@exodus/blockchain-metadata
This feature stores and manages transaction logs as well as account states of wallet accounts in a central location.
Install
npm i @exodus/blockchain-metadataUsage
This feature is designed to be used together with @exodus/headless. See using the sdk.
API Side
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:
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();