Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@unique-nft/sdk

Package Overview
Dependencies
Maintainers
7
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unique-nft/sdk

The @unique-nft/sdk package implements the SDK methods via the REST API. The package implements all the basic methods for working with the Unique Network SDK.

  • 1.0.0
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
476
increased by10.96%
Maintainers
7
Weekly downloads
 
Created
Source
Unique Network

polkadotjs uniquenetwork language license GitHub Release Date GitHub stability-alpha

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:

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 install @unique-nft/client

Initialization

Node.js

import { Client, Options } from '@unique-nft/client';
const options: Options = {
    baseUrl: '<REST API URL>'
};
const client = new Client(options);

In the baseUrl parameter, you must pass one of the paths to the Unique Network

Opal
https://rest.unique.network/opal
Quartz
https://rest.unique.network/quartz
Unique
https://rest.unique.network/unique

Set a signer

To be able to sign extrinsics, you need to install the Accounts package

npm install @unique-nft/accounts

Pass the singer in the parameters when creating the Client object

import { KeyringOptions } from "@polkadot/keyring/types";
import { KeyringProvider } from '@unique-nft/accounts/keyring';
import { Client } from "@unique-nft/client";

const options: KeyringOptions = {
  type: 'sr25519',
};
const provider = new KeyringProvider(options);
await provider.init();
const account = provider.addSeed('<seed of account>');
const signer = account.getSigner();

const clientOptions = {
  baseUrl: 'REST API URL',
  signer
};
const client = new Client(clientOptions);

Method call examples

const balanceResponse = await client.balance.get({ address: '<address>' });
const { parsed } = await client.balance.transfer.submitWaitResult(
  {
    address: '<address from>',
    destination: '<address to>',
    amount: 0.01
  });

Keywords

FAQs

Package last updated on 12 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc