viem 0.0.1-alpha.24 → 0.0.1-alpha.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-3476b8ee.d.ts +22 -0
- package/dist/{chain-afa13f5a.d.ts → chain-42de87e5.d.ts} +20 -14
- package/dist/{chain-e33d019b.d.ts → chain-b0cfb141.d.ts} +1 -1
- package/dist/chains.d.ts +20 -8
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-3ARWEJ3G.mjs → chunk-BSAB6UH4.mjs} +18 -2
- package/dist/chunk-BSAB6UH4.mjs.map +1 -0
- package/dist/{chunk-4D5XG6XB.js → chunk-DSQO3E4F.js} +367 -429
- package/dist/chunk-DSQO3E4F.js.map +1 -0
- package/dist/{chunk-A2HXAZXC.js → chunk-LINNE4N4.js} +199 -161
- package/dist/chunk-LINNE4N4.js.map +1 -0
- package/dist/{chunk-LQVMDX5I.mjs → chunk-PRG3BBPZ.mjs} +397 -459
- package/dist/chunk-PRG3BBPZ.mjs.map +1 -0
- package/dist/{chunk-YQUC52RL.mjs → chunk-QSIX64VZ.mjs} +136 -98
- package/dist/chunk-QSIX64VZ.mjs.map +1 -0
- package/dist/{chunk-ZYSXBTBB.js → chunk-YTG4YXMB.js} +30 -14
- package/dist/chunk-YTG4YXMB.js.map +1 -0
- package/dist/{contract-70f4ddbe.d.ts → contract-9dd2f98b.d.ts} +44 -31
- package/dist/contract.d.ts +129 -0
- package/dist/contract.js +55 -0
- package/dist/{clients/index.js.map → contract.js.map} +0 -0
- package/dist/contract.mjs +55 -0
- package/dist/{clients/index.mjs.map → contract.mjs.map} +0 -0
- package/dist/{createClient-60e3ab98.d.ts → createClient-6689596e.d.ts} +11 -5
- package/dist/{createPublicClient-d3d12dc3.d.ts → createPublicClient-fd558574.d.ts} +3 -3
- package/dist/{createTestClient-5f4532c4.d.ts → createTestClient-bc1d9028.d.ts} +3 -3
- package/dist/{createWalletClient-9ec3df4f.d.ts → createWalletClient-4df88244.d.ts} +3 -3
- package/dist/decodeErrorResult-ac835649.d.ts +16 -0
- package/dist/{eip1193-9317a312.d.ts → eip1193-617a05ae.d.ts} +2 -2
- package/dist/ens.d.ts +82 -1
- package/dist/ens.js +208 -3
- package/dist/ens.js.map +1 -1
- package/dist/ens.mjs +209 -4
- package/dist/ens.mjs.map +1 -1
- package/dist/getAbiItem-d2e8bd76.d.ts +97 -0
- package/dist/index.d.ts +113 -180
- package/dist/index.js +259 -279
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +267 -287
- package/dist/index.mjs.map +1 -1
- package/dist/public.d.ts +353 -10
- package/dist/public.js +3 -4
- package/dist/public.mjs +6 -7
- package/dist/readContract-c460f23a.d.ts +10 -0
- package/dist/rpc-8c10fc98.d.ts +119 -0
- package/dist/{sendTransaction-54a0d509.d.ts → sendTransaction-7ce442c0.d.ts} +3 -3
- package/dist/test.d.ts +160 -5
- package/dist/test.js +222 -18
- package/dist/test.js.map +1 -1
- package/dist/test.mjs +233 -29
- package/dist/test.mjs.map +1 -1
- package/dist/transactionReceipt-44dbf122.d.ts +26 -0
- package/dist/{transactionRequest-bdf57f7d.d.ts → transactionRequest-f437b4ba.d.ts} +1 -1
- package/dist/utils/index.d.ts +228 -21
- package/dist/utils/index.js +2 -6
- package/dist/utils/index.mjs +3 -7
- package/dist/wallet.d.ts +41 -7
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/watchEvent-569c9976.d.ts +41 -0
- package/dist/window.d.ts +2 -2
- package/ens/package.json +4 -0
- package/package.json +16 -12
- package/public/package.json +4 -0
- package/test/package.json +4 -0
- package/wallet/package.json +4 -0
- package/clients/package.json +0 -4
- package/dist/chunk-3ARWEJ3G.mjs.map +0 -1
- package/dist/chunk-4D5XG6XB.js.map +0 -1
- package/dist/chunk-6QTEW2BE.mjs +0 -260
- package/dist/chunk-6QTEW2BE.mjs.map +0 -1
- package/dist/chunk-A2HXAZXC.js.map +0 -1
- package/dist/chunk-KRPS5CIB.mjs +0 -256
- package/dist/chunk-KRPS5CIB.mjs.map +0 -1
- package/dist/chunk-LQVMDX5I.mjs.map +0 -1
- package/dist/chunk-N3IOPT3R.js +0 -256
- package/dist/chunk-N3IOPT3R.js.map +0 -1
- package/dist/chunk-YQUC52RL.mjs.map +0 -1
- package/dist/chunk-ZSTVHQ6J.js +0 -260
- package/dist/chunk-ZSTVHQ6J.js.map +0 -1
- package/dist/chunk-ZYSXBTBB.js.map +0 -1
- package/dist/clients/index.d.ts +0 -9
- package/dist/clients/index.js +0 -24
- package/dist/clients/index.mjs +0 -24
- package/dist/normalize-ef9240c0.d.ts +0 -33
- package/dist/parseGwei-492ab7dd.d.ts +0 -355
- package/dist/rpc-26932bae.d.ts +0 -61
- package/dist/stopImpersonatingAccount-c1a4b7e5.d.ts +0 -156
- package/dist/watchAsset-d59d6e35.d.ts +0 -38
- package/dist/watchPendingTransactions-ea21b31d.d.ts +0 -373
- package/dist/webSocket-775b4037.d.ts +0 -83
- package/src/_test/abis.ts +0 -1420
- package/src/_test/bench.ts +0 -15
- package/src/_test/constants.ts +0 -61
- package/src/_test/globalSetup.ts +0 -11
- package/src/_test/index.ts +0 -25
- package/src/_test/setup.ts +0 -8
- package/src/_test/utils.ts +0 -150
- package/src/actions/index.test.ts +0 -81
- package/src/actions/index.ts +0 -182
- package/src/actions/public/call.bench.ts +0 -48
- package/src/actions/public/call.test.ts +0 -99
- package/src/actions/public/call.ts +0 -97
- package/src/actions/public/createBlockFilter.bench.ts +0 -11
- package/src/actions/public/createBlockFilter.test.ts +0 -9
- package/src/actions/public/createBlockFilter.ts +0 -14
- package/src/actions/public/createContractEventFilter.test.ts +0 -119
- package/src/actions/public/createContractEventFilter.ts +0 -69
- package/src/actions/public/createEventFilter.test.ts +0 -245
- package/src/actions/public/createEventFilter.ts +0 -76
- package/src/actions/public/createPendingTransactionFilter.bench.ts +0 -11
- package/src/actions/public/createPendingTransactionFilter.test.ts +0 -9
- package/src/actions/public/createPendingTransactionFilter.ts +0 -14
- package/src/actions/public/deployContract.test.ts +0 -56
- package/src/actions/public/deployContract.ts +0 -38
- package/src/actions/public/estimateGas.bench.ts +0 -46
- package/src/actions/public/estimateGas.test.ts +0 -92
- package/src/actions/public/estimateGas.ts +0 -61
- package/src/actions/public/getBalance.test.ts +0 -83
- package/src/actions/public/getBalance.ts +0 -37
- package/src/actions/public/getBlock.bench.ts +0 -28
- package/src/actions/public/getBlock.test.ts +0 -575
- package/src/actions/public/getBlock.ts +0 -65
- package/src/actions/public/getBlockNumber.bench.ts +0 -28
- package/src/actions/public/getBlockNumber.test.ts +0 -27
- package/src/actions/public/getBlockNumber.ts +0 -32
- package/src/actions/public/getBlockTransactionCount.bench.ts +0 -15
- package/src/actions/public/getBlockTransactionCount.test.ts +0 -57
- package/src/actions/public/getBlockTransactionCount.ts +0 -52
- package/src/actions/public/getBytecode.test.ts +0 -27
- package/src/actions/public/getBytecode.ts +0 -32
- package/src/actions/public/getChainId.bench.ts +0 -15
- package/src/actions/public/getChainId.test.ts +0 -8
- package/src/actions/public/getChainId.ts +0 -7
- package/src/actions/public/getFeeHistory.bench.ts +0 -18
- package/src/actions/public/getFeeHistory.test.ts +0 -137
- package/src/actions/public/getFeeHistory.ts +0 -44
- package/src/actions/public/getFilterChanges.bench.ts +0 -13
- package/src/actions/public/getFilterChanges.test.ts +0 -189
- package/src/actions/public/getFilterChanges.ts +0 -23
- package/src/actions/public/getFilterLogs.test.ts +0 -104
- package/src/actions/public/getFilterLogs.ts +0 -20
- package/src/actions/public/getGasPrice.bench.ts +0 -19
- package/src/actions/public/getGasPrice.test.ts +0 -8
- package/src/actions/public/getGasPrice.ts +0 -15
- package/src/actions/public/getLogs.test.ts +0 -107
- package/src/actions/public/getLogs.ts +0 -84
- package/src/actions/public/getStorageAt.test.ts +0 -34
- package/src/actions/public/getStorageAt.ts +0 -32
- package/src/actions/public/getTransaction.bench.ts +0 -33
- package/src/actions/public/getTransaction.test.ts +0 -311
- package/src/actions/public/getTransaction.ts +0 -95
- package/src/actions/public/getTransactionConfirmations.test.ts +0 -69
- package/src/actions/public/getTransactionConfirmations.ts +0 -38
- package/src/actions/public/getTransactionCount.test.ts +0 -56
- package/src/actions/public/getTransactionCount.ts +0 -34
- package/src/actions/public/getTransactionReceipt.bench.ts +0 -33
- package/src/actions/public/getTransactionReceipt.test.ts +0 -179
- package/src/actions/public/getTransactionReceipt.ts +0 -34
- package/src/actions/public/index.test.ts +0 -44
- package/src/actions/public/index.ts +0 -152
- package/src/actions/public/multicall.test.ts +0 -452
- package/src/actions/public/multicall.ts +0 -103
- package/src/actions/public/readContract.test.ts +0 -328
- package/src/actions/public/readContract.ts +0 -73
- package/src/actions/public/simulateContract.bench.ts +0 -41
- package/src/actions/public/simulateContract.test.ts +0 -410
- package/src/actions/public/simulateContract.ts +0 -94
- package/src/actions/public/uninstallFilter.bench.ts +0 -13
- package/src/actions/public/uninstallFilter.test.ts +0 -65
- package/src/actions/public/uninstallFilter.ts +0 -17
- package/src/actions/public/waitForTransactionReceipt.test.ts +0 -322
- package/src/actions/public/waitForTransactionReceipt.ts +0 -170
- package/src/actions/public/watchBlockNumber.test.ts +0 -166
- package/src/actions/public/watchBlockNumber.ts +0 -79
- package/src/actions/public/watchBlocks.test.ts +0 -210
- package/src/actions/public/watchBlocks.ts +0 -114
- package/src/actions/public/watchContractEvent.test.ts +0 -305
- package/src/actions/public/watchContractEvent.ts +0 -108
- package/src/actions/public/watchEvent.test.ts +0 -195
- package/src/actions/public/watchEvent.ts +0 -95
- package/src/actions/public/watchPendingTransactions.test.ts +0 -116
- package/src/actions/public/watchPendingTransactions.ts +0 -74
- package/src/actions/test/dropTransaction.test.ts +0 -34
- package/src/actions/test/dropTransaction.ts +0 -17
- package/src/actions/test/getAutomine.test.ts +0 -14
- package/src/actions/test/getAutomine.ts +0 -11
- package/src/actions/test/getTxpoolContent.test.ts +0 -45
- package/src/actions/test/getTxpoolContent.ts +0 -7
- package/src/actions/test/getTxpoolStatus.test.ts +0 -41
- package/src/actions/test/getTxpoolStatus.ts +0 -12
- package/src/actions/test/impersonateAccount.test.ts +0 -26
- package/src/actions/test/impersonateAccount.ts +0 -17
- package/src/actions/test/increaseTime.test.ts +0 -18
- package/src/actions/test/increaseTime.ts +0 -17
- package/src/actions/test/index.test.ts +0 -38
- package/src/actions/test/index.ts +0 -77
- package/src/actions/test/inspectTxpool.test.ts +0 -50
- package/src/actions/test/inspectTxpool.ts +0 -7
- package/src/actions/test/mine.test.ts +0 -20
- package/src/actions/test/mine.ts +0 -16
- package/src/actions/test/removeBlockTimestampInterval.test.ts +0 -23
- package/src/actions/test/removeBlockTimestampInterval.ts +0 -7
- package/src/actions/test/reset.test.ts +0 -19
- package/src/actions/test/reset.ts +0 -18
- package/src/actions/test/revert.test.ts +0 -39
- package/src/actions/test/revert.ts +0 -14
- package/src/actions/test/sendUnsignedTransaction.test.ts +0 -52
- package/src/actions/test/sendUnsignedTransaction.ts +0 -19
- package/src/actions/test/setAutomine.test.ts +0 -14
- package/src/actions/test/setAutomine.ts +0 -8
- package/src/actions/test/setBalance.test.ts +0 -29
- package/src/actions/test/setBalance.ts +0 -20
- package/src/actions/test/setBlockGasLimit.test.ts +0 -21
- package/src/actions/test/setBlockGasLimit.ts +0 -17
- package/src/actions/test/setBlockTimestampInterval.test.ts +0 -23
- package/src/actions/test/setBlockTimestampInterval.ts +0 -16
- package/src/actions/test/setCode.test.ts +0 -26
- package/src/actions/test/setCode.ts +0 -19
- package/src/actions/test/setCoinbase.test.ts +0 -11
- package/src/actions/test/setCoinbase.ts +0 -17
- package/src/actions/test/setIntervalMining.test.ts +0 -30
- package/src/actions/test/setIntervalMining.ts +0 -16
- package/src/actions/test/setLoggingEnabled.test.ts +0 -10
- package/src/actions/test/setLoggingEnabled.ts +0 -8
- package/src/actions/test/setMinGasPrice.test.ts +0 -22
- package/src/actions/test/setMinGasPrice.ts +0 -17
- package/src/actions/test/setNextBlockBaseFeePerGas.test.ts +0 -23
- package/src/actions/test/setNextBlockBaseFeePerGas.ts +0 -17
- package/src/actions/test/setNextBlockTimestamp.test.ts +0 -19
- package/src/actions/test/setNextBlockTimestamp.ts +0 -17
- package/src/actions/test/setNonce.test.ts +0 -28
- package/src/actions/test/setNonce.ts +0 -20
- package/src/actions/test/setRpcUrl.test.ts +0 -9
- package/src/actions/test/setRpcUrl.ts +0 -8
- package/src/actions/test/setStorageAt.test.ts +0 -36
- package/src/actions/test/setStorageAt.ts +0 -26
- package/src/actions/test/snapshot.test.ts +0 -18
- package/src/actions/test/snapshot.ts +0 -7
- package/src/actions/test/stopImpersonatingAccount.test.ts +0 -29
- package/src/actions/test/stopImpersonatingAccount.ts +0 -17
- package/src/actions/wallet/addChain.test.ts +0 -14
- package/src/actions/wallet/addChain.ts +0 -21
- package/src/actions/wallet/getAccounts.test.ts +0 -22
- package/src/actions/wallet/getAccounts.ts +0 -7
- package/src/actions/wallet/getPermissions.test.ts +0 -24
- package/src/actions/wallet/getPermissions.ts +0 -9
- package/src/actions/wallet/index.test.ts +0 -20
- package/src/actions/wallet/index.ts +0 -30
- package/src/actions/wallet/requestAccounts.test.ts +0 -13
- package/src/actions/wallet/requestAccounts.ts +0 -7
- package/src/actions/wallet/requestPermissions.test.ts +0 -26
- package/src/actions/wallet/requestPermissions.ts +0 -19
- package/src/actions/wallet/sendTransaction.bench.ts +0 -57
- package/src/actions/wallet/sendTransaction.test.ts +0 -440
- package/src/actions/wallet/sendTransaction.ts +0 -77
- package/src/actions/wallet/signMessage.test.ts +0 -61
- package/src/actions/wallet/signMessage.ts +0 -35
- package/src/actions/wallet/switchChain.test.ts +0 -21
- package/src/actions/wallet/switchChain.ts +0 -19
- package/src/actions/wallet/watchAsset.test.ts +0 -40
- package/src/actions/wallet/watchAsset.ts +0 -16
- package/src/actions/wallet/writeContract.test.ts +0 -84
- package/src/actions/wallet/writeContract.ts +0 -47
- package/src/chains.test.ts +0 -1912
- package/src/chains.ts +0 -99
- package/src/clients/createClient.test.ts +0 -295
- package/src/clients/createClient.ts +0 -81
- package/src/clients/createPublicClient.test.ts +0 -165
- package/src/clients/createPublicClient.ts +0 -49
- package/src/clients/createTestClient.test.ts +0 -145
- package/src/clients/createTestClient.ts +0 -72
- package/src/clients/createWalletClient.test.ts +0 -121
- package/src/clients/createWalletClient.ts +0 -54
- package/src/clients/index.test.ts +0 -19
- package/src/clients/index.ts +0 -31
- package/src/clients/transports/createTransport.test.ts +0 -58
- package/src/clients/transports/createTransport.ts +0 -48
- package/src/clients/transports/custom.test.ts +0 -98
- package/src/clients/transports/custom.ts +0 -34
- package/src/clients/transports/fallback.test.ts +0 -257
- package/src/clients/transports/fallback.ts +0 -50
- package/src/clients/transports/http.test.ts +0 -109
- package/src/clients/transports/http.ts +0 -51
- package/src/clients/transports/index.test.ts +0 -15
- package/src/clients/transports/index.ts +0 -17
- package/src/clients/transports/webSocket.test.ts +0 -163
- package/src/clients/transports/webSocket.ts +0 -117
- package/src/constants/abis.test.ts +0 -53
- package/src/constants/abis.ts +0 -44
- package/src/constants/index.test.ts +0 -14
- package/src/constants/index.ts +0 -3
- package/src/constants/solidity.test.ts +0 -41
- package/src/constants/solidity.ts +0 -35
- package/src/ens.ts +0 -5
- package/src/errors/abi.test.ts +0 -81
- package/src/errors/abi.ts +0 -238
- package/src/errors/address.test.ts +0 -14
- package/src/errors/address.ts +0 -9
- package/src/errors/base.test.ts +0 -114
- package/src/errors/base.ts +0 -57
- package/src/errors/block.test.ts +0 -24
- package/src/errors/block.ts +0 -18
- package/src/errors/contract.test.ts +0 -233
- package/src/errors/contract.ts +0 -178
- package/src/errors/data.ts +0 -20
- package/src/errors/encoding.ts +0 -60
- package/src/errors/index.ts +0 -79
- package/src/errors/log.ts +0 -8
- package/src/errors/request.test.ts +0 -330
- package/src/errors/request.ts +0 -163
- package/src/errors/rpc.test.ts +0 -87
- package/src/errors/rpc.ts +0 -113
- package/src/errors/transaction.test.ts +0 -83
- package/src/errors/transaction.ts +0 -54
- package/src/errors/transport.test.ts +0 -11
- package/src/errors/transport.ts +0 -12
- package/src/index.test.ts +0 -263
- package/src/index.ts +0 -389
- package/src/public.ts +0 -80
- package/src/test.ts +0 -51
- package/src/types/block.ts +0 -71
- package/src/types/chain.ts +0 -6
- package/src/types/contract.ts +0 -393
- package/src/types/eip1193.ts +0 -1041
- package/src/types/fee.ts +0 -47
- package/src/types/filter.ts +0 -8
- package/src/types/formatter.ts +0 -23
- package/src/types/index.ts +0 -83
- package/src/types/log.ts +0 -22
- package/src/types/misc.ts +0 -5
- package/src/types/multicall.ts +0 -82
- package/src/types/rpc.ts +0 -35
- package/src/types/transaction.ts +0 -145
- package/src/types/utils.ts +0 -67
- package/src/types/window.ts +0 -9
- package/src/utils/abi/decodeAbi.bench.ts +0 -135
- package/src/utils/abi/decodeAbi.test.ts +0 -1614
- package/src/utils/abi/decodeAbi.ts +0 -300
- package/src/utils/abi/decodeDeployData.test.ts +0 -151
- package/src/utils/abi/decodeDeployData.ts +0 -44
- package/src/utils/abi/decodeErrorResult.test.ts +0 -230
- package/src/utils/abi/decodeErrorResult.ts +0 -45
- package/src/utils/abi/decodeFunctionData.test.ts +0 -139
- package/src/utils/abi/decodeFunctionData.ts +0 -29
- package/src/utils/abi/decodeFunctionResult.test.ts +0 -333
- package/src/utils/abi/decodeFunctionResult.ts +0 -57
- package/src/utils/abi/encodeAbi.bench.ts +0 -163
- package/src/utils/abi/encodeAbi.test.ts +0 -1447
- package/src/utils/abi/encodeAbi.ts +0 -273
- package/src/utils/abi/encodeDeployData.test.ts +0 -124
- package/src/utils/abi/encodeDeployData.ts +0 -40
- package/src/utils/abi/encodeErrorResult.test.ts +0 -192
- package/src/utils/abi/encodeErrorResult.ts +0 -47
- package/src/utils/abi/encodeEventTopics.test.ts +0 -345
- package/src/utils/abi/encodeEventTopics.ts +0 -75
- package/src/utils/abi/encodeFunctionData.test.ts +0 -138
- package/src/utils/abi/encodeFunctionData.ts +0 -45
- package/src/utils/abi/encodeFunctionResult.test.ts +0 -279
- package/src/utils/abi/encodeFunctionResult.ts +0 -41
- package/src/utils/abi/formatAbiItem.test.ts +0 -335
- package/src/utils/abi/formatAbiItem.ts +0 -41
- package/src/utils/abi/formatAbiItemWithArgs.test.ts +0 -291
- package/src/utils/abi/formatAbiItemWithArgs.ts +0 -27
- package/src/utils/abi/getAbiItem.test.ts +0 -547
- package/src/utils/abi/getAbiItem.ts +0 -95
- package/src/utils/abi/index.test.ts +0 -23
- package/src/utils/abi/index.ts +0 -42
- package/src/utils/address/getAddress.bench.ts +0 -22
- package/src/utils/address/getAddress.test.ts +0 -46
- package/src/utils/address/getAddress.ts +0 -28
- package/src/utils/address/getContractAddress.bench.ts +0 -20
- package/src/utils/address/getContractAddress.test.ts +0 -78
- package/src/utils/address/getContractAddress.ts +0 -59
- package/src/utils/address/index.test.ts +0 -17
- package/src/utils/address/index.ts +0 -16
- package/src/utils/address/isAddress.test.ts +0 -10
- package/src/utils/address/isAddress.ts +0 -10
- package/src/utils/address/isAddressEqual.test.ts +0 -55
- package/src/utils/address/isAddressEqual.ts +0 -6
- package/src/utils/buildRequest.test.ts +0 -365
- package/src/utils/buildRequest.ts +0 -45
- package/src/utils/chain.test.ts +0 -43
- package/src/utils/chain.ts +0 -8
- package/src/utils/contract/extractFunctionParts.test.ts +0 -109
- package/src/utils/contract/extractFunctionParts.ts +0 -27
- package/src/utils/contract/getContractError.test.ts +0 -282
- package/src/utils/contract/getContractError.ts +0 -58
- package/src/utils/contract/index.test.ts +0 -15
- package/src/utils/contract/index.ts +0 -8
- package/src/utils/data/concat.test.ts +0 -35
- package/src/utils/data/concat.ts +0 -34
- package/src/utils/data/index.test.ts +0 -23
- package/src/utils/data/index.ts +0 -13
- package/src/utils/data/isBytes.test.ts +0 -9
- package/src/utils/data/isBytes.ts +0 -7
- package/src/utils/data/isHex.test.ts +0 -13
- package/src/utils/data/isHex.ts +0 -5
- package/src/utils/data/pad.bench.ts +0 -30
- package/src/utils/data/pad.test.ts +0 -367
- package/src/utils/data/pad.ts +0 -53
- package/src/utils/data/size.test.ts +0 -18
- package/src/utils/data/size.ts +0 -13
- package/src/utils/data/slice.test.ts +0 -203
- package/src/utils/data/slice.ts +0 -60
- package/src/utils/data/trim.bench.ts +0 -34
- package/src/utils/data/trim.test.ts +0 -175
- package/src/utils/data/trim.ts +0 -33
- package/src/utils/encoding/decodeBytes.bench.ts +0 -40
- package/src/utils/encoding/decodeBytes.test.ts +0 -144
- package/src/utils/encoding/decodeBytes.ts +0 -63
- package/src/utils/encoding/decodeHex.bench.ts +0 -24
- package/src/utils/encoding/decodeHex.test.ts +0 -167
- package/src/utils/encoding/decodeHex.ts +0 -76
- package/src/utils/encoding/decodeRlp.bench.ts +0 -34
- package/src/utils/encoding/decodeRlp.test.ts +0 -350
- package/src/utils/encoding/decodeRlp.ts +0 -121
- package/src/utils/encoding/encodeBytes.bench.ts +0 -29
- package/src/utils/encoding/encodeBytes.test.ts +0 -676
- package/src/utils/encoding/encodeBytes.ts +0 -59
- package/src/utils/encoding/encodeHex.bench.ts +0 -49
- package/src/utils/encoding/encodeHex.test.ts +0 -232
- package/src/utils/encoding/encodeHex.ts +0 -104
- package/src/utils/encoding/encodeRlp.bench.ts +0 -54
- package/src/utils/encoding/encodeRlp.test.ts +0 -254
- package/src/utils/encoding/encodeRlp.ts +0 -48
- package/src/utils/encoding/index.test.ts +0 -32
- package/src/utils/encoding/index.ts +0 -36
- package/src/utils/ens/index.test.ts +0 -13
- package/src/utils/ens/index.ts +0 -5
- package/src/utils/ens/labelhash.test.ts +0 -55
- package/src/utils/ens/labelhash.ts +0 -16
- package/src/utils/ens/namehash.test.ts +0 -65
- package/src/utils/ens/namehash.ts +0 -28
- package/src/utils/ens/normalize.bench.ts +0 -14
- package/src/utils/ens/normalize.test.ts +0 -35
- package/src/utils/ens/normalize.ts +0 -14
- package/src/utils/formatters/block.bench.ts +0 -51
- package/src/utils/formatters/block.test.ts +0 -115
- package/src/utils/formatters/block.ts +0 -37
- package/src/utils/formatters/extract.test.ts +0 -14
- package/src/utils/formatters/extract.ts +0 -18
- package/src/utils/formatters/feeHistory.test.ts +0 -66
- package/src/utils/formatters/feeHistory.ts +0 -12
- package/src/utils/formatters/format.test.ts +0 -93
- package/src/utils/formatters/format.ts +0 -90
- package/src/utils/formatters/index.test.ts +0 -27
- package/src/utils/formatters/index.ts +0 -34
- package/src/utils/formatters/log.test.ts +0 -79
- package/src/utils/formatters/log.ts +0 -12
- package/src/utils/formatters/transaction.test.ts +0 -271
- package/src/utils/formatters/transaction.ts +0 -63
- package/src/utils/formatters/transactionReceipt.bench.ts +0 -73
- package/src/utils/formatters/transactionReceipt.test.ts +0 -151
- package/src/utils/formatters/transactionReceipt.ts +0 -63
- package/src/utils/formatters/transactionRequest.bench.ts +0 -29
- package/src/utils/formatters/transactionRequest.test.ts +0 -237
- package/src/utils/formatters/transactionRequest.ts +0 -56
- package/src/utils/hash/getEventSignature.test.ts +0 -61
- package/src/utils/hash/getEventSignature.ts +0 -4
- package/src/utils/hash/getFunctionSignature.test.ts +0 -22
- package/src/utils/hash/getFunctionSignature.ts +0 -5
- package/src/utils/hash/hashFunction.test.ts +0 -65
- package/src/utils/hash/hashFunction.ts +0 -12
- package/src/utils/hash/index.test.ts +0 -13
- package/src/utils/hash/index.ts +0 -5
- package/src/utils/hash/keccak256.test.ts +0 -59
- package/src/utils/hash/keccak256.ts +0 -21
- package/src/utils/index.test.ts +0 -113
- package/src/utils/index.ts +0 -141
- package/src/utils/observe.test.ts +0 -176
- package/src/utils/observe.ts +0 -66
- package/src/utils/poll.test.ts +0 -127
- package/src/utils/poll.ts +0 -42
- package/src/utils/promise/index.test.ts +0 -14
- package/src/utils/promise/index.ts +0 -3
- package/src/utils/promise/withCache.test.ts +0 -97
- package/src/utils/promise/withCache.ts +0 -73
- package/src/utils/promise/withRetry.test.ts +0 -231
- package/src/utils/promise/withRetry.ts +0 -61
- package/src/utils/promise/withTimeout.test.ts +0 -37
- package/src/utils/promise/withTimeout.ts +0 -39
- package/src/utils/rpc.test.ts +0 -989
- package/src/utils/rpc.ts +0 -292
- package/src/utils/stringify.test.ts +0 -13
- package/src/utils/stringify.ts +0 -5
- package/src/utils/uid.ts +0 -14
- package/src/utils/unit/constants.test.ts +0 -22
- package/src/utils/unit/constants.ts +0 -12
- package/src/utils/unit/formatEther.test.ts +0 -75
- package/src/utils/unit/formatEther.ts +0 -6
- package/src/utils/unit/formatGwei.test.ts +0 -32
- package/src/utils/unit/formatGwei.ts +0 -6
- package/src/utils/unit/formatUnit.bench.ts +0 -21
- package/src/utils/unit/formatUnit.test.ts +0 -40
- package/src/utils/unit/formatUnit.ts +0 -16
- package/src/utils/unit/index.test.ts +0 -28
- package/src/utils/unit/index.ts +0 -7
- package/src/utils/unit/parseEther.test.ts +0 -126
- package/src/utils/unit/parseEther.ts +0 -6
- package/src/utils/unit/parseGwei.test.ts +0 -50
- package/src/utils/unit/parseGwei.ts +0 -6
- package/src/utils/unit/parseUnit.bench.ts +0 -21
- package/src/utils/unit/parseUnit.test.ts +0 -54
- package/src/utils/unit/parseUnit.ts +0 -27
- package/src/utils/wait.ts +0 -3
- package/src/wallet.ts +0 -23
- package/src/window.ts +0 -1
@@ -1,355 +0,0 @@
|
|
1
|
-
import { AbiParameter, Narrow, Abi, AbiParametersToPrimitiveTypes } from 'abitype';
|
2
|
-
import { H as Hex, A as Address, B as ByteArray } from './chain-afa13f5a.js';
|
3
|
-
import { A as AbiItem, h as ExtractFunctionNameFromAbi, i as ExtractArgsFromAbi, E as ExtractResultFromAbi, e as ExtractConstructorArgsFromAbi, j as ExtractErrorNameFromAbi, k as ExtractErrorArgsFromAbi, c as ExtractEventNameFromAbi, d as ExtractEventArgsFromAbi, l as ExtractNameFromAbi, a as EventDefinition } from './contract-70f4ddbe.js';
|
4
|
-
import * as abitype_dist_abi_78346466 from 'abitype/dist/abi-78346466';
|
5
|
-
|
6
|
-
type DecodeAbiArgs<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = {
|
7
|
-
data: Hex;
|
8
|
-
params: Narrow<TParams>;
|
9
|
-
};
|
10
|
-
declare function decodeAbi<TParams extends readonly AbiParameter[] | readonly unknown[]>({ data, params }: DecodeAbiArgs<TParams>): readonly unknown[] | undefined;
|
11
|
-
|
12
|
-
type DecodeErrorResultArgs = {
|
13
|
-
abi?: Abi;
|
14
|
-
data: Hex;
|
15
|
-
};
|
16
|
-
type DecodeErrorResultResponse = {
|
17
|
-
abiItem: AbiItem;
|
18
|
-
errorName: string;
|
19
|
-
args?: readonly unknown[];
|
20
|
-
};
|
21
|
-
declare function decodeErrorResult({ abi, data, }: DecodeErrorResultArgs): DecodeErrorResultResponse;
|
22
|
-
|
23
|
-
type DecodeFunctionDataArgs = {
|
24
|
-
abi: Abi;
|
25
|
-
data: Hex;
|
26
|
-
};
|
27
|
-
declare function decodeFunctionData({ abi, data }: DecodeFunctionDataArgs): {
|
28
|
-
functionName: string;
|
29
|
-
args: readonly unknown[] | undefined;
|
30
|
-
};
|
31
|
-
|
32
|
-
type DecodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
33
|
-
abi: Narrow<TAbi>;
|
34
|
-
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
35
|
-
data: Hex;
|
36
|
-
} & Partial<ExtractArgsFromAbi<TAbi, TFunctionName>>;
|
37
|
-
type DecodeFunctionResultResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ExtractResultFromAbi<TAbi, TFunctionName>;
|
38
|
-
declare function decodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, functionName, data, }: DecodeFunctionResultArgs<TAbi, TFunctionName>): DecodeFunctionResultResponse<TAbi, TFunctionName>;
|
39
|
-
|
40
|
-
type EncodeAbiArgs<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = {
|
41
|
-
params: Narrow<TParams>;
|
42
|
-
values: TParams extends readonly AbiParameter[] ? AbiParametersToPrimitiveTypes<TParams> : never;
|
43
|
-
};
|
44
|
-
/**
|
45
|
-
* @description Encodes a list of primitive values into an ABI-encoded hex value.
|
46
|
-
*/
|
47
|
-
declare function encodeAbi<TParams extends readonly AbiParameter[] | readonly unknown[]>({ params, values }: EncodeAbiArgs<TParams>): `0x${string}`;
|
48
|
-
|
49
|
-
type EncodeDeployDataArgs<TAbi extends Abi | readonly unknown[] = Abi> = {
|
50
|
-
abi: Narrow<TAbi>;
|
51
|
-
bytecode: Hex;
|
52
|
-
} & ExtractConstructorArgsFromAbi<TAbi>;
|
53
|
-
declare function encodeDeployData<TAbi extends Abi | readonly unknown[]>({ abi, args, bytecode, }: EncodeDeployDataArgs<TAbi>): `0x${string}`;
|
54
|
-
|
55
|
-
type EncodeErrorResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TErrorName extends string = string> = {
|
56
|
-
abi: Narrow<TAbi>;
|
57
|
-
errorName: ExtractErrorNameFromAbi<TAbi, TErrorName>;
|
58
|
-
} & ExtractErrorArgsFromAbi<TAbi, TErrorName>;
|
59
|
-
declare function encodeErrorResult<TAbi extends Abi | readonly unknown[], TErrorName extends string>({ abi, errorName, args }: EncodeErrorResultArgs<TAbi, TErrorName>): `0x${string}`;
|
60
|
-
|
61
|
-
type EncodeEventTopicsArgs<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string> = {
|
62
|
-
abi: Narrow<TAbi>;
|
63
|
-
eventName: ExtractEventNameFromAbi<TAbi, TEventName>;
|
64
|
-
} & ExtractEventArgsFromAbi<TAbi, TEventName>;
|
65
|
-
declare function encodeEventTopics<TAbi extends Abi | readonly unknown[], TEventName extends string>({ abi, eventName, args }: EncodeEventTopicsArgs<TAbi, TEventName>): `0x${string}`[];
|
66
|
-
|
67
|
-
type EncodeFunctionDataArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
68
|
-
abi: Narrow<TAbi>;
|
69
|
-
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
70
|
-
} & ExtractArgsFromAbi<TAbi, TFunctionName>;
|
71
|
-
declare function encodeFunctionData<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, functionName }: EncodeFunctionDataArgs<TAbi, TFunctionName>): `0x${string}`;
|
72
|
-
|
73
|
-
type EncodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
74
|
-
abi: Narrow<TAbi>;
|
75
|
-
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
76
|
-
result?: ExtractResultFromAbi<TAbi, TFunctionName>;
|
77
|
-
};
|
78
|
-
declare function encodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, functionName, result, }: EncodeFunctionResultArgs<TAbi, TFunctionName>): `0x${string}`;
|
79
|
-
|
80
|
-
type GetAbiItemArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = {
|
81
|
-
abi: Narrow<TAbi>;
|
82
|
-
name: ExtractNameFromAbi<TAbi, TFunctionName>;
|
83
|
-
} & Partial<ExtractArgsFromAbi<TAbi, TFunctionName>>;
|
84
|
-
declare function getAbiItem<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, name }: GetAbiItemArgs<TAbi, TFunctionName>): abitype_dist_abi_78346466.o | abitype_dist_abi_78346466.q | abitype_dist_abi_78346466.p | undefined;
|
85
|
-
|
86
|
-
declare function getAddress(address: Address): `0x${string}`;
|
87
|
-
|
88
|
-
type GetCreateAddressOptions = {
|
89
|
-
from: Address;
|
90
|
-
nonce: bigint;
|
91
|
-
};
|
92
|
-
type GetCreate2AddressOptions = {
|
93
|
-
bytecode: ByteArray | Hex;
|
94
|
-
from: Address;
|
95
|
-
salt: ByteArray | Hex;
|
96
|
-
};
|
97
|
-
type GetContractAddressOptions = ({
|
98
|
-
opcode?: 'CREATE';
|
99
|
-
} & GetCreateAddressOptions) | ({
|
100
|
-
opcode: 'CREATE2';
|
101
|
-
} & GetCreate2AddressOptions);
|
102
|
-
declare function getContractAddress(opts: GetContractAddressOptions): `0x${string}`;
|
103
|
-
declare function getCreateAddress(opts: GetCreateAddressOptions): `0x${string}`;
|
104
|
-
declare function getCreate2Address(opts: GetCreate2AddressOptions): `0x${string}`;
|
105
|
-
|
106
|
-
declare function isAddress(address: Address): boolean;
|
107
|
-
|
108
|
-
declare function isAddressEqual(a: Address, b: Address): boolean;
|
109
|
-
|
110
|
-
type BaseErrorArgs = {
|
111
|
-
docsPath?: string;
|
112
|
-
metaMessages?: string[];
|
113
|
-
} & ({
|
114
|
-
cause?: never;
|
115
|
-
details?: string;
|
116
|
-
} | {
|
117
|
-
cause: BaseError | Error;
|
118
|
-
details?: never;
|
119
|
-
});
|
120
|
-
declare class BaseError extends Error {
|
121
|
-
details: string;
|
122
|
-
docsPath?: string;
|
123
|
-
metaMessages?: string[];
|
124
|
-
shortMessage: string;
|
125
|
-
name: string;
|
126
|
-
constructor(shortMessage: string, args?: BaseErrorArgs);
|
127
|
-
}
|
128
|
-
|
129
|
-
declare class ContractFunctionExecutionError extends BaseError {
|
130
|
-
abi: Abi;
|
131
|
-
args?: unknown[];
|
132
|
-
cause: BaseError;
|
133
|
-
contractAddress?: Address;
|
134
|
-
formattedArgs?: string;
|
135
|
-
functionName: string;
|
136
|
-
sender?: Address;
|
137
|
-
name: string;
|
138
|
-
constructor(cause: BaseError, { abi, args, contractAddress, docsPath, functionName, sender, }: {
|
139
|
-
abi: Abi;
|
140
|
-
args?: any;
|
141
|
-
contractAddress?: Address;
|
142
|
-
docsPath?: string;
|
143
|
-
functionName: string;
|
144
|
-
sender?: Address;
|
145
|
-
});
|
146
|
-
}
|
147
|
-
declare class ContractFunctionRevertedError extends BaseError {
|
148
|
-
name: string;
|
149
|
-
data?: DecodeErrorResultResponse;
|
150
|
-
reason?: string;
|
151
|
-
constructor({ abi, data, functionName, message, }: {
|
152
|
-
abi: Abi;
|
153
|
-
data?: Hex;
|
154
|
-
functionName: string;
|
155
|
-
message?: string;
|
156
|
-
});
|
157
|
-
}
|
158
|
-
declare class ContractFunctionZeroDataError extends BaseError {
|
159
|
-
name: string;
|
160
|
-
constructor({ functionName }: {
|
161
|
-
functionName: string;
|
162
|
-
});
|
163
|
-
}
|
164
|
-
|
165
|
-
declare function isBytes(value: any): boolean;
|
166
|
-
|
167
|
-
declare function isHex(value: any): boolean;
|
168
|
-
|
169
|
-
type PadOptions = {
|
170
|
-
dir?: 'left' | 'right';
|
171
|
-
size?: number;
|
172
|
-
};
|
173
|
-
type PadResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
|
174
|
-
declare function pad<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir, size }?: PadOptions): PadResult<TValue>;
|
175
|
-
declare function padHex(hex_: Hex, { dir, size }?: PadOptions): `0x${string}`;
|
176
|
-
declare function padBytes(bytes: ByteArray, { dir, size }?: PadOptions): Uint8Array;
|
177
|
-
|
178
|
-
type TrimOptions = {
|
179
|
-
dir?: 'left' | 'right';
|
180
|
-
};
|
181
|
-
type TrimResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
|
182
|
-
declare function trim<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir }?: TrimOptions): TrimResult<TValue>;
|
183
|
-
|
184
|
-
/**
|
185
|
-
* @description Retrieves the size of the value (in bytes).
|
186
|
-
*
|
187
|
-
* @param value The value (hex or byte array) to retrieve the size of.
|
188
|
-
* @returns The size of the value (in bytes).
|
189
|
-
*/
|
190
|
-
declare function size(value: Hex | ByteArray): number;
|
191
|
-
|
192
|
-
type SliceResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
|
193
|
-
/**
|
194
|
-
* @description Returns a section of the hex or byte array given a start/end bytes offset.
|
195
|
-
*
|
196
|
-
* @param value The hex or byte array to slice.
|
197
|
-
* @param start The start offset (in bytes).
|
198
|
-
* @param end The end offset (in bytes).
|
199
|
-
*/
|
200
|
-
declare function slice<TValue extends ByteArray | Hex>(value: TValue, start?: number, end?: number): SliceResult<TValue>;
|
201
|
-
/**
|
202
|
-
* @description Returns a section of the byte array given a start/end bytes offset.
|
203
|
-
*
|
204
|
-
* @param value The byte array to slice.
|
205
|
-
* @param start The start offset (in bytes).
|
206
|
-
* @param end The end offset (in bytes).
|
207
|
-
*/
|
208
|
-
declare function sliceBytes(value: ByteArray, start?: number, end?: number): Uint8Array;
|
209
|
-
/**
|
210
|
-
* @description Returns a section of the hex value given a start/end bytes offset.
|
211
|
-
*
|
212
|
-
* @param value The hex value to slice.
|
213
|
-
* @param start The start offset (in bytes).
|
214
|
-
* @param end The end offset (in bytes).
|
215
|
-
*/
|
216
|
-
declare function sliceHex(value_: Hex, start?: number, end?: number): string;
|
217
|
-
|
218
|
-
/**
|
219
|
-
* @description Encodes a boolean into a hex string
|
220
|
-
*/
|
221
|
-
declare function boolToHex(value: boolean): Hex;
|
222
|
-
/**
|
223
|
-
* @description Encodes a bytes array into a hex string
|
224
|
-
*/
|
225
|
-
declare function bytesToHex(value: ByteArray): Hex;
|
226
|
-
/**
|
227
|
-
* @description Encodes a string, number, bigint, or ByteArray into a hex string
|
228
|
-
*/
|
229
|
-
declare function encodeHex(value: string | number | bigint | boolean | ByteArray): Hex;
|
230
|
-
type NumberToHexOpts$1 = {
|
231
|
-
signed?: boolean;
|
232
|
-
size: number;
|
233
|
-
} | {
|
234
|
-
signed?: never;
|
235
|
-
size?: never;
|
236
|
-
};
|
237
|
-
/**
|
238
|
-
* @description Encodes a number or bigint into a hex string
|
239
|
-
*/
|
240
|
-
declare function numberToHex(value_: number | bigint, opts?: NumberToHexOpts$1): Hex;
|
241
|
-
/**
|
242
|
-
* @description Encodes a UTF-8 string into a hex string
|
243
|
-
*/
|
244
|
-
declare function stringToHex(value: string): Hex;
|
245
|
-
|
246
|
-
/**
|
247
|
-
* @description Encodes a boolean into a byte array.
|
248
|
-
*/
|
249
|
-
declare function boolToBytes(value: boolean): Uint8Array;
|
250
|
-
/** @description Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array. */
|
251
|
-
declare function encodeBytes(value: string | bigint | number | boolean | Hex): ByteArray;
|
252
|
-
/**
|
253
|
-
* @description Encodes a hex string into a byte array.
|
254
|
-
*/
|
255
|
-
declare function hexToBytes(hex_: Hex): ByteArray;
|
256
|
-
/**
|
257
|
-
* @description Encodes a number into a byte array.
|
258
|
-
*/
|
259
|
-
declare function numberToBytes(value: bigint | number, opts?: NumberToHexOpts$1): Uint8Array;
|
260
|
-
/**
|
261
|
-
* @description Encodes a UTF-8 string into a byte array.
|
262
|
-
*/
|
263
|
-
declare function stringToBytes(value: string): ByteArray;
|
264
|
-
|
265
|
-
type RecursiveArray<T> = T | Array<RecursiveArray<T>>;
|
266
|
-
type To$1 = 'hex' | 'bytes';
|
267
|
-
type EncodeRlpResponse<TTo extends To$1> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
|
268
|
-
declare function encodeRlp<TTo extends To$1 = 'hex'>(hexOrBytes: RecursiveArray<Hex> | RecursiveArray<ByteArray>, to_?: TTo): EncodeRlpResponse<TTo>;
|
269
|
-
|
270
|
-
type DecodeBytesResponse<TTo> = TTo extends 'string' ? string : TTo extends 'hex' ? Hex : TTo extends 'bigint' ? bigint : TTo extends 'number' ? number : TTo extends 'boolean' ? boolean : never;
|
271
|
-
/**
|
272
|
-
* @description Decodes a byte array into a UTF-8 string, hex value, number, bigint or boolean.
|
273
|
-
*/
|
274
|
-
declare function decodeBytes<TTo extends 'string' | 'hex' | 'bigint' | 'number' | 'boolean'>(bytes: ByteArray, to: TTo): DecodeBytesResponse<TTo>;
|
275
|
-
/**
|
276
|
-
* @description Decodes a byte array into a bigint.
|
277
|
-
*/
|
278
|
-
declare function bytesToBigint(bytes: ByteArray): bigint;
|
279
|
-
/**
|
280
|
-
* @description Decodes a byte array into a boolean.
|
281
|
-
*/
|
282
|
-
declare function bytesToBool(bytes: ByteArray): boolean;
|
283
|
-
|
284
|
-
/**
|
285
|
-
* @description Decodes a byte array into a number.
|
286
|
-
*/
|
287
|
-
declare function bytesToNumber(bytes: ByteArray): number;
|
288
|
-
/**
|
289
|
-
* @description Decodes a byte array into a UTF-8 string.
|
290
|
-
*/
|
291
|
-
declare function bytesToString(bytes: ByteArray): string;
|
292
|
-
|
293
|
-
type DecodeHexResponse<TTo> = TTo extends 'string' ? string : TTo extends 'bigint' ? bigint : TTo extends 'number' ? number : TTo extends 'bytes' ? ByteArray : TTo extends 'boolean' ? boolean : never;
|
294
|
-
/**
|
295
|
-
* @description Decodes a hex string into a string, number, bigint, boolean, or bytes32 array.
|
296
|
-
*/
|
297
|
-
declare function decodeHex<TTo extends 'string' | 'bigint' | 'number' | 'bytes' | 'boolean'>(hex: Hex, to: TTo): DecodeHexResponse<TTo>;
|
298
|
-
type HexToBigIntOpts = {
|
299
|
-
signed?: boolean;
|
300
|
-
};
|
301
|
-
/**
|
302
|
-
* @description Decodes a hex string into a bigint.
|
303
|
-
*/
|
304
|
-
declare function hexToBigInt(hex: Hex, opts?: HexToBigIntOpts): bigint;
|
305
|
-
/**
|
306
|
-
* @description Decodes a hex string into a boolean.
|
307
|
-
*/
|
308
|
-
declare function hexToBool(hex: Hex): boolean;
|
309
|
-
type NumberToHexOpts = HexToBigIntOpts;
|
310
|
-
/**
|
311
|
-
* @description Decodes a hex string into a number.
|
312
|
-
*/
|
313
|
-
declare function hexToNumber(hex: Hex, opts?: NumberToHexOpts): number;
|
314
|
-
/**
|
315
|
-
* @description Decodes a hex string into a UTF-8 string.
|
316
|
-
*/
|
317
|
-
declare function hexToString(hex: Hex): string;
|
318
|
-
|
319
|
-
type DecodeRlpResponse<TTo> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
|
320
|
-
declare function decodeRlp<TTo extends 'bytes' | 'hex'>(value: ByteArray | Hex, to: TTo): RecursiveArray<DecodeRlpResponse<TTo>>;
|
321
|
-
|
322
|
-
declare const getEventSignature: (event: EventDefinition) => `0x${string}`;
|
323
|
-
|
324
|
-
declare const getFunctionSignature: (fn: string) => `0x${string}`;
|
325
|
-
|
326
|
-
type To = 'hex' | 'bytes';
|
327
|
-
type Keccak256Hash<TTo extends To> = (TTo extends 'bytes' ? ByteArray : never) | (TTo extends 'hex' ? Hex : never);
|
328
|
-
declare function keccak256<TTo extends To = 'hex'>(value: ByteArray, to_?: TTo): Keccak256Hash<TTo>;
|
329
|
-
|
330
|
-
declare const etherUnits: {
|
331
|
-
gwei: number;
|
332
|
-
wei: number;
|
333
|
-
};
|
334
|
-
declare const gweiUnits: {
|
335
|
-
ether: number;
|
336
|
-
wei: number;
|
337
|
-
};
|
338
|
-
declare const weiUnits: {
|
339
|
-
ether: number;
|
340
|
-
gwei: number;
|
341
|
-
};
|
342
|
-
|
343
|
-
declare function formatEther(wei: bigint, unit?: 'wei' | 'gwei'): string;
|
344
|
-
|
345
|
-
declare function formatGwei(wei: bigint, unit?: 'wei'): string;
|
346
|
-
|
347
|
-
declare function formatUnit(value: bigint, decimals: number): string;
|
348
|
-
|
349
|
-
declare function parseUnit(value: `${number}`, decimals: number): bigint;
|
350
|
-
|
351
|
-
declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
352
|
-
|
353
|
-
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
354
|
-
|
355
|
-
export { isAddressEqual as $, decodeFunctionResult as A, BaseError as B, ContractFunctionExecutionError as C, DecodeAbiArgs as D, EncodeAbiArgs as E, decodeHex as F, GetContractAddressOptions as G, decodeRlp as H, encodeAbi as I, encodeBytes as J, encodeDeployData as K, encodeErrorResult as L, encodeEventTopics as M, encodeFunctionData as N, encodeFunctionResult as O, encodeHex as P, encodeRlp as Q, etherUnits as R, getAddress as S, getContractAddress as T, getCreateAddress as U, getCreate2Address as V, getEventSignature as W, getFunctionSignature as X, gweiUnits as Y, formatEther as Z, isAddress as _, ContractFunctionRevertedError as a, isBytes as a0, isHex as a1, hexToBigInt as a2, hexToBool as a3, hexToBytes as a4, hexToString as a5, keccak256 as a6, numberToBytes as a7, pad as a8, padBytes as a9, padHex as aa, parseEther as ab, parseGwei as ac, parseUnit as ad, formatGwei as ae, formatUnit as af, hexToNumber as ag, numberToHex as ah, size as ai, slice as aj, sliceBytes as ak, sliceHex as al, stringToBytes as am, stringToHex as an, trim as ao, weiUnits as ap, DecodeErrorResultResponse as aq, getAbiItem as ar, ContractFunctionZeroDataError as b, DecodeErrorResultArgs as c, DecodeFunctionDataArgs as d, DecodeFunctionResultArgs as e, DecodeFunctionResultResponse as f, EncodeDeployDataArgs as g, EncodeErrorResultArgs as h, EncodeEventTopicsArgs as i, EncodeFunctionDataArgs as j, EncodeFunctionResultArgs as k, GetCreateAddressOptions as l, GetCreate2AddressOptions as m, GetAbiItemArgs as n, EncodeRlpResponse as o, bytesToHex as p, bytesToString as q, boolToBytes as r, boolToHex as s, bytesToBigint as t, bytesToBool as u, bytesToNumber as v, decodeAbi as w, decodeBytes as x, decodeErrorResult as y, decodeFunctionData as z };
|
package/dist/rpc-26932bae.d.ts
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
type SuccessResult<T> = {
|
2
|
-
method?: never;
|
3
|
-
result: T;
|
4
|
-
error?: never;
|
5
|
-
};
|
6
|
-
type ErrorResult<T> = {
|
7
|
-
method?: never;
|
8
|
-
result?: never;
|
9
|
-
error: T;
|
10
|
-
};
|
11
|
-
type Subscription<TResult, TError> = {
|
12
|
-
method: 'eth_subscription';
|
13
|
-
error?: never;
|
14
|
-
result?: never;
|
15
|
-
params: {
|
16
|
-
subscription: string;
|
17
|
-
} & ({
|
18
|
-
result: TResult;
|
19
|
-
error?: never;
|
20
|
-
} | {
|
21
|
-
result?: never;
|
22
|
-
error: TError;
|
23
|
-
});
|
24
|
-
};
|
25
|
-
type RpcRequest = {
|
26
|
-
method: string;
|
27
|
-
params?: any[];
|
28
|
-
};
|
29
|
-
type RpcResponse<TResult = any, TError = any> = {
|
30
|
-
jsonrpc: `${number}`;
|
31
|
-
id: number;
|
32
|
-
} & (SuccessResult<TResult> | ErrorResult<TError> | Subscription<TResult, TError>);
|
33
|
-
declare function http(url: string, { body, retryDelay, retryCount, timeout, }: {
|
34
|
-
body: RpcRequest;
|
35
|
-
retryDelay?: number;
|
36
|
-
retryCount?: number;
|
37
|
-
timeout?: number;
|
38
|
-
}): Promise<RpcResponse<any, any>>;
|
39
|
-
type Id = string | number;
|
40
|
-
type CallbackFn = (message: any) => void;
|
41
|
-
type CallbackMap = Map<Id, CallbackFn>;
|
42
|
-
type Socket = WebSocket & {
|
43
|
-
requests: CallbackMap;
|
44
|
-
subscriptions: CallbackMap;
|
45
|
-
};
|
46
|
-
declare function webSocket(socket: Socket, { body, onData, onError, }: {
|
47
|
-
body: RpcRequest;
|
48
|
-
onData?: (message: RpcResponse) => void;
|
49
|
-
onError?: (message: RpcResponse['error']) => void;
|
50
|
-
}): Socket;
|
51
|
-
declare function webSocketAsync(socket: Socket, { body, timeout, }: {
|
52
|
-
body: RpcRequest;
|
53
|
-
timeout?: number;
|
54
|
-
}): Promise<RpcResponse<any, any>>;
|
55
|
-
declare const rpc: {
|
56
|
-
http: typeof http;
|
57
|
-
webSocket: typeof webSocket;
|
58
|
-
webSocketAsync: typeof webSocketAsync;
|
59
|
-
};
|
60
|
-
|
61
|
-
export { RpcResponse as R, rpc as r };
|
@@ -1,156 +0,0 @@
|
|
1
|
-
import { a as Hash, o as RpcTransaction, A as Address, V as Quantity, s as TransactionRequest, H as Hex } from './chain-afa13f5a.js';
|
2
|
-
import { T as TestClient } from './createTestClient-5f4532c4.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 };
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { C as Chain, A as Address, H as Hex, B as ByteArray } from './chain-afa13f5a.js';
|
2
|
-
import { W as WalletClient } from './createWalletClient-9ec3df4f.js';
|
3
|
-
import { a as WalletPermission, b as WatchAssetParams } from './eip1193-9317a312.js';
|
4
|
-
|
5
|
-
declare function addChain(client: WalletClient, chain: Chain): Promise<void>;
|
6
|
-
|
7
|
-
declare function getAccounts(client: WalletClient): Promise<`0x${string}`[]>;
|
8
|
-
|
9
|
-
type GetPermissionsResponse = WalletPermission[];
|
10
|
-
declare function getPermissions(client: WalletClient): Promise<WalletPermission[]>;
|
11
|
-
|
12
|
-
declare function requestAccounts(client: WalletClient): Promise<`0x${string}`[]>;
|
13
|
-
|
14
|
-
type RequestPermissionsArgs = {
|
15
|
-
eth_accounts: Record<string, any>;
|
16
|
-
} & {
|
17
|
-
[key: string]: Record<string, any>;
|
18
|
-
};
|
19
|
-
type RequestPermissionsResponse = WalletPermission[];
|
20
|
-
declare function requestPermissions(client: WalletClient, permissions: RequestPermissionsArgs): Promise<WalletPermission[]>;
|
21
|
-
|
22
|
-
type SignMessageArgs = {
|
23
|
-
from: Address;
|
24
|
-
data: Hex | ByteArray;
|
25
|
-
};
|
26
|
-
type SignMessageResponse = Hex;
|
27
|
-
declare function signMessage(client: WalletClient, { from, data: data_ }: SignMessageArgs): Promise<SignMessageResponse>;
|
28
|
-
|
29
|
-
type SwitchChainArgs = {
|
30
|
-
id: Chain['id'];
|
31
|
-
};
|
32
|
-
declare function switchChain(client: WalletClient, { id }: SwitchChainArgs): Promise<void>;
|
33
|
-
|
34
|
-
type WatchAssetArgs = WatchAssetParams;
|
35
|
-
type WatchAssetResponse = boolean;
|
36
|
-
declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
|
37
|
-
|
38
|
-
export { GetPermissionsResponse as G, RequestPermissionsResponse as R, SignMessageArgs as S, WatchAssetArgs as W, SignMessageResponse as a, SwitchChainArgs as b, WatchAssetResponse as c, addChain as d, getPermissions as e, requestPermissions as f, getAccounts as g, switchChain as h, requestAccounts as r, signMessage as s, watchAsset as w };
|