0.0.4 • Published 2 years ago

@unique-nft/rpc-client v0.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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)}`)
    }
)()