This feature offers a CRUD interface for wallet accounts, also known as portfolios from an end-user perspective.
yarn add @exodus/wallet-accounts
This feature is designed to be used together with @exodus/headless
. See using the sdk.
- Open the playground https://exodus-hydra.pages.dev/features/wallet-accounts
- 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.
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.
See using the sdk for more details on basic UI-side setup.
import { selectors } from '~/ui/flux'
const MyComponent = () => {
// selector definition https://github.com/ExodusMovement/exodus-hydra/blob/c0854e3fcce3d3d3d666f33b814430105225e97d/features/wallet-accounts/redux/selectors/active.js
const activeWalletAccount = useSelector(selectors.walletAccounts.active)
// ...
}