@capxul/cli 4.20.0-beta.27 → 4.20.0-beta.28

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.
@@ -1 +1 @@
1
- {"version":3,"file":"where-view-Csv4lEES.mjs","names":["encoder","size_","size","formatGwei","Value.formatGwei","sha256","sha256n","noble_sha256","toBytes","serializeTransaction","serializeTransaction_","sourceId"],"sources":["../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/chain/defineChain.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/version.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/base.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/encoding.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/isHex.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/size.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/trim.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/data.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/pad.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toHex.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toBytes.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/fromHex.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/formatter.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/transaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/block.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/log.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/transactionReceipt.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/number.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/concat.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/cursor.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/cursor.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toRlp.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/Value.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/formatGwei.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/transaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToCommitments.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToProofs.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/sha256.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/blob.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/blob.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobs.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobSidecars.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/address.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/chain.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/node.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/lru.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/keccak256.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/getAddress.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/isAddress.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/slice.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/assertTransaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/getTransactionType.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeAccessList.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeTransaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/contracts.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/formatters.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/serializers.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/chainConfig.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/chains/definitions/base.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/chains/definitions/baseSepolia.js","../../../packages/protocol/src/evm/networks.ts","../../../packages/protocol/src/primitives/record.ts","../src/runtime/where.ts","../src/runtime/where-view.ts"],"sourcesContent":["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","export const version = '2.55.18';\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 RlpDepthLimitExceededError extends BaseError {\n constructor({ limit }) {\n super(`RLP depth limit of \\`${limit}\\` exceeded.`, {\n name: 'RlpDepthLimitExceededError',\n });\n }\n}\nexport class RlpListBoundaryExceededError extends BaseError {\n constructor({ consumed, declared }) {\n super(`RLP list items consumed \\`${consumed}\\` bytes but the list declared a length of \\`${declared}\\`.`, { name: 'RlpListBoundaryExceededError' });\n }\n}\nexport class RlpTrailingBytesError extends BaseError {\n constructor({ count }) {\n super(`RLP payload encodes a single item, but \\`${count}\\` trailing ${count === 1 ? 'byte remains' : 'bytes remain'}.`, { name: 'RlpTrailingBytesError' });\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","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 './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","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 { 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 { IntegerOutOfRangeError, 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 = hexToNumber('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420\n */\nexport function hexToNumber(hex, opts = {}) {\n const value = hexToBigInt(hex, opts);\n const number = Number(value);\n if (!Number.isSafeInteger(number))\n throw new IntegerOutOfRangeError({\n max: `${Number.MAX_SAFE_INTEGER}`,\n min: `${Number.MIN_SAFE_INTEGER}`,\n signed: opts.signed,\n size: opts.size,\n value: `${value}n`,\n });\n return number;\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","export function defineFormatter(type, format) {\n return ({ exclude, format: overrides, }) => {\n return {\n exclude,\n format: (args, action) => {\n const formatted = format(args, action);\n if (exclude) {\n for (const key of exclude) {\n delete formatted[key];\n }\n }\n return {\n ...formatted,\n ...overrides(args, action),\n };\n },\n type,\n };\n };\n}\n//# sourceMappingURL=formatter.js.map","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 ...(transaction.blockTimestamp != null && {\n blockTimestamp: BigInt(transaction.blockTimestamp),\n }),\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 { 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 const maxInt8 = 2n ** (8n - 1n) - 1n;\nexport const maxInt16 = 2n ** (16n - 1n) - 1n;\nexport const maxInt24 = 2n ** (24n - 1n) - 1n;\nexport const maxInt32 = 2n ** (32n - 1n) - 1n;\nexport const maxInt40 = 2n ** (40n - 1n) - 1n;\nexport const maxInt48 = 2n ** (48n - 1n) - 1n;\nexport const maxInt56 = 2n ** (56n - 1n) - 1n;\nexport const maxInt64 = 2n ** (64n - 1n) - 1n;\nexport const maxInt72 = 2n ** (72n - 1n) - 1n;\nexport const maxInt80 = 2n ** (80n - 1n) - 1n;\nexport const maxInt88 = 2n ** (88n - 1n) - 1n;\nexport const maxInt96 = 2n ** (96n - 1n) - 1n;\nexport const maxInt104 = 2n ** (104n - 1n) - 1n;\nexport const maxInt112 = 2n ** (112n - 1n) - 1n;\nexport const maxInt120 = 2n ** (120n - 1n) - 1n;\nexport const maxInt128 = 2n ** (128n - 1n) - 1n;\nexport const maxInt136 = 2n ** (136n - 1n) - 1n;\nexport const maxInt144 = 2n ** (144n - 1n) - 1n;\nexport const maxInt152 = 2n ** (152n - 1n) - 1n;\nexport const maxInt160 = 2n ** (160n - 1n) - 1n;\nexport const maxInt168 = 2n ** (168n - 1n) - 1n;\nexport const maxInt176 = 2n ** (176n - 1n) - 1n;\nexport const maxInt184 = 2n ** (184n - 1n) - 1n;\nexport const maxInt192 = 2n ** (192n - 1n) - 1n;\nexport const maxInt200 = 2n ** (200n - 1n) - 1n;\nexport const maxInt208 = 2n ** (208n - 1n) - 1n;\nexport const maxInt216 = 2n ** (216n - 1n) - 1n;\nexport const maxInt224 = 2n ** (224n - 1n) - 1n;\nexport const maxInt232 = 2n ** (232n - 1n) - 1n;\nexport const maxInt240 = 2n ** (240n - 1n) - 1n;\nexport const maxInt248 = 2n ** (248n - 1n) - 1n;\nexport const maxInt256 = 2n ** (256n - 1n) - 1n;\nexport const minInt8 = -(2n ** (8n - 1n));\nexport const minInt16 = -(2n ** (16n - 1n));\nexport const minInt24 = -(2n ** (24n - 1n));\nexport const minInt32 = -(2n ** (32n - 1n));\nexport const minInt40 = -(2n ** (40n - 1n));\nexport const minInt48 = -(2n ** (48n - 1n));\nexport const minInt56 = -(2n ** (56n - 1n));\nexport const minInt64 = -(2n ** (64n - 1n));\nexport const minInt72 = -(2n ** (72n - 1n));\nexport const minInt80 = -(2n ** (80n - 1n));\nexport const minInt88 = -(2n ** (88n - 1n));\nexport const minInt96 = -(2n ** (96n - 1n));\nexport const minInt104 = -(2n ** (104n - 1n));\nexport const minInt112 = -(2n ** (112n - 1n));\nexport const minInt120 = -(2n ** (120n - 1n));\nexport const minInt128 = -(2n ** (128n - 1n));\nexport const minInt136 = -(2n ** (136n - 1n));\nexport const minInt144 = -(2n ** (144n - 1n));\nexport const minInt152 = -(2n ** (152n - 1n));\nexport const minInt160 = -(2n ** (160n - 1n));\nexport const minInt168 = -(2n ** (168n - 1n));\nexport const minInt176 = -(2n ** (176n - 1n));\nexport const minInt184 = -(2n ** (184n - 1n));\nexport const minInt192 = -(2n ** (192n - 1n));\nexport const minInt200 = -(2n ** (200n - 1n));\nexport const minInt208 = -(2n ** (208n - 1n));\nexport const minInt216 = -(2n ** (216n - 1n));\nexport const minInt224 = -(2n ** (224n - 1n));\nexport const minInt232 = -(2n ** (232n - 1n));\nexport const minInt240 = -(2n ** (240n - 1n));\nexport const minInt248 = -(2n ** (248n - 1n));\nexport const minInt256 = -(2n ** (256n - 1n));\nexport const maxUint8 = 2n ** 8n - 1n;\nexport const maxUint16 = 2n ** 16n - 1n;\nexport const maxUint24 = 2n ** 24n - 1n;\nexport const maxUint32 = 2n ** 32n - 1n;\nexport const maxUint40 = 2n ** 40n - 1n;\nexport const maxUint48 = 2n ** 48n - 1n;\nexport const maxUint56 = 2n ** 56n - 1n;\nexport const maxUint64 = 2n ** 64n - 1n;\nexport const maxUint72 = 2n ** 72n - 1n;\nexport const maxUint80 = 2n ** 80n - 1n;\nexport const maxUint88 = 2n ** 88n - 1n;\nexport const maxUint96 = 2n ** 96n - 1n;\nexport const maxUint104 = 2n ** 104n - 1n;\nexport const maxUint112 = 2n ** 112n - 1n;\nexport const maxUint120 = 2n ** 120n - 1n;\nexport const maxUint128 = 2n ** 128n - 1n;\nexport const maxUint136 = 2n ** 136n - 1n;\nexport const maxUint144 = 2n ** 144n - 1n;\nexport const maxUint152 = 2n ** 152n - 1n;\nexport const maxUint160 = 2n ** 160n - 1n;\nexport const maxUint168 = 2n ** 168n - 1n;\nexport const maxUint176 = 2n ** 176n - 1n;\nexport const maxUint184 = 2n ** 184n - 1n;\nexport const maxUint192 = 2n ** 192n - 1n;\nexport const maxUint200 = 2n ** 200n - 1n;\nexport const maxUint208 = 2n ** 208n - 1n;\nexport const maxUint216 = 2n ** 216n - 1n;\nexport const maxUint224 = 2n ** 224n - 1n;\nexport const maxUint232 = 2n ** 232n - 1n;\nexport const maxUint240 = 2n ** 240n - 1n;\nexport const maxUint248 = 2n ** 248n - 1n;\nexport const maxUint256 = 2n ** 256n - 1n;\n//# sourceMappingURL=number.js.map","export function concat(values) {\n if (typeof values[0] === 'string')\n return concatHex(values);\n return concatBytes(values);\n}\nexport function concatBytes(values) {\n let length = 0;\n for (const arr of values) {\n length += arr.length;\n }\n const result = new Uint8Array(length);\n let offset = 0;\n for (const arr of values) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n}\nexport function concatHex(values) {\n return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}`;\n}\n//# sourceMappingURL=concat.js.map","import { BaseError } from './base.js';\nexport class NegativeOffsetError extends BaseError {\n constructor({ offset }) {\n super(`Offset \\`${offset}\\` cannot be negative.`, {\n name: 'NegativeOffsetError',\n });\n }\n}\nexport class PositionOutOfBoundsError extends BaseError {\n constructor({ length, position }) {\n super(`Position \\`${position}\\` is out of bounds (\\`0 < position < ${length}\\`).`, { name: 'PositionOutOfBoundsError' });\n }\n}\nexport class RecursiveReadLimitExceededError extends BaseError {\n constructor({ count, limit }) {\n super(`Recursive read limit of \\`${limit}\\` exceeded (recursive read count: \\`${count}\\`).`, { name: 'RecursiveReadLimitExceededError' });\n }\n}\n//# sourceMappingURL=cursor.js.map","import { NegativeOffsetError, PositionOutOfBoundsError, RecursiveReadLimitExceededError, } from '../errors/cursor.js';\nconst staticCursor = {\n bytes: new Uint8Array(),\n dataView: new DataView(new ArrayBuffer(0)),\n position: 0,\n positionReadCount: new Map(),\n recursiveReadCount: 0,\n recursiveReadLimit: Number.POSITIVE_INFINITY,\n assertReadLimit() {\n if (this.recursiveReadCount >= this.recursiveReadLimit)\n throw new RecursiveReadLimitExceededError({\n count: this.recursiveReadCount + 1,\n limit: this.recursiveReadLimit,\n });\n },\n assertPosition(position) {\n if (position < 0 || position > this.bytes.length - 1)\n throw new PositionOutOfBoundsError({\n length: this.bytes.length,\n position,\n });\n },\n decrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position - offset;\n this.assertPosition(position);\n this.position = position;\n },\n getReadCount(position) {\n return this.positionReadCount.get(position || this.position) || 0;\n },\n incrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position + offset;\n this.assertPosition(position);\n this.position = position;\n },\n inspectByte(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectBytes(length, position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + length - 1);\n return this.bytes.subarray(position, position + length);\n },\n inspectUint8(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectUint16(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 1);\n return this.dataView.getUint16(position);\n },\n inspectUint24(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 2);\n return ((this.dataView.getUint16(position) << 8) +\n this.dataView.getUint8(position + 2));\n },\n inspectUint32(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 3);\n return this.dataView.getUint32(position);\n },\n pushByte(byte) {\n this.assertPosition(this.position);\n this.bytes[this.position] = byte;\n this.position++;\n },\n pushBytes(bytes) {\n this.assertPosition(this.position + bytes.length - 1);\n this.bytes.set(bytes, this.position);\n this.position += bytes.length;\n },\n pushUint8(value) {\n this.assertPosition(this.position);\n this.bytes[this.position] = value;\n this.position++;\n },\n pushUint16(value) {\n this.assertPosition(this.position + 1);\n this.dataView.setUint16(this.position, value);\n this.position += 2;\n },\n pushUint24(value) {\n this.assertPosition(this.position + 2);\n this.dataView.setUint16(this.position, value >> 8);\n this.dataView.setUint8(this.position + 2, value & ~4294967040);\n this.position += 3;\n },\n pushUint32(value) {\n this.assertPosition(this.position + 3);\n this.dataView.setUint32(this.position, value);\n this.position += 4;\n },\n readByte() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectByte();\n this.position++;\n return value;\n },\n readBytes(length, size) {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectBytes(length);\n this.position += size ?? length;\n return value;\n },\n readUint8() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint8();\n this.position += 1;\n return value;\n },\n readUint16() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint16();\n this.position += 2;\n return value;\n },\n readUint24() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint24();\n this.position += 3;\n return value;\n },\n readUint32() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint32();\n this.position += 4;\n return value;\n },\n get remaining() {\n return this.bytes.length - this.position;\n },\n setPosition(position) {\n const oldPosition = this.position;\n this.assertPosition(position);\n this.position = position;\n return () => (this.position = oldPosition);\n },\n _touch() {\n if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)\n return;\n const count = this.getReadCount();\n this.positionReadCount.set(this.position, count + 1);\n if (count > 0)\n this.recursiveReadCount++;\n },\n};\nexport function createCursor(bytes, { recursiveReadLimit = 8_192 } = {}) {\n const cursor = Object.create(staticCursor);\n cursor.bytes = bytes;\n cursor.dataView = new DataView(bytes.buffer ?? bytes, bytes.byteOffset, bytes.byteLength);\n cursor.positionReadCount = new Map();\n cursor.recursiveReadLimit = recursiveReadLimit;\n return cursor;\n}\n//# sourceMappingURL=cursor.js.map","import { BaseError } from '../../errors/base.js';\nimport { createCursor, } from '../cursor.js';\nimport { hexToBytes } from './toBytes.js';\nimport { bytesToHex } from './toHex.js';\nexport function toRlp(bytes, to = 'hex') {\n const encodable = getEncodable(bytes);\n const cursor = createCursor(new Uint8Array(encodable.length));\n encodable.encode(cursor);\n if (to === 'hex')\n return bytesToHex(cursor.bytes);\n return cursor.bytes;\n}\nexport function bytesToRlp(bytes, to = 'bytes') {\n return toRlp(bytes, to);\n}\nexport function hexToRlp(hex, to = 'hex') {\n return toRlp(hex, to);\n}\nfunction getEncodable(bytes) {\n if (Array.isArray(bytes))\n return getEncodableList(bytes.map((x) => getEncodable(x)));\n return getEncodableBytes(bytes);\n}\nfunction getEncodableList(list) {\n const bodyLength = list.reduce((acc, x) => acc + x.length, 0);\n const sizeOfBodyLength = getSizeOfLength(bodyLength);\n const length = (() => {\n if (bodyLength <= 55)\n return 1 + bodyLength;\n return 1 + sizeOfBodyLength + bodyLength;\n })();\n return {\n length,\n encode(cursor) {\n if (bodyLength <= 55) {\n cursor.pushByte(0xc0 + bodyLength);\n }\n else {\n cursor.pushByte(0xc0 + 55 + sizeOfBodyLength);\n if (sizeOfBodyLength === 1)\n cursor.pushUint8(bodyLength);\n else if (sizeOfBodyLength === 2)\n cursor.pushUint16(bodyLength);\n else if (sizeOfBodyLength === 3)\n cursor.pushUint24(bodyLength);\n else\n cursor.pushUint32(bodyLength);\n }\n for (const { encode } of list) {\n encode(cursor);\n }\n },\n };\n}\nfunction getEncodableBytes(bytesOrHex) {\n const bytes = typeof bytesOrHex === 'string' ? hexToBytes(bytesOrHex) : bytesOrHex;\n const sizeOfBytesLength = getSizeOfLength(bytes.length);\n const length = (() => {\n if (bytes.length === 1 && bytes[0] < 0x80)\n return 1;\n if (bytes.length <= 55)\n return 1 + bytes.length;\n return 1 + sizeOfBytesLength + bytes.length;\n })();\n return {\n length,\n encode(cursor) {\n if (bytes.length === 1 && bytes[0] < 0x80) {\n cursor.pushBytes(bytes);\n }\n else if (bytes.length <= 55) {\n cursor.pushByte(0x80 + bytes.length);\n cursor.pushBytes(bytes);\n }\n else {\n cursor.pushByte(0x80 + 55 + sizeOfBytesLength);\n if (sizeOfBytesLength === 1)\n cursor.pushUint8(bytes.length);\n else if (sizeOfBytesLength === 2)\n cursor.pushUint16(bytes.length);\n else if (sizeOfBytesLength === 3)\n cursor.pushUint24(bytes.length);\n else\n cursor.pushUint32(bytes.length);\n cursor.pushBytes(bytes);\n }\n },\n };\n}\nfunction getSizeOfLength(length) {\n if (length < 2 ** 8)\n return 1;\n if (length < 2 ** 16)\n return 2;\n if (length < 2 ** 24)\n return 3;\n if (length < 2 ** 32)\n return 4;\n throw new BaseError('Length is too large.');\n}\n//# sourceMappingURL=toRlp.js.map","// Adapted from the Ox v1 `Value` module.\n/** @see https://ethereum.github.io/yellowpaper/paper.pdf */\nconst exponents = {\n wei: 0,\n gwei: 9,\n szabo: 12,\n finney: 15,\n ether: 18,\n};\n/**\n * Formats a `bigint` Value to its string representation (divided by the given exponent).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.format(420_000_000_000n, 9)\n * // @log: '420'\n * ```\n *\n * @param value - The `bigint` Value to format.\n * @param decimals - The exponent to divide the `bigint` Value by.\n * @returns The string representation of the Value.\n */\nexport function format(value, decimals = 0) {\n if (!Number.isInteger(decimals) || decimals < 0)\n throw new InvalidDecimalsError({ decimals });\n let display = value.toString();\n const negative = display.startsWith('-');\n if (negative)\n display = display.slice(1);\n display = display.padStart(decimals, '0');\n let [integer, fraction] = [\n display.slice(0, display.length - decimals),\n display.slice(display.length - decimals),\n ];\n fraction = fraction.replace(/(0+)$/, '');\n return `${negative ? '-' : ''}${integer || '0'}${fraction ? `.${fraction}` : ''}`;\n}\n/**\n * Formats a `bigint` Value (default: wei) to a string representation of Ether.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.formatEther(1_000_000_000_000_000_000n)\n * // @log: '1'\n * ```\n *\n * @param wei - The Value to format.\n * @param unit - The unit to format the Value in. @default 'wei'.\n * @returns The Ether string representation of the Value.\n */\nexport function formatEther(wei, unit = 'wei') {\n return format(wei, exponents.ether - exponents[unit]);\n}\n/**\n * Formats a `bigint` Value (default: wei) to a string representation of Gwei.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.formatGwei(1_000_000_000n)\n * // @log: '1'\n * ```\n *\n * @param wei - The Value to format.\n * @param unit - The unit to format the Value in. @default 'wei'.\n * @returns The Gwei string representation of the Value.\n */\nexport function formatGwei(wei, unit = 'wei') {\n return format(wei, exponents.gwei - exponents[unit]);\n}\n/**\n * Parses a `string` representation of a Value to `bigint` (multiplied by the given exponent).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.from('420', 9)\n * // @log: 420000000000n\n * ```\n *\n * @param value - The string representation of the Value.\n * @param decimals - The exponent to multiply the Value by.\n * @returns The `bigint` representation of the Value.\n */\nexport function from(value, decimals = 0) {\n if (!Number.isInteger(decimals) || decimals < 0)\n throw new InvalidDecimalsError({ decimals });\n // Require at least one digit overall. Rejects '', '.', '-', '-.' which\n // the previous regex accepted (and which then either produced garbage or\n // threw a raw `SyntaxError` from `BigInt('')`).\n if (!/^-?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)$/.test(value))\n throw new InvalidDecimalNumberError({ value });\n let [integer = '', fraction = '0'] = value.split('.');\n const negative = integer.startsWith('-');\n if (negative)\n integer = integer.slice(1);\n if (integer === '')\n integer = '0';\n // trim trailing zeros.\n fraction = fraction.replace(/(0+)$/, '');\n // round off if the fraction is larger than the number of decimals.\n if (decimals === 0) {\n // Round half-away-from-zero by inspecting the first fractional digit.\n if (fraction.length > 0 && Number.parseInt(fraction[0], 10) >= 5)\n integer = `${BigInt(integer) + 1n}`;\n fraction = '';\n }\n else if (fraction.length > decimals) {\n const left = fraction.slice(0, decimals);\n const roundDigit = Number.parseInt(fraction.slice(decimals, decimals + 1), 10);\n if (roundDigit >= 5) {\n // Carry through the truncated fraction digits into the integer part\n // without converting to a JS Number (avoids float precision loss).\n const carried = carry(left);\n if (carried.length > decimals) {\n // Carry overflowed into the integer part.\n fraction = carried.slice(1);\n integer = `${BigInt(integer) + 1n}`;\n }\n else {\n fraction = carried;\n }\n }\n else {\n fraction = left;\n }\n }\n else {\n fraction = fraction.padEnd(decimals, '0');\n }\n return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);\n}\n/**\n * Adds 1 to a digit string with carry, returning a string of the same length\n * unless the carry overflows past the most-significant digit (in which case\n * the returned string is one digit longer).\n *\n * @internal\n */\nfunction carry(digits) {\n const out = digits.split('');\n let i = out.length - 1;\n while (i >= 0) {\n const d = Number.parseInt(out[i], 10) + 1;\n if (d < 10) {\n out[i] = String(d);\n return out.join('');\n }\n out[i] = '0';\n i--;\n }\n return `1${out.join('')}`;\n}\n/**\n * Parses a string representation of Ether to a `bigint` Value (default: wei).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.fromEther('420')\n * // @log: 420000000000000000000n\n * ```\n *\n * @param ether - String representation of Ether.\n * @param unit - The unit to parse to. @default 'wei'.\n * @returns A `bigint` Value.\n */\nexport function fromEther(ether, unit = 'wei') {\n return from(ether, exponents.ether - exponents[unit]);\n}\n/**\n * Parses a string representation of Gwei to a `bigint` Value (default: wei).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.fromGwei('420')\n * // @log: 420000000000n\n * ```\n *\n * @param gwei - String representation of Gwei.\n * @param unit - The unit to parse to. @default 'wei'.\n * @returns A `bigint` Value.\n */\nexport function fromGwei(gwei, unit = 'wei') {\n return from(gwei, exponents.gwei - exponents[unit]);\n}\n/**\n * Thrown when a value is not a valid decimal number.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.fromEther('123.456.789')\n * // @error: Value.InvalidDecimalNumberError: Value `123.456.789` is not a valid decimal number.\n * ```\n */\nclass InvalidDecimalNumberError extends Error {\n constructor({ value }) {\n super(`Value \\`${value}\\` is not a valid decimal number.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Value.InvalidDecimalNumberError'\n });\n }\n}\n/**\n * Thrown when the `decimals` argument is not a non-negative integer.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.from('1', -1)\n * // @error: Value.InvalidDecimalsError: `decimals` must be a non-negative integer. Got `-1`.\n * ```\n */\nclass InvalidDecimalsError extends Error {\n constructor({ decimals }) {\n super(`\\`decimals\\` must be a non-negative integer. Got \\`${decimals}\\`.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Value.InvalidDecimalsError'\n });\n }\n}\n//# sourceMappingURL=Value.js.map","import * as Value from './Value.js';\n/**\n * Converts numerical wei to a string representation of gwei.\n *\n * - Docs: https://viem.sh/docs/utilities/formatGwei\n *\n * @example\n * import { formatGwei } from 'viem'\n *\n * formatGwei(1000000000n)\n * // '1'\n */\nexport function formatGwei(wei, unit = 'wei') {\n return Value.formatGwei(wei, unit);\n}\n//# sourceMappingURL=formatGwei.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport function prettyPrint(args) {\n const entries = Object.entries(args)\n .map(([key, value]) => {\n if (value === undefined || value === false)\n return null;\n return [key, value];\n })\n .filter(Boolean);\n const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);\n return entries\n .map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`)\n .join('\\n');\n}\nexport class FeeConflictError extends BaseError {\n constructor() {\n super([\n 'Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.',\n 'Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others.',\n ].join('\\n'), { name: 'FeeConflictError' });\n }\n}\nexport class FeePayerNonceMismatchError extends BaseError {\n constructor({ filledNonce, requestedNonce, }) {\n super('The filled transaction nonce does not match the requested nonce.', {\n metaMessages: [\n `Requested Nonce: ${requestedNonce}`,\n `Filled Nonce: ${filledNonce}`,\n ],\n name: 'FeePayerNonceMismatchError',\n });\n }\n}\nexport class InvalidLegacyVError extends BaseError {\n constructor({ v }) {\n super(`Invalid \\`v\\` value \"${v}\". Expected 27 or 28.`, {\n name: 'InvalidLegacyVError',\n });\n }\n}\nexport class InvalidYParityError extends BaseError {\n constructor({ yParity }) {\n super(`Invalid \\`yParity\\` value \"${yParity}\". Expected 0 or 1.`, {\n name: 'InvalidYParityError',\n });\n }\n}\nexport class InvalidSerializableTransactionError extends BaseError {\n constructor({ transaction }) {\n super('Cannot infer a transaction type from provided transaction.', {\n metaMessages: [\n 'Provided Transaction:',\n '{',\n prettyPrint(transaction),\n '}',\n '',\n 'To infer the type, either provide:',\n '- a `type` to the Transaction, or',\n '- an EIP-1559 Transaction with `maxFeePerGas`, or',\n '- an EIP-2930 Transaction with `gasPrice` & `accessList`, or',\n '- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or',\n '- an EIP-7702 Transaction with `authorizationList`, or',\n '- a Legacy Transaction with `gasPrice`',\n ],\n name: 'InvalidSerializableTransactionError',\n });\n }\n}\nexport class InvalidSerializedTransactionTypeError extends BaseError {\n constructor({ serializedType }) {\n super(`Serialized transaction type \"${serializedType}\" is invalid.`, {\n name: 'InvalidSerializedTransactionType',\n });\n Object.defineProperty(this, \"serializedType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedType = serializedType;\n }\n}\nexport class InvalidSerializedTransactionError extends BaseError {\n constructor({ attributes, serializedTransaction, type, }) {\n const missing = Object.entries(attributes)\n .map(([key, value]) => (typeof value === 'undefined' ? key : undefined))\n .filter(Boolean);\n super(`Invalid serialized transaction of type \"${type}\" was provided.`, {\n metaMessages: [\n `Serialized Transaction: \"${serializedTransaction}\"`,\n missing.length > 0 ? `Missing Attributes: ${missing.join(', ')}` : '',\n ].filter(Boolean),\n name: 'InvalidSerializedTransactionError',\n });\n Object.defineProperty(this, \"serializedTransaction\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"type\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedTransaction = serializedTransaction;\n this.type = type;\n }\n}\nexport class InvalidStorageKeySizeError extends BaseError {\n constructor({ storageKey }) {\n super(`Size for storage key \"${storageKey}\" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: 'InvalidStorageKeySizeError' });\n }\n}\nexport class TransactionExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n chain: chain && `${chain?.name} (id: ${chain?.id})`,\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency?.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Request Arguments:',\n prettyArgs,\n ].filter(Boolean),\n name: 'TransactionExecutionError',\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.cause = cause;\n }\n}\nexport class TransactionNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, blockTag, hash, index, }) {\n let identifier = 'Transaction';\n if (blockTag && index !== undefined)\n identifier = `Transaction at block time \"${blockTag}\" at index \"${index}\"`;\n if (blockHash && index !== undefined)\n identifier = `Transaction at block hash \"${blockHash}\" at index \"${index}\"`;\n if (blockNumber && index !== undefined)\n identifier = `Transaction at block number \"${blockNumber}\" at index \"${index}\"`;\n if (hash)\n identifier = `Transaction with hash \"${hash}\"`;\n super(`${identifier} could not be found.`, {\n name: 'TransactionNotFoundError',\n });\n }\n}\nexport class TransactionReceiptNotFoundError extends BaseError {\n constructor({ hash }) {\n super(`Transaction receipt with hash \"${hash}\" could not be found. The Transaction may not be processed on a block yet.`, {\n name: 'TransactionReceiptNotFoundError',\n });\n }\n}\nexport class TransactionReceiptRevertedError extends BaseError {\n constructor({ receipt }) {\n super(`Transaction with hash \"${receipt.transactionHash}\" reverted.`, {\n metaMessages: [\n 'The receipt marked the transaction as \"reverted\". This could mean that the function on the contract you are trying to call threw an error.',\n ' ',\n 'You can attempt to extract the revert reason by:',\n '- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract',\n '- using the `call` Action with raw `data`',\n ],\n name: 'TransactionReceiptRevertedError',\n });\n Object.defineProperty(this, \"receipt\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.receipt = receipt;\n }\n}\nexport class WaitForTransactionReceiptTimeoutError extends BaseError {\n constructor({ hash }) {\n super(`Timed out while waiting for transaction with hash \"${hash}\" to be confirmed.`, { name: 'WaitForTransactionReceiptTimeoutError' });\n }\n}\n//# sourceMappingURL=transaction.js.map","import { toHex } from '../encoding/toHex.js';\nimport { toYParitySignatureArray } from '../transaction/serializeTransaction.js';\n/*\n * Serializes an EIP-7702 authorization list.\n */\nexport function serializeAuthorizationList(authorizationList) {\n if (!authorizationList || authorizationList.length === 0)\n return [];\n const serializedAuthorizationList = [];\n for (const authorization of authorizationList) {\n const { chainId, nonce, ...signature } = authorization;\n const contractAddress = authorization.address;\n serializedAuthorizationList.push([\n chainId ? toHex(chainId) : '0x',\n contractAddress,\n nonce ? toHex(nonce) : '0x',\n ...toYParitySignatureArray({}, signature),\n ]);\n }\n return serializedAuthorizationList;\n}\n//# sourceMappingURL=serializeAuthorizationList.js.map","import { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Compute commitments from a list of blobs.\n *\n * @example\n * ```ts\n * import { blobsToCommitments, toBlobs } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * ```\n */\nexport function blobsToCommitments(parameters) {\n const { kzg } = parameters;\n const to = parameters.to ?? (typeof parameters.blobs[0] === 'string' ? 'hex' : 'bytes');\n const blobs = (typeof parameters.blobs[0] === 'string'\n ? parameters.blobs.map((x) => hexToBytes(x))\n : parameters.blobs);\n const commitments = [];\n for (const blob of blobs)\n commitments.push(Uint8Array.from(kzg.blobToKzgCommitment(blob)));\n return (to === 'bytes'\n ? commitments\n : commitments.map((x) => bytesToHex(x)));\n}\n//# sourceMappingURL=blobsToCommitments.js.map","import { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Compute the proofs for a list of blobs and their commitments.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const proofs = blobsToProofs({ blobs, commitments, kzg })\n * ```\n */\nexport function blobsToProofs(parameters) {\n const { kzg } = parameters;\n const to = parameters.to ?? (typeof parameters.blobs[0] === 'string' ? 'hex' : 'bytes');\n const blobs = (typeof parameters.blobs[0] === 'string'\n ? parameters.blobs.map((x) => hexToBytes(x))\n : parameters.blobs);\n const commitments = (typeof parameters.commitments[0] === 'string'\n ? parameters.commitments.map((x) => hexToBytes(x))\n : parameters.commitments);\n const proofs = [];\n for (let i = 0; i < blobs.length; i++) {\n const blob = blobs[i];\n const commitment = commitments[i];\n proofs.push(Uint8Array.from(kzg.computeBlobKzgProof(blob, commitment)));\n }\n return (to === 'bytes'\n ? proofs\n : proofs.map((x) => bytesToHex(x)));\n}\n//# sourceMappingURL=blobsToProofs.js.map","/**\n * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.\n * @todo re-check https://issues.chromium.org/issues/42212588\n * @module\n */\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/**\n * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.\n *\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n *\n * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n * @deprecated\n */\nimport { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n, } from \"./sha2.js\";\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA256 = SHA256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha256 = sha256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA224 = SHA224n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha224 = sha224n;\n//# sourceMappingURL=sha256.js.map","import { sha256 as noble_sha256 } from '@noble/hashes/sha256';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function sha256(value, to_) {\n const to = to_ || 'hex';\n const bytes = noble_sha256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=sha256.js.map","import { bytesToHex } from '../encoding/toHex.js';\nimport { sha256 } from '../hash/sha256.js';\n/**\n * Transform a commitment to it's versioned hash.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * commitmentToVersionedHash,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const [commitment] = blobsToCommitments({ blobs, kzg })\n * const versionedHash = commitmentToVersionedHash({ commitment })\n * ```\n */\nexport function commitmentToVersionedHash(parameters) {\n const { commitment, version = 1 } = parameters;\n const to = parameters.to ?? (typeof commitment === 'string' ? 'hex' : 'bytes');\n const versionedHash = sha256(commitment, 'bytes');\n versionedHash.set([version], 0);\n return (to === 'bytes' ? versionedHash : bytesToHex(versionedHash));\n}\n//# sourceMappingURL=commitmentToVersionedHash.js.map","import { commitmentToVersionedHash, } from './commitmentToVersionedHash.js';\n/**\n * Transform a list of commitments to their versioned hashes.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * commitmentsToVersionedHashes,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const versionedHashes = commitmentsToVersionedHashes({ commitments })\n * ```\n */\nexport function commitmentsToVersionedHashes(parameters) {\n const { commitments, version } = parameters;\n const to = parameters.to ?? (typeof commitments[0] === 'string' ? 'hex' : 'bytes');\n const hashes = [];\n for (const commitment of commitments) {\n hashes.push(commitmentToVersionedHash({\n commitment,\n to,\n version,\n }));\n }\n return hashes;\n}\n//# sourceMappingURL=commitmentsToVersionedHashes.js.map","// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md#parameters\n/** Blob limit per transaction. */\nconst blobsPerTransaction = 6;\n/** The number of bytes in a BLS scalar field element. */\nexport const bytesPerFieldElement = 32;\n/** The number of field elements in a blob. */\nexport const fieldElementsPerBlob = 4096;\n/** The number of bytes in a blob. */\nexport const bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;\n/** Blob bytes limit per transaction. */\nexport const maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction -\n // terminator byte (0x80).\n 1 -\n // zero byte (0x00) appended to each field element.\n 1 * fieldElementsPerBlob * blobsPerTransaction;\n//# sourceMappingURL=blob.js.map","import { versionedHashVersionKzg } from '../constants/kzg.js';\nimport { BaseError } from './base.js';\nexport class BlobSizeTooLargeError extends BaseError {\n constructor({ maxSize, size }) {\n super('Blob size is too large.', {\n metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size} bytes`],\n name: 'BlobSizeTooLargeError',\n });\n }\n}\nexport class EmptyBlobError extends BaseError {\n constructor() {\n super('Blob data must not be empty.', { name: 'EmptyBlobError' });\n }\n}\nexport class InvalidVersionedHashSizeError extends BaseError {\n constructor({ hash, size, }) {\n super(`Versioned hash \"${hash}\" size is invalid.`, {\n metaMessages: ['Expected: 32', `Received: ${size}`],\n name: 'InvalidVersionedHashSizeError',\n });\n }\n}\nexport class InvalidVersionedHashVersionError extends BaseError {\n constructor({ hash, version, }) {\n super(`Versioned hash \"${hash}\" version is invalid.`, {\n metaMessages: [\n `Expected: ${versionedHashVersionKzg}`,\n `Received: ${version}`,\n ],\n name: 'InvalidVersionedHashVersionError',\n });\n }\n}\n//# sourceMappingURL=blob.js.map","import { bytesPerBlob, bytesPerFieldElement, fieldElementsPerBlob, maxBytesPerTransaction, } from '../../constants/blob.js';\nimport { BlobSizeTooLargeError, EmptyBlobError, } from '../../errors/blob.js';\nimport { createCursor } from '../cursor.js';\nimport { size } from '../data/size.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Transforms arbitrary data to blobs.\n *\n * @example\n * ```ts\n * import { toBlobs, stringToHex } from 'viem'\n *\n * const blobs = toBlobs({ data: stringToHex('hello world') })\n * ```\n */\nexport function toBlobs(parameters) {\n const to = parameters.to ?? (typeof parameters.data === 'string' ? 'hex' : 'bytes');\n const data = (typeof parameters.data === 'string'\n ? hexToBytes(parameters.data)\n : parameters.data);\n const size_ = size(data);\n if (!size_)\n throw new EmptyBlobError();\n if (size_ > maxBytesPerTransaction)\n throw new BlobSizeTooLargeError({\n maxSize: maxBytesPerTransaction,\n size: size_,\n });\n const blobs = [];\n let active = true;\n let position = 0;\n while (active) {\n const blob = createCursor(new Uint8Array(bytesPerBlob));\n let size = 0;\n while (size < fieldElementsPerBlob) {\n const bytes = data.slice(position, position + (bytesPerFieldElement - 1));\n // Push a zero byte so the field element doesn't overflow the BLS modulus.\n blob.pushByte(0x00);\n // Push the current segment of data bytes.\n blob.pushBytes(bytes);\n // If we detect that the current segment of data bytes is less than 31 bytes,\n // we can stop processing and push a terminator byte to indicate the end of the blob.\n if (bytes.length < 31) {\n blob.pushByte(0x80);\n active = false;\n break;\n }\n size++;\n position += 31;\n }\n blobs.push(blob);\n }\n return (to === 'bytes'\n ? blobs.map((x) => x.bytes)\n : blobs.map((x) => bytesToHex(x.bytes)));\n}\n//# sourceMappingURL=toBlobs.js.map","import { blobsToCommitments, } from './blobsToCommitments.js';\nimport { blobsToProofs } from './blobsToProofs.js';\nimport { toBlobs } from './toBlobs.js';\n/**\n * Transforms arbitrary data (or blobs, commitments, & proofs) into a sidecar array.\n *\n * @example\n * ```ts\n * import { toBlobSidecars, stringToHex } from 'viem'\n *\n * const sidecars = toBlobSidecars({ data: stringToHex('hello world') })\n * ```\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * toBlobs,\n * blobsToProofs,\n * toBlobSidecars,\n * stringToHex\n * } from 'viem'\n *\n * const blobs = toBlobs({ data: stringToHex('hello world') })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const proofs = blobsToProofs({ blobs, commitments, kzg })\n *\n * const sidecars = toBlobSidecars({ blobs, commitments, proofs })\n * ```\n */\nexport function toBlobSidecars(parameters) {\n const { data, kzg, to } = parameters;\n const blobs = parameters.blobs ?? toBlobs({ data: data, to });\n const commitments = parameters.commitments ?? blobsToCommitments({ blobs, kzg: kzg, to });\n const proofs = parameters.proofs ?? blobsToProofs({ blobs, commitments, kzg: kzg, to });\n const sidecars = [];\n for (let i = 0; i < blobs.length; i++)\n sidecars.push({\n blob: blobs[i],\n commitment: commitments[i],\n proof: proofs[i],\n });\n return sidecars;\n}\n//# sourceMappingURL=toBlobSidecars.js.map","import { BaseError } from './base.js';\nexport class InvalidAddressError extends BaseError {\n constructor({ address }) {\n super(`Address \"${address}\" is invalid.`, {\n metaMessages: [\n '- Address must be a hex value of 20 bytes (40 hex characters).',\n '- Address must match its checksum counterpart.',\n ],\n name: 'InvalidAddressError',\n });\n }\n}\n//# sourceMappingURL=address.js.map","import { BaseError } from './base.js';\nexport class ChainDoesNotSupportContract extends BaseError {\n constructor({ blockNumber, chain, contract, }) {\n super(`Chain \"${chain.name}\" does not support contract \"${contract.name}\".`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ...(blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber\n ? [\n `- The contract \"${contract.name}\" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`,\n ]\n : [\n `- The chain does not have the contract \"${contract.name}\" configured.`,\n ]),\n ],\n name: 'ChainDoesNotSupportContract',\n });\n }\n}\nexport class ChainMismatchError extends BaseError {\n constructor({ chain, currentChainId, }) {\n super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} – ${chain.name}).`, {\n metaMessages: [\n `Current Chain ID: ${currentChainId}`,\n `Expected Chain ID: ${chain.id} – ${chain.name}`,\n ],\n name: 'ChainMismatchError',\n });\n }\n}\nexport class ChainNotFoundError extends BaseError {\n constructor() {\n super([\n 'No chain was provided to the request.',\n 'Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.',\n ].join('\\n'), {\n name: 'ChainNotFoundError',\n });\n }\n}\nexport class ClientChainNotConfiguredError extends BaseError {\n constructor() {\n super('No chain was provided to the Client.', {\n name: 'ClientChainNotConfiguredError',\n });\n }\n}\nexport class InvalidChainIdError extends BaseError {\n constructor({ chainId }) {\n super(typeof chainId === 'number'\n ? `Chain ID \"${chainId}\" is invalid.`\n : 'Chain ID is invalid.', { name: 'InvalidChainIdError' });\n }\n}\n//# sourceMappingURL=chain.js.map","import { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport class ExecutionRevertedError extends BaseError {\n constructor({ cause, message, } = {}) {\n const reason = message\n ?.replace('execution reverted: ', '')\n ?.replace('execution reverted', '');\n super(`Execution reverted ${reason ? `with reason: ${reason}` : 'for an unknown reason'}.`, {\n cause,\n name: 'ExecutionRevertedError',\n });\n }\n}\nObject.defineProperty(ExecutionRevertedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n});\nObject.defineProperty(ExecutionRevertedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /execution reverted|gas required exceeds allowance/\n});\nexport class FeeCapTooHighError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}) cannot be higher than the maximum allowed value (2^256-1).`, {\n cause,\n name: 'FeeCapTooHighError',\n });\n }\n}\nObject.defineProperty(FeeCapTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas higher than 2\\^256-1|fee cap higher than 2\\^256-1/\n});\nexport class FeeCapTooLowError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ''} gwei) cannot be lower than the block base fee.`, {\n cause,\n name: 'FeeCapTooLowError',\n });\n }\n}\nObject.defineProperty(FeeCapTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/\n});\nexport class NonceTooHighError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is higher than the next one expected.`, { cause, name: 'NonceTooHighError' });\n }\n}\nObject.defineProperty(NonceTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too high/\n});\nexport class NonceTooLowError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super([\n `Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is lower than the current nonce of the account.`,\n 'Try increasing the nonce or find the latest nonce with `getTransactionCount`.',\n ].join('\\n'), { cause, name: 'NonceTooLowError' });\n }\n}\nObject.defineProperty(NonceTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too low|transaction already imported|already known/\n});\nexport class NonceMaxValueError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}exceeds the maximum allowed nonce.`, { cause, name: 'NonceMaxValueError' });\n }\n}\nObject.defineProperty(NonceMaxValueError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce has max value/\n});\nexport class InsufficientFundsError extends BaseError {\n constructor({ cause } = {}) {\n super([\n 'The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.',\n ].join('\\n'), {\n cause,\n metaMessages: [\n 'This error could arise when the account does not have enough funds to:',\n ' - pay for the total gas fee,',\n ' - pay for the value to send.',\n ' ',\n 'The cost of the transaction is calculated as `gas * gas fee + value`, where:',\n ' - `gas` is the amount of gas needed for transaction to execute,',\n ' - `gas fee` is the gas fee,',\n ' - `value` is the amount of ether to send to the recipient.',\n ],\n name: 'InsufficientFundsError',\n });\n }\n}\nObject.defineProperty(InsufficientFundsError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /insufficient funds|exceeds transaction sender account balance/\n});\nexport class IntrinsicGasTooHighError extends BaseError {\n constructor({ cause, gas, } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction exceeds the limit allowed for the block.`, {\n cause,\n name: 'IntrinsicGasTooHighError',\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too high|gas limit reached/\n});\nexport class IntrinsicGasTooLowError extends BaseError {\n constructor({ cause, gas, } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction is too low.`, {\n cause,\n name: 'IntrinsicGasTooLowError',\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too low/\n});\nexport class TransactionTypeNotSupportedError extends BaseError {\n constructor({ cause }) {\n super('The transaction type is not supported for this chain.', {\n cause,\n name: 'TransactionTypeNotSupportedError',\n });\n }\n}\nObject.defineProperty(TransactionTypeNotSupportedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /transaction type not valid/\n});\nexport class TipAboveFeeCapError extends BaseError {\n constructor({ cause, maxPriorityFeePerGas, maxFeePerGas, } = {}) {\n super([\n `The provided tip (\\`maxPriorityFeePerGas\\`${maxPriorityFeePerGas\n ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei`\n : ''}) cannot be higher than the fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}).`,\n ].join('\\n'), {\n cause,\n name: 'TipAboveFeeCapError',\n });\n }\n}\nObject.defineProperty(TipAboveFeeCapError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/\n});\nexport class UnknownNodeError extends BaseError {\n constructor({ cause }) {\n super(`An error occurred while executing: ${cause?.shortMessage}`, {\n cause,\n name: 'UnknownNodeError',\n });\n }\n}\n//# sourceMappingURL=node.js.map","/**\n * Map with a LRU (Least recently used) policy.\n *\n * @link https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU\n */\nexport class LruMap extends Map {\n constructor(size) {\n super();\n Object.defineProperty(this, \"maxSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.maxSize = size;\n }\n get(key) {\n const value = super.get(key);\n if (super.has(key)) {\n super.delete(key);\n super.set(key, value);\n }\n return value;\n }\n set(key, value) {\n if (super.has(key))\n super.delete(key);\n super.set(key, value);\n if (this.maxSize && this.size > this.maxSize) {\n const firstKey = super.keys().next().value;\n if (firstKey !== undefined)\n super.delete(firstKey);\n }\n return this;\n }\n}\n//# sourceMappingURL=lru.js.map","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf),\n * [Website](https://keccak.team/keccak.html),\n * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub).\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from \"./_u64.js\";\n// prettier-ignore\nimport { abytes, aexists, anumber, aoutput, clean, createHasher, createXOFer, Hash, swap32IfBE, toBytes, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = [];\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n/** `keccakf1600` internal function, additionally allows to adjust round count. */\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/** Keccak sponge function. */\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n this.enableXOF = false;\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n // 0 < blockLen < 200\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('only keccak-f1600 function is supported');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { blockLen, state } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));\n/** SHA3-224 hash function. */\nexport const sha3_224 = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))();\n/** SHA3-256 hash function. Different from keccak-256. */\nexport const sha3_256 = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))();\n/** SHA3-384 hash function. */\nexport const sha3_384 = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))();\n/** SHA3-512 hash function. */\nexport const sha3_512 = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))();\n/** keccak-224 hash function. */\nexport const keccak_224 = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))();\n/** keccak-256 hash function. Different from SHA3-256. */\nexport const keccak_256 = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))();\n/** keccak-384 hash function. */\nexport const keccak_384 = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))();\n/** keccak-512 hash function. */\nexport const keccak_512 = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))();\nconst genShake = (suffix, blockLen, outputLen) => createXOFer((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\n/** SHAKE128 XOF with 128-bit security. */\nexport const shake128 = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))();\n/** SHAKE256 XOF with 256-bit security. */\nexport const shake256 = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))();\n//# sourceMappingURL=sha3.js.map","import { keccak_256 } from '@noble/hashes/sha3';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function keccak256(value, to_) {\n const to = to_ || 'hex';\n const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=keccak256.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { stringToBytes, } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { LruMap } from '../lru.js';\nimport { isAddress } from './isAddress.js';\nconst checksumAddressCache = /*#__PURE__*/ new LruMap(8192);\nexport function checksumAddress(address_, \n/**\n * Warning: EIP-1191 checksum addresses are generally not backwards compatible with the\n * wider Ethereum ecosystem, meaning it will break when validated against an application/tool\n * that relies on EIP-55 checksum encoding (checksum without chainId).\n *\n * It is highly recommended to not use this feature unless you\n * know what you are doing.\n *\n * See more: https://github.com/ethereum/EIPs/issues/1121\n */\nchainId) {\n if (checksumAddressCache.has(`${address_}.${chainId}`))\n return checksumAddressCache.get(`${address_}.${chainId}`);\n const hexAddress = chainId\n ? `${chainId}${address_.toLowerCase()}`\n : address_.substring(2).toLowerCase();\n const hash = keccak256(stringToBytes(hexAddress), 'bytes');\n const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split('');\n for (let i = 0; i < 40; i += 2) {\n if (hash[i >> 1] >> 4 >= 8 && address[i]) {\n address[i] = address[i].toUpperCase();\n }\n if ((hash[i >> 1] & 0x0f) >= 8 && address[i + 1]) {\n address[i + 1] = address[i + 1].toUpperCase();\n }\n }\n const result = `0x${address.join('')}`;\n checksumAddressCache.set(`${address_}.${chainId}`, result);\n return result;\n}\nexport function getAddress(address, \n/**\n * Warning: EIP-1191 checksum addresses are generally not backwards compatible with the\n * wider Ethereum ecosystem, meaning it will break when validated against an application/tool\n * that relies on EIP-55 checksum encoding (checksum without chainId).\n *\n * It is highly recommended to not use this feature unless you\n * know what you are doing.\n *\n * See more: https://github.com/ethereum/EIPs/issues/1121\n */\nchainId) {\n if (!isAddress(address, { strict: false }))\n throw new InvalidAddressError({ address });\n return checksumAddress(address, chainId);\n}\n//# sourceMappingURL=getAddress.js.map","import { LruMap } from '../lru.js';\nimport { checksumAddress } from './getAddress.js';\nconst addressRegex = /^0x[a-fA-F0-9]{40}$/;\n/** @internal */\nexport const isAddressCache = /*#__PURE__*/ new LruMap(8192);\nexport function isAddress(address, options) {\n const { strict = true } = options ?? {};\n const cacheKey = `${address}.${strict}`;\n if (isAddressCache.has(cacheKey))\n return isAddressCache.get(cacheKey);\n const result = (() => {\n if (!addressRegex.test(address))\n return false;\n if (address.toLowerCase() === address)\n return true;\n if (strict)\n return checksumAddress(address) === address;\n return true;\n })();\n isAddressCache.set(cacheKey, result);\n return result;\n}\n//# sourceMappingURL=isAddress.js.map","import { SliceOffsetOutOfBoundsError, } from '../../errors/data.js';\nimport { isHex } from './isHex.js';\nimport { size } from './size.js';\n/**\n * @description Returns a section of the hex or byte array given a start/end bytes offset.\n *\n * @param value The hex or byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function slice(value, start, end, { strict } = {}) {\n if (isHex(value, { strict: false }))\n return sliceHex(value, start, end, {\n strict,\n });\n return sliceBytes(value, start, end, {\n strict,\n });\n}\nfunction assertStartOffset(value, start) {\n if (typeof start === 'number' && start > 0 && start > size(value) - 1)\n throw new SliceOffsetOutOfBoundsError({\n offset: start,\n position: 'start',\n size: size(value),\n });\n}\nfunction assertEndOffset(value, start, end) {\n if (typeof start === 'number' &&\n typeof end === 'number' &&\n size(value) !== end - start) {\n throw new SliceOffsetOutOfBoundsError({\n offset: end,\n position: 'end',\n size: size(value),\n });\n }\n}\n/**\n * @description Returns a section of the byte array given a start/end bytes offset.\n *\n * @param value The byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceBytes(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = value_.slice(start, end);\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n/**\n * @description Returns a section of the hex value given a start/end bytes offset.\n *\n * @param value The hex value to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceHex(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = `0x${value_\n .replace('0x', '')\n .slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n//# sourceMappingURL=slice.js.map","import { versionedHashVersionKzg } from '../../constants/kzg.js';\nimport { maxUint256 } from '../../constants/number.js';\nimport { InvalidAddressError, } from '../../errors/address.js';\nimport { BaseError } from '../../errors/base.js';\nimport { EmptyBlobError, InvalidVersionedHashSizeError, InvalidVersionedHashVersionError, } from '../../errors/blob.js';\nimport { InvalidChainIdError, } from '../../errors/chain.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError, } from '../../errors/node.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { hexToNumber } from '../encoding/fromHex.js';\nexport function assertTransactionEIP7702(transaction) {\n const { authorizationList } = transaction;\n if (authorizationList) {\n for (const authorization of authorizationList) {\n const { chainId } = authorization;\n const address = authorization.address;\n if (!isAddress(address))\n throw new InvalidAddressError({ address });\n if (chainId < 0)\n throw new InvalidChainIdError({ chainId });\n }\n }\n assertTransactionEIP1559(transaction);\n}\nexport function assertTransactionEIP4844(transaction) {\n const { blobVersionedHashes } = transaction;\n if (blobVersionedHashes) {\n if (blobVersionedHashes.length === 0)\n throw new EmptyBlobError();\n for (const hash of blobVersionedHashes) {\n const size_ = size(hash);\n const version = hexToNumber(slice(hash, 0, 1));\n if (size_ !== 32)\n throw new InvalidVersionedHashSizeError({ hash, size: size_ });\n if (version !== versionedHashVersionKzg)\n throw new InvalidVersionedHashVersionError({\n hash,\n version,\n });\n }\n }\n assertTransactionEIP1559(transaction);\n}\nexport function assertTransactionEIP1559(transaction) {\n const { chainId, maxPriorityFeePerGas, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxFeePerGas && maxFeePerGas > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\nexport function assertTransactionEIP2930(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.');\n if (gasPrice && gasPrice > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\nexport function assertTransactionLegacy(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof chainId !== 'undefined' && chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.');\n if (gasPrice && gasPrice > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\n//# sourceMappingURL=assertTransaction.js.map","import { InvalidSerializableTransactionError, } from '../../errors/transaction.js';\nexport function getTransactionType(transaction) {\n if (transaction.type)\n return transaction.type;\n if (typeof transaction.authorizationList !== 'undefined')\n return 'eip7702';\n if (typeof transaction.blobs !== 'undefined' ||\n typeof transaction.blobVersionedHashes !== 'undefined' ||\n typeof transaction.maxFeePerBlobGas !== 'undefined' ||\n typeof transaction.sidecars !== 'undefined')\n return 'eip4844';\n if (typeof transaction.maxFeePerGas !== 'undefined' ||\n typeof transaction.maxPriorityFeePerGas !== 'undefined') {\n return 'eip1559';\n }\n if (typeof transaction.gasPrice !== 'undefined') {\n if (typeof transaction.accessList !== 'undefined')\n return 'eip2930';\n return 'legacy';\n }\n throw new InvalidSerializableTransactionError({ transaction });\n}\n//# sourceMappingURL=getTransactionType.js.map","import { InvalidAddressError, } from '../../errors/address.js';\nimport { InvalidStorageKeySizeError, } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\n/*\n * Serialize an EIP-2930 access list\n * @remarks\n * Use to create a transaction serializer with support for EIP-2930 access lists\n *\n * @param accessList - Array of objects of address and arrays of Storage Keys\n * @throws InvalidAddressError, InvalidStorageKeySizeError\n * @returns Array of hex strings\n */\nexport function serializeAccessList(accessList) {\n if (!accessList || accessList.length === 0)\n return [];\n const serializedAccessList = [];\n for (let i = 0; i < accessList.length; i++) {\n const { address, storageKeys } = accessList[i];\n for (let j = 0; j < storageKeys.length; j++) {\n if (storageKeys[j].length - 2 !== 64) {\n throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });\n }\n }\n if (!isAddress(address, { strict: false })) {\n throw new InvalidAddressError({ address });\n }\n serializedAccessList.push([address, storageKeys]);\n }\n return serializedAccessList;\n}\n//# sourceMappingURL=serializeAccessList.js.map","import { InvalidLegacyVError, } from '../../errors/transaction.js';\nimport { serializeAuthorizationList, } from '../authorization/serializeAuthorizationList.js';\nimport { blobsToCommitments, } from '../blob/blobsToCommitments.js';\nimport { blobsToProofs, } from '../blob/blobsToProofs.js';\nimport { commitmentsToVersionedHashes, } from '../blob/commitmentsToVersionedHashes.js';\nimport { toBlobSidecars, } from '../blob/toBlobSidecars.js';\nimport { concatHex } from '../data/concat.js';\nimport { trim } from '../data/trim.js';\nimport { bytesToHex, numberToHex, } from '../encoding/toHex.js';\nimport { toRlp } from '../encoding/toRlp.js';\nimport { assertTransactionEIP1559, assertTransactionEIP2930, assertTransactionEIP4844, assertTransactionEIP7702, assertTransactionLegacy, } from './assertTransaction.js';\nimport { getTransactionType, } from './getTransactionType.js';\nimport { serializeAccessList, } from './serializeAccessList.js';\nexport function serializeTransaction(transaction, signature) {\n const type = getTransactionType(transaction);\n if (type === 'eip1559')\n return serializeTransactionEIP1559(transaction, signature);\n if (type === 'eip2930')\n return serializeTransactionEIP2930(transaction, signature);\n if (type === 'eip4844')\n return serializeTransactionEIP4844(transaction, signature);\n if (type === 'eip7702')\n return serializeTransactionEIP7702(transaction, signature);\n return serializeTransactionLegacy(transaction, signature);\n}\nfunction serializeTransactionEIP7702(transaction, signature) {\n const { authorizationList, chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP7702(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedAuthorizationList = serializeAuthorizationList(authorizationList);\n return concatHex([\n '0x04',\n toRlp([\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n serializedAuthorizationList,\n ...toYParitySignatureArray(transaction, signature),\n ]),\n ]);\n}\nfunction serializeTransactionEIP4844(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP4844(transaction);\n let blobVersionedHashes = transaction.blobVersionedHashes;\n let sidecars = transaction.sidecars;\n // If `blobs` are passed, we will need to compute the KZG commitments & proofs.\n if (transaction.blobs &&\n (typeof blobVersionedHashes === 'undefined' ||\n typeof sidecars === 'undefined')) {\n const blobs = (typeof transaction.blobs[0] === 'string'\n ? transaction.blobs\n : transaction.blobs.map((x) => bytesToHex(x)));\n const kzg = transaction.kzg;\n const commitments = blobsToCommitments({\n blobs,\n kzg,\n });\n if (typeof blobVersionedHashes === 'undefined')\n blobVersionedHashes = commitmentsToVersionedHashes({\n commitments,\n });\n if (typeof sidecars === 'undefined') {\n const proofs = blobsToProofs({ blobs, commitments, kzg });\n sidecars = toBlobSidecars({ blobs, commitments, proofs });\n }\n }\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n maxFeePerBlobGas ? numberToHex(maxFeePerBlobGas) : '0x',\n blobVersionedHashes ?? [],\n ...toYParitySignatureArray(transaction, signature),\n ];\n const blobs = [];\n const commitments = [];\n const proofs = [];\n if (sidecars)\n for (let i = 0; i < sidecars.length; i++) {\n const { blob, commitment, proof } = sidecars[i];\n blobs.push(blob);\n commitments.push(commitment);\n proofs.push(proof);\n }\n return concatHex([\n '0x03',\n sidecars\n ? // If sidecars are enabled, envelope turns into a \"wrapper\":\n toRlp([serializedTransaction, blobs, commitments, proofs])\n : // If sidecars are disabled, standard envelope is used:\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP1559(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP1559(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ...toYParitySignatureArray(transaction, signature),\n ];\n return concatHex([\n '0x02',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP2930(transaction, signature) {\n const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;\n assertTransactionEIP2930(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n gasPrice ? numberToHex(gasPrice) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ...toYParitySignatureArray(transaction, signature),\n ];\n return concatHex([\n '0x01',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionLegacy(transaction, signature) {\n const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;\n assertTransactionLegacy(transaction);\n let serializedTransaction = [\n nonce ? numberToHex(nonce) : '0x',\n gasPrice ? numberToHex(gasPrice) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n ];\n if (signature) {\n const v = (() => {\n // EIP-155 (inferred chainId)\n if (signature.v >= 35n) {\n const inferredChainId = (signature.v - 35n) / 2n;\n if (inferredChainId > 0)\n return signature.v;\n return 27n + (signature.v === 35n ? 0n : 1n);\n }\n // EIP-155 (explicit chainId)\n if (chainId > 0)\n return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);\n // Pre-EIP-155 (no chainId)\n const v = 27n + (signature.v === 27n ? 0n : 1n);\n if (signature.v !== v)\n throw new InvalidLegacyVError({ v: signature.v });\n return v;\n })();\n const r = trim(signature.r);\n const s = trim(signature.s);\n serializedTransaction = [\n ...serializedTransaction,\n numberToHex(v),\n r === '0x00' ? '0x' : r,\n s === '0x00' ? '0x' : s,\n ];\n }\n else if (chainId > 0) {\n serializedTransaction = [\n ...serializedTransaction,\n numberToHex(chainId),\n '0x',\n '0x',\n ];\n }\n return toRlp(serializedTransaction);\n}\nexport function toYParitySignatureArray(transaction, signature_) {\n const signature = signature_ ?? transaction;\n const { v, yParity } = signature;\n if (typeof signature.r === 'undefined')\n return [];\n if (typeof signature.s === 'undefined')\n return [];\n if (typeof v === 'undefined' && typeof yParity === 'undefined')\n return [];\n const r = trim(signature.r);\n const s = trim(signature.s);\n const yParity_ = (() => {\n if (typeof yParity === 'number')\n return yParity ? numberToHex(1) : '0x';\n if (v === 0n)\n return '0x';\n if (v === 1n)\n return numberToHex(1);\n return v === 27n ? '0x' : numberToHex(1);\n })();\n return [yParity_, r === '0x00' ? '0x' : r, s === '0x00' ? '0x' : s];\n}\n//# sourceMappingURL=serializeTransaction.js.map","/**\n * Predeploy contracts for OP Stack.\n * @see https://github.com/ethereum-optimism/optimism/blob/develop/specs/predeploys.md\n */\nexport const contracts = {\n gasPriceOracle: { address: '0x420000000000000000000000000000000000000F' },\n l1Block: { address: '0x4200000000000000000000000000000000000015' },\n l2CrossDomainMessenger: {\n address: '0x4200000000000000000000000000000000000007',\n },\n l2Erc721Bridge: { address: '0x4200000000000000000000000000000000000014' },\n l2StandardBridge: { address: '0x4200000000000000000000000000000000000010' },\n l2ToL1MessagePasser: {\n address: '0x4200000000000000000000000000000000000016',\n },\n};\n//# sourceMappingURL=contracts.js.map","import { hexToBigInt, hexToNumber } from '../utils/encoding/fromHex.js';\nimport { defineBlock } from '../utils/formatters/block.js';\nimport { defineTransaction, formatTransaction, } from '../utils/formatters/transaction.js';\nimport { defineTransactionReceipt } from '../utils/formatters/transactionReceipt.js';\nexport const formatters = {\n block: /*#__PURE__*/ defineBlock({\n format(args) {\n const transactions = args.transactions?.map((transaction) => {\n if (typeof transaction === 'string')\n return transaction;\n const formatted = formatTransaction(transaction);\n if (formatted.typeHex === '0x7e') {\n formatted.isSystemTx = transaction.isSystemTx;\n formatted.mint = transaction.mint\n ? hexToBigInt(transaction.mint)\n : undefined;\n formatted.sourceHash = transaction.sourceHash;\n formatted.type = 'deposit';\n }\n return formatted;\n });\n return {\n transactions,\n stateRoot: args.stateRoot,\n };\n },\n }),\n transaction: /*#__PURE__*/ defineTransaction({\n format(args) {\n const transaction = {};\n if (args.type === '0x7e') {\n transaction.isSystemTx = args.isSystemTx;\n transaction.mint = args.mint ? hexToBigInt(args.mint) : undefined;\n transaction.sourceHash = args.sourceHash;\n transaction.type = 'deposit';\n }\n return transaction;\n },\n }),\n transactionReceipt: /*#__PURE__*/ defineTransactionReceipt({\n format(args) {\n return {\n ...(args.depositNonce\n ? { depositNonce: hexToBigInt(args.depositNonce) }\n : {}),\n ...(args.depositReceiptVersion\n ? { depositReceiptVersion: hexToNumber(args.depositReceiptVersion) }\n : {}),\n l1GasPrice: args.l1GasPrice ? hexToBigInt(args.l1GasPrice) : null,\n l1GasUsed: args.l1GasUsed ? hexToBigInt(args.l1GasUsed) : null,\n l1Fee: args.l1Fee ? hexToBigInt(args.l1Fee) : null,\n l1FeeScalar: args.l1FeeScalar ? Number(args.l1FeeScalar) : null,\n };\n },\n }),\n};\n//# sourceMappingURL=formatters.js.map","import { InvalidAddressError } from '../errors/address.js';\nimport { isAddress } from '../utils/address/isAddress.js';\nimport { concatHex } from '../utils/data/concat.js';\nimport { toHex } from '../utils/encoding/toHex.js';\nimport { toRlp } from '../utils/encoding/toRlp.js';\nimport { serializeTransaction as serializeTransaction_, } from '../utils/transaction/serializeTransaction.js';\nexport function serializeTransaction(transaction, signature) {\n if (isDeposit(transaction))\n return serializeTransactionDeposit(transaction);\n return serializeTransaction_(transaction, signature);\n}\nexport const serializers = {\n transaction: serializeTransaction,\n};\nfunction serializeTransactionDeposit(transaction) {\n assertTransactionDeposit(transaction);\n const { sourceHash, data, from, gas, isSystemTx, mint, to, value } = transaction;\n const serializedTransaction = [\n sourceHash,\n from,\n to ?? '0x',\n mint ? toHex(mint) : '0x',\n value ? toHex(value) : '0x',\n gas ? toHex(gas) : '0x',\n isSystemTx ? '0x1' : '0x',\n data ?? '0x',\n ];\n return concatHex([\n '0x7e',\n toRlp(serializedTransaction),\n ]);\n}\nfunction isDeposit(transaction) {\n if (transaction.type === 'deposit')\n return true;\n if (typeof transaction.sourceHash !== 'undefined')\n return true;\n return false;\n}\nexport function assertTransactionDeposit(transaction) {\n const { from, to } = transaction;\n if (from && !isAddress(from))\n throw new InvalidAddressError({ address: from });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n}\n//# sourceMappingURL=serializers.js.map","import { contracts } from './contracts.js';\nimport { formatters } from './formatters.js';\nimport { serializers } from './serializers.js';\nexport const chainConfig = {\n blockTime: 2_000,\n contracts,\n formatters,\n serializers,\n};\n//# sourceMappingURL=chainConfig.js.map","import { chainConfig } from '../../op-stack/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nconst sourceId = 1; // mainnet\nexport const base = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 8453,\n name: 'Base',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://mainnet.base.org'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Basescan',\n url: 'https://basescan.org',\n apiUrl: 'https://api.basescan.org/api',\n },\n },\n contracts: {\n ...chainConfig.contracts,\n disputeGameFactory: {\n [sourceId]: {\n address: '0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e',\n },\n },\n l2OutputOracle: {\n [sourceId]: {\n address: '0x56315b90c40730925ec5485cf004d835058518A0',\n },\n },\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 5022,\n },\n portal: {\n [sourceId]: {\n address: '0x49048044D57e1C92A77f79988d21Fa8fAF74E97e',\n blockCreated: 17482143,\n },\n },\n l1StandardBridge: {\n [sourceId]: {\n address: '0x3154Cf16ccdb4C6d922629664174b904d80F2C35',\n blockCreated: 17482143,\n },\n },\n },\n sourceId,\n});\nexport const basePreconf = /*#__PURE__*/ defineChain({\n ...base,\n experimental_preconfirmationTime: 200,\n rpcUrls: {\n default: {\n http: ['https://mainnet-preconf.base.org'],\n },\n },\n});\n//# sourceMappingURL=base.js.map","import { chainConfig } from '../../op-stack/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nconst sourceId = 11_155_111; // sepolia\nexport const baseSepolia = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 84532,\n network: 'base-sepolia',\n name: 'Base Sepolia',\n nativeCurrency: { name: 'Sepolia Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://sepolia.base.org'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Basescan',\n url: 'https://sepolia.basescan.org',\n apiUrl: 'https://api-sepolia.basescan.org/api',\n },\n },\n contracts: {\n ...chainConfig.contracts,\n disputeGameFactory: {\n [sourceId]: {\n address: '0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1',\n },\n },\n l2OutputOracle: {\n [sourceId]: {\n address: '0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254',\n },\n },\n portal: {\n [sourceId]: {\n address: '0x49f53e41452c74589e85ca1677426ba426459e85',\n blockCreated: 4446677,\n },\n },\n l1StandardBridge: {\n [sourceId]: {\n address: '0xfd0Bf71F60660E2f608ed56e1659C450eB113120',\n blockCreated: 4446677,\n },\n },\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 1059647,\n },\n },\n testnet: true,\n sourceId,\n});\nexport const baseSepoliaPreconf = /*#__PURE__*/ defineChain({\n ...baseSepolia,\n experimental_preconfirmationTime: 200,\n rpcUrls: {\n default: {\n http: ['https://sepolia-preconf.base.org'],\n },\n },\n});\n//# sourceMappingURL=baseSepolia.js.map","// The network a chain id names: its display name and block explorer, read\n// from viem's chain registry. Capxul runs on Base and Base Sepolia; every\n// screen takes the network from the operation's chain through this, so no\n// caller writes a network name by hand.\n\nimport { base, baseSepolia } from \"viem/chains\";\n\nexport interface Network {\n readonly chainId: number;\n readonly name: string;\n readonly explorerUrl: string;\n}\n\nconst CHAINS = [base, baseSepolia];\n\n/** The network for a chain Capxul runs on, or null for any other chain. */\nexport function networkForChain(chainId: number): Network | null {\n const chain = CHAINS.find((candidate) => candidate.id === chainId);\n return chain === undefined\n ? null\n : { chainId, name: chain.name, explorerUrl: chain.blockExplorers.default.url };\n}\n","// The one home for reading an unknown value as a plain record. Every package\n// imports these instead of writing its own `typeof x === \"object\"` guard.\n\n/** A non-null object that is not an array: a value whose fields can be read by name. */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** The field `key` of `value` when `value` is a record, else undefined. */\nexport function readField(value: unknown, key: string): unknown {\n return isRecord(value) ? value[key] : undefined;\n}\n\n/** An array whose every entry is a string. */\nexport function isStringArray(value: unknown): value is readonly string[] {\n return Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n}\n","// Where you are: the environment, the signed-in person, who you act as, and\n// the Safe. Pure functions over plain values, with no Effect import, so the\n// `whoami` fast path can load this module alone and answer in well under 0.3 s.\n\nimport { networkForChain } from \"@capxul/protocol/evm/networks\";\nimport { isRecord } from \"@capxul/protocol/primitives/record\";\n\ndeclare const CAPXUL_BUILD_BOOTSTRAP_URL: string;\n\n/** The bundled staging deployment's bootstrap origin. */\nexport const STAGING_ORIGIN =\n typeof CAPXUL_BUILD_BOOTSTRAP_URL === \"undefined\"\n ? \"https://api.staging.capxul.com\"\n : CAPXUL_BUILD_BOOTSTRAP_URL;\n/** The standing local DevNet's bootstrap (Convex site) origin. */\nexport const DEVNET_ORIGIN = \"http://127.0.0.1:3211\";\n\n/** Environments `use env` and `--env` accept. Production is not wired yet. */\nexport const ENVIRONMENT_NAMES = [\"staging\", \"devnet\", \"production\"] as const;\n\n/** Where a value came from, most specific first. */\nexport type Source = \"flag\" | \"env\" | \"saved\" | \"default\";\n\nexport interface SavedOrganization {\n readonly id: string;\n readonly handle: string;\n readonly name: string;\n readonly safe: string | null;\n}\n\n/** What this machine last learned about one deployment. Nothing here is a secret. */\nexport interface SavedOrigin {\n readonly email?: string;\n readonly authUserId?: string;\n readonly pending?: string;\n readonly safe?: string | null;\n readonly chainId?: number | null;\n readonly org?: SavedOrganization | null;\n}\n\nexport interface SavedWhere {\n readonly version: 1;\n readonly env?: string;\n readonly origins?: Readonly<Record<string, SavedOrigin>>;\n}\n\nconst EMPTY_WHERE: SavedWhere = { version: 1 };\n\nconst nonEmpty = (value: unknown) =>\n typeof value === \"string\" && value !== \"\" ? value : undefined;\n\nconst parseOrganization = (value: unknown): SavedOrganization | null | undefined => {\n if (value === null) return null;\n if (!isRecord(value)) return undefined;\n const [id, handle, name] = [nonEmpty(value.id), nonEmpty(value.handle), nonEmpty(value.name)];\n return id === undefined || handle === undefined || name === undefined\n ? undefined\n : { id, handle, name, safe: nonEmpty(value.safe) ?? null };\n};\n\nconst parseOrigin = (value: unknown): SavedOrigin => {\n if (!isRecord(value)) return {};\n const fields = {\n email: nonEmpty(value.email),\n authUserId: nonEmpty(value.authUserId),\n pending: nonEmpty(value.pending),\n safe: nonEmpty(value.safe),\n chainId: Number.isSafeInteger(value.chainId) ? Number(value.chainId) : undefined,\n org: parseOrganization(value.org),\n };\n return Object.fromEntries(Object.entries(fields).filter(([, field]) => field !== undefined));\n};\n\n/** Read `context.json` content. Damaged or foreign content reads as empty: it is a cache. */\nexport const parseWhere = (content: string | null): SavedWhere => {\n if (content === null) return EMPTY_WHERE;\n try {\n const value: unknown = JSON.parse(content);\n if (!isRecord(value) || value.version !== 1) return EMPTY_WHERE;\n const origins = isRecord(value.origins) ? value.origins : {};\n const env = nonEmpty(value.env);\n return {\n version: 1,\n ...(env === undefined ? {} : { env }),\n origins: Object.fromEntries(\n Object.entries(origins).map(([origin, saved]) => [origin, parseOrigin(saved)]),\n ),\n };\n } catch {\n return EMPTY_WHERE;\n }\n};\n\n/** The CLI home folder, from the same variables the runtime configuration reads. */\nexport const cliHome = (\n env: Readonly<Record<string, string | undefined>>,\n join: (...parts: string[]) => string,\n) =>\n env.CAPXUL_CLI_HOME ??\n (env.XDG_CONFIG_HOME === undefined\n ? env.HOME === undefined\n ? undefined\n : join(env.HOME, \".config\", \"capxul\", \"cli\")\n : join(env.XDG_CONFIG_HOME, \"capxul\", \"cli\"));\n\n/** Every value of a `--name value` or `--name=value` flag, before any `--`. */\nexport const flagValues = (args: readonly string[], name: string): readonly string[] => {\n const end = args.indexOf(\"--\");\n const flags = end < 0 ? args : args.slice(0, end);\n return flags.flatMap((arg, index) =>\n arg.startsWith(`--${name}=`)\n ? [arg.slice(name.length + 3)]\n : arg === `--${name}` && flags[index + 1] !== undefined\n ? [flags[index + 1]!]\n : [],\n );\n};\n\n/** The last value of one flag, as the parser reads it. */\nexport const flagValue = (args: readonly string[], name: string): string | undefined =>\n flagValues(args, name).at(-1);\n\nconst isLoopback = (hostname: string) =>\n hostname === \"localhost\" || hostname === \"127.0.0.1\" || hostname === \"[::1]\";\n\n/** `production` is named for the header rule; no origin maps to it until production is wired. */\nexport type EnvironmentName = \"production\" | \"staging\" | \"devnet\" | \"local\" | \"custom\";\n\n/** What an origin points at: bundled staging, the local DevNet, another loopback backend, or custom. */\nexport const environmentOf = (origin: string): EnvironmentName => {\n if (origin === STAGING_ORIGIN) return \"staging\";\n if (origin === DEVNET_ORIGIN) return \"devnet\";\n return URL.canParse(origin) && isLoopback(new URL(origin).hostname) ? \"local\" : \"custom\";\n};\n\nexport type EnvironmentChoice =\n | { readonly origin: string; readonly source: Source }\n | { readonly refusal: string };\n\n/**\n * Select the deployment: `--env`, then `CAPXUL_ENV`, then `CAPXUL_BOOTSTRAP_URL`,\n * then the environment `use env` saved, then staging.\n */\nexport const chooseEnvironment = (input: {\n readonly flag: string | undefined;\n readonly variable: string | undefined;\n readonly bootstrapUrl: string | undefined;\n readonly saved: string | undefined;\n}): EnvironmentChoice => {\n const named = (name: string, source: Source): EnvironmentChoice => {\n if (name === \"staging\") return { origin: STAGING_ORIGIN, source };\n if (name === \"devnet\") return { origin: DEVNET_ORIGIN, source };\n if (name === \"production\")\n return { refusal: \"Production is not available in this CLI yet. Use staging or devnet.\" };\n return { refusal: `Unknown environment \"${name}\". Use one of: staging, devnet.` };\n };\n if (input.flag !== undefined) return named(input.flag, \"flag\");\n if (input.variable !== undefined && input.variable !== \"\") return named(input.variable, \"env\");\n if (input.bootstrapUrl !== undefined && input.bootstrapUrl !== \"\")\n return { origin: input.bootstrapUrl, source: \"env\" };\n if (input.saved !== undefined) return named(input.saved, \"saved\");\n return { origin: STAGING_ORIGIN, source: \"default\" };\n};\n\n/** The network's name, from the chain Capxul data names. */\nexport const networkName = (chainId: number | null | undefined) =>\n chainId === null || chainId === undefined\n ? null\n : (networkForChain(chainId)?.name ?? `Chain ${chainId}`);\n\nexport type Where = {\n readonly user: { readonly email: string } | null;\n readonly actingAs:\n | { readonly kind: \"personal\"; readonly source: Source }\n | {\n readonly kind: \"organization\";\n readonly handle: string;\n readonly name: string | null;\n readonly id: string | null;\n readonly source: Source;\n };\n readonly safe: string | null;\n readonly env: {\n readonly name: EnvironmentName;\n readonly origin: string;\n readonly source: Source;\n readonly network: string | null;\n readonly chainId: number | null;\n };\n};\n\n/** The Organization `--org`, else `CAPXUL_ORG`, names for one command. */\nexport const explicitOrganization = (flag: string | undefined, variable: string | undefined) =>\n flag !== undefined\n ? { value: flag, source: \"flag\" as const }\n : variable === undefined || variable === \"\"\n ? undefined\n : { value: variable, source: \"env\" as const };\n\ntype ExplicitOrganization = ReturnType<typeof explicitOrganization>;\n\n/** Who you act as: `--org` or `CAPXUL_ORG`, else the saved Organization, else yourself. */\nconst actorOf = (saved: SavedOrigin, explicit: ExplicitOrganization) => {\n if (explicit === undefined) {\n const org = saved.org;\n // `use personal` saves an explicit null; otherwise yourself is the default.\n if (org === null || org === undefined)\n return {\n actingAs: { kind: \"personal\", source: org === null ? \"saved\" : \"default\" },\n } as const;\n return { known: org, actingAs: { kind: \"organization\", ...org, source: \"saved\" } } as const;\n }\n const wanted = explicit.value.replace(/^@/u, \"\").toLowerCase();\n const known =\n saved.org?.handle.toLowerCase() === wanted || saved.org?.id === explicit.value\n ? saved.org\n : undefined;\n return {\n known,\n actingAs: {\n kind: \"organization\",\n handle: known?.handle ?? explicit.value,\n name: known?.name ?? null,\n id: known?.id ?? null,\n source: explicit.source,\n },\n } as const;\n};\n\n/** Combine the selected deployment, an explicit Organization, and what this machine saved. */\nexport const describeWhere = (input: {\n readonly origin: string;\n readonly envSource: Source;\n readonly saved: SavedWhere;\n readonly explicitOrg: ExplicitOrganization;\n}): Where => {\n const saved = input.saved.origins?.[input.origin] ?? {};\n const user = saved.email === undefined ? null : { email: saved.email };\n const { known, actingAs: actor } = actorOf(saved, input.explicitOrg);\n const actingAs: Where[\"actingAs\"] =\n actor.kind === \"personal\"\n ? actor\n : {\n kind: actor.kind,\n handle: actor.handle,\n name: actor.name,\n id: actor.id,\n source: actor.source,\n };\n const chainId = saved.chainId ?? null;\n return {\n user,\n actingAs,\n safe: actingAs.kind === \"personal\" ? (saved.safe ?? null) : (known?.safe ?? null),\n env: {\n name: environmentOf(input.origin),\n origin: input.origin,\n source: input.envSource,\n network: networkName(chainId),\n chainId,\n },\n };\n};\n","// How \"where you are\" reads on a terminal: the header line and the `whoami`\n// table. Pure text, with no Effect import, for the `whoami` fast path.\n\nimport type { Source, Where } from \"./where\";\n\nconst shortAddress = (address: string) =>\n /^0x[0-9a-fA-F]{40}$/u.test(address) ? `${address.slice(0, 6)}…${address.slice(-4)}` : address;\n\n/** Saved names come from other clients: keep terminal control characters out of them. */\nconst printable = (value: string) => value.replace(/[\\p{Cc}\\p{Cf}]/gu, \"?\");\n\nconst actorLabel = (where: Where) =>\n where.actingAs.kind === \"personal\"\n ? \"Personal\"\n : printable(where.actingAs.name ?? where.actingAs.handle);\n\n/** Text styling a terminal shows. Pipes, `NO_COLOR` and JSON get plain text. */\nexport interface Style {\n readonly highlight: (text: string) => string;\n readonly dim: (text: string) => string;\n readonly bad: (text: string) => string;\n readonly good: (text: string) => string;\n}\nexport const PLAIN: Style = {\n highlight: (text) => text,\n dim: (text) => text,\n bad: (text) => text,\n good: (text) => text,\n};\nconst COLOR: Style = {\n highlight: (text) => `\\u001b[33m${text}\\u001b[39m`,\n dim: (text) => `\\u001b[2m${text}\\u001b[22m`,\n bad: (text) => `\\u001b[31m${text}\\u001b[39m`,\n good: (text) => `\\u001b[32m${text}\\u001b[39m`,\n};\nexport const styleFor = (tty: boolean, env: Readonly<Record<string, string | undefined>>) =>\n tty && (env.NO_COLOR === undefined || env.NO_COLOR === \"\") ? COLOR : PLAIN;\n\n/** `▸ Acme Ltd · staging · Base Sepolia`. Production is the normal case: no label. */\nexport const headerLine = (where: Where, style: Style) =>\n [\n `▸ ${actorLabel(where)}`,\n ...(where.env.name === \"production\" ? [] : [style.highlight(where.env.name)]),\n ...(where.env.network === null ? [] : [where.env.network]),\n ].join(\" · \");\n\n/** The `whoami` table. Values are padded before styling so columns stay aligned. */\nexport const whoamiLines = (where: Where, style: Style): readonly string[] => {\n const row = (label: string, value: string, note?: Source, styled = value) =>\n `${label.padEnd(11)}${\n note === undefined || note === \"default\"\n ? styled\n : `${styled}${\" \".repeat(Math.max(2, 23 - value.length))}${style.dim(note)}`\n }`;\n const acting =\n where.actingAs.kind === \"personal\"\n ? \"yourself\"\n : `${printable(where.actingAs.name ?? where.actingAs.handle)} (org)`;\n const network = where.env.network === null ? \"\" : ` · ${where.env.network}`;\n return [\n row(\n \"user\",\n where.user === null ? \"not signed in · capxul auth login\" : printable(where.user.email),\n ),\n row(\"acting as\", acting, where.actingAs.source),\n ...(where.safe === null ? [] : [row(\"safe\", shortAddress(where.safe))]),\n row(\n \"env\",\n `${where.env.name}${network}`,\n where.env.source,\n `${style.highlight(where.env.name)}${network}`,\n ),\n ];\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"mappings":";;AAAA,SAAgB,YAAY,OAAO;CAC/B,MAAM,gBAAgB;EAClB,YAAY,KAAA;EACZ,MAAM,KAAA;EACN,aAAa,KAAA;EACb,GAAG;CACP;CACA,SAAS,OAAO,MAAM;EAClB,QAAQ,iBAAiB;GACrB,MAAM,aAAc,OAAO,iBAAiB,aAAa,aAAa,IAAI,IAAI;GAC9E,MAAM,WAAW;IAAE,GAAG;IAAM,GAAG;GAAW;GAC1C,OAAO,OAAO,OAAO,UAAU,EAAE,QAAQ,OAAO,QAAQ,EAAE,CAAC;EAC/D;CACJ;CACA,OAAO,OAAO,OAAO,eAAe,EAChC,QAAQ,OAAO,aAAa,EAChC,CAAC;AACL;;;ACjBA,MAAa,UAAU;;;ACCvB,IAAI,cAAc;CACd,a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c,UAAoC;CAC5E,MAAM,OAAO,OAAe,OAAe,MAAe,SAAS,UACjE,GAAG,MAAM,OAAO,EAAE,IAChB,SAAS,KAAA,KAAa,SAAS,YAC3B,SACA,GAAG,SAAS,IAAI,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,CAAC,IAAI,MAAM,IAAI,IAAI;CAE/E,MAAM,SACJ,MAAM,SAAS,SAAS,aACpB,aACA,GAAG,UAAU,MAAM,SAAS,QAAQ,MAAM,SAAS,MAAM,EAAE;CACjE,MAAM,UAAU,MAAM,IAAI,YAAY,OAAO,KAAK,MAAM,MAAM,IAAI;CAClE,OAAO;EACL,IACE,QACA,MAAM,SAAS,OAAO,sCAAsC,UAAU,MAAM,KAAK,KAAK,CACxF;EACA,IAAI,aAAa,QAAQ,MAAM,SAAS,MAAM;EAC9C,GAAI,MAAM,SAAS,OAAO,CAAC,IAAI,CAAC,IAAI,QAAQ,aAAa,MAAM,IAAI,CAAC,CAAC;EACrE,IACE,OACA,GAAG,MAAM,IAAI,OAAO,WACpB,MAAM,IAAI,QACV,GAAG,MAAM,UAAU,MAAM,IAAI,IAAI,IAAI,SACvC;CACF;AACF"}
1
+ {"version":3,"file":"where-view-BJmsAHQb.mjs","names":["encoder","size_","size","formatGwei","Value.formatGwei","sha256","sha256n","noble_sha256","toBytes","serializeTransaction","serializeTransaction_","sourceId"],"sources":["../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/chain/defineChain.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/version.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/base.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/encoding.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/isHex.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/size.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/trim.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/data.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/pad.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toHex.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toBytes.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/fromHex.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/formatter.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/transaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/block.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/log.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/formatters/transactionReceipt.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/number.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/concat.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/cursor.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/cursor.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/encoding/toRlp.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/Value.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/formatGwei.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/transaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToCommitments.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToProofs.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/sha256.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/blob.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/blob.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobs.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobSidecars.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/address.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/chain.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/node.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/lru.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/keccak256.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/getAddress.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/address/isAddress.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/data/slice.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/assertTransaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/getTransactionType.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeAccessList.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeTransaction.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/contracts.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/formatters.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/serializers.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/op-stack/chainConfig.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/chains/definitions/base.js","../../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/chains/definitions/baseSepolia.js","../../../packages/protocol/src/evm/networks.ts","../../../packages/protocol/src/primitives/record.ts","../src/runtime/where.ts","../src/runtime/where-view.ts"],"sourcesContent":["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","export const version = '2.55.18';\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 RlpDepthLimitExceededError extends BaseError {\n constructor({ limit }) {\n super(`RLP depth limit of \\`${limit}\\` exceeded.`, {\n name: 'RlpDepthLimitExceededError',\n });\n }\n}\nexport class RlpListBoundaryExceededError extends BaseError {\n constructor({ consumed, declared }) {\n super(`RLP list items consumed \\`${consumed}\\` bytes but the list declared a length of \\`${declared}\\`.`, { name: 'RlpListBoundaryExceededError' });\n }\n}\nexport class RlpTrailingBytesError extends BaseError {\n constructor({ count }) {\n super(`RLP payload encodes a single item, but \\`${count}\\` trailing ${count === 1 ? 'byte remains' : 'bytes remain'}.`, { name: 'RlpTrailingBytesError' });\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","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 './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","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 { 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 { IntegerOutOfRangeError, 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 = hexToNumber('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420\n */\nexport function hexToNumber(hex, opts = {}) {\n const value = hexToBigInt(hex, opts);\n const number = Number(value);\n if (!Number.isSafeInteger(number))\n throw new IntegerOutOfRangeError({\n max: `${Number.MAX_SAFE_INTEGER}`,\n min: `${Number.MIN_SAFE_INTEGER}`,\n signed: opts.signed,\n size: opts.size,\n value: `${value}n`,\n });\n return number;\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","export function defineFormatter(type, format) {\n return ({ exclude, format: overrides, }) => {\n return {\n exclude,\n format: (args, action) => {\n const formatted = format(args, action);\n if (exclude) {\n for (const key of exclude) {\n delete formatted[key];\n }\n }\n return {\n ...formatted,\n ...overrides(args, action),\n };\n },\n type,\n };\n };\n}\n//# sourceMappingURL=formatter.js.map","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 ...(transaction.blockTimestamp != null && {\n blockTimestamp: BigInt(transaction.blockTimestamp),\n }),\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 { 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 const maxInt8 = 2n ** (8n - 1n) - 1n;\nexport const maxInt16 = 2n ** (16n - 1n) - 1n;\nexport const maxInt24 = 2n ** (24n - 1n) - 1n;\nexport const maxInt32 = 2n ** (32n - 1n) - 1n;\nexport const maxInt40 = 2n ** (40n - 1n) - 1n;\nexport const maxInt48 = 2n ** (48n - 1n) - 1n;\nexport const maxInt56 = 2n ** (56n - 1n) - 1n;\nexport const maxInt64 = 2n ** (64n - 1n) - 1n;\nexport const maxInt72 = 2n ** (72n - 1n) - 1n;\nexport const maxInt80 = 2n ** (80n - 1n) - 1n;\nexport const maxInt88 = 2n ** (88n - 1n) - 1n;\nexport const maxInt96 = 2n ** (96n - 1n) - 1n;\nexport const maxInt104 = 2n ** (104n - 1n) - 1n;\nexport const maxInt112 = 2n ** (112n - 1n) - 1n;\nexport const maxInt120 = 2n ** (120n - 1n) - 1n;\nexport const maxInt128 = 2n ** (128n - 1n) - 1n;\nexport const maxInt136 = 2n ** (136n - 1n) - 1n;\nexport const maxInt144 = 2n ** (144n - 1n) - 1n;\nexport const maxInt152 = 2n ** (152n - 1n) - 1n;\nexport const maxInt160 = 2n ** (160n - 1n) - 1n;\nexport const maxInt168 = 2n ** (168n - 1n) - 1n;\nexport const maxInt176 = 2n ** (176n - 1n) - 1n;\nexport const maxInt184 = 2n ** (184n - 1n) - 1n;\nexport const maxInt192 = 2n ** (192n - 1n) - 1n;\nexport const maxInt200 = 2n ** (200n - 1n) - 1n;\nexport const maxInt208 = 2n ** (208n - 1n) - 1n;\nexport const maxInt216 = 2n ** (216n - 1n) - 1n;\nexport const maxInt224 = 2n ** (224n - 1n) - 1n;\nexport const maxInt232 = 2n ** (232n - 1n) - 1n;\nexport const maxInt240 = 2n ** (240n - 1n) - 1n;\nexport const maxInt248 = 2n ** (248n - 1n) - 1n;\nexport const maxInt256 = 2n ** (256n - 1n) - 1n;\nexport const minInt8 = -(2n ** (8n - 1n));\nexport const minInt16 = -(2n ** (16n - 1n));\nexport const minInt24 = -(2n ** (24n - 1n));\nexport const minInt32 = -(2n ** (32n - 1n));\nexport const minInt40 = -(2n ** (40n - 1n));\nexport const minInt48 = -(2n ** (48n - 1n));\nexport const minInt56 = -(2n ** (56n - 1n));\nexport const minInt64 = -(2n ** (64n - 1n));\nexport const minInt72 = -(2n ** (72n - 1n));\nexport const minInt80 = -(2n ** (80n - 1n));\nexport const minInt88 = -(2n ** (88n - 1n));\nexport const minInt96 = -(2n ** (96n - 1n));\nexport const minInt104 = -(2n ** (104n - 1n));\nexport const minInt112 = -(2n ** (112n - 1n));\nexport const minInt120 = -(2n ** (120n - 1n));\nexport const minInt128 = -(2n ** (128n - 1n));\nexport const minInt136 = -(2n ** (136n - 1n));\nexport const minInt144 = -(2n ** (144n - 1n));\nexport const minInt152 = -(2n ** (152n - 1n));\nexport const minInt160 = -(2n ** (160n - 1n));\nexport const minInt168 = -(2n ** (168n - 1n));\nexport const minInt176 = -(2n ** (176n - 1n));\nexport const minInt184 = -(2n ** (184n - 1n));\nexport const minInt192 = -(2n ** (192n - 1n));\nexport const minInt200 = -(2n ** (200n - 1n));\nexport const minInt208 = -(2n ** (208n - 1n));\nexport const minInt216 = -(2n ** (216n - 1n));\nexport const minInt224 = -(2n ** (224n - 1n));\nexport const minInt232 = -(2n ** (232n - 1n));\nexport const minInt240 = -(2n ** (240n - 1n));\nexport const minInt248 = -(2n ** (248n - 1n));\nexport const minInt256 = -(2n ** (256n - 1n));\nexport const maxUint8 = 2n ** 8n - 1n;\nexport const maxUint16 = 2n ** 16n - 1n;\nexport const maxUint24 = 2n ** 24n - 1n;\nexport const maxUint32 = 2n ** 32n - 1n;\nexport const maxUint40 = 2n ** 40n - 1n;\nexport const maxUint48 = 2n ** 48n - 1n;\nexport const maxUint56 = 2n ** 56n - 1n;\nexport const maxUint64 = 2n ** 64n - 1n;\nexport const maxUint72 = 2n ** 72n - 1n;\nexport const maxUint80 = 2n ** 80n - 1n;\nexport const maxUint88 = 2n ** 88n - 1n;\nexport const maxUint96 = 2n ** 96n - 1n;\nexport const maxUint104 = 2n ** 104n - 1n;\nexport const maxUint112 = 2n ** 112n - 1n;\nexport const maxUint120 = 2n ** 120n - 1n;\nexport const maxUint128 = 2n ** 128n - 1n;\nexport const maxUint136 = 2n ** 136n - 1n;\nexport const maxUint144 = 2n ** 144n - 1n;\nexport const maxUint152 = 2n ** 152n - 1n;\nexport const maxUint160 = 2n ** 160n - 1n;\nexport const maxUint168 = 2n ** 168n - 1n;\nexport const maxUint176 = 2n ** 176n - 1n;\nexport const maxUint184 = 2n ** 184n - 1n;\nexport const maxUint192 = 2n ** 192n - 1n;\nexport const maxUint200 = 2n ** 200n - 1n;\nexport const maxUint208 = 2n ** 208n - 1n;\nexport const maxUint216 = 2n ** 216n - 1n;\nexport const maxUint224 = 2n ** 224n - 1n;\nexport const maxUint232 = 2n ** 232n - 1n;\nexport const maxUint240 = 2n ** 240n - 1n;\nexport const maxUint248 = 2n ** 248n - 1n;\nexport const maxUint256 = 2n ** 256n - 1n;\n//# sourceMappingURL=number.js.map","export function concat(values) {\n if (typeof values[0] === 'string')\n return concatHex(values);\n return concatBytes(values);\n}\nexport function concatBytes(values) {\n let length = 0;\n for (const arr of values) {\n length += arr.length;\n }\n const result = new Uint8Array(length);\n let offset = 0;\n for (const arr of values) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n}\nexport function concatHex(values) {\n return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}`;\n}\n//# sourceMappingURL=concat.js.map","import { BaseError } from './base.js';\nexport class NegativeOffsetError extends BaseError {\n constructor({ offset }) {\n super(`Offset \\`${offset}\\` cannot be negative.`, {\n name: 'NegativeOffsetError',\n });\n }\n}\nexport class PositionOutOfBoundsError extends BaseError {\n constructor({ length, position }) {\n super(`Position \\`${position}\\` is out of bounds (\\`0 < position < ${length}\\`).`, { name: 'PositionOutOfBoundsError' });\n }\n}\nexport class RecursiveReadLimitExceededError extends BaseError {\n constructor({ count, limit }) {\n super(`Recursive read limit of \\`${limit}\\` exceeded (recursive read count: \\`${count}\\`).`, { name: 'RecursiveReadLimitExceededError' });\n }\n}\n//# sourceMappingURL=cursor.js.map","import { NegativeOffsetError, PositionOutOfBoundsError, RecursiveReadLimitExceededError, } from '../errors/cursor.js';\nconst staticCursor = {\n bytes: new Uint8Array(),\n dataView: new DataView(new ArrayBuffer(0)),\n position: 0,\n positionReadCount: new Map(),\n recursiveReadCount: 0,\n recursiveReadLimit: Number.POSITIVE_INFINITY,\n assertReadLimit() {\n if (this.recursiveReadCount >= this.recursiveReadLimit)\n throw new RecursiveReadLimitExceededError({\n count: this.recursiveReadCount + 1,\n limit: this.recursiveReadLimit,\n });\n },\n assertPosition(position) {\n if (position < 0 || position > this.bytes.length - 1)\n throw new PositionOutOfBoundsError({\n length: this.bytes.length,\n position,\n });\n },\n decrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position - offset;\n this.assertPosition(position);\n this.position = position;\n },\n getReadCount(position) {\n return this.positionReadCount.get(position || this.position) || 0;\n },\n incrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position + offset;\n this.assertPosition(position);\n this.position = position;\n },\n inspectByte(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectBytes(length, position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + length - 1);\n return this.bytes.subarray(position, position + length);\n },\n inspectUint8(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectUint16(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 1);\n return this.dataView.getUint16(position);\n },\n inspectUint24(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 2);\n return ((this.dataView.getUint16(position) << 8) +\n this.dataView.getUint8(position + 2));\n },\n inspectUint32(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 3);\n return this.dataView.getUint32(position);\n },\n pushByte(byte) {\n this.assertPosition(this.position);\n this.bytes[this.position] = byte;\n this.position++;\n },\n pushBytes(bytes) {\n this.assertPosition(this.position + bytes.length - 1);\n this.bytes.set(bytes, this.position);\n this.position += bytes.length;\n },\n pushUint8(value) {\n this.assertPosition(this.position);\n this.bytes[this.position] = value;\n this.position++;\n },\n pushUint16(value) {\n this.assertPosition(this.position + 1);\n this.dataView.setUint16(this.position, value);\n this.position += 2;\n },\n pushUint24(value) {\n this.assertPosition(this.position + 2);\n this.dataView.setUint16(this.position, value >> 8);\n this.dataView.setUint8(this.position + 2, value & ~4294967040);\n this.position += 3;\n },\n pushUint32(value) {\n this.assertPosition(this.position + 3);\n this.dataView.setUint32(this.position, value);\n this.position += 4;\n },\n readByte() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectByte();\n this.position++;\n return value;\n },\n readBytes(length, size) {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectBytes(length);\n this.position += size ?? length;\n return value;\n },\n readUint8() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint8();\n this.position += 1;\n return value;\n },\n readUint16() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint16();\n this.position += 2;\n return value;\n },\n readUint24() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint24();\n this.position += 3;\n return value;\n },\n readUint32() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint32();\n this.position += 4;\n return value;\n },\n get remaining() {\n return this.bytes.length - this.position;\n },\n setPosition(position) {\n const oldPosition = this.position;\n this.assertPosition(position);\n this.position = position;\n return () => (this.position = oldPosition);\n },\n _touch() {\n if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)\n return;\n const count = this.getReadCount();\n this.positionReadCount.set(this.position, count + 1);\n if (count > 0)\n this.recursiveReadCount++;\n },\n};\nexport function createCursor(bytes, { recursiveReadLimit = 8_192 } = {}) {\n const cursor = Object.create(staticCursor);\n cursor.bytes = bytes;\n cursor.dataView = new DataView(bytes.buffer ?? bytes, bytes.byteOffset, bytes.byteLength);\n cursor.positionReadCount = new Map();\n cursor.recursiveReadLimit = recursiveReadLimit;\n return cursor;\n}\n//# sourceMappingURL=cursor.js.map","import { BaseError } from '../../errors/base.js';\nimport { createCursor, } from '../cursor.js';\nimport { hexToBytes } from './toBytes.js';\nimport { bytesToHex } from './toHex.js';\nexport function toRlp(bytes, to = 'hex') {\n const encodable = getEncodable(bytes);\n const cursor = createCursor(new Uint8Array(encodable.length));\n encodable.encode(cursor);\n if (to === 'hex')\n return bytesToHex(cursor.bytes);\n return cursor.bytes;\n}\nexport function bytesToRlp(bytes, to = 'bytes') {\n return toRlp(bytes, to);\n}\nexport function hexToRlp(hex, to = 'hex') {\n return toRlp(hex, to);\n}\nfunction getEncodable(bytes) {\n if (Array.isArray(bytes))\n return getEncodableList(bytes.map((x) => getEncodable(x)));\n return getEncodableBytes(bytes);\n}\nfunction getEncodableList(list) {\n const bodyLength = list.reduce((acc, x) => acc + x.length, 0);\n const sizeOfBodyLength = getSizeOfLength(bodyLength);\n const length = (() => {\n if (bodyLength <= 55)\n return 1 + bodyLength;\n return 1 + sizeOfBodyLength + bodyLength;\n })();\n return {\n length,\n encode(cursor) {\n if (bodyLength <= 55) {\n cursor.pushByte(0xc0 + bodyLength);\n }\n else {\n cursor.pushByte(0xc0 + 55 + sizeOfBodyLength);\n if (sizeOfBodyLength === 1)\n cursor.pushUint8(bodyLength);\n else if (sizeOfBodyLength === 2)\n cursor.pushUint16(bodyLength);\n else if (sizeOfBodyLength === 3)\n cursor.pushUint24(bodyLength);\n else\n cursor.pushUint32(bodyLength);\n }\n for (const { encode } of list) {\n encode(cursor);\n }\n },\n };\n}\nfunction getEncodableBytes(bytesOrHex) {\n const bytes = typeof bytesOrHex === 'string' ? hexToBytes(bytesOrHex) : bytesOrHex;\n const sizeOfBytesLength = getSizeOfLength(bytes.length);\n const length = (() => {\n if (bytes.length === 1 && bytes[0] < 0x80)\n return 1;\n if (bytes.length <= 55)\n return 1 + bytes.length;\n return 1 + sizeOfBytesLength + bytes.length;\n })();\n return {\n length,\n encode(cursor) {\n if (bytes.length === 1 && bytes[0] < 0x80) {\n cursor.pushBytes(bytes);\n }\n else if (bytes.length <= 55) {\n cursor.pushByte(0x80 + bytes.length);\n cursor.pushBytes(bytes);\n }\n else {\n cursor.pushByte(0x80 + 55 + sizeOfBytesLength);\n if (sizeOfBytesLength === 1)\n cursor.pushUint8(bytes.length);\n else if (sizeOfBytesLength === 2)\n cursor.pushUint16(bytes.length);\n else if (sizeOfBytesLength === 3)\n cursor.pushUint24(bytes.length);\n else\n cursor.pushUint32(bytes.length);\n cursor.pushBytes(bytes);\n }\n },\n };\n}\nfunction getSizeOfLength(length) {\n if (length < 2 ** 8)\n return 1;\n if (length < 2 ** 16)\n return 2;\n if (length < 2 ** 24)\n return 3;\n if (length < 2 ** 32)\n return 4;\n throw new BaseError('Length is too large.');\n}\n//# sourceMappingURL=toRlp.js.map","// Adapted from the Ox v1 `Value` module.\n/** @see https://ethereum.github.io/yellowpaper/paper.pdf */\nconst exponents = {\n wei: 0,\n gwei: 9,\n szabo: 12,\n finney: 15,\n ether: 18,\n};\n/**\n * Formats a `bigint` Value to its string representation (divided by the given exponent).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.format(420_000_000_000n, 9)\n * // @log: '420'\n * ```\n *\n * @param value - The `bigint` Value to format.\n * @param decimals - The exponent to divide the `bigint` Value by.\n * @returns The string representation of the Value.\n */\nexport function format(value, decimals = 0) {\n if (!Number.isInteger(decimals) || decimals < 0)\n throw new InvalidDecimalsError({ decimals });\n let display = value.toString();\n const negative = display.startsWith('-');\n if (negative)\n display = display.slice(1);\n display = display.padStart(decimals, '0');\n let [integer, fraction] = [\n display.slice(0, display.length - decimals),\n display.slice(display.length - decimals),\n ];\n fraction = fraction.replace(/(0+)$/, '');\n return `${negative ? '-' : ''}${integer || '0'}${fraction ? `.${fraction}` : ''}`;\n}\n/**\n * Formats a `bigint` Value (default: wei) to a string representation of Ether.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.formatEther(1_000_000_000_000_000_000n)\n * // @log: '1'\n * ```\n *\n * @param wei - The Value to format.\n * @param unit - The unit to format the Value in. @default 'wei'.\n * @returns The Ether string representation of the Value.\n */\nexport function formatEther(wei, unit = 'wei') {\n return format(wei, exponents.ether - exponents[unit]);\n}\n/**\n * Formats a `bigint` Value (default: wei) to a string representation of Gwei.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.formatGwei(1_000_000_000n)\n * // @log: '1'\n * ```\n *\n * @param wei - The Value to format.\n * @param unit - The unit to format the Value in. @default 'wei'.\n * @returns The Gwei string representation of the Value.\n */\nexport function formatGwei(wei, unit = 'wei') {\n return format(wei, exponents.gwei - exponents[unit]);\n}\n/**\n * Parses a `string` representation of a Value to `bigint` (multiplied by the given exponent).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.from('420', 9)\n * // @log: 420000000000n\n * ```\n *\n * @param value - The string representation of the Value.\n * @param decimals - The exponent to multiply the Value by.\n * @returns The `bigint` representation of the Value.\n */\nexport function from(value, decimals = 0) {\n if (!Number.isInteger(decimals) || decimals < 0)\n throw new InvalidDecimalsError({ decimals });\n // Require at least one digit overall. Rejects '', '.', '-', '-.' which\n // the previous regex accepted (and which then either produced garbage or\n // threw a raw `SyntaxError` from `BigInt('')`).\n if (!/^-?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)$/.test(value))\n throw new InvalidDecimalNumberError({ value });\n let [integer = '', fraction = '0'] = value.split('.');\n const negative = integer.startsWith('-');\n if (negative)\n integer = integer.slice(1);\n if (integer === '')\n integer = '0';\n // trim trailing zeros.\n fraction = fraction.replace(/(0+)$/, '');\n // round off if the fraction is larger than the number of decimals.\n if (decimals === 0) {\n // Round half-away-from-zero by inspecting the first fractional digit.\n if (fraction.length > 0 && Number.parseInt(fraction[0], 10) >= 5)\n integer = `${BigInt(integer) + 1n}`;\n fraction = '';\n }\n else if (fraction.length > decimals) {\n const left = fraction.slice(0, decimals);\n const roundDigit = Number.parseInt(fraction.slice(decimals, decimals + 1), 10);\n if (roundDigit >= 5) {\n // Carry through the truncated fraction digits into the integer part\n // without converting to a JS Number (avoids float precision loss).\n const carried = carry(left);\n if (carried.length > decimals) {\n // Carry overflowed into the integer part.\n fraction = carried.slice(1);\n integer = `${BigInt(integer) + 1n}`;\n }\n else {\n fraction = carried;\n }\n }\n else {\n fraction = left;\n }\n }\n else {\n fraction = fraction.padEnd(decimals, '0');\n }\n return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);\n}\n/**\n * Adds 1 to a digit string with carry, returning a string of the same length\n * unless the carry overflows past the most-significant digit (in which case\n * the returned string is one digit longer).\n *\n * @internal\n */\nfunction carry(digits) {\n const out = digits.split('');\n let i = out.length - 1;\n while (i >= 0) {\n const d = Number.parseInt(out[i], 10) + 1;\n if (d < 10) {\n out[i] = String(d);\n return out.join('');\n }\n out[i] = '0';\n i--;\n }\n return `1${out.join('')}`;\n}\n/**\n * Parses a string representation of Ether to a `bigint` Value (default: wei).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.fromEther('420')\n * // @log: 420000000000000000000n\n * ```\n *\n * @param ether - String representation of Ether.\n * @param unit - The unit to parse to. @default 'wei'.\n * @returns A `bigint` Value.\n */\nexport function fromEther(ether, unit = 'wei') {\n return from(ether, exponents.ether - exponents[unit]);\n}\n/**\n * Parses a string representation of Gwei to a `bigint` Value (default: wei).\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.fromGwei('420')\n * // @log: 420000000000n\n * ```\n *\n * @param gwei - String representation of Gwei.\n * @param unit - The unit to parse to. @default 'wei'.\n * @returns A `bigint` Value.\n */\nexport function fromGwei(gwei, unit = 'wei') {\n return from(gwei, exponents.gwei - exponents[unit]);\n}\n/**\n * Thrown when a value is not a valid decimal number.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.fromEther('123.456.789')\n * // @error: Value.InvalidDecimalNumberError: Value `123.456.789` is not a valid decimal number.\n * ```\n */\nclass InvalidDecimalNumberError extends Error {\n constructor({ value }) {\n super(`Value \\`${value}\\` is not a valid decimal number.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Value.InvalidDecimalNumberError'\n });\n }\n}\n/**\n * Thrown when the `decimals` argument is not a non-negative integer.\n *\n * @example\n * ```ts twoslash\n * import { Value } from 'ox'\n *\n * Value.from('1', -1)\n * // @error: Value.InvalidDecimalsError: `decimals` must be a non-negative integer. Got `-1`.\n * ```\n */\nclass InvalidDecimalsError extends Error {\n constructor({ decimals }) {\n super(`\\`decimals\\` must be a non-negative integer. Got \\`${decimals}\\`.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Value.InvalidDecimalsError'\n });\n }\n}\n//# sourceMappingURL=Value.js.map","import * as Value from './Value.js';\n/**\n * Converts numerical wei to a string representation of gwei.\n *\n * - Docs: https://viem.sh/docs/utilities/formatGwei\n *\n * @example\n * import { formatGwei } from 'viem'\n *\n * formatGwei(1000000000n)\n * // '1'\n */\nexport function formatGwei(wei, unit = 'wei') {\n return Value.formatGwei(wei, unit);\n}\n//# sourceMappingURL=formatGwei.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport function prettyPrint(args) {\n const entries = Object.entries(args)\n .map(([key, value]) => {\n if (value === undefined || value === false)\n return null;\n return [key, value];\n })\n .filter(Boolean);\n const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);\n return entries\n .map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`)\n .join('\\n');\n}\nexport class FeeConflictError extends BaseError {\n constructor() {\n super([\n 'Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.',\n 'Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others.',\n ].join('\\n'), { name: 'FeeConflictError' });\n }\n}\nexport class FeePayerNonceMismatchError extends BaseError {\n constructor({ filledNonce, requestedNonce, }) {\n super('The filled transaction nonce does not match the requested nonce.', {\n metaMessages: [\n `Requested Nonce: ${requestedNonce}`,\n `Filled Nonce: ${filledNonce}`,\n ],\n name: 'FeePayerNonceMismatchError',\n });\n }\n}\nexport class InvalidLegacyVError extends BaseError {\n constructor({ v }) {\n super(`Invalid \\`v\\` value \"${v}\". Expected 27 or 28.`, {\n name: 'InvalidLegacyVError',\n });\n }\n}\nexport class InvalidYParityError extends BaseError {\n constructor({ yParity }) {\n super(`Invalid \\`yParity\\` value \"${yParity}\". Expected 0 or 1.`, {\n name: 'InvalidYParityError',\n });\n }\n}\nexport class InvalidSerializableTransactionError extends BaseError {\n constructor({ transaction }) {\n super('Cannot infer a transaction type from provided transaction.', {\n metaMessages: [\n 'Provided Transaction:',\n '{',\n prettyPrint(transaction),\n '}',\n '',\n 'To infer the type, either provide:',\n '- a `type` to the Transaction, or',\n '- an EIP-1559 Transaction with `maxFeePerGas`, or',\n '- an EIP-2930 Transaction with `gasPrice` & `accessList`, or',\n '- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or',\n '- an EIP-7702 Transaction with `authorizationList`, or',\n '- a Legacy Transaction with `gasPrice`',\n ],\n name: 'InvalidSerializableTransactionError',\n });\n }\n}\nexport class InvalidSerializedTransactionTypeError extends BaseError {\n constructor({ serializedType }) {\n super(`Serialized transaction type \"${serializedType}\" is invalid.`, {\n name: 'InvalidSerializedTransactionType',\n });\n Object.defineProperty(this, \"serializedType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedType = serializedType;\n }\n}\nexport class InvalidSerializedTransactionError extends BaseError {\n constructor({ attributes, serializedTransaction, type, }) {\n const missing = Object.entries(attributes)\n .map(([key, value]) => (typeof value === 'undefined' ? key : undefined))\n .filter(Boolean);\n super(`Invalid serialized transaction of type \"${type}\" was provided.`, {\n metaMessages: [\n `Serialized Transaction: \"${serializedTransaction}\"`,\n missing.length > 0 ? `Missing Attributes: ${missing.join(', ')}` : '',\n ].filter(Boolean),\n name: 'InvalidSerializedTransactionError',\n });\n Object.defineProperty(this, \"serializedTransaction\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"type\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedTransaction = serializedTransaction;\n this.type = type;\n }\n}\nexport class InvalidStorageKeySizeError extends BaseError {\n constructor({ storageKey }) {\n super(`Size for storage key \"${storageKey}\" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: 'InvalidStorageKeySizeError' });\n }\n}\nexport class TransactionExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n chain: chain && `${chain?.name} (id: ${chain?.id})`,\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency?.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Request Arguments:',\n prettyArgs,\n ].filter(Boolean),\n name: 'TransactionExecutionError',\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.cause = cause;\n }\n}\nexport class TransactionNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, blockTag, hash, index, }) {\n let identifier = 'Transaction';\n if (blockTag && index !== undefined)\n identifier = `Transaction at block time \"${blockTag}\" at index \"${index}\"`;\n if (blockHash && index !== undefined)\n identifier = `Transaction at block hash \"${blockHash}\" at index \"${index}\"`;\n if (blockNumber && index !== undefined)\n identifier = `Transaction at block number \"${blockNumber}\" at index \"${index}\"`;\n if (hash)\n identifier = `Transaction with hash \"${hash}\"`;\n super(`${identifier} could not be found.`, {\n name: 'TransactionNotFoundError',\n });\n }\n}\nexport class TransactionReceiptNotFoundError extends BaseError {\n constructor({ hash }) {\n super(`Transaction receipt with hash \"${hash}\" could not be found. The Transaction may not be processed on a block yet.`, {\n name: 'TransactionReceiptNotFoundError',\n });\n }\n}\nexport class TransactionReceiptRevertedError extends BaseError {\n constructor({ receipt }) {\n super(`Transaction with hash \"${receipt.transactionHash}\" reverted.`, {\n metaMessages: [\n 'The receipt marked the transaction as \"reverted\". This could mean that the function on the contract you are trying to call threw an error.',\n ' ',\n 'You can attempt to extract the revert reason by:',\n '- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract',\n '- using the `call` Action with raw `data`',\n ],\n name: 'TransactionReceiptRevertedError',\n });\n Object.defineProperty(this, \"receipt\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.receipt = receipt;\n }\n}\nexport class WaitForTransactionReceiptTimeoutError extends BaseError {\n constructor({ hash }) {\n super(`Timed out while waiting for transaction with hash \"${hash}\" to be confirmed.`, { name: 'WaitForTransactionReceiptTimeoutError' });\n }\n}\n//# sourceMappingURL=transaction.js.map","import { toHex } from '../encoding/toHex.js';\nimport { toYParitySignatureArray } from '../transaction/serializeTransaction.js';\n/*\n * Serializes an EIP-7702 authorization list.\n */\nexport function serializeAuthorizationList(authorizationList) {\n if (!authorizationList || authorizationList.length === 0)\n return [];\n const serializedAuthorizationList = [];\n for (const authorization of authorizationList) {\n const { chainId, nonce, ...signature } = authorization;\n const contractAddress = authorization.address;\n serializedAuthorizationList.push([\n chainId ? toHex(chainId) : '0x',\n contractAddress,\n nonce ? toHex(nonce) : '0x',\n ...toYParitySignatureArray({}, signature),\n ]);\n }\n return serializedAuthorizationList;\n}\n//# sourceMappingURL=serializeAuthorizationList.js.map","import { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Compute commitments from a list of blobs.\n *\n * @example\n * ```ts\n * import { blobsToCommitments, toBlobs } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * ```\n */\nexport function blobsToCommitments(parameters) {\n const { kzg } = parameters;\n const to = parameters.to ?? (typeof parameters.blobs[0] === 'string' ? 'hex' : 'bytes');\n const blobs = (typeof parameters.blobs[0] === 'string'\n ? parameters.blobs.map((x) => hexToBytes(x))\n : parameters.blobs);\n const commitments = [];\n for (const blob of blobs)\n commitments.push(Uint8Array.from(kzg.blobToKzgCommitment(blob)));\n return (to === 'bytes'\n ? commitments\n : commitments.map((x) => bytesToHex(x)));\n}\n//# sourceMappingURL=blobsToCommitments.js.map","import { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Compute the proofs for a list of blobs and their commitments.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const proofs = blobsToProofs({ blobs, commitments, kzg })\n * ```\n */\nexport function blobsToProofs(parameters) {\n const { kzg } = parameters;\n const to = parameters.to ?? (typeof parameters.blobs[0] === 'string' ? 'hex' : 'bytes');\n const blobs = (typeof parameters.blobs[0] === 'string'\n ? parameters.blobs.map((x) => hexToBytes(x))\n : parameters.blobs);\n const commitments = (typeof parameters.commitments[0] === 'string'\n ? parameters.commitments.map((x) => hexToBytes(x))\n : parameters.commitments);\n const proofs = [];\n for (let i = 0; i < blobs.length; i++) {\n const blob = blobs[i];\n const commitment = commitments[i];\n proofs.push(Uint8Array.from(kzg.computeBlobKzgProof(blob, commitment)));\n }\n return (to === 'bytes'\n ? proofs\n : proofs.map((x) => bytesToHex(x)));\n}\n//# sourceMappingURL=blobsToProofs.js.map","/**\n * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.\n * @todo re-check https://issues.chromium.org/issues/42212588\n * @module\n */\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/**\n * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.\n *\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n *\n * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n * @deprecated\n */\nimport { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n, } from \"./sha2.js\";\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA256 = SHA256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha256 = sha256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA224 = SHA224n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha224 = sha224n;\n//# sourceMappingURL=sha256.js.map","import { sha256 as noble_sha256 } from '@noble/hashes/sha256';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function sha256(value, to_) {\n const to = to_ || 'hex';\n const bytes = noble_sha256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=sha256.js.map","import { bytesToHex } from '../encoding/toHex.js';\nimport { sha256 } from '../hash/sha256.js';\n/**\n * Transform a commitment to it's versioned hash.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * commitmentToVersionedHash,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const [commitment] = blobsToCommitments({ blobs, kzg })\n * const versionedHash = commitmentToVersionedHash({ commitment })\n * ```\n */\nexport function commitmentToVersionedHash(parameters) {\n const { commitment, version = 1 } = parameters;\n const to = parameters.to ?? (typeof commitment === 'string' ? 'hex' : 'bytes');\n const versionedHash = sha256(commitment, 'bytes');\n versionedHash.set([version], 0);\n return (to === 'bytes' ? versionedHash : bytesToHex(versionedHash));\n}\n//# sourceMappingURL=commitmentToVersionedHash.js.map","import { commitmentToVersionedHash, } from './commitmentToVersionedHash.js';\n/**\n * Transform a list of commitments to their versioned hashes.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * commitmentsToVersionedHashes,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const versionedHashes = commitmentsToVersionedHashes({ commitments })\n * ```\n */\nexport function commitmentsToVersionedHashes(parameters) {\n const { commitments, version } = parameters;\n const to = parameters.to ?? (typeof commitments[0] === 'string' ? 'hex' : 'bytes');\n const hashes = [];\n for (const commitment of commitments) {\n hashes.push(commitmentToVersionedHash({\n commitment,\n to,\n version,\n }));\n }\n return hashes;\n}\n//# sourceMappingURL=commitmentsToVersionedHashes.js.map","// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md#parameters\n/** Blob limit per transaction. */\nconst blobsPerTransaction = 6;\n/** The number of bytes in a BLS scalar field element. */\nexport const bytesPerFieldElement = 32;\n/** The number of field elements in a blob. */\nexport const fieldElementsPerBlob = 4096;\n/** The number of bytes in a blob. */\nexport const bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;\n/** Blob bytes limit per transaction. */\nexport const maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction -\n // terminator byte (0x80).\n 1 -\n // zero byte (0x00) appended to each field element.\n 1 * fieldElementsPerBlob * blobsPerTransaction;\n//# sourceMappingURL=blob.js.map","import { versionedHashVersionKzg } from '../constants/kzg.js';\nimport { BaseError } from './base.js';\nexport class BlobSizeTooLargeError extends BaseError {\n constructor({ maxSize, size }) {\n super('Blob size is too large.', {\n metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size} bytes`],\n name: 'BlobSizeTooLargeError',\n });\n }\n}\nexport class EmptyBlobError extends BaseError {\n constructor() {\n super('Blob data must not be empty.', { name: 'EmptyBlobError' });\n }\n}\nexport class InvalidVersionedHashSizeError extends BaseError {\n constructor({ hash, size, }) {\n super(`Versioned hash \"${hash}\" size is invalid.`, {\n metaMessages: ['Expected: 32', `Received: ${size}`],\n name: 'InvalidVersionedHashSizeError',\n });\n }\n}\nexport class InvalidVersionedHashVersionError extends BaseError {\n constructor({ hash, version, }) {\n super(`Versioned hash \"${hash}\" version is invalid.`, {\n metaMessages: [\n `Expected: ${versionedHashVersionKzg}`,\n `Received: ${version}`,\n ],\n name: 'InvalidVersionedHashVersionError',\n });\n }\n}\n//# sourceMappingURL=blob.js.map","import { bytesPerBlob, bytesPerFieldElement, fieldElementsPerBlob, maxBytesPerTransaction, } from '../../constants/blob.js';\nimport { BlobSizeTooLargeError, EmptyBlobError, } from '../../errors/blob.js';\nimport { createCursor } from '../cursor.js';\nimport { size } from '../data/size.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Transforms arbitrary data to blobs.\n *\n * @example\n * ```ts\n * import { toBlobs, stringToHex } from 'viem'\n *\n * const blobs = toBlobs({ data: stringToHex('hello world') })\n * ```\n */\nexport function toBlobs(parameters) {\n const to = parameters.to ?? (typeof parameters.data === 'string' ? 'hex' : 'bytes');\n const data = (typeof parameters.data === 'string'\n ? hexToBytes(parameters.data)\n : parameters.data);\n const size_ = size(data);\n if (!size_)\n throw new EmptyBlobError();\n if (size_ > maxBytesPerTransaction)\n throw new BlobSizeTooLargeError({\n maxSize: maxBytesPerTransaction,\n size: size_,\n });\n const blobs = [];\n let active = true;\n let position = 0;\n while (active) {\n const blob = createCursor(new Uint8Array(bytesPerBlob));\n let size = 0;\n while (size < fieldElementsPerBlob) {\n const bytes = data.slice(position, position + (bytesPerFieldElement - 1));\n // Push a zero byte so the field element doesn't overflow the BLS modulus.\n blob.pushByte(0x00);\n // Push the current segment of data bytes.\n blob.pushBytes(bytes);\n // If we detect that the current segment of data bytes is less than 31 bytes,\n // we can stop processing and push a terminator byte to indicate the end of the blob.\n if (bytes.length < 31) {\n blob.pushByte(0x80);\n active = false;\n break;\n }\n size++;\n position += 31;\n }\n blobs.push(blob);\n }\n return (to === 'bytes'\n ? blobs.map((x) => x.bytes)\n : blobs.map((x) => bytesToHex(x.bytes)));\n}\n//# sourceMappingURL=toBlobs.js.map","import { blobsToCommitments, } from './blobsToCommitments.js';\nimport { blobsToProofs } from './blobsToProofs.js';\nimport { toBlobs } from './toBlobs.js';\n/**\n * Transforms arbitrary data (or blobs, commitments, & proofs) into a sidecar array.\n *\n * @example\n * ```ts\n * import { toBlobSidecars, stringToHex } from 'viem'\n *\n * const sidecars = toBlobSidecars({ data: stringToHex('hello world') })\n * ```\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * toBlobs,\n * blobsToProofs,\n * toBlobSidecars,\n * stringToHex\n * } from 'viem'\n *\n * const blobs = toBlobs({ data: stringToHex('hello world') })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const proofs = blobsToProofs({ blobs, commitments, kzg })\n *\n * const sidecars = toBlobSidecars({ blobs, commitments, proofs })\n * ```\n */\nexport function toBlobSidecars(parameters) {\n const { data, kzg, to } = parameters;\n const blobs = parameters.blobs ?? toBlobs({ data: data, to });\n const commitments = parameters.commitments ?? blobsToCommitments({ blobs, kzg: kzg, to });\n const proofs = parameters.proofs ?? blobsToProofs({ blobs, commitments, kzg: kzg, to });\n const sidecars = [];\n for (let i = 0; i < blobs.length; i++)\n sidecars.push({\n blob: blobs[i],\n commitment: commitments[i],\n proof: proofs[i],\n });\n return sidecars;\n}\n//# sourceMappingURL=toBlobSidecars.js.map","import { BaseError } from './base.js';\nexport class InvalidAddressError extends BaseError {\n constructor({ address }) {\n super(`Address \"${address}\" is invalid.`, {\n metaMessages: [\n '- Address must be a hex value of 20 bytes (40 hex characters).',\n '- Address must match its checksum counterpart.',\n ],\n name: 'InvalidAddressError',\n });\n }\n}\n//# sourceMappingURL=address.js.map","import { BaseError } from './base.js';\nexport class ChainDoesNotSupportContract extends BaseError {\n constructor({ blockNumber, chain, contract, }) {\n super(`Chain \"${chain.name}\" does not support contract \"${contract.name}\".`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ...(blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber\n ? [\n `- The contract \"${contract.name}\" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`,\n ]\n : [\n `- The chain does not have the contract \"${contract.name}\" configured.`,\n ]),\n ],\n name: 'ChainDoesNotSupportContract',\n });\n }\n}\nexport class ChainMismatchError extends BaseError {\n constructor({ chain, currentChainId, }) {\n super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} – ${chain.name}).`, {\n metaMessages: [\n `Current Chain ID: ${currentChainId}`,\n `Expected Chain ID: ${chain.id} – ${chain.name}`,\n ],\n name: 'ChainMismatchError',\n });\n }\n}\nexport class ChainNotFoundError extends BaseError {\n constructor() {\n super([\n 'No chain was provided to the request.',\n 'Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.',\n ].join('\\n'), {\n name: 'ChainNotFoundError',\n });\n }\n}\nexport class ClientChainNotConfiguredError extends BaseError {\n constructor() {\n super('No chain was provided to the Client.', {\n name: 'ClientChainNotConfiguredError',\n });\n }\n}\nexport class InvalidChainIdError extends BaseError {\n constructor({ chainId }) {\n super(typeof chainId === 'number'\n ? `Chain ID \"${chainId}\" is invalid.`\n : 'Chain ID is invalid.', { name: 'InvalidChainIdError' });\n }\n}\n//# sourceMappingURL=chain.js.map","import { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport class ExecutionRevertedError extends BaseError {\n constructor({ cause, message, } = {}) {\n const reason = message\n ?.replace('execution reverted: ', '')\n ?.replace('execution reverted', '');\n super(`Execution reverted ${reason ? `with reason: ${reason}` : 'for an unknown reason'}.`, {\n cause,\n name: 'ExecutionRevertedError',\n });\n }\n}\nObject.defineProperty(ExecutionRevertedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n});\nObject.defineProperty(ExecutionRevertedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /execution reverted|gas required exceeds allowance/\n});\nexport class FeeCapTooHighError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}) cannot be higher than the maximum allowed value (2^256-1).`, {\n cause,\n name: 'FeeCapTooHighError',\n });\n }\n}\nObject.defineProperty(FeeCapTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas higher than 2\\^256-1|fee cap higher than 2\\^256-1/\n});\nexport class FeeCapTooLowError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ''} gwei) cannot be lower than the block base fee.`, {\n cause,\n name: 'FeeCapTooLowError',\n });\n }\n}\nObject.defineProperty(FeeCapTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/\n});\nexport class NonceTooHighError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is higher than the next one expected.`, { cause, name: 'NonceTooHighError' });\n }\n}\nObject.defineProperty(NonceTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too high/\n});\nexport class NonceTooLowError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super([\n `Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is lower than the current nonce of the account.`,\n 'Try increasing the nonce or find the latest nonce with `getTransactionCount`.',\n ].join('\\n'), { cause, name: 'NonceTooLowError' });\n }\n}\nObject.defineProperty(NonceTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too low|transaction already imported|already known/\n});\nexport class NonceMaxValueError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}exceeds the maximum allowed nonce.`, { cause, name: 'NonceMaxValueError' });\n }\n}\nObject.defineProperty(NonceMaxValueError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce has max value/\n});\nexport class InsufficientFundsError extends BaseError {\n constructor({ cause } = {}) {\n super([\n 'The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.',\n ].join('\\n'), {\n cause,\n metaMessages: [\n 'This error could arise when the account does not have enough funds to:',\n ' - pay for the total gas fee,',\n ' - pay for the value to send.',\n ' ',\n 'The cost of the transaction is calculated as `gas * gas fee + value`, where:',\n ' - `gas` is the amount of gas needed for transaction to execute,',\n ' - `gas fee` is the gas fee,',\n ' - `value` is the amount of ether to send to the recipient.',\n ],\n name: 'InsufficientFundsError',\n });\n }\n}\nObject.defineProperty(InsufficientFundsError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /insufficient funds|exceeds transaction sender account balance/\n});\nexport class IntrinsicGasTooHighError extends BaseError {\n constructor({ cause, gas, } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction exceeds the limit allowed for the block.`, {\n cause,\n name: 'IntrinsicGasTooHighError',\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too high|gas limit reached/\n});\nexport class IntrinsicGasTooLowError extends BaseError {\n constructor({ cause, gas, } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction is too low.`, {\n cause,\n name: 'IntrinsicGasTooLowError',\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too low/\n});\nexport class TransactionTypeNotSupportedError extends BaseError {\n constructor({ cause }) {\n super('The transaction type is not supported for this chain.', {\n cause,\n name: 'TransactionTypeNotSupportedError',\n });\n }\n}\nObject.defineProperty(TransactionTypeNotSupportedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /transaction type not valid/\n});\nexport class TipAboveFeeCapError extends BaseError {\n constructor({ cause, maxPriorityFeePerGas, maxFeePerGas, } = {}) {\n super([\n `The provided tip (\\`maxPriorityFeePerGas\\`${maxPriorityFeePerGas\n ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei`\n : ''}) cannot be higher than the fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}).`,\n ].join('\\n'), {\n cause,\n name: 'TipAboveFeeCapError',\n });\n }\n}\nObject.defineProperty(TipAboveFeeCapError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/\n});\nexport class UnknownNodeError extends BaseError {\n constructor({ cause }) {\n super(`An error occurred while executing: ${cause?.shortMessage}`, {\n cause,\n name: 'UnknownNodeError',\n });\n }\n}\n//# sourceMappingURL=node.js.map","/**\n * Map with a LRU (Least recently used) policy.\n *\n * @link https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU\n */\nexport class LruMap extends Map {\n constructor(size) {\n super();\n Object.defineProperty(this, \"maxSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.maxSize = size;\n }\n get(key) {\n const value = super.get(key);\n if (super.has(key)) {\n super.delete(key);\n super.set(key, value);\n }\n return value;\n }\n set(key, value) {\n if (super.has(key))\n super.delete(key);\n super.set(key, value);\n if (this.maxSize && this.size > this.maxSize) {\n const firstKey = super.keys().next().value;\n if (firstKey !== undefined)\n super.delete(firstKey);\n }\n return this;\n }\n}\n//# sourceMappingURL=lru.js.map","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf),\n * [Website](https://keccak.team/keccak.html),\n * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub).\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from \"./_u64.js\";\n// prettier-ignore\nimport { abytes, aexists, anumber, aoutput, clean, createHasher, createXOFer, Hash, swap32IfBE, toBytes, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = [];\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n/** `keccakf1600` internal function, additionally allows to adjust round count. */\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/** Keccak sponge function. */\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n this.enableXOF = false;\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n // 0 < blockLen < 200\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('only keccak-f1600 function is supported');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { blockLen, state } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));\n/** SHA3-224 hash function. */\nexport const sha3_224 = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))();\n/** SHA3-256 hash function. Different from keccak-256. */\nexport const sha3_256 = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))();\n/** SHA3-384 hash function. */\nexport const sha3_384 = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))();\n/** SHA3-512 hash function. */\nexport const sha3_512 = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))();\n/** keccak-224 hash function. */\nexport const keccak_224 = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))();\n/** keccak-256 hash function. Different from SHA3-256. */\nexport const keccak_256 = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))();\n/** keccak-384 hash function. */\nexport const keccak_384 = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))();\n/** keccak-512 hash function. */\nexport const keccak_512 = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))();\nconst genShake = (suffix, blockLen, outputLen) => createXOFer((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\n/** SHAKE128 XOF with 128-bit security. */\nexport const shake128 = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))();\n/** SHAKE256 XOF with 256-bit security. */\nexport const shake256 = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))();\n//# sourceMappingURL=sha3.js.map","import { keccak_256 } from '@noble/hashes/sha3';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function keccak256(value, to_) {\n const to = to_ || 'hex';\n const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=keccak256.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { stringToBytes, } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { LruMap } from '../lru.js';\nimport { isAddress } from './isAddress.js';\nconst checksumAddressCache = /*#__PURE__*/ new LruMap(8192);\nexport function checksumAddress(address_, \n/**\n * Warning: EIP-1191 checksum addresses are generally not backwards compatible with the\n * wider Ethereum ecosystem, meaning it will break when validated against an application/tool\n * that relies on EIP-55 checksum encoding (checksum without chainId).\n *\n * It is highly recommended to not use this feature unless you\n * know what you are doing.\n *\n * See more: https://github.com/ethereum/EIPs/issues/1121\n */\nchainId) {\n if (checksumAddressCache.has(`${address_}.${chainId}`))\n return checksumAddressCache.get(`${address_}.${chainId}`);\n const hexAddress = chainId\n ? `${chainId}${address_.toLowerCase()}`\n : address_.substring(2).toLowerCase();\n const hash = keccak256(stringToBytes(hexAddress), 'bytes');\n const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split('');\n for (let i = 0; i < 40; i += 2) {\n if (hash[i >> 1] >> 4 >= 8 && address[i]) {\n address[i] = address[i].toUpperCase();\n }\n if ((hash[i >> 1] & 0x0f) >= 8 && address[i + 1]) {\n address[i + 1] = address[i + 1].toUpperCase();\n }\n }\n const result = `0x${address.join('')}`;\n checksumAddressCache.set(`${address_}.${chainId}`, result);\n return result;\n}\nexport function getAddress(address, \n/**\n * Warning: EIP-1191 checksum addresses are generally not backwards compatible with the\n * wider Ethereum ecosystem, meaning it will break when validated against an application/tool\n * that relies on EIP-55 checksum encoding (checksum without chainId).\n *\n * It is highly recommended to not use this feature unless you\n * know what you are doing.\n *\n * See more: https://github.com/ethereum/EIPs/issues/1121\n */\nchainId) {\n if (!isAddress(address, { strict: false }))\n throw new InvalidAddressError({ address });\n return checksumAddress(address, chainId);\n}\n//# sourceMappingURL=getAddress.js.map","import { LruMap } from '../lru.js';\nimport { checksumAddress } from './getAddress.js';\nconst addressRegex = /^0x[a-fA-F0-9]{40}$/;\n/** @internal */\nexport const isAddressCache = /*#__PURE__*/ new LruMap(8192);\nexport function isAddress(address, options) {\n const { strict = true } = options ?? {};\n const cacheKey = `${address}.${strict}`;\n if (isAddressCache.has(cacheKey))\n return isAddressCache.get(cacheKey);\n const result = (() => {\n if (!addressRegex.test(address))\n return false;\n if (address.toLowerCase() === address)\n return true;\n if (strict)\n return checksumAddress(address) === address;\n return true;\n })();\n isAddressCache.set(cacheKey, result);\n return result;\n}\n//# sourceMappingURL=isAddress.js.map","import { SliceOffsetOutOfBoundsError, } from '../../errors/data.js';\nimport { isHex } from './isHex.js';\nimport { size } from './size.js';\n/**\n * @description Returns a section of the hex or byte array given a start/end bytes offset.\n *\n * @param value The hex or byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function slice(value, start, end, { strict } = {}) {\n if (isHex(value, { strict: false }))\n return sliceHex(value, start, end, {\n strict,\n });\n return sliceBytes(value, start, end, {\n strict,\n });\n}\nfunction assertStartOffset(value, start) {\n if (typeof start === 'number' && start > 0 && start > size(value) - 1)\n throw new SliceOffsetOutOfBoundsError({\n offset: start,\n position: 'start',\n size: size(value),\n });\n}\nfunction assertEndOffset(value, start, end) {\n if (typeof start === 'number' &&\n typeof end === 'number' &&\n size(value) !== end - start) {\n throw new SliceOffsetOutOfBoundsError({\n offset: end,\n position: 'end',\n size: size(value),\n });\n }\n}\n/**\n * @description Returns a section of the byte array given a start/end bytes offset.\n *\n * @param value The byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceBytes(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = value_.slice(start, end);\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n/**\n * @description Returns a section of the hex value given a start/end bytes offset.\n *\n * @param value The hex value to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceHex(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = `0x${value_\n .replace('0x', '')\n .slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n//# sourceMappingURL=slice.js.map","import { versionedHashVersionKzg } from '../../constants/kzg.js';\nimport { maxUint256 } from '../../constants/number.js';\nimport { InvalidAddressError, } from '../../errors/address.js';\nimport { BaseError } from '../../errors/base.js';\nimport { EmptyBlobError, InvalidVersionedHashSizeError, InvalidVersionedHashVersionError, } from '../../errors/blob.js';\nimport { InvalidChainIdError, } from '../../errors/chain.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError, } from '../../errors/node.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { hexToNumber } from '../encoding/fromHex.js';\nexport function assertTransactionEIP7702(transaction) {\n const { authorizationList } = transaction;\n if (authorizationList) {\n for (const authorization of authorizationList) {\n const { chainId } = authorization;\n const address = authorization.address;\n if (!isAddress(address))\n throw new InvalidAddressError({ address });\n if (chainId < 0)\n throw new InvalidChainIdError({ chainId });\n }\n }\n assertTransactionEIP1559(transaction);\n}\nexport function assertTransactionEIP4844(transaction) {\n const { blobVersionedHashes } = transaction;\n if (blobVersionedHashes) {\n if (blobVersionedHashes.length === 0)\n throw new EmptyBlobError();\n for (const hash of blobVersionedHashes) {\n const size_ = size(hash);\n const version = hexToNumber(slice(hash, 0, 1));\n if (size_ !== 32)\n throw new InvalidVersionedHashSizeError({ hash, size: size_ });\n if (version !== versionedHashVersionKzg)\n throw new InvalidVersionedHashVersionError({\n hash,\n version,\n });\n }\n }\n assertTransactionEIP1559(transaction);\n}\nexport function assertTransactionEIP1559(transaction) {\n const { chainId, maxPriorityFeePerGas, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxFeePerGas && maxFeePerGas > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\nexport function assertTransactionEIP2930(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.');\n if (gasPrice && gasPrice > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\nexport function assertTransactionLegacy(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof chainId !== 'undefined' && chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.');\n if (gasPrice && gasPrice > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\n//# sourceMappingURL=assertTransaction.js.map","import { InvalidSerializableTransactionError, } from '../../errors/transaction.js';\nexport function getTransactionType(transaction) {\n if (transaction.type)\n return transaction.type;\n if (typeof transaction.authorizationList !== 'undefined')\n return 'eip7702';\n if (typeof transaction.blobs !== 'undefined' ||\n typeof transaction.blobVersionedHashes !== 'undefined' ||\n typeof transaction.maxFeePerBlobGas !== 'undefined' ||\n typeof transaction.sidecars !== 'undefined')\n return 'eip4844';\n if (typeof transaction.maxFeePerGas !== 'undefined' ||\n typeof transaction.maxPriorityFeePerGas !== 'undefined') {\n return 'eip1559';\n }\n if (typeof transaction.gasPrice !== 'undefined') {\n if (typeof transaction.accessList !== 'undefined')\n return 'eip2930';\n return 'legacy';\n }\n throw new InvalidSerializableTransactionError({ transaction });\n}\n//# sourceMappingURL=getTransactionType.js.map","import { InvalidAddressError, } from '../../errors/address.js';\nimport { InvalidStorageKeySizeError, } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\n/*\n * Serialize an EIP-2930 access list\n * @remarks\n * Use to create a transaction serializer with support for EIP-2930 access lists\n *\n * @param accessList - Array of objects of address and arrays of Storage Keys\n * @throws InvalidAddressError, InvalidStorageKeySizeError\n * @returns Array of hex strings\n */\nexport function serializeAccessList(accessList) {\n if (!accessList || accessList.length === 0)\n return [];\n const serializedAccessList = [];\n for (let i = 0; i < accessList.length; i++) {\n const { address, storageKeys } = accessList[i];\n for (let j = 0; j < storageKeys.length; j++) {\n if (storageKeys[j].length - 2 !== 64) {\n throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });\n }\n }\n if (!isAddress(address, { strict: false })) {\n throw new InvalidAddressError({ address });\n }\n serializedAccessList.push([address, storageKeys]);\n }\n return serializedAccessList;\n}\n//# sourceMappingURL=serializeAccessList.js.map","import { InvalidLegacyVError, } from '../../errors/transaction.js';\nimport { serializeAuthorizationList, } from '../authorization/serializeAuthorizationList.js';\nimport { blobsToCommitments, } from '../blob/blobsToCommitments.js';\nimport { blobsToProofs, } from '../blob/blobsToProofs.js';\nimport { commitmentsToVersionedHashes, } from '../blob/commitmentsToVersionedHashes.js';\nimport { toBlobSidecars, } from '../blob/toBlobSidecars.js';\nimport { concatHex } from '../data/concat.js';\nimport { trim } from '../data/trim.js';\nimport { bytesToHex, numberToHex, } from '../encoding/toHex.js';\nimport { toRlp } from '../encoding/toRlp.js';\nimport { assertTransactionEIP1559, assertTransactionEIP2930, assertTransactionEIP4844, assertTransactionEIP7702, assertTransactionLegacy, } from './assertTransaction.js';\nimport { getTransactionType, } from './getTransactionType.js';\nimport { serializeAccessList, } from './serializeAccessList.js';\nexport function serializeTransaction(transaction, signature) {\n const type = getTransactionType(transaction);\n if (type === 'eip1559')\n return serializeTransactionEIP1559(transaction, signature);\n if (type === 'eip2930')\n return serializeTransactionEIP2930(transaction, signature);\n if (type === 'eip4844')\n return serializeTransactionEIP4844(transaction, signature);\n if (type === 'eip7702')\n return serializeTransactionEIP7702(transaction, signature);\n return serializeTransactionLegacy(transaction, signature);\n}\nfunction serializeTransactionEIP7702(transaction, signature) {\n const { authorizationList, chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP7702(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedAuthorizationList = serializeAuthorizationList(authorizationList);\n return concatHex([\n '0x04',\n toRlp([\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n serializedAuthorizationList,\n ...toYParitySignatureArray(transaction, signature),\n ]),\n ]);\n}\nfunction serializeTransactionEIP4844(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP4844(transaction);\n let blobVersionedHashes = transaction.blobVersionedHashes;\n let sidecars = transaction.sidecars;\n // If `blobs` are passed, we will need to compute the KZG commitments & proofs.\n if (transaction.blobs &&\n (typeof blobVersionedHashes === 'undefined' ||\n typeof sidecars === 'undefined')) {\n const blobs = (typeof transaction.blobs[0] === 'string'\n ? transaction.blobs\n : transaction.blobs.map((x) => bytesToHex(x)));\n const kzg = transaction.kzg;\n const commitments = blobsToCommitments({\n blobs,\n kzg,\n });\n if (typeof blobVersionedHashes === 'undefined')\n blobVersionedHashes = commitmentsToVersionedHashes({\n commitments,\n });\n if (typeof sidecars === 'undefined') {\n const proofs = blobsToProofs({ blobs, commitments, kzg });\n sidecars = toBlobSidecars({ blobs, commitments, proofs });\n }\n }\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n maxFeePerBlobGas ? numberToHex(maxFeePerBlobGas) : '0x',\n blobVersionedHashes ?? [],\n ...toYParitySignatureArray(transaction, signature),\n ];\n const blobs = [];\n const commitments = [];\n const proofs = [];\n if (sidecars)\n for (let i = 0; i < sidecars.length; i++) {\n const { blob, commitment, proof } = sidecars[i];\n blobs.push(blob);\n commitments.push(commitment);\n proofs.push(proof);\n }\n return concatHex([\n '0x03',\n sidecars\n ? // If sidecars are enabled, envelope turns into a \"wrapper\":\n toRlp([serializedTransaction, blobs, commitments, proofs])\n : // If sidecars are disabled, standard envelope is used:\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP1559(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP1559(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ...toYParitySignatureArray(transaction, signature),\n ];\n return concatHex([\n '0x02',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP2930(transaction, signature) {\n const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;\n assertTransactionEIP2930(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n gasPrice ? numberToHex(gasPrice) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ...toYParitySignatureArray(transaction, signature),\n ];\n return concatHex([\n '0x01',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionLegacy(transaction, signature) {\n const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;\n assertTransactionLegacy(transaction);\n let serializedTransaction = [\n nonce ? numberToHex(nonce) : '0x',\n gasPrice ? numberToHex(gasPrice) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n ];\n if (signature) {\n const v = (() => {\n // EIP-155 (inferred chainId)\n if (signature.v >= 35n) {\n const inferredChainId = (signature.v - 35n) / 2n;\n if (inferredChainId > 0)\n return signature.v;\n return 27n + (signature.v === 35n ? 0n : 1n);\n }\n // EIP-155 (explicit chainId)\n if (chainId > 0)\n return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);\n // Pre-EIP-155 (no chainId)\n const v = 27n + (signature.v === 27n ? 0n : 1n);\n if (signature.v !== v)\n throw new InvalidLegacyVError({ v: signature.v });\n return v;\n })();\n const r = trim(signature.r);\n const s = trim(signature.s);\n serializedTransaction = [\n ...serializedTransaction,\n numberToHex(v),\n r === '0x00' ? '0x' : r,\n s === '0x00' ? '0x' : s,\n ];\n }\n else if (chainId > 0) {\n serializedTransaction = [\n ...serializedTransaction,\n numberToHex(chainId),\n '0x',\n '0x',\n ];\n }\n return toRlp(serializedTransaction);\n}\nexport function toYParitySignatureArray(transaction, signature_) {\n const signature = signature_ ?? transaction;\n const { v, yParity } = signature;\n if (typeof signature.r === 'undefined')\n return [];\n if (typeof signature.s === 'undefined')\n return [];\n if (typeof v === 'undefined' && typeof yParity === 'undefined')\n return [];\n const r = trim(signature.r);\n const s = trim(signature.s);\n const yParity_ = (() => {\n if (typeof yParity === 'number')\n return yParity ? numberToHex(1) : '0x';\n if (v === 0n)\n return '0x';\n if (v === 1n)\n return numberToHex(1);\n return v === 27n ? '0x' : numberToHex(1);\n })();\n return [yParity_, r === '0x00' ? '0x' : r, s === '0x00' ? '0x' : s];\n}\n//# sourceMappingURL=serializeTransaction.js.map","/**\n * Predeploy contracts for OP Stack.\n * @see https://github.com/ethereum-optimism/optimism/blob/develop/specs/predeploys.md\n */\nexport const contracts = {\n gasPriceOracle: { address: '0x420000000000000000000000000000000000000F' },\n l1Block: { address: '0x4200000000000000000000000000000000000015' },\n l2CrossDomainMessenger: {\n address: '0x4200000000000000000000000000000000000007',\n },\n l2Erc721Bridge: { address: '0x4200000000000000000000000000000000000014' },\n l2StandardBridge: { address: '0x4200000000000000000000000000000000000010' },\n l2ToL1MessagePasser: {\n address: '0x4200000000000000000000000000000000000016',\n },\n};\n//# sourceMappingURL=contracts.js.map","import { hexToBigInt, hexToNumber } from '../utils/encoding/fromHex.js';\nimport { defineBlock } from '../utils/formatters/block.js';\nimport { defineTransaction, formatTransaction, } from '../utils/formatters/transaction.js';\nimport { defineTransactionReceipt } from '../utils/formatters/transactionReceipt.js';\nexport const formatters = {\n block: /*#__PURE__*/ defineBlock({\n format(args) {\n const transactions = args.transactions?.map((transaction) => {\n if (typeof transaction === 'string')\n return transaction;\n const formatted = formatTransaction(transaction);\n if (formatted.typeHex === '0x7e') {\n formatted.isSystemTx = transaction.isSystemTx;\n formatted.mint = transaction.mint\n ? hexToBigInt(transaction.mint)\n : undefined;\n formatted.sourceHash = transaction.sourceHash;\n formatted.type = 'deposit';\n }\n return formatted;\n });\n return {\n transactions,\n stateRoot: args.stateRoot,\n };\n },\n }),\n transaction: /*#__PURE__*/ defineTransaction({\n format(args) {\n const transaction = {};\n if (args.type === '0x7e') {\n transaction.isSystemTx = args.isSystemTx;\n transaction.mint = args.mint ? hexToBigInt(args.mint) : undefined;\n transaction.sourceHash = args.sourceHash;\n transaction.type = 'deposit';\n }\n return transaction;\n },\n }),\n transactionReceipt: /*#__PURE__*/ defineTransactionReceipt({\n format(args) {\n return {\n ...(args.depositNonce\n ? { depositNonce: hexToBigInt(args.depositNonce) }\n : {}),\n ...(args.depositReceiptVersion\n ? { depositReceiptVersion: hexToNumber(args.depositReceiptVersion) }\n : {}),\n l1GasPrice: args.l1GasPrice ? hexToBigInt(args.l1GasPrice) : null,\n l1GasUsed: args.l1GasUsed ? hexToBigInt(args.l1GasUsed) : null,\n l1Fee: args.l1Fee ? hexToBigInt(args.l1Fee) : null,\n l1FeeScalar: args.l1FeeScalar ? Number(args.l1FeeScalar) : null,\n };\n },\n }),\n};\n//# sourceMappingURL=formatters.js.map","import { InvalidAddressError } from '../errors/address.js';\nimport { isAddress } from '../utils/address/isAddress.js';\nimport { concatHex } from '../utils/data/concat.js';\nimport { toHex } from '../utils/encoding/toHex.js';\nimport { toRlp } from '../utils/encoding/toRlp.js';\nimport { serializeTransaction as serializeTransaction_, } from '../utils/transaction/serializeTransaction.js';\nexport function serializeTransaction(transaction, signature) {\n if (isDeposit(transaction))\n return serializeTransactionDeposit(transaction);\n return serializeTransaction_(transaction, signature);\n}\nexport const serializers = {\n transaction: serializeTransaction,\n};\nfunction serializeTransactionDeposit(transaction) {\n assertTransactionDeposit(transaction);\n const { sourceHash, data, from, gas, isSystemTx, mint, to, value } = transaction;\n const serializedTransaction = [\n sourceHash,\n from,\n to ?? '0x',\n mint ? toHex(mint) : '0x',\n value ? toHex(value) : '0x',\n gas ? toHex(gas) : '0x',\n isSystemTx ? '0x1' : '0x',\n data ?? '0x',\n ];\n return concatHex([\n '0x7e',\n toRlp(serializedTransaction),\n ]);\n}\nfunction isDeposit(transaction) {\n if (transaction.type === 'deposit')\n return true;\n if (typeof transaction.sourceHash !== 'undefined')\n return true;\n return false;\n}\nexport function assertTransactionDeposit(transaction) {\n const { from, to } = transaction;\n if (from && !isAddress(from))\n throw new InvalidAddressError({ address: from });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n}\n//# sourceMappingURL=serializers.js.map","import { contracts } from './contracts.js';\nimport { formatters } from './formatters.js';\nimport { serializers } from './serializers.js';\nexport const chainConfig = {\n blockTime: 2_000,\n contracts,\n formatters,\n serializers,\n};\n//# sourceMappingURL=chainConfig.js.map","import { chainConfig } from '../../op-stack/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nconst sourceId = 1; // mainnet\nexport const base = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 8453,\n name: 'Base',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://mainnet.base.org'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Basescan',\n url: 'https://basescan.org',\n apiUrl: 'https://api.basescan.org/api',\n },\n },\n contracts: {\n ...chainConfig.contracts,\n disputeGameFactory: {\n [sourceId]: {\n address: '0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e',\n },\n },\n l2OutputOracle: {\n [sourceId]: {\n address: '0x56315b90c40730925ec5485cf004d835058518A0',\n },\n },\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 5022,\n },\n portal: {\n [sourceId]: {\n address: '0x49048044D57e1C92A77f79988d21Fa8fAF74E97e',\n blockCreated: 17482143,\n },\n },\n l1StandardBridge: {\n [sourceId]: {\n address: '0x3154Cf16ccdb4C6d922629664174b904d80F2C35',\n blockCreated: 17482143,\n },\n },\n },\n sourceId,\n});\nexport const basePreconf = /*#__PURE__*/ defineChain({\n ...base,\n experimental_preconfirmationTime: 200,\n rpcUrls: {\n default: {\n http: ['https://mainnet-preconf.base.org'],\n },\n },\n});\n//# sourceMappingURL=base.js.map","import { chainConfig } from '../../op-stack/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nconst sourceId = 11_155_111; // sepolia\nexport const baseSepolia = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 84532,\n network: 'base-sepolia',\n name: 'Base Sepolia',\n nativeCurrency: { name: 'Sepolia Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://sepolia.base.org'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Basescan',\n url: 'https://sepolia.basescan.org',\n apiUrl: 'https://api-sepolia.basescan.org/api',\n },\n },\n contracts: {\n ...chainConfig.contracts,\n disputeGameFactory: {\n [sourceId]: {\n address: '0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1',\n },\n },\n l2OutputOracle: {\n [sourceId]: {\n address: '0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254',\n },\n },\n portal: {\n [sourceId]: {\n address: '0x49f53e41452c74589e85ca1677426ba426459e85',\n blockCreated: 4446677,\n },\n },\n l1StandardBridge: {\n [sourceId]: {\n address: '0xfd0Bf71F60660E2f608ed56e1659C450eB113120',\n blockCreated: 4446677,\n },\n },\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 1059647,\n },\n },\n testnet: true,\n sourceId,\n});\nexport const baseSepoliaPreconf = /*#__PURE__*/ defineChain({\n ...baseSepolia,\n experimental_preconfirmationTime: 200,\n rpcUrls: {\n default: {\n http: ['https://sepolia-preconf.base.org'],\n },\n },\n});\n//# sourceMappingURL=baseSepolia.js.map","// The network a chain id names: its display name and block explorer, read\n// from viem's chain registry. Capxul runs on Base and Base Sepolia; every\n// screen takes the network from the operation's chain through this, so no\n// caller writes a network name by hand.\n\nimport { base, baseSepolia } from \"viem/chains\";\n\nexport interface Network {\n readonly chainId: number;\n readonly name: string;\n readonly explorerUrl: string;\n}\n\nconst CHAINS = [base, baseSepolia];\n\n/** The network for a chain Capxul runs on, or null for any other chain. */\nexport function networkForChain(chainId: number): Network | null {\n const chain = CHAINS.find((candidate) => candidate.id === chainId);\n return chain === undefined\n ? null\n : { chainId, name: chain.name, explorerUrl: chain.blockExplorers.default.url };\n}\n","// The one home for reading an unknown value as a plain record. Every package\n// imports these instead of writing its own `typeof x === \"object\"` guard.\n\n/** A non-null object that is not an array: a value whose fields can be read by name. */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** The field `key` of `value` when `value` is a record, else undefined. */\nexport function readField(value: unknown, key: string): unknown {\n return isRecord(value) ? value[key] : undefined;\n}\n\n/** An array whose every entry is a string. */\nexport function isStringArray(value: unknown): value is readonly string[] {\n return Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n}\n","// Where you are: the environment, the signed-in person, who you act as, and\n// the Safe. Pure functions over plain values, with no Effect import, so the\n// `whoami` fast path can load this module alone and answer in well under 0.3 s.\n\nimport { networkForChain } from \"@capxul/protocol/evm/networks\";\nimport { isRecord } from \"@capxul/protocol/primitives/record\";\n\ndeclare const CAPXUL_BUILD_BOOTSTRAP_URL: string;\n\n/** The bundled staging deployment's bootstrap origin. */\nexport const STAGING_ORIGIN =\n typeof CAPXUL_BUILD_BOOTSTRAP_URL === \"undefined\"\n ? \"https://api.staging.capxul.com\"\n : CAPXUL_BUILD_BOOTSTRAP_URL;\n/** The standing local DevNet's bootstrap (Convex site) origin. */\nexport const DEVNET_ORIGIN = \"http://127.0.0.1:3211\";\n\n/** Environments `use env` and `--env` accept. Production is not wired yet. */\nexport const ENVIRONMENT_NAMES = [\"staging\", \"devnet\", \"production\"] as const;\n\n/** Where a value came from, most specific first. */\nexport type Source = \"flag\" | \"env\" | \"saved\" | \"default\";\n\nexport interface SavedOrganization {\n readonly id: string;\n readonly handle: string;\n readonly name: string;\n readonly safe: string | null;\n}\n\n/** What this machine last learned about one deployment. Nothing here is a secret. */\nexport interface SavedOrigin {\n readonly email?: string;\n readonly authUserId?: string;\n readonly pending?: string;\n readonly safe?: string | null;\n readonly chainId?: number | null;\n readonly org?: SavedOrganization | null;\n}\n\nexport interface SavedWhere {\n readonly version: 1;\n readonly env?: string;\n readonly origins?: Readonly<Record<string, SavedOrigin>>;\n}\n\nconst EMPTY_WHERE: SavedWhere = { version: 1 };\n\nconst nonEmpty = (value: unknown) =>\n typeof value === \"string\" && value !== \"\" ? value : undefined;\n\nconst parseOrganization = (value: unknown): SavedOrganization | null | undefined => {\n if (value === null) return null;\n if (!isRecord(value)) return undefined;\n const [id, handle, name] = [nonEmpty(value.id), nonEmpty(value.handle), nonEmpty(value.name)];\n return id === undefined || handle === undefined || name === undefined\n ? undefined\n : { id, handle, name, safe: nonEmpty(value.safe) ?? null };\n};\n\nconst parseOrigin = (value: unknown): SavedOrigin => {\n if (!isRecord(value)) return {};\n const fields = {\n email: nonEmpty(value.email),\n authUserId: nonEmpty(value.authUserId),\n pending: nonEmpty(value.pending),\n safe: nonEmpty(value.safe),\n chainId: Number.isSafeInteger(value.chainId) ? Number(value.chainId) : undefined,\n org: parseOrganization(value.org),\n };\n return Object.fromEntries(Object.entries(fields).filter(([, field]) => field !== undefined));\n};\n\n/** Read `context.json` content. Damaged or foreign content reads as empty: it is a cache. */\nexport const parseWhere = (content: string | null): SavedWhere => {\n if (content === null) return EMPTY_WHERE;\n try {\n const value: unknown = JSON.parse(content);\n if (!isRecord(value) || value.version !== 1) return EMPTY_WHERE;\n const origins = isRecord(value.origins) ? value.origins : {};\n const env = nonEmpty(value.env);\n return {\n version: 1,\n ...(env === undefined ? {} : { env }),\n origins: Object.fromEntries(\n Object.entries(origins).map(([origin, saved]) => [origin, parseOrigin(saved)]),\n ),\n };\n } catch {\n return EMPTY_WHERE;\n }\n};\n\n/** The CLI home folder, from the same variables the runtime configuration reads. */\nexport const cliHome = (\n env: Readonly<Record<string, string | undefined>>,\n join: (...parts: string[]) => string,\n) =>\n env.CAPXUL_CLI_HOME ??\n (env.XDG_CONFIG_HOME === undefined\n ? env.HOME === undefined\n ? undefined\n : join(env.HOME, \".config\", \"capxul\", \"cli\")\n : join(env.XDG_CONFIG_HOME, \"capxul\", \"cli\"));\n\n/** Every value of a `--name value` or `--name=value` flag, before any `--`. */\nexport const flagValues = (args: readonly string[], name: string): readonly string[] => {\n const end = args.indexOf(\"--\");\n const flags = end < 0 ? args : args.slice(0, end);\n return flags.flatMap((arg, index) =>\n arg.startsWith(`--${name}=`)\n ? [arg.slice(name.length + 3)]\n : arg === `--${name}` && flags[index + 1] !== undefined\n ? [flags[index + 1]!]\n : [],\n );\n};\n\n/** The last value of one flag, as the parser reads it. */\nexport const flagValue = (args: readonly string[], name: string): string | undefined =>\n flagValues(args, name).at(-1);\n\n/**\n * The `--org` and `--env` a person typed, for a suggested command line: every\n * command takes them, and without them the suggestion acts somewhere else or\n * refuses (`org payroll run`). A value that is not plain is not echoed.\n */\nexport const scopeArgs = (args: readonly string[]) =>\n [\"org\", \"env\"].flatMap((name) => {\n const value = flagValue(args, name);\n return value !== undefined && /^[\\w.@:+-]{1,64}$/u.test(value) ? [`--${name}`, value] : [];\n });\n\nconst isLoopback = (hostname: string) =>\n hostname === \"localhost\" || hostname === \"127.0.0.1\" || hostname === \"[::1]\";\n\n/** `production` is named for the header rule; no origin maps to it until production is wired. */\nexport type EnvironmentName = \"production\" | \"staging\" | \"devnet\" | \"local\" | \"custom\";\n\n/** What an origin points at: bundled staging, the local DevNet, another loopback backend, or custom. */\nexport const environmentOf = (origin: string): EnvironmentName => {\n if (origin === STAGING_ORIGIN) return \"staging\";\n if (origin === DEVNET_ORIGIN) return \"devnet\";\n return URL.canParse(origin) && isLoopback(new URL(origin).hostname) ? \"local\" : \"custom\";\n};\n\nexport type EnvironmentChoice =\n | { readonly origin: string; readonly source: Source }\n | { readonly refusal: string };\n\n/**\n * Select the deployment: `--env`, then `CAPXUL_ENV`, then `CAPXUL_BOOTSTRAP_URL`,\n * then the environment `use env` saved, then staging.\n */\nexport const chooseEnvironment = (input: {\n readonly flag: string | undefined;\n readonly variable: string | undefined;\n readonly bootstrapUrl: string | undefined;\n readonly saved: string | undefined;\n}): EnvironmentChoice => {\n const named = (name: string, source: Source): EnvironmentChoice => {\n if (name === \"staging\") return { origin: STAGING_ORIGIN, source };\n if (name === \"devnet\") return { origin: DEVNET_ORIGIN, source };\n if (name === \"production\")\n return { refusal: \"Production is not available in this CLI yet. Use staging or devnet.\" };\n return { refusal: `Unknown environment \"${name}\". Use one of: staging, devnet.` };\n };\n if (input.flag !== undefined) return named(input.flag, \"flag\");\n if (input.variable !== undefined && input.variable !== \"\") return named(input.variable, \"env\");\n if (input.bootstrapUrl !== undefined && input.bootstrapUrl !== \"\")\n return { origin: input.bootstrapUrl, source: \"env\" };\n if (input.saved !== undefined) return named(input.saved, \"saved\");\n return { origin: STAGING_ORIGIN, source: \"default\" };\n};\n\n/** The network's name, from the chain Capxul data names. */\nexport const networkName = (chainId: number | null | undefined) =>\n chainId === null || chainId === undefined\n ? null\n : (networkForChain(chainId)?.name ?? `Chain ${chainId}`);\n\nexport type Where = {\n readonly user: { readonly email: string } | null;\n readonly actingAs:\n | { readonly kind: \"personal\"; readonly source: Source }\n | {\n readonly kind: \"organization\";\n readonly handle: string;\n readonly name: string | null;\n readonly id: string | null;\n readonly source: Source;\n };\n readonly safe: string | null;\n readonly env: {\n readonly name: EnvironmentName;\n readonly origin: string;\n readonly source: Source;\n readonly network: string | null;\n readonly chainId: number | null;\n };\n};\n\n/** The Organization `--org`, else `CAPXUL_ORG`, names for one command. */\nexport const explicitOrganization = (flag: string | undefined, variable: string | undefined) =>\n flag !== undefined\n ? { value: flag, source: \"flag\" as const }\n : variable === undefined || variable === \"\"\n ? undefined\n : { value: variable, source: \"env\" as const };\n\ntype ExplicitOrganization = ReturnType<typeof explicitOrganization>;\n\n/** Who you act as: `--org` or `CAPXUL_ORG`, else the saved Organization, else yourself. */\nconst actorOf = (saved: SavedOrigin, explicit: ExplicitOrganization) => {\n if (explicit === undefined) {\n const org = saved.org;\n // `use personal` saves an explicit null; otherwise yourself is the default.\n if (org === null || org === undefined)\n return {\n actingAs: { kind: \"personal\", source: org === null ? \"saved\" : \"default\" },\n } as const;\n return { known: org, actingAs: { kind: \"organization\", ...org, source: \"saved\" } } as const;\n }\n const wanted = explicit.value.replace(/^@/u, \"\").toLowerCase();\n const known =\n saved.org?.handle.toLowerCase() === wanted || saved.org?.id === explicit.value\n ? saved.org\n : undefined;\n return {\n known,\n actingAs: {\n kind: \"organization\",\n handle: known?.handle ?? explicit.value,\n name: known?.name ?? null,\n id: known?.id ?? null,\n source: explicit.source,\n },\n } as const;\n};\n\n/** Combine the selected deployment, an explicit Organization, and what this machine saved. */\nexport const describeWhere = (input: {\n readonly origin: string;\n readonly envSource: Source;\n readonly saved: SavedWhere;\n readonly explicitOrg: ExplicitOrganization;\n}): Where => {\n const saved = input.saved.origins?.[input.origin] ?? {};\n const user = saved.email === undefined ? null : { email: saved.email };\n const { known, actingAs: actor } = actorOf(saved, input.explicitOrg);\n const actingAs: Where[\"actingAs\"] =\n actor.kind === \"personal\"\n ? actor\n : {\n kind: actor.kind,\n handle: actor.handle,\n name: actor.name,\n id: actor.id,\n source: actor.source,\n };\n const chainId = saved.chainId ?? null;\n return {\n user,\n actingAs,\n safe: actingAs.kind === \"personal\" ? (saved.safe ?? null) : (known?.safe ?? null),\n env: {\n name: environmentOf(input.origin),\n origin: input.origin,\n source: input.envSource,\n network: networkName(chainId),\n chainId,\n },\n };\n};\n","// How \"where you are\" reads on a terminal: the header line and the `whoami`\n// table. Pure text, with no Effect import, for the `whoami` fast path.\n\nimport type { Source, Where } from \"./where\";\n\nconst shortAddress = (address: string) =>\n /^0x[0-9a-fA-F]{40}$/u.test(address) ? `${address.slice(0, 6)}…${address.slice(-4)}` : address;\n\n/** Saved names come from other clients: keep terminal control characters out of them. */\nconst printable = (value: string) => value.replace(/[\\p{Cc}\\p{Cf}]/gu, \"?\");\n\nconst actorLabel = (where: Where) =>\n where.actingAs.kind === \"personal\"\n ? \"Personal\"\n : printable(where.actingAs.name ?? where.actingAs.handle);\n\n/** Text styling a terminal shows. Pipes, `NO_COLOR` and JSON get plain text. */\nexport interface Style {\n readonly highlight: (text: string) => string;\n readonly dim: (text: string) => string;\n readonly bad: (text: string) => string;\n readonly good: (text: string) => string;\n}\nexport const PLAIN: Style = {\n highlight: (text) => text,\n dim: (text) => text,\n bad: (text) => text,\n good: (text) => text,\n};\nconst COLOR: Style = {\n highlight: (text) => `\\u001b[33m${text}\\u001b[39m`,\n dim: (text) => `\\u001b[2m${text}\\u001b[22m`,\n bad: (text) => `\\u001b[31m${text}\\u001b[39m`,\n good: (text) => `\\u001b[32m${text}\\u001b[39m`,\n};\nexport const styleFor = (tty: boolean, env: Readonly<Record<string, string | undefined>>) =>\n tty && (env.NO_COLOR === undefined || env.NO_COLOR === \"\") ? COLOR : PLAIN;\n\n/** `▸ Acme Ltd · staging · Base Sepolia`. Production is the normal case: no label. */\nexport const headerLine = (where: Where, style: Style) =>\n [\n `▸ ${actorLabel(where)}`,\n ...(where.env.name === \"production\" ? [] : [style.highlight(where.env.name)]),\n ...(where.env.network === null ? [] : [where.env.network]),\n ].join(\" · \");\n\n/** The `whoami` table. Values are padded before styling so columns stay aligned. */\nexport const whoamiLines = (where: Where, style: Style): readonly string[] => {\n const row = (label: string, value: string, note?: Source, styled = value) =>\n `${label.padEnd(11)}${\n note === undefined || note === \"default\"\n ? styled\n : `${styled}${\" \".repeat(Math.max(2, 23 - value.length))}${style.dim(note)}`\n }`;\n const acting =\n where.actingAs.kind === \"personal\"\n ? \"yourself\"\n : `${printable(where.actingAs.name ?? where.actingAs.handle)} (org)`;\n const network = where.env.network === null ? \"\" : ` · ${where.env.network}`;\n return [\n row(\n \"user\",\n where.user === null ? \"not signed in · capxul auth login\" : printable(where.user.email),\n ),\n row(\"acting as\", acting, where.actingAs.source),\n ...(where.safe === null ? [] : [row(\"safe\", shortAddress(where.safe))]),\n row(\n \"env\",\n `${where.env.name}${network}`,\n where.env.source,\n `${style.highlight(where.env.name)}${network}`,\n ),\n ];\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"mappings":";;AAAA,SAAgB,YAAY,OAAO;CAC/B,MAAM,gBAAgB;EAClB,YAAY,KAAA;EACZ,MAAM,KAAA;EACN,aAAa,KAAA;EACb,GAAG;CACP;CACA,SAAS,OAAO,MAAM;EAClB,QAAQ,iBAAiB;GACrB,MAAM,aAAc,OAAO,iBAAiB,aAAa,aAAa,IAAI,IAAI;GAC9E,MAAM,WAAW;IAAE,GAAG;IAAM,GAAG;GAAW;GAC1C,OAAO,OAAO,OAAO,UAAU,EAAE,QAAQ,OAAO,QAAQ,EAAE,CAAC;EAC/D;CACJ;CACA,OAAO,OAAO,OAAO,eAAe,EAChC,QAAQ,OAAO,aAAa,EAChC,CAAC;AACL;;;ACjBA,MAAa,UAAU;;;ACCvB,IAAI,cAAc;CACd,aAAa,EAAE,aAAa,WAAW,IAAI,eAAgB,WACrD,GAAG,eAAe,oBAAoB,WAAW,WAAW,IAAI,aAAa,OAC7E,KAAA;CACN,SAAS,QAAQ;AACrB;AAIA,IAAa,YAAb,MAAa,kBAAkB,MAAM;CACjC,YAAY,cAAc,OAAO,CAAC,GAAG;EACjC,MAAM,iBAAiB;GACnB,IAAI,KAAK,iBAAiB,WACtB,OAAO,KAAK,MAAM;GACtB,IAAI,KAAK,OAAO,SACZ,OAAO,KAAK,MAAM;GACtB,OAAO,KAAK;EAChB,EAAA,CAAG;EACH,MAAM,kBAAkB;GACpB,IAAI,KAAK,iBAAi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