viem 2.0.0-beta.5 → 2.0.0-beta.8
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/CHANGELOG.md +470 -394
- package/README.md +52 -46
- package/_cjs/accounts/toAccount.js.map +1 -1
- package/_cjs/accounts/utils/signTransaction.js.map +1 -1
- package/_cjs/actions/ens/getEnsAddress.js +1 -1
- package/_cjs/actions/ens/getEnsAddress.js.map +1 -1
- package/_cjs/actions/ens/getEnsAvatar.js +1 -1
- package/_cjs/actions/ens/getEnsAvatar.js.map +1 -1
- package/_cjs/actions/ens/getEnsName.js +1 -1
- package/_cjs/actions/ens/getEnsName.js.map +1 -1
- package/_cjs/actions/ens/getEnsResolver.js +1 -1
- package/_cjs/actions/ens/getEnsResolver.js.map +1 -1
- package/_cjs/actions/ens/getEnsText.js +1 -1
- package/_cjs/actions/ens/getEnsText.js.map +1 -1
- package/_cjs/actions/getContract.js +7 -7
- package/_cjs/actions/getContract.js.map +1 -1
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/createContractEventFilter.js +1 -1
- package/_cjs/actions/public/createContractEventFilter.js.map +1 -1
- package/_cjs/actions/public/createEventFilter.js +1 -1
- package/_cjs/actions/public/createEventFilter.js.map +1 -1
- package/_cjs/actions/public/estimateContractGas.js +1 -1
- package/_cjs/actions/public/estimateContractGas.js.map +1 -1
- package/_cjs/actions/public/estimateFeesPerGas.js +6 -3
- package/_cjs/actions/public/estimateFeesPerGas.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js +3 -8
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js +6 -4
- package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
- package/_cjs/actions/public/getBlock.js.map +1 -1
- package/_cjs/actions/public/getBlockTransactionCount.js.map +1 -1
- package/_cjs/actions/public/getContractEvents.js +1 -1
- package/_cjs/actions/public/getContractEvents.js.map +1 -1
- package/_cjs/actions/public/getFilterChanges.js +10 -31
- package/_cjs/actions/public/getFilterChanges.js.map +1 -1
- package/_cjs/actions/public/getFilterLogs.js +8 -29
- package/_cjs/actions/public/getFilterLogs.js.map +1 -1
- package/_cjs/actions/public/getLogs.js +8 -29
- package/_cjs/actions/public/getLogs.js.map +1 -1
- package/_cjs/actions/public/getTransaction.js.map +1 -1
- package/_cjs/actions/public/getTransactionConfirmations.js +4 -2
- package/_cjs/actions/public/getTransactionConfirmations.js.map +1 -1
- package/_cjs/actions/public/multicall.js +1 -1
- package/_cjs/actions/public/multicall.js.map +1 -1
- package/_cjs/actions/public/readContract.js +1 -1
- package/_cjs/actions/public/readContract.js.map +1 -1
- package/_cjs/actions/public/simulateContract.js +1 -1
- package/_cjs/actions/public/simulateContract.js.map +1 -1
- package/_cjs/actions/public/verifyHash.js +1 -1
- package/_cjs/actions/public/verifyHash.js.map +1 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js +18 -8
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/actions/public/watchBlockNumber.js +1 -1
- package/_cjs/actions/public/watchBlockNumber.js.map +1 -1
- package/_cjs/actions/public/watchBlocks.js +2 -2
- package/_cjs/actions/public/watchBlocks.js.map +1 -1
- package/_cjs/actions/public/watchContractEvent.js +7 -6
- package/_cjs/actions/public/watchContractEvent.js.map +1 -1
- package/_cjs/actions/public/watchEvent.js +7 -6
- package/_cjs/actions/public/watchEvent.js.map +1 -1
- package/_cjs/actions/public/watchPendingTransactions.js +5 -4
- package/_cjs/actions/public/watchPendingTransactions.js.map +1 -1
- package/_cjs/actions/test/setAutomine.js.map +1 -1
- package/_cjs/actions/wallet/addChain.js +1 -1
- package/_cjs/actions/wallet/addChain.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js +41 -38
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/actions/wallet/requestAddresses.js +1 -1
- package/_cjs/actions/wallet/requestAddresses.js.map +1 -1
- package/_cjs/actions/wallet/requestPermissions.js +1 -1
- package/_cjs/actions/wallet/requestPermissions.js.map +1 -1
- package/_cjs/actions/wallet/sendRawTransaction.js +1 -1
- package/_cjs/actions/wallet/sendRawTransaction.js.map +1 -1
- package/_cjs/actions/wallet/sendTransaction.js +5 -5
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/_cjs/actions/wallet/signMessage.js +1 -1
- package/_cjs/actions/wallet/signMessage.js.map +1 -1
- package/_cjs/actions/wallet/signTransaction.js +2 -2
- package/_cjs/actions/wallet/signTransaction.js.map +1 -1
- package/_cjs/actions/wallet/signTypedData.js +1 -1
- package/_cjs/actions/wallet/signTypedData.js.map +1 -1
- package/_cjs/actions/wallet/switchChain.js +1 -1
- package/_cjs/actions/wallet/switchChain.js.map +1 -1
- package/_cjs/actions/wallet/watchAsset.js +1 -1
- package/_cjs/actions/wallet/watchAsset.js.map +1 -1
- package/_cjs/actions/wallet/writeContract.js +6 -3
- package/_cjs/actions/wallet/writeContract.js.map +1 -1
- package/_cjs/chains/celo/formatters.js.map +1 -1
- package/_cjs/chains/celo/parsers.js.map +1 -1
- package/_cjs/chains/celo/serializers.js +4 -8
- package/_cjs/chains/celo/serializers.js.map +1 -1
- package/_cjs/chains/celo/utils.js +6 -4
- package/_cjs/chains/celo/utils.js.map +1 -1
- package/_cjs/chains/definitions/aurora.js +6 -0
- package/_cjs/chains/definitions/aurora.js.map +1 -1
- package/_cjs/chains/definitions/base.js +8 -0
- package/_cjs/chains/definitions/base.js.map +1 -1
- package/_cjs/chains/definitions/baseGoerli.js +7 -1
- package/_cjs/chains/definitions/baseGoerli.js.map +1 -1
- package/_cjs/chains/definitions/baseSepolia.js +11 -2
- package/_cjs/chains/definitions/baseSepolia.js.map +1 -1
- package/_cjs/chains/definitions/bscTestnet.js +2 -1
- package/_cjs/chains/definitions/bscTestnet.js.map +1 -1
- package/_cjs/chains/definitions/confluxESpace.js +1 -0
- package/_cjs/chains/definitions/confluxESpace.js.map +1 -1
- package/_cjs/chains/definitions/confluxESpaceTestnet.js +34 -0
- package/_cjs/chains/definitions/confluxESpaceTestnet.js.map +1 -0
- package/_cjs/chains/definitions/filecoin.js +6 -0
- package/_cjs/chains/definitions/filecoin.js.map +1 -1
- package/_cjs/chains/definitions/klaytn.js +6 -0
- package/_cjs/chains/definitions/klaytn.js.map +1 -1
- package/_cjs/chains/definitions/klaytnBaobab.js +30 -0
- package/_cjs/chains/definitions/klaytnBaobab.js.map +1 -0
- package/_cjs/chains/definitions/optimism.js +7 -0
- package/_cjs/chains/definitions/optimism.js.map +1 -1
- package/_cjs/chains/definitions/optimismGoerli.js +7 -0
- package/_cjs/chains/definitions/optimismGoerli.js.map +1 -1
- package/_cjs/chains/definitions/optimismSepolia.js +7 -0
- package/_cjs/chains/definitions/optimismSepolia.js.map +1 -1
- package/_cjs/chains/definitions/pgn.js +37 -0
- package/_cjs/chains/definitions/pgn.js.map +1 -0
- package/_cjs/chains/definitions/pgnTestnet.js +38 -0
- package/_cjs/chains/definitions/pgnTestnet.js.map +1 -0
- package/_cjs/chains/definitions/rootstock.js +29 -0
- package/_cjs/chains/definitions/rootstock.js.map +1 -0
- package/_cjs/chains/definitions/sapphire.js +33 -0
- package/_cjs/chains/definitions/sapphire.js.map +1 -0
- package/_cjs/chains/definitions/sapphireTestnet.js +28 -0
- package/_cjs/chains/definitions/sapphireTestnet.js.map +1 -0
- package/_cjs/chains/definitions/shibarium.js +35 -0
- package/_cjs/chains/definitions/shibarium.js.map +1 -0
- package/_cjs/chains/definitions/shimmer.js +29 -0
- package/_cjs/chains/definitions/shimmer.js.map +1 -0
- package/_cjs/chains/definitions/shimmerTestnet.js +30 -0
- package/_cjs/chains/definitions/shimmerTestnet.js.map +1 -0
- package/_cjs/chains/definitions/zora.js +7 -0
- package/_cjs/chains/definitions/zora.js.map +1 -1
- package/_cjs/chains/definitions/zoraSepolia.js +7 -0
- package/_cjs/chains/definitions/zoraSepolia.js.map +1 -1
- package/_cjs/chains/definitions/zoraTestnet.js +7 -0
- package/_cjs/chains/definitions/zoraTestnet.js.map +1 -1
- package/_cjs/chains/index.js +24 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/chains/opStack/abis.js +318 -1
- package/_cjs/chains/opStack/abis.js.map +1 -1
- package/_cjs/chains/opStack/actions/buildDepositTransaction.js +32 -0
- package/_cjs/chains/opStack/actions/buildDepositTransaction.js.map +1 -0
- package/_cjs/chains/opStack/actions/depositTransaction.js +36 -0
- package/_cjs/chains/opStack/actions/depositTransaction.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateContractL1Fee.js.map +1 -1
- package/_cjs/chains/opStack/actions/estimateContractL1Gas.js.map +1 -1
- package/_cjs/chains/opStack/actions/estimateContractTotalFee.js.map +1 -1
- package/_cjs/chains/opStack/actions/estimateContractTotalGas.js.map +1 -1
- package/_cjs/chains/opStack/chainConfig.js +2 -0
- package/_cjs/chains/opStack/chainConfig.js.map +1 -1
- package/_cjs/chains/opStack/chains.js +22 -0
- package/_cjs/chains/opStack/chains.js.map +1 -0
- package/_cjs/chains/opStack/decorators/{public.js → publicL2.js} +3 -1
- package/_cjs/chains/opStack/decorators/publicL2.js.map +1 -0
- package/_cjs/chains/opStack/decorators/walletL1.js +13 -0
- package/_cjs/chains/opStack/decorators/walletL1.js.map +1 -0
- package/_cjs/chains/opStack/formatters.js.map +1 -1
- package/_cjs/chains/opStack/index.js +34 -21
- package/_cjs/chains/opStack/index.js.map +1 -1
- package/_cjs/chains/opStack/parsers.js +55 -0
- package/_cjs/chains/opStack/parsers.js.map +1 -0
- package/_cjs/chains/opStack/serializers.js +52 -0
- package/_cjs/chains/opStack/serializers.js.map +1 -0
- package/_cjs/chains/opStack/{types.js → types/block.js} +1 -1
- package/_cjs/chains/opStack/types/block.js.map +1 -0
- package/_cjs/chains/opStack/types/chain.js +3 -0
- package/_cjs/chains/opStack/types/chain.js.map +1 -0
- package/_cjs/chains/opStack/types/contract.js +3 -0
- package/_cjs/chains/opStack/types/contract.js.map +1 -0
- package/_cjs/chains/opStack/types/transaction.js +3 -0
- package/_cjs/chains/opStack/types/transaction.js.map +1 -0
- package/_cjs/chains/opStack/utils/extractTransactionDepositedLogs.js +14 -0
- package/_cjs/chains/opStack/utils/extractTransactionDepositedLogs.js.map +1 -0
- package/_cjs/chains/opStack/utils/fromOpaqueData.js +29 -0
- package/_cjs/chains/opStack/utils/fromOpaqueData.js.map +1 -0
- package/_cjs/chains/opStack/utils/getL2TransactionHash.js +28 -0
- package/_cjs/chains/opStack/utils/getL2TransactionHash.js.map +1 -0
- package/_cjs/chains/opStack/utils/getL2TransactionHashes.js +11 -0
- package/_cjs/chains/opStack/utils/getL2TransactionHashes.js.map +1 -0
- package/_cjs/chains/opStack/utils/getSourceHash.js +21 -0
- package/_cjs/chains/opStack/utils/getSourceHash.js.map +1 -0
- package/_cjs/chains/zksync/serializers.js.map +1 -1
- package/_cjs/clients/createWalletClient.js +1 -1
- package/_cjs/clients/createWalletClient.js.map +1 -1
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/clients/decorators/wallet.js.map +1 -1
- package/_cjs/clients/transports/fallback.js +18 -4
- package/_cjs/clients/transports/fallback.js.map +1 -1
- package/_cjs/clients/transports/webSocket.js.map +1 -1
- package/_cjs/errors/base.js.map +1 -1
- package/_cjs/errors/contract.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/decodeEventLog.js.map +1 -1
- package/_cjs/utils/abi/decodeFunctionData.js.map +1 -1
- package/_cjs/utils/abi/decodeFunctionResult.js.map +1 -1
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodeErrorResult.js.map +1 -1
- package/_cjs/utils/abi/encodeEventTopics.js.map +1 -1
- package/_cjs/utils/abi/encodeFunctionData.js.map +1 -1
- package/_cjs/utils/abi/encodeFunctionResult.js.map +1 -1
- package/_cjs/utils/abi/encodePacked.js.map +1 -1
- package/_cjs/utils/abi/formatAbiItem.js.map +1 -1
- package/_cjs/utils/abi/getAbiItem.js.map +1 -1
- package/_cjs/utils/abi/parseEventLogs.js +37 -0
- package/_cjs/utils/abi/parseEventLogs.js.map +1 -0
- package/_cjs/utils/address/getAddress.js.map +1 -1
- package/_cjs/utils/address/getContractAddress.js.map +1 -1
- package/_cjs/utils/buildRequest.js +101 -82
- package/_cjs/utils/buildRequest.js.map +1 -1
- package/_cjs/utils/ccip.js +4 -2
- package/_cjs/utils/ccip.js.map +1 -1
- package/_cjs/utils/data/concat.js.map +1 -1
- package/_cjs/utils/data/pad.js.map +1 -1
- package/_cjs/utils/data/slice.js.map +1 -1
- package/_cjs/utils/data/trim.js.map +1 -1
- package/_cjs/utils/encoding/fromBytes.js.map +1 -1
- package/_cjs/utils/encoding/fromHex.js.map +1 -1
- package/_cjs/utils/encoding/fromRlp.js.map +1 -1
- package/_cjs/utils/encoding/toBytes.js +2 -2
- package/_cjs/utils/encoding/toBytes.js.map +1 -1
- package/_cjs/utils/encoding/toHex.js.map +1 -1
- package/_cjs/utils/encoding/toRlp.js +3 -1
- package/_cjs/utils/encoding/toRlp.js.map +1 -1
- package/_cjs/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/_cjs/utils/ens/avatar/utils.js +1 -1
- package/_cjs/utils/ens/avatar/utils.js.map +1 -1
- package/_cjs/utils/ens/namehash.js.map +1 -1
- package/_cjs/utils/ens/packetToBytes.js.map +1 -1
- package/_cjs/utils/errors/getContractError.js.map +1 -1
- package/_cjs/utils/errors/getNodeError.js +11 -11
- package/_cjs/utils/errors/getNodeError.js.map +1 -1
- package/_cjs/utils/formatters/block.js.map +1 -1
- package/_cjs/utils/formatters/extract.js.map +1 -1
- package/_cjs/utils/formatters/formatter.js.map +1 -1
- package/_cjs/utils/formatters/transaction.js.map +1 -1
- package/_cjs/utils/getAction.js +2 -2
- package/_cjs/utils/getAction.js.map +1 -1
- package/_cjs/utils/hash/normalizeSignature.js.map +1 -1
- package/_cjs/utils/index.js +3 -2
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/observe.js +2 -1
- package/_cjs/utils/observe.js.map +1 -1
- package/_cjs/utils/promise/createBatchScheduler.js +8 -2
- package/_cjs/utils/promise/createBatchScheduler.js.map +1 -1
- package/_cjs/utils/promise/withCache.js.map +1 -1
- package/_cjs/utils/promise/withRetry.js.map +1 -1
- package/_cjs/utils/promise/withTimeout.js.map +1 -1
- package/_cjs/utils/rpc.js.map +1 -1
- package/_cjs/utils/signature/hashTypedData.js.map +1 -1
- package/_cjs/utils/signature/signatureToCompactSignature.js.map +1 -1
- package/_cjs/utils/transaction/getTransactionType.js.map +1 -1
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/_cjs/utils/transaction/serializeAccessList.js.map +1 -1
- package/_cjs/utils/transaction/serializeTransaction.js.map +1 -1
- package/_cjs/utils/typedData.js.map +1 -1
- package/_cjs/utils/uid.js.map +1 -1
- package/_cjs/utils/unit/formatEther.js.map +1 -1
- package/_cjs/utils/unit/formatGwei.js.map +1 -1
- package/_cjs/utils/unit/formatUnits.js.map +1 -1
- package/_cjs/utils/unit/parseEther.js.map +1 -1
- package/_cjs/utils/unit/parseGwei.js.map +1 -1
- package/_cjs/utils/unit/parseUnits.js.map +1 -1
- package/_esm/accounts/toAccount.js.map +1 -1
- package/_esm/accounts/utils/signTransaction.js.map +1 -1
- package/_esm/actions/ens/getEnsAddress.js +3 -3
- package/_esm/actions/ens/getEnsAddress.js.map +1 -1
- package/_esm/actions/ens/getEnsAvatar.js +3 -3
- package/_esm/actions/ens/getEnsAvatar.js.map +1 -1
- package/_esm/actions/ens/getEnsName.js +3 -3
- package/_esm/actions/ens/getEnsName.js.map +1 -1
- package/_esm/actions/ens/getEnsResolver.js +3 -3
- package/_esm/actions/ens/getEnsResolver.js.map +1 -1
- package/_esm/actions/ens/getEnsText.js +3 -3
- package/_esm/actions/ens/getEnsText.js.map +1 -1
- package/_esm/actions/getContract.js +7 -7
- package/_esm/actions/getContract.js.map +1 -1
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/createContractEventFilter.js +1 -1
- package/_esm/actions/public/createContractEventFilter.js.map +1 -1
- package/_esm/actions/public/createEventFilter.js +1 -1
- package/_esm/actions/public/createEventFilter.js.map +1 -1
- package/_esm/actions/public/estimateContractGas.js +1 -1
- package/_esm/actions/public/estimateContractGas.js.map +1 -1
- package/_esm/actions/public/estimateFeesPerGas.js +6 -3
- package/_esm/actions/public/estimateFeesPerGas.js.map +1 -1
- package/_esm/actions/public/estimateGas.js +3 -8
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/actions/public/estimateMaxPriorityFeePerGas.js +6 -4
- package/_esm/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
- package/_esm/actions/public/getBlock.js +1 -1
- package/_esm/actions/public/getBlock.js.map +1 -1
- package/_esm/actions/public/getBlockNumber.js +1 -1
- package/_esm/actions/public/getBlockTransactionCount.js.map +1 -1
- package/_esm/actions/public/getContractEvents.js +1 -1
- package/_esm/actions/public/getContractEvents.js.map +1 -1
- package/_esm/actions/public/getFilterChanges.js +11 -33
- package/_esm/actions/public/getFilterChanges.js.map +1 -1
- package/_esm/actions/public/getFilterLogs.js +9 -31
- package/_esm/actions/public/getFilterLogs.js.map +1 -1
- package/_esm/actions/public/getLogs.js +10 -32
- package/_esm/actions/public/getLogs.js.map +1 -1
- package/_esm/actions/public/getTransaction.js +1 -1
- package/_esm/actions/public/getTransaction.js.map +1 -1
- package/_esm/actions/public/getTransactionConfirmations.js +5 -3
- package/_esm/actions/public/getTransactionConfirmations.js.map +1 -1
- package/_esm/actions/public/getTransactionReceipt.js +1 -1
- package/_esm/actions/public/multicall.js +1 -1
- package/_esm/actions/public/multicall.js.map +1 -1
- package/_esm/actions/public/readContract.js +2 -2
- package/_esm/actions/public/readContract.js.map +1 -1
- package/_esm/actions/public/simulateContract.js +2 -2
- package/_esm/actions/public/simulateContract.js.map +1 -1
- package/_esm/actions/public/verifyHash.js +1 -1
- package/_esm/actions/public/verifyHash.js.map +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js +22 -9
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/actions/public/watchBlockNumber.js +2 -2
- package/_esm/actions/public/watchBlockNumber.js.map +1 -1
- package/_esm/actions/public/watchBlocks.js +3 -3
- package/_esm/actions/public/watchBlocks.js.map +1 -1
- package/_esm/actions/public/watchContractEvent.js +7 -6
- package/_esm/actions/public/watchContractEvent.js.map +1 -1
- package/_esm/actions/public/watchEvent.js +7 -6
- package/_esm/actions/public/watchEvent.js.map +1 -1
- package/_esm/actions/public/watchPendingTransactions.js +5 -4
- package/_esm/actions/public/watchPendingTransactions.js.map +1 -1
- package/_esm/actions/test/setAutomine.js.map +1 -1
- package/_esm/actions/wallet/addChain.js +1 -1
- package/_esm/actions/wallet/addChain.js.map +1 -1
- package/_esm/actions/wallet/deployContract.js +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +44 -40
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/actions/wallet/requestAddresses.js +1 -1
- package/_esm/actions/wallet/requestAddresses.js.map +1 -1
- package/_esm/actions/wallet/requestPermissions.js +1 -1
- package/_esm/actions/wallet/requestPermissions.js.map +1 -1
- package/_esm/actions/wallet/sendRawTransaction.js +1 -1
- package/_esm/actions/wallet/sendRawTransaction.js.map +1 -1
- package/_esm/actions/wallet/sendTransaction.js +6 -6
- package/_esm/actions/wallet/sendTransaction.js.map +1 -1
- package/_esm/actions/wallet/signMessage.js +1 -1
- package/_esm/actions/wallet/signMessage.js.map +1 -1
- package/_esm/actions/wallet/signTransaction.js +2 -2
- package/_esm/actions/wallet/signTransaction.js.map +1 -1
- package/_esm/actions/wallet/signTypedData.js +1 -1
- package/_esm/actions/wallet/signTypedData.js.map +1 -1
- package/_esm/actions/wallet/switchChain.js +1 -1
- package/_esm/actions/wallet/switchChain.js.map +1 -1
- package/_esm/actions/wallet/watchAsset.js +1 -1
- package/_esm/actions/wallet/watchAsset.js.map +1 -1
- package/_esm/actions/wallet/writeContract.js +7 -4
- package/_esm/actions/wallet/writeContract.js.map +1 -1
- package/_esm/chains/celo/formatters.js.map +1 -1
- package/_esm/chains/celo/parsers.js.map +1 -1
- package/_esm/chains/celo/serializers.js +4 -8
- package/_esm/chains/celo/serializers.js.map +1 -1
- package/_esm/chains/celo/utils.js +16 -5
- package/_esm/chains/celo/utils.js.map +1 -1
- package/_esm/chains/definitions/aurora.js +6 -0
- package/_esm/chains/definitions/aurora.js.map +1 -1
- package/_esm/chains/definitions/base.js +8 -0
- package/_esm/chains/definitions/base.js.map +1 -1
- package/_esm/chains/definitions/baseGoerli.js +7 -1
- package/_esm/chains/definitions/baseGoerli.js.map +1 -1
- package/_esm/chains/definitions/baseSepolia.js +11 -2
- package/_esm/chains/definitions/baseSepolia.js.map +1 -1
- package/_esm/chains/definitions/bscTestnet.js +2 -1
- package/_esm/chains/definitions/bscTestnet.js.map +1 -1
- package/_esm/chains/definitions/confluxESpace.js +1 -0
- package/_esm/chains/definitions/confluxESpace.js.map +1 -1
- package/_esm/chains/definitions/confluxESpaceTestnet.js +31 -0
- package/_esm/chains/definitions/confluxESpaceTestnet.js.map +1 -0
- package/_esm/chains/definitions/filecoin.js +6 -0
- package/_esm/chains/definitions/filecoin.js.map +1 -1
- package/_esm/chains/definitions/klaytn.js +6 -0
- package/_esm/chains/definitions/klaytn.js.map +1 -1
- package/_esm/chains/definitions/klaytnBaobab.js +27 -0
- package/_esm/chains/definitions/klaytnBaobab.js.map +1 -0
- package/_esm/chains/definitions/optimism.js +7 -0
- package/_esm/chains/definitions/optimism.js.map +1 -1
- package/_esm/chains/definitions/optimismGoerli.js +7 -0
- package/_esm/chains/definitions/optimismGoerli.js.map +1 -1
- package/_esm/chains/definitions/optimismSepolia.js +7 -0
- package/_esm/chains/definitions/optimismSepolia.js.map +1 -1
- package/_esm/chains/definitions/pgn.js +34 -0
- package/_esm/chains/definitions/pgn.js.map +1 -0
- package/_esm/chains/definitions/pgnTestnet.js +35 -0
- package/_esm/chains/definitions/pgnTestnet.js.map +1 -0
- package/_esm/chains/definitions/rootstock.js +26 -0
- package/_esm/chains/definitions/rootstock.js.map +1 -0
- package/_esm/chains/definitions/sapphire.js +30 -0
- package/_esm/chains/definitions/sapphire.js.map +1 -0
- package/_esm/chains/definitions/sapphireTestnet.js +25 -0
- package/_esm/chains/definitions/sapphireTestnet.js.map +1 -0
- package/_esm/chains/definitions/shibarium.js +32 -0
- package/_esm/chains/definitions/shibarium.js.map +1 -0
- package/_esm/chains/definitions/shimmer.js +26 -0
- package/_esm/chains/definitions/shimmer.js.map +1 -0
- package/_esm/chains/definitions/shimmerTestnet.js +27 -0
- package/_esm/chains/definitions/shimmerTestnet.js.map +1 -0
- package/_esm/chains/definitions/zora.js +7 -0
- package/_esm/chains/definitions/zora.js.map +1 -1
- package/_esm/chains/definitions/zoraSepolia.js +7 -0
- package/_esm/chains/definitions/zoraSepolia.js.map +1 -1
- package/_esm/chains/definitions/zoraTestnet.js +7 -0
- package/_esm/chains/definitions/zoraTestnet.js.map +1 -1
- package/_esm/chains/index.js +10 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/chains/opStack/abis.js +317 -0
- package/_esm/chains/opStack/abis.js.map +1 -1
- package/_esm/chains/opStack/actions/buildDepositTransaction.js +54 -0
- package/_esm/chains/opStack/actions/buildDepositTransaction.js.map +1 -0
- package/_esm/chains/opStack/actions/depositTransaction.js +88 -0
- package/_esm/chains/opStack/actions/depositTransaction.js.map +1 -0
- package/_esm/chains/opStack/actions/estimateContractL1Fee.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateContractL1Gas.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateContractTotalFee.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateContractTotalGas.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateL1Fee.js +1 -1
- package/_esm/chains/opStack/actions/estimateL1Fee.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateL1Gas.js.map +1 -1
- package/_esm/chains/opStack/chainConfig.js +2 -0
- package/_esm/chains/opStack/chainConfig.js.map +1 -1
- package/_esm/chains/opStack/chains.js +10 -0
- package/_esm/chains/opStack/chains.js.map +1 -0
- package/_esm/chains/opStack/decorators/{public.js → publicL2.js} +3 -1
- package/_esm/chains/opStack/decorators/publicL2.js.map +1 -0
- package/_esm/chains/opStack/decorators/walletL1.js +9 -0
- package/_esm/chains/opStack/decorators/walletL1.js.map +1 -0
- package/_esm/chains/opStack/formatters.js.map +1 -1
- package/_esm/chains/opStack/index.js +12 -10
- package/_esm/chains/opStack/index.js.map +1 -1
- package/_esm/chains/opStack/parsers.js +51 -0
- package/_esm/chains/opStack/parsers.js.map +1 -0
- package/_esm/chains/opStack/serializers.js +47 -0
- package/_esm/chains/opStack/serializers.js.map +1 -0
- package/_esm/chains/opStack/types/block.js +2 -0
- package/_esm/chains/opStack/types/block.js.map +1 -0
- package/_esm/chains/opStack/types/chain.js +2 -0
- package/_esm/chains/opStack/types/chain.js.map +1 -0
- package/_esm/chains/opStack/types/contract.js +2 -0
- package/_esm/chains/opStack/types/contract.js.map +1 -0
- package/_esm/chains/opStack/types/transaction.js +2 -0
- package/_esm/chains/opStack/types/transaction.js.map +1 -0
- package/_esm/chains/opStack/utils/extractTransactionDepositedLogs.js +10 -0
- package/_esm/chains/opStack/utils/extractTransactionDepositedLogs.js.map +1 -0
- package/_esm/chains/opStack/utils/fromOpaqueData.js +25 -0
- package/_esm/chains/opStack/utils/fromOpaqueData.js.map +1 -0
- package/_esm/chains/opStack/utils/getL2TransactionHash.js +25 -0
- package/_esm/chains/opStack/utils/getL2TransactionHash.js.map +1 -0
- package/_esm/chains/opStack/utils/getL2TransactionHashes.js +7 -0
- package/_esm/chains/opStack/utils/getL2TransactionHashes.js.map +1 -0
- package/_esm/chains/opStack/utils/getSourceHash.js +18 -0
- package/_esm/chains/opStack/utils/getSourceHash.js.map +1 -0
- package/_esm/chains/zksync/serializers.js +1 -1
- package/_esm/chains/zksync/serializers.js.map +1 -1
- package/_esm/clients/createWalletClient.js +1 -1
- package/_esm/clients/createWalletClient.js.map +1 -1
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/clients/decorators/wallet.js.map +1 -1
- package/_esm/clients/transports/fallback.js +19 -6
- package/_esm/clients/transports/fallback.js.map +1 -1
- package/_esm/clients/transports/webSocket.js.map +1 -1
- package/_esm/errors/base.js.map +1 -1
- package/_esm/errors/contract.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/decodeEventLog.js.map +1 -1
- package/_esm/utils/abi/decodeFunctionData.js.map +1 -1
- package/_esm/utils/abi/decodeFunctionResult.js.map +1 -1
- package/_esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodeErrorResult.js.map +1 -1
- package/_esm/utils/abi/encodeEventTopics.js.map +1 -1
- package/_esm/utils/abi/encodeFunctionData.js.map +1 -1
- package/_esm/utils/abi/encodeFunctionResult.js.map +1 -1
- package/_esm/utils/abi/encodePacked.js.map +1 -1
- package/_esm/utils/abi/formatAbiItem.js.map +1 -1
- package/_esm/utils/abi/getAbiItem.js.map +1 -1
- package/_esm/utils/abi/parseEventLogs.js +59 -0
- package/_esm/utils/abi/parseEventLogs.js.map +1 -0
- package/_esm/utils/address/getAddress.js.map +1 -1
- package/_esm/utils/address/getContractAddress.js.map +1 -1
- package/_esm/utils/buildRequest.js +129 -102
- package/_esm/utils/buildRequest.js.map +1 -1
- package/_esm/utils/ccip.js +4 -2
- package/_esm/utils/ccip.js.map +1 -1
- package/_esm/utils/data/concat.js.map +1 -1
- package/_esm/utils/data/pad.js.map +1 -1
- package/_esm/utils/data/slice.js.map +1 -1
- package/_esm/utils/data/trim.js.map +1 -1
- package/_esm/utils/encoding/fromBytes.js.map +1 -1
- package/_esm/utils/encoding/fromHex.js.map +1 -1
- package/_esm/utils/encoding/fromRlp.js.map +1 -1
- package/_esm/utils/encoding/toBytes.js +2 -2
- package/_esm/utils/encoding/toBytes.js.map +1 -1
- package/_esm/utils/encoding/toHex.js.map +1 -1
- package/_esm/utils/encoding/toRlp.js +3 -1
- package/_esm/utils/encoding/toRlp.js.map +1 -1
- package/_esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/_esm/utils/ens/avatar/utils.js +1 -1
- package/_esm/utils/ens/avatar/utils.js.map +1 -1
- package/_esm/utils/ens/namehash.js +1 -1
- package/_esm/utils/ens/namehash.js.map +1 -1
- package/_esm/utils/ens/normalize.js +2 -2
- package/_esm/utils/ens/packetToBytes.js.map +1 -1
- package/_esm/utils/errors/getContractError.js.map +1 -1
- package/_esm/utils/errors/getNodeError.js +11 -11
- package/_esm/utils/errors/getNodeError.js.map +1 -1
- package/_esm/utils/formatters/block.js.map +1 -1
- package/_esm/utils/formatters/extract.js.map +1 -1
- package/_esm/utils/formatters/formatter.js.map +1 -1
- package/_esm/utils/formatters/transaction.js.map +1 -1
- package/_esm/utils/getAction.js +12 -2
- package/_esm/utils/getAction.js.map +1 -1
- package/_esm/utils/hash/normalizeSignature.js.map +1 -1
- package/_esm/utils/index.js +2 -1
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/observe.js +2 -1
- package/_esm/utils/observe.js.map +1 -1
- package/_esm/utils/promise/createBatchScheduler.js +8 -2
- package/_esm/utils/promise/createBatchScheduler.js.map +1 -1
- package/_esm/utils/promise/withCache.js.map +1 -1
- package/_esm/utils/promise/withRetry.js.map +1 -1
- package/_esm/utils/promise/withTimeout.js.map +1 -1
- package/_esm/utils/rpc.js.map +1 -1
- package/_esm/utils/signature/hashTypedData.js.map +1 -1
- package/_esm/utils/signature/signatureToCompactSignature.js.map +1 -1
- package/_esm/utils/transaction/getTransactionType.js.map +1 -1
- package/_esm/utils/transaction/parseTransaction.js.map +1 -1
- package/_esm/utils/transaction/serializeAccessList.js.map +1 -1
- package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/_esm/utils/typedData.js.map +1 -1
- package/_esm/utils/uid.js.map +1 -1
- package/_esm/utils/unit/formatEther.js +11 -0
- package/_esm/utils/unit/formatEther.js.map +1 -1
- package/_esm/utils/unit/formatGwei.js +11 -0
- package/_esm/utils/unit/formatGwei.js.map +1 -1
- package/_esm/utils/unit/formatUnits.js +11 -0
- package/_esm/utils/unit/formatUnits.js.map +1 -1
- package/_esm/utils/unit/parseEther.js +11 -0
- package/_esm/utils/unit/parseEther.js.map +1 -1
- package/_esm/utils/unit/parseGwei.js +11 -0
- package/_esm/utils/unit/parseGwei.js.map +1 -1
- package/_esm/utils/unit/parseUnits.js +11 -0
- package/_esm/utils/unit/parseUnits.js.map +1 -1
- package/_types/accounts/utils/signTransaction.d.ts.map +1 -1
- package/_types/actions/ens/getEnsAddress.d.ts +2 -2
- package/_types/actions/ens/getEnsAddress.d.ts.map +1 -1
- package/_types/actions/ens/getEnsAvatar.d.ts +2 -2
- package/_types/actions/ens/getEnsAvatar.d.ts.map +1 -1
- package/_types/actions/ens/getEnsName.d.ts +2 -2
- package/_types/actions/ens/getEnsName.d.ts.map +1 -1
- package/_types/actions/ens/getEnsResolver.d.ts +2 -2
- package/_types/actions/ens/getEnsResolver.d.ts.map +1 -1
- package/_types/actions/ens/getEnsText.d.ts +2 -2
- package/_types/actions/ens/getEnsText.d.ts.map +1 -1
- package/_types/actions/getContract.d.ts +5 -5
- package/_types/actions/getContract.d.ts.map +1 -1
- package/_types/actions/public/createContractEventFilter.d.ts.map +1 -1
- package/_types/actions/public/estimateContractGas.d.ts +2 -2
- package/_types/actions/public/estimateContractGas.d.ts.map +1 -1
- package/_types/actions/public/estimateFeesPerGas.d.ts +2 -2
- package/_types/actions/public/estimateFeesPerGas.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts +5 -3
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/_types/actions/public/getBlock.d.ts +1 -1
- package/_types/actions/public/getBlockNumber.d.ts +1 -1
- package/_types/actions/public/getContractEvents.d.ts.map +1 -1
- package/_types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/_types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/_types/actions/public/getLogs.d.ts +1 -1
- package/_types/actions/public/getLogs.d.ts.map +1 -1
- package/_types/actions/public/getTransaction.d.ts +1 -1
- package/_types/actions/public/getTransactionConfirmations.d.ts +1 -1
- package/_types/actions/public/getTransactionConfirmations.d.ts.map +1 -1
- package/_types/actions/public/getTransactionReceipt.d.ts +1 -1
- package/_types/actions/public/multicall.d.ts.map +1 -1
- package/_types/actions/public/readContract.d.ts +1 -1
- package/_types/actions/public/readContract.d.ts.map +1 -1
- package/_types/actions/public/simulateContract.d.ts +4 -4
- package/_types/actions/public/simulateContract.d.ts.map +1 -1
- package/_types/actions/public/verifyHash.d.ts.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/public/watchBlockNumber.d.ts +1 -1
- package/_types/actions/public/watchBlockNumber.d.ts.map +1 -1
- package/_types/actions/public/watchBlocks.d.ts +1 -1
- package/_types/actions/public/watchBlocks.d.ts.map +1 -1
- package/_types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/_types/actions/public/watchEvent.d.ts.map +1 -1
- package/_types/actions/public/watchPendingTransactions.d.ts.map +1 -1
- package/_types/actions/wallet/addChain.d.ts.map +1 -1
- package/_types/actions/wallet/deployContract.d.ts +3 -3
- package/_types/actions/wallet/deployContract.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +19 -7
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/actions/wallet/requestAddresses.d.ts.map +1 -1
- package/_types/actions/wallet/requestPermissions.d.ts.map +1 -1
- package/_types/actions/wallet/sendRawTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/sendTransaction.d.ts +4 -4
- package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/signMessage.d.ts.map +1 -1
- package/_types/actions/wallet/signTransaction.d.ts +2 -2
- package/_types/actions/wallet/signTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/signTypedData.d.ts.map +1 -1
- package/_types/actions/wallet/switchChain.d.ts.map +1 -1
- package/_types/actions/wallet/watchAsset.d.ts.map +1 -1
- package/_types/actions/wallet/writeContract.d.ts +4 -4
- package/_types/actions/wallet/writeContract.d.ts.map +1 -1
- package/_types/chains/celo/chainConfig.d.ts +7 -7
- package/_types/chains/celo/formatters.d.ts +7 -7
- package/_types/chains/celo/parsers.d.ts.map +1 -1
- package/_types/chains/celo/serializers.d.ts.map +1 -1
- package/_types/chains/celo/utils.d.ts.map +1 -1
- package/_types/chains/definitions/aurora.d.ts +6 -8
- package/_types/chains/definitions/aurora.d.ts.map +1 -1
- package/_types/chains/definitions/auroraTestnet.d.ts +1 -1
- package/_types/chains/definitions/base.d.ts +17 -9
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/baseGoerli.d.ts +15 -8
- package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/baseSepolia.d.ts +16 -8
- package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/bearNetworkChainMainnet.d.ts +1 -1
- package/_types/chains/definitions/bearNetworkChainTestnet.d.ts +1 -1
- package/_types/chains/definitions/bronos.d.ts +1 -1
- package/_types/chains/definitions/bronosTestnet.d.ts +1 -1
- package/_types/chains/definitions/bscTestnet.d.ts +4 -1
- package/_types/chains/definitions/bscTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bxn.d.ts +1 -1
- package/_types/chains/definitions/bxnTestnet.d.ts +1 -1
- package/_types/chains/definitions/celo.d.ts +7 -7
- package/_types/chains/definitions/celoAlfajores.d.ts +7 -7
- package/_types/chains/definitions/celoCannoli.d.ts +7 -7
- package/_types/chains/definitions/chiliz.d.ts +1 -1
- package/_types/chains/definitions/classic.d.ts +1 -1
- package/_types/chains/definitions/confluxESpace.d.ts +1 -0
- package/_types/chains/definitions/confluxESpace.d.ts.map +1 -1
- package/_types/chains/definitions/confluxESpaceTestnet.d.ts +38 -0
- package/_types/chains/definitions/confluxESpaceTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/dfk.d.ts +1 -1
- package/_types/chains/definitions/dogechain.d.ts +1 -1
- package/_types/chains/definitions/edgewareTestnet.d.ts +1 -1
- package/_types/chains/definitions/ekta.d.ts +1 -1
- package/_types/chains/definitions/ektaTestnet.d.ts +1 -1
- package/_types/chains/definitions/evmos.d.ts +1 -1
- package/_types/chains/definitions/evmosTestnet.d.ts +1 -1
- package/_types/chains/definitions/fibo.d.ts +1 -1
- package/_types/chains/definitions/filecoin.d.ts +6 -8
- package/_types/chains/definitions/filecoin.d.ts.map +1 -1
- package/_types/chains/definitions/filecoinCalibration.d.ts +1 -1
- package/_types/chains/definitions/filecoinHyperspace.d.ts +1 -1
- package/_types/chains/definitions/flare.d.ts +1 -1
- package/_types/chains/definitions/flareTestnet.d.ts +1 -1
- package/_types/chains/definitions/foundry.d.ts +1 -1
- package/_types/chains/definitions/fuseSparknet.d.ts +1 -1
- package/_types/chains/definitions/haqqMainnet.d.ts +1 -1
- package/_types/chains/definitions/haqqTestedge2.d.ts +1 -1
- package/_types/chains/definitions/hardhat.d.ts +1 -1
- package/_types/chains/definitions/iotex.d.ts +1 -1
- package/_types/chains/definitions/iotexTestnet.d.ts +1 -1
- package/_types/chains/definitions/klaytn.d.ts +6 -8
- package/_types/chains/definitions/klaytn.d.ts.map +1 -1
- package/_types/chains/definitions/klaytnBaobab.d.ts +40 -0
- package/_types/chains/definitions/klaytnBaobab.d.ts.map +1 -0
- package/_types/chains/definitions/kroma.d.ts +1 -1
- package/_types/chains/definitions/kromaSepolia.d.ts +1 -1
- package/_types/chains/definitions/localhost.d.ts +1 -1
- package/_types/chains/definitions/lukso.d.ts +1 -1
- package/_types/chains/definitions/mantleTestnet.d.ts +1 -1
- package/_types/chains/definitions/meter.d.ts +1 -1
- package/_types/chains/definitions/meterTestnet.d.ts +1 -1
- package/_types/chains/definitions/moonbeamDev.d.ts +1 -1
- package/_types/chains/definitions/oasys.d.ts +1 -1
- package/_types/chains/definitions/optimism.d.ts +16 -9
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +16 -9
- package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/optimismSepolia.d.ts +16 -9
- package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/pgn.d.ts +555 -0
- package/_types/chains/definitions/pgn.d.ts.map +1 -0
- package/_types/chains/definitions/pgnTestnet.d.ts +555 -0
- package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/qMainnet.d.ts +1 -1
- package/_types/chains/definitions/qTestnet.d.ts +1 -1
- package/_types/chains/definitions/rootstock.d.ts +40 -0
- package/_types/chains/definitions/rootstock.d.ts.map +1 -0
- package/_types/chains/definitions/sapphire.d.ts +38 -0
- package/_types/chains/definitions/sapphire.d.ts.map +1 -0
- package/_types/chains/definitions/sapphireTestnet.d.ts +40 -0
- package/_types/chains/definitions/sapphireTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/scrollTestnet.d.ts +1 -1
- package/_types/chains/definitions/shardeumSphinx.d.ts +1 -1
- package/_types/chains/definitions/shibarium.d.ts +40 -0
- package/_types/chains/definitions/shibarium.d.ts.map +1 -0
- package/_types/chains/definitions/shimmer.d.ts +38 -0
- package/_types/chains/definitions/shimmer.d.ts.map +1 -0
- package/_types/chains/definitions/shimmerTestnet.d.ts +38 -0
- package/_types/chains/definitions/shimmerTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/songbird.d.ts +1 -1
- package/_types/chains/definitions/songbirdTestnet.d.ts +1 -1
- package/_types/chains/definitions/spicy.d.ts +1 -1
- package/_types/chains/definitions/taikoJolnir.d.ts +1 -1
- package/_types/chains/definitions/taikoTestnetSepolia.d.ts +1 -1
- package/_types/chains/definitions/taraxa.d.ts +1 -1
- package/_types/chains/definitions/taraxaTestnet.d.ts +1 -1
- package/_types/chains/definitions/telosTestnet.d.ts +1 -1
- package/_types/chains/definitions/tenet.d.ts +1 -1
- package/_types/chains/definitions/thunderTestnet.d.ts +1 -1
- package/_types/chains/definitions/vechain.d.ts +1 -1
- package/_types/chains/definitions/xdc.d.ts +1 -1
- package/_types/chains/definitions/xdcTestnet.d.ts +1 -1
- package/_types/chains/definitions/zetachainAthensTestnet.d.ts +1 -1
- package/_types/chains/definitions/zhejiang.d.ts +1 -1
- package/_types/chains/definitions/zora.d.ts +16 -9
- package/_types/chains/definitions/zora.d.ts.map +1 -1
- package/_types/chains/definitions/zoraSepolia.d.ts +16 -9
- package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zoraTestnet.d.ts +16 -9
- package/_types/chains/definitions/zoraTestnet.d.ts.map +1 -1
- package/_types/chains/index.d.ts +13 -2
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/chains/opStack/abis.d.ts +435 -0
- package/_types/chains/opStack/abis.d.ts.map +1 -1
- package/_types/chains/opStack/actions/buildDepositTransaction.d.ts +63 -0
- package/_types/chains/opStack/actions/buildDepositTransaction.d.ts.map +1 -0
- package/_types/chains/opStack/actions/depositTransaction.d.ts +96 -0
- package/_types/chains/opStack/actions/depositTransaction.d.ts.map +1 -0
- package/_types/chains/opStack/actions/estimateL1Fee.d.ts +3 -3
- package/_types/chains/opStack/actions/estimateL1Fee.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateL1Gas.d.ts +2 -2
- package/_types/chains/opStack/actions/estimateL1Gas.d.ts.map +1 -1
- package/_types/chains/opStack/chainConfig.d.ts +14 -11
- package/_types/chains/opStack/chainConfig.d.ts.map +1 -1
- package/_types/chains/opStack/chains.d.ts +10 -0
- package/_types/chains/opStack/chains.d.ts.map +1 -0
- package/_types/chains/opStack/decorators/{public.d.ts → publicL2.d.ts} +31 -4
- package/_types/chains/opStack/decorators/publicL2.d.ts.map +1 -0
- package/_types/chains/opStack/decorators/walletL1.d.ts +64 -0
- package/_types/chains/opStack/decorators/walletL1.d.ts.map +1 -0
- package/_types/chains/opStack/formatters.d.ts +9 -8
- package/_types/chains/opStack/formatters.d.ts.map +1 -1
- package/_types/chains/opStack/index.d.ts +14 -11
- package/_types/chains/opStack/index.d.ts.map +1 -1
- package/_types/chains/opStack/parsers.d.ts +8 -0
- package/_types/chains/opStack/parsers.d.ts.map +1 -0
- package/_types/chains/opStack/serializers.d.ts +12 -0
- package/_types/chains/opStack/serializers.d.ts.map +1 -0
- package/_types/chains/opStack/types/block.d.ts +13 -0
- package/_types/chains/opStack/types/block.d.ts.map +1 -0
- package/_types/chains/opStack/types/chain.d.ts +9 -0
- package/_types/chains/opStack/types/chain.d.ts.map +1 -0
- package/_types/chains/opStack/types/contract.d.ts +13 -0
- package/_types/chains/opStack/types/contract.d.ts.map +1 -0
- package/_types/chains/opStack/{types.d.ts → types/transaction.d.ts} +21 -14
- package/_types/chains/opStack/types/transaction.d.ts.map +1 -0
- package/_types/chains/opStack/utils/extractTransactionDepositedLogs.d.ts +446 -0
- package/_types/chains/opStack/utils/extractTransactionDepositedLogs.d.ts.map +1 -0
- package/_types/chains/opStack/utils/fromOpaqueData.d.ts +15 -0
- package/_types/chains/opStack/utils/fromOpaqueData.d.ts.map +1 -0
- package/_types/chains/opStack/utils/getL2TransactionHash.d.ts +12 -0
- package/_types/chains/opStack/utils/getL2TransactionHash.d.ts.map +1 -0
- package/_types/chains/opStack/utils/getL2TransactionHashes.d.ts +11 -0
- package/_types/chains/opStack/utils/getL2TransactionHashes.d.ts.map +1 -0
- package/_types/chains/opStack/utils/getSourceHash.d.ts +28 -0
- package/_types/chains/opStack/utils/getSourceHash.d.ts.map +1 -0
- package/_types/clients/createClient.d.ts +1 -1
- package/_types/clients/decorators/public.d.ts +25 -25
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +6 -6
- package/_types/clients/decorators/wallet.d.ts.map +1 -1
- package/_types/clients/transports/fallback.d.ts.map +1 -1
- package/_types/errors/estimateGas.d.ts +1 -1
- package/_types/errors/estimateGas.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/types/account.d.ts +6 -3
- package/_types/types/account.d.ts.map +1 -1
- package/_types/types/chain.d.ts +12 -15
- package/_types/types/chain.d.ts.map +1 -1
- package/_types/types/contract.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +5 -1
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/ens.d.ts +1 -1
- package/_types/types/ens.d.ts.map +1 -1
- package/_types/types/filter.d.ts.map +1 -1
- package/_types/types/log.d.ts.map +1 -1
- package/_types/types/multicall.d.ts.map +1 -1
- package/_types/types/rpc.d.ts.map +1 -1
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/types/utils.d.ts +17 -1
- package/_types/types/utils.d.ts.map +1 -1
- package/_types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/_types/utils/abi/decodeFunctionData.d.ts.map +1 -1
- package/_types/utils/abi/decodeFunctionResult.d.ts.map +1 -1
- package/_types/utils/abi/encodeDeployData.d.ts.map +1 -1
- package/_types/utils/abi/encodeErrorResult.d.ts.map +1 -1
- package/_types/utils/abi/encodeEventTopics.d.ts.map +1 -1
- package/_types/utils/abi/encodeFunctionData.d.ts.map +1 -1
- package/_types/utils/abi/encodeFunctionResult.d.ts.map +1 -1
- package/_types/utils/abi/parseEventLogs.d.ts +43 -0
- package/_types/utils/abi/parseEventLogs.d.ts.map +1 -0
- package/_types/utils/buildRequest.d.ts +3 -6
- package/_types/utils/buildRequest.d.ts.map +1 -1
- package/_types/utils/ccip.d.ts.map +1 -1
- package/_types/utils/encoding/fromBytes.d.ts.map +1 -1
- package/_types/utils/encoding/fromHex.d.ts.map +1 -1
- package/_types/utils/ens/avatar/utils.d.ts.map +1 -1
- package/_types/utils/ens/namehash.d.ts +1 -1
- package/_types/utils/ens/normalize.d.ts +2 -2
- package/_types/utils/errors/getNodeError.d.ts.map +1 -1
- package/_types/utils/formatters/block.d.ts +3 -7
- package/_types/utils/formatters/block.d.ts.map +1 -1
- package/_types/utils/formatters/formatter.d.ts +1 -1
- package/_types/utils/formatters/transaction.d.ts +3 -7
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/transactionReceipt.d.ts +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +1 -1
- package/_types/utils/getAction.d.ts +8 -1
- package/_types/utils/getAction.d.ts.map +1 -1
- package/_types/utils/index.d.ts +2 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/promise/createBatchScheduler.d.ts.map +1 -1
- package/_types/utils/transaction/getSerializedTransactionType.d.ts.map +1 -1
- package/_types/utils/transaction/getTransactionType.d.ts.map +1 -1
- package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
- package/_types/utils/unit/formatEther.d.ts +11 -0
- package/_types/utils/unit/formatEther.d.ts.map +1 -1
- package/_types/utils/unit/formatGwei.d.ts +11 -0
- package/_types/utils/unit/formatGwei.d.ts.map +1 -1
- package/_types/utils/unit/formatUnits.d.ts +11 -0
- package/_types/utils/unit/formatUnits.d.ts.map +1 -1
- package/_types/utils/unit/parseEther.d.ts +11 -0
- package/_types/utils/unit/parseEther.d.ts.map +1 -1
- package/_types/utils/unit/parseGwei.d.ts +11 -0
- package/_types/utils/unit/parseGwei.d.ts.map +1 -1
- package/_types/utils/unit/parseUnits.d.ts +11 -0
- package/_types/utils/unit/parseUnits.d.ts.map +1 -1
- package/accounts/utils/signTransaction.ts +4 -2
- package/actions/ens/getEnsAddress.ts +3 -2
- package/actions/ens/getEnsAvatar.ts +3 -2
- package/actions/ens/getEnsName.ts +3 -2
- package/actions/ens/getEnsResolver.ts +3 -2
- package/actions/ens/getEnsText.ts +3 -2
- package/actions/getContract.ts +12 -11
- package/actions/public/createContractEventFilter.ts +7 -7
- package/actions/public/createEventFilter.ts +1 -1
- package/actions/public/estimateContractGas.ts +3 -9
- package/actions/public/estimateFeesPerGas.ts +8 -5
- package/actions/public/estimateGas.ts +8 -14
- package/actions/public/estimateMaxPriorityFeePerGas.ts +10 -6
- package/actions/public/getBlock.ts +1 -1
- package/actions/public/getBlockNumber.ts +1 -1
- package/actions/public/getContractEvents.ts +1 -0
- package/actions/public/getFilterChanges.ts +30 -39
- package/actions/public/getFilterLogs.ts +17 -38
- package/actions/public/getLogs.ts +16 -38
- package/actions/public/getTransaction.ts +1 -1
- package/actions/public/getTransactionConfirmations.ts +5 -3
- package/actions/public/getTransactionReceipt.ts +1 -1
- package/actions/public/multicall.ts +1 -0
- package/actions/public/readContract.ts +2 -1
- package/actions/public/simulateContract.ts +8 -5
- package/actions/public/verifyHash.ts +1 -0
- package/actions/public/waitForTransactionReceipt.ts +40 -13
- package/actions/public/watchBlockNumber.ts +2 -1
- package/actions/public/watchBlocks.ts +3 -1
- package/actions/public/watchContractEvent.ts +19 -4
- package/actions/public/watchEvent.ts +19 -4
- package/actions/public/watchPendingTransactions.ts +13 -3
- package/actions/wallet/addChain.ts +17 -14
- package/actions/wallet/deployContract.ts +3 -3
- package/actions/wallet/prepareTransactionRequest.ts +130 -67
- package/actions/wallet/requestAddresses.ts +4 -1
- package/actions/wallet/requestPermissions.ts +7 -4
- package/actions/wallet/sendRawTransaction.ts +7 -4
- package/actions/wallet/sendTransaction.ts +19 -16
- package/actions/wallet/signMessage.ts +7 -4
- package/actions/wallet/signTransaction.ts +23 -19
- package/actions/wallet/signTypedData.ts +7 -4
- package/actions/wallet/switchChain.ts +11 -8
- package/actions/wallet/watchAsset.ts +7 -4
- package/actions/wallet/writeContract.ts +21 -12
- package/chains/celo/parsers.ts +3 -3
- package/chains/celo/serializers.ts +4 -8
- package/chains/celo/utils.ts +16 -3
- package/chains/definitions/aurora.ts +6 -0
- package/chains/definitions/base.ts +9 -0
- package/chains/definitions/baseGoerli.ts +8 -1
- package/chains/definitions/baseSepolia.ts +12 -2
- package/chains/definitions/bscTestnet.ts +2 -1
- package/chains/definitions/confluxESpace.ts +1 -0
- package/chains/definitions/confluxESpaceTestnet.ts +31 -0
- package/chains/definitions/filecoin.ts +6 -0
- package/chains/definitions/klaytn.ts +6 -0
- package/chains/definitions/klaytnBaobab.ts +27 -0
- package/chains/definitions/optimism.ts +8 -0
- package/chains/definitions/optimismGoerli.ts +8 -0
- package/chains/definitions/optimismSepolia.ts +8 -0
- package/chains/definitions/pgn.ts +34 -0
- package/chains/definitions/pgnTestnet.ts +35 -0
- package/chains/definitions/rootstock.ts +26 -0
- package/chains/definitions/sapphire.ts +30 -0
- package/chains/definitions/sapphireTestnet.ts +25 -0
- package/chains/definitions/shibarium.ts +32 -0
- package/chains/definitions/shimmer.ts +26 -0
- package/chains/definitions/shimmerTestnet.ts +27 -0
- package/chains/definitions/zora.ts +8 -0
- package/chains/definitions/zoraSepolia.ts +8 -0
- package/chains/definitions/zoraTestnet.ts +8 -0
- package/chains/index.ts +15 -3
- package/chains/opStack/abis.ts +318 -0
- package/chains/opStack/actions/buildDepositTransaction.ts +151 -0
- package/chains/opStack/actions/depositTransaction.ts +171 -0
- package/chains/opStack/actions/estimateL1Fee.ts +3 -3
- package/chains/opStack/actions/estimateL1Gas.ts +2 -2
- package/chains/opStack/chainConfig.ts +2 -0
- package/chains/opStack/chains.ts +9 -0
- package/chains/opStack/decorators/{public.ts → publicL2.ts} +47 -4
- package/chains/opStack/decorators/walletL1.ts +86 -0
- package/chains/opStack/formatters.ts +3 -1
- package/chains/opStack/index.ts +77 -12
- package/chains/opStack/parsers.ts +88 -0
- package/chains/opStack/serializers.ts +88 -0
- package/chains/opStack/types/block.ts +34 -0
- package/chains/opStack/types/chain.ts +7 -0
- package/chains/opStack/types/contract.ts +17 -0
- package/chains/opStack/{types.ts → types/transaction.ts} +39 -33
- package/chains/opStack/utils/extractTransactionDepositedLogs.ts +36 -0
- package/chains/opStack/utils/fromOpaqueData.ts +40 -0
- package/chains/opStack/utils/getL2TransactionHash.ts +52 -0
- package/chains/opStack/utils/getL2TransactionHashes.ts +21 -0
- package/chains/opStack/utils/getSourceHash.ts +61 -0
- package/clients/createClient.ts +1 -1
- package/clients/createWalletClient.ts +1 -1
- package/clients/decorators/public.ts +42 -31
- package/clients/decorators/wallet.ts +26 -7
- package/clients/transports/fallback.ts +24 -6
- package/errors/base.ts +2 -2
- package/errors/estimateGas.ts +1 -1
- package/errors/version.ts +1 -1
- package/index.ts +2 -1
- package/package.json +15 -37
- package/types/account.ts +11 -2
- package/types/chain.ts +23 -12
- package/types/contract.ts +64 -64
- package/types/eip1193.ts +8 -0
- package/types/ens.ts +1 -1
- package/types/filter.ts +12 -12
- package/types/log.ts +4 -4
- package/types/multicall.ts +66 -61
- package/types/rpc.ts +1 -1
- package/types/transaction.ts +4 -4
- package/types/utils.ts +26 -7
- package/utils/abi/decodeEventLog.ts +2 -1
- package/utils/abi/decodeFunctionData.ts +2 -1
- package/utils/abi/decodeFunctionResult.ts +2 -2
- package/utils/abi/encodeDeployData.ts +2 -2
- package/utils/abi/encodeErrorResult.ts +2 -2
- package/utils/abi/encodeEventTopics.ts +6 -6
- package/utils/abi/encodeFunctionData.ts +2 -2
- package/utils/abi/encodeFunctionResult.ts +2 -2
- package/utils/abi/parseEventLogs.ts +129 -0
- package/utils/buildRequest.ts +46 -41
- package/utils/ccip.ts +4 -3
- package/utils/encoding/fromBytes.ts +8 -8
- package/utils/encoding/fromHex.ts +8 -8
- package/utils/encoding/toBytes.ts +2 -2
- package/utils/encoding/toRlp.ts +3 -1
- package/utils/ens/avatar/utils.ts +3 -1
- package/utils/ens/namehash.ts +1 -1
- package/utils/ens/normalize.ts +2 -2
- package/utils/errors/getContractError.ts +2 -2
- package/utils/errors/getNodeError.ts +12 -11
- package/utils/formatters/block.ts +2 -4
- package/utils/formatters/formatter.ts +1 -1
- package/utils/formatters/transaction.ts +2 -4
- package/utils/getAction.ts +11 -1
- package/utils/index.ts +6 -2
- package/utils/observe.ts +1 -1
- package/utils/promise/createBatchScheduler.ts +8 -4
- package/utils/transaction/getSerializedTransactionType.ts +2 -2
- package/utils/transaction/getTransactionType.ts +2 -1
- package/utils/transaction/serializeTransaction.ts +6 -3
- package/utils/unit/formatEther.ts +11 -0
- package/utils/unit/formatGwei.ts +11 -0
- package/utils/unit/formatUnits.ts +11 -0
- package/utils/unit/parseEther.ts +11 -0
- package/utils/unit/parseGwei.ts +11 -0
- package/utils/unit/parseUnits.ts +11 -0
- package/_cjs/chains/opStack/decorators/public.js.map +0 -1
- package/_cjs/chains/opStack/types.js.map +0 -1
- package/_esm/chains/opStack/decorators/public.js.map +0 -1
- package/_esm/chains/opStack/types.js +0 -2
- package/_esm/chains/opStack/types.js.map +0 -1
- package/_types/chains/opStack/decorators/public.d.ts.map +0 -1
- package/_types/chains/opStack/types.d.ts.map +0 -1
@@ -217,6 +217,7 @@ import {
|
|
217
217
|
watchPendingTransactions,
|
218
218
|
} from '../../actions/public/watchPendingTransactions.js'
|
219
219
|
import {
|
220
|
+
type ParameterType,
|
220
221
|
type PrepareTransactionRequestParameters,
|
221
222
|
type PrepareTransactionRequestReturnType,
|
222
223
|
prepareTransactionRequest,
|
@@ -447,13 +448,7 @@ export type PublicActions<
|
|
447
448
|
functionName
|
448
449
|
>,
|
449
450
|
>(
|
450
|
-
args: EstimateContractGasParameters<
|
451
|
-
abi,
|
452
|
-
functionName,
|
453
|
-
args,
|
454
|
-
TChain,
|
455
|
-
TAccount
|
456
|
-
>,
|
451
|
+
args: EstimateContractGasParameters<abi, functionName, args, TChain>,
|
457
452
|
) => Promise<EstimateContractGasReturnType>
|
458
453
|
/**
|
459
454
|
* Estimates the gas necessary to complete a transaction without submitting it to the network.
|
@@ -479,7 +474,7 @@ export type PublicActions<
|
|
479
474
|
* })
|
480
475
|
*/
|
481
476
|
estimateGas: (
|
482
|
-
args: EstimateGasParameters<TChain
|
477
|
+
args: EstimateGasParameters<TChain>,
|
483
478
|
) => Promise<EstimateGasReturnType>
|
484
479
|
/**
|
485
480
|
* Returns the balance of an address in wei.
|
@@ -520,7 +515,7 @@ export type PublicActions<
|
|
520
515
|
* Returns information about a block at a block number, hash, or tag.
|
521
516
|
*
|
522
517
|
* - Docs: https://viem.sh/docs/actions/public/getBlock.html
|
523
|
-
* - Examples: https://stackblitz.com/github/
|
518
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks
|
524
519
|
* - JSON-RPC Methods:
|
525
520
|
* - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.
|
526
521
|
* - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.
|
@@ -548,7 +543,7 @@ export type PublicActions<
|
|
548
543
|
* Returns the number of the most recent block seen.
|
549
544
|
*
|
550
545
|
* - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html
|
551
|
-
* - Examples: https://stackblitz.com/github/
|
546
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks
|
552
547
|
* - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)
|
553
548
|
*
|
554
549
|
* @param args - {@link GetBlockNumberParameters}
|
@@ -680,7 +675,7 @@ export type PublicActions<
|
|
680
675
|
* Gets address for ENS name.
|
681
676
|
*
|
682
677
|
* - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html
|
683
|
-
* - Examples: https://stackblitz.com/github/
|
678
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
684
679
|
*
|
685
680
|
* @remarks
|
686
681
|
* Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
|
@@ -700,7 +695,7 @@ export type PublicActions<
|
|
700
695
|
* transport: http(),
|
701
696
|
* })
|
702
697
|
* const ensAddress = await client.getEnsAddress({
|
703
|
-
* name: normalize('
|
698
|
+
* name: normalize('wevm.eth'),
|
704
699
|
* })
|
705
700
|
* // '0xd2135CfB216b74109775236E36d4b433F1DF507B'
|
706
701
|
*/
|
@@ -711,7 +706,7 @@ export type PublicActions<
|
|
711
706
|
* Gets the avatar of an ENS name.
|
712
707
|
*
|
713
708
|
* - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html
|
714
|
-
* - Examples: https://stackblitz.com/github/
|
709
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
715
710
|
*
|
716
711
|
* @remarks
|
717
712
|
* Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`.
|
@@ -731,7 +726,7 @@ export type PublicActions<
|
|
731
726
|
* transport: http(),
|
732
727
|
* })
|
733
728
|
* const ensAvatar = await client.getEnsAvatar({
|
734
|
-
* name: normalize('
|
729
|
+
* name: normalize('wevm.eth'),
|
735
730
|
* })
|
736
731
|
* // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'
|
737
732
|
*/
|
@@ -742,7 +737,7 @@ export type PublicActions<
|
|
742
737
|
* Gets primary name for specified address.
|
743
738
|
*
|
744
739
|
* - Docs: https://viem.sh/docs/ens/actions/getEnsName.html
|
745
|
-
* - Examples: https://stackblitz.com/github/
|
740
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
746
741
|
*
|
747
742
|
* @remarks
|
748
743
|
* Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name.
|
@@ -761,14 +756,14 @@ export type PublicActions<
|
|
761
756
|
* const ensName = await client.getEnsName({
|
762
757
|
* address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
|
763
758
|
* })
|
764
|
-
* // '
|
759
|
+
* // 'wevm.eth'
|
765
760
|
*/
|
766
761
|
getEnsName: (args: GetEnsNameParameters) => Promise<GetEnsNameReturnType>
|
767
762
|
/**
|
768
763
|
* Gets resolver for ENS name.
|
769
764
|
*
|
770
765
|
* - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html
|
771
|
-
* - Examples: https://stackblitz.com/github/
|
766
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
772
767
|
*
|
773
768
|
* @remarks
|
774
769
|
* Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.
|
@@ -788,7 +783,7 @@ export type PublicActions<
|
|
788
783
|
* transport: http(),
|
789
784
|
* })
|
790
785
|
* const resolverAddress = await client.getEnsResolver({
|
791
|
-
* name: normalize('
|
786
|
+
* name: normalize('wevm.eth'),
|
792
787
|
* })
|
793
788
|
* // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'
|
794
789
|
*/
|
@@ -799,7 +794,7 @@ export type PublicActions<
|
|
799
794
|
* Gets a text record for specified ENS name.
|
800
795
|
*
|
801
796
|
* - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html
|
802
|
-
* - Examples: https://stackblitz.com/github/
|
797
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
803
798
|
*
|
804
799
|
* @remarks
|
805
800
|
* Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
|
@@ -819,7 +814,7 @@ export type PublicActions<
|
|
819
814
|
* transport: http(),
|
820
815
|
* })
|
821
816
|
* const twitterRecord = await client.getEnsText({
|
822
|
-
* name: normalize('
|
817
|
+
* name: normalize('wevm.eth'),
|
823
818
|
* key: 'com.twitter',
|
824
819
|
* })
|
825
820
|
* // 'wagmi_sh'
|
@@ -1047,7 +1042,7 @@ export type PublicActions<
|
|
1047
1042
|
* Returns a list of event logs matching the provided parameters.
|
1048
1043
|
*
|
1049
1044
|
* - Docs: https://viem.sh/docs/actions/public/getLogs.html
|
1050
|
-
* - Examples: https://stackblitz.com/github/
|
1045
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/filters-and-logs/event-logs
|
1051
1046
|
* - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
|
1052
1047
|
*
|
1053
1048
|
* @param args - {@link GetLogsParameters}
|
@@ -1163,7 +1158,7 @@ export type PublicActions<
|
|
1163
1158
|
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
|
1164
1159
|
*
|
1165
1160
|
* - Docs: https://viem.sh/docs/actions/public/getTransaction.html
|
1166
|
-
* - Example: https://stackblitz.com/github/
|
1161
|
+
* - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
|
1167
1162
|
* - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)
|
1168
1163
|
*
|
1169
1164
|
* @param args - {@link GetTransactionParameters}
|
@@ -1188,7 +1183,7 @@ export type PublicActions<
|
|
1188
1183
|
* Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
|
1189
1184
|
*
|
1190
1185
|
* - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html
|
1191
|
-
* - Example: https://stackblitz.com/github/
|
1186
|
+
* - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
|
1192
1187
|
* - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)
|
1193
1188
|
*
|
1194
1189
|
* @param args - {@link GetTransactionConfirmationsParameters}
|
@@ -1237,7 +1232,7 @@ export type PublicActions<
|
|
1237
1232
|
* Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash.
|
1238
1233
|
*
|
1239
1234
|
* - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
|
1240
|
-
* - Example: https://stackblitz.com/github/
|
1235
|
+
* - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
|
1241
1236
|
* - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt)
|
1242
1237
|
*
|
1243
1238
|
* @param args - {@link GetTransactionReceiptParameters}
|
@@ -1340,15 +1335,31 @@ export type PublicActions<
|
|
1340
1335
|
* })
|
1341
1336
|
*/
|
1342
1337
|
prepareTransactionRequest: <
|
1338
|
+
TParameterType extends ParameterType,
|
1343
1339
|
TChainOverride extends Chain | undefined = undefined,
|
1340
|
+
TAccountOverride extends Account | Address | undefined = undefined,
|
1344
1341
|
>(
|
1345
|
-
args: PrepareTransactionRequestParameters<
|
1346
|
-
|
1342
|
+
args: PrepareTransactionRequestParameters<
|
1343
|
+
TChain,
|
1344
|
+
TAccount,
|
1345
|
+
TChainOverride,
|
1346
|
+
TAccountOverride,
|
1347
|
+
TParameterType
|
1348
|
+
>,
|
1349
|
+
) => Promise<
|
1350
|
+
PrepareTransactionRequestReturnType<
|
1351
|
+
Chain,
|
1352
|
+
TAccount,
|
1353
|
+
TChainOverride,
|
1354
|
+
TAccountOverride,
|
1355
|
+
TParameterType
|
1356
|
+
>
|
1357
|
+
>
|
1347
1358
|
/**
|
1348
1359
|
* Calls a read-only function on a contract, and returns the response.
|
1349
1360
|
*
|
1350
1361
|
* - Docs: https://viem.sh/docs/contract/readContract.html
|
1351
|
-
* - Examples: https://stackblitz.com/github/
|
1362
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/reading-contracts
|
1352
1363
|
*
|
1353
1364
|
* @remarks
|
1354
1365
|
* A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.
|
@@ -1413,7 +1424,7 @@ export type PublicActions<
|
|
1413
1424
|
* Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.
|
1414
1425
|
*
|
1415
1426
|
* - Docs: https://viem.sh/docs/contract/simulateContract.html
|
1416
|
-
* - Examples: https://stackblitz.com/github/
|
1427
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
|
1417
1428
|
*
|
1418
1429
|
* @remarks
|
1419
1430
|
* This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions.
|
@@ -1504,7 +1515,7 @@ export type PublicActions<
|
|
1504
1515
|
* Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error.
|
1505
1516
|
*
|
1506
1517
|
* - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html
|
1507
|
-
* - Example: https://stackblitz.com/github/
|
1518
|
+
* - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions
|
1508
1519
|
* - JSON-RPC Methods:
|
1509
1520
|
* - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.
|
1510
1521
|
* - If a Transaction has been replaced:
|
@@ -1545,7 +1556,7 @@ export type PublicActions<
|
|
1545
1556
|
* Watches and returns incoming block numbers.
|
1546
1557
|
*
|
1547
1558
|
* - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html
|
1548
|
-
* - Examples: https://stackblitz.com/github/
|
1559
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks
|
1549
1560
|
* - JSON-RPC Methods:
|
1550
1561
|
* - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.
|
1551
1562
|
* - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
|
@@ -1572,7 +1583,7 @@ export type PublicActions<
|
|
1572
1583
|
* Watches and returns information for incoming blocks.
|
1573
1584
|
*
|
1574
1585
|
* - Docs: https://viem.sh/docs/actions/public/watchBlocks.html
|
1575
|
-
* - Examples: https://stackblitz.com/github/
|
1586
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks
|
1576
1587
|
* - JSON-RPC Methods:
|
1577
1588
|
* - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.
|
1578
1589
|
* - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi, TypedData } from 'abitype'
|
1
|
+
import type { Abi, Address, TypedData } from 'abitype'
|
2
2
|
|
3
3
|
import type { Account } from '../../accounts/types.js'
|
4
4
|
import {
|
@@ -23,6 +23,7 @@ import {
|
|
23
23
|
getPermissions,
|
24
24
|
} from '../../actions/wallet/getPermissions.js'
|
25
25
|
import {
|
26
|
+
type ParameterType,
|
26
27
|
type PrepareTransactionRequestParameters,
|
27
28
|
type PrepareTransactionRequestReturnType,
|
28
29
|
prepareTransactionRequest,
|
@@ -109,7 +110,7 @@ export type WalletActions<
|
|
109
110
|
* Deploys a contract to the network, given bytecode and constructor arguments.
|
110
111
|
*
|
111
112
|
* - Docs: https://viem.sh/docs/contract/deployContract.html
|
112
|
-
* - Examples: https://stackblitz.com/github/
|
113
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/deploying-contracts
|
113
114
|
*
|
114
115
|
* @param args - {@link DeployContractParameters}
|
115
116
|
* @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}
|
@@ -232,9 +233,27 @@ export type WalletActions<
|
|
232
233
|
* value: 1n,
|
233
234
|
* })
|
234
235
|
*/
|
235
|
-
prepareTransactionRequest: <
|
236
|
-
|
237
|
-
|
236
|
+
prepareTransactionRequest: <
|
237
|
+
TParameterType extends ParameterType,
|
238
|
+
TChainOverride extends Chain | undefined = undefined,
|
239
|
+
TAccountOverride extends Account | Address | undefined = undefined,
|
240
|
+
>(
|
241
|
+
args: PrepareTransactionRequestParameters<
|
242
|
+
TChain,
|
243
|
+
TAccount,
|
244
|
+
TChainOverride,
|
245
|
+
TAccountOverride,
|
246
|
+
TParameterType
|
247
|
+
>,
|
248
|
+
) => Promise<
|
249
|
+
PrepareTransactionRequestReturnType<
|
250
|
+
Chain,
|
251
|
+
TAccount,
|
252
|
+
TChainOverride,
|
253
|
+
TAccountOverride,
|
254
|
+
TParameterType
|
255
|
+
>
|
256
|
+
>
|
238
257
|
/**
|
239
258
|
* Requests a list of accounts managed by a wallet.
|
240
259
|
*
|
@@ -313,7 +332,7 @@ export type WalletActions<
|
|
313
332
|
* Creates, signs, and sends a new transaction to the network.
|
314
333
|
*
|
315
334
|
* - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html
|
316
|
-
* - Examples: https://stackblitz.com/github/
|
335
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions
|
317
336
|
* - JSON-RPC Methods:
|
318
337
|
* - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
|
319
338
|
* - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
|
@@ -598,7 +617,7 @@ export type WalletActions<
|
|
598
617
|
* Executes a write function on a contract.
|
599
618
|
*
|
600
619
|
* - Docs: https://viem.sh/docs/contract/writeContract.html
|
601
|
-
* - Examples: https://stackblitz.com/github/
|
620
|
+
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
|
602
621
|
*
|
603
622
|
* A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state.
|
604
623
|
*
|
@@ -1,6 +1,9 @@
|
|
1
|
+
import {
|
2
|
+
TransactionRejectedRpcError,
|
3
|
+
UserRejectedRequestError,
|
4
|
+
} from '../../errors/rpc.js'
|
1
5
|
import type { ErrorType } from '../../errors/utils.js'
|
2
6
|
import type { Chain } from '../../types/chain.js'
|
3
|
-
import { isDeterministicError } from '../../utils/buildRequest.js'
|
4
7
|
import { wait } from '../../utils/wait.js'
|
5
8
|
|
6
9
|
import {
|
@@ -96,7 +99,7 @@ export function fallback(
|
|
96
99
|
retryCount,
|
97
100
|
retryDelay,
|
98
101
|
} = config
|
99
|
-
return ({ chain, pollingInterval = 4_000, timeout }) => {
|
102
|
+
return ({ chain, pollingInterval = 4_000, timeout, ...rest }) => {
|
100
103
|
let transports = transports_
|
101
104
|
|
102
105
|
let onResponse: OnResponseFn = () => {}
|
@@ -107,7 +110,12 @@ export function fallback(
|
|
107
110
|
name,
|
108
111
|
async request({ method, params }) {
|
109
112
|
const fetch = async (i = 0): Promise<any> => {
|
110
|
-
const transport = transports[i]({
|
113
|
+
const transport = transports[i]({
|
114
|
+
...rest,
|
115
|
+
chain,
|
116
|
+
retryCount: 0,
|
117
|
+
timeout,
|
118
|
+
})
|
111
119
|
try {
|
112
120
|
const response = await transport.request({
|
113
121
|
method,
|
@@ -132,9 +140,7 @@ export function fallback(
|
|
132
140
|
status: 'error',
|
133
141
|
})
|
134
142
|
|
135
|
-
|
136
|
-
// So throw the error.
|
137
|
-
if (isDeterministicError(err as Error)) throw err
|
143
|
+
if (shouldThrow(err as Error)) throw err
|
138
144
|
|
139
145
|
// If we've reached the end of the fallbacks, throw the error.
|
140
146
|
if (i === transports.length - 1) throw err
|
@@ -171,6 +177,18 @@ export function fallback(
|
|
171
177
|
}
|
172
178
|
}
|
173
179
|
|
180
|
+
function shouldThrow(error: Error) {
|
181
|
+
if ('code' in error && typeof error.code === 'number') {
|
182
|
+
if (
|
183
|
+
error.code === TransactionRejectedRpcError.code ||
|
184
|
+
error.code === UserRejectedRequestError.code ||
|
185
|
+
error.code === 5000 // CAIP UserRejectedRequestError
|
186
|
+
)
|
187
|
+
return true
|
188
|
+
}
|
189
|
+
return false
|
190
|
+
}
|
191
|
+
|
174
192
|
export function rankTransports({
|
175
193
|
chain,
|
176
194
|
interval = 4_000,
|
package/errors/base.ts
CHANGED
@@ -32,8 +32,8 @@ export class BaseError extends Error {
|
|
32
32
|
args.cause instanceof BaseError
|
33
33
|
? args.cause.details
|
34
34
|
: args.cause?.message
|
35
|
-
|
36
|
-
|
35
|
+
? args.cause.message
|
36
|
+
: args.details!
|
37
37
|
const docsPath =
|
38
38
|
args.cause instanceof BaseError
|
39
39
|
? args.cause.docsPath || args.docsPath
|
package/errors/estimateGas.ts
CHANGED
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '2.0.0-beta.
|
1
|
+
export const version = '2.0.0-beta.8'
|
package/index.ts
CHANGED
package/package.json
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "viem",
|
3
3
|
"description": "TypeScript Interface for Ethereum",
|
4
|
-
"version": "2.0.0-beta.
|
4
|
+
"version": "2.0.0-beta.8",
|
5
|
+
"type": "module",
|
5
6
|
"main": "./_cjs/index.js",
|
6
7
|
"module": "./_esm/index.js",
|
7
8
|
"types": "./_types/index.d.ts",
|
@@ -76,27 +77,13 @@
|
|
76
77
|
},
|
77
78
|
"typesVersions": {
|
78
79
|
"*": {
|
79
|
-
"accounts": [
|
80
|
-
|
81
|
-
],
|
82
|
-
"
|
83
|
-
|
84
|
-
],
|
85
|
-
"
|
86
|
-
"./_types/chains/index.d.ts"
|
87
|
-
],
|
88
|
-
"chains/utils": [
|
89
|
-
"./_types/chains/utils.d.ts"
|
90
|
-
],
|
91
|
-
"ens": [
|
92
|
-
"./_types/ens/index.d.ts"
|
93
|
-
],
|
94
|
-
"utils": [
|
95
|
-
"./_types/utils/index.d.ts"
|
96
|
-
],
|
97
|
-
"window": [
|
98
|
-
"./_types/window/index.d.ts"
|
99
|
-
]
|
80
|
+
"accounts": ["./_types/accounts/index.d.ts"],
|
81
|
+
"actions": ["./_types/actions/index.d.ts"],
|
82
|
+
"chains": ["./_types/chains/index.d.ts"],
|
83
|
+
"chains/utils": ["./_types/chains/utils.d.ts"],
|
84
|
+
"ens": ["./_types/ens/index.d.ts"],
|
85
|
+
"utils": ["./_types/utils/index.d.ts"],
|
86
|
+
"window": ["./_types/window/index.d.ts"]
|
100
87
|
}
|
101
88
|
},
|
102
89
|
"peerDependencies": {
|
@@ -108,7 +95,7 @@
|
|
108
95
|
}
|
109
96
|
},
|
110
97
|
"dependencies": {
|
111
|
-
"@adraffy/ens-normalize": "1.
|
98
|
+
"@adraffy/ens-normalize": "1.10.0",
|
112
99
|
"@noble/curves": "1.2.0",
|
113
100
|
"@noble/hashes": "1.3.2",
|
114
101
|
"@scure/bip32": "1.3.2",
|
@@ -119,22 +106,13 @@
|
|
119
106
|
},
|
120
107
|
"license": "MIT",
|
121
108
|
"homepage": "https://viem.sh",
|
122
|
-
"repository": "
|
123
|
-
"authors": [
|
124
|
-
"awkweb.eth",
|
125
|
-
"jxom.eth"
|
126
|
-
],
|
109
|
+
"repository": "wevm/viem",
|
110
|
+
"authors": ["awkweb.eth", "jxom.eth"],
|
127
111
|
"funding": [
|
128
112
|
{
|
129
113
|
"type": "github",
|
130
|
-
"url": "https://github.com/sponsors/
|
114
|
+
"url": "https://github.com/sponsors/wevm"
|
131
115
|
}
|
132
116
|
],
|
133
|
-
"keywords": [
|
134
|
-
|
135
|
-
"ethereum",
|
136
|
-
"dapps",
|
137
|
-
"wallet",
|
138
|
-
"web3"
|
139
|
-
]
|
140
|
-
}
|
117
|
+
"keywords": ["eth", "ethereum", "dapps", "wallet", "web3"]
|
118
|
+
}
|
package/types/account.ts
CHANGED
@@ -4,11 +4,20 @@ import type { Account, JsonRpcAccount } from '../accounts/types.js'
|
|
4
4
|
|
5
5
|
import type { IsUndefined, Prettify } from './utils.js'
|
6
6
|
|
7
|
+
export type DeriveAccount<
|
8
|
+
account extends Account | undefined,
|
9
|
+
accountOverride extends Account | Address | undefined,
|
10
|
+
> = accountOverride extends Account ? accountOverride : account
|
11
|
+
|
7
12
|
export type GetAccountParameter<
|
8
13
|
TAccount extends Account | undefined = Account | undefined,
|
14
|
+
TAccountOverride extends Account | Address | undefined = Account | Address,
|
15
|
+
TRequired extends boolean = true,
|
9
16
|
> = IsUndefined<TAccount> extends true
|
10
|
-
?
|
11
|
-
|
17
|
+
? TRequired extends true
|
18
|
+
? { account: TAccountOverride }
|
19
|
+
: { account?: TAccountOverride }
|
20
|
+
: { account?: TAccountOverride }
|
12
21
|
|
13
22
|
export type ParseAccount<
|
14
23
|
TAccountOrAddress extends Account | Address | undefined =
|
package/types/chain.ts
CHANGED
@@ -30,7 +30,7 @@ export type Chain<
|
|
30
30
|
{
|
31
31
|
[key: string]:
|
32
32
|
| ChainContract
|
33
|
-
| { [
|
33
|
+
| { [sourceId: number]: ChainContract | undefined }
|
34
34
|
| undefined
|
35
35
|
} & {
|
36
36
|
ensRegistry?: ChainContract | undefined
|
@@ -63,7 +63,7 @@ export type Chain<
|
|
63
63
|
/** Modifies how data (ie. Transactions) is serialized. */
|
64
64
|
serializers?: ChainSerializers<formatters> | undefined
|
65
65
|
/** Modifies how fees are derived. */
|
66
|
-
fees?: ChainFees<formatters> | undefined
|
66
|
+
fees?: ChainFees<formatters | undefined> | undefined
|
67
67
|
}
|
68
68
|
|
69
69
|
/////////////////////////////////////////////////////////////////////
|
@@ -168,7 +168,9 @@ export type ChainFeesFnParameters<
|
|
168
168
|
formatters extends ChainFormatters | undefined = ChainFormatters | undefined,
|
169
169
|
> = {
|
170
170
|
/** The latest block. */
|
171
|
-
block: Prettify<
|
171
|
+
block: Prettify<
|
172
|
+
FormattedBlock<Omit<Chain, 'formatters'> & { formatters: formatters }>
|
173
|
+
>
|
172
174
|
client: Client<Transport, Chain>
|
173
175
|
/**
|
174
176
|
* A transaction request. This value will be undefined if the caller
|
@@ -206,7 +208,7 @@ export type ExtractChain<
|
|
206
208
|
> = Extract<chains[number], { id: chainId }>
|
207
209
|
|
208
210
|
export type ExtractChainFormatterExclude<
|
209
|
-
chain extends
|
211
|
+
chain extends Chain | undefined,
|
210
212
|
type extends keyof ChainFormatters,
|
211
213
|
> = chain extends { formatters?: infer _Formatters extends ChainFormatters }
|
212
214
|
? _Formatters[type] extends { exclude: infer Exclude }
|
@@ -215,7 +217,7 @@ export type ExtractChainFormatterExclude<
|
|
215
217
|
: ''
|
216
218
|
|
217
219
|
export type ExtractChainFormatterParameters<
|
218
|
-
chain extends
|
220
|
+
chain extends Chain | undefined,
|
219
221
|
type extends keyof ChainFormatters,
|
220
222
|
fallback,
|
221
223
|
> = chain extends { formatters?: infer _Formatters extends ChainFormatters }
|
@@ -225,18 +227,27 @@ export type ExtractChainFormatterParameters<
|
|
225
227
|
: fallback
|
226
228
|
|
227
229
|
export type ExtractChainFormatterReturnType<
|
228
|
-
chain extends
|
230
|
+
chain extends Chain | undefined,
|
229
231
|
type extends keyof ChainFormatters,
|
230
232
|
fallback,
|
231
|
-
> = chain extends {
|
232
|
-
|
233
|
-
|
234
|
-
|
233
|
+
> = chain extends {
|
234
|
+
formatters?:
|
235
|
+
| { [_ in type]?: infer formatter extends ChainFormatter }
|
236
|
+
| undefined
|
237
|
+
}
|
238
|
+
? chain['formatters'] extends undefined
|
239
|
+
? fallback
|
240
|
+
: ReturnType<formatter['format']>
|
235
241
|
: fallback
|
236
242
|
|
237
|
-
export type
|
243
|
+
export type DeriveChain<
|
244
|
+
chain extends Chain | undefined,
|
245
|
+
chainOverride extends Chain | undefined,
|
246
|
+
> = chainOverride extends Chain ? chainOverride : chain
|
247
|
+
|
248
|
+
export type GetChainParameter<
|
238
249
|
chain extends Chain | undefined,
|
239
|
-
chainOverride extends Chain | undefined = undefined,
|
250
|
+
chainOverride extends Chain | undefined = Chain | undefined,
|
240
251
|
> = IsUndefined<chain> extends true
|
241
252
|
? { chain: chainOverride | null }
|
242
253
|
: { chain?: chainOverride | null | undefined }
|