@capxul/cli 4.20.0-beta.3 → 4.20.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1156 -21
- package/dist/browser/GeistVF.woff +0 -0
- package/dist/browser/signer.js +85954 -0
- package/dist/browser/signer.js.map +1 -0
- package/dist/entry-Cp3LiVYn.mjs +46472 -0
- package/dist/entry-Cp3LiVYn.mjs.map +1 -0
- package/dist/fast-Dvf2EM7j.mjs +57 -0
- package/dist/fast-Dvf2EM7j.mjs.map +1 -0
- package/dist/{lib-BOge5QZP.mjs → lib-5nM6ORJd.mjs} +5 -4
- package/dist/{lib-BOge5QZP.mjs.map → lib-5nM6ORJd.mjs.map} +1 -1
- package/dist/{lib-DH_xJGSE.mjs → lib-BJgR4mWJ.mjs} +6 -5
- package/dist/{lib-DH_xJGSE.mjs.map → lib-BJgR4mWJ.mjs.map} +1 -1
- package/dist/lib-BlUleR2B.mjs +3 -0
- package/dist/{lib-C8ENT9j6.mjs → lib-BspI667y.mjs} +7 -6
- package/dist/{lib-C8ENT9j6.mjs.map → lib-BspI667y.mjs.map} +1 -1
- package/dist/{lib-C4fpnzyy.mjs → lib-Buegx0dz.mjs} +6 -5
- package/dist/{lib-C4fpnzyy.mjs.map → lib-Buegx0dz.mjs.map} +1 -1
- package/dist/{lib-DVGoRCJN.mjs → lib-CJw8te9L.mjs} +38 -38
- package/dist/{lib-DVGoRCJN.mjs.map → lib-CJw8te9L.mjs.map} +1 -1
- package/dist/lib-C_-etuHZ.mjs +3 -0
- package/dist/lib-CoGPQsbr.mjs +655 -0
- package/dist/lib-CoGPQsbr.mjs.map +1 -0
- package/dist/lib-Dd_fsz7h.mjs +3 -0
- package/dist/lib-DnmstTkB.mjs +578 -0
- package/dist/lib-DnmstTkB.mjs.map +1 -0
- package/dist/lib-IlYdzOHo.mjs +3 -0
- package/dist/main.mjs +22 -51062
- package/dist/main.mjs.map +1 -1
- package/dist/organizations-Dkb73lVO.mjs +37607 -0
- package/dist/organizations-Dkb73lVO.mjs.map +1 -0
- package/dist/permission-approvals-C3cUSQeT.mjs +139 -0
- package/dist/permission-approvals-C3cUSQeT.mjs.map +1 -0
- package/dist/record-U7Yu4KQP.mjs +1295 -0
- package/dist/record-U7Yu4KQP.mjs.map +1 -0
- package/dist/{secp256k1-Cc9JhcTQ.mjs → secp256k1-D8L212-Z.mjs} +5 -298
- package/dist/secp256k1-D8L212-Z.mjs.map +1 -0
- package/dist/sha2-CR2DnMEk.mjs +298 -0
- package/dist/sha2-CR2DnMEk.mjs.map +1 -0
- package/dist/utils-DmKXBQjM.mjs +130 -0
- package/dist/utils-DmKXBQjM.mjs.map +1 -0
- package/dist/where-view-DuGbrSLp.mjs +1420 -0
- package/dist/where-view-DuGbrSLp.mjs.map +1 -0
- package/package.json +18 -10
- package/dist/secp256k1-Cc9JhcTQ.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-U7Yu4KQP.mjs","names":["encoder","size_","size","toBytes"],"sources":["../../../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/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/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.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/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","../../../packages/protocol/src/primitives/record.ts"],"sourcesContent":["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 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","/**\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","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","/**\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","// 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"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,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SAAS,gBAAgB,OAAO,OAAO,KAAK;CACxC,IAAI,OAAO,UAAU,YACjB,OAAO,QAAQ,YACf,KAAK,KAAK,MAAM,MAAM,OACtB,MAAM,IAAI,4BAA4B;EAClC,QAAQ;EACR,UAAU;EACV,MAAM,KAAK,KAAK;CACpB,CAAC;AAET;;;;;;;;AAQA,SAAgB,WAAW,QAAQ,OAAO,KAAK,EAAE,WAAW,CAAC,GAAG;CAC5D,kBAAkB,QAAQ,KAAK;CAC/B,MAAM,QAAQ,OAAO,MAAM,OAAO,GAAG;CACrC,IAAI,QACA,gBAAgB,OAAO,OAAO,GAAG;CACrC,OAAO;AACX;;;;;;;;AAQA,SAAgB,SAAS,QAAQ,OAAO,KAAK,EAAE,WAAW,CAAC,GAAG;CAC1D,kBAAkB,QAAQ,KAAK;CAC/B,MAAM,QAAQ,KAAK,OACd,QAAQ,MAAM,EAAE,CAAC,CACjB,OAAO,SAAS,KAAK,IAAI,OAAO,OAAO,UAAU,CAAC;CACvD,IAAI,QACA,gBAAgB,OAAO,OAAO,GAAG;CACrC,OAAO;AACX;;;;AC/DA,SAAgB,SAAS,OAAkD;CACzE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;AAGA,SAAgB,UAAU,OAAgB,KAAsB;CAC9D,OAAO,SAAS,KAAK,IAAI,MAAM,OAAO,KAAA;AACxC"}
|
|
@@ -1,298 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Internal Merkle-Damgard hash utils.
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */
|
|
8
|
-
function setBigUint64(view, byteOffset, value, isLE) {
|
|
9
|
-
if (typeof view.setBigUint64 === "function") return view.setBigUint64(byteOffset, value, isLE);
|
|
10
|
-
const _32n = BigInt(32);
|
|
11
|
-
const _u32_max = BigInt(4294967295);
|
|
12
|
-
const wh = Number(value >> _32n & _u32_max);
|
|
13
|
-
const wl = Number(value & _u32_max);
|
|
14
|
-
const h = isLE ? 4 : 0;
|
|
15
|
-
const l = isLE ? 0 : 4;
|
|
16
|
-
view.setUint32(byteOffset + h, wh, isLE);
|
|
17
|
-
view.setUint32(byteOffset + l, wl, isLE);
|
|
18
|
-
}
|
|
19
|
-
/** Choice: a ? b : c */
|
|
20
|
-
function Chi(a, b, c) {
|
|
21
|
-
return a & b ^ ~a & c;
|
|
22
|
-
}
|
|
23
|
-
/** Majority function, true if any two inputs is true. */
|
|
24
|
-
function Maj(a, b, c) {
|
|
25
|
-
return a & b ^ a & c ^ b & c;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Merkle-Damgard hash construction base class.
|
|
29
|
-
* Could be used to create MD5, RIPEMD, SHA1, SHA2.
|
|
30
|
-
*/
|
|
31
|
-
var HashMD = class extends Hash {
|
|
32
|
-
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
33
|
-
super();
|
|
34
|
-
this.finished = false;
|
|
35
|
-
this.length = 0;
|
|
36
|
-
this.pos = 0;
|
|
37
|
-
this.destroyed = false;
|
|
38
|
-
this.blockLen = blockLen;
|
|
39
|
-
this.outputLen = outputLen;
|
|
40
|
-
this.padOffset = padOffset;
|
|
41
|
-
this.isLE = isLE;
|
|
42
|
-
this.buffer = new Uint8Array(blockLen);
|
|
43
|
-
this.view = createView(this.buffer);
|
|
44
|
-
}
|
|
45
|
-
update(data) {
|
|
46
|
-
aexists(this);
|
|
47
|
-
data = toBytes(data);
|
|
48
|
-
abytes$1(data);
|
|
49
|
-
const { view, buffer, blockLen } = this;
|
|
50
|
-
const len = data.length;
|
|
51
|
-
for (let pos = 0; pos < len;) {
|
|
52
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
|
53
|
-
if (take === blockLen) {
|
|
54
|
-
const dataView = createView(data);
|
|
55
|
-
for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
59
|
-
this.pos += take;
|
|
60
|
-
pos += take;
|
|
61
|
-
if (this.pos === blockLen) {
|
|
62
|
-
this.process(view, 0);
|
|
63
|
-
this.pos = 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
this.length += data.length;
|
|
67
|
-
this.roundClean();
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
digestInto(out) {
|
|
71
|
-
aexists(this);
|
|
72
|
-
aoutput(out, this);
|
|
73
|
-
this.finished = true;
|
|
74
|
-
const { buffer, view, blockLen, isLE } = this;
|
|
75
|
-
let { pos } = this;
|
|
76
|
-
buffer[pos++] = 128;
|
|
77
|
-
clean(this.buffer.subarray(pos));
|
|
78
|
-
if (this.padOffset > blockLen - pos) {
|
|
79
|
-
this.process(view, 0);
|
|
80
|
-
pos = 0;
|
|
81
|
-
}
|
|
82
|
-
for (let i = pos; i < blockLen; i++) buffer[i] = 0;
|
|
83
|
-
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
|
84
|
-
this.process(view, 0);
|
|
85
|
-
const oview = createView(out);
|
|
86
|
-
const len = this.outputLen;
|
|
87
|
-
if (len % 4) throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
88
|
-
const outLen = len / 4;
|
|
89
|
-
const state = this.get();
|
|
90
|
-
if (outLen > state.length) throw new Error("_sha2: outputLen bigger than state");
|
|
91
|
-
for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
|
|
92
|
-
}
|
|
93
|
-
digest() {
|
|
94
|
-
const { buffer, outputLen } = this;
|
|
95
|
-
this.digestInto(buffer);
|
|
96
|
-
const res = buffer.slice(0, outputLen);
|
|
97
|
-
this.destroy();
|
|
98
|
-
return res;
|
|
99
|
-
}
|
|
100
|
-
_cloneInto(to) {
|
|
101
|
-
to || (to = new this.constructor());
|
|
102
|
-
to.set(...this.get());
|
|
103
|
-
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
104
|
-
to.destroyed = destroyed;
|
|
105
|
-
to.finished = finished;
|
|
106
|
-
to.length = length;
|
|
107
|
-
to.pos = pos;
|
|
108
|
-
if (length % blockLen) to.buffer.set(buffer);
|
|
109
|
-
return to;
|
|
110
|
-
}
|
|
111
|
-
clone() {
|
|
112
|
-
return this._cloneInto();
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
|
|
117
|
-
* Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
|
|
118
|
-
*/
|
|
119
|
-
/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */
|
|
120
|
-
const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
121
|
-
1779033703,
|
|
122
|
-
3144134277,
|
|
123
|
-
1013904242,
|
|
124
|
-
2773480762,
|
|
125
|
-
1359893119,
|
|
126
|
-
2600822924,
|
|
127
|
-
528734635,
|
|
128
|
-
1541459225
|
|
129
|
-
]);
|
|
130
|
-
//#endregion
|
|
131
|
-
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
|
|
132
|
-
/**
|
|
133
|
-
* SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.
|
|
134
|
-
* SHA256 is the fastest hash implementable in JS, even faster than Blake3.
|
|
135
|
-
* Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and
|
|
136
|
-
* [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).
|
|
137
|
-
* @module
|
|
138
|
-
*/
|
|
139
|
-
/**
|
|
140
|
-
* Round constants:
|
|
141
|
-
* First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)
|
|
142
|
-
*/
|
|
143
|
-
const SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
144
|
-
1116352408,
|
|
145
|
-
1899447441,
|
|
146
|
-
3049323471,
|
|
147
|
-
3921009573,
|
|
148
|
-
961987163,
|
|
149
|
-
1508970993,
|
|
150
|
-
2453635748,
|
|
151
|
-
2870763221,
|
|
152
|
-
3624381080,
|
|
153
|
-
310598401,
|
|
154
|
-
607225278,
|
|
155
|
-
1426881987,
|
|
156
|
-
1925078388,
|
|
157
|
-
2162078206,
|
|
158
|
-
2614888103,
|
|
159
|
-
3248222580,
|
|
160
|
-
3835390401,
|
|
161
|
-
4022224774,
|
|
162
|
-
264347078,
|
|
163
|
-
604807628,
|
|
164
|
-
770255983,
|
|
165
|
-
1249150122,
|
|
166
|
-
1555081692,
|
|
167
|
-
1996064986,
|
|
168
|
-
2554220882,
|
|
169
|
-
2821834349,
|
|
170
|
-
2952996808,
|
|
171
|
-
3210313671,
|
|
172
|
-
3336571891,
|
|
173
|
-
3584528711,
|
|
174
|
-
113926993,
|
|
175
|
-
338241895,
|
|
176
|
-
666307205,
|
|
177
|
-
773529912,
|
|
178
|
-
1294757372,
|
|
179
|
-
1396182291,
|
|
180
|
-
1695183700,
|
|
181
|
-
1986661051,
|
|
182
|
-
2177026350,
|
|
183
|
-
2456956037,
|
|
184
|
-
2730485921,
|
|
185
|
-
2820302411,
|
|
186
|
-
3259730800,
|
|
187
|
-
3345764771,
|
|
188
|
-
3516065817,
|
|
189
|
-
3600352804,
|
|
190
|
-
4094571909,
|
|
191
|
-
275423344,
|
|
192
|
-
430227734,
|
|
193
|
-
506948616,
|
|
194
|
-
659060556,
|
|
195
|
-
883997877,
|
|
196
|
-
958139571,
|
|
197
|
-
1322822218,
|
|
198
|
-
1537002063,
|
|
199
|
-
1747873779,
|
|
200
|
-
1955562222,
|
|
201
|
-
2024104815,
|
|
202
|
-
2227730452,
|
|
203
|
-
2361852424,
|
|
204
|
-
2428436474,
|
|
205
|
-
2756734187,
|
|
206
|
-
3204031479,
|
|
207
|
-
3329325298
|
|
208
|
-
]);
|
|
209
|
-
/** Reusable temporary buffer. "W" comes straight from spec. */
|
|
210
|
-
const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
211
|
-
var SHA256 = class extends HashMD {
|
|
212
|
-
constructor(outputLen = 32) {
|
|
213
|
-
super(64, outputLen, 8, false);
|
|
214
|
-
this.A = SHA256_IV[0] | 0;
|
|
215
|
-
this.B = SHA256_IV[1] | 0;
|
|
216
|
-
this.C = SHA256_IV[2] | 0;
|
|
217
|
-
this.D = SHA256_IV[3] | 0;
|
|
218
|
-
this.E = SHA256_IV[4] | 0;
|
|
219
|
-
this.F = SHA256_IV[5] | 0;
|
|
220
|
-
this.G = SHA256_IV[6] | 0;
|
|
221
|
-
this.H = SHA256_IV[7] | 0;
|
|
222
|
-
}
|
|
223
|
-
get() {
|
|
224
|
-
const { A, B, C, D, E, F, G, H } = this;
|
|
225
|
-
return [
|
|
226
|
-
A,
|
|
227
|
-
B,
|
|
228
|
-
C,
|
|
229
|
-
D,
|
|
230
|
-
E,
|
|
231
|
-
F,
|
|
232
|
-
G,
|
|
233
|
-
H
|
|
234
|
-
];
|
|
235
|
-
}
|
|
236
|
-
set(A, B, C, D, E, F, G, H) {
|
|
237
|
-
this.A = A | 0;
|
|
238
|
-
this.B = B | 0;
|
|
239
|
-
this.C = C | 0;
|
|
240
|
-
this.D = D | 0;
|
|
241
|
-
this.E = E | 0;
|
|
242
|
-
this.F = F | 0;
|
|
243
|
-
this.G = G | 0;
|
|
244
|
-
this.H = H | 0;
|
|
245
|
-
}
|
|
246
|
-
process(view, offset) {
|
|
247
|
-
for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
|
|
248
|
-
for (let i = 16; i < 64; i++) {
|
|
249
|
-
const W15 = SHA256_W[i - 15];
|
|
250
|
-
const W2 = SHA256_W[i - 2];
|
|
251
|
-
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
252
|
-
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
253
|
-
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
254
|
-
}
|
|
255
|
-
let { A, B, C, D, E, F, G, H } = this;
|
|
256
|
-
for (let i = 0; i < 64; i++) {
|
|
257
|
-
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
258
|
-
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
259
|
-
const T2 = (rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22)) + Maj(A, B, C) | 0;
|
|
260
|
-
H = G;
|
|
261
|
-
G = F;
|
|
262
|
-
F = E;
|
|
263
|
-
E = D + T1 | 0;
|
|
264
|
-
D = C;
|
|
265
|
-
C = B;
|
|
266
|
-
B = A;
|
|
267
|
-
A = T1 + T2 | 0;
|
|
268
|
-
}
|
|
269
|
-
A = A + this.A | 0;
|
|
270
|
-
B = B + this.B | 0;
|
|
271
|
-
C = C + this.C | 0;
|
|
272
|
-
D = D + this.D | 0;
|
|
273
|
-
E = E + this.E | 0;
|
|
274
|
-
F = F + this.F | 0;
|
|
275
|
-
G = G + this.G | 0;
|
|
276
|
-
H = H + this.H | 0;
|
|
277
|
-
this.set(A, B, C, D, E, F, G, H);
|
|
278
|
-
}
|
|
279
|
-
roundClean() {
|
|
280
|
-
clean(SHA256_W);
|
|
281
|
-
}
|
|
282
|
-
destroy() {
|
|
283
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
284
|
-
clean(this.buffer);
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
/**
|
|
288
|
-
* SHA2-256 hash function from RFC 4634.
|
|
289
|
-
*
|
|
290
|
-
* It is the fastest JS hash, even faster than Blake3.
|
|
291
|
-
* To break sha256 using birthday attack, attackers need to try 2^128 hashes.
|
|
292
|
-
* BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
|
|
293
|
-
*/
|
|
294
|
-
const sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
|
|
295
|
-
//#endregion
|
|
1
|
+
import { a as anumber, c as concatBytes$1, d as randomBytes, i as ahash, m as toBytes, n as abytes$1, r as aexists, s as clean, t as Hash } from "./utils-DmKXBQjM.mjs";
|
|
2
|
+
import { t as sha256 } from "./sha2-CR2DnMEk.mjs";
|
|
296
3
|
//#region ../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/abstract/utils.js
|
|
297
4
|
/**
|
|
298
5
|
* Hex, bytes and number utilities.
|
|
@@ -437,8 +144,8 @@ function aInRange(title, n, min, max) {
|
|
|
437
144
|
* TODO: merge with nLength in modular
|
|
438
145
|
*/
|
|
439
146
|
function bitLen(n) {
|
|
440
|
-
let len;
|
|
441
|
-
for (
|
|
147
|
+
let len = 0;
|
|
148
|
+
for (; n > _0n$4; n >>= _1n$4, len += 1);
|
|
442
149
|
return len;
|
|
443
150
|
}
|
|
444
151
|
/**
|
|
@@ -2216,4 +1923,4 @@ const secp256k1 = createCurve({
|
|
|
2216
1923
|
//#endregion
|
|
2217
1924
|
export { secp256k1 };
|
|
2218
1925
|
|
|
2219
|
-
//# sourceMappingURL=secp256k1-
|
|
1926
|
+
//# sourceMappingURL=secp256k1-D8L212-Z.mjs.map
|