viem 0.0.1-sushi.26 → 0.1.0
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/LICENSE +1 -1
- package/README.md +132 -2
- package/abi/package.json +4 -0
- package/dist/abi.d.ts +6 -0
- package/dist/abi.js +21 -0
- package/dist/abi.js.map +1 -0
- package/dist/abi.mjs +21 -0
- package/dist/abi.mjs.map +1 -0
- package/dist/chain-819c7ff7.d.ts +553 -0
- package/dist/{chain-c4ccb458.d.ts → chain-a4f98ba3.d.ts} +1 -1
- package/dist/chains.d.ts +5 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/chunk-APZXOA44.mjs +208 -0
- package/dist/chunk-APZXOA44.mjs.map +1 -0
- package/dist/chunk-HCZO3OIX.js +208 -0
- package/dist/chunk-HCZO3OIX.js.map +1 -0
- package/dist/{chunk-SD5X7F4U.mjs → chunk-I7AINPMM.mjs} +2756 -456
- package/dist/chunk-I7AINPMM.mjs.map +1 -0
- package/dist/chunk-QJNPIGP5.js +5326 -0
- package/dist/chunk-QJNPIGP5.js.map +1 -0
- package/dist/contract.d.ts +9 -122
- package/dist/contract.js +4 -4
- package/dist/contract.mjs +18 -18
- package/dist/{createClient-68ee4bb4.d.ts → createClient-a47ae6f5.d.ts} +13 -13
- package/dist/createPublicClient-e2eae0fc.d.ts +771 -0
- package/dist/{eip1193-6f9ba163.d.ts → eip1193-a882d1b8.d.ts} +14 -3
- package/dist/encodeFunctionResult-9eb553ce.d.ts +75 -0
- package/dist/encodePacked-4c019ed8.d.ts +12 -0
- package/dist/ens.d.ts +8 -69
- package/dist/ens.js +4 -199
- package/dist/ens.js.map +1 -1
- package/dist/ens.mjs +6 -201
- package/dist/ens.mjs.map +1 -1
- package/dist/formatAbiItem-622d2303.d.ts +14 -0
- package/dist/getAbiItem-159f3263.d.ts +22 -0
- package/dist/index.d.ts +106 -55
- package/dist/index.js +451 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +445 -35
- package/dist/index.mjs.map +1 -1
- package/dist/namehash-afff0feb.d.ts +25 -0
- package/dist/parseGwei-a2d0d77a.d.ts +497 -0
- package/dist/public.d.ts +11 -336
- package/dist/public.js +4 -3
- package/dist/public.mjs +3 -2
- package/dist/test-13f4413b.d.ts +205 -0
- package/dist/test.d.ts +8 -149
- package/dist/test.js +19 -222
- package/dist/test.js.map +1 -1
- package/dist/test.mjs +29 -232
- package/dist/test.mjs.map +1 -1
- package/dist/utils/index.d.ts +44 -231
- package/dist/utils/index.js +30 -2
- package/dist/utils/index.mjs +61 -33
- package/dist/wallet.d.ts +6 -41
- package/dist/wallet.js +2 -3
- package/dist/wallet.mjs +5 -6
- package/dist/window.d.ts +4 -2
- package/package.json +11 -6
- package/public/package.json +4 -0
- package/test/package.json +4 -0
- package/dist/call-ac509982.d.ts +0 -23
- package/dist/chain-f16512e8.d.ts +0 -372
- package/dist/chunk-2PFNLP3F.js +0 -192
- package/dist/chunk-2PFNLP3F.js.map +0 -1
- package/dist/chunk-5ND4P6QL.mjs +0 -192
- package/dist/chunk-5ND4P6QL.mjs.map +0 -1
- package/dist/chunk-NXCI5KQC.js +0 -3026
- package/dist/chunk-NXCI5KQC.js.map +0 -1
- package/dist/chunk-O7T5NQLB.mjs +0 -1091
- package/dist/chunk-O7T5NQLB.mjs.map +0 -1
- package/dist/chunk-SD5X7F4U.mjs.map +0 -1
- package/dist/chunk-UTL6F7UN.js +0 -1091
- package/dist/chunk-UTL6F7UN.js.map +0 -1
- package/dist/contract-9e76e561.d.ts +0 -166
- package/dist/createPublicClient-b732194e.d.ts +0 -19
- package/dist/createTestClient-dedf321e.d.ts +0 -34
- package/dist/createWalletClient-75813d83.d.ts +0 -30
- package/dist/decodeErrorResult-0b934d23.d.ts +0 -16
- package/dist/getAbiItem-c8e6e7d4.d.ts +0 -97
- package/dist/readContract-4f6e2692.d.ts +0 -10
- package/dist/rpc-a5a7f376.d.ts +0 -121
- package/dist/sendTransaction-e713f90c.d.ts +0 -12
- package/dist/transactionReceipt-2a86c7c7.d.ts +0 -26
- package/dist/transactionRequest-c7794f5e.d.ts +0 -15
- package/dist/watchEvent-c346c12d.d.ts +0 -41
- package/src/_test/abis.ts +0 -1420
- package/src/_test/bench.ts +0 -15
- package/src/_test/constants.ts +0 -63
- package/src/_test/generated.ts +0 -128
- 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 -155
- package/src/actions/ens/getEnsAddress.bench.ts +0 -26
- package/src/actions/ens/getEnsAddress.test.ts +0 -97
- package/src/actions/ens/getEnsAddress.ts +0 -122
- package/src/actions/ens/getEnsName.bench.ts +0 -30
- package/src/actions/ens/getEnsName.test.ts +0 -101
- package/src/actions/ens/getEnsName.ts +0 -106
- package/src/actions/ens/index.test.ts +0 -12
- package/src/actions/ens/index.ts +0 -3
- 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 -277
- package/src/actions/public/createEventFilter.ts +0 -93
- 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/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 -383
- package/src/actions/public/getFilterChanges.ts +0 -23
- package/src/actions/public/getFilterLogs.test.ts +0 -297
- 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 -306
- 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 -43
- package/src/actions/public/index.ts +0 -146
- package/src/actions/public/multicall.test.ts +0 -452
- package/src/actions/public/multicall.ts +0 -108
- 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 -91
- 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/deployContract.test.ts +0 -55
- package/src/actions/wallet/deployContract.ts +0 -38
- 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 -21
- package/src/actions/wallet/index.ts +0 -36
- 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 -439
- 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 -393
- package/src/clients/transports/fallback.ts +0 -58
- 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 -164
- package/src/clients/transports/webSocket.ts +0 -118
- 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/contract.test.ts +0 -32
- package/src/contract.ts +0 -68
- package/src/ens.test.ts +0 -15
- package/src/ens.ts +0 -8
- package/src/errors/abi.test.ts +0 -81
- package/src/errors/abi.ts +0 -254
- 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/chain.test.ts +0 -46
- package/src/errors/chain.ts +0 -33
- 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 -82
- 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 -116
- package/src/index.ts +0 -132
- package/src/public.test.ts +0 -36
- package/src/public.ts +0 -76
- package/src/test.test.ts +0 -38
- package/src/test.ts +0 -52
- package/src/types/block.ts +0 -71
- package/src/types/chain.ts +0 -6
- package/src/types/contract.ts +0 -497
- 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 -84
- 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 -88
- 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/decodeEventLog.test.ts +0 -542
- package/src/utils/abi/decodeEventLog.ts +0 -107
- package/src/utils/abi/decodeFunctionData.test.ts +0 -138
- package/src/utils/abi/decodeFunctionData.ts +0 -32
- 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 -42
- 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 -24
- package/src/utils/abi/index.ts +0 -48
- 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 -428
- package/src/utils/buildRequest.ts +0 -72
- 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 -14
- package/src/utils/ens/index.ts +0 -7
- 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/ens/packetToBytes.test.ts +0 -11
- package/src/utils/ens/packetToBytes.ts +0 -29
- 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 -111
- package/src/utils/index.ts +0 -142
- 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 -990
- package/src/utils/rpc.ts +0 -294
- 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.test.ts +0 -19
- package/src/wallet.ts +0 -23
- package/src/window.ts +0 -1
package/dist/test.mjs
CHANGED
@@ -1,236 +1,33 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
const { pending, queued } = await client.request({
|
32
|
-
method: "txpool_status"
|
33
|
-
});
|
34
|
-
return {
|
35
|
-
pending: hexToNumber(pending),
|
36
|
-
queued: hexToNumber(queued)
|
37
|
-
};
|
38
|
-
}
|
39
|
-
|
40
|
-
// src/actions/test/impersonateAccount.ts
|
41
|
-
async function impersonateAccount(client, { address }) {
|
42
|
-
return await client.request({
|
43
|
-
method: `${client.mode}_impersonateAccount`,
|
44
|
-
params: [address]
|
45
|
-
});
|
46
|
-
}
|
47
|
-
|
48
|
-
// src/actions/test/increaseTime.ts
|
49
|
-
async function increaseTime(client, { seconds }) {
|
50
|
-
return await client.request({
|
51
|
-
method: "evm_increaseTime",
|
52
|
-
params: [numberToHex(seconds)]
|
53
|
-
});
|
54
|
-
}
|
55
|
-
|
56
|
-
// src/actions/test/inspectTxpool.ts
|
57
|
-
async function inspectTxpool(client) {
|
58
|
-
return await client.request({
|
59
|
-
method: "txpool_inspect"
|
60
|
-
});
|
61
|
-
}
|
62
|
-
|
63
|
-
// src/actions/test/mine.ts
|
64
|
-
async function mine(client, { blocks, interval }) {
|
65
|
-
return await client.request({
|
66
|
-
method: `${client.mode}_mine`,
|
67
|
-
params: [numberToHex(blocks), numberToHex(interval || 0)]
|
68
|
-
});
|
69
|
-
}
|
70
|
-
|
71
|
-
// src/actions/test/removeBlockTimestampInterval.ts
|
72
|
-
async function removeBlockTimestampInterval(client) {
|
73
|
-
return await client.request({
|
74
|
-
method: `${client.mode}_removeBlockTimestampInterval`
|
75
|
-
});
|
76
|
-
}
|
77
|
-
|
78
|
-
// src/actions/test/reset.ts
|
79
|
-
async function reset(client, { blockNumber, jsonRpcUrl } = {}) {
|
80
|
-
return await client.request({
|
81
|
-
method: `${client.mode}_reset`,
|
82
|
-
params: [{ forking: { blockNumber: Number(blockNumber), jsonRpcUrl } }]
|
83
|
-
});
|
84
|
-
}
|
85
|
-
|
86
|
-
// src/actions/test/revert.ts
|
87
|
-
async function revert(client, { id }) {
|
88
|
-
return await client.request({
|
89
|
-
method: "evm_revert",
|
90
|
-
params: [id]
|
91
|
-
});
|
92
|
-
}
|
93
|
-
|
94
|
-
// src/actions/test/sendUnsignedTransaction.ts
|
95
|
-
async function sendUnsignedTransaction(client, request) {
|
96
|
-
const request_ = formatTransactionRequest(request);
|
97
|
-
const hash = await client.request({
|
98
|
-
method: "eth_sendUnsignedTransaction",
|
99
|
-
params: [request_]
|
100
|
-
});
|
101
|
-
return hash;
|
102
|
-
}
|
103
|
-
|
104
|
-
// src/actions/test/setAutomine.ts
|
105
|
-
async function setAutomine(client, enabled) {
|
106
|
-
return await client.request({
|
107
|
-
method: "evm_setAutomine",
|
108
|
-
params: [enabled]
|
109
|
-
});
|
110
|
-
}
|
111
|
-
|
112
|
-
// src/actions/test/setBalance.ts
|
113
|
-
async function setBalance(client, { address, value }) {
|
114
|
-
return await client.request({
|
115
|
-
method: `${client.mode}_setBalance`,
|
116
|
-
params: [address, numberToHex(value)]
|
117
|
-
});
|
118
|
-
}
|
119
|
-
|
120
|
-
// src/actions/test/setBlockGasLimit.ts
|
121
|
-
async function setBlockGasLimit(client, { gasLimit }) {
|
122
|
-
return await client.request({
|
123
|
-
method: "evm_setBlockGasLimit",
|
124
|
-
params: [numberToHex(gasLimit)]
|
125
|
-
});
|
126
|
-
}
|
127
|
-
|
128
|
-
// src/actions/test/setBlockTimestampInterval.ts
|
129
|
-
async function setBlockTimestampInterval(client, { interval }) {
|
130
|
-
return await client.request({
|
131
|
-
method: `${client.mode}_setBlockTimestampInterval`,
|
132
|
-
params: [interval]
|
133
|
-
});
|
134
|
-
}
|
135
|
-
|
136
|
-
// src/actions/test/setCode.ts
|
137
|
-
async function setCode(client, { address, bytecode }) {
|
138
|
-
return await client.request({
|
139
|
-
method: `${client.mode}_setCode`,
|
140
|
-
params: [address, bytecode]
|
141
|
-
});
|
142
|
-
}
|
143
|
-
|
144
|
-
// src/actions/test/setCoinbase.ts
|
145
|
-
async function setCoinbase(client, { address }) {
|
146
|
-
return await client.request({
|
147
|
-
method: `${client.mode}_setCoinbase`,
|
148
|
-
params: [address]
|
149
|
-
});
|
150
|
-
}
|
151
|
-
|
152
|
-
// src/actions/test/setIntervalMining.ts
|
153
|
-
async function setIntervalMining(client, { interval }) {
|
154
|
-
return await client.request({
|
155
|
-
method: "evm_setIntervalMining",
|
156
|
-
params: [interval]
|
157
|
-
});
|
158
|
-
}
|
159
|
-
|
160
|
-
// src/actions/test/setLoggingEnabled.ts
|
161
|
-
async function setLoggingEnabled(client, enabled) {
|
162
|
-
return await client.request({
|
163
|
-
method: `${client.mode}_setLoggingEnabled`,
|
164
|
-
params: [enabled]
|
165
|
-
});
|
166
|
-
}
|
167
|
-
|
168
|
-
// src/actions/test/setMinGasPrice.ts
|
169
|
-
async function setMinGasPrice(client, { gasPrice }) {
|
170
|
-
return await client.request({
|
171
|
-
method: `${client.mode}_setMinGasPrice`,
|
172
|
-
params: [numberToHex(gasPrice)]
|
173
|
-
});
|
174
|
-
}
|
175
|
-
|
176
|
-
// src/actions/test/setNextBlockBaseFeePerGas.ts
|
177
|
-
async function setNextBlockBaseFeePerGas(client, { baseFeePerGas }) {
|
178
|
-
return await client.request({
|
179
|
-
method: `${client.mode}_setNextBlockBaseFeePerGas`,
|
180
|
-
params: [numberToHex(baseFeePerGas)]
|
181
|
-
});
|
182
|
-
}
|
183
|
-
|
184
|
-
// src/actions/test/setNextBlockTimestamp.ts
|
185
|
-
async function setNextBlockTimestamp(client, { timestamp }) {
|
186
|
-
return await client.request({
|
187
|
-
method: "evm_setNextBlockTimestamp",
|
188
|
-
params: [numberToHex(timestamp)]
|
189
|
-
});
|
190
|
-
}
|
191
|
-
|
192
|
-
// src/actions/test/setNonce.ts
|
193
|
-
async function setNonce(client, { address, nonce }) {
|
194
|
-
return await client.request({
|
195
|
-
method: `${client.mode}_setNonce`,
|
196
|
-
params: [address, numberToHex(nonce)]
|
197
|
-
});
|
198
|
-
}
|
199
|
-
|
200
|
-
// src/actions/test/setRpcUrl.ts
|
201
|
-
async function setRpcUrl(client, jsonRpcUrl) {
|
202
|
-
return await client.request({
|
203
|
-
method: `${client.mode}_setRpcUrl`,
|
204
|
-
params: [jsonRpcUrl]
|
205
|
-
});
|
206
|
-
}
|
207
|
-
|
208
|
-
// src/actions/test/setStorageAt.ts
|
209
|
-
async function setStorageAt(client, { address, index, value }) {
|
210
|
-
return await client.request({
|
211
|
-
method: `${client.mode}_setStorageAt`,
|
212
|
-
params: [
|
213
|
-
address,
|
214
|
-
typeof index === "number" ? numberToHex(index) : index,
|
215
|
-
value
|
216
|
-
]
|
217
|
-
});
|
218
|
-
}
|
219
|
-
|
220
|
-
// src/actions/test/snapshot.ts
|
221
|
-
async function snapshot(client) {
|
222
|
-
return await client.request({
|
223
|
-
method: "evm_snapshot"
|
224
|
-
});
|
225
|
-
}
|
226
|
-
|
227
|
-
// src/actions/test/stopImpersonatingAccount.ts
|
228
|
-
async function stopImpersonatingAccount(client, { address }) {
|
229
|
-
return await client.request({
|
230
|
-
method: `${client.mode}_stopImpersonatingAccount`,
|
231
|
-
params: [address]
|
232
|
-
});
|
233
|
-
}
|
2
|
+
dropTransaction,
|
3
|
+
getAutomine,
|
4
|
+
getTxpoolContent,
|
5
|
+
getTxpoolStatus,
|
6
|
+
impersonateAccount,
|
7
|
+
increaseTime,
|
8
|
+
inspectTxpool,
|
9
|
+
mine,
|
10
|
+
removeBlockTimestampInterval,
|
11
|
+
reset,
|
12
|
+
revert,
|
13
|
+
sendUnsignedTransaction,
|
14
|
+
setAutomine,
|
15
|
+
setBalance,
|
16
|
+
setBlockGasLimit,
|
17
|
+
setBlockTimestampInterval,
|
18
|
+
setCode,
|
19
|
+
setCoinbase,
|
20
|
+
setIntervalMining,
|
21
|
+
setLoggingEnabled,
|
22
|
+
setMinGasPrice,
|
23
|
+
setNextBlockBaseFeePerGas,
|
24
|
+
setNextBlockTimestamp,
|
25
|
+
setNonce,
|
26
|
+
setRpcUrl,
|
27
|
+
setStorageAt,
|
28
|
+
snapshot,
|
29
|
+
stopImpersonatingAccount
|
30
|
+
} from "./chunk-I7AINPMM.mjs";
|
234
31
|
export {
|
235
32
|
dropTransaction,
|
236
33
|
getAutomine,
|
package/dist/test.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/actions/test/dropTransaction.ts","../src/actions/test/getAutomine.ts","../src/actions/test/getTxpoolContent.ts","../src/actions/test/getTxpoolStatus.ts","../src/actions/test/impersonateAccount.ts","../src/actions/test/increaseTime.ts","../src/actions/test/inspectTxpool.ts","../src/actions/test/mine.ts","../src/actions/test/removeBlockTimestampInterval.ts","../src/actions/test/reset.ts","../src/actions/test/revert.ts","../src/actions/test/sendUnsignedTransaction.ts","../src/actions/test/setAutomine.ts","../src/actions/test/setBalance.ts","../src/actions/test/setBlockGasLimit.ts","../src/actions/test/setBlockTimestampInterval.ts","../src/actions/test/setCode.ts","../src/actions/test/setCoinbase.ts","../src/actions/test/setIntervalMining.ts","../src/actions/test/setLoggingEnabled.ts","../src/actions/test/setMinGasPrice.ts","../src/actions/test/setNextBlockBaseFeePerGas.ts","../src/actions/test/setNextBlockTimestamp.ts","../src/actions/test/setNonce.ts","../src/actions/test/setRpcUrl.ts","../src/actions/test/setStorageAt.ts","../src/actions/test/snapshot.ts","../src/actions/test/stopImpersonatingAccount.ts"],"sourcesContent":["import type { TestClient } from '../../clients'\nimport type { Hash } from '../../types'\n\nexport type DropTransactionArgs = {\n /** The hash of the transaction to drop. */\n hash: Hash\n}\n\nexport async function dropTransaction(\n client: TestClient,\n { hash }: DropTransactionArgs,\n) {\n return await client.request({\n method: `${client.mode}_dropTransaction`,\n params: [hash],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type GetAutomineResponse = boolean\n\nexport async function getAutomine(\n client: TestClient,\n): Promise<GetAutomineResponse> {\n return await client.request({\n method: `${client.mode}_getAutomine`,\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function getTxpoolContent(client: TestClient) {\n return await client.request({\n method: 'txpool_content',\n })\n}\n","import type { TestClient } from '../../clients'\nimport { hexToNumber } from '../../utils'\n\nexport async function getTxpoolStatus(client: TestClient) {\n const { pending, queued } = await client.request({\n method: 'txpool_status',\n })\n return {\n pending: hexToNumber(pending),\n queued: hexToNumber(queued),\n }\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\n\nexport type ImpersonateAccountArgs = {\n /** The account to impersonate. */\n address: Address\n}\n\nexport async function impersonateAccount(\n client: TestClient,\n { address }: ImpersonateAccountArgs,\n) {\n return await client.request({\n method: `${client.mode}_impersonateAccount`,\n params: [address],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type IncreaseTimeArgs = {\n /** The amount of seconds to jump forward in time. */\n seconds: number\n}\n\nexport async function increaseTime(\n client: TestClient,\n { seconds }: IncreaseTimeArgs,\n) {\n return await client.request({\n method: 'evm_increaseTime',\n params: [numberToHex(seconds)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function inspectTxpool(client: TestClient) {\n return await client.request({\n method: 'txpool_inspect',\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type MineArgs = {\n /** Number of blocks to mine. */\n blocks: number\n /** Interval between each block in seconds. */\n interval?: number\n}\n\nexport async function mine(client: TestClient, { blocks, interval }: MineArgs) {\n return await client.request({\n method: `${client.mode}_mine`,\n params: [numberToHex(blocks), numberToHex(interval || 0)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function removeBlockTimestampInterval(client: TestClient) {\n return await client.request({\n method: `${client.mode}_removeBlockTimestampInterval`,\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type ResetArgs = {\n /** The block number to reset from. */\n blockNumber?: bigint\n /** The JSON RPC URL. */\n jsonRpcUrl?: string\n}\n\nexport async function reset(\n client: TestClient,\n { blockNumber, jsonRpcUrl }: ResetArgs = {},\n) {\n return await client.request({\n method: `${client.mode}_reset`,\n params: [{ forking: { blockNumber: Number(blockNumber), jsonRpcUrl } }],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Quantity } from '../../types'\n\nexport type RevertArgs = {\n /** The snapshot ID to revert to. */\n id: Quantity\n}\n\nexport async function revert(client: TestClient, { id }: RevertArgs) {\n return await client.request({\n method: 'evm_revert',\n params: [id],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Hash, TransactionRequest } from '../../types'\nimport { formatTransactionRequest } from '../../utils'\n\nexport type SendUnsignedTransactionArgs = TransactionRequest\n\nexport type SendUnsignedTransactionResponse = Hash\n\nexport async function sendUnsignedTransaction(\n client: TestClient,\n request: SendUnsignedTransactionArgs,\n): Promise<SendUnsignedTransactionResponse> {\n const request_ = formatTransactionRequest(request)\n const hash = await client.request({\n method: 'eth_sendUnsignedTransaction',\n params: [request_],\n })\n return hash\n}\n","import type { TestClient } from '../../clients'\n\nexport async function setAutomine(client: TestClient, enabled: boolean) {\n return await client.request({\n method: 'evm_setAutomine',\n params: [enabled],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\nimport { numberToHex } from '../../utils'\n\nexport type SetBalanceArgs = {\n /** The account address. */\n address: Address\n /** Amount (in wei) to set */\n value: bigint\n}\n\nexport async function setBalance(\n client: TestClient,\n { address, value }: SetBalanceArgs,\n) {\n return await client.request({\n method: `${client.mode}_setBalance`,\n params: [address, numberToHex(value)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetBlockGasLimitArgs = {\n /** Gas limit (in wei). */\n gasLimit: bigint\n}\n\nexport async function setBlockGasLimit(\n client: TestClient,\n { gasLimit }: SetBlockGasLimitArgs,\n) {\n return await client.request({\n method: 'evm_setBlockGasLimit',\n params: [numberToHex(gasLimit)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type SetBlockTimestampIntervalArgs = {\n /** The interval (in seconds). */\n interval: number\n}\n\nexport async function setBlockTimestampInterval(\n client: TestClient,\n { interval }: SetBlockTimestampIntervalArgs,\n) {\n return await client.request({\n method: `${client.mode}_setBlockTimestampInterval`,\n params: [interval],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address, Hex } from '../../types'\n\nexport type SetCodeArgs = {\n /** The account address. */\n address: Address\n /** The bytecode to set */\n bytecode: Hex\n}\n\nexport async function setCode(\n client: TestClient,\n { address, bytecode }: SetCodeArgs,\n) {\n return await client.request({\n method: `${client.mode}_setCode`,\n params: [address, bytecode],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\n\nexport type SetCoinbaseArgs = {\n /** The coinbase address. */\n address: Address\n}\n\nexport async function setCoinbase(\n client: TestClient,\n { address }: SetCoinbaseArgs,\n) {\n return await client.request({\n method: `${client.mode}_setCoinbase`,\n params: [address],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type SetIntervalMiningArgs = {\n /** The mining interval. */\n interval: number\n}\n\nexport async function setIntervalMining(\n client: TestClient,\n { interval }: SetIntervalMiningArgs,\n) {\n return await client.request({\n method: 'evm_setIntervalMining',\n params: [interval],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function setLoggingEnabled(client: TestClient, enabled: boolean) {\n return await client.request({\n method: `${client.mode}_setLoggingEnabled`,\n params: [enabled],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetMinGasPriceArgs = {\n /** The gas price. */\n gasPrice: bigint\n}\n\nexport async function setMinGasPrice(\n client: TestClient,\n { gasPrice }: SetMinGasPriceArgs,\n) {\n return await client.request({\n method: `${client.mode}_setMinGasPrice`,\n params: [numberToHex(gasPrice)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetNextBlockBaseFeePerGasArgs = {\n /** Base fee per gas (in wei). */\n baseFeePerGas: bigint\n}\n\nexport async function setNextBlockBaseFeePerGas(\n client: TestClient,\n { baseFeePerGas }: SetNextBlockBaseFeePerGasArgs,\n) {\n return await client.request({\n method: `${client.mode}_setNextBlockBaseFeePerGas`,\n params: [numberToHex(baseFeePerGas)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetNextBlockTimestampArgs = {\n /** The timestamp (in seconds). */\n timestamp: bigint\n}\n\nexport async function setNextBlockTimestamp(\n client: TestClient,\n { timestamp }: SetNextBlockTimestampArgs,\n) {\n return await client.request({\n method: 'evm_setNextBlockTimestamp',\n params: [numberToHex(timestamp)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\nimport { numberToHex } from '../../utils'\n\nexport type SetNonceArgs = {\n /** The account address. */\n address: Address\n /** The nonce to set. */\n nonce: number\n}\n\nexport async function setNonce(\n client: TestClient,\n { address, nonce }: SetNonceArgs,\n) {\n return await client.request({\n method: `${client.mode}_setNonce`,\n params: [address, numberToHex(nonce)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function setRpcUrl(client: TestClient, jsonRpcUrl: string) {\n return await client.request({\n method: `${client.mode}_setRpcUrl`,\n params: [jsonRpcUrl],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address, Hash, Hex } from '../../types'\nimport { numberToHex } from '../../utils'\n\nexport type SetStorageAtArgs = {\n /** The account address. */\n address: Address\n /** The storage slot (index). Can either be a number or hash value. */\n index: number | Hash\n /** The value to store as a 32 byte hex string. */\n value: Hex\n}\n\nexport async function setStorageAt(\n client: TestClient,\n { address, index, value }: SetStorageAtArgs,\n) {\n return await client.request({\n method: `${client.mode}_setStorageAt`,\n params: [\n address,\n typeof index === 'number' ? numberToHex(index) : index,\n value,\n ],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function snapshot(client: TestClient) {\n return await client.request({\n method: 'evm_snapshot',\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\n\nexport type StopImpersonatingAccountArgs = {\n /** The account to impersonate. */\n address: Address\n}\n\nexport async function stopImpersonatingAccount(\n client: TestClient,\n { address }: StopImpersonatingAccountArgs,\n) {\n return await client.request({\n method: `${client.mode}_stopImpersonatingAccount`,\n params: [address],\n })\n}\n"],"mappings":"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","names":[]}
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/utils/index.d.ts
CHANGED
@@ -1,41 +1,21 @@
|
|
1
|
-
|
2
|
-
export {
|
3
|
-
|
4
|
-
export {
|
5
|
-
export {
|
6
|
-
|
7
|
-
import { B as BaseError, C as
|
8
|
-
export { r as rpc } from '../
|
9
|
-
export {
|
10
|
-
|
11
|
-
|
12
|
-
import '
|
13
|
-
|
1
|
+
import { Address } from 'abitype';
|
2
|
+
export { ParseAbi, ParseAbiItem, ParseAbiParameter, ParseAbiParameters, parseAbi, parseAbiItem, parseAbiParameter, parseAbiParameters } from 'abitype';
|
3
|
+
export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from '../getAbiItem-159f3263.js';
|
4
|
+
export { D as DecodeErrorResultParameters, a as DecodeErrorResultReturnType, b as DecodeEventLogParameters, c as DecodeEventLogReturnType, d as DecodeFunctionDataParameters, e as DecodeFunctionResultParameters, f as DecodeFunctionResultReturnType, E as EncodeDeployDataParameters, g as EncodeErrorResultParameters, h as EncodeEventTopicsParameters, i as EncodeFunctionDataParameters, j as EncodeFunctionResultParameters, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from '../encodeFunctionResult-9eb553ce.js';
|
5
|
+
export { e as encodePacked } from '../encodePacked-4c019ed8.js';
|
6
|
+
export { a as formatAbiItem, f as formatAbiItemWithArgs } from '../formatAbiItem-622d2303.js';
|
7
|
+
import { B as BaseError, C as CallExecutionError, E as EstimateGasExecutionError, d as ExecutionRevertedError, F as FeeCapTooHighError, e as FeeCapTooLowError, h as NonceTooHighError, i as NonceTooLowError, N as NonceMaxValueError, I as InsufficientFundsError, f as IntrinsicGasTooHighError, g as IntrinsicGasTooLowError, l as TransactionTypeNotSupportedError, T as TipAboveFeeCapError, U as UnknownNodeError, k as TransactionExecutionError } from '../parseGwei-a2d0d77a.js';
|
8
|
+
export { G as GetContractAddressOptions, o as GetCreate2AddressOptions, p as GetCreateAddressOptions, H as HttpOptions, R as RpcResponse, ap as Socket, q as ToRlpReturnType, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, v as bytesToHex, w as bytesToNumber, x as bytesToString, y as formatEther, z as formatGwei, A as formatUnits, D as fromBytes, J as fromHex, K as fromRlp, L as getAccount, M as getAddress, O as getContractAddress, P as getContractError, Q as getCreate2Address, S as getCreateAddress, V as getEventSelector, X as getFunctionSelector, aq as getSocket, Y as hexToBigInt, Z as hexToBool, _ as hexToBytes, $ as hexToNumber, a0 as hexToString, a1 as isAddress, a2 as isAddressEqual, a3 as isBytes, a4 as isHex, a5 as keccak256, a6 as numberToBytes, a7 as numberToHex, a8 as pad, a9 as padBytes, aa as padHex, ab as parseEther, ac as parseGwei, ad as parseUnits, ar as rpc, ae as size, af as slice, ag as sliceBytes, ah as sliceHex, ai as stringToBytes, aj as stringToHex, ak as stringify, al as toBytes, am as toHex, an as toRlp, ao as trim } from '../parseGwei-a2d0d77a.js';
|
9
|
+
export { d as defineChain } from '../chain-a4f98ba3.js';
|
10
|
+
import { S as Formatter, C as Chain } from '../chain-819c7ff7.js';
|
11
|
+
export { I as ExtractFormatter, J as Formatted, K as FormattedTransaction, M as TransactionFormatter, ac as defineFormatter, N as defineTransaction, ad as format, O as formatTransaction, P as transactionType } from '../chain-819c7ff7.js';
|
12
|
+
import { C as CallParameters, E as EstimateGasParameters, S as SendTransactionParameters, W as WalletClient, P as PublicClient } from '../createPublicClient-e2eae0fc.js';
|
13
|
+
export { B as BlockFormatter, F as FormattedBlock, e as FormattedTransactionReceipt, f as FormattedTransactionRequest, T as TransactionReceiptFormatter, g as TransactionRequestFormatter, h as defineBlock, i as defineTransactionReceipt, j as defineTransactionRequest, k as formatBlock, l as formatTransactionRequest } from '../createPublicClient-e2eae0fc.js';
|
14
14
|
import 'isomorphic-ws';
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
from: Address;
|
20
|
-
nonce: bigint;
|
21
|
-
};
|
22
|
-
type GetCreate2AddressOptions = {
|
23
|
-
bytecode: ByteArray | Hex;
|
24
|
-
from: Address;
|
25
|
-
salt: ByteArray | Hex;
|
26
|
-
};
|
27
|
-
type GetContractAddressOptions = ({
|
28
|
-
opcode?: 'CREATE';
|
29
|
-
} & GetCreateAddressOptions) | ({
|
30
|
-
opcode: 'CREATE2';
|
31
|
-
} & GetCreate2AddressOptions);
|
32
|
-
declare function getContractAddress(opts: GetContractAddressOptions): `0x${string}`;
|
33
|
-
declare function getCreateAddress(opts: GetCreateAddressOptions): `0x${string}`;
|
34
|
-
declare function getCreate2Address(opts: GetCreate2AddressOptions): `0x${string}`;
|
35
|
-
|
36
|
-
declare function isAddress(address: Address): boolean;
|
37
|
-
|
38
|
-
declare function isAddressEqual(a: Address, b: Address): boolean;
|
15
|
+
import '@wagmi/chains';
|
16
|
+
import 'ethers@6/types/providers';
|
17
|
+
import '../eip1193-a882d1b8.js';
|
18
|
+
import '../createClient-a47ae6f5.js';
|
39
19
|
|
40
20
|
declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest, { retryDelay, retryCount, }?: {
|
41
21
|
retryDelay?: number;
|
@@ -55,68 +35,6 @@ declare function extractFunctionParams(def: string): {
|
|
55
35
|
}[] | undefined;
|
56
36
|
declare function extractFunctionType(def: string): string | undefined;
|
57
37
|
|
58
|
-
declare function getContractError(err: BaseError, { abi, address, args, docsPath, functionName, sender, }: {
|
59
|
-
abi: Abi;
|
60
|
-
args: any;
|
61
|
-
address?: Address;
|
62
|
-
docsPath?: string;
|
63
|
-
functionName: string;
|
64
|
-
sender?: Address;
|
65
|
-
}): ContractFunctionExecutionError;
|
66
|
-
|
67
|
-
declare function isBytes(value: any): boolean;
|
68
|
-
|
69
|
-
declare function isHex(value: any): boolean;
|
70
|
-
|
71
|
-
type PadOptions = {
|
72
|
-
dir?: 'left' | 'right';
|
73
|
-
size?: number;
|
74
|
-
};
|
75
|
-
type PadResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
|
76
|
-
declare function pad<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir, size }?: PadOptions): PadResult<TValue>;
|
77
|
-
declare function padHex(hex_: Hex, { dir, size }?: PadOptions): `0x${string}`;
|
78
|
-
declare function padBytes(bytes: ByteArray, { dir, size }?: PadOptions): Uint8Array;
|
79
|
-
|
80
|
-
type TrimOptions = {
|
81
|
-
dir?: 'left' | 'right';
|
82
|
-
};
|
83
|
-
type TrimResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
|
84
|
-
declare function trim<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir }?: TrimOptions): TrimResult<TValue>;
|
85
|
-
|
86
|
-
/**
|
87
|
-
* @description Retrieves the size of the value (in bytes).
|
88
|
-
*
|
89
|
-
* @param value The value (hex or byte array) to retrieve the size of.
|
90
|
-
* @returns The size of the value (in bytes).
|
91
|
-
*/
|
92
|
-
declare function size(value: Hex | ByteArray): number;
|
93
|
-
|
94
|
-
type SliceResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
|
95
|
-
/**
|
96
|
-
* @description Returns a section of the hex or byte array given a start/end bytes offset.
|
97
|
-
*
|
98
|
-
* @param value The hex or byte array to slice.
|
99
|
-
* @param start The start offset (in bytes).
|
100
|
-
* @param end The end offset (in bytes).
|
101
|
-
*/
|
102
|
-
declare function slice<TValue extends ByteArray | Hex>(value: TValue, start?: number, end?: number): SliceResult<TValue>;
|
103
|
-
/**
|
104
|
-
* @description Returns a section of the byte array given a start/end bytes offset.
|
105
|
-
*
|
106
|
-
* @param value The byte array to slice.
|
107
|
-
* @param start The start offset (in bytes).
|
108
|
-
* @param end The end offset (in bytes).
|
109
|
-
*/
|
110
|
-
declare function sliceBytes(value: ByteArray, start?: number, end?: number): Uint8Array;
|
111
|
-
/**
|
112
|
-
* @description Returns a section of the hex value given a start/end bytes offset.
|
113
|
-
*
|
114
|
-
* @param value The hex value to slice.
|
115
|
-
* @param start The start offset (in bytes).
|
116
|
-
* @param end The end offset (in bytes).
|
117
|
-
*/
|
118
|
-
declare function sliceHex(value_: Hex, start?: number, end?: number): string;
|
119
|
-
|
120
38
|
/**
|
121
39
|
* @description Picks out the keys from `value` that exist in the formatter.
|
122
40
|
*/
|
@@ -124,143 +42,38 @@ declare function extract(value: Record<string, unknown>, { formatter }: {
|
|
124
42
|
formatter?: Formatter;
|
125
43
|
}): {};
|
126
44
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
/**
|
132
|
-
* @description Encodes a bytes array into a hex string
|
133
|
-
*/
|
134
|
-
declare function bytesToHex(value: ByteArray): Hex;
|
135
|
-
/**
|
136
|
-
* @description Encodes a string, number, bigint, or ByteArray into a hex string
|
137
|
-
*/
|
138
|
-
declare function encodeHex(value: string | number | bigint | boolean | ByteArray): Hex;
|
139
|
-
type NumberToHexOpts$1 = {
|
140
|
-
signed?: boolean;
|
141
|
-
size: number;
|
142
|
-
} | {
|
143
|
-
signed?: never;
|
144
|
-
size?: never;
|
145
|
-
};
|
146
|
-
/**
|
147
|
-
* @description Encodes a number or bigint into a hex string
|
148
|
-
*/
|
149
|
-
declare function numberToHex(value_: number | bigint, opts?: NumberToHexOpts$1): Hex;
|
150
|
-
/**
|
151
|
-
* @description Encodes a UTF-8 string into a hex string
|
152
|
-
*/
|
153
|
-
declare function stringToHex(value: string): Hex;
|
154
|
-
|
155
|
-
/**
|
156
|
-
* @description Encodes a boolean into a byte array.
|
157
|
-
*/
|
158
|
-
declare function boolToBytes(value: boolean): Uint8Array;
|
159
|
-
/** @description Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array. */
|
160
|
-
declare function encodeBytes(value: string | bigint | number | boolean | Hex): ByteArray;
|
161
|
-
/**
|
162
|
-
* @description Encodes a hex string into a byte array.
|
163
|
-
*/
|
164
|
-
declare function hexToBytes(hex_: Hex): ByteArray;
|
165
|
-
/**
|
166
|
-
* @description Encodes a number into a byte array.
|
167
|
-
*/
|
168
|
-
declare function numberToBytes(value: bigint | number, opts?: NumberToHexOpts$1): Uint8Array;
|
169
|
-
/**
|
170
|
-
* @description Encodes a UTF-8 string into a byte array.
|
171
|
-
*/
|
172
|
-
declare function stringToBytes(value: string): ByteArray;
|
173
|
-
|
174
|
-
type RecursiveArray<T> = T | Array<RecursiveArray<T>>;
|
175
|
-
type To$1 = 'hex' | 'bytes';
|
176
|
-
type EncodeRlpResponse<TTo extends To$1> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
|
177
|
-
declare function encodeRlp<TTo extends To$1 = 'hex'>(hexOrBytes: RecursiveArray<Hex> | RecursiveArray<ByteArray>, to_?: TTo): EncodeRlpResponse<TTo>;
|
178
|
-
|
179
|
-
type DecodeBytesResponse<TTo> = TTo extends 'string' ? string : TTo extends 'hex' ? Hex : TTo extends 'bigint' ? bigint : TTo extends 'number' ? number : TTo extends 'boolean' ? boolean : never;
|
180
|
-
/**
|
181
|
-
* @description Decodes a byte array into a UTF-8 string, hex value, number, bigint or boolean.
|
182
|
-
*/
|
183
|
-
declare function decodeBytes<TTo extends 'string' | 'hex' | 'bigint' | 'number' | 'boolean'>(bytes: ByteArray, to: TTo): DecodeBytesResponse<TTo>;
|
184
|
-
/**
|
185
|
-
* @description Decodes a byte array into a bigint.
|
186
|
-
*/
|
187
|
-
declare function bytesToBigint(bytes: ByteArray): bigint;
|
188
|
-
/**
|
189
|
-
* @description Decodes a byte array into a boolean.
|
190
|
-
*/
|
191
|
-
declare function bytesToBool(bytes: ByteArray): boolean;
|
192
|
-
|
193
|
-
/**
|
194
|
-
* @description Decodes a byte array into a number.
|
195
|
-
*/
|
196
|
-
declare function bytesToNumber(bytes: ByteArray): number;
|
197
|
-
/**
|
198
|
-
* @description Decodes a byte array into a UTF-8 string.
|
199
|
-
*/
|
200
|
-
declare function bytesToString(bytes: ByteArray): string;
|
201
|
-
|
202
|
-
type DecodeHexResponse<TTo> = TTo extends 'string' ? string : TTo extends 'bigint' ? bigint : TTo extends 'number' ? number : TTo extends 'bytes' ? ByteArray : TTo extends 'boolean' ? boolean : never;
|
203
|
-
/**
|
204
|
-
* @description Decodes a hex string into a string, number, bigint, boolean, or bytes32 array.
|
205
|
-
*/
|
206
|
-
declare function decodeHex<TTo extends 'string' | 'bigint' | 'number' | 'bytes' | 'boolean'>(hex: Hex, to: TTo): DecodeHexResponse<TTo>;
|
207
|
-
type HexToBigIntOpts = {
|
208
|
-
signed?: boolean;
|
209
|
-
};
|
210
|
-
/**
|
211
|
-
* @description Decodes a hex string into a bigint.
|
212
|
-
*/
|
213
|
-
declare function hexToBigInt(hex: Hex, opts?: HexToBigIntOpts): bigint;
|
214
|
-
/**
|
215
|
-
* @description Decodes a hex string into a boolean.
|
216
|
-
*/
|
217
|
-
declare function hexToBool(hex: Hex): boolean;
|
218
|
-
type NumberToHexOpts = HexToBigIntOpts;
|
219
|
-
/**
|
220
|
-
* @description Decodes a hex string into a number.
|
221
|
-
*/
|
222
|
-
declare function hexToNumber(hex: Hex, opts?: NumberToHexOpts): number;
|
223
|
-
/**
|
224
|
-
* @description Decodes a hex string into a UTF-8 string.
|
225
|
-
*/
|
226
|
-
declare function hexToString(hex: Hex): string;
|
45
|
+
declare function getCallError(err: BaseError, { docsPath, ...args }: CallParameters & {
|
46
|
+
chain?: Chain;
|
47
|
+
docsPath?: string;
|
48
|
+
}): CallExecutionError;
|
227
49
|
|
228
|
-
|
229
|
-
|
50
|
+
declare function getEstimateGasError(err: BaseError, { docsPath, ...args }: EstimateGasParameters & {
|
51
|
+
chain?: Chain;
|
52
|
+
docsPath?: string;
|
53
|
+
}): EstimateGasExecutionError;
|
230
54
|
|
231
|
-
declare
|
55
|
+
declare function containsNodeError(err: BaseError): boolean;
|
56
|
+
declare function getNodeError(err: BaseError, args: Partial<SendTransactionParameters<any>>): ExecutionRevertedError | FeeCapTooHighError | FeeCapTooLowError | NonceTooHighError | NonceTooLowError | NonceMaxValueError | InsufficientFundsError | IntrinsicGasTooHighError | IntrinsicGasTooLowError | TransactionTypeNotSupportedError | TipAboveFeeCapError | UnknownNodeError;
|
232
57
|
|
233
|
-
declare
|
58
|
+
declare function getTransactionError(err: BaseError, { docsPath, ...args }: SendTransactionParameters & {
|
59
|
+
docsPath?: string;
|
60
|
+
}): TransactionExecutionError;
|
234
61
|
|
235
|
-
|
236
|
-
|
237
|
-
declare
|
62
|
+
declare const arrayRegex: RegExp;
|
63
|
+
declare const bytesRegex: RegExp;
|
64
|
+
declare const integerRegex: RegExp;
|
238
65
|
|
239
|
-
declare function
|
66
|
+
declare function assertRequest(args: Partial<SendTransactionParameters<Chain>>): void;
|
240
67
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
declare const weiUnits: {
|
250
|
-
ether: number;
|
251
|
-
gwei: number;
|
68
|
+
type PrepareRequestParameters<TParameters extends SendTransactionParameters = SendTransactionParameters> = TParameters;
|
69
|
+
type PrepareRequestReturnType<TParameters extends SendTransactionParameters = SendTransactionParameters> = TParameters & {
|
70
|
+
from: Address;
|
71
|
+
gas: SendTransactionParameters['gas'];
|
72
|
+
gasPrice?: SendTransactionParameters['gasPrice'];
|
73
|
+
maxFeePerGas?: SendTransactionParameters['maxFeePerGas'];
|
74
|
+
maxPriorityFeePerGas?: SendTransactionParameters['maxPriorityFeePerGas'];
|
75
|
+
nonce: SendTransactionParameters['nonce'];
|
252
76
|
};
|
77
|
+
declare function prepareRequest<TParameters extends SendTransactionParameters>(client: WalletClient<any, any> | PublicClient<any, any>, args: PrepareRequestParameters<TParameters>): Promise<PrepareRequestReturnType<TParameters>>;
|
253
78
|
|
254
|
-
|
255
|
-
|
256
|
-
declare function formatGwei(wei: bigint, unit?: 'wei'): string;
|
257
|
-
|
258
|
-
declare function formatUnit(value: bigint, decimals: number): string;
|
259
|
-
|
260
|
-
declare function parseUnit(value: `${number}`, decimals: number): bigint;
|
261
|
-
|
262
|
-
declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
263
|
-
|
264
|
-
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
265
|
-
|
266
|
-
export { EncodeRlpResponse, GetContractAddressOptions, GetCreate2AddressOptions, GetCreateAddressOptions, boolToBytes, boolToHex, buildRequest, bytesToBigint, bytesToBool, bytesToHex, bytesToNumber, bytesToString, decodeBytes, decodeHex, decodeRlp, encodeBytes, encodeHex, encodeRlp, etherUnits, extract, extractFunctionName, extractFunctionParams, extractFunctionParts, extractFunctionType, formatEther, formatGwei, formatUnit, getAddress, getContractAddress, getContractError, getCreate2Address, getCreateAddress, getEventSignature, getFunctionSignature, gweiUnits, hexToBigInt, hexToBool, hexToBytes, hexToNumber, hexToString, isAddress, isAddressEqual, isBytes, isHex, keccak256, numberToBytes, numberToHex, pad, padBytes, padHex, parseEther, parseGwei, parseUnit, size, slice, sliceBytes, sliceHex, stringToBytes, stringToHex, stringify, trim, weiUnits };
|
79
|
+
export { arrayRegex, assertRequest, buildRequest, bytesRegex, containsNodeError, extract, extractFunctionName, extractFunctionParams, extractFunctionParts, extractFunctionType, getCallError, getEstimateGasError, getNodeError, getTransactionError, integerRegex, prepareRequest };
|