quantum-coin-js-sdk 2.0.1 → 2.1.1

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 (233) hide show
  1. package/README.md +13 -0
  2. package/index.d.ts +9 -0
  3. package/index.js +37 -4
  4. package/package.json +12 -4
  5. package/wasmBase64.js +3 -2
  6. package/.gitignore +0 -4
  7. package/.idea/.name +0 -1
  8. package/.idea/modules.xml +0 -8
  9. package/.idea/quantum-coin-js-sdk.iml +0 -12
  10. package/.idea/vcs.xml +0 -6
  11. package/.vs/ProjectSettings.json +0 -3
  12. package/.vs/VSWorkspaceState.json +0 -8
  13. package/.vs/quantum-coin-js-sdk/FileContentIndex/a9d6de82-cfc3-4c22-ac38-06d706ff3673.vsidx +0 -0
  14. package/.vs/quantum-coin-js-sdk/FileContentIndex/fdc816df-1898-4153-99f2-c69ef4c2283b.vsidx +0 -0
  15. package/.vs/quantum-coin-js-sdk/config/applicationhost.config +0 -1011
  16. package/.vs/quantum-coin-js-sdk/v17/.wsuo +0 -0
  17. package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.backup.json +0 -39
  18. package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.json +0 -57
  19. package/.vs/slnx.sqlite +0 -0
  20. package/example/README.md +0 -14
  21. package/example/conversion-example.js +0 -19
  22. package/example/example-create-contract.js +0 -396
  23. package/example/example-encode-decode-rlp.js +0 -225
  24. package/example/example-event-pack-unpack.js +0 -391
  25. package/example/example-misc.js +0 -96
  26. package/example/example-token-pack-unpack.js +0 -960
  27. package/example/example-wallet-version4.js +0 -34
  28. package/example/example-wallet.js +0 -39
  29. package/example/example.js +0 -115
  30. package/example/node_modules/.bin/sdkgen +0 -16
  31. package/example/node_modules/.bin/sdkgen.cmd +0 -17
  32. package/example/node_modules/.bin/sdkgen.ps1 +0 -28
  33. package/example/node_modules/.package-lock.json +0 -51
  34. package/example/node_modules/quantumcoin/.github/workflows/publish-npmjs.yaml +0 -22
  35. package/example/node_modules/quantumcoin/LICENSE +0 -21
  36. package/example/node_modules/quantumcoin/README-SDK.md +0 -828
  37. package/example/node_modules/quantumcoin/README.md +0 -197
  38. package/example/node_modules/quantumcoin/config.d.ts +0 -50
  39. package/example/node_modules/quantumcoin/config.js +0 -123
  40. package/example/node_modules/quantumcoin/examples/AllSolidityTypes.sol +0 -184
  41. package/example/node_modules/quantumcoin/examples/SimpleIERC20.sol +0 -74
  42. package/example/node_modules/quantumcoin/examples/events.js +0 -41
  43. package/example/node_modules/quantumcoin/examples/events.ts +0 -35
  44. package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.js +0 -100
  45. package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.ts +0 -77
  46. package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.js +0 -100
  47. package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.ts +0 -77
  48. package/example/node_modules/quantumcoin/examples/example.js +0 -67
  49. package/example/node_modules/quantumcoin/examples/example.ts +0 -56
  50. package/example/node_modules/quantumcoin/examples/offline-signing.js +0 -77
  51. package/example/node_modules/quantumcoin/examples/offline-signing.ts +0 -65
  52. package/example/node_modules/quantumcoin/examples/package-lock.json +0 -596
  53. package/example/node_modules/quantumcoin/examples/package.json +0 -32
  54. package/example/node_modules/quantumcoin/examples/read-operations.js +0 -32
  55. package/example/node_modules/quantumcoin/examples/read-operations.ts +0 -31
  56. package/example/node_modules/quantumcoin/examples/sdk-generator-erc20.inline.json +0 -251
  57. package/example/node_modules/quantumcoin/examples/solidity-types.ts +0 -43
  58. package/example/node_modules/quantumcoin/examples/wallet-offline.js +0 -36
  59. package/example/node_modules/quantumcoin/examples/wallet-offline.ts +0 -26
  60. package/example/node_modules/quantumcoin/generate-sdk.js +0 -1846
  61. package/example/node_modules/quantumcoin/index.js +0 -12
  62. package/example/node_modules/quantumcoin/package.json +0 -95
  63. package/example/node_modules/quantumcoin/scripts/copy-declarations.js +0 -31
  64. package/example/node_modules/quantumcoin/scripts/run-all-one-by-one.js +0 -151
  65. package/example/node_modules/quantumcoin/src/abi/fragments.d.ts +0 -42
  66. package/example/node_modules/quantumcoin/src/abi/fragments.js +0 -63
  67. package/example/node_modules/quantumcoin/src/abi/index.d.ts +0 -13
  68. package/example/node_modules/quantumcoin/src/abi/index.js +0 -9
  69. package/example/node_modules/quantumcoin/src/abi/interface.d.ts +0 -128
  70. package/example/node_modules/quantumcoin/src/abi/interface.js +0 -605
  71. package/example/node_modules/quantumcoin/src/abi/js-abi-coder.d.ts +0 -8
  72. package/example/node_modules/quantumcoin/src/abi/js-abi-coder.js +0 -538
  73. package/example/node_modules/quantumcoin/src/constants.d.ts +0 -61
  74. package/example/node_modules/quantumcoin/src/constants.js +0 -94
  75. package/example/node_modules/quantumcoin/src/contract/contract-factory.d.ts +0 -28
  76. package/example/node_modules/quantumcoin/src/contract/contract-factory.js +0 -111
  77. package/example/node_modules/quantumcoin/src/contract/contract.d.ts +0 -113
  78. package/example/node_modules/quantumcoin/src/contract/contract.js +0 -408
  79. package/example/node_modules/quantumcoin/src/contract/index.d.ts +0 -9
  80. package/example/node_modules/quantumcoin/src/contract/index.js +0 -9
  81. package/example/node_modules/quantumcoin/src/errors/index.d.ts +0 -92
  82. package/example/node_modules/quantumcoin/src/errors/index.js +0 -200
  83. package/example/node_modules/quantumcoin/src/generator/index.d.ts +0 -81
  84. package/example/node_modules/quantumcoin/src/generator/index.js +0 -1571
  85. package/example/node_modules/quantumcoin/src/index.d.ts +0 -122
  86. package/example/node_modules/quantumcoin/src/index.js +0 -41
  87. package/example/node_modules/quantumcoin/src/internal/hex.d.ts +0 -68
  88. package/example/node_modules/quantumcoin/src/internal/hex.js +0 -180
  89. package/example/node_modules/quantumcoin/src/providers/extra-providers.d.ts +0 -139
  90. package/example/node_modules/quantumcoin/src/providers/extra-providers.js +0 -614
  91. package/example/node_modules/quantumcoin/src/providers/index.d.ts +0 -17
  92. package/example/node_modules/quantumcoin/src/providers/index.js +0 -10
  93. package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.d.ts +0 -12
  94. package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.js +0 -89
  95. package/example/node_modules/quantumcoin/src/providers/provider.d.ts +0 -206
  96. package/example/node_modules/quantumcoin/src/providers/provider.js +0 -524
  97. package/example/node_modules/quantumcoin/src/types/index.d.ts +0 -214
  98. package/example/node_modules/quantumcoin/src/types/index.js +0 -9
  99. package/example/node_modules/quantumcoin/src/utils/address.d.ts +0 -58
  100. package/example/node_modules/quantumcoin/src/utils/address.js +0 -144
  101. package/example/node_modules/quantumcoin/src/utils/encoding.d.ts +0 -120
  102. package/example/node_modules/quantumcoin/src/utils/encoding.js +0 -306
  103. package/example/node_modules/quantumcoin/src/utils/fixednumber.d.ts +0 -57
  104. package/example/node_modules/quantumcoin/src/utils/fixednumber.js +0 -366
  105. package/example/node_modules/quantumcoin/src/utils/hashing.d.ts +0 -76
  106. package/example/node_modules/quantumcoin/src/utils/hashing.js +0 -298
  107. package/example/node_modules/quantumcoin/src/utils/index.d.ts +0 -63
  108. package/example/node_modules/quantumcoin/src/utils/index.js +0 -14
  109. package/example/node_modules/quantumcoin/src/utils/result.d.ts +0 -57
  110. package/example/node_modules/quantumcoin/src/utils/result.js +0 -128
  111. package/example/node_modules/quantumcoin/src/utils/rlp.d.ts +0 -12
  112. package/example/node_modules/quantumcoin/src/utils/rlp.js +0 -215
  113. package/example/node_modules/quantumcoin/src/utils/units.d.ts +0 -29
  114. package/example/node_modules/quantumcoin/src/utils/units.js +0 -107
  115. package/example/node_modules/quantumcoin/src/wallet/index.d.ts +0 -10
  116. package/example/node_modules/quantumcoin/src/wallet/index.js +0 -8
  117. package/example/node_modules/quantumcoin/src/wallet/wallet.d.ts +0 -192
  118. package/example/node_modules/quantumcoin/src/wallet/wallet.js +0 -713
  119. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.js +0 -207
  120. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.ts +0 -191
  121. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.fixtures.js +0 -231
  122. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.js +0 -387
  123. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.ts +0 -350
  124. package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.js +0 -165
  125. package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.ts +0 -160
  126. package/example/node_modules/quantumcoin/test/e2e/helpers.js +0 -59
  127. package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.js +0 -141
  128. package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.ts +0 -128
  129. package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.js +0 -168
  130. package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.ts +0 -141
  131. package/example/node_modules/quantumcoin/test/e2e/transactional.test.js +0 -245
  132. package/example/node_modules/quantumcoin/test/e2e/transactional.test.ts +0 -208
  133. package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.js +0 -407
  134. package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.ts +0 -337
  135. package/example/node_modules/quantumcoin/test/fixtures/ConstructorParam.sol +0 -23
  136. package/example/node_modules/quantumcoin/test/fixtures/MultiContracts.sol +0 -37
  137. package/example/node_modules/quantumcoin/test/fixtures/SimpleStorage.sol +0 -18
  138. package/example/node_modules/quantumcoin/test/fixtures/StakingContract.abi.json +0 -1
  139. package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.js +0 -49
  140. package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.ts +0 -44
  141. package/example/node_modules/quantumcoin/test/integration/provider.test.js +0 -88
  142. package/example/node_modules/quantumcoin/test/integration/provider.test.ts +0 -85
  143. package/example/node_modules/quantumcoin/test/integration/ws-provider.test.js +0 -41
  144. package/example/node_modules/quantumcoin/test/integration/ws-provider.test.ts +0 -38
  145. package/example/node_modules/quantumcoin/test/security/abi-decoder-bounds.test.js +0 -122
  146. package/example/node_modules/quantumcoin/test/security/contract-overrides.test.js +0 -112
  147. package/example/node_modules/quantumcoin/test/security/generator-injection.test.js +0 -195
  148. package/example/node_modules/quantumcoin/test/security/malformed-input.test.js +0 -330
  149. package/example/node_modules/quantumcoin/test/security/malformed-input.test.ts +0 -35
  150. package/example/node_modules/quantumcoin/test/security/rpc-numeric-bounds.test.js +0 -81
  151. package/example/node_modules/quantumcoin/test/security/rpc-trust.test.js +0 -202
  152. package/example/node_modules/quantumcoin/test/unit/_encrypted-output.txt +0 -6
  153. package/example/node_modules/quantumcoin/test/unit/_log-encrypted-jsons.js +0 -45
  154. package/example/node_modules/quantumcoin/test/unit/_write-keystore-fixture.js +0 -16
  155. package/example/node_modules/quantumcoin/test/unit/abi-interface.test.js +0 -110
  156. package/example/node_modules/quantumcoin/test/unit/abi-interface.test.ts +0 -109
  157. package/example/node_modules/quantumcoin/test/unit/address-wallet.test.js +0 -923
  158. package/example/node_modules/quantumcoin/test/unit/address-wallet.test.ts +0 -877
  159. package/example/node_modules/quantumcoin/test/unit/browser-provider.test.js +0 -85
  160. package/example/node_modules/quantumcoin/test/unit/browser-provider.test.ts +0 -79
  161. package/example/node_modules/quantumcoin/test/unit/contract.test.js +0 -85
  162. package/example/node_modules/quantumcoin/test/unit/contract.test.ts +0 -83
  163. package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.js +0 -127
  164. package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.ts +0 -91
  165. package/example/node_modules/quantumcoin/test/unit/errors.test.js +0 -77
  166. package/example/node_modules/quantumcoin/test/unit/errors.test.ts +0 -76
  167. package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.js +0 -55
  168. package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.ts +0 -54
  169. package/example/node_modules/quantumcoin/test/unit/fixednumber.test.js +0 -656
  170. package/example/node_modules/quantumcoin/test/unit/fixednumber.test.ts +0 -660
  171. package/example/node_modules/quantumcoin/test/unit/fixtures/encrypted-keystores-48-32-36.js +0 -9
  172. package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.js +0 -42
  173. package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.ts +0 -41
  174. package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.js +0 -113
  175. package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.ts +0 -110
  176. package/example/node_modules/quantumcoin/test/unit/generator.test.js +0 -149
  177. package/example/node_modules/quantumcoin/test/unit/generator.test.ts +0 -148
  178. package/example/node_modules/quantumcoin/test/unit/hashing.test.js +0 -64
  179. package/example/node_modules/quantumcoin/test/unit/hashing.test.ts +0 -63
  180. package/example/node_modules/quantumcoin/test/unit/init.test.js +0 -39
  181. package/example/node_modules/quantumcoin/test/unit/init.test.ts +0 -38
  182. package/example/node_modules/quantumcoin/test/unit/interface.test.js +0 -56
  183. package/example/node_modules/quantumcoin/test/unit/interface.test.ts +0 -54
  184. package/example/node_modules/quantumcoin/test/unit/internal-hex.test.js +0 -81
  185. package/example/node_modules/quantumcoin/test/unit/internal-hex.test.ts +0 -80
  186. package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.js +0 -98
  187. package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.ts +0 -64
  188. package/example/node_modules/quantumcoin/test/unit/providers.test.js +0 -252
  189. package/example/node_modules/quantumcoin/test/unit/providers.test.ts +0 -251
  190. package/example/node_modules/quantumcoin/test/unit/result.test.js +0 -80
  191. package/example/node_modules/quantumcoin/test/unit/result.test.ts +0 -79
  192. package/example/node_modules/quantumcoin/test/unit/solidity-types.test.js +0 -49
  193. package/example/node_modules/quantumcoin/test/unit/solidity-types.test.ts +0 -39
  194. package/example/node_modules/quantumcoin/test/unit/utils.test.js +0 -57
  195. package/example/node_modules/quantumcoin/test/unit/utils.test.ts +0 -56
  196. package/example/node_modules/quantumcoin/test/verbose-logger.js +0 -74
  197. package/example/node_modules/quantumcoin/tsconfig.build.json +0 -14
  198. package/example/node_modules/seed-words/.github/workflows/publish-npmjs.yaml +0 -22
  199. package/example/node_modules/seed-words/BUILD.md +0 -7
  200. package/example/node_modules/seed-words/LICENSE +0 -121
  201. package/example/node_modules/seed-words/README.md +0 -67
  202. package/example/node_modules/seed-words/dist/seedwords.d.ts +0 -39
  203. package/example/node_modules/seed-words/package.json +0 -27
  204. package/example/node_modules/seed-words/seedwords.js +0 -315
  205. package/example/node_modules/seed-words/seedwords.txt +0 -65536
  206. package/example/node_modules/seed-words/tsconfig.json +0 -21
  207. package/example/package-lock.json +0 -60
  208. package/example/package.json +0 -15
  209. package/scripts/build-browser-tests.js +0 -29
  210. package/scripts/build-wasm.js +0 -85
  211. package/tests/browser/bundle.js +0 -97643
  212. package/tests/browser/entry.js +0 -57
  213. package/tests/browser/harness.html +0 -20
  214. package/tests/browser/run-browser.js +0 -50
  215. package/tests/encrypted-32.json +0 -1
  216. package/tests/encrypted-36.json +0 -1
  217. package/tests/encrypted-48.json +0 -1
  218. package/tests/generate-verify-vectors.js +0 -88
  219. package/tests/get-gas-price.test.js +0 -59
  220. package/tests/hashing.test.js +0 -34
  221. package/tests/non-transactional.preinit.test.js +0 -33
  222. package/tests/non-transactional.test.js +0 -1318
  223. package/tests/sign-raw-keytype5-context-null.test.js +0 -105
  224. package/tests/sign-raw-transaction.test.js +0 -194
  225. package/tests/sign-verify.test.js +0 -308
  226. package/tests/specs/assert.js +0 -74
  227. package/tests/specs/crypto.spec.js +0 -104
  228. package/tests/specs/hex.js +0 -31
  229. package/tests/specs/preinit.spec.js +0 -19
  230. package/tests/specs/sign.spec.js +0 -90
  231. package/tests/specs/wallet.spec.js +0 -98
  232. package/tests/transactional.rpc.test.js +0 -102
  233. package/tests/verify-vectors.json +0 -95035
