quantum-coin-js-sdk 1.0.39 → 2.1.0

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.
Files changed (226) hide show
  1. package/.gitignore +2 -1
  2. package/README.md +109 -768
  3. package/index.d.ts +76 -545
  4. package/index.js +319 -1194
  5. package/package.json +20 -5
  6. package/wasmBase64.js +7 -16
  7. package/wasm_exec.js +575 -587
  8. package/.idea/.name +0 -1
  9. package/.idea/modules.xml +0 -8
  10. package/.idea/quantum-coin-js-sdk.iml +0 -12
  11. package/.idea/vcs.xml +0 -6
  12. package/.vs/ProjectSettings.json +0 -3
  13. package/.vs/VSWorkspaceState.json +0 -8
  14. package/.vs/quantum-coin-js-sdk/FileContentIndex/a9d6de82-cfc3-4c22-ac38-06d706ff3673.vsidx +0 -0
  15. package/.vs/quantum-coin-js-sdk/FileContentIndex/fdc816df-1898-4153-99f2-c69ef4c2283b.vsidx +0 -0
  16. package/.vs/quantum-coin-js-sdk/config/applicationhost.config +0 -1011
  17. package/.vs/quantum-coin-js-sdk/v17/.wsuo +0 -0
  18. package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.backup.json +0 -39
  19. package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.json +0 -57
  20. package/.vs/slnx.sqlite +0 -0
  21. package/example/README.md +0 -14
  22. package/example/conversion-example.js +0 -19
  23. package/example/example-create-contract.js +0 -396
  24. package/example/example-encode-decode-rlp.js +0 -225
  25. package/example/example-event-pack-unpack.js +0 -391
  26. package/example/example-misc.js +0 -100
  27. package/example/example-rpc-send-signRawTransaction.js +0 -318
  28. package/example/example-rpc-send.js +0 -115
  29. package/example/example-send.js +0 -69
  30. package/example/example-token-pack-unpack.js +0 -960
  31. package/example/example-wallet-version4.js +0 -34
  32. package/example/example-wallet.js +0 -43
  33. package/example/example.js +0 -405
  34. package/example/node_modules/.bin/sdkgen +0 -16
  35. package/example/node_modules/.bin/sdkgen.cmd +0 -17
  36. package/example/node_modules/.bin/sdkgen.ps1 +0 -28
  37. package/example/node_modules/.package-lock.json +0 -47
  38. package/example/node_modules/quantumcoin/.github/workflows/publish-npmjs.yaml +0 -22
  39. package/example/node_modules/quantumcoin/LICENSE +0 -21
  40. package/example/node_modules/quantumcoin/README-SDK.md +0 -828
  41. package/example/node_modules/quantumcoin/README.md +0 -197
  42. package/example/node_modules/quantumcoin/config.d.ts +0 -50
  43. package/example/node_modules/quantumcoin/config.js +0 -123
  44. package/example/node_modules/quantumcoin/examples/AllSolidityTypes.sol +0 -184
  45. package/example/node_modules/quantumcoin/examples/SimpleIERC20.sol +0 -74
  46. package/example/node_modules/quantumcoin/examples/events.js +0 -41
  47. package/example/node_modules/quantumcoin/examples/events.ts +0 -35
  48. package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.js +0 -100
  49. package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.ts +0 -77
  50. package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.js +0 -100
  51. package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.ts +0 -77
  52. package/example/node_modules/quantumcoin/examples/example.js +0 -67
  53. package/example/node_modules/quantumcoin/examples/example.ts +0 -56
  54. package/example/node_modules/quantumcoin/examples/offline-signing.js +0 -77
  55. package/example/node_modules/quantumcoin/examples/offline-signing.ts +0 -65
  56. package/example/node_modules/quantumcoin/examples/package-lock.json +0 -596
  57. package/example/node_modules/quantumcoin/examples/package.json +0 -32
  58. package/example/node_modules/quantumcoin/examples/read-operations.js +0 -32
  59. package/example/node_modules/quantumcoin/examples/read-operations.ts +0 -31
  60. package/example/node_modules/quantumcoin/examples/sdk-generator-erc20.inline.json +0 -251
  61. package/example/node_modules/quantumcoin/examples/solidity-types.ts +0 -43
  62. package/example/node_modules/quantumcoin/examples/wallet-offline.js +0 -36
  63. package/example/node_modules/quantumcoin/examples/wallet-offline.ts +0 -26
  64. package/example/node_modules/quantumcoin/generate-sdk.js +0 -1846
  65. package/example/node_modules/quantumcoin/index.js +0 -12
  66. package/example/node_modules/quantumcoin/package.json +0 -95
  67. package/example/node_modules/quantumcoin/scripts/copy-declarations.js +0 -31
  68. package/example/node_modules/quantumcoin/scripts/run-all-one-by-one.js +0 -151
  69. package/example/node_modules/quantumcoin/src/abi/fragments.d.ts +0 -42
  70. package/example/node_modules/quantumcoin/src/abi/fragments.js +0 -63
  71. package/example/node_modules/quantumcoin/src/abi/index.d.ts +0 -13
  72. package/example/node_modules/quantumcoin/src/abi/index.js +0 -9
  73. package/example/node_modules/quantumcoin/src/abi/interface.d.ts +0 -128
  74. package/example/node_modules/quantumcoin/src/abi/interface.js +0 -605
  75. package/example/node_modules/quantumcoin/src/abi/js-abi-coder.d.ts +0 -8
  76. package/example/node_modules/quantumcoin/src/abi/js-abi-coder.js +0 -538
  77. package/example/node_modules/quantumcoin/src/constants.d.ts +0 -61
  78. package/example/node_modules/quantumcoin/src/constants.js +0 -94
  79. package/example/node_modules/quantumcoin/src/contract/contract-factory.d.ts +0 -28
  80. package/example/node_modules/quantumcoin/src/contract/contract-factory.js +0 -111
  81. package/example/node_modules/quantumcoin/src/contract/contract.d.ts +0 -113
  82. package/example/node_modules/quantumcoin/src/contract/contract.js +0 -408
  83. package/example/node_modules/quantumcoin/src/contract/index.d.ts +0 -9
  84. package/example/node_modules/quantumcoin/src/contract/index.js +0 -9
  85. package/example/node_modules/quantumcoin/src/errors/index.d.ts +0 -92
  86. package/example/node_modules/quantumcoin/src/errors/index.js +0 -200
  87. package/example/node_modules/quantumcoin/src/generator/index.d.ts +0 -81
  88. package/example/node_modules/quantumcoin/src/generator/index.js +0 -1571
  89. package/example/node_modules/quantumcoin/src/index.d.ts +0 -122
  90. package/example/node_modules/quantumcoin/src/index.js +0 -41
  91. package/example/node_modules/quantumcoin/src/internal/hex.d.ts +0 -68
  92. package/example/node_modules/quantumcoin/src/internal/hex.js +0 -180
  93. package/example/node_modules/quantumcoin/src/providers/extra-providers.d.ts +0 -139
  94. package/example/node_modules/quantumcoin/src/providers/extra-providers.js +0 -614
  95. package/example/node_modules/quantumcoin/src/providers/index.d.ts +0 -17
  96. package/example/node_modules/quantumcoin/src/providers/index.js +0 -10
  97. package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.d.ts +0 -12
  98. package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.js +0 -89
  99. package/example/node_modules/quantumcoin/src/providers/provider.d.ts +0 -206
  100. package/example/node_modules/quantumcoin/src/providers/provider.js +0 -524
  101. package/example/node_modules/quantumcoin/src/types/index.d.ts +0 -214
  102. package/example/node_modules/quantumcoin/src/types/index.js +0 -9
  103. package/example/node_modules/quantumcoin/src/utils/address.d.ts +0 -58
  104. package/example/node_modules/quantumcoin/src/utils/address.js +0 -144
  105. package/example/node_modules/quantumcoin/src/utils/encoding.d.ts +0 -120
  106. package/example/node_modules/quantumcoin/src/utils/encoding.js +0 -306
  107. package/example/node_modules/quantumcoin/src/utils/fixednumber.d.ts +0 -57
  108. package/example/node_modules/quantumcoin/src/utils/fixednumber.js +0 -366
  109. package/example/node_modules/quantumcoin/src/utils/hashing.d.ts +0 -76
  110. package/example/node_modules/quantumcoin/src/utils/hashing.js +0 -298
  111. package/example/node_modules/quantumcoin/src/utils/index.d.ts +0 -63
  112. package/example/node_modules/quantumcoin/src/utils/index.js +0 -14
  113. package/example/node_modules/quantumcoin/src/utils/result.d.ts +0 -57
  114. package/example/node_modules/quantumcoin/src/utils/result.js +0 -128
  115. package/example/node_modules/quantumcoin/src/utils/rlp.d.ts +0 -12
  116. package/example/node_modules/quantumcoin/src/utils/rlp.js +0 -215
  117. package/example/node_modules/quantumcoin/src/utils/units.d.ts +0 -29
  118. package/example/node_modules/quantumcoin/src/utils/units.js +0 -107
  119. package/example/node_modules/quantumcoin/src/wallet/index.d.ts +0 -10
  120. package/example/node_modules/quantumcoin/src/wallet/index.js +0 -8
  121. package/example/node_modules/quantumcoin/src/wallet/wallet.d.ts +0 -192
  122. package/example/node_modules/quantumcoin/src/wallet/wallet.js +0 -713
  123. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.js +0 -207
  124. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.ts +0 -191
  125. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.fixtures.js +0 -231
  126. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.js +0 -387
  127. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.ts +0 -350
  128. package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.js +0 -165
  129. package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.ts +0 -160
  130. package/example/node_modules/quantumcoin/test/e2e/helpers.js +0 -59
  131. package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.js +0 -141
  132. package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.ts +0 -128
  133. package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.js +0 -168
  134. package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.ts +0 -141
  135. package/example/node_modules/quantumcoin/test/e2e/transactional.test.js +0 -245
  136. package/example/node_modules/quantumcoin/test/e2e/transactional.test.ts +0 -208
  137. package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.js +0 -407
  138. package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.ts +0 -337
  139. package/example/node_modules/quantumcoin/test/fixtures/ConstructorParam.sol +0 -23
  140. package/example/node_modules/quantumcoin/test/fixtures/MultiContracts.sol +0 -37
  141. package/example/node_modules/quantumcoin/test/fixtures/SimpleStorage.sol +0 -18
  142. package/example/node_modules/quantumcoin/test/fixtures/StakingContract.abi.json +0 -1
  143. package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.js +0 -49
  144. package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.ts +0 -44
  145. package/example/node_modules/quantumcoin/test/integration/provider.test.js +0 -88
  146. package/example/node_modules/quantumcoin/test/integration/provider.test.ts +0 -85
  147. package/example/node_modules/quantumcoin/test/integration/ws-provider.test.js +0 -41
  148. package/example/node_modules/quantumcoin/test/integration/ws-provider.test.ts +0 -38
  149. package/example/node_modules/quantumcoin/test/security/abi-decoder-bounds.test.js +0 -122
  150. package/example/node_modules/quantumcoin/test/security/contract-overrides.test.js +0 -112
  151. package/example/node_modules/quantumcoin/test/security/generator-injection.test.js +0 -195
  152. package/example/node_modules/quantumcoin/test/security/malformed-input.test.js +0 -330
  153. package/example/node_modules/quantumcoin/test/security/malformed-input.test.ts +0 -35
  154. package/example/node_modules/quantumcoin/test/security/rpc-numeric-bounds.test.js +0 -81
  155. package/example/node_modules/quantumcoin/test/security/rpc-trust.test.js +0 -202
  156. package/example/node_modules/quantumcoin/test/unit/_encrypted-output.txt +0 -6
  157. package/example/node_modules/quantumcoin/test/unit/_log-encrypted-jsons.js +0 -45
  158. package/example/node_modules/quantumcoin/test/unit/_write-keystore-fixture.js +0 -16
  159. package/example/node_modules/quantumcoin/test/unit/abi-interface.test.js +0 -110
  160. package/example/node_modules/quantumcoin/test/unit/abi-interface.test.ts +0 -109
  161. package/example/node_modules/quantumcoin/test/unit/address-wallet.test.js +0 -923
  162. package/example/node_modules/quantumcoin/test/unit/address-wallet.test.ts +0 -877
  163. package/example/node_modules/quantumcoin/test/unit/browser-provider.test.js +0 -85
  164. package/example/node_modules/quantumcoin/test/unit/browser-provider.test.ts +0 -79
  165. package/example/node_modules/quantumcoin/test/unit/contract.test.js +0 -85
  166. package/example/node_modules/quantumcoin/test/unit/contract.test.ts +0 -83
  167. package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.js +0 -127
  168. package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.ts +0 -91
  169. package/example/node_modules/quantumcoin/test/unit/errors.test.js +0 -77
  170. package/example/node_modules/quantumcoin/test/unit/errors.test.ts +0 -76
  171. package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.js +0 -55
  172. package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.ts +0 -54
  173. package/example/node_modules/quantumcoin/test/unit/fixednumber.test.js +0 -656
  174. package/example/node_modules/quantumcoin/test/unit/fixednumber.test.ts +0 -660
  175. package/example/node_modules/quantumcoin/test/unit/fixtures/encrypted-keystores-48-32-36.js +0 -9
  176. package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.js +0 -42
  177. package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.ts +0 -41
  178. package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.js +0 -113
  179. package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.ts +0 -110
  180. package/example/node_modules/quantumcoin/test/unit/generator.test.js +0 -149
  181. package/example/node_modules/quantumcoin/test/unit/generator.test.ts +0 -148
  182. package/example/node_modules/quantumcoin/test/unit/hashing.test.js +0 -64
  183. package/example/node_modules/quantumcoin/test/unit/hashing.test.ts +0 -63
  184. package/example/node_modules/quantumcoin/test/unit/init.test.js +0 -39
  185. package/example/node_modules/quantumcoin/test/unit/init.test.ts +0 -38
  186. package/example/node_modules/quantumcoin/test/unit/interface.test.js +0 -56
  187. package/example/node_modules/quantumcoin/test/unit/interface.test.ts +0 -54
  188. package/example/node_modules/quantumcoin/test/unit/internal-hex.test.js +0 -81
  189. package/example/node_modules/quantumcoin/test/unit/internal-hex.test.ts +0 -80
  190. package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.js +0 -98
  191. package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.ts +0 -64
  192. package/example/node_modules/quantumcoin/test/unit/providers.test.js +0 -252
  193. package/example/node_modules/quantumcoin/test/unit/providers.test.ts +0 -251
  194. package/example/node_modules/quantumcoin/test/unit/result.test.js +0 -80
  195. package/example/node_modules/quantumcoin/test/unit/result.test.ts +0 -79
  196. package/example/node_modules/quantumcoin/test/unit/solidity-types.test.js +0 -49
  197. package/example/node_modules/quantumcoin/test/unit/solidity-types.test.ts +0 -39
  198. package/example/node_modules/quantumcoin/test/unit/utils.test.js +0 -57
  199. package/example/node_modules/quantumcoin/test/unit/utils.test.ts +0 -56
  200. package/example/node_modules/quantumcoin/test/verbose-logger.js +0 -74
  201. package/example/node_modules/quantumcoin/tsconfig.build.json +0 -14
  202. package/example/node_modules/seed-words/.github/workflows/publish-npmjs.yaml +0 -22
  203. package/example/node_modules/seed-words/BUILD.md +0 -7
  204. package/example/node_modules/seed-words/LICENSE +0 -121
  205. package/example/node_modules/seed-words/README.md +0 -67
  206. package/example/node_modules/seed-words/dist/seedwords.d.ts +0 -39
  207. package/example/node_modules/seed-words/package.json +0 -27
  208. package/example/node_modules/seed-words/seedwords.js +0 -315
  209. package/example/node_modules/seed-words/seedwords.txt +0 -65536
  210. package/example/node_modules/seed-words/tsconfig.json +0 -21
  211. package/example/package-lock.json +0 -56
  212. package/example/package.json +0 -15
  213. package/tests/encrypted-32.json +0 -1
  214. package/tests/encrypted-36.json +0 -1
  215. package/tests/encrypted-48.json +0 -1
  216. package/tests/generate-verify-vectors.js +0 -91
  217. package/tests/get-gas-price.test.js +0 -59
  218. package/tests/non-transactional.preinit.test.js +0 -41
  219. package/tests/non-transactional.test.js +0 -1389
  220. package/tests/scrypt.test.js +0 -128
  221. package/tests/sign-raw-keytype5-context-null.test.js +0 -107
  222. package/tests/sign-raw-transaction.test.js +0 -196
  223. package/tests/sign-verify.test.js +0 -311
  224. package/tests/transactional.relay.test.js +0 -131
  225. package/tests/transactional.rpc.test.js +0 -103
  226. package/tests/verify-vectors.json +0 -95035
