The Blockchain Data SDK provides a set of wrapper functions for interacting with the Immutable Blockchain Data APIs. It provides a simple and easy-to-use interface for querying blockchain data, such as assets, orders, and trades.
Read more about the Blockchain Data APIs in our docs here.
You can find an example usage of this package in the example set up here
To install this package, run the following command:
npm add @imtbl/blockchain-data
# or
pnpm add @imtbl/blockchain-data
# or
yarn add @imtbl/blockchain-data
This package is also included within the @imtbl/sdk
NPM package and can be re-exported directly from there.
If your environment supports conditional exports, you can import the contents of this package directly from the @imtbl/sdk
package using the @imtbl/sdk/blockchain_data
import path like so:
import { APIError, BlockchainData } from '@imtbl/sdk/blockchain_data';
This is the recommended way of consuming this package, as it allows for better tree-shaking and smaller bundle sizes.
If your environment does not support conditional exports, you will need to import the contents of this package directly from the @imtbl/sdk
package like so:
import { blockchainData } from '@imtbl/sdk';
const { APIError, BlockchainData } = blockchainData;
However this method will result in a larger bundle size as the entire @imtbl/blockchain-data
package will be included in your bundle.