quantumcoin 7.0.10 → 7.0.11

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 (172) hide show
  1. package/README-SDK.md +0 -5
  2. package/README.md +1 -3
  3. package/SPEC.md +2 -63
  4. package/config.js +10 -2
  5. package/examples/example.js +0 -5
  6. package/examples/example.ts +0 -5
  7. package/examples/node_modules/.bin/esbuild +16 -0
  8. package/examples/node_modules/.bin/esbuild.cmd +17 -0
  9. package/examples/node_modules/.bin/esbuild.ps1 +28 -0
  10. package/examples/node_modules/.bin/sdkgen +16 -0
  11. package/examples/node_modules/.bin/sdkgen.cmd +17 -0
  12. package/examples/node_modules/.bin/sdkgen.ps1 +28 -0
  13. package/examples/node_modules/.bin/tsx +16 -0
  14. package/examples/node_modules/.bin/tsx.cmd +17 -0
  15. package/examples/node_modules/.bin/tsx.ps1 +28 -0
  16. package/examples/node_modules/.package-lock.json +235 -0
  17. package/examples/node_modules/@esbuild/win32-x64/README.md +3 -0
  18. package/examples/node_modules/@esbuild/win32-x64/esbuild.exe +0 -0
  19. package/examples/node_modules/@esbuild/win32-x64/package.json +20 -0
  20. package/examples/node_modules/esbuild/LICENSE.md +21 -0
  21. package/examples/node_modules/esbuild/README.md +3 -0
  22. package/examples/node_modules/esbuild/bin/esbuild +223 -0
  23. package/examples/node_modules/esbuild/install.js +289 -0
  24. package/examples/node_modules/esbuild/lib/main.d.ts +716 -0
  25. package/examples/node_modules/esbuild/lib/main.js +2532 -0
  26. package/examples/node_modules/esbuild/package.json +49 -0
  27. package/examples/node_modules/get-tsconfig/LICENSE +21 -0
  28. package/examples/node_modules/get-tsconfig/README.md +235 -0
  29. package/examples/node_modules/get-tsconfig/dist/index.cjs +7 -0
  30. package/examples/node_modules/get-tsconfig/dist/index.d.cts +2088 -0
  31. package/examples/node_modules/get-tsconfig/dist/index.d.mts +2088 -0
  32. package/examples/node_modules/get-tsconfig/dist/index.mjs +7 -0
  33. package/examples/node_modules/get-tsconfig/package.json +46 -0
  34. package/examples/node_modules/quantum-coin-js-sdk/.github/workflows/publish-npmjs.yaml +22 -0
  35. package/examples/node_modules/quantum-coin-js-sdk/LICENSE +21 -0
  36. package/examples/node_modules/quantum-coin-js-sdk/LICENSE-wasm_exec.js.txt +30 -0
  37. package/examples/node_modules/quantum-coin-js-sdk/README.md +1665 -0
  38. package/examples/node_modules/quantum-coin-js-sdk/example/README.md +14 -0
  39. package/examples/node_modules/quantum-coin-js-sdk/example/conversion-example.js +19 -0
  40. package/examples/node_modules/quantum-coin-js-sdk/example/example-create-contract.js +396 -0
  41. package/examples/node_modules/quantum-coin-js-sdk/example/example-encode-decode-rlp.js +225 -0
  42. package/examples/node_modules/quantum-coin-js-sdk/example/example-event-pack-unpack.js +391 -0
  43. package/examples/node_modules/quantum-coin-js-sdk/example/example-misc.js +101 -0
  44. package/examples/node_modules/quantum-coin-js-sdk/example/example-rpc-send-signRawTransaction.js +318 -0
  45. package/examples/node_modules/quantum-coin-js-sdk/example/example-rpc-send.js +116 -0
  46. package/examples/node_modules/quantum-coin-js-sdk/example/example-send.js +70 -0
  47. package/examples/node_modules/quantum-coin-js-sdk/example/example-token-pack-unpack.js +961 -0
  48. package/examples/node_modules/quantum-coin-js-sdk/example/example-wallet-version4.js +35 -0
  49. package/examples/node_modules/quantum-coin-js-sdk/example/example-wallet.js +43 -0
  50. package/examples/node_modules/quantum-coin-js-sdk/example/example.js +405 -0
  51. package/examples/node_modules/quantum-coin-js-sdk/example/package-lock.json +134 -0
  52. package/examples/node_modules/quantum-coin-js-sdk/example/package.json +15 -0
  53. package/examples/node_modules/quantum-coin-js-sdk/index.d.ts +1024 -0
  54. package/examples/node_modules/quantum-coin-js-sdk/index.js +3062 -0
  55. package/examples/node_modules/quantum-coin-js-sdk/package.json +34 -0
  56. package/examples/node_modules/quantum-coin-js-sdk/tests/encrypted-32.json +1 -0
  57. package/examples/node_modules/quantum-coin-js-sdk/tests/encrypted-36.json +1 -0
  58. package/examples/node_modules/quantum-coin-js-sdk/tests/encrypted-48.json +1 -0
  59. package/examples/node_modules/quantum-coin-js-sdk/tests/generate-verify-vectors.js +91 -0
  60. package/examples/node_modules/quantum-coin-js-sdk/tests/non-transactional.preinit.test.js +41 -0
  61. package/examples/node_modules/quantum-coin-js-sdk/tests/non-transactional.test.js +686 -0
  62. package/examples/node_modules/quantum-coin-js-sdk/tests/sign-raw-keytype5-context-null.test.js +107 -0
  63. package/examples/node_modules/quantum-coin-js-sdk/tests/sign-raw-transaction.test.js +196 -0
  64. package/examples/node_modules/quantum-coin-js-sdk/tests/sign-verify.test.js +311 -0
  65. package/examples/node_modules/quantum-coin-js-sdk/tests/transactional.relay.test.js +131 -0
  66. package/examples/node_modules/quantum-coin-js-sdk/tests/transactional.rpc.test.js +103 -0
  67. package/examples/node_modules/quantum-coin-js-sdk/tests/verify-vectors.json +95035 -0
  68. package/examples/node_modules/quantum-coin-js-sdk/wasmBase64.d.ts +9 -0
  69. package/examples/node_modules/quantum-coin-js-sdk/wasmBase64.js +16 -0
  70. package/examples/node_modules/quantum-coin-js-sdk/wasm_exec.d.ts +0 -0
  71. package/examples/node_modules/quantum-coin-js-sdk/wasm_exec.js +587 -0
  72. package/examples/node_modules/resolve-pkg-maps/LICENSE +21 -0
  73. package/examples/node_modules/resolve-pkg-maps/README.md +216 -0
  74. package/examples/node_modules/resolve-pkg-maps/dist/index.cjs +1 -0
  75. package/examples/node_modules/resolve-pkg-maps/dist/index.d.cts +11 -0
  76. package/examples/node_modules/resolve-pkg-maps/dist/index.d.mts +11 -0
  77. package/examples/node_modules/resolve-pkg-maps/dist/index.mjs +1 -0
  78. package/examples/node_modules/resolve-pkg-maps/package.json +42 -0
  79. package/examples/node_modules/seed-words/.github/workflows/publish-npmjs.yaml +22 -0
  80. package/examples/node_modules/seed-words/BUILD.md +7 -0
  81. package/examples/node_modules/seed-words/LICENSE +121 -0
  82. package/examples/node_modules/seed-words/README.md +67 -0
  83. package/examples/node_modules/seed-words/dist/seedwords.d.ts +39 -0
  84. package/examples/node_modules/seed-words/package.json +27 -0
  85. package/examples/node_modules/seed-words/seedwords.js +315 -0
  86. package/examples/node_modules/seed-words/seedwords.txt +65536 -0
  87. package/examples/node_modules/seed-words/tsconfig.json +21 -0
  88. package/examples/node_modules/tsx/LICENSE +21 -0
  89. package/examples/node_modules/tsx/README.md +32 -0
  90. package/examples/node_modules/tsx/dist/cjs/api/index.cjs +1 -0
  91. package/examples/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
  92. package/examples/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
  93. package/examples/node_modules/tsx/dist/cjs/api/index.mjs +1 -0
  94. package/examples/node_modules/tsx/dist/cjs/index.cjs +1 -0
  95. package/examples/node_modules/tsx/dist/cjs/index.mjs +1 -0
  96. package/examples/node_modules/tsx/dist/cli.cjs +54 -0
  97. package/examples/node_modules/tsx/dist/cli.mjs +55 -0
  98. package/examples/node_modules/tsx/dist/client-BQVF1NaW.mjs +1 -0
  99. package/examples/node_modules/tsx/dist/client-D6NvIMSC.cjs +1 -0
  100. package/examples/node_modules/tsx/dist/esm/api/index.cjs +1 -0
  101. package/examples/node_modules/tsx/dist/esm/api/index.d.cts +35 -0
  102. package/examples/node_modules/tsx/dist/esm/api/index.d.mts +35 -0
  103. package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -0
  104. package/examples/node_modules/tsx/dist/esm/index.cjs +2 -0
  105. package/examples/node_modules/tsx/dist/esm/index.mjs +2 -0
  106. package/examples/node_modules/tsx/dist/get-pipe-path-BHW2eJdv.mjs +1 -0
  107. package/examples/node_modules/tsx/dist/get-pipe-path-BoR10qr8.cjs +1 -0
  108. package/examples/node_modules/tsx/dist/index-7AaEi15b.mjs +14 -0
  109. package/examples/node_modules/tsx/dist/index-BWFBUo6r.cjs +1 -0
  110. package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +1 -0
  111. package/examples/node_modules/tsx/dist/index-gckBtVBf.cjs +14 -0
  112. package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +3 -0
  113. package/examples/node_modules/tsx/dist/lexer-DgIbo0BU.cjs +3 -0
  114. package/examples/node_modules/tsx/dist/loader.cjs +1 -0
  115. package/examples/node_modules/tsx/dist/loader.mjs +1 -0
  116. package/examples/node_modules/tsx/dist/node-features-_8ZFwP_x.mjs +1 -0
  117. package/examples/node_modules/tsx/dist/node-features-roYmp9jK.cjs +1 -0
  118. package/examples/node_modules/tsx/dist/package-CeBgXWuR.mjs +1 -0
  119. package/examples/node_modules/tsx/dist/package-Dxt5kIHw.cjs +1 -0
  120. package/examples/node_modules/tsx/dist/patch-repl.cjs +1 -0
  121. package/examples/node_modules/tsx/dist/patch-repl.mjs +1 -0
  122. package/examples/node_modules/tsx/dist/preflight.cjs +1 -0
  123. package/examples/node_modules/tsx/dist/preflight.mjs +1 -0
  124. package/examples/node_modules/tsx/dist/register-2sWVXuRQ.cjs +1 -0
  125. package/examples/node_modules/tsx/dist/register-B7jrtLTO.mjs +1 -0
  126. package/examples/node_modules/tsx/dist/register-CFH5oNdT.mjs +4 -0
  127. package/examples/node_modules/tsx/dist/register-D46fvsV_.cjs +4 -0
  128. package/examples/node_modules/tsx/dist/repl.cjs +3 -0
  129. package/examples/node_modules/tsx/dist/repl.mjs +3 -0
  130. package/examples/node_modules/tsx/dist/require-D4F1Lv60.cjs +1 -0
  131. package/examples/node_modules/tsx/dist/require-DQxpCAr4.mjs +1 -0
  132. package/examples/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
  133. package/examples/node_modules/tsx/dist/suppress-warnings.mjs +1 -0
  134. package/examples/node_modules/tsx/dist/temporary-directory-B83uKxJF.cjs +1 -0
  135. package/examples/node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs +1 -0
  136. package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +5 -0
  137. package/examples/node_modules/tsx/package.json +68 -0
  138. package/examples/offline-signing.js +0 -2
  139. package/examples/offline-signing.ts +0 -1
  140. package/examples/package-lock.json +422 -73
  141. package/examples/package.json +1 -1
  142. package/examples/wallet-offline.js +1 -9
  143. package/examples/wallet-offline.ts +1 -9
  144. package/generate-sdk.js +4 -6
  145. package/package.json +2 -2
  146. package/src/abi/interface.js +13 -7
  147. package/src/abi/js-abi-coder.js +23 -18
  148. package/src/constants.d.ts +0 -5
  149. package/src/constants.js +0 -7
  150. package/src/contract/contract-factory.js +9 -3
  151. package/src/contract/contract.js +9 -3
  152. package/src/errors/index.js +12 -0
  153. package/src/index.d.ts +0 -3
  154. package/src/providers/extra-providers.js +20 -6
  155. package/src/providers/json-rpc-provider.js +15 -5
  156. package/src/providers/provider.d.ts +0 -2
  157. package/src/providers/provider.js +1 -3
  158. package/src/utils/address.d.ts +0 -14
  159. package/src/utils/address.js +12 -49
  160. package/src/utils/hashing.d.ts +0 -6
  161. package/src/utils/hashing.js +8 -23
  162. package/src/utils/index.d.ts +0 -3
  163. package/src/utils/rlp.js +7 -4
  164. package/src/wallet/wallet.d.ts +2 -13
  165. package/src/wallet/wallet.js +116 -97
  166. package/test/security/malformed-input.test.js +295 -1
  167. package/test/unit/address-wallet.test.js +188 -129
  168. package/test/unit/address-wallet.test.ts +187 -128
  169. package/test/unit/hashing.test.js +0 -11
  170. package/test/unit/hashing.test.ts +0 -11
  171. package/test/unit/providers.test.js +3 -1
  172. package/test/unit/providers.test.ts +3 -1
