(address: string)
| 1643 | |
| 1644 | // This should be used instead of directly calling PreferencesController.setSelectedAddress or AccountsController.setSelectedAccount |
| 1645 | setSelectedAccount(address: string) { |
| 1646 | const { AccountsController, PreferencesController } = this.context; |
| 1647 | const account = AccountsController.getAccountByAddress(address); |
| 1648 | if (account) { |
| 1649 | AccountsController.setSelectedAccount(account.id); |
| 1650 | PreferencesController.setSelectedAddress(address); |
| 1651 | } else { |
| 1652 | throw new Error(`No account found for address: ${address}`); |
| 1653 | } |
| 1654 | } |
| 1655 | |
| 1656 | /** |
| 1657 | * This should be used instead of directly calling PreferencesController.setAccountLabel or AccountsController.setAccountName in order to keep the names in sync |
no outgoing calls
no test coverage detected