OwnerChip Blockchain SDK is simplified interface to interact with the multi-chain blockchain layer of OwnerChip solutions without prior knowledge of the smart-contracts.
First, add the package to your package.json and install it.
You can then import it wherever needed:
import {OcBlockchainSdk} from '@ownerchip/blockchain-sdk';
Optionally, you can initialize the SDK with different parameters. Otherwise, the default multi-chain configuration will be used. The default config parameters can be found here.
import type {OcBlockchainSdkParameters} from '@ownerchip/blockchain-sdk';
const myParams: OcBlockchainSdkParameters = { ... };
const ocBlockchainSdk = new OcBlockchainSdk(
params: myParams
)
Once initialized, the SDK can be used to retrieve data like this:
ocBlockchainSdk.getCollectionOfTokenId("0x...")
To install and use this npm package from source, run the following command (it generates types from smart contract ABIs automatically)
npm i
npm run build:prod