package/README-SDK.md CHANGED
@@ -303,7 +303,6 @@ Wrapper returned by `provider.sendTransaction(...)` and `provider.getTransaction
303
303
  - `data: string`
304
304
  - `value: bigint`
305
305
  - `gasLimit: bigint | null`
306
- - `gasPrice: bigint | null`
307
306
  - `chainId: number | null`
308
307
  - `blockNumber: number | null`
309
308
  - `txType: number | null` — Transaction type (e.g. `1` for a standard transfer)
@@ -375,7 +374,6 @@ Core signing implementation.
375
374
 
376
375
  **Methods**
377
376
  - `getAddress(): Promise<string>`
378
- - `signMessageSync(message: string | Uint8Array): string`
379
377
  - `signTransaction(tx: TransactionRequest): Promise<string>`
380
378
  - `sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>`
381
379
 
@@ -387,7 +385,6 @@ User-facing wallet class.
387
385
 
388
386
  **Static methods**
389
387
  - `Wallet.createRandom(provider?: AbstractProvider, keyType?: number | null): Wallet` — `keyType`: `null`/`3` (default, hybrid compact) or `5` (hybrid5)
390
- - `Wallet.createRandomSeed(keyType?: number | null): string[]` — returns seed words (32 for keyType 3, 36 for keyType 5); pass to `fromPhrase` to open
391
388
  - `Wallet.fromSeed(seed: number[], provider?: AbstractProvider): Wallet` — opens wallet from raw seed bytes (64/72/96 length)
392
389
  - `Wallet.fromEncryptedJsonSync(json: string, password: string, provider?: AbstractProvider): Wallet`
393
390
  - `Wallet.fromPhrase(phrase: string | string[], provider?: AbstractProvider): Wallet`
@@ -561,8 +558,6 @@ From `quantumcoin`:
561
558
  - `getCreateAddress({ from, nonce }): string`
562
559
  - `getCreate2Address(from: string, salt: string, initCodeHash: string): string`
563
560
  - `computeAddress(publicKey: string|Uint8Array): string`
564
- - `verifyMessage(message: string|Uint8Array, signature: string): string`
565
- - `recoverAddress(message: string|Uint8Array, signature: string): string`
566
561
 
567
562
  **Example(s):**
568
563
  - `examples/wallet-offline.js`
package/README.md CHANGED
@@ -44,14 +44,12 @@ console.log(await provider.getBlockNumber());
44
44
  ## Wallet (offline + online)
45
45
 
46
46
  ```js
