classic-ui/modules/account/store/actions/saveAccount.js

20 lines
421 B
JavaScript
Raw Permalink Normal View History

2022-04-22 13:05:56 +10:00
export function saveAccount({ dispatch, rootState }, { account, address, backup }) {
const { ethAccount } = rootState.metamask
dispatch('createMutation', {
type: 'SET_ENCRYPTED_ACCOUNT',
payload: account
})
dispatch('createMutation', {
type: 'SET_ADDRESSES',
payload: {
addresses: {
encrypt: address,
backup: backup || '-',
connect: ethAccount
}
}
})
}