package/index.d.ts CHANGED
@@ -68,44 +68,6 @@ export function verifyWallet(wallet: Wallet): boolean;
68
68
  * @return {Wallet|number} Returns a Wallet object, or -1000 (not initialized), -1001 (invalid key type), -1002 (crypto failure).
69
69
  */
70
70
  export function newWallet(keyType: number | null): Wallet | number;
71
- /**
72
- * The sendCoins function posts a send-coin transaction to the blockchain. The chainId used for signing should be provided in the initialize() function.
73
- * Since the gas fee for sending coins is fixed at 1000 coins, there is no option to set the gas fee explicitly.
74
- * It may take many seconds after submitting a transaction before the transaction is returned by the getTransactionDetails function.
75
- * Transactions are usually committed in less than 30 seconds.
76
- *
77
- * @deprecated Use signRawTransaction and postTransaction instead.
78
- * @async
79
- * @function sendCoins
80
- * @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.
81
- * @param {string} toAddress - The address to which the coins should be sent.
82
- * @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
83
- * @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.
84
- * @return {Promise<SendResult>} Returns a promise of type SendResult.
85
- */
86
- export function sendCoins(wallet: Wallet, toAddress: string, coins: string, nonce: number): Promise<SendResult>;
87
- /**
88
- * The getAccountDetails function returns details of an account corresponding to the address.
89
- *
90
- * @async
91
- * @function getAccountDetails
92
- * @param {string} address - The address of the account of which the details have to be retrieved.
93
- * @return {Promise<AccountDetailsResult>} Returns a promise of type AccountDetailsResult.
94
- */
95
- export function getAccountDetails(address: string): Promise<AccountDetailsResult>;
96
- /**
97
- * The getTransactionDetails function returns details of a transaction posted to the blockchain.
98
- * 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.
99
- * Some transactions that have lower balance than the minimum required for gas fees may be discarded.
100
- * In these cases, the transactions may not be returned when invoking the getTransactionDetails function.
101
- * You should consider the transaction as succeeded only if the status field of the transactionReceipt object is 0x1 (success).
102
- * The transactionReceipt field can be null unless the transaction is registered with the blockchain.
103
- * @async
104
- * @function getTransactionDetails
105
- * @param {string} txnHash - The hash of the transaction to retrieve.
106
- * @return {Promise<TransactionDetailsResult>} Returns a promise of type TransactionDetailsResult.
107
- */
108
- export function getTransactionDetails(txnHash: string): Promise<TransactionDetailsResult>;
109
71
  /**
110
72
  * The isAddressValid function validates whether an address is valid or not. An address is of length 66 characters including 0x.
111
73
  *
@@ -114,100 +76,39 @@ export function getTransactionDetails(txnHash: string): Promise<TransactionDetai
114
76
  * @return {boolean} Returns true if the address validation succeeded, else returns false.
115
77
  */
