quantumcoin 6.14.5 → 7.0.2

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 (1296) hide show
  1. package/.github/workflows/publish-npmjs.yaml +22 -0
  2. package/.gitignore +15 -0
  3. package/{LICENSE.md → LICENSE} +21 -21
  4. package/README-SDK.md +756 -0
  5. package/README.md +152 -132
  6. package/SPEC.md +3845 -0
  7. package/config.d.ts +50 -0
  8. package/config.js +115 -0
  9. package/examples/AllSolidityTypes.sol +184 -0
  10. package/examples/SimpleIERC20.sol +74 -0
  11. package/examples/events.js +35 -0
  12. package/examples/example-generator-sdk-js.js +95 -0
  13. package/examples/example-generator-sdk-ts.js +95 -0
  14. package/examples/example.js +61 -0
  15. package/examples/package-lock.json +57 -0
  16. package/examples/package.json +16 -0
  17. package/examples/read-operations.js +27 -0
  18. package/examples/sdk-generator-erc20.inline.json +251 -0
  19. package/examples/solidity-types.ts +43 -0
  20. package/examples/wallet-offline.js +29 -0
  21. package/generate-sdk.js +1383 -0
  22. package/index.js +12 -0
  23. package/package.json +61 -116
  24. package/src/abi/fragments.d.ts +42 -0
  25. package/src/abi/fragments.js +63 -0
  26. package/src/abi/index.d.ts +13 -0
  27. package/src/abi/index.js +9 -0
  28. package/src/abi/interface.d.ts +132 -0
  29. package/src/abi/interface.js +590 -0
  30. package/src/abi/js-abi-coder.js +474 -0
  31. package/src/constants.d.ts +61 -0
  32. package/src/constants.js +94 -0
  33. package/src/contract/contract-factory.d.ts +28 -0
  34. package/src/contract/contract-factory.js +105 -0
  35. package/src/contract/contract.d.ts +105 -0
  36. package/src/contract/contract.js +312 -0
  37. package/src/contract/index.d.ts +9 -0
  38. package/src/contract/index.js +9 -0
  39. package/src/errors/index.d.ts +92 -0
  40. package/src/errors/index.js +188 -0
  41. package/src/generator/index.js +1201 -0
  42. package/src/index.d.ts +127 -0
  43. package/src/index.js +41 -0
  44. package/src/internal/hex.d.ts +61 -0
  45. package/src/internal/hex.js +144 -0
  46. package/src/providers/extra-providers.d.ts +128 -0
  47. package/src/providers/extra-providers.js +575 -0
  48. package/src/providers/index.d.ts +16 -0
  49. package/src/providers/index.js +10 -0
  50. package/src/providers/json-rpc-provider.d.ts +12 -0
  51. package/src/providers/json-rpc-provider.js +79 -0
  52. package/src/providers/provider.d.ts +196 -0
  53. package/src/providers/provider.js +359 -0
  54. package/src/types/index.d.ts +462 -0
  55. package/src/types/index.js +9 -0
  56. package/src/utils/address.d.ts +72 -0
  57. package/src/utils/address.js +182 -0
  58. package/src/utils/encoding.d.ts +120 -0
  59. package/src/utils/encoding.js +306 -0
  60. package/src/utils/hashing.d.ts +76 -0
  61. package/src/utils/hashing.js +298 -0
  62. package/src/utils/index.d.ts +55 -0
  63. package/src/utils/index.js +13 -0
  64. package/src/utils/result.d.ts +57 -0
  65. package/src/utils/result.js +128 -0
  66. package/src/utils/rlp.d.ts +12 -0
  67. package/src/utils/rlp.js +200 -0
  68. package/src/utils/units.d.ts +29 -0
  69. package/src/utils/units.js +107 -0
  70. package/src/wallet/index.d.ts +10 -0
  71. package/src/wallet/index.js +8 -0
  72. package/src/wallet/wallet.d.ts +160 -0
  73. package/src/wallet/wallet.js +489 -0
  74. package/test/e2e/all-solidity-types.dynamic.test.js +200 -0
  75. package/test/e2e/all-solidity-types.fixtures.js +231 -0
  76. package/test/e2e/all-solidity-types.generated-sdks.e2e.test.js +361 -0
  77. package/test/e2e/helpers.js +47 -0
  78. package/test/e2e/simple-erc20.generated-sdks.e2e.test.js +144 -0
  79. package/test/e2e/transactional.test.js +191 -0
  80. package/test/e2e/typed-generator.e2e.test.js +402 -0
  81. package/test/fixtures/ConstructorParam.sol +23 -0
  82. package/test/fixtures/MultiContracts.sol +37 -0
  83. package/test/fixtures/SimpleStorage.sol +18 -0
  84. package/test/fixtures/StakingContract.abi.json +1 -0
  85. package/test/integration/ipc-provider.test.js +44 -0
  86. package/test/integration/provider.test.js +72 -0
  87. package/test/integration/ws-provider.test.js +33 -0
  88. package/test/security/malformed-input.test.js +31 -0
  89. package/test/unit/abi-interface.test.js +98 -0
  90. package/test/unit/address-wallet.test.js +257 -0
  91. package/test/unit/browser-provider.test.js +82 -0
  92. package/test/unit/contract.test.js +82 -0
  93. package/test/unit/encoding-units-rlp.test.js +89 -0
  94. package/test/unit/errors.test.js +74 -0
  95. package/test/unit/filter-by-blockhash.test.js +52 -0
  96. package/test/unit/generate-contract-cli.test.js +39 -0
  97. package/test/unit/generate-sdk-artifacts-json.test.js +110 -0
  98. package/test/unit/generator.test.js +98 -0
  99. package/test/unit/hashing.test.js +54 -0
  100. package/test/unit/init.test.js +36 -0
  101. package/test/unit/interface.test.js +53 -0
  102. package/test/unit/internal-hex.test.js +47 -0
  103. package/test/unit/providers.test.js +144 -0
  104. package/test/unit/result.test.js +77 -0
  105. package/test/unit/solidity-types.test.js +46 -0
  106. package/test/unit/utils.test.js +54 -0
  107. package/CHANGELOG.md +0 -442
  108. package/FUNDING.json +0 -10
  109. package/SECURITY.md +0 -34
  110. package/dist/README.md +0 -22
  111. package/dist/quantumcoin.js +0 -20940
  112. package/dist/quantumcoin.js.map +0 -1
  113. package/dist/quantumcoin.min.js +0 -1
  114. package/dist/quantumcoin.umd.js +0 -21117
  115. package/dist/quantumcoin.umd.js.map +0 -1
  116. package/dist/quantumcoin.umd.min.js +0 -1
  117. package/dist/wordlists-extra.js +0 -1500
  118. package/dist/wordlists-extra.js.map +0 -1
  119. package/dist/wordlists-extra.min.js +0 -1
  120. package/lib.commonjs/README.md +0 -16
  121. package/lib.commonjs/_version.d.ts +0 -5
  122. package/lib.commonjs/_version.d.ts.map +0 -1
  123. package/lib.commonjs/_version.js +0 -9
  124. package/lib.commonjs/_version.js.map +0 -1
  125. package/lib.commonjs/abi/abi-coder.d.ts +0 -61
  126. package/lib.commonjs/abi/abi-coder.d.ts.map +0 -1
  127. package/lib.commonjs/abi/abi-coder.js +0 -210
  128. package/lib.commonjs/abi/abi-coder.js.map +0 -1
  129. package/lib.commonjs/abi/bytes32.d.ts +0 -15
  130. package/lib.commonjs/abi/bytes32.d.ts.map +0 -1
  131. package/lib.commonjs/abi/bytes32.js +0 -45
  132. package/lib.commonjs/abi/bytes32.js.map +0 -1
  133. package/lib.commonjs/abi/coders/abstract-coder.d.ts +0 -124
  134. package/lib.commonjs/abi/coders/abstract-coder.d.ts.map +0 -1
  135. package/lib.commonjs/abi/coders/abstract-coder.js +0 -472
  136. package/lib.commonjs/abi/coders/abstract-coder.js.map +0 -1
  137. package/lib.commonjs/abi/coders/address.d.ts +0 -13
  138. package/lib.commonjs/abi/coders/address.d.ts.map +0 -1
  139. package/lib.commonjs/abi/coders/address.js +0 -33
  140. package/lib.commonjs/abi/coders/address.js.map +0 -1
  141. package/lib.commonjs/abi/coders/anonymous.d.ts +0 -15
  142. package/lib.commonjs/abi/coders/anonymous.d.ts.map +0 -1
  143. package/lib.commonjs/abi/coders/anonymous.js +0 -27
  144. package/lib.commonjs/abi/coders/anonymous.js.map +0 -1
  145. package/lib.commonjs/abi/coders/array.d.ts +0 -25
  146. package/lib.commonjs/abi/coders/array.d.ts.map +0 -1
  147. package/lib.commonjs/abi/coders/array.js +0 -165
  148. package/lib.commonjs/abi/coders/array.js.map +0 -1
  149. package/lib.commonjs/abi/coders/boolean.d.ts +0 -13
  150. package/lib.commonjs/abi/coders/boolean.d.ts.map +0 -1
  151. package/lib.commonjs/abi/coders/boolean.js +0 -25
  152. package/lib.commonjs/abi/coders/boolean.js.map +0 -1
  153. package/lib.commonjs/abi/coders/bytes.d.ts +0 -19
  154. package/lib.commonjs/abi/coders/bytes.d.ts.map +0 -1
  155. package/lib.commonjs/abi/coders/bytes.js +0 -39
  156. package/lib.commonjs/abi/coders/bytes.js.map +0 -1
  157. package/lib.commonjs/abi/coders/fixed-bytes.d.ts +0 -15
  158. package/lib.commonjs/abi/coders/fixed-bytes.d.ts.map +0 -1
  159. package/lib.commonjs/abi/coders/fixed-bytes.js +0 -32
  160. package/lib.commonjs/abi/coders/fixed-bytes.js.map +0 -1
  161. package/lib.commonjs/abi/coders/null.d.ts +0 -12
  162. package/lib.commonjs/abi/coders/null.d.ts.map +0 -1
  163. package/lib.commonjs/abi/coders/null.js +0 -28
  164. package/lib.commonjs/abi/coders/null.js.map +0 -1
  165. package/lib.commonjs/abi/coders/number.d.ts +0 -16
  166. package/lib.commonjs/abi/coders/number.d.ts.map +0 -1
  167. package/lib.commonjs/abi/coders/number.js +0 -49
  168. package/lib.commonjs/abi/coders/number.js.map +0 -1
  169. package/lib.commonjs/abi/coders/string.d.ts +0 -13
  170. package/lib.commonjs/abi/coders/string.d.ts.map +0 -1
  171. package/lib.commonjs/abi/coders/string.js +0 -25
  172. package/lib.commonjs/abi/coders/string.js.map +0 -1
  173. package/lib.commonjs/abi/coders/tuple.d.ts +0 -16
  174. package/lib.commonjs/abi/coders/tuple.d.ts.map +0 -1
  175. package/lib.commonjs/abi/coders/tuple.js +0 -67
  176. package/lib.commonjs/abi/coders/tuple.js.map +0 -1
  177. package/lib.commonjs/abi/fragments.d.ts +0 -466
  178. package/lib.commonjs/abi/fragments.d.ts.map +0 -1
  179. package/lib.commonjs/abi/fragments.js +0 -1331
  180. package/lib.commonjs/abi/fragments.js.map +0 -1
  181. package/lib.commonjs/abi/index.d.ts +0 -18
  182. package/lib.commonjs/abi/index.d.ts.map +0 -1
  183. package/lib.commonjs/abi/index.js +0 -40
  184. package/lib.commonjs/abi/index.js.map +0 -1
  185. package/lib.commonjs/abi/interface.d.ts +0 -382
  186. package/lib.commonjs/abi/interface.d.ts.map +0 -1
  187. package/lib.commonjs/abi/interface.js +0 -1110
  188. package/lib.commonjs/abi/interface.js.map +0 -1
  189. package/lib.commonjs/abi/typed.d.ts +0 -570
  190. package/lib.commonjs/abi/typed.d.ts.map +0 -1
  191. package/lib.commonjs/abi/typed.js +0 -606
  192. package/lib.commonjs/abi/typed.js.map +0 -1
  193. package/lib.commonjs/address/address.d.ts +0 -36
  194. package/lib.commonjs/address/address.d.ts.map +0 -1
  195. package/lib.commonjs/address/address.js +0 -133
  196. package/lib.commonjs/address/address.js.map +0 -1
  197. package/lib.commonjs/address/checks.d.ts +0 -81
  198. package/lib.commonjs/address/checks.d.ts.map +0 -1
  199. package/lib.commonjs/address/checks.js +0 -120
  200. package/lib.commonjs/address/checks.js.map +0 -1
  201. package/lib.commonjs/address/contract-address.d.ts +0 -48
  202. package/lib.commonjs/address/contract-address.d.ts.map +0 -1
  203. package/lib.commonjs/address/contract-address.js +0 -74
  204. package/lib.commonjs/address/contract-address.js.map +0 -1
  205. package/lib.commonjs/address/index.d.ts +0 -49
  206. package/lib.commonjs/address/index.d.ts.map +0 -1
  207. package/lib.commonjs/address/index.js +0 -28
  208. package/lib.commonjs/address/index.js.map +0 -1
  209. package/lib.commonjs/constants/addresses.d.ts +0 -7
  210. package/lib.commonjs/constants/addresses.d.ts.map +0 -1
  211. package/lib.commonjs/constants/addresses.js +0 -10
  212. package/lib.commonjs/constants/addresses.js.map +0 -1
  213. package/lib.commonjs/constants/hashes.d.ts +0 -7
  214. package/lib.commonjs/constants/hashes.d.ts.map +0 -1
  215. package/lib.commonjs/constants/hashes.js +0 -10
  216. package/lib.commonjs/constants/hashes.js.map +0 -1
  217. package/lib.commonjs/constants/index.d.ts +0 -10
  218. package/lib.commonjs/constants/index.d.ts.map +0 -1
  219. package/lib.commonjs/constants/index.js +0 -22
  220. package/lib.commonjs/constants/index.js.map +0 -1
  221. package/lib.commonjs/constants/numbers.d.ts +0 -31
  222. package/lib.commonjs/constants/numbers.d.ts.map +0 -1
  223. package/lib.commonjs/constants/numbers.js +0 -34
  224. package/lib.commonjs/constants/numbers.js.map +0 -1
  225. package/lib.commonjs/constants/strings.d.ts +0 -13
  226. package/lib.commonjs/constants/strings.d.ts.map +0 -1
  227. package/lib.commonjs/constants/strings.js +0 -17
  228. package/lib.commonjs/constants/strings.js.map +0 -1
  229. package/lib.commonjs/contract/contract.d.ts +0 -168
  230. package/lib.commonjs/contract/contract.d.ts.map +0 -1
  231. package/lib.commonjs/contract/contract.js +0 -960
  232. package/lib.commonjs/contract/contract.js.map +0 -1
  233. package/lib.commonjs/contract/factory.d.ts +0 -62
  234. package/lib.commonjs/contract/factory.d.ts.map +0 -1
  235. package/lib.commonjs/contract/factory.js +0 -116
  236. package/lib.commonjs/contract/factory.js.map +0 -1
  237. package/lib.commonjs/contract/index.d.ts +0 -13
  238. package/lib.commonjs/contract/index.d.ts.map +0 -1
  239. package/lib.commonjs/contract/index.js +0 -24
  240. package/lib.commonjs/contract/index.js.map +0 -1
  241. package/lib.commonjs/contract/types.d.ts +0 -193
  242. package/lib.commonjs/contract/types.d.ts.map +0 -1
  243. package/lib.commonjs/contract/types.js +0 -6
  244. package/lib.commonjs/contract/types.js.map +0 -1
  245. package/lib.commonjs/contract/wrappers.d.ts +0 -143
  246. package/lib.commonjs/contract/wrappers.d.ts.map +0 -1
  247. package/lib.commonjs/contract/wrappers.js +0 -186
  248. package/lib.commonjs/contract/wrappers.js.map +0 -1
  249. package/lib.commonjs/crypto/crypto-browser.d.ts +0 -15
  250. package/lib.commonjs/crypto/crypto-browser.d.ts.map +0 -1
  251. package/lib.commonjs/crypto/crypto-browser.js +0 -55
  252. package/lib.commonjs/crypto/crypto-browser.js.map +0 -1
  253. package/lib.commonjs/crypto/crypto.d.ts +0 -2
  254. package/lib.commonjs/crypto/crypto.d.ts.map +0 -1
  255. package/lib.commonjs/crypto/crypto.js +0 -9
  256. package/lib.commonjs/crypto/crypto.js.map +0 -1
  257. package/lib.commonjs/crypto/hmac.d.ts +0 -25
  258. package/lib.commonjs/crypto/hmac.d.ts.map +0 -1
  259. package/lib.commonjs/crypto/hmac.js +0 -51
  260. package/lib.commonjs/crypto/hmac.js.map +0 -1
  261. package/lib.commonjs/crypto/index.d.ts +0 -25
  262. package/lib.commonjs/crypto/index.d.ts.map +0 -1
  263. package/lib.commonjs/crypto/index.js +0 -49
  264. package/lib.commonjs/crypto/index.js.map +0 -1
  265. package/lib.commonjs/crypto/keccak.d.ts +0 -35
  266. package/lib.commonjs/crypto/keccak.d.ts.map +0 -1
  267. package/lib.commonjs/crypto/keccak.js +0 -52
  268. package/lib.commonjs/crypto/keccak.js.map +0 -1
  269. package/lib.commonjs/crypto/pbkdf2.d.ts +0 -35
  270. package/lib.commonjs/crypto/pbkdf2.d.ts.map +0 -1
  271. package/lib.commonjs/crypto/pbkdf2.js +0 -53
  272. package/lib.commonjs/crypto/pbkdf2.js.map +0 -1
  273. package/lib.commonjs/crypto/random.d.ts +0 -14
  274. package/lib.commonjs/crypto/random.d.ts.map +0 -1
  275. package/lib.commonjs/crypto/random.js +0 -38
  276. package/lib.commonjs/crypto/random.js.map +0 -1
  277. package/lib.commonjs/crypto/ripemd160.d.ts +0 -25
  278. package/lib.commonjs/crypto/ripemd160.d.ts.map +0 -1
  279. package/lib.commonjs/crypto/ripemd160.js +0 -42
  280. package/lib.commonjs/crypto/ripemd160.js.map +0 -1
  281. package/lib.commonjs/crypto/scrypt.d.ts +0 -82
  282. package/lib.commonjs/crypto/scrypt.d.ts.map +0 -1
  283. package/lib.commonjs/crypto/scrypt.js +0 -104
  284. package/lib.commonjs/crypto/scrypt.js.map +0 -1
  285. package/lib.commonjs/crypto/sha2.d.ts +0 -47
  286. package/lib.commonjs/crypto/sha2.d.ts.map +0 -1
  287. package/lib.commonjs/crypto/sha2.js +0 -76
  288. package/lib.commonjs/crypto/sha2.js.map +0 -1
  289. package/lib.commonjs/crypto/signature.d.ts +0 -72
  290. package/lib.commonjs/crypto/signature.d.ts.map +0 -1
  291. package/lib.commonjs/crypto/signature.js +0 -118
  292. package/lib.commonjs/crypto/signature.js.map +0 -1
  293. package/lib.commonjs/crypto/signing-key.d.ts +0 -63
  294. package/lib.commonjs/crypto/signing-key.d.ts.map +0 -1
  295. package/lib.commonjs/crypto/signing-key.js +0 -105
  296. package/lib.commonjs/crypto/signing-key.js.map +0 -1
  297. package/lib.commonjs/hash/authorization.d.ts +0 -18
  298. package/lib.commonjs/hash/authorization.d.ts.map +0 -1
  299. package/lib.commonjs/hash/authorization.js +0 -30
  300. package/lib.commonjs/hash/authorization.js.map +0 -1
  301. package/lib.commonjs/hash/id.d.ts +0 -13
  302. package/lib.commonjs/hash/id.d.ts.map +0 -1
  303. package/lib.commonjs/hash/id.js +0 -21
  304. package/lib.commonjs/hash/id.js.map +0 -1
  305. package/lib.commonjs/hash/index.d.ts +0 -15
  306. package/lib.commonjs/hash/index.d.ts.map +0 -1
  307. package/lib.commonjs/hash/index.js +0 -30
  308. package/lib.commonjs/hash/index.js.map +0 -1
  309. package/lib.commonjs/hash/message.d.ts +0 -36
  310. package/lib.commonjs/hash/message.d.ts.map +0 -1
  311. package/lib.commonjs/hash/message.js +0 -56
  312. package/lib.commonjs/hash/message.js.map +0 -1
  313. package/lib.commonjs/hash/namehash.d.ts +0 -20
  314. package/lib.commonjs/hash/namehash.d.ts.map +0 -1
  315. package/lib.commonjs/hash/namehash.js +0 -91
  316. package/lib.commonjs/hash/namehash.js.map +0 -1
  317. package/lib.commonjs/hash/solidity.d.ts +0 -31
  318. package/lib.commonjs/hash/solidity.d.ts.map +0 -1
  319. package/lib.commonjs/hash/solidity.js +0 -109
  320. package/lib.commonjs/hash/solidity.js.map +0 -1
  321. package/lib.commonjs/hash/typed-data.d.ts +0 -150
  322. package/lib.commonjs/hash/typed-data.d.ts.map +0 -1
  323. package/lib.commonjs/hash/typed-data.js +0 -524
  324. package/lib.commonjs/hash/typed-data.js.map +0 -1
  325. package/lib.commonjs/index.d.ts +0 -11
  326. package/lib.commonjs/index.d.ts.map +0 -1
  327. package/lib.commonjs/index.js +0 -15
  328. package/lib.commonjs/index.js.map +0 -1
  329. package/lib.commonjs/package.json +0 -12
  330. package/lib.commonjs/providers/abstract-provider.d.ts +0 -451
  331. package/lib.commonjs/providers/abstract-provider.d.ts.map +0 -1
  332. package/lib.commonjs/providers/abstract-provider.js +0 -1409
  333. package/lib.commonjs/providers/abstract-provider.js.map +0 -1
  334. package/lib.commonjs/providers/abstract-signer.d.ts +0 -69
  335. package/lib.commonjs/providers/abstract-signer.d.ts.map +0 -1
  336. package/lib.commonjs/providers/abstract-signer.js +0 -249
  337. package/lib.commonjs/providers/abstract-signer.js.map +0 -1
  338. package/lib.commonjs/providers/community.d.ts +0 -29
  339. package/lib.commonjs/providers/community.d.ts.map +0 -1
  340. package/lib.commonjs/providers/community.js +0 -40
  341. package/lib.commonjs/providers/community.js.map +0 -1
  342. package/lib.commonjs/providers/contracts.d.ts +0 -36
  343. package/lib.commonjs/providers/contracts.d.ts.map +0 -1
  344. package/lib.commonjs/providers/contracts.js +0 -3
  345. package/lib.commonjs/providers/contracts.js.map +0 -1
  346. package/lib.commonjs/providers/default-provider.d.ts +0 -41
  347. package/lib.commonjs/providers/default-provider.d.ts.map +0 -1
  348. package/lib.commonjs/providers/default-provider.js +0 -92
  349. package/lib.commonjs/providers/default-provider.js.map +0 -1
  350. package/lib.commonjs/providers/ens-resolver.d.ts +0 -147
  351. package/lib.commonjs/providers/ens-resolver.d.ts.map +0 -1
  352. package/lib.commonjs/providers/ens-resolver.js +0 -502
  353. package/lib.commonjs/providers/ens-resolver.js.map +0 -1
  354. package/lib.commonjs/providers/format.d.ts +0 -15
  355. package/lib.commonjs/providers/format.d.ts.map +0 -1
  356. package/lib.commonjs/providers/format.js +0 -298
  357. package/lib.commonjs/providers/format.js.map +0 -1
  358. package/lib.commonjs/providers/formatting.d.ts +0 -318
  359. package/lib.commonjs/providers/formatting.d.ts.map +0 -1
  360. package/lib.commonjs/providers/formatting.js +0 -10
  361. package/lib.commonjs/providers/formatting.js.map +0 -1
  362. package/lib.commonjs/providers/index.d.ts +0 -41
  363. package/lib.commonjs/providers/index.d.ts.map +0 -1
  364. package/lib.commonjs/providers/index.js +0 -64
  365. package/lib.commonjs/providers/index.js.map +0 -1
  366. package/lib.commonjs/providers/network.d.ts +0 -99
  367. package/lib.commonjs/providers/network.d.ts.map +0 -1
  368. package/lib.commonjs/providers/network.js +0 -269
  369. package/lib.commonjs/providers/network.js.map +0 -1
  370. package/lib.commonjs/providers/pagination.d.ts +0 -6
  371. package/lib.commonjs/providers/pagination.d.ts.map +0 -1
  372. package/lib.commonjs/providers/pagination.js +0 -3
  373. package/lib.commonjs/providers/pagination.js.map +0 -1
  374. package/lib.commonjs/providers/plugin-fallback.d.ts +0 -13
  375. package/lib.commonjs/providers/plugin-fallback.d.ts.map +0 -1
  376. package/lib.commonjs/providers/plugin-fallback.js +0 -31
  377. package/lib.commonjs/providers/plugin-fallback.js.map +0 -1
  378. package/lib.commonjs/providers/plugins-network.d.ts +0 -170
  379. package/lib.commonjs/providers/plugins-network.d.ts.map +0 -1
  380. package/lib.commonjs/providers/plugins-network.js +0 -216
  381. package/lib.commonjs/providers/plugins-network.js.map +0 -1
  382. package/lib.commonjs/providers/provider-browser.d.ts +0 -108
  383. package/lib.commonjs/providers/provider-browser.d.ts.map +0 -1
  384. package/lib.commonjs/providers/provider-browser.js +0 -204
  385. package/lib.commonjs/providers/provider-browser.js.map +0 -1
  386. package/lib.commonjs/providers/provider-fallback.d.ts +0 -115
  387. package/lib.commonjs/providers/provider-fallback.d.ts.map +0 -1
  388. package/lib.commonjs/providers/provider-fallback.js +0 -624
  389. package/lib.commonjs/providers/provider-fallback.js.map +0 -1
  390. package/lib.commonjs/providers/provider-ipcsocket-browser.d.ts +0 -3
  391. package/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map +0 -1
  392. package/lib.commonjs/providers/provider-ipcsocket-browser.js +0 -6
  393. package/lib.commonjs/providers/provider-ipcsocket-browser.js.map +0 -1
  394. package/lib.commonjs/providers/provider-ipcsocket.d.ts +0 -21
  395. package/lib.commonjs/providers/provider-ipcsocket.d.ts.map +0 -1
  396. package/lib.commonjs/providers/provider-ipcsocket.js +0 -72
  397. package/lib.commonjs/providers/provider-ipcsocket.js.map +0 -1
  398. package/lib.commonjs/providers/provider-jsonrpc.d.ts +0 -360
  399. package/lib.commonjs/providers/provider-jsonrpc.d.ts.map +0 -1
  400. package/lib.commonjs/providers/provider-jsonrpc.js +0 -979
  401. package/lib.commonjs/providers/provider-jsonrpc.js.map +0 -1
  402. package/lib.commonjs/providers/provider-socket.d.ts +0 -113
  403. package/lib.commonjs/providers/provider-socket.d.ts.map +0 -1
  404. package/lib.commonjs/providers/provider-socket.js +0 -309
  405. package/lib.commonjs/providers/provider-socket.js.map +0 -1
  406. package/lib.commonjs/providers/provider-websocket.d.ts +0 -37
  407. package/lib.commonjs/providers/provider-websocket.d.ts.map +0 -1
  408. package/lib.commonjs/providers/provider-websocket.js +0 -80
  409. package/lib.commonjs/providers/provider-websocket.js.map +0 -1
  410. package/lib.commonjs/providers/provider.d.ts +0 -1223
  411. package/lib.commonjs/providers/provider.d.ts.map +0 -1
  412. package/lib.commonjs/providers/provider.js +0 -1321
  413. package/lib.commonjs/providers/provider.js.map +0 -1
  414. package/lib.commonjs/providers/signer-noncemanager.d.ts +0 -38
  415. package/lib.commonjs/providers/signer-noncemanager.d.ts.map +0 -1
  416. package/lib.commonjs/providers/signer-noncemanager.js +0 -78
  417. package/lib.commonjs/providers/signer-noncemanager.js.map +0 -1
  418. package/lib.commonjs/providers/signer.d.ts +0 -131
  419. package/lib.commonjs/providers/signer.d.ts.map +0 -1
  420. package/lib.commonjs/providers/signer.js +0 -3
  421. package/lib.commonjs/providers/signer.js.map +0 -1
  422. package/lib.commonjs/providers/subscriber-connection.d.ts +0 -25
  423. package/lib.commonjs/providers/subscriber-connection.d.ts.map +0 -1
  424. package/lib.commonjs/providers/subscriber-connection.js +0 -56
  425. package/lib.commonjs/providers/subscriber-connection.js.map +0 -1
  426. package/lib.commonjs/providers/subscriber-filterid.d.ts +0 -64
  427. package/lib.commonjs/providers/subscriber-filterid.d.ts.map +0 -1
  428. package/lib.commonjs/providers/subscriber-filterid.js +0 -180
  429. package/lib.commonjs/providers/subscriber-filterid.js.map +0 -1
  430. package/lib.commonjs/providers/subscriber-polling.d.ts +0 -100
  431. package/lib.commonjs/providers/subscriber-polling.d.ts.map +0 -1
  432. package/lib.commonjs/providers/subscriber-polling.js +0 -303
  433. package/lib.commonjs/providers/subscriber-polling.js.map +0 -1
  434. package/lib.commonjs/providers/ws-browser.d.ts +0 -3
  435. package/lib.commonjs/providers/ws-browser.d.ts.map +0 -1
  436. package/lib.commonjs/providers/ws-browser.js +0 -19
  437. package/lib.commonjs/providers/ws-browser.js.map +0 -1
  438. package/lib.commonjs/providers/ws.d.ts +0 -2
  439. package/lib.commonjs/providers/ws.d.ts.map +0 -1
  440. package/lib.commonjs/providers/ws.js +0 -6
  441. package/lib.commonjs/providers/ws.js.map +0 -1
  442. package/lib.commonjs/quantumcoin.d.ts +0 -24
  443. package/lib.commonjs/quantumcoin.d.ts.map +0 -1
  444. package/lib.commonjs/quantumcoin.js +0 -199
  445. package/lib.commonjs/quantumcoin.js.map +0 -1
  446. package/lib.commonjs/transaction/accesslist.d.ts +0 -6
  447. package/lib.commonjs/transaction/accesslist.d.ts.map +0 -1
  448. package/lib.commonjs/transaction/accesslist.js +0 -41
  449. package/lib.commonjs/transaction/accesslist.js.map +0 -1
  450. package/lib.commonjs/transaction/address.d.ts +0 -15
  451. package/lib.commonjs/transaction/address.d.ts.map +0 -1
  452. package/lib.commonjs/transaction/address.js +0 -39
  453. package/lib.commonjs/transaction/address.js.map +0 -1
  454. package/lib.commonjs/transaction/authorization.d.ts +0 -3
  455. package/lib.commonjs/transaction/authorization.d.ts.map +0 -1
  456. package/lib.commonjs/transaction/authorization.js +0 -16
  457. package/lib.commonjs/transaction/authorization.js.map +0 -1
  458. package/lib.commonjs/transaction/index.d.ts +0 -40
  459. package/lib.commonjs/transaction/index.d.ts.map +0 -1
  460. package/lib.commonjs/transaction/index.js +0 -19
  461. package/lib.commonjs/transaction/index.js.map +0 -1
  462. package/lib.commonjs/transaction/transaction.d.ts +0 -400
  463. package/lib.commonjs/transaction/transaction.d.ts.map +0 -1
  464. package/lib.commonjs/transaction/transaction.js +0 -1115
  465. package/lib.commonjs/transaction/transaction.js.map +0 -1
  466. package/lib.commonjs/utils/base58.d.ts +0 -23
  467. package/lib.commonjs/utils/base58.d.ts.map +0 -1
  468. package/lib.commonjs/utils/base58.js +0 -68
  469. package/lib.commonjs/utils/base58.js.map +0 -1
  470. package/lib.commonjs/utils/base64-browser.d.ts +0 -4
  471. package/lib.commonjs/utils/base64-browser.d.ts.map +0 -1
  472. package/lib.commonjs/utils/base64-browser.js +0 -24
  473. package/lib.commonjs/utils/base64-browser.js.map +0 -1
  474. package/lib.commonjs/utils/base64.d.ts +0 -40
  475. package/lib.commonjs/utils/base64.d.ts.map +0 -1
  476. package/lib.commonjs/utils/base64.js +0 -58
  477. package/lib.commonjs/utils/base64.js.map +0 -1
  478. package/lib.commonjs/utils/data.d.ts +0 -93
  479. package/lib.commonjs/utils/data.d.ts.map +0 -1
  480. package/lib.commonjs/utils/data.js +0 -184
  481. package/lib.commonjs/utils/data.js.map +0 -1
  482. package/lib.commonjs/utils/errors.d.ts +0 -512
  483. package/lib.commonjs/utils/errors.d.ts.map +0 -1
  484. package/lib.commonjs/utils/errors.js +0 -235
  485. package/lib.commonjs/utils/errors.js.map +0 -1
  486. package/lib.commonjs/utils/events.d.ts +0 -77
  487. package/lib.commonjs/utils/events.d.ts.map +0 -1
  488. package/lib.commonjs/utils/events.js +0 -46
  489. package/lib.commonjs/utils/events.js.map +0 -1
  490. package/lib.commonjs/utils/fetch.d.ts +0 -363
  491. package/lib.commonjs/utils/fetch.d.ts.map +0 -1
  492. package/lib.commonjs/utils/fetch.js +0 -858
  493. package/lib.commonjs/utils/fetch.js.map +0 -1
  494. package/lib.commonjs/utils/fixednumber.d.ts +0 -252
  495. package/lib.commonjs/utils/fixednumber.d.ts.map +0 -1
  496. package/lib.commonjs/utils/fixednumber.js +0 -530
  497. package/lib.commonjs/utils/fixednumber.js.map +0 -1
  498. package/lib.commonjs/utils/geturl-browser.d.ts +0 -4
  499. package/lib.commonjs/utils/geturl-browser.d.ts.map +0 -1
  500. package/lib.commonjs/utils/geturl-browser.js +0 -67
  501. package/lib.commonjs/utils/geturl-browser.js.map +0 -1
  502. package/lib.commonjs/utils/geturl.d.ts +0 -10
  503. package/lib.commonjs/utils/geturl.d.ts.map +0 -1
  504. package/lib.commonjs/utils/geturl.js +0 -120
  505. package/lib.commonjs/utils/geturl.js.map +0 -1
  506. package/lib.commonjs/utils/index.d.ts +0 -30
  507. package/lib.commonjs/utils/index.d.ts.map +0 -1
  508. package/lib.commonjs/utils/index.js +0 -78
  509. package/lib.commonjs/utils/index.js.map +0 -1
  510. package/lib.commonjs/utils/maths.d.ts +0 -66
  511. package/lib.commonjs/utils/maths.d.ts.map +0 -1
  512. package/lib.commonjs/utils/maths.js +0 -229
  513. package/lib.commonjs/utils/maths.js.map +0 -1
  514. package/lib.commonjs/utils/properties.d.ts +0 -23
  515. package/lib.commonjs/utils/properties.d.ts.map +0 -1
  516. package/lib.commonjs/utils/properties.js +0 -59
  517. package/lib.commonjs/utils/properties.js.map +0 -1
  518. package/lib.commonjs/utils/rlp-decode.d.ts +0 -6
  519. package/lib.commonjs/utils/rlp-decode.d.ts.map +0 -1
  520. package/lib.commonjs/utils/rlp-decode.js +0 -83
  521. package/lib.commonjs/utils/rlp-decode.js.map +0 -1
  522. package/lib.commonjs/utils/rlp-encode.d.ts +0 -6
  523. package/lib.commonjs/utils/rlp-encode.d.ts.map +0 -1
  524. package/lib.commonjs/utils/rlp-encode.js +0 -53
  525. package/lib.commonjs/utils/rlp-encode.js.map +0 -1
  526. package/lib.commonjs/utils/rlp.d.ts +0 -17
  527. package/lib.commonjs/utils/rlp.d.ts.map +0 -1
  528. package/lib.commonjs/utils/rlp.js +0 -14
  529. package/lib.commonjs/utils/rlp.js.map +0 -1
  530. package/lib.commonjs/utils/units.d.ts +0 -24
  531. package/lib.commonjs/utils/units.d.ts.map +0 -1
  532. package/lib.commonjs/utils/units.js +0 -90
  533. package/lib.commonjs/utils/units.js.map +0 -1
  534. package/lib.commonjs/utils/utf8.d.ts +0 -96
  535. package/lib.commonjs/utils/utf8.d.ts.map +0 -1
  536. package/lib.commonjs/utils/utf8.js +0 -227
  537. package/lib.commonjs/utils/utf8.js.map +0 -1
  538. package/lib.commonjs/utils/uuid.d.ts +0 -8
  539. package/lib.commonjs/utils/uuid.d.ts.map +0 -1
  540. package/lib.commonjs/utils/uuid.js +0 -34
  541. package/lib.commonjs/utils/uuid.js.map +0 -1
  542. package/lib.commonjs/wallet/base-wallet.d.ts +0 -57
  543. package/lib.commonjs/wallet/base-wallet.d.ts.map +0 -1
  544. package/lib.commonjs/wallet/base-wallet.js +0 -127
  545. package/lib.commonjs/wallet/base-wallet.js.map +0 -1
  546. package/lib.commonjs/wallet/index.d.ts +0 -23
  547. package/lib.commonjs/wallet/index.d.ts.map +0 -1
  548. package/lib.commonjs/wallet/index.js +0 -30
  549. package/lib.commonjs/wallet/index.js.map +0 -1
  550. package/lib.commonjs/wallet/json-keystore.d.ts +0 -40
  551. package/lib.commonjs/wallet/json-keystore.d.ts.map +0 -1
  552. package/lib.commonjs/wallet/json-keystore.js +0 -90
  553. package/lib.commonjs/wallet/json-keystore.js.map +0 -1
  554. package/lib.commonjs/wallet/utils.d.ts +0 -8
  555. package/lib.commonjs/wallet/utils.d.ts.map +0 -1
  556. package/lib.commonjs/wallet/utils.js +0 -149
  557. package/lib.commonjs/wallet/utils.js.map +0 -1
  558. package/lib.commonjs/wallet/wallet.d.ts +0 -62
  559. package/lib.commonjs/wallet/wallet.d.ts.map +0 -1
  560. package/lib.commonjs/wallet/wallet.js +0 -109
  561. package/lib.commonjs/wallet/wallet.js.map +0 -1
  562. package/lib.commonjs/wordlists/bit-reader.d.ts +0 -5
  563. package/lib.commonjs/wordlists/bit-reader.d.ts.map +0 -1
  564. package/lib.commonjs/wordlists/bit-reader.js +0 -36
  565. package/lib.commonjs/wordlists/bit-reader.js.map +0 -1
  566. package/lib.commonjs/wordlists/decode-owl.d.ts +0 -9
  567. package/lib.commonjs/wordlists/decode-owl.d.ts.map +0 -1
  568. package/lib.commonjs/wordlists/decode-owl.js +0 -60
  569. package/lib.commonjs/wordlists/decode-owl.js.map +0 -1
  570. package/lib.commonjs/wordlists/decode-owla.d.ts +0 -5
  571. package/lib.commonjs/wordlists/decode-owla.d.ts.map +0 -1
  572. package/lib.commonjs/wordlists/decode-owla.js +0 -32
  573. package/lib.commonjs/wordlists/decode-owla.js.map +0 -1
  574. package/lib.commonjs/wordlists/generation/encode-latin.d.ts +0 -25
  575. package/lib.commonjs/wordlists/generation/encode-latin.d.ts.map +0 -1
  576. package/lib.commonjs/wordlists/generation/encode-latin.js +0 -351
  577. package/lib.commonjs/wordlists/generation/encode-latin.js.map +0 -1
  578. package/lib.commonjs/wordlists/index.d.ts +0 -25
  579. package/lib.commonjs/wordlists/index.d.ts.map +0 -1
  580. package/lib.commonjs/wordlists/index.js +0 -33
  581. package/lib.commonjs/wordlists/index.js.map +0 -1
  582. package/lib.commonjs/wordlists/lang-cz.d.ts +0 -23
  583. package/lib.commonjs/wordlists/lang-cz.d.ts.map +0 -1
  584. package/lib.commonjs/wordlists/lang-cz.js +0 -35
  585. package/lib.commonjs/wordlists/lang-cz.js.map +0 -1
  586. package/lib.commonjs/wordlists/lang-en.d.ts +0 -23
  587. package/lib.commonjs/wordlists/lang-en.d.ts.map +0 -1
  588. package/lib.commonjs/wordlists/lang-en.js +0 -35
  589. package/lib.commonjs/wordlists/lang-en.js.map +0 -1
  590. package/lib.commonjs/wordlists/lang-es.d.ts +0 -23
  591. package/lib.commonjs/wordlists/lang-es.d.ts.map +0 -1
  592. package/lib.commonjs/wordlists/lang-es.js +0 -36
  593. package/lib.commonjs/wordlists/lang-es.js.map +0 -1
  594. package/lib.commonjs/wordlists/lang-fr.d.ts +0 -23
  595. package/lib.commonjs/wordlists/lang-fr.d.ts.map +0 -1
  596. package/lib.commonjs/wordlists/lang-fr.js +0 -36
  597. package/lib.commonjs/wordlists/lang-fr.js.map +0 -1
  598. package/lib.commonjs/wordlists/lang-it.d.ts +0 -23
  599. package/lib.commonjs/wordlists/lang-it.d.ts.map +0 -1
  600. package/lib.commonjs/wordlists/lang-it.js +0 -35
  601. package/lib.commonjs/wordlists/lang-it.js.map +0 -1
  602. package/lib.commonjs/wordlists/lang-ja.d.ts +0 -27
  603. package/lib.commonjs/wordlists/lang-ja.d.ts.map +0 -1
  604. package/lib.commonjs/wordlists/lang-ja.js +0 -158
  605. package/lib.commonjs/wordlists/lang-ja.js.map +0 -1
  606. package/lib.commonjs/wordlists/lang-ko.d.ts +0 -25
  607. package/lib.commonjs/wordlists/lang-ko.d.ts.map +0 -1
  608. package/lib.commonjs/wordlists/lang-ko.js +0 -93
  609. package/lib.commonjs/wordlists/lang-ko.js.map +0 -1
  610. package/lib.commonjs/wordlists/lang-pt.d.ts +0 -23
  611. package/lib.commonjs/wordlists/lang-pt.d.ts.map +0 -1
  612. package/lib.commonjs/wordlists/lang-pt.js +0 -35
  613. package/lib.commonjs/wordlists/lang-pt.js.map +0 -1
  614. package/lib.commonjs/wordlists/lang-zh.d.ts +0 -32
  615. package/lib.commonjs/wordlists/lang-zh.d.ts.map +0 -1
  616. package/lib.commonjs/wordlists/lang-zh.js +0 -96
  617. package/lib.commonjs/wordlists/lang-zh.js.map +0 -1
  618. package/lib.commonjs/wordlists/wordlist-owl.d.ts +0 -32
  619. package/lib.commonjs/wordlists/wordlist-owl.d.ts.map +0 -1
  620. package/lib.commonjs/wordlists/wordlist-owl.js +0 -70
  621. package/lib.commonjs/wordlists/wordlist-owl.js.map +0 -1
  622. package/lib.commonjs/wordlists/wordlist-owla.d.ts +0 -30
  623. package/lib.commonjs/wordlists/wordlist-owla.d.ts.map +0 -1
  624. package/lib.commonjs/wordlists/wordlist-owla.js +0 -40
  625. package/lib.commonjs/wordlists/wordlist-owla.js.map +0 -1
  626. package/lib.commonjs/wordlists/wordlist.d.ts +0 -47
  627. package/lib.commonjs/wordlists/wordlist.d.ts.map +0 -1
  628. package/lib.commonjs/wordlists/wordlist.js +0 -46
  629. package/lib.commonjs/wordlists/wordlist.js.map +0 -1
  630. package/lib.commonjs/wordlists/wordlists-browser.d.ts +0 -3
  631. package/lib.commonjs/wordlists/wordlists-browser.d.ts.map +0 -1
  632. package/lib.commonjs/wordlists/wordlists-browser.js +0 -8
  633. package/lib.commonjs/wordlists/wordlists-browser.js.map +0 -1
  634. package/lib.commonjs/wordlists/wordlists-extra.d.ts +0 -9
  635. package/lib.commonjs/wordlists/wordlists-extra.d.ts.map +0 -1
  636. package/lib.commonjs/wordlists/wordlists-extra.js +0 -20
  637. package/lib.commonjs/wordlists/wordlists-extra.js.map +0 -1
  638. package/lib.commonjs/wordlists/wordlists.d.ts +0 -16
  639. package/lib.commonjs/wordlists/wordlists.d.ts.map +0 -1
  640. package/lib.commonjs/wordlists/wordlists.js +0 -38
  641. package/lib.commonjs/wordlists/wordlists.js.map +0 -1
  642. package/lib.esm/README.md +0 -16
  643. package/lib.esm/_version.d.ts +0 -5
  644. package/lib.esm/_version.d.ts.map +0 -1
  645. package/lib.esm/_version.js +0 -6
  646. package/lib.esm/_version.js.map +0 -1
  647. package/lib.esm/abi/abi-coder.d.ts +0 -61
  648. package/lib.esm/abi/abi-coder.d.ts.map +0 -1
  649. package/lib.esm/abi/abi-coder.js +0 -206
  650. package/lib.esm/abi/abi-coder.js.map +0 -1
  651. package/lib.esm/abi/bytes32.d.ts +0 -15
  652. package/lib.esm/abi/bytes32.d.ts.map +0 -1
  653. package/lib.esm/abi/bytes32.js +0 -40
  654. package/lib.esm/abi/bytes32.js.map +0 -1
  655. package/lib.esm/abi/coders/abstract-coder.d.ts +0 -124
  656. package/lib.esm/abi/coders/abstract-coder.d.ts.map +0 -1
  657. package/lib.esm/abi/coders/abstract-coder.js +0 -466
  658. package/lib.esm/abi/coders/abstract-coder.js.map +0 -1
  659. package/lib.esm/abi/coders/address.d.ts +0 -13
  660. package/lib.esm/abi/coders/address.d.ts.map +0 -1
  661. package/lib.esm/abi/coders/address.js +0 -29
  662. package/lib.esm/abi/coders/address.js.map +0 -1
  663. package/lib.esm/abi/coders/anonymous.d.ts +0 -15
  664. package/lib.esm/abi/coders/anonymous.d.ts.map +0 -1
  665. package/lib.esm/abi/coders/anonymous.js +0 -23
  666. package/lib.esm/abi/coders/anonymous.js.map +0 -1
  667. package/lib.esm/abi/coders/array.d.ts +0 -25
  668. package/lib.esm/abi/coders/array.d.ts.map +0 -1
  669. package/lib.esm/abi/coders/array.js +0 -159
  670. package/lib.esm/abi/coders/array.js.map +0 -1
  671. package/lib.esm/abi/coders/boolean.d.ts +0 -13
  672. package/lib.esm/abi/coders/boolean.d.ts.map +0 -1
  673. package/lib.esm/abi/coders/boolean.js +0 -21
  674. package/lib.esm/abi/coders/boolean.js.map +0 -1
  675. package/lib.esm/abi/coders/bytes.d.ts +0 -19
  676. package/lib.esm/abi/coders/bytes.d.ts.map +0 -1
  677. package/lib.esm/abi/coders/bytes.js +0 -34
  678. package/lib.esm/abi/coders/bytes.js.map +0 -1
  679. package/lib.esm/abi/coders/fixed-bytes.d.ts +0 -15
  680. package/lib.esm/abi/coders/fixed-bytes.d.ts.map +0 -1
  681. package/lib.esm/abi/coders/fixed-bytes.js +0 -28
  682. package/lib.esm/abi/coders/fixed-bytes.js.map +0 -1
  683. package/lib.esm/abi/coders/null.d.ts +0 -12
  684. package/lib.esm/abi/coders/null.d.ts.map +0 -1
  685. package/lib.esm/abi/coders/null.js +0 -24
  686. package/lib.esm/abi/coders/null.js.map +0 -1
  687. package/lib.esm/abi/coders/number.d.ts +0 -16
  688. package/lib.esm/abi/coders/number.d.ts.map +0 -1
  689. package/lib.esm/abi/coders/number.js +0 -45
  690. package/lib.esm/abi/coders/number.js.map +0 -1
  691. package/lib.esm/abi/coders/string.d.ts +0 -13
  692. package/lib.esm/abi/coders/string.d.ts.map +0 -1
  693. package/lib.esm/abi/coders/string.js +0 -21
  694. package/lib.esm/abi/coders/string.js.map +0 -1
  695. package/lib.esm/abi/coders/tuple.d.ts +0 -16
  696. package/lib.esm/abi/coders/tuple.d.ts.map +0 -1
  697. package/lib.esm/abi/coders/tuple.js +0 -63
  698. package/lib.esm/abi/coders/tuple.js.map +0 -1
  699. package/lib.esm/abi/fragments.d.ts +0 -466
  700. package/lib.esm/abi/fragments.d.ts.map +0 -1
  701. package/lib.esm/abi/fragments.js +0 -1319
  702. package/lib.esm/abi/fragments.js.map +0 -1
  703. package/lib.esm/abi/index.d.ts +0 -18
  704. package/lib.esm/abi/index.d.ts.map +0 -1
  705. package/lib.esm/abi/index.js +0 -17
  706. package/lib.esm/abi/index.js.map +0 -1
  707. package/lib.esm/abi/interface.d.ts +0 -382
  708. package/lib.esm/abi/interface.d.ts.map +0 -1
  709. package/lib.esm/abi/interface.js +0 -1101
  710. package/lib.esm/abi/interface.js.map +0 -1
  711. package/lib.esm/abi/typed.d.ts +0 -570
  712. package/lib.esm/abi/typed.d.ts.map +0 -1
  713. package/lib.esm/abi/typed.js +0 -602
  714. package/lib.esm/abi/typed.js.map +0 -1
  715. package/lib.esm/address/address.d.ts +0 -36
  716. package/lib.esm/address/address.d.ts.map +0 -1
  717. package/lib.esm/address/address.js +0 -129
  718. package/lib.esm/address/address.js.map +0 -1
  719. package/lib.esm/address/checks.d.ts +0 -81
  720. package/lib.esm/address/checks.d.ts.map +0 -1
  721. package/lib.esm/address/checks.js +0 -114
  722. package/lib.esm/address/checks.js.map +0 -1
  723. package/lib.esm/address/contract-address.d.ts +0 -48
  724. package/lib.esm/address/contract-address.d.ts.map +0 -1
  725. package/lib.esm/address/contract-address.js +0 -69
  726. package/lib.esm/address/contract-address.js.map +0 -1
  727. package/lib.esm/address/index.d.ts +0 -49
  728. package/lib.esm/address/index.d.ts.map +0 -1
  729. package/lib.esm/address/index.js +0 -19
  730. package/lib.esm/address/index.js.map +0 -1
  731. package/lib.esm/constants/addresses.d.ts +0 -7
  732. package/lib.esm/constants/addresses.d.ts.map +0 -1
  733. package/lib.esm/constants/addresses.js +0 -7
  734. package/lib.esm/constants/addresses.js.map +0 -1
  735. package/lib.esm/constants/hashes.d.ts +0 -7
  736. package/lib.esm/constants/hashes.d.ts.map +0 -1
  737. package/lib.esm/constants/hashes.js +0 -7
  738. package/lib.esm/constants/hashes.js.map +0 -1
  739. package/lib.esm/constants/index.d.ts +0 -10
  740. package/lib.esm/constants/index.d.ts.map +0 -1
  741. package/lib.esm/constants/index.js +0 -10
  742. package/lib.esm/constants/index.js.map +0 -1
  743. package/lib.esm/constants/numbers.d.ts +0 -31
  744. package/lib.esm/constants/numbers.d.ts.map +0 -1
  745. package/lib.esm/constants/numbers.js +0 -31
  746. package/lib.esm/constants/numbers.js.map +0 -1
  747. package/lib.esm/constants/strings.d.ts +0 -13
  748. package/lib.esm/constants/strings.d.ts.map +0 -1
  749. package/lib.esm/constants/strings.js +0 -14
  750. package/lib.esm/constants/strings.js.map +0 -1
  751. package/lib.esm/contract/contract.d.ts +0 -168
  752. package/lib.esm/contract/contract.d.ts.map +0 -1
  753. package/lib.esm/contract/contract.js +0 -953
  754. package/lib.esm/contract/contract.js.map +0 -1
  755. package/lib.esm/contract/factory.d.ts +0 -62
  756. package/lib.esm/contract/factory.d.ts.map +0 -1
  757. package/lib.esm/contract/factory.js +0 -112
  758. package/lib.esm/contract/factory.js.map +0 -1
  759. package/lib.esm/contract/index.d.ts +0 -13
  760. package/lib.esm/contract/index.d.ts.map +0 -1
  761. package/lib.esm/contract/index.js +0 -12
  762. package/lib.esm/contract/index.js.map +0 -1
  763. package/lib.esm/contract/types.d.ts +0 -193
  764. package/lib.esm/contract/types.d.ts.map +0 -1
  765. package/lib.esm/contract/types.js +0 -5
  766. package/lib.esm/contract/types.js.map +0 -1
  767. package/lib.esm/contract/wrappers.d.ts +0 -143
  768. package/lib.esm/contract/wrappers.d.ts.map +0 -1
  769. package/lib.esm/contract/wrappers.js +0 -177
  770. package/lib.esm/contract/wrappers.js.map +0 -1
  771. package/lib.esm/crypto/crypto-browser.d.ts +0 -15
  772. package/lib.esm/crypto/crypto-browser.d.ts.map +0 -1
  773. package/lib.esm/crypto/crypto-browser.js +0 -48
  774. package/lib.esm/crypto/crypto-browser.js.map +0 -1
  775. package/lib.esm/crypto/crypto.d.ts +0 -2
  776. package/lib.esm/crypto/crypto.d.ts.map +0 -1
  777. package/lib.esm/crypto/crypto.js +0 -2
  778. package/lib.esm/crypto/crypto.js.map +0 -1
  779. package/lib.esm/crypto/hmac.d.ts +0 -25
  780. package/lib.esm/crypto/hmac.d.ts.map +0 -1
  781. package/lib.esm/crypto/hmac.js +0 -47
  782. package/lib.esm/crypto/hmac.js.map +0 -1
  783. package/lib.esm/crypto/index.d.ts +0 -25
  784. package/lib.esm/crypto/index.d.ts.map +0 -1
  785. package/lib.esm/crypto/index.js +0 -36
  786. package/lib.esm/crypto/index.js.map +0 -1
  787. package/lib.esm/crypto/keccak.d.ts +0 -35
  788. package/lib.esm/crypto/keccak.d.ts.map +0 -1
  789. package/lib.esm/crypto/keccak.js +0 -48
  790. package/lib.esm/crypto/keccak.js.map +0 -1
  791. package/lib.esm/crypto/pbkdf2.d.ts +0 -35
  792. package/lib.esm/crypto/pbkdf2.d.ts.map +0 -1
  793. package/lib.esm/crypto/pbkdf2.js +0 -49
  794. package/lib.esm/crypto/pbkdf2.js.map +0 -1
  795. package/lib.esm/crypto/random.d.ts +0 -14
  796. package/lib.esm/crypto/random.d.ts.map +0 -1
  797. package/lib.esm/crypto/random.js +0 -34
  798. package/lib.esm/crypto/random.js.map +0 -1
  799. package/lib.esm/crypto/ripemd160.d.ts +0 -25
  800. package/lib.esm/crypto/ripemd160.d.ts.map +0 -1
  801. package/lib.esm/crypto/ripemd160.js +0 -38
  802. package/lib.esm/crypto/ripemd160.js.map +0 -1
  803. package/lib.esm/crypto/scrypt.d.ts +0 -82
  804. package/lib.esm/crypto/scrypt.d.ts.map +0 -1
  805. package/lib.esm/crypto/scrypt.js +0 -99
  806. package/lib.esm/crypto/scrypt.js.map +0 -1
  807. package/lib.esm/crypto/sha2.d.ts +0 -47
  808. package/lib.esm/crypto/sha2.d.ts.map +0 -1
  809. package/lib.esm/crypto/sha2.js +0 -71
  810. package/lib.esm/crypto/sha2.js.map +0 -1
  811. package/lib.esm/crypto/signature.d.ts +0 -72
  812. package/lib.esm/crypto/signature.d.ts.map +0 -1
  813. package/lib.esm/crypto/signature.js +0 -114
  814. package/lib.esm/crypto/signature.js.map +0 -1
  815. package/lib.esm/crypto/signing-key.d.ts +0 -63
  816. package/lib.esm/crypto/signing-key.d.ts.map +0 -1
  817. package/lib.esm/crypto/signing-key.js +0 -101
  818. package/lib.esm/crypto/signing-key.js.map +0 -1
  819. package/lib.esm/hash/authorization.d.ts +0 -18
  820. package/lib.esm/hash/authorization.d.ts.map +0 -1
  821. package/lib.esm/hash/authorization.js +0 -25
  822. package/lib.esm/hash/authorization.js.map +0 -1
  823. package/lib.esm/hash/id.d.ts +0 -13
  824. package/lib.esm/hash/id.d.ts.map +0 -1
  825. package/lib.esm/hash/id.js +0 -17
  826. package/lib.esm/hash/id.js.map +0 -1
  827. package/lib.esm/hash/index.d.ts +0 -15
  828. package/lib.esm/hash/index.d.ts.map +0 -1
  829. package/lib.esm/hash/index.js +0 -13
  830. package/lib.esm/hash/index.js.map +0 -1
  831. package/lib.esm/hash/message.d.ts +0 -36
  832. package/lib.esm/hash/message.d.ts.map +0 -1
  833. package/lib.esm/hash/message.js +0 -51
  834. package/lib.esm/hash/message.js.map +0 -1
  835. package/lib.esm/hash/namehash.d.ts +0 -20
  836. package/lib.esm/hash/namehash.d.ts.map +0 -1
  837. package/lib.esm/hash/namehash.js +0 -84
  838. package/lib.esm/hash/namehash.js.map +0 -1
  839. package/lib.esm/hash/solidity.d.ts +0 -31
  840. package/lib.esm/hash/solidity.d.ts.map +0 -1
  841. package/lib.esm/hash/solidity.js +0 -103
  842. package/lib.esm/hash/solidity.js.map +0 -1
  843. package/lib.esm/hash/typed-data.d.ts +0 -150
  844. package/lib.esm/hash/typed-data.d.ts.map +0 -1
  845. package/lib.esm/hash/typed-data.js +0 -519
  846. package/lib.esm/hash/typed-data.js.map +0 -1
  847. package/lib.esm/index.d.ts +0 -11
  848. package/lib.esm/index.d.ts.map +0 -1
  849. package/lib.esm/index.js +0 -11
  850. package/lib.esm/index.js.map +0 -1
  851. package/lib.esm/package.json +0 -12
  852. package/lib.esm/providers/abstract-provider.d.ts +0 -451
  853. package/lib.esm/providers/abstract-provider.d.ts.map +0 -1
  854. package/lib.esm/providers/abstract-provider.js +0 -1404
  855. package/lib.esm/providers/abstract-provider.js.map +0 -1
  856. package/lib.esm/providers/abstract-signer.d.ts +0 -69
  857. package/lib.esm/providers/abstract-signer.d.ts.map +0 -1
  858. package/lib.esm/providers/abstract-signer.js +0 -244
  859. package/lib.esm/providers/abstract-signer.js.map +0 -1
  860. package/lib.esm/providers/community.d.ts +0 -29
  861. package/lib.esm/providers/community.d.ts.map +0 -1
  862. package/lib.esm/providers/community.js +0 -36
  863. package/lib.esm/providers/community.js.map +0 -1
  864. package/lib.esm/providers/contracts.d.ts +0 -36
  865. package/lib.esm/providers/contracts.d.ts.map +0 -1
  866. package/lib.esm/providers/contracts.js +0 -2
  867. package/lib.esm/providers/contracts.js.map +0 -1
  868. package/lib.esm/providers/default-provider.d.ts +0 -41
  869. package/lib.esm/providers/default-provider.d.ts.map +0 -1
  870. package/lib.esm/providers/default-provider.js +0 -88
  871. package/lib.esm/providers/default-provider.js.map +0 -1
  872. package/lib.esm/providers/ens-resolver.d.ts +0 -147
  873. package/lib.esm/providers/ens-resolver.d.ts.map +0 -1
  874. package/lib.esm/providers/ens-resolver.js +0 -496
  875. package/lib.esm/providers/ens-resolver.js.map +0 -1
  876. package/lib.esm/providers/format.d.ts +0 -15
  877. package/lib.esm/providers/format.d.ts.map +0 -1
  878. package/lib.esm/providers/format.js +0 -283
  879. package/lib.esm/providers/format.js.map +0 -1
  880. package/lib.esm/providers/formatting.d.ts +0 -318
  881. package/lib.esm/providers/formatting.d.ts.map +0 -1
  882. package/lib.esm/providers/formatting.js +0 -9
  883. package/lib.esm/providers/formatting.js.map +0 -1
  884. package/lib.esm/providers/index.d.ts +0 -41
  885. package/lib.esm/providers/index.d.ts.map +0 -1
  886. package/lib.esm/providers/index.js +0 -31
  887. package/lib.esm/providers/index.js.map +0 -1
  888. package/lib.esm/providers/network.d.ts +0 -99
  889. package/lib.esm/providers/network.d.ts.map +0 -1
  890. package/lib.esm/providers/network.js +0 -265
  891. package/lib.esm/providers/network.js.map +0 -1
  892. package/lib.esm/providers/pagination.d.ts +0 -6
  893. package/lib.esm/providers/pagination.d.ts.map +0 -1
  894. package/lib.esm/providers/pagination.js +0 -2
  895. package/lib.esm/providers/pagination.js.map +0 -1
  896. package/lib.esm/providers/plugin-fallback.d.ts +0 -13
  897. package/lib.esm/providers/plugin-fallback.d.ts.map +0 -1
  898. package/lib.esm/providers/plugin-fallback.js +0 -26
  899. package/lib.esm/providers/plugin-fallback.js.map +0 -1
  900. package/lib.esm/providers/plugins-network.d.ts +0 -170
  901. package/lib.esm/providers/plugins-network.d.ts.map +0 -1
  902. package/lib.esm/providers/plugins-network.js +0 -208
  903. package/lib.esm/providers/plugins-network.js.map +0 -1
  904. package/lib.esm/providers/provider-browser.d.ts +0 -108
  905. package/lib.esm/providers/provider-browser.d.ts.map +0 -1
  906. package/lib.esm/providers/provider-browser.js +0 -200
  907. package/lib.esm/providers/provider-browser.js.map +0 -1
  908. package/lib.esm/providers/provider-fallback.d.ts +0 -115
  909. package/lib.esm/providers/provider-fallback.d.ts.map +0 -1
  910. package/lib.esm/providers/provider-fallback.js +0 -620
  911. package/lib.esm/providers/provider-fallback.js.map +0 -1
  912. package/lib.esm/providers/provider-ipcsocket-browser.d.ts +0 -3
  913. package/lib.esm/providers/provider-ipcsocket-browser.d.ts.map +0 -1
  914. package/lib.esm/providers/provider-ipcsocket-browser.js +0 -3
  915. package/lib.esm/providers/provider-ipcsocket-browser.js.map +0 -1
  916. package/lib.esm/providers/provider-ipcsocket.d.ts +0 -21
  917. package/lib.esm/providers/provider-ipcsocket.d.ts.map +0 -1
  918. package/lib.esm/providers/provider-ipcsocket.js +0 -68
  919. package/lib.esm/providers/provider-ipcsocket.js.map +0 -1
  920. package/lib.esm/providers/provider-jsonrpc.d.ts +0 -360
  921. package/lib.esm/providers/provider-jsonrpc.d.ts.map +0 -1
  922. package/lib.esm/providers/provider-jsonrpc.js +0 -972
  923. package/lib.esm/providers/provider-jsonrpc.js.map +0 -1
  924. package/lib.esm/providers/provider-socket.d.ts +0 -113
  925. package/lib.esm/providers/provider-socket.d.ts.map +0 -1
  926. package/lib.esm/providers/provider-socket.js +0 -301
  927. package/lib.esm/providers/provider-socket.js.map +0 -1
  928. package/lib.esm/providers/provider-websocket.d.ts +0 -37
  929. package/lib.esm/providers/provider-websocket.d.ts.map +0 -1
  930. package/lib.esm/providers/provider-websocket.js +0 -76
  931. package/lib.esm/providers/provider-websocket.js.map +0 -1
  932. package/lib.esm/providers/provider.d.ts +0 -1223
  933. package/lib.esm/providers/provider.d.ts.map +0 -1
  934. package/lib.esm/providers/provider.js +0 -1312
  935. package/lib.esm/providers/provider.js.map +0 -1
  936. package/lib.esm/providers/signer-noncemanager.d.ts +0 -38
  937. package/lib.esm/providers/signer-noncemanager.d.ts.map +0 -1
  938. package/lib.esm/providers/signer-noncemanager.js +0 -74
  939. package/lib.esm/providers/signer-noncemanager.js.map +0 -1
  940. package/lib.esm/providers/signer.d.ts +0 -131
  941. package/lib.esm/providers/signer.d.ts.map +0 -1
  942. package/lib.esm/providers/signer.js +0 -2
  943. package/lib.esm/providers/signer.js.map +0 -1
  944. package/lib.esm/providers/subscriber-connection.d.ts +0 -25
  945. package/lib.esm/providers/subscriber-connection.d.ts.map +0 -1
  946. package/lib.esm/providers/subscriber-connection.js +0 -52
  947. package/lib.esm/providers/subscriber-connection.js.map +0 -1
  948. package/lib.esm/providers/subscriber-filterid.d.ts +0 -64
  949. package/lib.esm/providers/subscriber-filterid.d.ts.map +0 -1
  950. package/lib.esm/providers/subscriber-filterid.js +0 -174
  951. package/lib.esm/providers/subscriber-filterid.js.map +0 -1
  952. package/lib.esm/providers/subscriber-polling.d.ts +0 -100
  953. package/lib.esm/providers/subscriber-polling.d.ts.map +0 -1
  954. package/lib.esm/providers/subscriber-polling.js +0 -293
  955. package/lib.esm/providers/subscriber-polling.js.map +0 -1
  956. package/lib.esm/providers/ws-browser.d.ts +0 -3
  957. package/lib.esm/providers/ws-browser.d.ts.map +0 -1
  958. package/lib.esm/providers/ws-browser.js +0 -16
  959. package/lib.esm/providers/ws-browser.js.map +0 -1
  960. package/lib.esm/providers/ws.d.ts +0 -2
  961. package/lib.esm/providers/ws.d.ts.map +0 -1
  962. package/lib.esm/providers/ws.js +0 -2
  963. package/lib.esm/providers/ws.js.map +0 -1
  964. package/lib.esm/quantumcoin.d.ts +0 -24
  965. package/lib.esm/quantumcoin.d.ts.map +0 -1
  966. package/lib.esm/quantumcoin.js +0 -22
  967. package/lib.esm/quantumcoin.js.map +0 -1
  968. package/lib.esm/transaction/accesslist.d.ts +0 -6
  969. package/lib.esm/transaction/accesslist.d.ts.map +0 -1
  970. package/lib.esm/transaction/accesslist.js +0 -37
  971. package/lib.esm/transaction/accesslist.js.map +0 -1
  972. package/lib.esm/transaction/address.d.ts +0 -15
  973. package/lib.esm/transaction/address.d.ts.map +0 -1
  974. package/lib.esm/transaction/address.js +0 -34
  975. package/lib.esm/transaction/address.js.map +0 -1
  976. package/lib.esm/transaction/authorization.d.ts +0 -3
  977. package/lib.esm/transaction/authorization.d.ts.map +0 -1
  978. package/lib.esm/transaction/authorization.js +0 -12
  979. package/lib.esm/transaction/authorization.js.map +0 -1
  980. package/lib.esm/transaction/index.d.ts +0 -40
  981. package/lib.esm/transaction/index.d.ts.map +0 -1
  982. package/lib.esm/transaction/index.js +0 -11
  983. package/lib.esm/transaction/index.js.map +0 -1
  984. package/lib.esm/transaction/transaction.d.ts +0 -400
  985. package/lib.esm/transaction/transaction.d.ts.map +0 -1
  986. package/lib.esm/transaction/transaction.js +0 -1111
  987. package/lib.esm/transaction/transaction.js.map +0 -1
  988. package/lib.esm/utils/base58.d.ts +0 -23
  989. package/lib.esm/utils/base58.d.ts.map +0 -1
  990. package/lib.esm/utils/base58.js +0 -63
  991. package/lib.esm/utils/base58.js.map +0 -1
  992. package/lib.esm/utils/base64-browser.d.ts +0 -4
  993. package/lib.esm/utils/base64-browser.d.ts.map +0 -1
  994. package/lib.esm/utils/base64-browser.js +0 -19
  995. package/lib.esm/utils/base64-browser.js.map +0 -1
  996. package/lib.esm/utils/base64.d.ts +0 -40
  997. package/lib.esm/utils/base64.d.ts.map +0 -1
  998. package/lib.esm/utils/base64.js +0 -53
  999. package/lib.esm/utils/base64.js.map +0 -1
  1000. package/lib.esm/utils/data.d.ts +0 -93
  1001. package/lib.esm/utils/data.d.ts.map +0 -1
  1002. package/lib.esm/utils/data.js +0 -170
  1003. package/lib.esm/utils/data.js.map +0 -1
  1004. package/lib.esm/utils/errors.d.ts +0 -512
  1005. package/lib.esm/utils/errors.d.ts.map +0 -1
  1006. package/lib.esm/utils/errors.js +0 -224
  1007. package/lib.esm/utils/errors.js.map +0 -1
  1008. package/lib.esm/utils/events.d.ts +0 -77
  1009. package/lib.esm/utils/events.d.ts.map +0 -1
  1010. package/lib.esm/utils/events.js +0 -42
  1011. package/lib.esm/utils/events.js.map +0 -1
  1012. package/lib.esm/utils/fetch.d.ts +0 -363
  1013. package/lib.esm/utils/fetch.d.ts.map +0 -1
  1014. package/lib.esm/utils/fetch.js +0 -852
  1015. package/lib.esm/utils/fetch.js.map +0 -1
  1016. package/lib.esm/utils/fixednumber.d.ts +0 -252
  1017. package/lib.esm/utils/fixednumber.d.ts.map +0 -1
  1018. package/lib.esm/utils/fixednumber.js +0 -526
  1019. package/lib.esm/utils/fixednumber.js.map +0 -1
  1020. package/lib.esm/utils/geturl-browser.d.ts +0 -4
  1021. package/lib.esm/utils/geturl-browser.d.ts.map +0 -1
  1022. package/lib.esm/utils/geturl-browser.js +0 -62
  1023. package/lib.esm/utils/geturl-browser.js.map +0 -1
  1024. package/lib.esm/utils/geturl.d.ts +0 -10
  1025. package/lib.esm/utils/geturl.d.ts.map +0 -1
  1026. package/lib.esm/utils/geturl.js +0 -114
  1027. package/lib.esm/utils/geturl.js.map +0 -1
  1028. package/lib.esm/utils/index.d.ts +0 -30
  1029. package/lib.esm/utils/index.d.ts.map +0 -1
  1030. package/lib.esm/utils/index.js +0 -22
  1031. package/lib.esm/utils/index.js.map +0 -1
  1032. package/lib.esm/utils/maths.d.ts +0 -66
  1033. package/lib.esm/utils/maths.d.ts.map +0 -1
  1034. package/lib.esm/utils/maths.js +0 -215
  1035. package/lib.esm/utils/maths.js.map +0 -1
  1036. package/lib.esm/utils/properties.d.ts +0 -23
  1037. package/lib.esm/utils/properties.d.ts.map +0 -1
  1038. package/lib.esm/utils/properties.js +0 -54
  1039. package/lib.esm/utils/properties.js.map +0 -1
  1040. package/lib.esm/utils/rlp-decode.d.ts +0 -6
  1041. package/lib.esm/utils/rlp-decode.d.ts.map +0 -1
  1042. package/lib.esm/utils/rlp-decode.js +0 -79
  1043. package/lib.esm/utils/rlp-decode.js.map +0 -1
  1044. package/lib.esm/utils/rlp-encode.d.ts +0 -6
  1045. package/lib.esm/utils/rlp-encode.d.ts.map +0 -1
  1046. package/lib.esm/utils/rlp-encode.js +0 -49
  1047. package/lib.esm/utils/rlp-encode.js.map +0 -1
  1048. package/lib.esm/utils/rlp.d.ts +0 -17
  1049. package/lib.esm/utils/rlp.d.ts.map +0 -1
  1050. package/lib.esm/utils/rlp.js +0 -9
  1051. package/lib.esm/utils/rlp.js.map +0 -1
  1052. package/lib.esm/utils/units.d.ts +0 -24
  1053. package/lib.esm/utils/units.d.ts.map +0 -1
  1054. package/lib.esm/utils/units.js +0 -83
  1055. package/lib.esm/utils/units.js.map +0 -1
  1056. package/lib.esm/utils/utf8.d.ts +0 -96
  1057. package/lib.esm/utils/utf8.d.ts.map +0 -1
  1058. package/lib.esm/utils/utf8.js +0 -221
  1059. package/lib.esm/utils/utf8.js.map +0 -1
  1060. package/lib.esm/utils/uuid.d.ts +0 -8
  1061. package/lib.esm/utils/uuid.d.ts.map +0 -1
  1062. package/lib.esm/utils/uuid.js +0 -30
  1063. package/lib.esm/utils/uuid.js.map +0 -1
  1064. package/lib.esm/wallet/base-wallet.d.ts +0 -57
  1065. package/lib.esm/wallet/base-wallet.d.ts.map +0 -1
  1066. package/lib.esm/wallet/base-wallet.js +0 -123
  1067. package/lib.esm/wallet/base-wallet.js.map +0 -1
  1068. package/lib.esm/wallet/index.d.ts +0 -23
  1069. package/lib.esm/wallet/index.d.ts.map +0 -1
  1070. package/lib.esm/wallet/index.js +0 -22
  1071. package/lib.esm/wallet/index.js.map +0 -1
  1072. package/lib.esm/wallet/json-keystore.d.ts +0 -40
  1073. package/lib.esm/wallet/json-keystore.d.ts.map +0 -1
  1074. package/lib.esm/wallet/json-keystore.js +0 -84
  1075. package/lib.esm/wallet/json-keystore.js.map +0 -1
  1076. package/lib.esm/wallet/utils.d.ts +0 -8
  1077. package/lib.esm/wallet/utils.d.ts.map +0 -1
  1078. package/lib.esm/wallet/utils.js +0 -142
  1079. package/lib.esm/wallet/utils.js.map +0 -1
  1080. package/lib.esm/wallet/wallet.d.ts +0 -62
  1081. package/lib.esm/wallet/wallet.d.ts.map +0 -1
  1082. package/lib.esm/wallet/wallet.js +0 -105
  1083. package/lib.esm/wallet/wallet.js.map +0 -1
  1084. package/lib.esm/wordlists/bit-reader.d.ts +0 -5
  1085. package/lib.esm/wordlists/bit-reader.d.ts.map +0 -1
  1086. package/lib.esm/wordlists/bit-reader.js +0 -32
  1087. package/lib.esm/wordlists/bit-reader.js.map +0 -1
  1088. package/lib.esm/wordlists/decode-owl.d.ts +0 -9
  1089. package/lib.esm/wordlists/decode-owl.d.ts.map +0 -1
  1090. package/lib.esm/wordlists/decode-owl.js +0 -55
  1091. package/lib.esm/wordlists/decode-owl.js.map +0 -1
  1092. package/lib.esm/wordlists/decode-owla.d.ts +0 -5
  1093. package/lib.esm/wordlists/decode-owla.d.ts.map +0 -1
  1094. package/lib.esm/wordlists/decode-owla.js +0 -28
  1095. package/lib.esm/wordlists/decode-owla.js.map +0 -1
  1096. package/lib.esm/wordlists/generation/encode-latin.d.ts +0 -25
  1097. package/lib.esm/wordlists/generation/encode-latin.d.ts.map +0 -1
  1098. package/lib.esm/wordlists/generation/encode-latin.js +0 -344
  1099. package/lib.esm/wordlists/generation/encode-latin.js.map +0 -1
  1100. package/lib.esm/wordlists/index.d.ts +0 -25
  1101. package/lib.esm/wordlists/index.d.ts.map +0 -1
  1102. package/lib.esm/wordlists/index.js +0 -25
  1103. package/lib.esm/wordlists/index.js.map +0 -1
  1104. package/lib.esm/wordlists/lang-cz.d.ts +0 -23
  1105. package/lib.esm/wordlists/lang-cz.d.ts.map +0 -1
  1106. package/lib.esm/wordlists/lang-cz.js +0 -31
  1107. package/lib.esm/wordlists/lang-cz.js.map +0 -1
  1108. package/lib.esm/wordlists/lang-en.d.ts +0 -23
  1109. package/lib.esm/wordlists/lang-en.d.ts.map +0 -1
  1110. package/lib.esm/wordlists/lang-en.js +0 -31
  1111. package/lib.esm/wordlists/lang-en.js.map +0 -1
  1112. package/lib.esm/wordlists/lang-es.d.ts +0 -23
  1113. package/lib.esm/wordlists/lang-es.d.ts.map +0 -1
  1114. package/lib.esm/wordlists/lang-es.js +0 -32
  1115. package/lib.esm/wordlists/lang-es.js.map +0 -1
  1116. package/lib.esm/wordlists/lang-fr.d.ts +0 -23
  1117. package/lib.esm/wordlists/lang-fr.d.ts.map +0 -1
  1118. package/lib.esm/wordlists/lang-fr.js +0 -32
  1119. package/lib.esm/wordlists/lang-fr.js.map +0 -1
  1120. package/lib.esm/wordlists/lang-it.d.ts +0 -23
  1121. package/lib.esm/wordlists/lang-it.d.ts.map +0 -1
  1122. package/lib.esm/wordlists/lang-it.js +0 -31
  1123. package/lib.esm/wordlists/lang-it.js.map +0 -1
  1124. package/lib.esm/wordlists/lang-ja.d.ts +0 -27
  1125. package/lib.esm/wordlists/lang-ja.d.ts.map +0 -1
  1126. package/lib.esm/wordlists/lang-ja.js +0 -154
  1127. package/lib.esm/wordlists/lang-ja.js.map +0 -1
  1128. package/lib.esm/wordlists/lang-ko.d.ts +0 -25
  1129. package/lib.esm/wordlists/lang-ko.d.ts.map +0 -1
  1130. package/lib.esm/wordlists/lang-ko.js +0 -89
  1131. package/lib.esm/wordlists/lang-ko.js.map +0 -1
  1132. package/lib.esm/wordlists/lang-pt.d.ts +0 -23
  1133. package/lib.esm/wordlists/lang-pt.d.ts.map +0 -1
  1134. package/lib.esm/wordlists/lang-pt.js +0 -31
  1135. package/lib.esm/wordlists/lang-pt.js.map +0 -1
  1136. package/lib.esm/wordlists/lang-zh.d.ts +0 -32
  1137. package/lib.esm/wordlists/lang-zh.d.ts.map +0 -1
  1138. package/lib.esm/wordlists/lang-zh.js +0 -92
  1139. package/lib.esm/wordlists/lang-zh.js.map +0 -1
  1140. package/lib.esm/wordlists/wordlist-owl.d.ts +0 -32
  1141. package/lib.esm/wordlists/wordlist-owl.d.ts.map +0 -1
  1142. package/lib.esm/wordlists/wordlist-owl.js +0 -66
  1143. package/lib.esm/wordlists/wordlist-owl.js.map +0 -1
  1144. package/lib.esm/wordlists/wordlist-owla.d.ts +0 -30
  1145. package/lib.esm/wordlists/wordlist-owla.d.ts.map +0 -1
  1146. package/lib.esm/wordlists/wordlist-owla.js +0 -36
  1147. package/lib.esm/wordlists/wordlist-owla.js.map +0 -1
  1148. package/lib.esm/wordlists/wordlist.d.ts +0 -47
  1149. package/lib.esm/wordlists/wordlist.d.ts.map +0 -1
  1150. package/lib.esm/wordlists/wordlist.js +0 -42
  1151. package/lib.esm/wordlists/wordlist.js.map +0 -1
  1152. package/lib.esm/wordlists/wordlists-browser.d.ts +0 -3
  1153. package/lib.esm/wordlists/wordlists-browser.d.ts.map +0 -1
  1154. package/lib.esm/wordlists/wordlists-browser.js +0 -5
  1155. package/lib.esm/wordlists/wordlists-browser.js.map +0 -1
  1156. package/lib.esm/wordlists/wordlists-extra.d.ts +0 -9
  1157. package/lib.esm/wordlists/wordlists-extra.d.ts.map +0 -1
  1158. package/lib.esm/wordlists/wordlists-extra.js +0 -9
  1159. package/lib.esm/wordlists/wordlists-extra.js.map +0 -1
  1160. package/lib.esm/wordlists/wordlists.d.ts +0 -16
  1161. package/lib.esm/wordlists/wordlists.d.ts.map +0 -1
  1162. package/lib.esm/wordlists/wordlists.js +0 -35
  1163. package/lib.esm/wordlists/wordlists.js.map +0 -1
  1164. package/rollup.config.mjs +0 -50
  1165. package/src.ts/_version.ts +0 -6
  1166. package/src.ts/abi/abi-coder.ts +0 -237
  1167. package/src.ts/abi/bytes32.ts +0 -45
  1168. package/src.ts/abi/coders/abstract-coder.ts +0 -541
  1169. package/src.ts/abi/coders/address.ts +0 -36
  1170. package/src.ts/abi/coders/anonymous.ts +0 -29
  1171. package/src.ts/abi/coders/array.ts +0 -199
  1172. package/src.ts/abi/coders/boolean.ts +0 -27
  1173. package/src.ts/abi/coders/bytes.ts +0 -43
  1174. package/src.ts/abi/coders/fixed-bytes.ts +0 -37
  1175. package/src.ts/abi/coders/null.ts +0 -28
  1176. package/src.ts/abi/coders/number.ts +0 -63
  1177. package/src.ts/abi/coders/string.ts +0 -29
  1178. package/src.ts/abi/coders/tuple.ts +0 -69
  1179. package/src.ts/abi/fragments.ts +0 -1617
  1180. package/src.ts/abi/index.ts +0 -41
  1181. package/src.ts/abi/interface.ts +0 -1271
  1182. package/src.ts/abi/typed.ts +0 -796
  1183. package/src.ts/address/address.ts +0 -148
  1184. package/src.ts/address/checks.ts +0 -123
  1185. package/src.ts/address/contract-address.ts +0 -80
  1186. package/src.ts/address/index.ts +0 -57
  1187. package/src.ts/constants/addresses.ts +0 -8
  1188. package/src.ts/constants/hashes.ts +0 -7
  1189. package/src.ts/constants/index.ts +0 -16
  1190. package/src.ts/constants/numbers.ts +0 -35
  1191. package/src.ts/constants/strings.ts +0 -16
  1192. package/src.ts/contract/contract.ts +0 -1120
  1193. package/src.ts/contract/factory.ts +0 -143
  1194. package/src.ts/contract/index.ts +0 -31
  1195. package/src.ts/contract/types.ts +0 -236
  1196. package/src.ts/contract/wrappers.ts +0 -225
  1197. package/src.ts/crypto/crypto-browser.ts +0 -64
  1198. package/src.ts/crypto/crypto.ts +0 -4
  1199. package/src.ts/crypto/hmac.ts +0 -51
  1200. package/src.ts/crypto/index.ts +0 -59
  1201. package/src.ts/crypto/keccak.ts +0 -54
  1202. package/src.ts/crypto/pbkdf2.ts +0 -55
  1203. package/src.ts/crypto/random.ts +0 -36
  1204. package/src.ts/crypto/ripemd160.ts +0 -43
  1205. package/src.ts/crypto/scrypt.ts +0 -114
  1206. package/src.ts/crypto/sha2.ts +0 -78
  1207. package/src.ts/crypto/signature.ts +0 -145
  1208. package/src.ts/crypto/signing-key.ts +0 -126
  1209. package/src.ts/hash/authorization.ts +0 -38
  1210. package/src.ts/hash/id.ts +0 -17
  1211. package/src.ts/hash/index.ts +0 -18
  1212. package/src.ts/hash/message.ts +0 -51
  1213. package/src.ts/hash/namehash.ts +0 -101
  1214. package/src.ts/hash/solidity.ts +0 -117
  1215. package/src.ts/hash/typed-data.ts +0 -658
  1216. package/src.ts/index.ts +0 -12
  1217. package/src.ts/providers/abstract-provider.ts +0 -1761
  1218. package/src.ts/providers/abstract-signer.ts +0 -314
  1219. package/src.ts/providers/community.ts +0 -49
  1220. package/src.ts/providers/contracts.ts +0 -42
  1221. package/src.ts/providers/default-provider.ts +0 -96
  1222. package/src.ts/providers/ens-resolver.ts +0 -606
  1223. package/src.ts/providers/format.ts +0 -320
  1224. package/src.ts/providers/formatting.ts +0 -418
  1225. package/src.ts/providers/index.ts +0 -125
  1226. package/src.ts/providers/network.ts +0 -327
  1227. package/src.ts/providers/pagination.ts +0 -8
  1228. package/src.ts/providers/plugin-fallback.ts +0 -35
  1229. package/src.ts/providers/plugins-network.ts +0 -281
  1230. package/src.ts/providers/provider-browser.ts +0 -334
  1231. package/src.ts/providers/provider-fallback.ts +0 -801
  1232. package/src.ts/providers/provider-ipcsocket-browser.ts +0 -3
  1233. package/src.ts/providers/provider-ipcsocket.ts +0 -81
  1234. package/src.ts/providers/provider-jsonrpc.ts +0 -1334
  1235. package/src.ts/providers/provider-socket.ts +0 -352
  1236. package/src.ts/providers/provider-websocket.ts +0 -103
  1237. package/src.ts/providers/provider.ts +0 -2136
  1238. package/src.ts/providers/signer-noncemanager.ts +0 -98
  1239. package/src.ts/providers/signer.ts +0 -166
  1240. package/src.ts/providers/subscriber-connection.ts +0 -74
  1241. package/src.ts/providers/subscriber-filterid.ts +0 -199
  1242. package/src.ts/providers/subscriber-polling.ts +0 -321
  1243. package/src.ts/providers/ws-browser.ts +0 -11
  1244. package/src.ts/providers/ws.ts +0 -3
  1245. package/src.ts/quantumcoin.ts +0 -219
  1246. package/src.ts/thirdparty.d.ts +0 -16
  1247. package/src.ts/transaction/accesslist.ts +0 -43
  1248. package/src.ts/transaction/address.ts +0 -35
  1249. package/src.ts/transaction/authorization.ts +0 -14
  1250. package/src.ts/transaction/index.ts +0 -51
  1251. package/src.ts/transaction/transaction.ts +0 -1349
  1252. package/src.ts/utils/base58.ts +0 -73
  1253. package/src.ts/utils/base64-browser.ts +0 -25
  1254. package/src.ts/utils/base64.ts +0 -56
  1255. package/src.ts/utils/data.ts +0 -199
  1256. package/src.ts/utils/errors.ts +0 -793
  1257. package/src.ts/utils/events.ts +0 -105
  1258. package/src.ts/utils/fetch.ts +0 -970
  1259. package/src.ts/utils/fixednumber.ts +0 -643
  1260. package/src.ts/utils/geturl-browser.ts +0 -81
  1261. package/src.ts/utils/geturl.ts +0 -134
  1262. package/src.ts/utils/index.ts +0 -95
  1263. package/src.ts/utils/maths.ts +0 -240
  1264. package/src.ts/utils/properties.ts +0 -60
  1265. package/src.ts/utils/rlp-decode.ts +0 -104
  1266. package/src.ts/utils/rlp-encode.ts +0 -64
  1267. package/src.ts/utils/rlp.ts +0 -20
  1268. package/src.ts/utils/test.txt +0 -0
  1269. package/src.ts/utils/units.ts +0 -91
  1270. package/src.ts/utils/utf8.ts +0 -325
  1271. package/src.ts/utils/uuid.ts +0 -36
  1272. package/src.ts/wallet/base-wallet.ts +0 -160
  1273. package/src.ts/wallet/index.ts +0 -32
  1274. package/src.ts/wallet/json-keystore.ts +0 -108
  1275. package/src.ts/wallet/utils.ts +0 -147
  1276. package/src.ts/wallet/wallet.ts +0 -138
  1277. package/src.ts/wordlists/bit-reader.ts +0 -35
  1278. package/src.ts/wordlists/decode-owl.ts +0 -58
  1279. package/src.ts/wordlists/decode-owla.ts +0 -33
  1280. package/src.ts/wordlists/generation/encode-latin.ts +0 -370
  1281. package/src.ts/wordlists/index.ts +0 -26
  1282. package/src.ts/wordlists/lang-cz.ts +0 -33
  1283. package/src.ts/wordlists/lang-en.ts +0 -33
  1284. package/src.ts/wordlists/lang-es.ts +0 -35
  1285. package/src.ts/wordlists/lang-fr.ts +0 -34
  1286. package/src.ts/wordlists/lang-it.ts +0 -33
  1287. package/src.ts/wordlists/lang-ja.ts +0 -181
  1288. package/src.ts/wordlists/lang-ko.ts +0 -104
  1289. package/src.ts/wordlists/lang-pt.ts +0 -34
  1290. package/src.ts/wordlists/lang-zh.ts +0 -112
  1291. package/src.ts/wordlists/wordlist-owl.ts +0 -77
  1292. package/src.ts/wordlists/wordlist-owla.ts +0 -41
  1293. package/src.ts/wordlists/wordlist.ts +0 -59
  1294. package/src.ts/wordlists/wordlists-browser.ts +0 -8
  1295. package/src.ts/wordlists/wordlists-extra.ts +0 -9
  1296. package/src.ts/wordlists/wordlists.ts +0 -38