47
- const { Wallet, verifyMessage } = require("quantumcoin");
47
+ const { Wallet } = require("quantumcoin");
48
48
  const { Initialize } = require("quantumcoin/config");
49
49
 
50
50
  await Initialize(null);
51
51
 
52
52
  const wallet = Wallet.createRandom();
53
- const sig = wallet.signMessageSync("Hello, QuantumCoin!");
54
- console.log(verifyMessage("Hello, QuantumCoin!", sig));
55
53
 
56
54
  const encrypted = wallet.encryptSync("mySecurePassword123");
57
55
  const restored = Wallet.fromEncryptedJsonSync(encrypted, "mySecurePassword123");
package/SPEC.md CHANGED
@@ -380,7 +380,6 @@ Returns prefetched transaction objects (if available).
380
380
  - `value`: bigint | string - Value in wei
381
381
  - `data`: string - Transaction data (hex string)
382
382
  - `gasLimit`: bigint | string - Gas limit
383
- - `gasPrice`: bigint | string - Gas price
384
383
  - `nonce`: number - Transaction nonce
385
384
  - `chainId`: number - Chain ID
386
385
  - `remarks`: string | null - Optional hex string (including 0x) that represents a remark/comment. Maximum 32 bytes length (in bytes). Warning: do not store any sensitive information in this field as it will be public on the blockchain.
