@ocap/sdk 1.6.5 → 1.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/index.d.ts +1015 -735
- package/lib/sdk.js +1 -1
- package/package.json +22 -21
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/prettier/prettier)
|
|
4
4
|
[](https://docs.arcblock.io)
|
|
5
|
-
[](https://gitter.im/ArcBlock/community?utm_source=badge
|
|
5
|
+
[](https://gitter.im/ArcBlock/community?utm_source=badge\&utm_medium=badge\&utm_campaign=pr-badge)
|
|
6
6
|
|
|
7
7
|
> Forge Javascript SDK packages all in one
|
|
8
8
|
|
|
@@ -39,7 +39,7 @@ const OcapSDK = require('@ocap/sdk');
|
|
|
39
39
|
|
|
40
40
|
// Connect to multi endpoints
|
|
41
41
|
OcapSDK.connect('https://test.abtnetwork.io/api', { name: 'test' });
|
|
42
|
-
OcapSDK.connect('https://
|
|
42
|
+
OcapSDK.connect('https://beta.abtnetwork.io/api', { name: 'beta' });
|
|
43
43
|
|
|
44
44
|
const sender = OcapSDK.Wallet.fromRandom();
|
|
45
45
|
const receiver = OcapSDK.Wallet.fromRandom();
|
|
@@ -48,15 +48,14 @@ const receiver = OcapSDK.Wallet.fromRandom();
|
|
|
48
48
|
await OcapSDK.declare({ moniker: 'sender', wallet: sender }, { conn: 'test' }).then(console.log);
|
|
49
49
|
await OcapSDK.declare({ moniker: 'receiver', wallet: receiver }, { conn: 'test' }).then(console.log);
|
|
50
50
|
|
|
51
|
-
// Get
|
|
52
|
-
OcapSDK.getChainInfo({ conn: '
|
|
51
|
+
// Get beta chain info
|
|
52
|
+
OcapSDK.getChainInfo({ conn: 'beta' }).then(console.log);
|
|
53
53
|
|
|
54
54
|
// Get local chain info
|
|
55
55
|
OcapSDK.getChainInfo({ conn: 'local' }).then(console.log);
|
|
56
56
|
|
|
57
57
|
// Poke and transfer on test chain
|
|
58
|
-
await OcapSDK.
|
|
59
|
-
await OcapSDK.transfer({ to: receiver.toAddress(), token: 1, wallet: sender }, { conn: 'test' }).then(console.log);
|
|
58
|
+
await OcapSDK.transfer({ to: receiver.address, token: 1, wallet: sender }, { conn: 'test' }).then(console.log);
|
|
60
59
|
```
|
|
61
60
|
|
|
62
61
|
### ES6
|