116
78
  export function isAddressValid(address: string): boolean;
117
- /**
118
- * The getLatestBlockDetails function returns details of the latest block of the blockchain.
119
- *
120
- * @async
121
- * @function getLatestBlockDetails
122
- * @return {Promise<LatestBlockDetailsResult>} Returns a promise of an object of type LatestBlockDetailsResult.
123
- */
124
- export function getLatestBlockDetails(): Promise<LatestBlockDetailsResult>;
125
79
  /**
126
80
  * The signSendCoinTransaction function returns a signed transaction. The chainId used for signing should be provided in the initialize() function.
127
81
  * Since the gas fee for sending coins is fixed at 1000 coins, there is no option to set the gas fee explicitly.
128
- * 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.
129
- * 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.
82
+ * This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then broadcast it from a connected device (for example, via a relay or RPC endpoint).
83
+ * Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally broadcast the transaction from a connected device.
130
84
  *
131
85
  * @deprecated Use signRawTransaction instead.
132
86
  * @function signSendCoinTransaction
133
87
  * @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.
134
88
  * @param {string} toAddress - The address to which the coins should be sent.
135
89
  * @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
136
- * @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.
90
+ * @param {number} nonce - A monotonically increasing number representing the nonce of the account. You have to carefully manage the state of the nonce to avoid sending the coins multiple times, such as when retrying after an error.
137
91
  * @return {Promise<SignResult>} Returns a promise of type SignResult.
138
92
  */
