MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / setAccountLabel

Method setAccountLabel

app/core/Engine.ts:1661–1669  ·  view source on GitHub ↗

* This should be used instead of directly calling PreferencesController.setAccountLabel or AccountsController.setAccountName in order to keep the names in sync * We are currently incrementally migrating the accounts data to the AccountsController so we must keep these values * in sync until th

(address: string, label: string)

Source from the content-addressed store, hash-verified

1659 * in sync until the migration is complete.
1660 */
1661 setAccountLabel(address: string, label: string) {
1662 const { AccountsController, PreferencesController } = this.context;
1663 const accountToBeNamed = AccountsController.getAccountByAddress(address);
1664 if (accountToBeNamed === undefined) {
1665 throw new Error(`No account found for address: ${address}`);
1666 }
1667 AccountsController.setAccountName(accountToBeNamed.id, label);
1668 PreferencesController.setAccountLabel(address, label);
1669 }
1670}
1671
1672/**

Callers 3

saveAccountNameFunction · 0.80
index.jsFile · 0.80
Engine.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected