quantum-coin-js-sdk 2.0.1 → 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 (232) 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/.idea/.name +0 -1
  7. package/.idea/modules.xml +0 -8
  8. package/.idea/quantum-coin-js-sdk.iml +0 -12
  9. package/.idea/vcs.xml +0 -6
  10. package/.vs/ProjectSettings.json +0 -3
  11. package/.vs/VSWorkspaceState.json +0 -8
  12. package/.vs/quantum-coin-js-sdk/FileContentIndex/a9d6de82-cfc3-4c22-ac38-06d706ff3673.vsidx +0 -0
  13. package/.vs/quantum-coin-js-sdk/FileContentIndex/fdc816df-1898-4153-99f2-c69ef4c2283b.vsidx +0 -0
  14. package/.vs/quantum-coin-js-sdk/config/applicationhost.config +0 -1011
  15. package/.vs/quantum-coin-js-sdk/v17/.wsuo +0 -0
  16. package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.backup.json +0 -39
  17. package/.vs/quantum-coin-js-sdk/v17/DocumentLayout.json +0 -57
  18. package/.vs/slnx.sqlite +0 -0
  19. package/example/README.md +0 -14
  20. package/example/conversion-example.js +0 -19
  21. package/example/example-create-contract.js +0 -396
  22. package/example/example-encode-decode-rlp.js +0 -225
  23. package/example/example-event-pack-unpack.js +0 -391
  24. package/example/example-misc.js +0 -96
  25. package/example/example-token-pack-unpack.js +0 -960
  26. package/example/example-wallet-version4.js +0 -34
  27. package/example/example-wallet.js +0 -39
  28. package/example/example.js +0 -115
  29. package/example/node_modules/.bin/sdkgen +0 -16
  30. package/example/node_modules/.bin/sdkgen.cmd +0 -17
  31. package/example/node_modules/.bin/sdkgen.ps1 +0 -28
  32. package/example/node_modules/.package-lock.json +0 -51
  33. package/example/node_modules/quantumcoin/.github/workflows/publish-npmjs.yaml +0 -22
  34. package/example/node_modules/quantumcoin/LICENSE +0 -21
  35. package/example/node_modules/quantumcoin/README-SDK.md +0 -828
  36. package/example/node_modules/quantumcoin/README.md +0 -197
  37. package/example/node_modules/quantumcoin/config.d.ts +0 -50
  38. package/example/node_modules/quantumcoin/config.js +0 -123
  39. package/example/node_modules/quantumcoin/examples/AllSolidityTypes.sol +0 -184
  40. package/example/node_modules/quantumcoin/examples/SimpleIERC20.sol +0 -74
  41. package/example/node_modules/quantumcoin/examples/events.js +0 -41
  42. package/example/node_modules/quantumcoin/examples/events.ts +0 -35
  43. package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.js +0 -100
  44. package/example/node_modules/quantumcoin/examples/example-generator-sdk-js.ts +0 -77
  45. package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.js +0 -100
  46. package/example/node_modules/quantumcoin/examples/example-generator-sdk-ts.ts +0 -77
  47. package/example/node_modules/quantumcoin/examples/example.js +0 -67
  48. package/example/node_modules/quantumcoin/examples/example.ts +0 -56
  49. package/example/node_modules/quantumcoin/examples/offline-signing.js +0 -77
  50. package/example/node_modules/quantumcoin/examples/offline-signing.ts +0 -65
  51. package/example/node_modules/quantumcoin/examples/package-lock.json +0 -596
  52. package/example/node_modules/quantumcoin/examples/package.json +0 -32
  53. package/example/node_modules/quantumcoin/examples/read-operations.js +0 -32
  54. package/example/node_modules/quantumcoin/examples/read-operations.ts +0 -31
  55. package/example/node_modules/quantumcoin/examples/sdk-generator-erc20.inline.json +0 -251
  56. package/example/node_modules/quantumcoin/examples/solidity-types.ts +0 -43
  57. package/example/node_modules/quantumcoin/examples/wallet-offline.js +0 -36
  58. package/example/node_modules/quantumcoin/examples/wallet-offline.ts +0 -26
  59. package/example/node_modules/quantumcoin/generate-sdk.js +0 -1846
  60. package/example/node_modules/quantumcoin/index.js +0 -12
  61. package/example/node_modules/quantumcoin/package.json +0 -95
  62. package/example/node_modules/quantumcoin/scripts/copy-declarations.js +0 -31
  63. package/example/node_modules/quantumcoin/scripts/run-all-one-by-one.js +0 -151
  64. package/example/node_modules/quantumcoin/src/abi/fragments.d.ts +0 -42
  65. package/example/node_modules/quantumcoin/src/abi/fragments.js +0 -63
  66. package/example/node_modules/quantumcoin/src/abi/index.d.ts +0 -13
  67. package/example/node_modules/quantumcoin/src/abi/index.js +0 -9
  68. package/example/node_modules/quantumcoin/src/abi/interface.d.ts +0 -128
  69. package/example/node_modules/quantumcoin/src/abi/interface.js +0 -605
  70. package/example/node_modules/quantumcoin/src/abi/js-abi-coder.d.ts +0 -8
  71. package/example/node_modules/quantumcoin/src/abi/js-abi-coder.js +0 -538
  72. package/example/node_modules/quantumcoin/src/constants.d.ts +0 -61
  73. package/example/node_modules/quantumcoin/src/constants.js +0 -94
  74. package/example/node_modules/quantumcoin/src/contract/contract-factory.d.ts +0 -28
  75. package/example/node_modules/quantumcoin/src/contract/contract-factory.js +0 -111
  76. package/example/node_modules/quantumcoin/src/contract/contract.d.ts +0 -113
  77. package/example/node_modules/quantumcoin/src/contract/contract.js +0 -408
  78. package/example/node_modules/quantumcoin/src/contract/index.d.ts +0 -9
  79. package/example/node_modules/quantumcoin/src/contract/index.js +0 -9
  80. package/example/node_modules/quantumcoin/src/errors/index.d.ts +0 -92
  81. package/example/node_modules/quantumcoin/src/errors/index.js +0 -200
  82. package/example/node_modules/quantumcoin/src/generator/index.d.ts +0 -81
  83. package/example/node_modules/quantumcoin/src/generator/index.js +0 -1571
  84. package/example/node_modules/quantumcoin/src/index.d.ts +0 -122
  85. package/example/node_modules/quantumcoin/src/index.js +0 -41
  86. package/example/node_modules/quantumcoin/src/internal/hex.d.ts +0 -68
  87. package/example/node_modules/quantumcoin/src/internal/hex.js +0 -180
  88. package/example/node_modules/quantumcoin/src/providers/extra-providers.d.ts +0 -139
  89. package/example/node_modules/quantumcoin/src/providers/extra-providers.js +0 -614
  90. package/example/node_modules/quantumcoin/src/providers/index.d.ts +0 -17
  91. package/example/node_modules/quantumcoin/src/providers/index.js +0 -10
  92. package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.d.ts +0 -12
  93. package/example/node_modules/quantumcoin/src/providers/json-rpc-provider.js +0 -89
  94. package/example/node_modules/quantumcoin/src/providers/provider.d.ts +0 -206
  95. package/example/node_modules/quantumcoin/src/providers/provider.js +0 -524
  96. package/example/node_modules/quantumcoin/src/types/index.d.ts +0 -214
  97. package/example/node_modules/quantumcoin/src/types/index.js +0 -9
  98. package/example/node_modules/quantumcoin/src/utils/address.d.ts +0 -58
  99. package/example/node_modules/quantumcoin/src/utils/address.js +0 -144
  100. package/example/node_modules/quantumcoin/src/utils/encoding.d.ts +0 -120
  101. package/example/node_modules/quantumcoin/src/utils/encoding.js +0 -306
  102. package/example/node_modules/quantumcoin/src/utils/fixednumber.d.ts +0 -57
  103. package/example/node_modules/quantumcoin/src/utils/fixednumber.js +0 -366
  104. package/example/node_modules/quantumcoin/src/utils/hashing.d.ts +0 -76
  105. package/example/node_modules/quantumcoin/src/utils/hashing.js +0 -298
  106. package/example/node_modules/quantumcoin/src/utils/index.d.ts +0 -63
  107. package/example/node_modules/quantumcoin/src/utils/index.js +0 -14
  108. package/example/node_modules/quantumcoin/src/utils/result.d.ts +0 -57
  109. package/example/node_modules/quantumcoin/src/utils/result.js +0 -128
  110. package/example/node_modules/quantumcoin/src/utils/rlp.d.ts +0 -12
  111. package/example/node_modules/quantumcoin/src/utils/rlp.js +0 -215
  112. package/example/node_modules/quantumcoin/src/utils/units.d.ts +0 -29
  113. package/example/node_modules/quantumcoin/src/utils/units.js +0 -107
  114. package/example/node_modules/quantumcoin/src/wallet/index.d.ts +0 -10
  115. package/example/node_modules/quantumcoin/src/wallet/index.js +0 -8
  116. package/example/node_modules/quantumcoin/src/wallet/wallet.d.ts +0 -192
  117. package/example/node_modules/quantumcoin/src/wallet/wallet.js +0 -713
  118. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.js +0 -207
  119. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.dynamic.test.ts +0 -191
  120. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.fixtures.js +0 -231
  121. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.js +0 -387
  122. package/example/node_modules/quantumcoin/test/e2e/all-solidity-types.generated-sdks.e2e.test.ts +0 -350
  123. package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.js +0 -165
  124. package/example/node_modules/quantumcoin/test/e2e/generator-interface.e2e.test.ts +0 -160
  125. package/example/node_modules/quantumcoin/test/e2e/helpers.js +0 -59
  126. package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.js +0 -141
  127. package/example/node_modules/quantumcoin/test/e2e/signing-context-and-fee.e2e.test.ts +0 -128
  128. package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.js +0 -168
  129. package/example/node_modules/quantumcoin/test/e2e/simple-erc20.generated-sdks.e2e.test.ts +0 -141
  130. package/example/node_modules/quantumcoin/test/e2e/transactional.test.js +0 -245
  131. package/example/node_modules/quantumcoin/test/e2e/transactional.test.ts +0 -208
  132. package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.js +0 -407
  133. package/example/node_modules/quantumcoin/test/e2e/typed-generator.e2e.test.ts +0 -337
  134. package/example/node_modules/quantumcoin/test/fixtures/ConstructorParam.sol +0 -23
  135. package/example/node_modules/quantumcoin/test/fixtures/MultiContracts.sol +0 -37
  136. package/example/node_modules/quantumcoin/test/fixtures/SimpleStorage.sol +0 -18
  137. package/example/node_modules/quantumcoin/test/fixtures/StakingContract.abi.json +0 -1
  138. package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.js +0 -49
  139. package/example/node_modules/quantumcoin/test/integration/ipc-provider.test.ts +0 -44
  140. package/example/node_modules/quantumcoin/test/integration/provider.test.js +0 -88
  141. package/example/node_modules/quantumcoin/test/integration/provider.test.ts +0 -85
  142. package/example/node_modules/quantumcoin/test/integration/ws-provider.test.js +0 -41
  143. package/example/node_modules/quantumcoin/test/integration/ws-provider.test.ts +0 -38
  144. package/example/node_modules/quantumcoin/test/security/abi-decoder-bounds.test.js +0 -122
  145. package/example/node_modules/quantumcoin/test/security/contract-overrides.test.js +0 -112
  146. package/example/node_modules/quantumcoin/test/security/generator-injection.test.js +0 -195
  147. package/example/node_modules/quantumcoin/test/security/malformed-input.test.js +0 -330
  148. package/example/node_modules/quantumcoin/test/security/malformed-input.test.ts +0 -35
  149. package/example/node_modules/quantumcoin/test/security/rpc-numeric-bounds.test.js +0 -81
  150. package/example/node_modules/quantumcoin/test/security/rpc-trust.test.js +0 -202
  151. package/example/node_modules/quantumcoin/test/unit/_encrypted-output.txt +0 -6
  152. package/example/node_modules/quantumcoin/test/unit/_log-encrypted-jsons.js +0 -45
  153. package/example/node_modules/quantumcoin/test/unit/_write-keystore-fixture.js +0 -16
  154. package/example/node_modules/quantumcoin/test/unit/abi-interface.test.js +0 -110
  155. package/example/node_modules/quantumcoin/test/unit/abi-interface.test.ts +0 -109
  156. package/example/node_modules/quantumcoin/test/unit/address-wallet.test.js +0 -923
  157. package/example/node_modules/quantumcoin/test/unit/address-wallet.test.ts +0 -877
  158. package/example/node_modules/quantumcoin/test/unit/browser-provider.test.js +0 -85
  159. package/example/node_modules/quantumcoin/test/unit/browser-provider.test.ts +0 -79
  160. package/example/node_modules/quantumcoin/test/unit/contract.test.js +0 -85
  161. package/example/node_modules/quantumcoin/test/unit/contract.test.ts +0 -83
  162. package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.js +0 -127
  163. package/example/node_modules/quantumcoin/test/unit/encoding-units-rlp.test.ts +0 -91
  164. package/example/node_modules/quantumcoin/test/unit/errors.test.js +0 -77
  165. package/example/node_modules/quantumcoin/test/unit/errors.test.ts +0 -76
  166. package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.js +0 -55
  167. package/example/node_modules/quantumcoin/test/unit/filter-by-blockhash.test.ts +0 -54
  168. package/example/node_modules/quantumcoin/test/unit/fixednumber.test.js +0 -656
  169. package/example/node_modules/quantumcoin/test/unit/fixednumber.test.ts +0 -660
  170. package/example/node_modules/quantumcoin/test/unit/fixtures/encrypted-keystores-48-32-36.js +0 -9
  171. package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.js +0 -42
  172. package/example/node_modules/quantumcoin/test/unit/generate-contract-cli.test.ts +0 -41
  173. package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.js +0 -113
  174. package/example/node_modules/quantumcoin/test/unit/generate-sdk-artifacts-json.test.ts +0 -110
  175. package/example/node_modules/quantumcoin/test/unit/generator.test.js +0 -149
  176. package/example/node_modules/quantumcoin/test/unit/generator.test.ts +0 -148
  177. package/example/node_modules/quantumcoin/test/unit/hashing.test.js +0 -64
  178. package/example/node_modules/quantumcoin/test/unit/hashing.test.ts +0 -63
  179. package/example/node_modules/quantumcoin/test/unit/init.test.js +0 -39
  180. package/example/node_modules/quantumcoin/test/unit/init.test.ts +0 -38
  181. package/example/node_modules/quantumcoin/test/unit/interface.test.js +0 -56
  182. package/example/node_modules/quantumcoin/test/unit/interface.test.ts +0 -54
  183. package/example/node_modules/quantumcoin/test/unit/internal-hex.test.js +0 -81
  184. package/example/node_modules/quantumcoin/test/unit/internal-hex.test.ts +0 -80
  185. package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.js +0 -98
  186. package/example/node_modules/quantumcoin/test/unit/populate-transaction.test.ts +0 -64
  187. package/example/node_modules/quantumcoin/test/unit/providers.test.js +0 -252
  188. package/example/node_modules/quantumcoin/test/unit/providers.test.ts +0 -251
  189. package/example/node_modules/quantumcoin/test/unit/result.test.js +0 -80
  190. package/example/node_modules/quantumcoin/test/unit/result.test.ts +0 -79
  191. package/example/node_modules/quantumcoin/test/unit/solidity-types.test.js +0 -49
  192. package/example/node_modules/quantumcoin/test/unit/solidity-types.test.ts +0 -39
  193. package/example/node_modules/quantumcoin/test/unit/utils.test.js +0 -57
  194. package/example/node_modules/quantumcoin/test/unit/utils.test.ts +0 -56
  195. package/example/node_modules/quantumcoin/test/verbose-logger.js +0 -74
  196. package/example/node_modules/quantumcoin/tsconfig.build.json +0 -14
  197. package/example/node_modules/seed-words/.github/workflows/publish-npmjs.yaml +0 -22
  198. package/example/node_modules/seed-words/BUILD.md +0 -7
  199. package/example/node_modules/seed-words/LICENSE +0 -121
  200. package/example/node_modules/seed-words/README.md +0 -67
  201. package/example/node_modules/seed-words/dist/seedwords.d.ts +0 -39
  202. package/example/node_modules/seed-words/package.json +0 -27
  203. package/example/node_modules/seed-words/seedwords.js +0 -315
  204. package/example/node_modules/seed-words/seedwords.txt +0 -65536
  205. package/example/node_modules/seed-words/tsconfig.json +0 -21
  206. package/example/package-lock.json +0 -60
  207. package/example/package.json +0 -15
  208. package/scripts/build-browser-tests.js +0 -29
  209. package/scripts/build-wasm.js +0 -85
  210. package/tests/browser/bundle.js +0 -97643
  211. package/tests/browser/entry.js +0 -57
  212. package/tests/browser/harness.html +0 -20
  213. package/tests/browser/run-browser.js +0 -50
  214. package/tests/encrypted-32.json +0 -1
  215. package/tests/encrypted-36.json +0 -1
  216. package/tests/encrypted-48.json +0 -1
  217. package/tests/generate-verify-vectors.js +0 -88
  218. package/tests/get-gas-price.test.js +0 -59
  219. package/tests/hashing.test.js +0 -34
  220. package/tests/non-transactional.preinit.test.js +0 -33
  221. package/tests/non-transactional.test.js +0 -1318
  222. package/tests/sign-raw-keytype5-context-null.test.js +0 -105
  223. package/tests/sign-raw-transaction.test.js +0 -194
  224. package/tests/sign-verify.test.js +0 -308
  225. package/tests/specs/assert.js +0 -74
  226. package/tests/specs/crypto.spec.js +0 -104
  227. package/tests/specs/hex.js +0 -31
  228. package/tests/specs/preinit.spec.js +0 -19
  229. package/tests/specs/sign.spec.js +0 -90
  230. package/tests/specs/wallet.spec.js +0 -98
  231. package/tests/transactional.rpc.test.js +0 -102
  232. package/tests/verify-vectors.json +0 -95035