139
93
  export function signSendCoinTransaction(wallet: Wallet, toAddress: string, coins: string, nonce: number): Promise<SignResult>;
140
- /**
141
- * The listAccountTransactions function returns a list of transactions for a specific account.
142
- * 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.
143
- * Some transactions that have lower balance than the minimum required for gas fees may be discarded.
144
- * In these cases, the transactions may not be returned when invoking the listAccountTransactions function.
145
- * You should consider the transaction as succeeded only if the status field of the AccountTransactionCompact object is 0x1 (success).
146
- * Both transactions from and transactions to the address will be returned in the list.
147
- * Use the getTransactionDetails function, passing the hash of the transaction to get detailed information about the transaction.
148
- * @async
149
- * @function listAccountTransactions
150
- * @param {string} address - The address for which the transactions have to be listed.
151
- * @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.
152
- * @return {Promise<AccountTransactionsResult>} Returns a promise of type AccountTransactionsResult.
153
- */
154
- export function listAccountTransactions(address: string, pageNumber: number): Promise<AccountTransactionsResult>;
155
- /**
156
- * The postTransaction function posts a signed transaction to the blockchain.
157
- * 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).
158
- *
159
- * @async
160
- * @function postTransaction
161
- * @param {string} txnData - A signed transaction string returned by the signSendCoinTransaction function.
162
- * @return {Promise<SendResult>} Returns a promise of type SendResult. txnHash will be null in SendResult.
163
- */
164
- export function postTransaction(txnData: string): Promise<SendResult>;
165
94
  /**
166
95
  * @class
167
96
  * @constructor
168
97
  * @public
169
- * @classdesc This is the configuration class required to initialize and interact with Quantum Coin blockchain
98
+ * @classdesc This is the configuration class required to initialize the Quantum Coin SDK for offline operations such as wallet management and transaction signing.
170
99
  */
