Handles unified access to public keys from software and different hardware wallets.
flowchart TD
A[Consumer] --> |getPublicKey| B
B[PublicKeyProvider] --> C{Wallet\nSource}
C -->|Hardware| E[publicKeyStore.get]
C -->|Seed| F[keychain.exportKey]
yarn add @exodus/public-key-provider
This feature is designed to be used together with @exodus/headless
. See using the sdk.
- Open the playground https://exodus-hydra.pages.dev/features/public-key-provider
- Try out the some methods via the UI. These corresponds 1:1 with the
exodus.publicKeyProvider
API. - Run the below in the Dev Tools Console:
await exodus.publicKeyProvider.getPublicKey({
walletAccount: 'exodus_0',
keyIdentifier: {
derivationAlgorithm: 'BIP32',
derivationPath: "m/44'/0'/0'/0/0",
keyType: 'secp256k1',
},
})
See using the sdk for more details on how features plug into the SDK and the API interface in the type declaration.
const publicKey = await exodus.publicKeyProvider.getPublicKey({
walletAccount: 'exodus_0',
keyIdentifier,
})
const xpub = await exodus.publicKeyProvider.getExtendedPublicKey({
walletAccount: 'exodus_0',
keyIdentifier,
})