viem 0.0.0-portable-types-20230523145621 → 0.0.0-tmm-sign-typed-data-types.20230619T221425
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/README.md +12 -0
- package/dist/cjs/actions/ens/getEnsAddress.js +34 -23
- package/dist/cjs/actions/ens/getEnsAddress.js.map +1 -1
- package/dist/cjs/actions/getContract.js +22 -16
- package/dist/cjs/actions/getContract.js.map +1 -1
- package/dist/cjs/actions/public/call.js +1 -1
- package/dist/cjs/actions/public/call.js.map +1 -1
- package/dist/cjs/actions/public/createContractEventFilter.js +2 -1
- package/dist/cjs/actions/public/createContractEventFilter.js.map +1 -1
- package/dist/cjs/actions/public/createEventFilter.js +2 -1
- package/dist/cjs/actions/public/createEventFilter.js.map +1 -1
- package/dist/cjs/actions/public/estimateContractGas.js +1 -1
- package/dist/cjs/actions/public/estimateContractGas.js.map +1 -1
- package/dist/cjs/actions/public/estimateGas.js.map +1 -1
- package/dist/cjs/actions/public/getBlock.js.map +1 -1
- package/dist/cjs/actions/public/getBlockTransactionCount.js +1 -1
- package/dist/cjs/actions/public/getBlockTransactionCount.js.map +1 -1
- package/dist/cjs/actions/public/getChainId.js +3 -1
- package/dist/cjs/actions/public/getChainId.js.map +1 -1
- package/dist/cjs/actions/public/getFilterChanges.js +15 -3
- package/dist/cjs/actions/public/getFilterChanges.js.map +1 -1
- package/dist/cjs/actions/public/getFilterLogs.js +14 -2
- package/dist/cjs/actions/public/getFilterLogs.js.map +1 -1
- package/dist/cjs/actions/public/getGasPrice.js.map +1 -1
- package/dist/cjs/actions/public/getLogs.js +15 -3
- package/dist/cjs/actions/public/getLogs.js.map +1 -1
- package/dist/cjs/actions/public/getTransactionCount.js.map +1 -1
- package/dist/cjs/actions/public/verifyTypedData.js +6 -1
- package/dist/cjs/actions/public/verifyTypedData.js.map +1 -1
- package/dist/cjs/actions/public/watchContractEvent.js +3 -1
- package/dist/cjs/actions/public/watchContractEvent.js.map +1 -1
- package/dist/cjs/actions/public/watchEvent.js +3 -1
- package/dist/cjs/actions/public/watchEvent.js.map +1 -1
- package/dist/cjs/actions/test/getAutomine.js +4 -0
- package/dist/cjs/actions/test/getAutomine.js.map +1 -1
- package/dist/cjs/actions/test/mine.js +10 -4
- package/dist/cjs/actions/test/mine.js.map +1 -1
- package/dist/cjs/actions/test/sendUnsignedTransaction.js +21 -3
- package/dist/cjs/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/dist/cjs/actions/test/setAutomine.js +11 -4
- package/dist/cjs/actions/test/setAutomine.js.map +1 -1
- package/dist/cjs/actions/test/setBalance.js +10 -4
- package/dist/cjs/actions/test/setBalance.js.map +1 -1
- package/dist/cjs/actions/wallet/sendTransaction.js +1 -1
- package/dist/cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/dist/cjs/actions/wallet/signMessage.js +8 -1
- package/dist/cjs/actions/wallet/signMessage.js.map +1 -1
- package/dist/cjs/chains.js +14 -2
- package/dist/cjs/chains.js.map +1 -1
- package/dist/cjs/clients/createClient.js +1 -1
- package/dist/cjs/clients/createClient.js.map +1 -1
- package/dist/cjs/clients/createPublicClient.js.map +1 -1
- package/dist/cjs/clients/createTestClient.js.map +1 -1
- package/dist/cjs/clients/createWalletClient.js.map +1 -1
- package/dist/cjs/clients/decorators/public.js.map +1 -1
- package/dist/cjs/clients/decorators/test.js.map +1 -1
- package/dist/cjs/clients/transports/createTransport.js.map +1 -1
- package/dist/cjs/clients/transports/custom.js.map +1 -1
- package/dist/cjs/clients/transports/fallback.js.map +1 -1
- package/dist/cjs/clients/transports/http.js +25 -7
- package/dist/cjs/clients/transports/http.js.map +1 -1
- package/dist/cjs/clients/transports/webSocket.js +22 -14
- package/dist/cjs/clients/transports/webSocket.js.map +1 -1
- package/dist/cjs/errors/abi.js +15 -1
- package/dist/cjs/errors/abi.js.map +1 -1
- package/dist/cjs/errors/base.js +4 -11
- package/dist/cjs/errors/base.js.map +1 -1
- package/dist/cjs/errors/request.js.map +1 -1
- package/dist/cjs/errors/rpc.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/errors/version.js.map +1 -1
- package/dist/cjs/index.js +26 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/eip1193.js.map +1 -1
- package/dist/cjs/utils/abi/decodeEventLog.js +33 -19
- package/dist/cjs/utils/abi/decodeEventLog.js.map +1 -1
- package/dist/cjs/utils/abi/encodeEventTopics.js +11 -7
- package/dist/cjs/utils/abi/encodeEventTopics.js.map +1 -1
- package/dist/cjs/utils/abi/getAbiItem.js +2 -0
- package/dist/cjs/utils/abi/getAbiItem.js.map +1 -1
- package/dist/cjs/utils/encoding/toBytes.js.map +1 -1
- package/dist/cjs/utils/encoding/toHex.js.map +1 -1
- package/dist/cjs/utils/ens/encodeLabelhash.js +8 -0
- package/dist/cjs/utils/ens/encodeLabelhash.js.map +1 -0
- package/dist/cjs/utils/ens/encodedLabelToLabelhash.js +18 -0
- package/dist/cjs/utils/ens/encodedLabelToLabelhash.js.map +1 -0
- package/dist/cjs/utils/ens/labelhash.js +2 -1
- package/dist/cjs/utils/ens/labelhash.js.map +1 -1
- package/dist/cjs/utils/ens/namehash.js +5 -1
- package/dist/cjs/utils/ens/namehash.js.map +1 -1
- package/dist/cjs/utils/ens/packetToBytes.js +10 -9
- package/dist/cjs/utils/ens/packetToBytes.js.map +1 -1
- package/dist/cjs/utils/filters/createFilterRequestScope.js.map +1 -1
- package/dist/cjs/utils/formatters/block.js +3 -1
- package/dist/cjs/utils/formatters/block.js.map +1 -1
- package/dist/cjs/utils/formatters/log.js +2 -2
- package/dist/cjs/utils/formatters/transaction.js +3 -1
- package/dist/cjs/utils/formatters/transaction.js.map +1 -1
- package/dist/cjs/utils/formatters/transactionReceipt.js +1 -1
- package/dist/cjs/utils/formatters/transactionReceipt.js.map +1 -1
- package/dist/cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/dist/cjs/utils/hash/getEventSelector.js +5 -1
- package/dist/cjs/utils/hash/getEventSelector.js.map +1 -1
- package/dist/cjs/utils/hash/getFunctionSelector.js +5 -1
- package/dist/cjs/utils/hash/getFunctionSelector.js.map +1 -1
- package/dist/cjs/utils/hash/hashFunction.js +6 -4
- package/dist/cjs/utils/hash/hashFunction.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/observe.js.map +1 -1
- package/dist/cjs/utils/promise/createBatchScheduler.js.map +1 -1
- package/dist/cjs/utils/promise/withCache.js +8 -4
- package/dist/cjs/utils/promise/withCache.js.map +1 -1
- package/dist/cjs/utils/rpc.js +12 -17
- package/dist/cjs/utils/rpc.js.map +1 -1
- package/dist/cjs/utils/signature/hashMessage.js +7 -1
- package/dist/cjs/utils/signature/hashMessage.js.map +1 -1
- package/dist/cjs/utils/transaction/getTransactionType.js.map +1 -1
- package/dist/cjs/utils/transaction/serializeTransaction.js.map +1 -1
- package/dist/cjs/utils/typedData.js.map +1 -1
- package/dist/cjs/utils/unit/parseUnits.js +13 -3
- package/dist/cjs/utils/unit/parseUnits.js.map +1 -1
- package/dist/esm/accounts/generateMnemonic.js +7 -0
- package/dist/esm/accounts/generateMnemonic.js.map +1 -1
- package/dist/esm/accounts/generatePrivateKey.js +5 -0
- package/dist/esm/accounts/generatePrivateKey.js.map +1 -1
- package/dist/esm/accounts/hdKeyToAccount.js +5 -0
- package/dist/esm/accounts/hdKeyToAccount.js.map +1 -1
- package/dist/esm/accounts/mnemonicToAccount.js +5 -0
- package/dist/esm/accounts/mnemonicToAccount.js.map +1 -1
- package/dist/esm/accounts/privateKeyToAccount.js +5 -0
- package/dist/esm/accounts/privateKeyToAccount.js.map +1 -1
- package/dist/esm/accounts/toAccount.js +5 -0
- package/dist/esm/accounts/toAccount.js.map +1 -1
- package/dist/esm/accounts/utils/publicKeyToAddress.js +7 -0
- package/dist/esm/accounts/utils/publicKeyToAddress.js.map +1 -1
- package/dist/esm/accounts/utils/sign.js +8 -0
- package/dist/esm/accounts/utils/sign.js.map +1 -1
- package/dist/esm/accounts/utils/signMessage.js +6 -0
- package/dist/esm/accounts/utils/signMessage.js.map +1 -1
- package/dist/esm/accounts/utils/signTypedData.js +6 -0
- package/dist/esm/accounts/utils/signTypedData.js.map +1 -1
- package/dist/esm/actions/ens/getEnsAddress.js +62 -23
- package/dist/esm/actions/ens/getEnsAddress.js.map +1 -1
- package/dist/esm/actions/ens/getEnsAvatar.js +28 -0
- package/dist/esm/actions/ens/getEnsAvatar.js.map +1 -1
- package/dist/esm/actions/ens/getEnsName.js +27 -0
- package/dist/esm/actions/ens/getEnsName.js.map +1 -1
- package/dist/esm/actions/ens/getEnsResolver.js +28 -0
- package/dist/esm/actions/ens/getEnsResolver.js.map +1 -1
- package/dist/esm/actions/ens/getEnsText.js +29 -0
- package/dist/esm/actions/ens/getEnsText.js.map +1 -1
- package/dist/esm/actions/getContract.js +58 -16
- package/dist/esm/actions/getContract.js.map +1 -1
- package/dist/esm/actions/public/call.js +32 -1
- package/dist/esm/actions/public/call.js.map +1 -1
- package/dist/esm/actions/public/createBlockFilter.js +21 -0
- package/dist/esm/actions/public/createBlockFilter.js.map +1 -1
- package/dist/esm/actions/public/createContractEventFilter.js +24 -1
- package/dist/esm/actions/public/createContractEventFilter.js.map +1 -1
- package/dist/esm/actions/public/createEventFilter.js +25 -1
- package/dist/esm/actions/public/createEventFilter.js.map +1 -1
- package/dist/esm/actions/public/createPendingTransactionFilter.js +21 -0
- package/dist/esm/actions/public/createPendingTransactionFilter.js.map +1 -1
- package/dist/esm/actions/public/estimateContractGas.js +28 -1
- package/dist/esm/actions/public/estimateContractGas.js.map +1 -1
- package/dist/esm/actions/public/estimateGas.js +26 -0
- package/dist/esm/actions/public/estimateGas.js.map +1 -1
- package/dist/esm/actions/public/getBalance.js +35 -0
- package/dist/esm/actions/public/getBalance.js.map +1 -1
- package/dist/esm/actions/public/getBlock.js +24 -0
- package/dist/esm/actions/public/getBlock.js.map +1 -1
- package/dist/esm/actions/public/getBlockNumber.js +23 -0
- package/dist/esm/actions/public/getBlockNumber.js.map +1 -1
- package/dist/esm/actions/public/getBlockTransactionCount.js +24 -1
- package/dist/esm/actions/public/getBlockTransactionCount.js.map +1 -1
- package/dist/esm/actions/public/getBytecode.js +23 -0
- package/dist/esm/actions/public/getBytecode.js.map +1 -1
- package/dist/esm/actions/public/getChainId.js +24 -1
- package/dist/esm/actions/public/getChainId.js.map +1 -1
- package/dist/esm/actions/public/getFeeHistory.js +24 -0
- package/dist/esm/actions/public/getFeeHistory.js.map +1 -1
- package/dist/esm/actions/public/getFilterChanges.js +99 -3
- package/dist/esm/actions/public/getFilterChanges.js.map +1 -1
- package/dist/esm/actions/public/getFilterLogs.js +43 -2
- package/dist/esm/actions/public/getFilterLogs.js.map +1 -1
- package/dist/esm/actions/public/getGasPrice.js +20 -0
- package/dist/esm/actions/public/getGasPrice.js.map +1 -1
- package/dist/esm/actions/public/getLogs.js +39 -3
- package/dist/esm/actions/public/getLogs.js.map +1 -1
- package/dist/esm/actions/public/getStorageAt.js +24 -0
- package/dist/esm/actions/public/getStorageAt.js.map +1 -1
- package/dist/esm/actions/public/getTransaction.js +24 -0
- package/dist/esm/actions/public/getTransaction.js.map +1 -1
- package/dist/esm/actions/public/getTransactionConfirmations.js +24 -0
- package/dist/esm/actions/public/getTransactionConfirmations.js.map +1 -1
- package/dist/esm/actions/public/getTransactionCount.js +23 -0
- package/dist/esm/actions/public/getTransactionCount.js.map +1 -1
- package/dist/esm/actions/public/getTransactionReceipt.js +24 -0
- package/dist/esm/actions/public/getTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/public/multicall.js +40 -0
- package/dist/esm/actions/public/multicall.js.map +1 -1
- package/dist/esm/actions/public/readContract.js +31 -0
- package/dist/esm/actions/public/readContract.js.map +1 -1
- package/dist/esm/actions/public/simulateContract.js +31 -0
- package/dist/esm/actions/public/simulateContract.js.map +1 -1
- package/dist/esm/actions/public/uninstallFilter.js +24 -0
- package/dist/esm/actions/public/uninstallFilter.js.map +1 -1
- package/dist/esm/actions/public/verifyHash.js +10 -0
- package/dist/esm/actions/public/verifyHash.js.map +1 -1
- package/dist/esm/actions/public/verifyMessage.js +11 -0
- package/dist/esm/actions/public/verifyMessage.js.map +1 -1
- package/dist/esm/actions/public/verifyTypedData.js +16 -2
- package/dist/esm/actions/public/verifyTypedData.js.map +1 -1
- package/dist/esm/actions/public/waitForTransactionReceipt.js +52 -0
- package/dist/esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/public/watchBlockNumber.js +31 -0
- package/dist/esm/actions/public/watchBlockNumber.js.map +1 -1
- package/dist/esm/actions/public/watchBlocks.js +35 -1
- package/dist/esm/actions/public/watchBlocks.js.map +1 -1
- package/dist/esm/actions/public/watchContractEvent.js +39 -1
- package/dist/esm/actions/public/watchContractEvent.js.map +1 -1
- package/dist/esm/actions/public/watchEvent.js +41 -1
- package/dist/esm/actions/public/watchEvent.js.map +1 -1
- package/dist/esm/actions/public/watchPendingTransactions.js +29 -0
- package/dist/esm/actions/public/watchPendingTransactions.js.map +1 -1
- package/dist/esm/actions/test/dropTransaction.js +22 -0
- package/dist/esm/actions/test/dropTransaction.js.map +1 -1
- package/dist/esm/actions/test/getAutomine.js +24 -0
- package/dist/esm/actions/test/getAutomine.js.map +1 -1
- package/dist/esm/actions/test/getTxpoolContent.js +20 -0
- package/dist/esm/actions/test/getTxpoolContent.js.map +1 -1
- package/dist/esm/actions/test/getTxpoolStatus.js +20 -0
- package/dist/esm/actions/test/getTxpoolStatus.js.map +1 -1
- package/dist/esm/actions/test/impersonateAccount.js +22 -0
- package/dist/esm/actions/test/impersonateAccount.js.map +1 -1
- package/dist/esm/actions/test/increaseTime.js +22 -0
- package/dist/esm/actions/test/increaseTime.js.map +1 -1
- package/dist/esm/actions/test/inspectTxpool.js +20 -0
- package/dist/esm/actions/test/inspectTxpool.js.map +1 -1
- package/dist/esm/actions/test/mine.js +30 -4
- package/dist/esm/actions/test/mine.js.map +1 -1
- package/dist/esm/actions/test/removeBlockTimestampInterval.js +19 -0
- package/dist/esm/actions/test/removeBlockTimestampInterval.js.map +1 -1
- package/dist/esm/actions/test/reset.js +20 -0
- package/dist/esm/actions/test/reset.js.map +1 -1
- package/dist/esm/actions/test/revert.js +20 -0
- package/dist/esm/actions/test/revert.js.map +1 -1
- package/dist/esm/actions/test/sendUnsignedTransaction.js +48 -4
- package/dist/esm/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/dist/esm/actions/test/setAutomine.js +30 -4
- package/dist/esm/actions/test/setAutomine.js.map +1 -1
- package/dist/esm/actions/test/setBalance.js +33 -4
- package/dist/esm/actions/test/setBalance.js.map +1 -1
- package/dist/esm/actions/test/setBlockGasLimit.js +20 -0
- package/dist/esm/actions/test/setBlockGasLimit.js.map +1 -1
- package/dist/esm/actions/test/setBlockTimestampInterval.js +20 -0
- package/dist/esm/actions/test/setBlockTimestampInterval.js.map +1 -1
- package/dist/esm/actions/test/setCode.js +23 -0
- package/dist/esm/actions/test/setCode.js.map +1 -1
- package/dist/esm/actions/test/setCoinbase.js +22 -0
- package/dist/esm/actions/test/setCoinbase.js.map +1 -1
- package/dist/esm/actions/test/setIntervalMining.js +20 -0
- package/dist/esm/actions/test/setIntervalMining.js.map +1 -1
- package/dist/esm/actions/test/setLoggingEnabled.js +19 -0
- package/dist/esm/actions/test/setLoggingEnabled.js.map +1 -1
- package/dist/esm/actions/test/setMinGasPrice.js +24 -0
- package/dist/esm/actions/test/setMinGasPrice.js.map +1 -1
- package/dist/esm/actions/test/setNextBlockBaseFeePerGas.js +22 -0
- package/dist/esm/actions/test/setNextBlockBaseFeePerGas.js.map +1 -1
- package/dist/esm/actions/test/setNextBlockTimestamp.js +20 -0
- package/dist/esm/actions/test/setNextBlockTimestamp.js.map +1 -1
- package/dist/esm/actions/test/setNonce.js +23 -0
- package/dist/esm/actions/test/setNonce.js.map +1 -1
- package/dist/esm/actions/test/setRpcUrl.js +20 -0
- package/dist/esm/actions/test/setRpcUrl.js.map +1 -1
- package/dist/esm/actions/test/setStorageAt.js +24 -0
- package/dist/esm/actions/test/setStorageAt.js.map +1 -1
- package/dist/esm/actions/test/snapshot.js +19 -0
- package/dist/esm/actions/test/snapshot.js.map +1 -1
- package/dist/esm/actions/test/stopImpersonatingAccount.js +22 -0
- package/dist/esm/actions/test/stopImpersonatingAccount.js.map +1 -1
- package/dist/esm/actions/wallet/addChain.js +19 -0
- package/dist/esm/actions/wallet/addChain.js.map +1 -1
- package/dist/esm/actions/wallet/deployContract.js +27 -0
- package/dist/esm/actions/wallet/deployContract.js.map +1 -1
- package/dist/esm/actions/wallet/getAddresses.js +20 -0
- package/dist/esm/actions/wallet/getAddresses.js.map +1 -1
- package/dist/esm/actions/wallet/getPermissions.js +20 -0
- package/dist/esm/actions/wallet/getPermissions.js.map +1 -1
- package/dist/esm/actions/wallet/requestAddresses.js +24 -0
- package/dist/esm/actions/wallet/requestAddresses.js.map +1 -1
- package/dist/esm/actions/wallet/requestPermissions.js +23 -0
- package/dist/esm/actions/wallet/requestPermissions.js.map +1 -1
- package/dist/esm/actions/wallet/sendTransaction.js +48 -1
- package/dist/esm/actions/wallet/sendTransaction.js.map +1 -1
- package/dist/esm/actions/wallet/signMessage.js +55 -2
- package/dist/esm/actions/wallet/signMessage.js.map +1 -1
- package/dist/esm/actions/wallet/signTypedData.js +100 -0
- package/dist/esm/actions/wallet/signTypedData.js.map +1 -1
- package/dist/esm/actions/wallet/switchChain.js +20 -0
- package/dist/esm/actions/wallet/switchChain.js.map +1 -1
- package/dist/esm/actions/wallet/watchAsset.js +28 -0
- package/dist/esm/actions/wallet/watchAsset.js.map +1 -1
- package/dist/esm/actions/wallet/writeContract.js +50 -0
- package/dist/esm/actions/wallet/writeContract.js.map +1 -1
- package/dist/esm/chains.js +99 -87
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/clients/createClient.js +4 -1
- package/dist/esm/clients/createClient.js.map +1 -1
- package/dist/esm/clients/createPublicClient.js +19 -0
- package/dist/esm/clients/createPublicClient.js.map +1 -1
- package/dist/esm/clients/createTestClient.js +23 -0
- package/dist/esm/clients/createTestClient.js.map +1 -1
- package/dist/esm/clients/createWalletClient.js +36 -0
- package/dist/esm/clients/createWalletClient.js.map +1 -1
- package/dist/esm/clients/decorators/public.js.map +1 -1
- package/dist/esm/clients/decorators/test.js.map +1 -1
- package/dist/esm/clients/transports/createTransport.js +3 -0
- package/dist/esm/clients/transports/createTransport.js.map +1 -1
- package/dist/esm/clients/transports/custom.js +3 -0
- package/dist/esm/clients/transports/custom.js.map +1 -1
- package/dist/esm/clients/transports/fallback.js +11 -0
- package/dist/esm/clients/transports/fallback.js.map +1 -1
- package/dist/esm/clients/transports/http.js +31 -8
- package/dist/esm/clients/transports/http.js.map +1 -1
- package/dist/esm/clients/transports/webSocket.js +28 -15
- package/dist/esm/clients/transports/webSocket.js.map +1 -1
- package/dist/esm/constants/abis.js +6 -0
- package/dist/esm/constants/abis.js.map +1 -1
- package/dist/esm/constants/solidity.js +1 -0
- package/dist/esm/constants/solidity.js.map +1 -1
- package/dist/esm/contract.js +0 -1
- package/dist/esm/contract.js.map +1 -1
- package/dist/esm/errors/abi.js +15 -1
- package/dist/esm/errors/abi.js.map +1 -1
- package/dist/esm/errors/base.js +4 -11
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/node.js +9 -0
- package/dist/esm/errors/node.js.map +1 -1
- package/dist/esm/errors/request.js.map +1 -1
- package/dist/esm/errors/rpc.js +103 -0
- package/dist/esm/errors/rpc.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/errors/version.js.map +1 -1
- package/dist/esm/index.js +2 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/types/account.js +1 -1
- package/dist/esm/types/account.js.map +1 -1
- package/dist/esm/types/eip1193.js +2 -0
- package/dist/esm/types/eip1193.js.map +1 -1
- package/dist/esm/utils/abi/decodeAbiParameters.js +29 -0
- package/dist/esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/dist/esm/utils/abi/decodeEventLog.js +35 -19
- package/dist/esm/utils/abi/decodeEventLog.js.map +1 -1
- package/dist/esm/utils/abi/encodeAbiParameters.js +10 -1
- package/dist/esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/dist/esm/utils/abi/encodeEventTopics.js +11 -7
- package/dist/esm/utils/abi/encodeEventTopics.js.map +1 -1
- package/dist/esm/utils/abi/getAbiItem.js +9 -0
- package/dist/esm/utils/abi/getAbiItem.js.map +1 -1
- package/dist/esm/utils/accounts.js +3 -0
- package/dist/esm/utils/accounts.js.map +1 -1
- package/dist/esm/utils/buildRequest.js +2 -0
- package/dist/esm/utils/buildRequest.js.map +1 -1
- package/dist/esm/utils/data/size.js +6 -0
- package/dist/esm/utils/data/size.js.map +1 -1
- package/dist/esm/utils/data/slice.js +21 -0
- package/dist/esm/utils/data/slice.js.map +1 -1
- package/dist/esm/utils/encoding/fromBytes.js +79 -0
- package/dist/esm/utils/encoding/fromBytes.js.map +1 -1
- package/dist/esm/utils/encoding/fromHex.js +106 -0
- package/dist/esm/utils/encoding/fromHex.js.map +1 -1
- package/dist/esm/utils/encoding/toBytes.js +102 -1
- package/dist/esm/utils/encoding/toBytes.js.map +1 -1
- package/dist/esm/utils/encoding/toHex.js +108 -2
- package/dist/esm/utils/encoding/toHex.js.map +1 -1
- package/dist/esm/utils/ens/avatar/parseAvatarRecord.js +6 -2
- package/dist/esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/dist/esm/utils/ens/avatar/utils.js +10 -0
- package/dist/esm/utils/ens/avatar/utils.js.map +1 -1
- package/dist/esm/utils/ens/encodeLabelhash.js +4 -0
- package/dist/esm/utils/ens/encodeLabelhash.js.map +1 -0
- package/dist/esm/utils/ens/encodedLabelToLabelhash.js +14 -0
- package/dist/esm/utils/ens/encodedLabelToLabelhash.js.map +1 -0
- package/dist/esm/utils/ens/labelhash.js +11 -1
- package/dist/esm/utils/ens/labelhash.js.map +1 -1
- package/dist/esm/utils/ens/namehash.js +18 -2
- package/dist/esm/utils/ens/namehash.js.map +1 -1
- package/dist/esm/utils/ens/normalize.js +10 -0
- package/dist/esm/utils/ens/normalize.js.map +1 -1
- package/dist/esm/utils/ens/packetToBytes.js +16 -9
- package/dist/esm/utils/ens/packetToBytes.js.map +1 -1
- package/dist/esm/utils/filters/createFilterRequestScope.js +5 -0
- package/dist/esm/utils/filters/createFilterRequestScope.js.map +1 -1
- package/dist/esm/utils/formatters/block.js +4 -1
- package/dist/esm/utils/formatters/block.js.map +1 -1
- package/dist/esm/utils/formatters/extract.js +3 -0
- package/dist/esm/utils/formatters/extract.js.map +1 -1
- package/dist/esm/utils/formatters/format.js +3 -0
- package/dist/esm/utils/formatters/format.js.map +1 -1
- package/dist/esm/utils/formatters/log.js +2 -2
- package/dist/esm/utils/formatters/transaction.js +3 -1
- package/dist/esm/utils/formatters/transaction.js.map +1 -1
- package/dist/esm/utils/formatters/transactionReceipt.js +2 -2
- package/dist/esm/utils/formatters/transactionReceipt.js.map +1 -1
- package/dist/esm/utils/formatters/transactionRequest.js +1 -1
- package/dist/esm/utils/formatters/transactionRequest.js.map +1 -1
- package/dist/esm/utils/hash/getEventSelector.js +6 -2
- package/dist/esm/utils/hash/getEventSelector.js.map +1 -1
- package/dist/esm/utils/hash/getFunctionSelector.js +6 -2
- package/dist/esm/utils/hash/getFunctionSelector.js.map +1 -1
- package/dist/esm/utils/hash/hashFunction.js +4 -3
- package/dist/esm/utils/hash/hashFunction.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/observe.js +7 -2
- package/dist/esm/utils/observe.js.map +1 -1
- package/dist/esm/utils/poll.js +3 -0
- package/dist/esm/utils/poll.js.map +1 -1
- package/dist/esm/utils/promise/createBatchScheduler.js +1 -1
- package/dist/esm/utils/promise/createBatchScheduler.js.map +1 -1
- package/dist/esm/utils/promise/withCache.js +23 -6
- package/dist/esm/utils/promise/withCache.js.map +1 -1
- package/dist/esm/utils/regex.js +4 -0
- package/dist/esm/utils/regex.js.map +1 -1
- package/dist/esm/utils/rpc.js +27 -19
- package/dist/esm/utils/rpc.js.map +1 -1
- package/dist/esm/utils/signature/hashMessage.js +8 -2
- package/dist/esm/utils/signature/hashMessage.js.map +1 -1
- package/dist/esm/utils/signature/hashTypedData.js +3 -0
- package/dist/esm/utils/signature/hashTypedData.js.map +1 -1
- package/dist/esm/utils/signature/recoverPublicKey.js +2 -0
- package/dist/esm/utils/signature/recoverPublicKey.js.map +1 -1
- package/dist/esm/utils/signature/verifyMessage.js +12 -0
- package/dist/esm/utils/signature/verifyMessage.js.map +1 -1
- package/dist/esm/utils/signature/verifyTypedData.js +12 -0
- package/dist/esm/utils/signature/verifyTypedData.js.map +1 -1
- package/dist/esm/utils/transaction/getTransactionType.js.map +1 -1
- package/dist/esm/utils/transaction/prepareRequest.js +5 -1
- package/dist/esm/utils/transaction/prepareRequest.js.map +1 -1
- package/dist/esm/utils/transaction/serializeTransaction.js +4 -2
- package/dist/esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/dist/esm/utils/typedData.js +4 -0
- package/dist/esm/utils/typedData.js.map +1 -1
- package/dist/esm/utils/unit/parseUnits.js +15 -3
- package/dist/esm/utils/unit/parseUnits.js.map +1 -1
- package/dist/types/accounts/types.d.ts +3 -5
- package/dist/types/accounts/types.d.ts.map +1 -1
- package/dist/types/accounts/utils/signMessage.d.ts +2 -2
- package/dist/types/accounts/utils/signMessage.d.ts.map +1 -1
- package/dist/types/accounts/utils/signTypedData.d.ts +3 -6
- package/dist/types/accounts/utils/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/getContract.d.ts +65 -21
- package/dist/types/actions/getContract.d.ts.map +1 -1
- package/dist/types/actions/public/createContractEventFilter.d.ts +8 -3
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/createEventFilter.d.ts +17 -5
- package/dist/types/actions/public/createEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +4 -2
- package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -1
- package/dist/types/actions/public/getBlockNumber.d.ts +2 -2
- package/dist/types/actions/public/getBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/public/getChainId.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +4 -4
- package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterLogs.d.ts +4 -4
- package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/dist/types/actions/public/getLogs.d.ts +10 -4
- package/dist/types/actions/public/getLogs.d.ts.map +1 -1
- package/dist/types/actions/public/verifyMessage.d.ts +2 -2
- package/dist/types/actions/public/verifyMessage.d.ts.map +1 -1
- package/dist/types/actions/public/verifyTypedData.d.ts +3 -4
- package/dist/types/actions/public/verifyTypedData.d.ts.map +1 -1
- package/dist/types/actions/public/watchContractEvent.d.ts +10 -5
- package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/public/watchEvent.d.ts +11 -5
- package/dist/types/actions/public/watchEvent.d.ts.map +1 -1
- package/dist/types/actions/test/getAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/mine.d.ts.map +1 -1
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +8 -2
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
- package/dist/types/actions/test/setAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/setBalance.d.ts.map +1 -1
- package/dist/types/actions/wallet/signMessage.d.ts +2 -2
- package/dist/types/actions/wallet/signMessage.d.ts.map +1 -1
- package/dist/types/actions/wallet/signTypedData.d.ts +4 -7
- package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -1
- package/dist/types/chains.d.ts +364 -16
- package/dist/types/chains.d.ts.map +1 -1
- package/dist/types/clients/createClient.d.ts +5 -5
- package/dist/types/clients/createClient.d.ts.map +1 -1
- package/dist/types/clients/createPublicClient.d.ts +3 -3
- package/dist/types/clients/createPublicClient.d.ts.map +1 -1
- package/dist/types/clients/createTestClient.d.ts +2 -2
- package/dist/types/clients/createTestClient.d.ts.map +1 -1
- package/dist/types/clients/createWalletClient.d.ts +2 -2
- package/dist/types/clients/createWalletClient.d.ts.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +8 -8
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/clients/decorators/test.d.ts +1 -1
- package/dist/types/clients/decorators/test.d.ts.map +1 -1
- package/dist/types/clients/decorators/wallet.d.ts +1 -3
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/types/clients/transports/createTransport.d.ts +5 -8
- package/dist/types/clients/transports/createTransport.d.ts.map +1 -1
- package/dist/types/clients/transports/custom.d.ts +2 -2
- package/dist/types/clients/transports/custom.d.ts.map +1 -1
- package/dist/types/clients/transports/http.d.ts +11 -0
- package/dist/types/clients/transports/http.d.ts.map +1 -1
- package/dist/types/clients/transports/webSocket.d.ts.map +1 -1
- package/dist/types/contract.d.ts +1 -1
- package/dist/types/contract.d.ts.map +1 -1
- package/dist/types/errors/abi.d.ts +6 -4
- package/dist/types/errors/abi.d.ts.map +1 -1
- package/dist/types/errors/base.d.ts +0 -1
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/errors/request.d.ts +16 -8
- package/dist/types/errors/request.d.ts.map +1 -1
- package/dist/types/errors/rpc.d.ts +2 -2
- package/dist/types/errors/rpc.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/errors/version.d.ts.map +1 -1
- package/dist/types/index.d.ts +55 -53
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/account.d.ts +1 -1
- package/dist/types/types/account.d.ts.map +1 -1
- package/dist/types/types/contract.d.ts +11 -6
- package/dist/types/types/contract.d.ts.map +1 -1
- package/dist/types/types/eip1193.d.ts +1042 -827
- package/dist/types/types/eip1193.d.ts.map +1 -1
- package/dist/types/types/filter.d.ts +12 -3
- package/dist/types/types/filter.d.ts.map +1 -1
- package/dist/types/types/log.d.ts +5 -3
- package/dist/types/types/log.d.ts.map +1 -1
- package/dist/types/types/misc.d.ts +4 -0
- package/dist/types/types/misc.d.ts.map +1 -1
- package/dist/types/types/rpc.d.ts +1 -1
- package/dist/types/types/rpc.d.ts.map +1 -1
- package/dist/types/types/transaction.d.ts +14 -5
- package/dist/types/types/transaction.d.ts.map +1 -1
- package/dist/types/types/typedData.d.ts +17 -29
- package/dist/types/types/typedData.d.ts.map +1 -1
- package/dist/types/types/utils.d.ts +11 -0
- package/dist/types/types/utils.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeEventLog.d.ts +6 -5
- package/dist/types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeEventTopics.d.ts.map +1 -1
- package/dist/types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/dist/types/utils/ens/encodeLabelhash.d.ts +3 -0
- package/dist/types/utils/ens/encodeLabelhash.d.ts.map +1 -0
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts +3 -0
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts.map +1 -0
- package/dist/types/utils/ens/labelhash.d.ts.map +1 -1
- package/dist/types/utils/ens/namehash.d.ts.map +1 -1
- package/dist/types/utils/ens/packetToBytes.d.ts.map +1 -1
- package/dist/types/utils/filters/createFilterRequestScope.d.ts +6 -2
- package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +1 -1
- package/dist/types/utils/formatters/block.d.ts.map +1 -1
- package/dist/types/utils/formatters/transaction.d.ts +1 -1
- package/dist/types/utils/formatters/transaction.d.ts.map +1 -1
- package/dist/types/utils/formatters/transactionReceipt.d.ts.map +1 -1
- package/dist/types/utils/hash/getEventSelector.d.ts +2 -1
- package/dist/types/utils/hash/getEventSelector.d.ts.map +1 -1
- package/dist/types/utils/hash/getFunctionSelector.d.ts +2 -1
- package/dist/types/utils/hash/getFunctionSelector.d.ts.map +1 -1
- package/dist/types/utils/hash/hashFunction.d.ts +2 -0
- package/dist/types/utils/hash/hashFunction.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/observe.d.ts.map +1 -1
- package/dist/types/utils/promise/withCache.d.ts.map +1 -1
- package/dist/types/utils/rpc.d.ts +18 -10
- package/dist/types/utils/rpc.d.ts.map +1 -1
- package/dist/types/utils/signature/hashMessage.d.ts +2 -2
- package/dist/types/utils/signature/hashMessage.d.ts.map +1 -1
- package/dist/types/utils/signature/hashTypedData.d.ts +3 -6
- package/dist/types/utils/signature/hashTypedData.d.ts.map +1 -1
- package/dist/types/utils/signature/recoverMessageAddress.d.ts +2 -2
- package/dist/types/utils/signature/recoverMessageAddress.d.ts.map +1 -1
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +3 -6
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +1 -1
- package/dist/types/utils/signature/verifyTypedData.d.ts +3 -6
- package/dist/types/utils/signature/verifyTypedData.d.ts.map +1 -1
- package/dist/types/utils/transaction/getTransactionType.d.ts +2 -2
- package/dist/types/utils/transaction/getTransactionType.d.ts.map +1 -1
- package/dist/types/utils/typedData.d.ts +2 -3
- package/dist/types/utils/typedData.d.ts.map +1 -1
- package/dist/types/utils/unit/parseUnits.d.ts.map +1 -1
- package/package.json +7 -13
- package/src/accounts/types.ts +4 -4
- package/src/accounts/utils/signMessage.ts +2 -2
- package/src/accounts/utils/signTypedData.ts +4 -4
- package/src/actions/ens/getEnsAddress.ts +37 -22
- package/src/actions/getContract.ts +133 -69
- package/src/actions/public/call.ts +1 -1
- package/src/actions/public/createContractEventFilter.ts +21 -4
- package/src/actions/public/createEventFilter.ts +34 -13
- package/src/actions/public/estimateContractGas.ts +10 -4
- package/src/actions/public/estimateGas.ts +1 -1
- package/src/actions/public/getBlock.ts +2 -2
- package/src/actions/public/getBlockTransactionCount.ts +1 -1
- package/src/actions/public/getChainId.ts +3 -1
- package/src/actions/public/getFilterChanges.ts +32 -7
- package/src/actions/public/getFilterLogs.ts +34 -8
- package/src/actions/public/getGasPrice.ts +1 -1
- package/src/actions/public/getLogs.ts +39 -10
- package/src/actions/public/getTransactionCount.ts +1 -1
- package/src/actions/public/verifyMessage.ts +2 -2
- package/src/actions/public/verifyTypedData.ts +18 -6
- package/src/actions/public/watchContractEvent.ts +16 -4
- package/src/actions/public/watchEvent.ts +17 -4
- package/src/actions/test/getAutomine.ts +4 -0
- package/src/actions/test/mine.ts +10 -4
- package/src/actions/test/sendUnsignedTransaction.ts +54 -5
- package/src/actions/test/setAutomine.ts +8 -4
- package/src/actions/test/setBalance.ts +10 -4
- package/src/actions/wallet/sendTransaction.ts +1 -1
- package/src/actions/wallet/signMessage.ts +11 -4
- package/src/actions/wallet/signTypedData.ts +5 -5
- package/src/chains.ts +123 -88
- package/src/clients/createClient.ts +13 -11
- package/src/clients/createPublicClient.ts +3 -4
- package/src/clients/createTestClient.ts +2 -3
- package/src/clients/createWalletClient.ts +2 -3
- package/src/clients/decorators/public.ts +43 -17
- package/src/clients/decorators/test.ts +4 -3
- package/src/clients/decorators/wallet.ts +2 -2
- package/src/clients/transports/createTransport.ts +5 -9
- package/src/clients/transports/custom.ts +1 -2
- package/src/clients/transports/fallback.ts +1 -1
- package/src/clients/transports/http.ts +44 -7
- package/src/clients/transports/webSocket.ts +23 -15
- package/src/contract.ts +3 -3
- package/src/errors/abi.ts +16 -4
- package/src/errors/base.ts +6 -6
- package/src/errors/request.ts +4 -4
- package/src/errors/rpc.ts +3 -2
- package/src/errors/version.ts +1 -1
- package/src/index.ts +263 -249
- package/src/types/account.ts +9 -9
- package/src/types/contract.ts +33 -15
- package/src/types/eip1193.ts +1084 -827
- package/src/types/filter.ts +15 -3
- package/src/types/log.ts +13 -3
- package/src/types/misc.ts +6 -0
- package/src/types/rpc.ts +1 -1
- package/src/types/transaction.ts +24 -6
- package/src/types/typedData.ts +36 -45
- package/src/types/utils.ts +15 -0
- package/src/utils/abi/decodeEventLog.ts +47 -22
- package/src/utils/abi/encodeEventTopics.ts +16 -11
- package/src/utils/abi/getAbiItem.ts +1 -0
- package/src/utils/encoding/toBytes.ts +1 -1
- package/src/utils/encoding/toHex.ts +2 -2
- package/src/utils/ens/encodeLabelhash.ts +5 -0
- package/src/utils/ens/encodedLabelToLabelhash.ts +11 -0
- package/src/utils/ens/labelhash.ts +2 -1
- package/src/utils/ens/namehash.ts +6 -2
- package/src/utils/ens/packetToBytes.ts +12 -8
- package/src/utils/filters/createFilterRequestScope.ts +12 -4
- package/src/utils/formatters/block.ts +3 -1
- package/src/utils/formatters/log.ts +2 -2
- package/src/utils/formatters/transaction.ts +3 -1
- package/src/utils/formatters/transactionReceipt.ts +4 -2
- package/src/utils/formatters/transactionRequest.ts +1 -1
- package/src/utils/hash/getEventSelector.ts +6 -2
- package/src/utils/hash/getFunctionSelector.ts +6 -2
- package/src/utils/hash/hashFunction.ts +6 -2
- package/src/utils/index.ts +6 -0
- package/src/utils/observe.ts +2 -2
- package/src/utils/promise/createBatchScheduler.ts +1 -1
- package/src/utils/promise/withCache.ts +13 -11
- package/src/utils/rpc.ts +53 -53
- package/src/utils/signature/hashMessage.ts +8 -4
- package/src/utils/signature/hashTypedData.ts +4 -4
- package/src/utils/signature/recoverMessageAddress.ts +2 -2
- package/src/utils/signature/recoverTypedDataAddress.ts +4 -4
- package/src/utils/signature/verifyTypedData.ts +4 -4
- package/src/utils/transaction/getTransactionType.ts +10 -9
- package/src/utils/transaction/serializeTransaction.ts +3 -3
- package/src/utils/typedData.ts +3 -3
- package/src/utils/unit/parseUnits.ts +15 -5
- package/dist/cjs/adapters/ethers.js +0 -49
- package/dist/cjs/adapters/ethers.js.map +0 -1
- package/dist/cjs/ethers.js +0 -6
- package/dist/cjs/ethers.js.map +0 -1
- package/dist/esm/adapters/ethers.js +0 -45
- package/dist/esm/adapters/ethers.js.map +0 -1
- package/dist/esm/ethers.js +0 -2
- package/dist/esm/ethers.js.map +0 -1
- package/dist/types/adapters/ethers.d.ts +0 -27
- package/dist/types/adapters/ethers.d.ts.map +0 -1
- package/dist/types/ethers.d.ts +0 -2
- package/dist/types/ethers.d.ts.map +0 -1
- package/ethers/package.json +0 -5
- package/src/adapters/ethers.ts +0 -94
- package/src/ethers.ts +0 -1
@@ -147,8 +147,8 @@ export async function sendTransaction<
|
|
147
147
|
|
148
148
|
if (!chainId) chainId = await getChainId(client)
|
149
149
|
const signedRequest = (await account.signTransaction({
|
150
|
-
chainId,
|
151
150
|
...request,
|
151
|
+
chainId,
|
152
152
|
} as TransactionSerializable)) as Hash
|
153
153
|
return await client.request({
|
154
154
|
method: 'eth_sendRawTransaction',
|
@@ -5,13 +5,13 @@ import type { Transport } from '../../clients/transports/createTransport.js'
|
|
5
5
|
import { AccountNotFoundError } from '../../errors/account.js'
|
6
6
|
import type { GetAccountParameter } from '../../types/account.js'
|
7
7
|
import type { Chain } from '../../types/chain.js'
|
8
|
-
import type { Hex } from '../../types/misc.js'
|
9
|
-
import { toHex } from '../../utils/encoding/toHex.js'
|
8
|
+
import type { Hex, SignableMessage } from '../../types/misc.js'
|
9
|
+
import { stringToHex, toHex } from '../../utils/encoding/toHex.js'
|
10
10
|
|
11
11
|
export type SignMessageParameters<
|
12
12
|
TAccount extends Account | undefined = Account | undefined,
|
13
13
|
> = GetAccountParameter<TAccount> & {
|
14
|
-
message:
|
14
|
+
message: SignableMessage
|
15
15
|
}
|
16
16
|
|
17
17
|
export type SignMessageReturnType = Hex
|
@@ -78,8 +78,15 @@ export async function signMessage<
|
|
78
78
|
})
|
79
79
|
const account = parseAccount(account_)
|
80
80
|
if (account.type === 'local') return account.signMessage({ message })
|
81
|
+
|
82
|
+
const message_ = (() => {
|
83
|
+
if (typeof message === 'string') return stringToHex(message)
|
84
|
+
if (message.raw instanceof Uint8Array) return toHex(message.raw)
|
85
|
+
return message.raw
|
86
|
+
})()
|
87
|
+
|
81
88
|
return client.request({
|
82
89
|
method: 'personal_sign',
|
83
|
-
params: [
|
90
|
+
params: [message_, account.address],
|
84
91
|
})
|
85
92
|
}
|
@@ -14,8 +14,8 @@ import { stringify } from '../../utils/stringify.js'
|
|
14
14
|
import { validateTypedData } from '../../utils/typedData.js'
|
15
15
|
|
16
16
|
export type SignTypedDataParameters<
|
17
|
-
TTypedData extends TypedData |
|
18
|
-
TPrimaryType extends
|
17
|
+
TTypedData extends TypedData | Record<string, unknown> = TypedData,
|
18
|
+
TPrimaryType extends keyof TTypedData = keyof TTypedData,
|
19
19
|
TAccount extends Account | undefined = undefined,
|
20
20
|
> = GetAccountParameter<TAccount> &
|
21
21
|
TypedDataDefinition<TTypedData, TPrimaryType>
|
@@ -23,7 +23,7 @@ export type SignTypedDataParameters<
|
|
23
23
|
export type SignTypedDataReturnType = Hex
|
24
24
|
|
25
25
|
/**
|
26
|
-
* Signs typed data and calculates an Ethereum-specific signature in [
|
26
|
+
* Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712): `sign(keccak256("\x19\x01" ‖ domainSeparator ‖ hashStruct(message)))`
|
27
27
|
*
|
28
28
|
* - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html
|
29
29
|
* - JSON-RPC Methods:
|
@@ -121,8 +121,8 @@ export type SignTypedDataReturnType = Hex
|
|
121
121
|
* })
|
122
122
|
*/
|
123
123
|
export async function signTypedData<
|
124
|
-
TTypedData extends TypedData |
|
125
|
-
TPrimaryType extends
|
124
|
+
const TTypedData extends TypedData | Record<string, unknown>, // `Record<string, unknown>` allows for non-const asserted types
|
125
|
+
TPrimaryType extends keyof TTypedData,
|
126
126
|
TChain extends Chain | undefined,
|
127
127
|
TAccount extends Account | undefined,
|
128
128
|
>(
|
package/src/chains.ts
CHANGED
@@ -11,7 +11,7 @@ import { defineTransactionReceipt } from './utils/formatters/transactionReceipt.
|
|
11
11
|
import { defineTransactionRequest } from './utils/formatters/transactionRequest.js'
|
12
12
|
|
13
13
|
const celoFormatters = {
|
14
|
-
block: defineBlock({
|
14
|
+
block: /*#__PURE__*/ defineBlock({
|
15
15
|
exclude: ['difficulty', 'gasLimit', 'mixHash', 'nonce', 'uncles'],
|
16
16
|
format: (block) => ({
|
17
17
|
randomness: block.randomness as {
|
@@ -20,7 +20,7 @@ const celoFormatters = {
|
|
20
20
|
},
|
21
21
|
}),
|
22
22
|
}),
|
23
|
-
transaction: defineTransaction({
|
23
|
+
transaction: /*#__PURE__*/ defineTransaction({
|
24
24
|
format: (transaction) => ({
|
25
25
|
feeCurrency: transaction.feeCurrency as Address | null,
|
26
26
|
gatewayFee: transaction.gatewayFee
|
@@ -29,7 +29,7 @@ const celoFormatters = {
|
|
29
29
|
gatewayFeeRecipient: transaction.gatewayFeeRecipient as Address | null,
|
30
30
|
}),
|
31
31
|
}),
|
32
|
-
transactionReceipt: defineTransactionReceipt({
|
32
|
+
transactionReceipt: /*#__PURE__*/ defineTransactionReceipt({
|
33
33
|
format: (transaction) => ({
|
34
34
|
feeCurrency: transaction.feeCurrency as Address | null,
|
35
35
|
gatewayFee: transaction.gatewayFee
|
@@ -38,7 +38,7 @@ const celoFormatters = {
|
|
38
38
|
gatewayFeeRecipient: transaction.gatewayFeeRecipient as Address | null,
|
39
39
|
}),
|
40
40
|
}),
|
41
|
-
transactionRequest: defineTransactionRequest({
|
41
|
+
transactionRequest: /*#__PURE__*/ defineTransactionRequest({
|
42
42
|
format: (transactionRequest) => ({
|
43
43
|
feeCurrency: transactionRequest.feeCurrency as Address | undefined,
|
44
44
|
gatewayFee: transactionRequest.gatewayFee as Quantity | undefined,
|
@@ -48,95 +48,130 @@ const celoFormatters = {
|
|
48
48
|
}),
|
49
49
|
}),
|
50
50
|
}
|
51
|
-
|
52
|
-
export const
|
53
|
-
export const
|
54
|
-
export const
|
55
|
-
export const
|
56
|
-
export const
|
57
|
-
export const
|
58
|
-
export const
|
59
|
-
export const
|
60
|
-
export const
|
61
|
-
export const
|
62
|
-
export const
|
63
|
-
export const
|
64
|
-
export const
|
65
|
-
export const celo = defineChain({
|
51
|
+
export const arbitrum = /*#__PURE__*/ defineChain(chains.arbitrum)
|
52
|
+
export const arbitrumGoerli = /*#__PURE__*/ defineChain(chains.arbitrumGoerli)
|
53
|
+
export const aurora = /*#__PURE__*/ defineChain(chains.aurora)
|
54
|
+
export const auroraTestnet = /*#__PURE__*/ defineChain(chains.auroraTestnet)
|
55
|
+
export const avalanche = /*#__PURE__*/ defineChain(chains.avalanche)
|
56
|
+
export const avalancheFuji = /*#__PURE__*/ defineChain(chains.avalancheFuji)
|
57
|
+
export const baseGoerli = /*#__PURE__*/ defineChain(chains.baseGoerli)
|
58
|
+
export const boba = /*#__PURE__*/ defineChain(chains.boba)
|
59
|
+
export const bronos = /*#__PURE__*/ defineChain(chains.bronos)
|
60
|
+
export const bronosTestnet = /*#__PURE__*/ defineChain(chains.bronosTestnet)
|
61
|
+
export const bsc = /*#__PURE__*/ defineChain(chains.bsc)
|
62
|
+
export const bscTestnet = /*#__PURE__*/ defineChain(chains.bscTestnet)
|
63
|
+
export const canto = /*#__PURE__*/ defineChain(chains.canto)
|
64
|
+
export const celo = /*#__PURE__*/ defineChain({
|
66
65
|
...chains.celo,
|
67
66
|
formatters: celoFormatters,
|
68
67
|
})
|
69
|
-
export const celoAlfajores = defineChain({
|
68
|
+
export const celoAlfajores = /*#__PURE__*/ defineChain({
|
70
69
|
...chains.celoAlfajores,
|
71
70
|
formatters: celoFormatters,
|
72
71
|
})
|
73
|
-
export const
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
export const
|
78
|
-
export const
|
79
|
-
export const
|
80
|
-
export const
|
81
|
-
export const
|
82
|
-
export const
|
83
|
-
export const
|
84
|
-
export const
|
85
|
-
export const
|
86
|
-
export const
|
87
|
-
|
88
|
-
|
89
|
-
export const
|
90
|
-
|
91
|
-
|
92
|
-
export const
|
93
|
-
export const
|
94
|
-
export const
|
95
|
-
export const
|
96
|
-
export const
|
97
|
-
export const
|
98
|
-
export const
|
99
|
-
export const
|
100
|
-
export const
|
101
|
-
export const
|
102
|
-
export const
|
103
|
-
export const
|
104
|
-
export const
|
105
|
-
export const
|
106
|
-
export const
|
107
|
-
export const
|
108
|
-
export const
|
109
|
-
export const
|
110
|
-
export const
|
111
|
-
export const
|
112
|
-
export const
|
113
|
-
export const
|
114
|
-
export const
|
115
|
-
export const
|
116
|
-
export const
|
117
|
-
export const
|
118
|
-
export const
|
119
|
-
export const
|
120
|
-
export const
|
121
|
-
|
122
|
-
|
123
|
-
export const
|
124
|
-
export const
|
125
|
-
export const
|
126
|
-
export const
|
127
|
-
export const
|
128
|
-
|
129
|
-
|
130
|
-
export const
|
131
|
-
export const
|
132
|
-
|
133
|
-
|
134
|
-
export const
|
135
|
-
|
136
|
-
|
137
|
-
export const
|
138
|
-
|
139
|
-
|
140
|
-
export const
|
72
|
+
export const celoCannoli = /*#__PURE__*/ defineChain({
|
73
|
+
...chains.celoCannoli,
|
74
|
+
formatters: celoFormatters,
|
75
|
+
})
|
76
|
+
export const cronos = /*#__PURE__*/ defineChain(chains.cronos)
|
77
|
+
export const crossbell = /*#__PURE__*/ defineChain(chains.crossbell)
|
78
|
+
export const dfk = /*#__PURE__*/ defineChain(chains.dfk)
|
79
|
+
export const dogechain = /*#__PURE__*/ defineChain(chains.dogechain)
|
80
|
+
export const evmos = /*#__PURE__*/ defineChain(chains.evmos)
|
81
|
+
export const evmosTestnet = /*#__PURE__*/ defineChain(chains.evmosTestnet)
|
82
|
+
export const fantom = /*#__PURE__*/ defineChain(chains.fantom)
|
83
|
+
export const fantomTestnet = /*#__PURE__*/ defineChain(chains.fantomTestnet)
|
84
|
+
export const filecoin = /*#__PURE__*/ defineChain(chains.filecoin)
|
85
|
+
export const filecoinCalibration = /*#__PURE__*/ defineChain(
|
86
|
+
chains.filecoinCalibration,
|
87
|
+
)
|
88
|
+
export const filecoinHyperspace = /*#__PURE__*/ defineChain(
|
89
|
+
chains.filecoinHyperspace,
|
90
|
+
)
|
91
|
+
export const flare = /*#__PURE__*/ defineChain(chains.flare)
|
92
|
+
export const flareTestnet = /*#__PURE__*/ defineChain(chains.flareTestnet)
|
93
|
+
export const foundry = /*#__PURE__*/ defineChain(chains.foundry)
|
94
|
+
export const iotex = /*#__PURE__*/ defineChain(chains.iotex)
|
95
|
+
export const iotexTestnet = /*#__PURE__*/ defineChain(chains.iotexTestnet)
|
96
|
+
export const goerli = /*#__PURE__*/ defineChain(chains.goerli)
|
97
|
+
export const gnosis = /*#__PURE__*/ defineChain(chains.gnosis)
|
98
|
+
export const gnosisChiado = /*#__PURE__*/ defineChain(chains.gnosisChiado)
|
99
|
+
export const haqqMainnet = /*#__PURE__*/ defineChain(chains.haqqMainnet)
|
100
|
+
export const haqqTestedge2 = /*#__PURE__*/ defineChain(chains.haqqTestedge2)
|
101
|
+
export const hardhat = /*#__PURE__*/ defineChain(chains.hardhat)
|
102
|
+
export const harmonyOne = /*#__PURE__*/ defineChain(chains.harmonyOne)
|
103
|
+
export const klaytn = /*#__PURE__*/ defineChain(chains.klaytn)
|
104
|
+
export const lineaTestnet = /*#__PURE__*/ defineChain(chains.lineaTestnet)
|
105
|
+
export const localhost = /*#__PURE__*/ defineChain(chains.localhost)
|
106
|
+
export const mainnet = /*#__PURE__*/ defineChain(chains.mainnet)
|
107
|
+
export const metis = /*#__PURE__*/ defineChain(chains.metis)
|
108
|
+
export const metisGoerli = /*#__PURE__*/ defineChain(chains.metisGoerli)
|
109
|
+
export const moonbaseAlpha = /*#__PURE__*/ defineChain(chains.moonbaseAlpha)
|
110
|
+
export const moonbeam = /*#__PURE__*/ defineChain(chains.moonbeam)
|
111
|
+
export const moonriver = /*#__PURE__*/ defineChain(chains.moonriver)
|
112
|
+
export const nexi = /*#__PURE__*/ defineChain(chains.nexi)
|
113
|
+
export const okc = /*#__PURE__*/ defineChain(chains.okc)
|
114
|
+
export const optimism = /*#__PURE__*/ defineChain(chains.optimism)
|
115
|
+
export const optimismGoerli = /*#__PURE__*/ defineChain(chains.optimismGoerli)
|
116
|
+
export const polygon = /*#__PURE__*/ defineChain(chains.polygon)
|
117
|
+
export const polygonMumbai = /*#__PURE__*/ defineChain(chains.polygonMumbai)
|
118
|
+
export const polygonZkEvm = /*#__PURE__*/ defineChain(chains.polygonZkEvm)
|
119
|
+
export const polygonZkEvmTestnet = /*#__PURE__*/ defineChain(
|
120
|
+
chains.polygonZkEvmTestnet,
|
121
|
+
)
|
122
|
+
export const pulsechain = /*#__PURE__*/ defineChain(chains.pulsechain)
|
123
|
+
export const pulsechainV4 = /*#__PURE__*/ defineChain(chains.pulsechainV4)
|
124
|
+
export const scrollTestnet = /*#__PURE__*/ defineChain(chains.scrollTestnet)
|
125
|
+
export const sepolia = /*#__PURE__*/ defineChain(chains.sepolia)
|
126
|
+
export const skaleBlockBrawlers = /*#__PURE__*/ defineChain(
|
127
|
+
chains.skaleBlockBrawlers,
|
128
|
+
)
|
129
|
+
export const skaleCalypso = /*#__PURE__*/ defineChain(chains.skaleCalypso)
|
130
|
+
export const skaleCalypsoTestnet = /*#__PURE__*/ defineChain(
|
131
|
+
chains.skaleCalypsoTestnet,
|
132
|
+
)
|
133
|
+
export const skaleChaosTestnet = /*#__PURE__*/ defineChain(
|
134
|
+
chains.skaleChaosTestnet,
|
135
|
+
)
|
136
|
+
export const skaleCryptoBlades = /*#__PURE__*/ defineChain(
|
137
|
+
chains.skaleCryptoBlades,
|
138
|
+
)
|
139
|
+
export const skaleCryptoColosseum = /*#__PURE__*/ defineChain(
|
140
|
+
chains.skaleCryptoColosseum,
|
141
|
+
)
|
142
|
+
export const skaleEuropa = /*#__PURE__*/ defineChain(chains.skaleEuropa)
|
143
|
+
export const skaleEuropaTestnet = /*#__PURE__*/ defineChain(
|
144
|
+
chains.skaleEuropaTestnet,
|
145
|
+
)
|
146
|
+
export const skaleExorde = /*#__PURE__*/ defineChain(chains.skaleExorde)
|
147
|
+
export const skaleHumanProtocol = /*#__PURE__*/ defineChain(
|
148
|
+
chains.skaleHumanProtocol,
|
149
|
+
)
|
150
|
+
export const skaleNebula = /*#__PURE__*/ defineChain(chains.skaleNebula)
|
151
|
+
export const skaleNebulaTestnet = /*#__PURE__*/ defineChain(
|
152
|
+
chains.skaleNebulaTestnet,
|
153
|
+
)
|
154
|
+
export const skaleRazor = /*#__PURE__*/ defineChain(chains.skaleRazor)
|
155
|
+
export const skaleTitan = /*#__PURE__*/ defineChain(chains.skaleTitan)
|
156
|
+
export const skaleTitanTestnet = /*#__PURE__*/ defineChain(
|
157
|
+
chains.skaleTitanTestnet,
|
158
|
+
)
|
159
|
+
export const songbird = /*#__PURE__*/ defineChain(chains.songbird)
|
160
|
+
export const songbirdTestnet = /*#__PURE__*/ defineChain(chains.songbirdTestnet)
|
161
|
+
export const shardeumSphinx = /*#__PURE__*/ defineChain(chains.shardeumSphinx)
|
162
|
+
export const syscoin = /*#__PURE__*/ defineChain(chains.syscoin)
|
163
|
+
export const taraxa = /*#__PURE__*/ defineChain(chains.taraxa)
|
164
|
+
export const taraxaTestnet = /*#__PURE__*/ defineChain(chains.taraxaTestnet)
|
165
|
+
export const telos = /*#__PURE__*/ defineChain(chains.telos)
|
166
|
+
export const telosTestnet = /*#__PURE__*/ defineChain(chains.telosTestnet)
|
167
|
+
export const thunderTestnet = /*#__PURE__*/ defineChain(chains.thunderTestnet)
|
168
|
+
export const wanchain = /*#__PURE__*/ defineChain(chains.wanchain)
|
169
|
+
export const wanchainTestnet = /*#__PURE__*/ defineChain(chains.wanchainTestnet)
|
170
|
+
export const xdc = /*#__PURE__*/ defineChain(chains.xdc)
|
171
|
+
export const xdcTestnet = /*#__PURE__*/ defineChain(chains.xdcTestnet)
|
172
|
+
export const zhejiang = /*#__PURE__*/ defineChain(chains.zhejiang)
|
173
|
+
export const zkSync = /*#__PURE__*/ defineChain(chains.zkSync)
|
174
|
+
export const zkSyncTestnet = /*#__PURE__*/ defineChain(chains.zkSyncTestnet)
|
175
|
+
export const zoraTestnet = /*#__PURE__*/ defineChain(chains.zoraTestnet)
|
141
176
|
|
142
177
|
export type { Chain } from './types/chain.js'
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import type { Chain } from '../types/chain.js'
|
2
|
-
import type { Requests } from '../types/eip1193.js'
|
3
|
-
import { uid } from '../utils/uid.js'
|
4
|
-
|
5
2
|
import type {
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
EIP1193RequestFn,
|
4
|
+
EIP1474Methods,
|
5
|
+
RpcSchema,
|
6
|
+
} from '../types/eip1193.js'
|
7
|
+
import { uid } from '../utils/uid.js'
|
8
|
+
import type { Transport } from './transports/createTransport.js'
|
9
9
|
|
10
10
|
export type ClientConfig<
|
11
11
|
TTransport extends Transport = Transport,
|
@@ -30,7 +30,7 @@ export type ClientConfig<
|
|
30
30
|
|
31
31
|
export type Client<
|
32
32
|
TTransport extends Transport = Transport,
|
33
|
-
|
33
|
+
TRpcSchema extends RpcSchema | undefined = undefined,
|
34
34
|
TChain extends Chain | undefined = Chain | undefined,
|
35
35
|
> = {
|
36
36
|
/** Chain for the client. */
|
@@ -42,7 +42,9 @@ export type Client<
|
|
42
42
|
/** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */
|
43
43
|
pollingInterval: number
|
44
44
|
/** Request function wrapped with friendly error handling */
|
45
|
-
request:
|
45
|
+
request: TRpcSchema extends undefined
|
46
|
+
? EIP1193RequestFn<EIP1474Methods>
|
47
|
+
: EIP1193RequestFn<TRpcSchema>
|
46
48
|
/** The RPC transport */
|
47
49
|
transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value']
|
48
50
|
/** The type of client. */
|
@@ -56,7 +58,7 @@ export type Client<
|
|
56
58
|
*/
|
57
59
|
export function createClient<
|
58
60
|
TTransport extends Transport,
|
59
|
-
|
61
|
+
TRpcSchema extends RpcSchema | undefined = undefined,
|
60
62
|
TChain extends Chain | undefined = undefined,
|
61
63
|
>({
|
62
64
|
chain,
|
@@ -65,14 +67,14 @@ export function createClient<
|
|
65
67
|
pollingInterval = 4_000,
|
66
68
|
transport,
|
67
69
|
type = 'base',
|
68
|
-
}: ClientConfig<TTransport, TChain>): Client<TTransport,
|
70
|
+
}: ClientConfig<TTransport, TChain>): Client<TTransport, TRpcSchema, TChain> {
|
69
71
|
const { config, request, value } = transport({ chain, pollingInterval })
|
70
72
|
return {
|
71
73
|
chain: chain as TChain,
|
72
74
|
key,
|
73
75
|
name,
|
74
76
|
pollingInterval,
|
75
|
-
request,
|
77
|
+
request: request as any,
|
76
78
|
transport: { ...config, ...value },
|
77
79
|
type,
|
78
80
|
uid: uid(),
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { Chain } from '../types/chain.js'
|
2
|
-
import type {
|
2
|
+
import type { PublicRpcSchema } from '../types/eip1193.js'
|
3
3
|
import type { Prettify } from '../types/utils.js'
|
4
|
-
|
5
4
|
import { type Client, type ClientConfig, createClient } from './createClient.js'
|
6
5
|
import { type PublicActions, publicActions } from './decorators/public.js'
|
7
6
|
import type { Transport } from './transports/createTransport.js'
|
@@ -9,7 +8,7 @@ import type { Transport } from './transports/createTransport.js'
|
|
9
8
|
export type MulticallBatchOptions = {
|
10
9
|
/** The maximum size (in bytes) for each calldata chunk. @default 1_024 */
|
11
10
|
batchSize?: number
|
12
|
-
/** The maximum number of milliseconds to wait before sending a batch. @default
|
11
|
+
/** The maximum number of milliseconds to wait before sending a batch. @default 0 */
|
13
12
|
wait?: number
|
14
13
|
}
|
15
14
|
|
@@ -32,7 +31,7 @@ export type PublicClient<
|
|
32
31
|
TChain extends Chain | undefined = Chain | undefined,
|
33
32
|
TIncludeActions extends boolean = true,
|
34
33
|
> = Prettify<
|
35
|
-
Client<TTransport,
|
34
|
+
Client<TTransport, PublicRpcSchema, TChain> &
|
36
35
|
Pick<PublicClientConfig, 'batch'> &
|
37
36
|
(TIncludeActions extends true ? PublicActions<TTransport, TChain> : unknown)
|
38
37
|
>
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Chain } from '../types/chain.js'
|
2
|
-
import type {
|
3
|
-
|
2
|
+
import type { TestRpcSchema } from '../types/eip1193.js'
|
4
3
|
import { type Client, type ClientConfig, createClient } from './createClient.js'
|
5
4
|
import { type TestActions, testActions } from './decorators/test.js'
|
6
5
|
import type { Transport } from './transports/createTransport.js'
|
@@ -24,7 +23,7 @@ export type TestClient<
|
|
24
23
|
TTransport extends Transport = Transport,
|
25
24
|
TChain extends Chain | undefined = Chain | undefined,
|
26
25
|
TIncludeActions extends boolean = true,
|
27
|
-
> = Client<TTransport,
|
26
|
+
> = Client<TTransport, TestRpcSchema<TMode>, TChain> &
|
28
27
|
(TIncludeActions extends true ? TestActions : unknown) & {
|
29
28
|
mode: TMode
|
30
29
|
}
|
@@ -3,9 +3,8 @@ import type { Address } from 'abitype'
|
|
3
3
|
import type { Account, JsonRpcAccount } from '../accounts/types.js'
|
4
4
|
import { parseAccount } from '../accounts/utils/parseAccount.js'
|
5
5
|
import type { Chain } from '../types/chain.js'
|
6
|
-
import type {
|
6
|
+
import type { WalletRpcSchema } from '../types/eip1193.js'
|
7
7
|
import type { Prettify } from '../types/utils.js'
|
8
|
-
|
9
8
|
import { type Client, type ClientConfig, createClient } from './createClient.js'
|
10
9
|
import { type WalletActions, walletActions } from './decorators/wallet.js'
|
11
10
|
import type { Transport } from './transports/createTransport.js'
|
@@ -31,7 +30,7 @@ export type WalletClient<
|
|
31
30
|
TAccount extends Account | undefined = Account | undefined,
|
32
31
|
TIncludeActions extends boolean = true,
|
33
32
|
> = Prettify<
|
34
|
-
Client<TTransport,
|
33
|
+
Client<TTransport, WalletRpcSchema, TChain> &
|
35
34
|
(TIncludeActions extends true
|
36
35
|
? WalletActions<TChain, TAccount>
|
37
36
|
: unknown) & {
|
@@ -199,6 +199,7 @@ import {
|
|
199
199
|
import type { Chain } from '../../types/chain.js'
|
200
200
|
import type {
|
201
201
|
ContractFunctionConfig,
|
202
|
+
MaybeAbiEventName,
|
202
203
|
MaybeExtractEventArgsFromAbi,
|
203
204
|
} from '../../types/contract.js'
|
204
205
|
import type { FilterType } from '../../types/filter.js'
|
@@ -277,9 +278,12 @@ export type PublicActions<
|
|
277
278
|
TAbi extends Abi | readonly unknown[],
|
278
279
|
TEventName extends string | undefined,
|
279
280
|
TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined,
|
281
|
+
TStrict extends boolean | undefined = undefined,
|
280
282
|
>(
|
281
|
-
args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs>,
|
282
|
-
) => Promise<
|
283
|
+
args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs, TStrict>,
|
284
|
+
) => Promise<
|
285
|
+
CreateContractEventFilterReturnType<TAbi, TEventName, TArgs, TStrict>
|
286
|
+
>
|
283
287
|
/**
|
284
288
|
* Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
285
289
|
*
|
@@ -303,12 +307,23 @@ export type PublicActions<
|
|
303
307
|
*/
|
304
308
|
createEventFilter: <
|
305
309
|
TAbiEvent extends AbiEvent | undefined,
|
306
|
-
|
307
|
-
|
308
|
-
|
310
|
+
TStrict extends boolean | undefined = undefined,
|
311
|
+
_Abi extends Abi | readonly unknown[] = [TAbiEvent],
|
312
|
+
_EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>,
|
313
|
+
_Args extends
|
314
|
+
| MaybeExtractEventArgsFromAbi<_Abi, _EventName>
|
315
|
+
| undefined = undefined,
|
309
316
|
>(
|
310
|
-
args?: CreateEventFilterParameters<
|
311
|
-
|
317
|
+
args?: CreateEventFilterParameters<
|
318
|
+
TAbiEvent,
|
319
|
+
TStrict,
|
320
|
+
_Abi,
|
321
|
+
_EventName,
|
322
|
+
_Args
|
323
|
+
>,
|
324
|
+
) => Promise<
|
325
|
+
CreateEventFilterReturnType<TAbiEvent, TStrict, _Abi, _EventName, _Args>
|
326
|
+
>
|
312
327
|
/**
|
313
328
|
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
314
329
|
*
|
@@ -792,9 +807,12 @@ export type PublicActions<
|
|
792
807
|
TFilterType extends FilterType,
|
793
808
|
TAbi extends Abi | readonly unknown[],
|
794
809
|
TEventName extends string | undefined,
|
810
|
+
TStrict extends boolean | undefined = undefined,
|
795
811
|
>(
|
796
|
-
args: GetFilterChangesParameters<TFilterType, TAbi, TEventName>,
|
797
|
-
) => Promise<
|
812
|
+
args: GetFilterChangesParameters<TFilterType, TAbi, TEventName, TStrict>,
|
813
|
+
) => Promise<
|
814
|
+
GetFilterChangesReturnType<TFilterType, TAbi, TEventName, TStrict>
|
815
|
+
>
|
798
816
|
/**
|
799
817
|
* Returns a list of event logs since the filter was created.
|
800
818
|
*
|
@@ -824,9 +842,10 @@ export type PublicActions<
|
|
824
842
|
getFilterLogs: <
|
825
843
|
TAbi extends Abi | readonly unknown[],
|
826
844
|
TEventName extends string | undefined,
|
845
|
+
TStrict extends boolean | undefined = undefined,
|
827
846
|
>(
|
828
|
-
args: GetFilterLogsParameters<TAbi, TEventName>,
|
829
|
-
) => Promise<GetFilterLogsReturnType<TAbi, TEventName>>
|
847
|
+
args: GetFilterLogsParameters<TAbi, TEventName, TStrict>,
|
848
|
+
) => Promise<GetFilterLogsReturnType<TAbi, TEventName, TStrict>>
|
830
849
|
/**
|
831
850
|
* Returns the current price of gas (in wei).
|
832
851
|
*
|
@@ -866,9 +885,12 @@ export type PublicActions<
|
|
866
885
|
* })
|
867
886
|
* const logs = await client.getLogs()
|
868
887
|
*/
|
869
|
-
getLogs: <
|
870
|
-
|
871
|
-
|
888
|
+
getLogs: <
|
889
|
+
TAbiEvent extends AbiEvent | undefined,
|
890
|
+
TStrict extends boolean | undefined = undefined,
|
891
|
+
>(
|
892
|
+
args?: GetLogsParameters<TAbiEvent, TStrict>,
|
893
|
+
) => Promise<GetLogsReturnType<TAbiEvent, TStrict>>
|
872
894
|
/**
|
873
895
|
* Returns the value from a storage slot at a given address.
|
874
896
|
*
|
@@ -1276,8 +1298,9 @@ export type PublicActions<
|
|
1276
1298
|
watchContractEvent: <
|
1277
1299
|
TAbi extends Abi | readonly unknown[],
|
1278
1300
|
TEventName extends string,
|
1301
|
+
TStrict extends boolean | undefined = undefined,
|
1279
1302
|
>(
|
1280
|
-
args: WatchContractEventParameters<TAbi, TEventName>,
|
1303
|
+
args: WatchContractEventParameters<TAbi, TEventName, TStrict>,
|
1281
1304
|
) => WatchContractEventReturnType
|
1282
1305
|
/**
|
1283
1306
|
* Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).
|
@@ -1310,8 +1333,11 @@ export type PublicActions<
|
|
1310
1333
|
* onLogs: (logs) => console.log(logs),
|
1311
1334
|
* })
|
1312
1335
|
*/
|
1313
|
-
watchEvent: <
|
1314
|
-
|
1336
|
+
watchEvent: <
|
1337
|
+
TAbiEvent extends AbiEvent | undefined,
|
1338
|
+
TStrict extends boolean | undefined = undefined,
|
1339
|
+
>(
|
1340
|
+
args: WatchEventParameters<TAbiEvent, TStrict>,
|
1315
1341
|
) => WatchEventReturnType
|
1316
1342
|
/**
|
1317
1343
|
* Watches and returns pending transaction hashes.
|
@@ -328,8 +328,8 @@ export type TestActions = {
|
|
328
328
|
* value: 1000000000000000000n,
|
329
329
|
* })
|
330
330
|
*/
|
331
|
-
sendUnsignedTransaction: (
|
332
|
-
args: SendUnsignedTransactionParameters
|
331
|
+
sendUnsignedTransaction: <TChain extends Chain | undefined>(
|
332
|
+
args: SendUnsignedTransactionParameters<TChain>,
|
333
333
|
) => Promise<SendUnsignedTransactionReturnType>
|
334
334
|
/**
|
335
335
|
* Enables or disables the automatic mining of new blocks with each new transaction submitted to the network.
|
@@ -681,7 +681,8 @@ export function testActions<TChain extends Chain | undefined>(
|
|
681
681
|
removeBlockTimestampInterval: () => removeBlockTimestampInterval(client),
|
682
682
|
reset: (args) => reset(client, args),
|
683
683
|
revert: (args) => revert(client, args),
|
684
|
-
sendUnsignedTransaction: (args) =>
|
684
|
+
sendUnsignedTransaction: (args) =>
|
685
|
+
sendUnsignedTransaction(client, args as any),
|
685
686
|
setAutomine: (args) => setAutomine(client, args),
|
686
687
|
setBalance: (args) => setBalance(client, args),
|
687
688
|
setBlockGasLimit: (args) => setBlockGasLimit(client, args),
|
@@ -410,8 +410,8 @@ export type WalletActions<
|
|
410
410
|
* })
|
411
411
|
*/
|
412
412
|
signTypedData: <
|
413
|
-
TTypedData extends TypedData |
|
414
|
-
TPrimaryType extends
|
413
|
+
const TTypedData extends TypedData | Record<string, unknown>,
|
414
|
+
TPrimaryType extends keyof TTypedData,
|
415
415
|
>(
|
416
416
|
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>,
|
417
417
|
) => Promise<SignTypedDataReturnType>
|