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

@unique-nft/client

Package Overview
Dependencies
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unique-nft/client

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

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
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://web-opal.unique.network
Quartz
https://web-quartz.unique.network
Unique
https://web-unique.unique.network

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 { KeyringProvider } from '@unique-nft/accounts/keyring';
import { Client } from "@unique-nft/client";

const options = {
  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 22 Aug 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