0.7.4 • Published 16 days ago

@unique-nft/sdk v0.7.4

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

polkadotjs uniquenetwork language license GitHub Release Date GitHub stability-alpha

Client

Table of Contents

About Client package

The @unique-nft/sdk 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/sdk package.

Installation

npm

npm install @unique-nft/sdk

unpkg.com

<script src="https://unpkg.com/@unique-nft/sdk/bundles/index.js"></script>
<script src="https://unpkg.com/@unique-nft/sdk/bundles/evm.js"></script>
<script src="https://unpkg.com/@unique-nft/sdk/bundles/full.js"></script>
<script src="https://unpkg.com/@unique-nft/sdk/bundles/subscriptions.js"></script>

Initialization

Node.js

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 the Unique Network

Opal

https://rest.unique.network/opal/v1

Quartz

https://rest.unique.network/quartz/v1

Unique

https://rest.unique.network/unique/v1

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 { Sdk } 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 = {
  baseUrl: 'REST API URL',
  signer
};
const sdk = new Sdk(clientOptions);

Method call examples

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

16 days ago

0.7.3

1 month ago

0.7.2

2 months ago

0.7.1

2 months ago

0.7.0

2 months ago

0.6.2

3 months ago

0.6.1

4 months ago

0.6.0

4 months ago

0.2.23

7 months ago

0.2.22

7 months ago

0.2.21

8 months ago

0.2.20

9 months ago

0.2.19

10 months ago

0.3.0

6 months ago

0.2.17

11 months ago

0.2.16

12 months ago

0.2.15

12 months ago

0.2.14

12 months ago

0.2.13

12 months ago

0.2.12

12 months ago

0.2.11

12 months ago

0.2.10

1 year ago

0.2.7

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.1

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.1.13

1 year ago

0.2.0

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.2

2 years ago

0.1.7

2 years ago

0.1.4

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.5.9

2 years ago

1.0.0

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.4.33

2 years ago

0.4.31

2 years ago

0.4.32

2 years ago

0.4.30

2 years ago

0.4.28

2 years ago

0.4.29

2 years ago

0.4.26

2 years ago

0.4.27

2 years ago

0.4.24

2 years ago

0.4.25

2 years ago

0.4.22

2 years ago

0.4.23

2 years ago

0.4.20

2 years ago

0.4.21

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.3.17

2 years ago

0.4.19

2 years ago

0.4.10

2 years ago

0.4.17

2 years ago

0.4.18

2 years ago

0.4.15

2 years ago

0.4.16

2 years ago

0.4.13

2 years ago

0.4.14

2 years ago

0.4.11

2 years ago

0.4.12

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.7

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.16

2 years ago

0.3.15

2 years ago

0.3.14

2 years ago

0.3.9

2 years ago

0.3.13

2 years ago

0.3.12

2 years ago

0.3.10

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.2

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.2.0-rc2

2 years ago

0.2.0-rc

2 years ago

0.2.0-rc1

2 years ago

0.1.3

2 years ago