Connection tools


Unique Network provides various blockchain connection tools in order to simplify the features implementation in your project.

Depending on the project characteristics and the development team capabilities, you can choose the most suitable tool for you: SDK, Substrate REST or Substrate Client.



Our SDK allows integrating all Unique Network features into your web3 application without interacting with low-level API. Using SDK, you can mint collections and tokens, manage account balance, etc. Technically, it is a REST add-on that allows you to use the same methods in a simplified form.

Substrate REST

You can use a proxy HTTP service (Substrate REST) to implement server logic. It is designed to interact with the blockchain using simple HTTP requests. In general, this package is pretty close to SDK, but it provides you with more freedom to work with extrinsic on your side, such as:

  1. Build an unsigned extrinsic.
  2. Sign and verify the extrinsic using service (these functions should be implemented on a client for safety).
  3. Submit the extrinsic.

With Substrate REST, you can use public or self-hosted endpoints, which provides some flexibility in project and security settings.

Substrate Client

Substrate Client is a JavaScript/TypeScript library that helps to interact with Unique Network directly. This approach is recommended only for experienced developers which have already worked with blockchains. This is the most low-level package that we provide.

Substrate Client was developed as an add-on of the Polkadot{.js} ApiPromiseopen in new window, extending it with simple methods to work with the Unique Network.

However, Substrate Client can also be used with any network based on the Substrate frameworkopen in new window - main modules (extrinsics, balance, query, sign, etc.) will work with them.

Substrate Client is a low-lower connection tool that is easier than the WSS connection, but it requires more development and infrastructure support than SDK or Substrate REST.

How to install



npm install @unique-nft/sdk
yarn add @unique-nft/sdk


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

In the baseUrl parameter, you must pass one of the paths to our networks:

Opal :

Quartz :

Unique :

Set a signer

To be able to sign extrinsics, you need to install the Accountsopen in new window package.

npm install @unique-nft/accounts
yarn add @unique-nft/accounts

Pass the signer in the parameters when creating the Client object.

import { KeyringProvider } from '@unique-nft/accounts/keyring';
import { KeyringOptions } from '@polkadot/keyring/types';
import Sdk, { Options } from "@unique-nft/sdk";

const options: KeyringOptions = {
  type: 'sr25519',
const provider = new KeyringProvider(options);
await provider.init();

const signer = provider.addSeed('<seed of account>');

const clientOptions: Options = {
  baseUrl: 'REST API URL',
const sdk = new Sdk(clientOptions);

Substrate REST


Choose install approach: Docker or Public endpoints.

docker run -p 3000:3000 -e CHAIN_WS_URL=wss:// uniquenetwork/web:latest

See the hub.docker.comopen in new window page for more details.

Public endpoints

You can use public endpoints for access Unique Web:

Opal :

Quartz :

Unique :

Environment variables

CHAIN_WS_URL (required)
// Opal
CHAIN_WS_URL = 'wss://'
// Quartz
CHAIN_WS_URL = 'wss://'
// Unique
CHAIN_WS_URL = 'wss://'
SIGNER_SEED (optional)

The SIGNER_SEED value is used for the signing the transactions.

// type mnemonic here
SIGNER_SEED = 'nest have have have brave have nest nest nest body have amazing'
Port (optional, default value is 3000)
PORT = 3000
IPFS Gateway (optional)
IPFS upload URL (optional)

IPFS_UPLOAD_URL allows you to specify a setting for uploading files via IPFS.

Cache manager (optional)

Extrinsics results cache time


To set up the Redis store to cache extrinsics

REDIS_HOST = 'localhost'
Prefix (optional)

PREFIX allows you to add a global prefix to API. By default, the prefix is empty.

Secondary endpoints

You can also use a secondary connection for substrate, which allows you to use secondary endpoints.

Substrate endpoints

// Unique
// Quartz

Secondary environment variables


// or


Substrate Client


npm install @unique-nft/substrate-client
yarn add @unique-nft/substrate-client


import { createSigner } from '@unique-nft/substrate-client/sign';
import { Client } from '@unique-nft/substrate-client';
import fetch from 'node-fetch';

(async () => {
  const client = await Client.create({
    chainWsUrl: 'wss://',
    signer: await createSigner({
      seed: '//Alice', // Signer seed phrase if you want to sign extrinsics
    erc721: { // enable this option to parse ERC721 tokens
      fetch: async (url: string) => {
        const response = await fetch(url);
        if (!response.ok) throw new Error(response.statusText);
        try {
          return await response.json();
        } catch (e) {
          return true;
      ipfsGateways: ['', ''],

Comparison of connection tools

Every connection tool has several advantages and disadvantages compared to each others.


As the most user-friendly tool, the SDK has no obvious disadvantages compared to other tools.

It is a very small package (58 kB only)
There is no need to use the WSS connection, that means no connection delay
The highest possible level of backward compatibility
No need for infrastructure support (in the case of using public endpoints)
No need to implement the transaction signature logic

Substrate REST

This package can be used with any programming language (SDK and Substrate Client are available only for specific platforms)Substrate REST provides fewer use cases than Substrate Client
Using public endpoints allows you to use public IPFS nodesUnlike SDK, Substrate REST supposes that you have your own infrastructure
Using private endpoints allows you to increase the level of security for transaction signing and to use your IPFS nodesPublic endpoints don't allow you to implement safe transaction signing without JS (it is compatible only with browsers)
Private endpoints don't allow you to use public IPFS and require that you build transaction signing logic in your project

Substrate client

Compared to Substrate REST, Substrate Client already contains all the dependenciesNew features are implemented in this package later, then in Substrate REST
The package contains all core blockchain features and methodsRelatively large package (0,5 MB), which could be critical for browser applications
Contains verification of the sufficiency of funds in the account for a specific transaction or confirmation of ownership of the transferred tokenDoesn't contain IPFS, which means you have to upload images on your own
Releases come out more often, but have less backward compatibility
Contains an inner WSS connection, which means that connection delays could occur