quantum-coin-js-sdk 1.0.7 → 1.0.8
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 +1 -1
- package/example/example.js +0 -1
- package/example/package-lock.json +3 -3
- package/index.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -647,7 +647,7 @@ The deserializeWallet function creates a Wallet object from a JSON string.
|
|
|
647
647
|
The postTransaction function posts a signed transaction to the blockchain.
|
|
648
648
|
|
|
649
649
|
**Kind**: inner method of [<code>quantum-coin-js-sdk</code>](#module_quantum-coin-js-sdk)
|
|
650
|
-
**Returns**: <code>Promise.<SendResult></code> - Returns a promise of type SendResult.
|
|
650
|
+
**Returns**: <code>Promise.<SendResult></code> - Returns a promise of type SendResult. txnHash will be null in SendResult.
|
|
651
651
|
|
|
652
652
|
| Param | Type | Description |
|
|
653
653
|
| --- | --- | --- |
|
package/example/example.js
CHANGED
|
@@ -17,7 +17,6 @@ qcsdk.initialize(clientConfigVal).then((initResult) => {
|
|
|
17
17
|
}
|
|
18
18
|
console.log("Initialize succeeded");
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
//Get the account details
|
|
22
21
|
let address = "0x0000000000000000000000000000000000000000000000000000000000001000"; //Just an example address https://t4.scan.quantumcoin.org/account/0x0000000000000000000000000000000000000000000000000000000000001000
|
|
23
22
|
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"integrity": "sha512-7Q5YlFvaXoP+MK+yn4KH4MYvJDkyGoGUU/zKYsRxR1mVqddqGUsGvz2JTsfH5B/Gkk97gMMh3PQ7MmkM8iJA5Q=="
|
|
87
87
|
},
|
|
88
88
|
"node_modules/quantum-coin-js-sdk": {
|
|
89
|
-
"version": "1.0.
|
|
90
|
-
"resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.
|
|
91
|
-
"integrity": "sha512-
|
|
89
|
+
"version": "1.0.7",
|
|
90
|
+
"resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.7.tgz",
|
|
91
|
+
"integrity": "sha512-rHdSm7Xa3YGy5m/8YSin5EYJcE8ZnWtAFhcmsI3o56r+58c7ARwmcHaqJMMazmgenUC5AyxlUIrOjwzJFGAOuw==",
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"pqc-js-sdk": "^1.0.0"
|
|
94
94
|
}
|
package/index.js
CHANGED
|
@@ -735,7 +735,7 @@ function transactionGetData(fromaddress, nonce, toaddress, amount, gas, chainid,
|
|
|
735
735
|
* @async
|
|
736
736
|
* @function postTransaction
|
|
737
737
|
* @param {string} txnData - A signed transaction string returned by the signSendCoinTransaction function.
|
|
738
|
-
* @return {Promise<SendResult>} Returns a promise of type SendResult.
|
|
738
|
+
* @return {Promise<SendResult>} Returns a promise of type SendResult. txnHash will be null in SendResult.
|
|
739
739
|
*/
|
|
740
740
|
async function postTransaction(txnData) {
|
|
741
741
|
if (isInitialized === false) {
|
|
@@ -1027,7 +1027,7 @@ async function getTransactionDetails(txnHash) {
|
|
|
1027
1027
|
* @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.
|
|
1028
1028
|
* @return {SignResult} Returns a promise of type SignResult.
|
|
1029
1029
|
*/
|
|
1030
|
-
async function signSendCoinTransaction(wallet, toAddress, coins) {
|
|
1030
|
+
async function signSendCoinTransaction(wallet, toAddress, coins, nonce) {
|
|
1031
1031
|
if (isInitialized === false) {
|
|
1032
1032
|
return -1000;
|
|
1033
1033
|
}
|
|
@@ -1073,15 +1073,15 @@ async function signSendCoinTransaction(wallet, toAddress, coins) {
|
|
|
1073
1073
|
|
|
1074
1074
|
var txHashHex = transactionGetTransactionHash(wallet.address, nonce, toAddress, coins, DEFAULT_GAS, config.chainId, contractData, wallet.publicKey, quantumSig);
|
|
1075
1075
|
if (txHashHex == null) {
|
|
1076
|
-
return new
|
|
1076
|
+
return new SignResult(-508, null, null);
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
1079
|
var txnData = transactionGetData(wallet.address, nonce, toAddress, coins, DEFAULT_GAS, config.chainId, contractData, wallet.publicKey, quantumSig);
|
|
1080
1080
|
if (txnData == null) {
|
|
1081
|
-
return new
|
|
1081
|
+
return new SignResult(-509, null, null);
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
|
-
return new
|
|
1084
|
+
return new SignResult(0, txHashHex, txnData);
|
|
1085
1085
|
}
|
|
1086
1086
|
|
|
1087
1087
|
/**
|