{"version":3,"file":"defineChain-Dby2um0a.mjs","names":[],"sources":["../../../node_modules/.pnpm/viem@2.47.6_typescript@6.0.2_zod@4.3.6/node_modules/viem/_esm/utils/formatters/transaction.js","../../../node_modules/.pnpm/viem@2.47.6_typescript@6.0.2_zod@4.3.6/node_modules/viem/_esm/utils/formatters/block.js","../../../node_modules/.pnpm/viem@2.47.6_typescript@6.0.2_zod@4.3.6/node_modules/viem/_esm/utils/formatters/log.js","../../../node_modules/.pnpm/viem@2.47.6_typescript@6.0.2_zod@4.3.6/node_modules/viem/_esm/errors/account.js","../../../node_modules/.pnpm/viem@2.47.6_typescript@6.0.2_zod@4.3.6/node_modules/viem/_esm/utils/formatters/transactionReceipt.js","../../../node_modules/.pnpm/viem@2.47.6_typescript@6.0.2_zod@4.3.6/node_modules/viem/_esm/utils/chain/defineChain.js"],"sourcesContent":["import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nexport const transactionType = {\n    '0x0': 'legacy',\n    '0x1': 'eip2930',\n    '0x2': 'eip1559',\n    '0x3': 'eip4844',\n    '0x4': 'eip7702',\n};\nexport function formatTransaction(transaction, _) {\n    const transaction_ = {\n        ...transaction,\n        blockHash: transaction.blockHash ? transaction.blockHash : null,\n        blockNumber: transaction.blockNumber\n            ? BigInt(transaction.blockNumber)\n            : null,\n        chainId: transaction.chainId ? hexToNumber(transaction.chainId) : undefined,\n        gas: transaction.gas ? BigInt(transaction.gas) : undefined,\n        gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : undefined,\n        maxFeePerBlobGas: transaction.maxFeePerBlobGas\n            ? BigInt(transaction.maxFeePerBlobGas)\n            : undefined,\n        maxFeePerGas: transaction.maxFeePerGas\n            ? BigInt(transaction.maxFeePerGas)\n            : undefined,\n        maxPriorityFeePerGas: transaction.maxPriorityFeePerGas\n            ? BigInt(transaction.maxPriorityFeePerGas)\n            : undefined,\n        nonce: transaction.nonce ? hexToNumber(transaction.nonce) : undefined,\n        to: transaction.to ? transaction.to : null,\n        transactionIndex: transaction.transactionIndex\n            ? Number(transaction.transactionIndex)\n            : null,\n        type: transaction.type\n            ? transactionType[transaction.type]\n            : undefined,\n        typeHex: transaction.type ? transaction.type : undefined,\n        value: transaction.value ? BigInt(transaction.value) : undefined,\n        v: transaction.v ? BigInt(transaction.v) : undefined,\n    };\n    if (transaction.authorizationList)\n        transaction_.authorizationList = formatAuthorizationList(transaction.authorizationList);\n    transaction_.yParity = (() => {\n        // If `yParity` is provided, we will use it.\n        if (transaction.yParity)\n            return Number(transaction.yParity);\n        // If no `yParity` provided, try derive from `v`.\n        if (typeof transaction_.v === 'bigint') {\n            if (transaction_.v === 0n || transaction_.v === 27n)\n                return 0;\n            if (transaction_.v === 1n || transaction_.v === 28n)\n                return 1;\n            if (transaction_.v >= 35n)\n                return transaction_.v % 2n === 0n ? 1 : 0;\n        }\n        return undefined;\n    })();\n    if (transaction_.type === 'legacy') {\n        delete transaction_.accessList;\n        delete transaction_.maxFeePerBlobGas;\n        delete transaction_.maxFeePerGas;\n        delete transaction_.maxPriorityFeePerGas;\n        delete transaction_.yParity;\n    }\n    if (transaction_.type === 'eip2930') {\n        delete transaction_.maxFeePerBlobGas;\n        delete transaction_.maxFeePerGas;\n        delete transaction_.maxPriorityFeePerGas;\n    }\n    if (transaction_.type === 'eip1559')\n        delete transaction_.maxFeePerBlobGas;\n    return transaction_;\n}\nexport const defineTransaction = /*#__PURE__*/ defineFormatter('transaction', formatTransaction);\n//////////////////////////////////////////////////////////////////////////////\nfunction formatAuthorizationList(authorizationList) {\n    return authorizationList.map((authorization) => ({\n        address: authorization.address,\n        chainId: Number(authorization.chainId),\n        nonce: Number(authorization.nonce),\n        r: authorization.r,\n        s: authorization.s,\n        yParity: Number(authorization.yParity),\n    }));\n}\n//# sourceMappingURL=transaction.js.map","import { defineFormatter } from './formatter.js';\nimport { formatTransaction } from './transaction.js';\nexport function formatBlock(block, _) {\n    const transactions = (block.transactions ?? []).map((transaction) => {\n        if (typeof transaction === 'string')\n            return transaction;\n        return formatTransaction(transaction);\n    });\n    return {\n        ...block,\n        baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,\n        blobGasUsed: block.blobGasUsed ? BigInt(block.blobGasUsed) : undefined,\n        difficulty: block.difficulty ? BigInt(block.difficulty) : undefined,\n        excessBlobGas: block.excessBlobGas\n            ? BigInt(block.excessBlobGas)\n            : undefined,\n        gasLimit: block.gasLimit ? BigInt(block.gasLimit) : undefined,\n        gasUsed: block.gasUsed ? BigInt(block.gasUsed) : undefined,\n        hash: block.hash ? block.hash : null,\n        logsBloom: block.logsBloom ? block.logsBloom : null,\n        nonce: block.nonce ? block.nonce : null,\n        number: block.number ? BigInt(block.number) : null,\n        size: block.size ? BigInt(block.size) : undefined,\n        timestamp: block.timestamp ? BigInt(block.timestamp) : undefined,\n        transactions,\n        totalDifficulty: block.totalDifficulty\n            ? BigInt(block.totalDifficulty)\n            : null,\n    };\n}\nexport const defineBlock = /*#__PURE__*/ defineFormatter('block', formatBlock);\n//# sourceMappingURL=block.js.map","export function formatLog(log, { args, eventName, } = {}) {\n    return {\n        ...log,\n        blockHash: log.blockHash ? log.blockHash : null,\n        blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,\n        blockTimestamp: log.blockTimestamp\n            ? BigInt(log.blockTimestamp)\n            : log.blockTimestamp === null\n                ? null\n                : undefined,\n        logIndex: log.logIndex ? Number(log.logIndex) : null,\n        transactionHash: log.transactionHash ? log.transactionHash : null,\n        transactionIndex: log.transactionIndex\n            ? Number(log.transactionIndex)\n            : null,\n        ...(eventName ? { args, eventName } : {}),\n    };\n}\n//# sourceMappingURL=log.js.map","import { BaseError } from './base.js';\nexport class AccountNotFoundError extends BaseError {\n    constructor({ docsPath } = {}) {\n        super([\n            'Could not find an Account to execute with this Action.',\n            'Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client.',\n        ].join('\\n'), {\n            docsPath,\n            docsSlug: 'account',\n            name: 'AccountNotFoundError',\n        });\n    }\n}\nexport class AccountTypeNotSupportedError extends BaseError {\n    constructor({ docsPath, metaMessages, type, }) {\n        super(`Account type \"${type}\" is not supported.`, {\n            docsPath,\n            metaMessages,\n            name: 'AccountTypeNotSupportedError',\n        });\n    }\n}\n//# sourceMappingURL=account.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nimport { formatLog } from './log.js';\nimport { transactionType } from './transaction.js';\nexport const receiptStatuses = {\n    '0x0': 'reverted',\n    '0x1': 'success',\n};\nexport function formatTransactionReceipt(transactionReceipt, _) {\n    const receipt = {\n        ...transactionReceipt,\n        blockNumber: transactionReceipt.blockNumber\n            ? BigInt(transactionReceipt.blockNumber)\n            : null,\n        contractAddress: transactionReceipt.contractAddress\n            ? transactionReceipt.contractAddress\n            : null,\n        cumulativeGasUsed: transactionReceipt.cumulativeGasUsed\n            ? BigInt(transactionReceipt.cumulativeGasUsed)\n            : null,\n        effectiveGasPrice: transactionReceipt.effectiveGasPrice\n            ? BigInt(transactionReceipt.effectiveGasPrice)\n            : null,\n        gasUsed: transactionReceipt.gasUsed\n            ? BigInt(transactionReceipt.gasUsed)\n            : null,\n        logs: transactionReceipt.logs\n            ? transactionReceipt.logs.map((log) => formatLog(log))\n            : null,\n        to: transactionReceipt.to ? transactionReceipt.to : null,\n        transactionIndex: transactionReceipt.transactionIndex\n            ? hexToNumber(transactionReceipt.transactionIndex)\n            : null,\n        status: transactionReceipt.status\n            ? receiptStatuses[transactionReceipt.status]\n            : null,\n        type: transactionReceipt.type\n            ? transactionType[transactionReceipt.type] || transactionReceipt.type\n            : null,\n    };\n    if (transactionReceipt.blobGasPrice)\n        receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);\n    if (transactionReceipt.blobGasUsed)\n        receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);\n    return receipt;\n}\nexport const defineTransactionReceipt = /*#__PURE__*/ defineFormatter('transactionReceipt', formatTransactionReceipt);\n//# sourceMappingURL=transactionReceipt.js.map","export function defineChain(chain) {\n    const chainInstance = {\n        formatters: undefined,\n        fees: undefined,\n        serializers: undefined,\n        ...chain,\n    };\n    function extend(base) {\n        return (fnOrExtended) => {\n            const properties = (typeof fnOrExtended === 'function' ? fnOrExtended(base) : fnOrExtended);\n            const combined = { ...base, ...properties };\n            return Object.assign(combined, { extend: extend(combined) });\n        };\n    }\n    return Object.assign(chainInstance, {\n        extend: extend(chainInstance),\n    });\n}\nexport function extendSchema() {\n    return {};\n}\n//# sourceMappingURL=defineChain.js.map"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;AAEA,MAAa,kBAAkB;CAC3B,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACV;AACD,SAAgB,kBAAkB,aAAa,GAAG;CAC9C,MAAM,eAAe;EACjB,GAAG;EACH,WAAW,YAAY,YAAY,YAAY,YAAY;EAC3D,aAAa,YAAY,cACnB,OAAO,YAAY,YAAY,GAC/B;EACN,SAAS,YAAY,UAAU,YAAY,YAAY,QAAQ,GAAG,KAAA;EAClE,KAAK,YAAY,MAAM,OAAO,YAAY,IAAI,GAAG,KAAA;EACjD,UAAU,YAAY,WAAW,OAAO,YAAY,SAAS,GAAG,KAAA;EAChE,kBAAkB,YAAY,mBACxB,OAAO,YAAY,iBAAiB,GACpC,KAAA;EACN,cAAc,YAAY,eACpB,OAAO,YAAY,aAAa,GAChC,KAAA;EACN,sBAAsB,YAAY,uBAC5B,OAAO,YAAY,qBAAqB,GACxC,KAAA;EACN,OAAO,YAAY,QAAQ,YAAY,YAAY,MAAM,GAAG,KAAA;EAC5D,IAAI,YAAY,KAAK,YAAY,KAAK;EACtC,kBAAkB,YAAY,mBACxB,OAAO,YAAY,iBAAiB,GACpC;EACN,MAAM,YAAY,OACZ,gBAAgB,YAAY,QAC5B,KAAA;EACN,SAAS,YAAY,OAAO,YAAY,OAAO,KAAA;EAC/C,OAAO,YAAY,QAAQ,OAAO,YAAY,MAAM,GAAG,KAAA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