viem 0.0.1-alpha.2 → 0.0.1-alpha.21
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/chains/package.json +1 -1
- package/clients/package.json +1 -1
- package/dist/{rpc-655c0ba4.d.ts → chain-32f56cfa.d.ts} +78 -17
- package/dist/chain-f12cdc7f.d.ts +5 -0
- package/dist/chains.d.ts +1291 -74
- package/dist/chains.js +125 -129
- package/dist/chains.js.map +1 -0
- package/dist/chains.mjs +129 -0
- package/dist/chains.mjs.map +1 -0
- package/dist/{chunk-YQRTXQ2G.js → chunk-46BO7YAQ.mjs} +3 -15
- package/dist/chunk-46BO7YAQ.mjs.map +1 -0
- package/dist/chunk-57ZOFERP.mjs +256 -0
- package/dist/chunk-57ZOFERP.mjs.map +1 -0
- package/dist/{chunk-3EOU525X.js → chunk-62VTYU2V.mjs} +1207 -564
- package/dist/chunk-62VTYU2V.mjs.map +1 -0
- package/dist/{chunk-4HNVS7AM.js → chunk-DGO77E2H.mjs} +330 -539
- package/dist/chunk-DGO77E2H.mjs.map +1 -0
- package/dist/chunk-DSPMAIDO.mjs +176 -0
- package/dist/chunk-DSPMAIDO.mjs.map +1 -0
- package/dist/chunk-EC3NUIJE.js +176 -0
- package/dist/chunk-EC3NUIJE.js.map +1 -0
- package/dist/chunk-KEHGSYDO.js +259 -0
- package/dist/chunk-KEHGSYDO.js.map +1 -0
- package/dist/chunk-KZMJR27B.js +889 -0
- package/dist/chunk-KZMJR27B.js.map +1 -0
- package/dist/chunk-O2GYLJVD.js +2689 -0
- package/dist/chunk-O2GYLJVD.js.map +1 -0
- package/dist/chunk-W7BWWAC4.js +256 -0
- package/dist/chunk-W7BWWAC4.js.map +1 -0
- package/dist/clients/index.d.ts +8 -7
- package/dist/clients/index.js +24 -25
- package/dist/clients/index.js.map +1 -0
- package/dist/clients/index.mjs +24 -0
- package/dist/clients/index.mjs.map +1 -0
- package/dist/contract-9af4608b.d.ts +142 -0
- package/dist/createClient-5d316c7e.d.ts +62 -0
- package/dist/createPublicClient-9d2b42e1.d.ts +19 -0
- package/dist/createTestClient-79498dab.d.ts +34 -0
- package/dist/createWalletClient-f69a5230.d.ts +30 -0
- package/dist/{eip1193-8f7c22ce.d.ts → eip1193-6c485d63.d.ts} +13 -10
- package/dist/index.d.ts +424 -11
- package/dist/index.js +395 -292
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +395 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{parseGwei-fd7a0f7d.d.ts → parseGwei-4308ad80.d.ts} +82 -139
- package/dist/public.d.ts +11 -0
- package/dist/public.js +59 -0
- package/dist/public.js.map +1 -0
- package/dist/public.mjs +59 -0
- package/dist/public.mjs.map +1 -0
- package/dist/{rpc-3c0e3985.d.ts → rpc-26932bae.d.ts} +1 -38
- package/dist/sendTransaction-1c8290a9.d.ts +12 -0
- package/dist/stopImpersonatingAccount-7781842a.d.ts +156 -0
- package/dist/test.d.ts +6 -0
- package/dist/test.js +60 -0
- package/dist/test.js.map +1 -0
- package/dist/test.mjs +60 -0
- package/dist/test.mjs.map +1 -0
- package/dist/transactionRequest-341b6ed2.d.ts +15 -0
- package/dist/utils/index.d.ts +51 -8
- package/dist/utils/index.js +171 -156
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +171 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/wallet.d.ts +8 -0
- package/dist/wallet.js +24 -0
- package/dist/wallet.js.map +1 -0
- package/dist/wallet.mjs +24 -0
- package/dist/wallet.mjs.map +1 -0
- package/dist/watchAsset-afaad3c7.d.ts +38 -0
- package/dist/{watchAsset-04ab8db5.d.ts → watchPendingTransactions-3b722547.d.ts} +67 -217
- package/dist/{webSocket-c6e0d26f.d.ts → webSocket-b180e679.d.ts} +4 -9
- package/dist/window.d.ts +3 -2
- package/dist/window.js +1 -0
- package/dist/window.js.map +1 -0
- package/dist/window.mjs +1 -0
- package/dist/window.mjs.map +1 -0
- package/package.json +30 -66
- package/src/_test/abis.ts +1413 -0
- package/src/_test/bench.ts +15 -0
- package/src/_test/constants.ts +60 -0
- package/src/_test/globalSetup.ts +11 -0
- package/src/_test/index.ts +23 -0
- package/src/_test/setup.ts +8 -0
- package/src/_test/utils.ts +112 -0
- package/src/actions/index.test.ts +78 -0
- package/src/actions/index.ts +174 -0
- package/src/actions/public/call.bench.ts +48 -0
- package/src/actions/public/call.test.ts +99 -0
- package/src/actions/public/call.ts +97 -0
- package/src/actions/public/createBlockFilter.bench.ts +11 -0
- package/src/actions/public/createBlockFilter.test.ts +9 -0
- package/src/actions/public/createBlockFilter.ts +14 -0
- package/src/actions/public/createContractEventFilter.test.ts +119 -0
- package/src/actions/public/createContractEventFilter.ts +69 -0
- package/src/actions/public/createEventFilter.test.ts +245 -0
- package/src/actions/public/createEventFilter.ts +76 -0
- package/src/actions/public/createPendingTransactionFilter.bench.ts +11 -0
- package/src/actions/public/createPendingTransactionFilter.test.ts +9 -0
- package/src/actions/public/createPendingTransactionFilter.ts +14 -0
- package/src/actions/public/deployContract.test.ts +56 -0
- package/src/actions/public/deployContract.ts +38 -0
- package/src/actions/public/estimateGas.bench.ts +46 -0
- package/src/actions/public/estimateGas.test.ts +92 -0
- package/src/actions/public/estimateGas.ts +61 -0
- package/src/actions/public/getBalance.test.ts +83 -0
- package/src/actions/public/getBalance.ts +37 -0
- package/src/actions/public/getBlock.bench.ts +28 -0
- package/src/actions/public/getBlock.test.ts +575 -0
- package/src/actions/public/getBlock.ts +65 -0
- package/src/actions/public/getBlockNumber.bench.ts +28 -0
- package/src/actions/public/getBlockNumber.test.ts +27 -0
- package/src/actions/public/getBlockNumber.ts +32 -0
- package/src/actions/public/getBlockTransactionCount.bench.ts +15 -0
- package/src/actions/public/getBlockTransactionCount.test.ts +57 -0
- package/src/actions/public/getBlockTransactionCount.ts +52 -0
- package/src/actions/public/getBytecode.test.ts +27 -0
- package/src/actions/public/getBytecode.ts +32 -0
- package/src/actions/public/getChainId.bench.ts +15 -0
- package/src/actions/public/getChainId.test.ts +8 -0
- package/src/actions/public/getChainId.ts +7 -0
- package/src/actions/public/getFeeHistory.bench.ts +18 -0
- package/src/actions/public/getFeeHistory.test.ts +137 -0
- package/src/actions/public/getFeeHistory.ts +44 -0
- package/src/actions/public/getFilterChanges.bench.ts +13 -0
- package/src/actions/public/getFilterChanges.test.ts +189 -0
- package/src/actions/public/getFilterChanges.ts +23 -0
- package/src/actions/public/getFilterLogs.test.ts +104 -0
- package/src/actions/public/getFilterLogs.ts +20 -0
- package/src/actions/public/getGasPrice.bench.ts +28 -0
- package/src/actions/public/getGasPrice.test.ts +8 -0
- package/src/actions/public/getGasPrice.ts +15 -0
- package/src/actions/public/getLogs.test.ts +107 -0
- package/src/actions/public/getLogs.ts +84 -0
- package/src/actions/public/getStorageAt.test.ts +34 -0
- package/src/actions/public/getStorageAt.ts +32 -0
- package/src/actions/public/getTransaction.bench.ts +33 -0
- package/src/actions/public/getTransaction.test.ts +311 -0
- package/src/actions/public/getTransaction.ts +95 -0
- package/src/actions/public/getTransactionConfirmations.test.ts +69 -0
- package/src/actions/public/getTransactionConfirmations.ts +38 -0
- package/src/actions/public/getTransactionCount.test.ts +56 -0
- package/src/actions/public/getTransactionCount.ts +34 -0
- package/src/actions/public/getTransactionReceipt.bench.ts +33 -0
- package/src/actions/public/getTransactionReceipt.test.ts +179 -0
- package/src/actions/public/getTransactionReceipt.ts +34 -0
- package/src/actions/public/index.test.ts +43 -0
- package/src/actions/public/index.ts +149 -0
- package/src/actions/public/readContract.test.ts +128 -0
- package/src/actions/public/readContract.ts +87 -0
- package/src/actions/public/simulateContract.bench.ts +31 -0
- package/src/actions/public/simulateContract.test.ts +238 -0
- package/src/actions/public/simulateContract.ts +98 -0
- package/src/actions/public/uninstallFilter.bench.ts +13 -0
- package/src/actions/public/uninstallFilter.test.ts +65 -0
- package/src/actions/public/uninstallFilter.ts +17 -0
- package/src/actions/public/waitForTransactionReceipt.test.ts +322 -0
- package/src/actions/public/waitForTransactionReceipt.ts +170 -0
- package/src/actions/public/watchBlockNumber.test.ts +166 -0
- package/src/actions/public/watchBlockNumber.ts +79 -0
- package/src/actions/public/watchBlocks.test.ts +210 -0
- package/src/actions/public/watchBlocks.ts +114 -0
- package/src/actions/public/watchContractEvent.test.ts +301 -0
- package/src/actions/public/watchContractEvent.ts +108 -0
- package/src/actions/public/watchEvent.test.ts +190 -0
- package/src/actions/public/watchEvent.ts +95 -0
- package/src/actions/public/watchPendingTransactions.test.ts +116 -0
- package/src/actions/public/watchPendingTransactions.ts +74 -0
- package/src/actions/test/dropTransaction.test.ts +34 -0
- package/src/actions/test/dropTransaction.ts +17 -0
- package/src/actions/test/getAutomine.test.ts +14 -0
- package/src/actions/test/getAutomine.ts +11 -0
- package/src/actions/test/getTxpoolContent.test.ts +45 -0
- package/src/actions/test/getTxpoolContent.ts +7 -0
- package/src/actions/test/getTxpoolStatus.test.ts +41 -0
- package/src/actions/test/getTxpoolStatus.ts +12 -0
- package/src/actions/test/impersonateAccount.test.ts +28 -0
- package/src/actions/test/impersonateAccount.ts +17 -0
- package/src/actions/test/increaseTime.test.ts +18 -0
- package/src/actions/test/increaseTime.ts +17 -0
- package/src/actions/test/index.test.ts +38 -0
- package/src/actions/test/index.ts +77 -0
- package/src/actions/test/inspectTxpool.test.ts +50 -0
- package/src/actions/test/inspectTxpool.ts +7 -0
- package/src/actions/test/mine.test.ts +20 -0
- package/src/actions/test/mine.ts +16 -0
- package/src/actions/test/removeBlockTimestampInterval.test.ts +23 -0
- package/src/actions/test/removeBlockTimestampInterval.ts +7 -0
- package/src/actions/test/reset.test.ts +19 -0
- package/src/actions/test/reset.ts +18 -0
- package/src/actions/test/revert.test.ts +39 -0
- package/src/actions/test/revert.ts +14 -0
- package/src/actions/test/sendUnsignedTransaction.test.ts +52 -0
- package/src/actions/test/sendUnsignedTransaction.ts +19 -0
- package/src/actions/test/setAutomine.test.ts +14 -0
- package/src/actions/test/setAutomine.ts +8 -0
- package/src/actions/test/setBalance.test.ts +29 -0
- package/src/actions/test/setBalance.ts +20 -0
- package/src/actions/test/setBlockGasLimit.test.ts +21 -0
- package/src/actions/test/setBlockGasLimit.ts +17 -0
- package/src/actions/test/setBlockTimestampInterval.test.ts +23 -0
- package/src/actions/test/setBlockTimestampInterval.ts +16 -0
- package/src/actions/test/setCode.test.ts +26 -0
- package/src/actions/test/setCode.ts +19 -0
- package/src/actions/test/setCoinbase.test.ts +11 -0
- package/src/actions/test/setCoinbase.ts +17 -0
- package/src/actions/test/setIntervalMining.test.ts +30 -0
- package/src/actions/test/setIntervalMining.ts +16 -0
- package/src/actions/test/setLoggingEnabled.test.ts +10 -0
- package/src/actions/test/setLoggingEnabled.ts +8 -0
- package/src/actions/test/setMinGasPrice.test.ts +22 -0
- package/src/actions/test/setMinGasPrice.ts +17 -0
- package/src/actions/test/setNextBlockBaseFeePerGas.test.ts +23 -0
- package/src/actions/test/setNextBlockBaseFeePerGas.ts +17 -0
- package/src/actions/test/setNextBlockTimestamp.test.ts +19 -0
- package/src/actions/test/setNextBlockTimestamp.ts +17 -0
- package/src/actions/test/setNonce.test.ts +28 -0
- package/src/actions/test/setNonce.ts +20 -0
- package/src/actions/test/setRpcUrl.test.ts +9 -0
- package/src/actions/test/setRpcUrl.ts +8 -0
- package/src/actions/test/setStorageAt.test.ts +36 -0
- package/src/actions/test/setStorageAt.ts +26 -0
- package/src/actions/test/snapshot.test.ts +18 -0
- package/src/actions/test/snapshot.ts +7 -0
- package/src/actions/test/stopImpersonatingAccount.test.ts +31 -0
- package/src/actions/test/stopImpersonatingAccount.ts +17 -0
- package/src/actions/wallet/addChain.test.ts +14 -0
- package/src/actions/wallet/addChain.ts +21 -0
- package/src/actions/wallet/getAccounts.test.ts +22 -0
- package/src/actions/wallet/getAccounts.ts +7 -0
- package/src/actions/wallet/getPermissions.test.ts +24 -0
- package/src/actions/wallet/getPermissions.ts +9 -0
- package/src/actions/wallet/index.test.ts +20 -0
- package/src/actions/wallet/index.ts +30 -0
- package/src/actions/wallet/requestAccounts.test.ts +13 -0
- package/src/actions/wallet/requestAccounts.ts +7 -0
- package/src/actions/wallet/requestPermissions.test.ts +26 -0
- package/src/actions/wallet/requestPermissions.ts +19 -0
- package/src/actions/wallet/sendTransaction.bench.ts +57 -0
- package/src/actions/wallet/sendTransaction.test.ts +440 -0
- package/src/actions/wallet/sendTransaction.ts +77 -0
- package/src/actions/wallet/signMessage.test.ts +62 -0
- package/src/actions/wallet/signMessage.ts +35 -0
- package/src/actions/wallet/switchChain.test.ts +22 -0
- package/src/actions/wallet/switchChain.ts +19 -0
- package/src/actions/wallet/watchAsset.test.ts +41 -0
- package/src/actions/wallet/watchAsset.ts +16 -0
- package/src/actions/wallet/writeContract.test.ts +54 -0
- package/src/actions/wallet/writeContract.ts +56 -0
- package/src/chains.test.ts +1912 -0
- package/src/chains.ts +99 -0
- package/src/clients/createClient.test.ts +295 -0
- package/src/clients/createClient.ts +81 -0
- package/src/clients/createPublicClient.test.ts +165 -0
- package/src/clients/createPublicClient.ts +49 -0
- package/src/clients/createTestClient.test.ts +145 -0
- package/src/clients/createTestClient.ts +72 -0
- package/src/clients/createWalletClient.test.ts +121 -0
- package/src/clients/createWalletClient.ts +54 -0
- package/src/clients/index.test.ts +19 -0
- package/src/clients/index.ts +31 -0
- package/src/clients/transports/createTransport.test.ts +58 -0
- package/src/clients/transports/createTransport.ts +48 -0
- package/src/clients/transports/custom.test.ts +98 -0
- package/src/clients/transports/custom.ts +34 -0
- package/src/clients/transports/fallback.test.ts +223 -0
- package/src/clients/transports/fallback.ts +48 -0
- package/src/clients/transports/http.test.ts +110 -0
- package/src/clients/transports/http.ts +51 -0
- package/src/clients/transports/index.test.ts +15 -0
- package/src/clients/transports/index.ts +17 -0
- package/src/clients/transports/webSocket.test.ts +164 -0
- package/src/clients/transports/webSocket.ts +117 -0
- package/src/errors/abi.test.ts +83 -0
- package/src/errors/abi.ts +238 -0
- package/src/errors/address.test.ts +14 -0
- package/src/errors/address.ts +9 -0
- package/src/errors/base.test.ts +72 -0
- package/src/errors/base.ts +57 -0
- package/src/errors/block.test.ts +24 -0
- package/src/errors/block.ts +18 -0
- package/src/errors/contract.ts +125 -0
- package/src/errors/data.ts +20 -0
- package/src/errors/encoding.ts +60 -0
- package/src/errors/index.ts +77 -0
- package/src/errors/log.ts +8 -0
- package/src/errors/request.test.ts +331 -0
- package/src/errors/request.ts +163 -0
- package/src/errors/rpc.test.ts +88 -0
- package/src/errors/rpc.ts +113 -0
- package/src/errors/transaction.test.ts +83 -0
- package/src/errors/transaction.ts +54 -0
- package/src/errors/transport.test.ts +12 -0
- package/src/errors/transport.ts +12 -0
- package/src/index.test.ts +214 -0
- package/src/index.ts +373 -0
- package/src/public.ts +80 -0
- package/src/test.ts +51 -0
- package/src/types/block.ts +71 -0
- package/src/types/chain.ts +6 -0
- package/src/types/contract.ts +342 -0
- package/src/types/eip1193.ts +1041 -0
- package/src/types/fee.ts +47 -0
- package/src/types/filter.ts +8 -0
- package/src/types/formatter.ts +23 -0
- package/src/types/index.ts +78 -0
- package/src/types/log.ts +22 -0
- package/src/types/misc.ts +5 -0
- package/src/types/rpc.ts +35 -0
- package/src/types/transaction.ts +145 -0
- package/src/types/utils.ts +67 -0
- package/src/types/window.ts +9 -0
- package/src/utils/abi/decodeAbi.bench.ts +135 -0
- package/src/utils/abi/decodeAbi.test.ts +1615 -0
- package/src/utils/abi/decodeAbi.ts +296 -0
- package/src/utils/abi/decodeDeployData.test.ts +159 -0
- package/src/utils/abi/decodeDeployData.ts +41 -0
- package/src/utils/abi/decodeErrorResult.test.ts +130 -0
- package/src/utils/abi/decodeErrorResult.ts +28 -0
- package/src/utils/abi/decodeFunctionData.test.ts +140 -0
- package/src/utils/abi/decodeFunctionData.ts +29 -0
- package/src/utils/abi/decodeFunctionResult.test.ts +262 -0
- package/src/utils/abi/decodeFunctionResult.ts +53 -0
- package/src/utils/abi/encodeAbi.bench.ts +163 -0
- package/src/utils/abi/encodeAbi.test.ts +1448 -0
- package/src/utils/abi/encodeAbi.ts +264 -0
- package/src/utils/abi/encodeDeployData.test.ts +131 -0
- package/src/utils/abi/encodeDeployData.ts +37 -0
- package/src/utils/abi/encodeErrorResult.test.ts +197 -0
- package/src/utils/abi/encodeErrorResult.ts +40 -0
- package/src/utils/abi/encodeEventTopics.test.ts +348 -0
- package/src/utils/abi/encodeEventTopics.ts +69 -0
- package/src/utils/abi/encodeFunctionData.test.ts +140 -0
- package/src/utils/abi/encodeFunctionData.ts +38 -0
- package/src/utils/abi/encodeFunctionResult.test.ts +284 -0
- package/src/utils/abi/encodeFunctionResult.ts +39 -0
- package/src/utils/abi/formatAbiItem.test.ts +335 -0
- package/src/utils/abi/formatAbiItem.ts +41 -0
- package/src/utils/abi/formatAbiItemWithArgs.test.ts +291 -0
- package/src/utils/abi/formatAbiItemWithArgs.ts +27 -0
- package/src/utils/abi/getAbiItem.ts +5 -0
- package/src/utils/abi/index.test.ts +23 -0
- package/src/utils/abi/index.ts +38 -0
- package/src/utils/address/getAddress.bench.ts +22 -0
- package/src/utils/address/getAddress.test.ts +46 -0
- package/src/utils/address/getAddress.ts +28 -0
- package/src/utils/address/getContractAddress.bench.ts +20 -0
- package/src/utils/address/getContractAddress.test.ts +78 -0
- package/src/utils/address/getContractAddress.ts +59 -0
- package/src/utils/address/index.test.ts +17 -0
- package/src/utils/address/index.ts +16 -0
- package/src/utils/address/isAddress.test.ts +10 -0
- package/src/utils/address/isAddress.ts +10 -0
- package/src/utils/address/isAddressEqual.test.ts +55 -0
- package/src/utils/address/isAddressEqual.ts +6 -0
- package/src/utils/buildRequest.test.ts +365 -0
- package/src/utils/buildRequest.ts +45 -0
- package/src/utils/chain.test.ts +43 -0
- package/src/utils/chain.ts +8 -0
- package/src/utils/contract/extractFunctionParts.test.ts +109 -0
- package/src/utils/contract/extractFunctionParts.ts +27 -0
- package/src/utils/contract/getContractError.test.ts +97 -0
- package/src/utils/contract/getContractError.ts +66 -0
- package/src/utils/contract/index.test.ts +15 -0
- package/src/utils/contract/index.ts +8 -0
- package/src/utils/data/concat.test.ts +35 -0
- package/src/utils/data/concat.ts +34 -0
- package/src/utils/data/index.test.ts +23 -0
- package/src/utils/data/index.ts +13 -0
- package/src/utils/data/isBytes.test.ts +9 -0
- package/src/utils/data/isBytes.ts +7 -0
- package/src/utils/data/isHex.test.ts +13 -0
- package/src/utils/data/isHex.ts +5 -0
- package/src/utils/data/pad.bench.ts +39 -0
- package/src/utils/data/pad.test.ts +367 -0
- package/src/utils/data/pad.ts +53 -0
- package/src/utils/data/size.test.ts +18 -0
- package/src/utils/data/size.ts +13 -0
- package/src/utils/data/slice.test.ts +203 -0
- package/src/utils/data/slice.ts +60 -0
- package/src/utils/data/trim.bench.ts +50 -0
- package/src/utils/data/trim.test.ts +175 -0
- package/src/utils/data/trim.ts +33 -0
- package/src/utils/encoding/decodeBytes.bench.ts +40 -0
- package/src/utils/encoding/decodeBytes.test.ts +144 -0
- package/src/utils/encoding/decodeBytes.ts +63 -0
- package/src/utils/encoding/decodeHex.bench.ts +24 -0
- package/src/utils/encoding/decodeHex.test.ts +167 -0
- package/src/utils/encoding/decodeHex.ts +76 -0
- package/src/utils/encoding/decodeRlp.bench.ts +34 -0
- package/src/utils/encoding/decodeRlp.test.ts +350 -0
- package/src/utils/encoding/decodeRlp.ts +121 -0
- package/src/utils/encoding/encodeBytes.bench.ts +41 -0
- package/src/utils/encoding/encodeBytes.test.ts +676 -0
- package/src/utils/encoding/encodeBytes.ts +59 -0
- package/src/utils/encoding/encodeHex.bench.ts +60 -0
- package/src/utils/encoding/encodeHex.test.ts +232 -0
- package/src/utils/encoding/encodeHex.ts +104 -0
- package/src/utils/encoding/encodeRlp.bench.ts +54 -0
- package/src/utils/encoding/encodeRlp.test.ts +254 -0
- package/src/utils/encoding/encodeRlp.ts +48 -0
- package/src/utils/encoding/index.test.ts +32 -0
- package/src/utils/encoding/index.ts +36 -0
- package/src/utils/formatters/block.bench.ts +51 -0
- package/src/utils/formatters/block.test.ts +115 -0
- package/src/utils/formatters/block.ts +37 -0
- package/src/utils/formatters/extract.test.ts +14 -0
- package/src/utils/formatters/extract.ts +18 -0
- package/src/utils/formatters/feeHistory.test.ts +66 -0
- package/src/utils/formatters/feeHistory.ts +12 -0
- package/src/utils/formatters/format.test.ts +93 -0
- package/src/utils/formatters/format.ts +90 -0
- package/src/utils/formatters/index.test.ts +27 -0
- package/src/utils/formatters/index.ts +34 -0
- package/src/utils/formatters/log.test.ts +79 -0
- package/src/utils/formatters/log.ts +12 -0
- package/src/utils/formatters/transaction.test.ts +271 -0
- package/src/utils/formatters/transaction.ts +63 -0
- package/src/utils/formatters/transactionReceipt.bench.ts +73 -0
- package/src/utils/formatters/transactionReceipt.test.ts +151 -0
- package/src/utils/formatters/transactionReceipt.ts +63 -0
- package/src/utils/formatters/transactionRequest.bench.ts +29 -0
- package/src/utils/formatters/transactionRequest.test.ts +237 -0
- package/src/utils/formatters/transactionRequest.ts +56 -0
- package/src/utils/hash/getEventSignature.test.ts +61 -0
- package/src/utils/hash/getEventSignature.ts +4 -0
- package/src/utils/hash/getFunctionSignature.test.ts +22 -0
- package/src/utils/hash/getFunctionSignature.ts +5 -0
- package/src/utils/hash/hashFunction.test.ts +65 -0
- package/src/utils/hash/hashFunction.ts +12 -0
- package/src/utils/hash/index.test.ts +13 -0
- package/src/utils/hash/index.ts +5 -0
- package/src/utils/hash/keccak256.test.ts +59 -0
- package/src/utils/hash/keccak256.ts +23 -0
- package/src/utils/index.test.ts +110 -0
- package/src/utils/index.ts +137 -0
- package/src/utils/observe.test.ts +176 -0
- package/src/utils/observe.ts +66 -0
- package/src/utils/poll.test.ts +127 -0
- package/src/utils/poll.ts +42 -0
- package/src/utils/promise/index.test.ts +14 -0
- package/src/utils/promise/index.ts +3 -0
- package/src/utils/promise/withCache.test.ts +97 -0
- package/src/utils/promise/withCache.ts +73 -0
- package/src/utils/promise/withRetry.test.ts +231 -0
- package/src/utils/promise/withRetry.ts +61 -0
- package/src/utils/promise/withTimeout.test.ts +37 -0
- package/src/utils/promise/withTimeout.ts +39 -0
- package/src/utils/rpc.test.ts +992 -0
- package/src/utils/rpc.ts +292 -0
- package/src/utils/stringify.test.ts +13 -0
- package/src/utils/stringify.ts +5 -0
- package/src/utils/uid.ts +14 -0
- package/src/utils/unit/constants.test.ts +22 -0
- package/src/utils/unit/constants.ts +12 -0
- package/src/utils/unit/formatEther.test.ts +75 -0
- package/src/utils/unit/formatEther.ts +6 -0
- package/src/utils/unit/formatGwei.test.ts +32 -0
- package/src/utils/unit/formatGwei.ts +6 -0
- package/src/utils/unit/formatUnit.bench.ts +26 -0
- package/src/utils/unit/formatUnit.test.ts +40 -0
- package/src/utils/unit/formatUnit.ts +16 -0
- package/src/utils/unit/index.test.ts +28 -0
- package/src/utils/unit/index.ts +7 -0
- package/src/utils/unit/parseEther.test.ts +126 -0
- package/src/utils/unit/parseEther.ts +6 -0
- package/src/utils/unit/parseGwei.test.ts +50 -0
- package/src/utils/unit/parseGwei.ts +6 -0
- package/src/utils/unit/parseUnit.bench.ts +26 -0
- package/src/utils/unit/parseUnit.test.ts +54 -0
- package/src/utils/unit/parseUnit.ts +27 -0
- package/src/utils/wait.ts +3 -0
- package/src/wallet.ts +23 -0
- package/src/window.ts +1 -0
- package/utils/package.json +1 -1
- package/window/package.json +1 -1
- package/actions/package.json +0 -4
- package/dist/BaseError-7688f84e.d.ts +0 -18
- package/dist/actions/index.d.ts +0 -8
- package/dist/actions/index.js +0 -123
- package/dist/createWalletClient-915223f3.d.ts +0 -130
- package/dist/transactionRequest-ade896ac.d.ts +0 -44
@@ -0,0 +1,214 @@
|
|
1
|
+
import { expect, test } from 'vitest'
|
2
|
+
|
3
|
+
import * as actions from './index'
|
4
|
+
|
5
|
+
test('exports actions', () => {
|
6
|
+
expect(actions).toMatchInlineSnapshot(`
|
7
|
+
{
|
8
|
+
"AbiConstructorNotFoundError": [Function],
|
9
|
+
"AbiConstructorParamsNotFoundError": [Function],
|
10
|
+
"AbiDecodingDataSizeInvalidError": [Function],
|
11
|
+
"AbiEncodingArrayLengthMismatchError": [Function],
|
12
|
+
"AbiEncodingLengthMismatchError": [Function],
|
13
|
+
"AbiErrorInputsNotFoundError": [Function],
|
14
|
+
"AbiErrorNotFoundError": [Function],
|
15
|
+
"AbiErrorSignatureNotFoundError": [Function],
|
16
|
+
"AbiEventNotFoundError": [Function],
|
17
|
+
"AbiFunctionNotFoundError": [Function],
|
18
|
+
"AbiFunctionOutputsNotFoundError": [Function],
|
19
|
+
"AbiFunctionSignatureNotFoundError": [Function],
|
20
|
+
"BaseError": [Function],
|
21
|
+
"BlockNotFoundError": [Function],
|
22
|
+
"DataLengthTooLongError": [Function],
|
23
|
+
"DataLengthTooShortError": [Function],
|
24
|
+
"FilterTypeNotSupportedError": [Function],
|
25
|
+
"HttpRequestError": [Function],
|
26
|
+
"InternalRpcError": [Function],
|
27
|
+
"InvalidAbiDecodingTypeError": [Function],
|
28
|
+
"InvalidAbiEncodingTypeError": [Function],
|
29
|
+
"InvalidAddressError": [Function],
|
30
|
+
"InvalidArrayError": [Function],
|
31
|
+
"InvalidBytesBooleanError": [Function],
|
32
|
+
"InvalidDefinitionTypeError": [Function],
|
33
|
+
"InvalidGasArgumentsError": [Function],
|
34
|
+
"InvalidHexBooleanError": [Function],
|
35
|
+
"InvalidHexValueError": [Function],
|
36
|
+
"InvalidInputRpcError": [Function],
|
37
|
+
"InvalidParamsRpcError": [Function],
|
38
|
+
"InvalidRequestRpcError": [Function],
|
39
|
+
"JsonRpcVersionUnsupportedError": [Function],
|
40
|
+
"LimitExceededRpcError": [Function],
|
41
|
+
"MethodNotFoundRpcError": [Function],
|
42
|
+
"MethodNotSupportedRpcError": [Function],
|
43
|
+
"OffsetOutOfBoundsError": [Function],
|
44
|
+
"ParseRpcError": [Function],
|
45
|
+
"RequestError": [Function],
|
46
|
+
"ResourceNotFoundRpcError": [Function],
|
47
|
+
"ResourceUnavailableRpcError": [Function],
|
48
|
+
"RpcError": [Function],
|
49
|
+
"RpcRequestError": [Function],
|
50
|
+
"SizeExceedsPaddingSizeError": [Function],
|
51
|
+
"TimeoutError": [Function],
|
52
|
+
"TransactionNotFoundError": [Function],
|
53
|
+
"TransactionReceiptNotFoundError": [Function],
|
54
|
+
"TransactionRejectedRpcError": [Function],
|
55
|
+
"UnknownRpcError": [Function],
|
56
|
+
"UrlRequiredError": [Function],
|
57
|
+
"WaitForTransactionReceiptTimeoutError": [Function],
|
58
|
+
"WebSocketRequestError": [Function],
|
59
|
+
"addChain": [Function],
|
60
|
+
"boolToBytes": [Function],
|
61
|
+
"boolToHex": [Function],
|
62
|
+
"bytesToBigint": [Function],
|
63
|
+
"bytesToBool": [Function],
|
64
|
+
"bytesToHex": [Function],
|
65
|
+
"bytesToNumber": [Function],
|
66
|
+
"bytesToString": [Function],
|
67
|
+
"call": [Function],
|
68
|
+
"createBlockFilter": [Function],
|
69
|
+
"createClient": [Function],
|
70
|
+
"createContractEventFilter": [Function],
|
71
|
+
"createEventFilter": [Function],
|
72
|
+
"createPendingTransactionFilter": [Function],
|
73
|
+
"createPublicClient": [Function],
|
74
|
+
"createTestClient": [Function],
|
75
|
+
"createTransport": [Function],
|
76
|
+
"createWalletClient": [Function],
|
77
|
+
"custom": [Function],
|
78
|
+
"decodeAbi": [Function],
|
79
|
+
"decodeBytes": [Function],
|
80
|
+
"decodeErrorResult": [Function],
|
81
|
+
"decodeFunctionData": [Function],
|
82
|
+
"decodeFunctionResult": [Function],
|
83
|
+
"decodeHex": [Function],
|
84
|
+
"decodeRlp": [Function],
|
85
|
+
"deployContract": [Function],
|
86
|
+
"dropTransaction": [Function],
|
87
|
+
"encodeAbi": [Function],
|
88
|
+
"encodeBytes": [Function],
|
89
|
+
"encodeDeployData": [Function],
|
90
|
+
"encodeErrorResult": [Function],
|
91
|
+
"encodeEventTopics": [Function],
|
92
|
+
"encodeFunctionData": [Function],
|
93
|
+
"encodeFunctionResult": [Function],
|
94
|
+
"encodeHex": [Function],
|
95
|
+
"encodeRlp": [Function],
|
96
|
+
"estimateGas": [Function],
|
97
|
+
"etherUnits": {
|
98
|
+
"gwei": 9,
|
99
|
+
"wei": 18,
|
100
|
+
},
|
101
|
+
"fallback": [Function],
|
102
|
+
"formatBlock": [Function],
|
103
|
+
"formatEther": [Function],
|
104
|
+
"formatGwei": [Function],
|
105
|
+
"formatTransaction": [Function],
|
106
|
+
"formatTransactionRequest": [Function],
|
107
|
+
"formatUnit": [Function],
|
108
|
+
"getAccounts": [Function],
|
109
|
+
"getAddress": [Function],
|
110
|
+
"getAutomine": [Function],
|
111
|
+
"getBalance": [Function],
|
112
|
+
"getBlock": [Function],
|
113
|
+
"getBlockNumber": [Function],
|
114
|
+
"getBlockTransactionCount": [Function],
|
115
|
+
"getBytecode": [Function],
|
116
|
+
"getChainId": [Function],
|
117
|
+
"getContractAddress": [Function],
|
118
|
+
"getCreate2Address": [Function],
|
119
|
+
"getCreateAddress": [Function],
|
120
|
+
"getEventSignature": [Function],
|
121
|
+
"getFeeHistory": [Function],
|
122
|
+
"getFilterChanges": [Function],
|
123
|
+
"getFilterLogs": [Function],
|
124
|
+
"getFunctionSignature": [Function],
|
125
|
+
"getGasPrice": [Function],
|
126
|
+
"getLogs": [Function],
|
127
|
+
"getPermissions": [Function],
|
128
|
+
"getStorageAt": [Function],
|
129
|
+
"getTransaction": [Function],
|
130
|
+
"getTransactionConfirmations": [Function],
|
131
|
+
"getTransactionCount": [Function],
|
132
|
+
"getTransactionReceipt": [Function],
|
133
|
+
"getTxpoolContent": [Function],
|
134
|
+
"getTxpoolStatus": [Function],
|
135
|
+
"gweiUnits": {
|
136
|
+
"ether": -9,
|
137
|
+
"wei": 9,
|
138
|
+
},
|
139
|
+
"hexToBigInt": [Function],
|
140
|
+
"hexToBool": [Function],
|
141
|
+
"hexToBytes": [Function],
|
142
|
+
"hexToNumber": [Function],
|
143
|
+
"hexToString": [Function],
|
144
|
+
"http": [Function],
|
145
|
+
"impersonateAccount": [Function],
|
146
|
+
"increaseTime": [Function],
|
147
|
+
"inspectTxpool": [Function],
|
148
|
+
"isAddress": [Function],
|
149
|
+
"isAddressEqual": [Function],
|
150
|
+
"isBytes": [Function],
|
151
|
+
"isHex": [Function],
|
152
|
+
"keccak256": [Function],
|
153
|
+
"mine": [Function],
|
154
|
+
"numberToBytes": [Function],
|
155
|
+
"numberToHex": [Function],
|
156
|
+
"pad": [Function],
|
157
|
+
"padBytes": [Function],
|
158
|
+
"padHex": [Function],
|
159
|
+
"parseEther": [Function],
|
160
|
+
"parseGwei": [Function],
|
161
|
+
"parseUnit": [Function],
|
162
|
+
"readContract": [Function],
|
163
|
+
"removeBlockTimestampInterval": [Function],
|
164
|
+
"requestAccounts": [Function],
|
165
|
+
"requestPermissions": [Function],
|
166
|
+
"reset": [Function],
|
167
|
+
"revert": [Function],
|
168
|
+
"sendTransaction": [Function],
|
169
|
+
"sendUnsignedTransaction": [Function],
|
170
|
+
"setAutomine": [Function],
|
171
|
+
"setBalance": [Function],
|
172
|
+
"setBlockGasLimit": [Function],
|
173
|
+
"setBlockTimestampInterval": [Function],
|
174
|
+
"setCode": [Function],
|
175
|
+
"setCoinbase": [Function],
|
176
|
+
"setIntervalMining": [Function],
|
177
|
+
"setLoggingEnabled": [Function],
|
178
|
+
"setMinGasPrice": [Function],
|
179
|
+
"setNextBlockBaseFeePerGas": [Function],
|
180
|
+
"setNextBlockTimestamp": [Function],
|
181
|
+
"setNonce": [Function],
|
182
|
+
"setStorageAt": [Function],
|
183
|
+
"signMessage": [Function],
|
184
|
+
"simulateContract": [Function],
|
185
|
+
"size": [Function],
|
186
|
+
"slice": [Function],
|
187
|
+
"sliceBytes": [Function],
|
188
|
+
"sliceHex": [Function],
|
189
|
+
"snapshot": [Function],
|
190
|
+
"stopImpersonatingAccount": [Function],
|
191
|
+
"stringToBytes": [Function],
|
192
|
+
"stringToHex": [Function],
|
193
|
+
"switchChain": [Function],
|
194
|
+
"transactionType": {
|
195
|
+
"0x0": "legacy",
|
196
|
+
"0x1": "eip2930",
|
197
|
+
"0x2": "eip1559",
|
198
|
+
},
|
199
|
+
"trim": [Function],
|
200
|
+
"uninstallFilter": [Function],
|
201
|
+
"waitForTransactionReceipt": [Function],
|
202
|
+
"watchAsset": [Function],
|
203
|
+
"watchBlockNumber": [Function],
|
204
|
+
"watchBlocks": [Function],
|
205
|
+
"watchPendingTransactions": [Function],
|
206
|
+
"webSocket": [Function],
|
207
|
+
"weiUnits": {
|
208
|
+
"ether": -18,
|
209
|
+
"gwei": -9,
|
210
|
+
},
|
211
|
+
"writeContract": [Function],
|
212
|
+
}
|
213
|
+
`)
|
214
|
+
})
|
package/src/index.ts
ADDED
@@ -0,0 +1,373 @@
|
|
1
|
+
export type {
|
2
|
+
CallArgs,
|
3
|
+
CallResponse,
|
4
|
+
CreateBlockFilterResponse,
|
5
|
+
CreateContractEventFilterArgs,
|
6
|
+
CreateContractEventFilterResponse,
|
7
|
+
CreateEventFilterArgs,
|
8
|
+
CreateEventFilterResponse,
|
9
|
+
CreatePendingTransactionFilterResponse,
|
10
|
+
EstimateGasArgs,
|
11
|
+
EstimateGasResponse,
|
12
|
+
DeployContractArgs,
|
13
|
+
DeployContractResponse,
|
14
|
+
DropTransactionArgs,
|
15
|
+
GetBalanceArgs,
|
16
|
+
GetBalanceResponse,
|
17
|
+
GetBlockArgs,
|
18
|
+
GetBlockNumberArgs,
|
19
|
+
GetBlockNumberResponse,
|
20
|
+
GetBlockResponse,
|
21
|
+
GetBlockTransactionCountArgs,
|
22
|
+
GetBlockTransactionCountResponse,
|
23
|
+
GetBytecodeArgs,
|
24
|
+
GetBytecodeResponse,
|
25
|
+
GetFeeHistoryArgs,
|
26
|
+
GetFeeHistoryResponse,
|
27
|
+
GetFilterChangesArgs,
|
28
|
+
GetFilterChangesResponse,
|
29
|
+
GetFilterLogsArgs,
|
30
|
+
GetFilterLogsResponse,
|
31
|
+
GetGasPriceResponse,
|
32
|
+
GetLogsArgs,
|
33
|
+
GetLogsResponse,
|
34
|
+
GetPermissionsResponse,
|
35
|
+
GetStorageAtArgs,
|
36
|
+
GetStorageAtResponse,
|
37
|
+
GetTransactionArgs,
|
38
|
+
GetTransactionConfirmationsArgs,
|
39
|
+
GetTransactionConfirmationsResponse,
|
40
|
+
GetTransactionCountArgs,
|
41
|
+
GetTransactionCountResponse,
|
42
|
+
GetTransactionResponse,
|
43
|
+
GetTransactionReceiptArgs,
|
44
|
+
GetTransactionReceiptResponse,
|
45
|
+
ImpersonateAccountArgs,
|
46
|
+
IncreaseTimeArgs,
|
47
|
+
MineArgs,
|
48
|
+
OnBlock,
|
49
|
+
OnBlockNumber,
|
50
|
+
OnBlockNumberResponse,
|
51
|
+
OnBlockResponse,
|
52
|
+
OnTransactions,
|
53
|
+
OnTransactionsResponse,
|
54
|
+
ReadContractArgs,
|
55
|
+
ReadContractResponse,
|
56
|
+
ResetArgs,
|
57
|
+
RequestPermissionsResponse,
|
58
|
+
RevertArgs,
|
59
|
+
SendTransactionArgs,
|
60
|
+
SendTransactionResponse,
|
61
|
+
SendUnsignedTransactionArgs,
|
62
|
+
SendUnsignedTransactionResponse,
|
63
|
+
SetBalanceArgs,
|
64
|
+
SetBlockGasLimitArgs,
|
65
|
+
SetCodeArgs,
|
66
|
+
SetCoinbaseArgs,
|
67
|
+
SetIntervalMiningArgs,
|
68
|
+
SetMinGasPriceArgs,
|
69
|
+
SetBlockTimestampIntervalArgs,
|
70
|
+
SetNextBlockTimestampArgs,
|
71
|
+
SetNextBlockBaseFeePerGasArgs,
|
72
|
+
SetNonceArgs,
|
73
|
+
SetStorageAtArgs,
|
74
|
+
SignMessageArgs,
|
75
|
+
SignMessageResponse,
|
76
|
+
SimulateContractArgs,
|
77
|
+
SimulateContractResponse,
|
78
|
+
StopImpersonatingAccountArgs,
|
79
|
+
SwitchChainArgs,
|
80
|
+
UninstallFilterArgs,
|
81
|
+
UninstallFilterResponse,
|
82
|
+
WaitForTransactionReceiptArgs,
|
83
|
+
WaitForTransactionReceiptResponse,
|
84
|
+
WatchAssetArgs,
|
85
|
+
WatchAssetResponse,
|
86
|
+
WatchBlockNumberArgs,
|
87
|
+
WatchBlocksArgs,
|
88
|
+
WatchPendingTransactionsArgs,
|
89
|
+
WriteContractArgs,
|
90
|
+
WriteContractResponse,
|
91
|
+
} from './actions'
|
92
|
+
export {
|
93
|
+
addChain,
|
94
|
+
call,
|
95
|
+
createBlockFilter,
|
96
|
+
createContractEventFilter,
|
97
|
+
createEventFilter,
|
98
|
+
createPendingTransactionFilter,
|
99
|
+
deployContract,
|
100
|
+
dropTransaction,
|
101
|
+
estimateGas,
|
102
|
+
getAccounts,
|
103
|
+
getAutomine,
|
104
|
+
getBalance,
|
105
|
+
getBlock,
|
106
|
+
getBlockNumber,
|
107
|
+
getBlockTransactionCount,
|
108
|
+
getBytecode,
|
109
|
+
getChainId,
|
110
|
+
getFeeHistory,
|
111
|
+
getFilterChanges,
|
112
|
+
getFilterLogs,
|
113
|
+
getGasPrice,
|
114
|
+
getLogs,
|
115
|
+
getPermissions,
|
116
|
+
getStorageAt,
|
117
|
+
getTransaction,
|
118
|
+
getTransactionConfirmations,
|
119
|
+
getTransactionCount,
|
120
|
+
getTransactionReceipt,
|
121
|
+
getTxpoolContent,
|
122
|
+
getTxpoolStatus,
|
123
|
+
impersonateAccount,
|
124
|
+
increaseTime,
|
125
|
+
inspectTxpool,
|
126
|
+
mine,
|
127
|
+
readContract,
|
128
|
+
removeBlockTimestampInterval,
|
129
|
+
reset,
|
130
|
+
requestAccounts,
|
131
|
+
requestPermissions,
|
132
|
+
revert,
|
133
|
+
sendTransaction,
|
134
|
+
sendUnsignedTransaction,
|
135
|
+
setAutomine,
|
136
|
+
setBalance,
|
137
|
+
setBlockGasLimit,
|
138
|
+
setBlockTimestampInterval,
|
139
|
+
setCode,
|
140
|
+
setCoinbase,
|
141
|
+
setIntervalMining,
|
142
|
+
setLoggingEnabled,
|
143
|
+
setMinGasPrice,
|
144
|
+
setNextBlockBaseFeePerGas,
|
145
|
+
setNextBlockTimestamp,
|
146
|
+
setNonce,
|
147
|
+
setStorageAt,
|
148
|
+
signMessage,
|
149
|
+
simulateContract,
|
150
|
+
snapshot,
|
151
|
+
stopImpersonatingAccount,
|
152
|
+
switchChain,
|
153
|
+
uninstallFilter,
|
154
|
+
waitForTransactionReceipt,
|
155
|
+
watchAsset,
|
156
|
+
watchBlockNumber,
|
157
|
+
watchBlocks,
|
158
|
+
watchPendingTransactions,
|
159
|
+
writeContract,
|
160
|
+
} from './actions'
|
161
|
+
|
162
|
+
export type {
|
163
|
+
Client,
|
164
|
+
ClientConfig,
|
165
|
+
CustomTransport,
|
166
|
+
CustomTransportConfig,
|
167
|
+
FallbackTransport,
|
168
|
+
FallbackTransportConfig,
|
169
|
+
HttpTransport,
|
170
|
+
HttpTransportConfig,
|
171
|
+
PublicClient,
|
172
|
+
PublicClientConfig,
|
173
|
+
TestClient,
|
174
|
+
TestClientConfig,
|
175
|
+
Transport,
|
176
|
+
TransportConfig,
|
177
|
+
WalletClient,
|
178
|
+
WalletClientConfig,
|
179
|
+
WebSocketTransport,
|
180
|
+
WebSocketTransportConfig,
|
181
|
+
} from './clients'
|
182
|
+
export {
|
183
|
+
createClient,
|
184
|
+
createPublicClient,
|
185
|
+
createTestClient,
|
186
|
+
createTransport,
|
187
|
+
createWalletClient,
|
188
|
+
custom,
|
189
|
+
fallback,
|
190
|
+
http,
|
191
|
+
webSocket,
|
192
|
+
} from './clients'
|
193
|
+
|
194
|
+
export {
|
195
|
+
AbiConstructorNotFoundError,
|
196
|
+
AbiConstructorParamsNotFoundError,
|
197
|
+
AbiDecodingDataSizeInvalidError,
|
198
|
+
AbiEncodingArrayLengthMismatchError,
|
199
|
+
AbiEncodingLengthMismatchError,
|
200
|
+
AbiErrorInputsNotFoundError,
|
201
|
+
AbiErrorNotFoundError,
|
202
|
+
AbiErrorSignatureNotFoundError,
|
203
|
+
AbiEventNotFoundError,
|
204
|
+
AbiFunctionNotFoundError,
|
205
|
+
AbiFunctionOutputsNotFoundError,
|
206
|
+
AbiFunctionSignatureNotFoundError,
|
207
|
+
BaseError,
|
208
|
+
BlockNotFoundError,
|
209
|
+
DataLengthTooLongError,
|
210
|
+
DataLengthTooShortError,
|
211
|
+
HttpRequestError,
|
212
|
+
FilterTypeNotSupportedError,
|
213
|
+
InternalRpcError,
|
214
|
+
InvalidAbiDecodingTypeError,
|
215
|
+
InvalidAbiEncodingTypeError,
|
216
|
+
InvalidAddressError,
|
217
|
+
InvalidArrayError,
|
218
|
+
InvalidBytesBooleanError,
|
219
|
+
InvalidDefinitionTypeError,
|
220
|
+
InvalidGasArgumentsError,
|
221
|
+
InvalidHexBooleanError,
|
222
|
+
InvalidHexValueError,
|
223
|
+
InvalidInputRpcError,
|
224
|
+
InvalidParamsRpcError,
|
225
|
+
InvalidRequestRpcError,
|
226
|
+
JsonRpcVersionUnsupportedError,
|
227
|
+
LimitExceededRpcError,
|
228
|
+
MethodNotFoundRpcError,
|
229
|
+
MethodNotSupportedRpcError,
|
230
|
+
OffsetOutOfBoundsError,
|
231
|
+
ParseRpcError,
|
232
|
+
RequestError,
|
233
|
+
ResourceNotFoundRpcError,
|
234
|
+
ResourceUnavailableRpcError,
|
235
|
+
RpcError,
|
236
|
+
RpcRequestError,
|
237
|
+
SizeExceedsPaddingSizeError,
|
238
|
+
TimeoutError,
|
239
|
+
TransactionNotFoundError,
|
240
|
+
TransactionReceiptNotFoundError,
|
241
|
+
TransactionRejectedRpcError,
|
242
|
+
UnknownRpcError,
|
243
|
+
UrlRequiredError,
|
244
|
+
WaitForTransactionReceiptTimeoutError,
|
245
|
+
WebSocketRequestError,
|
246
|
+
} from './errors'
|
247
|
+
|
248
|
+
export type {
|
249
|
+
Address,
|
250
|
+
AbiItem,
|
251
|
+
AccessList,
|
252
|
+
Block,
|
253
|
+
BlockIdentifier,
|
254
|
+
BlockNumber,
|
255
|
+
BlockTag,
|
256
|
+
ByteArray,
|
257
|
+
Hex,
|
258
|
+
FeeHistory,
|
259
|
+
FeeValues,
|
260
|
+
FeeValuesEIP1559,
|
261
|
+
FeeValuesLegacy,
|
262
|
+
Hash,
|
263
|
+
Log,
|
264
|
+
RpcBlock,
|
265
|
+
RpcBlockIdentifier,
|
266
|
+
RpcBlockNumber,
|
267
|
+
RpcFeeHistory,
|
268
|
+
RpcFeeValues,
|
269
|
+
RpcLog,
|
270
|
+
RpcTransaction,
|
271
|
+
RpcTransactionReceipt,
|
272
|
+
RpcTransactionRequest,
|
273
|
+
RpcUncle,
|
274
|
+
TransactionReceipt,
|
275
|
+
TransactionRequest,
|
276
|
+
TransactionRequestBase,
|
277
|
+
TransactionRequestEIP1559,
|
278
|
+
TransactionRequestEIP2930,
|
279
|
+
TransactionRequestLegacy,
|
280
|
+
Transaction,
|
281
|
+
TransactionBase,
|
282
|
+
TransactionEIP1559,
|
283
|
+
TransactionEIP2930,
|
284
|
+
TransactionLegacy,
|
285
|
+
Uncle,
|
286
|
+
} from './types'
|
287
|
+
|
288
|
+
export type {
|
289
|
+
DecodeAbiArgs,
|
290
|
+
DecodeErrorResultArgs,
|
291
|
+
DecodeFunctionDataArgs,
|
292
|
+
DecodeFunctionResultArgs,
|
293
|
+
DecodeFunctionResultResponse,
|
294
|
+
EncodeAbiArgs,
|
295
|
+
EncodeDeployDataArgs,
|
296
|
+
EncodeErrorResultArgs,
|
297
|
+
EncodeEventTopicsArgs,
|
298
|
+
EncodeFunctionDataArgs,
|
299
|
+
EncodeFunctionResultArgs,
|
300
|
+
GetContractAddressOptions,
|
301
|
+
GetCreateAddressOptions,
|
302
|
+
GetCreate2AddressOptions,
|
303
|
+
EncodeRlpResponse,
|
304
|
+
FormattedBlock,
|
305
|
+
FormattedTransaction,
|
306
|
+
FormattedTransactionRequest,
|
307
|
+
} from './utils'
|
308
|
+
export {
|
309
|
+
bytesToHex,
|
310
|
+
bytesToString,
|
311
|
+
boolToBytes,
|
312
|
+
boolToHex,
|
313
|
+
bytesToBigint,
|
314
|
+
bytesToBool,
|
315
|
+
bytesToNumber,
|
316
|
+
decodeAbi,
|
317
|
+
decodeBytes,
|
318
|
+
decodeErrorResult,
|
319
|
+
decodeFunctionData,
|
320
|
+
decodeFunctionResult,
|
321
|
+
decodeHex,
|
322
|
+
decodeRlp,
|
323
|
+
encodeAbi,
|
324
|
+
encodeBytes,
|
325
|
+
encodeDeployData,
|
326
|
+
encodeErrorResult,
|
327
|
+
encodeEventTopics,
|
328
|
+
encodeFunctionData,
|
329
|
+
encodeFunctionResult,
|
330
|
+
encodeHex,
|
331
|
+
encodeRlp,
|
332
|
+
etherUnits,
|
333
|
+
getAddress,
|
334
|
+
getContractAddress,
|
335
|
+
getCreateAddress,
|
336
|
+
getCreate2Address,
|
337
|
+
getEventSignature,
|
338
|
+
getFunctionSignature,
|
339
|
+
gweiUnits,
|
340
|
+
formatEther,
|
341
|
+
isAddress,
|
342
|
+
isAddressEqual,
|
343
|
+
isBytes,
|
344
|
+
isHex,
|
345
|
+
hexToBigInt,
|
346
|
+
hexToBool,
|
347
|
+
hexToBytes,
|
348
|
+
hexToString,
|
349
|
+
keccak256,
|
350
|
+
numberToBytes,
|
351
|
+
pad,
|
352
|
+
padBytes,
|
353
|
+
padHex,
|
354
|
+
parseEther,
|
355
|
+
parseGwei,
|
356
|
+
parseUnit,
|
357
|
+
formatBlock,
|
358
|
+
formatGwei,
|
359
|
+
formatTransaction,
|
360
|
+
formatTransactionRequest,
|
361
|
+
formatUnit,
|
362
|
+
hexToNumber,
|
363
|
+
numberToHex,
|
364
|
+
size,
|
365
|
+
slice,
|
366
|
+
sliceBytes,
|
367
|
+
sliceHex,
|
368
|
+
stringToBytes,
|
369
|
+
stringToHex,
|
370
|
+
transactionType,
|
371
|
+
trim,
|
372
|
+
weiUnits,
|
373
|
+
} from './utils'
|
package/src/public.ts
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
export {
|
2
|
+
call,
|
3
|
+
createBlockFilter,
|
4
|
+
createPendingTransactionFilter,
|
5
|
+
deployContract,
|
6
|
+
estimateGas,
|
7
|
+
getBalance,
|
8
|
+
getBlock,
|
9
|
+
getBlockNumber,
|
10
|
+
getBlockNumberCache,
|
11
|
+
getBlockTransactionCount,
|
12
|
+
getBytecode,
|
13
|
+
getChainId,
|
14
|
+
getFeeHistory,
|
15
|
+
getFilterChanges,
|
16
|
+
getFilterLogs,
|
17
|
+
getGasPrice,
|
18
|
+
getTransaction,
|
19
|
+
getTransactionConfirmations,
|
20
|
+
getTransactionCount,
|
21
|
+
getTransactionReceipt,
|
22
|
+
simulateContract,
|
23
|
+
uninstallFilter,
|
24
|
+
waitForTransactionReceipt,
|
25
|
+
watchBlockNumber,
|
26
|
+
watchBlocks,
|
27
|
+
watchPendingTransactions,
|
28
|
+
} from './actions/public'
|
29
|
+
export type {
|
30
|
+
CallArgs,
|
31
|
+
CallResponse,
|
32
|
+
CreateBlockFilterResponse,
|
33
|
+
CreatePendingTransactionFilterResponse,
|
34
|
+
DeployContractArgs,
|
35
|
+
DeployContractResponse,
|
36
|
+
EstimateGasArgs,
|
37
|
+
EstimateGasResponse,
|
38
|
+
GetBalanceArgs,
|
39
|
+
GetBalanceResponse,
|
40
|
+
GetBlockArgs,
|
41
|
+
GetBlockNumberArgs,
|
42
|
+
GetBlockNumberResponse,
|
43
|
+
GetBlockResponse,
|
44
|
+
GetBlockTransactionCountArgs,
|
45
|
+
GetBlockTransactionCountResponse,
|
46
|
+
GetBytecodeArgs,
|
47
|
+
GetBytecodeResponse,
|
48
|
+
GetFeeHistoryArgs,
|
49
|
+
GetFeeHistoryResponse,
|
50
|
+
GetFilterChangesArgs,
|
51
|
+
GetFilterChangesResponse,
|
52
|
+
GetFilterLogsArgs,
|
53
|
+
GetFilterLogsResponse,
|
54
|
+
GetGasPriceResponse,
|
55
|
+
GetTransactionArgs,
|
56
|
+
GetTransactionConfirmationsArgs,
|
57
|
+
GetTransactionConfirmationsResponse,
|
58
|
+
GetTransactionCountArgs,
|
59
|
+
GetTransactionCountResponse,
|
60
|
+
GetTransactionReceiptArgs,
|
61
|
+
GetTransactionReceiptResponse,
|
62
|
+
GetTransactionResponse,
|
63
|
+
OnBlock,
|
64
|
+
OnBlockNumber,
|
65
|
+
OnBlockNumberResponse,
|
66
|
+
OnBlockResponse,
|
67
|
+
OnTransactions,
|
68
|
+
OnTransactionsResponse,
|
69
|
+
ReplacementReason,
|
70
|
+
ReplacementResponse,
|
71
|
+
SimulateContractArgs,
|
72
|
+
SimulateContractResponse,
|
73
|
+
UninstallFilterArgs,
|
74
|
+
UninstallFilterResponse,
|
75
|
+
WaitForTransactionReceiptArgs,
|
76
|
+
WaitForTransactionReceiptResponse,
|
77
|
+
WatchBlockNumberArgs,
|
78
|
+
WatchBlocksArgs,
|
79
|
+
WatchPendingTransactionsArgs,
|
80
|
+
} from './actions/public'
|
package/src/test.ts
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
export {
|
2
|
+
dropTransaction,
|
3
|
+
getAutomine,
|
4
|
+
getTxpoolContent,
|
5
|
+
getTxpoolStatus,
|
6
|
+
impersonateAccount,
|
7
|
+
increaseTime,
|
8
|
+
inspectTxpool,
|
9
|
+
mine,
|
10
|
+
removeBlockTimestampInterval,
|
11
|
+
reset,
|
12
|
+
revert,
|
13
|
+
sendUnsignedTransaction,
|
14
|
+
setAutomine,
|
15
|
+
setBalance,
|
16
|
+
setBlockGasLimit,
|
17
|
+
setBlockTimestampInterval,
|
18
|
+
setCode,
|
19
|
+
setCoinbase,
|
20
|
+
setIntervalMining,
|
21
|
+
setLoggingEnabled,
|
22
|
+
setMinGasPrice,
|
23
|
+
setNextBlockBaseFeePerGas,
|
24
|
+
setNextBlockTimestamp,
|
25
|
+
setNonce,
|
26
|
+
setStorageAt,
|
27
|
+
snapshot,
|
28
|
+
stopImpersonatingAccount,
|
29
|
+
} from './actions/test'
|
30
|
+
export type {
|
31
|
+
DropTransactionArgs,
|
32
|
+
ImpersonateAccountArgs,
|
33
|
+
IncreaseTimeArgs,
|
34
|
+
MineArgs,
|
35
|
+
ResetArgs,
|
36
|
+
RevertArgs,
|
37
|
+
SendUnsignedTransactionArgs,
|
38
|
+
SendUnsignedTransactionResponse,
|
39
|
+
SetBalanceArgs,
|
40
|
+
SetBlockGasLimitArgs,
|
41
|
+
SetBlockTimestampIntervalArgs,
|
42
|
+
SetCodeArgs,
|
43
|
+
SetCoinbaseArgs,
|
44
|
+
SetIntervalMiningArgs,
|
45
|
+
SetMinGasPriceArgs,
|
46
|
+
SetNextBlockBaseFeePerGasArgs,
|
47
|
+
SetNextBlockTimestampArgs,
|
48
|
+
SetNonceArgs,
|
49
|
+
SetStorageAtArgs,
|
50
|
+
StopImpersonatingAccountArgs,
|
51
|
+
} from './actions/test'
|