quantumcoin 7.0.3 → 7.0.4

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 (155) hide show
  1. package/.github/workflows/publish-npmjs.yaml +22 -22
  2. package/.gitignore +15 -15
  3. package/LICENSE +21 -21
  4. package/README-SDK.md +756 -754
  5. package/README.md +165 -150
  6. package/SPEC.md +3845 -3843
  7. package/config.d.ts +50 -50
  8. package/config.js +115 -115
  9. package/examples/AllSolidityTypes.sol +184 -184
  10. package/examples/SimpleIERC20.sol +74 -74
  11. package/examples/events.js +41 -35
  12. package/examples/events.ts +35 -0
  13. package/examples/example-generator-sdk-js.js +100 -95
  14. package/examples/example-generator-sdk-js.ts +77 -0
  15. package/examples/example-generator-sdk-ts.js +100 -95
  16. package/examples/example-generator-sdk-ts.ts +77 -0
  17. package/examples/example.js +72 -61
  18. package/examples/example.ts +61 -0
  19. package/examples/offline-signing.js +79 -73
  20. package/examples/offline-signing.ts +66 -0
  21. package/examples/package-lock.json +48 -57
  22. package/examples/package.json +32 -16
  23. package/examples/read-operations.js +32 -27
  24. package/examples/read-operations.ts +31 -0
  25. package/examples/sdk-generator-erc20.inline.json +251 -251
  26. package/examples/solidity-types.ts +43 -43
  27. package/examples/wallet-offline.js +35 -29
  28. package/examples/wallet-offline.ts +34 -0
  29. package/generate-sdk.js +1824 -1490
  30. package/index.js +12 -12
  31. package/package.json +95 -75
  32. package/scripts/copy-declarations.js +31 -0
  33. package/scripts/run-all-one-by-one.js +151 -0
  34. package/src/abi/fragments.d.ts +42 -42
  35. package/src/abi/fragments.js +63 -63
  36. package/src/abi/index.d.ts +13 -13
  37. package/src/abi/index.js +9 -9
  38. package/src/abi/interface.d.ts +128 -132
  39. package/src/abi/interface.js +590 -590
  40. package/src/abi/js-abi-coder.d.ts +8 -0
  41. package/src/abi/js-abi-coder.js +474 -474
  42. package/src/constants.d.ts +66 -61
  43. package/src/constants.js +101 -94
  44. package/src/contract/contract-factory.d.ts +28 -28
  45. package/src/contract/contract-factory.js +105 -105
  46. package/src/contract/contract.d.ts +113 -114
  47. package/src/contract/contract.js +354 -354
  48. package/src/contract/index.d.ts +9 -9
  49. package/src/contract/index.js +9 -9
  50. package/src/errors/index.d.ts +92 -92
  51. package/src/errors/index.js +188 -188
  52. package/src/generator/index.d.ts +74 -0
  53. package/src/generator/index.js +1404 -1404
  54. package/src/index.d.ts +125 -127
  55. package/src/index.js +41 -41
  56. package/src/internal/hex.d.ts +61 -61
  57. package/src/internal/hex.js +144 -144
  58. package/src/providers/extra-providers.d.ts +139 -128
  59. package/src/providers/extra-providers.js +600 -575
  60. package/src/providers/index.d.ts +17 -16
  61. package/src/providers/index.js +10 -10
  62. package/src/providers/json-rpc-provider.d.ts +12 -12
  63. package/src/providers/json-rpc-provider.js +79 -79
  64. package/src/providers/provider.d.ts +207 -203
  65. package/src/providers/provider.js +392 -371
  66. package/src/types/index.d.ts +214 -462
  67. package/src/types/index.js +9 -9
  68. package/src/utils/address.d.ts +72 -72
  69. package/src/utils/address.js +181 -182
  70. package/src/utils/encoding.d.ts +120 -120
  71. package/src/utils/encoding.js +306 -306
  72. package/src/utils/hashing.d.ts +82 -76
  73. package/src/utils/hashing.js +313 -298
  74. package/src/utils/index.d.ts +65 -55
  75. package/src/utils/index.js +13 -13
  76. package/src/utils/result.d.ts +57 -57
  77. package/src/utils/result.js +128 -128
  78. package/src/utils/rlp.d.ts +12 -12
  79. package/src/utils/rlp.js +200 -200
  80. package/src/utils/units.d.ts +29 -29
  81. package/src/utils/units.js +107 -107
  82. package/src/wallet/index.d.ts +10 -10
  83. package/src/wallet/index.js +8 -8
  84. package/src/wallet/wallet.d.ts +160 -160
  85. package/src/wallet/wallet.js +483 -489
  86. package/test/e2e/all-solidity-types.dynamic.test.js +207 -200
  87. package/test/e2e/all-solidity-types.dynamic.test.ts +191 -0
  88. package/test/e2e/all-solidity-types.fixtures.js +231 -231
  89. package/test/e2e/all-solidity-types.generated-sdks.e2e.test.js +387 -368
  90. package/test/e2e/all-solidity-types.generated-sdks.e2e.test.ts +350 -0
  91. package/test/e2e/helpers.js +59 -47
  92. package/test/e2e/signing-context-and-fee.e2e.test.js +137 -0
  93. package/test/e2e/signing-context-and-fee.e2e.test.ts +128 -0
  94. package/test/e2e/simple-erc20.generated-sdks.e2e.test.js +168 -151
  95. package/test/e2e/simple-erc20.generated-sdks.e2e.test.ts +141 -0
  96. package/test/e2e/transactional.test.js +245 -191
  97. package/test/e2e/transactional.test.ts +208 -0
  98. package/test/e2e/typed-generator.e2e.test.js +407 -404
  99. package/test/e2e/typed-generator.e2e.test.ts +337 -0
  100. package/test/fixtures/ConstructorParam.sol +23 -23
  101. package/test/fixtures/MultiContracts.sol +37 -37
  102. package/test/fixtures/SimpleStorage.sol +18 -18
  103. package/test/fixtures/StakingContract.abi.json +1 -1
  104. package/test/integration/ipc-provider.test.js +49 -44
  105. package/test/integration/ipc-provider.test.ts +44 -0
  106. package/test/integration/provider.test.js +88 -72
  107. package/test/integration/provider.test.ts +85 -0
  108. package/test/integration/ws-provider.test.js +41 -33
  109. package/test/integration/ws-provider.test.ts +38 -0
  110. package/test/security/malformed-input.test.js +37 -31
  111. package/test/security/malformed-input.test.ts +35 -0
  112. package/test/unit/_encrypted-output.txt +6 -0
  113. package/test/unit/_log-encrypted-jsons.js +45 -0
  114. package/test/unit/_write-keystore-fixture.js +16 -0
  115. package/test/unit/abi-interface.test.js +103 -98
  116. package/test/unit/abi-interface.test.ts +102 -0
  117. package/test/unit/address-wallet.test.js +355 -257
  118. package/test/unit/address-wallet.test.ts +342 -0
  119. package/test/unit/browser-provider.test.js +85 -82
  120. package/test/unit/browser-provider.test.ts +79 -0
  121. package/test/unit/contract.test.js +85 -82
  122. package/test/unit/contract.test.ts +83 -0
  123. package/test/unit/encoding-units-rlp.test.js +92 -89
  124. package/test/unit/encoding-units-rlp.test.ts +91 -0
  125. package/test/unit/errors.test.js +77 -74
  126. package/test/unit/errors.test.ts +76 -0
  127. package/test/unit/filter-by-blockhash.test.js +55 -52
  128. package/test/unit/filter-by-blockhash.test.ts +54 -0
  129. package/test/unit/fixtures/encrypted-keystores-48-32-36.js +9 -0
  130. package/test/unit/generate-contract-cli.test.js +42 -39
  131. package/test/unit/generate-contract-cli.test.ts +41 -0
  132. package/test/unit/generate-sdk-artifacts-json.test.js +113 -110
  133. package/test/unit/generate-sdk-artifacts-json.test.ts +110 -0
  134. package/test/unit/generator.test.js +102 -99
  135. package/test/unit/generator.test.ts +101 -0
  136. package/test/unit/hashing.test.js +68 -54
  137. package/test/unit/hashing.test.ts +67 -0
  138. package/test/unit/init.test.js +39 -36
  139. package/test/unit/init.test.ts +38 -0
  140. package/test/unit/interface.test.js +56 -53
  141. package/test/unit/interface.test.ts +54 -0
  142. package/test/unit/internal-hex.test.js +50 -47
  143. package/test/unit/internal-hex.test.ts +49 -0
  144. package/test/unit/populate-transaction.test.js +65 -62
  145. package/test/unit/populate-transaction.test.ts +64 -0
  146. package/test/unit/providers.test.js +200 -144
  147. package/test/unit/providers.test.ts +196 -0
  148. package/test/unit/result.test.js +80 -77
  149. package/test/unit/result.test.ts +79 -0
  150. package/test/unit/solidity-types.test.js +49 -46
  151. package/test/unit/solidity-types.test.ts +39 -0
  152. package/test/unit/utils.test.js +57 -54
  153. package/test/unit/utils.test.ts +56 -0
  154. package/test/verbose-logger.js +74 -0
  155. package/tsconfig.build.json +14 -0
