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
@@ -1,1334 +0,0 @@
1
- /**
2
- * One of the most common ways to interact with the blockchain is
3
- * by a node running a JSON-RPC interface which can be connected to,
4
- * based on the transport, using:
5
- *
6
- * - HTTP or HTTPS - [[JsonRpcProvider]]
7
- * - WebSocket - [[WebSocketProvider]]
8
- * - IPC - [[IpcSocketProvider]]
9
- *
10
- * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]
11
- */
12
-
13
- // @TODO:
14
- // - Add the batching API
15
-
16
- // https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false
17
-
18
- import { AbiCoder } from "../abi/index.js";
19
- import { getAddress, resolveAddress } from "../address/index.js";
20
- import { TypedDataEncoder } from "../hash/index.js";
21
- import { accessListify, authorizationify } from "../transaction/index.js";
22
- import {
23
- defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes,
24
- isError, makeError, assert, assertArgument,
25
- FetchRequest, resolveProperties
26
- } from "../utils/index.js";
27
-
28
- import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js";
29
- import { AbstractSigner } from "./abstract-signer.js";
30
- import { Network } from "./network.js";
31
- import { FilterIdEventSubscriber, FilterIdPendingSubscriber } from "./subscriber-filterid.js";
32
- import { PollingEventSubscriber } from "./subscriber-polling.js";
33
-
34
- import type { TypedDataDomain, TypedDataField } from "../hash/index.js";
35
- import type { TransactionLike } from "../transaction/index.js";
36
-
37
- import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js";
38
- import type { Networkish } from "./network.js";
39
- import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js";
40
- import type { Signer } from "./signer.js";
41
-
42
- type Timer = ReturnType<typeof setTimeout>;
43
-
44
- const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g);
45
- //const Methods = "getAddress,then".split(/,/g);
46
- function deepCopy<T = any>(value: T): T {
47
- if (value == null || Primitive.indexOf(typeof(value)) >= 0) {
48
- return value;
49
- }
50
-
51
- // Keep any Addressable
52
- if (typeof((<any>value).getAddress) === "function") {
53
- return value;
54
- }
55
-
56
- if (Array.isArray(value)) { return <any>(value.map(deepCopy)); }
57
-
58
- if (typeof(value) === "object") {
59
- return Object.keys(value).reduce((accum, key) => {
60
- accum[key] = (<any>value)[key];
61
- return accum;
62
- }, <any>{ });
63
- }
64
-
65
- throw new Error(`should not happen: ${ value } (${ typeof(value) })`);
66
- }
67
-
68
- function stall(duration: number): Promise<void> {
69
- return new Promise((resolve) => { setTimeout(resolve, duration); });
70
- }
71
-
72
- function getLowerCase(value: string): string {
73
- if (value) { return value.toLowerCase(); }
74
- return value;
75
- }
76
-
77
- interface Pollable {
78
- pollingInterval: number;
79
- }
80
-
81
- function isPollable(value: any): value is Pollable {
82
- return (value && typeof(value.pollingInterval) === "number");
83
- }
84
-
85
- /**
86
- * A JSON-RPC payload, which are sent to a JSON-RPC server.
87
- */
88
- export type JsonRpcPayload = {
89
- /**
90
- * The JSON-RPC request ID.
91
- */
92
- id: number;
93
-
94
- /**
95
- * The JSON-RPC request method.
96
- */
97
- method: string;
98
-
99
- /**
100
- * The JSON-RPC request parameters.
101
- */
102
- params: Array<any> | Record<string, any>;
103
-
104
- /**
105
- * A required constant in the JSON-RPC specification.
106
- */
107
- jsonrpc: "2.0";
108
- };
109
-
110
- /**
111
- * A JSON-RPC result, which are returned on success from a JSON-RPC server.
112
- */
113
- export type JsonRpcResult = {
114
- /**
115
- * The response ID to match it to the relevant request.
116
- */
117
- id: number;
118
-
119
- /**
120
- * The response result.
121
- */
122
- result: any;
123
- };
124
-
125
- /**
126
- * A JSON-RPC error, which are returned on failure from a JSON-RPC server.
127
- */
128
- export type JsonRpcError = {
129
- /**
130
- * The response ID to match it to the relevant request.
131
- */
132
- id: number;
133
-
134
- /**
135
- * The response error.
136
- */
137
- error: {
138
- code: number;
139
- message?: string;
140
- data?: any;
141
- }
142
- };
143
-
144
- /**
145
- * When subscribing to the ``"debug"`` event, the [[Listener]] will
146
- * receive this object as the first parameter.
147
- */
148
- export type DebugEventJsonRpcApiProvider = {
149
- action: "sendRpcPayload",
150
- payload: JsonRpcPayload | Array<JsonRpcPayload>
151
- } | {
152
- action: "receiveRpcResult",
153
- result: Array<JsonRpcResult | JsonRpcError>
154
- } | {
155
- action: "receiveRpcError",
156
- error: Error
157
- };
158
-
159
- /**
160
- * Options for configuring a [[JsonRpcApiProvider]]. Much of this
161
- * is targetted towards sub-classes, which often will not expose
162
- * any of these options to their consumers.
163
- *
164
- * **``polling``** - use the polling strategy is used immediately
165
- * for events; otherwise, attempt to use filters and fall back onto
166
- * polling (default: ``false``)
167
- *
168
- * **``staticNetwork``** - do not request chain ID on requests to
169
- * validate the underlying chain has not changed (default: ``null``)
170
- *
171
- * This should **ONLY** be used if it is **certain** that the network
172
- * cannot change, such as when using INFURA (since the URL dictates the
173
- * network). If the network is assumed static and it does change, this
174
- * can have tragic consequences. For example, this **CANNOT** be used
175
- * with MetaMask, since the user can select a new network from the
176
- * drop-down at any time.
177
- *
178
- * **``batchStallTime``** - how long (ms) to aggregate requests into a
179
- * single batch. ``0`` indicates batching will only encompass the current
180
- * event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``)
181
- *
182
- * **``batchMaxSize``** - target maximum size (bytes) to allow per batch
183
- * request (default: 1Mb)
184
- *
185
- * **``batchMaxCount``** - maximum number of requests to allow in a batch.
186
- * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``)
187
- *
188
- * **``cacheTimeout``** - passed as [[AbstractProviderOptions]].
189
- */
190
- export type JsonRpcApiProviderOptions = {
191
- polling?: boolean;
192
- staticNetwork?: null | boolean | Network;
193
- batchStallTime?: number;
194
- batchMaxSize?: number;
195
- batchMaxCount?: number;
196
-
197
- cacheTimeout?: number;
198
- pollingInterval?: number;
199
- };
200
-
201
- const defaultOptions = {
202
- polling: false,
203
- staticNetwork: null,
204
-
205
- batchStallTime: 10, // 10ms
206
- batchMaxSize: (1 << 20), // 1Mb
207
- batchMaxCount: 100, // 100 requests
208
-
209
- cacheTimeout: 250,
210
- pollingInterval: 4000
211
- }
212
-
213
- /**
214
- * A **JsonRpcTransactionRequest** is formatted as needed by the JSON-RPC
215
- * Ethereum API specification.
216
- */
217
- export interface JsonRpcTransactionRequest {
218
- /**
219
- * The sender address to use when signing.
220
- */
221
- from?: string;
222
-
223
- /**
224
- * The target address.
225
- */
226
- to?: string;
227
-
228
- /**
229
- * The transaction data.
230
- */
231
- data?: string;
232
-
233
- /**
234
- * The chain ID the transaction is valid on.
235
- */
236
- chainId?: string;
237
-
238
- /**
239
- * The [[link-eip-2718]] transaction type.
240
- */
241
- type?: string;
242
-
243
- /**
244
- * The maximum amount of gas to allow a transaction to consume.
245
- *
246
- * In most other places in ethers, this is called ``gasLimit`` which
247
- * differs from the JSON-RPC Ethereum API specification.
248
- */
249
- gas?: string;
250
-
251
- /**
252
- * The gas price per wei for transactions prior to [[link-eip-1559]].
253
- */
254
- gasPrice?: string;
255
-
256
- /**
257
- * The maximum fee per gas for [[link-eip-1559]] transactions.
258
- */
259
- maxFeePerGas?: string;
260
-
261
- /**
262
- * The maximum priority fee per gas for [[link-eip-1559]] transactions.
263
- */
264
- maxPriorityFeePerGas?: string;
265
-
266
- /**
267
- * The nonce for the transaction.
268
- */
269
- nonce?: string;
270
-
271
- /**
272
- * The transaction value (in wei).
273
- */
274
- value?: string;
275
-
276
- /**
277
- * The transaction access list.
278
- */
279
- accessList?: Array<{ address: string, storageKeys: Array<string> }>;
280
-
281
- /**
282
- * The transaction authorization list.
283
- */
284
- authorizationList?: Array<{
285
- address: string, nonce: string, chainId: string,
286
- r: string, s: string
287
- }>;
288
- }
289
-
290
- // @TODO: Unchecked Signers
291
-
292
- export class JsonRpcSigner extends AbstractSigner<JsonRpcApiProvider> {
293
- address!: string;
294
-
295
- constructor(provider: JsonRpcApiProvider, address: string) {
296
- super(provider);
297
- address = getAddress(address);
298
- defineProperties<JsonRpcSigner>(this, { address });
299
- }
300
-
301
- connect(provider: null | Provider): Signer {
302
- assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", {
303
- operation: "signer.connect"
304
- });
305
- }
306
-
307
- async getAddress(): Promise<string> {
308
- return this.address;
309
- }
310
-
311
- // JSON-RPC will automatially fill in nonce, etc. so we just check from
312
- async populateTransaction(tx: TransactionRequest): Promise<TransactionLike<string>> {
313
- return await this.populateCall(tx);
314
- }
315
-
316
- // Returns just the hash of the transaction after sent, which is what
317
- // the bare JSON-RPC API does;
318
- async sendUncheckedTransaction(_tx: TransactionRequest): Promise<string> {
319
- const tx = deepCopy(_tx);
320
-
321
- const promises: Array<Promise<void>> = [];
322
-
323
- // Make sure the from matches the sender
324
- if (tx.from) {
325
- const _from = tx.from;
326
- promises.push((async () => {
327
- const from = await resolveAddress(_from, this.provider);
328
- assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(),
329
- "from address mismatch", "transaction", _tx);
330
- tx.from = from;
331
- })());
332
- } else {
333
- tx.from = this.address;
334
- }
335
-
336
- // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user
337
- // wishes to use this, it is easy to specify explicitly, otherwise
338
- // we look it up for them.
339
- if (tx.gasLimit == null) {
340
- promises.push((async () => {
341
- tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address});
342
- })());
343
- }
344
-
345
- // The address may be an ENS name or Addressable
346
- if (tx.to != null) {
347
- const _to = tx.to;
348
- promises.push((async () => {
349
- tx.to = await resolveAddress(_to, this.provider);
350
- })());
351
- }
352
-
353
- // Wait until all of our properties are filled in
354
- if (promises.length) { await Promise.all(promises); }
355
-
356
- const hexTx = this.provider.getRpcTransaction(tx);
357
-
358
- return this.provider.send("eth_sendTransaction", [ hexTx ]);
359
- }
360
-
361
- async sendTransaction(tx: TransactionRequest): Promise<TransactionResponse> {
362
- // This cannot be mined any earlier than any recent block
363
- const blockNumber = await this.provider.getBlockNumber();
364
-
365
- // Send the transaction
366
- const hash = await this.sendUncheckedTransaction(tx);
367
-
368
- // Unfortunately, JSON-RPC only provides and opaque transaction hash
369
- // for a response, and we need the actual transaction, so we poll
370
- // for it; it should show up very quickly
371
- return await (new Promise((resolve, reject) => {
372
- const timeouts = [ 1000, 100 ];
373
- let invalids = 0;
374
-
375
- const checkTx = async () => {
376
-
377
- try {
378
- // Try getting the transaction
379
- const tx = await this.provider.getTransaction(hash);
380
-
381
- if (tx != null) {
382
- resolve(tx.replaceableTransaction(blockNumber));
383
- return;
384
- }
385
-
386
- } catch (error) {
387
-
388
- // If we were cancelled: stop polling.
389
- // If the data is bad: the node returns bad transactions
390
- // If the network changed: calling again will also fail
391
- // If unsupported: likely destroyed
392
- if (isError(error, "CANCELLED") || isError(error, "BAD_DATA") ||
393
- isError(error, "NETWORK_ERROR") || isError(error, "UNSUPPORTED_OPERATION")) {
394
-
395
- if (error.info == null) { error.info = { }; }
396
- error.info.sendTransactionHash = hash;
397
-
398
- reject(error);
399
- return;
400
- }
401
-
402
- // Stop-gap for misbehaving backends; see #4513
403
- if (isError(error, "INVALID_ARGUMENT")) {
404
- invalids++;
405
- if (error.info == null) { error.info = { }; }
406
- error.info.sendTransactionHash = hash;
407
- if (invalids > 10) {
408
- reject(error);
409
- return;
410
- }
411
- }
412
-
413
- // Notify anyone that cares; but we will try again, since
414
- // it is likely an intermittent service error
415
- this.provider.emit("error", makeError("failed to fetch transation after sending (will try again)", "UNKNOWN_ERROR", { error }));
416
- }
417
-
418
- // Wait another 4 seconds
419
- this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000);
420
- };
421
- checkTx();
422
- }));
423
- }
424
-
425
- async signTransaction(_tx: TransactionRequest): Promise<string> {
426
- const tx = deepCopy(_tx);
427
-
428
- // Make sure the from matches the sender
429
- if (tx.from) {
430
- const from = await resolveAddress(tx.from, this.provider);
431
- assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(),
432
- "from address mismatch", "transaction", _tx);
433
- tx.from = from;
434
- } else {
435
- tx.from = this.address;
436
- }
437
-
438
- const hexTx = this.provider.getRpcTransaction(tx);
439
- return await this.provider.send("eth_signTransaction", [ hexTx ]);
440
- }
441
-
442
-
443
- async signMessage(_message: string | Uint8Array): Promise<string> {
444
- const message = ((typeof(_message) === "string") ? toUtf8Bytes(_message): _message);
445
- return await this.provider.send("personal_sign", [
446
- hexlify(message), this.address.toLowerCase() ]);
447
- }
448
-
449
- async signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, _value: Record<string, any>): Promise<string> {
450
- const value = deepCopy(_value);
451
-
452
- // Populate any ENS names (in-place)
453
- const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value: string) => {
454
- const address = await resolveAddress(value);
455
- assertArgument(address != null, "TypedData does not support null address", "value", value);
456
- return address;
457
- });
458
-
459
- return await this.provider.send("eth_signTypedData_v4", [
460
- this.address.toLowerCase(),
461
- JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))
462
- ]);
463
- }
464
-
465
- async unlock(password: string): Promise<boolean> {
466
- return this.provider.send("personal_unlockAccount", [
467
- this.address.toLowerCase(), password, null ]);
468
- }
469
-
470
- // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign
471
- async _legacySignMessage(_message: string | Uint8Array): Promise<string> {
472
- const message = ((typeof(_message) === "string") ? toUtf8Bytes(_message): _message);
473
- return await this.provider.send("eth_sign", [
474
- this.address.toLowerCase(), hexlify(message) ]);
475
- }
476
- }
477
-
478
- type ResolveFunc = (result: JsonRpcResult) => void;
479
- type RejectFunc = (error: Error) => void;
480
-
481
- type Payload = { payload: JsonRpcPayload, resolve: ResolveFunc, reject: RejectFunc };
482
-
483
- /**
484
- * The JsonRpcApiProvider is an abstract class and **MUST** be
485
- * sub-classed.
486
- *
487
- * It provides the base for all JSON-RPC-based Provider interaction.
488
- *
489
- * Sub-classing Notes:
490
- * - a sub-class MUST override _send
491
- * - a sub-class MUST call the `_start()` method once connected
492
- */
493
- export abstract class JsonRpcApiProvider extends AbstractProvider {
494
-
495
- #options: Required<JsonRpcApiProviderOptions>;
496
-
497
- // The next ID to use for the JSON-RPC ID field
498
- #nextId: number;
499
-
500
- // Payloads are queued and triggered in batches using the drainTimer
501
- #payloads: Array<Payload>;
502
- #drainTimer: null | Timer;
503
-
504
- #notReady: null | {
505
- promise: Promise<void>,
506
- resolve: null | ((v: void) => void)
507
- };
508
-
509
- #network: null | Network;
510
- #pendingDetectNetwork: null | Promise<Network>;
511
-
512
- #scheduleDrain(): void {
513
- if (this.#drainTimer) { return; }
514
-
515
- // If we aren't using batching, no harm in sending it immediately
516
- const stallTime = (this._getOption("batchMaxCount") === 1) ? 0: this._getOption("batchStallTime");
517
-
518
- this.#drainTimer = setTimeout(() => {
519
- this.#drainTimer = null;
520
-
521
- const payloads = this.#payloads;
522
- this.#payloads = [ ];
523
-
524
- while (payloads.length) {
525
-
526
- // Create payload batches that satisfy our batch constraints
527
- const batch = [ <Payload>(payloads.shift()) ];
528
- while (payloads.length) {
529
- if (batch.length === this.#options.batchMaxCount) { break; }
530
- batch.push(<Payload>(payloads.shift()));
531
- const bytes = JSON.stringify(batch.map((p) => p.payload));
532
- if (bytes.length > this.#options.batchMaxSize) {
533
- payloads.unshift(<Payload>(batch.pop()));
534
- break;
535
- }
536
- }
537
-
538
- // Process the result to each payload
539
- (async () => {
540
- const payload = ((batch.length === 1) ? batch[0].payload: batch.map((p) => p.payload));
541
-
542
- this.emit("debug", { action: "sendRpcPayload", payload });
543
-
544
- try {
545
- const result = await this._send(payload);
546
- this.emit("debug", { action: "receiveRpcResult", result });
547
-
548
- // Process results in batch order
549
- for (const { resolve, reject, payload } of batch) {
550
-
551
- if (this.destroyed) {
552
- reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method }));
553
- continue;
554
- }
555
-
556
- // Find the matching result
557
- const resp = result.filter((r) => (r.id === payload.id))[0];
558
-
559
- // No result; the node failed us in unexpected ways
560
- if (resp == null) {
561
- const error = makeError("missing response for request", "BAD_DATA", {
562
- value: result, info: { payload }
563
- });
564
- this.emit("error", error);
565
- reject(error);
566
- continue;
567
- }
568
-
569
- // The response is an error
570
- if ("error" in resp) {
571
- reject(this.getRpcError(payload, resp));
572
- continue;
573
- }
574
-
575
- // All good; send the result
576
- resolve(resp.result);
577
- }
578
-
579
- } catch (error: any) {
580
- this.emit("debug", { action: "receiveRpcError", error });
581
-
582
- for (const { reject } of batch) {
583
- // @TODO: augment the error with the payload
584
- reject(error);
585
- }
586
- }
587
- })();
588
- }
589
- }, stallTime);
590
- }
591
-
592
- constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) {
593
- super(network, options);
594
-
595
- this.#nextId = 1;
596
- this.#options = Object.assign({ }, defaultOptions, options || { });
597
-
598
- this.#payloads = [ ];
599
- this.#drainTimer = null;
600
-
601
- this.#network = null;
602
- this.#pendingDetectNetwork = null;
603
-
604
- {
605
- let resolve: null | ((value: void) => void) = null;
606
- const promise = new Promise((_resolve: (value: void) => void) => {
607
- resolve = _resolve;
608
- });
609
- this.#notReady = { promise, resolve };
610
- }
611
-
612
- const staticNetwork = this._getOption("staticNetwork");
613
- if (typeof(staticNetwork) === "boolean") {
614
- assertArgument(!staticNetwork || network !== "any", "staticNetwork cannot be used on special network 'any'", "options", options);
615
- if (staticNetwork && network != null) {
616
- this.#network = Network.from(network);
617
- }
618
-
619
- } else if (staticNetwork) {
620
- // Make sure any static network is compatbile with the provided netwrok
621
- assertArgument(network == null || staticNetwork.matches(network),
622
- "staticNetwork MUST match network object", "options", options);
623
- this.#network = staticNetwork;
624
- }
625
- }
626
-
627
- /**
628
- * Returns the value associated with the option %%key%%.
629
- *
630
- * Sub-classes can use this to inquire about configuration options.
631
- */
632
- _getOption<K extends keyof JsonRpcApiProviderOptions>(key: K): JsonRpcApiProviderOptions[K] {
633
- return this.#options[key];
634
- }
635
-
636
- /**
637
- * Gets the [[Network]] this provider has committed to. On each call, the network
638
- * is detected, and if it has changed, the call will reject.
639
- */
640
- get _network(): Network {
641
- assert (this.#network, "network is not available yet", "NETWORK_ERROR");
642
- return this.#network;
643
- }
644
-
645
- /**
646
- * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel.
647
- *
648
- * Sub-classes **MUST** override this.
649
- */
650
- abstract _send(payload: JsonRpcPayload | Array<JsonRpcPayload>): Promise<Array<JsonRpcResult | JsonRpcError>>;
651
-
652
-
653
- /**
654
- * Resolves to the non-normalized value by performing %%req%%.
655
- *
656
- * Sub-classes may override this to modify behavior of actions,
657
- * and should generally call ``super._perform`` as a fallback.
658
- */
659
- async _perform(req: PerformActionRequest): Promise<any> {
660
-
661
- // Legacy networks do not like the type field being passed along (which
662
- // is fair), so we delete type if it is 0 and a non-EIP-1559 network
663
- if (req.method === "call" || req.method === "estimateGas") {
664
- let tx = req.transaction;
665
- if (tx && tx.type != null && getBigInt(tx.type)) {
666
- // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559
667
- if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
668
- const feeData = await this.getFeeData();
669
- if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
670
- // Network doesn't know about EIP-1559 (and hence type)
671
- req = Object.assign({ }, req, {
672
- transaction: Object.assign({ }, tx, { type: undefined })
673
- });
674
- }
675
- }
676
- }
677
- }
678
-
679
- const request = this.getRpcRequest(req);
680
-
681
- if (request != null) {
682
- return await this.send(request.method, request.args);
683
- }
684
-
685
- return super._perform(req);
686
- }
687
-
688
- /**
689
- * Sub-classes may override this; it detects the *actual* network that
690
- * we are **currently** connected to.
691
- *
692
- * Keep in mind that [[send]] may only be used once [[ready]], otherwise the
693
- * _send primitive must be used instead.
694
- */
695
- async _detectNetwork(): Promise<Network> {
696
- const network = this._getOption("staticNetwork");
697
- if (network) {
698
- if (network === true) {
699
- if (this.#network) { return this.#network; }
700
- } else {
701
- return network;
702
- }
703
- }
704
-
705
- if (this.#pendingDetectNetwork) {
706
- return await this.#pendingDetectNetwork;
707
- }
708
-
709
- // If we are ready, use ``send``, which enabled requests to be batched
710
- if (this.ready) {
711
- this.#pendingDetectNetwork = (async () => {
712
- try {
713
- const result = Network.from(getBigInt(await this.send("eth_chainId", [ ])));
714
- this.#pendingDetectNetwork = null;
715
- return result;
716
- } catch (error) {
717
- this.#pendingDetectNetwork = null;
718
- throw error;
719
- }
720
- })();
721
- return await this.#pendingDetectNetwork;
722
- }
723
-
724
- // We are not ready yet; use the primitive _send
725
- this.#pendingDetectNetwork = (async () => {
726
- const payload: JsonRpcPayload = {
727
- id: this.#nextId++, method: "eth_chainId", params: [ ], jsonrpc: "2.0"
728
- };
729
-
730
- this.emit("debug", { action: "sendRpcPayload", payload });
731
-
732
- let result: JsonRpcResult | JsonRpcError;
733
- try {
734
- result = (await this._send(payload))[0];
735
- this.#pendingDetectNetwork = null;
736
- } catch (error) {
737
- this.#pendingDetectNetwork = null;
738
- this.emit("debug", { action: "receiveRpcError", error });
739
- throw error;
740
- }
741
-
742
- this.emit("debug", { action: "receiveRpcResult", result });
743
-
744
- if ("result" in result) {
745
- return Network.from(getBigInt(result.result));
746
- }
747
-
748
- throw this.getRpcError(payload, result);
749
- })();
750
-
751
- return await this.#pendingDetectNetwork;
752
- }
753
-
754
- /**
755
- * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls
756
- * will be passed to [[_send]] from [[send]]. If it is overridden, then
757
- * ``super._start()`` **MUST** be called.
758
- *
759
- * Calling it multiple times is safe and has no effect.
760
- */
761
- _start(): void {
762
- if (this.#notReady == null || this.#notReady.resolve == null) { return; }
763
-
764
- this.#notReady.resolve();
765
- this.#notReady = null;
766
-
767
- (async () => {
768
-
769
- // Bootstrap the network
770
- while (this.#network == null && !this.destroyed) {
771
- try {
772
- this.#network = await this._detectNetwork();
773
- } catch (error) {
774
- if (this.destroyed) { break; }
775
- console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)");
776
- this.emit("error", makeError("failed to bootstrap network detection", "NETWORK_ERROR", { event: "initial-network-discovery", info: { error } }));
777
- await stall(1000);
778
- }
779
- }
780
-
781
- // Start dispatching requests
782
- this.#scheduleDrain();
783
- })();
784
- }
785
-
786
- /**
787
- * Resolves once the [[_start]] has been called. This can be used in
788
- * sub-classes to defer sending data until the connection has been
789
- * established.
790
- */
791
- async _waitUntilReady(): Promise<void> {
792
- if (this.#notReady == null) { return; }
793
- return await this.#notReady.promise;
794
- }
795
-
796
-
797
- /**
798
- * Return a Subscriber that will manage the %%sub%%.
799
- *
800
- * Sub-classes may override this to modify the behavior of
801
- * subscription management.
802
- */
803
- _getSubscriber(sub: Subscription): Subscriber {
804
-
805
- // Pending Filters aren't availble via polling
806
- if (sub.type === "pending") { return new FilterIdPendingSubscriber(this); }
807
-
808
- if (sub.type === "event") {
809
- if (this._getOption("polling")) {
810
- return new PollingEventSubscriber(this, sub.filter);
811
- }
812
- return new FilterIdEventSubscriber(this, sub.filter);
813
- }
814
-
815
- // Orphaned Logs are handled automatically, by the filter, since
816
- // logs with removed are emitted by it
817
- if (sub.type === "orphan" && sub.filter.orphan === "drop-log") {
818
- return new UnmanagedSubscriber("orphan");
819
- }
820
-
821
- return super._getSubscriber(sub);
822
- }
823
-
824
- /**
825
- * Returns true only if the [[_start]] has been called.
826
- */
827
- get ready(): boolean { return this.#notReady == null; }
828
-
829
- /**
830
- * Returns %%tx%% as a normalized JSON-RPC transaction request,
831
- * which has all values hexlified and any numeric values converted
832
- * to Quantity values.
833
- */
834
- getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest {
835
- const result: JsonRpcTransactionRequest = {};
836
-
837
- // JSON-RPC now requires numeric values to be "quantity" values
838
- ["chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value"].forEach((key) => {
839
- if ((<any>tx)[key] == null) { return; }
840
- let dstKey = key;
841
- if (key === "gasLimit") { dstKey = "gas"; }
842
- (<any>result)[dstKey] = toQuantity(getBigInt((<any>tx)[key], `tx.${ key }`));
843
- });
844
-
845
- // Make sure addresses and data are lowercase
846
- ["from", "to", "data"].forEach((key) => {
847
- if ((<any>tx)[key] == null) { return; }
848
- (<any>result)[key] = hexlify((<any>tx)[key]);
849
- });
850
-
851
- // Normalize the access list object
852
- if (tx.accessList) {
853
- result["accessList"] = accessListify(tx.accessList);
854
- }
855
-
856
- if (tx.blobVersionedHashes) {
857
- // @TODO: Remove this <any> case once EIP-4844 added to prepared tx
858
- (<any>result)["blobVersionedHashes"] = tx.blobVersionedHashes.map(h => h.toLowerCase());
859
- }
860
-
861
- if (tx.authorizationList) {
862
- result["authorizationList"] = tx.authorizationList.map((_a) => {
863
- const a = authorizationify(_a);
864
- return {
865
- address: a.address,
866
- nonce: toQuantity(a.nonce),
867
- chainId: toQuantity(a.chainId),
868
- r: toQuantity(a.signature.r),
869
- s: toQuantity(a.signature.s),
870
- }
871
- });
872
- }
873
-
874
- // @TODO: blobs should probably also be copied over, optionally
875
- // accounting for the kzg property to backfill blobVersionedHashes
876
- // using the commitment. Or should that be left as an exercise to
877
- // the caller?
878
-
879
- return result;
880
- }
881
-
882
- /**
883
- * Returns the request method and arguments required to perform
884
- * %%req%%.
885
- */
886
- getRpcRequest(req: PerformActionRequest): null | { method: string, args: Array<any> } {
887
- switch (req.method) {
888
- case "chainId":
889
- return { method: "eth_chainId", args: [ ] };
890
-
891
- case "getBlockNumber":
892
- return { method: "eth_blockNumber", args: [ ] };
893
-
894
- case "getGasPrice":
895
- return { method: "eth_gasPrice", args: [] };
896
-
897
- case "getPriorityFee":
898
- return { method: "eth_maxPriorityFeePerGas", args: [ ] };
899
-
900
- case "getBalance":
901
- return {
902
- method: "eth_getBalance",
903
- args: [ getLowerCase(req.address), req.blockTag ]
904
- };
905
-
906
- case "getTransactionCount":
907
- return {
908
- method: "eth_getTransactionCount",
909
- args: [ getLowerCase(req.address), req.blockTag ]
910
- };
911
-
912
- case "getCode":
913
- return {
914
- method: "eth_getCode",
915
- args: [ getLowerCase(req.address), req.blockTag ]
916
- };
917
-
918
- case "getStorage":
919
- return {
920
- method: "eth_getStorageAt",
921
- args: [
922
- getLowerCase(req.address),
923
- ("0x" + req.position.toString(16)),
924
- req.blockTag
925
- ]
926
- };
927
-
928
- case "broadcastTransaction":
929
- return {
930
- method: "eth_sendRawTransaction",
931
- args: [ req.signedTransaction ]
932
- };
933
-
934
- case "getBlock":
935
- if ("blockTag" in req) {
936
- return {
937
- method: "eth_getBlockByNumber",
938
- args: [ req.blockTag, !!req.includeTransactions ]
939
- };
940
- } else if ("blockHash" in req) {
941
- return {
942
- method: "eth_getBlockByHash",
943
- args: [ req.blockHash, !!req.includeTransactions ]
944
- };
945
- }
946
- break;
947
-
948
- case "getTransaction":
949
- return {
950
- method: "eth_getTransactionByHash",
951
- args: [ req.hash ]
952
- };
953
-
954
- case "getTransactionReceipt":
955
- return {
956
- method: "eth_getTransactionReceipt",
957
- args: [ req.hash ]
958
- };
959
-
960
- case "call":
961
- return {
962
- method: "eth_call",
963
- args: [ this.getRpcTransaction(req.transaction), req.blockTag ]
964
- };
965
-
966
- case "estimateGas": {
967
- return {
968
- method: "eth_estimateGas",
969
- args: [ this.getRpcTransaction(req.transaction) ]
970
- };
971
- }
972
-
973
- case "getLogs":
974
- if (req.filter && req.filter.address != null) {
975
- if (Array.isArray(req.filter.address)) {
976
- req.filter.address = req.filter.address.map(getLowerCase);
977
- } else {
978
- req.filter.address = getLowerCase(req.filter.address);
979
- }
980
- }
981
- return { method: "eth_getLogs", args: [ req.filter ] };
982
- }
983
-
984
- return null;
985
- }
986
-
987
- /**
988
- * Returns an ethers-style Error for the given JSON-RPC error
989
- * %%payload%%, coalescing the various strings and error shapes
990
- * that different nodes return, coercing them into a machine-readable
991
- * standardized error.
992
- */
993
- getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error {
994
- const { method } = payload;
995
- const { error } = _error;
996
-
997
- if (method === "eth_estimateGas" && error.message) {
998
- const msg = error.message;
999
- if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) {
1000
- return makeError("insufficient funds", "INSUFFICIENT_FUNDS", {
1001
- transaction: ((<any>payload).params[0]),
1002
- info: { payload, error }
1003
- });
1004
- } else if (msg.match(/nonce/i) && msg.match(/too low/i)) {
1005
- return makeError("nonce has already been used", "NONCE_EXPIRED", {
1006
- transaction: ((<any>payload).params[0]),
1007
- info: { payload, error }
1008
- });
1009
- }
1010
- }
1011
-
1012
- if (method === "eth_call" || method === "eth_estimateGas") {
1013
- const result = spelunkData(error);
1014
-
1015
- const e = AbiCoder.getBuiltinCallException(
1016
- (method === "eth_call") ? "call": "estimateGas",
1017
- ((<any>payload).params[0]),
1018
- (result ? result.data: null)
1019
- );
1020
- e.info = { error, payload };
1021
- return e;
1022
- }
1023
-
1024
- // Only estimateGas and call can return arbitrary contract-defined text, so now we
1025
- // we can process text safely.
1026
-
1027
- const message = JSON.stringify(spelunkMessage(error));
1028
-
1029
- if (typeof(error.message) === "string" && error.message.match(/user denied|ethers-user-denied/i)) {
1030
- const actionMap: Record<string, "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData"> = {
1031
- eth_sign: "signMessage",
1032
- personal_sign: "signMessage",
1033
- eth_signTypedData_v4: "signTypedData",
1034
- eth_signTransaction: "signTransaction",
1035
- eth_sendTransaction: "sendTransaction",
1036
- eth_requestAccounts: "requestAccess",
1037
- wallet_requestAccounts: "requestAccess",
1038
- };
1039
-
1040
- return makeError(`user rejected action`, "ACTION_REJECTED", {
1041
- action: (actionMap[method] || "unknown") ,
1042
- reason: "rejected",
1043
- info: { payload, error }
1044
- });
1045
- }
1046
-
1047
- if (method === "eth_sendRawTransaction" || method === "eth_sendTransaction") {
1048
- const transaction = <TransactionLike<string>>((<any>payload).params[0]);
1049
-
1050
- if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
1051
- return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", {
1052
- transaction, info: { error }
1053
- });
1054
- }
1055
-
1056
- if (message.match(/nonce/i) && message.match(/too low/i)) {
1057
- return makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error } });
1058
- }
1059
-
1060
- // "replacement transaction underpriced"
1061
- if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) {
1062
- return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error } });
1063
- }
1064
-
1065
- if (message.match(/only replay-protected/i)) {
1066
- return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", {
1067
- operation: method, info: { transaction, info: { error } }
1068
- });
1069
- }
1070
- }
1071
-
1072
- let unsupported = !!message.match(/the method .* does not exist/i);
1073
- if (!unsupported) {
1074
- if (error && (<any>error).details && (<any>error).details.startsWith("Unauthorized method:")) {
1075
- unsupported = true;
1076
- }
1077
- }
1078
-
1079
- if (unsupported) {
1080
- return makeError("unsupported operation", "UNSUPPORTED_OPERATION", {
1081
- operation: payload.method, info: { error, payload }
1082
- });
1083
- }
1084
-
1085
- return makeError("could not coalesce error", "UNKNOWN_ERROR", { error, payload });
1086
- }
1087
-
1088
-
1089
- /**
1090
- * Requests the %%method%% with %%params%% via the JSON-RPC protocol
1091
- * over the underlying channel. This can be used to call methods
1092
- * on the backend that do not have a high-level API within the Provider
1093
- * API.
1094
- *
1095
- * This method queues requests according to the batch constraints
1096
- * in the options, assigns the request a unique ID.
1097
- *
1098
- * **Do NOT override** this method in sub-classes; instead
1099
- * override [[_send]] or force the options values in the
1100
- * call to the constructor to modify this method's behavior.
1101
- */
1102
- send(method: string, params: Array<any> | Record<string, any>): Promise<any> {
1103
- // @TODO: cache chainId?? purge on switch_networks
1104
-
1105
- // We have been destroyed; no operations are supported anymore
1106
- if (this.destroyed) {
1107
- return Promise.reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: method }));
1108
- }
1109
-
1110
- const id = this.#nextId++;
1111
- const promise = new Promise((resolve, reject) => {
1112
- this.#payloads.push({
1113
- resolve, reject,
1114
- payload: { method, params, id, jsonrpc: "2.0" }
1115
- });
1116
- });
1117
-
1118
- // If there is not a pending drainTimer, set one
1119
- this.#scheduleDrain();
1120
-
1121
- return <Promise<JsonRpcResult>>promise;
1122
- }
1123
-
1124
- /**
1125
- * Resolves to the [[Signer]] account for %%address%% managed by
1126
- * the client.
1127
- *
1128
- * If the %%address%% is a number, it is used as an index in the
1129
- * the accounts from [[listAccounts]].
1130
- *
1131
- * This can only be used on clients which manage accounts (such as
1132
- * Geth with imported account or MetaMask).
1133
- *
1134
- * Throws if the account doesn't exist.
1135
- */
1136
- async getSigner(address?: number | string): Promise<JsonRpcSigner> {
1137
- if (address == null) { address = 0; }
1138
-
1139
- const accountsPromise = this.send("eth_accounts", [ ]);
1140
-
1141
- // Account index
1142
- if (typeof(address) === "number") {
1143
- const accounts = <Array<string>>(await accountsPromise);
1144
- if (address >= accounts.length) { throw new Error("no such account"); }
1145
- return new JsonRpcSigner(this, accounts[address]);
1146
- }
1147
-
1148
- const { accounts } = await resolveProperties({
1149
- network: this.getNetwork(),
1150
- accounts: accountsPromise
1151
- });
1152
-
1153
- // Account address
1154
- address = getAddress(address);
1155
- for (const account of accounts) {
1156
- if (getAddress(account) === address) {
1157
- return new JsonRpcSigner(this, address);
1158
- }
1159
- }
1160
-
1161
- throw new Error("invalid account");
1162
- }
1163
-
1164
- async listAccounts(): Promise<Array<JsonRpcSigner>> {
1165
- const accounts: Array<string> = await this.send("eth_accounts", [ ]);
1166
- return accounts.map((a) => new JsonRpcSigner(this, a));
1167
- }
1168
-
1169
- destroy(): void {
1170
-
1171
- // Stop processing requests
1172
- if (this.#drainTimer) {
1173
- clearTimeout(this.#drainTimer);
1174
- this.#drainTimer = null;
1175
- }
1176
-
1177
- // Cancel all pending requests
1178
- for (const { payload, reject } of this.#payloads) {
1179
- reject(makeError("provider destroyed; cancelled request", "UNSUPPORTED_OPERATION", { operation: payload.method }));
1180
- }
1181
-
1182
- this.#payloads = [ ];
1183
-
1184
- // Parent clean-up
1185
- super.destroy();
1186
-
1187
- }
1188
- }
1189
-
1190
- // @TODO: remove this in v7, it is not exported because this functionality
1191
- // is exposed in the JsonRpcApiProvider by setting polling to true. It should
1192
- // be safe to remove regardless, because it isn't reachable, but just in case.
1193
- /**
1194
- * @_ignore:
1195
- */
1196
- export abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider {
1197
- #pollingInterval: number;
1198
- constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) {
1199
- super(network, options);
1200
-
1201
- let pollingInterval = this._getOption("pollingInterval");
1202
- if (pollingInterval == null) { pollingInterval = defaultOptions.pollingInterval; }
1203
-
1204
- this.#pollingInterval = pollingInterval;
1205
- }
1206
-
1207
- _getSubscriber(sub: Subscription): Subscriber {
1208
- const subscriber = super._getSubscriber(sub);
1209
- if (isPollable(subscriber)) {
1210
- subscriber.pollingInterval = this.#pollingInterval;
1211
- }
1212
- return subscriber;
1213
- }
1214
-
1215
- /**
1216
- * The polling interval (default: 4000 ms)
1217
- */
1218
- get pollingInterval(): number { return this.#pollingInterval; }
1219
- set pollingInterval(value: number) {
1220
- if (!Number.isInteger(value) || value < 0) { throw new Error("invalid interval"); }
1221
- this.#pollingInterval = value;
1222
- this._forEachSubscriber((sub) => {
1223
- if (isPollable(sub)) {
1224
- sub.pollingInterval = this.#pollingInterval;
1225
- }
1226
- });
1227
- }
1228
- }
1229
-
1230
- /**
1231
- * The JsonRpcProvider is one of the most common Providers,
1232
- * which performs all operations over HTTP (or HTTPS) requests.
1233
- *
1234
- * Events are processed by polling the backend for the current block
1235
- * number; when it advances, all block-base events are then checked
1236
- * for updates.
1237
- */
1238
- export class JsonRpcProvider extends JsonRpcApiPollingProvider {
1239
- #connect: FetchRequest;
1240
-
1241
- constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions) {
1242
- if (url == null) { url = "http:/\/localhost:8545"; }
1243
- super(network, options);
1244
-
1245
- if (typeof(url) === "string") {
1246
- this.#connect = new FetchRequest(url);
1247
- } else {
1248
- this.#connect = url.clone();
1249
- }
1250
- }
1251
-
1252
- _getConnection(): FetchRequest {
1253
- return this.#connect.clone();
1254
- }
1255
-
1256
- async send(method: string, params: Array<any> | Record<string, any>): Promise<any> {
1257
- // All requests are over HTTP, so we can just start handling requests
1258
- // We do this here rather than the constructor so that we don't send any
1259
- // requests to the network (i.e. eth_chainId) until we absolutely have to.
1260
- await this._start();
1261
-
1262
- return await super.send(method, params);
1263
- }
1264
-
1265
- async _send(payload: JsonRpcPayload | Array<JsonRpcPayload>): Promise<Array<JsonRpcResult>> {
1266
- // Configure a POST connection for the requested method
1267
- const request = this._getConnection();
1268
- request.body = JSON.stringify(payload);
1269
- request.setHeader("content-type", "application/json");
1270
- const response = await request.send();
1271
- response.assertOk();
1272
-
1273
- let resp = response.bodyJson;
1274
- if (!Array.isArray(resp)) { resp = [ resp ]; }
1275
-
1276
- return resp;
1277
- }
1278
- }
1279
-
1280
- function spelunkData(value: any): null | { message: string, data: string } {
1281
- if (value == null) { return null; }
1282
-
1283
- // These *are* the droids we're looking for.
1284
- if (typeof(value.message) === "string" && value.message.match(/revert/i) && isHexString(value.data)) {
1285
- return { message: value.message, data: value.data };
1286
- }
1287
-
1288
- // Spelunk further...
1289
- if (typeof(value) === "object") {
1290
- for (const key in value) {
1291
- const result = spelunkData(value[key]);
1292
- if (result) { return result; }
1293
- }
1294
- return null;
1295
- }
1296
-
1297
- // Might be a JSON string we can further descend...
1298
- if (typeof(value) === "string") {
1299
- try {
1300
- return spelunkData(JSON.parse(value));
1301
- } catch (error) { }
1302
- }
1303
-
1304
- return null;
1305
- }
1306
-
1307
- function _spelunkMessage(value: any, result: Array<string>): void {
1308
- if (value == null) { return; }
1309
-
1310
- // These *are* the droids we're looking for.
1311
- if (typeof(value.message) === "string") {
1312
- result.push(value.message);
1313
- }
1314
-
1315
- // Spelunk further...
1316
- if (typeof(value) === "object") {
1317
- for (const key in value) {
1318
- _spelunkMessage(value[key], result);
1319
- }
1320
- }
1321
-
1322
- // Might be a JSON string we can further descend...
1323
- if (typeof(value) === "string") {
1324
- try {
1325
- return _spelunkMessage(JSON.parse(value), result);
1326
- } catch (error) { }
1327
- }
1328
- }
1329
-
1330
- function spelunkMessage(value: any): Array<string> {
1331
- const result: Array<string> = [ ];
1332
- _spelunkMessage(value, result);
1333
- return result;
1334
- }