@ethereum-tag-service/contracts
Version:
Composable content tagging service for Web3
1,431 lines (1,391 loc) • 87.2 kB
JavaScript
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/chain/defineChain.js
function defineChain(chain) {
return {
formatters: void 0,
fees: void 0,
serializers: void 0,
...chain
};
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/version.js
var version = "2.33.2";
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/base.js
var errorConfig = {
getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
version: `viem@${version}`
};
var BaseError = class _BaseError extends Error {
constructor(shortMessage, args = {}) {
const details = (() => {
if (args.cause instanceof _BaseError)
return args.cause.details;
if (args.cause?.message)
return args.cause.message;
return args.details;
})();
const docsPath = (() => {
if (args.cause instanceof _BaseError)
return args.cause.docsPath || args.docsPath;
return args.docsPath;
})();
const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath });
const message = [
shortMessage || "An error occurred.",
"",
...args.metaMessages ? [...args.metaMessages, ""] : [],
...docsUrl ? [`Docs: ${docsUrl}`] : [],
...details ? [`Details: ${details}`] : [],
...errorConfig.version ? [`Version: ${errorConfig.version}`] : []
].join("\n");
super(message, args.cause ? { cause: args.cause } : void 0);
Object.defineProperty(this, "details", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "docsPath", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "metaMessages", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "shortMessage", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "version", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: "BaseError"
});
this.details = details;
this.docsPath = docsPath;
this.metaMessages = args.metaMessages;
this.name = args.name ?? this.name;
this.shortMessage = shortMessage;
this.version = version;
}
walk(fn) {
return walk(this, fn);
}
};
function walk(err, fn) {
if (fn?.(err))
return err;
if (err && typeof err === "object" && "cause" in err && err.cause !== void 0)
return walk(err.cause, fn);
return fn ? null : err;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/encoding.js
var IntegerOutOfRangeError = class extends BaseError {
constructor({ max, min, signed, size: size2, value }) {
super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
}
};
var SizeOverflowError = class extends BaseError {
constructor({ givenSize, maxSize }) {
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
}
};
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/isHex.js
function isHex(value, { strict = true } = {}) {
if (!value)
return false;
if (typeof value !== "string")
return false;
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/size.js
function size(value) {
if (isHex(value, { strict: false }))
return Math.ceil((value.length - 2) / 2);
return value.length;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/trim.js
function trim(hexOrBytes, { dir = "left" } = {}) {
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
let sliceLength = 0;
for (let i = 0; i < data.length - 1; i++) {
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
sliceLength++;
else
break;
}
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
if (typeof hexOrBytes === "string") {
if (data.length === 1 && dir === "right")
data = `${data}0`;
return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
}
return data;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/data.js
var SliceOffsetOutOfBoundsError = class extends BaseError {
constructor({ offset, position, size: size2 }) {
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`, { name: "SliceOffsetOutOfBoundsError" });
}
};
var SizeExceedsPaddingSizeError = class extends BaseError {
constructor({ size: size2, targetSize, type }) {
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
}
};
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/pad.js
function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
if (typeof hexOrBytes === "string")
return padHex(hexOrBytes, { dir, size: size2 });
return padBytes(hexOrBytes, { dir, size: size2 });
}
function padHex(hex_, { dir, size: size2 = 32 } = {}) {
if (size2 === null)
return hex_;
const hex = hex_.replace("0x", "");
if (hex.length > size2 * 2)
throw new SizeExceedsPaddingSizeError({
size: Math.ceil(hex.length / 2),
targetSize: size2,
type: "hex"
});
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size2 * 2, "0")}`;
}
function padBytes(bytes, { dir, size: size2 = 32 } = {}) {
if (size2 === null)
return bytes;
if (bytes.length > size2)
throw new SizeExceedsPaddingSizeError({
size: bytes.length,
targetSize: size2,
type: "bytes"
});
const paddedBytes = new Uint8Array(size2);
for (let i = 0; i < size2; i++) {
const padEnd = dir === "right";
paddedBytes[padEnd ? i : size2 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
}
return paddedBytes;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toHex.js
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
function toHex(value, opts = {}) {
if (typeof value === "number" || typeof value === "bigint")
return numberToHex(value, opts);
if (typeof value === "string") {
return stringToHex(value, opts);
}
if (typeof value === "boolean")
return boolToHex(value, opts);
return bytesToHex(value, opts);
}
function boolToHex(value, opts = {}) {
const hex = `0x${Number(value)}`;
if (typeof opts.size === "number") {
assertSize(hex, { size: opts.size });
return pad(hex, { size: opts.size });
}
return hex;
}
function bytesToHex(value, opts = {}) {
let string = "";
for (let i = 0; i < value.length; i++) {
string += hexes[value[i]];
}
const hex = `0x${string}`;
if (typeof opts.size === "number") {
assertSize(hex, { size: opts.size });
return pad(hex, { dir: "right", size: opts.size });
}
return hex;
}
function numberToHex(value_, opts = {}) {
const { signed, size: size2 } = opts;
const value = BigInt(value_);
let maxValue;
if (size2) {
if (signed)
maxValue = (1n << BigInt(size2) * 8n - 1n) - 1n;
else
maxValue = 2n ** (BigInt(size2) * 8n) - 1n;
} else if (typeof value_ === "number") {
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
}
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
if (maxValue && value > maxValue || value < minValue) {
const suffix = typeof value_ === "bigint" ? "n" : "";
throw new IntegerOutOfRangeError({
max: maxValue ? `${maxValue}${suffix}` : void 0,
min: `${minValue}${suffix}`,
signed,
size: size2,
value: `${value_}${suffix}`
});
}
const hex = `0x${(signed && value < 0 ? (1n << BigInt(size2 * 8)) + BigInt(value) : value).toString(16)}`;
if (size2)
return pad(hex, { size: size2 });
return hex;
}
var encoder = /* @__PURE__ */ new TextEncoder();
function stringToHex(value_, opts = {}) {
const value = encoder.encode(value_);
return bytesToHex(value, opts);
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toBytes.js
var encoder2 = /* @__PURE__ */ new TextEncoder();
function toBytes(value, opts = {}) {
if (typeof value === "number" || typeof value === "bigint")
return numberToBytes(value, opts);
if (typeof value === "boolean")
return boolToBytes(value, opts);
if (isHex(value))
return hexToBytes(value, opts);
return stringToBytes(value, opts);
}
function boolToBytes(value, opts = {}) {
const bytes = new Uint8Array(1);
bytes[0] = Number(value);
if (typeof opts.size === "number") {
assertSize(bytes, { size: opts.size });
return pad(bytes, { size: opts.size });
}
return bytes;
}
var charCodeMap = {
zero: 48,
nine: 57,
A: 65,
F: 70,
a: 97,
f: 102
};
function charCodeToBase16(char) {
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
return char - charCodeMap.zero;
if (char >= charCodeMap.A && char <= charCodeMap.F)
return char - (charCodeMap.A - 10);
if (char >= charCodeMap.a && char <= charCodeMap.f)
return char - (charCodeMap.a - 10);
return void 0;
}
function hexToBytes(hex_, opts = {}) {
let hex = hex_;
if (opts.size) {
assertSize(hex, { size: opts.size });
hex = pad(hex, { dir: "right", size: opts.size });
}
let hexString = hex.slice(2);
if (hexString.length % 2)
hexString = `0${hexString}`;
const length = hexString.length / 2;
const bytes = new Uint8Array(length);
for (let index = 0, j = 0; index < length; index++) {
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
if (nibbleLeft === void 0 || nibbleRight === void 0) {
throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
}
bytes[index] = nibbleLeft * 16 + nibbleRight;
}
return bytes;
}
function numberToBytes(value, opts) {
const hex = numberToHex(value, opts);
return hexToBytes(hex);
}
function stringToBytes(value, opts = {}) {
const bytes = encoder2.encode(value);
if (typeof opts.size === "number") {
assertSize(bytes, { size: opts.size });
return pad(bytes, { dir: "right", size: opts.size });
}
return bytes;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/fromHex.js
function assertSize(hexOrBytes, { size: size2 }) {
if (size(hexOrBytes) > size2)
throw new SizeOverflowError({
givenSize: size(hexOrBytes),
maxSize: size2
});
}
function hexToBigInt(hex, opts = {}) {
const { signed } = opts;
if (opts.size)
assertSize(hex, { size: opts.size });
const value = BigInt(hex);
if (!signed)
return value;
const size2 = (hex.length - 2) / 2;
const max = (1n << BigInt(size2) * 8n - 1n) - 1n;
if (value <= max)
return value;
return value - BigInt(`0x${"f".padStart(size2 * 2, "f")}`) - 1n;
}
function hexToNumber(hex, opts = {}) {
return Number(hexToBigInt(hex, opts));
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/formatters/formatter.js
function defineFormatter(type, format) {
return ({ exclude, format: overrides }) => {
return {
exclude,
format: (args) => {
const formatted = format(args);
if (exclude) {
for (const key of exclude) {
delete formatted[key];
}
}
return {
...formatted,
...overrides(args)
};
},
type
};
};
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/formatters/transaction.js
var transactionType = {
"0x0": "legacy",
"0x1": "eip2930",
"0x2": "eip1559",
"0x3": "eip4844",
"0x4": "eip7702"
};
function formatTransaction(transaction) {
const transaction_ = {
...transaction,
blockHash: transaction.blockHash ? transaction.blockHash : null,
blockNumber: transaction.blockNumber ? BigInt(transaction.blockNumber) : null,
chainId: transaction.chainId ? hexToNumber(transaction.chainId) : void 0,
gas: transaction.gas ? BigInt(transaction.gas) : void 0,
gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : void 0,
maxFeePerBlobGas: transaction.maxFeePerBlobGas ? BigInt(transaction.maxFeePerBlobGas) : void 0,
maxFeePerGas: transaction.maxFeePerGas ? BigInt(transaction.maxFeePerGas) : void 0,
maxPriorityFeePerGas: transaction.maxPriorityFeePerGas ? BigInt(transaction.maxPriorityFeePerGas) : void 0,
nonce: transaction.nonce ? hexToNumber(transaction.nonce) : void 0,
to: transaction.to ? transaction.to : null,
transactionIndex: transaction.transactionIndex ? Number(transaction.transactionIndex) : null,
type: transaction.type ? transactionType[transaction.type] : void 0,
typeHex: transaction.type ? transaction.type : void 0,
value: transaction.value ? BigInt(transaction.value) : void 0,
v: transaction.v ? BigInt(transaction.v) : void 0
};
if (transaction.authorizationList)
transaction_.authorizationList = formatAuthorizationList(transaction.authorizationList);
transaction_.yParity = (() => {
if (transaction.yParity)
return Number(transaction.yParity);
if (typeof transaction_.v === "bigint") {
if (transaction_.v === 0n || transaction_.v === 27n)
return 0;
if (transaction_.v === 1n || transaction_.v === 28n)
return 1;
if (transaction_.v >= 35n)
return transaction_.v % 2n === 0n ? 1 : 0;
}
return void 0;
})();
if (transaction_.type === "legacy") {
delete transaction_.accessList;
delete transaction_.maxFeePerBlobGas;
delete transaction_.maxFeePerGas;
delete transaction_.maxPriorityFeePerGas;
delete transaction_.yParity;
}
if (transaction_.type === "eip2930") {
delete transaction_.maxFeePerBlobGas;
delete transaction_.maxFeePerGas;
delete transaction_.maxPriorityFeePerGas;
}
if (transaction_.type === "eip1559") {
delete transaction_.maxFeePerBlobGas;
}
return transaction_;
}
var defineTransaction = /* @__PURE__ */ defineFormatter("transaction", formatTransaction);
function formatAuthorizationList(authorizationList) {
return authorizationList.map((authorization) => ({
address: authorization.address,
chainId: Number(authorization.chainId),
nonce: Number(authorization.nonce),
r: authorization.r,
s: authorization.s,
yParity: Number(authorization.yParity)
}));
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/formatters/block.js
function formatBlock(block) {
const transactions = (block.transactions ?? []).map((transaction) => {
if (typeof transaction === "string")
return transaction;
return formatTransaction(transaction);
});
return {
...block,
baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,
blobGasUsed: block.blobGasUsed ? BigInt(block.blobGasUsed) : void 0,
difficulty: block.difficulty ? BigInt(block.difficulty) : void 0,
excessBlobGas: block.excessBlobGas ? BigInt(block.excessBlobGas) : void 0,
gasLimit: block.gasLimit ? BigInt(block.gasLimit) : void 0,
gasUsed: block.gasUsed ? BigInt(block.gasUsed) : void 0,
hash: block.hash ? block.hash : null,
logsBloom: block.logsBloom ? block.logsBloom : null,
nonce: block.nonce ? block.nonce : null,
number: block.number ? BigInt(block.number) : null,
size: block.size ? BigInt(block.size) : void 0,
timestamp: block.timestamp ? BigInt(block.timestamp) : void 0,
transactions,
totalDifficulty: block.totalDifficulty ? BigInt(block.totalDifficulty) : null
};
}
var defineBlock = /* @__PURE__ */ defineFormatter("block", formatBlock);
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/formatters/log.js
function formatLog(log, { args, eventName } = {}) {
return {
...log,
blockHash: log.blockHash ? log.blockHash : null,
blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,
logIndex: log.logIndex ? Number(log.logIndex) : null,
transactionHash: log.transactionHash ? log.transactionHash : null,
transactionIndex: log.transactionIndex ? Number(log.transactionIndex) : null,
...eventName ? { args, eventName } : {}
};
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/formatters/transactionReceipt.js
var receiptStatuses = {
"0x0": "reverted",
"0x1": "success"
};
function formatTransactionReceipt(transactionReceipt) {
const receipt = {
...transactionReceipt,
blockNumber: transactionReceipt.blockNumber ? BigInt(transactionReceipt.blockNumber) : null,
contractAddress: transactionReceipt.contractAddress ? transactionReceipt.contractAddress : null,
cumulativeGasUsed: transactionReceipt.cumulativeGasUsed ? BigInt(transactionReceipt.cumulativeGasUsed) : null,
effectiveGasPrice: transactionReceipt.effectiveGasPrice ? BigInt(transactionReceipt.effectiveGasPrice) : null,
gasUsed: transactionReceipt.gasUsed ? BigInt(transactionReceipt.gasUsed) : null,
logs: transactionReceipt.logs ? transactionReceipt.logs.map((log) => formatLog(log)) : null,
to: transactionReceipt.to ? transactionReceipt.to : null,
transactionIndex: transactionReceipt.transactionIndex ? hexToNumber(transactionReceipt.transactionIndex) : null,
status: transactionReceipt.status ? receiptStatuses[transactionReceipt.status] : null,
type: transactionReceipt.type ? transactionType[transactionReceipt.type] || transactionReceipt.type : null
};
if (transactionReceipt.blobGasPrice)
receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);
if (transactionReceipt.blobGasUsed)
receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);
return receipt;
}
var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/constants/number.js
var maxInt8 = 2n ** (8n - 1n) - 1n;
var maxInt16 = 2n ** (16n - 1n) - 1n;
var maxInt24 = 2n ** (24n - 1n) - 1n;
var maxInt32 = 2n ** (32n - 1n) - 1n;
var maxInt40 = 2n ** (40n - 1n) - 1n;
var maxInt48 = 2n ** (48n - 1n) - 1n;
var maxInt56 = 2n ** (56n - 1n) - 1n;
var maxInt64 = 2n ** (64n - 1n) - 1n;
var maxInt72 = 2n ** (72n - 1n) - 1n;
var maxInt80 = 2n ** (80n - 1n) - 1n;
var maxInt88 = 2n ** (88n - 1n) - 1n;
var maxInt96 = 2n ** (96n - 1n) - 1n;
var maxInt104 = 2n ** (104n - 1n) - 1n;
var maxInt112 = 2n ** (112n - 1n) - 1n;
var maxInt120 = 2n ** (120n - 1n) - 1n;
var maxInt128 = 2n ** (128n - 1n) - 1n;
var maxInt136 = 2n ** (136n - 1n) - 1n;
var maxInt144 = 2n ** (144n - 1n) - 1n;
var maxInt152 = 2n ** (152n - 1n) - 1n;
var maxInt160 = 2n ** (160n - 1n) - 1n;
var maxInt168 = 2n ** (168n - 1n) - 1n;
var maxInt176 = 2n ** (176n - 1n) - 1n;
var maxInt184 = 2n ** (184n - 1n) - 1n;
var maxInt192 = 2n ** (192n - 1n) - 1n;
var maxInt200 = 2n ** (200n - 1n) - 1n;
var maxInt208 = 2n ** (208n - 1n) - 1n;
var maxInt216 = 2n ** (216n - 1n) - 1n;
var maxInt224 = 2n ** (224n - 1n) - 1n;
var maxInt232 = 2n ** (232n - 1n) - 1n;
var maxInt240 = 2n ** (240n - 1n) - 1n;
var maxInt248 = 2n ** (248n - 1n) - 1n;
var maxInt256 = 2n ** (256n - 1n) - 1n;
var minInt8 = -(2n ** (8n - 1n));
var minInt16 = -(2n ** (16n - 1n));
var minInt24 = -(2n ** (24n - 1n));
var minInt32 = -(2n ** (32n - 1n));
var minInt40 = -(2n ** (40n - 1n));
var minInt48 = -(2n ** (48n - 1n));
var minInt56 = -(2n ** (56n - 1n));
var minInt64 = -(2n ** (64n - 1n));
var minInt72 = -(2n ** (72n - 1n));
var minInt80 = -(2n ** (80n - 1n));
var minInt88 = -(2n ** (88n - 1n));
var minInt96 = -(2n ** (96n - 1n));
var minInt104 = -(2n ** (104n - 1n));
var minInt112 = -(2n ** (112n - 1n));
var minInt120 = -(2n ** (120n - 1n));
var minInt128 = -(2n ** (128n - 1n));
var minInt136 = -(2n ** (136n - 1n));
var minInt144 = -(2n ** (144n - 1n));
var minInt152 = -(2n ** (152n - 1n));
var minInt160 = -(2n ** (160n - 1n));
var minInt168 = -(2n ** (168n - 1n));
var minInt176 = -(2n ** (176n - 1n));
var minInt184 = -(2n ** (184n - 1n));
var minInt192 = -(2n ** (192n - 1n));
var minInt200 = -(2n ** (200n - 1n));
var minInt208 = -(2n ** (208n - 1n));
var minInt216 = -(2n ** (216n - 1n));
var minInt224 = -(2n ** (224n - 1n));
var minInt232 = -(2n ** (232n - 1n));
var minInt240 = -(2n ** (240n - 1n));
var minInt248 = -(2n ** (248n - 1n));
var minInt256 = -(2n ** (256n - 1n));
var maxUint8 = 2n ** 8n - 1n;
var maxUint16 = 2n ** 16n - 1n;
var maxUint24 = 2n ** 24n - 1n;
var maxUint32 = 2n ** 32n - 1n;
var maxUint40 = 2n ** 40n - 1n;
var maxUint48 = 2n ** 48n - 1n;
var maxUint56 = 2n ** 56n - 1n;
var maxUint64 = 2n ** 64n - 1n;
var maxUint72 = 2n ** 72n - 1n;
var maxUint80 = 2n ** 80n - 1n;
var maxUint88 = 2n ** 88n - 1n;
var maxUint96 = 2n ** 96n - 1n;
var maxUint104 = 2n ** 104n - 1n;
var maxUint112 = 2n ** 112n - 1n;
var maxUint120 = 2n ** 120n - 1n;
var maxUint128 = 2n ** 128n - 1n;
var maxUint136 = 2n ** 136n - 1n;
var maxUint144 = 2n ** 144n - 1n;
var maxUint152 = 2n ** 152n - 1n;
var maxUint160 = 2n ** 160n - 1n;
var maxUint168 = 2n ** 168n - 1n;
var maxUint176 = 2n ** 176n - 1n;
var maxUint184 = 2n ** 184n - 1n;
var maxUint192 = 2n ** 192n - 1n;
var maxUint200 = 2n ** 200n - 1n;
var maxUint208 = 2n ** 208n - 1n;
var maxUint216 = 2n ** 216n - 1n;
var maxUint224 = 2n ** 224n - 1n;
var maxUint232 = 2n ** 232n - 1n;
var maxUint240 = 2n ** 240n - 1n;
var maxUint248 = 2n ** 248n - 1n;
var maxUint256 = 2n ** 256n - 1n;
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/concat.js
function concatHex(values) {
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/cursor.js
var NegativeOffsetError = class extends BaseError {
constructor({ offset }) {
super(`Offset \`${offset}\` cannot be negative.`, {
name: "NegativeOffsetError"
});
}
};
var PositionOutOfBoundsError = class extends BaseError {
constructor({ length, position }) {
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length}\`).`, { name: "PositionOutOfBoundsError" });
}
};
var RecursiveReadLimitExceededError = class extends BaseError {
constructor({ count, limit }) {
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count}\`).`, { name: "RecursiveReadLimitExceededError" });
}
};
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/cursor.js
var staticCursor = {
bytes: new Uint8Array(),
dataView: new DataView(new ArrayBuffer(0)),
position: 0,
positionReadCount: /* @__PURE__ */ new Map(),
recursiveReadCount: 0,
recursiveReadLimit: Number.POSITIVE_INFINITY,
assertReadLimit() {
if (this.recursiveReadCount >= this.recursiveReadLimit)
throw new RecursiveReadLimitExceededError({
count: this.recursiveReadCount + 1,
limit: this.recursiveReadLimit
});
},
assertPosition(position) {
if (position < 0 || position > this.bytes.length - 1)
throw new PositionOutOfBoundsError({
length: this.bytes.length,
position
});
},
decrementPosition(offset) {
if (offset < 0)
throw new NegativeOffsetError({ offset });
const position = this.position - offset;
this.assertPosition(position);
this.position = position;
},
getReadCount(position) {
return this.positionReadCount.get(position || this.position) || 0;
},
incrementPosition(offset) {
if (offset < 0)
throw new NegativeOffsetError({ offset });
const position = this.position + offset;
this.assertPosition(position);
this.position = position;
},
inspectByte(position_) {
const position = position_ ?? this.position;
this.assertPosition(position);
return this.bytes[position];
},
inspectBytes(length, position_) {
const position = position_ ?? this.position;
this.assertPosition(position + length - 1);
return this.bytes.subarray(position, position + length);
},
inspectUint8(position_) {
const position = position_ ?? this.position;
this.assertPosition(position);
return this.bytes[position];
},
inspectUint16(position_) {
const position = position_ ?? this.position;
this.assertPosition(position + 1);
return this.dataView.getUint16(position);
},
inspectUint24(position_) {
const position = position_ ?? this.position;
this.assertPosition(position + 2);
return (this.dataView.getUint16(position) << 8) + this.dataView.getUint8(position + 2);
},
inspectUint32(position_) {
const position = position_ ?? this.position;
this.assertPosition(position + 3);
return this.dataView.getUint32(position);
},
pushByte(byte) {
this.assertPosition(this.position);
this.bytes[this.position] = byte;
this.position++;
},
pushBytes(bytes) {
this.assertPosition(this.position + bytes.length - 1);
this.bytes.set(bytes, this.position);
this.position += bytes.length;
},
pushUint8(value) {
this.assertPosition(this.position);
this.bytes[this.position] = value;
this.position++;
},
pushUint16(value) {
this.assertPosition(this.position + 1);
this.dataView.setUint16(this.position, value);
this.position += 2;
},
pushUint24(value) {
this.assertPosition(this.position + 2);
this.dataView.setUint16(this.position, value >> 8);
this.dataView.setUint8(this.position + 2, value & ~4294967040);
this.position += 3;
},
pushUint32(value) {
this.assertPosition(this.position + 3);
this.dataView.setUint32(this.position, value);
this.position += 4;
},
readByte() {
this.assertReadLimit();
this._touch();
const value = this.inspectByte();
this.position++;
return value;
},
readBytes(length, size2) {
this.assertReadLimit();
this._touch();
const value = this.inspectBytes(length);
this.position += size2 ?? length;
return value;
},
readUint8() {
this.assertReadLimit();
this._touch();
const value = this.inspectUint8();
this.position += 1;
return value;
},
readUint16() {
this.assertReadLimit();
this._touch();
const value = this.inspectUint16();
this.position += 2;
return value;
},
readUint24() {
this.assertReadLimit();
this._touch();
const value = this.inspectUint24();
this.position += 3;
return value;
},
readUint32() {
this.assertReadLimit();
this._touch();
const value = this.inspectUint32();
this.position += 4;
return value;
},
get remaining() {
return this.bytes.length - this.position;
},
setPosition(position) {
const oldPosition = this.position;
this.assertPosition(position);
this.position = position;
return () => this.position = oldPosition;
},
_touch() {
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
return;
const count = this.getReadCount();
this.positionReadCount.set(this.position, count + 1);
if (count > 0)
this.recursiveReadCount++;
}
};
function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
const cursor = Object.create(staticCursor);
cursor.bytes = bytes;
cursor.dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
cursor.positionReadCount = /* @__PURE__ */ new Map();
cursor.recursiveReadLimit = recursiveReadLimit;
return cursor;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toRlp.js
function toRlp(bytes, to = "hex") {
const encodable = getEncodable(bytes);
const cursor = createCursor(new Uint8Array(encodable.length));
encodable.encode(cursor);
if (to === "hex")
return bytesToHex(cursor.bytes);
return cursor.bytes;
}
function getEncodable(bytes) {
if (Array.isArray(bytes))
return getEncodableList(bytes.map((x) => getEncodable(x)));
return getEncodableBytes(bytes);
}
function getEncodableList(list) {
const bodyLength = list.reduce((acc, x) => acc + x.length, 0);
const sizeOfBodyLength = getSizeOfLength(bodyLength);
const length = (() => {
if (bodyLength <= 55)
return 1 + bodyLength;
return 1 + sizeOfBodyLength + bodyLength;
})();
return {
length,
encode(cursor) {
if (bodyLength <= 55) {
cursor.pushByte(192 + bodyLength);
} else {
cursor.pushByte(192 + 55 + sizeOfBodyLength);
if (sizeOfBodyLength === 1)
cursor.pushUint8(bodyLength);
else if (sizeOfBodyLength === 2)
cursor.pushUint16(bodyLength);
else if (sizeOfBodyLength === 3)
cursor.pushUint24(bodyLength);
else
cursor.pushUint32(bodyLength);
}
for (const { encode } of list) {
encode(cursor);
}
}
};
}
function getEncodableBytes(bytesOrHex) {
const bytes = typeof bytesOrHex === "string" ? hexToBytes(bytesOrHex) : bytesOrHex;
const sizeOfBytesLength = getSizeOfLength(bytes.length);
const length = (() => {
if (bytes.length === 1 && bytes[0] < 128)
return 1;
if (bytes.length <= 55)
return 1 + bytes.length;
return 1 + sizeOfBytesLength + bytes.length;
})();
return {
length,
encode(cursor) {
if (bytes.length === 1 && bytes[0] < 128) {
cursor.pushBytes(bytes);
} else if (bytes.length <= 55) {
cursor.pushByte(128 + bytes.length);
cursor.pushBytes(bytes);
} else {
cursor.pushByte(128 + 55 + sizeOfBytesLength);
if (sizeOfBytesLength === 1)
cursor.pushUint8(bytes.length);
else if (sizeOfBytesLength === 2)
cursor.pushUint16(bytes.length);
else if (sizeOfBytesLength === 3)
cursor.pushUint24(bytes.length);
else
cursor.pushUint32(bytes.length);
cursor.pushBytes(bytes);
}
}
};
}
function getSizeOfLength(length) {
if (length < 2 ** 8)
return 1;
if (length < 2 ** 16)
return 2;
if (length < 2 ** 24)
return 3;
if (length < 2 ** 32)
return 4;
throw new BaseError("Length is too large.");
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/constants/unit.js
var gweiUnits = {
ether: -9,
wei: 9
};
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/unit/formatUnits.js
function formatUnits(value, decimals) {
let display = value.toString();
const negative = display.startsWith("-");
if (negative)
display = display.slice(1);
display = display.padStart(decimals, "0");
let [integer, fraction] = [
display.slice(0, display.length - decimals),
display.slice(display.length - decimals)
];
fraction = fraction.replace(/(0+)$/, "");
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/unit/formatGwei.js
function formatGwei(wei, unit = "wei") {
return formatUnits(wei, gweiUnits[unit]);
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/transaction.js
function prettyPrint(args) {
const entries = Object.entries(args).map(([key, value]) => {
if (value === void 0 || value === false)
return null;
return [key, value];
}).filter(Boolean);
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
}
var InvalidLegacyVError = class extends BaseError {
constructor({ v }) {
super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
name: "InvalidLegacyVError"
});
}
};
var InvalidSerializableTransactionError = class extends BaseError {
constructor({ transaction }) {
super("Cannot infer a transaction type from provided transaction.", {
metaMessages: [
"Provided Transaction:",
"{",
prettyPrint(transaction),
"}",
"",
"To infer the type, either provide:",
"- a `type` to the Transaction, or",
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
"- an EIP-7702 Transaction with `authorizationList`, or",
"- a Legacy Transaction with `gasPrice`"
],
name: "InvalidSerializableTransactionError"
});
}
};
var InvalidStorageKeySizeError = class extends BaseError {
constructor({ storageKey }) {
super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
}
};
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
function serializeAuthorizationList(authorizationList) {
if (!authorizationList || authorizationList.length === 0)
return [];
const serializedAuthorizationList = [];
for (const authorization of authorizationList) {
const { chainId, nonce, ...signature } = authorization;
const contractAddress = authorization.address;
serializedAuthorizationList.push([
chainId ? toHex(chainId) : "0x",
contractAddress,
nonce ? toHex(nonce) : "0x",
...toYParitySignatureArray({}, signature)
]);
}
return serializedAuthorizationList;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/blob/blobsToCommitments.js
function blobsToCommitments(parameters) {
const { kzg } = parameters;
const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
const blobs = typeof parameters.blobs[0] === "string" ? parameters.blobs.map((x) => hexToBytes(x)) : parameters.blobs;
const commitments = [];
for (const blob of blobs)
commitments.push(Uint8Array.from(kzg.blobToKzgCommitment(blob)));
return to === "bytes" ? commitments : commitments.map((x) => bytesToHex(x));
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/blob/blobsToProofs.js
function blobsToProofs(parameters) {
const { kzg } = parameters;
const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
const blobs = typeof parameters.blobs[0] === "string" ? parameters.blobs.map((x) => hexToBytes(x)) : parameters.blobs;
const commitments = typeof parameters.commitments[0] === "string" ? parameters.commitments.map((x) => hexToBytes(x)) : parameters.commitments;
const proofs = [];
for (let i = 0; i < blobs.length; i++) {
const blob = blobs[i];
const commitment = commitments[i];
proofs.push(Uint8Array.from(kzg.computeBlobKzgProof(blob, commitment)));
}
return to === "bytes" ? proofs : proofs.map((x) => bytesToHex(x));
}
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
function isBytes(a) {
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
}
function anumber(n) {
if (!Number.isSafeInteger(n) || n < 0)
throw new Error("positive integer expected, got " + n);
}
function abytes(b, ...lengths) {
if (!isBytes(b))
throw new Error("Uint8Array expected");
if (lengths.length > 0 && !lengths.includes(b.length))
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
}
function aexists(instance, checkFinished = true) {
if (instance.destroyed)
throw new Error("Hash instance has been destroyed");
if (checkFinished && instance.finished)
throw new Error("Hash#digest() has already been called");
}
function aoutput(out, instance) {
abytes(out);
const min = instance.outputLen;
if (out.length < min) {
throw new Error("digestInto() expects output buffer of length at least " + min);
}
}
function u32(arr) {
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
}
function clean(...arrays) {
for (let i = 0; i < arrays.length; i++) {
arrays[i].fill(0);
}
}
function createView(arr) {
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
}
function rotr(word, shift) {
return word << 32 - shift | word >>> shift;
}
var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
function byteSwap(word) {
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
}
function byteSwap32(arr) {
for (let i = 0; i < arr.length; i++) {
arr[i] = byteSwap(arr[i]);
}
return arr;
}
var swap32IfBE = isLE ? (u) => u : byteSwap32;
function utf8ToBytes(str) {
if (typeof str !== "string")
throw new Error("string expected");
return new Uint8Array(new TextEncoder().encode(str));
}
function toBytes2(data) {
if (typeof data === "string")
data = utf8ToBytes(data);
abytes(data);
return data;
}
var Hash = class {
};
function createHasher(hashCons) {
const hashC = (msg) => hashCons().update(toBytes2(msg)).digest();
const tmp = hashCons();
hashC.outputLen = tmp.outputLen;
hashC.blockLen = tmp.blockLen;
hashC.create = () => hashCons();
return hashC;
}
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
function setBigUint64(view, byteOffset, value, isLE2) {
if (typeof view.setBigUint64 === "function")
return view.setBigUint64(byteOffset, value, isLE2);
const _32n2 = BigInt(32);
const _u32_max = BigInt(4294967295);
const wh = Number(value >> _32n2 & _u32_max);
const wl = Number(value & _u32_max);
const h = isLE2 ? 4 : 0;
const l = isLE2 ? 0 : 4;
view.setUint32(byteOffset + h, wh, isLE2);
view.setUint32(byteOffset + l, wl, isLE2);
}
function Chi(a, b, c) {
return a & b ^ ~a & c;
}
function Maj(a, b, c) {
return a & b ^ a & c ^ b & c;
}
var HashMD = class extends Hash {
constructor(blockLen, outputLen, padOffset, isLE2) {
super();
this.finished = false;
this.length = 0;
this.pos = 0;
this.destroyed = false;
this.blockLen = blockLen;
this.outputLen = outputLen;
this.padOffset = padOffset;
this.isLE = isLE2;
this.buffer = new Uint8Array(blockLen);
this.view = createView(this.buffer);
}
update(data) {
aexists(this);
data = toBytes2(data);
abytes(data);
const { view, buffer, blockLen } = this;
const len = data.length;
for (let pos = 0; pos < len; ) {
const take = Math.min(blockLen - this.pos, len - pos);
if (take === blockLen) {
const dataView = createView(data);
for (; blockLen <= len - pos; pos += blockLen)
this.process(dataView, pos);
continue;
}
buffer.set(data.subarray(pos, pos + take), this.pos);
this.pos += take;
pos += take;
if (this.pos === blockLen) {
this.process(view, 0);
this.pos = 0;
}
}
this.length += data.length;
this.roundClean();
return this;
}
digestInto(out) {
aexists(this);
aoutput(out, this);
this.finished = true;
const { buffer, view, blockLen, isLE: isLE2 } = this;
let { pos } = this;
buffer[pos++] = 128;
clean(this.buffer.subarray(pos));
if (this.padOffset > blockLen - pos) {
this.process(view, 0);
pos = 0;
}
for (let i = pos; i < blockLen; i++)
buffer[i] = 0;
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2);
this.process(view, 0);
const oview = createView(out);
const len = this.outputLen;
if (len % 4)
throw new Error("_sha2: outputLen should be aligned to 32bit");
const outLen = len / 4;
const state = this.get();
if (outLen > state.length)
throw new Error("_sha2: outputLen bigger than state");
for (let i = 0; i < outLen; i++)
oview.setUint32(4 * i, state[i], isLE2);
}
digest() {
const { buffer, outputLen } = this;
this.digestInto(buffer);
const res = buffer.slice(0, outputLen);
this.destroy();
return res;
}
_cloneInto(to) {
to || (to = new this.constructor());
to.set(...this.get());
const { blockLen, buffer, length, finished, destroyed, pos } = this;
to.destroyed = destroyed;
to.finished = finished;
to.length = length;
to.pos = pos;
if (length % blockLen)
to.buffer.set(buffer);
return to;
}
clone() {
return this._cloneInto();
}
};
var SHA256_IV = /* @__PURE__ */ Uint32Array.from([
1779033703,
3144134277,
1013904242,
2773480762,
1359893119,
2600822924,
528734635,
1541459225
]);
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
var _32n = /* @__PURE__ */ BigInt(32);
function fromBig(n, le = false) {
if (le)
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
}
function split(lst, le = false) {
const len = lst.length;
let Ah = new Uint32Array(len);
let Al = new Uint32Array(len);
for (let i = 0; i < len; i++) {
const { h, l } = fromBig(lst[i], le);
[Ah[i], Al[i]] = [h, l];
}
return [Ah, Al];
}
var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
var SHA256_K = /* @__PURE__ */ Uint32Array.from([
1116352408,
1899447441,
3049323471,
3921009573,
961987163,
1508970993,
2453635748,
2870763221,
3624381080,
310598401,
607225278,
1426881987,
1925078388,
2162078206,
2614888103,
3248222580,
3835390401,
4022224774,
264347078,
604807628,
770255983,
1249150122,
1555081692,
1996064986,
2554220882,
2821834349,
2952996808,
3210313671,
3336571891,
3584528711,
113926993,
338241895,
666307205,
773529912,
1294757372,
1396182291,
1695183700,
1986661051,
2177026350,
2456956037,
2730485921,
2820302411,
3259730800,
3345764771,
3516065817,
3600352804,
4094571909,
275423344,
430227734,
506948616,
659060556,
883997877,
958139571,
1322822218,
1537002063,
1747873779,
1955562222,
2024104815,
2227730452,
2361852424,
2428436474,
2756734187,
3204031479,
3329325298
]);
var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
var SHA256 = class extends HashMD {
constructor(outputLen = 32) {
super(64, outputLen, 8, false);
this.A = SHA256_IV[0] | 0;
this.B = SHA256_IV[1] | 0;
this.C = SHA256_IV[2] | 0;
this.D = SHA256_IV[3] | 0;
this.E = SHA256_IV[4] | 0;
this.F = SHA256_IV[5] | 0;
this.G = SHA256_IV[6] | 0;
this.H = SHA256_IV[7] | 0;
}
get() {
const { A, B, C, D, E, F, G, H } = this;
return [A, B, C, D, E, F, G, H];
}
// prettier-ignore
set(A, B, C, D, E, F, G, H) {
this.A = A | 0;
this.B = B | 0;
this.C = C | 0;
this.D = D | 0;
this.E = E | 0;
this.F = F | 0;
this.G = G | 0;
this.H = H | 0;
}
process(view, offset) {
for (let i = 0; i < 16; i++, offset += 4)
SHA256_W[i] = view.getUint32(offset, false);
for (let i = 16; i < 64; i++) {
const W15 = SHA256_W[i - 15];
const W2 = SHA256_W[i - 2];
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
}
let { A, B, C, D, E, F, G, H } = this;
for (let i = 0; i < 64; i++) {
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
const T2 = sigma0 + Maj(A, B, C) | 0;
H = G;
G = F;
F = E;
E = D + T1 | 0;
D = C;
C = B;
B = A;
A = T1 + T2 | 0;
}
A = A + this.A | 0;
B = B + this.B | 0;
C = C + this.C | 0;
D = D + this.D | 0;
E = E + this.E | 0;
F = F + this.F | 0;
G = G + this.G | 0;
H = H + this.H | 0;
this.set(A, B, C, D, E, F, G, H);
}
roundClean() {
clean(SHA256_W);
}
destroy() {
this.set(0, 0, 0, 0, 0, 0, 0, 0);
clean(this.buffer);
}
};
var sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js
var sha2562 = sha256;
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/hash/sha256.js
function sha2563(value, to_) {
const to = to_ || "hex";
const bytes = sha2562(isHex(value, { strict: false }) ? toBytes(value) : value);
if (to === "bytes")
return bytes;
return toHex(bytes);
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
function commitmentToVersionedHash(parameters) {
const { commitment, version: version2 = 1 } = parameters;
const to = parameters.to ?? (typeof commitment === "string" ? "hex" : "bytes");
const versionedHash = sha2563(commitment, "bytes");
versionedHash.set([version2], 0);
return to === "bytes" ? versionedHash : bytesToHex(versionedHash);
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js
function commitmentsToVersionedHashes(parameters) {
const { commitments, version: version2 } = parameters;
const to = parameters.to ?? (typeof commitments[0] === "string" ? "hex" : "bytes");
const hashes = [];
for (const commitment of commitments) {
hashes.push(commitmentToVersionedHash({
commitment,
to,
version: version2
}));
}
return hashes;
}
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/constants/blob.js
var blobsPerTransaction = 6;
var bytesPerFieldElement = 32;
var fieldElementsPerBlob = 4096;
var bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;
var maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction - // terminator byte (0x80).
1 - // zero byte (0x00) appended to each field element.
1 * fieldElementsPerBlob * blobsPerTransaction;
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/constants/kzg.js
var versionedHashVersionKzg = 1;
// ../../node_modules/.pnpm/viem@2.33.2_bufferutil@4.0.9_typescript@5.9.2_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/blob.js
var BlobSizeTooLargeError = class extends BaseError {
constructor({ maxSize, size: size2 }) {
super("Blob size is too large.", {
metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size2} bytes`],
name: "BlobSizeTooLargeError"
});
}
};
var EmptyBlobError = class extends BaseError {
constructor() {
super("Blob data must not be empty.", { name: "EmptyBlobError" });
}
};
var InvalidVersionedHashSizeError = class extends BaseError {
constructor({ hash, size: size2 }) {
super(`Versioned hash "${hash}" size is invalid.`, {
metaMessages: ["Expected: 32", `Received: ${size2}`],