@@ -399,7 +398,6 @@ Returns prefetched transaction objects (if available).
399
398
  - `value`: bigint - Value in wei
400
399
  - `data`: string - Transaction data
401
400
  - `gasLimit`: bigint - Gas limit
402
- - `gasPrice`: bigint | null - Gas price
403
401
  - `nonce`: number - Nonce
404
402
  - `chainId`: number - Chain ID
405
403
  - `remarks`: string | null - Optional hex string (including 0x) that represents a remark/comment. Maximum 32 bytes length (in bytes). Warning: do not store any sensitive information in this field as it will be public on the blockchain.
@@ -713,12 +711,6 @@ constructor(privateKey: SigningKey, provider?: null | Provider)
713
711
  Returns the wallet address.
714
712
  - Returns: Address string
715
713
 
716
- #### `signMessageSync(message: string | Uint8Array): string`
717
- Returns the signature for message signed with this wallet (synchronous).
718
- - `message`: Message to sign (string or bytes)
719
- - Returns: Signature string
720
- - **Implementation**: Uses quantum-coin-js-sdk for message signing
721
-
722
714
  #### `signTransaction(tx: TransactionRequest): Promise<string>`
723
715
  Signs a transaction and returns the signed transaction data.
724
716
  - `tx`: Transaction request
@@ -837,7 +829,7 @@ Creates a wallet from a seed phrase.
837
829
  **Provider Usage**:
838
830
  - The provider is optional in the constructor. If not provided, `provider` will be `null`.
839
831
  - Methods that require blockchain access (`getBalance()`, `getTransactionCount()`, `sendTransaction()`) will throw an error if `provider` is `null`.
840
- - Methods that only require signing (`signTransaction()`, `signMessageSync()`, `signTypedData()`) can work without a provider.
832
+ - Methods that only require signing (`signTransaction()`, `signTypedData()`) can work without a provider.
841
833
  - The provider can be set later using the `connect(provider)` method.
842
834
 
843
835
  **Methods**:
@@ -868,13 +860,6 @@ Signs a transaction and returns the signed transaction data.
868
860
  - **Does not require provider**: Can sign transactions offline.
869
861
  - Note: The `remarks` field in TransactionRequest is optional and can be used to include a comment (max 32 bytes). Do not store sensitive information in remarks.
870
862
 
871
- #### `signMessageSync(message: string | Uint8Array): string`
872
- Signs a message and returns the signature (synchronous).
873
- - `message`: Message to sign (string or bytes)
874
- - Returns: Signature string
875
- - **Does not require provider**: Can sign messages offline.
876
- - **Implementation**: Uses quantum-coin-js-sdk for message signing
877
-
878
863
  #### `encryptSync(password: string | Uint8Array): string`
879
864
  Encrypts and serializes this wallet to a JSON string (synchronous).
880
865
  - `password`: Passphrase used to encrypt the wallet (should be at least 12 characters long)
@@ -1697,7 +1682,6 @@ Creates a Signature from various formats.
1697
1682
  - `from`: string | null - Sender address (null if not specified)
1698
1683
  - `nonce`: number | null - Transaction nonce
1699
1684
  - `gasLimit`: bigint | null - Gas limit
1700
- - `gasPrice`: bigint | null - Gas price
1701
1685
  - `value`: bigint | null - Transaction value in wei
1702
1686
  - `data`: string | null - Transaction data (hex string)
1703
1687
  - `chainId`: bigint | null - Chain ID
@@ -1816,20 +1800,6 @@ Computes address from public key.
1816
1800
  - Returns: Computed address (32 bytes, 66 hex characters including 0x)
1817
1801
  - **Implementation**: Uses quantum-coin-js-sdk's `addressFromPublicKey()` internally
1818
1802
 