package/SPEC.md ADDED
@@ -0,0 +1,3845 @@
1
+ <!--
2
+ This is an experimental SDK. Please do not use for production. Use at own risk
3
+ -->
4
+
5
+ # QuantumCoin.js - Ethers.js v6 Compatible API Specification
6
+
7
+ ## Overview
8
+
9
+ This specification defines the requirements for implementing a QuantumCoin SDK that provides an ethers.js v6-compatible API. The implementation should follow the same object model pattern as ethers.js v6, while using quantum-coin-js-sdk for underlying functionality (ABI encoding/decoding, signing, address validation, etc.).
10
+
11
+ ## Key Differences from Ethereum
12
+
13
+ 1. **Address Format**: QuantumCoin addresses are 32 bytes (66 hex characters including 0x), not 20 bytes like Ethereum
14
+ 2. **No HDWallet Support**: HDWallet functionality is not applicable for QuantumCoin
15
+ 3. **RPC Endpoint**: Uses custom RPC endpoint format (stored in Config.rpcEndpoint)
16
+ 4. **Chain ID**: Default chain ID is 123123 (mainnet)
17
+
18
+ ## Core Principles
19
+
20
+ - Use only built-in JavaScript/Node.js libraries (no external dependencies except quantum-coin-js-sdk)
21
+ - Follow ethers.js v6 object model and API patterns
22
+ - All cryptographic operations, signing, and address validation must use quantum-coin-js-sdk
23
+ - Maintain compatibility with ethers.js v6 patterns for ease of migration
24
+
25
+ ---
26
+
27
+ ## Constants
28
+
29
+ ### `version: string`
30
+ The current version of the QuantumCoin.js library.
31
+ - Type: `string`
32
+ - Example: `"1.0.0"`
33
+
34
+ ### `ZeroAddress: string`
35
+ The zero address (all zeros).
36
+ - Type: `string`
37
+ - Value: `"0x0000000000000000000000000000000000000000000000000000000000000000"` (32 bytes, 66 hex characters)
38
+ - **Note**: The API matches ethers.js v6 ZeroAddress. For QuantumCoin, this is a 32-byte address.
39
+
40
+ ### `ZeroHash: string`
41
+ The zero hash (all zeros).
42
+ - Type: `string`
43
+ - Value: `"0x0000000000000000000000000000000000000000000000000000000000000000"` (32 bytes, 66 hex characters)
44
+ - **Note**: The API matches ethers.js v6 ZeroHash.
45
+
46
+ ### `MaxUint256: bigint`
47
+ The maximum value for a uint256.
48
+ - Type: `bigint`
49
+ - Value: `2n ** 256n - 1n`
50
+ - **Note**: The API matches ethers.js v6 MaxUint256.
51
+
52
+ ### `MaxUint160: bigint`
53
+ The maximum value for a uint160.
54
+ - Type: `bigint`
55
+ - Value: `2n ** 160n - 1n`
56
+ - **Note**: The API matches ethers.js v6 MaxUint160.
57
+
58
+ ### `MinInt256: bigint`
59
+ The minimum value for an int256.
60
+ - Type: `bigint`
61
+ - Value: `-(2n ** 255n)`
62
+ - **Note**: The API matches ethers.js v6 MinInt256.
63
+
64
+ ### `MaxInt256: bigint`
65
+ The maximum value for an int256.
66
+ - Type: `bigint`
67
+ - Value: `2n ** 255n - 1n`
68
+ - **Note**: The API matches ethers.js v6 MaxInt256.
69
+
70
+ ### `NumericFault: string`
71
+ Error code for numeric faults.
72
+ - Type: `string`
73
+ - Value: `"NUMERIC_FAULT"`
74
+ - **Note**: The API matches ethers.js v6 NumericFault.
75
+
76
+ ### `NumericFaultCode: string`
77
+ Error code for numeric faults (alias).
78
+ - Type: `string`
79
+ - Value: `"NUMERIC_FAULT"`
80
+ - **Note**: The API matches ethers.js v6 NumericFaultCode.
81
+
82
+ ### `WeiPerEther: bigint`
83
+ Wei per ether constant.
84
+ - Type: `bigint`
85
+ - Value: `1000000000000000000n` (1e18)
86
+ - **Note**: The API matches ethers.js v6 WeiPerEther.
87
+
88
+ ### `EtherSymbol: string`
89
+ Symbol for Ether currency.
90
+ - Type: `string`
91
+ - Value: `"Ξ"`
92
+ - **Note**: The API matches ethers.js v6 EtherSymbol.
93
+
94
+ ### `N: bigint`
95
+ BigNumber constant (exported as `N`).
96
+ - Type: `bigint`
97
+ - **Note**: The API matches ethers.js v6 N constant.
98
+
99
+ ---
100
+
101
+ ## Table of Contents
102
+
103
+ - [Overview](#overview)
104
+ - [Key Differences from Ethereum](#key-differences-from-ethereum)
105
+ - [Core Principles](#core-principles)
106
+ - [Constants](#constants)
107
+ - [1. Provider Classes](#1-provider-classes)
108
+ - [1.1 AbstractProvider](#11-abstractprovider)
109
+ - [1.2 JsonRpcProvider](#12-jsonrpcprovider)
110
+ - [1.3 Block](#13-block)
111
+ - [1.4 TransactionRequest](#14-transactionrequest)
112
+ - [1.5 TransactionResponse](#15-transactionresponse)
113
+ - [1.6 TransactionReceipt](#16-transactionreceipt)
114
+ - [1.7 Log](#17-log)
115
+ - [1.8 Filter](#18-filter)
116
+ - [1.9 PollingBlockTagSubscriber](#19-pollingblocktagsubscriber)
117
+ - [1.10 WebSocketProvider](#110-websocketprovider)
118
+ - [1.11 IpcSocketProvider](#111-ipcsocketprovider)
119
+ - [1.12 FallbackProvider](#112-fallbackprovider)
120
+ - [1.13 BrowserProvider](#113-browserprovider)
121
+ - [1.14 FilterByBlockHash](#114-filterbyblockhash)
122
+ - [2. Wallet Classes](#2-wallet-classes)
123
+ - [2.1 AbstractSigner](#21-abstractsigner)
124
+ - [2.2 BaseWallet](#22-basewallet)
125
+ - [2.3 NonceManager](#23-noncemanager)
126
+ - [2.4 Wallet](#24-wallet)
127
+ - [2.5 JsonRpcSigner](#25-jsonrpcsigner)
128
+ - [2.6 VoidSigner](#26-voidsigner)
129
+ - [3. Contract Classes](#3-contract-classes)
130
+ - [3.1 BaseContract](#31-basecontract)
131
+ - [3.2 Contract](#32-contract)
132
+ - [3.3 ContractFactory](#33-contractfactory)
133
+ - [3.4 ContractTransactionResponse](#34-contracttransactionresponse)
134
+ - [3.5 ContractTransactionReceipt](#35-contracttransactionreceipt)
135
+ - [3.6 EventLog](#36-eventlog)
136
+ - [4. Interface and ABI Classes](#4-interface-and-abi-classes)
137
+ - [4.1 Interface](#41-interface)
138
+ - [4.2 Fragment (Base Class)](#42-fragment-base-class)
139
+ - [4.3 AbiFragment](#43-abifragment)
140
+ - [4.4 FunctionFragment](#44-functionfragment)
141
+ - [4.5 EventFragment](#45-eventfragment)
142
+ - [4.6 AbiParameter](#46-abiparameter)
143
+ - [4.7 TransactionDescription](#47-transactiondescription)
144
+ - [4.8 LogDescription](#48-logdescription)
145
+ - [4.9 ErrorFragment](#49-errorfragment)
146
+ - [4.10 ErrorDescription](#410-errordescription)
147
+ - [4.11 ConstructorFragment](#411-constructorfragment)
148
+ - [4.12 ParamType](#412-paramtype)
149
+ - [4.13 AbiCoder](#413-abicoder)
150
+ - [4.14 StructFragment](#414-structfragment)
151
+ - [4.15 FallbackFragment](#415-fallbackfragment)
152
+ - [5. Utility Classes and Functions](#5-utility-classes-and-functions)
153
+ - [5.1 Result](#51-result)
154
+ - [5.2 BytesLike](#52-byteslike)
155
+ - [5.3 BigNumberish](#53-bignumberish)
156
+ - [5.3.1 AddressLike](#531-addresslike)
157
+ - [5.3.2 Typed Values](#532-typed-values)
158
+ - [5.3.3 BlockTag](#533-blocktag)
159
+ - [5.3.4 ProviderEventFilter](#534-providereventfilter)
160
+ - [5.3.5 EventFilter](#535-eventfilter)
161
+ - [5.3.6 SigningKey](#536-signingkey)
162
+ - [5.3.7 Signature](#537-signature)
163
+ - [5.3.8 Transaction](#538-transaction)
164
+ - [5.3.9 Indexed](#539-indexed)
165
+ - [5.3.10 KeystoreAccount](#5310-keystoreaccount)
166
+ - [5.4 Address Utilities](#54-address-utilities)
167
+ - [5.4.1 Addressable Interface](#541-addressable-interface)
168
+ - [5.5 Encoding/Decoding Utilities](#55-encodingdecoding-utilities)
169
+ - [5.6 BigNumber Utilities](#56-bignumber-utilities)
170
+ - [5.7 Hash Utilities](#57-hash-utilities)
171
+ - [5.8 Random Utilities](#58-random-utilities)
172
+ - [5.9 RLP Encoding](#59-rlp-encoding)
173
+ - [5.10 Provider Utility Functions](#510-provider-utility-functions)
174
+ - [5.11 JSON Wallet Utilities](#511-json-wallet-utilities)
175
+ - [5.12 Mnemonic](#512-mnemonic)
176
+ - [5.13 Wordlist](#513-wordlist)
177
+ - [6. Network and Plugins](#6-network-and-plugins)
178
+ - [6.1 Network](#61-network)
179
+ - [6.2 Networkish](#62-networkish)
180
+ - [6.3 NetworkPlugin (Base Interface)](#63-networkplugin-base-interface)
181
+ - [6.4 GasCostPlugin](#64-gascostplugin)
182
+ - [7. Error Classes](#7-error-classes)
183
+ - [7.1 Error](#71-error)
184
+ - [7.2 ProviderError](#72-providererror)
185
+ - [7.3 TransactionError](#73-transactionerror)
186
+ - [7.4 ContractError](#74-contracterror)
187
+ - [8. Provider Types and Interfaces](#8-provider-types-and-interfaces)
188
+ - [8.1 PreparedTransactionRequest](#81-preparedtransactionrequest)
189
+ - [8.2 MinedBlock](#82-minedblock)
190
+ - [8.3 MinedTransactionResponse](#83-minedtransactionresponse)
191
+ - [8.4 FeeData](#84-feedata)
192
+ - [8.5 WebSocketLike](#85-websocketlike)
193
+ - [8.6 ProviderEvent](#86-providerevent)
194
+ - [8.7 TopicFilter](#87-topicfilter)
195
+ - [9. Provider Interface](#9-provider-interface)
196
+ - [9.1 Provider (Abstract Base Class)](#91-provider-abstract-base-class)
197
+ - [9.2 ContractRunner (Abstract Base Class/Interface)](#92-contractrunner-abstract-base-classinterface)
198
+ - [9.3 Signer (Abstract Base Class)](#93-signer-abstract-base-class)
199
+ - [10. Implementation Requirements](#10-implementation-requirements)
200
+ - [10.1 Quantum-Coin-JS-SDK Integration](#101-quantum-coin-js-sdk-integration)
201
+ - [10.2 Built-in Libraries Only](#102-built-in-libraries-only)
202
+ - [10.3 Address Format Handling](#103-address-format-handling)
203
+ - [10.4 Error Handling](#104-error-handling)
204
+ - [10.5 Event Handling](#105-event-handling)
205
+ - [10.6 Transaction Handling](#106-transaction-handling)
206
+ - [10.7 ABI Handling](#107-abi-handling)
207
+ - [10.8 Async/Await Pattern](#108-asyncawait-pattern)
208
+ - [10.9 Type Safety](#109-type-safety)
209
+ - [11. File Structure](#11-file-structure)
210
+ - [12. Example Usage Patterns](#12-example-usage-patterns)
211
+ - [12.1 Provider Usage](#121-provider-usage)
212
+ - [12.2 Wallet Usage](#122-wallet-usage)
213
+ - [12.3 Contract Usage](#123-contract-usage)
214
+ - [12.4 Contract Deployment](#124-contract-deployment)
215
+ - [13. Testing Requirements](#13-testing-requirements)
216
+ - [14. Documentation Requirements](#14-documentation-requirements)
217
+ - [15. Typed Contract Generator](#15-typed-contract-generator)
218
+ - [Notes](#notes)
219
+
220
+ ---
221
+
222
+ ## 1. Provider Classes
223
+
224
+ ### 1.1 AbstractProvider
225
+
226
+ **Purpose**: Abstract base class for all providers
227
+
228
+ **Extends**: Provider
229
+
230
+ **Note**: This is an internal base class. All concrete providers (JsonRpcProvider, WebSocketProvider, etc.) extend this class. The API matches ethers.js v6 AbstractProvider.
231
+
232
+ ---
233
+
234
+ ### 1.2 JsonRpcProvider
235
+
236
+ **Purpose**: Provides JSON-RPC interface to QuantumCoin blockchain
237
+
238
+ **Extends**: AbstractProvider
239
+
240
+ **Note**: The API matches ethers.js v6 JsonRpcProvider. All methods, properties, and behavior follow the same patterns as ethers.js v6.
241
+
242
+ **Constructor**:
243
+ ```javascript
244
+ constructor(url?: string, chainId?: number)
245
+ ```
246
+ - `url`: RPC endpoint URL (defaults to Config.rpcEndpoint or "https://public.rpc.quantumcoinapi.com")
247
+ - `chainId`: Chain ID (defaults to 123123)
248
+
249
+ **Properties**:
250
+ - `url`: string - RPC endpoint URL
251
+ - `chainId`: number - Chain ID
252
+
253
+ **Methods**:
254
+
255
+ #### `getBlockNumber(): Promise<number>`
256
+ Returns the latest block number.
257
+
258
+ #### `getBlock(blockNumber: number | "latest"): Promise<Block>`
259
+ Returns block information.
260
+ - `blockNumber`: Block number or "latest"
261
+
262
+ #### `getTransaction(txHash: string): Promise<TransactionResponse>`
263
+ Returns transaction details.
264
+ - `txHash`: Transaction hash (66 hex characters)
265
+
266
+ #### `getTransactionReceipt(txHash: string): Promise<TransactionReceipt>`
267
+ Returns transaction receipt.
268
+ - `txHash`: Transaction hash
269
+
270
+ #### `getBalance(address: string): Promise<bigint>`
271
+ Returns account balance in wei.
272
+ - `address`: 32-byte address (66 hex characters)
273
+
274
+ #### `getTransactionCount(address: string, blockTag?: string): Promise<number>`
275
+ Returns account nonce.
276
+ - `address`: 32-byte address
277
+ - `blockTag`: Optional block tag (default: "latest")
278
+
279
+ #### `sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>`
280
+ Sends a signed transaction.
281
+ - `tx`: Transaction request object
282
+
283
+ #### `call(tx: TransactionRequest, blockTag?: string): Promise<string>`
284
+ Executes a call without creating a transaction.
285
+ - `tx`: Transaction request
286
+ - `blockTag`: Optional block tag
287
+
288
+ #### `estimateGas(tx: TransactionRequest): Promise<bigint>`
289
+ Estimates gas for a transaction.
290
+ - `tx`: Transaction request
291
+
292
+ #### `getCode(address: string, blockTag?: string): Promise<string>`
293
+ Returns contract bytecode.
294
+ - `address`: Contract address
295
+ - `blockTag`: Optional block tag
296
+
297
+ #### `getStorageAt(address: string, position: bigint, blockTag?: string): Promise<string>`
298
+ Returns storage value at position.
299
+ - `address`: Contract address
300
+ - `position`: Storage position
301
+ - `blockTag`: Optional block tag
302
+
303
+ #### `getLogs(filter: Filter): Promise<Log[]>`
304
+ Returns event logs matching filter.
305
+ - `filter`: Event filter object
306
+
307
+ #### `on(event: string, callback: Function): void`
308
+ Subscribes to events (block, pending, etc.).
309
+ - `event`: Event name
310
+ - `callback`: Callback function
311
+
312
+ #### `once(event: string, callback: Function): void`
313
+ Subscribes to event once.
314
+ - `event`: Event name
315
+ - `callback`: Callback function
316
+
317
+ #### `removeListener(event: string, callback: Function): void`
318
+ Removes event listener.
319
+ - `event`: Event name
320
+ - `callback`: Callback function
321
+
322
+ #### `removeAllListeners(event?: string): void`
323
+ Removes all listeners for event.
324
+ - `event`: Optional event name
325
+
326
+ ---
327
+
328
+ ### 1.2.1 JsonRpcApiProvider
329
+
330
+ **Purpose**: Base class for JSON-RPC API providers
331
+
332
+ **Extends**: AbstractProvider
333
+
334
+ **Note**: This is an internal base class that provides the core JSON-RPC API functionality. JsonRpcProvider extends this class. The API matches ethers.js v6 JsonRpcApiProvider.
335
+
336
+ ---
337
+
338
+ ### 1.3 Block
339
+
340
+ **Properties**:
341
+ - `number`: number - Block number
342
+ - `hash`: string | null - Block hash (66 hex characters, null for pending blocks)
343
+ - `timestamp`: number - Block timestamp
344
+ - `transactions`: string[] | TransactionResponse[] - Array of transaction hashes or full transaction objects
345
+ - `parentHash`: string - Parent block hash
346
+ - `gasLimit`: bigint - Gas limit
347
+ - `gasUsed`: bigint - Gas used
348
+ - `miner`: string - Miner coinbase address (32 bytes, 66 hex characters)
349
+ - `difficulty`: bigint - Difficulty target
350
+ - `nonce`: string - Block nonce
351
+ - `extraData`: string - Extra data included by validator
352
+ - `receiptsRoot`: string | null - Hash of the transaction receipts trie
353
+ - `date`: Date | null - Date object for block timestamp
354
+ - `length`: number - Number of transactions in block
355
+ - `provider: Provider | null` - Provider instance
356
+
357
+ **Methods**:
358
+
359
+ #### `getTransaction(indexOrHash: number | string): Promise<TransactionResponse | null>`
360
+ Gets a transaction from the block.
361
+ - `indexOrHash`: Transaction index or hash
362
+ - Returns: TransactionResponse or null if not found
363
+
364
+ #### `getTransactionReceipt(indexOrHash: number | string): Promise<TransactionReceipt | null>`
365
+ Gets a transaction receipt from the block.
366
+ - `indexOrHash`: Transaction index or hash
367
+ - Returns: TransactionReceipt or null if not found
368
+
369
+ #### `getPrefetchedTransactions(): TransactionResponse[]`
370
+ Returns prefetched transaction objects (if available).
371
+ - Returns: Array of TransactionResponse objects
372
+
373
+ **Note**: Some properties may be null for pending blocks. The `transactions` property can be either an array of hashes (when fetched with `getBlock(blockNumber)`) or full transaction objects (when fetched with `getBlock(blockNumber, true)`).
374
+
375
+ ---
376
+
377
+ ### 1.4 TransactionRequest
378
+
379
+ **Properties**:
380
+ - `to`: string | null - Recipient address (null for contract creation)
381
+ - `from`: string - Sender address
382
+ - `value`: bigint | string - Value in wei
383
+ - `data`: string - Transaction data (hex string)
384
+ - `gasLimit`: bigint | string - Gas limit
385
+ - `gasPrice`: bigint | string - Gas price
386
+ - `nonce`: number - Transaction nonce
387
+ - `chainId`: number - Chain ID
388
+ - `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.
389
+ - `type?: number` - Transaction type
390
+ - `accessList?: Array<{address: string, storageKeys: string[]}>` - Access list (EIP-2930)
391
+
392
+ ---
393
+
394
+ ### 1.5 TransactionResponse
395
+
396
+ **Properties**:
397
+ - `hash`: string - Transaction hash
398
+ - `to`: string | null - Recipient address
399
+ - `from`: string - Sender address
400
+ - `value`: bigint - Value in wei
401
+ - `data`: string - Transaction data
402
+ - `gasLimit`: bigint - Gas limit
403
+ - `gasPrice`: bigint | null - Gas price
404
+ - `nonce`: number - Nonce
405
+ - `chainId`: number - Chain ID
406
+ - `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.
407
+ - `blockNumber`: number | null - Block number
408
+ - `blockHash`: string | null - Block hash
409
+ - `provider: Provider | null` - Provider instance
410
+ - `index: number | null` - Transaction index in block
411
+ - `type: number | null` - Transaction type
412
+ - `accessList: Array<{address: string, storageKeys: string[]}> | null` - Access list
413
+
414
+ **Methods**:
415
+
416
+ #### `wait(confirmations?: number, timeout?: number): Promise<TransactionReceipt>`
417
+ Waits for transaction confirmation.
418
+ - `confirmations`: Optional number of confirmations to wait for
419
+ - `timeout`: Optional timeout in milliseconds
420
+
421
+ ---
422
+
423
+ ### 1.6 TransactionReceipt
424
+
425
+ **Properties**:
426
+ - `hash`: string - Transaction hash
427
+ - `blockNumber`: number - Block number
428
+ - `blockHash`: string - Block hash
429
+ - `transactionIndex`: number - Transaction index in block
430
+ - `from`: string - Sender address
431
+ - `to`: string | null - Recipient address
432
+ - `gasUsed`: bigint - Gas used
433
+ - `effectiveGasPrice`: bigint - Effective gas price
434
+ - `status`: number - Transaction status (1 = success, 0 = failure)
435
+ - `remarks`: string | null - Optional hex string (including 0x) that represents a remark/comment from the transaction. Maximum 32 bytes length (in bytes). Warning: do not store any sensitive information in this field as it will be public on the blockchain.
436
+ - `logs`: Log[] - Event logs
437
+ - `logsBloom`: string - Logs bloom filter
438
+ - `provider: Provider | null` - Provider instance
439
+ - `contractAddress: string | null` - Contract address if transaction created a contract
440
+ - `type: number | null` - Transaction type
441
+ - `root: string | null` - State root (pre-Byzantium)
442
+ - `cumulativeGasUsed: bigint` - Cumulative gas used in block
443
+
444
+ ---
445
+
446
+ ### 1.7 Log
447
+
448
+ **Properties**:
449
+ - `address`: string - Contract address
450
+ - `topics`: string[] - Event topics
451
+ - `data`: string - Log data
452
+ - `blockNumber`: number - Block number
453
+ - `blockHash`: string - Block hash
454
+ - `transactionHash`: string - Transaction hash
455
+ - `transactionIndex`: number - Transaction index
456
+ - `logIndex`: number - Log index
457
+ - `removed`: boolean - Whether log was removed
458
+ - `provider: Provider | null` - Provider instance
459
+
460
+ **Methods**:
461
+
462
+ #### `getBlock(): Promise<Block | null>`
463
+ Gets block containing log.
464
+ - Returns: Block or null
465
+
466
+ #### `getTransaction(): Promise<TransactionResponse | null>`
467
+ Gets transaction containing log.
468
+ - Returns: TransactionResponse or null
469
+
470
+ #### `getTransactionReceipt(): Promise<TransactionReceipt | null>`
471
+ Gets transaction receipt.
472
+ - Returns: TransactionReceipt or null
473
+
474
+ ---
475
+
476
+ ### 1.8 Filter
477
+
478
+ **Properties**:
479
+ - `address`: string | string[] - Contract address(es)
480
+ - `topics`: (string | string[] | null)[] - Event topics
481
+ - `fromBlock`: number | string - Start block
482
+ - `toBlock`: number | string - End block
483
+
484
+ ---
485
+
486
+ ### 1.9 PollingBlockTagSubscriber
487
+
488
+ **Purpose**: Subscribes to block updates by polling the provider at regular intervals
489
+
490
+ **Extends**: OnBlockSubscriber, Subscriber
491
+
492
+ **Constructor**:
493
+ ```javascript
494
+ constructor(provider: Provider, tag: string)
495
+ ```
496
+ - `provider`: Provider instance
497
+ - `tag`: Block tag to poll ("latest", "pending", etc.)
498
+
499
+ **Methods**:
500
+
501
+ #### `start(): void`
502
+ Starts polling for block updates.
503
+
504
+ #### `stop(): void`
505
+ Stops polling for block updates.
506
+
507
+ **Note**: This class provides a polling-based alternative to event subscriptions for environments where WebSocket subscriptions are not available.
508
+
509
+ ---
510
+
511
+ ### 1.9.1 SocketBlockSubscriber
512
+
513
+ **Purpose**: Subscribes to block updates via WebSocket
514
+
515
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
516
+
517
+ ---
518
+
519
+ ### 1.9.2 SocketEventSubscriber
520
+
521
+ **Purpose**: Subscribes to event logs via WebSocket
522
+
523
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
524
+
525
+ ---
526
+
527
+ ### 1.9.3 SocketPendingSubscriber
528
+
529
+ **Purpose**: Subscribes to pending transactions via WebSocket
530
+
531
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
532
+
533
+ ---
534
+
535
+ ### 1.9.4 SocketSubscriber
536
+
537
+ **Purpose**: Base class for WebSocket subscribers
538
+
539
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
540
+
541
+ ---
542
+
543
+ ### 1.9.5 UnmanagedSubscriber
544
+
545
+ **Purpose**: Represents an unmanaged subscriber
546
+
547
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
548
+
549
+ ---
550
+
551
+ ### 1.10 WebSocketProvider
552
+
553
+ **Purpose**: JSON-RPC provider backed by a WebSocket connection
554
+
555
+ **Extends**: SocketProvider, JsonRpcProvider
556
+
557
+ **Constructor**:
558
+ ```javascript
559
+ constructor(url: string | WebSocketLike | WebSocketCreator, chainId?: number, options?: JsonRpcApiProviderOptions)
560
+ ```
561
+ - `url`: WebSocket URL, WebSocketLike instance, or WebSocketCreator function
562
+ - `chainId`: Chain ID (defaults to 123123)
563
+ - `options`: Optional provider options
564
+
565
+ **Properties**:
566
+ - `websocket`: WebSocketLike - The WebSocket connection
567
+ - `url`: string - WebSocket URL
568
+ - `chainId`: number - Chain ID
569
+
570
+ **Methods**:
571
+ - Inherits all methods from JsonRpcProvider
572
+ - Provides real-time event subscriptions via WebSocket
573
+
574
+ **Note**: WebSockets provide instant access to events but require a persistent connection. Many third-party services charge additional fees for WebSocket endpoints.
575
+
576
+ ---
577
+
578
+ ### 1.11 IpcSocketProvider
579
+
580
+ **Purpose**: JSON-RPC provider backed by an IPC socket (for local nodes)
581
+
582
+ **Extends**: SocketProvider, JsonRpcProvider
583
+
584
+ **Constructor**:
585
+ ```javascript
586
+ constructor(path: string, chainId?: number)
587
+ ```
588
+ - `path`: Path to IPC socket
589
+ - `chainId`: Chain ID (defaults to 123123)
590
+
591
+ **Properties**:
592
+ - `path`: string - IPC socket path
593
+ - `chainId`: number - Chain ID
594
+
595
+ **Methods**:
596
+ - Inherits all methods from JsonRpcProvider
597
+ - Provides real-time event subscriptions via IPC
598
+
599
+ **Note**: Used for connecting to local QuantumCoin nodes running on the same machine.
600
+
601
+ ---
602
+
603
+ ### 1.12 FallbackProvider
604
+
605
+ **Purpose**: Provider that falls back to multiple providers for redundancy and reliability
606
+
607
+ **Extends**: Provider
608
+
609
+ **Constructor**:
610
+ ```javascript
611
+ constructor(providers: Array<{ provider: Provider, priority?: number, weight?: number }>, quorum?: number)
612
+ ```
613
+ - `providers`: Array of provider configurations with optional priority and weight
614
+ - `quorum`: Optional quorum number (default: 1) - number of providers that must agree
615
+
616
+ **Properties**:
617
+ - `providers`: Provider[] - Array of providers
618
+ - `quorum`: number - Quorum number
619
+
620
+ **Methods**:
621
+ - Inherits all methods from Provider
622
+ - Automatically falls back to next provider on failure
623
+ - For methods requiring quorum, waits for multiple providers to agree
624
+
625
+ **Note**: Useful for high-availability applications where multiple RPC endpoints are available.
626
+
627
+ ---
628
+
629
+ ### 1.13 BrowserProvider
630
+
631
+ **Purpose**: JSON-RPC provider backed by a browser-based EIP-1193 compatible provider (e.g., MetaMask, WalletConnect)
632
+
633
+ **Extends**: JsonRpcProvider
634
+
635
+ **Note**: The API matches ethers.js v6 BrowserProvider. This provider wraps EIP-1193 compatible providers that are injected into the browser (typically via `window.ethereum` or similar).
636
+
637
+ **Constructor**:
638
+ ```javascript
639
+ constructor(ethereum: Eip1193Provider, chainId?: number)
640
+ ```
641
+ - `ethereum`: EIP-1193 compatible provider object (must implement the EIP-1193 interface)
642
+ - `chainId`: Chain ID (defaults to 123123)
643
+
644
+ **Properties**:
645
+ - `provider`: Eip1193Provider - The wrapped EIP-1193 provider
646
+ - `chainId`: number - Chain ID
647
+
648
+ **Methods**:
649
+ - Inherits all methods from JsonRpcProvider
650
+ - Provides browser-based wallet integration
651
+ - Automatically handles account changes and chain changes via EIP-1193 events
652
+
653
+ **EIP-1193 Provider Interface**:
654
+ The `ethereum` parameter must implement the EIP-1193 interface with the following methods:
655
+ - `request({ method: string, params?: any[] }): Promise<any>` - Main RPC request method
656
+ - `on(event: string, callback: Function): void` - Event subscription
657
+ - `removeListener(event: string, callback: Function): void` - Event unsubscription
658
+
659
+ **Events**:
660
+ The BrowserProvider automatically listens to EIP-1193 events:
661
+ - `accountsChanged` - Emitted when accounts change
662
+ - `chainChanged` - Emitted when chain ID changes
663
+ - `disconnect` - Emitted when provider disconnects
664
+
665
+ **Note**: BrowserProvider is designed for browser environments. For Node.js environments, use JsonRpcProvider, WebSocketProvider, or IpcSocketProvider instead.
666
+
667
+ ---
668
+
669
+ ### 1.14 FilterByBlockHash
670
+
671
+ **Properties**:
672
+ - `blockHash`: string - Block hash to filter by (66 hex characters)
673
+ - `address`: string | string[] - Contract address(es)
674
+ - `topics`: (string | string[] | null)[] - Event topics
675
+
676
+ **Note**: Alternative to Filter for querying logs by block hash instead of block number range. Allows querying potentially orphaned blocks without ambiguity.
677
+
678
+ ---
679
+
680
+ ## 2. Wallet Classes
681
+
682
+ ### 2.1 AbstractSigner
683
+
684
+ **Purpose**: Abstract base class for all signers
685
+
686
+ **Extends**: Signer
687
+
688
+ **Note**: This is an internal base class. All concrete signers (BaseWallet, Wallet, JsonRpcSigner, VoidSigner, etc.) extend this class. The API matches ethers.js v6 AbstractSigner.
689
+
690
+ ---
691
+
692
+ ### 2.2 BaseWallet
693
+
694
+ **Purpose**: Streamlined implementation of a Signer that operates with a private key
695
+
696
+ **Extends**: AbstractSigner
697
+
698
+ **Constructor**:
699
+ ```javascript
700
+ constructor(privateKey: SigningKey, provider?: null | Provider)
701
+ ```
702
+ - `privateKey`: SigningKey instance
703
+ - `provider`: Optional provider instance
704
+
705
+ **Properties**:
706
+ - `address`: string (read-only) - The wallet address
707
+ - `privateKey`: string (read-only) - The private key for this wallet
708
+ - `signingKey`: SigningKey (read-only) - The SigningKey used for signing payloads
709
+ - `provider`: Provider | null - Provider instance
710
+
711
+ **Methods**:
712
+
713
+ #### `getAddress(): Promise<string>`
714
+ Returns the wallet address.
715
+ - Returns: Address string
716
+
717
+ #### `signMessageSync(message: string | Uint8Array): string`
718
+ Returns the signature for message signed with this wallet (synchronous).
719
+ - `message`: Message to sign (string or bytes)
720
+ - Returns: Signature string
721
+ - **Implementation**: Uses quantum-coin-js-sdk for message signing
722
+
723
+ #### `signTransaction(tx: TransactionRequest): Promise<string>`
724
+ Signs a transaction and returns the signed transaction data.
725
+ - `tx`: Transaction request
726
+ - Returns: Signed transaction data
727
+ - **Implementation**: Uses `signRawTransaction()` from quantum-coin-js-sdk
728
+
729
+ #### `sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>`
730
+ Signs and sends a transaction.
731
+ - `tx`: Transaction request
732
+ - Returns: TransactionResponse
733
+ - **Requires provider**: Throws error if `provider` is `null`.
734
+
735
+ **Note**: BaseWallet provides the core signing functionality. Wallet extends BaseWallet and adds additional convenience methods.
736
+
737
+ ---
738
+
739
+ ### 2.3 NonceManager
740
+
741
+ **Purpose**: Manages nonces for transactions to prevent conflicts and ensure proper ordering
742
+
743
+ **Extends**: Signer
744
+
745
+ **Constructor**:
746
+ ```javascript
747
+ constructor(signer: Signer)
748
+ ```
749
+ - `signer`: Signer instance to wrap
750
+
751
+ **Properties**:
752
+ - `signer`: Signer - The wrapped signer
753
+ - `provider`: Provider | null - Provider instance (from wrapped signer)
754
+
755
+ **Methods**:
756
+
757
+ #### `getAddress(): Promise<string>`
758
+ Returns the signer address.
759
+ - Returns: Address string
760
+
761
+ #### `getTransactionCount(blockTag?: string): Promise<number>`
762
+ Gets the current transaction count (nonce).
763
+ - `blockTag`: Optional block tag
764
+ - Returns: Current nonce
765
+
766
+ #### `sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>`
767
+ Sends a transaction with managed nonce.
768
+ - `tx`: Transaction request (nonce will be auto-managed)
769
+ - Returns: TransactionResponse
770
+
771
+ #### `reset(): void`
772
+ Resets the nonce manager, clearing cached nonce.
773
+
774
+ #### `increment(): void`
775
+ Increments the internal nonce counter.
776
+
777
+ **Note**: NonceManager automatically manages nonces to prevent conflicts when sending multiple transactions. It tracks the nonce internally and increments it for each transaction.
778
+
779
+ ---
780
+
781
+ ### 2.4 Wallet
782
+
783
+ **Purpose**: Represents a QuantumCoin wallet with signing capabilities
784
+
785
+ **Extends**: BaseWallet
786
+
787
+ **Constructor**:
788
+ ```javascript
789
+ constructor(key: string | Uint8Array | SigningKey, provider?: Provider)
790
+ ```
791
+ - `key`: Private key as hex string, byte array, or SigningKey instance
792
+ - `provider`: Optional provider instance
793
+
794
+ **Implementation Notes**:
795
+ - The constructor should use quantum-coin-js-sdk functions to derive the wallet's public key and address:
796
+ - Use `publicKeyFromPrivateKey()` from quantum-coin-js-sdk to get the public key from the private key
797
+ - Use `addressFromPublicKey()` from quantum-coin-js-sdk to get the address from the public key
798
+ - If either function returns null, throw an error
799
+ - The private key should be converted to a byte array (number[]) if provided as a hex string for use with quantum-coin-js-sdk functions
800
+ - If a SigningKey is provided, use it directly
801
+
802
+ **Properties**:
803
+ - `address`: string (read-only) - Wallet address (32 bytes, 66 hex characters)
804
+ - `provider`: Provider | null - Provider instance (null if not provided in constructor)
805
+ - `privateKey`: string (read-only) - Private key as hex string
806
+ - `signingKey`: SigningKey (read-only) - The SigningKey used for signing payloads
807
+
808
+ **Static Methods**:
809
+
810
+ #### `createRandom(provider?: Provider): Wallet`
811
+ Creates a new random wallet.
812
+ - `provider`: Optional provider instance
813
+ - Returns: New Wallet instance
814
+ - **Implementation**: Uses `newWallet()` from quantum-coin-js-sdk internally. If `newWallet()` returns null, throw an error.
815
+
816
+ #### `fromEncryptedJsonSync(json: string, password: string, provider?: Provider): Wallet`
817
+ Creates a wallet from an encrypted JSON string (synchronous).
818
+ - `json`: Encrypted wallet JSON string
819
+ - `password`: Passphrase used to encrypt the wallet
820
+ - `provider`: Optional provider instance
821
+ - Returns: Wallet instance
822
+ - **Implementation**: Uses `deserializeEncryptedWallet()` from quantum-coin-js-sdk internally. If `deserializeEncryptedWallet()` returns null, throw an error.
823
+ - **Note**: This function can take up to a minute or so to execute. You should open wallets only from trusted sources.
824
+
825
+ #### `fromPhrase(phrase: string | string[], provider?: Provider): Wallet`
826
+ Creates a wallet from a seed phrase.
827
+ - `phrase`: Either:
828
+ - An array of seed words (string[])
829
+ - A space or comma delimited string containing seed words
830
+ - `provider`: Optional provider instance
831
+ - Returns: Wallet instance
832
+ - **Implementation**:
833
+ - If `phrase` is a string, split it by spaces or commas to create an array of words
834
+ - The resulting array must contain exactly 48 words
835
+ - Uses `openWalletFromSeedWords()` from quantum-coin-js-sdk internally with the array
836
+ - If `openWalletFromSeedWords()` returns null, throw an error
837
+
838
+ **Provider Usage**:
839
+ - The provider is optional in the constructor. If not provided, `provider` will be `null`.
840
+ - Methods that require blockchain access (`getBalance()`, `getTransactionCount()`, `sendTransaction()`) will throw an error if `provider` is `null`.
841
+ - Methods that only require signing (`signTransaction()`, `signMessageSync()`, `signTypedData()`) can work without a provider.
842
+ - The provider can be set later using the `connect(provider)` method.
843
+
844
+ **Methods**:
845
+
846
+ #### `getAddress(): string`
847
+ Returns the wallet address.
848
+ - Does not require a provider.
849
+
850
+ #### `getBalance(blockTag?: string): Promise<bigint>`
851
+ Returns wallet balance.
852
+ - `blockTag`: Optional block tag
853
+ - **Requires provider**: Throws error if `provider` is `null`.
854
+
855
+ #### `getTransactionCount(blockTag?: string): Promise<number>`
856
+ Returns wallet nonce.
857
+ - `blockTag`: Optional block tag
858
+ - **Requires provider**: Throws error if `provider` is `null`.
859
+
860
+ #### `sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>`
861
+ Signs and sends a transaction.
862
+ - `tx`: Transaction request (from, nonce, gasLimit will be auto-filled if not provided)
863
+ - **Requires provider**: Throws error if `provider` is `null`.
864
+ - 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.
865
+
866
+ #### `signTransaction(tx: TransactionRequest): Promise<string>`
867
+ Signs a transaction and returns the signed transaction data.
868
+ - `tx`: Transaction request
869
+ - **Does not require provider**: Can sign transactions offline.
870
+ - 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.
871
+
872
+ #### `signMessageSync(message: string | Uint8Array): string`
873
+ Signs a message and returns the signature (synchronous).
874
+ - `message`: Message to sign (string or bytes)
875
+ - Returns: Signature string
876
+ - **Does not require provider**: Can sign messages offline.
877
+ - **Implementation**: Uses quantum-coin-js-sdk for message signing
878
+
879
+ #### `encryptSync(password: string | Uint8Array): string`
880
+ Encrypts and serializes this wallet to a JSON string (synchronous).
881
+ - `password`: Passphrase used to encrypt the wallet (should be at least 12 characters long)
882
+ - Returns: Encrypted wallet JSON string
883
+ - **Implementation**: Uses `serializeEncryptedWallet()` from quantum-coin-js-sdk internally. If `serializeEncryptedWallet()` returns null, throw an error.
884
+ - **Note**: This method will block the event loop (freezing all UI) until it is complete, which may be a non-trivial duration. The encrypted JSON string is readable by Desktop/Mobile/Web/CLI wallet applications.
885
+
886
+ #### `connect(provider: Provider): Wallet`
887
+ Returns a new wallet instance connected to the provider.
888
+ - `provider`: Provider instance
889
+
890
+ ---
891
+
892
+ ## 3. Contract Classes
893
+
894
+ ### 3.2 Contract
895
+
896
+ **Purpose**: Represents a smart contract instance
897
+
898
+ **Extends**: BaseContract
899
+
900
+ **Note**: The API matches ethers.js v6 Contract. All methods, properties, and behavior follow the same patterns as ethers.js v6.
901
+
902
+ **Constructor**:
903
+ ```javascript
904
+ constructor(address: string, abi: Interface | AbiFragment[], providerOrSigner?: Provider | Signer, bytecode?: string)
905
+ ```
906
+ - `address`: Contract address (32 bytes)
907
+ - `abi`: Contract ABI (Interface or array of fragments)
908
+ - `providerOrSigner`: Provider or signer instance
909
+ - `bytecode`: Optional contract bytecode
910
+
911
+ **Properties**:
912
+ - `address`: string - Contract address
913
+ - `interface`: Interface - Contract interface
914
+ - `provider`: Provider | null - Provider instance
915
+ - `signer`: Signer | null - Signer instance
916
+ - `target: string | Addressable` - Contract target (address or addressable)
917
+ - `runner: ContractRunner | null` - Contract runner (provider or signer)
918
+ - `deployTransaction: ContractTransactionResponse | null` - Deployment transaction
919
+
920
+ **Methods**:
921
+
922
+ #### `getAddress(): string`
923
+ Returns contract address.
924
+
925
+ #### `[methodName](...args): Promise<any>`
926
+ Dynamic methods for each contract function.
927
+ - For view functions: Returns decoded return values
928
+ - For state-changing functions: Returns ContractTransactionResponse
929
+
930
+ #### `queryFilter(event: EventFragment, fromBlock?: number | string, toBlock?: number | string): Promise<EventLog[]>`
931
+ Queries event logs.
932
+ - `event`: Event fragment
933
+ - `fromBlock`: Start block
934
+ - `toBlock`: End block
935
+
936
+ #### `on(event: EventFragment | string, callback: Function): Contract`
937
+ Subscribes to contract events.
938
+ - `event`: Event fragment or name
939
+ - `callback`: Callback function
940
+
941
+ #### `once(event: EventFragment | string, callback: Function): Contract`
942
+ Subscribes to event once.
943
+ - `event`: Event fragment or name
944
+ - `callback`: Callback function
945
+
946
+ #### `removeListener(event: EventFragment | string, callback: Function): Contract`
947
+ Removes event listener.
948
+ - `event`: Event fragment or name
949
+ - `callback`: Callback function
950
+
951
+ #### `removeAllListeners(event?: EventFragment | string): Contract`
952
+ Removes all listeners.
953
+ - `event`: Optional event name
954
+
955
+ #### `connect(signerOrProvider: Signer | Provider): Contract`
956
+ Returns new contract instance connected to signer/provider.
957
+ - `signerOrProvider`: Signer or provider
958
+
959
+ #### `attach(address: string): Contract`
960
+ Returns new contract instance at different address.
961
+ - `address`: New contract address
962
+
963
+ #### `deployTransaction(): TransactionResponse | null`
964
+ Returns deployment transaction (if contract was deployed).
965
+
966
+ #### `getTransactionReceipt(hash: string): Promise<ContractTransactionReceipt | null>`
967
+ Gets contract transaction receipt.
968
+ - `hash`: Transaction hash
969
+ - Returns: ContractTransactionReceipt or null
970
+
971
+ #### `waitForDeployment(): Promise<this>`
972
+ Waits for contract deployment.
973
+ - Returns: Contract instance (this)
974
+
975
+ #### `getDeployedCode(): Promise<string | null>`
976
+ Gets deployed contract code.
977
+ - Returns: Contract bytecode or null if not deployed
978
+
979
+ #### `static from(target: string | Addressable, abi: Interface | AbiFragment[], runner?: ContractRunner): Contract`
980
+ Creates contract from target.
981
+ - `target`: Contract address or addressable
982
+ - `abi`: Contract ABI
983
+ - `runner`: Optional contract runner
984
+ - Returns: Contract instance
985
+
986
+ ---
987
+
988
+ ### 3.3 ContractFactory
989
+
990
+ **Purpose**: Factory for deploying contracts
991
+
992
+ **Note**: The API matches ethers.js v6 ContractFactory. All methods, properties, and behavior follow the same patterns as ethers.js v6.
993
+
994
+ **Constructor**:
995
+ ```javascript
996
+ constructor(abi: Interface | AbiFragment[], bytecode: string | BytesLike, signer?: Signer)
997
+ ```
998
+ - `abi`: Contract ABI
999
+ - `bytecode`: Contract bytecode
1000
+ - `signer`: Optional signer for deployment
1001
+
1002
+ **Methods**:
1003
+
1004
+ #### `getDeployTransaction(...args): TransactionRequest`
1005
+ Returns deployment transaction request.
1006
+ - `args`: Constructor arguments
1007
+
1008
+ #### `deploy(...args): Promise<Contract>`
1009
+ Deploys the contract.
1010
+ - `args`: Constructor arguments
1011
+ - Returns: Contract instance
1012
+
1013
+ #### `attach(address: string): Contract`
1014
+ Returns contract instance at address.
1015
+ - `address`: Contract address
1016
+
1017
+ #### `connect(signer: Signer): ContractFactory`
1018
+ Returns new factory connected to signer.
1019
+ - `signer`: Signer instance
1020
+
1021
+ ---
1022
+
1023
+ ### 3.4 ContractTransactionResponse
1024
+
1025
+ **Extends**: TransactionResponse
1026
+
1027
+ **Additional Methods**:
1028
+
1029
+ #### `wait(confirmations?: number): Promise<ContractTransactionReceipt>`
1030
+ Waits for transaction confirmation.
1031
+ - `confirmations`: Optional confirmations to wait for
1032
+
1033
+ ---
1034
+
1035
+ ### 3.5 ContractTransactionReceipt
1036
+
1037
+ **Extends**: TransactionReceipt
1038
+
1039
+ **Additional Methods**:
1040
+
1041
+ #### `getEvent(eventName: string): EventLog | null`
1042
+ Gets event log by name.
1043
+ - `eventName`: Event name
1044
+
1045
+ #### `getEvents(eventName: string): EventLog[]`
1046
+ Gets all event logs by name.
1047
+ - `eventName`: Event name
1048
+
1049
+ ---
1050
+
1051
+ ### 3.6 EventLog
1052
+
1053
+ **Extends**: Log
1054
+
1055
+ **Additional Properties**:
1056
+ - `eventName`: string - Event name
1057
+ - `args`: Result - Decoded event arguments
1058
+ - `fragment`: EventFragment - Event fragment
1059
+
1060
+ ---
1061
+
1062
+ ### 3.7 ContractEventPayload
1063
+
1064
+ **Purpose**: Represents a contract event payload
1065
+
1066
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1067
+
1068
+ ---
1069
+
1070
+ ### 3.8 ContractUnknownEventPayload
1071
+
1072
+ **Purpose**: Represents an unknown contract event payload
1073
+
1074
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1075
+
1076
+ ---
1077
+
1078
+ ### 3.9 EventPayload
1079
+
1080
+ **Purpose**: Base class for event payloads
1081
+
1082
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1083
+
1084
+ ---
1085
+
1086
+ ### 3.10 UndecodedEventLog
1087
+
1088
+ **Purpose**: Represents an undecoded event log
1089
+
1090
+ **Extends**: Log
1091
+
1092
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1093
+
1094
+ ---
1095
+
1096
+ ## 4. Interface and ABI Classes
1097
+
1098
+ ### 4.0 Fragment
1099
+
1100
+ **Purpose**: Base class for ABI fragments
1101
+
1102
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference. In quantumcoin.js, `AbiFragment` serves as the base fragment class.
1103
+
1104
+ ---
1105
+
1106
+ ### 4.0.1 NamedFragment
1107
+
1108
+ **Purpose**: Base class for named ABI fragments
1109
+
1110
+ **Extends**: Fragment
1111
+
1112
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1113
+
1114
+ ---
1115
+
1116
+ ### 4.1 Interface
1117
+
1118
+ **Purpose**: Represents contract ABI interface
1119
+
1120
+ **Note**: The API matches ethers.js v6 Interface. All methods, properties, and behavior follow the same patterns as ethers.js v6.
1121
+
1122
+ **Constructor**:
1123
+ ```javascript
1124
+ constructor(fragments: AbiFragment[] | string)
1125
+ ```
1126
+ - `fragments`: ABI fragments array or JSON string
1127
+
1128
+ **Properties**:
1129
+ - `fragments`: readonly AbiFragment[] - ABI fragments
1130
+
1131
+ **Methods**:
1132
+
1133
+ #### `getFunction(nameOrSignature: string): FunctionFragment`
1134
+ Gets function fragment by name or signature.
1135
+ - `nameOrSignature`: Function name or signature
1136
+
1137
+ #### `getEvent(nameOrSignature: string): EventFragment`
1138
+ Gets event fragment by name or signature.
1139
+ - `nameOrSignature`: Event name or signature
1140
+
1141
+ #### `encodeFunctionData(functionFragment: FunctionFragment | string, values: any[]): string`
1142
+ Encodes function call data.
1143
+ - `functionFragment`: Function fragment or signature
1144
+ - `values`: Function arguments
1145
+
1146
+ #### `decodeFunctionResult(functionFragment: FunctionFragment | string, data: string): Result`
1147
+ Decodes function result.
1148
+ - `functionFragment`: Function fragment or signature
1149
+ - `data`: Encoded result data
1150
+
1151
+ #### `encodeEventLog(eventFragment: EventFragment, values: any[]): { topics: string[], data: string }`
1152
+ Encodes event log.
1153
+ - `eventFragment`: Event fragment
1154
+ - `values`: Event values
1155
+ - **Implementation**: Uses `encodeEventLog()` from quantum-coin-js-sdk internally
1156
+ - Returns: Object with `topics` (string[]) and `data` (string)
1157
+
1158
+ #### `decodeEventLog(eventFragment: EventFragment, topics: string[], data: string): Result`
1159
+ Decodes event log.
1160
+ - `eventFragment`: Event fragment
1161
+ - `topics`: Event topics
1162
+ - `data`: Event data
1163
+ - **Implementation**: Uses `decodeEventLog()` from quantum-coin-js-sdk internally
1164
+ - Returns: Result object with decoded event arguments
1165
+
1166
+ #### `parseTransaction(data: string): TransactionDescription`
1167
+ Parses transaction data.
1168
+ - `data`: Transaction data
1169
+
1170
+ #### `parseLog(log: Log): LogDescription`
1171
+ Parses log data.
1172
+ - `log`: Log object
1173
+ - Returns: LogDescription with decoded event information
1174
+
1175
+ #### `getError(nameOrSignature: string): ErrorFragment`
1176
+ Gets error fragment by name or signature.
1177
+ - `nameOrSignature`: Error name or signature
1178
+ - Returns: ErrorFragment instance
1179
+
1180
+ #### `getConstructor(): ConstructorFragment | null`
1181
+ Gets constructor fragment.
1182
+ - Returns: ConstructorFragment instance or null if no constructor
1183
+
1184
+ #### `getFallback(): FunctionFragment | null`
1185
+ Gets fallback function fragment.
1186
+ - Returns: FunctionFragment instance or null if no fallback function
1187
+
1188
+ #### `getReceive(): FunctionFragment | null`
1189
+ Gets receive function fragment.
1190
+ - Returns: FunctionFragment instance or null if no receive function
1191
+
1192
+ #### `parseError(data: string): ErrorDescription`
1193
+ Parses error data.
1194
+ - `data`: Error data (hex string)
1195
+ - Returns: ErrorDescription with decoded error information
1196
+
1197
+ #### `getSighash(fragment: FunctionFragment | ErrorFragment | string): string`
1198
+ Gets function/error selector.
1199
+ - `fragment`: Function or error fragment or signature string
1200
+ - Returns: Function/error selector (4 bytes, 10 hex characters including 0x)
1201
+
1202
+ #### `getEventTopic(fragment: EventFragment | string): string`
1203
+ Gets event topic hash.
1204
+ - `fragment`: Event fragment or signature string
1205
+ - Returns: Event topic hash (32 bytes, 66 hex characters including 0x)
1206
+
1207
+ #### `format(format?: string): string`
1208
+ Formats interface as string.
1209
+ - `format`: Optional format type
1210
+ - Returns: Formatted interface string
1211
+
1212
+ #### `formatJson(): string`
1213
+ Formats interface as JSON string.
1214
+ - Returns: JSON string representation of interface
1215
+
1216
+ **Additional Properties**:
1217
+ - `deploy: ConstructorFragment | null` - Constructor fragment
1218
+ - `fallback: FallbackFragment | null` - Fallback function fragment
1219
+ - `receive: boolean` - Whether contract has receive function
1220
+
1221
+ ---
1222
+
1223
+ ### 4.2 AbiFragment
1224
+
1225
+ **Base Properties**:
1226
+ - `type`: string - Fragment type ("function", "event", "constructor", "fallback", "receive", "error")
1227
+ - `name`: string - Fragment name
1228
+ - `inputs`: AbiParameter[] - Input parameters
1229
+ - `outputs`: AbiParameter[] - Output parameters (for functions, not applicable for errors)
1230
+ - `signature`: string - Full signature of the fragment (e.g., "transfer(address,uint256)")
1231
+
1232
+ ---
1233
+
1234
+ ### 4.4 FunctionFragment
1235
+
1236
+ **Extends**: AbiFragment
1237
+
1238
+ **Note**: The API matches ethers.js v6 FunctionFragment.
1239
+
1240
+ **Additional Properties**:
1241
+ - `stateMutability`: string - "pure", "view", "nonpayable", "payable"
1242
+ - `constant`: boolean - Whether function is constant
1243
+ - `payable`: boolean - Whether function is payable
1244
+ - `selector`: string - Function selector (4 bytes, 10 hex characters including 0x)
1245
+
1246
+ **Methods**:
1247
+
1248
+ #### `format(format?: string): string`
1249
+ Formats fragment as string.
1250
+ - `format`: Optional format type
1251
+
1252
+ ---
1253
+
1254
+ ### 4.5 EventFragment
1255
+
1256
+ **Extends**: AbiFragment
1257
+
1258
+ **Note**: The API matches ethers.js v6 EventFragment.
1259
+
1260
+ **Additional Properties**:
1261
+ - `anonymous`: boolean - Whether event is anonymous
1262
+ - `topicHash`: string - Event topic hash (32 bytes, 66 hex characters including 0x)
1263
+
1264
+ **Methods**:
1265
+
1266
+ #### `format(format?: string): string`
1267
+ Formats fragment as string.
1268
+ - `format`: Optional format type
1269
+
1270
+ ---
1271
+
1272
+ ### 4.6 AbiParameter
1273
+
1274
+ **Note**: The API matches ethers.js v6 AbiParameter.
1275
+
1276
+ **Properties**:
1277
+ - `name`: string - Parameter name
1278
+ - `type`: string - Parameter type
1279
+ - `indexed`: boolean - Whether parameter is indexed (for events)
1280
+ - `components`: AbiParameter[] - Components (for structs/tuples)
1281
+
1282
+ ---
1283
+
1284
+ ### 4.7 TransactionDescription
1285
+
1286
+ **Note**: The API matches ethers.js v6 TransactionDescription.
1287
+
1288
+ **Properties**:
1289
+ - `name`: string - Function name
1290
+ - `signature`: string - Function signature
1291
+ - `args`: Result - Decoded arguments
1292
+ - `fragment`: FunctionFragment - Function fragment
1293
+
1294
+ ---
1295
+
1296
+ ### 4.8 LogDescription
1297
+
1298
+ **Note**: The API matches ethers.js v6 LogDescription.
1299
+
1300
+ **Properties**:
1301
+ - `name`: string - Event name
1302
+ - `signature`: string - Event signature
1303
+ - `args`: Result - Decoded arguments
1304
+ - `fragment`: EventFragment - Event fragment
1305
+
1306
+ ---
1307
+
1308
+ ### 4.9 ErrorFragment
1309
+
1310
+ **Extends**: AbiFragment
1311
+
1312
+ **Note**: The API matches ethers.js v6 ErrorFragment.
1313
+
1314
+ **Additional Properties**:
1315
+ - `type`: "error" - Fragment type
1316
+
1317
+ **Methods**:
1318
+
1319
+ #### `format(format?: string): string`
1320
+ Formats fragment as string.
1321
+ - `format`: Optional format type
1322
+
1323
+ ---
1324
+
1325
+ ### 4.10 ErrorDescription
1326
+
1327
+ **Note**: The API matches ethers.js v6 ErrorDescription.
1328
+
1329
+ **Properties**:
1330
+ - `name`: string - Error name
1331
+ - `signature`: string - Error signature
1332
+ - `args`: Result - Decoded error arguments
1333
+ - `fragment`: ErrorFragment - Error fragment
1334
+
1335
+ ---
1336
+
1337
+ ### 4.11 ConstructorFragment
1338
+
1339
+ **Extends**: AbiFragment
1340
+
1341
+ **Note**: The API matches ethers.js v6 ConstructorFragment.
1342
+
1343
+ **Additional Properties**:
1344
+ - `type`: "constructor" - Fragment type
1345
+ - `payable`: boolean - Whether constructor is payable
1346
+
1347
+ **Methods**:
1348
+
1349
+ #### `format(format?: string): string`
1350
+ Formats fragment as string.
1351
+ - `format`: Optional format type
1352
+
1353
+ ---
1354
+
1355
+ ### 4.11 ParamType
1356
+
1357
+ **Purpose**: Represents a parameter type in an ABI
1358
+
1359
+ **Constructor**:
1360
+ ```javascript
1361
+ constructor(fragment: string | ParamTypeLike)
1362
+ ```
1363
+ - `fragment`: Type string or ParamType-like object
1364
+
1365
+ **Properties**:
1366
+ - `type`: string - The base type (e.g., "uint256", "address", "tuple")
1367
+ - `baseType`: string - The base type without array or tuple components
1368
+ - `name`: string | null - Parameter name (if named)
1369
+ - `indexed`: boolean - Whether parameter is indexed (for events)
1370
+ - `components`: ParamType[] | null - Components for tuples/structs
1371
+ - `arrayLength`: number | null - Array length (null for dynamic arrays)
1372
+ - `arrayChildren`: ParamType | null - Type of array elements
1373
+
1374
+ **Methods**:
1375
+
1376
+ #### `format(format?: string): string`
1377
+ Formats the type as a string.
1378
+ - `format`: Optional format type ("full", "minimal", etc.)
1379
+
1380
+ #### `walk(fn: (type: ParamType) => void): void`
1381
+ Recursively walks the type tree, calling fn for each ParamType.
1382
+
1383
+ ---
1384
+
1385
+ ### 4.13 AbiCoder
1386
+
1387
+ **Note**: The API matches ethers.js v6 AbiCoder.
1388
+
1389
+ **Purpose**: Low-level ABI encoding and decoding utility
1390
+
1391
+ **Constructor**:
1392
+ ```javascript
1393
+ constructor()
1394
+ ```
1395
+
1396
+ **Methods**:
1397
+
1398
+ #### `encode(types: (string | ParamType)[], values: any[]): string`
1399
+ Encodes an array of values according to their types.
1400
+ - `types`: Array of type strings or ParamType instances
1401
+ - `values`: Array of values to encode
1402
+ - Returns: Encoded hex string
1403
+ - **Implementation**: Uses `packMethodData()` from quantum-coin-js-sdk internally
1404
+
1405
+ #### `decode(types: (string | ParamType)[], data: string, loose?: boolean): Result`
1406
+ Decodes encoded data according to types.
1407
+ - `types`: Array of type strings or ParamType instances
1408
+ - `data`: Encoded hex string
1409
+ - `loose`: Optional flag for loose decoding (handles older Solidity padding issues)
1410
+ - Returns: Result object with decoded values
1411
+ - **Implementation**: Uses `unpackMethodData()` from quantum-coin-js-sdk internally
1412
+
1413
+ #### `getDefaultValue(types: (string | ParamType)[]): Result`
1414
+ Returns the default values for the given types.
1415
+ - `types`: Array of type strings or ParamType instances
1416
+ - Returns: Result object with default values for each type
1417
+
1418
+ ---
1419
+
1420
+ ## 5. Utility Classes and Functions
1421
+
1422
+ ### 5.1 Result
1423
+
1424
+ **Purpose**: Represents decoded ABI data (array-like object with named properties)
1425
+
1426
+ **Extends**: Array
1427
+
1428
+ **Properties**:
1429
+ - Array indices for positional access
1430
+ - Named properties for named parameters
1431
+
1432
+ **Static Methods**:
1433
+
1434
+ #### `Result.fromItems(items: Array<any>, keys?: Array<null | string>): Result`
1435
+ Creates a new Result for items with each entry also accessible by its corresponding name in keys.
1436
+ - `items`: Array of values
1437
+ - `keys`: Optional array of keys (null for unnamed entries)
1438
+ - Returns: Result instance
1439
+
1440
+ **Methods**:
1441
+
1442
+ #### `getValue(name: string): any`
1443
+ Returns the value for name.
1444
+ - `name`: Property name
1445
+ - Returns: The value for the named property
1446
+ - **Note**: This method ensures all named values are accessible even if they conflict with Result methods or JavaScript keywords
1447
+
1448
+ #### `toArray(deep?: boolean): any[]`
1449
+ Converts to array.
1450
+ - `deep`: Optional flag to recursively convert nested Result objects
1451
+ - Returns: Normal array
1452
+ - **Note**: Throws if there are any outstanding deferred errors
1453
+
1454
+ #### `toObject(deep?: boolean): Record<string, any>`
1455
+ Converts to object.
1456
+ - `deep`: Optional flag to recursively convert nested Result objects
1457
+ - Returns: Object with name-value pairs
1458
+ - **Note**: Throws if any value is unnamed or if there are outstanding deferred errors
1459
+
1460
+ #### `checkResultErrors(result: Result): Array<{ error: Error, path: Array<string | number> }>`
1461
+ Returns all errors found in a Result.
1462
+ - `result`: Result instance to check
1463
+ - Returns: Array of error objects with error and path information
1464
+ - **Note**: Certain errors encountered when creating a Result are deferred until accessed. This function allows checking for all errors upfront.
1465
+
1466
+ ---
1467
+
1468
+ ### 5.2 BytesLike
1469
+
1470
+ **Type**: `string | Uint8Array | ArrayLike<number>`
1471
+
1472
+ ---
1473
+
1474
+ ### 5.3 BigNumberish
1475
+
1476
+ **Type**: `string | number | bigint`
1477
+
1478
+ ---
1479
+
1480
+ ### 5.3.1 AddressLike
1481
+
1482
+ **Type**: `string | Promise<string> | Addressable`
1483
+
1484
+ **Purpose**: Anything that can be used to return or resolve an address.
1485
+
1486
+ **Note**: For QuantumCoin, ENS (Ethereum Naming Service) is not applicable, so address resolution is limited to direct addresses and Addressable objects.
1487
+
1488
+ ---
1489
+
1490
+ ### 5.3.2 Typed Values
1491
+
1492
+ **Purpose**: Typed values provide type-safe encoding and validation for ABI parameters.
1493
+
1494
+ #### Typed (Base Class/Interface)
1495
+
1496
+ **Purpose**: Base class for all typed values.
1497
+
1498
+ **Static Methods**:
1499
+
1500
+ #### `Typed.isTyped(value: any): boolean`
1501
+ Returns true only if value is a Typed instance.
1502
+ - `value`: Value to check
1503
+ - Returns: `true` if value is a Typed instance
1504
+
1505
+ #### `Typed.dereference(value: Typed | T, type: string): T`
1506
+ If the value is a Typed instance, validates the underlying value and returns it, otherwise returns value directly.
1507
+ - `value`: Typed instance or value
1508
+ - `type`: Expected type string
1509
+ - Returns: The underlying value if Typed, otherwise the value itself
1510
+ - **Note**: Useful for functions that accept either a Typed object or values
1511
+
1512
+ **Methods**:
1513
+
1514
+ #### `format(): string`
1515
+ Format the type as a Human-Readable type.
1516
+ - Returns: Formatted type string
1517
+
1518
+ #### `defaultValue(): string | number | bigint | Result`
1519
+ The default value returned by this type.
1520
+ - Returns: Default value for the type
1521
+
1522
+ #### `isBigInt(): boolean`
1523
+ Returns true and provides a type guard if this is a TypedBigInt.
1524
+ - Returns: `true` if this is a TypedBigInt
1525
+
1526
+ #### `isData(): boolean`
1527
+ Returns true and provides a type guard if this is a TypedData.
1528
+ - Returns: `true` if this is a TypedData
1529
+
1530
+ #### `isString(): boolean`
1531
+ Returns true and provides a type guard if this is a TypedString.
1532
+ - Returns: `true` if this is a TypedString
1533
+
1534
+ #### TypedBigInt Interface
1535
+
1536
+ **Extends**: Typed
1537
+
1538
+ **Purpose**: A Typed that represents a numeric value.
1539
+
1540
+ **Properties**:
1541
+ - `value`: bigint - The numeric value
1542
+
1543
+ **Methods**:
1544
+
1545
+ #### `defaultValue(): bigint`
1546
+ The default value for all numeric types is 0.
1547
+
1548
+ #### `maxValue(): bigint`
1549
+ The maximum value for this type, accounting for bit-width.
1550
+
1551
+ #### `minValue(): bigint`
1552
+ The minimum value for this type, accounting for bit-width and signed-ness.
1553
+
1554
+ **Static Methods**: Typed provides static methods for creating typed values:
1555
+
1556
+ **Numeric Types**:
1557
+ - `Typed.uint8(v: BigNumberish): Typed`
1558
+ - `Typed.uint256(v: BigNumberish): Typed`
1559
+ - `Typed.int8(v: BigNumberish): Typed`
1560
+ - `Typed.int256(v: BigNumberish): Typed`
1561
+ - And all other uint/int variants (uint8 through uint256, int8 through int256)
1562
+
1563
+ **Other Types**:
1564
+ - `Typed.address(v: string): Typed` - Creates a typed address
1565
+ - `Typed.bool(v: boolean): Typed` - Creates a typed boolean
1566
+ - `Typed.bytes(v: BytesLike, length?: number): Typed` - Creates typed bytes (length optional for dynamic bytes)
1567
+ - `Typed.string(v: string): Typed` - Creates a typed string
1568
+ - `Typed.array(v: any[], type: string): Typed` - Creates a typed array
1569
+ - `Typed.tuple(v: any[], types: string[]): Typed` - Creates a typed tuple
1570
+
1571
+ #### TypedData Interface
1572
+
1573
+ **Extends**: Typed
1574
+
1575
+ **Purpose**: A Typed that represents a binary sequence of data as bytes.
1576
+
1577
+ **Properties**:
1578
+ - `value`: string - The hex string value
1579
+
1580
+ **Methods**:
1581
+
1582
+ #### `defaultValue(): string`
1583
+ The default value for this type (empty hex string "0x").
1584
+
1585
+ #### TypedString Interface
1586
+
1587
+ **Extends**: Typed
1588
+
1589
+ **Purpose**: A Typed that represents a UTF-8 sequence of bytes.
1590
+
1591
+ **Properties**:
1592
+ - `value`: string - The string value
1593
+
1594
+ **Methods**:
1595
+
1596
+ #### `defaultValue(): string`
1597
+ The default value for the string type is the empty string (i.e. "").
1598
+
1599
+ **Note**: Typed values are primarily used for type-safe ABI encoding. For QuantumCoin, these should work with quantum-coin-js-sdk's ABI encoding functions.
1600
+
1601
+ ---
1602
+
1603
+ ### 5.3.3 BlockTag
1604
+
1605
+ **Type**: `number | "latest" | "pending" | "earliest"`
1606
+
1607
+ **Purpose**: Represents a block identifier for queries.
1608
+
1609
+ **Values**:
1610
+ - `number`: Specific block number
1611
+ - `"latest"`: Latest block (default)
1612
+ - `"pending"`: Pending block (mempool)
1613
+ - `"earliest"`: Earliest block (genesis)
1614
+
1615
+ ---
1616
+
1617
+ ### 5.3.4 ProviderEventFilter
1618
+
1619
+ **Type**: `{ address?: string | string[], topics?: (string | string[] | null)[] }`
1620
+
1621
+ **Purpose**: Filter for provider events (blocks, transactions, logs).
1622
+
1623
+ **Properties**:
1624
+ - `address`: Optional contract address(es) to filter
1625
+ - `topics`: Optional event topics to filter
1626
+
1627
+ ---
1628
+
1629
+ ### 5.3.5 EventFilter
1630
+
1631
+ **Type**: `Filter`
1632
+
1633
+ **Purpose**: Alias for Filter type, used for event filtering.
1634
+
1635
+ **Note**: This is the same as the Filter type defined in Section 1.7.
1636
+
1637
+ ---
1638
+
1639
+ ### 5.3.6 SigningKey
1640
+
1641
+ **Purpose**: Represents a signing key used for cryptographic operations
1642
+
1643
+ **Constructor**:
1644
+ ```javascript
1645
+ constructor(privateKey: string | Uint8Array)
1646
+ ```
1647
+ - `privateKey`: Private key as hex string or byte array
1648
+
1649
+ **Properties**:
1650
+ - `privateKey`: string - Private key as hex string
1651
+ - `publicKey`: string - Public key
1652
+
1653
+ **Methods**:
1654
+
1655
+ #### `sign(digest: BytesLike): Signature`
1656
+ Signs a message digest.
1657
+ - `digest`: Message digest to sign
1658
+ - Returns: Signature object
1659
+
1660
+ **Note**: SigningKey is used internally by BaseWallet and Wallet for signing operations. Can be created from a private key and used in Wallet constructor. The API matches ethers.js v6 SigningKey.
1661
+
1662
+ ---
1663
+
1664
+ ### 5.3.7 Signature
1665
+
1666
+ **Purpose**: Represents a cryptographic signature
1667
+
1668
+ **Properties**:
1669
+ - `r`: string - R component of signature (hex string)
1670
+ - `s`: string - S component of signature (hex string)
1671
+ - `v`: number - Recovery ID (0 or 1)
1672
+
1673
+ **Methods**:
1674
+
1675
+ #### `serialize(): string`
1676
+ Serializes signature to compact format.
1677
+ - Returns: Serialized signature hex string
1678
+
1679
+ **Static Methods**:
1680
+
1681
+ #### `Signature.from(signature: string | SignatureLike): Signature`
1682
+ Creates a Signature from various formats.
1683
+ - `signature`: Signature string, object, or Signature instance
1684
+ - Returns: Signature instance
1685
+
1686
+ **Note**: The API matches ethers.js v6 Signature, with QuantumCoin-specific simplifications (removed network-specific fields and legacy conversion methods).
1687
+
1688
+ ---
1689
+
1690
+ ### 5.3.8 Transaction
1691
+
1692
+ **Purpose**: Represents a transaction object
1693
+
1694
+ **Type**: Interface/Class
1695
+
1696
+ **Properties**:
1697
+ - `to`: string | null - Recipient address (null for contract creation)
1698
+ - `from`: string | null - Sender address (null if not specified)
1699
+ - `nonce`: number | null - Transaction nonce
1700
+ - `gasLimit`: bigint | null - Gas limit
1701
+ - `gasPrice`: bigint | null - Gas price
1702
+ - `value`: bigint | null - Transaction value in wei
1703
+ - `data`: string | null - Transaction data (hex string)
1704
+ - `chainId`: bigint | null - Chain ID
1705
+ - `hash`: string | null - Transaction hash
1706
+ - `type`: number | null - Transaction type
1707
+ - `accessList`: Array<{ address: string, storageKeys: string[] }> | null - Access list (EIP-2930)
1708
+
1709
+ **Methods**:
1710
+
1711
+ #### `serialize(): string`
1712
+ Serializes transaction to hex string.
1713
+ - Returns: Serialized transaction hex string
1714
+
1715
+ #### `unsignedHash(): string`
1716
+ Computes hash of unsigned transaction.
1717
+ - Returns: Transaction hash (32 bytes, 66 hex characters including 0x)
1718
+
1719
+ **Static Methods**:
1720
+
1721
+ #### `Transaction.from(tx: string | TransactionLike): Transaction`
1722
+ Creates a Transaction from various formats.
1723
+ - `tx`: Transaction string, object, or Transaction instance
1724
+ - Returns: Transaction instance
1725
+
1726
+ **Note**: The API matches ethers.js v6 Transaction. For QuantumCoin, transaction structure follows QuantumCoin conventions.
1727
+
1728
+ ---
1729
+
1730
+ ### 5.3.9 Indexed
1731
+
1732
+ **Purpose**: Type guard/interface for indexed event parameters
1733
+
1734
+ **Note**: This interface/type is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1735
+
1736
+ ---
1737
+
1738
+ ### 5.3.9.1 TypedDataEncoder
1739
+
1740
+ **Purpose**: Encoder for EIP-712 typed data
1741
+
1742
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1743
+
1744
+ **Type**: `{ indexed: true, hash?: string }`
1745
+
1746
+ **Purpose**: Used to mark event parameters as indexed. When an event parameter is indexed, it is hashed and stored in the topics array of the log.
1747
+
1748
+ **Note**: The API matches ethers.js v6 Indexed type. This is used in event filtering and decoding.
1749
+
1750
+ ---
1751
+
1752
+ ### 5.3.10 KeystoreAccount
1753
+
1754
+ **Type**: `{ address: string, mnemonic?: { entropy: string }, privateKey: string }`
1755
+
1756
+ **Purpose**: Contents of a JSON Keystore Wallet
1757
+
1758
+ **Properties**:
1759
+ - `address`: string - Wallet address
1760
+ - `privateKey`: string - Private key as hex string
1761
+ - `mnemonic?`: Optional object containing:
1762
+ - `entropy`: string - Mnemonic entropy
1763
+
1764
+ **Note**: Used by `encryptKeystoreJsonSync()` and `decryptKeystoreJsonSync()` functions. For QuantumCoin, the mnemonic field is optional and may contain entropy for 48-word phrases.
1765
+
1766
+ ---
1767
+
1768
+ ### 5.4 Address Utilities
1769
+
1770
+ #### `isAddress(address: string): boolean`
1771
+ Checks if string is a valid address (32 bytes, 66 hex characters).
1772
+ - `address`: String to validate
1773
+ - Returns: `true` if valid address, `false` otherwise
1774
+
1775
+ #### `getAddress(address: string): string`
1776
+ Returns checksummed address (normalized for QuantumCoin).
1777
+ - `address`: Address string to normalize
1778
+ - Returns: Normalized and checksummed address (32 bytes, 66 hex characters)
1779
+ - **Note**: For QuantumCoin, address checksumming follows QuantumCoin conventions (not Ethereum EIP-55)
1780
+
1781
+ #### `isAddressable(value: any): boolean`
1782
+ Returns true if value is an object which implements the Addressable interface.
1783
+ - `value`: Value to check
1784
+ - Returns: `true` if value implements Addressable interface
1785
+ - **Note**: Wallets, Signers, and Contracts implement Addressable
1786
+
1787
+ #### `resolveAddress(target: AddressLike): string | Promise<string>`
1788
+ Resolves to an address for the target, which may be any supported address type, an Addressable or a Promise which resolves to an address.
1789
+ - `target`: Address string, Addressable object, or Promise resolving to address
1790
+ - Returns: Address string (synchronously) or Promise resolving to address string
1791
+ - **Note**: For QuantumCoin, ENS resolution is not supported. Only direct addresses and Addressable objects are supported.
1792
+
1793
+ #### `getContractAddress(tx: { from: string, nonce: number }): string`
1794
+ Calculates contract address from deployer and nonce.
1795
+ - **Implementation**: Uses `createAddress()` from quantum-coin-js-sdk internally
1796
+ - `tx.from`: Deployer address (32 bytes, 66 hex characters)
1797
+ - `tx.nonce`: Deployer nonce (number)
1798
+ - Returns: Contract address (32 bytes, 66 hex characters)
1799
+
1800
+ #### `getCreateAddress(tx: { from: string, nonce: number }): string`
1801
+ Gets CREATE address (alias for getContractAddress).
1802
+ - `tx.from`: Deployer address
1803
+ - `tx.nonce`: Deployer nonce
1804
+ - Returns: Contract address
1805
+
1806
+ #### `getCreate2Address(from: string, salt: string, initCodeHash: string): string`
1807
+ Calculates CREATE2 contract address.
1808
+ - **Implementation**: Uses `createAddress2()` from quantum-coin-js-sdk internally
1809
+ - `from`: Deployer address (32 bytes, 66 hex characters)
1810
+ - `salt`: Salt value (hex string)
1811
+ - `initCodeHash`: Hash of initialization code (hex string)
1812
+ - Returns: CREATE2 contract address (32 bytes, 66 hex characters)
1813
+
1814
+ #### `computeAddress(key: string | Uint8Array): string`
1815
+ Computes address from public key.
1816
+ - `key`: Public key as hex string or byte array
1817
+ - Returns: Computed address (32 bytes, 66 hex characters including 0x)
1818
+ - **Implementation**: Uses quantum-coin-js-sdk's `addressFromPublicKey()` internally
1819
+
1820
+ #### `verifyMessage(message: string | Uint8Array, signature: string): string`
1821
+ Verifies a message signature and recovers the address.
1822
+ - `message`: Message that was signed
1823
+ - `signature`: Signature to verify (hex string)
1824
+ - Returns: Address that signed the message
1825
+ - **Implementation**: Uses quantum-coin-js-sdk for signature verification
1826
+
1827
+ #### `recoverAddress(message: string | Uint8Array, signature: string): string`
1828
+ Recovers the address from a message signature.
1829
+ - `message`: Message that was signed
1830
+ - `signature`: Signature (hex string)
1831
+ - Returns: Address that signed the message
1832
+ - **Implementation**: Uses quantum-coin-js-sdk for signature recovery
1833
+
1834
+ ### 5.4.1 Addressable Interface
1835
+
1836
+ **Purpose**: An interface for objects which have an address, and can resolve it asynchronously.
1837
+
1838
+ **Methods**:
1839
+
1840
+ #### `getAddress(): Promise<string>`
1841
+ Get the object address.
1842
+ - Returns: Promise resolving to the address string
1843
+
1844
+ **Note**: Wallets, Signers, and Contracts implement this interface, allowing them to be used anywhere an address is expected.
1845
+
1846
+ ---
1847
+
1848
+ ### 5.5 Encoding/Decoding Utilities
1849
+
1850
+ #### `toUtf8String(data: BytesLike): string`
1851
+ Converts bytes to UTF-8 string.
1852
+
1853
+ #### `toUtf8Bytes(str: string): Uint8Array`
1854
+ Converts string to UTF-8 bytes.
1855
+
1856
+ #### `toHex(data: BytesLike): string`
1857
+ Converts data to hex string.
1858
+
1859
+ #### `hexlify(data: BytesLike): string`
1860
+ Converts data to hex string (alias for toHex).
1861
+
1862
+ #### `arrayify(data: BytesLike): Uint8Array`
1863
+ Converts data to byte array.
1864
+
1865
+ #### `concat(items: BytesLike[]): string`
1866
+ Concatenates byte arrays.
1867
+
1868
+ #### `stripZerosLeft(data: BytesLike): string`
1869
+ Strips leading zeros from hex string.
1870
+
1871
+ #### `encodeBytes32String(text: string): string`
1872
+ Encodes text as a Bytes32 string.
1873
+ - `text`: Text string to encode
1874
+ - Returns: Hex string (32 bytes, 66 hex characters including 0x)
1875
+ - **Note**: Text is padded or truncated to exactly 32 bytes
1876
+
1877
+ #### `decodeBytes32String(bytes: BytesLike): string`
1878
+ Decodes the Bytes32-encoded bytes into a string.
1879
+ - `bytes`: Bytes32-encoded data (hex string or bytes)
1880
+ - Returns: Decoded text string
1881
+ - **Note**: Removes null padding from the decoded string
1882
+
1883
+ #### `decodeBase58(data: string): Uint8Array`
1884
+ Decodes Base58-encoded data.
1885
+
1886
+ **Note**: This function is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1887
+
1888
+ ---
1889
+
1890
+ #### `decodeBase64(data: string): Uint8Array`
1891
+ Decodes Base64-encoded data.
1892
+
1893
+ **Note**: This function is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1894
+
1895
+ ---
1896
+
1897
+ #### `encodeBase58(data: BytesLike): string`
1898
+ Encodes data to Base58 string.
1899
+
1900
+ **Note**: This function is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1901
+
1902
+ ---
1903
+
1904
+ #### `encodeBase64(data: BytesLike): string`
1905
+ Encodes data to Base64 string.
1906
+
1907
+ **Note**: This function is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1908
+
1909
+ ---
1910
+
1911
+ #### `toUtf8CodePoints(str: string): number[]`
1912
+ Converts string to UTF-8 code points array.
1913
+
1914
+ **Note**: This function is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
1915
+
1916
+ ---
1917
+
1918
+ #### `isHexString(value: any, length?: number): boolean`
1919
+ Checks if value is a valid hex string.
1920
+ - `value`: Value to check
1921
+ - `length`: Optional expected length in bytes
1922
+ - Returns: `true` if value is a valid hex string, `false` otherwise
1923
+
1924
+ #### `isBytesLike(value: any): boolean`
1925
+ Checks if value is bytes-like (string, Uint8Array, or ArrayLike<number>).
1926
+ - `value`: Value to check
1927
+ - Returns: `true` if value is bytes-like, `false` otherwise
1928
+
1929
+ #### `zeroPad(value: BytesLike, length: number): string`
1930
+ Zero-pads a value to the specified length.
1931
+ - `value`: Value to pad
1932
+ - `length`: Target length in bytes
1933
+ - Returns: Zero-padded hex string
1934
+
1935
+ #### `zeroPadValue(value: BytesLike, length: number): string`
1936
+ Zero-pads a value to the specified length (left-pads).
1937
+ - `value`: Value to pad
1938
+ - `length`: Target length in bytes
1939
+ - Returns: Zero-padded hex string
1940
+
1941
+ #### `solidityPacked(types: string[], values: any[]): string`
1942
+ Encodes values using Solidity's packed encoding (no padding, tightly packed).
1943
+ - `types`: Array of Solidity type strings
1944
+ - `values`: Array of values to encode
1945
+ - Returns: Packed encoded hex string
1946
+ - **Note**: This is different from ABI encoding - values are tightly packed without padding
1947
+
1948
+ #### `solidityPackedKeccak256(types: string[], values: any[]): string`
1949
+ Encodes values using Solidity's packed encoding and computes keccak256 hash.
1950
+ - `types`: Array of Solidity type strings
1951
+ - `values`: Array of values to encode
1952
+ - Returns: Keccak256 hash of packed encoding (32 bytes, 66 hex characters including 0x)
1953
+
1954
+ #### `solidityPackedSha256(types: string[], values: any[]): string`
1955
+ Encodes values using Solidity's packed encoding and computes SHA-256 hash.
1956
+ - `types`: Array of Solidity type strings
1957
+ - `values`: Array of values to encode
1958
+ - Returns: SHA-256 hash of packed encoding (32 bytes, 66 hex characters including 0x)
1959
+
1960
+ ---
1961
+
1962
+ ### 5.6 BigNumber Utilities
1963
+
1964
+ #### `formatUnits(value: BigNumberish, decimals?: number): string`
1965
+ Formats value with decimals.
1966
+
1967
+ #### `parseUnits(value: string, decimals?: number): bigint`
1968
+ Parses value with decimals.
1969
+
1970
+ #### `formatEther(value: BigNumberish): string`
1971
+ Formats wei to ether (18 decimals).
1972
+
1973
+ #### `parseEther(value: string): bigint`
1974
+ Parses ether to wei (18 decimals).
1975
+
1976
+ ---
1977
+
1978
+ ### 5.7 Hash Utilities
1979
+
1980
+ #### `keccak256(data: BytesLike): string`
1981
+ Computes Keccak-256 hash.
1982
+ - `data`: Data to hash
1983
+ - Returns: Hex string (32 bytes, 66 hex characters including 0x)
1984
+
1985
+ #### `sha256(data: BytesLike): string`
1986
+ Computes SHA-256 hash.
1987
+ - `data`: Data to hash
1988
+ - Returns: Hex string (32 bytes, 66 hex characters including 0x)
1989
+
1990
+ #### `ripemd160(data: BytesLike): string`
1991
+ Computes RIPEMD-160 hash.
1992
+ - `data`: Data to hash
1993
+ - Returns: Hex string (20 bytes, 42 hex characters including 0x)
1994
+
1995
+ #### `id(text: string): string`
1996
+ Creates a keccak256 hash of a string (commonly used for function selectors).
1997
+ - `text`: Text string to hash
1998
+ - Returns: Hex string (32 bytes, 66 hex characters including 0x)
1999
+ - **Note**: This is equivalent to `keccak256(toUtf8Bytes(text))`
2000
+
2001
+ #### `sha512(data: BytesLike): string`
2002
+ Computes SHA-512 hash.
2003
+ - `data`: Data to hash
2004
+ - Returns: Hex string (64 bytes, 130 hex characters including 0x)
2005
+
2006
+ ---
2007
+
2008
+ ### 5.8 Random Utilities
2009
+
2010
+ #### `randomBytes(length: number): Uint8Array`
2011
+ Generates random bytes.
2012
+ - `length`: Number of random bytes to generate
2013
+ - Returns: Uint8Array containing random bytes
2014
+ - **Implementation**: Uses Node.js `crypto.randomBytes()` for Node.js environments. For browser environments, uses `crypto.getRandomValues()` from the Web Crypto API.
2015
+
2016
+ #### `computeHmac(algorithm: string, key: BytesLike, data: BytesLike): string`
2017
+ Computes HMAC (Hash-based Message Authentication Code).
2018
+ - `algorithm`: Hash algorithm to use (e.g., "sha256", "sha512")
2019
+ - `key`: Secret key for HMAC computation
2020
+ - `data`: Data to compute HMAC for
2021
+ - Returns: HMAC as hex string
2022
+ - **Implementation**: Uses Node.js `crypto.createHmac()` for Node.js environments. For browser environments, uses Web Crypto API's `crypto.subtle.sign()` with HMAC algorithm.
2023
+ - **Supported algorithms**: "sha256", "sha512" (and other algorithms supported by the underlying crypto implementation)
2024
+
2025
+ #### `pbkdf2(password: BytesLike, salt: BytesLike, iterations: number, keylen: number, algorithm?: string): string`
2026
+ Derives a key using PBKDF2 (Password-Based Key Derivation Function 2).
2027
+ - `password`: Password to derive key from
2028
+ - `salt`: Salt value (should be random bytes)
2029
+ - `iterations`: Number of iterations (higher is more secure but slower)
2030
+ - `keylen`: Desired key length in bytes
2031
+ - `algorithm`: Hash algorithm to use (default: "sha256")
2032
+ - Returns: Derived key as hex string
2033
+ - **Implementation**: Uses Node.js `crypto.pbkdf2Sync()` for Node.js environments. For browser environments, uses Web Crypto API's `crypto.subtle.deriveBits()` with PBKDF2 algorithm.
2034
+ - **Note**: This is a synchronous function that may block the event loop for a significant duration depending on the number of iterations.
2035
+
2036
+ #### `scrypt(password: BytesLike, salt: BytesLike, N: number, r: number, p: number, dkLen: number): string`
2037
+ Derives a key using scrypt key derivation function.
2038
+ - `password`: Password to derive key from
2039
+ - `salt`: Salt value (should be random bytes)
2040
+ - `N`: CPU/memory cost parameter (must be a power of 2, e.g., 16384, 32768)
2041
+ - `r`: Block size parameter (typically 8)
2042
+ - `p`: Parallelization parameter (typically 1)
2043
+ - `dkLen`: Desired key length in bytes
2044
+ - Returns: Derived key as hex string
2045
+ - **Implementation**: Uses Node.js `crypto.scryptSync()` for Node.js environments. For browser environments, may require a polyfill or WebAssembly implementation as Web Crypto API does not support scrypt natively.
2046
+ - **Note**: This is a synchronous function that may block the event loop for a significant duration depending on the parameters (especially N). scrypt is memory-hard and computationally expensive, making it resistant to hardware-accelerated attacks.
2047
+
2048
+ #### `scryptSync(password: BytesLike, salt: BytesLike, N: number, r: number, p: number, dkLen: number): string`
2049
+ Synchronous version of scrypt key derivation.
2050
+
2051
+ **Note**: This function is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference. The `scrypt()` function in quantumcoin.js is already synchronous.
2052
+
2053
+ ---
2054
+
2055
+ ### 5.9 RLP Encoding
2056
+
2057
+ #### `encodeRlp(value: any): string`
2058
+ Encodes value using RLP.
2059
+
2060
+ #### `decodeRlp(data: string): any`
2061
+ Decodes RLP data.
2062
+
2063
+ ---
2064
+
2065
+ ### 5.10 Provider Utility Functions
2066
+
2067
+ #### `copyRequest(req: TransactionRequest): PreparedTransactionRequest`
2068
+ Returns a copy of req with all properties coerced to their strict types.
2069
+ - `req`: Transaction request to copy
2070
+ - Returns: PreparedTransactionRequest with normalized properties
2071
+
2072
+ #### `getDefaultProvider(network?: Networkish, options?: any): FallbackProvider`
2073
+ Gets default provider.
2074
+ - `network`: Optional network identifier
2075
+ - `options`: Optional provider options
2076
+ - Returns: FallbackProvider instance
2077
+
2078
+ #### `showThrottleMessage(): void`
2079
+ Shows throttle message.
2080
+ - **Note**: Internal utility for rate limiting messages
2081
+
2082
+ #### `accessListify(accessList: any[]): Array<{address: string, storageKeys: string[]}>`
2083
+ Normalizes access list.
2084
+ - `accessList`: Access list to normalize
2085
+ - Returns: Normalized access list
2086
+
2087
+ ---
2088
+
2089
+ ### 5.11 JSON Wallet Utilities
2090
+
2091
+ #### `isKeystoreJson(json: string): boolean`
2092
+ Returns true if json is a valid JSON Keystore Wallet.
2093
+ - `json`: JSON string to validate
2094
+ - Returns: `true` if valid keystore JSON, `false` otherwise
2095
+
2096
+ #### `encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array): string`
2097
+ Returns a JSON Keystore Wallet for account encrypted with password (synchronous).
2098
+ - `account`: KeystoreAccount object with address, privateKey, and optional mnemonic
2099
+ - `password`: Password for encryption
2100
+ - Returns: Encrypted JSON Keystore Wallet string
2101
+ - **Implementation**: Uses `serializeEncryptedWallet()` from quantum-coin-js-sdk internally
2102
+ - **Note**: This method will block the event loop until encryption is complete. Uses default encryption parameters.
2103
+
2104
+ #### `decryptKeystoreJsonSync(json: string, password: string | Uint8Array): KeystoreAccount`
2105
+ Returns account details for JSON Keystore Wallet using password (synchronous).
2106
+ - `json`: JSON Keystore Wallet string
2107
+ - `password`: Password for decryption
2108
+ - Returns: KeystoreAccount object with address, privateKey, and optional mnemonic
2109
+ - **Implementation**: Uses `deserializeEncryptedWallet()` from quantum-coin-js-sdk internally
2110
+ - **Note**: This method will block the event loop until decryption is complete, which may take some time.
2111
+
2112
+ ---
2113
+
2114
+ ### 5.12 Mnemonic
2115
+
2116
+ **Purpose**: Wraps all properties required to compute seeds and convert between phrases and entropy
2117
+
2118
+ **Properties**:
2119
+ - `entropy`: string (read-only) - The underlying entropy which the mnemonic encodes
2120
+ - `password`: string (read-only) - The password used for this mnemonic (empty string if no password)
2121
+ - `phrase`: string (read-only) - The mnemonic phrase (48 words for QuantumCoin)
2122
+ - `wordlist`: Wordlist (read-only) - The wordlist for this mnemonic
2123
+ - **Note**: Wordlist is a type representing a list of words used for mnemonic generation. For QuantumCoin, a 48-word wordlist is used. The API matches ethers.js v6 Mnemonic, with QuantumCoin-specific simplifications (removed locale and path fields).
2124
+
2125
+ ---
2126
+
2127
+ ### 5.13 Wordlist
2128
+
2129
+ **Purpose**: Represents a wordlist for mnemonic phrase generation
2130
+
2131
+ **Note**: This is an abstract base class/interface. For QuantumCoin, the `seed-words` library (a dependency of quantum-coin-js-sdk) is used internally for wordlist operations.
2132
+
2133
+ **Properties**:
2134
+ - `locale`: string - Locale identifier for the wordlist
2135
+
2136
+ **Methods**:
2137
+
2138
+ #### `getWord(index: number): string`
2139
+ Returns the word at the specified index.
2140
+ - `index`: Word index (0-based)
2141
+ - Returns: Word string
2142
+
2143
+ #### `getWordIndex(word: string): number`
2144
+ Returns the index of the specified word.
2145
+ - `word`: Word to find
2146
+ - Returns: Word index, or -1 if not found
2147
+
2148
+ #### `split(mnemonic: string): Array<string>`
2149
+ Splits a mnemonic phrase into individual words.
2150
+ - `mnemonic`: Mnemonic phrase string
2151
+ - Returns: Array of word strings
2152
+
2153
+ #### `join(words: Array<string>): string`
2154
+ Joins words into a mnemonic phrase.
2155
+ - `words`: Array of word strings
2156
+ - Returns: Mnemonic phrase string
2157
+
2158
+ **Static Methods**:
2159
+
2160
+ #### `Wordlist.check(wordlist: Wordlist): Wordlist`
2161
+ Validates a wordlist.
2162
+ - `wordlist`: Wordlist instance to validate
2163
+ - Returns: Validated wordlist
2164
+
2165
+ **Note**: The API matches ethers.js v6 Wordlist. For QuantumCoin, the `seed-words` library is used internally for all wordlist operations, including word lookup, validation, and phrase generation/parsing.
2166
+
2167
+ ---
2168
+
2169
+ ### 5.14 Number Utilities
2170
+
2171
+ #### `fromTwos(value: bigint, width: number): bigint`
2172
+ Converts from two's complement.
2173
+ - `value`: Value to convert
2174
+ - `width`: Bit width
2175
+ - Returns: Converted value
2176
+
2177
+ #### `toTwos(value: bigint, width: number): bigint`
2178
+ Converts to two's complement.
2179
+ - `value`: Value to convert
2180
+ - `width`: Bit width
2181
+ - Returns: Converted value
2182
+
2183
+ #### `mask(value: bigint, bits: number): bigint`
2184
+ Masks bits.
2185
+ - `value`: Value to mask
2186
+ - `bits`: Number of bits
2187
+ - Returns: Masked value
2188
+
2189
+ #### `getBigInt(value: any, name?: string): bigint`
2190
+ Gets bigint value.
2191
+ - `value`: Value to convert
2192
+ - `name`: Optional parameter name for error messages
2193
+ - Returns: Bigint value
2194
+
2195
+ #### `getUint(value: any, name?: string): number`
2196
+ Gets uint value.
2197
+ - `value`: Value to convert
2198
+ - `name`: Optional parameter name for error messages
2199
+ - Returns: Unsigned integer value
2200
+
2201
+ #### `getNumber(value: any, name?: string): number`
2202
+ Gets number value.
2203
+ - `value`: Value to convert
2204
+ - `name`: Optional parameter name for error messages
2205
+ - Returns: Number value
2206
+
2207
+ #### `toBigInt(value: any): bigint`
2208
+ Converts to bigint.
2209
+ - `value`: Value to convert
2210
+ - Returns: Bigint value
2211
+
2212
+ #### `toNumber(value: any): number`
2213
+ Converts to number.
2214
+ - `value`: Value to convert
2215
+ - Returns: Number value
2216
+
2217
+ #### `toBeHex(value: any, width?: number): string`
2218
+ Converts to hex with width.
2219
+ - `value`: Value to convert
2220
+ - `width`: Optional byte width
2221
+ - Returns: Hex string
2222
+
2223
+ #### `toBeArray(value: any, width?: number): Uint8Array`
2224
+ Converts to array with width.
2225
+ - `value`: Value to convert
2226
+ - `width`: Optional byte width
2227
+ - Returns: Byte array
2228
+
2229
+ #### `toQuantity(value: any): string`
2230
+ Converts to quantity format.
2231
+ - `value`: Value to convert
2232
+ - Returns: Quantity string
2233
+
2234
+ ---
2235
+
2236
+ ### 5.15 Bytes Utilities
2237
+
2238
+ #### `getBytes(value: any, name?: string): Uint8Array`
2239
+ Gets bytes.
2240
+ - `value`: Value to convert
2241
+ - `name`: Optional parameter name for error messages
2242
+ - Returns: Byte array
2243
+
2244
+ #### `getBytesCopy(value: any, name?: string): Uint8Array`
2245
+ Gets bytes copy.
2246
+ - `value`: Value to convert
2247
+ - `name`: Optional parameter name for error messages
2248
+ - Returns: Copy of byte array
2249
+
2250
+ #### `dataLength(data: BytesLike): number`
2251
+ Gets data length.
2252
+ - `data`: Data to measure
2253
+ - Returns: Length in bytes
2254
+
2255
+ #### `dataSlice(data: BytesLike, start: number, end?: number): string`
2256
+ Slices data.
2257
+ - `data`: Data to slice
2258
+ - `start`: Start position
2259
+ - `end`: Optional end position
2260
+ - Returns: Sliced hex string
2261
+
2262
+ #### `zeroPadBytes(data: BytesLike, length: number): string`
2263
+ Zero pads bytes.
2264
+ - `data`: Data to pad
2265
+ - `length`: Target length in bytes
2266
+ - Returns: Zero-padded hex string
2267
+
2268
+ ---
2269
+
2270
+ ### 5.16 Error Utilities
2271
+
2272
+ #### `isError(error: any, code?: string): boolean`
2273
+ Checks if error with code.
2274
+ - `error`: Error to check
2275
+ - `code`: Optional error code to match
2276
+ - Returns: true if error matches
2277
+
2278
+ #### `isCallException(error: any): boolean`
2279
+ Checks if call exception.
2280
+ - `error`: Error to check
2281
+ - Returns: true if call exception
2282
+
2283
+ #### `makeError(message: string, code: string, info?: any): Error`
2284
+ Makes error.
2285
+ - `message`: Error message
2286
+ - `code`: Error code
2287
+ - `info`: Optional error info
2288
+ - Returns: Error instance
2289
+
2290
+ ---
2291
+
2292
+ ### 5.17 Assertion Utilities
2293
+
2294
+ #### `assert(check: boolean, message: string, code: string, info?: any): void`
2295
+ Asserts condition.
2296
+ - `check`: Condition to check
2297
+ - `message`: Error message
2298
+ - `code`: Error code
2299
+ - `info`: Optional error info
2300
+ - Throws: Error if check fails
2301
+
2302
+ #### `assertArgument(check: boolean, message: string, name: string, value: any): void`
2303
+ Asserts argument.
2304
+ - `check`: Condition to check
2305
+ - `message`: Error message
2306
+ - `name`: Argument name
2307
+ - `value`: Argument value
2308
+ - Throws: Error if check fails
2309
+
2310
+ #### `assertArgumentCount(count: number, expectedCount: number, message: string): void`
2311
+ Asserts argument count.
2312
+ - `count`: Actual count
2313
+ - `expectedCount`: Expected count
2314
+ - `message`: Error message
2315
+ - Throws: Error if counts don't match
2316
+
2317
+ #### `assertNormalize(form: string): void`
2318
+ Asserts normalize form.
2319
+ - `form`: Form to check
2320
+ - Throws: Error if form invalid
2321
+
2322
+ #### `assertPrivate(givenGuard: any, guard: symbol, className: string): void`
2323
+ Asserts private access.
2324
+ - `givenGuard`: Given guard value
2325
+ - `guard`: Expected guard symbol
2326
+ - `className`: Class name
2327
+ - Throws: Error if guard doesn't match
2328
+
2329
+ ---
2330
+
2331
+ ### 5.18 Other Utilities
2332
+
2333
+ #### `resolveProperties(value: Record<string, any>): Promise<Record<string, any>>`
2334
+ Resolves properties.
2335
+ - `value`: Object with potentially async values
2336
+ - Returns: Promise resolving to object with all values resolved
2337
+
2338
+ #### `defineProperties(target: any, values: Record<string, any>, types?: Record<string, string>): void`
2339
+ Defines properties.
2340
+ - `target`: Target object
2341
+ - `values`: Property values
2342
+ - `types`: Optional property types
2343
+
2344
+ #### `lock(value: any): any`
2345
+ Locks value.
2346
+ - `value`: Value to lock
2347
+ - Returns: Locked value
2348
+
2349
+ #### `uuidV4(randomBytes: (length: number) => Uint8Array): string`
2350
+ Generates UUID v4.
2351
+ - `randomBytes`: Random bytes function
2352
+ - Returns: UUID v4 string
2353
+
2354
+ ---
2355
+
2356
+ ### 5.19 Utility Classes (Not Implemented)
2357
+
2358
+ The following utility classes are exported from ethers.js but not implemented in quantumcoin.js. They are listed here for API compatibility reference:
2359
+
2360
+ #### `FixedNumber`
2361
+
2362
+ **Purpose**: Represents fixed-point decimal numbers
2363
+
2364
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. Use `bigint` and `formatUnits`/`parseUnits` for decimal handling in quantumcoin.js.
2365
+
2366
+ ---
2367
+
2368
+ #### `FetchRequest`
2369
+
2370
+ **Purpose**: Represents an HTTP fetch request
2371
+
2372
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
2373
+
2374
+ ---
2375
+
2376
+ #### `FetchResponse`
2377
+
2378
+ **Purpose**: Represents an HTTP fetch response
2379
+
2380
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
2381
+
2382
+ ---
2383
+
2384
+ #### `FetchCancelSignal`
2385
+
2386
+ **Purpose**: Represents a cancellation signal for fetch requests
2387
+
2388
+ **Note**: This class is exported from ethers.js but not implemented in quantumcoin.js. It is listed here for API compatibility reference.
2389
+
2390
+ ---
2391
+
2392
+ **Static Methods**:
2393
+
2394
+ #### `Mnemonic.fromEntropy(entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic`
2395
+ Create a new Mnemonic from the entropy.
2396
+ - `entropy`: Entropy bytes
2397
+ - `password`: Optional password (default: empty string)
2398
+ - `wordlist`: Optional wordlist (default: QuantumCoin wordlist)
2399
+ - Returns: Mnemonic instance
2400
+ - **Note**: For QuantumCoin, the entropy should generate 48-word phrases
2401
+
2402
+ #### `Mnemonic.fromPhrase(phrase: string, password?: null | string, wordlist?: null | Wordlist): Mnemonic`
2403
+ Creates a new Mnemonic for the phrase.
2404
+ - `phrase`: Mnemonic phrase string (48 words for QuantumCoin)
2405
+ - `password`: Optional password (default: empty string)
2406
+ - `wordlist`: Optional wordlist (default: QuantumCoin wordlist)
2407
+ - Returns: Mnemonic instance
2408
+
2409
+ #### `Mnemonic.entropyToPhrase(entropy: BytesLike, wordlist?: null | Wordlist): string`
2410
+ Returns the phrase for the entropy.
2411
+ - `entropy`: Entropy bytes
2412
+ - `wordlist`: Optional wordlist (default: QuantumCoin wordlist)
2413
+ - Returns: Mnemonic phrase string
2414
+
2415
+ #### `Mnemonic.isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean`
2416
+ Returns true if phrase is a valid mnemonic phrase.
2417
+ - `phrase`: Phrase to validate
2418
+ - `wordlist`: Optional wordlist (default: QuantumCoin wordlist)
2419
+ - Returns: `true` if valid mnemonic, `false` otherwise
2420
+ - **Note**: Checks that all words belong to the wordlist, length is valid, and checksum is correct. For QuantumCoin, validates 48-word phrases.
2421
+
2422
+ #### `Mnemonic.phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string`
2423
+ Returns the entropy for the phrase.
2424
+ - `phrase`: Mnemonic phrase string
2425
+ - `wordlist`: Optional wordlist (default: QuantumCoin wordlist)
2426
+ - Returns: Entropy as hex string
2427
+
2428
+ **Methods**:
2429
+
2430
+ #### `computeSeed(): string`
2431
+ Returns the seed for the mnemonic.
2432
+ - Returns: Seed as hex string
2433
+ - **Note**: Computes the seed from the mnemonic and password. For QuantumCoin, uses quantum-coin-js-sdk's seed computation.
2434
+
2435
+ ---
2436
+
2437
+ ## 6. Network and Plugins
2438
+
2439
+ ### 6.1 Network
2440
+
2441
+ **Purpose**: Encapsulates chain properties and allows plugin extensions
2442
+
2443
+ **Note**: The API matches ethers.js v6 Network. All methods, properties, and behavior follow the same patterns as ethers.js v6.
2444
+
2445
+ **Constructor**:
2446
+ ```javascript
2447
+ constructor(name: string, chainId: BigNumberish)
2448
+ ```
2449
+ - `name`: Network name
2450
+ - `chainId`: Chain ID
2451
+
2452
+ **Properties**:
2453
+ - `name`: string - Network common name
2454
+ - `chainId`: bigint - Network chain ID
2455
+ - `plugins`: NetworkPlugin[] - Array of attached plugins (read-only)
2456
+
2457
+ **Static Methods**:
2458
+
2459
+ #### `Network.from(network?: Networkish): Network`
2460
+ Returns a new Network for the network name or chainId.
2461
+ - `network`: Network name, chainId, or Network object
2462
+ - Returns: Network instance
2463
+
2464
+ #### `Network.register(nameOrChainId: string | number | bigint, networkFunc: () => Network): void`
2465
+ Registers a network name or chainId with a function that returns a Network instance.
2466
+ - `nameOrChainId`: Network name or chain ID to register
2467
+ - `networkFunc`: Function that returns a Network instance
2468
+
2469
+ **Methods**:
2470
+
2471
+ #### `attachPlugin(plugin: NetworkPlugin): this`
2472
+ Attach a new plugin to this Network.
2473
+ - `plugin`: NetworkPlugin instance
2474
+ - Returns: this
2475
+
2476
+ #### `clone(): Network`
2477
+ Create a copy of this Network.
2478
+ - Returns: New Network instance
2479
+
2480
+ #### `computeIntrinsicGas(tx: TransactionLike): number`
2481
+ Compute the intrinsic gas required for a transaction.
2482
+ - `tx`: Transaction-like object
2483
+ - Returns: Intrinsic gas amount
2484
+ - **Note**: A GasCostPlugin can be attached to override default values
2485
+
2486
+ #### `getPlugin<T extends NetworkPlugin>(name: string): null | T`
2487
+ Return the plugin matching name exactly.
2488
+ - `name`: Plugin name
2489
+ - Returns: Plugin instance or null
2490
+
2491
+ #### `getPlugins<T extends NetworkPlugin>(basename: string): T[]`
2492
+ Gets all plugins that match basename (with or without fragment).
2493
+ - `basename`: Plugin base name
2494
+ - Returns: Array of matching plugins
2495
+
2496
+ #### `matches(other: Networkish): boolean`
2497
+ Returns true if other matches this network.
2498
+ - `other`: Network name, chainId, or Network object
2499
+ - Returns: true if chain IDs match (or names match if no chain ID)
2500
+
2501
+ #### `toJSON(): any`
2502
+ Returns a JSON-compatible representation of the Network.
2503
+
2504
+ ---
2505
+
2506
+ ### 6.2 Networkish
2507
+
2508
+ **Type**: `Network | number | bigint | string | { chainId?: number, name?: string }`
2509
+
2510
+ **Purpose**: Anything that can be used to identify or create a Network.
2511
+
2512
+ ---
2513
+
2514
+ ### 6.3 NetworkPlugin (Base Interface)
2515
+
2516
+ **Purpose**: Base interface for network plugins
2517
+
2518
+ **Properties**:
2519
+ - `name`: string - Plugin name (must be unique per network)
2520
+
2521
+ **Note**: All network plugins must implement this interface. Plugins can extend network functionality (gas costs, fee data, etc.).
2522
+
2523
+ ---
2524
+
2525
+ ### 6.4 GasCostPlugin
2526
+
2527
+ **Extends**: NetworkPlugin
2528
+
2529
+ **Purpose**: Plugin for computing gas costs
2530
+
2531
+ **Properties**:
2532
+ - `name`: "org.ethers.plugins.network.GasCost" - Plugin name
2533
+ - `txAccessListAddress`: number - Gas cost for access list address
2534
+ - `txAccessListStorageKey`: number - Gas cost for access list storage key
2535
+ - `txBase`: number - Base transaction gas cost
2536
+ - `txCreate`: number - Gas cost for contract creation
2537
+ - `txDataNonzero`: number - Gas cost per non-zero data byte
2538
+ - `txDataZero`: number - Gas cost per zero data byte
2539
+
2540
+ **Methods**:
2541
+
2542
+ #### `computeIntrinsicGas(tx: TransactionLike): number`
2543
+ Compute the intrinsic gas required for a transaction using plugin parameters.
2544
+ - `tx`: Transaction-like object
2545
+ - Returns: Intrinsic gas amount
2546
+
2547
+ ---
2548
+
2549
+ ## 7. Error Classes
2550
+
2551
+ ### 7.1 Error
2552
+
2553
+ **Base error class**
2554
+
2555
+ **Properties**:
2556
+ - `message`: string - Error message
2557
+ - `code`: string - Error code
2558
+ - `data`: any - Error data
2559
+
2560
+ ---
2561
+
2562
+ ### 7.2 ProviderError
2563
+
2564
+ **Extends**: Error
2565
+
2566
+ **Additional Properties**:
2567
+ - `statusCode`: number - HTTP status code
2568
+ - `request`: any - Request object
2569
+ - `response`: any - Response object
2570
+
2571
+ ---
2572
+
2573
+ ### 7.3 TransactionError
2574
+
2575
+ **Extends**: Error
2576
+
2577
+ **Additional Properties**:
2578
+ - `transaction`: TransactionRequest - Transaction that failed
2579
+ - `receipt`: TransactionReceipt | null - Transaction receipt (if available)
2580
+
2581
+ ---
2582
+
2583
+ ### 7.4 ContractError
2584
+
2585
+ **Extends**: Error
2586
+
2587
+ **Additional Properties**:
2588
+ - `contractAddress`: string - Contract address
2589
+ - `method`: string - Method name
2590
+ - `args`: any[] - Method arguments
2591
+
2592
+ ---
2593
+
2594
+ ## 8. Provider Types and Interfaces
2595
+
2596
+ ### 8.1 PreparedTransactionRequest
2597
+
2598
+ **Purpose**: Transaction request with all properties coerced to strict types
2599
+
2600
+ **Properties**:
2601
+ - `to`: string | null - Recipient address
2602
+ - `from`: string - Sender address
2603
+ - `value`: bigint - Value in wei
2604
+ - `data`: string - Transaction data (hex string)
2605
+ - `gasLimit`: bigint - Gas limit
2606
+ - `gasPrice`: bigint | null - Gas price
2607
+ - `nonce`: number - Transaction nonce
2608
+ - `chainId`: number - Chain ID
2609
+ - `remarks`: string | null - Optional remarks field
2610
+
2611
+ **Note**: Created by `copyRequest(req: TransactionRequest): PreparedTransactionRequest` to normalize a transaction request.
2612
+
2613
+ ---
2614
+
2615
+ ### 8.2 MinedBlock
2616
+
2617
+ **Purpose**: Block that has been mined (extends Block)
2618
+
2619
+ **Extends**: Block
2620
+
2621
+ **Additional Properties**:
2622
+ - All Block properties are guaranteed to be non-null (hash, number, etc.)
2623
+
2624
+ **Note**: Type guard for blocks that have been mined. Pending blocks do not satisfy this type.
2625
+
2626
+ ---
2627
+
2628
+ ### 8.3 MinedTransactionResponse
2629
+
2630
+ **Purpose**: Transaction response that has been mined
2631
+
2632
+ **Extends**: TransactionResponse
2633
+
2634
+ **Additional Properties**:
2635
+ - `blockNumber`: number - Block number (guaranteed non-null)
2636
+ - `blockHash`: string - Block hash (guaranteed non-null)
2637
+
2638
+ **Methods**:
2639
+
2640
+ #### `isMined(): boolean`
2641
+ Returns true if this transaction has been mined.
2642
+ - Returns: true (always true for MinedTransactionResponse)
2643
+
2644
+ #### `getBlock(): Promise<Block>`
2645
+ Resolves to the Block that this transaction was included in.
2646
+ - Returns: Block instance
2647
+
2648
+ #### `confirmations(): Promise<number>`
2649
+ Resolves to the number of confirmations this transaction has.
2650
+ - Returns: Number of confirmations
2651
+
2652
+ **Note**: Type guard for transactions that have been included in a block.
2653
+
2654
+ ---
2655
+
2656
+ ### 8.4 FeeData
2657
+
2658
+ **Purpose**: Represents fee data for transactions
2659
+
2660
+ **Constructor**:
2661
+ ```javascript
2662
+ constructor(gasPrice: bigint | null)
2663
+ ```
2664
+ - `gasPrice`: Legacy gas price
2665
+
2666
+ **Properties**:
2667
+ - `gasPrice`: bigint | null - Gas price
2668
+
2669
+ **Methods**:
2670
+
2671
+ #### `toJSON(): any`
2672
+ Converts to JSON.
2673
+ - Returns: JSON representation of FeeData
2674
+
2675
+ **Note**: For QuantumCoin, only `gasPrice` is used (EIP-1559 style transactions are not applicable).
2676
+
2677
+ ---
2678
+
2679
+ ### 8.5 WebSocketLike
2680
+
2681
+ **Purpose**: Interface for WebSocket-like objects
2682
+
2683
+ **Properties**:
2684
+ - `readyState`: number - Connection state (0 = CONNECTING, 1 = OPEN, 2 = CLOSING, 3 = CLOSED)
2685
+ - `onopen`: ((event: any) => void) | null - Open event handler
2686
+ - `onmessage`: ((event: any) => void) | null - Message event handler
2687
+ - `onerror`: ((event: any) => void) | null - Error event handler
2688
+
2689
+ **Methods**:
2690
+
2691
+ #### `send(payload: any): void`
2692
+ Sends data through the WebSocket.
2693
+ - `payload`: Data to send
2694
+
2695
+ #### `close(code?: number, reason?: string): void`
2696
+ Closes the WebSocket connection.
2697
+ - `code`: Optional close code
2698
+ - `reason`: Optional close reason
2699
+
2700
+ **Note**: Generic interface for WebSocket compatibility, allowing different WebSocket implementations to be used.
2701
+
2702
+ ---
2703
+
2704
+ ### 8.6 ProviderEvent
2705
+
2706
+ **Type**: `string | Array<string | Array<string>> | EventFilter | FilterByBlockHash`
2707
+
2708
+ **Purpose**: Type for provider events that can be subscribed to
2709
+
2710
+ **Values**:
2711
+ - `"block"` - Emitted on each new block with block number
2712
+ - `"error"` - Emitted on async errors
2713
+ - `"debug"` - Emitted on debug events
2714
+ - Transaction hash (string) - Emitted when transaction is mined
2715
+ - Array of topics - Emitted on matching logs
2716
+ - EventFilter - Emitted on matching logs
2717
+ - FilterByBlockHash - Emitted on matching logs in specific block
2718
+
2719
+ **Note**: Each provider may support additional event types.
2720
+
2721
+ ---
2722
+
2723
+ ### 8.7 TopicFilter
2724
+
2725
+ **Type**: `Array<null | string | Array<string>>`
2726
+
2727
+ **Purpose**: Structure for bloom-filter queries on event topics
2728
+
2729
+ **Description**:
2730
+ - Each field can be:
2731
+ - `null` - Matches any value
2732
+ - `string` - Must match exactly that value
2733
+ - `Array<string>` - OR match (any one of those values must match)
2734
+
2735
+ **Example**:
2736
+ ```javascript
2737
+ // Match any event from address 0x... with topic[0] = "0x123..." and any topic[1]
2738
+ ["0x123...", null]
2739
+
2740
+ // Match events with topic[0] = "0x123..." OR "0x456..."
2741
+ [["0x123...", "0x456..."], null]
2742
+ ```
2743
+
2744
+ ---
2745
+
2746
+ ## 9. Provider Interface
2747
+
2748
+ ### 9.1 Provider (Abstract Base Class)
2749
+
2750
+ **Properties**:
2751
+ - `chainId`: Promise<number> - Chain ID
2752
+
2753
+ **Methods**:
2754
+
2755
+ #### `getBlockNumber(): Promise<number>`
2756
+ Returns latest block number.
2757
+
2758
+ #### `getBlock(blockNumber: number | string): Promise<Block>`
2759
+ Returns block information.
2760
+
2761
+ #### `getTransaction(txHash: string): Promise<TransactionResponse>`
2762
+ Returns transaction.
2763
+
2764
+ #### `getTransactionReceipt(txHash: string): Promise<TransactionReceipt>`
2765
+ Returns transaction receipt.
2766
+
2767
+ #### `getBalance(address: string, blockTag?: string): Promise<bigint>`
2768
+ Returns balance.
2769
+
2770
+ #### `getTransactionCount(address: string, blockTag?: string): Promise<number>`
2771
+ Returns nonce.
2772
+
2773
+ #### `sendTransaction(tx: string | TransactionRequest): Promise<TransactionResponse>`
2774
+ Sends transaction.
2775
+ - Note: If `tx` is a TransactionRequest, the `remarks` field is optional and can be used to include a comment (max 32 bytes). Do not store sensitive information in remarks.
2776
+
2777
+ #### `call(tx: TransactionRequest, blockTag?: string): Promise<string>`
2778
+ Executes call.
2779
+
2780
+ #### `estimateGas(tx: TransactionRequest): Promise<bigint>`
2781
+ Estimates gas.
2782
+
2783
+ #### `getCode(address: string, blockTag?: string): Promise<string>`
2784
+ Returns contract code.
2785
+
2786
+ #### `getStorageAt(address: string, position: bigint, blockTag?: string): Promise<string>`
2787
+ Returns storage value.
2788
+
2789
+ #### `getLogs(filter: Filter): Promise<Log[]>`
2790
+ Returns logs.
2791
+
2792
+ #### `on(event: string, callback: Function): void`
2793
+ Subscribes to events.
2794
+
2795
+ #### `once(event: string, callback: Function): void`
2796
+ Subscribes to event once.
2797
+
2798
+ #### `removeListener(event: string, callback: Function): void`
2799
+ Removes listener.
2800
+
2801
+ #### `removeAllListeners(event?: string): void`
2802
+ Removes all listeners.
2803
+
2804
+ ---
2805
+
2806
+ ## 9. Provider Interface
2807
+
2808
+ ### 9.1 Provider (Abstract Base Class)
2809
+
2810
+ **Purpose**: Abstract base class for blockchain providers
2811
+
2812
+ **Note**: The API matches ethers.js v6 Provider. All methods, properties, and behavior follow the same patterns as ethers.js v6.
2813
+
2814
+ **Properties**:
2815
+ - `chainId`: Promise<number> - Chain ID
2816
+ - `network: Network` - Network instance (read-only)
2817
+ - `ready: Promise<Network>` - Promise that resolves when provider is ready
2818
+
2819
+ **Methods**:
2820
+
2821
+ #### `getBlockNumber(): Promise<number>`
2822
+ Returns latest block number.
2823
+
2824
+ #### `getBlock(blockTag: string | number): Promise<Block | null>`
2825
+ Returns block information.
2826
+
2827
+ #### `getTransaction(txHash: string): Promise<TransactionResponse | null>`
2828
+ Returns transaction.
2829
+
2830
+ #### `getTransactionReceipt(txHash: string): Promise<TransactionReceipt | null>`
2831
+ Returns transaction receipt.
2832
+
2833
+ #### `getBalance(address: string, blockTag?: string): Promise<bigint>`
2834
+ Returns balance.
2835
+
2836
+ #### `getTransactionCount(address: string, blockTag?: string): Promise<number>`
2837
+ Returns nonce.
2838
+
2839
+ #### `call(tx: TransactionRequest, blockTag?: string): Promise<string>`
2840
+ Executes a call without creating a transaction.
2841
+ - `tx`: Transaction request
2842
+ - `blockTag`: Optional block tag
2843
+ - Returns: Result data as hex string
2844
+
2845
+ #### `estimateGas(tx: TransactionRequest): Promise<bigint>`
2846
+ Estimates gas for a transaction.
2847
+ - `tx`: Transaction request
2848
+ - Returns: Estimated gas amount
2849
+
2850
+ #### `getTransactionResult(txHash: string): Promise<null | string>`
2851
+ Gets the result of a transaction execution.
2852
+ - `txHash`: Transaction hash
2853
+ - Returns: Result data or null if transaction failed
2854
+
2855
+ #### `getNetwork(): Promise<Network>`
2856
+ Gets network information.
2857
+ - Returns: Network instance
2858
+
2859
+ #### `getFeeData(): Promise<FeeData>`
2860
+ Gets fee data (gas prices).
2861
+ - Returns: FeeData instance
2862
+
2863
+ #### `broadcastTransaction(signedTx: string): Promise<TransactionResponse>`
2864
+ Broadcasts a signed transaction.
2865
+ - `signedTx`: Signed transaction hex string
2866
+ - Returns: TransactionResponse
2867
+
2868
+ #### `waitForTransaction(txHash: string, confirms?: number, timeout?: number): Promise<TransactionReceipt>`
2869
+ Waits for transaction confirmation.
2870
+ - `txHash`: Transaction hash
2871
+ - `confirms`: Optional number of confirmations to wait for
2872
+ - `timeout`: Optional timeout in milliseconds
2873
+ - Returns: TransactionReceipt
2874
+
2875
+ **Note**: Both Provider and Signer implement this interface, allowing them to be used interchangeably for contract calls and gas estimation.
2876
+
2877
+ ---
2878
+
2879
+ ### 9.2 ContractRunner (Abstract Base Class/Interface)
2880
+
2881
+ **Purpose**: Interface for contract execution (implemented by Provider and Signer)
2882
+
2883
+ **Note**: The API matches ethers.js v6 ContractRunner. All methods, properties, and behavior follow the same patterns as ethers.js v6.
2884
+
2885
+ **Properties**:
2886
+ - `provider`: Provider | null - Provider instance
2887
+
2888
+ **Methods**:
2889
+
2890
+ #### `call(tx: TransactionRequest, blockTag?: string): Promise<string>`
2891
+ Executes a call without creating a transaction.
2892
+ - `tx`: Transaction request
2893
+ - `blockTag`: Optional block tag
2894
+ - Returns: Result data as hex string
2895
+
2896
+ #### `estimateGas(tx: TransactionRequest): Promise<bigint>`
2897
+ Estimates gas for a transaction.
2898
+ - `tx`: Transaction request
2899
+ - Returns: Estimated gas amount
2900
+
2901
+ #### `getTransactionResult(txHash: string): Promise<null | string>`
2902
+ Gets the result of a transaction execution.
2903
+ - `txHash`: Transaction hash
2904
+ - Returns: Result data or null if transaction failed
2905
+
2906
+ **Note**: Both Provider and Signer implement this interface, allowing them to be used interchangeably for contract calls and gas estimation.
2907
+
2908
+ ---
2909
+
2910
+ ### 9.3 Signer (Abstract Base Class)
2911
+
2912
+ **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.
2913
+
2914
+ **Properties**:
2915
+ - `provider`: Provider | null - Provider instance
2916
+ - `address: string` - Signer address (read-only)
2917
+
2918
+ **Methods**:
2919
+
2920
+ #### `getAddress(): Promise<string>`
2921
+ Returns signer address.
2922
+
2923
+ #### `getBalance(blockTag?: string): Promise<bigint>`
2924
+ Returns balance.
2925
+
2926
+ #### `getTransactionCount(blockTag?: string): Promise<number>`
2927
+ Returns nonce.
2928
+
2929
+ #### `sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>`
2930
+ Signs and sends transaction.
2931
+ - 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.
2932
+
2933
+ #### `signTransaction(tx: TransactionRequest): Promise<string>`
2934
+ Signs transaction.
2935
+ - 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.
2936
+
2937
+ #### `signMessageSync(message: string | Uint8Array): string`
2938
+ Signs message (synchronous).
2939
+ - `message`: Message to sign (string or bytes)
2940
+ - Returns: Signature string
2941
+
2942
+ #### `connect(provider: Provider): Signer`
2943
+ Connects to provider.
2944
+
2945
+ #### `populateTransaction(tx: TransactionRequest): Promise<TransactionRequest>`
2946
+ Populates transaction with defaults.
2947
+ - `tx`: Transaction request
2948
+ - Returns: Populated transaction request
2949
+
2950
+ #### `populateCall(tx: TransactionRequest): Promise<TransactionRequest>`
2951
+ Populates call transaction.
2952
+ - `tx`: Transaction request
2953
+ - Returns: Populated call transaction request
2954
+
2955
+ #### `call(tx: TransactionRequest, blockTag?: BlockTag): Promise<string>`
2956
+ Executes a call without creating a transaction.
2957
+ - `tx`: Transaction request
2958
+ - `blockTag`: Optional block tag
2959
+ - Returns: Result data as hex string
2960
+
2961
+ #### `estimateGas(tx: TransactionRequest): Promise<bigint>`
2962
+ Estimates gas for a transaction.
2963
+ - `tx`: Transaction request
2964
+ - Returns: Estimated gas amount
2965
+
2966
+ ---
2967
+
2968
+ ## 10. Implementation Requirements
2969
+
2970
+ ### 10.1 Quantum-Coin-JS-SDK Integration
2971
+
2972
+ All implementations must use quantum-coin-js-sdk for:
2973
+
2974
+ 1. **Address Validation**: Use `isAddressValid()` from quantum-coin-js-sdk
2975
+ 2. **ABI Encoding/Decoding**: Use `packMethodData()` and `unpackMethodData()` from quantum-coin-js-sdk
2976
+ 3. **Event Log Encoding/Decoding**: Use `encodeEventLog()` and `decodeEventLog()` from quantum-coin-js-sdk
2977
+ 4. **Transaction Signing**: Use `signRawTransaction()` from quantum-coin-js-sdk (supports `remarks` field via TransactionSigningRequest)
2978
+ 5. **Contract Address Calculation**: Use `createAddress()` and `createAddress2()` from quantum-coin-js-sdk
2979
+ 6. **Wallet Operations**: Use Wallet class from quantum-coin-js-sdk for private key management
2980
+ 7. **Wallet Address Derivation**: Use `publicKeyFromPrivateKey()` and `addressFromPublicKey()` from quantum-coin-js-sdk to derive the public key and address from the private key in the Wallet constructor
2981
+ 8. **Random Wallet Creation**: Use `newWallet()` from quantum-coin-js-sdk in `Wallet.createRandom()` static method
2982
+ 9. **Encrypted Wallet Deserialization**: Use `deserializeEncryptedWallet()` from quantum-coin-js-sdk in `Wallet.fromEncryptedJsonSync()` static method
2983
+ 10. **Encrypted Wallet Serialization**: Use `serializeEncryptedWallet()` from quantum-coin-js-sdk in `Wallet.encryptSync()` instance method
2984
+ 11. **Seed Words Wallet Creation**: Use `openWalletFromSeedWords()` from quantum-coin-js-sdk in `Wallet.fromPhrase()` static method (48 words required)
2985
+ 12. **RPC Calls**: Use quantum-coin-js-sdk RPC functions (getAccountDetails, getTransactionDetails, etc.)
2986
+ 13. **Transaction Remarks**: The `remarks` field is passed through to quantum-coin-js-sdk's TransactionSigningRequest.remarks field (optional, max 32 bytes, hex string with 0x prefix)
2987
+
2988
+ **SDK Source Reference (for implementers)**:
2989
+ - The `quantum-coin-js-sdk` code can be found under `node_modules/quantum-coin-js-sdk/`.
2990
+ - The SDK entrypoint and the `initialize(...)` function can be found in `node_modules/quantum-coin-js-sdk/index.js`.
2991
+
2992
+ ### 10.2 Built-in Libraries Only
2993
+
2994
+ Use only built-in JavaScript/Node.js libraries:
2995
+ - `crypto` - For hashing (SHA-256, RIPEMD-160), random bytes
2996
+ - `Buffer` - For byte manipulation
2997
+ - `http`/`https` - For RPC requests (if not using quantum-coin-js-sdk RPC)
2998
+ - `util` - For utility functions
2999
+ - `events` - For event emitters
3000
+
3001
+ ### 10.3 Address Format Handling
3002
+
3003
+ - All addresses must be validated as 32 bytes (66 hex characters including 0x)
3004
+ - Address normalization should use quantum-coin-js-sdk validation
3005
+ - Address checksumming (if applicable) should follow QuantumCoin conventions
3006
+
3007
+ ### 10.4 Error Handling
3008
+
3009
+ - All errors should extend appropriate error classes
3010
+ - Error messages should be clear and descriptive
3011
+ - Error codes should follow ethers.js patterns where applicable
3012
+
3013
+ ### 10.5 Event Handling
3014
+
3015
+ - Use Node.js EventEmitter for event subscriptions
3016
+ - Support block events, transaction events, and contract events
3017
+ - Implement proper cleanup for event listeners
3018
+
3019
+ ### 10.6 Transaction Handling
3020
+
3021
+ - Support both legacy and EIP-1559 style transactions (if applicable)
3022
+ - Handle gas estimation and pricing
3023
+ - Support transaction replacement (nonce management)
3024
+ - Implement proper transaction confirmation waiting
3025
+ - Support `remarks` field in transactions (optional, max 32 bytes, public on blockchain)
3026
+ - Validate remarks field: must be hex string with 0x prefix, max 32 bytes when decoded
3027
+ - Use quantum-coin-js-sdk's `signRawTransaction()` which accepts `remarks` in TransactionSigningRequest
3028
+
3029
+ ### 10.7 ABI Handling
3030
+
3031
+ - Support all Solidity types (as defined in types.js)
3032
+ - Handle complex types (arrays, structs, tuples)
3033
+ - Support function overloading
3034
+ - Support indexed and non-indexed event parameters
3035
+
3036
+ ### 10.8 Async/Await Pattern
3037
+
3038
+ - All provider methods should return Promises
3039
+ - Use async/await throughout
3040
+ - Handle errors with try/catch
3041
+
3042
+ ### 10.9 Type Safety
3043
+
3044
+ - Use JSDoc for type annotations
3045
+ - Provide clear parameter and return type documentation
3046
+ - Validate inputs at runtime
3047
+
3048
+ ---
3049
+
3050
+ ## 11. File Structure
3051
+
3052
+ ```
3053
+ quantumcoin.js/
3054
+ ├── src/
3055
+ │ ├── providers/
3056
+ │ │ ├── provider.js # Base Provider class
3057
+ │ │ ├── json-rpc-provider.js # JsonRpcProvider
3058
+ │ │ └── index.js
3059
+ │ ├── wallet/
3060
+ │ │ ├── wallet.js # Wallet class
3061
+ │ │ └── index.js
3062
+ │ ├── contract/
3063
+ │ │ ├── contract.js # Contract class
3064
+ │ │ ├── contract-factory.js # ContractFactory
3065
+ │ │ └── index.js
3066
+ │ ├── abi/
3067
+ │ │ ├── interface.js # Interface class
3068
+ │ │ ├── fragments.js # Fragment classes
3069
+ │ │ └── index.js
3070
+ │ ├── utils/
3071
+ │ │ ├── address.js # Address utilities
3072
+ │ │ ├── encoding.js # Encoding utilities
3073
+ │ │ ├── hashing.js # Hash utilities
3074
+ │ │ ├── units.js # Unit conversion
3075
+ │ │ └── index.js
3076
+ │ ├── errors/
3077
+ │ │ ├── index.js # Error classes
3078
+ │ │ └── ...
3079
+ │ └── index.js # Main entry point
3080
+ ├── test/
3081
+ │ ├── unit/ # Unit tests (no blockchain connectivity)
3082
+ │ ├── integration/ # Integration tests (read-only blockchain)
3083
+ │ ├── e2e/ # End-to-end tests (write access)
3084
+ │ ├── security/ # Security tests (malformed input, etc.)
3085
+ │ └── fixtures/ # Test fixtures and data
3086
+ ├── config.js # Existing config
3087
+ └── package.json
3088
+ ```
3089
+
3090
+ ---
3091
+
3092
+ ## 12. Example Usage Patterns
3093
+
3094
+ ### 12.1 Provider Usage
3095
+
3096
+ ```javascript
3097
+ const { JsonRpcProvider } = require('quantumcoin');
3098
+ const provider = new JsonRpcProvider('https://public.rpc.quantumcoinapi.com', 123123);
3099
+
3100
+ const balance = await provider.getBalance('0x...');
3101
+ const blockNumber = await provider.getBlockNumber();
3102
+ ```
3103
+
3104
+ ### 12.2 Wallet Usage
3105
+
3106
+ ```javascript
3107
+ const { Wallet } = require('quantumcoin');
3108
+
3109
+ // Create wallet from private key
3110
+ const wallet = new Wallet('0x...privateKey...', provider);
3111
+
3112
+ // Create random wallet
3113
+ const randomWallet = Wallet.createRandom(provider);
3114
+
3115
+ // Create wallet from encrypted JSON
3116
+ const encryptedJson = '{"address":"...","crypto":{...}}';
3117
+ const walletFromJson = Wallet.fromEncryptedJsonSync(encryptedJson, 'password123', provider);
3118
+
3119
+ // Create wallet from seed phrase (48 words) - can be array or string
3120
+ const seedPhraseArray = ['word1', 'word2', ..., 'word48'];
3121
+ const walletFromPhrase1 = Wallet.fromPhrase(seedPhraseArray, provider);
3122
+
3123
+ // Or as a space or comma delimited string
3124
+ const seedPhraseString = 'word1 word2 ... word48'; // or 'word1,word2,...,word48'
3125
+ const walletFromPhrase2 = Wallet.fromPhrase(seedPhraseString, provider);
3126
+
3127
+ // Encrypt wallet to JSON string (instance method)
3128
+ const encryptedJson = wallet.encryptSync('mySecurePassword123');
3129
+ // Can be saved to file and opened in Desktop/Mobile/Web/CLI wallet applications
3130
+
3131
+ // Sign message synchronously
3132
+ const signature = wallet.signMessageSync('Hello, QuantumCoin!');
3133
+
3134
+ const tx = await wallet.sendTransaction({
3135
+ to: '0x...',
3136
+ value: parseEther('1.0')
3137
+ });
3138
+ ```
3139
+
3140
+ ### 12.3 Contract Usage
3141
+
3142
+ ```javascript
3143
+ const { Contract } = require('quantumcoin');
3144
+ const abi = [...]; // ABI array
3145
+ const contract = new Contract('0x...', abi, provider);
3146
+
3147
+ const result = await contract.balanceOf('0x...');
3148
+ const tx = await contract.transfer('0x...', parseEther('1.0'));
3149
+ ```
3150
+
3151
+ ### 12.4 Contract Deployment
3152
+
3153
+ ```javascript
3154
+ const { ContractFactory } = require('quantumcoin');
3155
+ const factory = new ContractFactory(abi, bytecode, wallet);
3156
+ const contract = await factory.deploy(...args);
3157
+ ```
3158
+
3159
+ ---
3160
+
3161
+ ## 13. Testing Requirements
3162
+
3163
+ ### 13.1 Test Organization
3164
+
3165
+ Tests should be organized into the following folders:
3166
+ - **`test/unit/`**: Unit tests that don't require blockchain connectivity
3167
+ - **`test/integration/`**: Integration tests that require read-only blockchain connectivity
3168
+ - **`test/e2e/`**: End-to-end tests that require write access (sending transactions)
3169
+ - **`test/security/`**: Security tests with malformed input, edge cases, and attack vectors
3170
+
3171
+ ### 13.2 Test Metadata
3172
+
3173
+ Each test file must include metadata to specify test categories:
3174
+
3175
+ ```javascript
3176
+ /**
3177
+ * @testCategory unit|integration|e2e|security
3178
+ * @blockchainRequired false|readonly|write
3179
+ * @description Brief description of what this test suite covers
3180
+ */
3181
+ ```
3182
+
3183
+ **Test Categories:**
3184
+ - **`unit`**: Tests that don't need blockchain connectivity (pure functions, utilities, encoding/decoding, etc.)
3185
+ - **`integration`**: Tests that need read-only blockchain connectivity (querying blocks, transactions, contract reads, etc.)
3186
+ - **`e2e`**: Tests that need write access (sending transactions, deploying contracts, etc.)
3187
+ - **`security`**: Tests for security vulnerabilities, malformed input, edge cases, etc.
3188
+
3189
+ **Blockchain Requirements:**
3190
+ - **`false`**: No blockchain connectivity needed
3191
+ - **`readonly`**: Read-only blockchain access (queries only)
3192
+ - **`write`**: Write access required (sending transactions)
3193
+
3194
+ ### 13.3 Test Configuration
3195
+
3196
+ **RPC Endpoint**: `https://public.rpc.quantumcoinapi.com`
3197
+ **Chain ID**: `123123`
3198
+
3199
+ **Test Data Requirements:**
3200
+ - For block-related tests: Use block numbers greater than `3000000`
3201
+ - For transaction read-only tests: Use transactions between blocks `3385844` to `3387473` (inclusive)
3202
+ - For smart contract read-only tests:
3203
+ - Contract Address: `0x0000000000000000000000000000000000000000000000000000000000001000`
3204
+ - ABI: Available at `https://raw.githubusercontent.com/quantumcoinproject/quantum-coin-go/refs/heads/dogep/systemcontracts/staking/stakingv2/StakingContract.abi`
3205
+
3206
+ ### 13.4 Test Coverage Requirements
3207
+
3208
+ #### 13.4.1 Comprehensive Test Coverage
3209
+
3210
+ All tests must include:
3211
+ - **Positive test cases**: Valid inputs and expected successful outcomes
3212
+ - **Negative test cases**: Invalid inputs, error conditions, and edge cases
3213
+ - **Optional parameter coverage**: Tests must cover all combinations of optional parameters to achieve 100% code coverage of the SDK
3214
+ - Test with all optional parameters provided
3215
+ - Test with no optional parameters (using defaults)
3216
+ - Test with partial optional parameters (various combinations)
3217
+
3218
+ #### 13.4.2 Unit Tests (No Blockchain Connectivity)
3219
+
3220
+ Test areas:
3221
+ - Address validation and conversion (32-byte addresses)
3222
+ - Encoding/decoding utilities
3223
+ - Hash functions
3224
+ - Unit conversions
3225
+ - Error classes and error handling
3226
+ - Wallet creation and management (without sending transactions)
3227
+ - Message signing (offline)
3228
+ - ABI parsing and fragment handling
3229
+ - Data encoding/decoding
3230
+
3231
+ #### 13.4.3 Integration Tests (Read-Only Blockchain)
3232
+
3233
+ Test areas:
3234
+ - Provider initialization and connection
3235
+ - Block queries (`getBlock`, `getBlockNumber`, etc.)
3236
+ - Transaction queries (`getTransaction`, `getTransactionReceipt`, etc.)
3237
+ - Balance queries (`getBalance`)
3238
+ - Contract read operations (using the staking contract at `0x0000000000000000000000000000000000000000000000000000000000001000`)
3239
+ - Event filtering and querying (read-only)
3240
+ - Log queries
3241
+ - Gas estimation (read-only operation)
3242
+ - Network information queries
3243
+
3244
+ **Test Data:**
3245
+ - Blocks: Use block numbers > 3000000
3246
+ - Transactions: Use transactions from blocks 3385844 to 3387473
3247
+ - Contract: Use staking contract at `0x0000000000000000000000000000000000000000000000000000000000001000`
3248
+
3249
+ #### 13.4.4 End-to-End Tests (Write Access)
3250
+
3251
+ Test areas:
3252
+ - Sending standard transactions
3253
+ - Contract deployment
3254
+ - Contract write operations
3255
+ - Transaction confirmation and receipt handling
3256
+ - Event listening and subscription
3257
+ - Transaction replacement and cancellation
3258
+
3259
+ **Test Wallet:**
3260
+ - A hardcoded test wallet must be included in test files for sending transactions
3261
+ - The test wallet should have sufficient balance for testing
3262
+ - Private key should be stored securely in test configuration (not committed to version control in production)
3263
+
3264
+ **IERC20 Contract Tests:**
3265
+ - Deploy a standard IERC20 contract
3266
+ - Test all IERC20 operations:
3267
+ - `transfer(to, amount)`
3268
+ - `transferFrom(from, to, amount)`
3269
+ - `approve(spender, amount)`
3270
+ - `balanceOf(account)`
3271
+ - `allowance(owner, spender)`
3272
+ - `totalSupply()`
3273
+ - Test events: `Transfer`, `Approval`
3274
+ - Test with various parameter combinations and optional parameters
3275
+
3276
+ #### 13.4.5 Security Tests
3277
+
3278
+ Test areas:
3279
+ - **Malformed input handling**:
3280
+ - Invalid addresses (wrong length, invalid characters, etc.)
3281
+ - Invalid transaction data
3282
+ - Invalid ABI formats
3283
+ - Invalid block numbers and tags
3284
+ - Invalid hex strings
3285
+ - Invalid numeric values (negative, overflow, etc.)
3286
+ - **Edge cases**:
3287
+ - Empty strings and null/undefined values
3288
+ - Very large numbers (overflow scenarios)
3289
+ - Zero values
3290
+ - Boundary conditions
3291
+ - **Attack vectors**:
3292
+ - SQL injection attempts in string parameters
3293
+ - Buffer overflow attempts
3294
+ - Reentrancy scenarios (where applicable)
3295
+ - Invalid signature handling
3296
+ - Invalid transaction replay attempts
3297
+
3298
+ ### 13.5 Code Coverage Goal
3299
+
3300
+ The test suite must achieve **100% code coverage** of the SDK. This includes:
3301
+ - All public methods
3302
+ - All private/internal methods
3303
+ - All error paths
3304
+ - All optional parameter combinations
3305
+ - All conditional branches
3306
+ - All edge cases
3307
+
3308
+ ### 13.6 Test Examples
3309
+
3310
+ #### Example: Unit Test Structure
3311
+
3312
+ ```javascript
3313
+ /**
3314
+ * @testCategory unit
3315
+ * @blockchainRequired false
3316
+ * @description Tests for address utilities
3317
+ */
3318
+ describe('Address Utilities', () => {
3319
+ describe('isAddress', () => {
3320
+ it('should return true for valid 32-byte address', () => {
3321
+ // Positive test case
3322
+ });
3323
+
3324
+ it('should return false for invalid address', () => {
3325
+ // Negative test case
3326
+ });
3327
+
3328
+ it('should handle optional checksum parameter', () => {
3329
+ // Optional parameter test
3330
+ });
3331
+ });
3332
+ });
3333
+ ```
3334
+
3335
+ #### Example: Integration Test Structure
3336
+
3337
+ ```javascript
3338
+ /**
3339
+ * @testCategory integration
3340
+ * @blockchainRequired readonly
3341
+ * @description Tests for block queries
3342
+ */
3343
+ describe('Block Queries', () => {
3344
+ const provider = new JsonRpcProvider('https://public.rpc.quantumcoinapi.com', 123123);
3345
+
3346
+ describe('getBlock', () => {
3347
+ it('should get block by number > 3000000', async () => {
3348
+ // Test with block number
3349
+ });
3350
+
3351
+ it('should get block with "latest" tag', async () => {
3352
+ // Test with optional block tag
3353
+ });
3354
+
3355
+ it('should get block without optional parameters', async () => {
3356
+ // Test default behavior
3357
+ });
3358
+ });
3359
+ });
3360
+ ```
3361
+
3362
+ #### Example: E2E Test Structure
3363
+
3364
+ ```javascript
3365
+ /**
3366
+ * @testCategory e2e
3367
+ * @blockchainRequired write
3368
+ * @description Tests for IERC20 contract deployment and interaction
3369
+ */
3370
+ describe('IERC20 Contract', () => {
3371
+ const provider = new JsonRpcProvider('https://public.rpc.quantumcoinapi.com', 123123);
3372
+ const wallet = new Wallet(TEST_WALLET_PRIVATE_KEY, provider);
3373
+
3374
+ describe('Contract Deployment', () => {
3375
+ it('should deploy IERC20 contract', async () => {
3376
+ // Deploy contract
3377
+ });
3378
+ });
3379
+
3380
+ describe('Contract Interactions', () => {
3381
+ it('should transfer tokens', async () => {
3382
+ // Test transfer with all parameters
3383
+ });
3384
+
3385
+ it('should transfer tokens with default gas settings', async () => {
3386
+ // Test with optional parameters omitted
3387
+ });
3388
+ });
3389
+ });
3390
+ ```
3391
+
3392
+ #### Example: Security Test Structure
3393
+
3394
+ ```javascript
3395
+ /**
3396
+ * @testCategory security
3397
+ * @blockchainRequired false
3398
+ * @description Security tests for malformed input
3399
+ */
3400
+ describe('Security: Malformed Input', () => {
3401
+ describe('Address Validation', () => {
3402
+ it('should reject addresses with invalid length', () => {
3403
+ // Security test
3404
+ });
3405
+
3406
+ it('should reject addresses with SQL injection attempts', () => {
3407
+ // Security test
3408
+ });
3409
+ });
3410
+ });
3411
+ ```
3412
+
3413
+ ### 13.7 Test Execution
3414
+
3415
+ Tests should be organized to allow selective execution:
3416
+ - Run only unit tests (fast, no network)
3417
+ - Run only integration tests (read-only, requires network)
3418
+ - Run only e2e tests (write access, requires network and test funds)
3419
+ - Run only security tests
3420
+ - Run all tests
3421
+
3422
+ ### 13.8 Additional Requirements
3423
+
3424
+ - All tests must be deterministic and repeatable
3425
+ - Tests should clean up after themselves (where applicable)
3426
+ - Tests should not interfere with each other
3427
+ - Use appropriate test timeouts for network operations
3428
+ - Mock external dependencies where appropriate (for unit tests)
3429
+ - Use real blockchain data for integration and e2e tests
3430
+
3431
+ ### 13.9 Implementation Gate: Non-Transaction Tests Must Pass
3432
+
3433
+ After the rest of this specification is implemented (i.e., once the SDK APIs described in this document exist), the implementation MUST run **all tests that do not require sending transactions** and ensure they succeed.
3434
+
3435
+ - **Included**: all test suites marked `@blockchainRequired false` or `@blockchainRequired readonly`
3436
+ - **Excluded**: any test suites marked `@blockchainRequired write` (i.e., tests that send transactions)
3437
+
3438
+ If any included test fails:
3439
+ - **Diagnose** whether the failure is due to a **test bug** or a **SDK implementation bug**
3440
+ - **Fix** the test (if the test is incorrect) or fix the SDK code (if the SDK is incorrect)
3441
+ - **Re-run** the included test set and **repeat** until all included tests pass
3442
+
3443
+ ---
3444
+
3445
+ ## 14. Documentation Requirements
3446
+
3447
+ - **Code and Documentation Comments**: All code must include detailed comments and documentation. Code comments should explain the logic, purpose, and implementation details. Documentation comments (JSDoc) should be comprehensive and clear, enabling both readers of the code and users of the SDK to understand functionality, parameters, return values, and usage patterns. Doc-level comments must appear in the SDK code itself (as JSDoc comments), not just in separate documentation files, so that they are available to SDK users through IDE tooltips and documentation generation tools.
3448
+ - JSDoc comments for all public methods
3449
+ - Usage examples for each major class
3450
+ - Migration guide from ethers.js
3451
+ - API reference documentation
3452
+ - Troubleshooting guide
3453
+
3454
+ ---
3455
+
3456
+ ## 15. Typed Contract Generator
3457
+
3458
+ ### 15.1 Overview
3459
+
3460
+ A typed contract generator tool that creates fully-typed contract classes from ABI and bytecode. This generator produces TypeScript/JavaScript classes with proper types, methods, and deployment factories based on the provided contract ABI and binary code.
3461
+
3462
+ ### 15.2 Generator Input
3463
+
3464
+ The generator accepts the following inputs:
3465
+ - **Contract ABI**: JSON array containing the contract's Application Binary Interface
3466
+ - **Contract Bytecode (bin)**: Hexadecimal string containing the compiled contract bytecode
3467
+
3468
+ ### 15.3 Interactive Setup Process
3469
+
3470
+ #### 15.3.1 Package Creation Prompt
3471
+
3472
+ When invoked, the generator first asks:
3473
+ ```
3474
+ Do you want to create a new package? (Y/N)
3475
+ ```
3476
+
3477
+ #### 15.3.2 New Package Creation (Y)
3478
+
3479
+ If the user selects **Yes**, the generator prompts for:
3480
+
3481
+ 1. **Package Location**:
3482
+ - Prompt: `Enter the folder path where the package should be created:`
3483
+ - User provides absolute or relative path
3484
+
3485
+ 2. **Package Name**:
3486
+ - Prompt: `Enter package name:`
3487
+ - Must be valid npm package name
3488
+
3489
+ 3. **Package Description**:
3490
+ - Prompt: `Enter package description:`
3491
+ - Brief description of the generated contract package
3492
+
3493
+ 4. **Author**:
3494
+ - Prompt: `Enter author name:`
3495
+ - Author information for package.json
3496
+
3497
+ 5. **License**:
3498
+ - Prompt: `Enter license (default: MIT):`
3499
+ - Default: `MIT` (if user presses Enter without input)
3500
+ - User can specify custom license
3501
+
3502
+ 6. **Version**:
3503
+ - Prompt: `Enter version (default: 0.0.1):`
3504
+ - Default: `0.0.1` (if user presses Enter without input)
3505
+ - Must follow semantic versioning
3506
+
3507
+ **Dependencies**: The generator automatically adds all dependencies from `quantumcoin.js` package.json to the generated package's dependencies.
3508
+
3509
+ #### 15.3.3 Existing Package Integration (N)
3510
+
3511
+ If the user selects **No**, the generator prompts for:
3512
+
3513
+ 1. **Target Location**:
3514
+ - Prompt: `Enter the location in your existing package (relative to package root):`
3515
+ - User provides path where contract files should be generated
3516
+ - Example: `src/contracts` or `contracts`
3517
+
3518
+ ### 15.4 Generated Code Structure
3519
+
3520
+ #### 15.4.1 Contract Class
3521
+
3522
+ The generator creates a typed contract class with the following features:
3523
+
3524
+ **Class Name**: Based on contract name from ABI (if available) or derived from package name
3525
+
3526
+ **Constructor**:
3527
+ ```typescript
3528
+ constructor(address: string, runner?: ContractRunner, _deployTx?: TransactionResponse)
3529
+ ```
3530
+ - `address`: Contract address (32-byte QuantumCoin address)
3531
+ - `runner`: Optional ContractRunner (Provider or Signer)
3532
+ - `_deployTx`: Optional deployment transaction (for newly deployed contracts)
3533
+
3534
+ **Typed Methods**:
3535
+ - **Read-only functions**: Return typed results using types from quantumcoin.js
3536
+ - **State-changing functions**: Return `ContractTransactionResponse` from quantumcoin.js
3537
+ - **View functions**: Return typed values based on ABI return types
3538
+ - **Pure functions**: Return typed values based on ABI return types
3539
+
3540
+ **Method Signatures**:
3541
+ - All method parameters are typed based on ABI input types
3542
+ - All return types use quantumcoin.js types (e.g., `bigint`, `string`, `AddressLike`, etc.)
3543
+ - Optional parameters are properly marked
3544
+ - Overloads are generated for functions with optional parameters
3545
+
3546
+ **Event Handling**:
3547
+ - Typed event filters and listeners
3548
+ - Event types match quantumcoin.js `EventLog` structure
3549
+ - Indexed and non-indexed parameters are properly typed
3550
+
3551
+ **Error Handling**:
3552
+ - Custom error classes for contract-specific errors
3553
+ - Error types match quantumcoin.js error patterns
3554
+
3555
+ #### 15.4.2 Contract Factory
3556
+
3557
+ The generator creates a `ContractFactory` class for deployment:
3558
+
3559
+ **Class Name**: `{ContractName}__factory`
3560
+
3561
+ **Static Methods**:
3562
+ ```typescript
3563
+ static connect(address: string, runner?: ContractRunner): {ContractName}
3564
+ ```
3565
+ - Creates a contract instance at the given address
3566
+
3567
+ **Instance Methods**:
3568
+ ```typescript
3569
+ deploy(...constructorArgs: TypedArgs[]): Promise<{ContractName}>
3570
+ ```
3571
+ - Deploys the contract with typed constructor arguments
3572
+ - Returns a contract instance with the deployment transaction attached
3573
+
3574
+ **Properties**:
3575
+ - `bytecode`: The contract bytecode
3576
+ - `interface`: The contract ABI interface
3577
+ - `abi`: The contract ABI array
3578
+
3579
+ #### 15.4.3 Type Definitions
3580
+
3581
+ The generator creates TypeScript type definitions for:
3582
+ - Function parameters (input types)
3583
+ - Function return values (output types)
3584
+ - Event parameters
3585
+ - Struct types (if present in ABI)
3586
+ - Tuple types (if present in ABI)
3587
+
3588
+ All types use quantumcoin.js type system:
3589
+ - `bigint` for uint/int types
3590
+ - `string` for addresses (32-byte)
3591
+ - `BytesLike` for bytes types
3592
+ - Custom struct types for complex data structures
3593
+
3594
+ #### 15.4.4 Code Comments
3595
+
3596
+ All generated code includes comprehensive JSDoc comments:
3597
+
3598
+ **Class Comments**:
3599
+ ```typescript
3600
+ /**
3601
+ * {ContractName} - A typed contract interface for {ContractName}
3602
+ *
3603
+ * @description {Description from ABI or package description}
3604
+ * @example
3605
+ * ```typescript
3606
+ * const contract = new {ContractName}(address, provider);
3607
+ * const result = await contract.someMethod(...args);
3608
+ * ```
3609
+ */
3610
+ ```
3611
+
3612
+ **Method Comments**:
3613
+ ```typescript
3614
+ /**
3615
+ * {methodName} - {Description from ABI}
3616
+ *
3617
+ * @param {paramName} - {Type and description}
3618
+ * @returns {Return type description}
3619
+ * @throws {Error conditions}
3620
+ *
3621
+ * @example
3622
+ * ```typescript
3623
+ * const result = await contract.{methodName}(...args);
3624
+ * ```
3625
+ */
3626
+ ```
3627
+
3628
+ **Transaction Methods**:
3629
+ ```typescript
3630
+ /**
3631
+ * {methodName} - Sends a transaction to {methodName}
3632
+ *
3633
+ * @param {paramName} - {Type and description}
3634
+ * @param overrides - Optional transaction overrides (gas, value, etc.)
3635
+ * @returns Promise<ContractTransactionResponse> - Transaction response object
3636
+ *
3637
+ * @example
3638
+ * ```typescript
3639
+ * const tx = await contract.{methodName}(...args, {
3640
+ * gasLimit: 100000n,
3641
+ * value: parseEther("1.0")
3642
+ * });
3643
+ * await tx.wait();
3644
+ * ```
3645
+ */
3646
+ ```
3647
+
3648
+ ### 15.5 Generated File Structure
3649
+
3650
+ #### 15.5.1 New Package Structure
3651
+
3652
+ ```
3653
+ {package-name}/
3654
+ ├── package.json # Generated with dependencies
3655
+ ├── tsconfig.json # TypeScript configuration
3656
+ ├── README.md # Generated README
3657
+ ├── src/
3658
+ │ ├── {ContractName}.ts # Main contract class
3659
+ │ ├── {ContractName}__factory.ts # Contract factory
3660
+ │ ├── types.ts # Type definitions
3661
+ │ └── index.ts # Main exports
3662
+ └── examples/
3663
+ ├── deploy.ts # Deployment example
3664
+ ├── read-operations.ts # Read-only operations example
3665
+ ├── write-operations.ts # Transaction examples
3666
+ └── events.ts # Event listening examples
3667
+ ```
3668
+
3669
+ #### 15.5.2 Existing Package Structure
3670
+
3671
+ ```
3672
+ {existing-package}/
3673
+ └── {target-location}/
3674
+ ├── {ContractName}.ts
3675
+ ├── {ContractName}__factory.ts
3676
+ ├── types.ts
3677
+ └── index.ts
3678
+ ```
3679
+
3680
+ ### 15.6 Example Generation
3681
+
3682
+ #### 15.6.1 Example Files
3683
+
3684
+ The generator creates example files in the `examples/` folder:
3685
+
3686
+ **deploy.ts**:
3687
+ ```typescript
3688
+ import { JsonRpcProvider, Wallet } from 'quantumcoin';
3689
+ import { {ContractName}, {ContractName}__factory } from '../src';
3690
+
3691
+ async function deploy() {
3692
+ const provider = new JsonRpcProvider('https://public.rpc.quantumcoinapi.com', 123123);
3693
+ const wallet = new Wallet('0x...privateKey...', provider);
3694
+
3695
+ const factory = new {ContractName}__factory(wallet);
3696
+ const contract = await factory.deploy(...constructorArgs);
3697
+
3698
+ console.log('Contract deployed at:', contract.target);
3699
+ console.log('Deployment transaction:', contract.deploymentTransaction()?.hash);
3700
+
3701
+ await contract.deploymentTransaction()?.wait();
3702
+ console.log('Contract deployed and confirmed!');
3703
+ }
3704
+
3705
+ deploy().catch(console.error);
3706
+ ```
3707
+
3708
+ **read-operations.ts**:
3709
+ ```typescript
3710
+ import { JsonRpcProvider } from 'quantumcoin';
3711
+ import { {ContractName} } from '../src';
3712
+
3713
+ async function readOperations() {
3714
+ const provider = new JsonRpcProvider('https://public.rpc.quantumcoinapi.com', 123123);
3715
+ const contract = {ContractName}.connect('0x...contractAddress...', provider);
3716
+
3717
+ // Example read operations based on ABI
3718
+ const result = await contract.someViewFunction(...args);
3719
+ console.log('Result:', result);
3720
+ }
3721
+
3722
+ readOperations().catch(console.error);
3723
+ ```
3724
+
3725
+ **write-operations.ts**:
3726
+ ```typescript
3727
+ import { JsonRpcProvider, Wallet, parseEther } from 'quantumcoin';
3728
+ import { {ContractName} } from '../src';
3729
+
3730
+ async function writeOperations() {
3731
+ const provider = new JsonRpcProvider('https://public.rpc.quantumcoinapi.com', 123123);
3732
+ const wallet = new Wallet('0x...privateKey...', provider);
3733
+ const contract = {ContractName}.connect('0x...contractAddress...', wallet);
3734
+
3735
+ // Example transaction operations based on ABI
3736
+ const tx = await contract.someStateChangingFunction(...args, {
3737
+ gasLimit: 100000n
3738
+ });
3739
+ console.log('Transaction hash:', tx.hash);
3740
+
3741
+ const receipt = await tx.wait();
3742
+ console.log('Transaction confirmed in block:', receipt.blockNumber);
3743
+ }
3744
+
3745
+ writeOperations().catch(console.error);
3746
+ ```
3747
+
3748
+ **events.ts**:
3749
+ ```typescript
3750
+ import { JsonRpcProvider } from 'quantumcoin';
3751
+ import { {ContractName} } from '../src';
3752
+
3753
+ async function listenToEvents() {
3754
+ const provider = new JsonRpcProvider('https://public.rpc.quantumcoinapi.com', 123123);
3755
+ const contract = {ContractName}.connect('0x...contractAddress...', provider);
3756
+
3757
+ // Example event listening based on ABI
3758
+ contract.on('SomeEvent', (event) => {
3759
+ console.log('Event received:', event);
3760
+ });
3761
+
3762
+ // Filter events
3763
+ const filter = contract.filters.SomeEvent(...args);
3764
+ const events = await contract.queryFilter(filter, fromBlock, toBlock);
3765
+ console.log('Filtered events:', events);
3766
+ }
3767
+
3768
+ listenToEvents().catch(console.error);
3769
+ ```
3770
+
3771
+ ### 15.7 Transaction Return Types
3772
+
3773
+ Methods that send transactions must return the appropriate transaction object from quantumcoin.js:
3774
+
3775
+ - **Return Type**: `Promise<ContractTransactionResponse>`
3776
+ - **Properties**: All properties from `ContractTransactionResponse`:
3777
+ - `hash`: Transaction hash
3778
+ - `to`: Recipient address
3779
+ - `from`: Sender address
3780
+ - `value`: Transaction value
3781
+ - `data`: Transaction data
3782
+ - `gasLimit`: Gas limit
3783
+ - `gasPrice`: Gas price
3784
+ - `nonce`: Transaction nonce
3785
+ - `chainId`: Chain ID
3786
+ - `wait()`: Method to wait for confirmation
3787
+ - `getTransaction()`: Get full transaction details
3788
+ - `getReceipt()`: Get transaction receipt
3789
+
3790
+ ### 15.8 Type Mapping
3791
+
3792
+ The generator maps Solidity types to quantumcoin.js types:
3793
+
3794
+ | Solidity Type | quantumcoin.js Type |
3795
+ |--------------|---------------------|
3796
+ | `address` | `string` (32-byte address) |
3797
+ | `uint8` to `uint256` | `bigint` |
3798
+ | `int8` to `int256` | `bigint` |
3799
+ | `bool` | `boolean` |
3800
+ | `bytes1` to `bytes32` | `BytesLike` |
3801
+ | `bytes` | `BytesLike` |
3802
+ | `string` | `string` |
3803
+ | `tuple` | Custom type or object |
3804
+ | Arrays | `Array<Type>` |
3805
+ | Mappings | Not directly accessible (use getter functions) |
3806
+
3807
+ ### 15.9 Generator Implementation Requirements
3808
+
3809
+ 1. **ABI Parsing**: Parse ABI JSON to extract functions, events, errors, and constructor
3810
+ 2. **Type Inference**: Infer TypeScript types from ABI parameter types
3811
+ 3. **Method Generation**: Generate typed methods for all functions in ABI
3812
+ 4. **Event Generation**: Generate typed event filters and listeners
3813
+ 5. **Error Generation**: Generate custom error classes for contract errors
3814
+ 6. **Factory Generation**: Generate ContractFactory with deployment support
3815
+ 7. **Example Generation**: Generate comprehensive examples for all operations
3816
+ 8. **Documentation**: Generate JSDoc comments for all generated code
3817
+ 9. **Package Setup**: Create package.json with proper dependencies
3818
+ 10. **Type Safety**: Ensure all generated code is fully typed
3819
+
3820
+ ### 15.10 Usage
3821
+
3822
+ The generator should be invoked as a command-line tool or script:
3823
+
3824
+ ```bash
3825
+ # As a CLI tool
3826
+ npx quantumcoin-sdk-generator --abi path/to/abi.json --bin path/to/bytecode.bin
3827
+
3828
+ # Or as a Node.js script
3829
+ node generate-sdk.js --abi path/to/abi.json --bin path/to/bytecode.bin
3830
+ ```
3831
+
3832
+ The generator should support:
3833
+ - Interactive mode (prompts for all inputs)
3834
+ - Non-interactive mode (all inputs via command-line arguments)
3835
+ - Configuration file input (JSON/YAML config file)
3836
+
3837
+ ---
3838
+
3839
+ ## Notes
3840
+
3841
+ 1. This specification is based on ethers.js v6 patterns but adapted for QuantumCoin
3842
+ 2. All address-related operations must account for 32-byte addresses
3843
+ 3. HDWallet functionality is explicitly excluded
3844
+ 4. All cryptographic operations must use quantum-coin-js-sdk
3845
+ 5. The implementation should be as compatible as possible with ethers.js v6 for ease of migration