Client
Table of Contents
About Client package
The @unique-nft/client package implements the SDK methods via the REST API. The package implements all the basic methods for working with the SDK:
- collection creating;
- token minting and transferring;
- balance transferring
- etc.
The package is under construction. Check the SDK package methods list to learn more about the methods, that will be implemented in the @unique-nft/client package.
Installation
npm
npm i @unique-nft/client
Initialization
Node.js
import { Client, Options, AllBalancesResponse, ExtrinsicResultResponse, BalanceTransferParsed } from ‘@unique-nft/client’;
const options: Options = {
baseUrl: ‘url for rest api’
};
const client = new Client(options);
Method call examples
const balanceResponse: AllBalancesResponse = await client.balance.get(
{
address: ‘your address’,
});
const transferResult: ExtrinsicResultResponse<BalanceTransferParsed> = await client.balance.transfer.submitWaitResult(
{
address: ‘address from’,
destination: ‘address to’,
amount: 0.001,
});