@@ -12,7 +12,7 @@ yarn add @unique-nft/api
1212npm install @unique-nft/api
1313```
1414
15- Since this project rely on BigInt, there may be needed additional bundler settings.
15+ Since this project requires BigInt support there may be needed some additional bundler settings.
1616
1717For Vite there may be useful to set esbuild target to es2020 at least, example of ` vite.config.ts ` :
1818
@@ -83,9 +83,9 @@ Transaction may be signed with keyring as well as with an account from the polka
8383With keyring (available in both browser and Node.js):
8484
8585``` typescript
86- import {Substrate , substrateTools } from ' @unique-nft/api'
86+ import {Substrate , substrateTools , WS_RPC } from ' @unique-nft/api'
8787
88- const chain = new Substrate .Unique ().connect (' wss://... ' )
88+ const chain = new Substrate .Unique ().connect (WS_RPC . quartz )
8989
9090const keyring = substrateTools .signerTools .fromSeed (' electric suit...' )
9191
@@ -95,10 +95,10 @@ const result = await chain.transferCoins({...}).signAndSend(keyring)
9595With the polkadot extension (available in browser only):
9696
9797``` typescript
98- import {Substrate , polkadotExtensionTools } from ' @unique-nft/api'
98+ import {Substrate , polkadotExtensionTools , WS_RPC } from ' @unique-nft/api'
9999
100- const quartz = new Substrate .Unique ().connect (' wss://quartz.unique.network ' )
101- const kusama = new Substrate .Common ().connect (' wss://kusama-rpc.polkadot.io ' )
100+ const quartz = new Substrate .Unique ().connect (WS_RPC . quartz )
101+ const kusama = new Substrate .Common ().connect (WS_RPC . kusama )
102102
103103const accounts = await polkadotExtensionTools .getAllAccounts ()
104104const account = accounts .find (account => account .address === ' 5...' )
@@ -116,15 +116,15 @@ Substrate class provide methods which take transaction parameters and return Tra
116116Example:
117117
118118``` typescript
119- const result = await chain
119+ const result = await quartz
120120 .transferCoins ({toAddress: ' 5...' , amountInWei: 1n })
121121 .signAndSend (keyringOrAccount )
122122```
123123
124124More verbose example:
125125
126126``` typescript
127- const tx = chain .transferCoins ({toAddress: ' 5...' , amountInWei: 1n })
127+ const tx = quartz .transferCoins ({toAddress: ' 5...' , amountInWei: 1n })
128128await tx .sign (keyringOrAccount )
129129console .log (tx .getRawTx ().toJSON ())
130130const result = await tx .send ()
0 commit comments