superstack-wallet-sdk 0.4.2
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 +114 -0
- package/dist/esm/_virtual/_commonjsHelpers.js +2 -0
- package/dist/esm/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/esm/_virtual/_polyfill-node.buffer.js +2 -0
- package/dist/esm/_virtual/_polyfill-node.buffer.js.map +1 -0
- package/dist/esm/_virtual/index.js +2 -0
- package/dist/esm/_virtual/index.js.map +1 -0
- package/dist/esm/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js +2 -0
- package/dist/esm/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js.map +1 -0
- package/dist/esm/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +2 -0
- package/dist/esm/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +1 -0
- package/dist/esm/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +2 -0
- package/dist/esm/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/_md.js +2 -0
- package/dist/esm/node_modules/@noble/hashes/esm/_md.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/_u64.js +2 -0
- package/dist/esm/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/crypto.js +2 -0
- package/dist/esm/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/hmac.js +2 -0
- package/dist/esm/node_modules/@noble/hashes/esm/hmac.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/sha2.js +2 -0
- package/dist/esm/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/sha256.js +2 -0
- package/dist/esm/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/sha3.js +2 -0
- package/dist/esm/node_modules/@noble/hashes/esm/sha3.js.map +1 -0
- package/dist/esm/node_modules/@noble/hashes/esm/utils.js +4 -0
- package/dist/esm/node_modules/@noble/hashes/esm/utils.js.map +1 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/adapter.js +2 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/adapter.js.map +1 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/errors.js +2 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/errors.js.map +1 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/signer.js +2 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/signer.js.map +1 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/transaction.js +2 -0
- package/dist/esm/node_modules/@solana/wallet-adapter-base/lib/esm/transaction.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/errors.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/errors.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/signature.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/signature.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/struct.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/errors/struct.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/parseAbi.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/parseAbi.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/parseAbiItem.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/parseAbiItem.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/cache.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/cache.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/structs.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/structs.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/utils.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/human-readable/runtime/utils.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/regex.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/regex.js.map +1 -0
- package/dist/esm/node_modules/abitype/dist/esm/version.js +2 -0
- package/dist/esm/node_modules/abitype/dist/esm/version.js.map +1 -0
- package/dist/esm/node_modules/ethers/lib.esm/_version.js +2 -0
- package/dist/esm/node_modules/ethers/lib.esm/_version.js.map +1 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/data.js +2 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/data.js.map +1 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/errors.js +2 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/errors.js.map +1 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/fixednumber.js +2 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/fixednumber.js.map +1 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/maths.js +2 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/maths.js.map +1 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/properties.js +2 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/properties.js.map +1 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/units.js +2 -0
- package/dist/esm/node_modules/ethers/lib.esm/utils/units.js.map +1 -0
- package/dist/esm/node_modules/eventemitter3/index.js +2 -0
- package/dist/esm/node_modules/eventemitter3/index.js.map +1 -0
- package/dist/esm/node_modules/eventemitter3/index2.js +2 -0
- package/dist/esm/node_modules/eventemitter3/index2.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiConstructor.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiConstructor.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiFunction.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiFunction.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiItem.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiItem.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiParameters.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/AbiParameters.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Address.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Address.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Authorization.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Authorization.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/BlockOverrides.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/BlockOverrides.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Bytes.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Bytes.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Caches.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Caches.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Errors.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Errors.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Hash.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Hash.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Hex.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Hex.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Json.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Json.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Signature.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Signature.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Solidity.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Solidity.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/Withdrawal.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/Withdrawal.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/abiItem.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/abiItem.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/abiParameters.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/abiParameters.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/bytes.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/bytes.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/cursor.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/cursor.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/errors.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/errors.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/hex.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/hex.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/lru.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/internal/lru.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/core/version.js +2 -0
- package/dist/esm/node_modules/ox/_esm/core/version.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/erc6492/SignatureErc6492.js +2 -0
- package/dist/esm/node_modules/ox/_esm/erc6492/SignatureErc6492.js.map +1 -0
- package/dist/esm/node_modules/ox/_esm/erc8010/SignatureErc8010.js +2 -0
- package/dist/esm/node_modules/ox/_esm/erc8010/SignatureErc8010.js.map +1 -0
- package/dist/esm/node_modules/styled-components/dist/styled-components.browser.esm.js +2 -0
- package/dist/esm/node_modules/styled-components/dist/styled-components.browser.esm.js.map +1 -0
- package/dist/esm/node_modules/stylis/src/Enum.js +2 -0
- package/dist/esm/node_modules/stylis/src/Enum.js.map +1 -0
- package/dist/esm/node_modules/stylis/src/Middleware.js +2 -0
- package/dist/esm/node_modules/stylis/src/Middleware.js.map +1 -0
- package/dist/esm/node_modules/stylis/src/Parser.js +2 -0
- package/dist/esm/node_modules/stylis/src/Parser.js.map +1 -0
- package/dist/esm/node_modules/stylis/src/Prefixer.js +2 -0
- package/dist/esm/node_modules/stylis/src/Prefixer.js.map +1 -0
- package/dist/esm/node_modules/stylis/src/Serializer.js +2 -0
- package/dist/esm/node_modules/stylis/src/Serializer.js.map +1 -0
- package/dist/esm/node_modules/stylis/src/Tokenizer.js +2 -0
- package/dist/esm/node_modules/stylis/src/Tokenizer.js.map +1 -0
- package/dist/esm/node_modules/stylis/src/Utility.js +2 -0
- package/dist/esm/node_modules/stylis/src/Utility.js.map +1 -0
- package/dist/esm/node_modules/tslib/tslib.es6.js +2 -0
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/accounts/utils/parseAccount.js +2 -0
- package/dist/esm/node_modules/viem/_esm/accounts/utils/parseAccount.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js +2 -0
- package/dist/esm/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsAddress.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsAddress.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsAvatar.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsAvatar.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsName.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsName.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsResolver.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsResolver.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsText.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/ens/getEnsText.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/call.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/call.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createAccessList.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createAccessList.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createBlockFilter.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createBlockFilter.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createContractEventFilter.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createContractEventFilter.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createEventFilter.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createEventFilter.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createPendingTransactionFilter.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/createPendingTransactionFilter.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateContractGas.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateContractGas.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateFeesPerGas.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateFeesPerGas.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateGas.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateGas.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateMaxPriorityFeePerGas.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBalance.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBalance.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlobBaseFee.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlobBaseFee.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlock.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlock.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlockNumber.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlockNumber.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlockTransactionCount.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getBlockTransactionCount.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getChainId.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getChainId.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getCode.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getCode.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getContractEvents.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getContractEvents.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getEip712Domain.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getEip712Domain.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getFeeHistory.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getFeeHistory.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getFilterChanges.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getFilterChanges.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getFilterLogs.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getFilterLogs.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getGasPrice.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getGasPrice.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getLogs.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getLogs.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getProof.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getProof.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getStorageAt.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getStorageAt.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransaction.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransaction.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransactionConfirmations.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransactionConfirmations.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransactionCount.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransactionCount.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransactionReceipt.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/getTransactionReceipt.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/multicall.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/multicall.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/readContract.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/readContract.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/simulateBlocks.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/simulateBlocks.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/simulateCalls.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/simulateCalls.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/simulateContract.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/simulateContract.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/uninstallFilter.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/uninstallFilter.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/verifyHash.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/verifyHash.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/verifyMessage.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/verifyMessage.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/verifyTypedData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/verifyTypedData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/waitForTransactionReceipt.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/waitForTransactionReceipt.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchBlockNumber.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchBlockNumber.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchBlocks.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchBlocks.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchContractEvent.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchContractEvent.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchEvent.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchEvent.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchPendingTransactions.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/public/watchPendingTransactions.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/siwe/verifySiweMessage.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/siwe/verifySiweMessage.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/wallet/prepareTransactionRequest.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/actions/wallet/sendRawTransaction.js +2 -0
- package/dist/esm/node_modules/viem/_esm/actions/wallet/sendRawTransaction.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/clients/createClient.js +2 -0
- package/dist/esm/node_modules/viem/_esm/clients/createClient.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/clients/createPublicClient.js +2 -0
- package/dist/esm/node_modules/viem/_esm/clients/createPublicClient.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/clients/decorators/public.js +2 -0
- package/dist/esm/node_modules/viem/_esm/clients/decorators/public.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/clients/transports/createTransport.js +2 -0
- package/dist/esm/node_modules/viem/_esm/clients/transports/createTransport.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/clients/transports/http.js +2 -0
- package/dist/esm/node_modules/viem/_esm/clients/transports/http.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/abis.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/abis.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/address.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/address.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/blob.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/blob.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/contract.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/contract.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/contracts.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/contracts.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/number.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/number.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/solidity.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/solidity.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/strings.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/strings.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/constants/unit.js +2 -0
- package/dist/esm/node_modules/viem/_esm/constants/unit.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/abi.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/abi.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/address.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/address.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/base.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/base.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/blob.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/blob.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/block.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/block.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/ccip.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/ccip.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/chain.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/chain.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/contract.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/contract.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/cursor.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/cursor.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/data.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/data.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/eip712.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/eip712.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/encoding.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/encoding.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/ens.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/ens.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/estimateGas.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/estimateGas.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/fee.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/fee.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/log.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/log.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/node.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/node.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/request.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/request.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/rpc.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/rpc.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/stateOverride.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/stateOverride.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/transaction.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/transaction.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/transport.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/transport.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/typedData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/typedData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/utils.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/utils.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/errors/version.js +2 -0
- package/dist/esm/node_modules/viem/_esm/errors/version.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeErrorResult.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeErrorResult.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeEventLog.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeEventLog.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeFunctionData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeFunctionData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeDeployData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeDeployData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeErrorResult.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeErrorResult.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeEventTopics.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeEventTopics.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeFunctionData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeFunctionData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/formatAbiItem.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/formatAbiItem.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/getAbiItem.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/getAbiItem.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/parseEventLogs.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/parseEventLogs.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/address/getAddress.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/address/getAddress.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/address/isAddress.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/address/isAddress.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/address/isAddressEqual.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/address/isAddressEqual.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/authorization/hashAuthorization.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/authorization/hashAuthorization.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/authorization/recoverAuthorizationAddress.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/authorization/recoverAuthorizationAddress.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/blobsToCommitments.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/blobsToCommitments.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/blobsToProofs.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/blobsToProofs.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/toBlobSidecars.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/toBlobSidecars.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/toBlobs.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/blob/toBlobs.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/buildRequest.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/buildRequest.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ccip.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ccip.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/chain/getChainContractAddress.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/chain/getChainContractAddress.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/cursor.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/cursor.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/concat.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/concat.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/isHex.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/isHex.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/pad.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/pad.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/size.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/size.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/slice.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/slice.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/trim.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/data/trim.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/fromBytes.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/fromBytes.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/fromHex.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/fromHex.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/toBytes.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/toBytes.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/toHex.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/toHex.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/toRlp.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/encoding/toRlp.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/avatar/parseAvatarRecord.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/avatar/utils.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/avatar/utils.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/encodeLabelhash.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/encodeLabelhash.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/encodedLabelToLabelhash.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/encodedLabelToLabelhash.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/errors.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/errors.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/labelhash.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/labelhash.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/namehash.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/namehash.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/packetToBytes.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/ens/packetToBytes.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getCallError.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getCallError.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getContractError.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getContractError.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getEstimateGasError.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getEstimateGasError.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getNodeError.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/errors/getNodeError.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/filters/createFilterRequestScope.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/filters/createFilterRequestScope.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/block.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/block.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/extract.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/extract.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/feeHistory.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/feeHistory.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/log.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/log.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/proof.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/proof.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/transaction.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/transaction.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/transactionReceipt.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/transactionReceipt.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/transactionRequest.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/formatters/transactionRequest.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/getAction.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/getAction.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/hashSignature.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/hashSignature.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/keccak256.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/keccak256.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/normalizeSignature.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/normalizeSignature.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/sha256.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/sha256.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toEventSelector.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toEventSelector.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toFunctionSelector.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toFunctionSelector.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toSignature.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toSignature.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toSignatureHash.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/hash/toSignatureHash.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/lru.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/lru.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/observe.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/observe.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/poll.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/poll.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/createBatchScheduler.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/createBatchScheduler.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withCache.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withCache.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withDedupe.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withDedupe.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withResolvers.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withResolvers.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withRetry.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withRetry.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withTimeout.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/promise/withTimeout.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/regex.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/regex.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/rpc/http.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/rpc/http.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/rpc/id.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/rpc/id.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/hashMessage.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/hashMessage.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/hashTypedData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/hashTypedData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/recoverAddress.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/recoverAddress.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/recoverPublicKey.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/recoverPublicKey.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/serializeSignature.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/serializeSignature.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/siwe/parseSiweMessage.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/siwe/parseSiweMessage.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/siwe/validateSiweMessage.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/siwe/validateSiweMessage.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/stateOverride.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/stateOverride.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/stringify.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/stringify.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/transaction/assertRequest.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/transaction/assertRequest.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/transaction/getTransactionType.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/transaction/getTransactionType.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/typedData.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/typedData.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/uid.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/uid.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/unit/formatEther.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/unit/formatEther.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/unit/formatGwei.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/unit/formatGwei.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/unit/formatUnits.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/unit/formatUnits.js.map +1 -0
- package/dist/esm/node_modules/viem/_esm/utils/wait.js +2 -0
- package/dist/esm/node_modules/viem/_esm/utils/wait.js.map +1 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/_shortw_utils.js +3 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/_shortw_utils.js.map +1 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/curve.js +3 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/curve.js.map +1 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/modular.js +4 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/modular.js.map +1 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/utils.js +3 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/utils.js.map +1 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/weierstrass.js +4 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/abstract/weierstrass.js.map +1 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/secp256k1.js +3 -0
- package/dist/esm/node_modules/viem/node_modules/@noble/curves/esm/secp256k1.js.map +1 -0
- package/dist/esm/src/LoginModal.js +2 -0
- package/dist/esm/src/LoginModal.js.map +1 -0
- package/dist/esm/src/LoginModal.styles.js +286 -0
- package/dist/esm/src/LoginModal.styles.js.map +1 -0
- package/dist/esm/src/adapters/phantom.js +2 -0
- package/dist/esm/src/adapters/phantom.js.map +1 -0
- package/dist/esm/src/client.js +2 -0
- package/dist/esm/src/client.js.map +1 -0
- package/dist/esm/src/coinbase.js +2 -0
- package/dist/esm/src/coinbase.js.map +1 -0
- package/dist/esm/src/context.js +2 -0
- package/dist/esm/src/context.js.map +1 -0
- package/dist/esm/src/hooks.js +2 -0
- package/dist/esm/src/hooks.js.map +1 -0
- package/dist/esm/src/index.js +2 -0
- package/dist/esm/src/index.js.map +1 -0
- package/dist/esm/src/modal.js +2 -0
- package/dist/esm/src/modal.js.map +1 -0
- package/dist/esm/src/polyfills.js +2 -0
- package/dist/esm/src/polyfills.js.map +1 -0
- package/dist/esm/src/storage.js +2 -0
- package/dist/esm/src/storage.js.map +1 -0
- package/dist/esm/src/styles/index.js +2 -0
- package/dist/esm/src/styles/index.js.map +1 -0
- package/dist/esm/src/styles/theme.js +2 -0
- package/dist/esm/src/styles/theme.js.map +1 -0
- package/dist/esm/src/types.js +2 -0
- package/dist/esm/src/types.js.map +1 -0
- package/dist/esm/src/utils/coinbaseUtils.js +2 -0
- package/dist/esm/src/utils/coinbaseUtils.js.map +1 -0
- package/dist/esm/src/utils/oauth.js +2 -0
- package/dist/esm/src/utils/oauth.js.map +1 -0
- package/dist/esm/types/LoginModal.d.ts +3 -0
- package/dist/esm/types/LoginModal.styles.d.ts +29 -0
- package/dist/esm/types/adapters/phantom.d.ts +30 -0
- package/dist/esm/types/client.d.ts +170 -0
- package/dist/esm/types/coinbase.d.ts +3 -0
- package/dist/esm/types/context.d.ts +28 -0
- package/dist/esm/types/hooks.d.ts +56 -0
- package/dist/esm/types/index.d.ts +8 -0
- package/dist/esm/types/modal.d.ts +20 -0
- package/dist/esm/types/polyfills.d.ts +1 -0
- package/dist/esm/types/storage.d.ts +9 -0
- package/dist/esm/types/styles/globalStyles.d.ts +2 -0
- package/dist/esm/types/styles/index.d.ts +2 -0
- package/dist/esm/types/styles/theme.d.ts +103 -0
- package/dist/esm/types/types.d.ts +132 -0
- package/dist/esm/types/utils/coinbaseUtils.d.ts +9 -0
- package/dist/esm/types/utils/oauth.d.ts +21 -0
- package/dist/esm/types/utils/twitter.d.ts +35 -0
- package/dist/index.cjs +296 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +530 -0
- package/package.json +97 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/call.js"],"sourcesContent":["import { parseAbi } from 'abitype';\nimport * as BlockOverrides from 'ox/BlockOverrides';\nimport { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { multicall3Abi } from '../../constants/abis.js';\nimport { aggregate3Signature } from '../../constants/contract.js';\nimport { deploylessCallViaBytecodeBytecode, deploylessCallViaFactoryBytecode, multicall3Bytecode, } from '../../constants/contracts.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ChainDoesNotSupportContract, ClientChainNotConfiguredError, } from '../../errors/chain.js';\nimport { CounterfactualDeploymentFailedError, RawContractError, } from '../../errors/contract.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeDeployData, } from '../../utils/abi/encodeDeployData.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getCallError, } from '../../utils/errors/getCallError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { createBatchScheduler, } from '../../utils/promise/createBatchScheduler.js';\nimport { serializeStateOverride, } from '../../utils/stateOverride.js';\nimport { assertRequest } from '../../utils/transaction/assertRequest.js';\n/**\n * Executes a new message call immediately without submitting a transaction to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/call\n * - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)\n *\n * @param client - Client to use\n * @param parameters - {@link CallParameters}\n * @returns The call data. {@link CallReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { call } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const data = await call(client, {\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * })\n */\nexport async function call(client, args) {\n const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = client.experimental_blockTag ?? 'latest', accessList, blobs, blockOverrides, code, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride, ...rest } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n if (code && (factory || factoryData))\n throw new BaseError('Cannot provide both `code` & `factory`/`factoryData` as parameters.');\n if (code && to)\n throw new BaseError('Cannot provide both `code` & `to` as parameters.');\n // Check if the call is deployless via bytecode.\n const deploylessCallViaBytecode = code && data_;\n // Check if the call is deployless via a factory.\n const deploylessCallViaFactory = factory && factoryData && to && data_;\n const deploylessCall = deploylessCallViaBytecode || deploylessCallViaFactory;\n const data = (() => {\n if (deploylessCallViaBytecode)\n return toDeploylessCallViaBytecodeData({\n code,\n data: data_,\n });\n if (deploylessCallViaFactory)\n return toDeploylessCallViaFactoryData({\n data: data_,\n factory,\n factoryData,\n to,\n });\n return data_;\n })();\n try {\n assertRequest(args);\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const rpcBlockOverrides = blockOverrides\n ? BlockOverrides.toRpc(blockOverrides)\n : undefined;\n const rpcStateOverride = serializeStateOverride(stateOverride);\n const chainFormat = client.chain?.formatters?.transactionRequest?.format;\n const format = chainFormat || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format: chainFormat }),\n from: account?.address,\n accessList,\n authorizationList,\n blobs,\n data,\n gas,\n gasPrice,\n maxFeePerBlobGas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to: deploylessCall ? undefined : to,\n value,\n });\n if (batch &&\n shouldPerformMulticall({ request }) &&\n !rpcStateOverride &&\n !rpcBlockOverrides) {\n try {\n return await scheduleMulticall(client, {\n ...request,\n blockNumber,\n blockTag,\n });\n }\n catch (err) {\n if (!(err instanceof ClientChainNotConfiguredError) &&\n !(err instanceof ChainDoesNotSupportContract))\n throw err;\n }\n }\n const params = (() => {\n const base = [\n request,\n block,\n ];\n if (rpcStateOverride && rpcBlockOverrides)\n return [...base, rpcStateOverride, rpcBlockOverrides];\n if (rpcStateOverride)\n return [...base, rpcStateOverride];\n if (rpcBlockOverrides)\n return [...base, {}, rpcBlockOverrides];\n return base;\n })();\n const response = await client.request({\n method: 'eth_call',\n params,\n });\n if (response === '0x')\n return { data: undefined };\n return { data: response };\n }\n catch (err) {\n const data = getRevertErrorData(err);\n // Check for CCIP-Read offchain lookup signature.\n const { offchainLookup, offchainLookupSignature } = await import('../../utils/ccip.js');\n if (client.ccipRead !== false &&\n data?.slice(0, 10) === offchainLookupSignature &&\n to)\n return { data: await offchainLookup(client, { data, to }) };\n // Check for counterfactual deployment error.\n if (deploylessCall && data?.slice(0, 10) === '0x101bb98d')\n throw new CounterfactualDeploymentFailedError({ factory });\n throw getCallError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n// We only want to perform a scheduled multicall if:\n// - The request has calldata,\n// - The request has a target address,\n// - The target address is not already the aggregate3 signature,\n// - The request has no other properties (`nonce`, `gas`, etc cannot be sent with a multicall).\nfunction shouldPerformMulticall({ request }) {\n const { data, to, ...request_ } = request;\n if (!data)\n return false;\n if (data.startsWith(aggregate3Signature))\n return false;\n if (!to)\n return false;\n if (Object.values(request_).filter((x) => typeof x !== 'undefined').length > 0)\n return false;\n return true;\n}\nasync function scheduleMulticall(client, args) {\n const { batchSize = 1024, deployless = false, wait = 0, } = typeof client.batch?.multicall === 'object' ? client.batch.multicall : {};\n const { blockNumber, blockTag = client.experimental_blockTag ?? 'latest', data, to, } = args;\n const multicallAddress = (() => {\n if (deployless)\n return null;\n if (args.multicallAddress)\n return args.multicallAddress;\n if (client.chain) {\n return getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n throw new ClientChainNotConfiguredError();\n })();\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const { schedule } = createBatchScheduler({\n id: `${client.uid}.${block}`,\n wait,\n shouldSplitBatch(args) {\n const size = args.reduce((size, { data }) => size + (data.length - 2), 0);\n return size > batchSize * 2;\n },\n fn: async (requests) => {\n const calls = requests.map((request) => ({\n allowFailure: true,\n callData: request.data,\n target: request.to,\n }));\n const calldata = encodeFunctionData({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n });\n const data = await client.request({\n method: 'eth_call',\n params: [\n {\n ...(multicallAddress === null\n ? {\n data: toDeploylessCallViaBytecodeData({\n code: multicall3Bytecode,\n data: calldata,\n }),\n }\n : { to: multicallAddress, data: calldata }),\n },\n block,\n ],\n });\n return decodeFunctionResult({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n data: data || '0x',\n });\n },\n });\n const [{ returnData, success }] = await schedule({ data, to });\n if (!success)\n throw new RawContractError({ data: returnData });\n if (returnData === '0x')\n return { data: undefined };\n return { data: returnData };\n}\nfunction toDeploylessCallViaBytecodeData(parameters) {\n const { code, data } = parameters;\n return encodeDeployData({\n abi: parseAbi(['constructor(bytes, bytes)']),\n bytecode: deploylessCallViaBytecodeBytecode,\n args: [code, data],\n });\n}\nfunction toDeploylessCallViaFactoryData(parameters) {\n const { data, factory, factoryData, to } = parameters;\n return encodeDeployData({\n abi: parseAbi(['constructor(address, bytes, address, bytes)']),\n bytecode: deploylessCallViaFactoryBytecode,\n args: [to, data, factory, factoryData],\n });\n}\n/** @internal */\nexport function getRevertErrorData(err) {\n if (!(err instanceof BaseError))\n return undefined;\n const error = err.walk();\n return typeof error?.data === 'object' ? error.data?.data : error.data;\n}\n//# sourceMappingURL=call.js.map"],"names":["async","call","client","args","account","account_","authorizationList","batch","Boolean","multicall","blockNumber","blockTag","experimental_blockTag","accessList","blobs","blockOverrides","code","data","data_","factory","factoryData","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","nonce","to","value","stateOverride","rest","parseAccount","undefined","BaseError","deploylessCallViaBytecode","deploylessCallViaFactory","deploylessCall","toDeploylessCallViaBytecodeData","parameters","encodeDeployData","abi","parseAbi","bytecode","deploylessCallViaFactoryBytecode","toDeploylessCallViaFactoryData","assertRequest","block","numberToHex","rpcBlockOverrides","BlockOverrides.toRpc","rpcStateOverride","serializeStateOverride","chainFormat","chain","formatters","transactionRequest","format","request","formatTransactionRequest","extract","from","address","request_","startsWith","aggregate3Signature","Object","values","filter","x","length","shouldPerformMulticall","batchSize","deployless","wait","multicallAddress","getChainContractAddress","contract","ClientChainNotConfiguredError","blockNumberHex","schedule","createBatchScheduler","id","uid","shouldSplitBatch","size","reduce","fn","requests","calls","map","allowFailure","callData","target","calldata","encodeFunctionData","multicall3Abi","functionName","method","params","multicall3Bytecode","decodeFunctionResult","returnData","success","RawContractError","scheduleMulticall","err","ChainDoesNotSupportContract","base","response","getRevertErrorData","offchainLookup","offchainLookupSignature","import","ccipRead","slice","CounterfactualDeploymentFailedError","getCallError","deploylessCallViaBytecodeBytecode","error","walk"],"mappings":"4gDA6COA,eAAeC,EAAKC,EAAQC,GAC/B,MAAQC,QAASC,EAAWH,EAAOE,QAAOE,kBAAEA,EAAiBC,MAAEA,EAAQC,QAAQN,EAAOK,OAAOE,WAAUC,YAAEA,EAAWC,SAAEA,EAAWT,EAAOU,uBAAyB,SAAQC,WAAEA,EAAUC,MAAEA,EAAKC,eAAEA,EAAcC,KAAEA,EAAMC,KAAMC,EAAKC,QAAEA,EAAOC,YAAEA,EAAWC,IAAEA,EAAGC,SAAEA,EAAQC,iBAAEA,EAAgBC,aAAEA,EAAYC,qBAAEA,EAAoBC,MAAEA,EAAKC,GAAEA,EAAEC,MAAEA,EAAKC,cAAEA,KAAkBC,GAAS3B,EACnWC,EAAUC,EAAW0B,EAAa1B,QAAY2B,EACpD,GAAIhB,IAASG,GAAWC,GACpB,MAAM,IAAIa,EAAU,uEACxB,GAAIjB,GAAQW,EACR,MAAM,IAAIM,EAAU,oDAExB,MAAMC,EAA4BlB,GAAQE,EAEpCiB,EAA2BhB,GAAWC,GAAeO,GAAMT,EAC3DkB,EAAiBF,GAA6BC,EAC9ClB,EACEiB,EACOG,EAAgC,CACnCrB,OACAC,KAAMC,IAEViB,EAyLZ,SAAwCG,GACpC,MAAMrB,KAAEA,EAAIE,QAAEA,EAAOC,YAAEA,EAAWO,GAAEA,GAAOW,EAC3C,OAAOC,EAAiB,CACpBC,IAAKC,EAAS,CAAC,gDACfC,SAAUC,EACVxC,KAAM,CAACwB,EAAIV,EAAME,EAASC,IAElC,CA/LmBwB,CAA+B,CAClC3B,KAAMC,EACNC,UACAC,cACAO,OAEDT,EAEX,IACI2B,EAAc1C,GACd,MACM2C,GADwC,iBAAhBpC,EAA2BqC,EAAYrC,QAAesB,IACpDrB,EAC1BqC,EAAoBjC,EACpBkC,EAAqBlC,QACrBiB,EACAkB,EAAmBC,EAAuBtB,GAC1CuB,EAAclD,EAAOmD,OAAOC,YAAYC,oBAAoBC,OAE5DC,GADSL,GAAeM,GACP,IAEhBC,EAAQ7B,EAAM,CAAE0B,OAAQJ,IAC3BQ,KAAMxD,GAASyD,QACfhD,aACAP,oBACAQ,QACAG,OACAI,MACAC,WACAC,mBACAC,eACAC,uBACAC,QACAC,GAAIS,OAAiBJ,EAAYL,EACjCC,UAEJ,GAAIrB,GA6DZ,UAAgCkD,QAAEA,IAC9B,MAAMxC,KAAEA,EAAIU,GAAEA,KAAOmC,GAAaL,EAClC,QAAKxC,KAEDA,EAAK8C,WAAWC,OAEfrC,KAEDsC,OAAOC,OAAOJ,GAAUK,OAAQC,QAAmB,IAANA,GAAmBC,OAAS,IAGjF,CAvEYC,CAAuB,CAAEb,cACxBP,IACAF,EACD,IACI,aAoEhBhD,eAAiCE,EAAQC,GACrC,MAAMoE,UAAEA,EAAY,KAAIC,WAAEA,GAAa,EAAKC,KAAEA,EAAO,GAA0C,iBAA5BvE,EAAOK,OAAOE,UAAyBP,EAAOK,MAAME,UAAY,CAAA,GAC7HC,YAAEA,EAAWC,SAAEA,EAAWT,EAAOU,uBAAyB,SAAQK,KAAEA,EAAIU,GAAEA,GAAQxB,EAClFuE,EAAmB,MACrB,GAAIF,EACA,OAAO,KACX,GAAIrE,EAAKuE,iBACL,OAAOvE,EAAKuE,iBAChB,GAAIxE,EAAOmD,MACP,OAAOsB,EAAwB,CAC3BjE,cACA2C,MAAOnD,EAAOmD,MACduB,SAAU,eAGlB,MAAM,IAAIC,CACb,EAbwB,GAcnBC,EAAwC,iBAAhBpE,EAA2BqC,EAAYrC,QAAesB,EAC9Ec,EAAQgC,GAAkBnE,GAC1BoE,SAAEA,GAAaC,EAAqB,CACtCC,GAAI,GAAG/E,EAAOgF,OAAOpC,IACrB2B,OACA,gBAAAU,CAAiBhF,GACb,MAAMiF,EAAOjF,EAAKkF,OAAO,CAACD,GAAQnE,UAAWmE,GAAQnE,EAAKoD,OAAS,GAAI,GACvE,OAAOe,EAAmB,EAAZb,CAClB,EACAe,GAAItF,MAAOuF,IACP,MAAMC,EAAQD,EAASE,IAAKhC,IAAO,CAC/BiC,cAAc,EACdC,SAAUlC,EAAQxC,KAClB2E,OAAQnC,EAAQ9B,MAEdkE,EAAWC,EAAmB,CAChCtD,IAAKuD,EACL5F,KAAM,CAACqF,GACPQ,aAAc,eAEZ/E,QAAaf,EAAOuD,QAAQ,CAC9BwC,OAAQ,WACRC,OAAQ,CACJ,IAC6B,OAArBxB,EACE,CACEzD,KAAMoB,EAAgC,CAClCrB,KAAMmF,EACNlF,KAAM4E,KAGZ,CAAElE,GAAI+C,EAAkBzD,KAAM4E,IAExC/C,KAGR,OAAOsD,EAAqB,CACxB5D,IAAKuD,EACL5F,KAAM,CAACqF,GACPQ,aAAc,aACd/E,KAAMA,GAAQ,YAInBoF,WAAEA,EAAUC,QAAEA,UAAmBvB,EAAS,CAAE9D,OAAMU,OACzD,IAAK2E,EACD,MAAM,IAAIC,EAAiB,CAAEtF,KAAMoF,IACvC,MAAmB,OAAfA,EACO,CAAEpF,UAAMe,GACZ,CAAEf,KAAMoF,EACnB,CAvI6BG,CAAkBtG,EAAQ,IAChCuD,EACH/C,cACAC,YAER,CACA,MAAO8F,GACH,KAAMA,aAAe5B,GACf4B,aAAeC,GACjB,MAAMD,CACd,CAEJ,MAAMP,EAAS,MACX,MAAMS,EAAO,CACTlD,EACAX,GAEJ,OAAII,GAAoBF,EACb,IAAI2D,EAAMzD,EAAkBF,GACnCE,EACO,IAAIyD,EAAMzD,GACjBF,EACO,IAAI2D,EAAM,CAAA,EAAI3D,GAClB2D,CACV,EAZc,GAaTC,QAAiB1G,EAAOuD,QAAQ,CAClCwC,OAAQ,WACRC,WAEJ,MAAiB,OAAbU,EACO,CAAE3F,UAAMe,GACZ,CAAEf,KAAM2F,EACnB,CACA,MAAOH,GACH,MAAMxF,EAAO4F,EAAmBJ,IAE1BK,eAAEA,EAAcC,wBAAEA,SAAkCC,OAAO,uBACjE,IAAwB,IAApB9G,EAAO+G,UACPhG,GAAMiG,MAAM,EAAG,MAAQH,GACvBpF,EACA,MAAO,CAAEV,WAAY6F,EAAe5G,EAAQ,CAAEe,OAAMU,QAExD,GAAIS,GAAyC,eAAvBnB,GAAMiG,MAAM,EAAG,IACjC,MAAM,IAAIC,EAAoC,CAAEhG,YACpD,MAAMiG,EAAaX,EAAK,IACjBtG,EACHC,UACAiD,MAAOnD,EAAOmD,OAEtB,CACJ,CAsFA,SAAShB,EAAgCC,GACrC,MAAMtB,KAAEA,EAAIC,KAAEA,GAASqB,EACvB,OAAOC,EAAiB,CACpBC,IAAKC,EAAS,CAAC,8BACfC,SAAU2E,EACVlH,KAAM,CAACa,EAAMC,IAErB,CAUO,SAAS4F,EAAmBJ,GAC/B,KAAMA,aAAexE,GACjB,OACJ,MAAMqF,EAAQb,EAAIc,OAClB,MAA8B,iBAAhBD,GAAOrG,KAAoBqG,EAAMrG,MAAMA,KAAOqG,EAAMrG,IACtE","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseAccount as t}from"../../accounts/utils/parseAccount.js";import{numberToHex as s}from"../../utils/encoding/toHex.js";import{getCallError as a}from"../../utils/errors/getCallError.js";import{extract as e}from"../../utils/formatters/extract.js";import{formatTransactionRequest as r}from"../../utils/formatters/transactionRequest.js";import{assertRequest as o}from"../../utils/transaction/assertRequest.js";async function c(c,i){const{account:m=c.account,blockNumber:n,blockTag:u="latest",blobs:l,data:f,gas:g,gasPrice:b,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:P,to:x,value:h,...j}=i,F=m?t(m):void 0;try{o(i);const t=("bigint"==typeof n?s(n):void 0)||u,a=c.chain?.formatters?.transactionRequest?.format,m=(a||r)({...e(j,{format:a}),from:F?.address,blobs:l,data:f,gas:g,gasPrice:b,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:P,to:x,value:h}),G=await c.request({method:"eth_createAccessList",params:[m,t]});return{accessList:G.accessList,gasUsed:BigInt(G.gasUsed)}}catch(t){throw a(t,{...i,account:F,chain:c.chain})}}export{c as createAccessList};
|
|
2
|
+
//# sourceMappingURL=createAccessList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAccessList.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/createAccessList.js"],"sourcesContent":["import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getCallError, } from '../../utils/errors/getCallError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { assertRequest } from '../../utils/transaction/assertRequest.js';\n/**\n * Creates an EIP-2930 access list.\n *\n * - Docs: https://viem.sh/docs/actions/public/createAccessList\n * - JSON-RPC Methods: `eth_createAccessList`\n *\n * @param client - Client to use\n * @param parameters - {@link CreateAccessListParameters}\n * @returns The access list. {@link CreateAccessListReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createAccessList } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const data = await createAccessList(client, {\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * })\n */\nexport async function createAccessList(client, args) {\n const { account: account_ = client.account, blockNumber, blockTag = 'latest', blobs, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, to, value, ...rest } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n try {\n assertRequest(args);\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const chainFormat = client.chain?.formatters?.transactionRequest?.format;\n const format = chainFormat || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format: chainFormat }),\n from: account?.address,\n blobs,\n data,\n gas,\n gasPrice,\n maxFeePerBlobGas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n to,\n value,\n });\n const response = await client.request({\n method: 'eth_createAccessList',\n params: [request, block],\n });\n return {\n accessList: response.accessList,\n gasUsed: BigInt(response.gasUsed),\n };\n }\n catch (err) {\n throw getCallError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n//# sourceMappingURL=createAccessList.js.map"],"names":["async","createAccessList","client","args","account","account_","blockNumber","blockTag","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","to","value","rest","parseAccount","undefined","assertRequest","block","numberToHex","chainFormat","chain","formatters","transactionRequest","format","request","formatTransactionRequest","extract","from","address","response","method","params","accessList","gasUsed","BigInt","err","getCallError"],"mappings":"+ZA+BOA,eAAeC,EAAiBC,EAAQC,GAC3C,MAAQC,QAASC,EAAWH,EAAOE,QAAOE,YAAEA,EAAWC,SAAEA,EAAW,SAAQC,MAAEA,EAAKC,KAAEA,EAAIC,IAAEA,EAAGC,SAAEA,EAAQC,iBAAEA,EAAgBC,aAAEA,EAAYC,qBAAEA,EAAoBC,GAAEA,EAAEC,MAAEA,KAAUC,GAASd,EACjLC,EAAUC,EAAWa,EAAab,QAAYc,EACpD,IACIC,EAAcjB,GACd,MACMkB,GADwC,iBAAhBf,EAA2BgB,EAAYhB,QAAea,IACpDZ,EAC1BgB,EAAcrB,EAAOsB,OAAOC,YAAYC,oBAAoBC,OAE5DC,GADSL,GAAeM,GACP,IAEhBC,EAAQb,EAAM,CAAEU,OAAQJ,IAC3BQ,KAAM3B,GAAS4B,QACfxB,QACAC,OACAC,MACAC,WACAC,mBACAC,eACAC,uBACAC,KACAC,UAEEiB,QAAiB/B,EAAO0B,QAAQ,CAClCM,OAAQ,uBACRC,OAAQ,CAACP,EAASP,KAEtB,MAAO,CACHe,WAAYH,EAASG,WACrBC,QAASC,OAAOL,EAASI,SAEjC,CACA,MAAOE,GACH,MAAMC,EAAaD,EAAK,IACjBpC,EACHC,UACAoB,MAAOtB,EAAOsB,OAEtB,CACJ","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createFilterRequestScope as e}from"../../utils/filters/createFilterRequestScope.js";async function t(t){const r=e(t,{method:"eth_newBlockFilter"}),o=await t.request({method:"eth_newBlockFilter"});return{id:o,request:r(o),type:"block"}}export{t as createBlockFilter};
|
|
2
|
+
//# sourceMappingURL=createBlockFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBlockFilter.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/createBlockFilter.js"],"sourcesContent":["import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).\n *\n * - Docs: https://viem.sh/docs/actions/public/createBlockFilter\n * - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'block' }\n */\nexport async function createBlockFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newBlockFilter',\n });\n const id = await client.request({\n method: 'eth_newBlockFilter',\n });\n return { id, request: getRequest(id), type: 'block' };\n}\n//# sourceMappingURL=createBlockFilter.js.map"],"names":["async","createBlockFilter","client","getRequest","createFilterRequestScope","method","id","request","type"],"mappings":"2FAsBOA,eAAeC,EAAkBC,GACpC,MAAMC,EAAaC,EAAyBF,EAAQ,CAChDG,OAAQ,uBAENC,QAAWJ,EAAOK,QAAQ,CAC5BF,OAAQ,uBAEZ,MAAO,CAAEC,KAAIC,QAASJ,EAAWG,GAAKE,KAAM,QAChD","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{encodeEventTopics as e}from"../../utils/abi/encodeEventTopics.js";import{numberToHex as t}from"../../utils/encoding/toHex.js";import{createFilterRequestScope as o}from"../../utils/filters/createFilterRequestScope.js";async function i(i,r){const{address:s,abi:a,args:n,eventName:c,fromBlock:m,strict:l,toBlock:p}=r,d=o(i,{method:"eth_newFilter"}),f=c?e({abi:a,args:n,eventName:c}):void 0,u=await i.request({method:"eth_newFilter",params:[{address:s,fromBlock:"bigint"==typeof m?t(m):m,toBlock:"bigint"==typeof p?t(p):p,topics:f}]});return{abi:a,args:n,eventName:c,id:u,request:d(u),strict:Boolean(l),type:"event"}}export{i as createContractEventFilter};
|
|
2
|
+
//# sourceMappingURL=createContractEventFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createContractEventFilter.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/createContractEventFilter.js"],"sourcesContent":["import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs).\n *\n * - Docs: https://viem.sh/docs/contract/createContractEventFilter\n *\n * @param client - Client to use\n * @param parameters - {@link CreateContractEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateContractEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * })\n */\nexport async function createContractEventFilter(client, parameters) {\n const { address, abi, args, eventName, fromBlock, strict, toBlock } = parameters;\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n const topics = eventName\n ? encodeEventTopics({\n abi,\n args,\n eventName,\n })\n : undefined;\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n topics,\n },\n ],\n });\n return {\n abi,\n args,\n eventName,\n id,\n request: getRequest(id),\n strict: Boolean(strict),\n type: 'event',\n };\n}\n//# sourceMappingURL=createContractEventFilter.js.map"],"names":["async","createContractEventFilter","client","parameters","address","abi","args","eventName","fromBlock","strict","toBlock","getRequest","createFilterRequestScope","method","topics","encodeEventTopics","undefined","id","request","params","numberToHex","Boolean","type"],"mappings":"gOAyBOA,eAAeC,EAA0BC,EAAQC,GACpD,MAAMC,QAAEA,EAAOC,IAAEA,EAAGC,KAAEA,EAAIC,UAAEA,EAASC,UAAEA,EAASC,OAAEA,EAAMC,QAAEA,GAAYP,EAChEQ,EAAaC,EAAyBV,EAAQ,CAChDW,OAAQ,kBAENC,EAASP,EACTQ,EAAkB,CAChBV,MACAC,OACAC,mBAEFS,EACAC,QAAWf,EAAOgB,QAAQ,CAC5BL,OAAQ,gBACRM,OAAQ,CACJ,CACIf,UACAI,UAAgC,iBAAdA,EAAyBY,EAAYZ,GAAaA,EACpEE,QAA4B,iBAAZA,EAAuBU,EAAYV,GAAWA,EAC9DI,aAIZ,MAAO,CACHT,MACAC,OACAC,YACAU,KACAC,QAASP,EAAWM,GACpBR,OAAQY,QAAQZ,GAChBa,KAAM,QAEd","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{encodeEventTopics as e}from"../../utils/abi/encodeEventTopics.js";import{numberToHex as t}from"../../utils/encoding/toHex.js";import{createFilterRequestScope as o}from"../../utils/filters/createFilterRequestScope.js";async function i(i,{address:r,args:s,event:n,events:a,fromBlock:c,strict:l,toBlock:m}={}){const f=a??(n?[n]:void 0),p=o(i,{method:"eth_newFilter"});let d=[];if(f){const t=f.flatMap(t=>e({abi:[t],eventName:t.name,args:s}));d=[t],n&&(d=d[0])}const u=await i.request({method:"eth_newFilter",params:[{address:r,fromBlock:"bigint"==typeof c?t(c):c,toBlock:"bigint"==typeof m?t(m):m,...d.length?{topics:d}:{}}]});return{abi:f,args:s,eventName:n?n.name:void 0,fromBlock:c,id:u,request:p(u),strict:Boolean(l),toBlock:m,type:"event"}}export{i as createEventFilter};
|
|
2
|
+
//# sourceMappingURL=createEventFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEventFilter.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/createEventFilter.js"],"sourcesContent":["import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).\n *\n * - Docs: https://viem.sh/docs/actions/public/createEventFilter\n * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)\n *\n * @param client - Client to use\n * @param parameters - {@link CreateEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',\n * })\n */\nexport async function createEventFilter(client, { address, args, event, events: events_, fromBlock, strict, toBlock, } = {}) {\n const events = events_ ?? (event ? [event] : undefined);\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n let topics = [];\n if (events) {\n const encoded = events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n }));\n // TODO: Clean up type casting\n topics = [encoded];\n if (event)\n topics = topics[0];\n }\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n ...(topics.length ? { topics } : {}),\n },\n ],\n });\n return {\n abi: events,\n args,\n eventName: event ? event.name : undefined,\n fromBlock,\n id,\n request: getRequest(id),\n strict: Boolean(strict),\n toBlock,\n type: 'event',\n };\n}\n//# sourceMappingURL=createEventFilter.js.map"],"names":["async","createEventFilter","client","address","args","event","events","events_","fromBlock","strict","toBlock","undefined","getRequest","createFilterRequestScope","method","topics","encoded","flatMap","encodeEventTopics","abi","eventName","name","id","request","params","numberToHex","length","Boolean","type"],"mappings":"gOA0BOA,eAAeC,EAAkBC,GAAQC,QAAEA,EAAOC,KAAEA,EAAIC,MAAEA,EAAOC,OAAQC,EAAOC,UAAEA,EAASC,OAAEA,EAAMC,QAAEA,GAAa,CAAA,GACrH,MAAMJ,EAASC,IAAYF,EAAQ,CAACA,QAASM,GACvCC,EAAaC,EAAyBX,EAAQ,CAChDY,OAAQ,kBAEZ,IAAIC,EAAS,GACb,GAAIT,EAAQ,CACR,MAAMU,EAAUV,EAAOW,QAASZ,GAAUa,EAAkB,CACxDC,IAAK,CAACd,GACNe,UAAWf,EAAMgB,KACjBjB,UAGJW,EAAS,CAACC,GACNX,IACAU,EAASA,EAAO,GACxB,CACA,MAAMO,QAAWpB,EAAOqB,QAAQ,CAC5BT,OAAQ,gBACRU,OAAQ,CACJ,CACIrB,UACAK,UAAgC,iBAAdA,EAAyBiB,EAAYjB,GAAaA,EACpEE,QAA4B,iBAAZA,EAAuBe,EAAYf,GAAWA,KAC1DK,EAAOW,OAAS,CAAEX,UAAW,CAAA,MAI7C,MAAO,CACHI,IAAKb,EACLF,OACAgB,UAAWf,EAAQA,EAAMgB,UAAOV,EAChCH,YACAc,KACAC,QAASX,EAAWU,GACpBb,OAAQkB,QAAQlB,GAChBC,UACAkB,KAAM,QAEd","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createFilterRequestScope as e}from"../../utils/filters/createFilterRequestScope.js";async function t(t){const n=e(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:n(r),type:"transaction"}}export{t as createPendingTransactionFilter};
|
|
2
|
+
//# sourceMappingURL=createPendingTransactionFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPendingTransactionFilter.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/createPendingTransactionFilter.js"],"sourcesContent":["import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).\n *\n * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter\n * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'transaction' }\n */\nexport async function createPendingTransactionFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newPendingTransactionFilter',\n });\n const id = await client.request({\n method: 'eth_newPendingTransactionFilter',\n });\n return { id, request: getRequest(id), type: 'transaction' };\n}\n//# sourceMappingURL=createPendingTransactionFilter.js.map"],"names":["async","createPendingTransactionFilter","client","getRequest","createFilterRequestScope","method","id","request","type"],"mappings":"2FAsBOA,eAAeC,EAA+BC,GACjD,MAAMC,EAAaC,EAAyBF,EAAQ,CAChDG,OAAQ,oCAENC,QAAWJ,EAAOK,QAAQ,CAC5BF,OAAQ,oCAEZ,MAAO,CAAEC,KAAIC,QAASJ,EAAWG,GAAKE,KAAM,cAChD","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseAccount as t}from"../../accounts/utils/parseAccount.js";import{encodeFunctionData as a}from"../../utils/abi/encodeFunctionData.js";import{getContractError as o}from"../../utils/errors/getContractError.js";import{getAction as r}from"../../utils/getAction.js";import{estimateGas as s}from"./estimateGas.js";async function c(c,i){const{abi:e,address:n,args:m,functionName:u,dataSuffix:d,...f}=i,p=a({abi:e,args:m,functionName:u});try{return await r(c,s,"estimateGas")({data:`${p}${d?d.replace("0x",""):""}`,to:n,...f})}catch(a){const r=f.account?t(f.account):void 0;throw o(a,{abi:e,address:n,args:m,docsPath:"/docs/contract/estimateContractGas",functionName:u,sender:r?.address})}}export{c as estimateContractGas};
|
|
2
|
+
//# sourceMappingURL=estimateContractGas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateContractGas.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/estimateContractGas.js"],"sourcesContent":["import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError, } from '../../utils/errors/getContractError.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { estimateGas, } from './estimateGas.js';\n/**\n * Estimates the gas required to successfully execute a contract write function call.\n *\n * - Docs: https://viem.sh/docs/contract/estimateContractGas\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateContractGasParameters}\n * @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateContractGas } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gas = await estimateContractGas(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint() public']),\n * functionName: 'mint',\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * })\n */\nexport async function estimateContractGas(client, parameters) {\n const { abi, address, args, functionName, dataSuffix, ...request } = parameters;\n const data = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const gas = await getAction(client, estimateGas, 'estimateGas')({\n data: `${data}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n to: address,\n ...request,\n });\n return gas;\n }\n catch (error) {\n const account = request.account ? parseAccount(request.account) : undefined;\n throw getContractError(error, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/estimateContractGas',\n functionName,\n sender: account?.address,\n });\n }\n}\n//# sourceMappingURL=estimateContractGas.js.map"],"names":["async","estimateContractGas","client","parameters","abi","address","args","functionName","dataSuffix","request","data","encodeFunctionData","getAction","estimateGas","replace","to","error","account","parseAccount","undefined","getContractError","docsPath","sender"],"mappings":"6TAgCOA,eAAeC,EAAoBC,EAAQC,GAC9C,MAAMC,IAAEA,EAAGC,QAAEA,EAAOC,KAAEA,EAAIC,aAAEA,EAAYC,WAAEA,KAAeC,GAAYN,EAC/DO,EAAOC,EAAmB,CAC5BP,MACAE,OACAC,iBAEJ,IAMI,aALkBK,EAAUV,EAAQW,EAAa,cAA/BD,CAA8C,CAC5DF,KAAM,GAAGA,IAAOF,EAAaA,EAAWM,QAAQ,KAAM,IAAM,KAC5DC,GAAIV,KACDI,GAGX,CACA,MAAOO,GACH,MAAMC,EAAUR,EAAQQ,QAAUC,EAAaT,EAAQQ,cAAWE,EAClE,MAAMC,EAAiBJ,EAAO,CAC1BZ,MACAC,UACAC,OACAe,SAAU,qCACVd,eACAe,OAAQL,GAASZ,SAEzB,CACJ","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{BaseFeeScalarError as e,Eip1559FeesNotSupportedError as t}from"../../errors/fee.js";import{getAction as i}from"../../utils/getAction.js";import{internal_estimateMaxPriorityFeePerGas as r}from"./estimateMaxPriorityFeePerGas.js";import{getBlock as s}from"./getBlock.js";import{getGasPrice as a}from"./getGasPrice.js";async function o(e,t){return n(e,t)}async function n(o,n){const{block:c,chain:f=o.chain,request:l,type:m="eip1559"}=n||{},p=await(async()=>"function"==typeof f?.fees?.baseFeeMultiplier?f.fees.baseFeeMultiplier({block:c,client:o,request:l}):f?.fees?.baseFeeMultiplier??1.2)();if(p<1)throw new e;const u=10**(p.toString().split(".")[1]?.length??0),P=e=>e*BigInt(Math.ceil(p*u))/BigInt(u),y=c||await i(o,s,"getBlock")({});if("function"==typeof f?.fees?.estimateFeesPerGas){const e=await f.fees.estimateFeesPerGas({block:c,client:o,multiply:P,request:l,type:m});if(null!==e)return e}if("eip1559"===m){if("bigint"!=typeof y.baseFeePerGas)throw new t;const e="bigint"==typeof l?.maxPriorityFeePerGas?l.maxPriorityFeePerGas:await r(o,{block:y,chain:f,request:l}),i=P(y.baseFeePerGas);return{maxFeePerGas:l?.maxFeePerGas??i+e,maxPriorityFeePerGas:e}}return{gasPrice:l?.gasPrice??P(await i(o,a,"getGasPrice")({}))}}export{o as estimateFeesPerGas,n as internal_estimateFeesPerGas};
|
|
2
|
+
//# sourceMappingURL=estimateFeesPerGas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateFeesPerGas.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/estimateFeesPerGas.js"],"sourcesContent":["import { BaseFeeScalarError, Eip1559FeesNotSupportedError, } from '../../errors/fee.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { internal_estimateMaxPriorityFeePerGas, } from './estimateMaxPriorityFeePerGas.js';\nimport { getBlock } from './getBlock.js';\nimport { getGasPrice } from './getGasPrice.js';\n/**\n * Returns an estimate for the fees per gas (in wei) for a\n * transaction to be likely included in the next block.\n * Defaults to [`chain.fees.estimateFeesPerGas`](/docs/clients/chains#fees-estimatefeespergas) if set.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateFeesPerGasParameters}\n * @returns An estimate (in wei) for the fees per gas. {@link EstimateFeesPerGasReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateFeesPerGas } from 'viem/actions'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const maxPriorityFeePerGas = await estimateFeesPerGas(client)\n * // { maxFeePerGas: ..., maxPriorityFeePerGas: ... }\n */\nexport async function estimateFeesPerGas(client, args) {\n return internal_estimateFeesPerGas(client, args);\n}\nexport async function internal_estimateFeesPerGas(client, args) {\n const { block: block_, chain = client.chain, request, type = 'eip1559', } = args || {};\n const baseFeeMultiplier = await (async () => {\n if (typeof chain?.fees?.baseFeeMultiplier === 'function')\n return chain.fees.baseFeeMultiplier({\n block: block_,\n client,\n request,\n });\n return chain?.fees?.baseFeeMultiplier ?? 1.2;\n })();\n if (baseFeeMultiplier < 1)\n throw new BaseFeeScalarError();\n const decimals = baseFeeMultiplier.toString().split('.')[1]?.length ?? 0;\n const denominator = 10 ** decimals;\n const multiply = (base) => (base * BigInt(Math.ceil(baseFeeMultiplier * denominator))) /\n BigInt(denominator);\n const block = block_\n ? block_\n : await getAction(client, getBlock, 'getBlock')({});\n if (typeof chain?.fees?.estimateFeesPerGas === 'function') {\n const fees = (await chain.fees.estimateFeesPerGas({\n block: block_,\n client,\n multiply,\n request,\n type,\n }));\n if (fees !== null)\n return fees;\n }\n if (type === 'eip1559') {\n if (typeof block.baseFeePerGas !== 'bigint')\n throw new Eip1559FeesNotSupportedError();\n const maxPriorityFeePerGas = typeof request?.maxPriorityFeePerGas === 'bigint'\n ? request.maxPriorityFeePerGas\n : await internal_estimateMaxPriorityFeePerGas(client, {\n block: block,\n chain,\n request,\n });\n const baseFeePerGas = multiply(block.baseFeePerGas);\n const maxFeePerGas = request?.maxFeePerGas ?? baseFeePerGas + maxPriorityFeePerGas;\n return {\n maxFeePerGas,\n maxPriorityFeePerGas,\n };\n }\n const gasPrice = request?.gasPrice ??\n multiply(await getAction(client, getGasPrice, 'getGasPrice')({}));\n return {\n gasPrice,\n };\n}\n//# sourceMappingURL=estimateFeesPerGas.js.map"],"names":["async","estimateFeesPerGas","client","args","internal_estimateFeesPerGas","block","block_","chain","request","type","baseFeeMultiplier","fees","BaseFeeScalarError","denominator","toString","split","length","multiply","base","BigInt","Math","ceil","getAction","getBlock","baseFeePerGas","Eip1559FeesNotSupportedError","maxPriorityFeePerGas","internal_estimateMaxPriorityFeePerGas","maxFeePerGas","gasPrice","getGasPrice"],"mappings":"kUA4BOA,eAAeC,EAAmBC,EAAQC,GAC7C,OAAOC,EAA4BF,EAAQC,EAC/C,CACOH,eAAeI,EAA4BF,EAAQC,GACtD,MAAQE,MAAOC,EAAMC,MAAEA,EAAQL,EAAOK,MAAKC,QAAEA,EAAOC,KAAEA,EAAO,WAAeN,GAAQ,CAAA,EAC9EO,OAA0B,UACkB,mBAAnCH,GAAOI,MAAMD,kBACbH,EAAMI,KAAKD,kBAAkB,CAChCL,MAAOC,EACPJ,SACAM,YAEDD,GAAOI,MAAMD,mBAAqB,IAPb,GAShC,GAAIA,EAAoB,EACpB,MAAM,IAAIE,EACd,MACMC,EAAc,KADHH,EAAkBI,WAAWC,MAAM,KAAK,IAAIC,QAAU,GAEjEC,EAAYC,GAAUA,EAAOC,OAAOC,KAAKC,KAAKX,EAAoBG,IACpEM,OAAON,GACLR,EAAQC,SAEFgB,EAAUpB,EAAQqB,EAAU,WAA5BD,CAAwC,CAAA,GACpD,GAA+C,mBAApCf,GAAOI,MAAMV,mBAAmC,CACvD,MAAMU,QAAcJ,EAAMI,KAAKV,mBAAmB,CAC9CI,MAAOC,EACPJ,SACAe,WACAT,UACAC,SAEJ,GAAa,OAATE,EACA,OAAOA,CACf,CACA,GAAa,YAATF,EAAoB,CACpB,GAAmC,iBAAxBJ,EAAMmB,cACb,MAAM,IAAIC,EACd,MAAMC,EAAgE,iBAAlClB,GAASkB,qBACvClB,EAAQkB,2BACFC,EAAsCzB,EAAQ,CAClDG,MAAOA,EACPE,QACAC,YAEFgB,EAAgBP,EAASZ,EAAMmB,eAErC,MAAO,CACHI,aAFiBpB,GAASoB,cAAgBJ,EAAgBE,EAG1DA,uBAER,CAGA,MAAO,CACHG,SAHarB,GAASqB,UACtBZ,QAAeK,EAAUpB,EAAQ4B,EAAa,cAA/BR,CAA8C,CAAA,IAIrE","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseAccount as t}from"../../accounts/utils/parseAccount.js";import{BaseError as a}from"../../errors/base.js";import{recoverAuthorizationAddress as r}from"../../utils/authorization/recoverAuthorizationAddress.js";import{numberToHex as e}from"../../utils/encoding/toHex.js";import{getEstimateGasError as o}from"../../utils/errors/getEstimateGasError.js";import{extract as s}from"../../utils/formatters/extract.js";import{formatTransactionRequest as i}from"../../utils/formatters/transactionRequest.js";import{serializeStateOverride as n}from"../../utils/stateOverride.js";import{assertRequest as c}from"../../utils/transaction/assertRequest.js";import{prepareTransactionRequest as m}from"../wallet/prepareTransactionRequest.js";async function u(u,l){const{account:f=u.account}=l,d=f?t(f):void 0;try{const{accessList:t,authorizationList:o,blobs:f,blobVersionedHashes:h,blockNumber:p,blockTag:b,data:g,gas:j,gasPrice:x,maxFeePerBlobGas:P,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:G,value:y,stateOverride:q,...z}=await m(u,{...l,parameters:"local"===d?.type?void 0:["blobVersionedHashes"]}),F=("bigint"==typeof p?e(p):void 0)||b,L=n(q),H=await(async()=>z.to?z.to:o&&o.length>0?await r({authorization:o[0]}).catch(()=>{throw new a("`to` is required. Could not infer from `authorizationList`")}):void 0)();c(l);const R=u.chain?.formatters?.transactionRequest?.format,k=(R||i)({...s(z,{format:R}),from:d?.address,accessList:t,authorizationList:o,blobs:f,blobVersionedHashes:h,data:g,gas:j,gasPrice:x,maxFeePerBlobGas:P,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:G,to:H,value:y});return BigInt(await u.request({method:"eth_estimateGas",params:L?[k,F??u.experimental_blockTag??"latest",L]:F?[k,F]:[k]}))}catch(t){throw o(t,{...l,account:d,chain:u.chain})}}export{u as estimateGas};
|
|
2
|
+
//# sourceMappingURL=estimateGas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateGas.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/estimateGas.js"],"sourcesContent":["import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { BaseError } from '../../errors/base.js';\nimport { recoverAuthorizationAddress, } from '../../utils/authorization/recoverAuthorizationAddress.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getEstimateGasError, } from '../../utils/errors/getEstimateGasError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { serializeStateOverride } from '../../utils/stateOverride.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { prepareTransactionRequest, } from '../wallet/prepareTransactionRequest.js';\n/**\n * Estimates the gas necessary to complete a transaction without submitting it to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateGas\n * - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateGasParameters}\n * @returns The gas estimate (in gas units). {@link EstimateGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseEther } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateGas } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasEstimate = await estimateGas(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: parseEther('1'),\n * })\n */\nexport async function estimateGas(client, args) {\n const { account: account_ = client.account } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n try {\n const { accessList, authorizationList, blobs, blobVersionedHashes, blockNumber, blockTag, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, value, stateOverride, ...rest } = (await prepareTransactionRequest(client, {\n ...args,\n parameters: \n // Some RPC Providers do not compute versioned hashes from blobs. We will need\n // to compute them.\n account?.type === 'local' ? undefined : ['blobVersionedHashes'],\n }));\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const rpcStateOverride = serializeStateOverride(stateOverride);\n const to = await (async () => {\n // If `to` exists on the parameters, use that.\n if (rest.to)\n return rest.to;\n // If no `to` exists, and we are sending a EIP-7702 transaction, use the\n // address of the first authorization in the list.\n if (authorizationList && authorizationList.length > 0)\n return await recoverAuthorizationAddress({\n authorization: authorizationList[0],\n }).catch(() => {\n throw new BaseError('`to` is required. Could not infer from `authorizationList`');\n });\n // Otherwise, we are sending a deployment transaction.\n return undefined;\n })();\n assertRequest(args);\n const chainFormat = client.chain?.formatters?.transactionRequest?.format;\n const format = chainFormat || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format: chainFormat }),\n from: account?.address,\n accessList,\n authorizationList,\n blobs,\n blobVersionedHashes,\n data,\n gas,\n gasPrice,\n maxFeePerBlobGas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n });\n return BigInt(await client.request({\n method: 'eth_estimateGas',\n params: rpcStateOverride\n ? [\n request,\n block ?? client.experimental_blockTag ?? 'latest',\n rpcStateOverride,\n ]\n : block\n ? [request, block]\n : [request],\n }));\n }\n catch (err) {\n throw getEstimateGasError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n//# sourceMappingURL=estimateGas.js.map"],"names":["async","estimateGas","client","args","account","account_","parseAccount","undefined","accessList","authorizationList","blobs","blobVersionedHashes","blockNumber","blockTag","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","nonce","value","stateOverride","rest","prepareTransactionRequest","parameters","type","block","numberToHex","rpcStateOverride","serializeStateOverride","to","length","recoverAuthorizationAddress","authorization","catch","BaseError","assertRequest","chainFormat","chain","formatters","transactionRequest","format","request","formatTransactionRequest","extract","from","address","BigInt","method","params","experimental_blockTag","err","getEstimateGasError"],"mappings":"8tBAmCOA,eAAeC,EAAYC,EAAQC,GACtC,MAAQC,QAASC,EAAWH,EAAOE,SAAYD,EACzCC,EAAUC,EAAWC,EAAaD,QAAYE,EACpD,IACI,MAAMC,WAAEA,EAAUC,kBAAEA,EAAiBC,MAAEA,EAAKC,oBAAEA,EAAmBC,YAAEA,EAAWC,SAAEA,EAAQC,KAAEA,EAAIC,IAAEA,EAAGC,SAAEA,EAAQC,iBAAEA,EAAgBC,aAAEA,EAAYC,qBAAEA,EAAoBC,MAAEA,EAAKC,MAAEA,EAAKC,cAAEA,KAAkBC,SAAgBC,EAA0BtB,EAAQ,IAChPC,EACHsB,WAGkB,UAAlBrB,GAASsB,UAAmBnB,EAAY,CAAC,yBAGvCoB,GADwC,iBAAhBf,EAA2BgB,EAAYhB,QAAeL,IACpDM,EAC1BgB,EAAmBC,EAAuBR,GAC1CS,OAAW,UAETR,EAAKQ,GACER,EAAKQ,GAGZtB,GAAqBA,EAAkBuB,OAAS,QACnCC,EAA4B,CACrCC,cAAezB,EAAkB,KAClC0B,MAAM,KACL,MAAM,IAAIC,EAAU,qEAJ5B,EANa,GAejBC,EAAclC,GACd,MAAMmC,EAAcpC,EAAOqC,OAAOC,YAAYC,oBAAoBC,OAE5DC,GADSL,GAAeM,GACP,IAEhBC,EAAQtB,EAAM,CAAEmB,OAAQJ,IAC3BQ,KAAM1C,GAAS2C,QACfvC,aACAC,oBACAC,QACAC,sBACAG,OACAC,MACAC,WACAC,mBACAC,eACAC,uBACAC,QACAW,KACAV,UAEJ,OAAO2B,aAAa9C,EAAOyC,QAAQ,CAC/BM,OAAQ,kBACRC,OAAQrB,EACF,CACEc,EACAhB,GAASzB,EAAOiD,uBAAyB,SACzCtB,GAEFF,EACI,CAACgB,EAAShB,GACV,CAACgB,KAEnB,CACA,MAAOS,GACH,MAAMC,EAAoBD,EAAK,IACxBjD,EACHC,UACAmC,MAAOrC,EAAOqC,OAEtB,CACJ","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Eip1559FeesNotSupportedError as e}from"../../errors/fee.js";import{hexToBigInt as t}from"../../utils/encoding/fromHex.js";import{getAction as r}from"../../utils/getAction.js";import{getBlock as o}from"./getBlock.js";import{getGasPrice as i}from"./getGasPrice.js";async function s(e,t){return n(e,t)}async function n(s,n){const{block:a,chain:c=s.chain,request:f}=n||{};try{const e=c?.fees?.maxPriorityFeePerGas??c?.fees?.defaultPriorityFee;if("function"==typeof e){const t=a||await r(s,o,"getBlock")({}),i=await e({block:t,client:s,request:f});if(null===i)throw new Error;return i}if(void 0!==e)return e;const i=await s.request({method:"eth_maxPriorityFeePerGas"});return t(i)}catch{const[t,n]=await Promise.all([a?Promise.resolve(a):r(s,o,"getBlock")({}),r(s,i,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new e;const c=n-t.baseFeePerGas;return c<0n?0n:c}}export{s as estimateMaxPriorityFeePerGas,n as internal_estimateMaxPriorityFeePerGas};
|
|
2
|
+
//# sourceMappingURL=estimateMaxPriorityFeePerGas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateMaxPriorityFeePerGas.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/estimateMaxPriorityFeePerGas.js"],"sourcesContent":["import { Eip1559FeesNotSupportedError, } from '../../errors/fee.js';\nimport { hexToBigInt, } from '../../utils/encoding/fromHex.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { getBlock } from './getBlock.js';\nimport { getGasPrice } from './getGasPrice.js';\n/**\n * Returns an estimate for the max priority fee per gas (in wei) for a\n * transaction to be likely included in the next block.\n * Defaults to [`chain.fees.defaultPriorityFee`](/docs/clients/chains#fees-defaultpriorityfee) if set.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas\n *\n * @param client - Client to use\n * @returns An estimate (in wei) for the max priority fee per gas. {@link EstimateMaxPriorityFeePerGasReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateMaxPriorityFeePerGas } from 'viem/actions'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const maxPriorityFeePerGas = await estimateMaxPriorityFeePerGas(client)\n * // 10000000n\n */\nexport async function estimateMaxPriorityFeePerGas(client, args) {\n return internal_estimateMaxPriorityFeePerGas(client, args);\n}\nexport async function internal_estimateMaxPriorityFeePerGas(client, args) {\n const { block: block_, chain = client.chain, request } = args || {};\n try {\n const maxPriorityFeePerGas = chain?.fees?.maxPriorityFeePerGas ?? chain?.fees?.defaultPriorityFee;\n if (typeof maxPriorityFeePerGas === 'function') {\n const block = block_ || (await getAction(client, getBlock, 'getBlock')({}));\n const maxPriorityFeePerGas_ = await maxPriorityFeePerGas({\n block,\n client,\n request,\n });\n if (maxPriorityFeePerGas_ === null)\n throw new Error();\n return maxPriorityFeePerGas_;\n }\n if (typeof maxPriorityFeePerGas !== 'undefined')\n return maxPriorityFeePerGas;\n const maxPriorityFeePerGasHex = await client.request({\n method: 'eth_maxPriorityFeePerGas',\n });\n return hexToBigInt(maxPriorityFeePerGasHex);\n }\n catch {\n // If the RPC Provider does not support `eth_maxPriorityFeePerGas`\n // fall back to calculating it manually via `gasPrice - baseFeePerGas`.\n // See: https://github.com/ethereum/pm/issues/328#:~:text=eth_maxPriorityFeePerGas%20after%20London%20will%20effectively%20return%20eth_gasPrice%20%2D%20baseFee\n const [block, gasPrice] = await Promise.all([\n block_\n ? Promise.resolve(block_)\n : getAction(client, getBlock, 'getBlock')({}),\n getAction(client, getGasPrice, 'getGasPrice')({}),\n ]);\n if (typeof block.baseFeePerGas !== 'bigint')\n throw new Eip1559FeesNotSupportedError();\n const maxPriorityFeePerGas = gasPrice - block.baseFeePerGas;\n if (maxPriorityFeePerGas < 0n)\n return 0n;\n return maxPriorityFeePerGas;\n }\n}\n//# sourceMappingURL=estimateMaxPriorityFeePerGas.js.map"],"names":["async","estimateMaxPriorityFeePerGas","client","args","internal_estimateMaxPriorityFeePerGas","block","block_","chain","request","maxPriorityFeePerGas","fees","defaultPriorityFee","getAction","getBlock","maxPriorityFeePerGas_","Error","maxPriorityFeePerGasHex","method","hexToBigInt","gasPrice","Promise","all","resolve","getGasPrice","baseFeePerGas","Eip1559FeesNotSupportedError"],"mappings":"8QA2BOA,eAAeC,EAA6BC,EAAQC,GACvD,OAAOC,EAAsCF,EAAQC,EACzD,CACOH,eAAeI,EAAsCF,EAAQC,GAChE,MAAQE,MAAOC,EAAMC,MAAEA,EAAQL,EAAOK,MAAKC,QAAEA,GAAYL,GAAQ,CAAA,EACjE,IACI,MAAMM,EAAuBF,GAAOG,MAAMD,sBAAwBF,GAAOG,MAAMC,mBAC/E,GAAoC,mBAAzBF,EAAqC,CAC5C,MAAMJ,EAAQC,SAAiBM,EAAUV,EAAQW,EAAU,WAA5BD,CAAwC,CAAA,GACjEE,QAA8BL,EAAqB,CACrDJ,QACAH,SACAM,YAEJ,GAA8B,OAA1BM,EACA,MAAM,IAAIC,MACd,OAAOD,CACX,CACA,QAAoC,IAAzBL,EACP,OAAOA,EACX,MAAMO,QAAgCd,EAAOM,QAAQ,CACjDS,OAAQ,6BAEZ,OAAOC,EAAYF,EACvB,CACA,MAII,MAAOX,EAAOc,SAAkBC,QAAQC,IAAI,CACxCf,EACMc,QAAQE,QAAQhB,GAChBM,EAAUV,EAAQW,EAAU,WAA5BD,CAAwC,CAAA,GAC9CA,EAAUV,EAAQqB,EAAa,cAA/BX,CAA8C,CAAA,KAElD,GAAmC,iBAAxBP,EAAMmB,cACb,MAAM,IAAIC,EACd,MAAMhB,EAAuBU,EAAWd,EAAMmB,cAC9C,OAAIf,EAAuB,GAChB,GACJA,CACX,CACJ","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{numberToHex as t}from"../../utils/encoding/toHex.js";async function e(e,{address:o,blockNumber:a,blockTag:n=e.experimental_blockTag??"latest"}){const i="bigint"==typeof a?t(a):void 0,r=await e.request({method:"eth_getBalance",params:[o,i||n]});return BigInt(r)}export{e as getBalance};
|
|
2
|
+
//# sourceMappingURL=getBalance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBalance.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getBalance.js"],"sourcesContent":["import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the balance of an address in wei.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBalance\n * - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)\n *\n * You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther).\n *\n * ```ts\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * blockTag: 'safe'\n * })\n * const balanceAsEther = formatEther(balance)\n * // \"6.942\"\n * ```\n *\n * @param client - Client to use\n * @param parameters - {@link GetBalanceParameters}\n * @returns The balance of the address in wei. {@link GetBalanceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBalance } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n * // 10000000000000000000000n (wei)\n */\nexport async function getBalance(client, { address, blockNumber, blockTag = client.experimental_blockTag ?? 'latest', }) {\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const balance = await client.request({\n method: 'eth_getBalance',\n params: [address, blockNumberHex || blockTag],\n });\n return BigInt(balance);\n}\n//# sourceMappingURL=getBalance.js.map"],"names":["async","getBalance","client","address","blockNumber","blockTag","experimental_blockTag","blockNumberHex","numberToHex","undefined","balance","request","method","params","BigInt"],"mappings":"4DAoCOA,eAAeC,EAAWC,GAAQC,QAAEA,EAAOC,YAAEA,EAAWC,SAAEA,EAAWH,EAAOI,uBAAyB,WACxG,MAAMC,EAAwC,iBAAhBH,EAA2BI,EAAYJ,QAAeK,EAC9EC,QAAgBR,EAAOS,QAAQ,CACjCC,OAAQ,iBACRC,OAAQ,CAACV,EAASI,GAAkBF,KAExC,OAAOS,OAAOJ,EAClB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBlobBaseFee.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getBlobBaseFee.js"],"sourcesContent":["/**\n * Returns the base fee per blob gas in wei.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee\n * - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee)\n *\n * @param client - Client to use\n * @returns The blob base fee (in wei). {@link GetBlobBaseFeeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlobBaseFee } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const blobBaseFee = await getBlobBaseFee(client)\n */\nexport async function getBlobBaseFee(client) {\n const baseFee = await client.request({\n method: 'eth_blobBaseFee',\n });\n return BigInt(baseFee);\n}\n//# sourceMappingURL=getBlobBaseFee.js.map"],"names":["async","getBlobBaseFee","client","baseFee","request","method","BigInt"],"mappings":"AAoBOA,eAAeC,EAAeC,GACjC,MAAMC,QAAgBD,EAAOE,QAAQ,CACjCC,OAAQ,oBAEZ,OAAOC,OAAOH,EAClB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{BlockNotFoundError as o}from"../../errors/block.js";import{numberToHex as e}from"../../utils/encoding/toHex.js";import{formatBlock as t}from"../../utils/formatters/block.js";async function r(r,{blockHash:a,blockNumber:l,blockTag:s=r.experimental_blockTag??"latest",includeTransactions:c}={}){const m=c??!1,i=void 0!==l?e(l):void 0;let n=null;if(n=a?await r.request({method:"eth_getBlockByHash",params:[a,m]},{dedupe:!0}):await r.request({method:"eth_getBlockByNumber",params:[i||s,m]},{dedupe:Boolean(i)}),!n)throw new o({blockHash:a,blockNumber:l});return(r.chain?.formatters?.block?.format||t)(n)}export{r as getBlock};
|
|
2
|
+
//# sourceMappingURL=getBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBlock.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getBlock.js"],"sourcesContent":["import { BlockNotFoundError, } from '../../errors/block.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatBlock, } from '../../utils/formatters/block.js';\n/**\n * Returns information about a block at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlock\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockParameters}\n * @returns Information about the block. {@link GetBlockReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlock } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const block = await getBlock(client)\n */\nexport async function getBlock(client, { blockHash, blockNumber, blockTag = client.experimental_blockTag ?? 'latest', includeTransactions: includeTransactions_, } = {}) {\n const includeTransactions = includeTransactions_ ?? false;\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let block = null;\n if (blockHash) {\n block = await client.request({\n method: 'eth_getBlockByHash',\n params: [blockHash, includeTransactions],\n }, { dedupe: true });\n }\n else {\n block = await client.request({\n method: 'eth_getBlockByNumber',\n params: [blockNumberHex || blockTag, includeTransactions],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n if (!block)\n throw new BlockNotFoundError({ blockHash, blockNumber });\n const format = client.chain?.formatters?.block?.format || formatBlock;\n return format(block);\n}\n//# sourceMappingURL=getBlock.js.map"],"names":["async","getBlock","client","blockHash","blockNumber","blockTag","experimental_blockTag","includeTransactions","includeTransactions_","blockNumberHex","undefined","numberToHex","block","request","method","params","dedupe","Boolean","BlockNotFoundError","chain","formatters","format","formatBlock"],"mappings":"qLA2BOA,eAAeC,EAASC,GAAQC,UAAEA,EAASC,YAAEA,EAAWC,SAAEA,EAAWH,EAAOI,uBAAyB,SAAUC,oBAAqBC,GAA0B,CAAA,GACjK,MAAMD,EAAsBC,IAAwB,EAC9CC,OAAiCC,IAAhBN,EAA4BO,EAAYP,QAAeM,EAC9E,IAAIE,EAAQ,KAaZ,GAXIA,EADAT,QACcD,EAAOW,QAAQ,CACzBC,OAAQ,qBACRC,OAAQ,CAACZ,EAAWI,IACrB,CAAES,QAAQ,UAGCd,EAAOW,QAAQ,CACzBC,OAAQ,uBACRC,OAAQ,CAACN,GAAkBJ,EAAUE,IACtC,CAAES,OAAQC,QAAQR,MAEpBG,EACD,MAAM,IAAIM,EAAmB,CAAEf,YAAWC,gBAE9C,OADeF,EAAOiB,OAAOC,YAAYR,OAAOS,QAAUC,GAC5CV,EAClB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{withCache as e}from"../../utils/promise/withCache.js";async function c(c,{cacheTime:t=c.cacheTime}={}){const i=await e(()=>c.request({method:"eth_blockNumber"}),{cacheKey:(r=c.uid,`blockNumber.${r}`),cacheTime:t});var r;return BigInt(i)}export{c as getBlockNumber};
|
|
2
|
+
//# sourceMappingURL=getBlockNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBlockNumber.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getBlockNumber.js"],"sourcesContent":["import { getCache, withCache, } from '../../utils/promise/withCache.js';\nconst cacheKey = (id) => `blockNumber.${id}`;\n/** @internal */\nexport function getBlockNumberCache(id) {\n return getCache(cacheKey(id));\n}\n/**\n * Returns the number of the most recent block seen.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockNumber\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks\n * - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockNumberParameters}\n * @returns The number of the block. {@link GetBlockNumberReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockNumber } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const blockNumber = await getBlockNumber(client)\n * // 69420n\n */\nexport async function getBlockNumber(client, { cacheTime = client.cacheTime } = {}) {\n const blockNumberHex = await withCache(() => client.request({\n method: 'eth_blockNumber',\n }), { cacheKey: cacheKey(client.uid), cacheTime });\n return BigInt(blockNumberHex);\n}\n//# sourceMappingURL=getBlockNumber.js.map"],"names":["async","getBlockNumber","client","cacheTime","blockNumberHex","withCache","request","method","cacheKey","id","uid","BigInt"],"mappings":"6DA6BOA,eAAeC,EAAeC,GAAQC,UAAEA,EAAYD,EAAOC,WAAc,IAC5E,MAAMC,QAAuBC,EAAU,IAAMH,EAAOI,QAAQ,CACxDC,OAAQ,oBACR,CAAEC,UA/BQC,EA+BWP,EAAOQ,IA/BX,eAAeD,KA+BEN,cA/BzB,IAACM,EAgCd,OAAOE,OAAOP,EAClB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{hexToNumber as o}from"../../utils/encoding/fromHex.js";import{numberToHex as t}from"../../utils/encoding/toHex.js";async function e(e,{blockHash:a,blockNumber:n,blockTag:r="latest"}={}){const s=void 0!==n?t(n):void 0;let i;return i=a?await e.request({method:"eth_getBlockTransactionCountByHash",params:[a]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:Boolean(s)}),o(i)}export{e as getBlockTransactionCount};
|
|
2
|
+
//# sourceMappingURL=getBlockTransactionCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBlockTransactionCount.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getBlockTransactionCount.js"],"sourcesContent":["import { hexToNumber, } from '../../utils/encoding/fromHex.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of Transactions at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockTransactionCountParameters}\n * @returns The block transaction count. {@link GetBlockTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const count = await getBlockTransactionCount(client)\n */\nexport async function getBlockTransactionCount(client, { blockHash, blockNumber, blockTag = 'latest', } = {}) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let count;\n if (blockHash) {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByHash',\n params: [blockHash],\n }, { dedupe: true });\n }\n else {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByNumber',\n params: [blockNumberHex || blockTag],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n return hexToNumber(count);\n}\n//# sourceMappingURL=getBlockTransactionCount.js.map"],"names":["async","getBlockTransactionCount","client","blockHash","blockNumber","blockTag","blockNumberHex","undefined","numberToHex","count","request","method","params","dedupe","Boolean","hexToNumber"],"mappings":"0HAyBOA,eAAeC,EAAyBC,GAAQC,UAAEA,EAASC,YAAEA,EAAWC,SAAEA,EAAW,UAAc,IACtG,MAAMC,OAAiCC,IAAhBH,EAA4BI,EAAYJ,QAAeG,EAC9E,IAAIE,EAaJ,OAXIA,EADAN,QACcD,EAAOQ,QAAQ,CACzBC,OAAQ,qCACRC,OAAQ,CAACT,IACV,CAAEU,QAAQ,UAGCX,EAAOQ,QAAQ,CACzBC,OAAQ,uCACRC,OAAQ,CAACN,GAAkBD,IAC5B,CAAEQ,OAAQC,QAAQR,KAElBS,EAAYN,EACvB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getChainId.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getChainId.js"],"sourcesContent":["import { hexToNumber, } from '../../utils/encoding/fromHex.js';\n/**\n * Returns the chain ID associated with the current network.\n *\n * - Docs: https://viem.sh/docs/actions/public/getChainId\n * - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)\n *\n * @param client - Client to use\n * @returns The current chain ID. {@link GetChainIdReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getChainId } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const chainId = await getChainId(client)\n * // 1\n */\nexport async function getChainId(client) {\n const chainIdHex = await client.request({\n method: 'eth_chainId',\n }, { dedupe: true });\n return hexToNumber(chainIdHex);\n}\n//# sourceMappingURL=getChainId.js.map"],"names":["async","getChainId","client","chainIdHex","request","method","dedupe","hexToNumber"],"mappings":"8DAsBOA,eAAeC,EAAWC,GAC7B,MAAMC,QAAmBD,EAAOE,QAAQ,CACpCC,OAAQ,eACT,CAAEC,QAAQ,IACb,OAAOC,EAAYJ,EACvB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{numberToHex as e}from"../../utils/encoding/toHex.js";async function o(o,{address:t,blockNumber:a,blockTag:d="latest"}){const r=void 0!==a?e(a):void 0,s=await o.request({method:"eth_getCode",params:[t,r||d]},{dedupe:Boolean(r)});if("0x"!==s)return s}export{o as getCode};
|
|
2
|
+
//# sourceMappingURL=getCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCode.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getCode.js"],"sourcesContent":["import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Retrieves the bytecode at an address.\n *\n * - Docs: https://viem.sh/docs/contract/getCode\n * - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)\n *\n * @param client - Client to use\n * @param parameters - {@link GetCodeParameters}\n * @returns The contract's bytecode. {@link GetCodeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getCode } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getCode(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * })\n */\nexport async function getCode(client, { address, blockNumber, blockTag = 'latest' }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const hex = await client.request({\n method: 'eth_getCode',\n params: [address, blockNumberHex || blockTag],\n }, { dedupe: Boolean(blockNumberHex) });\n if (hex === '0x')\n return undefined;\n return hex;\n}\n//# sourceMappingURL=getCode.js.map"],"names":["async","getCode","client","address","blockNumber","blockTag","blockNumberHex","undefined","numberToHex","hex","request","method","params","dedupe","Boolean"],"mappings":"4DAwBOA,eAAeC,EAAQC,GAAQC,QAAEA,EAAOC,YAAEA,EAAWC,SAAEA,EAAW,WACrE,MAAMC,OAAiCC,IAAhBH,EAA4BI,EAAYJ,QAAeG,EACxEE,QAAYP,EAAOQ,QAAQ,CAC7BC,OAAQ,cACRC,OAAQ,CAACT,EAASG,GAAkBD,IACrC,CAAEQ,OAAQC,QAAQR,KACrB,GAAY,OAARG,EAEJ,OAAOA,CACX","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getAbiItem as t}from"../../utils/abi/getAbiItem.js";import{getAction as o}from"../../utils/getAction.js";import{getLogs as e}from"./getLogs.js";async function s(s,r){const{abi:i,address:a,args:c,blockHash:m,eventName:n,fromBlock:l,toBlock:g,strict:f}=r,b=n?t({abi:i,name:n}):void 0,d=b?void 0:i.filter(t=>"event"===t.type);return o(s,e,"getLogs")({address:a,args:c,blockHash:m,event:b,events:d,fromBlock:l,toBlock:g,strict:f})}export{s as getContractEvents};
|
|
2
|
+
//# sourceMappingURL=getContractEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getContractEvents.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getContractEvents.js"],"sourcesContent":["import { getAbiItem, } from '../../utils/abi/getAbiItem.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { getLogs, } from './getLogs.js';\n/**\n * Returns a list of event logs emitted by a contract.\n *\n * - Docs: https://viem.sh/docs/contract/getContractEvents#getcontractevents\n * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)\n *\n * @param client - Client to use\n * @param parameters - {@link GetContractEventsParameters}\n * @returns A list of event logs. {@link GetContractEventsReturnType}\n *\n * @example\n * import { createClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getContractEvents } from 'viem/public'\n * import { wagmiAbi } from './abi'\n *\n * const client = createClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const logs = await getContractEvents(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: wagmiAbi,\n * eventName: 'Transfer'\n * })\n */\nexport async function getContractEvents(client, parameters) {\n const { abi, address, args, blockHash, eventName, fromBlock, toBlock, strict, } = parameters;\n const event = eventName\n ? getAbiItem({ abi, name: eventName })\n : undefined;\n const events = !event\n ? abi.filter((x) => x.type === 'event')\n : undefined;\n return getAction(client, getLogs, 'getLogs')({\n address,\n args,\n blockHash,\n event,\n events,\n fromBlock,\n toBlock,\n strict,\n });\n}\n//# sourceMappingURL=getContractEvents.js.map"],"names":["async","getContractEvents","client","parameters","abi","address","args","blockHash","eventName","fromBlock","toBlock","strict","event","getAbiItem","name","undefined","events","filter","x","type","getAction","getLogs"],"mappings":"uJA6BOA,eAAeC,EAAkBC,EAAQC,GAC5C,MAAMC,IAAEA,EAAGC,QAAEA,EAAOC,KAAEA,EAAIC,UAAEA,EAASC,UAAEA,EAASC,UAAEA,EAASC,QAAEA,EAAOC,OAAEA,GAAYR,EAC5ES,EAAQJ,EACRK,EAAW,CAAET,MAAKU,KAAMN,SACxBO,EACAC,EAAUJ,OAEVG,EADAX,EAAIa,OAAQC,GAAiB,UAAXA,EAAEC,MAE1B,OAAOC,EAAUlB,EAAQmB,EAAS,UAA3BD,CAAsC,CACzCf,UACAC,OACAC,YACAK,QACAI,SACAP,YACAC,UACAC,UAER","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Eip712DomainNotFoundError as t}from"../../errors/eip712.js";import{getAction as n}from"../../utils/getAction.js";import{readContract as e}from"./readContract.js";async function a(a,o){const{address:i,factory:s,factoryData:c}=o;try{const[t,o,m,y,p,u,d]=await n(a,e,"readContract")({abi:r,address:i,functionName:"eip712Domain",factory:s,factoryData:c});return{domain:{name:o,version:m,chainId:Number(y),verifyingContract:p,salt:u},extensions:d,fields:t}}catch(n){const e=n;if("ContractFunctionExecutionError"===e.name&&"ContractFunctionZeroDataError"===e.cause.name)throw new t({address:i});throw e}}const r=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];export{a as getEip712Domain};
|
|
2
|
+
//# sourceMappingURL=getEip712Domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEip712Domain.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getEip712Domain.js"],"sourcesContent":["import { Eip712DomainNotFoundError, } from '../../errors/eip712.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract, } from './readContract.js';\n/**\n * Reads the EIP-712 domain from a contract, based on the ERC-5267 specification.\n *\n * @param client - A {@link Client} instance.\n * @param parameters - The parameters of the action. {@link GetEip712DomainParameters}\n * @returns The EIP-712 domain, fields, and extensions. {@link GetEip712DomainReturnType}\n *\n * @example\n * ```ts\n * import { createPublicClient, http, getEip712Domain } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const domain = await getEip712Domain(client, {\n * address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n * })\n * // {\n * // domain: {\n * // name: 'ExampleContract',\n * // version: '1',\n * // chainId: 1,\n * // verifyingContract: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n * // },\n * // fields: '0x0f',\n * // extensions: [],\n * // }\n * ```\n */\nexport async function getEip712Domain(client, parameters) {\n const { address, factory, factoryData } = parameters;\n try {\n const [fields, name, version, chainId, verifyingContract, salt, extensions,] = await getAction(client, readContract, 'readContract')({\n abi,\n address,\n functionName: 'eip712Domain',\n factory,\n factoryData,\n });\n return {\n domain: {\n name,\n version,\n chainId: Number(chainId),\n verifyingContract,\n salt,\n },\n extensions,\n fields,\n };\n }\n catch (e) {\n const error = e;\n if (error.name === 'ContractFunctionExecutionError' &&\n error.cause.name === 'ContractFunctionZeroDataError') {\n throw new Eip712DomainNotFoundError({ address });\n }\n throw error;\n }\n}\nconst abi = [\n {\n inputs: [],\n name: 'eip712Domain',\n outputs: [\n { name: 'fields', type: 'bytes1' },\n { name: 'name', type: 'string' },\n { name: 'version', type: 'string' },\n { name: 'chainId', type: 'uint256' },\n { name: 'verifyingContract', type: 'address' },\n { name: 'salt', type: 'bytes32' },\n { name: 'extensions', type: 'uint256[]' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\n//# sourceMappingURL=getEip712Domain.js.map"],"names":["async","getEip712Domain","client","parameters","address","factory","factoryData","fields","name","version","chainId","verifyingContract","salt","extensions","getAction","readContract","abi","functionName","domain","Number","e","error","cause","Eip712DomainNotFoundError","inputs","outputs","type","stateMutability"],"mappings":"yKAmCOA,eAAeC,EAAgBC,EAAQC,GAC1C,MAAMC,QAAEA,EAAOC,QAAEA,EAAOC,YAAEA,GAAgBH,EAC1C,IACI,MAAOI,EAAQC,EAAMC,EAASC,EAASC,EAAmBC,EAAMC,SAAqBC,EAAUZ,EAAQa,EAAc,eAAhCD,CAAgD,CACjIE,MACAZ,UACAa,aAAc,eACdZ,UACAC,gBAEJ,MAAO,CACHY,OAAQ,CACJV,OACAC,UACAC,QAASS,OAAOT,GAChBC,oBACAC,QAEJC,aACAN,SAER,CACA,MAAOa,GACH,MAAMC,EAAQD,EACd,GAAmB,mCAAfC,EAAMb,MACe,kCAArBa,EAAMC,MAAMd,KACZ,MAAM,IAAIe,EAA0B,CAAEnB,YAE1C,MAAMiB,CACV,CACJ,CACA,MAAML,EAAM,CACR,CACIQ,OAAQ,GACRhB,KAAM,eACNiB,QAAS,CACL,CAAEjB,KAAM,SAAUkB,KAAM,UACxB,CAAElB,KAAM,OAAQkB,KAAM,UACtB,CAAElB,KAAM,UAAWkB,KAAM,UACzB,CAAElB,KAAM,UAAWkB,KAAM,WACzB,CAAElB,KAAM,oBAAqBkB,KAAM,WACnC,CAAElB,KAAM,OAAQkB,KAAM,WACtB,CAAElB,KAAM,aAAckB,KAAM,cAEhCC,gBAAiB,OACjBD,KAAM","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{numberToHex as e}from"../../utils/encoding/toHex.js";import{formatFeeHistory as t}from"../../utils/formatters/feeHistory.js";async function o(o,{blockCount:r,blockNumber:i,blockTag:s="latest",rewardPercentiles:n}){const a="bigint"==typeof i?e(i):void 0,c=await o.request({method:"eth_feeHistory",params:[e(r),a||s,n]},{dedupe:Boolean(a)});return t(c)}export{o as getFeeHistory};
|
|
2
|
+
//# sourceMappingURL=getFeeHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFeeHistory.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getFeeHistory.js"],"sourcesContent":["import { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatFeeHistory, } from '../../utils/formatters/feeHistory.js';\n/**\n * Returns a collection of historical gas information.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFeeHistory\n * - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)\n *\n * @param client - Client to use\n * @param parameters - {@link GetFeeHistoryParameters}\n * @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getFeeHistory } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const feeHistory = await getFeeHistory(client, {\n * blockCount: 4,\n * rewardPercentiles: [25, 75],\n * })\n */\nexport async function getFeeHistory(client, { blockCount, blockNumber, blockTag = 'latest', rewardPercentiles, }) {\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const feeHistory = await client.request({\n method: 'eth_feeHistory',\n params: [\n numberToHex(blockCount),\n blockNumberHex || blockTag,\n rewardPercentiles,\n ],\n }, { dedupe: Boolean(blockNumberHex) });\n return formatFeeHistory(feeHistory);\n}\n//# sourceMappingURL=getFeeHistory.js.map"],"names":["async","getFeeHistory","client","blockCount","blockNumber","blockTag","rewardPercentiles","blockNumberHex","numberToHex","undefined","feeHistory","request","method","params","dedupe","Boolean","formatFeeHistory"],"mappings":"oIA0BOA,eAAeC,EAAcC,GAAQC,WAAEA,EAAUC,YAAEA,EAAWC,SAAEA,EAAW,SAAQC,kBAAEA,IACxF,MAAMC,EAAwC,iBAAhBH,EAA2BI,EAAYJ,QAAeK,EAC9EC,QAAmBR,EAAOS,QAAQ,CACpCC,OAAQ,iBACRC,OAAQ,CACJL,EAAYL,GACZI,GAAkBF,EAClBC,IAEL,CAAEQ,OAAQC,QAAQR,KACrB,OAAOS,EAAiBN,EAC5B","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseEventLogs as t}from"../../utils/abi/parseEventLogs.js";import{formatLog as i}from"../../utils/formatters/log.js";async function r(r,{filter:s}){const e="strict"in s&&s.strict,a=await s.request({method:"eth_getFilterChanges",params:[s.id]});if("string"==typeof a[0])return a;const o=a.map(t=>i(t));return"abi"in s&&s.abi?t({abi:s.abi,logs:o,strict:e}):o}export{r as getFilterChanges};
|
|
2
|
+
//# sourceMappingURL=getFilterChanges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFilterChanges.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getFilterChanges.js"],"sourcesContent":["import { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport { formatLog, } from '../../utils/formatters/log.js';\n/**\n * Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterChanges\n * - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)\n *\n * A Filter can be created from the following actions:\n *\n * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)\n * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)\n * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)\n * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)\n *\n * Depending on the type of filter, the return value will be different:\n *\n * - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.\n * - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.\n * - If the filter was created with `createBlockFilter`, it returns a list of block hashes.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterChangesParameters}\n * @returns Logs or hashes. {@link GetFilterChangesReturnType}\n *\n * @example\n * // Blocks\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n *\n * @example\n * // Contract Events\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * eventName: 'Transfer',\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Raw Events\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Transactions\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n */\nexport async function getFilterChanges(_client, { filter, }) {\n const strict = 'strict' in filter && filter.strict;\n const logs = await filter.request({\n method: 'eth_getFilterChanges',\n params: [filter.id],\n });\n if (typeof logs[0] === 'string')\n return logs;\n const formattedLogs = logs.map((log) => formatLog(log));\n if (!('abi' in filter) || !filter.abi)\n return formattedLogs;\n return parseEventLogs({\n abi: filter.abi,\n logs: formattedLogs,\n strict,\n });\n}\n//# sourceMappingURL=getFilterChanges.js.map"],"names":["async","getFilterChanges","_client","filter","strict","logs","request","method","params","id","formattedLogs","map","log","formatLog","abi","parseEventLogs"],"mappings":"6HAoFOA,eAAeC,EAAiBC,GAASC,OAAEA,IAC9C,MAAMC,EAAS,WAAYD,GAAUA,EAAOC,OACtCC,QAAaF,EAAOG,QAAQ,CAC9BC,OAAQ,uBACRC,OAAQ,CAACL,EAAOM,MAEpB,GAAuB,iBAAZJ,EAAK,GACZ,OAAOA,EACX,MAAMK,EAAgBL,EAAKM,IAAKC,GAAQC,EAAUD,IAClD,MAAM,QAAST,GAAYA,EAAOW,IAE3BC,EAAe,CAClBD,IAAKX,EAAOW,IACZT,KAAMK,EACNN,WAJOM,CAMf","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseEventLogs as t}from"../../utils/abi/parseEventLogs.js";import{formatLog as r}from"../../utils/formatters/log.js";async function i(i,{filter:s}){const o=s.strict??!1,a=(await s.request({method:"eth_getFilterLogs",params:[s.id]})).map(t=>r(t));return s.abi?t({abi:s.abi,logs:a,strict:o}):a}export{i as getFilterLogs};
|
|
2
|
+
//# sourceMappingURL=getFilterLogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFilterLogs.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getFilterLogs.js"],"sourcesContent":["import { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport { formatLog, } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs since the filter was created.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterLogs\n * - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)\n *\n * `getFilterLogs` is only compatible with **event filters**.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterLogsParameters}\n * @returns A list of event logs. {@link GetFilterLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterLogs(client, { filter })\n */\nexport async function getFilterLogs(_client, { filter, }) {\n const strict = filter.strict ?? false;\n const logs = await filter.request({\n method: 'eth_getFilterLogs',\n params: [filter.id],\n });\n const formattedLogs = logs.map((log) => formatLog(log));\n if (!filter.abi)\n return formattedLogs;\n return parseEventLogs({\n abi: filter.abi,\n logs: formattedLogs,\n strict,\n });\n}\n//# sourceMappingURL=getFilterLogs.js.map"],"names":["async","getFilterLogs","_client","filter","strict","formattedLogs","request","method","params","id","map","log","formatLog","abi","parseEventLogs","logs"],"mappings":"6HA6BOA,eAAeC,EAAcC,GAASC,OAAEA,IAC3C,MAAMC,EAASD,EAAOC,SAAU,EAK1BC,SAJaF,EAAOG,QAAQ,CAC9BC,OAAQ,oBACRC,OAAQ,CAACL,EAAOM,OAEOC,IAAKC,GAAQC,EAAUD,IAClD,OAAKR,EAAOU,IAELC,EAAe,CAClBD,IAAKV,EAAOU,IACZE,KAAMV,EACND,WAJOC,CAMf","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGasPrice.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getGasPrice.js"],"sourcesContent":["/**\n * Returns the current price of gas (in wei).\n *\n * - Docs: https://viem.sh/docs/actions/public/getGasPrice\n * - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)\n *\n * @param client - Client to use\n * @returns The gas price (in wei). {@link GetGasPriceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getGasPrice } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasPrice = await getGasPrice(client)\n */\nexport async function getGasPrice(client) {\n const gasPrice = await client.request({\n method: 'eth_gasPrice',\n });\n return BigInt(gasPrice);\n}\n//# sourceMappingURL=getGasPrice.js.map"],"names":["async","getGasPrice","client","gasPrice","request","method","BigInt"],"mappings":"AAoBOA,eAAeC,EAAYC,GAC9B,MAAMC,QAAiBD,EAAOE,QAAQ,CAClCC,OAAQ,iBAEZ,OAAOC,OAAOH,EAClB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{encodeEventTopics as t}from"../../utils/abi/encodeEventTopics.js";import{parseEventLogs as o}from"../../utils/abi/parseEventLogs.js";import{numberToHex as s}from"../../utils/encoding/toHex.js";import{formatLog as e}from"../../utils/formatters/log.js";async function a(a,{address:i,blockHash:r,fromBlock:c,toBlock:m,event:n,events:p,args:l,strict:g}={}){const d=g??!1,f=p??(n?[n]:void 0);let b,u=[];if(f){const o=f.flatMap(o=>t({abi:[o],eventName:o.name,args:p?void 0:l}));u=[o],n&&(u=u[0])}b=r?await a.request({method:"eth_getLogs",params:[{address:i,topics:u,blockHash:r}]}):await a.request({method:"eth_getLogs",params:[{address:i,topics:u,fromBlock:"bigint"==typeof c?s(c):c,toBlock:"bigint"==typeof m?s(m):m}]});const v=b.map(t=>e(t));return f?o({abi:f,args:l,logs:v,strict:d}):v}export{a as getLogs};
|
|
2
|
+
//# sourceMappingURL=getLogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLogs.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getLogs.js"],"sourcesContent":["import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatLog, } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs matching the provided parameters.\n *\n * - Docs: https://viem.sh/docs/actions/public/getLogs\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/logs_event-logs\n * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)\n *\n * @param client - Client to use\n * @param parameters - {@link GetLogsParameters}\n * @returns A list of event logs. {@link GetLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const logs = await getLogs(client)\n */\nexport async function getLogs(client, { address, blockHash, fromBlock, toBlock, event, events: events_, args, strict: strict_, } = {}) {\n const strict = strict_ ?? false;\n const events = events_ ?? (event ? [event] : undefined);\n let topics = [];\n if (events) {\n const encoded = events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args: events_ ? undefined : args,\n }));\n // TODO: Clean up type casting\n topics = [encoded];\n if (event)\n topics = topics[0];\n }\n let logs;\n if (blockHash) {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [{ address, topics, blockHash }],\n });\n }\n else {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [\n {\n address,\n topics,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n },\n ],\n });\n }\n const formattedLogs = logs.map((log) => formatLog(log));\n if (!events)\n return formattedLogs;\n return parseEventLogs({\n abi: events,\n args: args,\n logs: formattedLogs,\n strict,\n });\n}\n//# sourceMappingURL=getLogs.js.map"],"names":["async","getLogs","client","address","blockHash","fromBlock","toBlock","event","events","events_","args","strict","strict_","undefined","logs","topics","encoded","flatMap","encodeEventTopics","abi","eventName","name","request","method","params","numberToHex","formattedLogs","map","log","formatLog","parseEventLogs"],"mappings":"kQA0BOA,eAAeC,EAAQC,GAAQC,QAAEA,EAAOC,UAAEA,EAASC,UAAEA,EAASC,QAAEA,EAAOC,MAAEA,EAAOC,OAAQC,EAAOC,KAAEA,EAAMC,OAAQC,GAAa,CAAA,GAC/H,MAAMD,EAASC,IAAW,EACpBJ,EAASC,IAAYF,EAAQ,CAACA,QAASM,GAC7C,IAYIC,EAZAC,EAAS,GACb,GAAIP,EAAQ,CACR,MAAMQ,EAAUR,EAAOS,QAASV,GAAUW,EAAkB,CACxDC,IAAK,CAACZ,GACNa,UAAWb,EAAMc,KACjBX,KAAMD,OAAUI,EAAYH,KAGhCK,EAAS,CAACC,GACNT,IACAQ,EAASA,EAAO,GACxB,CAGID,EADAV,QACaF,EAAOoB,QAAQ,CACxBC,OAAQ,cACRC,OAAQ,CAAC,CAAErB,UAASY,SAAQX,sBAInBF,EAAOoB,QAAQ,CACxBC,OAAQ,cACRC,OAAQ,CACJ,CACIrB,UACAY,SACAV,UAAgC,iBAAdA,EAAyBoB,EAAYpB,GAAaA,EACpEC,QAA4B,iBAAZA,EAAuBmB,EAAYnB,GAAWA,MAK9E,MAAMoB,EAAgBZ,EAAKa,IAAKC,GAAQC,EAAUD,IAClD,OAAKpB,EAEEsB,EAAe,CAClBX,IAAKX,EACLE,KAAMA,EACNI,KAAMY,EACNf,WALOe,CAOf","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{numberToHex as o}from"../../utils/encoding/toHex.js";import{formatProof as t}from"../../utils/formatters/proof.js";async function r(r,{address:e,blockNumber:s,blockTag:a,storageKeys:i}){const m=a??"latest",n=void 0!==s?o(s):void 0,c=await r.request({method:"eth_getProof",params:[e,i,n||m]});return t(c)}export{r as getProof};
|
|
2
|
+
//# sourceMappingURL=getProof.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProof.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getProof.js"],"sourcesContent":["import { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatProof, } from '../../utils/formatters/proof.js';\n/**\n * Returns the account and storage values of the specified account including the Merkle-proof.\n *\n * - Docs: https://viem.sh/docs/actions/public/getProof\n * - JSON-RPC Methods:\n * - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186)\n *\n * @param client - Client to use\n * @param parameters - {@link GetProofParameters}\n * @returns Proof data. {@link GetProofReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getProof } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const block = await getProof(client, {\n * address: '0x...',\n * storageKeys: ['0x...'],\n * })\n */\nexport async function getProof(client, { address, blockNumber, blockTag: blockTag_, storageKeys, }) {\n const blockTag = blockTag_ ?? 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const proof = await client.request({\n method: 'eth_getProof',\n params: [address, storageKeys, blockNumberHex || blockTag],\n });\n return formatProof(proof);\n}\n//# sourceMappingURL=getProof.js.map"],"names":["async","getProof","client","address","blockNumber","blockTag","blockTag_","storageKeys","blockNumberHex","undefined","numberToHex","proof","request","method","params","formatProof"],"mappings":"0HA2BOA,eAAeC,EAASC,GAAQC,QAAEA,EAAOC,YAAEA,EAAaC,SAAUC,EAASC,YAAEA,IAChF,MAAMF,EAAWC,GAAa,SACxBE,OAAiCC,IAAhBL,EAA4BM,EAAYN,QAAeK,EACxEE,QAAcT,EAAOU,QAAQ,CAC/BC,OAAQ,eACRC,OAAQ,CAACX,EAASI,EAAaC,GAAkBH,KAErD,OAAOU,EAAYJ,EACvB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{numberToHex as t}from"../../utils/encoding/toHex.js";async function o(o,{address:e,blockNumber:r,blockTag:s="latest",slot:a}){const i=void 0!==r?t(r):void 0;return await o.request({method:"eth_getStorageAt",params:[e,a,i||s]})}export{o as getStorageAt};
|
|
2
|
+
//# sourceMappingURL=getStorageAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getStorageAt.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getStorageAt.js"],"sourcesContent":["import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the value from a storage slot at a given address.\n *\n * - Docs: https://viem.sh/docs/contract/getStorageAt\n * - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)\n *\n * @param client - Client to use\n * @param parameters - {@link GetStorageAtParameters}\n * @returns The value of the storage slot. {@link GetStorageAtReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getStorageAt } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getStorageAt(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * slot: toHex(0),\n * })\n */\nexport async function getStorageAt(client, { address, blockNumber, blockTag = 'latest', slot }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const data = await client.request({\n method: 'eth_getStorageAt',\n params: [address, slot, blockNumberHex || blockTag],\n });\n return data;\n}\n//# sourceMappingURL=getStorageAt.js.map"],"names":["async","getStorageAt","client","address","blockNumber","blockTag","slot","blockNumberHex","undefined","numberToHex","request","method","params"],"mappings":"4DAyBOA,eAAeC,EAAaC,GAAQC,QAAEA,EAAOC,YAAEA,EAAWC,SAAEA,EAAW,SAAQC,KAAEA,IACpF,MAAMC,OAAiCC,IAAhBJ,EAA4BK,EAAYL,QAAeI,EAK9E,aAJmBN,EAAOQ,QAAQ,CAC9BC,OAAQ,mBACRC,OAAQ,CAACT,EAASG,EAAMC,GAAkBF,IAGlD","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TransactionNotFoundError as t}from"../../errors/transaction.js";import{numberToHex as a}from"../../utils/encoding/toHex.js";import{formatTransaction as e}from"../../utils/formatters/transaction.js";async function o(o,{blockHash:r,blockNumber:n,blockTag:s,hash:i,index:c}){const d=s||"latest",m=void 0!==n?a(n):void 0;let h=null;if(h=i?await o.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):r?await o.request({method:"eth_getTransactionByBlockHashAndIndex",params:[r,a(c)]},{dedupe:!0}):await o.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[m||d,a(c)]},{dedupe:Boolean(m)}),!h)throw new t({blockHash:r,blockNumber:n,blockTag:d,hash:i,index:c});return(o.chain?.formatters?.transaction?.format||e)(h)}export{o as getTransaction};
|
|
2
|
+
//# sourceMappingURL=getTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransaction.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getTransaction.js"],"sourcesContent":["import { TransactionNotFoundError, } from '../../errors/transaction.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatTransaction, } from '../../utils/formatters/transaction.js';\n/**\n * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransaction\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionParameters}\n * @returns The transaction information. {@link GetTransactionReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransaction } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transaction = await getTransaction(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransaction(client, { blockHash, blockNumber, blockTag: blockTag_, hash, index, }) {\n const blockTag = blockTag_ || 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let transaction = null;\n if (hash) {\n transaction = await client.request({\n method: 'eth_getTransactionByHash',\n params: [hash],\n }, { dedupe: true });\n }\n else if (blockHash) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockHashAndIndex',\n params: [blockHash, numberToHex(index)],\n }, { dedupe: true });\n }\n else if (blockNumberHex || blockTag) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockNumberAndIndex',\n params: [blockNumberHex || blockTag, numberToHex(index)],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n if (!transaction)\n throw new TransactionNotFoundError({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n });\n const format = client.chain?.formatters?.transaction?.format || formatTransaction;\n return format(transaction);\n}\n//# sourceMappingURL=getTransaction.js.map"],"names":["async","getTransaction","client","blockHash","blockNumber","blockTag","blockTag_","hash","index","blockNumberHex","undefined","numberToHex","transaction","request","method","params","dedupe","Boolean","TransactionNotFoundError","chain","formatters","format","formatTransaction"],"mappings":"6MA2BOA,eAAeC,EAAeC,GAAQC,UAAEA,EAASC,YAAEA,EAAaC,SAAUC,EAASC,KAAEA,EAAIC,MAAEA,IAC9F,MAAMH,EAAWC,GAAa,SACxBG,OAAiCC,IAAhBN,EAA4BO,EAAYP,QAAeM,EAC9E,IAAIE,EAAc,KAmBlB,GAjBIA,EADAL,QACoBL,EAAOW,QAAQ,CAC/BC,OAAQ,2BACRC,OAAQ,CAACR,IACV,CAAES,QAAQ,IAERb,QACeD,EAAOW,QAAQ,CAC/BC,OAAQ,wCACRC,OAAQ,CAACZ,EAAWQ,EAAYH,KACjC,CAAEQ,QAAQ,UAGOd,EAAOW,QAAQ,CAC/BC,OAAQ,0CACRC,OAAQ,CAACN,GAAkBJ,EAAUM,EAAYH,KAClD,CAAEQ,OAAQC,QAAQR,MAEpBG,EACD,MAAM,IAAIM,EAAyB,CAC/Bf,YACAC,cACAC,WACAE,OACAC,UAGR,OADeN,EAAOiB,OAAOC,YAAYR,aAAaS,QAAUC,GAClDV,EAClB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getAction as t}from"../../utils/getAction.js";import{getBlockNumber as o}from"./getBlockNumber.js";import{getTransaction as r}from"./getTransaction.js";async function e(e,{hash:n,transactionReceipt:i}){const[a,c]=await Promise.all([t(e,o,"getBlockNumber")({}),n?t(e,r,"getTransaction")({hash:n}):void 0]),s=i?.blockNumber||c?.blockNumber;return s?a-s+1n:0n}export{e as getTransactionConfirmations};
|
|
2
|
+
//# sourceMappingURL=getTransactionConfirmations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransactionConfirmations.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getTransactionConfirmations.js"],"sourcesContent":["import { getAction } from '../../utils/getAction.js';\nimport { getBlockNumber, } from './getBlockNumber.js';\nimport { getTransaction, } from './getTransaction.js';\n/**\n * Returns the number of blocks passed (confirmations) since the transaction was processed on a block.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionConfirmationsParameters}\n * @returns The number of blocks passed since the transaction was processed. If confirmations is 0, then the Transaction has not been confirmed & processed yet. {@link GetTransactionConfirmationsReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionConfirmations } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const confirmations = await getTransactionConfirmations(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionConfirmations(client, { hash, transactionReceipt }) {\n const [blockNumber, transaction] = await Promise.all([\n getAction(client, getBlockNumber, 'getBlockNumber')({}),\n hash\n ? getAction(client, getTransaction, 'getTransaction')({ hash })\n : undefined,\n ]);\n const transactionBlockNumber = transactionReceipt?.blockNumber || transaction?.blockNumber;\n if (!transactionBlockNumber)\n return 0n;\n return blockNumber - transactionBlockNumber + 1n;\n}\n//# sourceMappingURL=getTransactionConfirmations.js.map"],"names":["async","getTransactionConfirmations","client","hash","transactionReceipt","blockNumber","transaction","Promise","all","getAction","getBlockNumber","getTransaction","undefined","transactionBlockNumber"],"mappings":"+JA2BOA,eAAeC,EAA4BC,GAAQC,KAAEA,EAAIC,mBAAEA,IAC9D,MAAOC,EAAaC,SAAqBC,QAAQC,IAAI,CACjDC,EAAUP,EAAQQ,EAAgB,iBAAlCD,CAAoD,CAAA,GACpDN,EACMM,EAAUP,EAAQS,EAAgB,iBAAlCF,CAAoD,CAAEN,cACtDS,IAEJC,EAAyBT,GAAoBC,aAAeC,GAAaD,YAC/E,OAAKQ,EAEER,EAAcQ,EAAyB,GADnC,EAEf","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{hexToNumber as t}from"../../utils/encoding/fromHex.js";import{numberToHex as o}from"../../utils/encoding/toHex.js";async function e(e,{address:n,blockTag:r="latest",blockNumber:s}){const a=await e.request({method:"eth_getTransactionCount",params:[n,"bigint"==typeof s?o(s):r]},{dedupe:Boolean(s)});return t(a)}export{e as getTransactionCount};
|
|
2
|
+
//# sourceMappingURL=getTransactionCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransactionCount.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getTransactionCount.js"],"sourcesContent":["import { hexToNumber, } from '../../utils/encoding/fromHex.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has sent.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionCount\n * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionCountParameters}\n * @returns The number of transactions an account has sent. {@link GetTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionCount = await getTransactionCount(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function getTransactionCount(client, { address, blockTag = 'latest', blockNumber }) {\n const count = await client.request({\n method: 'eth_getTransactionCount',\n params: [\n address,\n typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : blockTag,\n ],\n }, {\n dedupe: Boolean(blockNumber),\n });\n return hexToNumber(count);\n}\n//# sourceMappingURL=getTransactionCount.js.map"],"names":["async","getTransactionCount","client","address","blockTag","blockNumber","count","request","method","params","numberToHex","dedupe","Boolean","hexToNumber"],"mappings":"0HAyBOA,eAAeC,EAAoBC,GAAQC,QAAEA,EAAOC,SAAEA,EAAW,SAAQC,YAAEA,IAC9E,MAAMC,QAAcJ,EAAOK,QAAQ,CAC/BC,OAAQ,0BACRC,OAAQ,CACJN,EACuB,iBAAhBE,EAA2BK,EAAYL,GAAeD,IAElE,CACCO,OAAQC,QAAQP,KAEpB,OAAOQ,EAAYP,EACvB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TransactionReceiptNotFoundError as t}from"../../errors/transaction.js";import{formatTransactionReceipt as r}from"../../utils/formatters/transactionReceipt.js";async function a(a,{hash:e}){const o=await a.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!o)throw new t({hash:e});return(a.chain?.formatters?.transactionReceipt?.format||r)(o)}export{a as getTransactionReceipt};
|
|
2
|
+
//# sourceMappingURL=getTransactionReceipt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransactionReceipt.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/getTransactionReceipt.js"],"sourcesContent":["import { TransactionReceiptNotFoundError, } from '../../errors/transaction.js';\nimport { formatTransactionReceipt, } from '../../utils/formatters/transactionReceipt.js';\n/**\n * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionReceiptParameters}\n * @returns The transaction receipt. {@link GetTransactionReceiptReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionReceipt } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionReceipt = await getTransactionReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionReceipt(client, { hash }) {\n const receipt = await client.request({\n method: 'eth_getTransactionReceipt',\n params: [hash],\n }, { dedupe: true });\n if (!receipt)\n throw new TransactionReceiptNotFoundError({ hash });\n const format = client.chain?.formatters?.transactionReceipt?.format ||\n formatTransactionReceipt;\n return format(receipt);\n}\n//# sourceMappingURL=getTransactionReceipt.js.map"],"names":["async","getTransactionReceipt","client","hash","receipt","request","method","params","dedupe","TransactionReceiptNotFoundError","chain","formatters","transactionReceipt","format","formatTransactionReceipt"],"mappings":"sKA0BOA,eAAeC,EAAsBC,GAAQC,KAAEA,IAClD,MAAMC,QAAgBF,EAAOG,QAAQ,CACjCC,OAAQ,4BACRC,OAAQ,CAACJ,IACV,CAAEK,QAAQ,IACb,IAAKJ,EACD,MAAM,IAAIK,EAAgC,CAAEN,SAGhD,OAFeD,EAAOQ,OAAOC,YAAYC,oBAAoBC,QACzDC,GACUV,EAClB","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{multicall3Abi as t}from"../../constants/abis.js";import{multicall3Bytecode as r}from"../../constants/contracts.js";import{AbiDecodingZeroDataError as a}from"../../errors/abi.js";import{BaseError as e}from"../../errors/base.js";import{RawContractError as o}from"../../errors/contract.js";import{decodeFunctionResult as s}from"../../utils/abi/decodeFunctionResult.js";import{encodeFunctionData as c}from"../../utils/abi/encodeFunctionData.js";import{getChainContractAddress as i}from"../../utils/chain/getChainContractAddress.js";import{getContractError as l}from"../../utils/errors/getContractError.js";import{getAction as n}from"../../utils/getAction.js";import{readContract as u}from"./readContract.js";async function m(m,d){const{account:f,authorizationList:h,allowFailure:g=!0,blockNumber:b,blockOverrides:p,blockTag:w,stateOverride:j}=d,N=d.contracts,{batchSize:k=d.batchSize??1024,deployless:v=d.deployless??!1}="object"==typeof m.batch?.multicall?m.batch.multicall:{},y=(()=>{if(d.multicallAddress)return d.multicallAddress;if(v)return null;if(m.chain)return i({blockNumber:b,chain:m.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),A=[[]];let C=0,D=0;for(let t=0;t<N.length;t++){const{abi:r,address:a,args:e,functionName:o}=N[t];try{const t=c({abi:r,args:e,functionName:o});D+=(t.length-2)/2,k>0&&D>k&&A[C].length>0&&(C++,D=(t.length-2)/2,A[C]=[]),A[C]=[...A[C],{allowFailure:!0,callData:t,target:a}]}catch(t){const s=l(t,{abi:r,address:a,args:e,docsPath:"/docs/contract/multicall",functionName:o,sender:f});if(!g)throw s;A[C]=[...A[C],{allowFailure:!0,callData:"0x",target:a}]}}const F=await Promise.allSettled(A.map(a=>n(m,u,"readContract")({...null===y?{code:r}:{address:y},abi:t,account:f,args:[a],authorizationList:h,blockNumber:b,blockOverrides:p,blockTag:w,functionName:"aggregate3",stateOverride:j}))),z=[];for(let t=0;t<F.length;t++){const r=F[t];if("rejected"===r.status){if(!g)throw r.reason;for(let a=0;a<A[t].length;a++)z.push({status:"failure",error:r.reason,result:void 0});continue}const e=r.value;for(let r=0;r<e.length;r++){const{returnData:c,success:i}=e[r],{callData:n}=A[t][r],{abi:u,address:m,functionName:d,args:f}=N[z.length];try{if("0x"===n)throw new a;if(!i)throw new o({data:c});const t=s({abi:u,args:f,data:c,functionName:d});z.push(g?{result:t,status:"success"}:t)}catch(t){const r=l(t,{abi:u,address:m,args:f,docsPath:"/docs/contract/multicall",functionName:d});if(!g)throw r;z.push({error:r,result:void 0,status:"failure"})}}}if(z.length!==N.length)throw new e("multicall results mismatch");return z}export{m as multicall};
|
|
2
|
+
//# sourceMappingURL=multicall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multicall.js","sources":["../../../../../../../node_modules/viem/_esm/actions/public/multicall.js"],"sourcesContent":["import { multicall3Abi } from '../../constants/abis.js';\nimport { multicall3Bytecode } from '../../constants/contracts.js';\nimport { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { BaseError } from '../../errors/base.js';\nimport { RawContractError } from '../../errors/contract.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { getContractError, } from '../../utils/errors/getContractError.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract } from './readContract.js';\n/**\n * Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).\n *\n * - Docs: https://viem.sh/docs/contract/multicall\n *\n * @param client - Client to use\n * @param parameters - {@link MulticallParameters}\n * @returns An array of results with accompanying status. {@link MulticallReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { multicall } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const abi = parseAbi([\n * 'function balanceOf(address) view returns (uint256)',\n * 'function totalSupply() view returns (uint256)',\n * ])\n * const results = await multicall(client, {\n * contracts: [\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'balanceOf',\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * },\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'totalSupply',\n * },\n * ],\n * })\n * // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]\n */\nexport async function multicall(client, parameters) {\n const { account, authorizationList, allowFailure = true, blockNumber, blockOverrides, blockTag, stateOverride, } = parameters;\n const contracts = parameters.contracts;\n const { batchSize = parameters.batchSize ?? 1024, deployless = parameters.deployless ?? false, } = typeof client.batch?.multicall === 'object' ? client.batch.multicall : {};\n const multicallAddress = (() => {\n if (parameters.multicallAddress)\n return parameters.multicallAddress;\n if (deployless)\n return null;\n if (client.chain) {\n return getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n throw new Error('client chain not configured. multicallAddress is required.');\n })();\n const chunkedCalls = [[]];\n let currentChunk = 0;\n let currentChunkSize = 0;\n for (let i = 0; i < contracts.length; i++) {\n const { abi, address, args, functionName } = contracts[i];\n try {\n const callData = encodeFunctionData({ abi, args, functionName });\n currentChunkSize += (callData.length - 2) / 2;\n // Check to see if we need to create a new chunk.\n if (\n // Check if batching is enabled.\n batchSize > 0 &&\n // Check if the current size of the batch exceeds the size limit.\n currentChunkSize > batchSize &&\n // Check if the current chunk is not already empty.\n chunkedCalls[currentChunk].length > 0) {\n currentChunk++;\n currentChunkSize = (callData.length - 2) / 2;\n chunkedCalls[currentChunk] = [];\n }\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData,\n target: address,\n },\n ];\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n sender: account,\n });\n if (!allowFailure)\n throw error;\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData: '0x',\n target: address,\n },\n ];\n }\n }\n const aggregate3Results = await Promise.allSettled(chunkedCalls.map((calls) => getAction(client, readContract, 'readContract')({\n ...(multicallAddress === null\n ? { code: multicall3Bytecode }\n : { address: multicallAddress }),\n abi: multicall3Abi,\n account,\n args: [calls],\n authorizationList,\n blockNumber,\n blockOverrides,\n blockTag,\n functionName: 'aggregate3',\n stateOverride,\n })));\n const results = [];\n for (let i = 0; i < aggregate3Results.length; i++) {\n const result = aggregate3Results[i];\n // If an error occurred in a `readContract` invocation (ie. network error),\n // then append the failure reason to each contract result.\n if (result.status === 'rejected') {\n if (!allowFailure)\n throw result.reason;\n for (let j = 0; j < chunkedCalls[i].length; j++) {\n results.push({\n status: 'failure',\n error: result.reason,\n result: undefined,\n });\n }\n continue;\n }\n // If the `readContract` call was successful, then decode the results.\n const aggregate3Result = result.value;\n for (let j = 0; j < aggregate3Result.length; j++) {\n // Extract the response from `readContract`\n const { returnData, success } = aggregate3Result[j];\n // Extract the request call data from the original call.\n const { callData } = chunkedCalls[i][j];\n // Extract the contract config for this call from the `contracts` argument\n // for decoding.\n const { abi, address, functionName, args } = contracts[results.length];\n try {\n if (callData === '0x')\n throw new AbiDecodingZeroDataError();\n if (!success)\n throw new RawContractError({ data: returnData });\n const result = decodeFunctionResult({\n abi,\n args,\n data: returnData,\n functionName,\n });\n results.push(allowFailure ? { result, status: 'success' } : result);\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n });\n if (!allowFailure)\n throw error;\n results.push({ error, result: undefined, status: 'failure' });\n }\n }\n }\n if (results.length !== contracts.length)\n throw new BaseError('multicall results mismatch');\n return results;\n}\n//# sourceMappingURL=multicall.js.map"],"names":["async","multicall","client","parameters","account","authorizationList","allowFailure","blockNumber","blockOverrides","blockTag","stateOverride","contracts","batchSize","deployless","batch","multicallAddress","chain","getChainContractAddress","contract","Error","chunkedCalls","currentChunk","currentChunkSize","i","length","abi","address","args","functionName","callData","encodeFunctionData","target","err","error","getContractError","docsPath","sender","aggregate3Results","Promise","allSettled","map","calls","getAction","readContract","code","multicall3Bytecode","multicall3Abi","results","result","status","reason","j","push","undefined","aggregate3Result","value","returnData","success","AbiDecodingZeroDataError","RawContractError","data","decodeFunctionResult","BaseError"],"mappings":"usBAkDOA,eAAeC,EAAUC,EAAQC,GACpC,MAAMC,QAAEA,EAAOC,kBAAEA,EAAiBC,aAAEA,GAAe,EAAIC,YAAEA,EAAWC,eAAEA,EAAcC,SAAEA,EAAQC,cAAEA,GAAmBP,EAC7GQ,EAAYR,EAAWQ,WACvBC,UAAEA,EAAYT,EAAWS,WAAa,KAAIC,WAAEA,EAAaV,EAAWU,aAAc,GAA8C,iBAA5BX,EAAOY,OAAOb,UAAyBC,EAAOY,MAAMb,UAAY,CAAA,EACpKc,EAAmB,MACrB,GAAIZ,EAAWY,iBACX,OAAOZ,EAAWY,iBACtB,GAAIF,EACA,OAAO,KACX,GAAIX,EAAOc,MACP,OAAOC,EAAwB,CAC3BV,cACAS,MAAOd,EAAOc,MACdE,SAAU,eAGlB,MAAM,IAAIC,MAAM,6DACnB,EAbwB,GAcnBC,EAAe,CAAC,IACtB,IAAIC,EAAe,EACfC,EAAmB,EACvB,IAAK,IAAIC,EAAI,EAAGA,EAAIZ,EAAUa,OAAQD,IAAK,CACvC,MAAME,IAAEA,EAAGC,QAAEA,EAAOC,KAAEA,EAAIC,aAAEA,GAAiBjB,EAAUY,GACvD,IACI,MAAMM,EAAWC,EAAmB,CAAEL,MAAKE,OAAMC,iBACjDN,IAAqBO,EAASL,OAAS,GAAK,EAI5CZ,EAAY,GAERU,EAAmBV,GAEnBQ,EAAaC,GAAcG,OAAS,IACpCH,IACAC,GAAoBO,EAASL,OAAS,GAAK,EAC3CJ,EAAaC,GAAgB,IAEjCD,EAAaC,GAAgB,IACtBD,EAAaC,GAChB,CACIf,cAAc,EACduB,WACAE,OAAQL,GAGpB,CACA,MAAOM,GACH,MAAMC,EAAQC,EAAiBF,EAAK,CAChCP,MACAC,UACAC,OACAQ,SAAU,2BACVP,eACAQ,OAAQhC,IAEZ,IAAKE,EACD,MAAM2B,EACVb,EAAaC,GAAgB,IACtBD,EAAaC,GAChB,CACIf,cAAc,EACduB,SAAU,KACVE,OAAQL,GAGpB,CACJ,CACA,MAAMW,QAA0BC,QAAQC,WAAWnB,EAAaoB,IAAKC,GAAUC,EAAUxC,EAAQyC,EAAc,eAAhCD,CAAgD,IAClG,OAArB3B,EACE,CAAE6B,KAAMC,GACR,CAAEnB,QAASX,GACjBU,IAAKqB,EACL1C,UACAuB,KAAM,CAACc,GACPpC,oBACAE,cACAC,iBACAC,WACAmB,aAAc,aACdlB,oBAEEqC,EAAU,GAChB,IAAK,IAAIxB,EAAI,EAAGA,EAAIc,EAAkBb,OAAQD,IAAK,CAC/C,MAAMyB,EAASX,EAAkBd,GAGjC,GAAsB,aAAlByB,EAAOC,OAAuB,CAC9B,IAAK3C,EACD,MAAM0C,EAAOE,OACjB,IAAK,IAAIC,EAAI,EAAGA,EAAI/B,EAAaG,GAAGC,OAAQ2B,IACxCJ,EAAQK,KAAK,CACTH,OAAQ,UACRhB,MAAOe,EAAOE,OACdF,YAAQK,IAGhB,QACJ,CAEA,MAAMC,EAAmBN,EAAOO,MAChC,IAAK,IAAIJ,EAAI,EAAGA,EAAIG,EAAiB9B,OAAQ2B,IAAK,CAE9C,MAAMK,WAAEA,EAAUC,QAAEA,GAAYH,EAAiBH,IAE3CtB,SAAEA,GAAaT,EAAaG,GAAG4B,IAG/B1B,IAAEA,EAAGC,QAAEA,EAAOE,aAAEA,EAAYD,KAAEA,GAAShB,EAAUoC,EAAQvB,QAC/D,IACI,GAAiB,OAAbK,EACA,MAAM,IAAI6B,EACd,IAAKD,EACD,MAAM,IAAIE,EAAiB,CAAEC,KAAMJ,IACvC,MAAMR,EAASa,EAAqB,CAChCpC,MACAE,OACAiC,KAAMJ,EACN5B,iBAEJmB,EAAQK,KAAK9C,EAAe,CAAE0C,SAAQC,OAAQ,WAAcD,EAChE,CACA,MAAOhB,GACH,MAAMC,EAAQC,EAAiBF,EAAK,CAChCP,MACAC,UACAC,OACAQ,SAAU,2BACVP,iBAEJ,IAAKtB,EACD,MAAM2B,EACVc,EAAQK,KAAK,CAAEnB,QAAOe,YAAQK,EAAWJ,OAAQ,WACrD,CACJ,CACJ,CACA,GAAIF,EAAQvB,SAAWb,EAAUa,OAC7B,MAAM,IAAIsC,EAAU,8BACxB,OAAOf,CACX","x_google_ignoreList":[0]}
|