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

20 lines
421 B
JavaScript
Raw Permalink Normal View History

2022-04-22 06:05:56 +03: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
}
}
})
}