171
100
  export class Config {
172
101
  /**
173
102
  * Creates a config class
174
- * @param {string} readUrl - The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.readrelay.quantumcoinapi.com
175
- * @param {string} writeUrl - The Write API URL pointing to a write relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay. The following URLs are community maintained. Please use your own relay service. Mainnet: https://sdk.writerelay.quantumcoinapi.com
176
103
  * @param {number} chainId - The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.
177
- * @param {string} readApiKey - Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization.
178
- * @param {string} writeApiKey - Optional parameter if authorization is enabled for the relay service. API Key for authorization. Defaults to null which indicates no authorization.
179
104
  */
180
- constructor(readUrl: string, writeUrl: string, chainId: number, readApiKey: string, writeApiKey: string);
181
- /**
182
- * The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay
183
- * @type {string}
184
- * @public
185
- */
186
- public readUrl: string;
187
- /**
188
- * The Read API URL pointing to a read relay. See https://github.com/quantumcoinproject/quantum-coin-go/tree/main/relay
189
- * @type {string}
190
- * @public
191
- */
192
- public writeUrl: string;
105
+ constructor(chainId: number);
193
106
  /**
194
107
  * The chain id of the blockchain. Mainnet chainId is 123123. Testnet T4 chainId is 310324.
195
108
  * @type {number}
196
109
  * @public
197
110
  */
198
111
  public chainId: number;
199
- /**
200
- * API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.
201
- * @type {string}
202
- * @public
203
- */
204
- public readApiKey: string;
205
- /**
206
- * API Key for authorization if authorization is enabled for the relay service. Defaults to null which indicates no authorization.
207
- * @type {string}
208
- * @public
209
- */
210
- public writeApiKey: string;
211
112
  }
212
113
  /**
213
114
  * @class
@@ -249,432 +150,6 @@ export class Wallet {
249
150
  */
250
151
  public preExpansionSeed: Uint8Array | number[] | null;
251
152
  }