@@ -1,122 +0,0 @@
1
- declare const _exports: {
2
- isError(error: any, code: string): boolean;
3
- isCallException(error: any): boolean;
4
- makeError(message: string, code: errors.ErrorCode, info?: Record<string, any> | undefined): Error & {
5
- code: errors.ErrorCode;
6
- shortMessage: string;
7
- };
8
- assert(check: any, message: string, code: errors.ErrorCode, info?: Record<string, any> | undefined): void;
9
- assertArgument(check: any, message: string, name: string, value: any): void;
10
- ProviderError: typeof errors.ProviderError;
11
- TransactionError: typeof errors.TransactionError;
12
- ContractError: typeof errors.ContractError;
13
- formatUnits(value: import("./utils/units").BigNumberish, decimals?: number | undefined): string;
14
- parseUnits(value: string, decimals?: number | undefined): bigint;
15
- formatEther(value: import("./utils/units").BigNumberish): string;
16
- parseEther(value: string): bigint;
17
- WeiPerEther: bigint;
18
- checkResultErrors(result: any): Array<{
19
- error: Error;
20
- path: Array<string | number>;
21
- }>;
22
- Result: typeof import("./utils/result").Result;
23
- encodeRlp(value: any): string;
24
- decodeRlp(data: string): any;
25
- keccak256(data: string | Uint8Array): string;
26
- sha256(data: string | Uint8Array): string;
27
- sha512(data: string | Uint8Array): string;
28
- ripemd160(data: string | Uint8Array): string;
29
- id(text: string): string;
30
- randomBytes(length: number): Uint8Array;
31
- computeHmac(algorithm: string, key: string | Uint8Array, data: string | Uint8Array): string;
32
- pbkdf2(password: string | Uint8Array, salt: string | Uint8Array, iterations: number, keylen: number, algorithm?: string | undefined): string;
33
- scrypt(password: string | Uint8Array, salt: string | Uint8Array, N: number, r: number, p: number, dkLen: number): Promise<string>;
34
- scryptSync(password: string | Uint8Array, salt: string | Uint8Array, N: number, r: number, p: number, dkLen: number): string;
35
- toUtf8String(data: import("./utils/encoding").BytesLike): string;
36
- toUtf8Bytes(str: string): Uint8Array;
37
- toHex(data: import("./utils/encoding").BytesLike): string;
38
- hexlify(data: import("./utils/encoding").BytesLike): string;
39
- arrayify(data: import("./utils/encoding").BytesLike): Uint8Array;
40
- concat(items: import("./utils/encoding").BytesLike[]): string;
41
- stripZerosLeft(data: import("./utils/encoding").BytesLike): string;
42
- encodeBytes32String(text: string): string;
43
- decodeBytes32String(bytes: import("./utils/encoding").BytesLike): string;
44
- decodeBase58(data: string): Uint8Array;
45
- decodeBase64(data: string): Uint8Array;
46
- encodeBase58(data: import("./utils/encoding").BytesLike): string;
47
- encodeBase64(data: import("./utils/encoding").BytesLike): string;
48
- toUtf8CodePoints(str: string): number[];
49
- isBytesLike(value: any): boolean;
50
- zeroPad(value: import("./utils/encoding").BytesLike, length: number): string;
51
- zeroPadValue(value: import("./utils/encoding").BytesLike, length: number): string;
52
- solidityPacked(): void;
53
- solidityPackedKeccak256(): void;
54
- solidityPackedSha256(): void;
55
- isHexString: typeof import("./internal/hex").isHexString;
56
- bytesToHex: typeof import("./internal/hex").bytesToHex;
57
- hexToBytes: typeof import("./internal/hex").hexToBytes;
58
- isAddress(address: string): boolean;
59
- getAddress(address: string): string;
60
- isAddressable(value: any): boolean;
61
- resolveAddress(target: any): string | Promise<string>;
62
- getContractAddress(tx: {
63
- from: string;
64
- nonce: number;
65
- }): string;
66
- getCreateAddress(tx: {
67
- from: string;
68
- nonce: number;
69
- }): string;
70
- getCreate2Address(from: string, salt: string, initCodeHash: string): string;
71
- computeAddress(key: string | Uint8Array): string;
72
- Interface: typeof import("./abi/interface").Interface;
73
- AbiCoder: typeof import("./abi/interface").AbiCoder;
74
- Fragment: typeof import("./abi/fragments").Fragment;
75
- NamedFragment: typeof import("./abi/fragments").NamedFragment;
76
- FunctionFragment: typeof import("./abi/fragments").FunctionFragment;
77
- EventFragment: typeof import("./abi/fragments").EventFragment;
78
- ErrorFragment: typeof import("./abi/fragments").ErrorFragment;
79
- ConstructorFragment: typeof import("./abi/fragments").ConstructorFragment;
80
- StructFragment: typeof import("./abi/fragments").StructFragment;
81
- FallbackFragment: typeof import("./abi/fragments").FallbackFragment;
82
- ContractFactory: typeof import("./contract/contract-factory").ContractFactory;
83
- BaseContract: typeof import("./contract/contract").BaseContract;
84
- Contract: typeof import("./contract/contract").Contract;
85
- ContractTransactionResponse: typeof import("./contract/contract").ContractTransactionResponse;
86
- ContractTransactionReceipt: typeof import("./contract/contract").ContractTransactionReceipt;
87
- EventLog: typeof import("./contract/contract").EventLog;
88
- SigningKey: typeof import("./wallet/wallet").SigningKey;
89
- AbstractSigner: typeof import("./wallet/wallet").AbstractSigner;
90
- BaseWallet: typeof import("./wallet/wallet").BaseWallet;
91
- Wallet: typeof import("./wallet/wallet").Wallet;
92
- NonceManager: typeof import("./wallet/wallet").NonceManager;
93
- JsonRpcSigner: typeof import("./wallet/wallet").JsonRpcSigner;
94
- VoidSigner: typeof import("./wallet/wallet").VoidSigner;
95
- getProvider(endpoint?: string | undefined, chainId?: number | undefined): import("./providers/provider").AbstractProvider;
96
- WebSocketProvider: typeof import("./providers/extra-providers").WebSocketProvider;
97
- IpcSocketProvider: typeof import("./providers/extra-providers").IpcSocketProvider;
98
- BrowserProvider: typeof import("./providers/extra-providers").BrowserProvider;
99
- FallbackProvider: typeof import("./providers/extra-providers").FallbackProvider;
100
- FilterByBlockHash: typeof import("./providers/extra-providers").FilterByBlockHash;
101
- JsonRpcProvider: typeof import("./providers/json-rpc-provider").JsonRpcProvider;
102
- JsonRpcApiProvider: typeof import("./providers/json-rpc-provider").JsonRpcApiProvider;
103
- Provider: typeof import("./providers/provider").Provider;
104
- AbstractProvider: typeof import("./providers/provider").AbstractProvider;
105
- Block: typeof import("./providers/provider").Block;
106
- TransactionResponse: typeof import("./providers/provider").TransactionResponse;
107
- TransactionReceipt: typeof import("./providers/provider").TransactionReceipt;
108
- Log: typeof import("./providers/provider").Log;
109
- version: string;
110
- ZeroAddress: string;
111
- ZeroHash: string;
112
- MaxUint256: bigint;
113
- MaxUint160: bigint;
114
- MinInt256: bigint;
115
- MaxInt256: bigint;
116
- NumericFault: string;
117
- NumericFaultCode: string;
118
- EtherSymbol: string;
119
- N: bigint;
120
- };
121
- export = _exports;
122
- import errors = require("./errors");
@@ -1,41 +0,0 @@
1
- /**
2
- * @fileoverview QuantumCoin.js main entrypoint (ethers.js v6 compatible API surface).
3
- *
4
- * IMPORTANT: Call `Initialize()` (from `quantumcoin/config`) before using
5
- * any functionality that relies on `quantum-coin-js-sdk` (address validation,
6
- * ABI packing/unpacking, signing, etc.).
7
- */
8
-
9
- // Core constants
10
- const constants = require("./constants");
11
-
12
- // Modules
13
- const providers = require("./providers");
14
- const wallet = require("./wallet");
15
- const contract = require("./contract");
16
- const abi = require("./abi");
17
- const utils = require("./utils");
18
- const errors = require("./errors");
19
-
20
- module.exports = {
21
- ...constants,
22
-
23
- // Providers
24
- ...providers,
25
-
26
- // Wallet / signers
27
- ...wallet,
28
-
29
- // Contracts
30
- ...contract,
31
-
32
- // ABI
33
- ...abi,
34
-
35
- // Utils
36
- ...utils,
37
-
38
- // Errors
39
- ...errors,
40
- };
41
-
@@ -1,68 +0,0 @@
1
- /**
2
- * Return true if `value` is a Uint8Array.
3
- * @param {any} value
4
- * @returns {value is Uint8Array}
5
- */
6
- export function isUint8Array(value: any): value is Uint8Array;
7
- /**
8
- * Normalize a hex string.
9
- * @param {string} hex
10
- * @returns {string}
11
- */
12
- export function normalizeHex(hex: string): string;
13
- /**
14
- * Format a number/bigint as a JSON-RPC QUANTITY hex string (no leading zeros).
15
- * @param value
16
- */
17
- export function toQuantityHex(value: number | bigint): string;
18
- /** Alias of `toQuantityHex` matching ethers.js v6 naming. */
19
- export const toQuantity: typeof toQuantityHex;
20
- /**
21
- * Returns true if value is a hex string.
22
- * @param {any} value
23
- * @param {number=} lengthBytes Optional exact byte length.
24
- * @returns {boolean}
25
- */
26
- export function isHexString(value: any, lengthBytes?: number | undefined): boolean;
27
- /**
28
- * Strip 0x prefix.
29
- * @param {string} hex
30
- * @returns {string}
31
- */
32
- export function strip0x(hex: string): string;
33
- /**
34
- * Ensure a 0x prefix.
35
- * @param {string} hex
36
- * @returns {string}
37
- */
38
- export function add0x(hex: string): string;
39
- /**
40
- * Convert a hex string to bytes.
41
- * @param {string} hex
42
- * @returns {Uint8Array}
43
- */
44
- export function hexToBytes(hex: string): Uint8Array;
45
- /**
46
- * Convert bytes to hex string.
47
- * @param {Uint8Array} bytes
48
- * @returns {string}
49
- */
50
- export function bytesToHex(bytes: Uint8Array): string;
51
- /**
52
- * UTF-8 encode a string to bytes.
53
- * @param {string} str
54
- * @returns {Uint8Array}
55
- */
56
- export function utf8ToBytes(str: string): Uint8Array;
57
- /**
58
- * UTF-8 decode bytes to a string.
59
- * @param {Uint8Array} bytes
60
- * @returns {string}
61
- */
62
- export function bytesToUtf8(bytes: Uint8Array): string;
63
- /**
64
- * Convert BytesLike to Uint8Array.
65
- * @param {string | Uint8Array} data
66
- * @returns {Uint8Array}
67
- */
68
- export function arrayify(data: string | Uint8Array): Uint8Array;
@@ -1,180 +0,0 @@
1
- /**
2
- * @fileoverview Internal hex and bytes helpers.
3
- *
4
- * IMPORTANT:
5
- * - This module intentionally avoids external dependencies.
6
- * - All hex strings in this SDK are normalized to lowercase with a `0x` prefix.
7
- */
8
-
9
- const { TextEncoder, TextDecoder } = require("util");
10
-
11
- /** @type {TextEncoder} */
12
- const _utf8Encoder = new TextEncoder();
13
- /** @type {TextDecoder} */
14
- const _utf8Decoder = new TextDecoder("utf-8", { fatal: false });
15
-
16
- /**
17
- * Return true if `value` is a Uint8Array.
18
- * @param {any} value
19
- * @returns {value is Uint8Array}
20
- */
21
- function isUint8Array(value) {
22
- return value instanceof Uint8Array;
23
- }
24
-
25
- /**
26
- * Normalize a hex string.
27
- * @param {string} hex
28
- * @returns {string}
29
- */
30
- function normalizeHex(hex) {
31
- if (typeof hex !== "string") throw new TypeError("hex must be a string");
32
- let h = hex.toLowerCase();
33
- if (!h.startsWith("0x")) h = "0x" + h;
34
- if (h.length % 2 !== 0) h = "0x0" + h.slice(2);
35
- return h;
36
- }
37
-
38
- /**
39
- * Format a number/bigint as a JSON-RPC QUANTITY hex string.
40
- *
41
- * Per the Ethereum JSON-RPC spec, quantities use the most compact
42
- * representation with no leading zeros, with the single exception that
43
- * zero is encoded as "0x0".
44
- *
45
- * Use this for block numbers, gas amounts, nonces, balances, and other
46
- * numeric RPC parameters. Do NOT use it for DATA hex (addresses,
47
- * bytecode, byte-arrays) — use `normalizeHex` for those.
48
- *
49
- * @param {number|bigint} value
50
- * @returns {string}
51
- */
52
- function toQuantityHex(value) {
53
- let n;
54
- if (typeof value === "bigint") {
55
- n = value;
56
- } else if (typeof value === "number") {
57
- if (!Number.isInteger(value)) {
58
- throw new TypeError("toQuantityHex: value must be an integer or bigint");
59
- }
60
- n = BigInt(value);
61
- } else {
62
- throw new TypeError("toQuantityHex: value must be a number or bigint");
63
- }
64
- if (n < 0n) throw new RangeError("toQuantityHex: value must be non-negative");
65
- if (n === 0n) return "0x0";
66
- return "0x" + n.toString(16);
67
- }
68
-
69
- /** Alias of `toQuantityHex` matching ethers.js v6 naming. */
70
- const toQuantity = toQuantityHex;
71
-
72
- /**
73
- * Returns true if value is a hex string.
74
- * @param {any} value
75
- * @param {number=} lengthBytes Optional exact byte length.
76
- * @returns {boolean}
77
- */
78
- function isHexString(value, lengthBytes) {
79
- if (typeof value !== "string") return false;
80
- const v = value.startsWith("0x") ? value.slice(2) : value;
81
- if (v.length === 0) return false;
82
- if (!/^[0-9a-fA-F]+$/.test(v)) return false;
83
- if (v.length % 2 !== 0) return false;
84
- if (lengthBytes != null) return v.length === lengthBytes * 2;
85
- return true;
86
- }
87
-
88
- /**
89
- * Strip 0x prefix.
90
- * @param {string} hex
91
- * @returns {string}
92
- */
93
- function strip0x(hex) {
94
- if (typeof hex !== "string") throw new TypeError("hex must be a string");
95
- return hex.startsWith("0x") ? hex.slice(2) : hex;
96
- }
97
-
98
- /**
99
- * Ensure a 0x prefix.
100
- * @param {string} hex
101
- * @returns {string}
102
- */
103
- function add0x(hex) {
104
- if (typeof hex !== "string") throw new TypeError("hex must be a string");
105
- return hex.startsWith("0x") ? hex : "0x" + hex;
106
- }
107
-
108
- /**
109
- * Convert a hex string to bytes.
110
- * @param {string} hex
111
- * @returns {Uint8Array}
112
- */
113
- function hexToBytes(hex) {
114
- if (!isHexString(hex)) throw new TypeError("invalid hex string");
115
- const h = strip0x(hex);
116
- const out = new Uint8Array(h.length / 2);
117
- for (let i = 0; i < out.length; i++) {
118
- out[i] = parseInt(h.slice(i * 2, i * 2 + 2), 16);
119
- }
120
- return out;
121
- }
122
-
123
- /**
124
- * Convert bytes to hex string.
125
- * @param {Uint8Array} bytes
126
- * @returns {string}
127
- */
128
- function bytesToHex(bytes) {
129
- if (!isUint8Array(bytes)) throw new TypeError("bytes must be Uint8Array");
130
- let out = "0x";
131
- for (const b of bytes) out += b.toString(16).padStart(2, "0");
132
- return out;
133
- }
134
-
135
- /**
136
- * UTF-8 encode a string to bytes.
137
- * @param {string} str
138
- * @returns {Uint8Array}
139
- */
140
- function utf8ToBytes(str) {
141
- if (typeof str !== "string") throw new TypeError("str must be a string");
142
- return _utf8Encoder.encode(str);
143
- }
144
-
145
- /**
146
- * UTF-8 decode bytes to a string.
147
- * @param {Uint8Array} bytes
148
- * @returns {string}
149
- */
150
- function bytesToUtf8(bytes) {
151
- if (!isUint8Array(bytes)) throw new TypeError("bytes must be Uint8Array");
152
- return _utf8Decoder.decode(bytes);
153
- }
154
-
155
- /**
156
- * Convert BytesLike to Uint8Array.
157
- * @param {string | Uint8Array} data
158
- * @returns {Uint8Array}
159
- */
160
- function arrayify(data) {
161
- if (typeof data === "string") return hexToBytes(data);
162
- if (isUint8Array(data)) return new Uint8Array(data);
163
- throw new TypeError("unsupported BytesLike");
164
- }
165
-
166
- module.exports = {
167
- isUint8Array,
168
- normalizeHex,
169
- toQuantityHex,
170
- toQuantity,
171
- isHexString,
172
- strip0x,
173
- add0x,
174
- hexToBytes,
175
- bytesToHex,
176
- utf8ToBytes,
177
- bytesToUtf8,
178
- arrayify,
179
- };
180
-
@@ -1,139 +0,0 @@
1
- export class WebSocketProvider extends AbstractProvider {
2
- /**
3
- * Create a WebSocket JSON-RPC provider.
4
- *
5
- * This uses the built-in global `WebSocket` available in recent Node.js
6
- * versions (via undici). No additional npm dependencies are required.
7
- *
8
- * @param {string} url WebSocket endpoint (e.g. ws://127.0.0.1:8546)
9
- * @param {number=} chainId Optional chain id (compat)
10
- */
11
- constructor(url: string, chainId?: number | undefined);
12
- url: string;
13
- chainId: number;
14
- /** @type {any|null} */
15
- _ws: any | null;
16
- /** @type {Promise<void>|null} */
17
- _wsReady: Promise<void> | null;
18
- /** @type {Map<number, { resolve: Function, reject: Function, timer: any }>} */
19
- _pending: Map<number, {
20
- resolve: Function;
21
- reject: Function;
22
- timer: any;
23
- }>;
24
- /**
25
- * Close the underlying WebSocket connection and reject any pending requests.
26
- * This is important for tests so the Node.js event loop can exit cleanly.
27
- */
28
- destroy(): void;
29
- _rejectAllPending(err: any): void;
30
- _connect(): Promise<void>;
31
- }
32
- export class IpcSocketProvider extends AbstractProvider {
33
- /**
34
- * Create an IPC provider.
35
- *
36
- * On Windows, use a named pipe path like: `\\\\.\\pipe\\geth.ipc`
37
- * On Unix, use a domain socket path like: `/path/to/geth.ipc`
38
- *
39
- * @param {string} path IPC socket path
40
- */
41
- constructor(path: string);
42
- path: string;
43
- }
44
- export class BrowserProvider extends AbstractProvider {
45
- /**
46
- * Create a BrowserProvider from an EIP-1193 provider (e.g. MetaMask).
47
- *
48
- * This is a lightweight implementation that focuses on the core behaviors:
49
- * - `send(method, params)` dispatches EIP-1193 requests
50
- * - `getSigner()` resolves the connected account
51
- * - emits ethers-like `debug` events for request/response tracking
52
- *
53
- * @param {{ request: Function }} eip1193Provider
54
- * @param {any=} network Unused (compat)
55
- * @param {{ providerInfo?: any }=} options
56
- */
57
- constructor(eip1193Provider: {
58
- request: Function;
59
- }, network?: any | undefined, options?: {
60
- providerInfo?: any;
61
- } | undefined);
62
- provider: {
63
- request: Function;
64
- };
65
- providerInfo: any;
66
- /**
67
- * Send an EIP-1193 JSON-RPC request.
68
- * @param {string} method
69
- * @param {any[]|Record<string, any>=} params
70
- * @returns {Promise<any>}
71
- */
72
- send(method: string, params?: (any[] | Record<string, any>) | undefined): Promise<any>;
73
- /**
74
- * Map an EIP-1193 error into a normalized Error.
75
- * @param {{ method: string, params?: any }} payload
76
- * @param {any} error
77
- * @returns {Error}
78
- */
79
- getRpcError(payload: {
80
- method: string;
81
- params?: any;
82
- }, error: any): Error;
83
- /**
84
- * Ethers compatibility: internal send for single or batched payloads.
85
- * @param {any|any[]} payload
86
- * @returns {Promise<any>}
87
- */
88
- _send(payload: any | any[]): Promise<any>;
89
- /**
90
- * Returns a signer for the specified account index or address.
91
- * @param {number|string=} address
92
- * @returns {Promise<JsonRpcSigner>}
93
- */
94
- getSigner(address?: (number | string) | undefined): Promise<JsonRpcSigner>;
95
- /**
96
- * Resolve whether this provider manages the address/index.
97
- * @param {number|string} address
98
- * @returns {Promise<boolean>}
99
- */
100
- hasSigner(address: number | string): Promise<boolean>;
101
- }
102
- /**
103
- * FallbackProvider - uses the first provider in the list.
104
- */
105
- export class FallbackProvider extends AbstractProvider {
106
- /**
107
- * @param {AbstractProvider[]|AbstractProvider} providers
108
- */
109
- constructor(providers: AbstractProvider[] | AbstractProvider);
110
- providers: AbstractProvider[];
111
- _perform(method: any, params: any): Promise<any>;
112
- }
113
- /**
114
- * FilterByBlockHash placeholder.
115
- */
116
- export class FilterByBlockHash {
117
- constructor(blockHash: any, address: any, topics: any);
118
- blockHash: string;
119
- address: any;
120
- topics: any;
121
- toJSON(): {
122
- blockHash: string;
123
- address: any;
124
- topics: any;
125
- };
126
- }
127
- /**
128
- * Create a provider from an endpoint string. Detects connection type by scheme/path:
129
- * - http:// or https:// → JsonRpcProvider
130
- * - ws:// or wss:// → WebSocketProvider
131
- * - otherwise (e.g. \\\\.\\pipe\\geth.ipc or /path/to/geth.ipc) → IpcSocketProvider
132
- *
133
- * @param {string=} endpoint - RPC URL (http/https), WebSocket URL (ws/wss), or IPC path. If omitted or empty, uses default from Config (HTTP).
134
- * @param {number=} chainId - Chain ID (default 123123). Used for HTTP and WebSocket; ignored for IPC.
135
- * @returns {AbstractProvider}
136
- */
137
- export function getProvider(endpoint?: string | undefined, chainId?: number | undefined): AbstractProvider;
138
- import { AbstractProvider } from "./provider";
139
- import { JsonRpcSigner } from "../wallet/wallet";