viem 0.0.1-alpha.25 → 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/dist/{call-ac509982.d.ts → call-3476b8ee.d.ts} +4 -5
- package/dist/{chain-f16512e8.d.ts → chain-42de87e5.d.ts} +1 -14
- package/dist/{chain-c4ccb458.d.ts → chain-b0cfb141.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-LEPQJNVO.mjs → chunk-BSAB6UH4.mjs} +2 -2
- package/dist/{chunk-LEPQJNVO.mjs.map → chunk-BSAB6UH4.mjs.map} +0 -0
- package/dist/{chunk-THMRUG4D.js → chunk-DSQO3E4F.js} +257 -398
- package/dist/chunk-DSQO3E4F.js.map +1 -0
- package/dist/{chunk-CD2XJOBJ.js → chunk-LINNE4N4.js} +136 -91
- package/dist/chunk-LINNE4N4.js.map +1 -0
- package/dist/{chunk-KSAO4Y4Q.mjs → chunk-PRG3BBPZ.mjs} +293 -434
- package/dist/chunk-PRG3BBPZ.mjs.map +1 -0
- package/dist/{chunk-2Y3UZMSP.mjs → chunk-QSIX64VZ.mjs} +61 -16
- package/dist/chunk-QSIX64VZ.mjs.map +1 -0
- package/dist/{chunk-NUXMGPMK.js → chunk-YTG4YXMB.js} +14 -14
- package/dist/{chunk-NUXMGPMK.js.map → chunk-YTG4YXMB.js.map} +0 -0
- package/dist/{contract-9e76e561.d.ts → contract-9dd2f98b.d.ts} +1 -1
- package/dist/contract.d.ts +21 -15
- package/dist/contract.js +6 -4
- package/dist/contract.mjs +5 -3
- package/dist/{createClient-68ee4bb4.d.ts → createClient-6689596e.d.ts} +10 -4
- package/dist/{createPublicClient-b732194e.d.ts → createPublicClient-fd558574.d.ts} +3 -3
- package/dist/{createTestClient-dedf321e.d.ts → createTestClient-bc1d9028.d.ts} +3 -3
- package/dist/{createWalletClient-75813d83.d.ts → createWalletClient-4df88244.d.ts} +3 -3
- package/dist/{decodeErrorResult-0b934d23.d.ts → decodeErrorResult-ac835649.d.ts} +2 -2
- package/dist/{eip1193-6f9ba163.d.ts → eip1193-617a05ae.d.ts} +2 -2
- package/dist/ens.d.ts +8 -8
- package/dist/ens.js +21 -21
- package/dist/ens.mjs +2 -2
- package/dist/{getAbiItem-c8e6e7d4.d.ts → getAbiItem-d2e8bd76.d.ts} +2 -2
- package/dist/index.d.ts +44 -21
- package/dist/index.js +54 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -21
- package/dist/index.mjs.map +1 -1
- package/dist/public.d.ts +13 -12
- package/dist/public.js +3 -3
- package/dist/public.mjs +2 -2
- package/dist/{readContract-4f6e2692.d.ts → readContract-c460f23a.d.ts} +3 -3
- package/dist/{rpc-a5a7f376.d.ts → rpc-8c10fc98.d.ts} +3 -5
- package/dist/{sendTransaction-e713f90c.d.ts → sendTransaction-7ce442c0.d.ts} +3 -3
- package/dist/test.d.ts +4 -4
- package/dist/test.js +13 -13
- package/dist/test.mjs +1 -1
- package/dist/{transactionReceipt-2a86c7c7.d.ts → transactionReceipt-44dbf122.d.ts} +1 -1
- package/dist/{transactionRequest-c7794f5e.d.ts → transactionRequest-f437b4ba.d.ts} +1 -1
- package/dist/utils/index.d.ts +14 -11
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet.d.ts +6 -6
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/{watchEvent-c346c12d.d.ts → watchEvent-569c9976.d.ts} +3 -3
- package/dist/window.d.ts +2 -2
- package/package.json +4 -4
- package/public/package.json +4 -0
- package/test/package.json +4 -0
- package/dist/chunk-2Y3UZMSP.mjs.map +0 -1
- package/dist/chunk-CD2XJOBJ.js.map +0 -1
- package/dist/chunk-KSAO4Y4Q.mjs.map +0 -1
- package/dist/chunk-THMRUG4D.js.map +0 -1
- package/src/_test/abis.ts +0 -1420
- package/src/_test/bench.ts +0 -15
- package/src/_test/constants.ts +0 -63
- 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 -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 -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 -31
- 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 -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 -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/ens.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
2
2
|
|
3
|
-
var
|
3
|
+
var _chunkLINNE4N4js = require('./chunk-LINNE4N4.js');
|
4
4
|
|
5
5
|
|
6
6
|
|
@@ -13,7 +13,7 @@ var _chunkCD2XJOBJjs = require('./chunk-CD2XJOBJ.js');
|
|
13
13
|
|
14
14
|
|
15
15
|
|
16
|
-
var
|
16
|
+
var _chunkDSQO3E4Fjs = require('./chunk-DSQO3E4F.js');
|
17
17
|
|
18
18
|
// src/utils/ens/normalize.ts
|
19
19
|
var _idnauts46hx = require('idna-uts46-hx');
|
@@ -25,21 +25,21 @@ function normalize(name) {
|
|
25
25
|
function labelhash(label) {
|
26
26
|
let result = new Uint8Array(32).fill(0);
|
27
27
|
if (!label)
|
28
|
-
return
|
29
|
-
return
|
28
|
+
return _chunkDSQO3E4Fjs.bytesToHex.call(void 0, result);
|
29
|
+
return _chunkDSQO3E4Fjs.keccak256.call(void 0, _chunkDSQO3E4Fjs.stringToBytes.call(void 0, normalize(label)));
|
30
30
|
}
|
31
31
|
|
32
32
|
// src/utils/ens/namehash.ts
|
33
33
|
function namehash(name) {
|
34
34
|
let result = new Uint8Array(32).fill(0);
|
35
35
|
if (!name)
|
36
|
-
return
|
36
|
+
return _chunkDSQO3E4Fjs.bytesToHex.call(void 0, result);
|
37
37
|
const labels = normalize(name).split(".");
|
38
38
|
for (let i = labels.length - 1; i >= 0; i -= 1) {
|
39
|
-
const hashed =
|
40
|
-
result =
|
39
|
+
const hashed = _chunkDSQO3E4Fjs.keccak256.call(void 0, _chunkDSQO3E4Fjs.stringToBytes.call(void 0, labels[i]), "bytes");
|
40
|
+
result = _chunkDSQO3E4Fjs.keccak256.call(void 0, _chunkDSQO3E4Fjs.concat.call(void 0, [result, hashed]), "bytes");
|
41
41
|
}
|
42
|
-
return
|
42
|
+
return _chunkDSQO3E4Fjs.bytesToHex.call(void 0, result);
|
43
43
|
}
|
44
44
|
|
45
45
|
// src/utils/ens/packetToBytes.ts
|
@@ -47,7 +47,7 @@ function packetToBytes(packet) {
|
|
47
47
|
function length(value2) {
|
48
48
|
if (value2 === "." || value2 === "..")
|
49
49
|
return 1;
|
50
|
-
return
|
50
|
+
return _chunkDSQO3E4Fjs.encodeBytes.call(void 0, value2.replace(/^\.|\.$/gm, "")).length + 2;
|
51
51
|
}
|
52
52
|
const bytes = new Uint8Array(length(packet));
|
53
53
|
const value = packet.replace(/^\.|\.$/gm, "");
|
@@ -56,7 +56,7 @@ function packetToBytes(packet) {
|
|
56
56
|
let offset = 0;
|
57
57
|
const list = value.split(".");
|
58
58
|
for (let i = 0; i < list.length; i++) {
|
59
|
-
const encoded =
|
59
|
+
const encoded = _chunkDSQO3E4Fjs.encodeBytes.call(void 0, list[i]);
|
60
60
|
bytes[offset] = encoded.length;
|
61
61
|
bytes.set(encoded, offset + 1);
|
62
62
|
offset += encoded.length + 1;
|
@@ -79,12 +79,12 @@ async function getEnsAddress(client, {
|
|
79
79
|
);
|
80
80
|
const contract = _optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.contracts, 'optionalAccess', _3 => _3.ensUniversalResolver]);
|
81
81
|
if (!contract)
|
82
|
-
throw new (0,
|
82
|
+
throw new (0, _chunkDSQO3E4Fjs.ChainDoesNotSupportContract)({
|
83
83
|
chain: client.chain,
|
84
84
|
contract: { name: "ensUniversalResolver" }
|
85
85
|
});
|
86
86
|
if (blockNumber && contract.blockCreated && contract.blockCreated > blockNumber)
|
87
|
-
throw new (0,
|
87
|
+
throw new (0, _chunkDSQO3E4Fjs.ChainDoesNotSupportContract)({
|
88
88
|
blockNumber,
|
89
89
|
chain: client.chain,
|
90
90
|
contract: {
|
@@ -94,7 +94,7 @@ async function getEnsAddress(client, {
|
|
94
94
|
});
|
95
95
|
universalResolverAddress = contract.address;
|
96
96
|
}
|
97
|
-
const res = await
|
97
|
+
const res = await _chunkLINNE4N4js.readContract.call(void 0, client, {
|
98
98
|
address: universalResolverAddress,
|
99
99
|
abi: [
|
100
100
|
{
|
@@ -113,8 +113,8 @@ async function getEnsAddress(client, {
|
|
113
113
|
],
|
114
114
|
functionName: "resolve",
|
115
115
|
args: [
|
116
|
-
|
117
|
-
|
116
|
+
_chunkDSQO3E4Fjs.encodeHex.call(void 0, packetToBytes(name)),
|
117
|
+
_chunkDSQO3E4Fjs.encodeFunctionData.call(void 0, {
|
118
118
|
abi: [
|
119
119
|
{
|
120
120
|
name: "addr",
|
@@ -131,7 +131,7 @@ async function getEnsAddress(client, {
|
|
131
131
|
blockNumber,
|
132
132
|
blockTag
|
133
133
|
});
|
134
|
-
return
|
134
|
+
return _chunkDSQO3E4Fjs.decodeFunctionResult.call(void 0, {
|
135
135
|
abi: [
|
136
136
|
{
|
137
137
|
name: "addr",
|
@@ -161,12 +161,12 @@ async function getEnsName(client, {
|
|
161
161
|
);
|
162
162
|
const contract = _optionalChain([client, 'access', _4 => _4.chain, 'optionalAccess', _5 => _5.contracts, 'optionalAccess', _6 => _6.ensUniversalResolver]);
|
163
163
|
if (!contract)
|
164
|
-
throw new (0,
|
164
|
+
throw new (0, _chunkDSQO3E4Fjs.ChainDoesNotSupportContract)({
|
165
165
|
chain: client.chain,
|
166
166
|
contract: { name: "ensUniversalResolver" }
|
167
167
|
});
|
168
168
|
if (blockNumber && contract.blockCreated && contract.blockCreated > blockNumber)
|
169
|
-
throw new (0,
|
169
|
+
throw new (0, _chunkDSQO3E4Fjs.ChainDoesNotSupportContract)({
|
170
170
|
blockNumber,
|
171
171
|
chain: client.chain,
|
172
172
|
contract: {
|
@@ -178,7 +178,7 @@ async function getEnsName(client, {
|
|
178
178
|
}
|
179
179
|
const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`;
|
180
180
|
try {
|
181
|
-
const res = await
|
181
|
+
const res = await _chunkLINNE4N4js.readContract.call(void 0, client, {
|
182
182
|
address: universalResolverAddress,
|
183
183
|
abi: [
|
184
184
|
{
|
@@ -195,13 +195,13 @@ async function getEnsName(client, {
|
|
195
195
|
}
|
196
196
|
],
|
197
197
|
functionName: "reverse",
|
198
|
-
args: [
|
198
|
+
args: [_chunkDSQO3E4Fjs.encodeHex.call(void 0, packetToBytes(reverseNode))],
|
199
199
|
blockNumber,
|
200
200
|
blockTag
|
201
201
|
});
|
202
202
|
return res[0];
|
203
203
|
} catch (error) {
|
204
|
-
if (error instanceof
|
204
|
+
if (error instanceof _chunkDSQO3E4Fjs.ContractFunctionExecutionError && error.cause.reason === _chunkDSQO3E4Fjs.panicReasons[50])
|
205
205
|
return null;
|
206
206
|
throw error;
|
207
207
|
}
|
package/dist/ens.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
readContract
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-QSIX64VZ.mjs";
|
4
4
|
import {
|
5
5
|
ChainDoesNotSupportContract,
|
6
6
|
ContractFunctionExecutionError,
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
keccak256,
|
14
14
|
panicReasons,
|
15
15
|
stringToBytes
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-PRG3BBPZ.mjs";
|
17
17
|
|
18
18
|
// src/utils/ens/normalize.ts
|
19
19
|
import { toUnicode } from "idna-uts46-hx";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AbiParameter, Narrow, Abi, AbiParametersToPrimitiveTypes } from 'abitype';
|
2
|
-
import { H as Hex, G as LogTopic } from './chain-
|
3
|
-
import { b as ExtractEventNameFromAbi, d as ExtractEventArgsFromTopics, e as ExtractFunctionNameFromAbi, f as ExtractArgsFromAbi, E as ExtractResultFromAbi, a as ExtractConstructorArgsFromAbi, g as ExtractErrorNameFromAbi, h as ExtractErrorArgsFromAbi, c as ExtractEventArgsFromAbi, A as AbiItem, i as ExtractNameFromAbi } from './contract-
|
2
|
+
import { H as Hex, G as LogTopic } from './chain-42de87e5.js';
|
3
|
+
import { b as ExtractEventNameFromAbi, d as ExtractEventArgsFromTopics, e as ExtractFunctionNameFromAbi, f as ExtractArgsFromAbi, E as ExtractResultFromAbi, a as ExtractConstructorArgsFromAbi, g as ExtractErrorNameFromAbi, h as ExtractErrorArgsFromAbi, c as ExtractEventArgsFromAbi, A as AbiItem, i as ExtractNameFromAbi } from './contract-9dd2f98b.js';
|
4
4
|
import * as abitype_dist_abi_78346466 from 'abitype/dist/abi-78346466';
|
5
5
|
|
6
6
|
type DecodeAbiArgs<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = {
|
package/dist/index.d.ts
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-
|
2
|
-
export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-
|
1
|
+
import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-6689596e.js';
|
2
|
+
export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-6689596e.js';
|
3
3
|
import WebSocket from 'isomorphic-ws';
|
4
|
-
import { H as Hex, A as Address, a as Hash, B as ByteArray, b as BlockTag } from './chain-
|
5
|
-
export { c as AccessList, A as Address, d as Block, e as BlockIdentifier, f as BlockNumber, b as BlockTag, B as ByteArray, C as Chain, F as FeeHistory, g as FeeValues, h as FeeValuesEIP1559, i as FeeValuesLegacy, a as Hash, H as Hex, L as Log, R as RpcBlock, j as RpcBlockIdentifier, k as RpcBlockNumber, l as RpcFeeHistory, m as RpcFeeValues, n as RpcLog, o as RpcTransaction, p as RpcTransactionReceipt, q as RpcTransactionRequest, r as RpcUncle, x as Transaction, y as TransactionBase, z as TransactionEIP1559, D as TransactionEIP2930, E as TransactionLegacy, T as TransactionReceipt, s as TransactionRequest, t as TransactionRequestBase, u as TransactionRequestEIP1559, v as TransactionRequestEIP2930, w as TransactionRequestLegacy, U as Uncle } from './chain-
|
6
|
-
import { B as BaseError, R as RpcResponse } from './rpc-
|
7
|
-
export { B as BaseError, C as ContractFunctionExecutionError, a as ContractFunctionRevertedError, b as ContractFunctionZeroDataError } from './rpc-
|
8
|
-
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-
|
9
|
-
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './createTestClient-
|
10
|
-
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './createWalletClient-
|
11
|
-
export { A as AbiItem, C as ContractConfig } from './contract-
|
12
|
-
import './eip1193-
|
4
|
+
import { H as Hex, A as Address, a as Hash, B as ByteArray, b as BlockTag } from './chain-42de87e5.js';
|
5
|
+
export { c as AccessList, A as Address, d as Block, e as BlockIdentifier, f as BlockNumber, b as BlockTag, B as ByteArray, C as Chain, F as FeeHistory, g as FeeValues, h as FeeValuesEIP1559, i as FeeValuesLegacy, a as Hash, H as Hex, L as Log, R as RpcBlock, j as RpcBlockIdentifier, k as RpcBlockNumber, l as RpcFeeHistory, m as RpcFeeValues, n as RpcLog, o as RpcTransaction, p as RpcTransactionReceipt, q as RpcTransactionRequest, r as RpcUncle, x as Transaction, y as TransactionBase, z as TransactionEIP1559, D as TransactionEIP2930, E as TransactionLegacy, T as TransactionReceipt, s as TransactionRequest, t as TransactionRequestBase, u as TransactionRequestEIP1559, v as TransactionRequestEIP2930, w as TransactionRequestLegacy, U as Uncle } from './chain-42de87e5.js';
|
6
|
+
import { B as BaseError, R as RpcResponse } from './rpc-8c10fc98.js';
|
7
|
+
export { B as BaseError, C as ContractFunctionExecutionError, a as ContractFunctionRevertedError, b as ContractFunctionZeroDataError } from './rpc-8c10fc98.js';
|
8
|
+
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-fd558574.js';
|
9
|
+
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './createTestClient-bc1d9028.js';
|
10
|
+
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './createWalletClient-4df88244.js';
|
11
|
+
export { A as AbiItem, C as ContractConfig } from './contract-9dd2f98b.js';
|
12
|
+
import './eip1193-617a05ae.js';
|
13
13
|
import '@wagmi/chains';
|
14
14
|
import 'abitype';
|
15
|
-
import './decodeErrorResult-
|
15
|
+
import './decodeErrorResult-ac835649.js';
|
16
16
|
|
17
17
|
declare class AbiConstructorNotFoundError extends BaseError {
|
18
18
|
name: string;
|
@@ -173,13 +173,19 @@ declare class FilterTypeNotSupportedError extends BaseError {
|
|
173
173
|
|
174
174
|
declare class HttpRequestError extends BaseError {
|
175
175
|
name: string;
|
176
|
-
|
177
|
-
|
176
|
+
body: {
|
177
|
+
[key: string]: unknown;
|
178
|
+
};
|
179
|
+
headers?: Headers;
|
180
|
+
status?: number;
|
181
|
+
url: string;
|
182
|
+
constructor({ body, details, headers, status, url, }: {
|
178
183
|
body: {
|
179
184
|
[key: string]: unknown;
|
180
185
|
};
|
181
|
-
details
|
182
|
-
|
186
|
+
details?: string;
|
187
|
+
headers?: Headers;
|
188
|
+
status?: number;
|
183
189
|
url: string;
|
184
190
|
});
|
185
191
|
}
|
@@ -218,8 +224,9 @@ declare class TimeoutError extends BaseError {
|
|
218
224
|
}
|
219
225
|
|
220
226
|
declare class RequestError extends BaseError {
|
221
|
-
constructor(err: Error, { docsPath, shortMessage }: {
|
227
|
+
constructor(err: Error, { docsPath, metaMessages, shortMessage, }: {
|
222
228
|
docsPath?: string;
|
229
|
+
metaMessages?: string[];
|
223
230
|
shortMessage: string;
|
224
231
|
});
|
225
232
|
}
|
@@ -334,6 +341,10 @@ type CustomTransportConfig = {
|
|
334
341
|
key?: TransportConfig['key'];
|
335
342
|
/** The name of the transport. */
|
336
343
|
name?: TransportConfig['name'];
|
344
|
+
/** The max number of times to retry. */
|
345
|
+
retryCount?: TransportConfig['retryCount'];
|
346
|
+
/** The base delay (in ms) between retries. */
|
347
|
+
retryDelay?: TransportConfig['retryDelay'];
|
337
348
|
};
|
338
349
|
type CustomTransport = Transport<'custom', EthereumProvider['request']>;
|
339
350
|
/**
|
@@ -341,24 +352,32 @@ type CustomTransport = Transport<'custom', EthereumProvider['request']>;
|
|
341
352
|
*/
|
342
353
|
declare function custom<TProvider extends EthereumProvider>(
|
343
354
|
/** An Ethereum provider with an EIP-1193 "request" attribute. */
|
344
|
-
provider: TProvider,
|
355
|
+
provider: TProvider, config?: CustomTransportConfig): CustomTransport;
|
345
356
|
|
346
357
|
type FallbackTransportConfig = {
|
347
358
|
/** The key of the Fallback transport. */
|
348
359
|
key?: TransportConfig['key'];
|
349
360
|
/** The name of the Fallback transport. */
|
350
361
|
name?: TransportConfig['name'];
|
362
|
+
/** The max number of times to retry. */
|
363
|
+
retryCount?: TransportConfig['retryCount'];
|
364
|
+
/** The base delay (in ms) between retries. */
|
365
|
+
retryDelay?: TransportConfig['retryDelay'];
|
351
366
|
};
|
352
367
|
type FallbackTransport = Transport<'fallback', {
|
353
368
|
transports: Transport[];
|
354
369
|
}>;
|
355
|
-
declare function fallback(transports: Transport[],
|
370
|
+
declare function fallback(transports: Transport[], config?: FallbackTransportConfig): FallbackTransport;
|
356
371
|
|
357
372
|
type HttpTransportConfig = {
|
358
373
|
/** The key of the HTTP transport. */
|
359
374
|
key?: TransportConfig['key'];
|
360
375
|
/** The name of the HTTP transport. */
|
361
376
|
name?: TransportConfig['name'];
|
377
|
+
/** The max number of times to retry. */
|
378
|
+
retryCount?: TransportConfig['retryCount'];
|
379
|
+
/** The base delay (in ms) between retries. */
|
380
|
+
retryDelay?: TransportConfig['retryDelay'];
|
362
381
|
};
|
363
382
|
type HttpTransport = Transport<'http', {
|
364
383
|
url?: string;
|
@@ -368,7 +387,7 @@ type HttpTransport = Transport<'http', {
|
|
368
387
|
*/
|
369
388
|
declare function http(
|
370
389
|
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
371
|
-
url?: string,
|
390
|
+
url?: string, config?: HttpTransportConfig): HttpTransport;
|
372
391
|
|
373
392
|
type WebSocketTransportSubscribeArgs = {
|
374
393
|
onData: (data: RpcResponse) => void;
|
@@ -392,6 +411,10 @@ type WebSocketTransportConfig = {
|
|
392
411
|
key?: TransportConfig['key'];
|
393
412
|
/** The name of the WebSocket transport. */
|
394
413
|
name?: TransportConfig['name'];
|
414
|
+
/** The max number of times to retry. */
|
415
|
+
retryCount?: TransportConfig['retryCount'];
|
416
|
+
/** The base delay (in ms) between retries. */
|
417
|
+
retryDelay?: TransportConfig['retryDelay'];
|
395
418
|
};
|
396
419
|
type WebSocketTransport = Transport<'webSocket', {
|
397
420
|
getSocket(): Promise<WebSocket>;
|
@@ -402,7 +425,7 @@ type WebSocketTransport = Transport<'webSocket', {
|
|
402
425
|
*/
|
403
426
|
declare function webSocket(
|
404
427
|
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
405
|
-
url?: string,
|
428
|
+
url?: string, config?: WebSocketTransportConfig): WebSocketTransport;
|
406
429
|
|
407
430
|
declare const multicall3Abi: readonly [{
|
408
431
|
readonly inputs: readonly [{
|
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -57,70 +57,89 @@
|
|
57
57
|
|
58
58
|
|
59
59
|
|
60
|
-
|
60
|
+
|
61
|
+
var _chunkDSQO3E4Fjs = require('./chunk-DSQO3E4F.js');
|
61
62
|
|
62
63
|
// src/clients/transports/createTransport.ts
|
63
|
-
function createTransport(
|
64
|
+
function createTransport({
|
65
|
+
key,
|
66
|
+
name,
|
67
|
+
request,
|
68
|
+
retryCount = 3,
|
69
|
+
retryDelay = 150,
|
70
|
+
type
|
71
|
+
}, value) {
|
64
72
|
return {
|
65
|
-
config,
|
73
|
+
config: { key, name, request, retryCount, retryDelay, type },
|
74
|
+
request: _chunkDSQO3E4Fjs.buildRequest.call(void 0, request, { retryCount, retryDelay }),
|
66
75
|
value
|
67
76
|
};
|
68
77
|
}
|
69
78
|
|
70
79
|
// src/clients/transports/custom.ts
|
71
|
-
function custom(provider,
|
72
|
-
|
80
|
+
function custom(provider, config = {}) {
|
81
|
+
const { key = "custom", name = "Custom Provider", retryDelay } = config;
|
82
|
+
return ({ retryCount: defaultRetryCount }) => createTransport({
|
73
83
|
key,
|
74
84
|
name,
|
75
85
|
request: provider.request.bind(provider),
|
86
|
+
retryCount: _nullishCoalesce(config.retryCount, () => ( defaultRetryCount)),
|
87
|
+
retryDelay,
|
76
88
|
type: "custom"
|
77
89
|
});
|
78
90
|
}
|
79
91
|
|
80
92
|
// src/clients/transports/fallback.ts
|
81
|
-
function fallback(transports,
|
93
|
+
function fallback(transports, config = {}) {
|
94
|
+
const { key = "fallback", name = "Fallback", retryCount, retryDelay } = config;
|
82
95
|
return ({ chain }) => createTransport(
|
83
96
|
{
|
84
97
|
key,
|
85
98
|
name,
|
86
99
|
async request({ method, params }) {
|
87
100
|
const fetch = async (i = 0) => {
|
88
|
-
const transport = transports[i]({ chain });
|
101
|
+
const transport = transports[i]({ chain, retryCount: 0 });
|
89
102
|
try {
|
90
|
-
return await transport.
|
103
|
+
return await transport.request({
|
91
104
|
method,
|
92
105
|
params
|
93
106
|
});
|
94
107
|
} catch (err) {
|
95
|
-
if (
|
96
|
-
|
97
|
-
|
108
|
+
if (_chunkDSQO3E4Fjs.isDeterministicError.call(void 0, err))
|
109
|
+
throw err;
|
110
|
+
if (i === transports.length - 1)
|
111
|
+
throw err;
|
112
|
+
return fetch(i + 1);
|
98
113
|
}
|
99
114
|
};
|
100
115
|
return fetch();
|
101
116
|
},
|
117
|
+
retryCount,
|
118
|
+
retryDelay,
|
102
119
|
type: "fallback"
|
103
120
|
},
|
104
121
|
{
|
105
122
|
transports: transports.map(
|
106
|
-
(fn) => fn({ chain })
|
123
|
+
(fn) => fn({ chain, retryCount: 0 })
|
107
124
|
)
|
108
125
|
}
|
109
126
|
);
|
110
127
|
}
|
111
128
|
|
112
129
|
// src/clients/transports/http.ts
|
113
|
-
function http(url,
|
114
|
-
|
130
|
+
function http(url, config = {}) {
|
131
|
+
const { key = "http", name = "HTTP JSON-RPC", retryDelay } = config;
|
132
|
+
return ({ chain, retryCount: defaultRetryCount }) => {
|
133
|
+
const retryCount = _nullishCoalesce(config.retryCount, () => ( defaultRetryCount));
|
115
134
|
const url_ = url || _optionalChain([chain, 'optionalAccess', _ => _.rpcUrls, 'access', _2 => _2.default, 'access', _3 => _3.http, 'access', _4 => _4[0]]);
|
116
135
|
if (!url_)
|
117
|
-
throw new (0,
|
136
|
+
throw new (0, _chunkDSQO3E4Fjs.UrlRequiredError)();
|
118
137
|
return createTransport(
|
119
138
|
{
|
120
139
|
key,
|
121
140
|
name,
|
122
141
|
async request({ method, params }) {
|
123
|
-
const { result } = await
|
142
|
+
const { result } = await _chunkDSQO3E4Fjs.rpc.http(url_, {
|
124
143
|
body: {
|
125
144
|
method,
|
126
145
|
params
|
@@ -128,6 +147,8 @@ function http(url, { key = "http", name = "HTTP JSON-RPC" } = {}) {
|
|
128
147
|
});
|
129
148
|
return result;
|
130
149
|
},
|
150
|
+
retryCount,
|
151
|
+
retryDelay,
|
131
152
|
type: "http"
|
132
153
|
},
|
133
154
|
{
|
@@ -138,35 +159,36 @@ function http(url, { key = "http", name = "HTTP JSON-RPC" } = {}) {
|
|
138
159
|
}
|
139
160
|
|
140
161
|
// src/clients/transports/webSocket.ts
|
141
|
-
function webSocket(url, {
|
142
|
-
key = "webSocket",
|
143
|
-
|
144
|
-
|
145
|
-
return ({ chain }) => {
|
162
|
+
function webSocket(url, config = {}) {
|
163
|
+
const { key = "webSocket", name = "WebSocket JSON-RPC", retryDelay } = config;
|
164
|
+
return ({ chain, retryCount: defaultRetryCount }) => {
|
165
|
+
const retryCount = _nullishCoalesce(config.retryCount, () => ( defaultRetryCount));
|
146
166
|
const url_ = url || _optionalChain([chain, 'optionalAccess', _5 => _5.rpcUrls, 'access', _6 => _6.default, 'access', _7 => _7.webSocket, 'optionalAccess', _8 => _8[0]]);
|
147
167
|
if (!url_)
|
148
|
-
throw new (0,
|
168
|
+
throw new (0, _chunkDSQO3E4Fjs.UrlRequiredError)();
|
149
169
|
return createTransport(
|
150
170
|
{
|
151
171
|
key,
|
152
172
|
name,
|
153
173
|
async request({ method, params }) {
|
154
|
-
const socket = await
|
155
|
-
const { result } = await
|
174
|
+
const socket = await _chunkDSQO3E4Fjs.getSocket.call(void 0, url_);
|
175
|
+
const { result } = await _chunkDSQO3E4Fjs.rpc.webSocketAsync(socket, {
|
156
176
|
body: { method, params }
|
157
177
|
});
|
158
178
|
return result;
|
159
179
|
},
|
180
|
+
retryCount,
|
181
|
+
retryDelay,
|
160
182
|
type: "webSocket"
|
161
183
|
},
|
162
184
|
{
|
163
185
|
getSocket() {
|
164
|
-
return
|
186
|
+
return _chunkDSQO3E4Fjs.getSocket.call(void 0, url_);
|
165
187
|
},
|
166
188
|
async subscribe({ params, onData, onError }) {
|
167
|
-
const socket = await
|
189
|
+
const socket = await _chunkDSQO3E4Fjs.getSocket.call(void 0, url_);
|
168
190
|
const { result: subscriptionId } = await new Promise(
|
169
|
-
(resolve, reject) =>
|
191
|
+
(resolve, reject) => _chunkDSQO3E4Fjs.rpc.webSocket(socket, {
|
170
192
|
body: {
|
171
193
|
method: "eth_subscribe",
|
172
194
|
params
|
@@ -188,7 +210,7 @@ function webSocket(url, {
|
|
188
210
|
subscriptionId,
|
189
211
|
async unsubscribe() {
|
190
212
|
return new Promise(
|
191
|
-
(resolve, reject) =>
|
213
|
+
(resolve, reject) => _chunkDSQO3E4Fjs.rpc.webSocket(socket, {
|
192
214
|
body: {
|
193
215
|
method: "eth_unsubscribe",
|
194
216
|
params: [subscriptionId]
|
@@ -229,13 +251,13 @@ function createClient({
|
|
229
251
|
transport,
|
230
252
|
type = "base"
|
231
253
|
}) {
|
232
|
-
const { config, value } = transport({ chain });
|
254
|
+
const { config, request, value } = transport({ chain });
|
233
255
|
return {
|
234
256
|
chain,
|
235
257
|
key,
|
236
258
|
name,
|
237
259
|
pollingInterval,
|
238
|
-
request
|
260
|
+
request,
|
239
261
|
transport: { ...config, ...value },
|
240
262
|
type,
|
241
263
|
uid: uid()
|
@@ -363,5 +385,5 @@ function createWalletClient({
|
|
363
385
|
|
364
386
|
|
365
387
|
|
366
|
-
exports.AbiConstructorNotFoundError =
|
388
|
+
exports.AbiConstructorNotFoundError = _chunkDSQO3E4Fjs.AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = _chunkDSQO3E4Fjs.AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = _chunkDSQO3E4Fjs.AbiDecodingDataSizeInvalidError; exports.AbiEncodingArrayLengthMismatchError = _chunkDSQO3E4Fjs.AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = _chunkDSQO3E4Fjs.AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = _chunkDSQO3E4Fjs.AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = _chunkDSQO3E4Fjs.AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = _chunkDSQO3E4Fjs.AbiErrorSignatureNotFoundError; exports.AbiEventNotFoundError = _chunkDSQO3E4Fjs.AbiEventNotFoundError; exports.AbiFunctionNotFoundError = _chunkDSQO3E4Fjs.AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = _chunkDSQO3E4Fjs.AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = _chunkDSQO3E4Fjs.AbiFunctionSignatureNotFoundError; exports.BaseError = _chunkDSQO3E4Fjs.BaseError; exports.BlockNotFoundError = _chunkDSQO3E4Fjs.BlockNotFoundError; exports.ContractFunctionExecutionError = _chunkDSQO3E4Fjs.ContractFunctionExecutionError; exports.ContractFunctionRevertedError = _chunkDSQO3E4Fjs.ContractFunctionRevertedError; exports.ContractFunctionZeroDataError = _chunkDSQO3E4Fjs.ContractFunctionZeroDataError; exports.DataLengthTooLongError = _chunkDSQO3E4Fjs.DataLengthTooLongError; exports.DataLengthTooShortError = _chunkDSQO3E4Fjs.DataLengthTooShortError; exports.FilterTypeNotSupportedError = _chunkDSQO3E4Fjs.FilterTypeNotSupportedError; exports.HttpRequestError = _chunkDSQO3E4Fjs.HttpRequestError; exports.InternalRpcError = _chunkDSQO3E4Fjs.InternalRpcError; exports.InvalidAbiDecodingTypeError = _chunkDSQO3E4Fjs.InvalidAbiDecodingTypeError; exports.InvalidAbiEncodingTypeError = _chunkDSQO3E4Fjs.InvalidAbiEncodingTypeError; exports.InvalidAddressError = _chunkDSQO3E4Fjs.InvalidAddressError; exports.InvalidArrayError = _chunkDSQO3E4Fjs.InvalidArrayError; exports.InvalidBytesBooleanError = _chunkDSQO3E4Fjs.InvalidBytesBooleanError; exports.InvalidDefinitionTypeError = _chunkDSQO3E4Fjs.InvalidDefinitionTypeError; exports.InvalidGasArgumentsError = _chunkDSQO3E4Fjs.InvalidGasArgumentsError; exports.InvalidHexBooleanError = _chunkDSQO3E4Fjs.InvalidHexBooleanError; exports.InvalidHexValueError = _chunkDSQO3E4Fjs.InvalidHexValueError; exports.InvalidInputRpcError = _chunkDSQO3E4Fjs.InvalidInputRpcError; exports.InvalidParamsRpcError = _chunkDSQO3E4Fjs.InvalidParamsRpcError; exports.InvalidRequestRpcError = _chunkDSQO3E4Fjs.InvalidRequestRpcError; exports.JsonRpcVersionUnsupportedError = _chunkDSQO3E4Fjs.JsonRpcVersionUnsupportedError; exports.LimitExceededRpcError = _chunkDSQO3E4Fjs.LimitExceededRpcError; exports.MethodNotFoundRpcError = _chunkDSQO3E4Fjs.MethodNotFoundRpcError; exports.MethodNotSupportedRpcError = _chunkDSQO3E4Fjs.MethodNotSupportedRpcError; exports.OffsetOutOfBoundsError = _chunkDSQO3E4Fjs.OffsetOutOfBoundsError; exports.ParseRpcError = _chunkDSQO3E4Fjs.ParseRpcError; exports.RequestError = _chunkDSQO3E4Fjs.RequestError; exports.ResourceNotFoundRpcError = _chunkDSQO3E4Fjs.ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = _chunkDSQO3E4Fjs.ResourceUnavailableRpcError; exports.RpcError = _chunkDSQO3E4Fjs.RpcError; exports.RpcRequestError = _chunkDSQO3E4Fjs.RpcRequestError; exports.SizeExceedsPaddingSizeError = _chunkDSQO3E4Fjs.SizeExceedsPaddingSizeError; exports.TimeoutError = _chunkDSQO3E4Fjs.TimeoutError; exports.TransactionNotFoundError = _chunkDSQO3E4Fjs.TransactionNotFoundError; exports.TransactionReceiptNotFoundError = _chunkDSQO3E4Fjs.TransactionReceiptNotFoundError; exports.TransactionRejectedRpcError = _chunkDSQO3E4Fjs.TransactionRejectedRpcError; exports.UnknownRpcError = _chunkDSQO3E4Fjs.UnknownRpcError; exports.UrlRequiredError = _chunkDSQO3E4Fjs.UrlRequiredError; exports.WaitForTransactionReceiptTimeoutError = _chunkDSQO3E4Fjs.WaitForTransactionReceiptTimeoutError; exports.WebSocketRequestError = _chunkDSQO3E4Fjs.WebSocketRequestError; exports.createClient = createClient; exports.createPublicClient = createPublicClient; exports.createTestClient = createTestClient; exports.createTransport = createTransport; exports.createWalletClient = createWalletClient; exports.custom = custom; exports.fallback = fallback; exports.http = http; exports.multicall3Abi = _chunkDSQO3E4Fjs.multicall3Abi; exports.webSocket = webSocket;
|
367
389
|
//# sourceMappingURL=index.js.map
|