Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@exodus/address-provider

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/address-provider

Address provider for deriving and tracking used and unused addresses.

  • 12.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1K
increased by68.32%
Maintainers
0
Weekly downloads
 
Created
Source

@exodus/address-provider

This module derives addresses for assets from different wallet accounts. Addresses for software wallet accounts are encoded public keys that are derived from the seed using Keychain, whereas hardware wallet accounts use the public keys stored in the public-key-store.

flowchart LR
    A[AddressProvider] --> B[PublicKeyProvider]
    B -->|software| D[Keychain]
    B -->|hardware| E[PublicKeyStore]

Install

yarn add @exodus/address-provider

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/address-provider
  2. Try out some methods via the UI. These correspond 1:1 with the exodus.addressProvider API.
  3. Run await exodus.addressProvider.getReceiveAddress({ walletAccount: 'exodus_0', assetName: 'bitcoin' }) 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.

const address = await exodus.addressProvider.getAddress({
  purpose: 44,
  assetName: 'bitcoin',
  walletAccount: 'exodus_0',
  chainIndex: 0,
  addressIndex: 0,
})

const receiveAddress = await exodus.addressProvider.getReceiveAddress({
  assetName: 'bitcoin',
  walletAccount: 'exodus_0',
})

const unusedReceiveAddress = await exodus.addressProvider.getReceiveAddress({
  assetName: 'bitcoin',
  walletAccount: 'exodus_0',
  multiAddressMode: true,
})

If you're building a feature that requires the wallet's addresses, add a dependency on the addressProvider module, which provides almost the same API as the external exodus.addressProvider API (caveat: the module expects WalletAccount instances, while the API expects WalletAccount names like 'exodus_0').

UI Side

See using the sdk for more details on basic UI-side setup.

import exodus from '~/ui/exodus'

const MyComponent = () => {
  const { loading, value: receiveAddress } = useAsync(
    exodus.addressProvider.getReceiveAddress({ walletAccount: 'exodus_0', assetName: 'bitcoin' })
  )

  return loading ? <Text>Loading...</Text> : <Text>Your address: {receiveAddress}</Text>
}

FAQs

Package last updated on 03 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc