essential-eth 0.4.6 → 0.4.9-beta.0

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 (477) hide show
  1. package/..eslintrc.js.un~ +0 -0
  2. package/..npmignore.un~ +0 -0
  3. package/.env +1 -0
  4. package/.eslintignore +4 -0
  5. package/.eslintrc.js +34 -0
  6. package/.gitattributes +1 -0
  7. package/.github/workflows/.test.yml.un~ +0 -0
  8. package/.github/workflows/test.yml +29 -0
  9. package/.package.json.un~ +0 -0
  10. package/.prettierignore +7 -0
  11. package/.travis.yml +5 -0
  12. package/jest.config.js +9 -0
  13. package/package.json +34 -20
  14. package/readme.md +1 -2
  15. package/scripts/build-website.sh +4 -0
  16. package/scripts/bump-minor.sh +4 -0
  17. package/scripts/bump-patch.sh +4 -0
  18. package/scripts/fetch-chains-info.ts +70 -0
  19. package/scripts/pre-commit.sh +5 -0
  20. package/src/classes/Contract.ts +161 -0
  21. package/src/classes/test/Contract/crv-abi.ts +488 -0
  22. package/src/classes/test/Contract/crv.test.ts +56 -0
  23. package/src/classes/test/Contract/ens-abi.ts +452 -0
  24. package/src/classes/test/Contract/ens.test.ts +39 -0
  25. package/src/classes/test/Contract/fei-abi.ts +526 -0
  26. package/src/classes/test/Contract/fei.test.ts +86 -0
  27. package/src/classes/test/Contract/foo-abi.ts +42 -0
  28. package/src/classes/test/Contract/foo.test.ts +33 -0
  29. package/src/classes/test/Contract/uni.test.ts +72 -0
  30. package/src/classes/test/Contract/uniswap-abi.ts +121 -0
  31. package/src/classes/utils/clean-block.ts +49 -0
  32. package/src/classes/utils/clean-transaction.ts +35 -0
  33. package/src/classes/utils/encode-decode-transaction.ts +126 -0
  34. package/src/classes/utils/fetchers.ts +27 -0
  35. package/{lib/cjs/classes/utils/hex-to-decimal.d.ts → src/classes/utils/hex-to-decimal.ts} +3 -1
  36. package/src/index.ts +27 -0
  37. package/src/providers/JsonRpcProvider.ts +94 -0
  38. package/src/providers/test/get-block.test.ts +63 -0
  39. package/src/providers/test/get-network.test.ts +34 -0
  40. package/src/providers/utils/chains-info.ts +1079 -0
  41. package/src/shared/tiny-big/helpers.test.ts +30 -0
  42. package/src/shared/tiny-big/helpers.ts +89 -0
  43. package/src/shared/tiny-big/tiny-big.test.ts +10 -0
  44. package/src/shared/tiny-big/tiny-big.ts +36 -0
  45. package/src/shared/validate-type.ts +20 -0
  46. package/src/types/.Contract.types.ts.un~ +0 -0
  47. package/src/types/Block.types.ts +50 -0
  48. package/src/types/Contract.types.ts +67 -0
  49. package/src/types/Network.types.ts +8 -0
  50. package/src/types/Transaction.types.ts +35 -0
  51. package/{lib/cjs/utils/ether-to-wei.d.ts → src/utils/ether-to-wei.ts} +10 -2
  52. package/src/utils/index.ts +6 -0
  53. package/src/utils/is-address.ts +16 -0
  54. package/src/utils/tests/ether-to-wei.test.ts +65 -0
  55. package/src/utils/tests/is-address.test.ts +52 -0
  56. package/src/utils/tests/to-checksum-address.test.ts +43 -0
  57. package/src/utils/tests/wei-to-ether.test.ts +72 -0
  58. package/src/utils/to-checksum-address.ts +47 -0
  59. package/{lib/cjs/utils/wei-to-ether.d.ts → src/utils/wei-to-ether.ts} +8 -1
  60. package/test/global-setup.js +8 -0
  61. package/test/global-teardown.js +5 -0
  62. package/test/jest.setup-after-env.js +1 -0
  63. package/test/server.js +24 -0
  64. package/tsconfig-cjs.json +8 -0
  65. package/tsconfig.json +25 -0
  66. package/typedoc/options-new-version.js +8 -0
  67. package/typedoc/options.js +9 -0
  68. package/types/just-omit.d.ts +1 -0
  69. package/website/.nojekyll +1 -0
  70. package/website/assets/highlight.css +71 -0
  71. package/website/assets/icons.css +1043 -0
  72. package/website/assets/icons.png +0 -0
  73. package/website/assets/icons@2x.png +0 -0
  74. package/website/assets/main.js +52 -0
  75. package/website/assets/search.js +1 -0
  76. package/website/assets/style.css +1413 -0
  77. package/website/assets/widgets.png +0 -0
  78. package/website/assets/widgets@2x.png +0 -0
  79. package/website/classes/Contract.html +13 -0
  80. package/website/classes/JsonRpcProvider.html +8 -0
  81. package/website/classes/TinyBig.html +161 -0
  82. package/website/index.html +207 -0
  83. package/website/interfaces/Block.html +1 -0
  84. package/website/interfaces/JSONABIArgument.html +1 -0
  85. package/website/interfaces/Network.html +3 -0
  86. package/website/interfaces/Transaction.html +1 -0
  87. package/website/modules.html +32 -0
  88. package/website/versions/0.1.2/assets/highlight.css +57 -0
  89. package/website/versions/0.1.2/assets/icons.css +1043 -0
  90. package/website/versions/0.1.2/assets/icons.png +0 -0
  91. package/website/versions/0.1.2/assets/icons@2x.png +0 -0
  92. package/website/versions/0.1.2/assets/main.js +52 -0
  93. package/website/versions/0.1.2/assets/search.js +1 -0
  94. package/website/versions/0.1.2/assets/style.css +1341 -0
  95. package/website/versions/0.1.2/assets/widgets.png +0 -0
  96. package/website/versions/0.1.2/assets/widgets@2x.png +0 -0
  97. package/website/versions/0.1.2/classes/TinyBig.html +4 -0
  98. package/website/versions/0.1.2/index.html +20 -0
  99. package/website/versions/0.1.2/modules.html +23 -0
  100. package/website/versions/0.1.3/assets/highlight.css +64 -0
  101. package/website/versions/0.1.3/assets/icons.css +1043 -0
  102. package/website/versions/0.1.3/assets/icons.png +0 -0
  103. package/website/versions/0.1.3/assets/icons@2x.png +0 -0
  104. package/website/versions/0.1.3/assets/main.js +52 -0
  105. package/website/versions/0.1.3/assets/search.js +1 -0
  106. package/website/versions/0.1.3/assets/style.css +1341 -0
  107. package/website/versions/0.1.3/assets/widgets.png +0 -0
  108. package/website/versions/0.1.3/assets/widgets@2x.png +0 -0
  109. package/website/versions/0.1.3/classes/TinyBig.html +4 -0
  110. package/website/versions/0.1.3/index.html +53 -0
  111. package/website/versions/0.1.3/modules.html +23 -0
  112. package/website/versions/0.1.4/assets/highlight.css +64 -0
  113. package/website/versions/0.1.4/assets/icons.css +1043 -0
  114. package/website/versions/0.1.4/assets/icons.png +0 -0
  115. package/website/versions/0.1.4/assets/icons@2x.png +0 -0
  116. package/website/versions/0.1.4/assets/main.js +52 -0
  117. package/website/versions/0.1.4/assets/search.js +1 -0
  118. package/website/versions/0.1.4/assets/style.css +1341 -0
  119. package/website/versions/0.1.4/assets/widgets.png +0 -0
  120. package/website/versions/0.1.4/assets/widgets@2x.png +0 -0
  121. package/website/versions/0.1.4/classes/EssentialEth.html +1 -0
  122. package/website/versions/0.1.4/classes/TinyBig.html +4 -0
  123. package/website/versions/0.1.4/index.html +58 -0
  124. package/website/versions/0.1.4/modules.html +23 -0
  125. package/website/versions/0.2.0/assets/highlight.css +64 -0
  126. package/website/versions/0.2.0/assets/icons.css +1043 -0
  127. package/website/versions/0.2.0/assets/icons.png +0 -0
  128. package/website/versions/0.2.0/assets/icons@2x.png +0 -0
  129. package/website/versions/0.2.0/assets/main.js +52 -0
  130. package/website/versions/0.2.0/assets/search.js +1 -0
  131. package/website/versions/0.2.0/assets/style.css +1341 -0
  132. package/website/versions/0.2.0/assets/widgets.png +0 -0
  133. package/website/versions/0.2.0/assets/widgets@2x.png +0 -0
  134. package/website/versions/0.2.0/classes/EssentialEth.html +5 -0
  135. package/website/versions/0.2.0/classes/TinyBig.html +146 -0
  136. package/website/versions/0.2.0/index.html +89 -0
  137. package/website/versions/0.2.0/modules.html +25 -0
  138. package/website/versions/0.2.1/assets/highlight.css +64 -0
  139. package/website/versions/0.2.1/assets/icons.css +1043 -0
  140. package/website/versions/0.2.1/assets/icons.png +0 -0
  141. package/website/versions/0.2.1/assets/icons@2x.png +0 -0
  142. package/website/versions/0.2.1/assets/main.js +52 -0
  143. package/website/versions/0.2.1/assets/search.js +1 -0
  144. package/website/versions/0.2.1/assets/style.css +1341 -0
  145. package/website/versions/0.2.1/assets/widgets.png +0 -0
  146. package/website/versions/0.2.1/assets/widgets@2x.png +0 -0
  147. package/website/versions/0.2.1/classes/EssentialEth.html +5 -0
  148. package/website/versions/0.2.1/classes/TinyBig.html +146 -0
  149. package/website/versions/0.2.1/index.html +96 -0
  150. package/website/versions/0.2.1/modules.html +29 -0
  151. package/website/versions/0.2.2/assets/highlight.css +64 -0
  152. package/website/versions/0.2.2/assets/icons.css +1043 -0
  153. package/website/versions/0.2.2/assets/icons.png +0 -0
  154. package/website/versions/0.2.2/assets/icons@2x.png +0 -0
  155. package/website/versions/0.2.2/assets/main.js +52 -0
  156. package/website/versions/0.2.2/assets/search.js +1 -0
  157. package/website/versions/0.2.2/assets/style.css +1341 -0
  158. package/website/versions/0.2.2/assets/widgets.png +0 -0
  159. package/website/versions/0.2.2/assets/widgets@2x.png +0 -0
  160. package/website/versions/0.2.2/classes/EssentialEth.html +5 -0
  161. package/website/versions/0.2.2/classes/TinyBig.html +146 -0
  162. package/website/versions/0.2.2/index.html +96 -0
  163. package/website/versions/0.2.2/modules.html +29 -0
  164. package/website/versions/0.3.0/.nojekyll +1 -0
  165. package/website/versions/0.3.0/assets/highlight.css +71 -0
  166. package/website/versions/0.3.0/assets/icons.css +1043 -0
  167. package/website/versions/0.3.0/assets/icons.png +0 -0
  168. package/website/versions/0.3.0/assets/icons@2x.png +0 -0
  169. package/website/versions/0.3.0/assets/main.js +52 -0
  170. package/website/versions/0.3.0/assets/search.js +1 -0
  171. package/website/versions/0.3.0/assets/style.css +1384 -0
  172. package/website/versions/0.3.0/assets/widgets.png +0 -0
  173. package/website/versions/0.3.0/assets/widgets@2x.png +0 -0
  174. package/website/versions/0.3.0/classes/Contract.html +15 -0
  175. package/website/versions/0.3.0/classes/TinyBig.html +156 -0
  176. package/website/versions/0.3.0/index.html +123 -0
  177. package/website/versions/0.3.0/modules.html +32 -0
  178. package/website/versions/0.3.1/.nojekyll +1 -0
  179. package/website/versions/0.3.1/assets/highlight.css +71 -0
  180. package/website/versions/0.3.1/assets/icons.css +1043 -0
  181. package/website/versions/0.3.1/assets/icons.png +0 -0
  182. package/website/versions/0.3.1/assets/icons@2x.png +0 -0
  183. package/website/versions/0.3.1/assets/main.js +52 -0
  184. package/website/versions/0.3.1/assets/search.js +1 -0
  185. package/website/versions/0.3.1/assets/style.css +1384 -0
  186. package/website/versions/0.3.1/assets/widgets.png +0 -0
  187. package/website/versions/0.3.1/assets/widgets@2x.png +0 -0
  188. package/website/versions/0.3.1/classes/Contract.html +15 -0
  189. package/website/versions/0.3.1/classes/TinyBig.html +156 -0
  190. package/website/versions/0.3.1/index.html +123 -0
  191. package/website/versions/0.3.1/modules.html +32 -0
  192. package/website/versions/0.3.2/.nojekyll +1 -0
  193. package/website/versions/0.3.2/assets/highlight.css +71 -0
  194. package/website/versions/0.3.2/assets/icons.css +1043 -0
  195. package/website/versions/0.3.2/assets/icons.png +0 -0
  196. package/website/versions/0.3.2/assets/icons@2x.png +0 -0
  197. package/website/versions/0.3.2/assets/main.js +52 -0
  198. package/website/versions/0.3.2/assets/search.js +1 -0
  199. package/website/versions/0.3.2/assets/style.css +1384 -0
  200. package/website/versions/0.3.2/assets/widgets.png +0 -0
  201. package/website/versions/0.3.2/assets/widgets@2x.png +0 -0
  202. package/website/versions/0.3.2/classes/Contract.html +15 -0
  203. package/website/versions/0.3.2/classes/JsonRpcProvider.html +5 -0
  204. package/website/versions/0.3.2/classes/TinyBig.html +156 -0
  205. package/website/versions/0.3.2/index.html +123 -0
  206. package/website/versions/0.3.2/modules.html +32 -0
  207. package/website/versions/0.3.3/.nojekyll +1 -0
  208. package/website/versions/0.3.3/assets/highlight.css +71 -0
  209. package/website/versions/0.3.3/assets/icons.css +1043 -0
  210. package/website/versions/0.3.3/assets/icons.png +0 -0
  211. package/website/versions/0.3.3/assets/icons@2x.png +0 -0
  212. package/website/versions/0.3.3/assets/main.js +52 -0
  213. package/website/versions/0.3.3/assets/search.js +1 -0
  214. package/website/versions/0.3.3/assets/style.css +1384 -0
  215. package/website/versions/0.3.3/assets/widgets.png +0 -0
  216. package/website/versions/0.3.3/assets/widgets@2x.png +0 -0
  217. package/website/versions/0.3.3/classes/Contract.html +15 -0
  218. package/website/versions/0.3.3/classes/JsonRpcProvider.html +5 -0
  219. package/website/versions/0.3.3/classes/TinyBig.html +156 -0
  220. package/website/versions/0.3.3/index.html +123 -0
  221. package/website/versions/0.3.3/interfaces/Block.html +1 -0
  222. package/website/versions/0.3.3/interfaces/Transaction.html +1 -0
  223. package/website/versions/0.3.3/modules.html +32 -0
  224. package/website/versions/0.4.0/.nojekyll +1 -0
  225. package/website/versions/0.4.0/assets/highlight.css +71 -0
  226. package/website/versions/0.4.0/assets/icons.css +1043 -0
  227. package/website/versions/0.4.0/assets/icons.png +0 -0
  228. package/website/versions/0.4.0/assets/icons@2x.png +0 -0
  229. package/website/versions/0.4.0/assets/main.js +52 -0
  230. package/website/versions/0.4.0/assets/search.js +1 -0
  231. package/website/versions/0.4.0/assets/style.css +1384 -0
  232. package/website/versions/0.4.0/assets/widgets.png +0 -0
  233. package/website/versions/0.4.0/assets/widgets@2x.png +0 -0
  234. package/website/versions/0.4.0/classes/Contract.html +15 -0
  235. package/website/versions/0.4.0/classes/JsonRpcProvider.html +6 -0
  236. package/website/versions/0.4.0/classes/TinyBig.html +156 -0
  237. package/website/versions/0.4.0/index.html +148 -0
  238. package/website/versions/0.4.0/interfaces/Block.html +1 -0
  239. package/website/versions/0.4.0/interfaces/Transaction.html +1 -0
  240. package/website/versions/0.4.0/modules.html +32 -0
  241. package/website/versions/0.4.1/.nojekyll +1 -0
  242. package/website/versions/0.4.1/assets/highlight.css +71 -0
  243. package/website/versions/0.4.1/assets/icons.css +1043 -0
  244. package/website/versions/0.4.1/assets/icons.png +0 -0
  245. package/website/versions/0.4.1/assets/icons@2x.png +0 -0
  246. package/website/versions/0.4.1/assets/main.js +52 -0
  247. package/website/versions/0.4.1/assets/search.js +1 -0
  248. package/website/versions/0.4.1/assets/style.css +1384 -0
  249. package/website/versions/0.4.1/assets/widgets.png +0 -0
  250. package/website/versions/0.4.1/assets/widgets@2x.png +0 -0
  251. package/website/versions/0.4.1/classes/Contract.html +15 -0
  252. package/website/versions/0.4.1/classes/JsonRpcProvider.html +6 -0
  253. package/website/versions/0.4.1/classes/TinyBig.html +156 -0
  254. package/website/versions/0.4.1/index.html +148 -0
  255. package/website/versions/0.4.1/interfaces/Block.html +1 -0
  256. package/website/versions/0.4.1/interfaces/Transaction.html +1 -0
  257. package/website/versions/0.4.1/modules.html +32 -0
  258. package/website/versions/0.4.2/.nojekyll +1 -0
  259. package/website/versions/0.4.2/assets/highlight.css +71 -0
  260. package/website/versions/0.4.2/assets/icons.css +1043 -0
  261. package/website/versions/0.4.2/assets/icons.png +0 -0
  262. package/website/versions/0.4.2/assets/icons@2x.png +0 -0
  263. package/website/versions/0.4.2/assets/main.js +52 -0
  264. package/website/versions/0.4.2/assets/search.js +1 -0
  265. package/website/versions/0.4.2/assets/style.css +1384 -0
  266. package/website/versions/0.4.2/assets/widgets.png +0 -0
  267. package/website/versions/0.4.2/assets/widgets@2x.png +0 -0
  268. package/website/versions/0.4.2/classes/Contract.html +15 -0
  269. package/website/versions/0.4.2/classes/JsonRpcProvider.html +8 -0
  270. package/website/versions/0.4.2/classes/TinyBig.html +156 -0
  271. package/website/versions/0.4.2/index.html +199 -0
  272. package/website/versions/0.4.2/interfaces/Block.html +1 -0
  273. package/website/versions/0.4.2/interfaces/Transaction.html +1 -0
  274. package/website/versions/0.4.2/modules.html +34 -0
  275. package/website/versions/0.4.3/.nojekyll +1 -0
  276. package/website/versions/0.4.3/assets/highlight.css +71 -0
  277. package/website/versions/0.4.3/assets/icons.css +1043 -0
  278. package/website/versions/0.4.3/assets/icons.png +0 -0
  279. package/website/versions/0.4.3/assets/icons@2x.png +0 -0
  280. package/website/versions/0.4.3/assets/main.js +52 -0
  281. package/website/versions/0.4.3/assets/search.js +1 -0
  282. package/website/versions/0.4.3/assets/style.css +1384 -0
  283. package/website/versions/0.4.3/assets/widgets.png +0 -0
  284. package/website/versions/0.4.3/assets/widgets@2x.png +0 -0
  285. package/website/versions/0.4.3/classes/Contract.html +15 -0
  286. package/website/versions/0.4.3/classes/JsonRpcProvider.html +8 -0
  287. package/website/versions/0.4.3/classes/TinyBig.html +159 -0
  288. package/website/versions/0.4.3/index.html +199 -0
  289. package/website/versions/0.4.3/interfaces/Block.html +1 -0
  290. package/website/versions/0.4.3/interfaces/Transaction.html +1 -0
  291. package/website/versions/0.4.3/modules.html +34 -0
  292. package/website/versions/0.4.6/.nojekyll +1 -0
  293. package/website/versions/0.4.6/assets/highlight.css +71 -0
  294. package/website/versions/0.4.6/assets/icons.css +1043 -0
  295. package/website/versions/0.4.6/assets/icons.png +0 -0
  296. package/website/versions/0.4.6/assets/icons@2x.png +0 -0
  297. package/website/versions/0.4.6/assets/main.js +52 -0
  298. package/website/versions/0.4.6/assets/search.js +1 -0
  299. package/website/versions/0.4.6/assets/style.css +1413 -0
  300. package/website/versions/0.4.6/assets/widgets.png +0 -0
  301. package/website/versions/0.4.6/assets/widgets@2x.png +0 -0
  302. package/website/versions/0.4.6/classes/Contract.html +15 -0
  303. package/website/versions/0.4.6/classes/JsonRpcProvider.html +8 -0
  304. package/website/versions/0.4.6/classes/TinyBig.html +159 -0
  305. package/website/versions/0.4.6/index.html +207 -0
  306. package/website/versions/0.4.6/interfaces/Block.html +1 -0
  307. package/website/versions/0.4.6/interfaces/Transaction.html +1 -0
  308. package/website/versions/0.4.6/modules.html +34 -0
  309. package/website/versions/0.4.8/.nojekyll +1 -0
  310. package/website/versions/0.4.8/assets/highlight.css +71 -0
  311. package/website/versions/0.4.8/assets/icons.css +1043 -0
  312. package/website/versions/0.4.8/assets/icons.png +0 -0
  313. package/website/versions/0.4.8/assets/icons@2x.png +0 -0
  314. package/website/versions/0.4.8/assets/main.js +52 -0
  315. package/website/versions/0.4.8/assets/search.js +1 -0
  316. package/website/versions/0.4.8/assets/style.css +1413 -0
  317. package/website/versions/0.4.8/assets/widgets.png +0 -0
  318. package/website/versions/0.4.8/assets/widgets@2x.png +0 -0
  319. package/website/versions/0.4.8/classes/Contract.html +15 -0
  320. package/website/versions/0.4.8/classes/JsonRpcProvider.html +8 -0
  321. package/website/versions/0.4.8/classes/TinyBig.html +161 -0
  322. package/website/versions/0.4.8/index.html +207 -0
  323. package/website/versions/0.4.8/interfaces/Block.html +1 -0
  324. package/website/versions/0.4.8/interfaces/Transaction.html +1 -0
  325. package/website/versions/0.4.8/modules.html +34 -0
  326. package/website/versions/0.4.9-beta.0/.nojekyll +1 -0
  327. package/website/versions/0.4.9-beta.0/assets/highlight.css +71 -0
  328. package/website/versions/0.4.9-beta.0/assets/icons.css +1043 -0
  329. package/website/versions/0.4.9-beta.0/assets/icons.png +0 -0
  330. package/website/versions/0.4.9-beta.0/assets/icons@2x.png +0 -0
  331. package/website/versions/0.4.9-beta.0/assets/main.js +52 -0
  332. package/website/versions/0.4.9-beta.0/assets/search.js +1 -0
  333. package/website/versions/0.4.9-beta.0/assets/style.css +1413 -0
  334. package/website/versions/0.4.9-beta.0/assets/widgets.png +0 -0
  335. package/website/versions/0.4.9-beta.0/assets/widgets@2x.png +0 -0
  336. package/website/versions/0.4.9-beta.0/classes/Contract.html +13 -0
  337. package/website/versions/0.4.9-beta.0/classes/JsonRpcProvider.html +8 -0
  338. package/website/versions/0.4.9-beta.0/classes/TinyBig.html +161 -0
  339. package/website/versions/0.4.9-beta.0/index.html +207 -0
  340. package/website/versions/0.4.9-beta.0/interfaces/Block.html +1 -0
  341. package/website/versions/0.4.9-beta.0/interfaces/JSONABIArgument.html +1 -0
  342. package/website/versions/0.4.9-beta.0/interfaces/Network.html +3 -0
  343. package/website/versions/0.4.9-beta.0/interfaces/Transaction.html +1 -0
  344. package/website/versions/0.4.9-beta.0/modules.html +32 -0
  345. package/website/versions/versions/0.1.2/assets/highlight.css +57 -0
  346. package/website/versions/versions/0.1.2/assets/icons.css +1043 -0
  347. package/website/versions/versions/0.1.2/assets/icons.png +0 -0
  348. package/website/versions/versions/0.1.2/assets/icons@2x.png +0 -0
  349. package/website/versions/versions/0.1.2/assets/main.js +52 -0
  350. package/website/versions/versions/0.1.2/assets/search.js +1 -0
  351. package/website/versions/versions/0.1.2/assets/style.css +1341 -0
  352. package/website/versions/versions/0.1.2/assets/widgets.png +0 -0
  353. package/website/versions/versions/0.1.2/assets/widgets@2x.png +0 -0
  354. package/website/versions/versions/0.1.2/classes/TinyBig.html +4 -0
  355. package/website/versions/versions/0.1.2/index.html +20 -0
  356. package/website/versions/versions/0.1.2/modules.html +23 -0
  357. package/website/versions/versions/0.1.3/assets/highlight.css +64 -0
  358. package/website/versions/versions/0.1.3/assets/icons.css +1043 -0
  359. package/website/versions/versions/0.1.3/assets/icons.png +0 -0
  360. package/website/versions/versions/0.1.3/assets/icons@2x.png +0 -0
  361. package/website/versions/versions/0.1.3/assets/main.js +52 -0
  362. package/website/versions/versions/0.1.3/assets/search.js +1 -0
  363. package/website/versions/versions/0.1.3/assets/style.css +1341 -0
  364. package/website/versions/versions/0.1.3/assets/widgets.png +0 -0
  365. package/website/versions/versions/0.1.3/assets/widgets@2x.png +0 -0
  366. package/website/versions/versions/0.1.3/classes/TinyBig.html +4 -0
  367. package/website/versions/versions/0.1.3/index.html +53 -0
  368. package/website/versions/versions/0.1.3/modules.html +23 -0
  369. package/website/versions/versions/0.1.4/assets/highlight.css +64 -0
  370. package/website/versions/versions/0.1.4/assets/icons.css +1043 -0
  371. package/website/versions/versions/0.1.4/assets/icons.png +0 -0
  372. package/website/versions/versions/0.1.4/assets/icons@2x.png +0 -0
  373. package/website/versions/versions/0.1.4/assets/main.js +52 -0
  374. package/website/versions/versions/0.1.4/assets/search.js +1 -0
  375. package/website/versions/versions/0.1.4/assets/style.css +1341 -0
  376. package/website/versions/versions/0.1.4/assets/widgets.png +0 -0
  377. package/website/versions/versions/0.1.4/assets/widgets@2x.png +0 -0
  378. package/website/versions/versions/0.1.4/classes/TinyBig.html +4 -0
  379. package/website/versions/versions/0.1.4/index.html +58 -0
  380. package/website/versions/versions/0.1.4/modules.html +23 -0
  381. package/lib/cjs/classes/Contract.d.ts +0 -72
  382. package/lib/cjs/classes/Contract.js +0 -126
  383. package/lib/cjs/classes/test/Contract/crv-abi.d.ts +0 -2
  384. package/lib/cjs/classes/test/Contract/crv-abi.js +0 -488
  385. package/lib/cjs/classes/test/Contract/ens-abi.d.ts +0 -2
  386. package/lib/cjs/classes/test/Contract/ens-abi.js +0 -453
  387. package/lib/cjs/classes/test/Contract/fei-abi.d.ts +0 -2
  388. package/lib/cjs/classes/test/Contract/fei-abi.js +0 -526
  389. package/lib/cjs/classes/test/Contract/foo-abi.d.ts +0 -2
  390. package/lib/cjs/classes/test/Contract/foo-abi.js +0 -42
  391. package/lib/cjs/classes/test/Contract/uniswap-abi.d.ts +0 -2
  392. package/lib/cjs/classes/test/Contract/uniswap-abi.js +0 -121
  393. package/lib/cjs/classes/utils/clean-block.d.ts +0 -6
  394. package/lib/cjs/classes/utils/clean-block.js +0 -46
  395. package/lib/cjs/classes/utils/clean-transaction.d.ts +0 -5
  396. package/lib/cjs/classes/utils/clean-transaction.js +0 -38
  397. package/lib/cjs/classes/utils/encode-decode-transaction.d.ts +0 -3
  398. package/lib/cjs/classes/utils/encode-decode-transaction.js +0 -113
  399. package/lib/cjs/classes/utils/fetchers.d.ts +0 -9
  400. package/lib/cjs/classes/utils/fetchers.js +0 -33
  401. package/lib/cjs/classes/utils/hex-to-decimal.js +0 -11
  402. package/lib/cjs/index.d.ts +0 -12
  403. package/lib/cjs/index.js +0 -19
  404. package/lib/cjs/providers/JsonRpcProvider.d.ts +0 -22
  405. package/lib/cjs/providers/JsonRpcProvider.js +0 -69
  406. package/lib/cjs/providers/utils/chains-info.d.ts +0 -338
  407. package/lib/cjs/providers/utils/chains-info.js +0 -1015
  408. package/lib/cjs/shared/tiny-big/helpers.d.ts +0 -1
  409. package/lib/cjs/shared/tiny-big/helpers.js +0 -71
  410. package/lib/cjs/shared/tiny-big/tiny-big.d.ts +0 -19
  411. package/lib/cjs/shared/tiny-big/tiny-big.js +0 -41
  412. package/lib/cjs/shared/validate-type.d.ts +0 -3
  413. package/lib/cjs/shared/validate-type.js +0 -9
  414. package/lib/cjs/types/Block.types.d.ts +0 -47
  415. package/lib/cjs/types/Block.types.js +0 -2
  416. package/lib/cjs/types/Contract.types.d.ts +0 -24
  417. package/lib/cjs/types/Contract.types.js +0 -2
  418. package/lib/cjs/types/Network.types.d.ts +0 -8
  419. package/lib/cjs/types/Network.types.js +0 -2
  420. package/lib/cjs/types/Transaction.types.d.ts +0 -34
  421. package/lib/cjs/types/Transaction.types.js +0 -2
  422. package/lib/cjs/utils/ether-to-wei.js +0 -32
  423. package/lib/cjs/utils/is-address.d.ts +0 -5
  424. package/lib/cjs/utils/is-address.js +0 -20
  425. package/lib/cjs/utils/to-checksum-address.d.ts +0 -17
  426. package/lib/cjs/utils/to-checksum-address.js +0 -46
  427. package/lib/cjs/utils/wei-to-ether.js +0 -34
  428. package/lib/esm/classes/Contract.d.ts +0 -12
  429. package/lib/esm/classes/Contract.js +0 -63
  430. package/lib/esm/classes/test/Contract/crv-abi.d.ts +0 -2
  431. package/lib/esm/classes/test/Contract/crv-abi.js +0 -470
  432. package/lib/esm/classes/test/Contract/ens-abi.d.ts +0 -2
  433. package/lib/esm/classes/test/Contract/ens-abi.js +0 -435
  434. package/lib/esm/classes/test/Contract/fei-abi.d.ts +0 -2
  435. package/lib/esm/classes/test/Contract/fei-abi.js +0 -521
  436. package/lib/esm/classes/test/Contract/foo-abi.d.ts +0 -2
  437. package/lib/esm/classes/test/Contract/foo-abi.js +0 -33
  438. package/lib/esm/classes/test/Contract/uniswap-abi.d.ts +0 -2
  439. package/lib/esm/classes/test/Contract/uniswap-abi.js +0 -116
  440. package/lib/esm/classes/utils/clean-block.d.ts +0 -3
  441. package/lib/esm/classes/utils/clean-block.js +0 -35
  442. package/lib/esm/classes/utils/clean-transaction.d.ts +0 -2
  443. package/lib/esm/classes/utils/clean-transaction.js +0 -29
  444. package/lib/esm/classes/utils/encode-decode-transaction.d.ts +0 -3
  445. package/lib/esm/classes/utils/encode-decode-transaction.js +0 -98
  446. package/lib/esm/classes/utils/fetchers.d.ts +0 -9
  447. package/lib/esm/classes/utils/fetchers.js +0 -25
  448. package/lib/esm/classes/utils/hex-to-decimal.d.ts +0 -1
  449. package/lib/esm/classes/utils/hex-to-decimal.js +0 -3
  450. package/lib/esm/index.d.ts +0 -12
  451. package/lib/esm/index.js +0 -8
  452. package/lib/esm/providers/JsonRpcProvider.d.ts +0 -9
  453. package/lib/esm/providers/JsonRpcProvider.js +0 -49
  454. package/lib/esm/providers/utils/chains-info.d.ts +0 -338
  455. package/lib/esm/providers/utils/chains-info.js +0 -1011
  456. package/lib/esm/shared/tiny-big/helpers.d.ts +0 -1
  457. package/lib/esm/shared/tiny-big/helpers.js +0 -58
  458. package/lib/esm/shared/tiny-big/tiny-big.d.ts +0 -8
  459. package/lib/esm/shared/tiny-big/tiny-big.js +0 -22
  460. package/lib/esm/shared/validate-type.d.ts +0 -3
  461. package/lib/esm/shared/validate-type.js +0 -5
  462. package/lib/esm/types/Block.types.d.ts +0 -47
  463. package/lib/esm/types/Block.types.js +0 -1
  464. package/lib/esm/types/Contract.types.d.ts +0 -24
  465. package/lib/esm/types/Contract.types.js +0 -1
  466. package/lib/esm/types/Network.types.d.ts +0 -5
  467. package/lib/esm/types/Network.types.js +0 -1
  468. package/lib/esm/types/Transaction.types.d.ts +0 -34
  469. package/lib/esm/types/Transaction.types.js +0 -1
  470. package/lib/esm/utils/ether-to-wei.d.ts +0 -3
  471. package/lib/esm/utils/ether-to-wei.js +0 -7
  472. package/lib/esm/utils/is-address.d.ts +0 -1
  473. package/lib/esm/utils/is-address.js +0 -12
  474. package/lib/esm/utils/to-checksum-address.d.ts +0 -1
  475. package/lib/esm/utils/to-checksum-address.js +0 -25
  476. package/lib/esm/utils/wei-to-ether.d.ts +0 -3
  477. package/lib/esm/utils/wei-to-ether.js +0 -7
@@ -0,0 +1,526 @@
1
+ import { JSONABI } from '../../../types/Contract.types';
2
+
3
+ export const feiABI: JSONABI =
4
+ // http://api.etherscan.io/api?module=contract&action=getabi&address=0x090d4613473dee047c3f2706764f49e0821d256e&format=raw
5
+
6
+ [
7
+ {
8
+ inputs: [
9
+ { internalType: 'address', name: '_core', type: 'address' },
10
+ { internalType: 'address', name: '_bondingcurve', type: 'address' },
11
+ { internalType: 'address', name: '_ido', type: 'address' },
12
+ { internalType: 'address', name: '_oracle', type: 'address' },
13
+ { internalType: 'uint256', name: '_duration', type: 'uint256' },
14
+ {
15
+ internalType: 'uint256',
16
+ name: '_exchangeRateDiscount',
17
+ type: 'uint256',
18
+ },
19
+ ],
20
+ stateMutability: 'nonpayable',
21
+ type: 'constructor',
22
+ },
23
+ {
24
+ anonymous: false,
25
+ inputs: [
26
+ {
27
+ indexed: true,
28
+ internalType: 'address',
29
+ name: 'owner',
30
+ type: 'address',
31
+ },
32
+ {
33
+ indexed: true,
34
+ internalType: 'address',
35
+ name: 'spender',
36
+ type: 'address',
37
+ },
38
+ {
39
+ indexed: false,
40
+ internalType: 'uint256',
41
+ name: 'value',
42
+ type: 'uint256',
43
+ },
44
+ ],
45
+ name: 'Approval',
46
+ type: 'event',
47
+ },
48
+ {
49
+ anonymous: false,
50
+ inputs: [
51
+ {
52
+ indexed: true,
53
+ internalType: 'address',
54
+ name: '_from',
55
+ type: 'address',
56
+ },
57
+ {
58
+ indexed: true,
59
+ internalType: 'address',
60
+ name: '_to',
61
+ type: 'address',
62
+ },
63
+ {
64
+ indexed: false,
65
+ internalType: 'uint256',
66
+ name: '_amount',
67
+ type: 'uint256',
68
+ },
69
+ ],
70
+ name: 'Commit',
71
+ type: 'event',
72
+ },
73
+ {
74
+ anonymous: false,
75
+ inputs: [
76
+ {
77
+ indexed: true,
78
+ internalType: 'address',
79
+ name: '_core',
80
+ type: 'address',
81
+ },
82
+ ],
83
+ name: 'CoreUpdate',
84
+ type: 'event',
85
+ },
86
+ {
87
+ anonymous: false,
88
+ inputs: [
89
+ {
90
+ indexed: false,
91
+ internalType: 'uint256',
92
+ name: '_duration',
93
+ type: 'uint256',
94
+ },
95
+ ],
96
+ name: 'DurationUpdate',
97
+ type: 'event',
98
+ },
99
+ {
100
+ anonymous: false,
101
+ inputs: [
102
+ {
103
+ indexed: false,
104
+ internalType: 'uint256',
105
+ name: '_timestamp',
106
+ type: 'uint256',
107
+ },
108
+ ],
109
+ name: 'Launch',
110
+ type: 'event',
111
+ },
112
+ {
113
+ anonymous: false,
114
+ inputs: [
115
+ {
116
+ indexed: false,
117
+ internalType: 'address',
118
+ name: 'account',
119
+ type: 'address',
120
+ },
121
+ ],
122
+ name: 'Paused',
123
+ type: 'event',
124
+ },
125
+ {
126
+ anonymous: false,
127
+ inputs: [
128
+ {
129
+ indexed: true,
130
+ internalType: 'address',
131
+ name: '_to',
132
+ type: 'address',
133
+ },
134
+ {
135
+ indexed: false,
136
+ internalType: 'uint256',
137
+ name: '_value',
138
+ type: 'uint256',
139
+ },
140
+ ],
141
+ name: 'Purchase',
142
+ type: 'event',
143
+ },
144
+ {
145
+ anonymous: false,
146
+ inputs: [
147
+ {
148
+ indexed: true,
149
+ internalType: 'address',
150
+ name: '_to',
151
+ type: 'address',
152
+ },
153
+ {
154
+ indexed: false,
155
+ internalType: 'uint256',
156
+ name: '_amountIn',
157
+ type: 'uint256',
158
+ },
159
+ {
160
+ indexed: false,
161
+ internalType: 'uint256',
162
+ name: '_amountFei',
163
+ type: 'uint256',
164
+ },
165
+ {
166
+ indexed: false,
167
+ internalType: 'uint256',
168
+ name: '_amountTribe',
169
+ type: 'uint256',
170
+ },
171
+ ],
172
+ name: 'Redeem',
173
+ type: 'event',
174
+ },
175
+ {
176
+ anonymous: false,
177
+ inputs: [
178
+ {
179
+ indexed: false,
180
+ internalType: 'uint256',
181
+ name: '_startTime',
182
+ type: 'uint256',
183
+ },
184
+ ],
185
+ name: 'TimerReset',
186
+ type: 'event',
187
+ },
188
+ {
189
+ anonymous: false,
190
+ inputs: [
191
+ {
192
+ indexed: true,
193
+ internalType: 'address',
194
+ name: 'from',
195
+ type: 'address',
196
+ },
197
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
198
+ {
199
+ indexed: false,
200
+ internalType: 'uint256',
201
+ name: 'value',
202
+ type: 'uint256',
203
+ },
204
+ ],
205
+ name: 'Transfer',
206
+ type: 'event',
207
+ },
208
+ {
209
+ anonymous: false,
210
+ inputs: [
211
+ {
212
+ indexed: false,
213
+ internalType: 'address',
214
+ name: 'account',
215
+ type: 'address',
216
+ },
217
+ ],
218
+ name: 'Unpaused',
219
+ type: 'event',
220
+ },
221
+ {
222
+ inputs: [
223
+ { internalType: 'address', name: 'owner', type: 'address' },
224
+ { internalType: 'address', name: 'spender', type: 'address' },
225
+ ],
226
+ name: 'allowance',
227
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
228
+ stateMutability: 'view',
229
+ type: 'function',
230
+ },
231
+ {
232
+ inputs: [
233
+ { internalType: 'address', name: 'spender', type: 'address' },
234
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
235
+ ],
236
+ name: 'approve',
237
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
238
+ stateMutability: 'nonpayable',
239
+ type: 'function',
240
+ },
241
+ {
242
+ inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
243
+ name: 'balanceOf',
244
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
245
+ stateMutability: 'view',
246
+ type: 'function',
247
+ },
248
+ {
249
+ inputs: [
250
+ { internalType: 'address', name: 'from', type: 'address' },
251
+ { internalType: 'address', name: 'to', type: 'address' },
252
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
253
+ ],
254
+ name: 'commit',
255
+ outputs: [],
256
+ stateMutability: 'nonpayable',
257
+ type: 'function',
258
+ },
259
+ {
260
+ inputs: [{ internalType: 'address', name: '', type: 'address' }],
261
+ name: 'committedFGEN',
262
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
263
+ stateMutability: 'view',
264
+ type: 'function',
265
+ },
266
+ {
267
+ inputs: [],
268
+ name: 'core',
269
+ outputs: [{ internalType: 'contract ICore', name: '', type: 'address' }],
270
+ stateMutability: 'view',
271
+ type: 'function',
272
+ },
273
+ {
274
+ inputs: [],
275
+ name: 'decimals',
276
+ outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],
277
+ stateMutability: 'view',
278
+ type: 'function',
279
+ },
280
+ {
281
+ inputs: [
282
+ { internalType: 'address', name: 'spender', type: 'address' },
283
+ { internalType: 'uint256', name: 'subtractedValue', type: 'uint256' },
284
+ ],
285
+ name: 'decreaseAllowance',
286
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
287
+ stateMutability: 'nonpayable',
288
+ type: 'function',
289
+ },
290
+ {
291
+ inputs: [],
292
+ name: 'duration',
293
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
294
+ stateMutability: 'view',
295
+ type: 'function',
296
+ },
297
+ {
298
+ inputs: [
299
+ { internalType: 'address', name: 'from', type: 'address' },
300
+ { internalType: 'address payable', name: 'to', type: 'address' },
301
+ ],
302
+ name: 'emergencyExit',
303
+ outputs: [],
304
+ stateMutability: 'nonpayable',
305
+ type: 'function',
306
+ },
307
+ {
308
+ inputs: [],
309
+ name: 'fei',
310
+ outputs: [{ internalType: 'contract IFei', name: '', type: 'address' }],
311
+ stateMutability: 'view',
312
+ type: 'function',
313
+ },
314
+ {
315
+ inputs: [],
316
+ name: 'feiBalance',
317
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
318
+ stateMutability: 'view',
319
+ type: 'function',
320
+ },
321
+ {
322
+ inputs: [
323
+ { internalType: 'uint256', name: 'amountIn', type: 'uint256' },
324
+ { internalType: 'bool', name: 'inclusive', type: 'bool' },
325
+ ],
326
+ name: 'getAmountOut',
327
+ outputs: [
328
+ { internalType: 'uint256', name: 'feiAmount', type: 'uint256' },
329
+ { internalType: 'uint256', name: 'tribeAmount', type: 'uint256' },
330
+ ],
331
+ stateMutability: 'view',
332
+ type: 'function',
333
+ },
334
+ {
335
+ inputs: [{ internalType: 'address', name: 'to', type: 'address' }],
336
+ name: 'getAmountsToRedeem',
337
+ outputs: [
338
+ { internalType: 'uint256', name: 'feiAmount', type: 'uint256' },
339
+ { internalType: 'uint256', name: 'genesisTribe', type: 'uint256' },
340
+ { internalType: 'uint256', name: 'idoTribe', type: 'uint256' },
341
+ ],
342
+ stateMutability: 'view',
343
+ type: 'function',
344
+ },
345
+ {
346
+ inputs: [
347
+ { internalType: 'address', name: 'spender', type: 'address' },
348
+ { internalType: 'uint256', name: 'addedValue', type: 'uint256' },
349
+ ],
350
+ name: 'increaseAllowance',
351
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
352
+ stateMutability: 'nonpayable',
353
+ type: 'function',
354
+ },
355
+ {
356
+ inputs: [],
357
+ name: 'initGenesis',
358
+ outputs: [],
359
+ stateMutability: 'nonpayable',
360
+ type: 'function',
361
+ },
362
+ {
363
+ inputs: [],
364
+ name: 'isTimeEnded',
365
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
366
+ stateMutability: 'view',
367
+ type: 'function',
368
+ },
369
+ {
370
+ inputs: [],
371
+ name: 'isTimeStarted',
372
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
373
+ stateMutability: 'view',
374
+ type: 'function',
375
+ },
376
+ {
377
+ inputs: [],
378
+ name: 'launch',
379
+ outputs: [],
380
+ stateMutability: 'nonpayable',
381
+ type: 'function',
382
+ },
383
+ {
384
+ inputs: [],
385
+ name: 'launchBlock',
386
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
387
+ stateMutability: 'view',
388
+ type: 'function',
389
+ },
390
+ {
391
+ inputs: [],
392
+ name: 'name',
393
+ outputs: [{ internalType: 'string', name: '', type: 'string' }],
394
+ stateMutability: 'view',
395
+ type: 'function',
396
+ },
397
+ {
398
+ inputs: [],
399
+ name: 'pause',
400
+ outputs: [],
401
+ stateMutability: 'nonpayable',
402
+ type: 'function',
403
+ },
404
+ {
405
+ inputs: [],
406
+ name: 'paused',
407
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
408
+ stateMutability: 'view',
409
+ type: 'function',
410
+ },
411
+ {
412
+ inputs: [
413
+ { internalType: 'address', name: 'to', type: 'address' },
414
+ { internalType: 'uint256', name: 'value', type: 'uint256' },
415
+ ],
416
+ name: 'purchase',
417
+ outputs: [],
418
+ stateMutability: 'payable',
419
+ type: 'function',
420
+ },
421
+ {
422
+ inputs: [{ internalType: 'address', name: 'to', type: 'address' }],
423
+ name: 'redeem',
424
+ outputs: [],
425
+ stateMutability: 'nonpayable',
426
+ type: 'function',
427
+ },
428
+ {
429
+ inputs: [],
430
+ name: 'remainingTime',
431
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
432
+ stateMutability: 'view',
433
+ type: 'function',
434
+ },
435
+ {
436
+ inputs: [{ internalType: 'address', name: 'core', type: 'address' }],
437
+ name: 'setCore',
438
+ outputs: [],
439
+ stateMutability: 'nonpayable',
440
+ type: 'function',
441
+ },
442
+ {
443
+ inputs: [],
444
+ name: 'startTime',
445
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
446
+ stateMutability: 'view',
447
+ type: 'function',
448
+ },
449
+ {
450
+ inputs: [],
451
+ name: 'symbol',
452
+ outputs: [{ internalType: 'string', name: '', type: 'string' }],
453
+ stateMutability: 'view',
454
+ type: 'function',
455
+ },
456
+ {
457
+ inputs: [],
458
+ name: 'timeSinceStart',
459
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
460
+ stateMutability: 'view',
461
+ type: 'function',
462
+ },
463
+ {
464
+ inputs: [],
465
+ name: 'totalCommittedFGEN',
466
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
467
+ stateMutability: 'view',
468
+ type: 'function',
469
+ },
470
+ {
471
+ inputs: [],
472
+ name: 'totalCommittedTribe',
473
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
474
+ stateMutability: 'view',
475
+ type: 'function',
476
+ },
477
+ {
478
+ inputs: [],
479
+ name: 'totalSupply',
480
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
481
+ stateMutability: 'view',
482
+ type: 'function',
483
+ },
484
+ {
485
+ inputs: [
486
+ { internalType: 'address', name: 'recipient', type: 'address' },
487
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
488
+ ],
489
+ name: 'transfer',
490
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
491
+ stateMutability: 'nonpayable',
492
+ type: 'function',
493
+ },
494
+ {
495
+ inputs: [
496
+ { internalType: 'address', name: 'sender', type: 'address' },
497
+ { internalType: 'address', name: 'recipient', type: 'address' },
498
+ { internalType: 'uint256', name: 'amount', type: 'uint256' },
499
+ ],
500
+ name: 'transferFrom',
501
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
502
+ stateMutability: 'nonpayable',
503
+ type: 'function',
504
+ },
505
+ {
506
+ inputs: [],
507
+ name: 'tribe',
508
+ outputs: [{ internalType: 'contract IERC20', name: '', type: 'address' }],
509
+ stateMutability: 'view',
510
+ type: 'function',
511
+ },
512
+ {
513
+ inputs: [],
514
+ name: 'tribeBalance',
515
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
516
+ stateMutability: 'view',
517
+ type: 'function',
518
+ },
519
+ {
520
+ inputs: [],
521
+ name: 'unpause',
522
+ outputs: [],
523
+ stateMutability: 'nonpayable',
524
+ type: 'function',
525
+ },
526
+ ];
@@ -0,0 +1,86 @@
1
+ import { Contract as EthersContract } from '@ethersproject/contracts';
2
+ import { StaticJsonRpcProvider } from '@ethersproject/providers';
3
+ import { TinyBig } from '../../..';
4
+ import { JsonRpcProvider } from '../../../providers/JsonRpcProvider';
5
+ import { Contract as EssentialEthContract } from '../../Contract';
6
+ import { feiABI } from './fei-abi';
7
+
8
+ // The JSONABI
9
+ const JSONABI = feiABI;
10
+
11
+ const rpcURL = `${process.env.RPC_ORIGIN}/api/eth`;
12
+ const ethersProvider = new StaticJsonRpcProvider(rpcURL);
13
+ const essentialEthProvider = new JsonRpcProvider(rpcURL);
14
+
15
+ // https://etherscan.io/address/0xBFfB152b9392e38CdDc275D818a3Db7FE364596b
16
+ const contractAddress = '0xBFfB152b9392e38CdDc275D818a3Db7FE364596b';
17
+
18
+ const smartContractGetFeiAmountsToRedeem = async (
19
+ contract: any,
20
+ address: string,
21
+ ) => {
22
+ const merkleRoot = (await contract.getAmountsToRedeem(address)) as TinyBig[];
23
+ return merkleRoot;
24
+ };
25
+
26
+ const ethersContract = new EthersContract(
27
+ contractAddress,
28
+ JSONABI as any,
29
+ ethersProvider,
30
+ );
31
+ const essentialEthContract = new EssentialEthContract(
32
+ contractAddress,
33
+ JSONABI,
34
+ essentialEthProvider,
35
+ );
36
+ describe('fEI contract', () => {
37
+ it('should fetch unclaimed amounts "[uint256, uint256, uint256]" data-type', async () => {
38
+ const [ethersResponse, essentialEthResponse] = await Promise.all([
39
+ smartContractGetFeiAmountsToRedeem(
40
+ ethersContract,
41
+ '0xf5dBA31743ea341057280bb3AdD5c2Fb505BDC4C',
42
+ ),
43
+ smartContractGetFeiAmountsToRedeem(
44
+ essentialEthContract,
45
+ '0xf5dBA31743ea341057280bb3AdD5c2Fb505BDC4C',
46
+ ),
47
+ ]);
48
+ expect(ethersResponse[0].toString()).toStrictEqual(
49
+ essentialEthResponse[0].toString(),
50
+ );
51
+ expect(ethersResponse[1].toString()).toStrictEqual(
52
+ essentialEthResponse[1].toString(),
53
+ );
54
+ expect(ethersResponse[2].toString()).toStrictEqual(
55
+ essentialEthResponse[2].toString(),
56
+ );
57
+
58
+ expect(essentialEthResponse[2].toNumber()).toBe(0);
59
+ });
60
+ it('should fetch "uint8" data-type', async () => {
61
+ const [ethersResponse, essentialEthResponse] = await Promise.all([
62
+ ethersContract.decimals(),
63
+ essentialEthContract.decimals(),
64
+ ]);
65
+ expect(ethersResponse).toStrictEqual(essentialEthResponse);
66
+ });
67
+
68
+ it('should throw errors for methods using unsupported data-types', async () => {
69
+ await expect(essentialEthContract.name()).rejects.toThrow(
70
+ 'essential-eth does not yet support "string" outputs. Make a PR today!',
71
+ );
72
+ });
73
+ // it.only('should fetch "string" name data-type', async () => {
74
+ // const [ethersResponse, essentialEthResponse] = await Promise.all([
75
+ // ethersContract.symbol(),
76
+ // essentialEthContract.symbol(),
77
+ // ]);
78
+ // expect(ethersResponse).toStrictEqual(essentialEthResponse);
79
+
80
+ // const [ethers2Response, essential2EthResponse] = await Promise.all([
81
+ // ethersContract.name(),
82
+ // essentialEthContract.name(),
83
+ // ]);
84
+ // expect(ethers2Response).toStrictEqual(essential2EthResponse);
85
+ // });
86
+ });
@@ -0,0 +1,42 @@
1
+ // https://docs.soliditylang.org/en/v0.6.8/abi-spec.html#examples
2
+ // contract Foo {
3
+ // function bar(bytes3[2] memory) public pure {}
4
+ // function baz(uint32 x, bool y) public pure returns (bool r) { r = x > 32 || y; }
5
+ // function sam(bytes memory, bool, uint[] memory) public pure {}
6
+
7
+ import { JSONABI } from '../../..';
8
+
9
+ // }
10
+ export const fooABI: JSONABI = [
11
+ {
12
+ inputs: [
13
+ {
14
+ internalType: 'bytes3[2]',
15
+ name: 'memory',
16
+ type: 'bytes3[2]',
17
+ },
18
+ ],
19
+ name: 'bar',
20
+ outputs: [],
21
+ type: 'function',
22
+ },
23
+ {
24
+ inputs: [
25
+ { internalType: 'uint32', name: 'x', type: 'uint32' },
26
+ { internalType: 'bool', name: 'y', type: 'bool' },
27
+ ],
28
+ name: 'baz',
29
+ outputs: [{ internalType: 'bool', name: 'r', type: 'bool' }],
30
+ type: 'function',
31
+ },
32
+ {
33
+ inputs: [
34
+ { internalType: 'bytes', name: 'memory', type: 'bytes' },
35
+ { internalType: 'bool', name: '', type: 'bool' },
36
+ { internalType: 'uint[]', name: 'memory', type: 'uint[]' },
37
+ ],
38
+ name: 'sam',
39
+ outputs: [],
40
+ type: 'function',
41
+ },
42
+ ];
@@ -0,0 +1,33 @@
1
+ import { encodeData } from '../../utils/encode-decode-transaction';
2
+ import { JSONABIArgument } from './../../../types/Contract.types';
3
+ import { fooABI } from './foo-abi';
4
+
5
+ describe('foo encode', () => {
6
+ it('encodes "baz" function', () => {
7
+ const jsonABIArgument = fooABI.find(
8
+ (abi) => abi.name === 'baz',
9
+ ) as JSONABIArgument;
10
+ const encoded = encodeData(jsonABIArgument, [69, true]);
11
+ expect(encoded).toBe(
12
+ '0xcdcd77c000000000000000000000000000000000000000000000000000000000000000450000000000000000000000000000000000000000000000000000000000000001',
13
+ );
14
+ });
15
+ it('encodes "bar" function', () => {
16
+ const jsonABIArgument = fooABI.find(
17
+ (abi) => abi.name === 'bar',
18
+ ) as JSONABIArgument;
19
+ const encoded = encodeData(jsonABIArgument, ['abc', 'def']);
20
+ expect(encoded).toBe(
21
+ '0xfce353f661626300000000000000000000000000000000000000000000000000000000006465660000000000000000000000000000000000000000000000000000000000',
22
+ );
23
+ });
24
+ // it('encodes "sam" function', () => {
25
+ // const jsonABIArgument = fooABI.find(
26
+ // (abi) => abi.name === 'sam',
27
+ // ) as JSONABIArgument;
28
+ // const encoded = encodeData(jsonABIArgument, ['dave', true, [1, 2, 3]]);
29
+ // expect(encoded).toBe(
30
+ // '0xa5643bf20000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000464617665000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003',
31
+ // );
32
+ // });
33
+ });