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
package/dist/public.js
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
var _chunkKZMJR27Bjs = require('./chunk-KZMJR27B.js');
|
29
|
+
require('./chunk-EC3NUIJE.js');
|
30
|
+
require('./chunk-O2GYLJVD.js');
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
exports.call = _chunkKZMJR27Bjs.call; exports.createBlockFilter = _chunkKZMJR27Bjs.createBlockFilter; exports.createPendingTransactionFilter = _chunkKZMJR27Bjs.createPendingTransactionFilter; exports.deployContract = _chunkKZMJR27Bjs.deployContract; exports.estimateGas = _chunkKZMJR27Bjs.estimateGas; exports.getBalance = _chunkKZMJR27Bjs.getBalance; exports.getBlock = _chunkKZMJR27Bjs.getBlock; exports.getBlockNumber = _chunkKZMJR27Bjs.getBlockNumber; exports.getBlockNumberCache = _chunkKZMJR27Bjs.getBlockNumberCache; exports.getBlockTransactionCount = _chunkKZMJR27Bjs.getBlockTransactionCount; exports.getBytecode = _chunkKZMJR27Bjs.getBytecode; exports.getChainId = _chunkKZMJR27Bjs.getChainId; exports.getFeeHistory = _chunkKZMJR27Bjs.getFeeHistory; exports.getFilterChanges = _chunkKZMJR27Bjs.getFilterChanges; exports.getFilterLogs = _chunkKZMJR27Bjs.getFilterLogs; exports.getGasPrice = _chunkKZMJR27Bjs.getGasPrice; exports.getTransaction = _chunkKZMJR27Bjs.getTransaction; exports.getTransactionConfirmations = _chunkKZMJR27Bjs.getTransactionConfirmations; exports.getTransactionCount = _chunkKZMJR27Bjs.getTransactionCount; exports.getTransactionReceipt = _chunkKZMJR27Bjs.getTransactionReceipt; exports.simulateContract = _chunkKZMJR27Bjs.simulateContract; exports.uninstallFilter = _chunkKZMJR27Bjs.uninstallFilter; exports.waitForTransactionReceipt = _chunkKZMJR27Bjs.waitForTransactionReceipt; exports.watchBlockNumber = _chunkKZMJR27Bjs.watchBlockNumber; exports.watchBlocks = _chunkKZMJR27Bjs.watchBlocks; exports.watchPendingTransactions = _chunkKZMJR27Bjs.watchPendingTransactions;
|
59
|
+
//# sourceMappingURL=public.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/public.mjs
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
import {
|
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 "./chunk-DGO77E2H.mjs";
|
29
|
+
import "./chunk-DSPMAIDO.mjs";
|
30
|
+
import "./chunk-62VTYU2V.mjs";
|
31
|
+
export {
|
32
|
+
call,
|
33
|
+
createBlockFilter,
|
34
|
+
createPendingTransactionFilter,
|
35
|
+
deployContract,
|
36
|
+
estimateGas,
|
37
|
+
getBalance,
|
38
|
+
getBlock,
|
39
|
+
getBlockNumber,
|
40
|
+
getBlockNumberCache,
|
41
|
+
getBlockTransactionCount,
|
42
|
+
getBytecode,
|
43
|
+
getChainId,
|
44
|
+
getFeeHistory,
|
45
|
+
getFilterChanges,
|
46
|
+
getFilterLogs,
|
47
|
+
getGasPrice,
|
48
|
+
getTransaction,
|
49
|
+
getTransactionConfirmations,
|
50
|
+
getTransactionCount,
|
51
|
+
getTransactionReceipt,
|
52
|
+
simulateContract,
|
53
|
+
uninstallFilter,
|
54
|
+
waitForTransactionReceipt,
|
55
|
+
watchBlockNumber,
|
56
|
+
watchBlocks,
|
57
|
+
watchPendingTransactions
|
58
|
+
};
|
59
|
+
//# sourceMappingURL=public.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import { B as BaseError } from './BaseError-7688f84e.js';
|
2
|
-
|
3
1
|
type SuccessResult<T> = {
|
4
2
|
method?: never;
|
5
3
|
result: T;
|
@@ -59,40 +57,5 @@ declare const rpc: {
|
|
59
57
|
webSocket: typeof webSocket;
|
60
58
|
webSocketAsync: typeof webSocketAsync;
|
61
59
|
};
|
62
|
-
declare class HttpRequestError extends BaseError {
|
63
|
-
name: string;
|
64
|
-
status: number;
|
65
|
-
constructor({ body, details, status, url, }: {
|
66
|
-
body: {
|
67
|
-
[key: string]: unknown;
|
68
|
-
};
|
69
|
-
details: string;
|
70
|
-
status: number;
|
71
|
-
url: string;
|
72
|
-
});
|
73
|
-
}
|
74
|
-
declare class RpcError extends BaseError {
|
75
|
-
code: number;
|
76
|
-
name: string;
|
77
|
-
constructor({ body, error, url, }: {
|
78
|
-
body: {
|
79
|
-
[key: string]: unknown;
|
80
|
-
};
|
81
|
-
error: {
|
82
|
-
code: number;
|
83
|
-
message: string;
|
84
|
-
};
|
85
|
-
url: string;
|
86
|
-
});
|
87
|
-
}
|
88
|
-
declare class TimeoutError extends BaseError {
|
89
|
-
name: string;
|
90
|
-
constructor({ body, url, }: {
|
91
|
-
body: {
|
92
|
-
[key: string]: unknown;
|
93
|
-
};
|
94
|
-
url: string;
|
95
|
-
});
|
96
|
-
}
|
97
60
|
|
98
|
-
export {
|
61
|
+
export { RpcResponse as R, rpc as r };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { K as Formatter, M as MergeIntersectionProperties, N as Formatted, s as TransactionRequest, J as Chain, H as Hash } from './chain-32f56cfa.js';
|
2
|
+
import { W as WalletClient } from './createWalletClient-f69a5230.js';
|
3
|
+
import { T as TransactionRequestFormatter } from './transactionRequest-341b6ed2.js';
|
4
|
+
|
5
|
+
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
|
6
|
+
type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & {
|
7
|
+
chain?: TChain;
|
8
|
+
};
|
9
|
+
type SendTransactionResponse = Hash;
|
10
|
+
declare function sendTransaction<TChain extends Chain>(client: WalletClient, { chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
|
11
|
+
|
12
|
+
export { FormattedTransactionRequest as F, SendTransactionArgs as S, SendTransactionResponse as a, sendTransaction as s };
|
@@ -0,0 +1,156 @@
|
|
1
|
+
import { H as Hash, o as RpcTransaction, A as Address, X as Quantity, s as TransactionRequest, b as Hex } from './chain-32f56cfa.js';
|
2
|
+
import { T as TestClient } from './createTestClient-79498dab.js';
|
3
|
+
|
4
|
+
type DropTransactionArgs = {
|
5
|
+
/** The hash of the transaction to drop. */
|
6
|
+
hash: Hash;
|
7
|
+
};
|
8
|
+
declare function dropTransaction(client: TestClient, { hash }: DropTransactionArgs): Promise<void>;
|
9
|
+
|
10
|
+
type GetAutomineResponse = boolean;
|
11
|
+
declare function getAutomine(client: TestClient): Promise<GetAutomineResponse>;
|
12
|
+
|
13
|
+
declare function getTxpoolContent(client: TestClient): Promise<{
|
14
|
+
pending: Record<`0x${string}`, Record<string, RpcTransaction>>;
|
15
|
+
queued: Record<`0x${string}`, Record<string, RpcTransaction>>;
|
16
|
+
}>;
|
17
|
+
|
18
|
+
declare function getTxpoolStatus(client: TestClient): Promise<{
|
19
|
+
pending: number;
|
20
|
+
queued: number;
|
21
|
+
}>;
|
22
|
+
|
23
|
+
type ImpersonateAccountArgs = {
|
24
|
+
/** The account to impersonate. */
|
25
|
+
address: Address;
|
26
|
+
};
|
27
|
+
declare function impersonateAccount(client: TestClient, { address }: ImpersonateAccountArgs): Promise<void>;
|
28
|
+
|
29
|
+
type IncreaseTimeArgs = {
|
30
|
+
/** The amount of seconds to jump forward in time. */
|
31
|
+
seconds: number;
|
32
|
+
};
|
33
|
+
declare function increaseTime(client: TestClient, { seconds }: IncreaseTimeArgs): Promise<`0x${string}`>;
|
34
|
+
|
35
|
+
declare function inspectTxpool(client: TestClient): Promise<{
|
36
|
+
pending: Record<`0x${string}`, Record<string, string>>;
|
37
|
+
queued: Record<`0x${string}`, Record<string, string>>;
|
38
|
+
}>;
|
39
|
+
|
40
|
+
type MineArgs = {
|
41
|
+
/** Number of blocks to mine. */
|
42
|
+
blocks: number;
|
43
|
+
/** Interval between each block in seconds. */
|
44
|
+
interval?: number;
|
45
|
+
};
|
46
|
+
declare function mine(client: TestClient, { blocks, interval }: MineArgs): Promise<void>;
|
47
|
+
|
48
|
+
declare function removeBlockTimestampInterval(client: TestClient): Promise<void>;
|
49
|
+
|
50
|
+
type ResetArgs = {
|
51
|
+
/** The block number to reset from. */
|
52
|
+
blockNumber?: bigint;
|
53
|
+
/** The JSON RPC URL. */
|
54
|
+
jsonRpcUrl?: string;
|
55
|
+
};
|
56
|
+
declare function reset(client: TestClient, { blockNumber, jsonRpcUrl }?: ResetArgs): Promise<void>;
|
57
|
+
|
58
|
+
type RevertArgs = {
|
59
|
+
/** The snapshot ID to revert to. */
|
60
|
+
id: Quantity;
|
61
|
+
};
|
62
|
+
declare function revert(client: TestClient, { id }: RevertArgs): Promise<void>;
|
63
|
+
|
64
|
+
type SendUnsignedTransactionArgs = TransactionRequest;
|
65
|
+
type SendUnsignedTransactionResponse = Hash;
|
66
|
+
declare function sendUnsignedTransaction(client: TestClient, request: SendUnsignedTransactionArgs): Promise<SendUnsignedTransactionResponse>;
|
67
|
+
|
68
|
+
declare function setAutomine(client: TestClient, enabled: boolean): Promise<void>;
|
69
|
+
|
70
|
+
type SetBalanceArgs = {
|
71
|
+
/** The account address. */
|
72
|
+
address: Address;
|
73
|
+
/** Amount (in wei) to set */
|
74
|
+
value: bigint;
|
75
|
+
};
|
76
|
+
declare function setBalance(client: TestClient, { address, value }: SetBalanceArgs): Promise<void>;
|
77
|
+
|
78
|
+
type SetBlockGasLimitArgs = {
|
79
|
+
/** Gas limit (in wei). */
|
80
|
+
gasLimit: bigint;
|
81
|
+
};
|
82
|
+
declare function setBlockGasLimit(client: TestClient, { gasLimit }: SetBlockGasLimitArgs): Promise<void>;
|
83
|
+
|
84
|
+
type SetBlockTimestampIntervalArgs = {
|
85
|
+
/** The interval (in seconds). */
|
86
|
+
interval: number;
|
87
|
+
};
|
88
|
+
declare function setBlockTimestampInterval(client: TestClient, { interval }: SetBlockTimestampIntervalArgs): Promise<void>;
|
89
|
+
|
90
|
+
type SetCodeArgs = {
|
91
|
+
/** The account address. */
|
92
|
+
address: Address;
|
93
|
+
/** The bytecode to set */
|
94
|
+
bytecode: Hex;
|
95
|
+
};
|
96
|
+
declare function setCode(client: TestClient, { address, bytecode }: SetCodeArgs): Promise<void>;
|
97
|
+
|
98
|
+
type SetCoinbaseArgs = {
|
99
|
+
/** The coinbase address. */
|
100
|
+
address: Address;
|
101
|
+
};
|
102
|
+
declare function setCoinbase(client: TestClient, { address }: SetCoinbaseArgs): Promise<void>;
|
103
|
+
|
104
|
+
type SetIntervalMiningArgs = {
|
105
|
+
/** The mining interval. */
|
106
|
+
interval: number;
|
107
|
+
};
|
108
|
+
declare function setIntervalMining(client: TestClient, { interval }: SetIntervalMiningArgs): Promise<void>;
|
109
|
+
|
110
|
+
declare function setLoggingEnabled(client: TestClient, enabled: boolean): Promise<void>;
|
111
|
+
|
112
|
+
type SetMinGasPriceArgs = {
|
113
|
+
/** The gas price. */
|
114
|
+
gasPrice: bigint;
|
115
|
+
};
|
116
|
+
declare function setMinGasPrice(client: TestClient, { gasPrice }: SetMinGasPriceArgs): Promise<void>;
|
117
|
+
|
118
|
+
type SetNextBlockBaseFeePerGasArgs = {
|
119
|
+
/** Base fee per gas (in wei). */
|
120
|
+
baseFeePerGas: bigint;
|
121
|
+
};
|
122
|
+
declare function setNextBlockBaseFeePerGas(client: TestClient, { baseFeePerGas }: SetNextBlockBaseFeePerGasArgs): Promise<void>;
|
123
|
+
|
124
|
+
type SetNextBlockTimestampArgs = {
|
125
|
+
/** The timestamp (in seconds). */
|
126
|
+
timestamp: bigint;
|
127
|
+
};
|
128
|
+
declare function setNextBlockTimestamp(client: TestClient, { timestamp }: SetNextBlockTimestampArgs): Promise<void>;
|
129
|
+
|
130
|
+
type SetNonceArgs = {
|
131
|
+
/** The account address. */
|
132
|
+
address: Address;
|
133
|
+
/** The nonce to set. */
|
134
|
+
nonce: number;
|
135
|
+
};
|
136
|
+
declare function setNonce(client: TestClient, { address, nonce }: SetNonceArgs): Promise<void>;
|
137
|
+
|
138
|
+
type SetStorageAtArgs = {
|
139
|
+
/** The account address. */
|
140
|
+
address: Address;
|
141
|
+
/** The storage slot (index). Can either be a number or hash value. */
|
142
|
+
index: number | Hash;
|
143
|
+
/** The value to store as a 32 byte hex string. */
|
144
|
+
value: Hex;
|
145
|
+
};
|
146
|
+
declare function setStorageAt(client: TestClient, { address, index, value }: SetStorageAtArgs): Promise<void>;
|
147
|
+
|
148
|
+
declare function snapshot(client: TestClient): Promise<`0x${string}`>;
|
149
|
+
|
150
|
+
type StopImpersonatingAccountArgs = {
|
151
|
+
/** The account to impersonate. */
|
152
|
+
address: Address;
|
153
|
+
};
|
154
|
+
declare function stopImpersonatingAccount(client: TestClient, { address }: StopImpersonatingAccountArgs): Promise<void>;
|
155
|
+
|
156
|
+
export { sendUnsignedTransaction as A, setAutomine as B, setBalance as C, DropTransactionArgs as D, setBlockGasLimit as E, setBlockTimestampInterval as F, setCode as G, setCoinbase as H, ImpersonateAccountArgs as I, setIntervalMining as J, setLoggingEnabled as K, setMinGasPrice as L, MineArgs as M, setNextBlockBaseFeePerGas as N, setNextBlockTimestamp as O, setNonce as P, setStorageAt as Q, ResetArgs as R, SendUnsignedTransactionArgs as S, snapshot as T, stopImpersonatingAccount as U, IncreaseTimeArgs as a, RevertArgs as b, SendUnsignedTransactionResponse as c, SetBalanceArgs as d, SetBlockGasLimitArgs as e, SetCodeArgs as f, SetCoinbaseArgs as g, SetIntervalMiningArgs as h, SetMinGasPriceArgs as i, SetBlockTimestampIntervalArgs as j, SetNextBlockTimestampArgs as k, SetNextBlockBaseFeePerGasArgs as l, SetNonceArgs as m, SetStorageAtArgs as n, StopImpersonatingAccountArgs as o, dropTransaction as p, getAutomine as q, getTxpoolContent as r, getTxpoolStatus as s, impersonateAccount as t, increaseTime as u, inspectTxpool as v, mine as w, removeBlockTimestampInterval as x, reset as y, revert as z };
|
package/dist/test.d.ts
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
export { D as DropTransactionArgs, I as ImpersonateAccountArgs, a as IncreaseTimeArgs, M as MineArgs, R as ResetArgs, b as RevertArgs, S as SendUnsignedTransactionArgs, c as SendUnsignedTransactionResponse, d as SetBalanceArgs, e as SetBlockGasLimitArgs, j as SetBlockTimestampIntervalArgs, f as SetCodeArgs, g as SetCoinbaseArgs, h as SetIntervalMiningArgs, i as SetMinGasPriceArgs, l as SetNextBlockBaseFeePerGasArgs, k as SetNextBlockTimestampArgs, m as SetNonceArgs, n as SetStorageAtArgs, o as StopImpersonatingAccountArgs, p as dropTransaction, q as getAutomine, r as getTxpoolContent, s as getTxpoolStatus, t as impersonateAccount, u as increaseTime, v as inspectTxpool, w as mine, x as removeBlockTimestampInterval, y as reset, z as revert, A as sendUnsignedTransaction, B as setAutomine, C as setBalance, E as setBlockGasLimit, F as setBlockTimestampInterval, G as setCode, H as setCoinbase, J as setIntervalMining, K as setLoggingEnabled, L as setMinGasPrice, N as setNextBlockBaseFeePerGas, O as setNextBlockTimestamp, P as setNonce, Q as setStorageAt, T as snapshot, U as stopImpersonatingAccount } from './stopImpersonatingAccount-7781842a.js';
|
2
|
+
import './chain-32f56cfa.js';
|
3
|
+
import '@wagmi/chains';
|
4
|
+
import './createTestClient-79498dab.js';
|
5
|
+
import './eip1193-6c485d63.js';
|
6
|
+
import './createClient-5d316c7e.js';
|
package/dist/test.js
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
var _chunkW7BWWAC4js = require('./chunk-W7BWWAC4.js');
|
30
|
+
require('./chunk-O2GYLJVD.js');
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
exports.dropTransaction = _chunkW7BWWAC4js.dropTransaction; exports.getAutomine = _chunkW7BWWAC4js.getAutomine; exports.getTxpoolContent = _chunkW7BWWAC4js.getTxpoolContent; exports.getTxpoolStatus = _chunkW7BWWAC4js.getTxpoolStatus; exports.impersonateAccount = _chunkW7BWWAC4js.impersonateAccount; exports.increaseTime = _chunkW7BWWAC4js.increaseTime; exports.inspectTxpool = _chunkW7BWWAC4js.inspectTxpool; exports.mine = _chunkW7BWWAC4js.mine; exports.removeBlockTimestampInterval = _chunkW7BWWAC4js.removeBlockTimestampInterval; exports.reset = _chunkW7BWWAC4js.reset; exports.revert = _chunkW7BWWAC4js.revert; exports.sendUnsignedTransaction = _chunkW7BWWAC4js.sendUnsignedTransaction; exports.setAutomine = _chunkW7BWWAC4js.setAutomine; exports.setBalance = _chunkW7BWWAC4js.setBalance; exports.setBlockGasLimit = _chunkW7BWWAC4js.setBlockGasLimit; exports.setBlockTimestampInterval = _chunkW7BWWAC4js.setBlockTimestampInterval; exports.setCode = _chunkW7BWWAC4js.setCode; exports.setCoinbase = _chunkW7BWWAC4js.setCoinbase; exports.setIntervalMining = _chunkW7BWWAC4js.setIntervalMining; exports.setLoggingEnabled = _chunkW7BWWAC4js.setLoggingEnabled; exports.setMinGasPrice = _chunkW7BWWAC4js.setMinGasPrice; exports.setNextBlockBaseFeePerGas = _chunkW7BWWAC4js.setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = _chunkW7BWWAC4js.setNextBlockTimestamp; exports.setNonce = _chunkW7BWWAC4js.setNonce; exports.setStorageAt = _chunkW7BWWAC4js.setStorageAt; exports.snapshot = _chunkW7BWWAC4js.snapshot; exports.stopImpersonatingAccount = _chunkW7BWWAC4js.stopImpersonatingAccount;
|
60
|
+
//# sourceMappingURL=test.js.map
|
package/dist/test.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/test.mjs
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
import {
|
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 "./chunk-57ZOFERP.mjs";
|
30
|
+
import "./chunk-62VTYU2V.mjs";
|
31
|
+
export {
|
32
|
+
dropTransaction,
|
33
|
+
getAutomine,
|
34
|
+
getTxpoolContent,
|
35
|
+
getTxpoolStatus,
|
36
|
+
impersonateAccount,
|
37
|
+
increaseTime,
|
38
|
+
inspectTxpool,
|
39
|
+
mine,
|
40
|
+
removeBlockTimestampInterval,
|
41
|
+
reset,
|
42
|
+
revert,
|
43
|
+
sendUnsignedTransaction,
|
44
|
+
setAutomine,
|
45
|
+
setBalance,
|
46
|
+
setBlockGasLimit,
|
47
|
+
setBlockTimestampInterval,
|
48
|
+
setCode,
|
49
|
+
setCoinbase,
|
50
|
+
setIntervalMining,
|
51
|
+
setLoggingEnabled,
|
52
|
+
setMinGasPrice,
|
53
|
+
setNextBlockBaseFeePerGas,
|
54
|
+
setNextBlockTimestamp,
|
55
|
+
setNonce,
|
56
|
+
setStorageAt,
|
57
|
+
snapshot,
|
58
|
+
stopImpersonatingAccount
|
59
|
+
};
|
60
|
+
//# sourceMappingURL=test.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { J as Chain, Q as ExtractFormatter, V as Formatters, K as Formatter, N as Formatted, q as RpcTransactionRequest, s as TransactionRequest } from './chain-32f56cfa.js';
|
2
|
+
|
3
|
+
type TransactionRequestFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionRequest', NonNullable<Formatters['transactionRequest']>>;
|
4
|
+
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, RpcTransactionRequest>;
|
5
|
+
declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
|
6
|
+
declare const defineTransactionRequest: <TFormat extends Formatter<Partial<TransactionRequest<bigint, number>>, Partial<RpcTransactionRequest> & {
|
7
|
+
[key: string]: unknown;
|
8
|
+
}>, TExclude extends ("data" | "value" | "gas" | "from" | "nonce" | "to" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
|
9
|
+
exclude?: TExclude | undefined;
|
10
|
+
format?: TFormat | undefined;
|
11
|
+
}) => (data: Partial<TransactionRequest<bigint, number>> & {
|
12
|
+
[key: string]: unknown;
|
13
|
+
}) => RpcTransactionRequest & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
|
14
|
+
|
15
|
+
export { FormattedTransactionRequest as F, TransactionRequestFormatter as T, defineTransactionRequest as d, formatTransactionRequest as f };
|
package/dist/utils/index.d.ts
CHANGED
@@ -1,12 +1,38 @@
|
|
1
|
-
export {
|
2
|
-
|
3
|
-
export { B as BlockFormatter,
|
4
|
-
|
5
|
-
import 'abitype';
|
6
|
-
|
7
|
-
import '../
|
1
|
+
export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeFunctionDataArgs, c as DecodeFunctionResultArgs, d as DecodeFunctionResultResponse, E as EncodeAbiArgs, e as EncodeDeployDataArgs, f as EncodeErrorResultArgs, g as EncodeEventTopicsArgs, h as EncodeFunctionDataArgs, i as EncodeFunctionResultArgs, l as EncodeRlpResponse, G as GetContractAddressOptions, k as GetCreate2AddressOptions, j as GetCreateAddressOptions, o as boolToBytes, p as boolToHex, q as bytesToBigint, r as bytesToBool, m as bytesToHex, s as bytesToNumber, n as bytesToString, t as decodeAbi, u as decodeBytes, v as decodeErrorResult, w as decodeFunctionData, x as decodeFunctionResult, y as decodeHex, z as decodeRlp, A as encodeAbi, B as encodeBytes, C as encodeDeployData, F as encodeErrorResult, H as encodeEventTopics, I as encodeFunctionData, J as encodeFunctionResult, K as encodeHex, L as encodeRlp, M as etherUnits, U as formatEther, a9 as formatGwei, aa as formatUnit, N as getAddress, O as getContractAddress, Q as getCreate2Address, P as getCreateAddress, R as getEventSignature, S as getFunctionSignature, T as gweiUnits, Z as hexToBigInt, _ as hexToBool, $ as hexToBytes, ab as hexToNumber, a0 as hexToString, V as isAddress, W as isAddressEqual, X as isBytes, Y as isHex, a1 as keccak256, a2 as numberToBytes, ac as numberToHex, a3 as pad, a4 as padBytes, a5 as padHex, a6 as parseEther, a7 as parseGwei, a8 as parseUnit, ad as size, ae as slice, af as sliceBytes, ag as sliceHex, ah as stringToBytes, ai as stringToHex, aj as trim, ak as weiUnits } from '../parseGwei-4308ad80.js';
|
2
|
+
import { A as AbiItem } from '../contract-9af4608b.js';
|
3
|
+
export { B as BlockFormatter, F as FormattedBlock, i as FormattedTransactionReceipt, T as TransactionReceiptFormatter, k as defineBlock, l as defineTransactionReceipt, g as formatBlock } from '../contract-9af4608b.js';
|
4
|
+
import * as abitype_dist_abi_b1bae27f from 'abitype/dist/abi-b1bae27f';
|
5
|
+
import { Abi } from 'abitype';
|
6
|
+
export { d as defineChain } from '../chain-f12cdc7f.js';
|
7
|
+
import { A as Address, K as Formatter } from '../chain-32f56cfa.js';
|
8
|
+
export { Q as ExtractFormatter, N as Formatted, E as FormattedTransaction, P as TransactionFormatter, _ as defineFormatter, $ as defineTransaction, a0 as format, G as formatTransaction, I as transactionType } from '../chain-32f56cfa.js';
|
9
|
+
export { F as FormattedTransactionRequest, T as TransactionRequestFormatter, d as defineTransactionRequest, f as formatTransactionRequest } from '../transactionRequest-341b6ed2.js';
|
10
|
+
export { r as rpc } from '../rpc-26932bae.js';
|
8
11
|
import '@wagmi/chains';
|
9
12
|
|
13
|
+
declare function formatAbiItemWithArgs({ abiItem, args, includeFunctionName, includeName, }: {
|
14
|
+
abiItem: AbiItem;
|
15
|
+
args: readonly unknown[];
|
16
|
+
includeFunctionName?: boolean;
|
17
|
+
includeName?: boolean;
|
18
|
+
}): string | undefined;
|
19
|
+
|
20
|
+
declare function formatAbiItem(abiItem: AbiItem, { includeName }?: {
|
21
|
+
includeName?: boolean;
|
22
|
+
}): string;
|
23
|
+
|
24
|
+
declare function getAbiItem({ abi, name }: {
|
25
|
+
abi: Abi;
|
26
|
+
name: string;
|
27
|
+
}): abitype_dist_abi_b1bae27f.q | abitype_dist_abi_b1bae27f.p | abitype_dist_abi_b1bae27f.o | undefined;
|
28
|
+
|
29
|
+
declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest): TRequest;
|
30
|
+
|
31
|
+
declare function extractFunctionParts(def: string): {
|
32
|
+
type: string | undefined;
|
33
|
+
name: string | undefined;
|
34
|
+
params: string | undefined;
|
35
|
+
};
|
10
36
|
declare function extractFunctionName(def: string): string | undefined;
|
11
37
|
declare function extractFunctionParams(def: string): {
|
12
38
|
indexed?: boolean | undefined;
|
@@ -15,4 +41,21 @@ declare function extractFunctionParams(def: string): {
|
|
15
41
|
}[] | undefined;
|
16
42
|
declare function extractFunctionType(def: string): string | undefined;
|
17
43
|
|
18
|
-
|
44
|
+
declare function getContractError(err: unknown, { abi, address, args, functionName, sender, }: {
|
45
|
+
abi: Abi;
|
46
|
+
args: any;
|
47
|
+
address?: Address;
|
48
|
+
functionName: string;
|
49
|
+
sender?: Address;
|
50
|
+
}): unknown;
|
51
|
+
|
52
|
+
/**
|
53
|
+
* @description Picks out the keys from `value` that exist in the formatter.
|
54
|
+
*/
|
55
|
+
declare function extract(value: Record<string, unknown>, { formatter }: {
|
56
|
+
formatter?: Formatter;
|
57
|
+
}): {};
|
58
|
+
|
59
|
+
declare function stringify(value: unknown): string;
|
60
|
+
|
61
|
+
export { buildRequest, extract, extractFunctionName, extractFunctionParams, extractFunctionParts, extractFunctionType, formatAbiItem, formatAbiItemWithArgs, getAbiItem, getContractError, stringify };
|