252
- /**
253
- * @class
254
- * @constructor
255
- * @public
256
- * @classdesc This class represents a Block.
257
- */
258
- export class BlockDetails {
259
- constructor(blockNumber: any);
260
- /**
261
- * Block Number of the block
262
- * @type {number}
263
- * @public
264
- */
265
- public blockNumber: number;
266
- }
267
- /**
268
- * @class
269
- * @constructor
270
- * @public
271
- * @classdesc This class represents a result from invoking the getLatestBlock function.
272
- */
273
- export class LatestBlockDetailsResult {
274
- constructor(resultCode: any, blockDetails: any, response: any, requestId: any, err: any);
275
- /**
276
- * 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.
277
- * @type {number}
278
- * @public
279
- */
280
- public resultCode: number;
281
- /**
282
- * An object of type BlockDetails representing the block. This value is null if the value of resultCode is not 0.
283
- * @type {BlockDetails}
284
- * @public
285
- */
286
- public blockDetails: BlockDetails;
287
- /**
288
- * 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.
289
- * @type {Object}
290
- * @public
291
- */
292
- public response: Object;
293
- /**
294
- * An unique id to represent the request. This can be null if request failed before it could be sent.
295
- * @type {string}
296
- * @public
297
- */
298
- public requestId: string;
299
- /**
300
- * 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.
301
- * @type {Error}
302
- * @public
303
- */
304
- public err: Error;
305
- }
306
- /**
307
- * @class
308
- * @constructor
309
- * @public
310
- * @classdesc This class represents an Account.
311
- */
312
- export class AccountDetails {
313
- constructor(address: any, balance: any, nonce: any, blockNumber: any);
314
- /**
315
- * Address of the wallet. Is 66 bytes in length including 0x.
316
- * @type {string}
317
- * @public
318
- */
319
- public address: string;
320
- /**
321
- * Balance of the account in wei. To convert this to ethers, see https://docs.ethers.org/v4/api-utils.html#ether-strings-and-wei
322
- * @type {string}
323
- * @public
324
- */
325
- public balance: string;
326
- /**
327
- * 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.
328
- * @type {number}
329
- * @public
330
- */
331
- public nonce: number;
332
- /**
333
- * The block number as of which the Account details was retrieved.
334
- * @type {number}
335
- * @public
336
- */
337
- public blockNumber: number;
338
- }
339
- /**
340
- * @class
341
- * @constructor
342
- * @public
343
- * @classdesc This class represents a result from invoking the getAccountDetails function.
344
- */
345
- export class AccountDetailsResult {
346
- constructor(resultCode: any, accountDetails: any, response: any, requestId: any, err: any);
347
- /**
348
- * 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.
349
- * @type {number}
350
- * @public
351
- */
352
- public resultCode: number;
353
- /**
354
- * An object of type AccountDetails representing the block. This value is null if the value of resultCode is not 0.
355
- * @type {AccountDetails}
356
- * @public
357
- */
358
- public accountDetails: AccountDetails;
359
- /**
360
- * 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.
361
- * @type {Object}
362
- * @public
363
- */
364
- public response: Object;
365
- /**
366
- * An unique id to represent the request. This can be null if request failed before it could be sent.
367
- * @type {string}
368
- * @public
369
- */
370
- public requestId: string;
371
- /**
372
- * 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.
373
- * @type {Error}
374
- * @public
375
- */
376
- public err: Error;
377
- }
378
- /**
379
- * @class
380
- * @constructor
381
- * @public
382
- * @classdesc This class represents a result from invoking the sendCoins function.
383
- */
384
- export class SendResult {
385
- constructor(resultCode: any, txnHash: any, response: any, requestId: any, err: any);
386
- /**
387
- * 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.
388
- * @type {number}
389
- * @public
390
- */
391
- public resultCode: number;
392
- /**
393
- * 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.
394
- * @type {string}
395
- * @public
396
- */
397
- public txnHash: string;
398
- /**
399
- * 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.
400
- * @type {Object}
401
- * @public
402
- */
403
- public response: Object;
404
- /**
405
- * An unique id to represent the request. This can be null if request failed before it could be sent.
406
- * @type {string}
407
- * @public
408
- */
409
- public requestId: string;
410
- /**
411
- * 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.
412
- * @type {Error}
413
- * @public
414
- */
415
- public err: Error;
416
- }
417
- /**
418
- * @class
419
- * @constructor
420
- * @public
421
- * @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.
422
- * 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).
423
- */
424
- export class TransactionReceipt {
425
- /**
426
- * A hexadecimal string representing the total amount of gas used when this transaction was executed in the block.
427
- * @type {string}
428
- * @public
429
- */
430
- public cumulativeGasUsed: string;
431
- /**
432
- * A hexadecimal string representing the sum of the base fee and tip paid per unit of gas.
433
- * @type {string}
434
- * @public
435
- */
436
- public effectiveGasPrice: string;
437
- /**
438
- * A hexadecimal string representing the amount of gas used by this specific transaction alone.
439
- * @type {string}
440
- * @public
441
- */
442
- public gasUsed: string;
443
- /**
444
- * 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).
445
- * @type {string}
446
- * @public
447
- */
448
- public status: string;
449
- /**
450
- * Hash of the Transaction, to uniquely identify it. Is 66 bytes in length including 0x.
451
- * @type {string}
452
- * @public
453
- */
454
- public hash: string;
455
- /**
456
- * A hexadecimal string representing the transaction type. 0x0 is DefaultFeeTxType.
457
- * @type {string}
458
- * @public
459
- */
460
- public type: string;
461
- }
462
- /**
463
- * @class
464
- * @constructor
465
- * @public
466
- * @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).
467
- */
468
- export class TransactionDetails {
469
- /**
470
- * 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.
471
- * @type {string}
472
- * @public
473
- */
474
- public blockHash: string;
475
- /**
476
- * The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.
477
- * @type {number}
478
- * @public
479
- */
480
- public blockNumber: number;
481
- /**
482
- * A 66 character hexadecimal string representing the address the transaction is sent from.
483
- * @type {string}
484
- * @public
485
- */
486
- public from: string;
487
- /**
488
- * A hexadecimal string representing the gas provided for the transaction execution.
489
- * @type {string}
490
- * @public
491
- */
492
- public gas: string;
493
- /**
494
- * A hexadecimal string representing the gasPrice used for each paid gas, in Wei.
495
- * @type {string}
496
- * @public
497
- */
498
- public gasPrice: string;
499
- /**
500
- * A 66 character hexadecimal string representing the hash of the transaction.
501
- * @type {string}
502
- * @public
503
- */
504
- public hash: string;
505
- /**
506
- * A hexadecimal string representing the compiled code of a contract OR the hash of the invoked method signature and encoded parameters.
507
- * @type {string}
508
- * @public
509
- */
510
- public input: string;
511
- /**
512
- * 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.
513
- * @type {number}
514
- * @public
515
- */
516
- public nonce: number;
517
- /**
518
- * A 66 character hexadecimal string representing address the transaction is directed to.
519
- * @type {string}
520
- * @public
521
- */
522
- public to: string;
523
- /**
524
- * 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.
525
- * @type {string}
526
- * @public
527
- */
528
- public value: string;
529
- /**
530
- * The receipt of the transaction. This field will be null while the transaction is pending (not yet registered in the blockchain).
531
- * @type {TransactionReceipt}
532
- * @public
533
- */
534
- public receipt: TransactionReceipt;
535
- }
536
- /**
537
- * @class
538
- * @constructor
539
- * @public
540
- * @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).
541
- */
542
- export class TransactionDetailsResult {
543
- constructor(resultCode: any, transactionDetails: any, response: any, requestId: any, err: any);
544
- /**
545
- * 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.
546
- * @type {number}
547
- * @public
548
- */
549
- public resultCode: number;
550
- /**
551
- * An object of type TransactionDetails representing the transaction. This value is null if the value of resultCode is not 0.
552
- * @type {TransactionDetails}
553
- * @public
554
- */
555
- public transactionDetails: TransactionDetails;
556
- /**
557
- * 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.
558
- * @type {Object}
559
- * @public
560
- */
561
- public response: Object;
562
- /**
563
- * An unique id to represent the request. This can be null if request failed before it could be sent.
564
- * @type {string}
565
- * @public
566
- */
567
- public requestId: string;
568
- /**
569
- * 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.
570
- * @type {Error}
571
- * @public
572
- */
573
- public err: Error;
574
- }
575
- /**
576
- * @class
577
- * @constructor
578
- * @public
579
- * @classdesc This class represents a result from invoking the listAccountTransactionDetails function.
580
- */
581
- export class AccountTransactionsResult {
582
- constructor(resultCode: any, listAccountTransactionsResponse: any, response: any, requestId: any, err: any);
583
- /**
584
- * 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.
585
- * @type {number}
586
- * @public
587
- */
588
- public resultCode: number;
589
- /**
590
- * 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.
591
- * @type {ListAccountTransactionsResponse}
592
- * @public
593
- */
594
- public listAccountTransactionsResponse: ListAccountTransactionsResponse;
595
- /**
596
- * 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.
597
- * @type {Object}
598
- * @public
599
- */
600
- public response: Object;
601
- /**
602
- * An unique id to represent the request. This can be null if request failed before it could be sent.
603
- * @type {string}
604
- * @public
605
- */
606
- public requestId: string;
607
- /**
608
- * 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.
609
- * @type {Error}
610
- * @public
611
- */
612
- public err: Error;
613
- }
614
- /**
615
- * @class
616
- * @constructor
617
- * @public
618
- * @classdesc This class represents a list of account transactions returned by the listAccountTransactionDetails function.
619
- */
620
- export class ListAccountTransactionsResponse {
621
- /**
622
- * The number of pages available for listing.
623
- * @type {number}
624
- * @public
625
- */
626
- public pageCount: number;
627
- /**
628
- * An array of type AccountTransactionCompact, containing the list of transactions. Can be null if no items are available.
629
- * @type {(AccountTransactionCompact|Array)}
630
- * @public
631
- */
632
- public items: (AccountTransactionCompact | any[]);
633
- }
634
- /**
635
- * @class
636
- * @constructor
637
- * @public
638
- * @classdesc This class represents a transaction of an account. You should consider the transaction as succeeded only if the status field is 0x1 (success).
639
- */
640
- export class AccountTransactionCompact {
641
- /**
642
- * The number of the block that registered the transaction. This field can be null if the transaction was not registered in the blockchain.
643
- * @type {number}
644
- * @public
645
- */
646
- public blockNumber: number;
647
- /**
648
- * A 66 character hexadecimal string representing the address the transaction is sent from.
649
- * @type {string}
650
- * @public
651
- */
652
- public from: string;
653
- /**
654
- * A 66 character hexadecimal string representing the hash of the transaction.
655
- * @type {string}
656
- * @public
657
- */
658
- public hash: string;
659
- /**
660
- * A 66 character hexadecimal string representing address the transaction is directed to.
661
- * @type {string}
662
- * @public
663
- */
664
- public to: string;
665
- /**
666
- * 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.
667
- * @type {string}
668
- * @public
669
- */
670
- public value: string;
671
- /**
672
- * 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).
673
- * @type {string}
674
- * @public
675
- */
676
- public status: string;
677
- }
678
153
  /**
679
154
  * The newWalletSeedWords function creates a new wallet seed word list. The returned array can then be passed to the openWalletFromSeedWords function to create a new wallet.
680
155
  *
@@ -729,19 +204,74 @@ export function addressFromPublicKey(publicKey: number[]): string;
729
204
  /**
730
205
  * The scryptDeriveKey function derives a key from a secret and salt using the scrypt KDF.
731
206
  *
732
- * Note: Only the specific scrypt parameter set N=262144, r=8, p=1, dkLen=32 is supported
733
- * currently. Passing any other values returns null.
207
+ * Arbitrary scrypt parameters are supported. The classic set N=262144, r=8, p=1, dkLen=32
208
+ * remains fully supported and byte-for-byte compatible with previous versions.
734
209
  *
735
210
  * @function scryptDeriveKey
736
- * @param {string} secret - The secret/passphrase to derive the key from.
211
+ * @param {string|Uint8Array|number[]} secret - The secret/passphrase. A string is encoded as UTF-8 bytes.
212
+ * @param {Uint8Array|number[]} salt - The salt as a byte array.
213
+ * @param {number} N - The scrypt CPU/memory cost parameter (power of two, > 1).
214
+ * @param {number} r - The scrypt block size parameter.
215
+ * @param {number} p - The scrypt parallelization parameter.
216
+ * @param {number} dkLen - The derived key length in bytes.
217
+ * @return {number[]} - Returns the derived key as a byte array. Returns null if the operation failed or the parameters are invalid.
218
+ */
219
+ export function scryptDeriveKey(secret: string | Uint8Array | number[], salt: Uint8Array | number[], N: number, r: number, p: number, dkLen: number): number[];
220
+ /**
221
+ * The sha256 function computes the SHA-256 digest of the input.
222
+ *
223
+ * @function sha256
224
+ * @param {string|Uint8Array|number[]} data - The data to hash (string -> UTF-8 bytes).
225
+ * @return {number[]} - The 32-byte digest as a byte array. Returns null on invalid input.
226
+ */
227
+ export function sha256(data: string | Uint8Array | number[]): number[];
228
+ /**
229
+ * The sha512 function computes the SHA-512 digest of the input.
230
+ *
231
+ * @function sha512
232
+ * @param {string|Uint8Array|number[]} data - The data to hash (string -> UTF-8 bytes).
233
+ * @return {number[]} - The 64-byte digest as a byte array. Returns null on invalid input.
234
+ */
235
+ export function sha512(data: string | Uint8Array | number[]): number[];
236
+ /**
237
+ * The keccak256 function computes the Keccak-256 digest of the input.
238
+ * This is the Ethereum-style Keccak-256 (legacy padding), not SHA3-256.
239
+ *
240
+ * @function keccak256
241
+ * @param {string|Uint8Array|number[]} data - The data to hash (string -> UTF-8 bytes).
242
+ * @return {number[]} - The 32-byte digest as a byte array. Returns null on invalid input.
243
+ */
244
+ export function keccak256(data: string | Uint8Array | number[]): number[];
245
+ /**
246
+ * The ripemd160 function computes the RIPEMD-160 digest of the input.
247
+ *
248
+ * @function ripemd160
249
+ * @param {string|Uint8Array|number[]} data - The data to hash (string -> UTF-8 bytes).
250
+ * @return {number[]} - The 20-byte digest as a byte array. Returns null on invalid input.
251
+ */
252
+ export function ripemd160(data: string | Uint8Array | number[]): number[];
253
+ /**
254
+ * The computeHmac function computes an HMAC over the data using the given key.
255
+ *
256
+ * @function computeHmac
257
+ * @param {string} algorithm - The hash algorithm: "sha256" or "sha512".
258
+ * @param {string|Uint8Array|number[]} key - The HMAC key (string -> UTF-8 bytes).
259
+ * @param {string|Uint8Array|number[]} data - The data to authenticate (string -> UTF-8 bytes).
260
+ * @return {number[]} - The HMAC as a byte array. Returns null on invalid input.
261
+ */
262
+ export function computeHmac(algorithm: string, key: string | Uint8Array | number[], data: string | Uint8Array | number[]): number[];
263
+ /**
264
+ * The pbkdf2 function derives a key using PBKDF2.
265
+ *
266
+ * @function pbkdf2
267
+ * @param {string|Uint8Array|number[]} password - The password (string -> UTF-8 bytes).
737
268
  * @param {Uint8Array|number[]} salt - The salt as a byte array.
738
- * @param {number} N - The scrypt CPU/memory cost parameter. Must be 262144.
739
- * @param {number} r - The scrypt block size parameter. Must be 8.
740
- * @param {number} p - The scrypt parallelization parameter. Must be 1.
741
- * @param {number} dkLen - The derived key length in bytes. Must be 32.
742
- * @return {number[]} - Returns the 32-byte derived key as a byte array. Returns null if the operation failed or the parameters are unsupported.
269
+ * @param {number} iterations - The iteration count (positive integer).
270
+ * @param {number} keylen - The derived key length in bytes (positive integer).
271
+ * @param {string} algorithm - The PRF hash algorithm: "sha256" or "sha512".
272
+ * @return {number[]} - The derived key as a byte array. Returns null on invalid input.
743
273
  */
