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.
- package/..eslintrc.js.un~ +0 -0
- package/..npmignore.un~ +0 -0
- package/.env +1 -0
- package/.eslintignore +4 -0
- package/.eslintrc.js +34 -0
- package/.gitattributes +1 -0
- package/.github/workflows/.test.yml.un~ +0 -0
- package/.github/workflows/test.yml +29 -0
- package/.package.json.un~ +0 -0
- package/.prettierignore +7 -0
- package/.travis.yml +5 -0
- package/jest.config.js +9 -0
- package/package.json +34 -20
- package/readme.md +1 -2
- package/scripts/build-website.sh +4 -0
- package/scripts/bump-minor.sh +4 -0
- package/scripts/bump-patch.sh +4 -0
- package/scripts/fetch-chains-info.ts +70 -0
- package/scripts/pre-commit.sh +5 -0
- package/src/classes/Contract.ts +161 -0
- package/src/classes/test/Contract/crv-abi.ts +488 -0
- package/src/classes/test/Contract/crv.test.ts +56 -0
- package/src/classes/test/Contract/ens-abi.ts +452 -0
- package/src/classes/test/Contract/ens.test.ts +39 -0
- package/src/classes/test/Contract/fei-abi.ts +526 -0
- package/src/classes/test/Contract/fei.test.ts +86 -0
- package/src/classes/test/Contract/foo-abi.ts +42 -0
- package/src/classes/test/Contract/foo.test.ts +33 -0
- package/src/classes/test/Contract/uni.test.ts +72 -0
- package/src/classes/test/Contract/uniswap-abi.ts +121 -0
- package/src/classes/utils/clean-block.ts +49 -0
- package/src/classes/utils/clean-transaction.ts +35 -0
- package/src/classes/utils/encode-decode-transaction.ts +126 -0
- package/src/classes/utils/fetchers.ts +27 -0
- package/{lib/cjs/classes/utils/hex-to-decimal.d.ts → src/classes/utils/hex-to-decimal.ts} +3 -1
- package/src/index.ts +27 -0
- package/src/providers/JsonRpcProvider.ts +94 -0
- package/src/providers/test/get-block.test.ts +63 -0
- package/src/providers/test/get-network.test.ts +34 -0
- package/src/providers/utils/chains-info.ts +1079 -0
- package/src/shared/tiny-big/helpers.test.ts +30 -0
- package/src/shared/tiny-big/helpers.ts +89 -0
- package/src/shared/tiny-big/tiny-big.test.ts +10 -0
- package/src/shared/tiny-big/tiny-big.ts +36 -0
- package/src/shared/validate-type.ts +20 -0
- package/src/types/.Contract.types.ts.un~ +0 -0
- package/src/types/Block.types.ts +50 -0
- package/src/types/Contract.types.ts +67 -0
- package/src/types/Network.types.ts +8 -0
- package/src/types/Transaction.types.ts +35 -0
- package/{lib/cjs/utils/ether-to-wei.d.ts → src/utils/ether-to-wei.ts} +10 -2
- package/src/utils/index.ts +6 -0
- package/src/utils/is-address.ts +16 -0
- package/src/utils/tests/ether-to-wei.test.ts +65 -0
- package/src/utils/tests/is-address.test.ts +52 -0
- package/src/utils/tests/to-checksum-address.test.ts +43 -0
- package/src/utils/tests/wei-to-ether.test.ts +72 -0
- package/src/utils/to-checksum-address.ts +47 -0
- package/{lib/cjs/utils/wei-to-ether.d.ts → src/utils/wei-to-ether.ts} +8 -1
- package/test/global-setup.js +8 -0
- package/test/global-teardown.js +5 -0
- package/test/jest.setup-after-env.js +1 -0
- package/test/server.js +24 -0
- package/tsconfig-cjs.json +8 -0
- package/tsconfig.json +25 -0
- package/typedoc/options-new-version.js +8 -0
- package/typedoc/options.js +9 -0
- package/types/just-omit.d.ts +1 -0
- package/website/.nojekyll +1 -0
- package/website/assets/highlight.css +71 -0
- package/website/assets/icons.css +1043 -0
- package/website/assets/icons.png +0 -0
- package/website/assets/icons@2x.png +0 -0
- package/website/assets/main.js +52 -0
- package/website/assets/search.js +1 -0
- package/website/assets/style.css +1413 -0
- package/website/assets/widgets.png +0 -0
- package/website/assets/widgets@2x.png +0 -0
- package/website/classes/Contract.html +13 -0
- package/website/classes/JsonRpcProvider.html +8 -0
- package/website/classes/TinyBig.html +161 -0
- package/website/index.html +207 -0
- package/website/interfaces/Block.html +1 -0
- package/website/interfaces/JSONABIArgument.html +1 -0
- package/website/interfaces/Network.html +3 -0
- package/website/interfaces/Transaction.html +1 -0
- package/website/modules.html +32 -0
- package/website/versions/0.1.2/assets/highlight.css +57 -0
- package/website/versions/0.1.2/assets/icons.css +1043 -0
- package/website/versions/0.1.2/assets/icons.png +0 -0
- package/website/versions/0.1.2/assets/icons@2x.png +0 -0
- package/website/versions/0.1.2/assets/main.js +52 -0
- package/website/versions/0.1.2/assets/search.js +1 -0
- package/website/versions/0.1.2/assets/style.css +1341 -0
- package/website/versions/0.1.2/assets/widgets.png +0 -0
- package/website/versions/0.1.2/assets/widgets@2x.png +0 -0
- package/website/versions/0.1.2/classes/TinyBig.html +4 -0
- package/website/versions/0.1.2/index.html +20 -0
- package/website/versions/0.1.2/modules.html +23 -0
- package/website/versions/0.1.3/assets/highlight.css +64 -0
- package/website/versions/0.1.3/assets/icons.css +1043 -0
- package/website/versions/0.1.3/assets/icons.png +0 -0
- package/website/versions/0.1.3/assets/icons@2x.png +0 -0
- package/website/versions/0.1.3/assets/main.js +52 -0
- package/website/versions/0.1.3/assets/search.js +1 -0
- package/website/versions/0.1.3/assets/style.css +1341 -0
- package/website/versions/0.1.3/assets/widgets.png +0 -0
- package/website/versions/0.1.3/assets/widgets@2x.png +0 -0
- package/website/versions/0.1.3/classes/TinyBig.html +4 -0
- package/website/versions/0.1.3/index.html +53 -0
- package/website/versions/0.1.3/modules.html +23 -0
- package/website/versions/0.1.4/assets/highlight.css +64 -0
- package/website/versions/0.1.4/assets/icons.css +1043 -0
- package/website/versions/0.1.4/assets/icons.png +0 -0
- package/website/versions/0.1.4/assets/icons@2x.png +0 -0
- package/website/versions/0.1.4/assets/main.js +52 -0
- package/website/versions/0.1.4/assets/search.js +1 -0
- package/website/versions/0.1.4/assets/style.css +1341 -0
- package/website/versions/0.1.4/assets/widgets.png +0 -0
- package/website/versions/0.1.4/assets/widgets@2x.png +0 -0
- package/website/versions/0.1.4/classes/EssentialEth.html +1 -0
- package/website/versions/0.1.4/classes/TinyBig.html +4 -0
- package/website/versions/0.1.4/index.html +58 -0
- package/website/versions/0.1.4/modules.html +23 -0
- package/website/versions/0.2.0/assets/highlight.css +64 -0
- package/website/versions/0.2.0/assets/icons.css +1043 -0
- package/website/versions/0.2.0/assets/icons.png +0 -0
- package/website/versions/0.2.0/assets/icons@2x.png +0 -0
- package/website/versions/0.2.0/assets/main.js +52 -0
- package/website/versions/0.2.0/assets/search.js +1 -0
- package/website/versions/0.2.0/assets/style.css +1341 -0
- package/website/versions/0.2.0/assets/widgets.png +0 -0
- package/website/versions/0.2.0/assets/widgets@2x.png +0 -0
- package/website/versions/0.2.0/classes/EssentialEth.html +5 -0
- package/website/versions/0.2.0/classes/TinyBig.html +146 -0
- package/website/versions/0.2.0/index.html +89 -0
- package/website/versions/0.2.0/modules.html +25 -0
- package/website/versions/0.2.1/assets/highlight.css +64 -0
- package/website/versions/0.2.1/assets/icons.css +1043 -0
- package/website/versions/0.2.1/assets/icons.png +0 -0
- package/website/versions/0.2.1/assets/icons@2x.png +0 -0
- package/website/versions/0.2.1/assets/main.js +52 -0
- package/website/versions/0.2.1/assets/search.js +1 -0
- package/website/versions/0.2.1/assets/style.css +1341 -0
- package/website/versions/0.2.1/assets/widgets.png +0 -0
- package/website/versions/0.2.1/assets/widgets@2x.png +0 -0
- package/website/versions/0.2.1/classes/EssentialEth.html +5 -0
- package/website/versions/0.2.1/classes/TinyBig.html +146 -0
- package/website/versions/0.2.1/index.html +96 -0
- package/website/versions/0.2.1/modules.html +29 -0
- package/website/versions/0.2.2/assets/highlight.css +64 -0
- package/website/versions/0.2.2/assets/icons.css +1043 -0
- package/website/versions/0.2.2/assets/icons.png +0 -0
- package/website/versions/0.2.2/assets/icons@2x.png +0 -0
- package/website/versions/0.2.2/assets/main.js +52 -0
- package/website/versions/0.2.2/assets/search.js +1 -0
- package/website/versions/0.2.2/assets/style.css +1341 -0
- package/website/versions/0.2.2/assets/widgets.png +0 -0
- package/website/versions/0.2.2/assets/widgets@2x.png +0 -0
- package/website/versions/0.2.2/classes/EssentialEth.html +5 -0
- package/website/versions/0.2.2/classes/TinyBig.html +146 -0
- package/website/versions/0.2.2/index.html +96 -0
- package/website/versions/0.2.2/modules.html +29 -0
- package/website/versions/0.3.0/.nojekyll +1 -0
- package/website/versions/0.3.0/assets/highlight.css +71 -0
- package/website/versions/0.3.0/assets/icons.css +1043 -0
- package/website/versions/0.3.0/assets/icons.png +0 -0
- package/website/versions/0.3.0/assets/icons@2x.png +0 -0
- package/website/versions/0.3.0/assets/main.js +52 -0
- package/website/versions/0.3.0/assets/search.js +1 -0
- package/website/versions/0.3.0/assets/style.css +1384 -0
- package/website/versions/0.3.0/assets/widgets.png +0 -0
- package/website/versions/0.3.0/assets/widgets@2x.png +0 -0
- package/website/versions/0.3.0/classes/Contract.html +15 -0
- package/website/versions/0.3.0/classes/TinyBig.html +156 -0
- package/website/versions/0.3.0/index.html +123 -0
- package/website/versions/0.3.0/modules.html +32 -0
- package/website/versions/0.3.1/.nojekyll +1 -0
- package/website/versions/0.3.1/assets/highlight.css +71 -0
- package/website/versions/0.3.1/assets/icons.css +1043 -0
- package/website/versions/0.3.1/assets/icons.png +0 -0
- package/website/versions/0.3.1/assets/icons@2x.png +0 -0
- package/website/versions/0.3.1/assets/main.js +52 -0
- package/website/versions/0.3.1/assets/search.js +1 -0
- package/website/versions/0.3.1/assets/style.css +1384 -0
- package/website/versions/0.3.1/assets/widgets.png +0 -0
- package/website/versions/0.3.1/assets/widgets@2x.png +0 -0
- package/website/versions/0.3.1/classes/Contract.html +15 -0
- package/website/versions/0.3.1/classes/TinyBig.html +156 -0
- package/website/versions/0.3.1/index.html +123 -0
- package/website/versions/0.3.1/modules.html +32 -0
- package/website/versions/0.3.2/.nojekyll +1 -0
- package/website/versions/0.3.2/assets/highlight.css +71 -0
- package/website/versions/0.3.2/assets/icons.css +1043 -0
- package/website/versions/0.3.2/assets/icons.png +0 -0
- package/website/versions/0.3.2/assets/icons@2x.png +0 -0
- package/website/versions/0.3.2/assets/main.js +52 -0
- package/website/versions/0.3.2/assets/search.js +1 -0
- package/website/versions/0.3.2/assets/style.css +1384 -0
- package/website/versions/0.3.2/assets/widgets.png +0 -0
- package/website/versions/0.3.2/assets/widgets@2x.png +0 -0
- package/website/versions/0.3.2/classes/Contract.html +15 -0
- package/website/versions/0.3.2/classes/JsonRpcProvider.html +5 -0
- package/website/versions/0.3.2/classes/TinyBig.html +156 -0
- package/website/versions/0.3.2/index.html +123 -0
- package/website/versions/0.3.2/modules.html +32 -0
- package/website/versions/0.3.3/.nojekyll +1 -0
- package/website/versions/0.3.3/assets/highlight.css +71 -0
- package/website/versions/0.3.3/assets/icons.css +1043 -0
- package/website/versions/0.3.3/assets/icons.png +0 -0
- package/website/versions/0.3.3/assets/icons@2x.png +0 -0
- package/website/versions/0.3.3/assets/main.js +52 -0
- package/website/versions/0.3.3/assets/search.js +1 -0
- package/website/versions/0.3.3/assets/style.css +1384 -0
- package/website/versions/0.3.3/assets/widgets.png +0 -0
- package/website/versions/0.3.3/assets/widgets@2x.png +0 -0
- package/website/versions/0.3.3/classes/Contract.html +15 -0
- package/website/versions/0.3.3/classes/JsonRpcProvider.html +5 -0
- package/website/versions/0.3.3/classes/TinyBig.html +156 -0
- package/website/versions/0.3.3/index.html +123 -0
- package/website/versions/0.3.3/interfaces/Block.html +1 -0
- package/website/versions/0.3.3/interfaces/Transaction.html +1 -0
- package/website/versions/0.3.3/modules.html +32 -0
- package/website/versions/0.4.0/.nojekyll +1 -0
- package/website/versions/0.4.0/assets/highlight.css +71 -0
- package/website/versions/0.4.0/assets/icons.css +1043 -0
- package/website/versions/0.4.0/assets/icons.png +0 -0
- package/website/versions/0.4.0/assets/icons@2x.png +0 -0
- package/website/versions/0.4.0/assets/main.js +52 -0
- package/website/versions/0.4.0/assets/search.js +1 -0
- package/website/versions/0.4.0/assets/style.css +1384 -0
- package/website/versions/0.4.0/assets/widgets.png +0 -0
- package/website/versions/0.4.0/assets/widgets@2x.png +0 -0
- package/website/versions/0.4.0/classes/Contract.html +15 -0
- package/website/versions/0.4.0/classes/JsonRpcProvider.html +6 -0
- package/website/versions/0.4.0/classes/TinyBig.html +156 -0
- package/website/versions/0.4.0/index.html +148 -0
- package/website/versions/0.4.0/interfaces/Block.html +1 -0
- package/website/versions/0.4.0/interfaces/Transaction.html +1 -0
- package/website/versions/0.4.0/modules.html +32 -0
- package/website/versions/0.4.1/.nojekyll +1 -0
- package/website/versions/0.4.1/assets/highlight.css +71 -0
- package/website/versions/0.4.1/assets/icons.css +1043 -0
- package/website/versions/0.4.1/assets/icons.png +0 -0
- package/website/versions/0.4.1/assets/icons@2x.png +0 -0
- package/website/versions/0.4.1/assets/main.js +52 -0
- package/website/versions/0.4.1/assets/search.js +1 -0
- package/website/versions/0.4.1/assets/style.css +1384 -0
- package/website/versions/0.4.1/assets/widgets.png +0 -0
- package/website/versions/0.4.1/assets/widgets@2x.png +0 -0
- package/website/versions/0.4.1/classes/Contract.html +15 -0
- package/website/versions/0.4.1/classes/JsonRpcProvider.html +6 -0
- package/website/versions/0.4.1/classes/TinyBig.html +156 -0
- package/website/versions/0.4.1/index.html +148 -0
- package/website/versions/0.4.1/interfaces/Block.html +1 -0
- package/website/versions/0.4.1/interfaces/Transaction.html +1 -0
- package/website/versions/0.4.1/modules.html +32 -0
- package/website/versions/0.4.2/.nojekyll +1 -0
- package/website/versions/0.4.2/assets/highlight.css +71 -0
- package/website/versions/0.4.2/assets/icons.css +1043 -0
- package/website/versions/0.4.2/assets/icons.png +0 -0
- package/website/versions/0.4.2/assets/icons@2x.png +0 -0
- package/website/versions/0.4.2/assets/main.js +52 -0
- package/website/versions/0.4.2/assets/search.js +1 -0
- package/website/versions/0.4.2/assets/style.css +1384 -0
- package/website/versions/0.4.2/assets/widgets.png +0 -0
- package/website/versions/0.4.2/assets/widgets@2x.png +0 -0
- package/website/versions/0.4.2/classes/Contract.html +15 -0
- package/website/versions/0.4.2/classes/JsonRpcProvider.html +8 -0
- package/website/versions/0.4.2/classes/TinyBig.html +156 -0
- package/website/versions/0.4.2/index.html +199 -0
- package/website/versions/0.4.2/interfaces/Block.html +1 -0
- package/website/versions/0.4.2/interfaces/Transaction.html +1 -0
- package/website/versions/0.4.2/modules.html +34 -0
- package/website/versions/0.4.3/.nojekyll +1 -0
- package/website/versions/0.4.3/assets/highlight.css +71 -0
- package/website/versions/0.4.3/assets/icons.css +1043 -0
- package/website/versions/0.4.3/assets/icons.png +0 -0
- package/website/versions/0.4.3/assets/icons@2x.png +0 -0
- package/website/versions/0.4.3/assets/main.js +52 -0
- package/website/versions/0.4.3/assets/search.js +1 -0
- package/website/versions/0.4.3/assets/style.css +1384 -0
- package/website/versions/0.4.3/assets/widgets.png +0 -0
- package/website/versions/0.4.3/assets/widgets@2x.png +0 -0
- package/website/versions/0.4.3/classes/Contract.html +15 -0
- package/website/versions/0.4.3/classes/JsonRpcProvider.html +8 -0
- package/website/versions/0.4.3/classes/TinyBig.html +159 -0
- package/website/versions/0.4.3/index.html +199 -0
- package/website/versions/0.4.3/interfaces/Block.html +1 -0
- package/website/versions/0.4.3/interfaces/Transaction.html +1 -0
- package/website/versions/0.4.3/modules.html +34 -0
- package/website/versions/0.4.6/.nojekyll +1 -0
- package/website/versions/0.4.6/assets/highlight.css +71 -0
- package/website/versions/0.4.6/assets/icons.css +1043 -0
- package/website/versions/0.4.6/assets/icons.png +0 -0
- package/website/versions/0.4.6/assets/icons@2x.png +0 -0
- package/website/versions/0.4.6/assets/main.js +52 -0
- package/website/versions/0.4.6/assets/search.js +1 -0
- package/website/versions/0.4.6/assets/style.css +1413 -0
- package/website/versions/0.4.6/assets/widgets.png +0 -0
- package/website/versions/0.4.6/assets/widgets@2x.png +0 -0
- package/website/versions/0.4.6/classes/Contract.html +15 -0
- package/website/versions/0.4.6/classes/JsonRpcProvider.html +8 -0
- package/website/versions/0.4.6/classes/TinyBig.html +159 -0
- package/website/versions/0.4.6/index.html +207 -0
- package/website/versions/0.4.6/interfaces/Block.html +1 -0
- package/website/versions/0.4.6/interfaces/Transaction.html +1 -0
- package/website/versions/0.4.6/modules.html +34 -0
- package/website/versions/0.4.8/.nojekyll +1 -0
- package/website/versions/0.4.8/assets/highlight.css +71 -0
- package/website/versions/0.4.8/assets/icons.css +1043 -0
- package/website/versions/0.4.8/assets/icons.png +0 -0
- package/website/versions/0.4.8/assets/icons@2x.png +0 -0
- package/website/versions/0.4.8/assets/main.js +52 -0
- package/website/versions/0.4.8/assets/search.js +1 -0
- package/website/versions/0.4.8/assets/style.css +1413 -0
- package/website/versions/0.4.8/assets/widgets.png +0 -0
- package/website/versions/0.4.8/assets/widgets@2x.png +0 -0
- package/website/versions/0.4.8/classes/Contract.html +15 -0
- package/website/versions/0.4.8/classes/JsonRpcProvider.html +8 -0
- package/website/versions/0.4.8/classes/TinyBig.html +161 -0
- package/website/versions/0.4.8/index.html +207 -0
- package/website/versions/0.4.8/interfaces/Block.html +1 -0
- package/website/versions/0.4.8/interfaces/Transaction.html +1 -0
- package/website/versions/0.4.8/modules.html +34 -0
- package/website/versions/0.4.9-beta.0/.nojekyll +1 -0
- package/website/versions/0.4.9-beta.0/assets/highlight.css +71 -0
- package/website/versions/0.4.9-beta.0/assets/icons.css +1043 -0
- package/website/versions/0.4.9-beta.0/assets/icons.png +0 -0
- package/website/versions/0.4.9-beta.0/assets/icons@2x.png +0 -0
- package/website/versions/0.4.9-beta.0/assets/main.js +52 -0
- package/website/versions/0.4.9-beta.0/assets/search.js +1 -0
- package/website/versions/0.4.9-beta.0/assets/style.css +1413 -0
- package/website/versions/0.4.9-beta.0/assets/widgets.png +0 -0
- package/website/versions/0.4.9-beta.0/assets/widgets@2x.png +0 -0
- package/website/versions/0.4.9-beta.0/classes/Contract.html +13 -0
- package/website/versions/0.4.9-beta.0/classes/JsonRpcProvider.html +8 -0
- package/website/versions/0.4.9-beta.0/classes/TinyBig.html +161 -0
- package/website/versions/0.4.9-beta.0/index.html +207 -0
- package/website/versions/0.4.9-beta.0/interfaces/Block.html +1 -0
- package/website/versions/0.4.9-beta.0/interfaces/JSONABIArgument.html +1 -0
- package/website/versions/0.4.9-beta.0/interfaces/Network.html +3 -0
- package/website/versions/0.4.9-beta.0/interfaces/Transaction.html +1 -0
- package/website/versions/0.4.9-beta.0/modules.html +32 -0
- package/website/versions/versions/0.1.2/assets/highlight.css +57 -0
- package/website/versions/versions/0.1.2/assets/icons.css +1043 -0
- package/website/versions/versions/0.1.2/assets/icons.png +0 -0
- package/website/versions/versions/0.1.2/assets/icons@2x.png +0 -0
- package/website/versions/versions/0.1.2/assets/main.js +52 -0
- package/website/versions/versions/0.1.2/assets/search.js +1 -0
- package/website/versions/versions/0.1.2/assets/style.css +1341 -0
- package/website/versions/versions/0.1.2/assets/widgets.png +0 -0
- package/website/versions/versions/0.1.2/assets/widgets@2x.png +0 -0
- package/website/versions/versions/0.1.2/classes/TinyBig.html +4 -0
- package/website/versions/versions/0.1.2/index.html +20 -0
- package/website/versions/versions/0.1.2/modules.html +23 -0
- package/website/versions/versions/0.1.3/assets/highlight.css +64 -0
- package/website/versions/versions/0.1.3/assets/icons.css +1043 -0
- package/website/versions/versions/0.1.3/assets/icons.png +0 -0
- package/website/versions/versions/0.1.3/assets/icons@2x.png +0 -0
- package/website/versions/versions/0.1.3/assets/main.js +52 -0
- package/website/versions/versions/0.1.3/assets/search.js +1 -0
- package/website/versions/versions/0.1.3/assets/style.css +1341 -0
- package/website/versions/versions/0.1.3/assets/widgets.png +0 -0
- package/website/versions/versions/0.1.3/assets/widgets@2x.png +0 -0
- package/website/versions/versions/0.1.3/classes/TinyBig.html +4 -0
- package/website/versions/versions/0.1.3/index.html +53 -0
- package/website/versions/versions/0.1.3/modules.html +23 -0
- package/website/versions/versions/0.1.4/assets/highlight.css +64 -0
- package/website/versions/versions/0.1.4/assets/icons.css +1043 -0
- package/website/versions/versions/0.1.4/assets/icons.png +0 -0
- package/website/versions/versions/0.1.4/assets/icons@2x.png +0 -0
- package/website/versions/versions/0.1.4/assets/main.js +52 -0
- package/website/versions/versions/0.1.4/assets/search.js +1 -0
- package/website/versions/versions/0.1.4/assets/style.css +1341 -0
- package/website/versions/versions/0.1.4/assets/widgets.png +0 -0
- package/website/versions/versions/0.1.4/assets/widgets@2x.png +0 -0
- package/website/versions/versions/0.1.4/classes/TinyBig.html +4 -0
- package/website/versions/versions/0.1.4/index.html +58 -0
- package/website/versions/versions/0.1.4/modules.html +23 -0
- package/lib/cjs/classes/Contract.d.ts +0 -72
- package/lib/cjs/classes/Contract.js +0 -126
- package/lib/cjs/classes/test/Contract/crv-abi.d.ts +0 -2
- package/lib/cjs/classes/test/Contract/crv-abi.js +0 -488
- package/lib/cjs/classes/test/Contract/ens-abi.d.ts +0 -2
- package/lib/cjs/classes/test/Contract/ens-abi.js +0 -453
- package/lib/cjs/classes/test/Contract/fei-abi.d.ts +0 -2
- package/lib/cjs/classes/test/Contract/fei-abi.js +0 -526
- package/lib/cjs/classes/test/Contract/foo-abi.d.ts +0 -2
- package/lib/cjs/classes/test/Contract/foo-abi.js +0 -42
- package/lib/cjs/classes/test/Contract/uniswap-abi.d.ts +0 -2
- package/lib/cjs/classes/test/Contract/uniswap-abi.js +0 -121
- package/lib/cjs/classes/utils/clean-block.d.ts +0 -6
- package/lib/cjs/classes/utils/clean-block.js +0 -46
- package/lib/cjs/classes/utils/clean-transaction.d.ts +0 -5
- package/lib/cjs/classes/utils/clean-transaction.js +0 -38
- package/lib/cjs/classes/utils/encode-decode-transaction.d.ts +0 -3
- package/lib/cjs/classes/utils/encode-decode-transaction.js +0 -113
- package/lib/cjs/classes/utils/fetchers.d.ts +0 -9
- package/lib/cjs/classes/utils/fetchers.js +0 -33
- package/lib/cjs/classes/utils/hex-to-decimal.js +0 -11
- package/lib/cjs/index.d.ts +0 -12
- package/lib/cjs/index.js +0 -19
- package/lib/cjs/providers/JsonRpcProvider.d.ts +0 -22
- package/lib/cjs/providers/JsonRpcProvider.js +0 -69
- package/lib/cjs/providers/utils/chains-info.d.ts +0 -338
- package/lib/cjs/providers/utils/chains-info.js +0 -1015
- package/lib/cjs/shared/tiny-big/helpers.d.ts +0 -1
- package/lib/cjs/shared/tiny-big/helpers.js +0 -71
- package/lib/cjs/shared/tiny-big/tiny-big.d.ts +0 -19
- package/lib/cjs/shared/tiny-big/tiny-big.js +0 -41
- package/lib/cjs/shared/validate-type.d.ts +0 -3
- package/lib/cjs/shared/validate-type.js +0 -9
- package/lib/cjs/types/Block.types.d.ts +0 -47
- package/lib/cjs/types/Block.types.js +0 -2
- package/lib/cjs/types/Contract.types.d.ts +0 -24
- package/lib/cjs/types/Contract.types.js +0 -2
- package/lib/cjs/types/Network.types.d.ts +0 -8
- package/lib/cjs/types/Network.types.js +0 -2
- package/lib/cjs/types/Transaction.types.d.ts +0 -34
- package/lib/cjs/types/Transaction.types.js +0 -2
- package/lib/cjs/utils/ether-to-wei.js +0 -32
- package/lib/cjs/utils/is-address.d.ts +0 -5
- package/lib/cjs/utils/is-address.js +0 -20
- package/lib/cjs/utils/to-checksum-address.d.ts +0 -17
- package/lib/cjs/utils/to-checksum-address.js +0 -46
- package/lib/cjs/utils/wei-to-ether.js +0 -34
- package/lib/esm/classes/Contract.d.ts +0 -12
- package/lib/esm/classes/Contract.js +0 -63
- package/lib/esm/classes/test/Contract/crv-abi.d.ts +0 -2
- package/lib/esm/classes/test/Contract/crv-abi.js +0 -470
- package/lib/esm/classes/test/Contract/ens-abi.d.ts +0 -2
- package/lib/esm/classes/test/Contract/ens-abi.js +0 -435
- package/lib/esm/classes/test/Contract/fei-abi.d.ts +0 -2
- package/lib/esm/classes/test/Contract/fei-abi.js +0 -521
- package/lib/esm/classes/test/Contract/foo-abi.d.ts +0 -2
- package/lib/esm/classes/test/Contract/foo-abi.js +0 -33
- package/lib/esm/classes/test/Contract/uniswap-abi.d.ts +0 -2
- package/lib/esm/classes/test/Contract/uniswap-abi.js +0 -116
- package/lib/esm/classes/utils/clean-block.d.ts +0 -3
- package/lib/esm/classes/utils/clean-block.js +0 -35
- package/lib/esm/classes/utils/clean-transaction.d.ts +0 -2
- package/lib/esm/classes/utils/clean-transaction.js +0 -29
- package/lib/esm/classes/utils/encode-decode-transaction.d.ts +0 -3
- package/lib/esm/classes/utils/encode-decode-transaction.js +0 -98
- package/lib/esm/classes/utils/fetchers.d.ts +0 -9
- package/lib/esm/classes/utils/fetchers.js +0 -25
- package/lib/esm/classes/utils/hex-to-decimal.d.ts +0 -1
- package/lib/esm/classes/utils/hex-to-decimal.js +0 -3
- package/lib/esm/index.d.ts +0 -12
- package/lib/esm/index.js +0 -8
- package/lib/esm/providers/JsonRpcProvider.d.ts +0 -9
- package/lib/esm/providers/JsonRpcProvider.js +0 -49
- package/lib/esm/providers/utils/chains-info.d.ts +0 -338
- package/lib/esm/providers/utils/chains-info.js +0 -1011
- package/lib/esm/shared/tiny-big/helpers.d.ts +0 -1
- package/lib/esm/shared/tiny-big/helpers.js +0 -58
- package/lib/esm/shared/tiny-big/tiny-big.d.ts +0 -8
- package/lib/esm/shared/tiny-big/tiny-big.js +0 -22
- package/lib/esm/shared/validate-type.d.ts +0 -3
- package/lib/esm/shared/validate-type.js +0 -5
- package/lib/esm/types/Block.types.d.ts +0 -47
- package/lib/esm/types/Block.types.js +0 -1
- package/lib/esm/types/Contract.types.d.ts +0 -24
- package/lib/esm/types/Contract.types.js +0 -1
- package/lib/esm/types/Network.types.d.ts +0 -5
- package/lib/esm/types/Network.types.js +0 -1
- package/lib/esm/types/Transaction.types.d.ts +0 -34
- package/lib/esm/types/Transaction.types.js +0 -1
- package/lib/esm/utils/ether-to-wei.d.ts +0 -3
- package/lib/esm/utils/ether-to-wei.js +0 -7
- package/lib/esm/utils/is-address.d.ts +0 -1
- package/lib/esm/utils/is-address.js +0 -12
- package/lib/esm/utils/to-checksum-address.d.ts +0 -1
- package/lib/esm/utils/to-checksum-address.js +0 -25
- package/lib/esm/utils/wei-to-ether.d.ts +0 -3
- package/lib/esm/utils/wei-to-ether.js +0 -7
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>TinyBig | essential-eth - v0.1.4</title><meta name="description" content="Documentation for essential-eth - v0.1.4"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">essential-eth - v0.1.4</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">essential-eth - v0.1.4</a></li><li><a href="TinyBig.html">TinyBig</a></li></ul><h1>Class TinyBig</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
|
2
|
+
<p>A wrapper around big.js which expands scientific notation. This is the return type of every operation on ether, wei, etc.
|
|
3
|
+
The only important things to know are the "toString" and "toNumber" functions</p>
|
|
4
|
+
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">TinyBig</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="TinyBig.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="TinyBig.html#__value" class="tsd-kind-icon">__value</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="TinyBig.html#toNumber" class="tsd-kind-icon">to<wbr/>Number</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="TinyBig.html#toString" class="tsd-kind-icon">to<wbr/>String</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a name="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Tiny<wbr/>Big<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/shared/tiny-big/tiny-big.ts#L11">shared/tiny-big/tiny-big.ts:11</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a name="__value" class="tsd-anchor"></a><h3>__value</h3><div class="tsd-signature tsd-kind-icon">__value<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Big</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/shared/tiny-big/tiny-big.ts#L10">shared/tiny-big/tiny-big.ts:10</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="toNumber" class="tsd-anchor"></a><h3>to<wbr/>Number</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">to<wbr/>Number<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/shared/tiny-big/tiny-big.ts#L14">shared/tiny-big/tiny-big.ts:14</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="toString" class="tsd-anchor"></a><h3>to<wbr/>String</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">to<wbr/>String<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/shared/tiny-big/tiny-big.ts#L18">shared/tiny-big/tiny-big.ts:18</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="TinyBig.html" class="tsd-kind-icon">Tiny<wbr/>Big</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="TinyBig.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="TinyBig.html#__value" class="tsd-kind-icon">__value</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="TinyBig.html#toNumber" class="tsd-kind-icon">to<wbr/>Number</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="TinyBig.html#toString" class="tsd-kind-icon">to<wbr/>String</a></li></ul></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>essential-eth - v0.1.4</title><meta name="description" content="Documentation for essential-eth - v0.1.4"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">essential-eth - v0.1.4</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1>essential-eth - v0.1.4</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography"><p align="center">
|
|
2
|
+
<a><img src="https://blog.ethereum.org/img/2018/08/grants_eth_logo.png" title="Ethereum triangle" height="300"/></a>
|
|
3
|
+
</p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<b>
|
|
6
|
+
Essential Eth
|
|
7
|
+
</b>
|
|
8
|
+
<br>
|
|
9
|
+
<i>Ultralight Ethereum utilities for JS and TS</i>
|
|
10
|
+
<br>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<hr>
|
|
14
|
+
<p align="center">
|
|
15
|
+
<img src="https://user-images.githubusercontent.com/3408480/133322814-f3d18424-4ba8-4a37-8cbc-c5e6828354a3.png" title="Ethereum triangle" width="900"/>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<hr>
|
|
19
|
+
<br>
|
|
20
|
+
|
|
21
|
+
<p><img src="https://badgen.net/bundlephobia/minzip/essential-eth" alt=""> <img src="https://badgen.net/bundlephobia/tree-shaking/essential-eth" alt=""></p>
|
|
22
|
+
<p><img src="https://img.shields.io/npm/v/essential-eth" alt="">
|
|
23
|
+
<img src="https://badgen.net/bundlephobia/min/essential-eth" alt="">
|
|
24
|
+
<img src="https://badgen.net/bundlephobia/dependency-count/essential-eth" alt=""></p>
|
|
25
|
+
|
|
26
|
+
<a href="#features" id="features" style="color: inherit; text-decoration: none;">
|
|
27
|
+
<h2>Features</h2>
|
|
28
|
+
</a>
|
|
29
|
+
<ul>
|
|
30
|
+
<li>⚡️ A replacement for the utils in web3.js and ethers.js</li>
|
|
31
|
+
<li>🏎 <a href="https://bundlephobia.com/package/essential-eth">The TINIEST code size possible</a></li>
|
|
32
|
+
<li>ʦ Fully typed with TypeScript (also works with JavaScript)</li>
|
|
33
|
+
<li>🌲 Tree-shaking and no side-effects</li>
|
|
34
|
+
<li>👩⚖️ MIT License</li>
|
|
35
|
+
</ul>
|
|
36
|
+
|
|
37
|
+
<a href="#install" id="install" style="color: inherit; text-decoration: none;">
|
|
38
|
+
<h2>Install</h2>
|
|
39
|
+
</a>
|
|
40
|
+
<pre><code class="language-sh"><span class="hl-1">npm install --save essential-eth </span><span class="hl-3"># TypeScript types load automatically</span><br/><br/><span class="hl-3"># or if you prefer yarn</span><br/><span class="hl-1">yarn add essential-eth </span><span class="hl-3"># TypeScript types load automatically</span>
|
|
41
|
+
</code></pre>
|
|
42
|
+
|
|
43
|
+
<a href="#require" id="require" style="color: inherit; text-decoration: none;">
|
|
44
|
+
<h2>Require</h2>
|
|
45
|
+
</a>
|
|
46
|
+
<pre><code class="language-typescript"><span class="hl-5">import</span><span class="hl-1"> { etherToWei } </span><span class="hl-5">from</span><span class="hl-1"> </span><span class="hl-2">'essential-eth'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">// or in a non-import environment</span><br/><span class="hl-5">const</span><span class="hl-1"> { </span><span class="hl-4">etherToWei</span><span class="hl-1"> } </span><span class="hl-5">=</span><span class="hl-1"> </span><span class="hl-4">require</span><span class="hl-1">(</span><span class="hl-2">'essential-eth'</span><span class="hl-1">);</span>
|
|
47
|
+
</code></pre>
|
|
48
|
+
|
|
49
|
+
<a href="#functions" id="functions" style="color: inherit; text-decoration: none;">
|
|
50
|
+
<h2>Functions</h2>
|
|
51
|
+
</a>
|
|
52
|
+
<pre><code class="language-typescript"><span class="hl-3">// convert ether to wei</span><br/><span class="hl-0">etherToWei</span><span class="hl-1">(etherQuantity: string </span><span class="hl-5">|</span><span class="hl-1"> number): TinyBig</span><br/><br/><span class="hl-3">// convert wei to ether</span><br/><span class="hl-0">weiToEther</span><span class="hl-1">(weiQuantity: string </span><span class="hl-5">|</span><span class="hl-1"> number): TinyBig</span><br/><br/><span class="hl-3">// return proper mixed-case address</span><br/><span class="hl-0">toChecksumAddress</span><span class="hl-1">(address: string): string</span>
|
|
53
|
+
</code></pre>
|
|
54
|
+
<ul>
|
|
55
|
+
<li><a href="https://essential-eth.vercel.app">📓 View full docs</a></li>
|
|
56
|
+
<li><a href="https://essential-eth.vercel.app/versions">📓 View docs for an older version</a></li>
|
|
57
|
+
</ul>
|
|
58
|
+
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class"><a href="classes/TinyBig.html" class="tsd-kind-icon">Tiny<wbr/>Big</a></li><li class="tsd-kind-function"><a href="modules.html#etherToWei" class="tsd-kind-icon">ether<wbr/>To<wbr/>Wei</a></li><li class="tsd-kind-function"><a href="modules.html#tinyBig" class="tsd-kind-icon">tiny<wbr/>Big</a></li><li class="tsd-kind-function"><a href="modules.html#toChecksumAddress" class="tsd-kind-icon">to<wbr/>Checksum<wbr/>Address</a></li><li class="tsd-kind-function"><a href="modules.html#weiToEther" class="tsd-kind-icon">wei<wbr/>To<wbr/>Ether</a></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="assets/main.js"></script></body></html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>essential-eth - v0.1.4</title><meta name="description" content="Documentation for essential-eth - v0.1.4"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">essential-eth - v0.1.4</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1>essential-eth - v0.1.4</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class"><a href="classes/TinyBig.html" class="tsd-kind-icon">Tiny<wbr/>Big</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function"><a href="modules.html#etherToWei" class="tsd-kind-icon">ether<wbr/>To<wbr/>Wei</a></li><li class="tsd-kind-function"><a href="modules.html#tinyBig" class="tsd-kind-icon">tiny<wbr/>Big</a></li><li class="tsd-kind-function"><a href="modules.html#toChecksumAddress" class="tsd-kind-icon">to<wbr/>Checksum<wbr/>Address</a></li><li class="tsd-kind-function"><a href="modules.html#weiToEther" class="tsd-kind-icon">wei<wbr/>To<wbr/>Ether</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Functions</h2><section class="tsd-panel tsd-member tsd-kind-function"><a name="etherToWei" class="tsd-anchor"></a><h3>ether<wbr/>To<wbr/>Wei</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">ether<wbr/>To<wbr/>Wei<span class="tsd-signature-symbol">(</span>etherQuantity<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/ether-to-wei.ts#L26">ether-to-wei.ts:26</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
2
|
+
<p>Similar to <a href="https://docs.ethers.io/v4/api-utils.html#ether-strings-and-wei">"parseEther" in ethers.js</a></p>
|
|
3
|
+
</div><div><p>Similar to <a href="https://web3js.readthedocs.io/en/v1.2.11/web3-utils.html?highlight=towei#towei">"toWei" in web3</a></p>
|
|
4
|
+
</div><dl class="tsd-comment-tags"><dt>example</dt><dd><pre><code class="language-javascript"><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-2">'1000'</span><span class="hl-1">).</span><span class="hl-0">toString</span><span class="hl-1">()</span><br/><span class="hl-3">// '1000000000000000000000'</span><br/><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-4">1000</span><span class="hl-1">).</span><span class="hl-0">toString</span><span class="hl-1">()</span><br/><span class="hl-3">// '1000000000000000000000'</span>
|
|
5
|
+
</code></pre>
|
|
6
|
+
</dd><dt>example</dt><dd><pre><code class="language-javascript"><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-2">'1000'</span><span class="hl-1">).</span><span class="hl-0">toNumber</span><span class="hl-1">()</span><br/><span class="hl-3">// 1000000000000000000000</span><br/><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-4">1000</span><span class="hl-1">).</span><span class="hl-0">toNumber</span><span class="hl-1">()</span><br/><span class="hl-3">// 1000000000000000000000</span>
|
|
7
|
+
</code></pre>
|
|
8
|
+
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>etherQuantity: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="classes/TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><a name="tinyBig" class="tsd-anchor"></a><h3>tiny<wbr/>Big</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">tiny<wbr/>Big<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/shared/tiny-big/tiny-big.ts#L23">shared/tiny-big/tiny-big.ts:23</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="classes/TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><a name="toChecksumAddress" class="tsd-anchor"></a><h3>to<wbr/>Checksum<wbr/>Address</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">to<wbr/>Checksum<wbr/>Address<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/to-checksum-address.ts#L19">to-checksum-address.ts:19</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
9
|
+
<p>Returns an Ethereum address in proper mixed-case checksum.</p>
|
|
10
|
+
</div><dl class="tsd-comment-tags"><dt>example</dt><dd><pre><code class="language-javascript"><span class="hl-0">toChecksumAddress</span><span class="hl-1">(</span><span class="hl-2">'0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359'</span><span class="hl-1">);</span><br/><span class="hl-3">// '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359'</span>
|
|
11
|
+
</code></pre>
|
|
12
|
+
<p>Similar to <a href="https://docs.ethers.io/v4/api-utils.html#utils-getaddress">"getAddress" in ethers.js</a></p>
|
|
13
|
+
<p>Similar to <a href="https://web3js.readthedocs.io/en/v1.2.11/web3-utils.html#tochecksumaddress">"toChecksumAddress" in web3</a></p>
|
|
14
|
+
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>address: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div><p>An Ethereum address. Mixed, lower, and uppercase are all valid</p>
|
|
15
|
+
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><a name="weiToEther" class="tsd-anchor"></a><h3>wei<wbr/>To<wbr/>Ether</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">wei<wbr/>To<wbr/>Ether<span class="tsd-signature-symbol">(</span>weiQuantity<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/dawsbot/essential-eth/blob/3824dc2/src/wei-to-ether.ts#L28">wei-to-ether.ts:28</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
16
|
+
<p>Convert from Ether to Wei</p>
|
|
17
|
+
</div><div><p>Similar to <a href="https://docs.ethers.io/v4/api-utils.html#ether-strings-and-wei">"formatEther" in ethers.js</a></p>
|
|
18
|
+
<p>Similar to <a href="https://web3js.readthedocs.io/en/v1.2.11/web3-utils.html#fromwei">"fromWei" in web3</a></p>
|
|
19
|
+
</div><dl class="tsd-comment-tags"><dt>example</dt><dd><pre><code class="language-javascript"><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-2">'1000'</span><span class="hl-1">).</span><span class="hl-0">toString</span><span class="hl-1">()</span><br/><span class="hl-3">// '1000000000000000000000'</span><br/><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-4">1000</span><span class="hl-1">).</span><span class="hl-0">toString</span><span class="hl-1">()</span><br/><span class="hl-2">'1000000000000000000000'</span>
|
|
20
|
+
</code></pre>
|
|
21
|
+
</dd><dt>example</dt><dd><pre><code class="language-javascript"><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-2">'1000'</span><span class="hl-1">).</span><span class="hl-0">toNumber</span><span class="hl-1">()</span><br/><span class="hl-3">// 1000000000000000000000</span><br/><span class="hl-0">etherToWei</span><span class="hl-1">(</span><span class="hl-4">1000</span><span class="hl-1">).</span><span class="hl-0">toNumber</span><span class="hl-1">()</span><br/><span class="hl-3">// 1000000000000000000000</span>
|
|
22
|
+
</code></pre>
|
|
23
|
+
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>weiQuantity: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="classes/TinyBig.html" class="tsd-signature-type" data-tsd-kind="Class">TinyBig</a></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class"><a href="classes/TinyBig.html" class="tsd-kind-icon">Tiny<wbr/>Big</a></li><li class="tsd-kind-function"><a href="modules.html#etherToWei" class="tsd-kind-icon">ether<wbr/>To<wbr/>Wei</a></li><li class="tsd-kind-function"><a href="modules.html#tinyBig" class="tsd-kind-icon">tiny<wbr/>Big</a></li><li class="tsd-kind-function"><a href="modules.html#toChecksumAddress" class="tsd-kind-icon">to<wbr/>Checksum<wbr/>Address</a></li><li class="tsd-kind-function"><a href="modules.html#weiToEther" class="tsd-kind-icon">wei<wbr/>To<wbr/>Ether</a></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="assets/main.js"></script></body></html>
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '../providers/JsonRpcProvider';
|
|
2
|
-
import { ContractInterface } from '../types/Contract.types';
|
|
3
|
-
export declare class BaseContract {
|
|
4
|
-
/**
|
|
5
|
-
* The URL to your Eth node. Consider POKT or Infura
|
|
6
|
-
*/
|
|
7
|
-
readonly _address: string;
|
|
8
|
-
readonly _contractInterface: ContractInterface;
|
|
9
|
-
readonly _provider: JsonRpcProvider;
|
|
10
|
-
/**
|
|
11
|
-
* @param addressOrName - The ethereum address of the smart-contract
|
|
12
|
-
* @param contractInterface - The JSON ABI of the smart-contract (like http://api.etherscan.io/api?module=contract&action=getabi&address=0x090d4613473dee047c3f2706764f49e0821d256e&format=raw)
|
|
13
|
-
* @param signerOrProvider - An instantiated essential-eth provider
|
|
14
|
-
*/
|
|
15
|
-
constructor(addressOrName: string, contractInterface: ContractInterface, signerOrProvider: JsonRpcProvider);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Applies the unique contract's methods to the instantiated Contract in the constructor based-upon the provided ABI
|
|
19
|
-
*/
|
|
20
|
-
export declare function defineReadOnly<T>(object: T, name: string, value: any): void;
|
|
21
|
-
/**
|
|
22
|
-
* Only accepts ABIS in JSON format. This allows for stronger typing and assurances of data-types
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { Contract, JsonRpcProvider } from 'essential-eth';
|
|
27
|
-
* // UNI airdrop contract
|
|
28
|
-
* const contractAddress = '0x090D4613473dEE047c3f2706764f49E0821D256e';
|
|
29
|
-
* const provider = new JsonRpcProvider();
|
|
30
|
-
*
|
|
31
|
-
* const JSONABI = [
|
|
32
|
-
* {
|
|
33
|
-
* inputs: [
|
|
34
|
-
* {
|
|
35
|
-
* internalType: 'uint256',
|
|
36
|
-
* name: 'index',
|
|
37
|
-
* type: 'uint256',
|
|
38
|
-
* },
|
|
39
|
-
* ],
|
|
40
|
-
* name: 'isClaimed',
|
|
41
|
-
* outputs: [
|
|
42
|
-
* {
|
|
43
|
-
* internalType: 'bool',
|
|
44
|
-
* name: '',
|
|
45
|
-
* type: 'bool',
|
|
46
|
-
* },
|
|
47
|
-
* ],
|
|
48
|
-
* stateMutability: 'view',
|
|
49
|
-
* type: 'function',
|
|
50
|
-
* },
|
|
51
|
-
* ]
|
|
52
|
-
*
|
|
53
|
-
* const contract = new Contract(
|
|
54
|
-
* contractAddress,
|
|
55
|
-
* JSONABI,
|
|
56
|
-
* provider,
|
|
57
|
-
* );
|
|
58
|
-
*
|
|
59
|
-
* (async () => {
|
|
60
|
-
* // prints boolean as to whether index 0 has claimed airdrop or not
|
|
61
|
-
* console.log(await contract.isClaimed(0));
|
|
62
|
-
* })()
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
export declare class Contract extends BaseContract {
|
|
68
|
-
/**
|
|
69
|
-
* The dynamic contract calls on any given contract. Like "isClaimed", "merkleRoot", etc.
|
|
70
|
-
*/
|
|
71
|
-
readonly [key: string]: any;
|
|
72
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Contract = exports.defineReadOnly = exports.BaseContract = void 0;
|
|
13
|
-
const encode_decode_transaction_1 = require("./utils/encode-decode-transaction");
|
|
14
|
-
const fetchers_1 = require("./utils/fetchers");
|
|
15
|
-
function estimateGas(txnData) {
|
|
16
|
-
// https://ethereum.stackexchange.com/questions/1570/what-does-intrinsic-gas-too-low-mean/1694
|
|
17
|
-
txnData.split('').reduce((previousValue, currentValue) => {
|
|
18
|
-
// 0 characters are 4 gwei, all others are 48 gwei
|
|
19
|
-
const characterCost = currentValue === '0' ? 4 : 68;
|
|
20
|
-
return previousValue + characterCost;
|
|
21
|
-
}, 0);
|
|
22
|
-
}
|
|
23
|
-
class BaseContract {
|
|
24
|
-
/**
|
|
25
|
-
* @param addressOrName - The ethereum address of the smart-contract
|
|
26
|
-
* @param contractInterface - The JSON ABI of the smart-contract (like http://api.etherscan.io/api?module=contract&action=getabi&address=0x090d4613473dee047c3f2706764f49e0821d256e&format=raw)
|
|
27
|
-
* @param signerOrProvider - An instantiated essential-eth provider
|
|
28
|
-
*/
|
|
29
|
-
constructor(addressOrName, contractInterface, signerOrProvider) {
|
|
30
|
-
this._address = addressOrName;
|
|
31
|
-
this._contractInterface = contractInterface;
|
|
32
|
-
this._provider = signerOrProvider;
|
|
33
|
-
contractInterface
|
|
34
|
-
.filter((jsonABIArgument) => jsonABIArgument.type === 'function')
|
|
35
|
-
.forEach((jsonABIArgument) => {
|
|
36
|
-
if ('name' in jsonABIArgument &&
|
|
37
|
-
typeof jsonABIArgument.name === 'string') {
|
|
38
|
-
defineReadOnly(this, jsonABIArgument.name, (..._args) => __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
let functionArguments = _args;
|
|
40
|
-
let options = {};
|
|
41
|
-
// remove options from encoding
|
|
42
|
-
const lastArg = _args[_args.length - 1];
|
|
43
|
-
if (!Array.isArray(lastArg) && typeof lastArg === 'object') {
|
|
44
|
-
options = lastArg;
|
|
45
|
-
functionArguments = _args.slice(0, _args.length - 1);
|
|
46
|
-
}
|
|
47
|
-
const data = (0, encode_decode_transaction_1.encodeData)(jsonABIArgument, functionArguments);
|
|
48
|
-
const decimalGas = typeof options.gasLimit === 'number'
|
|
49
|
-
? options.gasLimit /* user passed in "gasLimit" directly */
|
|
50
|
-
: typeof (jsonABIArgument === null || jsonABIArgument === void 0 ? void 0 : jsonABIArgument.gas) ===
|
|
51
|
-
'number' /* ABI specified "gas". */
|
|
52
|
-
? estimateGas(data)
|
|
53
|
-
: null;
|
|
54
|
-
const nodeResponse = yield (0, fetchers_1.post)(this._provider._rpcUrl, (0, fetchers_1.buildRPCPostBody)('eth_call', [
|
|
55
|
-
Object.assign({ to: this._address.toLowerCase(), data: data }, (decimalGas
|
|
56
|
-
? { gas: `0x${decimalGas.toString(16)}` }
|
|
57
|
-
: {})),
|
|
58
|
-
'latest',
|
|
59
|
-
]));
|
|
60
|
-
return (0, encode_decode_transaction_1.decodeRPCResponse)(jsonABIArgument, nodeResponse);
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.BaseContract = BaseContract;
|
|
67
|
-
/**
|
|
68
|
-
* Applies the unique contract's methods to the instantiated Contract in the constructor based-upon the provided ABI
|
|
69
|
-
*/
|
|
70
|
-
function defineReadOnly(object, name, value) {
|
|
71
|
-
Object.defineProperty(object, name, {
|
|
72
|
-
enumerable: true,
|
|
73
|
-
value: value,
|
|
74
|
-
writable: false,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
exports.defineReadOnly = defineReadOnly;
|
|
78
|
-
/**
|
|
79
|
-
* Only accepts ABIS in JSON format. This allows for stronger typing and assurances of data-types
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* import { Contract, JsonRpcProvider } from 'essential-eth';
|
|
84
|
-
* // UNI airdrop contract
|
|
85
|
-
* const contractAddress = '0x090D4613473dEE047c3f2706764f49E0821D256e';
|
|
86
|
-
* const provider = new JsonRpcProvider();
|
|
87
|
-
*
|
|
88
|
-
* const JSONABI = [
|
|
89
|
-
* {
|
|
90
|
-
* inputs: [
|
|
91
|
-
* {
|
|
92
|
-
* internalType: 'uint256',
|
|
93
|
-
* name: 'index',
|
|
94
|
-
* type: 'uint256',
|
|
95
|
-
* },
|
|
96
|
-
* ],
|
|
97
|
-
* name: 'isClaimed',
|
|
98
|
-
* outputs: [
|
|
99
|
-
* {
|
|
100
|
-
* internalType: 'bool',
|
|
101
|
-
* name: '',
|
|
102
|
-
* type: 'bool',
|
|
103
|
-
* },
|
|
104
|
-
* ],
|
|
105
|
-
* stateMutability: 'view',
|
|
106
|
-
* type: 'function',
|
|
107
|
-
* },
|
|
108
|
-
* ]
|
|
109
|
-
*
|
|
110
|
-
* const contract = new Contract(
|
|
111
|
-
* contractAddress,
|
|
112
|
-
* JSONABI,
|
|
113
|
-
* provider,
|
|
114
|
-
* );
|
|
115
|
-
*
|
|
116
|
-
* (async () => {
|
|
117
|
-
* // prints boolean as to whether index 0 has claimed airdrop or not
|
|
118
|
-
* console.log(await contract.isClaimed(0));
|
|
119
|
-
* })()
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
class Contract extends BaseContract {
|
|
125
|
-
}
|
|
126
|
-
exports.Contract = Contract;
|