@exodus/wallet-accounts
TypeScript icon, indicating that this package has built-in type declarations

17.5.1 • Public • Published

@exodus/wallet-accounts

This feature offers a CRUD interface for wallet accounts, also known as portfolios from an end-user perspective.

Install

yarn add @exodus/wallet-accounts

Usage

This feature is designed to be used together with @exodus/headless. See using the sdk.

Play with it

  1. Open the playground https://exodus-hydra.pages.dev/features/wallet-accounts
  2. Try out some methods via the UI. These correspond 1:1 with the exodus.walletAccounts API.
  3. 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.

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)
  // ...
}

Readme

Keywords

none

Package Sidebar

Install

npm i @exodus/wallet-accounts

Weekly Downloads

3,359

Version

17.5.1

License

MIT

Unpacked Size

102 kB

Total Files

56

Last publish

Collaborators

  • joshuabot