package/src/index.d.ts CHANGED
@@ -1,127 +1,125 @@
1
- declare const _exports: {
2
- isError: typeof errors.isError;
3
- isCallException: typeof errors.isCallException;
4
- makeError: typeof errors.makeError;
5
- assert: typeof errors.assert;
6
- assertArgument: typeof errors.assertArgument;
7
- ProviderError: typeof errors.ProviderError;
8
- TransactionError: typeof errors.TransactionError;
9
- ContractError: typeof errors.ContractError;
10
- formatUnits: typeof import("./utils/units").formatUnits;
11
- parseUnits: typeof import("./utils/units").parseUnits;
12
- formatEther: typeof import("./utils/units").formatEther;
13
- parseEther: typeof import("./utils/units").parseEther;
14
- WeiPerEther: bigint;
15
- Result: typeof import("./utils/result").Result;
16
- checkResultErrors: typeof import("./utils/result").checkResultErrors;
17
- encodeRlp: typeof import("./utils/rlp").encodeRlp;
18
- decodeRlp: typeof import("./utils/rlp").decodeRlp;
19
- keccak256: typeof import("./utils/hashing").keccak256;
20
- sha256: typeof import("./utils/hashing").sha256;
21
- sha512: typeof import("./utils/hashing").sha512;
22
- ripemd160: typeof import("./utils/hashing").ripemd160;
23
- id: typeof import("./utils/hashing").id;
24
- randomBytes: typeof import("./utils/hashing").randomBytes;
25
- computeHmac: typeof import("./utils/hashing").computeHmac;
26
- pbkdf2: typeof import("./utils/hashing").pbkdf2;
27
- scrypt: typeof import("./utils/hashing").scrypt;
28
- scryptSync: typeof import("./utils/hashing").scryptSync;
29
- toUtf8String: typeof import("./utils/encoding").toUtf8String;
30
- toUtf8Bytes: typeof import("./utils/encoding").toUtf8Bytes;
31
- toHex: typeof import("./utils/encoding").toHex;
32
- hexlify: typeof import("./utils/encoding").hexlify;
33
- arrayify: typeof import("./utils/encoding").arrayify;
34
- concat: typeof import("./utils/encoding").concat;
35
- stripZerosLeft: typeof import("./utils/encoding").stripZerosLeft;
36
- encodeBytes32String: typeof import("./utils/encoding").encodeBytes32String;
37
- decodeBytes32String: typeof import("./utils/encoding").decodeBytes32String;
38
- decodeBase58: typeof import("./utils/encoding").decodeBase58;
39
- decodeBase64: typeof import("./utils/encoding").decodeBase64;
40
- encodeBase58: typeof import("./utils/encoding").encodeBase58;
41
- encodeBase64: typeof import("./utils/encoding").encodeBase64;
42
- toUtf8CodePoints: typeof import("./utils/encoding").toUtf8CodePoints;
43
- isHexString: typeof import("./internal/hex").isHexString;
44
- isBytesLike: typeof import("./utils/encoding").isBytesLike;
45
- zeroPad: typeof import("./utils/encoding").zeroPad;
46
- zeroPadValue: typeof import("./utils/encoding").zeroPadValue;
47
- solidityPacked: typeof import("./utils/encoding").solidityPacked;
48
- solidityPackedKeccak256: typeof import("./utils/encoding").solidityPackedKeccak256;
49
- solidityPackedSha256: typeof import("./utils/encoding").solidityPackedSha256;
50
- bytesToHex: typeof import("./internal/hex").bytesToHex;
51
- hexToBytes: typeof import("./internal/hex").hexToBytes;
52
- isAddress: typeof import("./utils/address").isAddress;
53
- getAddress: typeof import("./utils/address").getAddress;
54
- isAddressable: typeof import("./utils/address").isAddressable;
55
- resolveAddress: typeof import("./utils/address").resolveAddress;
56
- getContractAddress: typeof import("./utils/address").getContractAddress;
57
- getCreateAddress: typeof import("./utils/address").getCreateAddress;
58
- getCreate2Address: typeof import("./utils/address").getCreate2Address;
59
- computeAddress: typeof import("./utils/address").computeAddress;
60
- verifyMessage: typeof import("./utils/address").verifyMessage;
61
- recoverAddress: typeof import("./utils/address").recoverAddress;
62
- Interface: typeof import("./abi/interface").Interface;
63
- AbiCoder: typeof import("./abi/interface").AbiCoder;
64
- Fragment: typeof import("./abi/fragments").Fragment;
65
- NamedFragment: typeof import("./abi/fragments").NamedFragment;
66
- FunctionFragment: typeof import("./abi/fragments").FunctionFragment;
67
- EventFragment: typeof import("./abi/fragments").EventFragment;
68
- ErrorFragment: typeof import("./abi/fragments").ErrorFragment;
69
- ConstructorFragment: typeof import("./abi/fragments").ConstructorFragment;
70
- StructFragment: typeof import("./abi/fragments").StructFragment;
71
- FallbackFragment: typeof import("./abi/fragments").FallbackFragment;
72
- ContractFactory: typeof import("./contract/contract-factory").ContractFactory;
73
- BaseContract: typeof import("./contract/contract").BaseContract;
74
- Contract: typeof import("./contract/contract").Contract;
75
- ContractTransactionResponse: typeof import("./contract/contract").ContractTransactionResponse;
76
- ContractTransactionReceipt: typeof import("./contract/contract").ContractTransactionReceipt;
77
- EventLog: typeof import("./contract/contract").EventLog;
78
- SigningKey: typeof import("./wallet/wallet").SigningKey;
79
- AbstractSigner: typeof import("./wallet/wallet").AbstractSigner;
80
- BaseWallet: typeof import("./wallet/wallet").BaseWallet;
81
- Wallet: typeof import("./wallet/wallet").Wallet;
82
- NonceManager: typeof import("./wallet/wallet").NonceManager;
83
- JsonRpcSigner: typeof import("./wallet/wallet").JsonRpcSigner;
84
- VoidSigner: typeof import("./wallet/wallet").VoidSigner;
85
- WebSocketProvider: typeof import("./providers/extra-providers").WebSocketProvider;
86
- IpcSocketProvider: typeof import("./providers/extra-providers").IpcSocketProvider;
87
- BrowserProvider: typeof import("./providers/extra-providers").BrowserProvider;
88
- FallbackProvider: typeof import("./providers/extra-providers").FallbackProvider;
89
- FilterByBlockHash: typeof import("./providers/extra-providers").FilterByBlockHash;
90
- JsonRpcProvider: typeof import("./providers/json-rpc-provider").JsonRpcProvider;
91
- JsonRpcApiProvider: typeof import("./providers/json-rpc-provider").JsonRpcApiProvider;
92
- Provider: typeof import("./providers/provider").Provider;
93
- AbstractProvider: typeof import("./providers/provider").AbstractProvider;
94
- Block: typeof import("./providers/provider").Block;
95
- TransactionResponse: typeof import("./providers/provider").TransactionResponse;
96
- TransactionReceipt: typeof import("./providers/provider").TransactionReceipt;
97
- Log: typeof import("./providers/provider").Log;
98
- version: string;
99
- ZeroAddress: string;
100
- ZeroHash: string;
101
- MaxUint256: bigint;
102
- MaxUint160: bigint;
103
- MinInt256: bigint;
104
- MaxInt256: bigint;
105
- NumericFault: string;
106
- NumericFaultCode: string;
107
- EtherSymbol: string;
108
- N: bigint;
109
- };
110
- export = _exports;
111
- import errors = require("./errors");
112
-
113
- // ---------------------------------------------------------------------------
114
- // Core Solidity typing exports (type-only)
115
- // ---------------------------------------------------------------------------
116
- declare namespace _exports {
117
- export type AddressLike = import("./types").AddressLike;
118
- export type BytesLike = import("./types").BytesLike;
119
- export type Bytes32Like = import("./types").Bytes32Like;
120
- export type BigNumberish = import("./types").BigNumberish;
121
- export type HexString = import("./types").HexString;
122
- export type SolidityTypeName = import("./types").SolidityTypeName;
123
- export type SolidityInputValue<T extends SolidityTypeName> = import("./types").SolidityInputValue<T>;
124
- export type SolidityOutputValue<T extends SolidityTypeName> = import("./types").SolidityOutputValue<T>;
125
- export type SolidityTuple = import("./types").SolidityTuple;
126
- export type SolidityStruct = import("./types").SolidityStruct;
127
- }
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
+ hashMessage(message: string | Uint8Array): string;
27
+ sha256(data: string | Uint8Array): string;
28
+ sha512(data: string | Uint8Array): string;
29
+ ripemd160(data: string | Uint8Array): string;
30
+ id(text: string): string;
31
+ randomBytes(length: number): Uint8Array;
32
+ computeHmac(algorithm: string, key: string | Uint8Array, data: string | Uint8Array): string;
33
+ pbkdf2(password: string | Uint8Array, salt: string | Uint8Array, iterations: number, keylen: number, algorithm?: string | undefined): string;
34
+ scrypt(password: string | Uint8Array, salt: string | Uint8Array, N: number, r: number, p: number, dkLen: number): Promise<string>;
35
+ scryptSync(password: string | Uint8Array, salt: string | Uint8Array, N: number, r: number, p: number, dkLen: number): string;
36
+ toUtf8String(data: import("./utils/encoding").BytesLike): string;
37
+ toUtf8Bytes(str: string): Uint8Array;
38
+ toHex(data: import("./utils/encoding").BytesLike): string;
39
+ hexlify(data: import("./utils/encoding").BytesLike): string;
40
+ arrayify(data: import("./utils/encoding").BytesLike): Uint8Array;
41
+ concat(items: import("./utils/encoding").BytesLike[]): string;
42
+ stripZerosLeft(data: import("./utils/encoding").BytesLike): string;
43
+ encodeBytes32String(text: string): string;
44
+ decodeBytes32String(bytes: import("./utils/encoding").BytesLike): string;
45
+ decodeBase58(data: string): Uint8Array;
46
+ decodeBase64(data: string): Uint8Array;
47
+ encodeBase58(data: import("./utils/encoding").BytesLike): string;
48
+ encodeBase64(data: import("./utils/encoding").BytesLike): string;
49
+ toUtf8CodePoints(str: string): number[];
50
+ isBytesLike(value: any): boolean;
51
+ zeroPad(value: import("./utils/encoding").BytesLike, length: number): string;
52
+ zeroPadValue(value: import("./utils/encoding").BytesLike, length: number): string;
53
+ solidityPacked(): void;
54
+ solidityPackedKeccak256(): void;
55
+ solidityPackedSha256(): void;
56
+ isHexString: typeof import("./internal/hex").isHexString;
57
+ bytesToHex: typeof import("./internal/hex").bytesToHex;
58
+ hexToBytes: typeof import("./internal/hex").hexToBytes;
59
+ isAddress(address: string): boolean;
60
+ getAddress(address: string): string;
61
+ isAddressable(value: any): boolean;
62
+ resolveAddress(target: any): string | Promise<string>;
63
+ getContractAddress(tx: {
64
+ from: string;
65
+ nonce: number;
66
+ }): string;
67
+ getCreateAddress(tx: {
68
+ from: string;
69
+ nonce: number;
70
+ }): string;
71
+ getCreate2Address(from: string, salt: string, initCodeHash: string): string;
72
+ computeAddress(key: string | Uint8Array): string;
73
+ verifyMessage(message: string | Uint8Array, signature: string): string;
74
+ recoverAddress(message: string | Uint8Array, signature: string): string;
75
+ Interface: typeof import("./abi/interface").Interface;
76
+ AbiCoder: typeof import("./abi/interface").AbiCoder;
77
+ Fragment: typeof import("./abi/fragments").Fragment;
78
+ NamedFragment: typeof import("./abi/fragments").NamedFragment;
79
+ FunctionFragment: typeof import("./abi/fragments").FunctionFragment;
80
+ EventFragment: typeof import("./abi/fragments").EventFragment;
81
+ ErrorFragment: typeof import("./abi/fragments").ErrorFragment;
82
+ ConstructorFragment: typeof import("./abi/fragments").ConstructorFragment;
83
+ StructFragment: typeof import("./abi/fragments").StructFragment;
84
+ FallbackFragment: typeof import("./abi/fragments").FallbackFragment;
85
+ ContractFactory: typeof import("./contract/contract-factory").ContractFactory;
86
+ BaseContract: typeof import("./contract/contract").BaseContract;
87
+ Contract: typeof import("./contract/contract").Contract;
88
+ ContractTransactionResponse: typeof import("./contract/contract").ContractTransactionResponse;
89
+ ContractTransactionReceipt: typeof import("./contract/contract").ContractTransactionReceipt;
90
+ EventLog: typeof import("./contract/contract").EventLog;
91
+ SigningKey: typeof import("./wallet/wallet").SigningKey;
92
+ AbstractSigner: typeof import("./wallet/wallet").AbstractSigner;
93
+ BaseWallet: typeof import("./wallet/wallet").BaseWallet;
94
+ Wallet: typeof import("./wallet/wallet").Wallet;
95
+ NonceManager: typeof import("./wallet/wallet").NonceManager;
96
+ JsonRpcSigner: typeof import("./wallet/wallet").JsonRpcSigner;
97
+ VoidSigner: typeof import("./wallet/wallet").VoidSigner;
98
+ getProvider(endpoint?: string | undefined, chainId?: number | undefined): import("./providers/provider").AbstractProvider;
99
+ WebSocketProvider: typeof import("./providers/extra-providers").WebSocketProvider;
100
+ IpcSocketProvider: typeof import("./providers/extra-providers").IpcSocketProvider;
101
+ BrowserProvider: typeof import("./providers/extra-providers").BrowserProvider;
102
+ FallbackProvider: typeof import("./providers/extra-providers").FallbackProvider;
103
+ FilterByBlockHash: typeof import("./providers/extra-providers").FilterByBlockHash;
104
+ JsonRpcProvider: typeof import("./providers/json-rpc-provider").JsonRpcProvider;
105
+ JsonRpcApiProvider: typeof import("./providers/json-rpc-provider").JsonRpcApiProvider;
106
+ Provider: typeof import("./providers/provider").Provider;
107
+ AbstractProvider: typeof import("./providers/provider").AbstractProvider;
108
+ Block: typeof import("./providers/provider").Block;
109
+ TransactionResponse: typeof import("./providers/provider").TransactionResponse;
110
+ TransactionReceipt: typeof import("./providers/provider").TransactionReceipt;
111
+ Log: typeof import("./providers/provider").Log;
112
+ version: string;
113
+ ZeroAddress: string;
114
+ ZeroHash: string;
115
+ MaxUint256: bigint;
116
+ MaxUint160: bigint;
117
+ MinInt256: bigint;
118
+ MaxInt256: bigint;
119
+ NumericFault: string;
120
+ NumericFaultCode: string;
121
+ EtherSymbol: string;
122
+ N: bigint;
123
+ };
124
+ export = _exports;
125
+ import errors = require("./errors");
package/src/index.js CHANGED
@@ -1,41 +1,41 @@
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
+ /**
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,61 +1,61 @@
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
- * Returns true if value is a hex string.
15
- * @param {any} value
16
- * @param {number=} lengthBytes Optional exact byte length.
17
- * @returns {boolean}
18
- */
19
- export function isHexString(value: any, lengthBytes?: number | undefined): boolean;
20
- /**
21
- * Strip 0x prefix.
22
- * @param {string} hex
23
- * @returns {string}
24
- */
25
- export function strip0x(hex: string): string;
26
- /**
27
- * Ensure a 0x prefix.
28
- * @param {string} hex
29
- * @returns {string}
30
- */
31
- export function add0x(hex: string): string;
32
- /**
33
- * Convert a hex string to bytes.
34
- * @param {string} hex
35
- * @returns {Uint8Array}
36
- */
37
- export function hexToBytes(hex: string): Uint8Array;
38
- /**
39
- * Convert bytes to hex string.
40
- * @param {Uint8Array} bytes
41
- * @returns {string}
42
- */
43
- export function bytesToHex(bytes: Uint8Array): string;
44
- /**
45
- * UTF-8 encode a string to bytes.
46
- * @param {string} str
47
- * @returns {Uint8Array}
48
- */
49
- export function utf8ToBytes(str: string): Uint8Array;
50
- /**
51
- * UTF-8 decode bytes to a string.
52
- * @param {Uint8Array} bytes
53
- * @returns {string}
54
- */
55
- export function bytesToUtf8(bytes: Uint8Array): string;
56
- /**
57
- * Convert BytesLike to Uint8Array.
58
- * @param {string | Uint8Array} data
59
- * @returns {Uint8Array}
60
- */
61
- export function arrayify(data: string | Uint8Array): Uint8Array;
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
+ * Returns true if value is a hex string.
15
+ * @param {any} value
16
+ * @param {number=} lengthBytes Optional exact byte length.
17
+ * @returns {boolean}
18
+ */
19
+ export function isHexString(value: any, lengthBytes?: number | undefined): boolean;
20
+ /**
21
+ * Strip 0x prefix.
22
+ * @param {string} hex
23
+ * @returns {string}
24
+ */
25
+ export function strip0x(hex: string): string;
26
+ /**
27
+ * Ensure a 0x prefix.
28
+ * @param {string} hex
29
+ * @returns {string}
30
+ */
31
+ export function add0x(hex: string): string;
32
+ /**
33
+ * Convert a hex string to bytes.
34
+ * @param {string} hex
35
+ * @returns {Uint8Array}
36
+ */
37
+ export function hexToBytes(hex: string): Uint8Array;
38
+ /**
39
+ * Convert bytes to hex string.
40
+ * @param {Uint8Array} bytes
41
+ * @returns {string}
42
+ */
43
+ export function bytesToHex(bytes: Uint8Array): string;
44
+ /**
45
+ * UTF-8 encode a string to bytes.
46
+ * @param {string} str
47
+ * @returns {Uint8Array}
48
+ */
49
+ export function utf8ToBytes(str: string): Uint8Array;
50
+ /**
51
+ * UTF-8 decode bytes to a string.
52
+ * @param {Uint8Array} bytes
53
+ * @returns {string}
54
+ */
55
+ export function bytesToUtf8(bytes: Uint8Array): string;
56
+ /**
57
+ * Convert BytesLike to Uint8Array.
58
+ * @param {string | Uint8Array} data
59
+ * @returns {Uint8Array}
60
+ */
61
+ export function arrayify(data: string | Uint8Array): Uint8Array;