viem 0.0.1-cjs.10 → 0.0.1-sushi.26
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/contract/package.json +4 -0
- package/dist/call-ac509982.d.ts +23 -0
- package/dist/chain-c4ccb458.d.ts +5 -0
- package/dist/{rpc-b77c5aee.d.ts → chain-f16512e8.d.ts} +97 -17
- package/dist/chains.d.ts +1303 -74
- package/dist/chains.js +81 -85
- package/dist/chains.js.map +1 -0
- package/dist/chains.mjs +121 -125
- package/dist/chains.mjs.map +1 -0
- package/dist/chunk-2PFNLP3F.js +192 -0
- package/dist/chunk-2PFNLP3F.js.map +1 -0
- package/dist/chunk-5ND4P6QL.mjs +192 -0
- package/dist/chunk-5ND4P6QL.mjs.map +1 -0
- package/dist/{chunk-5ZBNF5WM.js → chunk-NXCI5KQC.js} +769 -359
- package/dist/chunk-NXCI5KQC.js.map +1 -0
- package/dist/{chunk-HLVCJ7RV.mjs → chunk-O7T5NQLB.mjs} +484 -477
- package/dist/chunk-O7T5NQLB.mjs.map +1 -0
- package/dist/{chunk-2FDH6XP5.mjs → chunk-SD5X7F4U.mjs} +777 -367
- package/dist/chunk-SD5X7F4U.mjs.map +1 -0
- package/dist/{chunk-46ZFLVHC.js → chunk-UTL6F7UN.js} +519 -512
- package/dist/chunk-UTL6F7UN.js.map +1 -0
- package/dist/contract-9e76e561.d.ts +166 -0
- package/dist/contract.d.ts +123 -0
- package/dist/contract.js +53 -0
- package/dist/contract.js.map +1 -0
- package/dist/contract.mjs +53 -0
- package/dist/contract.mjs.map +1 -0
- package/dist/createClient-68ee4bb4.d.ts +62 -0
- package/dist/createPublicClient-b732194e.d.ts +19 -0
- package/dist/createTestClient-dedf321e.d.ts +34 -0
- package/dist/createWalletClient-75813d83.d.ts +30 -0
- package/dist/decodeErrorResult-0b934d23.d.ts +16 -0
- package/dist/{eip1193-020a6f13.d.ts → eip1193-6f9ba163.d.ts} +12 -9
- package/dist/ens.d.ts +82 -0
- package/dist/ens.js +216 -0
- package/dist/ens.js.map +1 -0
- package/dist/ens.mjs +216 -0
- package/dist/ens.mjs.map +1 -0
- package/dist/getAbiItem-c8e6e7d4.d.ts +97 -0
- package/dist/index.d.ts +128 -33
- package/dist/index.js +240 -244
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +257 -261
- package/dist/index.mjs.map +1 -0
- package/dist/public.d.ts +353 -0
- package/dist/public.js +58 -0
- package/dist/public.js.map +1 -0
- package/dist/public.mjs +58 -0
- package/dist/public.mjs.map +1 -0
- package/dist/readContract-4f6e2692.d.ts +10 -0
- package/dist/rpc-a5a7f376.d.ts +121 -0
- package/dist/sendTransaction-e713f90c.d.ts +12 -0
- package/dist/test.d.ts +161 -0
- package/dist/test.js +264 -0
- package/dist/test.js.map +1 -0
- package/dist/test.mjs +264 -0
- package/dist/test.mjs.map +1 -0
- package/dist/transactionReceipt-2a86c7c7.d.ts +26 -0
- package/dist/transactionRequest-c7794f5e.d.ts +15 -0
- package/dist/utils/index.d.ts +238 -24
- package/dist/utils/index.js +27 -2
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +30 -5
- package/dist/utils/index.mjs.map +1 -0
- package/dist/wallet.d.ts +42 -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/watchEvent-c346c12d.d.ts +41 -0
- package/dist/window.d.ts +3 -2
- package/dist/window.js +1 -1
- package/dist/window.js.map +1 -0
- package/dist/window.mjs +1 -0
- package/dist/window.mjs.map +1 -0
- package/ens/package.json +4 -0
- package/package.json +40 -72
- package/src/_test/abis.ts +1420 -0
- package/src/_test/bench.ts +15 -0
- package/src/_test/constants.ts +63 -0
- package/src/_test/generated.ts +128 -0
- package/src/_test/globalSetup.ts +11 -0
- package/src/_test/index.ts +25 -0
- package/src/_test/setup.ts +8 -0
- package/src/_test/utils.ts +155 -0
- package/src/actions/ens/getEnsAddress.bench.ts +26 -0
- package/src/actions/ens/getEnsAddress.test.ts +97 -0
- package/src/actions/ens/getEnsAddress.ts +122 -0
- package/src/actions/ens/getEnsName.bench.ts +30 -0
- package/src/actions/ens/getEnsName.test.ts +101 -0
- package/src/actions/ens/getEnsName.ts +106 -0
- package/src/actions/ens/index.test.ts +12 -0
- package/src/actions/ens/index.ts +3 -0
- package/src/actions/index.test.ts +81 -0
- package/src/actions/index.ts +182 -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 +277 -0
- package/src/actions/public/createEventFilter.ts +93 -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/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 +383 -0
- package/src/actions/public/getFilterChanges.ts +23 -0
- package/src/actions/public/getFilterLogs.test.ts +297 -0
- package/src/actions/public/getFilterLogs.ts +20 -0
- package/src/actions/public/getGasPrice.bench.ts +19 -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 +306 -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 +146 -0
- package/src/actions/public/multicall.test.ts +452 -0
- package/src/actions/public/multicall.ts +108 -0
- package/src/actions/public/readContract.test.ts +328 -0
- package/src/actions/public/readContract.ts +73 -0
- package/src/actions/public/simulateContract.bench.ts +41 -0
- package/src/actions/public/simulateContract.test.ts +410 -0
- package/src/actions/public/simulateContract.ts +91 -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 +305 -0
- package/src/actions/public/watchContractEvent.ts +108 -0
- package/src/actions/public/watchEvent.test.ts +195 -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 +26 -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 +29 -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/deployContract.test.ts +55 -0
- package/src/actions/wallet/deployContract.ts +38 -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 +21 -0
- package/src/actions/wallet/index.ts +36 -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 +61 -0
- package/src/actions/wallet/signMessage.ts +35 -0
- package/src/actions/wallet/switchChain.test.ts +21 -0
- package/src/actions/wallet/switchChain.ts +19 -0
- package/src/actions/wallet/watchAsset.test.ts +40 -0
- package/src/actions/wallet/watchAsset.ts +16 -0
- package/src/actions/wallet/writeContract.test.ts +84 -0
- package/src/actions/wallet/writeContract.ts +47 -0
- package/src/chains.test.ts +439 -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 +393 -0
- package/src/clients/transports/fallback.ts +58 -0
- package/src/clients/transports/http.test.ts +109 -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 +118 -0
- package/src/constants/abis.test.ts +53 -0
- package/src/constants/abis.ts +44 -0
- package/src/constants/index.test.ts +14 -0
- package/src/constants/index.ts +3 -0
- package/src/constants/solidity.test.ts +41 -0
- package/src/constants/solidity.ts +35 -0
- package/src/contract.test.ts +32 -0
- package/src/contract.ts +68 -0
- package/src/ens.test.ts +15 -0
- package/src/ens.ts +8 -0
- package/src/errors/abi.test.ts +81 -0
- package/src/errors/abi.ts +254 -0
- package/src/errors/address.test.ts +14 -0
- package/src/errors/address.ts +9 -0
- package/src/errors/base.test.ts +114 -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/chain.test.ts +46 -0
- package/src/errors/chain.ts +33 -0
- package/src/errors/contract.test.ts +233 -0
- package/src/errors/contract.ts +178 -0
- package/src/errors/data.ts +20 -0
- package/src/errors/encoding.ts +60 -0
- package/src/errors/index.ts +82 -0
- package/src/errors/log.ts +8 -0
- package/src/errors/request.test.ts +330 -0
- package/src/errors/request.ts +163 -0
- package/src/errors/rpc.test.ts +87 -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 +11 -0
- package/src/errors/transport.ts +12 -0
- package/src/index.test.ts +116 -0
- package/src/index.ts +132 -0
- package/src/public.test.ts +36 -0
- package/src/public.ts +76 -0
- package/src/test.test.ts +38 -0
- package/src/test.ts +52 -0
- package/src/types/block.ts +71 -0
- package/src/types/chain.ts +6 -0
- package/src/types/contract.ts +497 -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 +84 -0
- package/src/types/log.ts +22 -0
- package/src/types/misc.ts +5 -0
- package/src/types/multicall.ts +82 -0
- package/src/types/rpc.ts +35 -0
- package/src/types/transaction.ts +145 -0
- package/src/types/utils.ts +88 -0
- package/src/types/window.ts +9 -0
- package/src/utils/abi/decodeAbi.bench.ts +135 -0
- package/src/utils/abi/decodeAbi.test.ts +1614 -0
- package/src/utils/abi/decodeAbi.ts +300 -0
- package/src/utils/abi/decodeDeployData.test.ts +151 -0
- package/src/utils/abi/decodeDeployData.ts +44 -0
- package/src/utils/abi/decodeErrorResult.test.ts +230 -0
- package/src/utils/abi/decodeErrorResult.ts +45 -0
- package/src/utils/abi/decodeEventLog.test.ts +542 -0
- package/src/utils/abi/decodeEventLog.ts +107 -0
- package/src/utils/abi/decodeFunctionData.test.ts +138 -0
- package/src/utils/abi/decodeFunctionData.ts +32 -0
- package/src/utils/abi/decodeFunctionResult.test.ts +333 -0
- package/src/utils/abi/decodeFunctionResult.ts +57 -0
- package/src/utils/abi/encodeAbi.bench.ts +163 -0
- package/src/utils/abi/encodeAbi.test.ts +1447 -0
- package/src/utils/abi/encodeAbi.ts +273 -0
- package/src/utils/abi/encodeDeployData.test.ts +124 -0
- package/src/utils/abi/encodeDeployData.ts +40 -0
- package/src/utils/abi/encodeErrorResult.test.ts +192 -0
- package/src/utils/abi/encodeErrorResult.ts +47 -0
- package/src/utils/abi/encodeEventTopics.test.ts +345 -0
- package/src/utils/abi/encodeEventTopics.ts +75 -0
- package/src/utils/abi/encodeFunctionData.test.ts +138 -0
- package/src/utils/abi/encodeFunctionData.ts +42 -0
- package/src/utils/abi/encodeFunctionResult.test.ts +279 -0
- package/src/utils/abi/encodeFunctionResult.ts +41 -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.test.ts +547 -0
- package/src/utils/abi/getAbiItem.ts +95 -0
- package/src/utils/abi/index.test.ts +24 -0
- package/src/utils/abi/index.ts +48 -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 +428 -0
- package/src/utils/buildRequest.ts +72 -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 +282 -0
- package/src/utils/contract/getContractError.ts +58 -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 +30 -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 +34 -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 +29 -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 +49 -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/ens/index.test.ts +14 -0
- package/src/utils/ens/index.ts +7 -0
- package/src/utils/ens/labelhash.test.ts +55 -0
- package/src/utils/ens/labelhash.ts +16 -0
- package/src/utils/ens/namehash.test.ts +65 -0
- package/src/utils/ens/namehash.ts +28 -0
- package/src/utils/ens/normalize.bench.ts +14 -0
- package/src/utils/ens/normalize.test.ts +35 -0
- package/src/utils/ens/normalize.ts +14 -0
- package/src/utils/ens/packetToBytes.test.ts +11 -0
- package/src/utils/ens/packetToBytes.ts +29 -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 +21 -0
- package/src/utils/index.test.ts +111 -0
- package/src/utils/index.ts +142 -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 +990 -0
- package/src/utils/rpc.ts +294 -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 +21 -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 +21 -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.test.ts +19 -0
- package/src/wallet.ts +23 -0
- package/src/window.ts +1 -0
- package/wallet/package.json +4 -0
- package/actions/package.json +0 -4
- package/clients/package.json +0 -4
- package/dist/actions/index.d.ts +0 -8
- package/dist/actions/index.js +0 -125
- package/dist/actions/index.mjs +0 -125
- package/dist/chunk-CWCWWGBC.mjs +0 -258
- package/dist/chunk-SGTIBKHG.js +0 -258
- package/dist/clients/index.d.ts +0 -7
- package/dist/clients/index.js +0 -23
- package/dist/clients/index.mjs +0 -23
- package/dist/createWalletClient-d612fe08.d.ts +0 -130
- package/dist/parseGwei-7c87ff41.d.ts +0 -278
- package/dist/rpc-26932bae.d.ts +0 -61
- package/dist/transactionRequest-08d30731.d.ts +0 -132
- package/dist/watchAsset-bc6373f4.d.ts +0 -534
- package/dist/webSocket-7f88e9e0.d.ts +0 -83
@@ -1,534 +0,0 @@
|
|
1
|
-
import { Abi } from 'abitype';
|
2
|
-
import { Chain, Formatter } from './chains.js';
|
3
|
-
import { H as Hex, A as Address, b as BlockTag, M as MergeIntersectionProperties, v as TransactionRequest, K as EstimateGasParameters, a as Hash, F as FeeHistory, L as Log, r as RpcTransactionReceipt, T as TransactionReceipt, N as TransactionType, D as Transaction, q as RpcTransaction, Q as Quantity, B as ByteArray } from './rpc-b77c5aee.js';
|
4
|
-
import { T as TransactionRequestFormatter, e as Formatted, E as ExtractFunctionNameFromAbi, G as GetValue, g as ExtractArgsFromAbi, h as ExtractResultFromAbi, F as FormattedBlock, B as BlockFormatter, a as FormattedTransaction, i as TransactionFormatter, j as FormattedTransactionReceipt, k as TransactionReceiptFormatter, l as ExtractFormatter } from './transactionRequest-08d30731.js';
|
5
|
-
import { P as PublicClient, T as TestClient, W as WalletClient } from './createWalletClient-d612fe08.js';
|
6
|
-
import { W as WalletPermission, a as WatchAssetParams } from './eip1193-020a6f13.js';
|
7
|
-
|
8
|
-
type FilterType = 'transaction' | 'block' | 'event';
|
9
|
-
type Filter<TFilterType extends FilterType = 'event'> = {
|
10
|
-
id: Hex;
|
11
|
-
type: TFilterType;
|
12
|
-
};
|
13
|
-
|
14
|
-
type FormattedCall<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
|
15
|
-
type CallArgs<TChain extends Chain = Chain> = FormattedCall<TransactionRequestFormatter<TChain>> & {
|
16
|
-
chain?: TChain;
|
17
|
-
from?: Address;
|
18
|
-
} & ({
|
19
|
-
/** The balance of the account at a block number. */
|
20
|
-
blockNumber?: bigint;
|
21
|
-
blockTag?: never;
|
22
|
-
} | {
|
23
|
-
blockNumber?: never;
|
24
|
-
/** The balance of the account at a block tag. */
|
25
|
-
blockTag?: BlockTag;
|
26
|
-
});
|
27
|
-
type CallResponse = {
|
28
|
-
data: Hex | undefined;
|
29
|
-
};
|
30
|
-
declare function call<TChain extends Chain>(client: PublicClient, { blockNumber, blockTag, chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: CallArgs<TChain>): Promise<CallResponse>;
|
31
|
-
|
32
|
-
type CallContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = Omit<CallArgs<TChain>, 'from' | 'to' | 'data' | 'value'> & {
|
33
|
-
address: Address;
|
34
|
-
abi: TAbi;
|
35
|
-
from?: Address;
|
36
|
-
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
37
|
-
value?: GetValue<TAbi, TFunctionName, CallArgs<TChain>['value']>;
|
38
|
-
} & ExtractArgsFromAbi<TAbi, TFunctionName>;
|
39
|
-
type CallContractResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ExtractResultFromAbi<TAbi, TFunctionName>;
|
40
|
-
declare function callContract<TChain extends Chain, TAbi extends Abi = Abi, TFunctionName extends string = any>(client: PublicClient, { abi, address, args, functionName, ...callRequest }: CallContractArgs<TChain, TAbi, TFunctionName>): Promise<CallContractResponse<TAbi, TFunctionName>>;
|
41
|
-
|
42
|
-
type CreatePendingTransactionFilterResponse = Filter<'transaction'>;
|
43
|
-
declare function createPendingTransactionFilter(client: PublicClient): Promise<CreatePendingTransactionFilterResponse>;
|
44
|
-
|
45
|
-
type CreateBlockFilterResponse = Filter<'block'>;
|
46
|
-
declare function createBlockFilter(client: PublicClient): Promise<CreateBlockFilterResponse>;
|
47
|
-
|
48
|
-
type EstimateGasArgs = EstimateGasParameters & ({
|
49
|
-
/** The balance of the account at a block number. */
|
50
|
-
blockNumber?: bigint;
|
51
|
-
blockTag?: never;
|
52
|
-
} | {
|
53
|
-
blockNumber?: never;
|
54
|
-
/** The balance of the account at a block tag. */
|
55
|
-
blockTag?: BlockTag;
|
56
|
-
});
|
57
|
-
type EstimateGasResponse = bigint;
|
58
|
-
/**
|
59
|
-
* @description Estimates the gas necessary to complete a transaction without submitting it to the network.
|
60
|
-
*/
|
61
|
-
declare function estimateGas(client: PublicClient, { blockNumber, blockTag, data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, value, }: EstimateGasArgs): Promise<EstimateGasResponse>;
|
62
|
-
|
63
|
-
type GetBalanceArgs = {
|
64
|
-
/** The address of the account. */
|
65
|
-
address: Address;
|
66
|
-
} & ({
|
67
|
-
/** The balance of the account at a block number. */
|
68
|
-
blockNumber?: bigint;
|
69
|
-
blockTag?: never;
|
70
|
-
} | {
|
71
|
-
blockNumber?: never;
|
72
|
-
/** The balance of the account at a block tag. */
|
73
|
-
blockTag?: BlockTag;
|
74
|
-
});
|
75
|
-
type GetBalanceResponse = bigint;
|
76
|
-
/**
|
77
|
-
* @description Returns the balance of an address in wei.
|
78
|
-
*/
|
79
|
-
declare function getBalance(client: PublicClient, { address, blockNumber, blockTag }: GetBalanceArgs): Promise<GetBalanceResponse>;
|
80
|
-
|
81
|
-
type GetBlockArgs = {
|
82
|
-
/** Whether or not to include transaction data in the response. */
|
83
|
-
includeTransactions?: boolean;
|
84
|
-
} & ({
|
85
|
-
/** Hash of the block. */
|
86
|
-
blockHash?: Hash;
|
87
|
-
blockNumber?: never;
|
88
|
-
blockTag?: never;
|
89
|
-
} | {
|
90
|
-
blockHash?: never;
|
91
|
-
/** The block number. */
|
92
|
-
blockNumber?: bigint;
|
93
|
-
blockTag?: never;
|
94
|
-
} | {
|
95
|
-
blockHash?: never;
|
96
|
-
blockNumber?: never;
|
97
|
-
/** The block tag. Defaults to 'latest'. */
|
98
|
-
blockTag?: BlockTag;
|
99
|
-
});
|
100
|
-
type GetBlockResponse<TChain extends Chain = Chain> = FormattedBlock<BlockFormatter<TChain>>;
|
101
|
-
declare function getBlock<TChain extends Chain>(client: PublicClient<any, TChain>, { blockHash, blockNumber, blockTag, includeTransactions, }?: GetBlockArgs): Promise<GetBlockResponse<TChain>>;
|
102
|
-
|
103
|
-
type GetBlockNumberArgs = {
|
104
|
-
/** The maximum age (in ms) of the cached value. */
|
105
|
-
maxAge?: number;
|
106
|
-
};
|
107
|
-
type GetBlockNumberResponse = bigint;
|
108
|
-
declare function getBlockNumberCache(id: string): {
|
109
|
-
clear: () => void;
|
110
|
-
promise: {
|
111
|
-
clear: () => boolean;
|
112
|
-
get: () => Promise<unknown> | undefined;
|
113
|
-
set: (data: Promise<unknown>) => Map<string, Promise<unknown>>;
|
114
|
-
};
|
115
|
-
response: {
|
116
|
-
clear: () => boolean;
|
117
|
-
get: () => {
|
118
|
-
created: Date;
|
119
|
-
data: unknown;
|
120
|
-
} | undefined;
|
121
|
-
set: (data: {
|
122
|
-
created: Date;
|
123
|
-
data: unknown;
|
124
|
-
}) => Map<string, {
|
125
|
-
created: Date;
|
126
|
-
data: unknown;
|
127
|
-
}>;
|
128
|
-
};
|
129
|
-
};
|
130
|
-
/**
|
131
|
-
* @description Returns the number of the most recent block seen.
|
132
|
-
*/
|
133
|
-
declare function getBlockNumber(client: PublicClient, { maxAge }?: GetBlockNumberArgs): Promise<GetBlockNumberResponse>;
|
134
|
-
|
135
|
-
type GetBlockTransactionCountArgs = {
|
136
|
-
/** Hash of the block. */
|
137
|
-
blockHash?: Hash;
|
138
|
-
blockNumber?: never;
|
139
|
-
blockTag?: never;
|
140
|
-
} | {
|
141
|
-
blockHash?: never;
|
142
|
-
/** The block number. */
|
143
|
-
blockNumber?: bigint;
|
144
|
-
blockTag?: never;
|
145
|
-
} | {
|
146
|
-
blockHash?: never;
|
147
|
-
blockNumber?: never;
|
148
|
-
/** The block tag. Defaults to 'latest'. */
|
149
|
-
blockTag?: BlockTag;
|
150
|
-
};
|
151
|
-
type GetBlockTransactionCountResponse = number;
|
152
|
-
declare function getBlockTransactionCount<TChain extends Chain>(client: PublicClient<any, TChain>, { blockHash, blockNumber, blockTag, }?: GetBlockTransactionCountArgs): Promise<GetBlockTransactionCountResponse>;
|
153
|
-
|
154
|
-
declare function getChainId(client: PublicClient): Promise<number>;
|
155
|
-
|
156
|
-
type GetFeeHistoryArgs = {
|
157
|
-
blockCount: number;
|
158
|
-
rewardPercentiles: number[];
|
159
|
-
} & ({
|
160
|
-
blockNumber?: never;
|
161
|
-
blockTag?: BlockTag;
|
162
|
-
} | {
|
163
|
-
blockNumber?: bigint;
|
164
|
-
blockTag?: never;
|
165
|
-
});
|
166
|
-
type GetFeeHistoryResponse = FeeHistory;
|
167
|
-
/**
|
168
|
-
* @description Returns a collection of historical gas information.
|
169
|
-
*/
|
170
|
-
declare function getFeeHistory(client: PublicClient, { blockCount, blockNumber, blockTag, rewardPercentiles, }: GetFeeHistoryArgs): Promise<GetFeeHistoryResponse>;
|
171
|
-
|
172
|
-
type GetFilterChangesArgs<TFilterType extends FilterType> = {
|
173
|
-
filter: Filter<TFilterType>;
|
174
|
-
};
|
175
|
-
type GetFilterChangesResponse<TFilterType extends FilterType> = TFilterType extends 'event' ? Log[] : Hash[];
|
176
|
-
declare function getFilterChanges<TFilterType extends FilterType>(client: PublicClient, { filter }: GetFilterChangesArgs<TFilterType>): Promise<GetFilterChangesResponse<TFilterType>>;
|
177
|
-
|
178
|
-
type GetFilterLogsArgs = {
|
179
|
-
filter: Filter<'event'>;
|
180
|
-
};
|
181
|
-
type GetFilterLogsResponse = Log[];
|
182
|
-
declare function getFilterLogs<TFilterType extends FilterType>(client: PublicClient, { filter }: GetFilterLogsArgs): Promise<GetFilterLogsResponse>;
|
183
|
-
|
184
|
-
type GetGasPriceResponse = bigint;
|
185
|
-
/**
|
186
|
-
* @description Returns the current price of gas (in wei).
|
187
|
-
*/
|
188
|
-
declare function getGasPrice(client: PublicClient): Promise<GetGasPriceResponse>;
|
189
|
-
|
190
|
-
type GetTransactionArgs = {
|
191
|
-
/** The block hash */
|
192
|
-
blockHash: Hash;
|
193
|
-
blockNumber?: never;
|
194
|
-
blockTag?: never;
|
195
|
-
hash?: never;
|
196
|
-
/** The index of the transaction on the block. */
|
197
|
-
index: number;
|
198
|
-
} | {
|
199
|
-
blockHash?: never;
|
200
|
-
/** The block number */
|
201
|
-
blockNumber: bigint;
|
202
|
-
blockTag?: never;
|
203
|
-
hash?: never;
|
204
|
-
/** The index of the transaction on the block. */
|
205
|
-
index: number;
|
206
|
-
} | {
|
207
|
-
blockHash?: never;
|
208
|
-
blockNumber?: never;
|
209
|
-
/** The block tag. */
|
210
|
-
blockTag: BlockTag;
|
211
|
-
hash?: never;
|
212
|
-
/** The index of the transaction on the block. */
|
213
|
-
index: number;
|
214
|
-
} | {
|
215
|
-
blockHash?: never;
|
216
|
-
blockNumber?: never;
|
217
|
-
blockTag?: never;
|
218
|
-
/** The hash of the transaction. */
|
219
|
-
hash: Hash;
|
220
|
-
index?: number;
|
221
|
-
};
|
222
|
-
type GetTransactionResponse<TChain extends Chain = Chain> = FormattedTransaction<TransactionFormatter<TChain>>;
|
223
|
-
/** @description Returns information about a transaction given a hash or block identifier. */
|
224
|
-
declare function getTransaction<TChain extends Chain>(client: PublicClient<any, TChain>, { blockHash, blockNumber, blockTag, hash, index, }: GetTransactionArgs): Promise<GetTransactionResponse<TChain>>;
|
225
|
-
|
226
|
-
type GetTransactionConfirmationsArgs<TChain extends Chain> = {
|
227
|
-
/** The transaction hash. */
|
228
|
-
hash: Hash;
|
229
|
-
transactionReceipt?: never;
|
230
|
-
} | {
|
231
|
-
hash?: never;
|
232
|
-
/** The transaction receipt. */
|
233
|
-
transactionReceipt: FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
|
234
|
-
};
|
235
|
-
type GetTransactionConfirmationsResponse = bigint;
|
236
|
-
declare function getTransactionConfirmations<TChain extends Chain>(client: PublicClient<any, TChain>, { hash, transactionReceipt }: GetTransactionConfirmationsArgs<TChain>): Promise<GetTransactionConfirmationsResponse>;
|
237
|
-
|
238
|
-
type GetTransactionCountArgs = {
|
239
|
-
/** The account address. */
|
240
|
-
address: Address;
|
241
|
-
} & ({
|
242
|
-
/** The block number. */
|
243
|
-
blockNumber?: bigint;
|
244
|
-
blockTag?: never;
|
245
|
-
} | {
|
246
|
-
blockNumber?: never;
|
247
|
-
/** The block tag. Defaults to 'latest'. */
|
248
|
-
blockTag?: BlockTag;
|
249
|
-
});
|
250
|
-
type GetTransactionCountResponse = number;
|
251
|
-
/**
|
252
|
-
* @description Returns the number of transactions an account has broadcast / sent.
|
253
|
-
*/
|
254
|
-
declare function getTransactionCount(client: PublicClient, { address, blockTag, blockNumber }: GetTransactionCountArgs): Promise<GetTransactionCountResponse>;
|
255
|
-
|
256
|
-
type GetTransactionReceiptArgs = {
|
257
|
-
/** The hash of the transaction. */
|
258
|
-
hash: Hash;
|
259
|
-
};
|
260
|
-
type GetTransactionReceiptResponse<TChain extends Chain = Chain> = FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
|
261
|
-
declare function getTransactionReceipt<TChain extends Chain>(client: PublicClient<any, TChain>, { hash }: GetTransactionReceiptArgs): Promise<Formatted<ExtractFormatter<TChain, "transactionReceipt", Formatter<RpcTransactionReceipt, TransactionReceipt<bigint, number, "success" | "reverted", TransactionType>>>, TransactionReceipt<bigint, number, "success" | "reverted", TransactionType>, false>>;
|
262
|
-
|
263
|
-
type UninstallFilterArgs = {
|
264
|
-
filter: Filter<any>;
|
265
|
-
};
|
266
|
-
type UninstallFilterResponse = boolean;
|
267
|
-
declare function uninstallFilter(client: PublicClient, { filter }: UninstallFilterArgs): Promise<UninstallFilterResponse>;
|
268
|
-
|
269
|
-
type ReplacementReason = 'cancelled' | 'replaced' | 'repriced';
|
270
|
-
type ReplacementResponse<TChain extends Chain = Chain> = {
|
271
|
-
reason: ReplacementReason;
|
272
|
-
replacedTransaction: Transaction;
|
273
|
-
transaction: Transaction;
|
274
|
-
transactionReceipt: GetTransactionReceiptResponse<TChain>;
|
275
|
-
};
|
276
|
-
type WaitForTransactionReceiptResponse<TChain extends Chain = Chain> = GetTransactionReceiptResponse<TChain>;
|
277
|
-
type WaitForTransactionReceiptArgs<TChain extends Chain = Chain> = {
|
278
|
-
/** The number of confirmations (blocks that have passed) to wait before resolving. */
|
279
|
-
confirmations?: number;
|
280
|
-
/** The hash of the transaction. */
|
281
|
-
hash: Hash;
|
282
|
-
onReplaced?: (response: ReplacementResponse<TChain>) => void;
|
283
|
-
/** Polling frequency (in ms). Defaults to the client's pollingInterval config. */
|
284
|
-
pollingInterval?: number;
|
285
|
-
/** Optional timeout (in milliseconds) to wait before stopping polling. */
|
286
|
-
timeout?: number;
|
287
|
-
};
|
288
|
-
declare function waitForTransactionReceipt<TChain extends Chain>(client: PublicClient<any, TChain>, { confirmations, hash, onReplaced, pollingInterval, timeout, }: WaitForTransactionReceiptArgs<TChain>): Promise<WaitForTransactionReceiptResponse<TChain>>;
|
289
|
-
|
290
|
-
type OnBlockNumberResponse = GetBlockNumberResponse;
|
291
|
-
type OnBlockNumber = (blockNumber: OnBlockNumberResponse, prevBlockNumber: OnBlockNumberResponse | undefined) => void;
|
292
|
-
type WatchBlockNumberArgs = {
|
293
|
-
/** Whether or not to emit the missed block numbers to the callback. */
|
294
|
-
emitMissed?: boolean;
|
295
|
-
/** Whether or not to emit the latest block number to the callback when the subscription opens. */
|
296
|
-
emitOnBegin?: boolean;
|
297
|
-
/** The callback to call when a new block number is received. */
|
298
|
-
onBlockNumber: OnBlockNumber;
|
299
|
-
/** The callback to call when an error occurred when trying to get for a new block. */
|
300
|
-
onError?: (error: Error) => void;
|
301
|
-
/** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
|
302
|
-
pollingInterval?: number;
|
303
|
-
};
|
304
|
-
/** @description Watches and returns incoming block numbers. */
|
305
|
-
declare function watchBlockNumber(client: PublicClient, { emitOnBegin, emitMissed, onBlockNumber, onError, pollingInterval, }: WatchBlockNumberArgs): () => void;
|
306
|
-
|
307
|
-
type OnBlockResponse<TChain extends Chain = Chain> = GetBlockResponse<TChain>;
|
308
|
-
type OnBlock<TChain extends Chain = Chain> = (block: OnBlockResponse<TChain>, prevBlock: OnBlockResponse<TChain> | undefined) => void;
|
309
|
-
type WatchBlocksArgs<TChain extends Chain = Chain> = {
|
310
|
-
/** The block tag. Defaults to "latest". */
|
311
|
-
blockTag?: BlockTag;
|
312
|
-
/** Whether or not to emit the missed blocks to the callback. */
|
313
|
-
emitMissed?: boolean;
|
314
|
-
/** Whether or not to emit the block to the callback when the subscription opens. */
|
315
|
-
emitOnBegin?: boolean;
|
316
|
-
/** The callback to call when a new block is received. */
|
317
|
-
onBlock: OnBlock<TChain>;
|
318
|
-
/** The callback to call when an error occurred when trying to get for a new block. */
|
319
|
-
onError?: (error: Error) => void;
|
320
|
-
/** Whether or not to include transaction data in the response. */
|
321
|
-
includeTransactions?: boolean;
|
322
|
-
/** Polling frequency (in ms). Defaults to the client's pollingInterval config. */
|
323
|
-
pollingInterval?: number;
|
324
|
-
};
|
325
|
-
/** @description Watches and returns information for incoming blocks. */
|
326
|
-
declare function watchBlocks<TChain extends Chain>(client: PublicClient<any, TChain>, { blockTag, emitMissed, emitOnBegin, onBlock, onError, includeTransactions, pollingInterval, }: WatchBlocksArgs<TChain>): () => void;
|
327
|
-
|
328
|
-
type OnTransactionsResponse = Hash[];
|
329
|
-
type OnTransactions = (transactions: OnTransactionsResponse) => void;
|
330
|
-
type WatchPendingTransactionsArgs = {
|
331
|
-
/** Whether or not the transaction hashes should be batched on each invocation. */
|
332
|
-
batch?: boolean;
|
333
|
-
/** The callback to call when an error occurred when trying to get for a new block. */
|
334
|
-
onError?: (error: Error) => void;
|
335
|
-
/** The callback to call when new transactions are received. */
|
336
|
-
onTransactions: OnTransactions;
|
337
|
-
/** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
|
338
|
-
pollingInterval?: number;
|
339
|
-
};
|
340
|
-
declare function watchPendingTransactions(client: PublicClient, { batch, onError, onTransactions, pollingInterval, }: WatchPendingTransactionsArgs): () => void;
|
341
|
-
|
342
|
-
type DropTransactionArgs = {
|
343
|
-
/** The hash of the transaction to drop. */
|
344
|
-
hash: Hash;
|
345
|
-
};
|
346
|
-
declare function dropTransaction(client: TestClient, { hash }: DropTransactionArgs): Promise<void>;
|
347
|
-
|
348
|
-
type GetAutomineResponse = boolean;
|
349
|
-
declare function getAutomine(client: TestClient): Promise<GetAutomineResponse>;
|
350
|
-
|
351
|
-
declare function getTxpoolContent(client: TestClient): Promise<{
|
352
|
-
pending: Record<`0x${string}`, Record<string, RpcTransaction>>;
|
353
|
-
queued: Record<`0x${string}`, Record<string, RpcTransaction>>;
|
354
|
-
}>;
|
355
|
-
|
356
|
-
declare function getTxpoolStatus(client: TestClient): Promise<{
|
357
|
-
pending: number;
|
358
|
-
queued: number;
|
359
|
-
}>;
|
360
|
-
|
361
|
-
type ImpersonateAccountArgs = {
|
362
|
-
/** The account to impersonate. */
|
363
|
-
address: Address;
|
364
|
-
};
|
365
|
-
declare function impersonateAccount(client: TestClient, { address }: ImpersonateAccountArgs): Promise<void>;
|
366
|
-
|
367
|
-
type IncreaseTimeArgs = {
|
368
|
-
/** The amount of seconds to jump forward in time. */
|
369
|
-
seconds: number;
|
370
|
-
};
|
371
|
-
declare function increaseTime(client: TestClient, { seconds }: IncreaseTimeArgs): Promise<`0x${string}`>;
|
372
|
-
|
373
|
-
declare function inspectTxpool(client: TestClient): Promise<{
|
374
|
-
pending: Record<`0x${string}`, Record<string, string>>;
|
375
|
-
queued: Record<`0x${string}`, Record<string, string>>;
|
376
|
-
}>;
|
377
|
-
|
378
|
-
type MineArgs = {
|
379
|
-
/** Number of blocks to mine. */
|
380
|
-
blocks: number;
|
381
|
-
/** Interval between each block in seconds. */
|
382
|
-
interval?: number;
|
383
|
-
};
|
384
|
-
declare function mine(client: TestClient, { blocks, interval }: MineArgs): Promise<void>;
|
385
|
-
|
386
|
-
declare function removeBlockTimestampInterval(client: TestClient): Promise<void>;
|
387
|
-
|
388
|
-
type ResetArgs = {
|
389
|
-
/** The block number to reset from. */
|
390
|
-
blockNumber?: bigint;
|
391
|
-
/** The JSON RPC URL. */
|
392
|
-
jsonRpcUrl?: string;
|
393
|
-
};
|
394
|
-
declare function reset(client: TestClient, { blockNumber, jsonRpcUrl }?: ResetArgs): Promise<void>;
|
395
|
-
|
396
|
-
type RevertArgs = {
|
397
|
-
/** The snapshot ID to revert to. */
|
398
|
-
id: Quantity;
|
399
|
-
};
|
400
|
-
declare function revert(client: TestClient, { id }: RevertArgs): Promise<void>;
|
401
|
-
|
402
|
-
type SendUnsignedTransactionArgs = TransactionRequest;
|
403
|
-
type SendUnsignedTransactionResponse = Hash;
|
404
|
-
declare function sendUnsignedTransaction(client: TestClient, request: SendUnsignedTransactionArgs): Promise<SendUnsignedTransactionResponse>;
|
405
|
-
|
406
|
-
declare function setAutomine(client: TestClient, enabled: boolean): Promise<void>;
|
407
|
-
|
408
|
-
type SetBalanceArgs = {
|
409
|
-
/** The account address. */
|
410
|
-
address: Address;
|
411
|
-
/** Amount (in wei) to set */
|
412
|
-
value: bigint;
|
413
|
-
};
|
414
|
-
declare function setBalance(client: TestClient, { address, value }: SetBalanceArgs): Promise<void>;
|
415
|
-
|
416
|
-
type SetBlockGasLimitArgs = {
|
417
|
-
/** Gas limit (in wei). */
|
418
|
-
gasLimit: bigint;
|
419
|
-
};
|
420
|
-
declare function setBlockGasLimit(client: TestClient, { gasLimit }: SetBlockGasLimitArgs): Promise<void>;
|
421
|
-
|
422
|
-
type SetBlockTimestampIntervalArgs = {
|
423
|
-
/** The interval (in seconds). */
|
424
|
-
interval: number;
|
425
|
-
};
|
426
|
-
declare function setBlockTimestampInterval(client: TestClient, { interval }: SetBlockTimestampIntervalArgs): Promise<void>;
|
427
|
-
|
428
|
-
type SetCodeArgs = {
|
429
|
-
/** The account address. */
|
430
|
-
address: Address;
|
431
|
-
/** The bytecode to set */
|
432
|
-
bytecode: Hex;
|
433
|
-
};
|
434
|
-
declare function setCode(client: TestClient, { address, bytecode }: SetCodeArgs): Promise<void>;
|
435
|
-
|
436
|
-
type SetCoinbaseArgs = {
|
437
|
-
/** The coinbase address. */
|
438
|
-
address: Address;
|
439
|
-
};
|
440
|
-
declare function setCoinbase(client: TestClient, { address }: SetCoinbaseArgs): Promise<void>;
|
441
|
-
|
442
|
-
type SetIntervalMiningArgs = {
|
443
|
-
/** The mining interval. */
|
444
|
-
interval: number;
|
445
|
-
};
|
446
|
-
declare function setIntervalMining(client: TestClient, { interval }: SetIntervalMiningArgs): Promise<void>;
|
447
|
-
|
448
|
-
declare function setLoggingEnabled(client: TestClient, enabled: boolean): Promise<void>;
|
449
|
-
|
450
|
-
type SetMinGasPriceArgs = {
|
451
|
-
/** The gas price. */
|
452
|
-
gasPrice: bigint;
|
453
|
-
};
|
454
|
-
declare function setMinGasPrice(client: TestClient, { gasPrice }: SetMinGasPriceArgs): Promise<void>;
|
455
|
-
|
456
|
-
type SetNextBlockBaseFeePerGasArgs = {
|
457
|
-
/** Base fee per gas (in wei). */
|
458
|
-
baseFeePerGas: bigint;
|
459
|
-
};
|
460
|
-
declare function setNextBlockBaseFeePerGas(client: TestClient, { baseFeePerGas }: SetNextBlockBaseFeePerGasArgs): Promise<void>;
|
461
|
-
|
462
|
-
type SetNextBlockTimestampArgs = {
|
463
|
-
/** The timestamp (in seconds). */
|
464
|
-
timestamp: bigint;
|
465
|
-
};
|
466
|
-
declare function setNextBlockTimestamp(client: TestClient, { timestamp }: SetNextBlockTimestampArgs): Promise<void>;
|
467
|
-
|
468
|
-
type SetNonceArgs = {
|
469
|
-
/** The account address. */
|
470
|
-
address: Address;
|
471
|
-
/** The nonce to set. */
|
472
|
-
nonce: number;
|
473
|
-
};
|
474
|
-
declare function setNonce(client: TestClient, { address, nonce }: SetNonceArgs): Promise<void>;
|
475
|
-
|
476
|
-
type SetStorageAtArgs = {
|
477
|
-
/** The account address. */
|
478
|
-
address: Address;
|
479
|
-
/** The storage slot (index). Can either be a number or hash value. */
|
480
|
-
index: number | Hash;
|
481
|
-
/** The value to store as a 32 byte hex string. */
|
482
|
-
value: Hex;
|
483
|
-
};
|
484
|
-
declare function setStorageAt(client: TestClient, { address, index, value }: SetStorageAtArgs): Promise<void>;
|
485
|
-
|
486
|
-
declare function snapshot(client: TestClient): Promise<`0x${string}`>;
|
487
|
-
|
488
|
-
type StopImpersonatingAccountArgs = {
|
489
|
-
/** The account to impersonate. */
|
490
|
-
address: Address;
|
491
|
-
};
|
492
|
-
declare function stopImpersonatingAccount(client: TestClient, { address }: StopImpersonatingAccountArgs): Promise<void>;
|
493
|
-
|
494
|
-
declare function addChain(client: WalletClient, chain: Chain): Promise<void>;
|
495
|
-
|
496
|
-
declare function getAccounts(client: WalletClient): Promise<`0x${string}`[]>;
|
497
|
-
|
498
|
-
type GetPermissionsResponse = WalletPermission[];
|
499
|
-
declare function getPermissions(client: WalletClient): Promise<WalletPermission[]>;
|
500
|
-
|
501
|
-
declare function requestAccounts(client: WalletClient): Promise<`0x${string}`[]>;
|
502
|
-
|
503
|
-
type RequestPermissionsArgs = {
|
504
|
-
eth_accounts: Record<string, any>;
|
505
|
-
} & {
|
506
|
-
[key: string]: Record<string, any>;
|
507
|
-
};
|
508
|
-
type RequestPermissionsResponse = WalletPermission[];
|
509
|
-
declare function requestPermissions(client: WalletClient, permissions: RequestPermissionsArgs): Promise<WalletPermission[]>;
|
510
|
-
|
511
|
-
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
|
512
|
-
type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & {
|
513
|
-
chain?: TChain;
|
514
|
-
};
|
515
|
-
type SendTransactionResponse = Hash;
|
516
|
-
declare function sendTransaction<TChain extends Chain>(client: WalletClient, { chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
|
517
|
-
|
518
|
-
type SignMessageArgs = {
|
519
|
-
from: Address;
|
520
|
-
data: Hex | ByteArray;
|
521
|
-
};
|
522
|
-
type SignMessageResponse = Hex;
|
523
|
-
declare function signMessage(client: WalletClient, { from, data: data_ }: SignMessageArgs): Promise<SignMessageResponse>;
|
524
|
-
|
525
|
-
type SwitchChainArgs = {
|
526
|
-
id: Chain['id'];
|
527
|
-
};
|
528
|
-
declare function switchChain(client: WalletClient, { id }: SwitchChainArgs): Promise<void>;
|
529
|
-
|
530
|
-
type WatchAssetArgs = WatchAssetParams;
|
531
|
-
type WatchAssetResponse = boolean;
|
532
|
-
declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
|
533
|
-
|
534
|
-
export { SetIntervalMiningArgs as $, GetTransactionResponse as A, GetTransactionReceiptArgs as B, CallArgs as C, DropTransactionArgs as D, EstimateGasArgs as E, GetTransactionReceiptResponse as F, GetBalanceArgs as G, IncreaseTimeArgs as H, ImpersonateAccountArgs as I, OnBlockNumber as J, OnBlockNumberResponse as K, OnBlockResponse as L, MineArgs as M, OnTransactions as N, OnBlock as O, OnTransactionsResponse as P, RequestPermissionsResponse as Q, ResetArgs as R, RevertArgs as S, SendTransactionArgs as T, SendTransactionResponse as U, SendUnsignedTransactionArgs as V, SendUnsignedTransactionResponse as W, SetBalanceArgs as X, SetBlockGasLimitArgs as Y, SetCodeArgs as Z, SetCoinbaseArgs as _, CallContractArgs as a, setMinGasPrice as a$, SetMinGasPriceArgs as a0, SetBlockTimestampIntervalArgs as a1, SetNextBlockTimestampArgs as a2, SetNextBlockBaseFeePerGasArgs as a3, SetNonceArgs as a4, SetStorageAtArgs as a5, SignMessageArgs as a6, SignMessageResponse as a7, StopImpersonatingAccountArgs as a8, SwitchChainArgs as a9, getGasPrice as aA, getPermissions as aB, getTransaction as aC, getTransactionConfirmations as aD, getTransactionCount as aE, getTransactionReceipt as aF, getTxpoolContent as aG, getTxpoolStatus as aH, impersonateAccount as aI, increaseTime as aJ, inspectTxpool as aK, mine as aL, removeBlockTimestampInterval as aM, reset as aN, requestAccounts as aO, requestPermissions as aP, revert as aQ, sendTransaction as aR, sendUnsignedTransaction as aS, setAutomine as aT, setBalance as aU, setBlockGasLimit as aV, setBlockTimestampInterval as aW, setCode as aX, setCoinbase as aY, setIntervalMining as aZ, setLoggingEnabled as a_, UninstallFilterArgs as aa, UninstallFilterResponse as ab, WaitForTransactionReceiptArgs as ac, WaitForTransactionReceiptResponse as ad, WatchAssetArgs as ae, WatchAssetResponse as af, WatchBlockNumberArgs as ag, WatchBlocksArgs as ah, WatchPendingTransactionsArgs as ai, addChain as aj, call as ak, callContract as al, createBlockFilter as am, createPendingTransactionFilter as an, estimateGas as ao, dropTransaction as ap, getAccounts as aq, getAutomine as ar, getBalance as as, getBlock as at, getBlockNumber as au, getBlockTransactionCount as av, getChainId as aw, getFeeHistory as ax, getFilterChanges as ay, getFilterLogs as az, CallContractResponse as b, setNextBlockBaseFeePerGas as b0, setNextBlockTimestamp as b1, setNonce as b2, setStorageAt as b3, signMessage as b4, snapshot as b5, stopImpersonatingAccount as b6, switchChain as b7, uninstallFilter as b8, waitForTransactionReceipt as b9, watchAsset as ba, watchBlockNumber as bb, watchBlocks as bc, watchPendingTransactions as bd, getBlockNumberCache as be, ReplacementReason as bf, ReplacementResponse as bg, FormattedTransactionRequest as bh, CallResponse as c, CreateBlockFilterResponse as d, CreatePendingTransactionFilterResponse as e, EstimateGasResponse as f, GetBalanceResponse as g, GetBlockArgs as h, GetBlockNumberArgs as i, GetBlockNumberResponse as j, GetBlockResponse as k, GetBlockTransactionCountArgs as l, GetBlockTransactionCountResponse as m, GetFeeHistoryArgs as n, GetFeeHistoryResponse as o, GetFilterChangesArgs as p, GetFilterChangesResponse as q, GetFilterLogsArgs as r, GetFilterLogsResponse as s, GetGasPriceResponse as t, GetPermissionsResponse as u, GetTransactionArgs as v, GetTransactionConfirmationsArgs as w, GetTransactionConfirmationsResponse as x, GetTransactionCountArgs as y, GetTransactionCountResponse as z };
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import { e as TransportConfig, d as Transport, B as BaseRpcRequests } from './createWalletClient-d612fe08.js';
|
2
|
-
import { a as Hash } from './rpc-b77c5aee.js';
|
3
|
-
import { R as RpcResponse } from './rpc-26932bae.js';
|
4
|
-
|
5
|
-
type EthereumProvider = {
|
6
|
-
request: BaseRpcRequests['request'];
|
7
|
-
};
|
8
|
-
type CustomTransportConfig = {
|
9
|
-
/** The key of the transport. */
|
10
|
-
key?: TransportConfig['key'];
|
11
|
-
/** The name of the transport. */
|
12
|
-
name?: TransportConfig['name'];
|
13
|
-
};
|
14
|
-
type CustomTransport = Transport<'custom', EthereumProvider['request']>;
|
15
|
-
/**
|
16
|
-
* @description Creates a custom transport given an EIP-1193 compliant `request` attribute.
|
17
|
-
*/
|
18
|
-
declare function custom<TProvider extends EthereumProvider>(
|
19
|
-
/** An Ethereum provider with an EIP-1193 "request" attribute. */
|
20
|
-
provider: TProvider, { key, name }?: CustomTransportConfig): CustomTransport;
|
21
|
-
|
22
|
-
type FallbackTransportConfig = {
|
23
|
-
/** The key of the Fallback transport. */
|
24
|
-
key?: TransportConfig['key'];
|
25
|
-
/** The name of the Fallback transport. */
|
26
|
-
name?: TransportConfig['name'];
|
27
|
-
};
|
28
|
-
type FallbackTransport = Transport<'fallback', {
|
29
|
-
transports: Transport[];
|
30
|
-
}>;
|
31
|
-
declare function fallback(transports: Transport[], { key, name }?: FallbackTransportConfig): FallbackTransport;
|
32
|
-
|
33
|
-
type HttpTransportConfig = {
|
34
|
-
/** The key of the HTTP transport. */
|
35
|
-
key?: TransportConfig['key'];
|
36
|
-
/** The name of the HTTP transport. */
|
37
|
-
name?: TransportConfig['name'];
|
38
|
-
};
|
39
|
-
type HttpTransport = Transport<'http', {
|
40
|
-
url?: string;
|
41
|
-
}>;
|
42
|
-
/**
|
43
|
-
* @description Creates a HTTP transport that connects to a JSON-RPC API.
|
44
|
-
*/
|
45
|
-
declare function http(
|
46
|
-
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
47
|
-
url?: string, { key, name }?: HttpTransportConfig): HttpTransport;
|
48
|
-
|
49
|
-
type WebSocketTransportSubscribeArgs = {
|
50
|
-
onData: (data: RpcResponse) => void;
|
51
|
-
onError?: (error: any) => void;
|
52
|
-
};
|
53
|
-
type WebSocketTransportSubscribeResponse = {
|
54
|
-
subscriptionId: Hash;
|
55
|
-
unsubscribe: () => Promise<RpcResponse<boolean>>;
|
56
|
-
};
|
57
|
-
type WebSocketTransportSubscribe = {
|
58
|
-
subscribe(args: WebSocketTransportSubscribeArgs & {
|
59
|
-
/**
|
60
|
-
* @description Add information about compiled contracts
|
61
|
-
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_addcompilationresult
|
62
|
-
*/
|
63
|
-
params: ['newHeads'];
|
64
|
-
}): Promise<WebSocketTransportSubscribeResponse>;
|
65
|
-
};
|
66
|
-
type WebSocketTransportConfig = {
|
67
|
-
/** The key of the WebSocket transport. */
|
68
|
-
key?: TransportConfig['key'];
|
69
|
-
/** The name of the WebSocket transport. */
|
70
|
-
name?: TransportConfig['name'];
|
71
|
-
};
|
72
|
-
type WebSocketTransport = Transport<'webSocket', {
|
73
|
-
getSocket(): Promise<WebSocket>;
|
74
|
-
subscribe: WebSocketTransportSubscribe['subscribe'];
|
75
|
-
}>;
|
76
|
-
/**
|
77
|
-
* @description Creates a WebSocket transport that connects to a JSON-RPC API.
|
78
|
-
*/
|
79
|
-
declare function webSocket(
|
80
|
-
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
81
|
-
url?: string, { key, name, }?: WebSocketTransportConfig): WebSocketTransport;
|
82
|
-
|
83
|
-
export { CustomTransport as C, FallbackTransport as F, HttpTransport as H, WebSocketTransport as W, CustomTransportConfig as a, FallbackTransportConfig as b, HttpTransportConfig as c, WebSocketTransportConfig as d, custom as e, fallback as f, http as h, webSocket as w };
|