essential-eth 0.5.12 → 0.5.13-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/classes/Contract.d.ts +11 -0
- package/{lib → dist}/cjs/classes/Contract.js +0 -0
- package/{lib/esm → dist/cjs}/classes/test/Contract/crv-abi.d.ts +2 -2
- package/{lib → dist}/cjs/classes/test/Contract/crv-abi.js +0 -0
- package/{lib/esm → dist/cjs}/classes/test/Contract/ens-abi.d.ts +2 -2
- package/{lib → dist}/cjs/classes/test/Contract/ens-abi.js +0 -0
- package/{lib/esm → dist/cjs}/classes/test/Contract/fei-abi.d.ts +2 -2
- package/{lib → dist}/cjs/classes/test/Contract/fei-abi.js +0 -0
- package/{lib/esm → dist/cjs}/classes/test/Contract/foo-abi.d.ts +2 -2
- package/{lib → dist}/cjs/classes/test/Contract/foo-abi.js +0 -0
- package/{lib/esm → dist/cjs}/classes/test/Contract/uniswap-abi.d.ts +2 -2
- package/{lib → dist}/cjs/classes/test/Contract/uniswap-abi.js +0 -0
- package/dist/cjs/classes/utils/clean-block.d.ts +3 -0
- package/{lib → dist}/cjs/classes/utils/clean-block.js +0 -0
- package/dist/cjs/classes/utils/clean-log.d.ts +2 -0
- package/{lib → dist}/cjs/classes/utils/clean-log.js +0 -0
- package/dist/cjs/classes/utils/clean-transaction-receipt.d.ts +2 -0
- package/{lib → dist}/cjs/classes/utils/clean-transaction-receipt.js +0 -0
- package/dist/cjs/classes/utils/clean-transaction.d.ts +2 -0
- package/{lib → dist}/cjs/classes/utils/clean-transaction.js +0 -0
- package/{lib → dist}/cjs/classes/utils/encode-decode-transaction.d.ts +4 -16
- package/{lib → dist}/cjs/classes/utils/encode-decode-transaction.js +0 -0
- package/dist/cjs/classes/utils/fetchers.d.ts +9 -0
- package/{lib → dist}/cjs/classes/utils/fetchers.js +0 -0
- package/dist/cjs/classes/utils/hex-to-decimal.d.ts +1 -0
- package/{lib → dist}/cjs/classes/utils/hex-to-decimal.js +0 -0
- package/{lib → dist}/cjs/classes/utils/prepare-transaction.d.ts +2 -6
- package/{lib → dist}/cjs/classes/utils/prepare-transaction.js +0 -0
- package/{lib/esm → dist/cjs}/index.d.ts +25 -25
- package/{lib → dist}/cjs/index.js +0 -0
- package/dist/cjs/index.umd.js +2 -0
- package/dist/cjs/index.umd.js.map +1 -0
- package/{lib/esm → dist/cjs}/logger/logger.d.ts +11 -11
- package/{lib → dist}/cjs/logger/logger.js +0 -0
- package/dist/cjs/logger/package-version.d.ts +1 -0
- package/{lib → dist}/cjs/logger/package-version.js +1 -1
- package/dist/cjs/providers/BaseProvider.d.ts +24 -0
- package/{lib → dist}/cjs/providers/BaseProvider.js +0 -0
- package/{lib → dist}/cjs/providers/FallthroughProvider.d.ts +11 -24
- package/{lib → dist}/cjs/providers/FallthroughProvider.js +0 -0
- package/dist/cjs/providers/JsonRpcProvider.d.ts +7 -0
- package/{lib → dist}/cjs/providers/JsonRpcProvider.js +0 -0
- package/{lib/esm → dist/cjs}/providers/test/rpc-urls.d.ts +11 -11
- package/{lib → dist}/cjs/providers/test/rpc-urls.js +0 -0
- package/{lib/esm → dist/cjs}/providers/utils/chains-info.d.ts +467 -467
- package/{lib → dist}/cjs/providers/utils/chains-info.js +0 -0
- package/dist/cjs/shared/tiny-big/helpers.d.ts +1 -0
- package/{lib → dist}/cjs/shared/tiny-big/helpers.js +0 -0
- package/dist/cjs/shared/tiny-big/tiny-big.d.ts +10 -0
- package/{lib → dist}/cjs/shared/tiny-big/tiny-big.js +0 -0
- package/{lib/esm → dist/cjs}/shared/validate-type.d.ts +3 -3
- package/{lib → dist}/cjs/shared/validate-type.js +0 -0
- package/{lib → dist}/cjs/types/Block.types.d.ts +40 -41
- package/{lib → dist}/cjs/types/Block.types.js +0 -0
- package/{lib/esm → dist/cjs}/types/Contract.types.d.ts +24 -24
- package/{lib → dist}/cjs/types/Contract.types.js +0 -0
- package/{lib → dist}/cjs/types/Filter.types.d.ts +12 -16
- package/{lib → dist}/cjs/types/Filter.types.js +0 -0
- package/{lib → dist}/cjs/types/Network.types.d.ts +5 -8
- package/{lib → dist}/cjs/types/Network.types.js +0 -0
- package/{lib → dist}/cjs/types/Transaction.types.d.ts +113 -123
- package/{lib → dist}/cjs/types/Transaction.types.js +0 -0
- package/dist/cjs/utils/bytes.d.ts +40 -0
- package/{lib → dist}/cjs/utils/bytes.js +0 -0
- package/dist/cjs/utils/compute-address.d.ts +1 -0
- package/{lib → dist}/cjs/utils/compute-address.js +0 -0
- package/dist/cjs/utils/compute-public-key.d.ts +2 -0
- package/{lib → dist}/cjs/utils/compute-public-key.js +0 -0
- package/dist/cjs/utils/ether-to-gwei.d.ts +3 -0
- package/{lib → dist}/cjs/utils/ether-to-gwei.js +0 -0
- package/dist/cjs/utils/ether-to-wei.d.ts +3 -0
- package/{lib → dist}/cjs/utils/ether-to-wei.js +0 -0
- package/dist/cjs/utils/gwei-to-ether.d.ts +3 -0
- package/{lib → dist}/cjs/utils/gwei-to-ether.js +0 -0
- package/dist/cjs/utils/hash-message.d.ts +2 -0
- package/{lib → dist}/cjs/utils/hash-message.js +0 -0
- package/dist/cjs/utils/is-address.d.ts +1 -0
- package/{lib → dist}/cjs/utils/is-address.js +0 -0
- package/dist/cjs/utils/keccak256.d.ts +2 -0
- package/{lib → dist}/cjs/utils/keccak256.js +0 -0
- package/dist/cjs/utils/solidity-keccak256.d.ts +2 -0
- package/{lib → dist}/cjs/utils/solidity-keccak256.js +0 -0
- package/dist/cjs/utils/split-signature.d.ts +2 -0
- package/{lib → dist}/cjs/utils/split-signature.js +0 -0
- package/dist/cjs/utils/to-checksum-address.d.ts +1 -0
- package/{lib → dist}/cjs/utils/to-checksum-address.js +0 -0
- package/dist/cjs/utils/to-utf8-bytes.d.ts +1 -0
- package/{lib → dist}/cjs/utils/to-utf8-bytes.js +0 -0
- package/dist/cjs/utils/wei-to-ether.d.ts +3 -0
- package/{lib → dist}/cjs/utils/wei-to-ether.js +0 -0
- package/{lib → dist}/esm/classes/Contract.d.ts +0 -0
- package/{lib → dist}/esm/classes/Contract.js +0 -0
- package/{lib/cjs → dist/esm}/classes/test/Contract/crv-abi.d.ts +0 -0
- package/{lib → dist}/esm/classes/test/Contract/crv-abi.js +0 -0
- package/{lib/cjs → dist/esm}/classes/test/Contract/ens-abi.d.ts +0 -0
- package/{lib → dist}/esm/classes/test/Contract/ens-abi.js +0 -0
- package/{lib/cjs → dist/esm}/classes/test/Contract/fei-abi.d.ts +0 -0
- package/{lib → dist}/esm/classes/test/Contract/fei-abi.js +0 -0
- package/{lib/cjs → dist/esm}/classes/test/Contract/foo-abi.d.ts +0 -0
- package/{lib → dist}/esm/classes/test/Contract/foo-abi.js +0 -0
- package/{lib/cjs → dist/esm}/classes/test/Contract/uniswap-abi.d.ts +0 -0
- package/{lib → dist}/esm/classes/test/Contract/uniswap-abi.js +0 -0
- package/{lib → dist}/esm/classes/utils/clean-block.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/clean-block.js +0 -0
- package/{lib → dist}/esm/classes/utils/clean-log.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/clean-log.js +0 -0
- package/{lib → dist}/esm/classes/utils/clean-transaction-receipt.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/clean-transaction-receipt.js +0 -0
- package/{lib → dist}/esm/classes/utils/clean-transaction.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/clean-transaction.js +0 -0
- package/{lib → dist}/esm/classes/utils/encode-decode-transaction.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/encode-decode-transaction.js +0 -0
- package/{lib → dist}/esm/classes/utils/fetchers.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/fetchers.js +0 -0
- package/{lib → dist}/esm/classes/utils/hex-to-decimal.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/hex-to-decimal.js +0 -0
- package/{lib → dist}/esm/classes/utils/prepare-transaction.d.ts +0 -0
- package/{lib → dist}/esm/classes/utils/prepare-transaction.js +0 -0
- package/{lib/cjs → dist/esm}/index.d.ts +0 -0
- package/{lib → dist}/esm/index.js +0 -0
- package/{lib/cjs → dist/esm}/logger/logger.d.ts +0 -0
- package/{lib → dist}/esm/logger/logger.js +0 -0
- package/dist/esm/logger/package-version.d.ts +1 -0
- package/dist/esm/logger/package-version.js +1 -0
- package/{lib → dist}/esm/providers/BaseProvider.d.ts +0 -0
- package/{lib → dist}/esm/providers/BaseProvider.js +0 -0
- package/{lib → dist}/esm/providers/FallthroughProvider.d.ts +0 -0
- package/{lib → dist}/esm/providers/FallthroughProvider.js +0 -0
- package/{lib → dist}/esm/providers/JsonRpcProvider.d.ts +0 -0
- package/{lib → dist}/esm/providers/JsonRpcProvider.js +0 -0
- package/{lib/cjs → dist/esm}/providers/test/rpc-urls.d.ts +0 -0
- package/{lib → dist}/esm/providers/test/rpc-urls.js +0 -0
- package/{lib/cjs → dist/esm}/providers/utils/chains-info.d.ts +0 -0
- package/{lib → dist}/esm/providers/utils/chains-info.js +0 -0
- package/{lib → dist}/esm/shared/tiny-big/helpers.d.ts +0 -0
- package/{lib → dist}/esm/shared/tiny-big/helpers.js +0 -0
- package/{lib → dist}/esm/shared/tiny-big/tiny-big.d.ts +0 -0
- package/{lib → dist}/esm/shared/tiny-big/tiny-big.js +0 -0
- package/{lib/cjs → dist/esm}/shared/validate-type.d.ts +0 -0
- package/{lib → dist}/esm/shared/validate-type.js +0 -0
- package/{lib → dist}/esm/types/Block.types.d.ts +0 -0
- package/{lib → dist}/esm/types/Block.types.js +0 -0
- package/{lib/cjs → dist/esm}/types/Contract.types.d.ts +0 -0
- package/{lib → dist}/esm/types/Contract.types.js +0 -0
- package/{lib → dist}/esm/types/Filter.types.d.ts +0 -0
- package/{lib → dist}/esm/types/Filter.types.js +0 -0
- package/{lib → dist}/esm/types/Network.types.d.ts +0 -0
- package/{lib → dist}/esm/types/Network.types.js +0 -0
- package/{lib → dist}/esm/types/Transaction.types.d.ts +0 -0
- package/{lib → dist}/esm/types/Transaction.types.js +0 -0
- package/{lib → dist}/esm/utils/bytes.d.ts +0 -0
- package/{lib → dist}/esm/utils/bytes.js +0 -0
- package/{lib → dist}/esm/utils/compute-address.d.ts +0 -0
- package/{lib → dist}/esm/utils/compute-address.js +0 -0
- package/{lib → dist}/esm/utils/compute-public-key.d.ts +0 -0
- package/{lib → dist}/esm/utils/compute-public-key.js +0 -0
- package/{lib → dist}/esm/utils/ether-to-gwei.d.ts +0 -0
- package/{lib → dist}/esm/utils/ether-to-gwei.js +0 -0
- package/{lib → dist}/esm/utils/ether-to-wei.d.ts +0 -0
- package/{lib → dist}/esm/utils/ether-to-wei.js +0 -0
- package/{lib → dist}/esm/utils/gwei-to-ether.d.ts +0 -0
- package/{lib → dist}/esm/utils/gwei-to-ether.js +0 -0
- package/{lib → dist}/esm/utils/hash-message.d.ts +0 -0
- package/{lib → dist}/esm/utils/hash-message.js +0 -0
- package/{lib → dist}/esm/utils/is-address.d.ts +0 -0
- package/{lib → dist}/esm/utils/is-address.js +0 -0
- package/{lib → dist}/esm/utils/keccak256.d.ts +0 -0
- package/{lib → dist}/esm/utils/keccak256.js +0 -0
- package/{lib → dist}/esm/utils/solidity-keccak256.d.ts +0 -0
- package/{lib → dist}/esm/utils/solidity-keccak256.js +0 -0
- package/{lib → dist}/esm/utils/split-signature.d.ts +0 -0
- package/{lib → dist}/esm/utils/split-signature.js +0 -0
- package/{lib → dist}/esm/utils/to-checksum-address.d.ts +0 -0
- package/{lib → dist}/esm/utils/to-checksum-address.js +0 -0
- package/{lib → dist}/esm/utils/to-utf8-bytes.d.ts +0 -0
- package/{lib → dist}/esm/utils/to-utf8-bytes.js +0 -0
- package/{lib → dist}/esm/utils/wei-to-ether.d.ts +0 -0
- package/{lib → dist}/esm/utils/wei-to-ether.js +0 -0
- package/package.json +25 -13
- package/readme.md +70 -51
- package/lib/cjs/classes/Contract.d.ts +0 -78
- package/lib/cjs/classes/utils/clean-block.d.ts +0 -121
- package/lib/cjs/classes/utils/clean-log.d.ts +0 -9
- package/lib/cjs/classes/utils/clean-transaction-receipt.d.ts +0 -14
- package/lib/cjs/classes/utils/clean-transaction.d.ts +0 -14
- package/lib/cjs/classes/utils/fetchers.d.ts +0 -39
- package/lib/cjs/classes/utils/hex-to-decimal.d.ts +0 -18
- package/lib/cjs/logger/package-version.d.ts +0 -1
- package/lib/cjs/providers/BaseProvider.d.ts +0 -353
- package/lib/cjs/providers/JsonRpcProvider.d.ts +0 -33
- package/lib/cjs/shared/tiny-big/helpers.d.ts +0 -17
- package/lib/cjs/shared/tiny-big/tiny-big.d.ts +0 -58
- package/lib/cjs/utils/bytes.d.ts +0 -289
- package/lib/cjs/utils/compute-address.d.ts +0 -17
- package/lib/cjs/utils/compute-public-key.d.ts +0 -18
- package/lib/cjs/utils/ether-to-gwei.d.ts +0 -27
- package/lib/cjs/utils/ether-to-wei.d.ts +0 -27
- package/lib/cjs/utils/gwei-to-ether.d.ts +0 -27
- package/lib/cjs/utils/hash-message.d.ts +0 -14
- package/lib/cjs/utils/is-address.d.ts +0 -24
- package/lib/cjs/utils/keccak256.d.ts +0 -16
- package/lib/cjs/utils/solidity-keccak256.d.ts +0 -39
- package/lib/cjs/utils/split-signature.d.ts +0 -24
- package/lib/cjs/utils/to-checksum-address.d.ts +0 -17
- package/lib/cjs/utils/to-utf8-bytes.d.ts +0 -15
- package/lib/cjs/utils/wei-to-ether.d.ts +0 -27
- package/lib/esm/logger/package-version.d.ts +0 -1
- package/lib/esm/logger/package-version.js +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RPCTransactionReceipt, TransactionReceipt } from '../../types/Transaction.types';
|
|
2
|
-
/**
|
|
3
|
-
* Converts RPC transaction receipt response to more JS-friendly format
|
|
4
|
-
*
|
|
5
|
-
* @param transactionReceipt the transaction receipt to clean
|
|
6
|
-
* @returns a cleaned transaction receipt
|
|
7
|
-
* @example
|
|
8
|
-
* ```javascript
|
|
9
|
-
* const RPCTransactionReceipt = { blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: '0xe28f62', contractAddress: null, cumulativeGasUsed: '0x37a2b9', effectiveGasPrice: '0x62df1c62c', from: '0x642824fab1d0141073ed74326332950bec4701e3', gasUsed: '0x1a325', logs: [ { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 84, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x000000000000000000000000000000000000000000000000000000000000074d' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 85, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x000000000000000000000000000000000000000000000000000000000000074e' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 86, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x000000000000000000000000000000000000000000000000000000000000074f' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 87, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000750' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 88, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000751' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 89, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000752' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 90, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000753' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 91, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000754' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 92, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000755' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 93, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000756' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 } ], logsBloom: '0x20000080004000000000000400000000000001000000000400000000000000000000000000000000000000000008000000000000000000000000000000004000000000000008000000000008000000010080000014000004000000000000000000100000020800000000000000001800000080000000002000000010000000000000000000000200000200000000002000000000000400000000000000000000000000000000000000000040000000000000000100000000000000000000040002100002000000000000080000000000000100000002000000040000001220000000000000000000000000000000000000000000000000000000000000004000', status: '0x1', to: '0x84f80ea01e26b7c11bdd241970982c7eeab6ddcc', transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: '0x29', type: '0x2' }
|
|
10
|
-
* cleanTransactionReceipt(RPCTransactionReceipt);
|
|
11
|
-
* // { blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, contractAddress: null, cumulativeGasUsed: Big { s: 1, e: 6, c: [ 3, 6, 4, 6, 1, 3, 7 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, effectiveGasPrice: Big { s: 1, e: 10, c: [ 2, 6, 5, 4, 0, 6, 2, 3, 4, 0, 4 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, from: '0x642824FaB1D0141073ed74326332950bEc4701e3', gasUsed: Big { s: 1, e: 5, c: [ 1, 0, 7, 3, 0, 1 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, logs: [ { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 84, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x000000000000000000000000000000000000000000000000000000000000074d' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 85, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x000000000000000000000000000000000000000000000000000000000000074e' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 86, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x000000000000000000000000000000000000000000000000000000000000074f' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 87, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000750' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 88, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000751' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 89, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000752' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 90, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000753' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 91, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000754' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 92, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000755' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 }, { address: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, data: '0x', logIndex: 93, topics: [ '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', '0x0000000000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000642824fab1d0141073ed74326332950bec4701e3', '0x0000000000000000000000000000000000000000000000000000000000000756' ], transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41 } ], logsBloom: '0x20000080004000000000000400000000000001000000000400000000000000000000000000000000000000000008000000000000000000000000000000004000000000000008000000000008000000010080000014000004000000000000000000100000020800000000000000001800000080000000002000000010000000000000000000000200000200000000002000000000000400000000000000000000000000000000000000000040000000000000000100000000000000000000040002100002000000000000080000000000000100000002000000040000001220000000000000000000000000000000000000000000000000000000000000004000', status: 1, to: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', transactionHash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', transactionIndex: 41, type: 2, byzantium: true, confirmations: 40 }
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare function cleanTransactionReceipt(transactionReceipt: RPCTransactionReceipt): TransactionReceipt;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RPCTransaction, TransactionResponse } from '../../types/Transaction.types';
|
|
2
|
-
/**
|
|
3
|
-
* Converts RPC transaction response to more JS-friendly format
|
|
4
|
-
*
|
|
5
|
-
* @param transaction the transaction to clean
|
|
6
|
-
* @returns a cleaned transaction
|
|
7
|
-
* @example
|
|
8
|
-
* ```javascript
|
|
9
|
-
* const RPCTransaction = { accessList: [], blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: '0xe28f62', chainId: '0x1', from: '0x642824fab1d0141073ed74326332950bec4701e3', gas: '0x274b7', gasPrice: '0x62df1c62c', hash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', input: '0xa0712d68000000000000000000000000000000000000000000000000000000000000000a', maxFeePerGas: '0x98808e3f0', maxPriorityFeePerGas: '0x3b9aca00', nonce: '0x42', r: '0x304682f8b22006dd1347c3722f6e43a5ad8e3a1ae51939cc0d6f07981602f5c0', s: '0x207ad110eb5c014cb628814b92396785fabfbe74542293300eeadf156f50f105', to: '0x84f80ea01e26b7c11bdd241970982c7eeab6ddcc', transactionIndex: '0x29', type: '0x2', v: '0x1', value: '0x470de4df820000' }
|
|
10
|
-
* cleanTransaction(RPCTransaction);
|
|
11
|
-
* // { accessList: [], blockHash: '0x03ddc6a835462f750fcaf5ab511d8c48121b0813e3e80de84d7adc3ef192b7bf', blockNumber: 14847842, chainId: 1, from: '0x642824FaB1D0141073ed74326332950bEc4701e3', gas: Big { s: 1, e: 5, c: [ 1, 6, 0, 9, 5, 1 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, gasPrice: Big { s: 1, e: 10, c: [ 2, 6, 5, 4, 0, 6, 2, 3, 4, 0, 4 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, hash: '0xd0befcb9d10a89aba2d488534811bf5c62a889e2499d23cdd83c2a2200cde873', input: '0xa0712d68000000000000000000000000000000000000000000000000000000000000000a', maxFeePerGas: Big { s: 1, e: 10, c: [ 4, 0, 9, 3, 6, 9, 8, 9, 6, 8 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, maxPriorityFeePerGas: Big { s: 1, e: 9, c: [ 1 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, nonce: 66, r: '0x304682f8b22006dd1347c3722f6e43a5ad8e3a1ae51939cc0d6f07981602f5c0', s: '0x207ad110eb5c014cb628814b92396785fabfbe74542293300eeadf156f50f105', to: '0x84F80EA01e26B7C11bdd241970982C7EEAb6DdcC', transactionIndex: 41, type: 2, v: 1, value: Big { s: 1, e: 16, c: [ 2 ], constructor: { [λ: Big] DP: 20, RM: 1, NE: -7, PE: 21, strict: false, roundDown: 0, roundHalfUp: 1, roundHalfEven: 2, roundUp: 3, Big: [Circular], default: [Circular] }, padAndChop: [λ] }, confirmations: 53 }
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare function cleanTransaction(transaction: RPCTransaction): TransactionResponse;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Makes a post request with the specified JSON data, normally to the a Ethereum JSON RPC API endpoint
|
|
3
|
-
*
|
|
4
|
-
* @param url the URL to send the request to
|
|
5
|
-
* @param body the body data (JSON) to send with the request
|
|
6
|
-
* @returns the JSON response from the server
|
|
7
|
-
* @example
|
|
8
|
-
* ```javascript
|
|
9
|
-
* post('https://free-eth-node.com/api/eth', { jsonrpc: '2.0', id: 1, method: 'eth_gasPrice', params: [] });
|
|
10
|
-
* // '0x66fa8dbfd'
|
|
11
|
-
*
|
|
12
|
-
* post('https://free-eth-node.com/api/eth', { jsonrpc: '2.0', id: 1, method: 'eth_getBalance', params: [ '0x4a986a6dCA6dbf99bC3d17F8D71aFb0d60e740f8', 'latest' ] });
|
|
13
|
-
* // '0x312faeb995df61d4'
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare function post(url: string, body: Record<string, unknown>): Promise<any>;
|
|
17
|
-
declare type RPCMethodName = 'eth_getBlockByNumber' | 'eth_getBlockByHash' | 'eth_call' | 'eth_chainId' | 'eth_gasPrice' | 'eth_getBalance' | 'eth_getTransactionByHash' | 'eth_getTransactionReceipt' | 'eth_getTransactionCount' | 'eth_getCode' | 'eth_blockNumber' | 'eth_estimateGas' | 'eth_getLogs';
|
|
18
|
-
/**
|
|
19
|
-
* Prepares data to be sent using the {@link post} function. Data is prepared per the {@link https://en.wikipedia.org/wiki/JSON-RPC#Examples JSON RPC v2 spec}
|
|
20
|
-
*
|
|
21
|
-
* @param method the RPC method to be invoked
|
|
22
|
-
* @param params the parameters to be passed to the defined method
|
|
23
|
-
* @returns a POST method body matching the {@link https://en.wikipedia.org/wiki/JSON-RPC#Examples JSON RPC v2 spec}
|
|
24
|
-
* @example
|
|
25
|
-
* ```javascript
|
|
26
|
-
* buildRPCPostBody('eth_gasPrice', []);
|
|
27
|
-
* // { jsonrpc: '2.0', id: 1, method: 'eth_gasPrice', params: [] }
|
|
28
|
-
*
|
|
29
|
-
* buildRPCPostBody('eth_getBalance', ['0x407d73d8a49eeb85d32cf465507dd71d507100c1', 'latest']);
|
|
30
|
-
* // { jsonrpc: '2.0', id: 1, method: 'eth_getBalance', params: [ '0x4a986a6dCA6dbf99bC3d17F8D71aFb0d60e740f8', 'latest' ] }
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare function buildRPCPostBody(method: RPCMethodName, params: unknown[]): {
|
|
34
|
-
jsonrpc: string;
|
|
35
|
-
id: number;
|
|
36
|
-
method: RPCMethodName;
|
|
37
|
-
params: unknown[];
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a hexadecimal string it's decimal equivalent.
|
|
3
|
-
* This is needed instead of parseInt because parseInt loses precision.
|
|
4
|
-
*
|
|
5
|
-
* @param hex the hex string to be converted to decimal
|
|
6
|
-
* @returns a decimal value equivalent to the hex string given
|
|
7
|
-
* @example
|
|
8
|
-
* ```javascript
|
|
9
|
-
* hexToDecimal('0x34');
|
|
10
|
-
* // 52
|
|
11
|
-
* ```
|
|
12
|
-
* @example
|
|
13
|
-
* ```javascript
|
|
14
|
-
* hexToDecimal('0x628608');
|
|
15
|
-
* // 6456840
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function hexToDecimal(hex: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const version = "0.5.12";
|
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
import type { TinyBig } from '../shared/tiny-big/tiny-big';
|
|
2
|
-
import type { BlockResponse, BlockTag } from '../types/Block.types';
|
|
3
|
-
import type { Filter, FilterByBlockHash } from '../types/Filter.types';
|
|
4
|
-
import type { Network } from '../types/Network.types';
|
|
5
|
-
import type { Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '../types/Transaction.types';
|
|
6
|
-
export declare abstract class BaseProvider {
|
|
7
|
-
/**
|
|
8
|
-
* ignore
|
|
9
|
-
*/
|
|
10
|
-
abstract selectRpcUrl(): string;
|
|
11
|
-
abstract post(body: Record<string, unknown>): Promise<any>;
|
|
12
|
-
/**
|
|
13
|
-
* @ignore
|
|
14
|
-
*/
|
|
15
|
-
readonly _rpcUrls: string[];
|
|
16
|
-
/**
|
|
17
|
-
* @ignore
|
|
18
|
-
*/
|
|
19
|
-
protected _post: (body: Record<string, unknown>) => Promise<any>;
|
|
20
|
-
/**
|
|
21
|
-
* @param rpcUrls The URL(s) to your Eth node(s). Consider POKT or Infura
|
|
22
|
-
* @example
|
|
23
|
-
* `https://free-eth-node.com/api/eth`
|
|
24
|
-
* @example
|
|
25
|
-
* `https://mainnet.infura.io/v3/YOUR-PROJECT-ID`
|
|
26
|
-
*/
|
|
27
|
-
constructor(rpcUrls: string[]);
|
|
28
|
-
/**
|
|
29
|
-
* Gets information (name, chainId, and ensAddress when applicable) about the network the provider is connected to.
|
|
30
|
-
*
|
|
31
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.getNetwork`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getNetwork) in ethers.js
|
|
32
|
-
* * [Similar](/docs/api#isd) to [`web3.eth.getChainId`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#getchainid) in web3.js, returns more than just the `chainId`
|
|
33
|
-
*
|
|
34
|
-
* @returns information about the network this provider is currently connected to
|
|
35
|
-
* @example
|
|
36
|
-
* ```javascript
|
|
37
|
-
* jsonRpcProvider('https://free-eth-node.com/api/eth').getNetwork();
|
|
38
|
-
* // { chainId: 1, name: 'eth', ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e' }
|
|
39
|
-
* ```
|
|
40
|
-
* @example
|
|
41
|
-
* ```javascript
|
|
42
|
-
* jsonRpcProvider('https://free-eth-node.com/api/MATIC').getNetwork();
|
|
43
|
-
* // { chainId: 137, name: 'MATIC', ensAddress: null }
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
getNetwork(): Promise<Network>;
|
|
47
|
-
/**
|
|
48
|
-
* Gets the number of the most recently mined block on the network the provider is connected to.
|
|
49
|
-
*
|
|
50
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.getBlockNumber`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getBlockNumber) in ethers.js
|
|
51
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.getBlockNumber`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#getblocknumber) in web3.js
|
|
52
|
-
*
|
|
53
|
-
* @returns the number of the most recently mined block
|
|
54
|
-
* @example
|
|
55
|
-
* ```javascript
|
|
56
|
-
* await provider.getBlockNumber();
|
|
57
|
-
* // 1053312
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
getBlockNumber(): Promise<number>;
|
|
61
|
-
/**
|
|
62
|
-
* Gets information about a specified transaction, even if it hasn't been mined yet.
|
|
63
|
-
*
|
|
64
|
-
* * [Similar](/docs/api#isd) to [`ethers.provider.getTransaction`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getTransaction) in ethers.js, does not have `wait` method that waits until the transaction has been mined
|
|
65
|
-
* * [Similar](/docs/api#isd) to [`web3.eth.getTransaction`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#gettransaction) in web3.js, some information returned using different types
|
|
66
|
-
*
|
|
67
|
-
* @param transactionHash the hash of the transaction to get information about
|
|
68
|
-
* @returns information about the specified transaction
|
|
69
|
-
* @example
|
|
70
|
-
* ```javascript
|
|
71
|
-
* await provider.getTransaction('0x9014ae6ef92464338355a79e5150e542ff9a83e2323318b21f40d6a3e65b4789');
|
|
72
|
-
* // {
|
|
73
|
-
* // accessList: [],
|
|
74
|
-
* // blockHash: "0x876810a013dbcd140f6fd6048c1dc33abbb901f1f96b394c2fa63aef3cb40b5d",
|
|
75
|
-
* // blockNumber: 14578286,
|
|
76
|
-
* // chainId: 1,
|
|
77
|
-
* // from: "0xdfD9dE5f6FA60BD70636c0900752E93a6144AEd4",
|
|
78
|
-
* // gas: { TinyBig: 112163 },
|
|
79
|
-
* // gasPrice: { TinyBig: 48592426858 },
|
|
80
|
-
* // hash: "0x9014ae6ef92464338355a79e5150e542ff9a83e2323318b21f40d6a3e65b4789",
|
|
81
|
-
* // input: "0x83259f17000000000000000000000000000000000000000000...",
|
|
82
|
-
* // maxFeePerGas: { TinyBig: 67681261618 },
|
|
83
|
-
* // maxPriorityFeePerGas: { TinyBig: 1500000000 },
|
|
84
|
-
* // nonce: { TinyBig: 129 },
|
|
85
|
-
* // r: "0x59a7c15b12c18cd68d6c440963d959bff3e73831ffc938e75ecad07f7ee43fbc",
|
|
86
|
-
* // s: "0x1ebaf05f0d9273b16c2a7748b150a79d22533a8cd74552611cbe620fee3dcf1c",
|
|
87
|
-
* // to: "0x39B72d136ba3e4ceF35F48CD09587ffaB754DD8B",
|
|
88
|
-
* // transactionIndex: 29,
|
|
89
|
-
* // type: 2,
|
|
90
|
-
* // v: 0,
|
|
91
|
-
* // value: { TinyBig: 0 },
|
|
92
|
-
* // confirmations: 298140,
|
|
93
|
-
* // }
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
getTransaction(transactionHash: string): Promise<TransactionResponse>;
|
|
97
|
-
/**
|
|
98
|
-
* Gives information about a transaction that has already been mined. Includes additional information beyond what's provided by [`getTransaction`](/docs/api/modules#gettransaction).
|
|
99
|
-
*
|
|
100
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.getTransactionReceipt`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getTransactionReceipt) in ethers.js
|
|
101
|
-
* * [Similar](/docs/api#isd) to [`web3.eth.getTransactionReceipt`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#gettransactionreceipt) in web3.js, some information returned using different types
|
|
102
|
-
*
|
|
103
|
-
* @param transactionHash the hash of the transaction to get information about
|
|
104
|
-
* @returns information about the specified transaction that has already been mined
|
|
105
|
-
* @example
|
|
106
|
-
* ```javascript
|
|
107
|
-
* await provider.getTransactionReceipt('0x9014ae6ef92464338355a79e5150e542ff9a83e2323318b21f40d6a3e65b4789');
|
|
108
|
-
* // {
|
|
109
|
-
* // blockHash: "0x876810a013dbcd140f6fd6048c1dc33abbb901f1f96b394c2fa63aef3cb40b5d",
|
|
110
|
-
* // blockNumber: 14578286,
|
|
111
|
-
* // contractAddress: null,
|
|
112
|
-
* // cumulativeGasUsed: { TinyBig: 3067973 },
|
|
113
|
-
* // effectiveGasPrice: { TinyBig: 48592426858 },
|
|
114
|
-
* // from: "0xdfD9dE5f6FA60BD70636c0900752E93a6144AEd4",
|
|
115
|
-
* // gasUsed: { TinyBig: 112163 },
|
|
116
|
-
* // logs: [
|
|
117
|
-
* // {
|
|
118
|
-
* // address: "0x0eDF9bc41Bbc1354c70e2107F80C42caE7FBBcA8",
|
|
119
|
-
* // blockHash: "0x876810a013dbcd140f6fd6048c1dc33abbb901f1f96b394c2fa63aef3cb40b5d",
|
|
120
|
-
* // blockNumber: 14578286,
|
|
121
|
-
* // data: "0x0000000000000000000000000000000000000000000003a12ec797b5484968c1",
|
|
122
|
-
* // logIndex: 42,
|
|
123
|
-
* // topics: [
|
|
124
|
-
* // "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
|
|
125
|
-
* // "0x00000000000000000000000039b72d136ba3e4cef35f48cd09587ffab754dd8b",
|
|
126
|
-
* // "0x000000000000000000000000dfd9de5f6fa60bd70636c0900752e93a6144aed4",
|
|
127
|
-
* // ],
|
|
128
|
-
* // transactionHash: "0x9014ae6ef92464338355a79e5150e542ff9a83e2323318b21f40d6a3e65b4789",
|
|
129
|
-
* // transactionIndex: 29,
|
|
130
|
-
* // },
|
|
131
|
-
* // {
|
|
132
|
-
* // address: "0x39B72d136ba3e4ceF35F48CD09587ffaB754DD8B",
|
|
133
|
-
* // blockHash: "0x876810a013dbcd140f6fd6048c1dc33abbb901f1f96b394c2fa63aef3cb40b5d",
|
|
134
|
-
* // blockNumber: 14578286,
|
|
135
|
-
* // data: "0x0000000000000000000000000000000000000000000003a12ec797b5484968c1",
|
|
136
|
-
* // logIndex: 43,
|
|
137
|
-
* // topics: [
|
|
138
|
-
* // "0x34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf7",
|
|
139
|
-
* // "0x000000000000000000000000dfd9de5f6fa60bd70636c0900752e93a6144aed4",
|
|
140
|
-
* // "0x0000000000000000000000000000000000000000000000000000000000000003",
|
|
141
|
-
* // ],
|
|
142
|
-
* // transactionHash: "0x9014ae6ef92464338355a79e5150e542ff9a83e2323318b21f40d6a3e65b4789",
|
|
143
|
-
* // transactionIndex: 29,
|
|
144
|
-
* // },
|
|
145
|
-
* // ],
|
|
146
|
-
* // logsBloom: "0x00000000000000000000000000000...",
|
|
147
|
-
* // status: 1,
|
|
148
|
-
* // to: "0x39B72d136ba3e4ceF35F48CD09587ffaB754DD8B",
|
|
149
|
-
* // transactionHash: "0x9014ae6ef92464338355a79e5150e542ff9a83e2323318b21f40d6a3e65b4789",
|
|
150
|
-
* // transactionIndex: 29,
|
|
151
|
-
* // type: 2,
|
|
152
|
-
* // byzantium: true,
|
|
153
|
-
* // confirmations: 298171,
|
|
154
|
-
* // }
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
|
-
getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
|
|
158
|
-
/**
|
|
159
|
-
* Returns the number of sent transactions by an address, from genesis (or as far back as a provider looks) up to specified block.
|
|
160
|
-
*
|
|
161
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.getTransactionCount`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getTransactionCount) in ethers.js
|
|
162
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.getTransactionCount`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#gettransactioncount) in web3.js
|
|
163
|
-
*
|
|
164
|
-
* @param address the address to count number of sent transactions
|
|
165
|
-
* @param blockTag the block to count transactions up to, inclusive
|
|
166
|
-
* @returns the number of transactions sent by the specified address
|
|
167
|
-
* @example
|
|
168
|
-
* ```javascript
|
|
169
|
-
* await provider.getTransactionCount('0x71660c4005ba85c37ccec55d0c4493e66fe775d3');
|
|
170
|
-
* // 1060000
|
|
171
|
-
* ```
|
|
172
|
-
* @example
|
|
173
|
-
* ```javascript
|
|
174
|
-
* await provider.getTransactionCount('0x71660c4005ba85c37ccec55d0c4493e66fe775d3', 'latest');
|
|
175
|
-
* // 1060000
|
|
176
|
-
* ```
|
|
177
|
-
* @example
|
|
178
|
-
* ```javascript
|
|
179
|
-
* await provider.getTransactionCount('0x71660c4005ba85c37ccec55d0c4493e66fe775d3', 14649390);
|
|
180
|
-
* // 1053312
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
getTransactionCount(address: string, blockTag?: BlockTag): Promise<number>;
|
|
184
|
-
/**
|
|
185
|
-
* Gets information about a certain block, optionally with full transaction objects.
|
|
186
|
-
*
|
|
187
|
-
* * [Similar](/docs/api#isd) to [`ethers.provider.getBlock`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getLogs) in ethers.js, includes some additional information. Can also return block with full transaction objects, similar to [`ethers.providers.getBlockWithTransactions`]
|
|
188
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.getBlock`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#getpastlogs) in web3.js
|
|
189
|
-
*
|
|
190
|
-
* @param timeFrame The number, hash, or text-based description ('latest', 'earliest', or 'pending') of the block to collect information on.
|
|
191
|
-
* @param returnTransactionObjects Whether to also return data about the transactions on the block.
|
|
192
|
-
* @returns A BlockResponse object with information about the specified block
|
|
193
|
-
* @example
|
|
194
|
-
* ```javascript
|
|
195
|
-
* await provider.getBlock(14879862);
|
|
196
|
-
* // {
|
|
197
|
-
* // baseFeePerGas: { TinyBig: 39095728776 },
|
|
198
|
-
* // difficulty: { TinyBig: 14321294455359973 },
|
|
199
|
-
* // extraData: "0x486976656f6e2073672d6865617679",
|
|
200
|
-
* // gasLimit: { TinyBig: 29970620 },
|
|
201
|
-
* // gasUsed: { TinyBig: 20951384 },
|
|
202
|
-
* // hash: "0x563b458ec3c4f87393b53f70bdddc0058497109b784d8cacd9247ddf267049ab",
|
|
203
|
-
* // logsBloom:
|
|
204
|
-
* // "0x9f38794fe80b521794df6efad8b0d2e9582f9ec3959a3f9384bda0fa371cfa5fac5af9d515c6bdf1ec325f5b5f7ebdd6a3a9fae17b38a86d4dc4b0971afc68d8086640550f4c156e6f923f4a1bb94fb0bed6cdcc474c5c64bfeff7a4a906f72b9a7b94004ee58efc53d63ac66961acd3a431b2d896cc9fd75f6072960bced45f770587caf130f57504decfcb63c6ca8fbc5bdbd749edd5a99a7375d2b81872289adb775fb3c928259f4be39c6d3f4d5b6217822979bb88c1f1fb62429b1b6d41cf4e3f77f9e1db3f5723108f1e5b1255dd734ad8cdb11e7ea22487c788e67c83777b6f395e504ca59c64f52245ee6de3804cf809e5caa4f0ea6a9aa9eb6ed801",
|
|
205
|
-
* // miner: "0x1aD91ee08f21bE3dE0BA2ba6918E714dA6B45836",
|
|
206
|
-
* // mixHash: "0x73cc9419bfb89c9d41c3a8c34ce56b5ebe468bdcf870258d2e77262275d580ec",
|
|
207
|
-
* // nonce: "0x976f3f5d596ffb08",
|
|
208
|
-
* // number: 14879862,
|
|
209
|
-
* // parentHash: "0x95986ae14a71face8d9a6a379edd875b2e8bc73e4de0d9d460e7752bddb0f579",
|
|
210
|
-
* // receiptsRoot: "0x8e6ba2fd9bee602b653dae6e3132f16538c2c5df24f1df8c000392053f73defa",
|
|
211
|
-
* // sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
|
|
212
|
-
* // size: { TinyBig: 134483 },
|
|
213
|
-
* // stateRoot: "0xbf2bb67bd1c741f3d00904b8451d7c2cf4e3a2726f5a5884792ede2074747b85",
|
|
214
|
-
* // timestamp: { TinyBig: 1654016186 },
|
|
215
|
-
* // totalDifficulty: { TinyBig: 50478104614257705213748 },
|
|
216
|
-
* // transactions: [
|
|
217
|
-
* // "0xb3326a9149809603a2c28545e50e4f7d16e194bf5ee9764e0544603854c4a8d2",
|
|
218
|
-
* // "0x8b42095f8d335404a4896b2817b8e5e3d86a5a87cb434a8eec295d5280a7f48e",
|
|
219
|
-
* // "0x882f78fcb73f0f7ad0700bb0424a8b4beb366aaa93b88a3562c49a8d0ce4dcff",
|
|
220
|
-
* // ...
|
|
221
|
-
* // ],
|
|
222
|
-
* // transactionsRoot: "0x5934902f3dcc263ec34f24318179bf6301f53f4834685792066026f3a4849d72",
|
|
223
|
-
* // uncles: [],
|
|
224
|
-
* // }
|
|
225
|
-
* ```
|
|
226
|
-
*/
|
|
227
|
-
getBlock(timeFrame?: BlockTag, returnTransactionObjects?: boolean): Promise<BlockResponse>;
|
|
228
|
-
/**
|
|
229
|
-
* Gives an estimate of the current gas price in wei.
|
|
230
|
-
*
|
|
231
|
-
* * [Similar](/docs/api#isd) to [`ethers.provider.getGasPrice`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getGasPrice) in ethers.js, does not have a parameter specifying what unit you'd like to return. See also [`weiToEther`](/docs/api/modules#weitoether) and [`etherToGwei`](/docs/api/modules#ethertogwei)
|
|
232
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.getGasPrice`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#getgasprice) in web3.js, returns a number (TinyBig) instead of a string
|
|
233
|
-
*
|
|
234
|
-
* @returns an estimate of the current gas price in wei
|
|
235
|
-
* @example
|
|
236
|
-
* ```javascript
|
|
237
|
-
* await provider.getGasPrice();
|
|
238
|
-
* // 52493941856
|
|
239
|
-
* ```
|
|
240
|
-
*/
|
|
241
|
-
getGasPrice(): Promise<TinyBig>;
|
|
242
|
-
/**
|
|
243
|
-
* Returns the balance of the account in wei.
|
|
244
|
-
*
|
|
245
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.getBalance`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getBalance) in ethers.js
|
|
246
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.getBalance`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#getbalance) in web3.js, returns a number (TinyBig) instead of a string
|
|
247
|
-
*
|
|
248
|
-
* @param address the address to check the balance of
|
|
249
|
-
* @param blockTag the block to check the specified address' balance on
|
|
250
|
-
* @returns the balance of the network's native token for the specified address on the specified block
|
|
251
|
-
* @example
|
|
252
|
-
* ```javascript
|
|
253
|
-
* await provider.getBalance('0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8');
|
|
254
|
-
* // 28798127851528138
|
|
255
|
-
* ```
|
|
256
|
-
*/
|
|
257
|
-
getBalance(address: string, blockTag?: BlockTag): Promise<TinyBig>;
|
|
258
|
-
/**
|
|
259
|
-
* Gets the code of a contract on a specified block.
|
|
260
|
-
*
|
|
261
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.getCode`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getCode) in ethers.js
|
|
262
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.getCode`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#getcode) in web3.js
|
|
263
|
-
*
|
|
264
|
-
* @param address the contract address to get the contract code from
|
|
265
|
-
* @param blockTag the block height to search for the contract code from. Contract code can change, so this allows for checking a specific block
|
|
266
|
-
* @returns the contract creation code for the specified address at the specified block height
|
|
267
|
-
* @example
|
|
268
|
-
* ```javascript
|
|
269
|
-
* await jsonRpcProvider().getCode('0xaC6095720221C79C6E7C638d260A2eFBC5D8d880', 'latest');
|
|
270
|
-
* // '0x608060405234801561001057600080fd5b506004361061...'
|
|
271
|
-
* ```
|
|
272
|
-
*/
|
|
273
|
-
getCode(address: string, blockTag?: BlockTag): Promise<string>;
|
|
274
|
-
/**
|
|
275
|
-
* Returns an estimate of the amount of gas that would be required to submit transaction to the network.
|
|
276
|
-
* An estimate may not be accurate since there could be another transaction on the network that was not accounted for.
|
|
277
|
-
*
|
|
278
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.estimateGas`](https://docs.ethers.io/v5/api/providers/provider/#Provider-estimateGas) in ethers.js
|
|
279
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.estimateGas`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#estimateGas) in web3.js
|
|
280
|
-
*
|
|
281
|
-
* @param transaction the transaction to check the estimated gas cost for
|
|
282
|
-
* @returns the estimated amount of gas charged for submitting the specified transaction to the blockchain
|
|
283
|
-
* @example
|
|
284
|
-
* ```javascript
|
|
285
|
-
* await provider.estimateGas({
|
|
286
|
-
* // Wrapped ETH address
|
|
287
|
-
* to: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
288
|
-
* data: "0xd0e30db0",
|
|
289
|
-
* value: etherToWei('1.0').toHexString(),
|
|
290
|
-
* });
|
|
291
|
-
* // { TinyBig: "27938" }
|
|
292
|
-
* ```
|
|
293
|
-
*/
|
|
294
|
-
estimateGas(transaction: TransactionRequest): Promise<TinyBig>;
|
|
295
|
-
/**
|
|
296
|
-
* Returns transaction receipt event logs that match a specified filter.
|
|
297
|
-
* May return `[]` if parameters are too broad, even if logs exist.
|
|
298
|
-
*
|
|
299
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.getLogs`](https://docs.ethers.io/v5/api/providers/provider/#Provider-getLogs) in ethers.js
|
|
300
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.getPastLogs`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#getpastlogs) in web3.js
|
|
301
|
-
*
|
|
302
|
-
* @param filter parameters to filter the logs by
|
|
303
|
-
* @returns an array of logs matching the specified filter
|
|
304
|
-
* @example
|
|
305
|
-
* ```javascript
|
|
306
|
-
* provider.getLogs({
|
|
307
|
-
* address: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
308
|
-
* topics: [
|
|
309
|
-
* "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
|
|
310
|
-
* "0x00000000000000000000000021b8065d10f73ee2e260e5b47d3344d3ced7596e",
|
|
311
|
-
* ],
|
|
312
|
-
* fromBlock: 14825027,
|
|
313
|
-
* toBlock: 14825039,
|
|
314
|
-
* });
|
|
315
|
-
*
|
|
316
|
-
* [
|
|
317
|
-
* {
|
|
318
|
-
* address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
319
|
-
* blockHash: '0x8e0dfac2f704851960f866c8708b3bef2f66c0fee0329cf25ff0261b264ca6bc',
|
|
320
|
-
* blockNumber: 14825029,
|
|
321
|
-
* data: '0x000000000000000000000000000000000000000000000000005f862ee352a38a',
|
|
322
|
-
* logIndex: 384,
|
|
323
|
-
* removed: false,
|
|
324
|
-
* topics: [
|
|
325
|
-
* '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
|
|
326
|
-
* '0x00000000000000000000000021b8065d10f73ee2e260e5b47d3344d3ced7596e',
|
|
327
|
-
* '0x00000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45'
|
|
328
|
-
* ],
|
|
329
|
-
* transactionHash: '0xbd49031be16f8fd1775f4e0fe79b408ffd8ae9c65b2827ee47e3238e3f51f4c0',
|
|
330
|
-
* transactionIndex: 226
|
|
331
|
-
* }
|
|
332
|
-
* ]
|
|
333
|
-
* ```
|
|
334
|
-
*/
|
|
335
|
-
getLogs(filter: Filter | FilterByBlockHash): Promise<Array<Log>>;
|
|
336
|
-
/**
|
|
337
|
-
* Returns the result of adding a transaction to the blockchain without actually adding that transaction to the blockchain.
|
|
338
|
-
* Does not require any ether as gas.
|
|
339
|
-
*
|
|
340
|
-
* * [Identical](/docs/api#isd) to [`ethers.provider.call`](https://docs.ethers.io/v5/api/providers/provider/#Provider-call) in ethers.js
|
|
341
|
-
* * [Identical](/docs/api#isd) to [`web3.eth.call`](https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#call) in web3.js
|
|
342
|
-
*
|
|
343
|
-
* @param transaction the transaction object to, in theory, execute. Doesn't actually get added to the blockchain.
|
|
344
|
-
* @param blockTag the block to execute this transaction on
|
|
345
|
-
* @returns the result of executing the transaction on the specified block
|
|
346
|
-
* @example
|
|
347
|
-
* ```javascript
|
|
348
|
-
* await provider.call({ to: "0x6b175474e89094c44da98b954eedeac495271d0f", data: "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" });
|
|
349
|
-
* // '0x0000000000000000000000000000000000000000000000000858898f93629000'
|
|
350
|
-
* ```
|
|
351
|
-
*/
|
|
352
|
-
call(transaction: TransactionRequest, blockTag?: BlockTag): Promise<string>;
|
|
353
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseProvider } from './BaseProvider';
|
|
2
|
-
export declare class JsonRpcProvider extends BaseProvider {
|
|
3
|
-
/**
|
|
4
|
-
* @ignore
|
|
5
|
-
*/
|
|
6
|
-
selectRpcUrl(): string;
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
post(body: Record<string, unknown>): Promise<any>;
|
|
11
|
-
/**
|
|
12
|
-
* @param rpcUrl The URL to your Eth node. Consider POKT or Infura
|
|
13
|
-
* @example
|
|
14
|
-
* `https://free-eth-node.com/api/eth`
|
|
15
|
-
* @example
|
|
16
|
-
* `https://mainnet.infura.io/v3/YOUR-PROJECT-ID`
|
|
17
|
-
*/
|
|
18
|
-
constructor(rpcUrl?: string);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Helper function to avoid "new"
|
|
22
|
-
*
|
|
23
|
-
* @param rpcUrl the RPC URL to post requests to
|
|
24
|
-
* @returns an initiated {@link JsonRpcProvider}
|
|
25
|
-
* @example
|
|
26
|
-
* ```javascript
|
|
27
|
-
* jsonRpcProvider().getBlock('latest').then(block => {
|
|
28
|
-
* console.log(block.number);
|
|
29
|
-
* })
|
|
30
|
-
* // 14530496
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare function jsonRpcProvider(rpcUrl?: string): JsonRpcProvider;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a string in scientific notation formatting to string in decimal format
|
|
3
|
-
*
|
|
4
|
-
* @param scientificString a string in scientific format to convert to decimal
|
|
5
|
-
* @returns a string of a decimal number equivalent to the specified scientificString
|
|
6
|
-
* @example
|
|
7
|
-
* ```javascript
|
|
8
|
-
* scientificStrToDecimalStr('2.3e-5');
|
|
9
|
-
* // '0.000023'
|
|
10
|
-
* ```
|
|
11
|
-
* @example
|
|
12
|
-
* ```javascript
|
|
13
|
-
* scientificStrToDecimalStr('2.3e+5');
|
|
14
|
-
* // '230000'
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare function scientificStrToDecimalStr(scientificString: string): string;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import Big from 'big.js';
|
|
2
|
-
/**
|
|
3
|
-
* A wrapper around [big.js](https://github.com/MikeMcl/big.js) which expands scientific notation and creates a "toHexString" function.
|
|
4
|
-
* This is the return type of every operation on ether, wei, etc.
|
|
5
|
-
*/
|
|
6
|
-
export declare class TinyBig extends Big {
|
|
7
|
-
constructor(value: string | number | TinyBig | Big);
|
|
8
|
-
/**
|
|
9
|
-
* Used anytime you're passing in "value" to ethers or web3
|
|
10
|
-
* For now, TypeScript will complain that `TinyBig` is not a `BigNumberish`. You can // @ts-ignore or call this
|
|
11
|
-
*
|
|
12
|
-
* @returns the TinyBig represented as a hex string
|
|
13
|
-
* @example
|
|
14
|
-
* ```javascript
|
|
15
|
-
* tinyBig(293).toHexString();
|
|
16
|
-
* // '0x125'
|
|
17
|
-
* ```
|
|
18
|
-
* @example
|
|
19
|
-
* ```javascript
|
|
20
|
-
* tinyBig(681365874).toHexString();
|
|
21
|
-
* // '0x289cd172'
|
|
22
|
-
*/
|
|
23
|
-
toHexString(): string;
|
|
24
|
-
toNumber(): number;
|
|
25
|
-
toString(): string;
|
|
26
|
-
/**
|
|
27
|
-
* Eithers pads or shortens a string to a specified length
|
|
28
|
-
*
|
|
29
|
-
* @param str the string to pad or chop
|
|
30
|
-
* @param padChar the character to pad the string with
|
|
31
|
-
* @param length the desired length of the given string
|
|
32
|
-
* @returns a string of the desired length, either padded with the specified padChar or with the beginning of the string chopped off
|
|
33
|
-
* @example
|
|
34
|
-
* ```javascript
|
|
35
|
-
* padAndChop('essential-eth', 'a', 8);
|
|
36
|
-
* // 'tial-eth'
|
|
37
|
-
* ```
|
|
38
|
-
* @example
|
|
39
|
-
* ```javascript
|
|
40
|
-
* padAndChop('essential-eth', 'A', 20);
|
|
41
|
-
* // 'AAAAAAAessential-eth'
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
private padAndChop;
|
|
45
|
-
toTwos(bitCount: number): Big;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Helper factory function so that you don't have to type "new" when instantiating a new TinyBig
|
|
49
|
-
*
|
|
50
|
-
* @param value the value to initiate the TinyBig with
|
|
51
|
-
* @returns an initiated {@link TinyBig}
|
|
52
|
-
* @example
|
|
53
|
-
* ```javascript
|
|
54
|
-
* tinyBig(10).times(3).toNumber()
|
|
55
|
-
* // 30
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare function tinyBig(value: string | number | TinyBig | Big): TinyBig;
|