1819
- #### `verifyMessage(message: string | Uint8Array, signature: string): string`
1820
- Verifies a message signature and recovers the address.
1821
- - `message`: Message that was signed
1822
- - `signature`: Signature to verify (hex string)
1823
- - Returns: Address that signed the message
1824
- - **Implementation**: Uses quantum-coin-js-sdk for signature verification
1825
-
1826
- #### `recoverAddress(message: string | Uint8Array, signature: string): string`
1827
- Recovers the address from a message signature.
1828
- - `message`: Message that was signed
1829
- - `signature`: Signature (hex string)
1830
- - Returns: Address that signed the message
1831
- - **Implementation**: Uses quantum-coin-js-sdk for signature recovery
1832
-
1833
1803
  ### 5.4.1 Addressable Interface
1834
1804
 
1835
1805
  **Purpose**: An interface for objects which have an address, and can resolve it asynchronously.
@@ -2602,7 +2572,6 @@ Compute the intrinsic gas required for a transaction using plugin parameters.
2602
2572
  - `value`: bigint - Value in wei
2603
2573
  - `data`: string - Transaction data (hex string)
2604
2574
  - `gasLimit`: bigint - Gas limit
2605
- - `gasPrice`: bigint | null - Gas price
2606
2575
  - `nonce`: number - Transaction nonce
2607
2576
  - `chainId`: number - Chain ID
2608
2577
  - `remarks`: string | null - Optional remarks field
@@ -2652,27 +2621,6 @@ Resolves to the number of confirmations this transaction has.
2652
2621
 
2653
2622
  ---
2654
2623
 
2655
- ### 8.4 FeeData
2656
-
2657
- **Purpose**: Represents fee data for transactions
2658
-
2659
- **Constructor**:
2660
- ```javascript
2661
- constructor(gasPrice: bigint | null)
2662
- ```
2663
- - `gasPrice`: Legacy gas price
2664
-
2665
- **Properties**:
2666
- - `gasPrice`: bigint | null - Gas price
2667
-
2668
- **Methods**:
2669
-
2670
- #### `toJSON(): any`
2671
- Converts to JSON.
2672
- - Returns: JSON representation of FeeData
2673
-
2674
- **Note**: For QuantumCoin, only `gasPrice` is used (EIP-1559 style transactions are not applicable).
2675
-
2676
2624
  ---
2677
2625
 
2678
2626
  ### 8.5 WebSocketLike
@@ -2908,7 +2856,7 @@ Gets the result of a transaction execution.
2908
2856
 
2909
2857
  ### 9.3 Signer (Abstract Base Class)
2910
2858
 
2911
- **Note**: The API matches ethers.js v6 Signer. All methods, properties, and behavior follow the same patterns as ethers.js v6, except `signMessage()` is replaced with `signMessageSync()` for synchronous operation.
2859
+ **Note**: The API matches ethers.js v6 Signer. All methods, properties, and behavior follow the same patterns as ethers.js v6.
2912
2860
 
2913
2861
  **Properties**:
2914
2862
  - `provider`: Provider | null - Provider instance
@@ -2933,11 +2881,6 @@ Signs and sends transaction.
2933
2881
  Signs transaction.
2934
2882
  - Note: The `remarks` field in TransactionRequest is optional and can be used to include a comment (max 32 bytes). Do not store sensitive information in remarks.
2935
2883
 
2936
- #### `signMessageSync(message: string | Uint8Array): string`
2937
- Signs message (synchronous).
2938
- - `message`: Message to sign (string or bytes)
2939
- - Returns: Signature string
2940
-
2941
2884
  #### `connect(provider: Provider): Signer`
2942
2885
  Connects to provider.
2943
2886
 
@@ -3128,9 +3071,6 @@ const walletFromPhrase2 = Wallet.fromPhrase(seedPhraseString, provider);
3128
3071
  const encryptedJson = wallet.encryptSync('mySecurePassword123');
3129
3072
  // Can be saved to file and opened in Desktop/Mobile/Web/CLI wallet applications
3130
3073
 
