@unique-nft/rpc-client
v0.0.4
Published
RPC client for unique network
Downloads
6
Keywords
Readme
unique-rpc-client
ALPHA - The purpose and content of the package may change dramatically without notice. Use at your own risk
Installation
Install the package using npm:
npm i -S @unique-nft/rpc-client
Usage
import rpcClient
import { rpcClient } from "@unique-nft/rpc-client"
Add settings object in format:
const settings = {
"blockchain": {
"escrowAddress": "5DymvaYC4QNyA2KSR1kzaa44YhiPLWgD71ymgT8pSujzpnsg",
"unique": {
"wsEndpoint": "wss://quartz.unique.network",
"collectionIds": [
5
],
"contractAddress": "0x3C87F245628FB443f63DccF38D4e18F921A3c2e2"
},
"kusama": {
"wsEndpoint": "wss://ws-relay-opal.unique.network",
"marketCommission": "10"
}
},
"auction": {
"commission": 10,
"address": "yGEeaYLrnw8aiTFj5QZAmwWRKu6QdxUkaASLCQznuZX2Lyj7q"
}
};
Use rpcCLint:
(
async () => {
await rpcClient.initialize(settings)
const token = await rpcClient.nftController?.getToken(2, 2)
console.log(`token: ${JSON.stringify(token)}`)
}
)()