MoneyAccountController Actions
6 actions registered.
| Name | Deprecated |
|---|---|
clearState | |
createMoneyAccount | |
getMoneyAccount | |
getState | |
init | |
setDefaultMoneyAccount |
MoneyAccountController:clearState
Package: @metamask/money-account-controller
Resets the controller state to its default, removing all money accounts.
Intended for use during a full app reset (e.g. when the user wipes all wallet data). Does not interact with the keyring.
Handler signature:
() => void
MoneyAccountController:createMoneyAccount
Package: @metamask/money-account-controller
Creates a money account. If an account already exists for the given source, it is returned as-is (idempotent).
NOTE: Creating an MPC-backed account may trigger the MPC setup, which can be long-running and require interactive authentication.
Parameters:
| Name | Description |
|---|---|
params | The parameters for creating the money account. |
Returns: The money account.
Handler signature:
(params: CreateMoneyAccountParams) => Promise<MoneyAccount>
MoneyAccountController:getMoneyAccount
Package: @metamask/money-account-controller
Gets a money account by id, by entropy source, the MPC-backed one, or the default one when no selector is provided.
Parameters:
| Name | Description |
|---|---|
selector | Selector for getting the money account. |
Returns: The money account, or undefined if none matches.
Handler signature:
(selector?: GetMoneyAccountSelector) => MoneyAccount | undefined
MoneyAccountController:getState
Package: @metamask/money-account-controller
Handler signature:
() => MoneyAccountControllerState
MoneyAccountController:init
Package: @metamask/money-account-controller
Initializes the controller by creating a money account for the primary entropy source if one does not already exist, and by setting that account as the default if no default is set.
Handler signature:
() => Promise<void>
MoneyAccountController:setDefaultMoneyAccount
Package: @metamask/money-account-controller
Sets the default money account.
Parameters:
| Name | Description |
|---|---|
id | The id of the money account to use as the default. |
Handler signature:
(id: MoneyAccount['id']) => void