essential-eth 0.4.9-beta.1 → 0.4.9-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (498) hide show
  1. package/lib/cjs/classes/Contract.d.ts +71 -0
  2. package/lib/cjs/classes/Contract.js +133 -0
  3. package/lib/cjs/classes/test/Contract/crv-abi.d.ts +2 -0
  4. package/lib/cjs/classes/test/Contract/crv-abi.js +488 -0
  5. package/lib/cjs/classes/test/Contract/ens-abi.d.ts +2 -0
  6. package/lib/cjs/classes/test/Contract/ens-abi.js +453 -0
  7. package/lib/cjs/classes/test/Contract/fei-abi.d.ts +2 -0
  8. package/lib/cjs/classes/test/Contract/fei-abi.js +526 -0
  9. package/lib/cjs/classes/test/Contract/foo-abi.d.ts +2 -0
  10. package/lib/cjs/classes/test/Contract/foo-abi.js +42 -0
  11. package/lib/cjs/classes/test/Contract/uniswap-abi.d.ts +2 -0
  12. package/lib/cjs/classes/test/Contract/uniswap-abi.js +121 -0
  13. package/lib/cjs/classes/utils/clean-block.d.ts +6 -0
  14. package/lib/cjs/classes/utils/clean-block.js +46 -0
  15. package/lib/cjs/classes/utils/clean-transaction.d.ts +5 -0
  16. package/lib/cjs/classes/utils/clean-transaction.js +38 -0
  17. package/lib/cjs/classes/utils/encode-decode-transaction.d.ts +3 -0
  18. package/lib/cjs/classes/utils/encode-decode-transaction.js +113 -0
  19. package/lib/cjs/classes/utils/fetchers.d.ts +9 -0
  20. package/lib/cjs/classes/utils/fetchers.js +33 -0
  21. package/{src/classes/utils/hex-to-decimal.ts → lib/cjs/classes/utils/hex-to-decimal.d.ts} +1 -3
  22. package/lib/cjs/classes/utils/hex-to-decimal.js +11 -0
  23. package/lib/cjs/index.d.ts +13 -0
  24. package/lib/cjs/index.js +44 -0
  25. package/lib/cjs/providers/JsonRpcProvider.d.ts +23 -0
  26. package/lib/cjs/providers/JsonRpcProvider.js +94 -0
  27. package/lib/cjs/providers/utils/chains-info.d.ts +360 -0
  28. package/lib/cjs/providers/utils/chains-info.js +1081 -0
  29. package/lib/cjs/shared/tiny-big/helpers.d.ts +1 -0
  30. package/lib/cjs/shared/tiny-big/helpers.js +71 -0
  31. package/lib/cjs/shared/tiny-big/tiny-big.d.ts +19 -0
  32. package/lib/cjs/shared/tiny-big/tiny-big.js +41 -0
  33. package/lib/cjs/shared/validate-type.d.ts +3 -0
  34. package/lib/cjs/shared/validate-type.js +9 -0
  35. package/lib/cjs/types/Block.types.d.ts +47 -0
  36. package/lib/cjs/types/Block.types.js +2 -0
  37. package/lib/cjs/types/Contract.types.d.ts +24 -0
  38. package/lib/cjs/types/Contract.types.js +2 -0
  39. package/lib/cjs/types/Network.types.d.ts +8 -0
  40. package/lib/cjs/types/Network.types.js +2 -0
  41. package/lib/cjs/types/Transaction.types.d.ts +34 -0
  42. package/lib/cjs/types/Transaction.types.js +2 -0
  43. package/{src/utils/ether-to-wei.ts → lib/cjs/utils/ether-to-wei.d.ts} +2 -10
  44. package/lib/cjs/utils/ether-to-wei.js +32 -0
  45. package/{src/utils/index.ts → lib/cjs/utils/index.d.ts} +0 -1
  46. package/lib/cjs/utils/index.js +11 -0
  47. package/lib/cjs/utils/is-address.d.ts +5 -0
  48. package/lib/cjs/utils/is-address.js +20 -0
  49. package/lib/cjs/utils/to-checksum-address.d.ts +17 -0
  50. package/lib/cjs/utils/to-checksum-address.js +46 -0
  51. package/{src/utils/wei-to-ether.ts → lib/cjs/utils/wei-to-ether.d.ts} +1 -8
  52. package/lib/cjs/utils/wei-to-ether.js +34 -0
  53. package/lib/esm/classes/Contract.d.ts +11 -0
  54. package/lib/esm/classes/Contract.js +70 -0
  55. package/lib/esm/classes/test/Contract/crv-abi.d.ts +2 -0
  56. package/lib/esm/classes/test/Contract/crv-abi.js +470 -0
  57. package/lib/esm/classes/test/Contract/ens-abi.d.ts +2 -0
  58. package/lib/esm/classes/test/Contract/ens-abi.js +435 -0
  59. package/lib/esm/classes/test/Contract/fei-abi.d.ts +2 -0
  60. package/lib/esm/classes/test/Contract/fei-abi.js +521 -0
  61. package/lib/esm/classes/test/Contract/foo-abi.d.ts +2 -0
  62. package/lib/esm/classes/test/Contract/foo-abi.js +33 -0
  63. package/lib/esm/classes/test/Contract/uniswap-abi.d.ts +2 -0
  64. package/lib/esm/classes/test/Contract/uniswap-abi.js +116 -0
  65. package/lib/esm/classes/utils/clean-block.d.ts +3 -0
  66. package/lib/esm/classes/utils/clean-block.js +35 -0
  67. package/lib/esm/classes/utils/clean-transaction.d.ts +2 -0
  68. package/lib/esm/classes/utils/clean-transaction.js +29 -0
  69. package/lib/esm/classes/utils/encode-decode-transaction.d.ts +3 -0
  70. package/lib/esm/classes/utils/encode-decode-transaction.js +98 -0
  71. package/lib/esm/classes/utils/fetchers.d.ts +9 -0
  72. package/lib/esm/classes/utils/fetchers.js +25 -0
  73. package/lib/esm/classes/utils/hex-to-decimal.d.ts +1 -0
  74. package/lib/esm/classes/utils/hex-to-decimal.js +3 -0
  75. package/lib/esm/index.d.ts +13 -0
  76. package/lib/esm/index.js +9 -0
  77. package/lib/esm/providers/JsonRpcProvider.d.ts +10 -0
  78. package/lib/esm/providers/JsonRpcProvider.js +74 -0
  79. package/lib/esm/providers/utils/chains-info.d.ts +360 -0
  80. package/lib/esm/providers/utils/chains-info.js +1077 -0
  81. package/lib/esm/shared/tiny-big/helpers.d.ts +1 -0
  82. package/lib/esm/shared/tiny-big/helpers.js +58 -0
  83. package/lib/esm/shared/tiny-big/tiny-big.d.ts +8 -0
  84. package/lib/esm/shared/tiny-big/tiny-big.js +22 -0
  85. package/lib/esm/shared/validate-type.d.ts +3 -0
  86. package/lib/esm/shared/validate-type.js +5 -0
  87. package/lib/esm/types/Block.types.d.ts +47 -0
  88. package/lib/esm/types/Block.types.js +1 -0
  89. package/lib/esm/types/Contract.types.d.ts +24 -0
  90. package/lib/esm/types/Contract.types.js +1 -0
  91. package/lib/esm/types/Network.types.d.ts +5 -0
  92. package/lib/esm/types/Network.types.js +1 -0
  93. package/lib/esm/types/Transaction.types.d.ts +34 -0
  94. package/lib/esm/types/Transaction.types.js +1 -0
  95. package/lib/esm/utils/ether-to-wei.d.ts +3 -0
  96. package/lib/esm/utils/ether-to-wei.js +7 -0
  97. package/lib/esm/utils/index.d.ts +5 -0
  98. package/lib/esm/utils/index.js +5 -0
  99. package/lib/esm/utils/is-address.d.ts +1 -0
  100. package/lib/esm/utils/is-address.js +12 -0
  101. package/lib/esm/utils/to-checksum-address.d.ts +1 -0
  102. package/lib/esm/utils/to-checksum-address.js +25 -0
  103. package/lib/esm/utils/wei-to-ether.d.ts +3 -0
  104. package/lib/esm/utils/wei-to-ether.js +7 -0
  105. package/package.json +8 -22
  106. package/..eslintrc.js.un~ +0 -0
  107. package/..npmignore.un~ +0 -0
  108. package/.env +0 -1
  109. package/.eslintignore +0 -4
  110. package/.eslintrc.js +0 -34
  111. package/.gitattributes +0 -1
  112. package/.github/workflows/.test.yml.un~ +0 -0
  113. package/.github/workflows/test.yml +0 -29
  114. package/.package.json.un~ +0 -0
  115. package/.prettierignore +0 -7
  116. package/.travis.yml +0 -5
  117. package/jest.config.js +0 -9
  118. package/scripts/build-website.sh +0 -4
  119. package/scripts/bump-minor.sh +0 -4
  120. package/scripts/bump-patch.sh +0 -4
  121. package/scripts/fetch-chains-info.ts +0 -70
  122. package/scripts/pre-commit.sh +0 -5
  123. package/src/classes/Contract.ts +0 -161
  124. package/src/classes/test/Contract/crv-abi.ts +0 -488
  125. package/src/classes/test/Contract/crv.test.ts +0 -56
  126. package/src/classes/test/Contract/ens-abi.ts +0 -452
  127. package/src/classes/test/Contract/ens.test.ts +0 -39
  128. package/src/classes/test/Contract/fei-abi.ts +0 -526
  129. package/src/classes/test/Contract/fei.test.ts +0 -86
  130. package/src/classes/test/Contract/foo-abi.ts +0 -42
  131. package/src/classes/test/Contract/foo.test.ts +0 -33
  132. package/src/classes/test/Contract/uni.test.ts +0 -72
  133. package/src/classes/test/Contract/uniswap-abi.ts +0 -121
  134. package/src/classes/utils/clean-block.ts +0 -49
  135. package/src/classes/utils/clean-transaction.ts +0 -35
  136. package/src/classes/utils/encode-decode-transaction.ts +0 -126
  137. package/src/classes/utils/fetchers.ts +0 -27
  138. package/src/index.ts +0 -27
  139. package/src/providers/JsonRpcProvider.ts +0 -94
  140. package/src/providers/test/get-block.test.ts +0 -63
  141. package/src/providers/test/get-network.test.ts +0 -34
  142. package/src/providers/utils/chains-info.ts +0 -1079
  143. package/src/shared/tiny-big/helpers.test.ts +0 -30
  144. package/src/shared/tiny-big/helpers.ts +0 -89
  145. package/src/shared/tiny-big/tiny-big.test.ts +0 -10
  146. package/src/shared/tiny-big/tiny-big.ts +0 -36
  147. package/src/shared/validate-type.ts +0 -20
  148. package/src/types/.Contract.types.ts.un~ +0 -0
  149. package/src/types/Block.types.ts +0 -50
  150. package/src/types/Contract.types.ts +0 -67
  151. package/src/types/Network.types.ts +0 -8
  152. package/src/types/Transaction.types.ts +0 -35
  153. package/src/utils/is-address.ts +0 -16
  154. package/src/utils/tests/ether-to-wei.test.ts +0 -65
  155. package/src/utils/tests/is-address.test.ts +0 -52
  156. package/src/utils/tests/to-checksum-address.test.ts +0 -43
  157. package/src/utils/tests/wei-to-ether.test.ts +0 -72
  158. package/src/utils/to-checksum-address.ts +0 -47
  159. package/test/global-setup.js +0 -8
  160. package/test/global-teardown.js +0 -5
  161. package/test/jest.setup-after-env.js +0 -1
  162. package/test/server.js +0 -24
  163. package/tsconfig-cjs.json +0 -8
  164. package/tsconfig.json +0 -25
  165. package/typedoc/options-new-version.js +0 -8
  166. package/typedoc/options.js +0 -9
  167. package/types/just-omit.d.ts +0 -1
  168. package/website/.nojekyll +0 -1
  169. package/website/assets/highlight.css +0 -71
  170. package/website/assets/icons.css +0 -1043
  171. package/website/assets/icons.png +0 -0
  172. package/website/assets/icons@2x.png +0 -0
  173. package/website/assets/main.js +0 -52
  174. package/website/assets/search.js +0 -1
  175. package/website/assets/style.css +0 -1413
  176. package/website/assets/widgets.png +0 -0
  177. package/website/assets/widgets@2x.png +0 -0
  178. package/website/classes/Contract.html +0 -13
  179. package/website/classes/JsonRpcProvider.html +0 -8
  180. package/website/classes/TinyBig.html +0 -161
  181. package/website/index.html +0 -207
  182. package/website/interfaces/Block.html +0 -1
  183. package/website/interfaces/JSONABIArgument.html +0 -1
  184. package/website/interfaces/Network.html +0 -3
  185. package/website/interfaces/Transaction.html +0 -1
  186. package/website/modules.html +0 -32
  187. package/website/versions/0.1.2/assets/highlight.css +0 -57
  188. package/website/versions/0.1.2/assets/icons.css +0 -1043
  189. package/website/versions/0.1.2/assets/icons.png +0 -0
  190. package/website/versions/0.1.2/assets/icons@2x.png +0 -0
  191. package/website/versions/0.1.2/assets/main.js +0 -52
  192. package/website/versions/0.1.2/assets/search.js +0 -1
  193. package/website/versions/0.1.2/assets/style.css +0 -1341
  194. package/website/versions/0.1.2/assets/widgets.png +0 -0
  195. package/website/versions/0.1.2/assets/widgets@2x.png +0 -0
  196. package/website/versions/0.1.2/classes/TinyBig.html +0 -4
  197. package/website/versions/0.1.2/index.html +0 -20
  198. package/website/versions/0.1.2/modules.html +0 -23
  199. package/website/versions/0.1.3/assets/highlight.css +0 -64
  200. package/website/versions/0.1.3/assets/icons.css +0 -1043
  201. package/website/versions/0.1.3/assets/icons.png +0 -0
  202. package/website/versions/0.1.3/assets/icons@2x.png +0 -0
  203. package/website/versions/0.1.3/assets/main.js +0 -52
  204. package/website/versions/0.1.3/assets/search.js +0 -1
  205. package/website/versions/0.1.3/assets/style.css +0 -1341
  206. package/website/versions/0.1.3/assets/widgets.png +0 -0
  207. package/website/versions/0.1.3/assets/widgets@2x.png +0 -0
  208. package/website/versions/0.1.3/classes/TinyBig.html +0 -4
  209. package/website/versions/0.1.3/index.html +0 -53
  210. package/website/versions/0.1.3/modules.html +0 -23
  211. package/website/versions/0.1.4/assets/highlight.css +0 -64
  212. package/website/versions/0.1.4/assets/icons.css +0 -1043
  213. package/website/versions/0.1.4/assets/icons.png +0 -0
  214. package/website/versions/0.1.4/assets/icons@2x.png +0 -0
  215. package/website/versions/0.1.4/assets/main.js +0 -52
  216. package/website/versions/0.1.4/assets/search.js +0 -1
  217. package/website/versions/0.1.4/assets/style.css +0 -1341
  218. package/website/versions/0.1.4/assets/widgets.png +0 -0
  219. package/website/versions/0.1.4/assets/widgets@2x.png +0 -0
  220. package/website/versions/0.1.4/classes/EssentialEth.html +0 -1
  221. package/website/versions/0.1.4/classes/TinyBig.html +0 -4
  222. package/website/versions/0.1.4/index.html +0 -58
  223. package/website/versions/0.1.4/modules.html +0 -23
  224. package/website/versions/0.2.0/assets/highlight.css +0 -64
  225. package/website/versions/0.2.0/assets/icons.css +0 -1043
  226. package/website/versions/0.2.0/assets/icons.png +0 -0
  227. package/website/versions/0.2.0/assets/icons@2x.png +0 -0
  228. package/website/versions/0.2.0/assets/main.js +0 -52
  229. package/website/versions/0.2.0/assets/search.js +0 -1
  230. package/website/versions/0.2.0/assets/style.css +0 -1341
  231. package/website/versions/0.2.0/assets/widgets.png +0 -0
  232. package/website/versions/0.2.0/assets/widgets@2x.png +0 -0
  233. package/website/versions/0.2.0/classes/EssentialEth.html +0 -5
  234. package/website/versions/0.2.0/classes/TinyBig.html +0 -146
  235. package/website/versions/0.2.0/index.html +0 -89
  236. package/website/versions/0.2.0/modules.html +0 -25
  237. package/website/versions/0.2.1/assets/highlight.css +0 -64
  238. package/website/versions/0.2.1/assets/icons.css +0 -1043
  239. package/website/versions/0.2.1/assets/icons.png +0 -0
  240. package/website/versions/0.2.1/assets/icons@2x.png +0 -0
  241. package/website/versions/0.2.1/assets/main.js +0 -52
  242. package/website/versions/0.2.1/assets/search.js +0 -1
  243. package/website/versions/0.2.1/assets/style.css +0 -1341
  244. package/website/versions/0.2.1/assets/widgets.png +0 -0
  245. package/website/versions/0.2.1/assets/widgets@2x.png +0 -0
  246. package/website/versions/0.2.1/classes/EssentialEth.html +0 -5
  247. package/website/versions/0.2.1/classes/TinyBig.html +0 -146
  248. package/website/versions/0.2.1/index.html +0 -96
  249. package/website/versions/0.2.1/modules.html +0 -29
  250. package/website/versions/0.2.2/assets/highlight.css +0 -64
  251. package/website/versions/0.2.2/assets/icons.css +0 -1043
  252. package/website/versions/0.2.2/assets/icons.png +0 -0
  253. package/website/versions/0.2.2/assets/icons@2x.png +0 -0
  254. package/website/versions/0.2.2/assets/main.js +0 -52
  255. package/website/versions/0.2.2/assets/search.js +0 -1
  256. package/website/versions/0.2.2/assets/style.css +0 -1341
  257. package/website/versions/0.2.2/assets/widgets.png +0 -0
  258. package/website/versions/0.2.2/assets/widgets@2x.png +0 -0
  259. package/website/versions/0.2.2/classes/EssentialEth.html +0 -5
  260. package/website/versions/0.2.2/classes/TinyBig.html +0 -146
  261. package/website/versions/0.2.2/index.html +0 -96
  262. package/website/versions/0.2.2/modules.html +0 -29
  263. package/website/versions/0.3.0/.nojekyll +0 -1
  264. package/website/versions/0.3.0/assets/highlight.css +0 -71
  265. package/website/versions/0.3.0/assets/icons.css +0 -1043
  266. package/website/versions/0.3.0/assets/icons.png +0 -0
  267. package/website/versions/0.3.0/assets/icons@2x.png +0 -0
  268. package/website/versions/0.3.0/assets/main.js +0 -52
  269. package/website/versions/0.3.0/assets/search.js +0 -1
  270. package/website/versions/0.3.0/assets/style.css +0 -1384
  271. package/website/versions/0.3.0/assets/widgets.png +0 -0
  272. package/website/versions/0.3.0/assets/widgets@2x.png +0 -0
  273. package/website/versions/0.3.0/classes/Contract.html +0 -15
  274. package/website/versions/0.3.0/classes/TinyBig.html +0 -156
  275. package/website/versions/0.3.0/index.html +0 -123
  276. package/website/versions/0.3.0/modules.html +0 -32
  277. package/website/versions/0.3.1/.nojekyll +0 -1
  278. package/website/versions/0.3.1/assets/highlight.css +0 -71
  279. package/website/versions/0.3.1/assets/icons.css +0 -1043
  280. package/website/versions/0.3.1/assets/icons.png +0 -0
  281. package/website/versions/0.3.1/assets/icons@2x.png +0 -0
  282. package/website/versions/0.3.1/assets/main.js +0 -52
  283. package/website/versions/0.3.1/assets/search.js +0 -1
  284. package/website/versions/0.3.1/assets/style.css +0 -1384
  285. package/website/versions/0.3.1/assets/widgets.png +0 -0
  286. package/website/versions/0.3.1/assets/widgets@2x.png +0 -0
  287. package/website/versions/0.3.1/classes/Contract.html +0 -15
  288. package/website/versions/0.3.1/classes/TinyBig.html +0 -156
  289. package/website/versions/0.3.1/index.html +0 -123
  290. package/website/versions/0.3.1/modules.html +0 -32
  291. package/website/versions/0.3.2/.nojekyll +0 -1
  292. package/website/versions/0.3.2/assets/highlight.css +0 -71
  293. package/website/versions/0.3.2/assets/icons.css +0 -1043
  294. package/website/versions/0.3.2/assets/icons.png +0 -0
  295. package/website/versions/0.3.2/assets/icons@2x.png +0 -0
  296. package/website/versions/0.3.2/assets/main.js +0 -52
  297. package/website/versions/0.3.2/assets/search.js +0 -1
  298. package/website/versions/0.3.2/assets/style.css +0 -1384
  299. package/website/versions/0.3.2/assets/widgets.png +0 -0
  300. package/website/versions/0.3.2/assets/widgets@2x.png +0 -0
  301. package/website/versions/0.3.2/classes/Contract.html +0 -15
  302. package/website/versions/0.3.2/classes/JsonRpcProvider.html +0 -5
  303. package/website/versions/0.3.2/classes/TinyBig.html +0 -156
  304. package/website/versions/0.3.2/index.html +0 -123
  305. package/website/versions/0.3.2/modules.html +0 -32
  306. package/website/versions/0.3.3/.nojekyll +0 -1
  307. package/website/versions/0.3.3/assets/highlight.css +0 -71
  308. package/website/versions/0.3.3/assets/icons.css +0 -1043
  309. package/website/versions/0.3.3/assets/icons.png +0 -0
  310. package/website/versions/0.3.3/assets/icons@2x.png +0 -0
  311. package/website/versions/0.3.3/assets/main.js +0 -52
  312. package/website/versions/0.3.3/assets/search.js +0 -1
  313. package/website/versions/0.3.3/assets/style.css +0 -1384
  314. package/website/versions/0.3.3/assets/widgets.png +0 -0
  315. package/website/versions/0.3.3/assets/widgets@2x.png +0 -0
  316. package/website/versions/0.3.3/classes/Contract.html +0 -15
  317. package/website/versions/0.3.3/classes/JsonRpcProvider.html +0 -5
  318. package/website/versions/0.3.3/classes/TinyBig.html +0 -156
  319. package/website/versions/0.3.3/index.html +0 -123
  320. package/website/versions/0.3.3/interfaces/Block.html +0 -1
  321. package/website/versions/0.3.3/interfaces/Transaction.html +0 -1
  322. package/website/versions/0.3.3/modules.html +0 -32
  323. package/website/versions/0.4.0/.nojekyll +0 -1
  324. package/website/versions/0.4.0/assets/highlight.css +0 -71
  325. package/website/versions/0.4.0/assets/icons.css +0 -1043
  326. package/website/versions/0.4.0/assets/icons.png +0 -0
  327. package/website/versions/0.4.0/assets/icons@2x.png +0 -0
  328. package/website/versions/0.4.0/assets/main.js +0 -52
  329. package/website/versions/0.4.0/assets/search.js +0 -1
  330. package/website/versions/0.4.0/assets/style.css +0 -1384
  331. package/website/versions/0.4.0/assets/widgets.png +0 -0
  332. package/website/versions/0.4.0/assets/widgets@2x.png +0 -0
  333. package/website/versions/0.4.0/classes/Contract.html +0 -15
  334. package/website/versions/0.4.0/classes/JsonRpcProvider.html +0 -6
  335. package/website/versions/0.4.0/classes/TinyBig.html +0 -156
  336. package/website/versions/0.4.0/index.html +0 -148
  337. package/website/versions/0.4.0/interfaces/Block.html +0 -1
  338. package/website/versions/0.4.0/interfaces/Transaction.html +0 -1
  339. package/website/versions/0.4.0/modules.html +0 -32
  340. package/website/versions/0.4.1/.nojekyll +0 -1
  341. package/website/versions/0.4.1/assets/highlight.css +0 -71
  342. package/website/versions/0.4.1/assets/icons.css +0 -1043
  343. package/website/versions/0.4.1/assets/icons.png +0 -0
  344. package/website/versions/0.4.1/assets/icons@2x.png +0 -0
  345. package/website/versions/0.4.1/assets/main.js +0 -52
  346. package/website/versions/0.4.1/assets/search.js +0 -1
  347. package/website/versions/0.4.1/assets/style.css +0 -1384
  348. package/website/versions/0.4.1/assets/widgets.png +0 -0
  349. package/website/versions/0.4.1/assets/widgets@2x.png +0 -0
  350. package/website/versions/0.4.1/classes/Contract.html +0 -15
  351. package/website/versions/0.4.1/classes/JsonRpcProvider.html +0 -6
  352. package/website/versions/0.4.1/classes/TinyBig.html +0 -156
  353. package/website/versions/0.4.1/index.html +0 -148
  354. package/website/versions/0.4.1/interfaces/Block.html +0 -1
  355. package/website/versions/0.4.1/interfaces/Transaction.html +0 -1
  356. package/website/versions/0.4.1/modules.html +0 -32
  357. package/website/versions/0.4.2/.nojekyll +0 -1
  358. package/website/versions/0.4.2/assets/highlight.css +0 -71
  359. package/website/versions/0.4.2/assets/icons.css +0 -1043
  360. package/website/versions/0.4.2/assets/icons.png +0 -0
  361. package/website/versions/0.4.2/assets/icons@2x.png +0 -0
  362. package/website/versions/0.4.2/assets/main.js +0 -52
  363. package/website/versions/0.4.2/assets/search.js +0 -1
  364. package/website/versions/0.4.2/assets/style.css +0 -1384
  365. package/website/versions/0.4.2/assets/widgets.png +0 -0
  366. package/website/versions/0.4.2/assets/widgets@2x.png +0 -0
  367. package/website/versions/0.4.2/classes/Contract.html +0 -15
  368. package/website/versions/0.4.2/classes/JsonRpcProvider.html +0 -8
  369. package/website/versions/0.4.2/classes/TinyBig.html +0 -156
  370. package/website/versions/0.4.2/index.html +0 -199
  371. package/website/versions/0.4.2/interfaces/Block.html +0 -1
  372. package/website/versions/0.4.2/interfaces/Transaction.html +0 -1
  373. package/website/versions/0.4.2/modules.html +0 -34
  374. package/website/versions/0.4.3/.nojekyll +0 -1
  375. package/website/versions/0.4.3/assets/highlight.css +0 -71
  376. package/website/versions/0.4.3/assets/icons.css +0 -1043
  377. package/website/versions/0.4.3/assets/icons.png +0 -0
  378. package/website/versions/0.4.3/assets/icons@2x.png +0 -0
  379. package/website/versions/0.4.3/assets/main.js +0 -52
  380. package/website/versions/0.4.3/assets/search.js +0 -1
  381. package/website/versions/0.4.3/assets/style.css +0 -1384
  382. package/website/versions/0.4.3/assets/widgets.png +0 -0
  383. package/website/versions/0.4.3/assets/widgets@2x.png +0 -0
  384. package/website/versions/0.4.3/classes/Contract.html +0 -15
  385. package/website/versions/0.4.3/classes/JsonRpcProvider.html +0 -8
  386. package/website/versions/0.4.3/classes/TinyBig.html +0 -159
  387. package/website/versions/0.4.3/index.html +0 -199
  388. package/website/versions/0.4.3/interfaces/Block.html +0 -1
  389. package/website/versions/0.4.3/interfaces/Transaction.html +0 -1
  390. package/website/versions/0.4.3/modules.html +0 -34
  391. package/website/versions/0.4.6/.nojekyll +0 -1
  392. package/website/versions/0.4.6/assets/highlight.css +0 -71
  393. package/website/versions/0.4.6/assets/icons.css +0 -1043
  394. package/website/versions/0.4.6/assets/icons.png +0 -0
  395. package/website/versions/0.4.6/assets/icons@2x.png +0 -0
  396. package/website/versions/0.4.6/assets/main.js +0 -52
  397. package/website/versions/0.4.6/assets/search.js +0 -1
  398. package/website/versions/0.4.6/assets/style.css +0 -1413
  399. package/website/versions/0.4.6/assets/widgets.png +0 -0
  400. package/website/versions/0.4.6/assets/widgets@2x.png +0 -0
  401. package/website/versions/0.4.6/classes/Contract.html +0 -15
  402. package/website/versions/0.4.6/classes/JsonRpcProvider.html +0 -8
  403. package/website/versions/0.4.6/classes/TinyBig.html +0 -159
  404. package/website/versions/0.4.6/index.html +0 -207
  405. package/website/versions/0.4.6/interfaces/Block.html +0 -1
  406. package/website/versions/0.4.6/interfaces/Transaction.html +0 -1
  407. package/website/versions/0.4.6/modules.html +0 -34
  408. package/website/versions/0.4.8/.nojekyll +0 -1
  409. package/website/versions/0.4.8/assets/highlight.css +0 -71
  410. package/website/versions/0.4.8/assets/icons.css +0 -1043
  411. package/website/versions/0.4.8/assets/icons.png +0 -0
  412. package/website/versions/0.4.8/assets/icons@2x.png +0 -0
  413. package/website/versions/0.4.8/assets/main.js +0 -52
  414. package/website/versions/0.4.8/assets/search.js +0 -1
  415. package/website/versions/0.4.8/assets/style.css +0 -1413
  416. package/website/versions/0.4.8/assets/widgets.png +0 -0
  417. package/website/versions/0.4.8/assets/widgets@2x.png +0 -0
  418. package/website/versions/0.4.8/classes/Contract.html +0 -15
  419. package/website/versions/0.4.8/classes/JsonRpcProvider.html +0 -8
  420. package/website/versions/0.4.8/classes/TinyBig.html +0 -161
  421. package/website/versions/0.4.8/index.html +0 -207
  422. package/website/versions/0.4.8/interfaces/Block.html +0 -1
  423. package/website/versions/0.4.8/interfaces/Transaction.html +0 -1
  424. package/website/versions/0.4.8/modules.html +0 -34
  425. package/website/versions/0.4.9-beta.0/.nojekyll +0 -1
  426. package/website/versions/0.4.9-beta.0/assets/highlight.css +0 -71
  427. package/website/versions/0.4.9-beta.0/assets/icons.css +0 -1043
  428. package/website/versions/0.4.9-beta.0/assets/icons.png +0 -0
  429. package/website/versions/0.4.9-beta.0/assets/icons@2x.png +0 -0
  430. package/website/versions/0.4.9-beta.0/assets/main.js +0 -52
  431. package/website/versions/0.4.9-beta.0/assets/search.js +0 -1
  432. package/website/versions/0.4.9-beta.0/assets/style.css +0 -1413
  433. package/website/versions/0.4.9-beta.0/assets/widgets.png +0 -0
  434. package/website/versions/0.4.9-beta.0/assets/widgets@2x.png +0 -0
  435. package/website/versions/0.4.9-beta.0/classes/Contract.html +0 -13
  436. package/website/versions/0.4.9-beta.0/classes/JsonRpcProvider.html +0 -8
  437. package/website/versions/0.4.9-beta.0/classes/TinyBig.html +0 -161
  438. package/website/versions/0.4.9-beta.0/index.html +0 -207
  439. package/website/versions/0.4.9-beta.0/interfaces/Block.html +0 -1
  440. package/website/versions/0.4.9-beta.0/interfaces/JSONABIArgument.html +0 -1
  441. package/website/versions/0.4.9-beta.0/interfaces/Network.html +0 -3
  442. package/website/versions/0.4.9-beta.0/interfaces/Transaction.html +0 -1
  443. package/website/versions/0.4.9-beta.0/modules.html +0 -32
  444. package/website/versions/0.4.9-beta.1/.nojekyll +0 -1
  445. package/website/versions/0.4.9-beta.1/assets/highlight.css +0 -71
  446. package/website/versions/0.4.9-beta.1/assets/icons.css +0 -1043
  447. package/website/versions/0.4.9-beta.1/assets/icons.png +0 -0
  448. package/website/versions/0.4.9-beta.1/assets/icons@2x.png +0 -0
  449. package/website/versions/0.4.9-beta.1/assets/main.js +0 -52
  450. package/website/versions/0.4.9-beta.1/assets/search.js +0 -1
  451. package/website/versions/0.4.9-beta.1/assets/style.css +0 -1413
  452. package/website/versions/0.4.9-beta.1/assets/widgets.png +0 -0
  453. package/website/versions/0.4.9-beta.1/assets/widgets@2x.png +0 -0
  454. package/website/versions/0.4.9-beta.1/classes/Contract.html +0 -13
  455. package/website/versions/0.4.9-beta.1/classes/JsonRpcProvider.html +0 -8
  456. package/website/versions/0.4.9-beta.1/classes/TinyBig.html +0 -161
  457. package/website/versions/0.4.9-beta.1/index.html +0 -207
  458. package/website/versions/0.4.9-beta.1/interfaces/Block.html +0 -1
  459. package/website/versions/0.4.9-beta.1/interfaces/JSONABIArgument.html +0 -1
  460. package/website/versions/0.4.9-beta.1/interfaces/Network.html +0 -3
  461. package/website/versions/0.4.9-beta.1/interfaces/Transaction.html +0 -1
  462. package/website/versions/0.4.9-beta.1/modules.html +0 -32
  463. package/website/versions/versions/0.1.2/assets/highlight.css +0 -57
  464. package/website/versions/versions/0.1.2/assets/icons.css +0 -1043
  465. package/website/versions/versions/0.1.2/assets/icons.png +0 -0
  466. package/website/versions/versions/0.1.2/assets/icons@2x.png +0 -0
  467. package/website/versions/versions/0.1.2/assets/main.js +0 -52
  468. package/website/versions/versions/0.1.2/assets/search.js +0 -1
  469. package/website/versions/versions/0.1.2/assets/style.css +0 -1341
  470. package/website/versions/versions/0.1.2/assets/widgets.png +0 -0
  471. package/website/versions/versions/0.1.2/assets/widgets@2x.png +0 -0
  472. package/website/versions/versions/0.1.2/classes/TinyBig.html +0 -4
  473. package/website/versions/versions/0.1.2/index.html +0 -20
  474. package/website/versions/versions/0.1.2/modules.html +0 -23
  475. package/website/versions/versions/0.1.3/assets/highlight.css +0 -64
  476. package/website/versions/versions/0.1.3/assets/icons.css +0 -1043
  477. package/website/versions/versions/0.1.3/assets/icons.png +0 -0
  478. package/website/versions/versions/0.1.3/assets/icons@2x.png +0 -0
  479. package/website/versions/versions/0.1.3/assets/main.js +0 -52
  480. package/website/versions/versions/0.1.3/assets/search.js +0 -1
  481. package/website/versions/versions/0.1.3/assets/style.css +0 -1341
  482. package/website/versions/versions/0.1.3/assets/widgets.png +0 -0
  483. package/website/versions/versions/0.1.3/assets/widgets@2x.png +0 -0
  484. package/website/versions/versions/0.1.3/classes/TinyBig.html +0 -4
  485. package/website/versions/versions/0.1.3/index.html +0 -53
  486. package/website/versions/versions/0.1.3/modules.html +0 -23
  487. package/website/versions/versions/0.1.4/assets/highlight.css +0 -64
  488. package/website/versions/versions/0.1.4/assets/icons.css +0 -1043
  489. package/website/versions/versions/0.1.4/assets/icons.png +0 -0
  490. package/website/versions/versions/0.1.4/assets/icons@2x.png +0 -0
  491. package/website/versions/versions/0.1.4/assets/main.js +0 -52
  492. package/website/versions/versions/0.1.4/assets/search.js +0 -1
  493. package/website/versions/versions/0.1.4/assets/style.css +0 -1341
  494. package/website/versions/versions/0.1.4/assets/widgets.png +0 -0
  495. package/website/versions/versions/0.1.4/assets/widgets@2x.png +0 -0
  496. package/website/versions/versions/0.1.4/classes/TinyBig.html +0 -4
  497. package/website/versions/versions/0.1.4/index.html +0 -58
  498. package/website/versions/versions/0.1.4/modules.html +0 -23
