UNPKG

coinley-checkout

Version:

A React SDK for Coinley cryptocurrency payment processing with multi-network support

1 lines 2.07 MB
{"version":3,"file":"index-1c96ce10.mjs","sources":["../node_modules/viem/_esm/errors/version.js","../node_modules/viem/_esm/errors/base.js","../node_modules/viem/_esm/errors/encoding.js","../node_modules/viem/_esm/errors/data.js","../node_modules/viem/_esm/utils/data/pad.js","../node_modules/viem/_esm/utils/data/isHex.js","../node_modules/viem/_esm/utils/data/size.js","../node_modules/viem/_esm/utils/data/trim.js","../node_modules/viem/_esm/utils/encoding/toBytes.js","../node_modules/viem/_esm/utils/encoding/fromHex.js","../node_modules/viem/_esm/utils/encoding/toHex.js","../node_modules/viem/_esm/utils/abi/formatAbiItem.js","../node_modules/viem/_esm/errors/abi.js","../node_modules/viem/_esm/utils/data/concat.js","../node_modules/viem/_esm/errors/address.js","../node_modules/viem/_esm/utils/lru.js","../node_modules/viem/node_modules/@noble/hashes/esm/_u64.js","../node_modules/viem/node_modules/@noble/hashes/esm/crypto.js","../node_modules/viem/node_modules/@noble/hashes/esm/utils.js","../node_modules/viem/node_modules/@noble/hashes/esm/sha3.js","../node_modules/viem/_esm/utils/hash/keccak256.js","../node_modules/viem/_esm/utils/address/getAddress.js","../node_modules/viem/_esm/utils/address/isAddress.js","../node_modules/viem/_esm/utils/data/slice.js","../node_modules/viem/_esm/utils/regex.js","../node_modules/viem/_esm/utils/abi/encodeAbiParameters.js","../node_modules/viem/_esm/utils/abi/encodeDeployData.js","../node_modules/viem/_esm/accounts/utils/parseAccount.js","../node_modules/viem/_esm/errors/account.js","../node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js","../node_modules/viem/_esm/utils/signature/recoverPublicKey.js","../node_modules/viem/_esm/utils/signature/recoverAddress.js","../node_modules/viem/_esm/errors/cursor.js","../node_modules/viem/_esm/utils/cursor.js","../node_modules/viem/_esm/utils/encoding/toRlp.js","../node_modules/viem/_esm/utils/authorization/hashAuthorization.js","../node_modules/viem/_esm/utils/authorization/recoverAuthorizationAddress.js","../node_modules/viem/_esm/errors/chain.js","../node_modules/viem/_esm/utils/chain/assertCurrentChain.js","../node_modules/viem/_esm/constants/unit.js","../node_modules/viem/_esm/utils/unit/formatUnits.js","../node_modules/viem/_esm/utils/unit/formatGwei.js","../node_modules/viem/_esm/errors/node.js","../node_modules/viem/_esm/utils/unit/formatEther.js","../node_modules/viem/_esm/errors/transaction.js","../node_modules/viem/_esm/utils/stringify.js","../node_modules/viem/_esm/errors/utils.js","../node_modules/viem/_esm/errors/request.js","../node_modules/viem/_esm/errors/rpc.js","../node_modules/viem/_esm/utils/errors/getNodeError.js","../node_modules/viem/_esm/utils/errors/getTransactionError.js","../node_modules/viem/_esm/utils/formatters/extract.js","../node_modules/viem/_esm/utils/formatters/formatter.js","../node_modules/viem/_esm/utils/formatters/transactionRequest.js","../node_modules/viem/_esm/utils/getAction.js","../node_modules/viem/_esm/constants/number.js","../node_modules/viem/_esm/utils/transaction/assertRequest.js","../node_modules/viem/_esm/actions/public/getChainId.js","../node_modules/viem/_esm/errors/fee.js","../node_modules/viem/_esm/errors/block.js","../node_modules/viem/_esm/utils/formatters/transaction.js","../node_modules/viem/_esm/utils/formatters/block.js","../node_modules/viem/_esm/actions/public/getBlock.js","../node_modules/viem/_esm/actions/public/getGasPrice.js","../node_modules/viem/_esm/actions/public/estimateMaxPriorityFeePerGas.js","../node_modules/viem/_esm/actions/public/estimateFeesPerGas.js","../node_modules/viem/_esm/errors/estimateGas.js","../node_modules/viem/_esm/utils/errors/getEstimateGasError.js","../node_modules/viem/_esm/errors/stateOverride.js","../node_modules/viem/_esm/utils/stateOverride.js","../node_modules/viem/_esm/actions/public/getBalance.js","../node_modules/viem/_esm/actions/public/estimateGas.js","../node_modules/viem/_esm/actions/public/getTransactionCount.js","../node_modules/viem/_esm/utils/blob/blobsToCommitments.js","../node_modules/viem/_esm/utils/blob/blobsToProofs.js","../node_modules/viem/node_modules/@noble/hashes/esm/_md.js","../node_modules/viem/node_modules/@noble/hashes/esm/sha2.js","../node_modules/viem/node_modules/@noble/hashes/esm/sha256.js","../node_modules/viem/_esm/utils/hash/sha256.js","../node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js","../node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js","../node_modules/viem/_esm/constants/blob.js","../node_modules/viem/_esm/constants/kzg.js","../node_modules/viem/_esm/errors/blob.js","../node_modules/viem/_esm/utils/blob/toBlobs.js","../node_modules/viem/_esm/utils/blob/toBlobSidecars.js","../node_modules/viem/_esm/utils/transaction/getTransactionType.js","../node_modules/viem/_esm/actions/wallet/prepareTransactionRequest.js","../node_modules/viem/_esm/actions/wallet/sendRawTransaction.js","../node_modules/viem/_esm/actions/wallet/sendTransaction.js","../node_modules/viem/_esm/constants/abis.js","../node_modules/viem/_esm/utils/encoding/fromBytes.js","../node_modules/viem/_esm/utils/abi/decodeAbiParameters.js","../node_modules/viem/_esm/utils/hash/hashSignature.js","../node_modules/viem/node_modules/abitype/dist/esm/version.js","../node_modules/viem/node_modules/abitype/dist/esm/errors.js","../node_modules/viem/node_modules/abitype/dist/esm/regex.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/errors/signature.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/errors/struct.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/runtime/cache.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/runtime/utils.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/runtime/structs.js","../node_modules/viem/node_modules/abitype/dist/esm/human-readable/parseAbi.js","../node_modules/viem/_esm/utils/hash/normalizeSignature.js","../node_modules/viem/_esm/utils/hash/toSignature.js","../node_modules/viem/_esm/utils/hash/toSignatureHash.js","../node_modules/viem/_esm/utils/hash/toEventSelector.js","../node_modules/viem/_esm/utils/hash/toFunctionSelector.js","../node_modules/viem/_esm/utils/abi/getAbiItem.js","../node_modules/viem/_esm/utils/abi/decodeFunctionResult.js","../node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js","../node_modules/viem/_esm/utils/abi/encodeFunctionData.js","../node_modules/viem/_esm/utils/chain/getChainContractAddress.js","../node_modules/viem/_esm/constants/solidity.js","../node_modules/viem/_esm/utils/abi/decodeErrorResult.js","../node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js","../node_modules/viem/_esm/errors/contract.js","../node_modules/viem/_esm/utils/ens/errors.js","../node_modules/viem/_esm/utils/abi/decodeFunctionData.js","../node_modules/viem/_esm/utils/abi/encodeErrorResult.js","../node_modules/viem/_esm/utils/abi/encodeFunctionResult.js","../node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js","../node_modules/viem/_esm/utils/ens/encodedLabelToLabelhash.js","../node_modules/viem/_esm/utils/ens/namehash.js","../node_modules/viem/_esm/utils/ens/encodeLabelhash.js","../node_modules/viem/_esm/utils/ens/labelhash.js","../node_modules/viem/_esm/utils/ens/packetToBytes.js","../node_modules/viem/_esm/utils/errors/getContractError.js","../node_modules/ox/_esm/core/version.js","../node_modules/ox/_esm/core/internal/errors.js","../node_modules/ox/_esm/core/Errors.js","../node_modules/ox/_esm/core/Json.js","../node_modules/ox/_esm/core/internal/hex.js","../node_modules/ox/_esm/core/Hex.js","../node_modules/ox/_esm/core/Withdrawal.js","../node_modules/ox/_esm/core/BlockOverrides.js","../node_modules/viem/_esm/constants/contract.js","../node_modules/viem/_esm/constants/contracts.js","../node_modules/viem/_esm/utils/errors/getCallError.js","../node_modules/viem/_esm/utils/promise/withResolvers.js","../node_modules/viem/_esm/utils/promise/createBatchScheduler.js","../node_modules/viem/_esm/actions/public/call.js","../node_modules/viem/_esm/actions/public/readContract.js","../node_modules/viem/_esm/errors/ens.js","../node_modules/viem/_esm/utils/ens/avatar/utils.js","../node_modules/viem/_esm/utils/ens/avatar/parseAvatarRecord.js","../node_modules/viem/_esm/actions/ens/getEnsText.js","../node_modules/viem/_esm/actions/ens/getEnsAvatar.js","../node_modules/viem/_esm/actions/ens/getEnsName.js","../node_modules/viem/_esm/utils/formatters/log.js","../node_modules/viem/_esm/utils/formatters/transactionReceipt.js","../node_modules/viem/_esm/actions/public/multicall.js","../node_modules/viem/_esm/utils/promise/withDedupe.js","../node_modules/viem/_esm/utils/wait.js","../node_modules/viem/_esm/utils/promise/withRetry.js","../node_modules/viem/_esm/utils/buildRequest.js","../node_modules/viem/_esm/utils/chain/defineChain.js","../node_modules/viem/_esm/utils/promise/withTimeout.js","../node_modules/viem/_esm/utils/rpc/id.js","../node_modules/viem/_esm/utils/rpc/http.js","../node_modules/viem/_esm/errors/typedData.js","../node_modules/viem/_esm/utils/typedData.js","../node_modules/viem/_esm/utils/transaction/assertTransaction.js","../node_modules/viem/_esm/utils/transaction/serializeAccessList.js","../node_modules/viem/_esm/utils/transaction/serializeTransaction.js","../node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js","../node_modules/viem/_esm/actions/wallet/signMessage.js","../node_modules/viem/_esm/actions/wallet/signTypedData.js","../node_modules/@wagmi/core/dist/esm/utils/getAction.js","../node_modules/@wagmi/core/dist/esm/version.js","../node_modules/@wagmi/core/dist/esm/utils/getVersion.js","../node_modules/@wagmi/core/dist/esm/errors/base.js","../node_modules/@wagmi/core/dist/esm/errors/config.js","../node_modules/@wagmi/core/dist/esm/actions/connect.js","../node_modules/viem/_esm/utils/uid.js","../node_modules/viem/_esm/clients/createClient.js","../node_modules/viem/_esm/clients/transports/createTransport.js","../node_modules/viem/_esm/clients/transports/custom.js","../node_modules/viem/_esm/errors/transport.js","../node_modules/viem/_esm/clients/transports/http.js","../node_modules/@wagmi/core/dist/esm/actions/getConnectorClient.js","../node_modules/@wagmi/core/dist/esm/actions/disconnect.js","../node_modules/@wagmi/core/dist/esm/utils/getUnit.js","../node_modules/@wagmi/core/dist/esm/actions/getAccount.js","../node_modules/@wagmi/core/dist/esm/actions/multicall.js","../node_modules/@wagmi/core/dist/esm/actions/readContract.js","../node_modules/@wagmi/core/dist/esm/actions/readContracts.js","../node_modules/@wagmi/core/dist/esm/actions/getBalance.js","../node_modules/@wagmi/core/dist/esm/actions/getChainId.js","../node_modules/@wagmi/core/dist/esm/utils/deepEqual.js","../node_modules/@wagmi/core/dist/esm/actions/getChains.js","../node_modules/@wagmi/core/dist/esm/actions/getConnections.js","../node_modules/@wagmi/core/dist/esm/actions/getConnectors.js","../node_modules/@wagmi/core/dist/esm/actions/getEnsAvatar.js","../node_modules/@wagmi/core/dist/esm/actions/getEnsName.js","../node_modules/@wagmi/core/dist/esm/actions/reconnect.js","../node_modules/@wagmi/core/dist/esm/actions/sendTransaction.js","../node_modules/@wagmi/core/dist/esm/actions/signMessage.js","../node_modules/@wagmi/core/dist/esm/actions/signTypedData.js","../node_modules/@wagmi/core/dist/esm/errors/connector.js","../node_modules/@wagmi/core/dist/esm/actions/switchChain.js","../node_modules/@wagmi/core/dist/esm/actions/watchAccount.js","../node_modules/@wagmi/core/dist/esm/actions/watchChainId.js","../node_modules/@wagmi/core/dist/esm/actions/watchConnections.js","../node_modules/@wagmi/core/dist/esm/actions/watchConnectors.js","../node_modules/@wagmi/core/dist/esm/connectors/createConnector.js","../node_modules/@wagmi/core/dist/esm/connectors/injected.js","../node_modules/mipd/dist/esm/utils.js","../node_modules/mipd/dist/esm/store.js","../node_modules/@wagmi/core/node_modules/zustand/esm/middleware.mjs","../node_modules/@wagmi/core/node_modules/zustand/esm/vanilla.mjs","../node_modules/eventemitter3/index.js","../node_modules/@wagmi/core/dist/esm/createEmitter.js","../node_modules/@wagmi/core/dist/esm/utils/deserialize.js","../node_modules/@wagmi/core/dist/esm/utils/serialize.js","../node_modules/@wagmi/core/dist/esm/createStorage.js","../node_modules/@wagmi/core/dist/esm/utils/uid.js","../node_modules/@wagmi/core/dist/esm/createConfig.js","../node_modules/@wagmi/core/dist/esm/hydrate.js","../node_modules/@wagmi/core/dist/esm/utils/extractRpcUrls.js","../node_modules/wagmi/dist/esm/hydrate.js","../node_modules/wagmi/dist/esm/context.js","../node_modules/wagmi/dist/esm/version.js","../node_modules/wagmi/dist/esm/utils/getVersion.js","../node_modules/wagmi/dist/esm/errors/base.js","../node_modules/wagmi/dist/esm/errors/context.js","../node_modules/wagmi/dist/esm/hooks/useConfig.js","../node_modules/@wagmi/core/dist/esm/actions/watchChains.js","../node_modules/wagmi/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../node_modules/wagmi/node_modules/use-sync-external-store/shim/index.js","../node_modules/wagmi/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../node_modules/wagmi/node_modules/use-sync-external-store/shim/with-selector.js","../node_modules/wagmi/dist/esm/hooks/useSyncExternalStoreWithTracked.js","../node_modules/wagmi/dist/esm/hooks/useAccount.js","../node_modules/@tanstack/query-core/build/modern/subscribable.js","../node_modules/@tanstack/query-core/build/modern/utils.js","../node_modules/@tanstack/query-core/build/modern/focusManager.js","../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../node_modules/@tanstack/query-core/build/modern/thenable.js","../node_modules/@tanstack/query-core/build/modern/retryer.js","../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../node_modules/@tanstack/query-core/build/modern/removable.js","../node_modules/@tanstack/query-core/build/modern/query.js","../node_modules/@tanstack/query-core/build/modern/queryCache.js","../node_modules/@tanstack/query-core/build/modern/mutation.js","../node_modules/@tanstack/query-core/build/modern/mutationCache.js","../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../node_modules/@tanstack/query-core/build/modern/queryClient.js","../node_modules/@tanstack/query-core/build/modern/queryObserver.js","../node_modules/@tanstack/query-core/build/modern/mutationObserver.js","../node_modules/@wagmi/core/dist/esm/query/utils.js","../node_modules/@wagmi/core/dist/esm/query/connect.js","../node_modules/@wagmi/core/dist/esm/query/disconnect.js","../node_modules/@wagmi/core/dist/esm/query/getBalance.js","../node_modules/@wagmi/core/dist/esm/query/getEnsAvatar.js","../node_modules/@wagmi/core/dist/esm/query/getEnsName.js","../node_modules/@wagmi/core/dist/esm/query/sendTransaction.js","../node_modules/@wagmi/core/dist/esm/query/signMessage.js","../node_modules/@wagmi/core/dist/esm/query/signTypedData.js","../node_modules/@wagmi/core/dist/esm/query/switchChain.js","../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/jsx-runtime.js","../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js","../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../node_modules/@tanstack/react-query/build/modern/suspense.js","../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../node_modules/@tanstack/react-query/build/modern/useQuery.js","../node_modules/@tanstack/react-query/build/modern/useMutation.js","../node_modules/wagmi/dist/esm/utils/query.js","../node_modules/wagmi/dist/esm/hooks/useChainId.js","../node_modules/wagmi/dist/esm/hooks/useBalance.js","../node_modules/wagmi/dist/esm/hooks/useChains.js","../node_modules/wagmi/dist/esm/hooks/useConnectors.js","../node_modules/wagmi/dist/esm/hooks/useConnect.js","../node_modules/wagmi/dist/esm/hooks/useConnections.js","../node_modules/wagmi/dist/esm/hooks/useDisconnect.js","../node_modules/wagmi/dist/esm/hooks/useEnsAvatar.js","../node_modules/wagmi/dist/esm/hooks/useEnsName.js","../node_modules/wagmi/dist/esm/hooks/useSendTransaction.js","../node_modules/wagmi/dist/esm/hooks/useSignMessage.js","../node_modules/wagmi/dist/esm/hooks/useSignTypedData.js","../node_modules/wagmi/dist/esm/hooks/useSwitchChain.js","../node_modules/viem/_esm/op-stack/contracts.js","../node_modules/viem/_esm/op-stack/formatters.js","../node_modules/viem/_esm/op-stack/serializers.js","../node_modules/viem/_esm/op-stack/chainConfig.js","../node_modules/viem/_esm/chains/definitions/arbitrum.js","../node_modules/viem/_esm/chains/definitions/avalanche.js","../node_modules/viem/_esm/chains/definitions/base.js","../node_modules/viem/_esm/chains/definitions/bsc.js","../node_modules/viem/_esm/chains/definitions/cronos.js","../node_modules/viem/_esm/chains/definitions/fantom.js","../node_modules/viem/_esm/chains/definitions/gnosis.js","../node_modules/viem/_esm/chains/definitions/mainnet.js","../node_modules/viem/_esm/chains/definitions/optimism.js","../node_modules/viem/_esm/chains/definitions/polygon.js","../node_modules/@wagmi/connectors/dist/esm/coinbaseWallet.js","../node_modules/@wagmi/connectors/dist/esm/metaMask.js","../node_modules/@wagmi/connectors/dist/esm/walletConnect.js","../node_modules/@coinley/wallet-connect-core/dist/config.js","../node_modules/@coinley/wallet-connect-core/dist/provider.js","../node_modules/@coinley/wallet-connect-core/dist/hooks.js","../node_modules/@coinley/wallet-connect-core/dist/components/ConnectButton.js","../node_modules/@coinley/wallet-connect-core/dist/components/WalletModal.js","../src/services/walletCoreService.js","../node_modules/vite-plugin-node-polyfills/shims/process/dist/index.js","../src/services/coinleyConnectClient.js","../src/services/walletService.js","../src/services/api.js","../src/context/ThemeContext.jsx","../src/context/CoinleyContext.jsx","../node_modules/qrcode.react/lib/esm/index.js","../src/components/QRCode.jsx","../src/components/PaymentStatus.jsx","../src/components/icons.jsx","../src/components/PaymentMethods.jsx","../src/assets/Logomark.png","../src/components/CoinleyModal.jsx","../src/components/CoinleyCheckout.jsx","../src/index.js"],"sourcesContent":["export const version = '2.33.2';\n//# sourceMappingURL=version.js.map","import { version } from './version.js';\nlet errorConfig = {\n getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath\n ? `${docsBaseUrl ?? 'https://viem.sh'}${docsPath}${docsSlug ? `#${docsSlug}` : ''}`\n : undefined,\n version: `viem@${version}`,\n};\nexport function setErrorConfig(config) {\n errorConfig = config;\n}\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n const details = (() => {\n if (args.cause instanceof BaseError)\n return args.cause.details;\n if (args.cause?.message)\n return args.cause.message;\n return args.details;\n })();\n const docsPath = (() => {\n if (args.cause instanceof BaseError)\n return args.cause.docsPath || args.docsPath;\n return args.docsPath;\n })();\n const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath });\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsUrl ? [`Docs: ${docsUrl}`] : []),\n ...(details ? [`Details: ${details}`] : []),\n ...(errorConfig.version ? [`Version: ${errorConfig.version}`] : []),\n ].join('\\n');\n super(message, args.cause ? { cause: args.cause } : undefined);\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'BaseError'\n });\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.name = args.name ?? this.name;\n this.shortMessage = shortMessage;\n this.version = version;\n }\n walk(fn) {\n return walk(this, fn);\n }\n}\nfunction walk(err, fn) {\n if (fn?.(err))\n return err;\n if (err &&\n typeof err === 'object' &&\n 'cause' in err &&\n err.cause !== undefined)\n return walk(err.cause, fn);\n return fn ? null : err;\n}\n//# sourceMappingURL=base.js.map","import { BaseError } from './base.js';\nexport class IntegerOutOfRangeError extends BaseError {\n constructor({ max, min, signed, size, value, }) {\n super(`Number \"${value}\" is not in safe ${size ? `${size * 8}-bit ${signed ? 'signed' : 'unsigned'} ` : ''}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: 'IntegerOutOfRangeError' });\n }\n}\nexport class InvalidBytesBooleanError extends BaseError {\n constructor(bytes) {\n super(`Bytes value \"${bytes}\" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {\n name: 'InvalidBytesBooleanError',\n });\n }\n}\nexport class InvalidHexBooleanError extends BaseError {\n constructor(hex) {\n super(`Hex value \"${hex}\" is not a valid boolean. The hex value must be \"0x0\" (false) or \"0x1\" (true).`, { name: 'InvalidHexBooleanError' });\n }\n}\nexport class InvalidHexValueError extends BaseError {\n constructor(value) {\n super(`Hex value \"${value}\" is an odd length (${value.length}). It must be an even length.`, { name: 'InvalidHexValueError' });\n }\n}\nexport class SizeOverflowError extends BaseError {\n constructor({ givenSize, maxSize }) {\n super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: 'SizeOverflowError' });\n }\n}\n//# sourceMappingURL=encoding.js.map","import { BaseError } from './base.js';\nexport class SliceOffsetOutOfBoundsError extends BaseError {\n constructor({ offset, position, size, }) {\n super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \"${offset}\" is out-of-bounds (size: ${size}).`, { name: 'SliceOffsetOutOfBoundsError' });\n }\n}\nexport class SizeExceedsPaddingSizeError extends BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} size (${size}) exceeds padding size (${targetSize}).`, { name: 'SizeExceedsPaddingSizeError' });\n }\n}\nexport class InvalidBytesLengthError extends BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size} ${type} long.`, { name: 'InvalidBytesLengthError' });\n }\n}\n//# sourceMappingURL=data.js.map","import { SizeExceedsPaddingSizeError, } from '../../errors/data.js';\nexport function pad(hexOrBytes, { dir, size = 32 } = {}) {\n if (typeof hexOrBytes === 'string')\n return padHex(hexOrBytes, { dir, size });\n return padBytes(hexOrBytes, { dir, size });\n}\nexport function padHex(hex_, { dir, size = 32 } = {}) {\n if (size === null)\n return hex_;\n const hex = hex_.replace('0x', '');\n if (hex.length > size * 2)\n throw new SizeExceedsPaddingSizeError({\n size: Math.ceil(hex.length / 2),\n targetSize: size,\n type: 'hex',\n });\n return `0x${hex[dir === 'right' ? 'padEnd' : 'padStart'](size * 2, '0')}`;\n}\nexport function padBytes(bytes, { dir, size = 32 } = {}) {\n if (size === null)\n return bytes;\n if (bytes.length > size)\n throw new SizeExceedsPaddingSizeError({\n size: bytes.length,\n targetSize: size,\n type: 'bytes',\n });\n const paddedBytes = new Uint8Array(size);\n for (let i = 0; i < size; i++) {\n const padEnd = dir === 'right';\n paddedBytes[padEnd ? i : size - i - 1] =\n bytes[padEnd ? i : bytes.length - i - 1];\n }\n return paddedBytes;\n}\n//# sourceMappingURL=pad.js.map","export function isHex(value, { strict = true } = {}) {\n if (!value)\n return false;\n if (typeof value !== 'string')\n return false;\n return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith('0x');\n}\n//# sourceMappingURL=isHex.js.map","import { isHex } from './isHex.js';\n/**\n * @description Retrieves the size of the value (in bytes).\n *\n * @param value The value (hex or byte array) to retrieve the size of.\n * @returns The size of the value (in bytes).\n */\nexport function size(value) {\n if (isHex(value, { strict: false }))\n return Math.ceil((value.length - 2) / 2);\n return value.length;\n}\n//# sourceMappingURL=size.js.map","export function trim(hexOrBytes, { dir = 'left' } = {}) {\n let data = typeof hexOrBytes === 'string' ? hexOrBytes.replace('0x', '') : hexOrBytes;\n let sliceLength = 0;\n for (let i = 0; i < data.length - 1; i++) {\n if (data[dir === 'left' ? i : data.length - i - 1].toString() === '0')\n sliceLength++;\n else\n break;\n }\n data =\n dir === 'left'\n ? data.slice(sliceLength)\n : data.slice(0, data.length - sliceLength);\n if (typeof hexOrBytes === 'string') {\n if (data.length === 1 && dir === 'right')\n data = `${data}0`;\n return `0x${data.length % 2 === 1 ? `0${data}` : data}`;\n }\n return data;\n}\n//# sourceMappingURL=trim.js.map","import { BaseError } from '../../errors/base.js';\nimport { isHex } from '../data/isHex.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nimport { numberToHex, } from './toHex.js';\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes\n * - Example: https://viem.sh/docs/utilities/toBytes#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes('Hello world')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function toBytes(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToBytes(value, opts);\n if (typeof value === 'boolean')\n return boolToBytes(value, opts);\n if (isHex(value))\n return hexToBytes(value, opts);\n return stringToBytes(value, opts);\n}\n/**\n * Encodes a boolean into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#booltobytes\n *\n * @param value Boolean value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true)\n * // Uint8Array([1])\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true, { size: 32 })\n * // Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])\n */\nexport function boolToBytes(value, opts = {}) {\n const bytes = new Uint8Array(1);\n bytes[0] = Number(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { size: opts.size });\n }\n return bytes;\n}\n// We use very optimized technique to convert hex string to byte array\nconst charCodeMap = {\n zero: 48,\n nine: 57,\n A: 65,\n F: 70,\n a: 97,\n f: 102,\n};\nfunction charCodeToBase16(char) {\n if (char >= charCodeMap.zero && char <= charCodeMap.nine)\n return char - charCodeMap.zero;\n if (char >= charCodeMap.A && char <= charCodeMap.F)\n return char - (charCodeMap.A - 10);\n if (char >= charCodeMap.a && char <= charCodeMap.f)\n return char - (charCodeMap.a - 10);\n return undefined;\n}\n/**\n * Encodes a hex string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#hextobytes\n *\n * @param hex Hex string to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function hexToBytes(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = pad(hex, { dir: 'right', size: opts.size });\n }\n let hexString = hex.slice(2);\n if (hexString.length % 2)\n hexString = `0${hexString}`;\n const length = hexString.length / 2;\n const bytes = new Uint8Array(length);\n for (let index = 0, j = 0; index < length; index++) {\n const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));\n const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));\n if (nibbleLeft === undefined || nibbleRight === undefined) {\n throw new BaseError(`Invalid byte sequence (\"${hexString[j - 2]}${hexString[j - 1]}\" in \"${hexString}\").`);\n }\n bytes[index] = nibbleLeft * 16 + nibbleRight;\n }\n return bytes;\n}\n/**\n * Encodes a number into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#numbertobytes\n *\n * @param value Number to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function numberToBytes(value, opts) {\n const hex = numberToHex(value, opts);\n return hexToBytes(hex);\n}\n/**\n * Encodes a UTF-8 string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#stringtobytes\n *\n * @param value String to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33])\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function stringToBytes(value, opts = {}) {\n const bytes = encoder.encode(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { dir: 'right', size: opts.size });\n }\n return bytes;\n}\n//# sourceMappingURL=toBytes.js.map","import { InvalidHexBooleanError, SizeOverflowError, } from '../../errors/encoding.js';\nimport { size as size_ } from '../data/size.js';\nimport { trim } from '../data/trim.js';\nimport { hexToBytes } from './toBytes.js';\nexport function assertSize(hexOrBytes, { size }) {\n if (size_(hexOrBytes) > size)\n throw new SizeOverflowError({\n givenSize: size_(hexOrBytes),\n maxSize: size,\n });\n}\n/**\n * Decodes a hex string into a string, number, bigint, boolean, or byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex\n * - Example: https://viem.sh/docs/utilities/fromHex#usage\n *\n * @param hex Hex string to decode.\n * @param toOrOpts Type to convert to or options.\n * @returns Decoded value.\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x1a4', 'number')\n * // 420\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c6421', 'string')\n * // 'Hello world'\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * to: 'string'\n * })\n * // 'Hello world'\n */\nexport function fromHex(hex, toOrOpts) {\n const opts = typeof toOrOpts === 'string' ? { to: toOrOpts } : toOrOpts;\n const to = opts.to;\n if (to === 'number')\n return hexToNumber(hex, opts);\n if (to === 'bigint')\n return hexToBigInt(hex, opts);\n if (to === 'string')\n return hexToString(hex, opts);\n if (to === 'boolean')\n return hexToBool(hex, opts);\n return hexToBytes(hex, opts);\n}\n/**\n * Decodes a hex value into a bigint.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextobigint\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns BigInt value.\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x1a4', { signed: true })\n * // 420n\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420n\n */\nexport function hexToBigInt(hex, opts = {}) {\n const { signed } = opts;\n if (opts.size)\n assertSize(hex, { size: opts.size });\n const value = BigInt(hex);\n if (!signed)\n return value;\n const size = (hex.length - 2) / 2;\n const max = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n if (value <= max)\n return value;\n return value - BigInt(`0x${'f'.padStart(size * 2, 'f')}`) - 1n;\n}\n/**\n * Decodes a hex value into a boolean.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextobool\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Boolean value.\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x01')\n * // true\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x0000000000000000000000000000000000000000000000000000000000000001', { size: 32 })\n * // true\n */\nexport function hexToBool(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = trim(hex);\n }\n if (trim(hex) === '0x00')\n return false;\n if (trim(hex) === '0x01')\n return true;\n throw new InvalidHexBooleanError(hex);\n}\n/**\n * Decodes a hex string into a number.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextonumber\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Number value.\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToNumber('0x1a4')\n * // 420\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420\n */\nexport function hexToNumber(hex, opts = {}) {\n return Number(hexToBigInt(hex, opts));\n}\n/**\n * Decodes a hex value into a UTF-8 string.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextostring\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns String value.\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c6421')\n * // 'Hello world!'\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * })\n * // 'Hello world'\n */\nexport function hexToString(hex, opts = {}) {\n let bytes = hexToBytes(hex);\n if (opts.size) {\n assertSize(bytes, { size: opts.size });\n bytes = trim(bytes, { dir: 'right' });\n }\n return new TextDecoder().decode(bytes);\n}\n//# sourceMappingURL=fromHex.js.map","import { IntegerOutOfRangeError, } from '../../errors/encoding.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nconst hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, '0'));\n/**\n * Encodes a string, number, bigint, or ByteArray into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex\n * - Example: https://viem.sh/docs/utilities/toHex#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world')\n * // '0x48656c6c6f20776f726c6421'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex(420)\n * // '0x1a4'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world', { size: 32 })\n * // '0x48656c6c6f20776f726c64210000000000000000000000000000000000000000'\n */\nexport function toHex(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToHex(value, opts);\n if (typeof value === 'string') {\n return stringToHex(value, opts);\n }\n if (typeof value === 'boolean')\n return boolToHex(value, opts);\n return bytesToHex(value, opts);\n}\n/**\n * Encodes a boolean into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#booltohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true)\n * // '0x1'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(false)\n * // '0x0'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true, { size: 32 })\n * // '0x0000000000000000000000000000000000000000000000000000000000000001'\n */\nexport function boolToHex(value, opts = {}) {\n const hex = `0x${Number(value)}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a bytes array into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#bytestohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]), { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function bytesToHex(value, opts = {}) {\n let string = '';\n for (let i = 0; i < value.length; i++) {\n string += hexes[value[i]];\n }\n const hex = `0x${string}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { dir: 'right', size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a number or bigint into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#numbertohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420)\n * // '0x1a4'\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420, { size: 32 })\n * // '0x00000000000000000000000000000000000000000000000000000000000001a4'\n */\nexport function numberToHex(value_, opts = {}) {\n const { signed, size } = opts;\n const value = BigInt(value_);\n let maxValue;\n if (size) {\n if (signed)\n maxValue = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n else\n maxValue = 2n ** (BigInt(size) * 8n) - 1n;\n }\n else if (typeof value_ === 'number') {\n maxValue = BigInt(Number.MAX_SAFE_INTEGER);\n }\n const minValue = typeof maxValue === 'bigint' && signed ? -maxValue - 1n : 0;\n if ((maxValue && value > maxValue) || value < minValue) {\n const suffix = typeof value_ === 'bigint' ? 'n' : '';\n throw new IntegerOutOfRangeError({\n max: maxValue ? `${maxValue}${suffix}` : undefined,\n min: `${minValue}${suffix}`,\n signed,\n size,\n value: `${value_}${suffix}`,\n });\n }\n const hex = `0x${(signed && value < 0 ? (1n << BigInt(size * 8)) + BigInt(value) : value).toString(16)}`;\n if (size)\n return pad(hex, { size });\n return hex;\n}\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#stringtohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!')\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!', { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function stringToHex(value_, opts = {}) {\n const value = encoder.encode(value_);\n return bytesToHex(value, opts);\n}\n//# sourceMappingURL=toHex.js.map","import { InvalidDefinitionTypeError, } from '../../errors/abi.js';\nexport function formatAbiItem(abiItem, { includeName = false } = {}) {\n if (abiItem.type !== 'function' &&\n abiItem.type !== 'event' &&\n abiItem.type !== 'error')\n throw new InvalidDefinitionTypeError(abiItem.type);\n return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;\n}\nexport function formatAbiParams(params, { includeName = false } = {}) {\n if (!params)\n return '';\n return params\n .map((param) => formatAbiParam(param, { includeName }))\n .join(includeName ? ', ' : ',');\n}\nfunction formatAbiParam(param, { includeName }) {\n if (param.type.startsWith('tuple')) {\n return `(${formatAbiParams(param.components, { includeName })})${param.type.slice('tuple'.length)}`;\n }\n return param.type + (includeName && param.name ? ` ${param.name}` : '');\n}\n//# sourceMappingURL=formatAbiItem.js.map","import { formatAbiItem, formatAbiParams } from '../utils/abi/formatAbiItem.js';\nimport { size } from '../utils/data/size.js';\nimport { BaseError } from './base.js';\nexport class AbiConstructorNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'A constructor was not found on the ABI.',\n 'Make sure you are using the correct ABI and that the constructor exists on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiConstructorNotFoundError',\n });\n }\n}\nexport class AbiConstructorParamsNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.',\n 'Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiConstructorParamsNotFoundError',\n });\n }\n}\nexport class AbiDecodingDataSizeInvalidError extends BaseError {\n constructor({ data, size }) {\n super([\n `Data size of ${size} bytes is invalid.`,\n 'Size must be in increments of 32 bytes (size % 32 === 0).',\n ].join('\\n'), {\n metaMessages: [`Data: ${data} (${size} bytes)`],\n name: 'AbiDecodingDataSizeInvalidError',\n });\n }\n}\nexport class AbiDecodingDataSizeTooSmallError extends BaseError {\n constructor({ data, params, size, }) {\n super([`Data size of ${size} bytes is too small for given parameters.`].join('\\n'), {\n metaMessages: [\n `Params: (${formatAbiParams(params, { includeName: true })})`,\n `Data: ${data} (${size} bytes)`,\n ],\n name: 'AbiDecodingDataSizeTooSmallError',\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"params\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"size\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n this.params = params;\n this.size = size;\n }\n}\nexport class AbiDecodingZeroDataError extends BaseError {\n constructor() {\n super('Cannot decode zero data (\"0x\") with ABI parameters.', {\n name: 'AbiDecodingZeroDataError',\n });\n }\n}\nexport class AbiEncodingArrayLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, type, }) {\n super([\n `ABI encoding array length mismatch for type ${type}.`,\n `Expected length: ${expectedLength}`,\n `Given length: ${givenLength}`,\n ].join('\\n'), { name: 'AbiEncodingArrayLengthMismatchError' });\n }\n}\nexport class AbiEncodingBytesSizeMismatchError extends BaseError {\n constructor({ expectedSize, value }) {\n super(`Size of bytes \"${value}\" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`, { name: 'AbiEncodingBytesSizeMismatchError' });\n }\n}\nexport class AbiEncodingLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, }) {\n super([\n 'ABI encoding params/values length mismatch.',\n `Expected length (params): ${expectedLength}`,\n `Given length (values): ${givenLength}`,\n ].join('\\n'), { name: 'AbiEncodingLengthMismatchError' });\n }\n}\nexport class AbiErrorInputsNotFoundError extends BaseError {\n constructor(errorName, { docsPath }) {\n super([\n `Arguments (\\`args\\`) were provided to \"${errorName}\", but \"${errorName}\" on the ABI does not contain any parameters (\\`inputs\\`).`,\n 'Cannot encode error result without knowing what the parameter types are.',\n 'Make sure you are using the correct ABI and that the inputs exist on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiErrorInputsNotFoundError',\n });\n }\n}\nexport class AbiErrorNotFoundError extends BaseError {\n constructor(errorName, { docsPath } = {}) {\n super([\n `Error ${errorName ? `\"${errorName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiErrorNotFoundError',\n });\n }\n}\nexport class AbiErrorSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded error signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n name: 'AbiErrorSignatureNotFoundError',\n });\n Object.defineProperty(this, \"signature\", {\