3131
- // Sign message synchronously
3132
- const signature = wallet.signMessageSync('Hello, QuantumCoin!');
3133
-
3134
3074
  const tx = await wallet.sendTransaction({
3135
3075
  to: '0x...',
3136
3076
  value: parseEther('1.0')
@@ -3780,7 +3720,6 @@ Methods that send transactions must return the appropriate transaction object fr
3780
3720
  - `value`: Transaction value
3781
3721
  - `data`: Transaction data
3782
3722
  - `gasLimit`: Gas limit
3783
- - `gasPrice`: Gas price
3784
3723
  - `nonce`: Transaction nonce
3785
3724
  - `chainId`: Chain ID
3786
3725
  - `wait()`: Method to wait for confirmation
package/config.js CHANGED
@@ -106,10 +106,18 @@ function getConfig() {
106
106
  return _config;
107
107
  }
108
108
 
109
- // Export Config class and Initialize function
109
+ /**
110
+ * Returns the pending initialization promise, or null if Initialize() has not been called.
111
+ * @return {Promise<boolean>|null}
112
+ */
113
+ function getInitializationPromise() {
114
+ return _initializationPromise;
115
+ }
116
+
110
117
  module.exports = {
111
118
  Config,
112
119
  Initialize,
113
120
  isInitialized,
114
- getConfig
121
+ getConfig,
122
+ getInitializationPromise
115
123
  };
@@ -47,11 +47,6 @@ async function main() {
47
47
  const wallet = qc.Wallet.createRandom();
48
48
  console.log("Random wallet address:", wallet.address);
49
49
  logAddress("random_wallet", wallet.address);
50
- const sig = wallet.signMessageSync("Hello, QuantumCoin!");
51
- console.log("Signed message signature:", sig.slice(0, 18) + "...");
52
- const recovered = qc.verifyMessage("Hello, QuantumCoin!", sig);
53
- console.log("Recovered address:", recovered);
54
- logAddress("recovered", recovered);
55
50
 
56
51
  const encrypted = wallet.encryptSync("mySecurePassword123");
57
52
  console.log("Encrypted wallet JSON length:", encrypted.length);
@@ -38,11 +38,6 @@ async function main(): Promise<void> {
38
38
  const wallet = qc.Wallet.createRandom();
39
39
  console.log("Random wallet address:", wallet.address);
40
40
  logAddress("random_wallet", wallet.address);
41
- const sig = wallet.signMessageSync("Hello, QuantumCoin!");
42
- console.log("Signed message signature:", sig.slice(0, 18) + "...");
43
- const recovered = qc.verifyMessage("Hello, QuantumCoin!", sig);
44
- console.log("Recovered address:", recovered);
45
- logAddress("recovered", recovered);
46
41
 
47
42
  const encrypted = wallet.encryptSync("mySecurePassword123");
48
43
  console.log("Encrypted wallet JSON length:", encrypted.length);
@@ -0,0 +1,16 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -x "$basedir/node" ]; then
13
+ exec "$basedir/node" "$basedir/../esbuild/bin/esbuild" "$@"
14
+ else
15
+ exec node "$basedir/../esbuild/bin/esbuild" "$@"
16
+ fi
@@ -0,0 +1,17 @@
1
+ @ECHO off
2
+ GOTO start
3
+ :find_dp0
4
+ SET dp0=%~dp0
5
+ EXIT /b
6
+ :start
7
+ SETLOCAL
8
+ CALL :find_dp0
9
+
10
+ IF EXIST "%dp0%\node.exe" (
11
+ SET "_prog=%dp0%\node.exe"
12
+ ) ELSE (
13
+ SET "_prog=node"
14
+ SET PATHEXT=%PATHEXT:;.JS;=;%
15
+ )
16
+
17
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esbuild\bin\esbuild" %*
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6
+ # Fix case when both the Windows and Linux builds of Node
7
+ # are installed in the same directory
8
+ $exe=".exe"
9
+ }
10
+ $ret=0
11
+ if (Test-Path "$basedir/node$exe") {
12
+ # Support pipeline input
13
+ if ($MyInvocation.ExpectingInput) {
14
+ $input | & "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args
15
+ } else {
16
+ & "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args
17
+ }
18
+ $ret=$LASTEXITCODE
19
+ } else {
20
+ # Support pipeline input
21
+ if ($MyInvocation.ExpectingInput) {
22
+ $input | & "node$exe" "$basedir/../esbuild/bin/esbuild" $args
23
+ } else {
24
+ & "node$exe" "$basedir/../esbuild/bin/esbuild" $args
25
+ }
26
+ $ret=$LASTEXITCODE
27
+ }
28
+ exit $ret
@@ -0,0 +1,16 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -x "$basedir/node" ]; then
13
+ exec "$basedir/node" "$basedir/../quantumcoin/generate-sdk.js" "$@"
14
+ else
15
+ exec node "$basedir/../quantumcoin/generate-sdk.js" "$@"
16
+ fi
@@ -0,0 +1,17 @@
1
+ @ECHO off
2
+ GOTO start
3
+ :find_dp0
4
+ SET dp0=%~dp0
5
+ EXIT /b
6
+ :start
7
+ SETLOCAL
8
+ CALL :find_dp0
9
+
10
+ IF EXIST "%dp0%\node.exe" (
11
+ SET "_prog=%dp0%\node.exe"
12
+ ) ELSE (
13
+ SET "_prog=node"
14
+ SET PATHEXT=%PATHEXT:;.JS;=;%
15
+ )
16
+
17
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\quantumcoin\generate-sdk.js" %*
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6
+ # Fix case when both the Windows and Linux builds of Node
7
+ # are installed in the same directory
8
+ $exe=".exe"
9
+ }
10
+ $ret=0
11
+ if (Test-Path "$basedir/node$exe") {
12
+ # Support pipeline input
13
+ if ($MyInvocation.ExpectingInput) {
14
+ $input | & "$basedir/node$exe" "$basedir/../quantumcoin/generate-sdk.js" $args
15
+ } else {
16
+ & "$basedir/node$exe" "$basedir/../quantumcoin/generate-sdk.js" $args
17
+ }
18
+ $ret=$LASTEXITCODE
19
+ } else {
20
+ # Support pipeline input
21
+ if ($MyInvocation.ExpectingInput) {
22
+ $input | & "node$exe" "$basedir/../quantumcoin/generate-sdk.js" $args
23
+ } else {
24
+ & "node$exe" "$basedir/../quantumcoin/generate-sdk.js" $args
25
+ }
26
+ $ret=$LASTEXITCODE
27
+ }
28
+ exit $ret
@@ -0,0 +1,16 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -x "$basedir/node" ]; then
13
+ exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
14
+ else
15
+ exec node "$basedir/../tsx/dist/cli.mjs" "$@"
16
+ fi
@@ -0,0 +1,17 @@
1
+ @ECHO off
2
+ GOTO start
3
+ :find_dp0
4
+ SET dp0=%~dp0
5
+ EXIT /b
6
+ :start
7
+ SETLOCAL
8
+ CALL :find_dp0
9
+
10
+ IF EXIST "%dp0%\node.exe" (
11
+ SET "_prog=%dp0%\node.exe"
12
+ ) ELSE (
13
+ SET "_prog=node"
14
+ SET PATHEXT=%PATHEXT:;.JS;=;%
15
+ )
16
+
17
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\tsx\dist\cli.mjs" %*
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6
+ # Fix case when both the Windows and Linux builds of Node
7
+ # are installed in the same directory
8
+ $exe=".exe"
9
+ }
10
+ $ret=0
11
+ if (Test-Path "$basedir/node$exe") {
12
+ # Support pipeline input
13
+ if ($MyInvocation.ExpectingInput) {
14
+ $input | & "$basedir/node$exe" "$basedir/../tsx/dist/cli.mjs" $args
15
+ } else {
16
+ & "$basedir/node$exe" "$basedir/../tsx/dist/cli.mjs" $args
17
+ }
18
+ $ret=$LASTEXITCODE
19
+ } else {
20
+ # Support pipeline input
21
+ if ($MyInvocation.ExpectingInput) {
22
+ $input | & "node$exe" "$basedir/../tsx/dist/cli.mjs" $args
23
+ } else {
24
+ & "node$exe" "$basedir/../tsx/dist/cli.mjs" $args
25
+ }
26
+ $ret=$LASTEXITCODE
27
+ }
28
+ exit $ret
@@ -0,0 +1,235 @@
1
+ {
2
+ "name": "quantumcoinjs-sdk-examples",
3
+ "version": "1.0.1",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "..": {
8
+ "name": "quantumcoin",
9
+ "version": "7.0.10",
10
+ "license": "MIT",
11
+ "dependencies": {
12
+ "quantum-coin-js-sdk": "1.0.33",
13
+ "seed-words": "^1.0.2"
14
+ },
15
+ "bin": {
16
+ "sdkgen": "generate-sdk.js"
17
+ },
18
+ "devDependencies": {
19
+ "tsx": "^4.19.0"
20
+ }
21
+ },
22
+ "../node_modules/@esbuild/win32-x64": {
23
+ "version": "0.27.7",
24
+ "cpu": [
25
+ "x64"
26
+ ],
27
+ "dev": true,
28
+ "license": "MIT",
29
+ "optional": true,
30
+ "os": [
31
+ "win32"
32
+ ],
33
+ "engines": {
34
+ "node": ">=18"
35
+ }
36
+ },
37
+ "../node_modules/esbuild": {
38
+ "version": "0.27.7",
39
+ "dev": true,
40
+ "hasInstallScript": true,
41
+ "license": "MIT",
42
+ "bin": {
43
+ "esbuild": "bin/esbuild"
44
+ },
45
+ "engines": {
46
+ "node": ">=18"
47
+ },
48
+ "optionalDependencies": {
49
+ "@esbuild/aix-ppc64": "0.27.7",
50
+ "@esbuild/android-arm": "0.27.7",
51
+ "@esbuild/android-arm64": "0.27.7",
52
+ "@esbuild/android-x64": "0.27.7",
53
+ "@esbuild/darwin-arm64": "0.27.7",
54
+ "@esbuild/darwin-x64": "0.27.7",
55
+ "@esbuild/freebsd-arm64": "0.27.7",
56
+ "@esbuild/freebsd-x64": "0.27.7",
57
+ "@esbuild/linux-arm": "0.27.7",
58
+ "@esbuild/linux-arm64": "0.27.7",
59
+ "@esbuild/linux-ia32": "0.27.7",
60
+ "@esbuild/linux-loong64": "0.27.7",
61
+ "@esbuild/linux-mips64el": "0.27.7",
62
+ "@esbuild/linux-ppc64": "0.27.7",
63
+ "@esbuild/linux-riscv64": "0.27.7",
64
+ "@esbuild/linux-s390x": "0.27.7",
65
+ "@esbuild/linux-x64": "0.27.7",
66
+ "@esbuild/netbsd-arm64": "0.27.7",
67
+ "@esbuild/netbsd-x64": "0.27.7",
68
+ "@esbuild/openbsd-arm64": "0.27.7",
69
+ "@esbuild/openbsd-x64": "0.27.7",
70
+ "@esbuild/openharmony-arm64": "0.27.7",
71
+ "@esbuild/sunos-x64": "0.27.7",
72
+ "@esbuild/win32-arm64": "0.27.7",
73
+ "@esbuild/win32-ia32": "0.27.7",
74
+ "@esbuild/win32-x64": "0.27.7"
75
+ }
76
+ },
77
+ "../node_modules/get-tsconfig": {
78
+ "version": "4.13.7",
79
+ "dev": true,
80
+ "license": "MIT",
81
+ "dependencies": {
82
+ "resolve-pkg-maps": "^1.0.0"
83
+ },
84
+ "funding": {
85
+ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
86
+ }
87
+ },
88
+ "../node_modules/quantum-coin-js-sdk": {
89
+ "version": "1.0.32",
90
+ "license": "MIT",
91
+ "dependencies": {
92
+ "seed-words": "1.0.2"
93
+ }
94
+ },
95
+ "../node_modules/resolve-pkg-maps": {
96
+ "version": "1.0.0",
97
+ "dev": true,
98
+ "license": "MIT",
99
+ "funding": {
100
+ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
101
+ }
102
+ },
103
+ "../node_modules/seed-words": {
104
+ "version": "1.0.2",
105
+ "license": "MIT"
106
+ },
107
+ "../node_modules/tsx": {
108
+ "version": "4.21.0",
109
+ "dev": true,
110
+ "license": "MIT",
111
+ "dependencies": {
112
+ "esbuild": "~0.27.0",
113
+ "get-tsconfig": "^4.7.5"
114
+ },
115
+ "bin": {
116
+ "tsx": "dist/cli.mjs"
117
+ },
118
+ "engines": {
119
+ "node": ">=18.0.0"
120
+ },
121
+ "optionalDependencies": {
122
+ "fsevents": "~2.3.3"
123
+ }
124
+ },
125
+ "node_modules/@esbuild/win32-x64": {
126
+ "version": "0.27.7",
127
+ "cpu": [
128
+ "x64"
129
+ ],
130
+ "dev": true,
131
+ "license": "MIT",
132
+ "optional": true,
133
+ "os": [
134
+ "win32"
135
+ ],
136
+ "engines": {
137
+ "node": ">=18"
138
+ }
139
+ },
140
+ "node_modules/esbuild": {
141
+ "version": "0.27.7",
142
+ "dev": true,
143
+ "hasInstallScript": true,
144
+ "license": "MIT",
145
+ "bin": {
146
+ "esbuild": "bin/esbuild"
147
+ },
148
+ "engines": {
149
+ "node": ">=18"
150
+ },
151
+ "optionalDependencies": {
152
+ "@esbuild/aix-ppc64": "0.27.7",
153
+ "@esbuild/android-arm": "0.27.7",
154
+ "@esbuild/android-arm64": "0.27.7",
155
+ "@esbuild/android-x64": "0.27.7",
156
+ "@esbuild/darwin-arm64": "0.27.7",
157
+ "@esbuild/darwin-x64": "0.27.7",
158
+ "@esbuild/freebsd-arm64": "0.27.7",
159
+ "@esbuild/freebsd-x64": "0.27.7",
160
+ "@esbuild/linux-arm": "0.27.7",
161
+ "@esbuild/linux-arm64": "0.27.7",
162
+ "@esbuild/linux-ia32": "0.27.7",
163
+ "@esbuild/linux-loong64": "0.27.7",
164
+ "@esbuild/linux-mips64el": "0.27.7",
165
+ "@esbuild/linux-ppc64": "0.27.7",
166
+ "@esbuild/linux-riscv64": "0.27.7",
167
+ "@esbuild/linux-s390x": "0.27.7",
168
+ "@esbuild/linux-x64": "0.27.7",
169
+ "@esbuild/netbsd-arm64": "0.27.7",
170
+ "@esbuild/netbsd-x64": "0.27.7",
171
+ "@esbuild/openbsd-arm64": "0.27.7",
172
+ "@esbuild/openbsd-x64": "0.27.7",
173
+ "@esbuild/openharmony-arm64": "0.27.7",
174
+ "@esbuild/sunos-x64": "0.27.7",
175
+ "@esbuild/win32-arm64": "0.27.7",
176
+ "@esbuild/win32-ia32": "0.27.7",
177
+ "@esbuild/win32-x64": "0.27.7"
178
+ }
179
+ },
180
+ "node_modules/get-tsconfig": {
181
+ "version": "4.13.7",
182
+ "dev": true,
183
+ "license": "MIT",
184
+ "dependencies": {
185
+ "resolve-pkg-maps": "^1.0.0"
186
+ },
187
+ "funding": {
188
+ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
189
+ }
190
+ },
191
+ "node_modules/quantum-coin-js-sdk": {
192
+ "version": "1.0.33",
193
+ "resolved": "https://registry.npmjs.org/quantum-coin-js-sdk/-/quantum-coin-js-sdk-1.0.33.tgz",
194
+ "integrity": "sha512-n4Q/PBj6yQ2mj3MpvNdLlBSoSxM9+q+yTDz/l/zuWxeob/unj1ZQgzir1Qh4U/Vu7eAbZmAhRORFP9ttfw3ToA==",
195
+ "license": "MIT",
196
+ "dependencies": {
197
+ "seed-words": "1.0.2"
198
+ }
199
+ },
200
+ "node_modules/quantumcoin": {
201
+ "resolved": "..",
202
+ "link": true
203
+ },
204
+ "node_modules/resolve-pkg-maps": {
205
+ "version": "1.0.0",
206
+ "dev": true,
207
+ "license": "MIT",
208
+ "funding": {
209
+ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
210
+ }
211
+ },
212
+ "node_modules/seed-words": {
213
+ "version": "1.0.2",
214
+ "license": "MIT"
215
+ },
216
+ "node_modules/tsx": {
217
+ "version": "4.21.0",
218
+ "dev": true,
219
+ "license": "MIT",
220
+ "dependencies": {
221
+ "esbuild": "~0.27.0",
222
+ "get-tsconfig": "^4.7.5"
223
+ },
224
+ "bin": {
225
+ "tsx": "dist/cli.mjs"
226
+ },
227
+ "engines": {
228
+ "node": ">=18.0.0"
229
+ },
230
+ "optionalDependencies": {
231
+ "fsevents": "~2.3.3"
232
+ }
233
+ }
234
+ }
235
+ }