quantum-coin-js-sdk 1.0.16 → 1.0.17
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 +20 -20
- package/example/package-lock.json +27 -19
- package/index.d.ts +701 -0
- package/index.js +10 -12
- package/package.json +3 -2
- package/wasm_exec.d.ts +0 -0
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Requires Node.js version v20.18.1 or higher
|
|
|
28
28
|
* [.blockDetails](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+blockDetails) : <code>BlockDetails</code>
|
|
29
29
|
* [.response](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+response) : <code>Object</code>
|
|
30
30
|
* [.requestId](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+requestId) : <code>string</code>
|
|
31
|
-
* [.err](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+err) : <code>
|
|
31
|
+
* [.err](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+err) : <code>Error</code>
|
|
32
32
|
* [~AccountDetails](#module_quantum-coin-js-sdk..AccountDetails)
|
|
33
33
|
* [.address](#module_quantum-coin-js-sdk..AccountDetails+address) : <code>string</code>
|
|
34
34
|
* [.balance](#module_quantum-coin-js-sdk..AccountDetails+balance) : <code>string</code>
|
|
@@ -39,7 +39,7 @@ Requires Node.js version v20.18.1 or higher
|
|
|
39
39
|
* [.accountDetails](#module_quantum-coin-js-sdk..AccountDetailsResult+accountDetails) : <code>AccountDetails</code>
|
|
40
40
|
* [.response](#module_quantum-coin-js-sdk..AccountDetailsResult+response) : <code>Object</code>
|
|
41
41
|
* [.requestId](#module_quantum-coin-js-sdk..AccountDetailsResult+requestId) : <code>string</code>
|
|
42
|
-
* [.err](#module_quantum-coin-js-sdk..AccountDetailsResult+err) : <code>
|
|
42
|
+
* [.err](#module_quantum-coin-js-sdk..AccountDetailsResult+err) : <code>Error</code>
|
|
43
43
|
* [~SignResult](#module_quantum-coin-js-sdk..SignResult)
|
|
44
44
|
* [.resultCode](#module_quantum-coin-js-sdk..SignResult+resultCode) : <code>number</code>
|
|
45
45
|
* [.txnHash](#module_quantum-coin-js-sdk..SignResult+txnHash) : <code>string</code>
|
|
@@ -49,7 +49,7 @@ Requires Node.js version v20.18.1 or higher
|
|
|
49
49
|
* [.txnHash](#module_quantum-coin-js-sdk..SendResult+txnHash) : <code>string</code>
|
|
50
50
|
* [.response](#module_quantum-coin-js-sdk..SendResult+response) : <code>Object</code>
|
|
51
51
|
* [.requestId](#module_quantum-coin-js-sdk..SendResult+requestId) : <code>string</code>
|
|
52
|
-
* [.err](#module_quantum-coin-js-sdk..SendResult+err) : <code>
|
|
52
|
+
* [.err](#module_quantum-coin-js-sdk..SendResult+err) : <code>Error</code>
|
|
53
53
|
* [~TransactionReceipt](#module_quantum-coin-js-sdk..TransactionReceipt)
|
|
54
54
|
* [.cumulativeGasUsed](#module_quantum-coin-js-sdk..TransactionReceipt+cumulativeGasUsed) : <code>string</code>
|
|
55
55
|
* [.effectiveGasPrice](#module_quantum-coin-js-sdk..TransactionReceipt+effectiveGasPrice) : <code>string</code>
|
|
@@ -74,7 +74,7 @@ Requires Node.js version v20.18.1 or higher
|
|
|
74
74
|
* [.transactionDetails](#module_quantum-coin-js-sdk..TransactionDetailsResult+transactionDetails) : <code>TransactionDetails</code>
|
|
75
75
|
* [.response](#module_quantum-coin-js-sdk..TransactionDetailsResult+response) : <code>Object</code>
|
|
76
76
|
* [.requestId](#module_quantum-coin-js-sdk..TransactionDetailsResult+requestId) : <code>string</code>
|
|
77
|
-
* [.err](#module_quantum-coin-js-sdk..TransactionDetailsResult+err) : <code>
|
|
77
|
+
* [.err](#module_quantum-coin-js-sdk..TransactionDetailsResult+err) : <code>Error</code>
|
|
78
78
|
* [~AccountTransactionCompact](#module_quantum-coin-js-sdk..AccountTransactionCompact)
|
|
79
79
|
* [.blockNumber](#module_quantum-coin-js-sdk..AccountTransactionCompact+blockNumber) : <code>number</code>
|
|
80
80
|
* [.from](#module_quantum-coin-js-sdk..AccountTransactionCompact+from) : <code>string</code>
|
|
@@ -90,7 +90,7 @@ Requires Node.js version v20.18.1 or higher
|
|
|
90
90
|
* [.listAccountTransactionsResponse](#module_quantum-coin-js-sdk..AccountTransactionsResult+listAccountTransactionsResponse) : <code>ListAccountTransactionsResponse</code>
|
|
91
91
|
* [.response](#module_quantum-coin-js-sdk..AccountTransactionsResult+response) : <code>Object</code>
|
|
92
92
|
* [.requestId](#module_quantum-coin-js-sdk..AccountTransactionsResult+requestId) : <code>string</code>
|
|
93
|
-
* [.err](#module_quantum-coin-js-sdk..AccountTransactionsResult+err) : <code>
|
|
93
|
+
* [.err](#module_quantum-coin-js-sdk..AccountTransactionsResult+err) : <code>Error</code>
|
|
94
94
|
* [~initialize(clientConfig)](#module_quantum-coin-js-sdk..initialize) ⇒ <code>Promise.<boolean></code>
|
|
95
95
|
* [~isAddressValid(address)](#module_quantum-coin-js-sdk..isAddressValid) ⇒ <code>boolean</code>
|
|
96
96
|
* [~newWallet()](#module_quantum-coin-js-sdk..newWallet) ⇒ <code>Wallet</code>
|
|
@@ -102,7 +102,7 @@ Requires Node.js version v20.18.1 or higher
|
|
|
102
102
|
* [~serializeWallet(wallet)](#module_quantum-coin-js-sdk..serializeWallet) ⇒ <code>string</code>
|
|
103
103
|
* [~deserializeWallet(walletJson)](#module_quantum-coin-js-sdk..deserializeWallet) ⇒ <code>Wallet</code>
|
|
104
104
|
* [~postTransaction(txnData)](#module_quantum-coin-js-sdk..postTransaction) ⇒ <code>Promise.<SendResult></code>
|
|
105
|
-
* [~getLatestBlockDetails()](#module_quantum-coin-js-sdk..getLatestBlockDetails) ⇒ <code>Promise.<
|
|
105
|
+
* [~getLatestBlockDetails()](#module_quantum-coin-js-sdk..getLatestBlockDetails) ⇒ <code>Promise.<LatestBlockDetailsResult></code>
|
|
106
106
|
* [~getAccountDetails(address)](#module_quantum-coin-js-sdk..getAccountDetails) ⇒ <code>Promise.<AccountDetailsResult></code>
|
|
107
107
|
* [~getTransactionDetails(txnHash)](#module_quantum-coin-js-sdk..getTransactionDetails) ⇒ <code>Promise.<TransactionDetailsResult></code>
|
|
108
108
|
* [~listAccountTransactions(address, pageNumber)](#module_quantum-coin-js-sdk..listAccountTransactions) ⇒ <code>Promise.<ListAccountTransactionsResponse></code>
|
|
@@ -197,8 +197,8 @@ Creates a Wallet class. The constructor does not verify the wallet. To verify a
|
|
|
197
197
|
| Param | Type | Description |
|
|
198
198
|
| --- | --- | --- |
|
|
199
199
|
| address | <code>string</code> | Address of the wallet |
|
|
200
|
-
| privateKey | <code>Array.<
|
|
201
|
-
| publicKey | <code>Array.<
|
|
200
|
+
| privateKey | <code>Array.<number></code> | Private Key byte array of the wallet |
|
|
201
|
+
| publicKey | <code>Array.<number></code> | The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324. |
|
|
202
202
|
|
|
203
203
|
<a name="module_quantum-coin-js-sdk..Wallet+address"></a>
|
|
204
204
|
|
|
@@ -248,7 +248,7 @@ This class represents a result from invoking the getLatestBlock function.
|
|
|
248
248
|
* [.blockDetails](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+blockDetails) : <code>BlockDetails</code>
|
|
249
249
|
* [.response](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+response) : <code>Object</code>
|
|
250
250
|
* [.requestId](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+requestId) : <code>string</code>
|
|
251
|
-
* [.err](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+err) : <code>
|
|
251
|
+
* [.err](#module_quantum-coin-js-sdk..LatestBlockDetailsResult+err) : <code>Error</code>
|
|
252
252
|
|
|
253
253
|
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult+resultCode"></a>
|
|
254
254
|
|
|
@@ -280,7 +280,7 @@ An unique id to represent the request. This can be null if request failed before
|
|
|
280
280
|
**Access**: public
|
|
281
281
|
<a name="module_quantum-coin-js-sdk..LatestBlockDetailsResult+err"></a>
|
|
282
282
|
|
|
283
|
-
#### latestBlockDetailsResult.err : <code>
|
|
283
|
+
#### latestBlockDetailsResult.err : <code>Error</code>
|
|
284
284
|
An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
285
285
|
|
|
286
286
|
**Kind**: instance property of [<code>LatestBlockDetailsResult</code>](#module_quantum-coin-js-sdk..LatestBlockDetailsResult)
|
|
@@ -340,7 +340,7 @@ This class represents a result from invoking the getAccountDetails function.
|
|
|
340
340
|
* [.accountDetails](#module_quantum-coin-js-sdk..AccountDetailsResult+accountDetails) : <code>AccountDetails</code>
|
|
341
341
|
* [.response](#module_quantum-coin-js-sdk..AccountDetailsResult+response) : <code>Object</code>
|
|
342
342
|
* [.requestId](#module_quantum-coin-js-sdk..AccountDetailsResult+requestId) : <code>string</code>
|
|
343
|
-
* [.err](#module_quantum-coin-js-sdk..AccountDetailsResult+err) : <code>
|
|
343
|
+
* [.err](#module_quantum-coin-js-sdk..AccountDetailsResult+err) : <code>Error</code>
|
|
344
344
|
|
|
345
345
|
<a name="module_quantum-coin-js-sdk..AccountDetailsResult+resultCode"></a>
|
|
346
346
|
|
|
@@ -372,7 +372,7 @@ An unique id to represent the request. This can be null if request failed before
|
|
|
372
372
|
**Access**: public
|
|
373
373
|
<a name="module_quantum-coin-js-sdk..AccountDetailsResult+err"></a>
|
|
374
374
|
|
|
375
|
-
#### accountDetailsResult.err : <code>
|
|
375
|
+
#### accountDetailsResult.err : <code>Error</code>
|
|
376
376
|
An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
377
377
|
|
|
378
378
|
**Kind**: instance property of [<code>AccountDetailsResult</code>](#module_quantum-coin-js-sdk..AccountDetailsResult)
|
|
@@ -424,7 +424,7 @@ This class represents a result from invoking the sendCoins function.
|
|
|
424
424
|
* [.txnHash](#module_quantum-coin-js-sdk..SendResult+txnHash) : <code>string</code>
|
|
425
425
|
* [.response](#module_quantum-coin-js-sdk..SendResult+response) : <code>Object</code>
|
|
426
426
|
* [.requestId](#module_quantum-coin-js-sdk..SendResult+requestId) : <code>string</code>
|
|
427
|
-
* [.err](#module_quantum-coin-js-sdk..SendResult+err) : <code>
|
|
427
|
+
* [.err](#module_quantum-coin-js-sdk..SendResult+err) : <code>Error</code>
|
|
428
428
|
|
|
429
429
|
<a name="module_quantum-coin-js-sdk..SendResult+resultCode"></a>
|
|
430
430
|
|
|
@@ -456,7 +456,7 @@ An unique id to represent the request. This can be null if request failed before
|
|
|
456
456
|
**Access**: public
|
|
457
457
|
<a name="module_quantum-coin-js-sdk..SendResult+err"></a>
|
|
458
458
|
|
|
459
|
-
#### sendResult.err : <code>
|
|
459
|
+
#### sendResult.err : <code>Error</code>
|
|
460
460
|
An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
461
461
|
|
|
462
462
|
**Kind**: instance property of [<code>SendResult</code>](#module_quantum-coin-js-sdk..SendResult)
|
|
@@ -630,7 +630,7 @@ This class represents a result from invoking the getTransactionDetails function.
|
|
|
630
630
|
* [.transactionDetails](#module_quantum-coin-js-sdk..TransactionDetailsResult+transactionDetails) : <code>TransactionDetails</code>
|
|
631
631
|
* [.response](#module_quantum-coin-js-sdk..TransactionDetailsResult+response) : <code>Object</code>
|
|
632
632
|
* [.requestId](#module_quantum-coin-js-sdk..TransactionDetailsResult+requestId) : <code>string</code>
|
|
633
|
-
* [.err](#module_quantum-coin-js-sdk..TransactionDetailsResult+err) : <code>
|
|
633
|
+
* [.err](#module_quantum-coin-js-sdk..TransactionDetailsResult+err) : <code>Error</code>
|
|
634
634
|
|
|
635
635
|
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult+resultCode"></a>
|
|
636
636
|
|
|
@@ -662,7 +662,7 @@ An unique id to represent the request. This can be null if request failed before
|
|
|
662
662
|
**Access**: public
|
|
663
663
|
<a name="module_quantum-coin-js-sdk..TransactionDetailsResult+err"></a>
|
|
664
664
|
|
|
665
|
-
#### transactionDetailsResult.err : <code>
|
|
665
|
+
#### transactionDetailsResult.err : <code>Error</code>
|
|
666
666
|
An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
667
667
|
|
|
668
668
|
**Kind**: instance property of [<code>TransactionDetailsResult</code>](#module_quantum-coin-js-sdk..TransactionDetailsResult)
|
|
@@ -764,7 +764,7 @@ This class represents a result from invoking the listAccountTransactionDetails f
|
|
|
764
764
|
* [.listAccountTransactionsResponse](#module_quantum-coin-js-sdk..AccountTransactionsResult+listAccountTransactionsResponse) : <code>ListAccountTransactionsResponse</code>
|
|
765
765
|
* [.response](#module_quantum-coin-js-sdk..AccountTransactionsResult+response) : <code>Object</code>
|
|
766
766
|
* [.requestId](#module_quantum-coin-js-sdk..AccountTransactionsResult+requestId) : <code>string</code>
|
|
767
|
-
* [.err](#module_quantum-coin-js-sdk..AccountTransactionsResult+err) : <code>
|
|
767
|
+
* [.err](#module_quantum-coin-js-sdk..AccountTransactionsResult+err) : <code>Error</code>
|
|
768
768
|
|
|
769
769
|
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult+resultCode"></a>
|
|
770
770
|
|
|
@@ -796,7 +796,7 @@ An unique id to represent the request. This can be null if request failed before
|
|
|
796
796
|
**Access**: public
|
|
797
797
|
<a name="module_quantum-coin-js-sdk..AccountTransactionsResult+err"></a>
|
|
798
798
|
|
|
799
|
-
#### accountTransactionsResult.err : <code>
|
|
799
|
+
#### accountTransactionsResult.err : <code>Error</code>
|
|
800
800
|
An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
801
801
|
|
|
802
802
|
**Kind**: instance property of [<code>AccountTransactionsResult</code>](#module_quantum-coin-js-sdk..AccountTransactionsResult)
|
|
@@ -927,11 +927,11 @@ The postTransaction function posts a signed transaction to the blockchain.
|
|
|
927
927
|
|
|
928
928
|
<a name="module_quantum-coin-js-sdk..getLatestBlockDetails"></a>
|
|
929
929
|
|
|
930
|
-
### quantum-coin-js-sdk~getLatestBlockDetails() ⇒ <code>Promise.<
|
|
930
|
+
### quantum-coin-js-sdk~getLatestBlockDetails() ⇒ <code>Promise.<LatestBlockDetailsResult></code>
|
|
931
931
|
The getLatestBlockDetails function returns details of the latest block of the blockchain.
|
|
932
932
|
|
|
933
933
|
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
934
|
-
**Returns**: <code>Promise.<
|
|
934
|
+
**Returns**: <code>Promise.<LatestBlockDetailsResult></code> - Returns a promise of an object of type BlockDetailsResult.
|
|
935
935
|
<a name="module_quantum-coin-js-sdk..getAccountDetails"></a>
|
|
936
936
|
|
|
937
937
|
### quantum-coin-js-sdk~getAccountDetails(address) ⇒ <code>Promise.<AccountDetailsResult></code>
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
"node_modules/@adraffy/ens-normalize": {
|
|
17
17
|
"version": "1.10.1",
|
|
18
18
|
"resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz",
|
|
19
|
-
"integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw=="
|
|
19
|
+
"integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==",
|
|
20
|
+
"license": "MIT"
|
|
20
21
|
},
|
|
21
22
|
"node_modules/@noble/curves": {
|
|
22
23
|
"version": "1.2.0",
|
|
23
24
|
"resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz",
|
|
24
25
|
"integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==",
|
|
26
|
+
"license": "MIT",
|
|
25
27
|
"dependencies": {
|
|
26
28
|
"@noble/hashes": "1.3.2"
|
|
27
29
|
},
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
"version": "1.3.2",
|
|
34
36
|
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz",
|
|
35
37
|
"integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==",
|
|
38
|
+
"license": "MIT",
|
|
36
39
|
"engines": {
|
|
37
40
|
"node": ">= 16"
|
|
38
41
|
},
|
|
@@ -44,6 +47,7 @@
|
|
|
44
47
|
"version": "22.7.5",
|
|
45
48
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz",
|
|
46
49
|
"integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==",
|
|
50
|
+
"license": "MIT",
|
|
47
51
|
"dependencies": {
|
|
48
52
|
"undici-types": "~6.19.2"
|
|
49
53
|
}
|
|
@@ -51,12 +55,13 @@
|
|
|
51
55
|
"node_modules/aes-js": {
|
|
52
56
|
"version": "4.0.0-beta.5",
|
|
53
57
|
"resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz",
|
|
54
|
-
"integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q=="
|
|
58
|
+
"integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==",
|
|
59
|
+
"license": "MIT"
|
|
55
60
|
},
|
|
56
61
|
"node_modules/ethers": {
|
|
57
|
-
"version": "6.
|
|
58
|
-
"resolved": "https://registry.npmjs.org/ethers/-/ethers-6.
|
|
59
|
-
"integrity": "sha512-
|
|
62
|
+
"version": "6.14.4",
|
|
63
|
+
"resolved": "https://registry.npmjs.org/ethers/-/ethers-6.14.4.tgz",
|
|
64
|
+
"integrity": "sha512-Jm/dzRs2Z9iBrT6e9TvGxyb5YVKAPLlpna7hjxH7KH/++DSh2T/JVmQUv7iHI5E55hDbp/gEVvstWYXVxXFzsA==",
|
|
60
65
|
"funding": [
|
|
61
66
|
{
|
|
62
67
|
"type": "individual",
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
"url": "https://www.buymeacoffee.com/ricmoo"
|
|
68
73
|
}
|
|
69
74
|
],
|
|
75
|
+
"license": "MIT",
|
|
70
76
|
"dependencies": {
|
|
71
77
|
"@adraffy/ens-normalize": "1.10.1",
|
|
72
78
|
"@noble/curves": "1.2.0",
|
|
@@ -81,12 +87,13 @@
|
|
|
81
87
|
}
|
|
82
88
|
},
|
|
83
89
|
"node_modules/quantum-coin-js-sdk": {
|
|
84
|
-
"version": "1.0.
|
|
85
|
-
"resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.
|
|
86
|
-
"integrity": "sha512-
|
|
90
|
+
"version": "1.0.16",
|
|
91
|
+
"resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.16.tgz",
|
|
92
|
+
"integrity": "sha512-g8wll8GqEmk1lm9t1UFJTs5NDmpr8PPsHfDtakfrcKdaJTk6FFK6GMTn9HOO7ZzuX1RkBe+lrvNQtRpIb6VdNg==",
|
|
87
93
|
"license": "MIT",
|
|
88
94
|
"dependencies": {
|
|
89
|
-
"quantum-coin-pqc-js-sdk": "^1.0.0"
|
|
95
|
+
"quantum-coin-pqc-js-sdk": "^1.0.0",
|
|
96
|
+
"seed-words": "^1.0.1"
|
|
90
97
|
}
|
|
91
98
|
},
|
|
92
99
|
"node_modules/quantum-coin-pqc-js-sdk": {
|
|
@@ -95,20 +102,29 @@
|
|
|
95
102
|
"integrity": "sha512-d837t+/wVt8SN6xp3RMAkHvClgrwo2VV254eIsz6do2HD1GmzXCH+vts9S4jILHo7wK0ro7SHRwzZLR9AEhOIw==",
|
|
96
103
|
"license": "MIT"
|
|
97
104
|
},
|
|
105
|
+
"node_modules/seed-words": {
|
|
106
|
+
"version": "1.0.1",
|
|
107
|
+
"resolved": "https://registry.npmjs.org/seed-words/-/seed-words-1.0.1.tgz",
|
|
108
|
+
"integrity": "sha512-wq9DqfEGXzvIdTatznyQo/9+SN8tM/FNV4H0sAPc6XcOSYdI3YhIL035OYwTld1m1Cn2vnMtNBQv1mBTaU1Qjg==",
|
|
109
|
+
"license": "MIT"
|
|
110
|
+
},
|
|
98
111
|
"node_modules/tslib": {
|
|
99
112
|
"version": "2.7.0",
|
|
100
113
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
|
|
101
|
-
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="
|
|
114
|
+
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==",
|
|
115
|
+
"license": "0BSD"
|
|
102
116
|
},
|
|
103
117
|
"node_modules/undici-types": {
|
|
104
118
|
"version": "6.19.8",
|
|
105
119
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
|
|
106
|
-
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="
|
|
120
|
+
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
|
121
|
+
"license": "MIT"
|
|
107
122
|
},
|
|
108
123
|
"node_modules/ws": {
|
|
109
124
|
"version": "8.17.1",
|
|
110
125
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
|
|
111
126
|
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
|
|
127
|
+
"license": "MIT",
|
|
112
128
|
"engines": {
|
|
113
129
|
"node": ">=10.0.0"
|
|
114
130
|
},
|
|
@@ -124,14 +140,6 @@
|
|
|
124
140
|
"optional": true
|
|
125
141
|
}
|
|
126
142
|
}
|
|
127
|
-
},
|
|
128
|
-
"quantum-coin-js-sdk": {
|
|
129
|
-
"version": "1.0.15",
|
|
130
|
-
"extraneous": true,
|
|
131
|
-
"license": "MIT",
|
|
132
|
-
"dependencies": {
|
|
133
|
-
"quantum-coin-pqc-js-sdk": "^1.0.0"
|
|
134
|
-
}
|
|
135
143
|
}
|
|
136
144
|
}
|
|
137
145
|
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The initialize function has to be called before attempting to invoke any other function. This function should be called only once.
|
|
3
|
+
*
|
|
4
|
+
* @async
|
|
5
|
+
* @function initialize
|
|
6
|
+
* @param {Config} clientConfig - A configuration represented by the Config class
|
|
7
|
+
* @return {Promise<boolean>} Returns a promise of type boolean; true if the initialization succeeded, else false.
|
|
8
|
+
*/
|
|
9
|
+
export function initialize(clientConfig: Config): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* The serializeWallet function serializes a Wallet object to a JSON string. You should encrypt the string before saving it to disk or a database.
|
|
12
|
+
*
|
|
13
|
+
* @function serializeWallet
|
|
14
|
+
* @param {Wallet} wallet - A Wallet object representing the wallet to serialize.
|
|
15
|
+
* @return {string} Returns the Wallet in JSON string format. If the wallet is invalid, null is returned.
|
|
16
|
+
*/
|
|
17
|
+
export function serializeWallet(wallet: Wallet): string;
|
|
18
|
+
/**
|
|
19
|
+
* The deserializeWallet function creates a Wallet object from a JSON string.
|
|
20
|
+
*
|
|
21
|
+
* @function deserializeWallet
|
|
22
|
+
* @param {string} walletJson - A Wallet object representing the wallet to deserialize.
|
|
23
|
+
* @return {Wallet} Returns the Wallet corresponding to the walletJson. If the wallet is invalid, null is returned.
|
|
24
|
+
*/
|
|
25
|
+
export function deserializeWallet(walletJson: string): Wallet;
|
|
26
|
+
/**
|
|
27
|
+
* The serializeEncryptedWallet function encrypts and serializes a Wallet object to a JSON string readable by the Desktop/Mobile/Web/CLI wallet applications. You can save this string to a file and open the file in one of these wallet applications. You may also open this string using the deserializeEncryptedWallet function. If you loose the passphrase, you will be unable to open the wallet. This function can take upto a minute or so to execute.
|
|
28
|
+
*
|
|
29
|
+
* @function serializeEncryptedWallet
|
|
30
|
+
* @param {Wallet} wallet - A Wallet object representing the wallet to serialize.
|
|
31
|
+
* @param {string} passphrase - A passphrase used to encrypt the wallet. It should atleast be 12 characters long.
|
|
32
|
+
* @return {string} Returns the Wallet in JSON string format. If the wallet is invalid, null is returned.
|
|
33
|
+
*/
|
|
34
|
+
export function serializeEncryptedWallet(wallet: Wallet, passphrase: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* The deserializeEncryptedWallet function opens a wallet backed-up using an application such as the Desktop/Mobile/CLI/Web wallet. This function can take upto a minute or so to execute. You should open wallets only from trusted sources.
|
|
37
|
+
*
|
|
38
|
+
* @function deserializeEncryptedWallet
|
|
39
|
+
* @param {string} walletJsonString - The json string from a wallet file.
|
|
40
|
+
* @param {string} passphrase - The passphrase used to encrypt the wallet.
|
|
41
|
+
* @return {Wallet} Returns a Wallet object. Returns null if opening the wallet fails.
|
|
42
|
+
*/
|
|
43
|
+
export function deserializeEncryptedWallet(walletJsonString: string, passphrase: string): Wallet;
|
|
44
|
+
/**
|
|
45
|
+
* The verifyWallet function verifies whether a Wallet is valid or not. To mitigate spoofing and other attachs, it is highly recommended to verify a wallet, especially if it is from an untrusted source.
|
|
46
|
+
*
|
|
47
|
+
* @function verifyWallet
|
|
48
|
+
* @param {Wallet} wallet - A Wallet object representing the wallet to verify.
|
|
49
|
+
* @return {boolean} Returns true if the Wallet verification succeeded, else returns false.
|
|
50
|
+
*/
|
|
51
|
+
export function verifyWallet(wallet: Wallet): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The newWallet function creates a new Wallet.
|
|
54
|
+
*
|
|
55
|
+
* @function newWallet
|
|
56
|
+
* @return {Wallet} Returns a Wallet object.
|
|
57
|
+
*/
|
|
58
|
+
export function newWallet(): Wallet;
|
|
59
|
+
/**
|
|
60
|
+
* The sendCoins function posts a send-coin transaction to the blockchain.
|
|
61
|
+
* Since the gas fee for sending coins is fixed at 1000 coins, there is no option to set the gas fee explicitly.
|
|
62
|
+
* It may take many seconds after submitting a transaction before the transaction is returned by the getTransactionDetails function.
|
|
63
|
+
* Transactions are usually committed in less than 30 seconds.
|
|
64
|
+
*
|
|
65
|
+
* @async
|
|
66
|
+
* @function sendCoins
|
|
67
|
+
* @param {Wallet} wallet - A Wallet object from which the transaction has to be sent. The address corresponding to the Wallet should have enough coins to cover gas fees as well. A minimum of 1000 coins (1000000000000000000000 wei) are required for gas fees.
|
|
68
|
+
* @param {string} toAddress - The address to which the coins should be sent.
|
|
69
|
+
* @param {string} coins - The string representing the number of coins (in ether) to send. To convert between ethers and wei, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei
|
|
70
|
+
* @param {number} nonce - The nonce of the account retrieved by invoking the getAccountDetails function. You have to carefully manage state of the nonce to avoid sending the coins multiple times, such as when retrying sendCoins after a network error.
|
|
71
|
+
* @return {Promise<SendResult>} Returns a promise of type SendResult.
|
|
72
|
+
*/
|
|
73
|
+
export function sendCoins(wallet: Wallet, toAddress: string, coins: string, nonce: number): Promise<SendResult>;
|
|
74
|
+
/**
|
|
75
|
+
* The getAccountDetails function returns details of an account corresponding to the address.
|
|
76
|
+
*
|
|
77
|
+
* @async
|
|
78
|
+
* @function getAccountDetails
|
|
79
|
+
* @param {string} address - The address of the account of which the details have to be retrieved.
|
|
80
|
+
* @return {Promise<AccountDetailsResult>} Returns a promise of type AccountDetailsResult.
|
|
81
|
+
*/
|
|
82
|
+
export function getAccountDetails(address: string): Promise<AccountDetailsResult>;
|
|
83
|
+
/**
|
|
84
|
+
* The getTransactionDetails function returns details of a transaction posted to the blockchain.
|
|
85
|
+
* Transactions may take a while to get registered in the blockchain. After a transaction is submitted, it may take a while before it is available for reading.
|
|
86
|
+
* Some transactions that have lower balance than the minimum required for gas fees may be discarded.
|
|
87
|
+
* In these cases, the transactions may not be returned when invoking the getTransactionDetails function.
|
|
88
|
+
* You should consider the transaction as succeeded only if the status field of the transactionReceipt object is 0x1 (success).
|
|
89
|
+
* The transactionReceipt field can be null unless the transaction is registered with the blockchain.
|
|
90
|
+
* @async
|
|
91
|
+
* @function getTransactionDetails
|
|
92
|
+
* @param {string} txnHash - The hash of the transaction to retrieve.
|
|
93
|
+
* @return {Promise<TransactionDetailsResult>} Returns a promise of type type TransactionDetailsResult.
|
|
94
|
+
*/
|
|
95
|
+
export function getTransactionDetails(txnHash: string): Promise<TransactionDetailsResult>;
|
|
96
|
+
/**
|
|
97
|
+
* The isAddressValid function validates whether an address is valid or not. An address is of length 66 characters including 0x.
|
|
98
|
+
*
|
|
99
|
+
* @function isAddressValid
|
|
100
|
+
* @param {string} address - A string representing the address to validate.
|
|
101
|
+
* @return {boolean} Returns true if the address validation succeeded, else returns false.
|
|
102
|
+
*/
|
|
103
|
+
export function isAddressValid(address: string): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The getLatestBlockDetails function returns details of the latest block of the blockchain.
|
|
106
|
+
*
|
|
107
|
+
* @async
|
|
108
|
+
* @function getLatestBlockDetails
|
|
109
|
+
* @return {Promise<LatestBlockDetailsResult>} Returns a promise of an object of type BlockDetailsResult.
|
|
110
|
+
*/
|
|
111
|
+
export function getLatestBlockDetails(): Promise<LatestBlockDetailsResult>;
|
|
112
|
+
/**
|
|
113
|
+
* The signSendCoinTransaction function returns a signed transaction.
|
|
114
|
+
* Since the gas fee for sending coins is fixed at 1000 coins, there is no option to set the gas fee explicitly.
|
|
115
|
+
* This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then use the postTransaction function to post it on a connected device.
|
|
116
|
+
* Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally submit the transaction by calling the postTransaction function.
|
|
117
|
+
*
|
|
118
|
+
* @function signSendCoinTransaction
|
|
119
|
+
* @param {Wallet} wallet - A Wallet object from which the transaction has to be sent. The address corresponding to the Wallet should have enough coins to cover gas fees as well. A minimum of 1000 coins (1000000000000000000000 wei) are required for gas fees.
|
|
120
|
+
* @param {string} toAddress - The address to which the coins should be sent.
|
|
121
|
+
* @param {string} coins - The string representing the number of coins (in ether) to send. To convert between ethers and wei, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei
|
|
122
|
+
* @param {number} nonce - The nonce of the account retrieved by invoking the getAccountDetails function. You have to carefully manage state of the nonce to avoid sending the coins multiple times, such as when retrying sendCoins after a network error.
|
|
123
|
+
* @return {SignResult} Returns a promise of type SignResult.
|
|
124
|
+
*/
|
|
125
|
+
export function signSendCoinTransaction(wallet: Wallet, toAddress: string, coins: string, nonce: number): SignResult;
|
|
126
|
+
/**
|
|
127
|
+
* The listAccountTransactions function returns a list of transactions for a specific account.
|
|
128
|
+
* Transactions may take a while to get registered in the blockchain. After a transaction is submitted, it may take a while before it is available for listing.
|
|
129
|
+
* Some transactions that have lower balance than the minimum required for gas fees may be discarded.
|
|
130
|
+
* In these cases, the transactions may not be returned when invoking the listAccountTransactions function.
|
|
131
|
+
* You should consider the transaction as succeeded only if the status field AccountDetailsCompact object is 0x1 (success).
|
|
132
|
+
* Both transactions from and transactions to the address will be returned in the list.
|
|
133
|
+
* Use the getTransactionDetails function, passing the hash of the transaction to get detailed information about the transaction.
|
|
134
|
+
* @async
|
|
135
|
+
* @function listAccountTransactions
|
|
136
|
+
* @param {string} address - The address for which the transactions have to be listed.
|
|
137
|
+
* @param {number} pageNumber - The page number for which the transactions has to be listed for the account. Pass 0 to list the latest page. Pass 1 to list the oldest page. A maximum of 20 transactions are returned in each page. The response of this API includes a field that shows the pageCount (total number of pages available). You can pass any number between 1 to pageCount to get the corresponding page.
|
|
138
|
+
* @return {Promise<ListAccountTransactionsResponse>} Returns a promise of type type ListAccountTransactionsResponse.
|
|
139
|
+
*/
|
|
140
|
+
export function listAccountTransactions(address: string, pageNumber: number): Promise<ListAccountTransactionsResponse>;
|
|
141
|
+
/**
|
|
142
|
+
* The postTransaction function posts a signed transaction to the blockchain.
|
|
143
|
+
* This method can be used in conjunction with the signSendCoinTransaction method to submit a transaction that was signed using a cold wallet (offline or disconnected or air-gapped wallet).
|
|
144
|
+
*
|
|
145
|
+
* @async
|
|
146
|
+
* @function postTransaction
|
|
147
|
+
* @param {string} txnData - A signed transaction string returned by the signSendCoinTransaction function.
|
|
148
|
+
* @return {Promise<SendResult>} Returns a promise of type SendResult. txnHash will be null in SendResult.
|
|
149
|
+
*/
|
|
150
|
+
export function postTransaction(txnData: string): Promise<SendResult>;
|
|
151
|
+
/**
|
|
152
|
+
* @class
|
|
153
|
+
* @constructor
|
|
154
|
+
* @public
|
|
155
|
+
* @classdesc This is the configuration class required to initialize and interact with Quantum Coin blockchain
|
|
156
|
+
*/
|
|
157
|
+
export class Config {
|
|
158
|
+
/**
|
|
159
|
+
* Creates a config class
|
|
160
|
+
* @param {string} readUrl - The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.readrelay.quantumcoinapi.com
|
|
161
|
+
* @param {string} writeUrl - The Write API URL pointing to a write relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.writerelay.quantumcoinapi.com
|
|
162
|
+
* @param {number} chainId - The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.
|
|
163
|
+
* @param {string} readApiKey - Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization.
|
|
164
|
+
* @param {string} writeApiKey - Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization.
|
|
165
|
+
*/
|
|
166
|
+
constructor(readUrl: string, writeUrl: string, chainId: number, readApiKey: string, writeApiKey: string);
|
|
167
|
+
/**
|
|
168
|
+
* The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay
|
|
169
|
+
* @type {string}
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
public readUrl: string;
|
|
173
|
+
/**
|
|
174
|
+
* The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/dogep/relay
|
|
175
|
+
* @type {string}
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
178
|
+
public writeUrl: string;
|
|
179
|
+
/**
|
|
180
|
+
* The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.
|
|
181
|
+
* @type {number}
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
public chainId: number;
|
|
185
|
+
/**
|
|
186
|
+
* API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.
|
|
187
|
+
* @type {string}
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
public readApiKey: string;
|
|
191
|
+
/**
|
|
192
|
+
* API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.
|
|
193
|
+
* @type {string}
|
|
194
|
+
* @public
|
|
195
|
+
*/
|
|
196
|
+
public writeApiKey: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* @class
|
|
200
|
+
* @constructor
|
|
201
|
+
* @public
|
|
202
|
+
* @classdesc This class represents a Wallet. Use the verifyWallet function to verify if a wallet is valid. Verifying the wallet is highly recommended, especially if it comes from an untrusted source. For more details on the underlying cryptography of the Wallet, see https://github.com/QuantumCoinProject/hybrid-pqc
|
|
203
|
+
*/
|
|
204
|
+
export class Wallet {
|
|
205
|
+
/**
|
|
206
|
+
* Creates a Wallet class. The constructor does not verify the wallet. To verify a wallet, call the verifyWallet function explicitly.
|
|
207
|
+
* @param {string} address - Address of the wallet
|
|
208
|
+
* @param {number[]} privateKey - Private Key byte array of the wallet
|
|
209
|
+
* @param {number[]} publicKey - The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.
|
|
210
|
+
*/
|
|
211
|
+
constructor(address: string, privateKey: number[], publicKey: number[]);
|
|
212
|
+
/**
|
|
213
|
+
* Address of the wallet. Is 66 bytes in length including 0x (if the wallet is valid).
|
|
214
|
+
* @type {string}
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
public address: string;
|
|
218
|
+
/**
|
|
219
|
+
* Private Key byte array of the wallet. Is 4064 bytes in length (if the wallet is valid).
|
|
220
|
+
* @type {{number[]}
|
|
221
|
+
* @public
|
|
222
|
+
*/
|
|
223
|
+
public privateKey: {};
|
|
224
|
+
/**
|
|
225
|
+
* Public Key byte array of the wallet. Is 1408 bytes in length (if the wallet is valid).
|
|
226
|
+
* @type {{number[]}
|
|
227
|
+
* @public
|
|
228
|
+
*/
|
|
229
|
+
public publicKey: {};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @class
|
|
233
|
+
* @constructor
|
|
234
|
+
* @public
|
|
235
|
+
* @classdesc This class represents a Block.
|
|
236
|
+
*/
|
|
237
|
+
export class BlockDetails {
|
|
238
|
+
constructor(blockNumber: any);
|
|
239
|
+
/**
|
|
240
|
+
* Block Number of the block
|
|
241
|
+
* @type {number}
|
|
242
|
+
* @public
|
|
243
|
+
*/
|
|
244
|
+
public blockNumber: number;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* @class
|
|
248
|
+
* @constructor
|
|
249
|
+
* @public
|
|
250
|
+
* @classdesc This class represents a result from invoking the getLatestBlock function.
|
|
251
|
+
*/
|
|
252
|
+
export class LatestBlockDetailsResult {
|
|
253
|
+
constructor(resultCode: any, blockDetails: any, response: any, requestId: any, err: any);
|
|
254
|
+
/**
|
|
255
|
+
* Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.
|
|
256
|
+
* @type {number}
|
|
257
|
+
* @public
|
|
258
|
+
*/
|
|
259
|
+
public resultCode: number;
|
|
260
|
+
/**
|
|
261
|
+
* An object of type BlockDetails representing the block. This value is null if the value of resultCode is not 0.
|
|
262
|
+
* @type {BlockDetails}
|
|
263
|
+
* @public
|
|
264
|
+
*/
|
|
265
|
+
public blockDetails: BlockDetails;
|
|
266
|
+
/**
|
|
267
|
+
* An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.
|
|
268
|
+
* @type {Object}
|
|
269
|
+
* @public
|
|
270
|
+
*/
|
|
271
|
+
public response: any;
|
|
272
|
+
/**
|
|
273
|
+
* An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
274
|
+
* @type {string}
|
|
275
|
+
* @public
|
|
276
|
+
*/
|
|
277
|
+
public requestId: string;
|
|
278
|
+
/**
|
|
279
|
+
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
280
|
+
* @type {Error}
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
283
|
+
public err: Error;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* @class
|
|
287
|
+
* @constructor
|
|
288
|
+
* @public
|
|
289
|
+
* @classdesc This class represents an Account.
|
|
290
|
+
*/
|
|
291
|
+
export class AccountDetails {
|
|
292
|
+
constructor(address: any, balance: any, nonce: any, blockNumber: any);
|
|
293
|
+
/**
|
|
294
|
+
* Address of the wallet. Is 66 bytes in length including 0x.
|
|
295
|
+
* @type {string}
|
|
296
|
+
* @public
|
|
297
|
+
*/
|
|
298
|
+
public address: string;
|
|
299
|
+
/**
|
|
300
|
+
* Balance of the account in wei. To convert this to ethers, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei
|
|
301
|
+
* @type {string}
|
|
302
|
+
* @public
|
|
303
|
+
*/
|
|
304
|
+
public balance: string;
|
|
305
|
+
/**
|
|
306
|
+
* A monotonically increasing number representing the nonce of the account. After each transaction from the account that gets registered in the blockchain, the nonce increases by 1.
|
|
307
|
+
* @type {number}
|
|
308
|
+
* @public
|
|
309
|
+
*/
|
|
310
|
+
public nonce: number;
|
|
311
|
+
/**
|
|
312
|
+
* The block number as of which the Account details was retrieved.
|
|
313
|
+
* @type {number}
|
|
314
|
+
* @public
|
|
315
|
+
*/
|
|
316
|
+
public blockNumber: number;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* @class
|
|
320
|
+
* @constructor
|
|
321
|
+
* @public
|
|
322
|
+
* @classdesc This class represents a result from invoking the getAccountDetails function.
|
|
323
|
+
*/
|
|
324
|
+
export class AccountDetailsResult {
|
|
325
|
+
constructor(resultCode: any, accountDetails: any, response: any, requestId: any, err: any);
|
|
326
|
+
/**
|
|
327
|
+
* Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.
|
|
328
|
+
* @type {number}
|
|
329
|
+
* @public
|
|
330
|
+
*/
|
|
331
|
+
public resultCode: number;
|
|
332
|
+
/**
|
|
333
|
+
* An object of type AccountDetails representing the block. This value is null if the value of resultCode is not 0.
|
|
334
|
+
* @type {AccountDetails}
|
|
335
|
+
* @public
|
|
336
|
+
*/
|
|
337
|
+
public accountDetails: AccountDetails;
|
|
338
|
+
/**
|
|
339
|
+
* An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.
|
|
340
|
+
* @type {Object}
|
|
341
|
+
* @public
|
|
342
|
+
*/
|
|
343
|
+
public response: any;
|
|
344
|
+
/**
|
|
345
|
+
* An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
346
|
+
* @type {string}
|
|
347
|
+
* @public
|
|
348
|
+
*/
|
|
349
|
+
public requestId: string;
|
|
350
|
+
/**
|
|
351
|
+
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
352
|
+
* @type {Error}
|
|
353
|
+
* @public
|
|
354
|
+
*/
|
|
355
|
+
public err: Error;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* @class
|
|
359
|
+
* @constructor
|
|
360
|
+
* @public
|
|
361
|
+
* @classdesc This class represents a result from invoking the sendCoins function.
|
|
362
|
+
*/
|
|
363
|
+
export class SendResult {
|
|
364
|
+
constructor(resultCode: any, txnHash: any, response: any, requestId: any, err: any);
|
|
365
|
+
/**
|
|
366
|
+
* Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.
|
|
367
|
+
* @type {number}
|
|
368
|
+
* @public
|
|
369
|
+
*/
|
|
370
|
+
public resultCode: number;
|
|
371
|
+
/**
|
|
372
|
+
* Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x. This value is null if the value of resultCode is not 0.
|
|
373
|
+
* @type {string}
|
|
374
|
+
* @public
|
|
375
|
+
*/
|
|
376
|
+
public txnHash: string;
|
|
377
|
+
/**
|
|
378
|
+
* An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.
|
|
379
|
+
* @type {Object}
|
|
380
|
+
* @public
|
|
381
|
+
*/
|
|
382
|
+
public response: any;
|
|
383
|
+
/**
|
|
384
|
+
* An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
385
|
+
* @type {string}
|
|
386
|
+
* @public
|
|
387
|
+
*/
|
|
388
|
+
public requestId: string;
|
|
389
|
+
/**
|
|
390
|
+
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
391
|
+
* @type {Error}
|
|
392
|
+
* @public
|
|
393
|
+
*/
|
|
394
|
+
public err: Error;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* @class
|
|
398
|
+
* @constructor
|
|
399
|
+
* @public
|
|
400
|
+
* @classdesc This class represents a Receipt of a transaction that is registered in the blockchain. The transactionReceipt field can be null unless the transaction is registered with the blockchain.
|
|
401
|
+
* While the transaction is pending, this field will be null. You should consider the transaction as succeeded only if the status field's value is 0x1 (success).
|
|
402
|
+
*/
|
|
403
|
+
export class TransactionReceipt {
|
|
404
|
+
/**
|
|
405
|
+
* A hexadecimal string representing the total amount of gas used when this transaction was executed in the block.
|
|
406
|
+
* @type {string}
|
|
407
|
+
* @public
|
|
408
|
+
*/
|
|
409
|
+
public cumulativeGasUsed: string;
|
|
410
|
+
/**
|
|
411
|
+
* A hexadecimal string representing the sum of the base fee and tip paid per unit of gas.
|
|
412
|
+
* @type {string}
|
|
413
|
+
* @public
|
|
414
|
+
*/
|
|
415
|
+
public effectiveGasPrice: string;
|
|
416
|
+
/**
|
|
417
|
+
* A hexadecimal string representing the amount of gas used by this specific transaction alone.
|
|
418
|
+
* @type {string}
|
|
419
|
+
* @public
|
|
420
|
+
*/
|
|
421
|
+
public gasUsed: string;
|
|
422
|
+
/**
|
|
423
|
+
* A hexadecimal string representing either 0x1 (success) or 0x0 (failure). Failed transactions can also incur gas fee. You should consider the transaction as succeeded only if the status value is 0x1 (success).
|
|
424
|
+
* @type {string}
|
|
425
|
+
* @public
|
|
426
|
+
*/
|
|
427
|
+
public status: string;
|
|
428
|
+
/**
|
|
429
|
+
* Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x.
|
|
430
|
+
* @type {string}
|
|
431
|
+
* @public
|
|
432
|
+
*/
|
|
433
|
+
public hash: string;
|
|
434
|
+
/**
|
|
435
|
+
* A hexadecimal string representing the transaction type. 0x0 is DefaultFeeTxType.
|
|
436
|
+
* @type {string}
|
|
437
|
+
* @public
|
|
438
|
+
*/
|
|
439
|
+
public type: string;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* @class
|
|
443
|
+
* @constructor
|
|
444
|
+
* @public
|
|
445
|
+
* @classdesc This class represents details of a transaction. You should consider the transaction as succeeded only if the status field of the receipt object is 0x1 (success).
|
|
446
|
+
*/
|
|
447
|
+
export class TransactionDetails {
|
|
448
|
+
/**
|
|
449
|
+
* A hexadecimal string representing the hash of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.
|
|
450
|
+
* @type {string}
|
|
451
|
+
* @public
|
|
452
|
+
*/
|
|
453
|
+
public blockHash: string;
|
|
454
|
+
/**
|
|
455
|
+
* The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.
|
|
456
|
+
* @type {number}
|
|
457
|
+
* @public
|
|
458
|
+
*/
|
|
459
|
+
public blockNumber: number;
|
|
460
|
+
/**
|
|
461
|
+
* A 66 character hexadecimal string representing the address the transaction is sent from.
|
|
462
|
+
* @type {string}
|
|
463
|
+
* @public
|
|
464
|
+
*/
|
|
465
|
+
public from: string;
|
|
466
|
+
/**
|
|
467
|
+
* A hexadecimal string representing the gas provided for the transaction execution.
|
|
468
|
+
* @type {string}
|
|
469
|
+
* @public
|
|
470
|
+
*/
|
|
471
|
+
public gas: string;
|
|
472
|
+
/**
|
|
473
|
+
* A hexadecimal string representing the gasPrice used for each paid gas, in Wei.
|
|
474
|
+
* @type {string}
|
|
475
|
+
* @public
|
|
476
|
+
*/
|
|
477
|
+
public gasPrice: string;
|
|
478
|
+
/**
|
|
479
|
+
* A 66 character hexadecimal string representing the hash of the transaction.
|
|
480
|
+
* @type {string}
|
|
481
|
+
* @public
|
|
482
|
+
*/
|
|
483
|
+
public hash: string;
|
|
484
|
+
/**
|
|
485
|
+
* A hexadecimal string representing the compiled code of a contract OR the hash of the invoked method signature and encoded parameters.
|
|
486
|
+
* @type {string}
|
|
487
|
+
* @public
|
|
488
|
+
*/
|
|
489
|
+
public input: string;
|
|
490
|
+
/**
|
|
491
|
+
* A monotonically increasing number representing the nonce of the account. After each transaction from the account that gets registered in the blockchain, the nonce increases by 1.
|
|
492
|
+
* @type {number}
|
|
493
|
+
* @public
|
|
494
|
+
*/
|
|
495
|
+
public nonce: number;
|
|
496
|
+
/**
|
|
497
|
+
* A 66 character hexadecimal string representing address the transaction is directed to.
|
|
498
|
+
* @type {string}
|
|
499
|
+
* @public
|
|
500
|
+
*/
|
|
501
|
+
public to: string;
|
|
502
|
+
/**
|
|
503
|
+
* A hexadecimal string representing the value sent with this transaction. The value can be 0 for smart contract transactions, since it only represents the number of coins sent.
|
|
504
|
+
* @type {string}
|
|
505
|
+
* @public
|
|
506
|
+
*/
|
|
507
|
+
public value: string;
|
|
508
|
+
/**
|
|
509
|
+
* The receipt of the transaction. This field will be null while the transaction is pending (not yet registered in the blockchain).
|
|
510
|
+
* @type {TransactionReceipt}
|
|
511
|
+
* @public
|
|
512
|
+
*/
|
|
513
|
+
public receipt: TransactionReceipt;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* @class
|
|
517
|
+
* @constructor
|
|
518
|
+
* @public
|
|
519
|
+
* @classdesc This class represents a result from invoking the getTransactionDetails function. If transactions get discarded by the blockchain, for reasons such as due to lower than minimum gas fees or invalid nonce, the resultCode will always contain a non-zero value (failure).
|
|
520
|
+
*/
|
|
521
|
+
export class TransactionDetailsResult {
|
|
522
|
+
constructor(resultCode: any, transactionDetails: any, response: any, requestId: any, err: any);
|
|
523
|
+
/**
|
|
524
|
+
* Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.
|
|
525
|
+
* @type {number}
|
|
526
|
+
* @public
|
|
527
|
+
*/
|
|
528
|
+
public resultCode: number;
|
|
529
|
+
/**
|
|
530
|
+
* An object of type TransactionDetails representing the transaction. This value is null if the value of resultCode is not 0.
|
|
531
|
+
* @type {TransactionDetails}
|
|
532
|
+
* @public
|
|
533
|
+
*/
|
|
534
|
+
public transactionDetails: TransactionDetails;
|
|
535
|
+
/**
|
|
536
|
+
* An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.
|
|
537
|
+
* @type {Object}
|
|
538
|
+
* @public
|
|
539
|
+
*/
|
|
540
|
+
public response: any;
|
|
541
|
+
/**
|
|
542
|
+
* An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
543
|
+
* @type {string}
|
|
544
|
+
* @public
|
|
545
|
+
*/
|
|
546
|
+
public requestId: string;
|
|
547
|
+
/**
|
|
548
|
+
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
549
|
+
* @type {Error}
|
|
550
|
+
* @public
|
|
551
|
+
*/
|
|
552
|
+
public err: Error;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* @class
|
|
556
|
+
* @constructor
|
|
557
|
+
* @public
|
|
558
|
+
* @classdesc This class represents a result from invoking the listAccountTransactionDetails function.
|
|
559
|
+
*/
|
|
560
|
+
export class AccountTransactionsResult {
|
|
561
|
+
constructor(resultCode: any, listAccountTransactionsResponse: any, response: any, requestId: any, err: any);
|
|
562
|
+
/**
|
|
563
|
+
* Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.
|
|
564
|
+
* @type {number}
|
|
565
|
+
* @public
|
|
566
|
+
*/
|
|
567
|
+
public resultCode: number;
|
|
568
|
+
/**
|
|
569
|
+
* An object of type ListAccountTransactionsResponse representing the list of transactions along with metadata. This value is null if the value of resultCode is not 0.
|
|
570
|
+
* @type {ListAccountTransactionsResponse}
|
|
571
|
+
* @public
|
|
572
|
+
*/
|
|
573
|
+
public listAccountTransactionsResponse: ListAccountTransactionsResponse;
|
|
574
|
+
/**
|
|
575
|
+
* An object of representing the raw Response returned by the service. For details, see https://developer.mozilla.org/en-US/docs/Web/API/Response. This value can be null if the value of resultCode is not 0.
|
|
576
|
+
* @type {Object}
|
|
577
|
+
* @public
|
|
578
|
+
*/
|
|
579
|
+
public response: any;
|
|
580
|
+
/**
|
|
581
|
+
* An unique id to represent the request. This can be null if request failed before it could be sent.
|
|
582
|
+
* @type {string}
|
|
583
|
+
* @public
|
|
584
|
+
*/
|
|
585
|
+
public requestId: string;
|
|
586
|
+
/**
|
|
587
|
+
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
588
|
+
* @type {Error}
|
|
589
|
+
* @public
|
|
590
|
+
*/
|
|
591
|
+
public err: Error;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* @class
|
|
595
|
+
* @constructor
|
|
596
|
+
* @public
|
|
597
|
+
* @classdesc This class represents a list of account transactions returned by the listAccountTransactionDetails function.
|
|
598
|
+
*/
|
|
599
|
+
export class ListAccountTransactionsResponse {
|
|
600
|
+
/**
|
|
601
|
+
* The number of pages available for listing.
|
|
602
|
+
* @type {number}
|
|
603
|
+
* @public
|
|
604
|
+
*/
|
|
605
|
+
public pageCount: number;
|
|
606
|
+
/**
|
|
607
|
+
* An array of type AccountTransactionCompact, containing the list of transactions. Can be null if no items are available.
|
|
608
|
+
* @type {(AccountTransactionCompact|Array)}
|
|
609
|
+
* @public
|
|
610
|
+
*/
|
|
611
|
+
public items: (AccountTransactionCompact | any[]);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* @class
|
|
615
|
+
* @constructor
|
|
616
|
+
* @public
|
|
617
|
+
* @classdesc This class represents a transaction of an account. You should consider the transaction as succeeded only if the status field is 0x1 (success).
|
|
618
|
+
*/
|
|
619
|
+
export class AccountTransactionCompact {
|
|
620
|
+
/**
|
|
621
|
+
* The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.
|
|
622
|
+
* @type {number}
|
|
623
|
+
* @public
|
|
624
|
+
*/
|
|
625
|
+
public blockNumber: number;
|
|
626
|
+
/**
|
|
627
|
+
* A 66 character hexadecimal string representing the address the transaction is sent from.
|
|
628
|
+
* @type {string}
|
|
629
|
+
* @public
|
|
630
|
+
*/
|
|
631
|
+
public from: string;
|
|
632
|
+
/**
|
|
633
|
+
* A 66 character hexadecimal string representing the hash of the transaction.
|
|
634
|
+
* @type {string}
|
|
635
|
+
* @public
|
|
636
|
+
*/
|
|
637
|
+
public hash: string;
|
|
638
|
+
/**
|
|
639
|
+
* A 66 character hexadecimal string representing address the transaction is directed to.
|
|
640
|
+
* @type {string}
|
|
641
|
+
* @public
|
|
642
|
+
*/
|
|
643
|
+
public to: string;
|
|
644
|
+
/**
|
|
645
|
+
* A hexadecimal string representing the value sent with this transaction. The value can be 0 for smart contract transactions, since it only represents the number of coins sent.
|
|
646
|
+
* @type {string}
|
|
647
|
+
* @public
|
|
648
|
+
*/
|
|
649
|
+
public value: string;
|
|
650
|
+
/**
|
|
651
|
+
* A hexadecimal string representing either 0x1 (success) or 0x0 (failure). Failed transactions can also incur gas fee. You should consider the transaction as succeeded only if the status value is 0x1 (success).
|
|
652
|
+
* @type {string}
|
|
653
|
+
* @public
|
|
654
|
+
*/
|
|
655
|
+
public status: string;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* The newWalletSeed function creates a new Wallet seed word list. The return array can then be passed to the openWalletFromSeedWords function to create a new wallet.
|
|
659
|
+
*
|
|
660
|
+
* @function newWalletSeed
|
|
661
|
+
* @return {array} Returns an array of seed words (48 words in total). Returns null if the operation failed.
|
|
662
|
+
*/
|
|
663
|
+
export function newWalletSeed(): any[];
|
|
664
|
+
/**
|
|
665
|
+
* The openWalletFromSeedWords function creates a wallet from a seed word list. The seed word list is available for wallets created from Desktop/Web/Mobile wallets.
|
|
666
|
+
*
|
|
667
|
+
* @function openWalletFromSeedWords
|
|
668
|
+
* @param {array} seedWordList - An array of seed words. There should be 48 words in total.
|
|
669
|
+
* @return {Wallet} Returns a Wallet object. Returns null if the operation failed.
|
|
670
|
+
*/
|
|
671
|
+
export function openWalletFromSeedWords(seedWordList: any[]): Wallet;
|
|
672
|
+
/**
|
|
673
|
+
* @class
|
|
674
|
+
* @constructor
|
|
675
|
+
* @public
|
|
676
|
+
* @classdesc This class represents a result from invoking the signSendCoinTransaction function.
|
|
677
|
+
*/
|
|
678
|
+
declare class SignResult {
|
|
679
|
+
constructor(resultCode: any, txnHash: any, txnData: any);
|
|
680
|
+
/**
|
|
681
|
+
* Represents the result of the operation. A value of 0 represents that the operation succeeded. Any other value indicates the operation failed. See the result code section for more details.
|
|
682
|
+
* @type {number}
|
|
683
|
+
* @public
|
|
684
|
+
*/
|
|
685
|
+
public resultCode: number;
|
|
686
|
+
/**
|
|
687
|
+
* Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x. This value is null if the value of resultCode is not 0.
|
|
688
|
+
* @type {string}
|
|
689
|
+
* @public
|
|
690
|
+
*/
|
|
691
|
+
public txnHash: string;
|
|
692
|
+
/**
|
|
693
|
+
* A payload representing the signed transaction.
|
|
694
|
+
* To actually send a transaction, this payload can then be taken to to a different device that is connected to the blockchain relay and then sent using the postTransaction function.
|
|
695
|
+
* This value is null if the value of resultCode is not 0.
|
|
696
|
+
* @type {string}
|
|
697
|
+
* @public
|
|
698
|
+
*/
|
|
699
|
+
public txnData: string;
|
|
700
|
+
}
|
|
701
|
+
export {};
|
package/index.js
CHANGED
|
@@ -27,8 +27,6 @@
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
var fs = require('fs');
|
|
31
|
-
const path = require('path');
|
|
32
30
|
var wasmexec = require('./wasm_exec');
|
|
33
31
|
var pqc = require('quantum-coin-pqc-js-sdk');
|
|
34
32
|
const crypto = require("crypto");
|
|
@@ -107,8 +105,8 @@ class Wallet {
|
|
|
107
105
|
/**
|
|
108
106
|
* Creates a Wallet class. The constructor does not verify the wallet. To verify a wallet, call the verifyWallet function explicitly.
|
|
109
107
|
* @param {string} address - Address of the wallet
|
|
110
|
-
* @param {
|
|
111
|
-
* @param {
|
|
108
|
+
* @param {number[]} privateKey - Private Key byte array of the wallet
|
|
109
|
+
* @param {number[]} publicKey - The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.
|
|
112
110
|
*/
|
|
113
111
|
constructor(address, privateKey, publicKey) {
|
|
114
112
|
|
|
@@ -121,14 +119,14 @@ class Wallet {
|
|
|
121
119
|
|
|
122
120
|
/**
|
|
123
121
|
* Private Key byte array of the wallet. Is 4064 bytes in length (if the wallet is valid).
|
|
124
|
-
* @type {{
|
|
122
|
+
* @type {{number[]}
|
|
125
123
|
* @public
|
|
126
124
|
*/
|
|
127
125
|
this.privateKey = privateKey;
|
|
128
126
|
|
|
129
127
|
/**
|
|
130
128
|
* Public Key byte array of the wallet. Is 1408 bytes in length (if the wallet is valid).
|
|
131
|
-
* @type {{
|
|
129
|
+
* @type {{number[]}
|
|
132
130
|
* @public
|
|
133
131
|
*/
|
|
134
132
|
this.publicKey = publicKey;
|
|
@@ -190,7 +188,7 @@ class LatestBlockDetailsResult {
|
|
|
190
188
|
|
|
191
189
|
/**
|
|
192
190
|
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
193
|
-
* @type {
|
|
191
|
+
* @type {Error}
|
|
194
192
|
* @public
|
|
195
193
|
*/
|
|
196
194
|
this.err = err;
|
|
@@ -273,7 +271,7 @@ class AccountDetailsResult {
|
|
|
273
271
|
|
|
274
272
|
/**
|
|
275
273
|
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
276
|
-
* @type {
|
|
274
|
+
* @type {Error}
|
|
277
275
|
* @public
|
|
278
276
|
*/
|
|
279
277
|
this.err = err;
|
|
@@ -351,7 +349,7 @@ class SendResult {
|
|
|
351
349
|
|
|
352
350
|
/**
|
|
353
351
|
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
354
|
-
* @type {
|
|
352
|
+
* @type {Error}
|
|
355
353
|
* @public
|
|
356
354
|
*/
|
|
357
355
|
this.err = err;
|
|
@@ -538,7 +536,7 @@ class TransactionDetailsResult {
|
|
|
538
536
|
|
|
539
537
|
/**
|
|
540
538
|
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
541
|
-
* @type {
|
|
539
|
+
* @type {Error}
|
|
542
540
|
* @public
|
|
543
541
|
*/
|
|
544
542
|
this.err = err;
|
|
@@ -661,7 +659,7 @@ class AccountTransactionsResult {
|
|
|
661
659
|
|
|
662
660
|
/**
|
|
663
661
|
* An error object if the operation resulted in an error and there was no response. This property is defined only if the resultCode is -10000.
|
|
664
|
-
* @type {
|
|
662
|
+
* @type {Error}
|
|
665
663
|
* @public
|
|
666
664
|
*/
|
|
667
665
|
this.err = err;
|
|
@@ -1138,7 +1136,7 @@ async function postTransaction(txnData) {
|
|
|
1138
1136
|
*
|
|
1139
1137
|
* @async
|
|
1140
1138
|
* @function getLatestBlockDetails
|
|
1141
|
-
* @return {Promise<
|
|
1139
|
+
* @return {Promise<LatestBlockDetailsResult>} Returns a promise of an object of type BlockDetailsResult.
|
|
1142
1140
|
*/
|
|
1143
1141
|
async function getLatestBlockDetails() {
|
|
1144
1142
|
if (isInitialized === false) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quantum-coin-js-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Quantum Coin - Q SDK in JavaScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"build": "npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly && jsdoc2md index.js >README.md"
|
|
8
9
|
},
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
package/wasm_exec.d.ts
ADDED
|
File without changes
|