viem 0.0.1-alpha.2 → 0.0.1-alpha.20
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-3EOU525X.js → chunk-5Q6FSUU2.mjs} +1199 -562
- package/dist/chunk-5Q6FSUU2.mjs.map +1 -0
- package/dist/chunk-FHXXG7I6.js +259 -0
- package/dist/chunk-FHXXG7I6.js.map +1 -0
- package/dist/chunk-IAQPMSGJ.js +176 -0
- package/dist/chunk-IAQPMSGJ.js.map +1 -0
- package/dist/{chunk-4HNVS7AM.js → chunk-MYQNZSWD.mjs} +330 -539
- package/dist/chunk-MYQNZSWD.mjs.map +1 -0
- package/dist/chunk-NHAKUPTF.js +889 -0
- package/dist/chunk-NHAKUPTF.js.map +1 -0
- package/dist/chunk-SF4I2NKC.js +2683 -0
- package/dist/chunk-SF4I2NKC.js.map +1 -0
- package/dist/chunk-T7CBAKLI.mjs +176 -0
- package/dist/chunk-T7CBAKLI.mjs.map +1 -0
- package/dist/chunk-YFKR74XG.js +256 -0
- package/dist/chunk-YFKR74XG.js.map +1 -0
- package/dist/chunk-YODUQCHJ.mjs +256 -0
- package/dist/chunk-YODUQCHJ.mjs.map +1 -0
- package/dist/{chunk-YQRTXQ2G.js → chunk-ZVGTYLKU.mjs} +3 -15
- package/dist/chunk-ZVGTYLKU.mjs.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 +1414 -0
- package/src/utils/abi/encodeAbi.ts +258 -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 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/index.mjs
ADDED
@@ -0,0 +1,395 @@
|
|
1
|
+
import {
|
2
|
+
createClient,
|
3
|
+
createPublicClient,
|
4
|
+
createTestClient,
|
5
|
+
createTransport,
|
6
|
+
createWalletClient,
|
7
|
+
custom,
|
8
|
+
fallback,
|
9
|
+
http,
|
10
|
+
webSocket
|
11
|
+
} from "./chunk-ZVGTYLKU.mjs";
|
12
|
+
import {
|
13
|
+
call,
|
14
|
+
createBlockFilter,
|
15
|
+
createContractEventFilter,
|
16
|
+
createEventFilter,
|
17
|
+
createPendingTransactionFilter,
|
18
|
+
deployContract,
|
19
|
+
estimateGas,
|
20
|
+
getBalance,
|
21
|
+
getBlock,
|
22
|
+
getBlockNumber,
|
23
|
+
getBlockTransactionCount,
|
24
|
+
getBytecode,
|
25
|
+
getChainId,
|
26
|
+
getFeeHistory,
|
27
|
+
getFilterChanges,
|
28
|
+
getFilterLogs,
|
29
|
+
getGasPrice,
|
30
|
+
getLogs,
|
31
|
+
getStorageAt,
|
32
|
+
getTransaction,
|
33
|
+
getTransactionConfirmations,
|
34
|
+
getTransactionCount,
|
35
|
+
getTransactionReceipt,
|
36
|
+
readContract,
|
37
|
+
simulateContract,
|
38
|
+
uninstallFilter,
|
39
|
+
waitForTransactionReceipt,
|
40
|
+
watchBlockNumber,
|
41
|
+
watchBlocks,
|
42
|
+
watchPendingTransactions
|
43
|
+
} from "./chunk-MYQNZSWD.mjs";
|
44
|
+
import {
|
45
|
+
dropTransaction,
|
46
|
+
getAutomine,
|
47
|
+
getTxpoolContent,
|
48
|
+
getTxpoolStatus,
|
49
|
+
impersonateAccount,
|
50
|
+
increaseTime,
|
51
|
+
inspectTxpool,
|
52
|
+
mine,
|
53
|
+
removeBlockTimestampInterval,
|
54
|
+
reset,
|
55
|
+
revert,
|
56
|
+
sendUnsignedTransaction,
|
57
|
+
setAutomine,
|
58
|
+
setBalance,
|
59
|
+
setBlockGasLimit,
|
60
|
+
setBlockTimestampInterval,
|
61
|
+
setCode,
|
62
|
+
setCoinbase,
|
63
|
+
setIntervalMining,
|
64
|
+
setLoggingEnabled,
|
65
|
+
setMinGasPrice,
|
66
|
+
setNextBlockBaseFeePerGas,
|
67
|
+
setNextBlockTimestamp,
|
68
|
+
setNonce,
|
69
|
+
setStorageAt,
|
70
|
+
snapshot,
|
71
|
+
stopImpersonatingAccount
|
72
|
+
} from "./chunk-YODUQCHJ.mjs";
|
73
|
+
import {
|
74
|
+
addChain,
|
75
|
+
getAccounts,
|
76
|
+
getPermissions,
|
77
|
+
requestAccounts,
|
78
|
+
requestPermissions,
|
79
|
+
sendTransaction,
|
80
|
+
signMessage,
|
81
|
+
switchChain,
|
82
|
+
watchAsset,
|
83
|
+
writeContract
|
84
|
+
} from "./chunk-T7CBAKLI.mjs";
|
85
|
+
import {
|
86
|
+
AbiConstructorNotFoundError,
|
87
|
+
AbiConstructorParamsNotFoundError,
|
88
|
+
AbiDecodingDataSizeInvalidError,
|
89
|
+
AbiEncodingArrayLengthMismatchError,
|
90
|
+
AbiEncodingLengthMismatchError,
|
91
|
+
AbiErrorInputsNotFoundError,
|
92
|
+
AbiErrorNotFoundError,
|
93
|
+
AbiErrorSignatureNotFoundError,
|
94
|
+
AbiEventNotFoundError,
|
95
|
+
AbiFunctionNotFoundError,
|
96
|
+
AbiFunctionOutputsNotFoundError,
|
97
|
+
AbiFunctionSignatureNotFoundError,
|
98
|
+
BaseError,
|
99
|
+
BlockNotFoundError,
|
100
|
+
DataLengthTooLongError,
|
101
|
+
DataLengthTooShortError,
|
102
|
+
FilterTypeNotSupportedError,
|
103
|
+
HttpRequestError,
|
104
|
+
InternalRpcError,
|
105
|
+
InvalidAbiDecodingTypeError,
|
106
|
+
InvalidAbiEncodingTypeError,
|
107
|
+
InvalidAddressError,
|
108
|
+
InvalidArrayError,
|
109
|
+
InvalidBytesBooleanError,
|
110
|
+
InvalidDefinitionTypeError,
|
111
|
+
InvalidGasArgumentsError,
|
112
|
+
InvalidHexBooleanError,
|
113
|
+
InvalidHexValueError,
|
114
|
+
InvalidInputRpcError,
|
115
|
+
InvalidParamsRpcError,
|
116
|
+
InvalidRequestRpcError,
|
117
|
+
JsonRpcVersionUnsupportedError,
|
118
|
+
LimitExceededRpcError,
|
119
|
+
MethodNotFoundRpcError,
|
120
|
+
MethodNotSupportedRpcError,
|
121
|
+
OffsetOutOfBoundsError,
|
122
|
+
ParseRpcError,
|
123
|
+
RequestError,
|
124
|
+
ResourceNotFoundRpcError,
|
125
|
+
ResourceUnavailableRpcError,
|
126
|
+
RpcError,
|
127
|
+
RpcRequestError,
|
128
|
+
SizeExceedsPaddingSizeError,
|
129
|
+
TimeoutError,
|
130
|
+
TransactionNotFoundError,
|
131
|
+
TransactionReceiptNotFoundError,
|
132
|
+
TransactionRejectedRpcError,
|
133
|
+
UnknownRpcError,
|
134
|
+
UrlRequiredError,
|
135
|
+
WaitForTransactionReceiptTimeoutError,
|
136
|
+
WebSocketRequestError,
|
137
|
+
boolToBytes,
|
138
|
+
boolToHex,
|
139
|
+
bytesToBigint,
|
140
|
+
bytesToBool,
|
141
|
+
bytesToHex,
|
142
|
+
bytesToNumber,
|
143
|
+
bytesToString,
|
144
|
+
decodeAbi,
|
145
|
+
decodeBytes,
|
146
|
+
decodeErrorResult,
|
147
|
+
decodeFunctionData,
|
148
|
+
decodeFunctionResult,
|
149
|
+
decodeHex,
|
150
|
+
decodeRlp,
|
151
|
+
encodeAbi,
|
152
|
+
encodeBytes,
|
153
|
+
encodeDeployData,
|
154
|
+
encodeErrorResult,
|
155
|
+
encodeEventTopics,
|
156
|
+
encodeFunctionData,
|
157
|
+
encodeFunctionResult,
|
158
|
+
encodeHex,
|
159
|
+
encodeRlp,
|
160
|
+
etherUnits,
|
161
|
+
formatBlock,
|
162
|
+
formatEther,
|
163
|
+
formatGwei,
|
164
|
+
formatTransaction,
|
165
|
+
formatTransactionRequest,
|
166
|
+
formatUnit,
|
167
|
+
getAddress,
|
168
|
+
getContractAddress,
|
169
|
+
getCreate2Address,
|
170
|
+
getCreateAddress,
|
171
|
+
getEventSignature,
|
172
|
+
getFunctionSignature,
|
173
|
+
gweiUnits,
|
174
|
+
hexToBigInt,
|
175
|
+
hexToBool,
|
176
|
+
hexToBytes,
|
177
|
+
hexToNumber,
|
178
|
+
hexToString,
|
179
|
+
isAddress,
|
180
|
+
isAddressEqual,
|
181
|
+
isBytes,
|
182
|
+
isHex,
|
183
|
+
keccak256,
|
184
|
+
numberToBytes,
|
185
|
+
numberToHex,
|
186
|
+
pad,
|
187
|
+
padBytes,
|
188
|
+
padHex,
|
189
|
+
parseEther,
|
190
|
+
parseGwei,
|
191
|
+
parseUnit,
|
192
|
+
size,
|
193
|
+
slice,
|
194
|
+
sliceBytes,
|
195
|
+
sliceHex,
|
196
|
+
stringToBytes,
|
197
|
+
stringToHex,
|
198
|
+
transactionType,
|
199
|
+
trim,
|
200
|
+
weiUnits
|
201
|
+
} from "./chunk-5Q6FSUU2.mjs";
|
202
|
+
export {
|
203
|
+
AbiConstructorNotFoundError,
|
204
|
+
AbiConstructorParamsNotFoundError,
|
205
|
+
AbiDecodingDataSizeInvalidError,
|
206
|
+
AbiEncodingArrayLengthMismatchError,
|
207
|
+
AbiEncodingLengthMismatchError,
|
208
|
+
AbiErrorInputsNotFoundError,
|
209
|
+
AbiErrorNotFoundError,
|
210
|
+
AbiErrorSignatureNotFoundError,
|
211
|
+
AbiEventNotFoundError,
|
212
|
+
AbiFunctionNotFoundError,
|
213
|
+
AbiFunctionOutputsNotFoundError,
|
214
|
+
AbiFunctionSignatureNotFoundError,
|
215
|
+
BaseError,
|
216
|
+
BlockNotFoundError,
|
217
|
+
DataLengthTooLongError,
|
218
|
+
DataLengthTooShortError,
|
219
|
+
FilterTypeNotSupportedError,
|
220
|
+
HttpRequestError,
|
221
|
+
InternalRpcError,
|
222
|
+
InvalidAbiDecodingTypeError,
|
223
|
+
InvalidAbiEncodingTypeError,
|
224
|
+
InvalidAddressError,
|
225
|
+
InvalidArrayError,
|
226
|
+
InvalidBytesBooleanError,
|
227
|
+
InvalidDefinitionTypeError,
|
228
|
+
InvalidGasArgumentsError,
|
229
|
+
InvalidHexBooleanError,
|
230
|
+
InvalidHexValueError,
|
231
|
+
InvalidInputRpcError,
|
232
|
+
InvalidParamsRpcError,
|
233
|
+
InvalidRequestRpcError,
|
234
|
+
JsonRpcVersionUnsupportedError,
|
235
|
+
LimitExceededRpcError,
|
236
|
+
MethodNotFoundRpcError,
|
237
|
+
MethodNotSupportedRpcError,
|
238
|
+
OffsetOutOfBoundsError,
|
239
|
+
ParseRpcError,
|
240
|
+
RequestError,
|
241
|
+
ResourceNotFoundRpcError,
|
242
|
+
ResourceUnavailableRpcError,
|
243
|
+
RpcError,
|
244
|
+
RpcRequestError,
|
245
|
+
SizeExceedsPaddingSizeError,
|
246
|
+
TimeoutError,
|
247
|
+
TransactionNotFoundError,
|
248
|
+
TransactionReceiptNotFoundError,
|
249
|
+
TransactionRejectedRpcError,
|
250
|
+
UnknownRpcError,
|
251
|
+
UrlRequiredError,
|
252
|
+
WaitForTransactionReceiptTimeoutError,
|
253
|
+
WebSocketRequestError,
|
254
|
+
addChain,
|
255
|
+
boolToBytes,
|
256
|
+
boolToHex,
|
257
|
+
bytesToBigint,
|
258
|
+
bytesToBool,
|
259
|
+
bytesToHex,
|
260
|
+
bytesToNumber,
|
261
|
+
bytesToString,
|
262
|
+
call,
|
263
|
+
createBlockFilter,
|
264
|
+
createClient,
|
265
|
+
createContractEventFilter,
|
266
|
+
createEventFilter,
|
267
|
+
createPendingTransactionFilter,
|
268
|
+
createPublicClient,
|
269
|
+
createTestClient,
|
270
|
+
createTransport,
|
271
|
+
createWalletClient,
|
272
|
+
custom,
|
273
|
+
decodeAbi,
|
274
|
+
decodeBytes,
|
275
|
+
decodeErrorResult,
|
276
|
+
decodeFunctionData,
|
277
|
+
decodeFunctionResult,
|
278
|
+
decodeHex,
|
279
|
+
decodeRlp,
|
280
|
+
deployContract,
|
281
|
+
dropTransaction,
|
282
|
+
encodeAbi,
|
283
|
+
encodeBytes,
|
284
|
+
encodeDeployData,
|
285
|
+
encodeErrorResult,
|
286
|
+
encodeEventTopics,
|
287
|
+
encodeFunctionData,
|
288
|
+
encodeFunctionResult,
|
289
|
+
encodeHex,
|
290
|
+
encodeRlp,
|
291
|
+
estimateGas,
|
292
|
+
etherUnits,
|
293
|
+
fallback,
|
294
|
+
formatBlock,
|
295
|
+
formatEther,
|
296
|
+
formatGwei,
|
297
|
+
formatTransaction,
|
298
|
+
formatTransactionRequest,
|
299
|
+
formatUnit,
|
300
|
+
getAccounts,
|
301
|
+
getAddress,
|
302
|
+
getAutomine,
|
303
|
+
getBalance,
|
304
|
+
getBlock,
|
305
|
+
getBlockNumber,
|
306
|
+
getBlockTransactionCount,
|
307
|
+
getBytecode,
|
308
|
+
getChainId,
|
309
|
+
getContractAddress,
|
310
|
+
getCreate2Address,
|
311
|
+
getCreateAddress,
|
312
|
+
getEventSignature,
|
313
|
+
getFeeHistory,
|
314
|
+
getFilterChanges,
|
315
|
+
getFilterLogs,
|
316
|
+
getFunctionSignature,
|
317
|
+
getGasPrice,
|
318
|
+
getLogs,
|
319
|
+
getPermissions,
|
320
|
+
getStorageAt,
|
321
|
+
getTransaction,
|
322
|
+
getTransactionConfirmations,
|
323
|
+
getTransactionCount,
|
324
|
+
getTransactionReceipt,
|
325
|
+
getTxpoolContent,
|
326
|
+
getTxpoolStatus,
|
327
|
+
gweiUnits,
|
328
|
+
hexToBigInt,
|
329
|
+
hexToBool,
|
330
|
+
hexToBytes,
|
331
|
+
hexToNumber,
|
332
|
+
hexToString,
|
333
|
+
http,
|
334
|
+
impersonateAccount,
|
335
|
+
increaseTime,
|
336
|
+
inspectTxpool,
|
337
|
+
isAddress,
|
338
|
+
isAddressEqual,
|
339
|
+
isBytes,
|
340
|
+
isHex,
|
341
|
+
keccak256,
|
342
|
+
mine,
|
343
|
+
numberToBytes,
|
344
|
+
numberToHex,
|
345
|
+
pad,
|
346
|
+
padBytes,
|
347
|
+
padHex,
|
348
|
+
parseEther,
|
349
|
+
parseGwei,
|
350
|
+
parseUnit,
|
351
|
+
readContract,
|
352
|
+
removeBlockTimestampInterval,
|
353
|
+
requestAccounts,
|
354
|
+
requestPermissions,
|
355
|
+
reset,
|
356
|
+
revert,
|
357
|
+
sendTransaction,
|
358
|
+
sendUnsignedTransaction,
|
359
|
+
setAutomine,
|
360
|
+
setBalance,
|
361
|
+
setBlockGasLimit,
|
362
|
+
setBlockTimestampInterval,
|
363
|
+
setCode,
|
364
|
+
setCoinbase,
|
365
|
+
setIntervalMining,
|
366
|
+
setLoggingEnabled,
|
367
|
+
setMinGasPrice,
|
368
|
+
setNextBlockBaseFeePerGas,
|
369
|
+
setNextBlockTimestamp,
|
370
|
+
setNonce,
|
371
|
+
setStorageAt,
|
372
|
+
signMessage,
|
373
|
+
simulateContract,
|
374
|
+
size,
|
375
|
+
slice,
|
376
|
+
sliceBytes,
|
377
|
+
sliceHex,
|
378
|
+
snapshot,
|
379
|
+
stopImpersonatingAccount,
|
380
|
+
stringToBytes,
|
381
|
+
stringToHex,
|
382
|
+
switchChain,
|
383
|
+
transactionType,
|
384
|
+
trim,
|
385
|
+
uninstallFilter,
|
386
|
+
waitForTransactionReceipt,
|
387
|
+
watchAsset,
|
388
|
+
watchBlockNumber,
|
389
|
+
watchBlocks,
|
390
|
+
watchPendingTransactions,
|
391
|
+
webSocket,
|
392
|
+
weiUnits,
|
393
|
+
writeContract
|
394
|
+
};
|
395
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -1,73 +1,78 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { R as RpcError } from './rpc-3c0e3985.js';
|
5
|
-
|
6
|
-
type ExtractArgsFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiFunction extends AbiFunction & {
|
7
|
-
type: 'function';
|
8
|
-
} = TAbi extends Abi ? ExtractAbiFunction<TAbi, TFunctionName> : AbiFunction & {
|
9
|
-
type: 'function';
|
10
|
-
}, TArgs = AbiParametersToPrimitiveTypes<TAbiFunction['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
|
11
|
-
/**
|
12
|
-
* Arguments to pass contract method
|
13
|
-
*
|
14
|
-
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
|
15
|
-
*/
|
16
|
-
args?: readonly unknown[];
|
17
|
-
} : TArgs extends readonly [] ? {
|
18
|
-
args?: never;
|
19
|
-
} : {
|
20
|
-
/** Arguments to pass contract method */ args: TArgs;
|
21
|
-
};
|
1
|
+
import { AbiParameter, AbiParametersToPrimitiveTypes, Abi, ExtractAbiErrorNames, ExtractAbiEventNames } from 'abitype';
|
2
|
+
import { b as Hex, A as Address, c as ByteArray } from './chain-32f56cfa.js';
|
3
|
+
import { d as ExtractFunctionNameFromAbi, f as ExtractResultFromAbi, h as ExtractConstructorArgsFromAbi, j as ExtractErrorArgsFromAbi, c as ExtractEventArgsFromAbi, e as ExtractArgsFromAbi, E as EventDefinition } from './contract-9af4608b.js';
|
22
4
|
|
23
|
-
|
5
|
+
type DecodeAbiArgs<TParams extends readonly AbiParameter[]> = {
|
24
6
|
data: Hex;
|
25
7
|
params: TParams;
|
26
|
-
}
|
27
|
-
declare
|
28
|
-
name: string;
|
29
|
-
constructor(size: number);
|
30
|
-
}
|
31
|
-
declare class InvalidAbiDecodingTypeError extends BaseError {
|
32
|
-
name: string;
|
33
|
-
constructor(type: string);
|
34
|
-
}
|
8
|
+
};
|
9
|
+
declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, params, }: DecodeAbiArgs<TParams>): AbiParametersToPrimitiveTypes<TParams> | undefined;
|
35
10
|
|
11
|
+
type DecodeErrorResultArgs = {
|
12
|
+
abi: Abi;
|
13
|
+
data: Hex;
|
14
|
+
};
|
15
|
+
declare function decodeErrorResult({ abi, data }: DecodeErrorResultArgs): {
|
16
|
+
errorName: string;
|
17
|
+
args: readonly unknown[] | undefined;
|
18
|
+
};
|
19
|
+
|
20
|
+
type DecodeFunctionDataArgs = {
|
21
|
+
abi: Abi;
|
22
|
+
data: Hex;
|
23
|
+
};
|
24
|
+
declare function decodeFunctionData({ abi, data }: DecodeFunctionDataArgs): {
|
25
|
+
functionName: string;
|
26
|
+
args: readonly unknown[] | undefined;
|
27
|
+
};
|
28
|
+
|
29
|
+
type DecodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = {
|
30
|
+
abi: TAbi;
|
31
|
+
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
32
|
+
data: Hex;
|
33
|
+
};
|
34
|
+
type DecodeFunctionResultResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = ExtractResultFromAbi<TAbi, TFunctionName>;
|
35
|
+
declare function decodeFunctionResult<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any>({ abi, functionName, data, }: DecodeFunctionResultArgs<TAbi, TFunctionName>): DecodeFunctionResultResponse<TAbi, TFunctionName>;
|
36
|
+
|
37
|
+
type EncodeAbiArgs<TParams extends readonly AbiParameter[]> = {
|
38
|
+
params: TParams;
|
39
|
+
values: AbiParametersToPrimitiveTypes<TParams>;
|
40
|
+
};
|
36
41
|
/**
|
37
42
|
* @description Encodes a list of primitive values into an ABI-encoded hex value.
|
38
43
|
*/
|
39
|
-
declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
}
|
51
|
-
declare
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
58
|
-
|
59
|
-
|
60
|
-
constructor(type: string);
|
61
|
-
}
|
62
|
-
declare class InvalidArrayError extends BaseError {
|
63
|
-
name: string;
|
64
|
-
constructor(value: unknown);
|
65
|
-
}
|
66
|
-
|
67
|
-
declare function encodeFunctionParams<TAbi extends Abi = Abi, TFunctionName extends ExtractAbiFunctionNames<TAbi> = any>({ abi, args, functionName, }: {
|
44
|
+
declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: EncodeAbiArgs<TParams>): `0x${string}`;
|
45
|
+
|
46
|
+
type EncodeDeployDataArgs<TAbi extends Abi = Abi> = {
|
47
|
+
abi: TAbi;
|
48
|
+
bytecode: Hex;
|
49
|
+
} & ExtractConstructorArgsFromAbi<TAbi>;
|
50
|
+
declare function encodeDeployData<TAbi extends Abi = Abi>({ abi, args, bytecode, }: EncodeDeployDataArgs<TAbi>): `0x${string}`;
|
51
|
+
|
52
|
+
type EncodeErrorResultArgs<TAbi extends Abi = Abi, TErrorName extends ExtractAbiErrorNames<TAbi> = any> = {
|
53
|
+
abi: TAbi;
|
54
|
+
errorName: TErrorName;
|
55
|
+
} & ExtractErrorArgsFromAbi<TAbi, TErrorName>;
|
56
|
+
declare function encodeErrorResult<TAbi extends Abi = Abi, TErrorName extends ExtractAbiErrorNames<TAbi> = any>({ abi, errorName, args }: EncodeErrorResultArgs<TAbi, TErrorName>): `0x${string}`;
|
57
|
+
|
58
|
+
type EncodeEventTopicsArgs<TAbi extends Abi = Abi, TEventName extends ExtractAbiEventNames<TAbi> = any> = {
|
59
|
+
abi: TAbi;
|
60
|
+
eventName: TEventName;
|
61
|
+
} & ExtractEventArgsFromAbi<TAbi, TEventName>;
|
62
|
+
declare function encodeEventTopics<TAbi extends Abi = Abi, TEventName extends ExtractAbiEventNames<TAbi> = any>({ abi, eventName, args }: EncodeEventTopicsArgs<TAbi, TEventName>): `0x${string}`[];
|
63
|
+
|
64
|
+
type EncodeFunctionDataArgs<TAbi extends Abi = Abi, TFunctionName extends string = any> = {
|
68
65
|
abi: TAbi;
|
69
|
-
functionName: TFunctionName
|
70
|
-
} & ExtractArgsFromAbi<TAbi, TFunctionName
|
66
|
+
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
67
|
+
} & ExtractArgsFromAbi<TAbi, TFunctionName>;
|
68
|
+
declare function encodeFunctionData<TAbi extends Abi = Abi, TFunctionName extends string = any>({ abi, args, functionName }: EncodeFunctionDataArgs<TAbi, TFunctionName>): `0x${string}`;
|
69
|
+
|
70
|
+
type EncodeFunctionResultArgs<TAbi extends Abi = Abi, TFunctionName extends string = any> = {
|
71
|
+
abi: TAbi;
|
72
|
+
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
73
|
+
result?: ExtractResultFromAbi<TAbi, TFunctionName>;
|
74
|
+
};
|
75
|
+
declare function encodeFunctionResult<TAbi extends Abi = Abi, TFunctionName extends string = any>({ abi, functionName, result, }: EncodeFunctionResultArgs<TAbi, TFunctionName>): `0x${string}`;
|
71
76
|
|
72
77
|
declare function getAddress(address: Address): `0x${string}`;
|
73
78
|
|
@@ -93,81 +98,6 @@ declare function isAddress(address: Address): boolean;
|
|
93
98
|
|
94
99
|
declare function isAddressEqual(a: Address, b: Address): boolean;
|
95
100
|
|
96
|
-
declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest): TRequest;
|
97
|
-
declare class RequestError extends BaseError {
|
98
|
-
constructor(err: Error, { docsPath, humanMessage }: {
|
99
|
-
docsPath?: string;
|
100
|
-
humanMessage: string;
|
101
|
-
});
|
102
|
-
}
|
103
|
-
declare class RpcRequestError extends RequestError {
|
104
|
-
code: number;
|
105
|
-
constructor(err: RpcError, { docsPath, humanMessage }: {
|
106
|
-
docsPath?: string;
|
107
|
-
humanMessage: string;
|
108
|
-
});
|
109
|
-
}
|
110
|
-
declare class ParseRpcError extends RpcRequestError {
|
111
|
-
name: string;
|
112
|
-
code: number;
|
113
|
-
constructor(err: RpcError);
|
114
|
-
}
|
115
|
-
declare class InvalidRequestRpcError extends RpcRequestError {
|
116
|
-
name: string;
|
117
|
-
code: number;
|
118
|
-
constructor(err: RpcError);
|
119
|
-
}
|
120
|
-
declare class MethodNotFoundRpcError extends RpcRequestError {
|
121
|
-
name: string;
|
122
|
-
code: number;
|
123
|
-
constructor(err: RpcError);
|
124
|
-
}
|
125
|
-
declare class InvalidParamsRpcError extends RpcRequestError {
|
126
|
-
name: string;
|
127
|
-
code: number;
|
128
|
-
constructor(err: RpcError);
|
129
|
-
}
|
130
|
-
declare class InternalRpcError extends RpcRequestError {
|
131
|
-
name: string;
|
132
|
-
code: number;
|
133
|
-
constructor(err: RpcError);
|
134
|
-
}
|
135
|
-
declare class InvalidInputRpcError extends RpcRequestError {
|
136
|
-
name: string;
|
137
|
-
code: number;
|
138
|
-
constructor(err: RpcError);
|
139
|
-
}
|
140
|
-
declare class ResourceNotFoundRpcError extends RpcRequestError {
|
141
|
-
name: string;
|
142
|
-
code: number;
|
143
|
-
constructor(err: RpcError);
|
144
|
-
}
|
145
|
-
declare class ResourceUnavailableRpcError extends RpcRequestError {
|
146
|
-
name: string;
|
147
|
-
code: number;
|
148
|
-
constructor(err: RpcError);
|
149
|
-
}
|
150
|
-
declare class TransactionRejectedRpcError extends RpcRequestError {
|
151
|
-
name: string;
|
152
|
-
code: number;
|
153
|
-
constructor(err: RpcError);
|
154
|
-
}
|
155
|
-
declare class MethodNotSupportedRpcError extends RpcRequestError {
|
156
|
-
name: string;
|
157
|
-
code: number;
|
158
|
-
constructor(err: RpcError);
|
159
|
-
}
|
160
|
-
declare class LimitExceededRpcError extends RpcRequestError {
|
161
|
-
name: string;
|
162
|
-
code: number;
|
163
|
-
constructor(err: RpcError);
|
164
|
-
}
|
165
|
-
declare class JsonRpcVersionUnsupportedError extends RpcRequestError {
|
166
|
-
name: string;
|
167
|
-
code: number;
|
168
|
-
constructor(err: RpcError);
|
169
|
-
}
|
170
|
-
|
171
101
|
declare function isBytes(value: any): boolean;
|
172
102
|
|
173
103
|
declare function isHex(value: any): boolean;
|
@@ -325,7 +255,7 @@ declare function hexToString(hex: Hex): string;
|
|
325
255
|
type DecodeRlpResponse<TTo> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
|
326
256
|
declare function decodeRlp<TTo extends 'bytes' | 'hex'>(value: ByteArray | Hex, to: TTo): RecursiveArray<DecodeRlpResponse<TTo>>;
|
327
257
|
|
328
|
-
declare const getEventSignature: (event:
|
258
|
+
declare const getEventSignature: (event: EventDefinition) => `0x${string}`;
|
329
259
|
|
330
260
|
declare const getFunctionSignature: (fn: string) => `0x${string}`;
|
331
261
|
|
@@ -333,6 +263,19 @@ type To = 'hex' | 'bytes';
|
|
333
263
|
type Keccak256Hash<TTo extends To> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
|
334
264
|
declare function keccak256<TTo extends To = 'hex'>(value: ByteArray, to_?: TTo): Keccak256Hash<TTo>;
|
335
265
|
|
266
|
+
declare const etherUnits: {
|
267
|
+
gwei: number;
|
268
|
+
wei: number;
|
269
|
+
};
|
270
|
+
declare const gweiUnits: {
|
271
|
+
ether: number;
|
272
|
+
wei: number;
|
273
|
+
};
|
274
|
+
declare const weiUnits: {
|
275
|
+
ether: number;
|
276
|
+
gwei: number;
|
277
|
+
};
|
278
|
+
|
336
279
|
declare function formatEther(wei: bigint, unit?: 'wei' | 'gwei'): string;
|
337
280
|
|
338
281
|
declare function formatGwei(wei: bigint, unit?: 'wei'): string;
|
@@ -345,4 +288,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
|
345
288
|
|
346
289
|
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
347
290
|
|
348
|
-
export {
|
291
|
+
export { hexToBytes as $, encodeAbi as A, encodeBytes as B, encodeDeployData as C, DecodeAbiArgs as D, EncodeAbiArgs as E, encodeErrorResult as F, GetContractAddressOptions as G, encodeEventTopics as H, encodeFunctionData as I, encodeFunctionResult as J, encodeHex as K, encodeRlp as L, etherUnits as M, getAddress as N, getContractAddress as O, getCreateAddress as P, getCreate2Address as Q, getEventSignature as R, getFunctionSignature as S, gweiUnits as T, formatEther as U, isAddress as V, isAddressEqual as W, isBytes as X, isHex as Y, hexToBigInt as Z, hexToBool as _, DecodeErrorResultArgs as a, hexToString as a0, keccak256 as a1, numberToBytes as a2, pad as a3, padBytes as a4, padHex as a5, parseEther as a6, parseGwei as a7, parseUnit as a8, formatGwei as a9, formatUnit as aa, hexToNumber as ab, numberToHex as ac, size as ad, slice as ae, sliceBytes as af, sliceHex as ag, stringToBytes as ah, stringToHex as ai, trim as aj, weiUnits as ak, DecodeFunctionDataArgs as b, DecodeFunctionResultArgs as c, DecodeFunctionResultResponse as d, EncodeDeployDataArgs as e, EncodeErrorResultArgs as f, EncodeEventTopicsArgs as g, EncodeFunctionDataArgs as h, EncodeFunctionResultArgs as i, GetCreateAddressOptions as j, GetCreate2AddressOptions as k, EncodeRlpResponse as l, bytesToHex as m, bytesToString as n, boolToBytes as o, boolToHex as p, bytesToBigint as q, bytesToBool as r, bytesToNumber as s, decodeAbi as t, decodeBytes as u, decodeErrorResult as v, decodeFunctionData as w, decodeFunctionResult as x, decodeHex as y, decodeRlp as z };
|
package/dist/public.d.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DeployContractArgs, e as DeployContractResponse, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, f as GetBalanceResponse, g as GetBlockArgs, h as GetBlockNumberArgs, i as GetBlockNumberResponse, j as GetBlockResponse, k as GetBlockTransactionCountArgs, l as GetBlockTransactionCountResponse, m as GetBytecodeArgs, n as GetBytecodeResponse, o as GetFeeHistoryArgs, p as GetFeeHistoryResponse, q as GetFilterChangesArgs, r as GetFilterChangesResponse, s as GetFilterLogsArgs, t as GetFilterLogsResponse, u as GetGasPriceResponse, v as GetTransactionArgs, w as GetTransactionConfirmationsArgs, x as GetTransactionConfirmationsResponse, y as GetTransactionCountArgs, z as GetTransactionCountResponse, B as GetTransactionReceiptArgs, H as GetTransactionReceiptResponse, A as GetTransactionResponse, O as OnBlock, I as OnBlockNumber, J as OnBlockNumberResponse, K as OnBlockResponse, L as OnTransactions, M as OnTransactionsResponse, ao as ReplacementReason, ap as ReplacementResponse, S as SimulateContractArgs, N as SimulateContractResponse, U as UninstallFilterArgs, P as UninstallFilterResponse, W as WaitForTransactionReceiptArgs, Q as WaitForTransactionReceiptResponse, R as WatchBlockNumberArgs, T as WatchBlocksArgs, V as WatchPendingTransactionsArgs, Z as call, _ as createBlockFilter, $ as createPendingTransactionFilter, a0 as deployContract, a1 as estimateGas, a2 as getBalance, a3 as getBlock, a4 as getBlockNumber, an as getBlockNumberCache, a5 as getBlockTransactionCount, a6 as getBytecode, a7 as getChainId, a8 as getFeeHistory, a9 as getFilterChanges, aa as getFilterLogs, ab as getGasPrice, ac as getTransaction, ad as getTransactionConfirmations, ae as getTransactionCount, af as getTransactionReceipt, ag as simulateContract, ah as uninstallFilter, ai as waitForTransactionReceipt, aj as watchBlockNumber, ak as watchBlocks, al as watchPendingTransactions } from './watchPendingTransactions-3b722547.js';
|
2
|
+
import 'abitype';
|
3
|
+
import './chain-32f56cfa.js';
|
4
|
+
import '@wagmi/chains';
|
5
|
+
import './contract-9af4608b.js';
|
6
|
+
import './createPublicClient-9d2b42e1.js';
|
7
|
+
import './eip1193-6c485d63.js';
|
8
|
+
import './createClient-5d316c7e.js';
|
9
|
+
import './createWalletClient-f69a5230.js';
|
10
|
+
import './sendTransaction-1c8290a9.js';
|
11
|
+
import './transactionRequest-341b6ed2.js';
|