@exodus/wallet-accounts
This feature offers a CRUD interface for wallet accounts, also known as portfolios from an end-user perspective.
Install
npm i @exodus/wallet-accounts
Usage
This feature is designed to be used together with @exodus/headless
. See using the sdk.
Play with it
- Open the playground
- Try out some methods via the UI. These correspond 1:1 with the
exodus.walletAccounts
API. - Run
await exodus.walletAccounts.getEnabled()
in the Dev Tools Console.
API Side
See using the sdk for more details on how features plug into the SDK and the API interface in the type declaration .
await exodus.walletAccounts.create({ source: WalletAccount.EXODUS_SRC });
const { exodus_1: created } = await exodus.walletAccounts.getEnabled();
await exodus.walletAccounts.disable(created.toString());
await exodus.walletAccounts.enable(created.toString());
If you’re building a feature that requires readonly access to wallet accounts, add a dependency on walletAccountsAtom
. See legos for more information on how atoms work.
UI Side
See using the sdk for more details on basic UI-side setup.
Example: active selector
import { selectors } from '~/ui/flux';
const MyComponent = () => {
const activeWalletAccount = useSelector(selectors.walletAccounts.active);
// ...
};
Last updated on