Manages access to and persistence of blockchain metadata, specifically transaction history and account state.
npm install @exodus/blockchain-metadata@exodus/blockchain-metadataThis feature stores and manages transaction logs as well as account states of wallet accounts in a central location.
``sh`
yarn add @exodus/blockchain-metadata
This feature is designed to be used together with @exodus/headless. See using the sdk.
See using the sdk for more details on how features plug into the SDK and the API interface in the type declaration.
If you're building a feature that needs to write transaction logs or account states you can also use the batching feature of blockchain-metadata, which will only emit once after all updates are processed. Depend on the blockchainMetadata node and use the batch method to queue up updates:
`ts``
await blockchainMetadata
.batch()
.updateAccountState({
assetName: 'bitcoin',
walletAccount: 'exodus_0',
newData: { cursor: 'some cursor' },
})
.updateAccountState({
assetName: 'ethereum',
walletAccount: 'exodus_0',
newData: { cursor: 'some cursor' },
})
.updateTxs({
assetName: 'ethereum',
walletAccount: 'exodus_0',
txs: [{ id: '123', confirmations: 42 }],
})
.commit()