744
- export function scryptDeriveKey(secret: string, salt: Uint8Array | number[], N: number, r: number, p: number, dkLen: number): number[];
274
+ export function pbkdf2(password: string | Uint8Array | number[], salt: Uint8Array | number[], iterations: number, keylen: number, algorithm: string): number[];
745
275
  /**
746
276
  * The combinePublicKeySignature combines the public key and signature.
747
277
  *
@@ -834,8 +364,8 @@ export class TransactionSigningRequest {
834
364
  * With this function, you can set the gasLimit explicitly compared to signTransaction.
835
365
  * You can also pass data to be signed, such as when creating or invoking a smart contract.
836
366
  * Since the gas fee is fixed at 1000 coins for 21000 units of gas, there is no option to set the gas fee explicitly.
837
- * 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.
838
- * 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.
367
+ * This function is useful for offline (cold storage) wallets, where you can sign a transaction offline and then broadcast it from a connected device (for example, via a relay or RPC endpoint).
368
+ * Another usecase for this function is when you want to first store a signed transaction to a database, then queue it and finally broadcast the transaction from a connected device.
839
369
  *
840
370
  * @function signRawTransaction
841
371
  * @param {TransactionSigningRequest} transactionSigningRequest - An object of type TransactionSigningRequest with the transaction signing details.
@@ -844,13 +374,14 @@ export class TransactionSigningRequest {
844
374
  export function signRawTransaction(transactionSigningRequest: TransactionSigningRequest): SignResult;
845
375
  /**
846
376
  * Returns the gas price per unit of gas (per-gas-unit), in wei, for the signing context implied by keyType and fullSign.
847
- * The returned gasPrice is the price PER UNIT OF GAS, NOT the total transaction fee (total fee = gasPrice * gasLimit).
377
+ * The returned value is the price PER UNIT OF GAS, NOT the total transaction fee (total fee = gasPrice * gasLimit).
848
378
  * This mirrors the dynamic-fee gas price logic in quantum-coin-go core/types/dynamic_fee_tx.go.
849
379
  *
850
- * fullSign is ignored for keyType 5 (which always uses signing context 1). For keyType 3, fullSign selects the scheme: false = compact (context 0), true = full (context 2).
380
+ * fullSign is IGNORED for keyType 5 (KEY_TYPE_HYBRIDEDMLDSASLHDSA5), which always uses signing context 1.
381
+ * For keyType 3 (KEY_TYPE_HYBRIDEDMLDSASLHDSA), fullSign selects the scheme: false = compact (context 0), true = full (context 2).
851
382
  *
852
383
  * @function getGasPrice
853
- * @param {number} keyType - 3 (HYBRIDEDMLDSASLHDSA) or 5 (HYBRIDEDMLDSASLHDSA5).
384
+ * @param {number} keyType - 3 (KEY_TYPE_HYBRIDEDMLDSASLHDSA) or 5 (KEY_TYPE_HYBRIDEDMLDSASLHDSA5).
854
385
  * @param {boolean|null} [fullSign] - Optional. Use full (non-compact) signing for keyType 3. Ignored for keyType 5. Defaults to false.
855
386
  * @returns {{ resultCode: number, gasPrice: string|null }} resultCode 0 and gasPrice as a decimal wei string (per gas unit) on success; resultCode -940 with gasPrice null for an invalid keyType.
856
387
  */
@@ -1053,7 +584,7 @@ declare class SignResult {
1053
584
  public txnHash: string;
1054
585
  /**
1055
586
  * A payload representing the signed transaction.
1056
- * 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.
587
+ * To actually send a transaction, this payload can then be broadcast to the blockchain from a connected device (for example, via a relay or RPC endpoint).
1057
588
  * This value is null if the value of resultCode is not 0.
1058
589
  * @type {string}
1059
590
  * @public