@@ -0,0 +1,35 @@
1
+ import { toChecksumAddress } from '../..';
2
+ import { cleanTransaction } from './clean-transaction';
3
+ import { hexToDecimal } from './hex-to-decimal';
4
+ export function cleanBlock(block, returnTransactionObjects) {
5
+ const cleanedBlock = Object.assign({}, block);
6
+ Object.keys(block).forEach((key) => {
7
+ if (!block[key])
8
+ return;
9
+ switch (key) {
10
+ case 'gasLimit':
11
+ case 'gasUsed':
12
+ case 'number':
13
+ case 'size':
14
+ case 'timestamp':
15
+ case 'baseFeePerGas':
16
+ cleanedBlock[key] = Number(hexToDecimal(block[key]));
17
+ break;
18
+ case 'difficulty':
19
+ case 'totalDifficulty':
20
+ cleanedBlock[key] = hexToDecimal(block[key]);
21
+ break;
22
+ case 'miner':
23
+ if (block[key]) {
24
+ cleanedBlock[key] = toChecksumAddress(block[key]);
25
+ }
26
+ break;
27
+ }
28
+ });
29
+ if (returnTransactionObjects) {
30
+ cleanedBlock.transactions.forEach((transaction, index) => {
31
+ cleanedBlock.transactions[index] = cleanTransaction(transaction);
32
+ });
33
+ }
34
+ return cleanedBlock;
35
+ }
@@ -0,0 +1,2 @@
1
+ import { RPCTransaction, Transaction } from '../../types/Transaction.types';
2
+ export declare function cleanTransaction(transaction: RPCTransaction): Transaction;
@@ -0,0 +1,29 @@
1
+ import { toChecksumAddress } from '../..';
2
+ import { hexToDecimal } from './hex-to-decimal';
3
+ export function cleanTransaction(transaction) {
4
+ const cleanedTransaction = Object.assign({}, transaction);
5
+ Object.keys(transaction).forEach((key) => {
6
+ if (!transaction[key])
7
+ return;
8
+ switch (key) {
9
+ case 'blockNumber':
10
+ case 'gas':
11
+ case 'nonce':
12
+ case 'transactionIndex':
13
+ case 'type':
14
+ cleanedTransaction[key] = Number(hexToDecimal(transaction[key]));
15
+ break;
16
+ case 'gasPrice':
17
+ case 'value':
18
+ cleanedTransaction[key] = hexToDecimal(transaction[key]);
19
+ break;
20
+ case 'from':
21
+ case 'to':
22
+ if (transaction[key]) {
23
+ cleanedTransaction[key] = toChecksumAddress(transaction[key]);
24
+ }
25
+ break;
26
+ }
27
+ });
28
+ return cleanedTransaction;
29
+ }
@@ -0,0 +1,3 @@
1
+ import { JSONABIArgument } from '../../types/Contract.types';
2
+ export declare function encodeData(jsonABIArgument: JSONABIArgument, args: any[]): string;
3
+ export declare function decodeRPCResponse(jsonABIArgument: JSONABIArgument, nodeResponse: string): string | number | boolean | import("../..").TinyBig | (string | number | boolean | import("../..").TinyBig)[];
@@ -0,0 +1,98 @@
1
+ import { Keccak } from 'sha3';
2
+ import { tinyBig, toChecksumAddress } from '../..';
3
+ import { hexToDecimal } from './hex-to-decimal';
4
+ const hexTrue = '0000000000000000000000000000000000000000000000000000000000000001';
5
+ const hexFalse = '0000000000000000000000000000000000000000000000000000000000000000';
6
+ function expandType(type) {
7
+ if (type === 'uint[]') {
8
+ return 'uint256[]';
9
+ }
10
+ else if (type === 'int[]') {
11
+ return 'int256[]';
12
+ }
13
+ return type;
14
+ }
15
+ export function encodeData(jsonABIArgument, args) {
16
+ const hash = new Keccak(256);
17
+ const functionString = `${jsonABIArgument.name}(${jsonABIArgument.inputs.map((input) => expandType(input.type))})`;
18
+ const functionHash = hash.update(functionString).digest('hex');
19
+ const jsonABIInputsLength = jsonABIArgument.inputs.length;
20
+ let shouldValidateInputLength = true;
21
+ if (jsonABIArgument.inputs.find((input) => input.type.includes('['))) {
22
+ shouldValidateInputLength = false;
23
+ }
24
+ if (shouldValidateInputLength && args.length !== jsonABIInputsLength) {
25
+ throw new Error(`args inputs of "${args.length}" does not match expected length of "${jsonABIArgument.inputs.length}"`);
26
+ }
27
+ const argsWithTypes = (jsonABIArgument.inputs || []).reduce((acc, input, i) => {
28
+ var _a;
29
+ if (input.type.includes('[')) {
30
+ const basicType = (_a = /([^[]*)\[.*$/g.exec(input.type)) === null || _a === void 0 ? void 0 : _a[1];
31
+ args.forEach((arg) => {
32
+ acc = acc.concat([[arg, basicType]]);
33
+ });
34
+ return acc;
35
+ }
36
+ else {
37
+ return acc.concat([[args[i], input.type]]);
38
+ }
39
+ }, []);
40
+ const encodedArgs = argsWithTypes.map(([arg, inputType]) => {
41
+ let rawArg = arg;
42
+ switch (inputType) {
43
+ case 'bool':
44
+ return arg ? hexTrue : hexFalse;
45
+ case 'address':
46
+ rawArg = arg.replace(/^0x/g, '').toLowerCase();
47
+ break;
48
+ default:
49
+ if (inputType.startsWith('bytes')) {
50
+ const argEncoded = rawArg
51
+ .split('')
52
+ .map((character) => character.charCodeAt(0).toString(16))
53
+ .join('');
54
+ const paddedEncodedArg = argEncoded.padEnd(64, '0');
55
+ return paddedEncodedArg;
56
+ }
57
+ else if (inputType === 'uint256') {
58
+ const argEncoded = BigInt(arg).toString(16);
59
+ const paddedEncodedArg = argEncoded.padStart(64, '0');
60
+ return paddedEncodedArg;
61
+ }
62
+ else if (inputType.startsWith('uint')) {
63
+ break;
64
+ }
65
+ else {
66
+ throw new Error(`essential-eth does not yet support "${inputType}" inputs. Make a PR today!"`);
67
+ }
68
+ }
69
+ const argEncoded = rawArg.toString(16);
70
+ const paddedEncodedArg = argEncoded.padStart(64, '0');
71
+ return paddedEncodedArg;
72
+ });
73
+ const functionEncoded = functionHash.slice(0, 8);
74
+ const data = `0x${functionEncoded}${encodedArgs.join('')}`;
75
+ return data;
76
+ }
77
+ export function decodeRPCResponse(jsonABIArgument, nodeResponse) {
78
+ const rawOutputs = jsonABIArgument.outputs;
79
+ const encodedOutputs = nodeResponse.slice(2).match(/.{1,64}/g);
80
+ const outputs = (encodedOutputs || []).map((output, i) => {
81
+ const outputType = (rawOutputs || [])[i].type;
82
+ switch (outputType) {
83
+ case 'bool':
84
+ return output === hexTrue;
85
+ case 'address':
86
+ return toChecksumAddress(`0x${output.slice(24)}`);
87
+ case 'uint256':
88
+ return tinyBig(hexToDecimal(`0x${output}`));
89
+ case 'bytes32':
90
+ return `0x${output}`;
91
+ case 'uint8':
92
+ return Number(hexToDecimal(`0x${output}`));
93
+ default:
94
+ throw new Error(`essential-eth does not yet support "${outputType}" outputs. Make a PR today!"`);
95
+ }
96
+ });
97
+ return outputs.length === 1 ? outputs[0] : outputs;
98
+ }
@@ -0,0 +1,9 @@
1
+ export declare function post(url: string, body: Record<string, unknown>): Promise<any>;
2
+ declare type RPCMethodName = 'eth_getBlockByNumber' | 'eth_call' | 'eth_chainId';
3
+ export declare function buildRPCPostBody(method: RPCMethodName, params: any[]): {
4
+ jsonrpc: string;
5
+ id: number;
6
+ method: RPCMethodName;
7
+ params: any[];
8
+ };
9
+ export {};
@@ -0,0 +1,25 @@
1
+ import unfetch from 'isomorphic-unfetch';
2
+ export function post(url, body) {
3
+ return unfetch(url, {
4
+ method: 'POST',
5
+ headers: {
6
+ 'Content-Type': 'application/json',
7
+ },
8
+ body: JSON.stringify(body),
9
+ })
10
+ .then((r) => r.json())
11
+ .then((response) => {
12
+ if (response.error) {
13
+ throw new Error(response.error);
14
+ }
15
+ return response.result;
16
+ });
17
+ }
18
+ export function buildRPCPostBody(method, params) {
19
+ return {
20
+ jsonrpc: '2.0',
21
+ id: 1,
22
+ method,
23
+ params,
24
+ };
25
+ }
@@ -0,0 +1 @@
1
+ export declare function hexToDecimal(hex: string): string;
@@ -0,0 +1,3 @@
1
+ export function hexToDecimal(hex) {
2
+ return BigInt(hex).toString();
3
+ }
@@ -0,0 +1,13 @@
1
+ import { Contract } from './classes/Contract';
2
+ import { JsonRpcProvider, jsonRpcProvider } from './providers/JsonRpcProvider';
3
+ import { tinyBig, TinyBig } from './shared/tiny-big/tiny-big';
4
+ import { Block } from './types/Block.types';
5
+ import { ContractTypes, JSONABI, JSONABIArgument } from './types/Contract.types';
6
+ import { Network } from './types/Network.types';
7
+ import { Transaction } from './types/Transaction.types';
8
+ import * as utils from './utils';
9
+ import { etherToWei } from './utils/ether-to-wei';
10
+ import { isAddress } from './utils/is-address';
11
+ import { toChecksumAddress } from './utils/to-checksum-address';
12
+ import { weiToEther } from './utils/wei-to-ether';
13
+ export { utils, etherToWei, isAddress, jsonRpcProvider, JsonRpcProvider, tinyBig, toChecksumAddress, weiToEther, Contract, TinyBig, Block, ContractTypes, JSONABI, JSONABIArgument, Network, Transaction, };
@@ -0,0 +1,9 @@
1
+ import { Contract } from './classes/Contract';
2
+ import { JsonRpcProvider, jsonRpcProvider } from './providers/JsonRpcProvider';
3
+ import { tinyBig, TinyBig } from './shared/tiny-big/tiny-big';
4
+ import * as utils from './utils';
5
+ import { etherToWei } from './utils/ether-to-wei';
6
+ import { isAddress } from './utils/is-address';
7
+ import { toChecksumAddress } from './utils/to-checksum-address';
8
+ import { weiToEther } from './utils/wei-to-ether';
9
+ export { utils, etherToWei, isAddress, jsonRpcProvider, JsonRpcProvider, tinyBig, toChecksumAddress, weiToEther, Contract, TinyBig, };
@@ -0,0 +1,10 @@
1
+ import { Block } from '../types/Block.types';
2
+ import { Network } from '../types/Network.types';
3
+ export declare class JsonRpcProvider {
4
+ readonly _rpcUrl: Array<string>;
5
+ _rpcUrlCounter: number;
6
+ constructor(rpcUrl?: string | Array<string>);
7
+ getBlock(timeFrame: 'latest' | 'earliest' | 'pending' | number, returnTransactionObjects?: boolean): Promise<Block>;
8
+ getNetwork(): Promise<Network>;
9
+ }
10
+ export declare function jsonRpcProvider(rpcUrl?: string): JsonRpcProvider;
@@ -0,0 +1,74 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { cleanBlock } from '../classes/utils/clean-block';
11
+ import { buildRPCPostBody, post } from '../classes/utils/fetchers';
12
+ import { hexToDecimal } from '../classes/utils/hex-to-decimal';
13
+ import chainsInfo from './utils/chains-info';
14
+ export class JsonRpcProvider {
15
+ constructor(rpcUrl) {
16
+ this._rpcUrl = (() => {
17
+ if (!rpcUrl) {
18
+ return ['https://free-eth-node.com/api/eth'];
19
+ }
20
+ else if (!Array.isArray(rpcUrl)) {
21
+ return [rpcUrl];
22
+ }
23
+ return rpcUrl;
24
+ })();
25
+ this._rpcUrlCounter = 0;
26
+ }
27
+ getBlock(timeFrame, returnTransactionObjects = false) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ let rpcTimeFrame;
30
+ if (typeof timeFrame === 'number') {
31
+ rpcTimeFrame = `0x${timeFrame.toString(16)}`;
32
+ }
33
+ else {
34
+ rpcTimeFrame = timeFrame;
35
+ }
36
+ const req = () => __awaiter(this, void 0, void 0, function* () {
37
+ return yield post(this._rpcUrl[this._rpcUrlCounter], buildRPCPostBody('eth_getBlockByNumber', [
38
+ rpcTimeFrame,
39
+ returnTransactionObjects,
40
+ ])).catch((e) => {
41
+ if (e.code === 'ENOTFOUND') {
42
+ this._rpcUrlCounter++;
43
+ return req();
44
+ }
45
+ });
46
+ });
47
+ const nodeResponse = (yield req());
48
+ return cleanBlock(nodeResponse, returnTransactionObjects);
49
+ });
50
+ }
51
+ getNetwork() {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const req = () => __awaiter(this, void 0, void 0, function* () {
54
+ return yield post(this._rpcUrl[this._rpcUrlCounter], buildRPCPostBody('eth_chainId', [])).catch((e) => {
55
+ if (e.code === 'ENOTFOUND') {
56
+ this._rpcUrlCounter++;
57
+ return req();
58
+ }
59
+ });
60
+ });
61
+ const nodeResponse = (yield req());
62
+ const chainId = hexToDecimal(nodeResponse);
63
+ const info = chainsInfo[chainId];
64
+ return {
65
+ chainId: Number(chainId),
66
+ name: info[0] || 'unknown',
67
+ ensAddress: info[1] || null,
68
+ };
69
+ });
70
+ }
71
+ }
72
+ export function jsonRpcProvider(rpcUrl) {
73
+ return new JsonRpcProvider(rpcUrl);
74
+ }
@@ -0,0 +1,360 @@
1
+ declare const _default: {
2
+ "1": string[];
3
+ "2": string[];
4
+ "3": string[];
5
+ "4": string[];
6
+ "5": string[];
7
+ "6": string[];
8
+ "7": string[];
9
+ "8": string[];
10
+ "9": string[];
11
+ "10": string[];
12
+ "11": string[];
13
+ "12": string[];
14
+ "13": string[];
15
+ "14": string[];
16
+ "15": string[];
17
+ "16": string[];
18
+ "17": string[];
19
+ "18": string[];
20
+ "19": string[];
21
+ "20": string[];
22
+ "21": string[];
23
+ "22": string[];
24
+ "23": string[];
25
+ "24": string[];
26
+ "25": string[];
27
+ "26": string[];
28
+ "27": string[];
29
+ "28": string[];
30
+ "29": string[];
31
+ "30": string[];
32
+ "31": string[];
33
+ "32": string[];
34
+ "33": string[];
35
+ "34": string[];
36
+ "35": string[];
37
+ "38": string[];
38
+ "40": string[];
39
+ "41": string[];
40
+ "42": string[];
41
+ "43": string[];
42
+ "44": string[];
43
+ "45": string[];
44
+ "50": string[];
45
+ "51": string[];
46
+ "52": string[];
47
+ "53": string[];
48
+ "55": string[];
49
+ "56": string[];
50
+ "57": string[];
51
+ "58": string[];
52
+ "59": string[];
53
+ "60": string[];
54
+ "61": string[];
55
+ "62": string[];
56
+ "63": string[];
57
+ "64": string[];
58
+ "65": string[];
59
+ "66": string[];
60
+ "67": string[];
61
+ "68": string[];
62
+ "69": string[];
63
+ "71": string[];
64
+ "74": string[];
65
+ "76": string[];
66
+ "77": string[];
67
+ "78": string[];
68
+ "80": string[];
69
+ "82": string[];
70
+ "83": string[];
71
+ "85": string[];
72
+ "86": string[];
73
+ "87": string[];
74
+ "88": string[];
75
+ "89": string[];
76
+ "90": string[];
77
+ "91": string[];
78
+ "92": string[];
79
+ "93": string[];
80
+ "95": string[];
81
+ "96": string[];
82
+ "97": string[];
83
+ "99": string[];
84
+ "100": string[];
85
+ "101": string[];
86
+ "102": string[];
87
+ "105": string[];
88
+ "106": string[];
89
+ "107": string[];
90
+ "108": string[];
91
+ "110": string[];
92
+ "111": string[];
93
+ "122": string[];
94
+ "123": string[];
95
+ "124": string[];
96
+ "125": string[];
97
+ "126": string[];
98
+ "127": string[];
99
+ "128": string[];
100
+ "137": string[];
101
+ "142": string[];
102
+ "162": string[];
103
+ "163": string[];
104
+ "170": string[];
105
+ "172": string[];
106
+ "186": string[];
107
+ "188": string[];
108
+ "189": string[];
109
+ "199": string[];
110
+ "200": string[];
111
+ "211": string[];
112
+ "222": string[];
113
+ "246": string[];
114
+ "250": string[];
115
+ "256": string[];
116
+ "258": string[];
117
+ "262": string[];
118
+ "269": string[];
119
+ "288": string[];
120
+ "321": string[];
121
+ "322": string[];
122
+ "333": string[];
123
+ "335": string[];
124
+ "336": string[];
125
+ "338": string[];
126
+ "361": string[];
127
+ "363": string[];
128
+ "364": string[];
129
+ "365": string[];
130
+ "369": string[];
131
+ "385": string[];
132
+ "420": string[];
133
+ "499": string[];
134
+ "512": string[];
135
+ "513": string[];
136
+ "555": string[];
137
+ "558": string[];
138
+ "588": string[];
139
+ "595": string[];
140
+ "600": string[];
141
+ "666": string[];
142
+ "686": string[];
143
+ "707": string[];
144
+ "708": string[];
145
+ "721": string[];
146
+ "777": string[];
147
+ "787": string[];
148
+ "803": string[];
149
+ "820": string[];
150
+ "821": string[];
151
+ "880": string[];
152
+ "888": string[];
153
+ "900": string[];
154
+ "901": string[];
155
+ "902": string[];
156
+ "903": string[];
157
+ "940": string[];
158
+ "941": string[];
159
+ "942": string[];
160
+ "977": string[];
161
+ "998": string[];
162
+ "999": string[];
163
+ "1001": string[];
164
+ "1007": string[];
165
+ "1010": string[];
166
+ "1012": string[];
167
+ "1022": string[];
168
+ "1023": string[];
169
+ "1024": string[];
170
+ "1028": string[];
171
+ "1030": string[];
172
+ "1088": string[];
173
+ "1139": string[];
174
+ "1140": string[];
175
+ "1197": string[];
176
+ "1201": string[];
177
+ "1202": string[];
178
+ "1213": string[];
179
+ "1214": string[];
180
+ "1280": string[];
181
+ "1284": string[];
182
+ "1285": string[];
183
+ "1287": string[];
184
+ "1288": string[];
185
+ "1618": string[];
186
+ "1620": string[];
187
+ "1657": string[];
188
+ "1856": string[];
189
+ "1898": string[];
190
+ "1987": string[];
191
+ "2020": string[];
192
+ "2021": string[];
193
+ "2022": string[];
194
+ "2025": string[];
195
+ "2100": string[];
196
+ "2101": string[];
197
+ "2213": string[];
198
+ "2559": string[];
199
+ "3331": string[];
200
+ "3333": string[];
201
+ "3334": string[];
202
+ "3400": string[];
203
+ "3500": string[];
204
+ "3690": string[];
205
+ "3966": string[];
206
+ "3967": string[];
207
+ "4002": string[];
208
+ "4689": string[];
209
+ "4690": string[];
210
+ "4918": string[];
211
+ "5197": string[];
212
+ "5315": string[];
213
+ "5700": string[];
214
+ "5851": string[];
215
+ "5869": string[];
216
+ "6626": string[];
217
+ "7341": string[];
218
+ "7878": string[];
219
+ "8000": string[];
220
+ "8001": string[];
221
+ "8029": string[];
222
+ "8080": string[];
223
+ "8217": string[];
224
+ "8285": string[];
225
+ "8723": string[];
226
+ "8724": string[];
227
+ "8888": string[];
228
+ "8995": string[];
229
+ "9000": string[];
230
+ "9001": string[];
231
+ "9100": string[];
232
+ "9527": string[];
233
+ "9999": string[];
234
+ "10000": string[];
235
+ "10001": string[];
236
+ "10101": string[];
237
+ "10823": string[];
238
+ "11111": string[];
239
+ "11437": string[];
240
+ "12051": string[];
241
+ "12052": string[];
242
+ "13381": string[];
243
+ "16000": string[];
244
+ "16001": string[];
245
+ "19845": string[];
246
+ "21816": string[];
247
+ "24484": string[];
248
+ "24734": string[];
249
+ "31102": string[];
250
+ "31337": string[];
251
+ "32659": string[];
252
+ "39797": string[];
253
+ "42069": string[];
254
+ "42161": string[];
255
+ "42220": string[];
256
+ "42261": string[];
257
+ "42262": string[];
258
+ "43110": string[];
259
+ "43113": string[];
260
+ "43114": string[];
261
+ "44787": string[];
262
+ "47805": string[];
263
+ "49797": string[];
264
+ "53935": string[];
265
+ "55555": string[];
266
+ "55556": string[];
267
+ "60000": string[];
268
+ "60001": string[];
269
+ "60002": string[];
270
+ "60103": string[];
271
+ "62320": string[];
272
+ "63000": string[];
273
+ "63001": string[];
274
+ "70000": string[];
275
+ "70001": string[];
276
+ "70002": string[];
277
+ "70103": string[];
278
+ "71393": string[];
279
+ "73799": string[];
280
+ "78110": string[];
281
+ "80001": string[];
282
+ "99998": string[];
283
+ "99999": string[];
284
+ "100000": string[];
285
+ "100001": string[];
286
+ "100002": string[];
287
+ "100003": string[];
288
+ "100004": string[];
289
+ "100005": string[];
290
+ "100006": string[];
291
+ "100007": string[];
292
+ "100008": string[];
293
+ "108801": string[];
294
+ "110000": string[];
295
+ "110001": string[];
296
+ "110002": string[];
297
+ "110003": string[];
298
+ "110004": string[];
299
+ "110005": string[];
300
+ "110006": string[];
301
+ "110007": string[];
302
+ "110008": string[];
303
+ "200625": string[];
304
+ "201018": string[];
305
+ "201030": string[];
306
+ "210309": string[];
307
+ "210425": string[];
308
+ "234666": string[];
309
+ "246529": string[];
310
+ "246785": string[];
311
+ "281121": string[];
312
+ "333888": string[];
313
+ "333999": string[];
314
+ "421611": string[];
315
+ "444900": string[];
316
+ "666666": string[];
317
+ "888888": string[];
318
+ "955305": string[];
319
+ "1313114": string[];
320
+ "1313500": string[];
321
+ "1337702": string[];
322
+ "7762959": string[];
323
+ "11155111": string[];
324
+ "13371337": string[];
325
+ "18289463": string[];
326
+ "20181205": string[];
327
+ "28945486": string[];
328
+ "35855456": string[];
329
+ "61717561": string[];
330
+ "99415706": string[];
331
+ "192837465": string[];
332
+ "245022926": string[];
333
+ "245022934": string[];
334
+ "245022940": string[];
335
+ "311752642": string[];
336
+ "356256156": string[];
337
+ "486217935": string[];
338
+ "1122334455": string[];
339
+ "1313161554": string[];
340
+ "1313161555": string[];
341
+ "1313161556": string[];
342
+ "1666600000": string[];
343
+ "1666600001": string[];
344
+ "1666600002": string[];
345
+ "1666600003": string[];
346
+ "1666700000": string[];
347
+ "1666700001": string[];
348
+ "1666700002": string[];
349
+ "1666700003": string[];
350
+ "2021121117": string[];
351
+ "3125659152": string[];
352
+ "4216137055": string[];
353
+ "11297108099": string[];
354
+ "11297108109": string[];
355
+ "197710212030": string[];
356
+ "197710212031": string[];
357
+ "6022140761023": string[];
358
+ "868455272153094": string[];
359
+ };
360
+ export default _default;