@@ -1,12 +0,0 @@
1
- /**
2
- * @fileoverview Package entrypoint for `require("quantumcoin")`.
3
- *
4
- * This exports the ethers.js v6 compatible API surface implemented in `src/`,
5
- * plus the initialization utilities from `config.js`.
6
- */
7
-
8
- module.exports = {
9
- ...require("./src"),
10
- ...require("./config"),
11
- };
12
-
@@ -1,95 +0,0 @@
1
- {
2
- "name": "quantumcoin",
3
- "version": "7.0.14",
4
- "description": "QuantumCoin.js - a post quantum cryptography SDK for QuantumCoin",
5
- "main": "index.js",
6
- "types": "src/index.d.ts",
7
- "typesVersions": {
8
- "*": {
9
- "types": [
10
- "src/types/index.d.ts"
11
- ],
12
- "config": [
13
- "config.d.ts"
14
- ]
15
- }
16
- },
17
- "exports": {
18
- ".": {
19
- "types": "./src/index.d.ts",
20
- "default": "./index.js"
21
- },
22
- "./config": {
23
- "types": "./config.d.ts",
24
- "default": "./config.js"
25
- },
26
- "./types": {
27
- "types": "./src/types/index.d.ts",
28
- "default": "./src/types/index.js"
29
- },
30
- "./package.json": "./package.json"
31
- },
32
- "scripts": {
33
- "test": "node --test \"test/unit/**/*.test.js\" \"test/integration/**/*.test.js\" \"test/security/**/*.test.js\" \"test/e2e/*.test.js\"",
34
- "test:unit": "node --test \"test/unit/**/*.test.js\"",
35
- "test:integration": "node --test \"test/integration/**/*.test.js\"",
36
- "test:security": "node --test \"test/security/**/*.test.js\"",
37
- "test:non-transactional": "node --test \"test/unit/**/*.test.js\" \"test/integration/**/*.test.js\" \"test/security/**/*.test.js\"",
38
- "test:e2e": "node --test --test-concurrency=1 \"test/e2e/*.test.js\"",
39
- "test:generator-sdk": "node --test \"test/unit/generate-contract-cli.test.js\" \"test/unit/generator.test.js\" \"test/unit/generate-sdk-artifacts-json.test.js\" && node --test --test-concurrency=1 \"test/e2e/typed-generator.e2e.test.js\" \"test/e2e/simple-erc20.generated-sdks.e2e.test.js\" \"test/e2e/all-solidity-types.generated-sdks.e2e.test.js\"",
40
- "test:ts:generator-sdk": "npx tsx --test \"test/unit/generate-contract-cli.test.ts\" \"test/unit/generator.test.ts\" \"test/unit/generate-sdk-artifacts-json.test.ts\" && npx tsx --test --test-concurrency=1 \"test/e2e/typed-generator.e2e.test.ts\" \"test/e2e/simple-erc20.generated-sdks.e2e.test.ts\" \"test/e2e/all-solidity-types.generated-sdks.e2e.test.ts\"",
41
- "test:ts": "npx tsx --test \"test/unit/**/*.test.ts\" \"test/integration/**/*.test.ts\" \"test/security/**/*.test.ts\"",
42
- "test:ts:unit": "npx tsx --test \"test/unit/**/*.test.ts\"",
43
- "test:ts:integration": "npx tsx --test \"test/integration/**/*.test.ts\"",
44
- "test:ts:security": "npx tsx --test \"test/security/**/*.test.ts\"",
45
- "test:ts:e2e": "npx tsx --test --test-concurrency=1 \"test/e2e/*.test.ts\" \"test/e2e/*.e2e.test.ts\" \"test/e2e/*.dynamic.test.ts\"",
46
- "example": "node examples/example.js",
47
- "example:ts": "npx tsx examples/example.ts",
48
- "example:provider": "node examples/example.js",
49
- "example:wallet": "node examples/wallet-offline.js",
50
- "example:wallet:ts": "npx tsx examples/wallet-offline.ts",
51
- "example:contract:read": "node examples/read-operations.js",
52
- "example:contract:read:ts": "npx tsx examples/read-operations.ts",
53
- "example:events": "node examples/events.js",
54
- "example:events:ts": "npx tsx examples/events.ts",
55
- "example:offline-signing": "node examples/offline-signing.js",
56
- "example:offline-signing:ts": "npx tsx examples/offline-signing.ts",
57
- "example:generator-js": "node examples/example-generator-sdk-js.js",
58
- "example:generator-js:ts": "npx tsx examples/example-generator-sdk-js.ts",
59
- "example:generator-ts": "node examples/example-generator-sdk-ts.js",
60
- "example:generator-ts:ts": "npx tsx examples/example-generator-sdk-ts.ts",
61
- "examples": "node examples/example.js && node examples/wallet-offline.js && node examples/read-operations.js && node examples/events.js && node examples/example-generator-sdk-js.js && node examples/example-generator-sdk-ts.js",
62
- "examples:ts": "npx tsx examples/example.ts && npx tsx examples/wallet-offline.ts && npx tsx examples/read-operations.ts && npx tsx examples/events.ts && npx tsx examples/example-generator-sdk-js.ts && npx tsx examples/example-generator-sdk-ts.ts",
63
- "build": "npx -p typescript tsc -p tsconfig.build.json && node scripts/copy-declarations.js"
64
- },
65
- "repository": {
66
- "type": "git",
67
- "url": "git+https://github.com/quantumcoinproject/quantumcoin.js.git"
68
- },
69
- "files": [
70
- "**"
71
- ],
72
- "keywords": [
73
- "cryptography",
74
- "quantum coins",
75
- "quantum coin",
76
- "quantumcoin",
77
- "blockchain"
78
- ],
79
- "author": "QuantumCoin Community",
80
- "license": "MIT",
81
- "bugs": {
82
- "url": "https://github.com/quantumcoinproject/quantumcoin.js/issues"
83
- },
84
- "homepage": "https://github.com/quantumcoinproject/quantumcoin.js#readme",
85
- "bin": {
86
- "sdkgen": "./generate-sdk.js"
87
- },
88
- "devDependencies": {
89
- "tsx": "^4.19.0"
90
- },
91
- "dependencies": {
92
- "seed-words": "^1.0.2",
93
- "quantum-coin-js-sdk": "1.0.36"
94
- }
95
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * Copy generated .d.ts from dist/ into src/ so that package types stay in sync
3
- * with the declarations emitted by `tsc` from JSDoc in the .js sources.
4
- * Run after `npm run build`.
5
- */
6
- const fs = require("fs");
7
- const path = require("path");
8
-
9
- const distDir = path.join(__dirname, "..", "dist");
10
- const srcDir = path.join(__dirname, "..", "src");
11
-
12
- if (!fs.existsSync(distDir)) {
13
- console.warn("scripts/copy-declarations.js: dist/ not found, run build first.");
14
- process.exit(0);
15
- }
16
-
17
- function copyRecursive(from, to) {
18
- for (const name of fs.readdirSync(from)) {
19
- const fromPath = path.join(from, name);
20
- const toPath = path.join(to, name);
21
- if (fs.statSync(fromPath).isDirectory()) {
22
- if (!fs.existsSync(toPath)) fs.mkdirSync(toPath, { recursive: true });
23
- copyRecursive(fromPath, toPath);
24
- } else {
25
- fs.copyFileSync(fromPath, toPath);
26
- }
27
- }
28
- }
29
-
30
- copyRecursive(distDir, srcDir);
31
- console.log("Declarations copied from dist/ to src/.");
@@ -1,151 +0,0 @@
1
- /**
2
- * Run all tests and examples one by one with process.env (set QC_RPC_URL, QC_SOLC_PATH).
3
- * Prints a status table at the end.
4
- * Usage: node scripts/run-all-one-by-one.js
5
- */
6
- const { spawnSync } = require("node:child_process");
7
- const path = require("node:path");
8
- const fs = require("node:fs");
9
-
10
- const repoRoot = path.resolve(__dirname, "..");
11
- const isWin = process.platform === "win32";
12
-
13
- function run(cmd, args, opts = {}) {
14
- const cwd = opts.cwd || repoRoot;
15
- const env = { ...process.env, ...opts.env };
16
- const res = spawnSync(cmd, args, {
17
- cwd,
18
- env,
19
- encoding: "utf8",
20
- stdio: "pipe",
21
- shell: false,
22
- windowsHide: true,
23
- timeout: opts.timeout ?? 120000,
24
- });
25
- return { ...res, status: res.status ?? (res.signal ? 1 : 0) };
26
- }
27
-
28
- function runShell(cmdLine, opts = {}) {
29
- const cwd = opts.cwd || repoRoot;
30
- const env = { ...process.env, ...opts.env };
31
- if (isWin) {
32
- return spawnSync("cmd.exe", ["/d", "/s", "/c", cmdLine], {
33
- cwd,
34
- env,
35
- encoding: "utf8",
36
- stdio: "pipe",
37
- windowsHide: true,
38
- timeout: opts.timeout ?? 120000,
39
- });
40
- }
41
- return spawnSync("sh", ["-c", cmdLine], {
42
- cwd,
43
- env,
44
- encoding: "utf8",
45
- stdio: "pipe",
46
- timeout: opts.timeout ?? 120000,
47
- });
48
- }
49
-
50
- const results = [];
51
-
52
- function add(name, ok, errMsg = "") {
53
- results.push({ name, status: ok ? "PASS" : "FAIL", err: errMsg });
54
- process.stdout.write(ok ? "." : "F");
55
- }
56
-
57
- // Unit tests (node --test single file)
58
- const unitDir = path.join(repoRoot, "test", "unit");
59
- const unitFiles = fs.readdirSync(unitDir)
60
- .filter((f) => f.endsWith(".test.js"))
61
- .sort();
62
- for (const f of unitFiles) {
63
- const name = `unit / ${f}`;
64
- const r = run(process.execPath, ["--test", path.join(unitDir, f)], { timeout: 60000 });
65
- add(name, r.status === 0, r.stderr || r.stdout);
66
- }
67
-
68
- // Integration
69
- const intDir = path.join(repoRoot, "test", "integration");
70
- const intFiles = fs.readdirSync(intDir)
71
- .filter((f) => f.endsWith(".test.js"))
72
- .sort();
73
- for (const f of intFiles) {
74
- const name = `integration / ${f}`;
75
- const r = run(process.execPath, ["--test", path.join(intDir, f)], { timeout: 60000 });
76
- add(name, r.status === 0, r.stderr || r.stdout);
77
- }
78
-
79
- // Security
80
- const secDir = path.join(repoRoot, "test", "security");
81
- const secFiles = fs.readdirSync(secDir)
82
- .filter((f) => f.endsWith(".test.js"))
83
- .sort();
84
- for (const f of secFiles) {
85
- const name = `security / ${f}`;
86
- const r = run(process.execPath, ["--test", path.join(secDir, f)], { timeout: 60000 });
87
- add(name, r.status === 0, r.stderr || r.stdout);
88
- }
89
-
90
- // E2E (one by one, longer timeout)
91
- const e2eDir = path.join(repoRoot, "test", "e2e");
92
- const e2eFiles = fs.readdirSync(e2eDir)
93
- .filter((f) => f.endsWith(".test.js"))
94
- .sort();
95
- for (const f of e2eFiles) {
96
- const name = `e2e / ${f}`;
97
- const r = run(process.execPath, ["--test", "--test-concurrency=1", path.join(e2eDir, f)], { timeout: 180000 });
98
- add(name, r.status === 0, r.stderr || r.stdout);
99
- }
100
-
101
- // Examples (JS)
102
- const examples = [
103
- ["example.js", [process.execPath, "examples/example.js"]],
104
- ["wallet-offline.js", [process.execPath, "examples/wallet-offline.js"]],
105
- ["read-operations.js", [process.execPath, "examples/read-operations.js"]],
106
- ["events.js", [process.execPath, "examples/events.js"]],
107
- ["offline-signing.js", [process.execPath, "examples/offline-signing.js"]],
108
- ["example-generator-sdk-js.js", [process.execPath, "examples/example-generator-sdk-js.js"]],
109
- ["example-generator-sdk-ts.js", [process.execPath, "examples/example-generator-sdk-ts.js"]],
110
- ];
111
- for (const [label, [cmd, ...args]] of examples) {
112
- const r = run(cmd, args, { timeout: 90000 });
113
- add(`example / ${label}`, r.status === 0, r.stderr || r.stdout);
114
- }
115
-
116
- // Examples (TS via npx tsx)
117
- const examplesTs = [
118
- "example.ts",
119
- "wallet-offline.ts",
120
- "read-operations.ts",
121
- "events.ts",
122
- "offline-signing.ts",
123
- "example-generator-sdk-js.ts",
124
- "example-generator-sdk-ts.ts",
125
- ];
126
- for (const f of examplesTs) {
127
- const name = `example / ${f}`;
128
- const r = runShell(`npx tsx examples/${f}`, { timeout: 90000 });
129
- const status = r.status ?? (r.signal ? 1 : 0);
130
- add(name, status === 0, r.stderr || r.stdout);
131
- }
132
-
133
- // Print table
134
- console.log("\n\n| Category | Item | Status |");
135
- console.log("|------------|------|--------|");
136
- let lastCat = "";
137
- for (const { name, status } of results) {
138
- const [cat, item] = name.split(" / ");
139
- const catDisplay = cat !== lastCat ? cat : "";
140
- lastCat = cat;
141
- console.log(`| ${catDisplay.padEnd(10)} | ${item} | ${status} |`);
142
- }
143
- const passed = results.filter((r) => r.status === "PASS").length;
144
- const failed = results.filter((r) => r.status === "FAIL").length;
145
- console.log("\nTotal:", passed, "passed,", failed, "failed.");
146
- if (failed > 0) {
147
- console.log("\nFailed:");
148
- results.filter((r) => r.status === "FAIL").forEach((r) => console.log(" -", r.name, "\n", r.err.slice(0, 500)));
149
- process.exit(1);
150
- }
151
- process.exit(0);
@@ -1,42 +0,0 @@
1
- /**
2
- * @fileoverview Minimal ABI fragment classes (ethers.js v6 compatible surface).
3
- *
4
- * This SDK keeps fragment handling lightweight and delegates ABI encoding/decoding
5
- * to `quantum-coin-js-sdk` (WASM).
6
- */
7
- export class Fragment {
8
- /**
9
- * @param {any} fragment
10
- */
11
- constructor(fragment: any);
12
- type: any;
13
- name: any;
14
- inputs: any;
15
- outputs: any;
16
- stateMutability: any;
17
- anonymous: any;
18
- /**
19
- * Formats the fragment.
20
- * @param {string=} format
21
- * @returns {string}
22
- */
23
- format(format?: string | undefined): string;
24
- /**
25
- * @returns {any}
26
- */
27
- toJSON(): any;
28
- }
29
- export class NamedFragment extends Fragment {
30
- }
31
- export class FunctionFragment extends NamedFragment {
32
- }
33
- export class EventFragment extends NamedFragment {
34
- }
35
- export class ErrorFragment extends NamedFragment {
36
- }
37
- export class ConstructorFragment extends Fragment {
38
- }
39
- export class StructFragment extends Fragment {
40
- }
41
- export class FallbackFragment extends Fragment {
42
- }
@@ -1,63 +0,0 @@
1
- /**
2
- * @fileoverview Minimal ABI fragment classes (ethers.js v6 compatible surface).
3
- *
4
- * This SDK keeps fragment handling lightweight and delegates ABI encoding/decoding
5
- * to `quantum-coin-js-sdk` (WASM).
6
- */
7
-
8
- class Fragment {
9
- /**
10
- * @param {any} fragment
11
- */
12
- constructor(fragment) {
13
- this.type = fragment?.type;
14
- this.name = fragment?.name;
15
- this.inputs = fragment?.inputs || [];
16
- this.outputs = fragment?.outputs || [];
17
- this.stateMutability = fragment?.stateMutability;
18
- this.anonymous = fragment?.anonymous;
19
- }
20
-
21
- /**
22
- * Formats the fragment.
23
- * @param {string=} format
24
- * @returns {string}
25
- */
26
- format(format) {
27
- // For now, return JSON-ish format (compatible enough for tooling).
28
- // ethers supports "sighash", "full", etc.
29
- void format;
30
- return JSON.stringify(this.toJSON());
31
- }
32
-
33
- /**
34
- * @returns {any}
35
- */
36
- toJSON() {
37
- const out = {};
38
- for (const k of ["type", "name", "inputs", "outputs", "stateMutability", "anonymous"]) {
39
- if (this[k] != null) out[k] = this[k];
40
- }
41
- return out;
42
- }
43
- }
44
-
45
- class NamedFragment extends Fragment {}
46
- class FunctionFragment extends NamedFragment {}
47
- class EventFragment extends NamedFragment {}
48
- class ErrorFragment extends NamedFragment {}
49
- class ConstructorFragment extends Fragment {}
50
- class StructFragment extends Fragment {}
51
- class FallbackFragment extends Fragment {}
52
-
53
- module.exports = {
54
- Fragment,
55
- NamedFragment,
56
- FunctionFragment,
57
- EventFragment,
58
- ErrorFragment,
59
- ConstructorFragment,
60
- StructFragment,
61
- FallbackFragment,
62
- };
63
-
@@ -1,13 +0,0 @@
1
- declare const _exports: {
2
- Interface: typeof import("./interface").Interface;
3
- AbiCoder: typeof import("./interface").AbiCoder;
4
- Fragment: typeof import("./fragments").Fragment;
5
- NamedFragment: typeof import("./fragments").NamedFragment;
6
- FunctionFragment: typeof import("./fragments").FunctionFragment;
7
- EventFragment: typeof import("./fragments").EventFragment;
8
- ErrorFragment: typeof import("./fragments").ErrorFragment;
9
- ConstructorFragment: typeof import("./fragments").ConstructorFragment;
10
- StructFragment: typeof import("./fragments").StructFragment;
11
- FallbackFragment: typeof import("./fragments").FallbackFragment;
12
- };
13
- export = _exports;
@@ -1,9 +0,0 @@
1
- /**
2
- * @fileoverview ABI exports.
3
- */
4
-
5
- module.exports = {
6
- ...require("./fragments"),
7
- ...require("./interface"),
8
- };
9
-
@@ -1,128 +0,0 @@
1
- export class Interface {
2
- /**
3
- * @param {any[]|Interface} abi
4
- */
5
- constructor(abi: any[] | Interface);
6
- abi: any;
7
- _abiJson: string;
8
- _qcsdkAbi: any[];
9
- _qcsdkAbiJson: string;
10
- /**
11
- * Returns JSON format of ABI.
12
- * @returns {string}
13
- */
14
- formatJson(): string;
15
- /**
16
- * Internal: normalized ABI JSON for qcsdk.
17
- * @returns {string}
18
- */
19
- _qcsdkFormatJson(): string;
20
- /**
21
- * Internal: normalize argument values for qcsdk based on original ABI params.
22
- * @param {Array<any>} params
23
- * @param {Array<any>} values
24
- * @returns {Array<any>}
25
- */
26
- _qcsdkNormalizeValues(params: Array<any>, values: Array<any>): Array<any>;
27
- /**
28
- * Basic formatter (ethers supports multiple formats).
29
- * @param {string=} format
30
- * @returns {string}
31
- */
32
- format(format?: string | undefined): string;
33
- /**
34
- * Get a function fragment by name (first match).
35
- * @param {string} nameOrSignature
36
- * @returns {FunctionFragment}
37
- */
38
- getFunction(nameOrSignature: string): FunctionFragment;
39
- /**
40
- * Get an event fragment by name (first match).
41
- * @param {string} nameOrSignature
42
- * @returns {EventFragment}
43
- */
44
- getEvent(nameOrSignature: string): EventFragment;
45
- /**
46
- * Get an error fragment by name (first match).
47
- * @param {string} nameOrSignature
48
- * @returns {ErrorFragment}
49
- */
50
- getError(nameOrSignature: string): ErrorFragment;
51
- /**
52
- * Returns the constructor fragment if present.
53
- * @returns {ConstructorFragment|null}
54
- */
55
- getConstructor(): ConstructorFragment | null;
56
- /**
57
- * Encode function data using quantum-coin-js-sdk.
58
- * @param {FunctionFragment|string} functionFragment
59
- * @param {any[]} values
60
- * @returns {string}
61
- */
62
- encodeFunctionData(functionFragment: FunctionFragment | string, values: any[]): string;
63
- /**
64
- * Decode function result using quantum-coin-js-sdk.
65
- * @param {FunctionFragment|string} functionFragment
66
- * @param {string} data
67
- * @returns {any}
68
- */
69
- decodeFunctionResult(functionFragment: FunctionFragment | string, data: string): any;
70
- /**
71
- * Encode an event log from values.
72
- * @param {EventFragment|any} eventFragment
73
- * @param {any[]} values
74
- * @returns {{ topics: string[], data: string }}
75
- */
76
- encodeEventLog(eventFragment: EventFragment | any, values: any[]): {
77
- topics: string[];
78
- data: string;
79
- };
80
- /**
81
- * Decode an event log.
82
- * @param {EventFragment|any} eventFragment
83
- * @param {string[]} topics
84
- * @param {string} data
85
- * @returns {any}
86
- */
87
- decodeEventLog(eventFragment: EventFragment | any, topics: string[], data: string): any;
88
- parseTransaction(): void;
89
- parseLog(...args: any[]): {
90
- fragment: EventFragment;
91
- name: any;
92
- signature: any;
93
- topic: string;
94
- args: Result;
95
- };
96
- parseError(): void;
97
- getSighash(): void;
98
- getEventTopic(): void;
99
- getFallback(): any;
100
- getReceive(): any;
101
- }
102
- export class AbiCoder {
103
- /**
104
- * Encode values by types into ABI data.
105
- * @param {(string|any)[]} types
106
- * @param {any[]} values
107
- * @returns {string}
108
- */
109
- encode(types: (string | any)[], values: any[]): string;
110
- /**
111
- * Decode ABI data by output types.
112
- * @param {(string|any)[]} types
113
- * @param {string} data
114
- * @returns {any}
115
- */
116
- decode(types: (string | any)[], data: string): any;
117
- /**
118
- * Return a default value for types.
119
- * @param {(string|any)[]} types
120
- * @returns {any}
121
- */
122
- getDefaultValue(types: (string | any)[]): any;
123
- }
124
- import { FunctionFragment } from "./fragments";
125
- import { EventFragment } from "./fragments";
126
- import { ErrorFragment } from "./fragments";
127
- import { ConstructorFragment } from "./fragments";
128
- import { Result } from "../utils/result";