From 42b121ac9a889ab73ba0427b59c40c6aa6329355 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 11 Nov 2024 09:49:52 +0100 Subject: [PATCH] fix: arbitrum env --- dist/action.js | 765 +++++++++++++++++++++++------------------------ dist/action.mjs | 765 +++++++++++++++++++++++------------------------ dist/lib.d.mts | 4 +- dist/lib.d.ts | 4 +- dist/lib.js | 765 +++++++++++++++++++++++------------------------ dist/lib.mjs | 767 +++++++++++++++++++++++------------------------- src/chainIds.ts | 2 +- src/lib.test.ts | 2 +- 8 files changed, 1474 insertions(+), 1600 deletions(-) diff --git a/dist/action.js b/dist/action.js index f672e61..dcb25c3 100644 --- a/dist/action.js +++ b/dist/action.js @@ -9,9 +9,6 @@ var __typeError = (msg) => { throw TypeError(msg); }; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; @@ -19857,360 +19854,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } }); -// node_modules/@noble/hashes/esm/_assert.js -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`positive integer expected, not ${n}`); -} -function isBytes(a) { - return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; -} -function bytes(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}, not of length=${b.length}`); -} -function exists(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 output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -var init_assert = __esm({ - "node_modules/@noble/hashes/esm/_assert.js"() { - "use strict"; - } -}); - -// node_modules/@noble/hashes/esm/utils.js -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } -} -function utf8ToBytes(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); -} -function toBytes2(data) { - if (typeof data === "string") - data = utf8ToBytes(data); - bytes(data); - return data; -} -function wrapConstructor(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; -} -function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -var u32, createView, rotr, isLE, byteSwap, Hash, toStr; -var init_utils = __esm({ - "node_modules/@noble/hashes/esm/utils.js"() { - "use strict"; - init_assert(); - u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - rotr = (word, shift) => word << 32 - shift | word >>> shift; - isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; - byteSwap = (word) => word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255; - Hash = class { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } - }; - toStr = {}.toString; - } -}); - -// 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); -} -var Chi, Maj, HashMD; -var init_md = __esm({ - "node_modules/@noble/hashes/esm/_md.js"() { - "use strict"; - init_assert(); - init_utils(); - Chi = (a, b, c) => a & b ^ ~a & c; - Maj = (a, b, c) => a & b ^ a & c ^ b & c; - HashMD = class extends Hash { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes2(data); - 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) { - exists(this); - output(out, this); - this.finished = true; - const { buffer, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer[pos++] = 128; - this.buffer.subarray(pos).fill(0); - 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.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - }; - } -}); - -// node_modules/@noble/hashes/esm/sha256.js -var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256; -var init_sha256 = __esm({ - "node_modules/@noble/hashes/esm/sha256.js"() { - "use strict"; - init_md(); - init_utils(); - SHA256_K = /* @__PURE__ */ new Uint32Array([ - 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 - ]); - SHA256_IV = /* @__PURE__ */ new Uint32Array([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]); - SHA256_W = /* @__PURE__ */ new Uint32Array(64); - SHA256 = class extends HashMD { - constructor() { - super(64, 32, 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() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } - }; - sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - } -}); - // src/action.ts var import_core = __toESM(require_core()); @@ -20289,12 +19932,12 @@ function defineChain(chain) { } // node_modules/viem/_esm/errors/version.js -var version = "2.21.28"; +var version = "2.21.40"; // node_modules/viem/_esm/errors/base.js var errorConfig = { getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0, - version + version: `viem@${version}` }; var BaseError = class _BaseError extends Error { constructor(shortMessage, args = {}) { @@ -20370,7 +20013,7 @@ var BaseError = class _BaseError extends Error { function walk(err, fn) { if (fn?.(err)) return err; - if (err && typeof err === "object" && "cause" in err) + if (err && typeof err === "object" && "cause" in err && err.cause !== void 0) return walk(err.cause, fn); return fn ? null : err; } @@ -21429,8 +21072,333 @@ function blobsToProofs(parameters) { return to === "bytes" ? proofs : proofs.map((x) => bytesToHex(x)); } +// node_modules/@noble/hashes/esm/_assert.js +function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`positive integer expected, not ${n}`); +} +function isBytes(a) { + return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; +} +function bytes(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}, not of length=${b.length}`); +} +function exists(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 output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } +} + +// node_modules/@noble/hashes/esm/utils.js +var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +var rotr = (word, shift) => word << 32 - shift | word >>> shift; +var isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; +var byteSwap = (word) => 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]); + } +} +function utf8ToBytes(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function toBytes2(data) { + if (typeof data === "string") + data = utf8ToBytes(data); + bytes(data); + return data; +} +var Hash = class { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } +}; +var toStr = {}.toString; +function wrapConstructor(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; +} +function wrapXOFConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} + +// 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); +} +var Chi = (a, b, c) => a & b ^ ~a & c; +var Maj = (a, b, c) => a & b ^ a & c ^ b & c; +var HashMD = class extends Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + exists(this); + const { view, buffer, blockLen } = this; + data = toBytes2(data); + 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) { + exists(this); + output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + 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.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } +}; + +// node_modules/@noble/hashes/esm/sha256.js +var SHA256_K = /* @__PURE__ */ new Uint32Array([ + 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_IV = /* @__PURE__ */ new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 +]); +var SHA256_W = /* @__PURE__ */ new Uint32Array(64); +var SHA256 = class extends HashMD { + constructor() { + super(64, 32, 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() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } +}; +var sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); + // node_modules/viem/_esm/utils/hash/sha256.js -init_sha256(); function sha2562(value, to_) { const to = to_ || "hex"; const bytes2 = sha256(isHex(value, { strict: false }) ? toBytes(value) : value); @@ -21568,7 +21536,7 @@ function serializeAuthorizationList(authorizationList) { for (const authorization of authorizationList) { const { contractAddress, chainId, nonce, ...signature } = authorization; serializedAuthorizationList.push([ - toHex(chainId), + chainId ? toHex(chainId) : "0x", contractAddress, nonce ? toHex(nonce) : "0x", ...toYParitySignatureArray({}, signature) @@ -21799,9 +21767,6 @@ var LruMap = class extends Map { } }; -// node_modules/@noble/hashes/esm/sha3.js -init_assert(); - // node_modules/@noble/hashes/esm/_u64.js var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); var _32n = /* @__PURE__ */ BigInt(32); @@ -21825,7 +21790,6 @@ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; // node_modules/@noble/hashes/esm/sha3.js -init_utils(); var SHA3_PI = []; var SHA3_ROTL = []; var _SHA3_IOTA = []; @@ -22112,7 +22076,7 @@ function assertTransactionEIP7702(transaction) { const { contractAddress, chainId } = authorization; if (!isAddress(contractAddress)) throw new InvalidAddressError({ address: contractAddress }); - if (chainId <= 0) + if (chainId < 0) throw new InvalidChainIdError({ chainId }); } } @@ -22863,6 +22827,11 @@ var base = /* @__PURE__ */ defineChain({ }, contracts: { ...chainConfig2.contracts, + disputeGameFactory: { + [sourceId]: { + address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e" + } + }, l2OutputOracle: { [sourceId]: { address: "0x56315b90c40730925ec5485cf004d835058518A0" @@ -23224,6 +23193,36 @@ var fantomTestnet = /* @__PURE__ */ defineChain({ testnet: true }); +// node_modules/viem/_esm/chains/definitions/gnosis.js +var gnosis = /* @__PURE__ */ defineChain({ + id: 100, + name: "Gnosis", + nativeCurrency: { + decimals: 18, + name: "Gnosis", + symbol: "xDAI" + }, + rpcUrls: { + default: { + http: ["https://rpc.gnosischain.com"], + webSocket: ["wss://rpc.gnosischain.com/wss"] + } + }, + blockExplorers: { + default: { + name: "Gnosisscan", + url: "https://gnosisscan.io", + apiUrl: "https://api.gnosisscan.io/api" + } + }, + contracts: { + multicall3: { + address: "0xca11bde05977b3631167028862be2a173976ca11", + blockCreated: 21022491 + } + } +}); + // node_modules/viem/_esm/chains/definitions/goerli.js var goerli = /* @__PURE__ */ defineChain({ id: 5, @@ -23257,36 +23256,6 @@ var goerli = /* @__PURE__ */ defineChain({ testnet: true }); -// node_modules/viem/_esm/chains/definitions/gnosis.js -var gnosis = /* @__PURE__ */ defineChain({ - id: 100, - name: "Gnosis", - nativeCurrency: { - decimals: 18, - name: "Gnosis", - symbol: "xDAI" - }, - rpcUrls: { - default: { - http: ["https://rpc.gnosischain.com"], - webSocket: ["wss://rpc.gnosischain.com/wss"] - } - }, - blockExplorers: { - default: { - name: "Gnosisscan", - url: "https://gnosisscan.io", - apiUrl: "https://api.gnosisscan.io/api" - } - }, - contracts: { - multicall3: { - address: "0xca11bde05977b3631167028862be2a173976ca11", - blockCreated: 21022491 - } - } -}); - // node_modules/viem/_esm/chains/definitions/harmonyOne.js var harmonyOne = /* @__PURE__ */ defineChain({ id: 16666e5, @@ -23724,7 +23693,7 @@ var ChainId = { mumbai: polygonMumbai.id, avalanche: avalanche.id, fuji: avalancheFuji.id, - arbitrum_one: arbitrum.id, + arbitrum: arbitrum.id, arbitrum_goerli: arbitrumGoerli.id, arbitrum_sepolia: arbitrumSepolia.id, fantom: fantom.id, diff --git a/dist/action.mjs b/dist/action.mjs index 5e2f316..fbc7a9a 100644 --- a/dist/action.mjs +++ b/dist/action.mjs @@ -14,9 +14,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; @@ -19862,360 +19859,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } }); -// node_modules/@noble/hashes/esm/_assert.js -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`positive integer expected, not ${n}`); -} -function isBytes(a) { - return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; -} -function bytes(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}, not of length=${b.length}`); -} -function exists(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 output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -var init_assert = __esm({ - "node_modules/@noble/hashes/esm/_assert.js"() { - "use strict"; - } -}); - -// node_modules/@noble/hashes/esm/utils.js -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } -} -function utf8ToBytes(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); -} -function toBytes2(data) { - if (typeof data === "string") - data = utf8ToBytes(data); - bytes(data); - return data; -} -function wrapConstructor(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; -} -function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -var u32, createView, rotr, isLE, byteSwap, Hash, toStr; -var init_utils = __esm({ - "node_modules/@noble/hashes/esm/utils.js"() { - "use strict"; - init_assert(); - u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - rotr = (word, shift) => word << 32 - shift | word >>> shift; - isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; - byteSwap = (word) => word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255; - Hash = class { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } - }; - toStr = {}.toString; - } -}); - -// 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); -} -var Chi, Maj, HashMD; -var init_md = __esm({ - "node_modules/@noble/hashes/esm/_md.js"() { - "use strict"; - init_assert(); - init_utils(); - Chi = (a, b, c) => a & b ^ ~a & c; - Maj = (a, b, c) => a & b ^ a & c ^ b & c; - HashMD = class extends Hash { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes2(data); - 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) { - exists(this); - output(out, this); - this.finished = true; - const { buffer, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer[pos++] = 128; - this.buffer.subarray(pos).fill(0); - 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.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - }; - } -}); - -// node_modules/@noble/hashes/esm/sha256.js -var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256; -var init_sha256 = __esm({ - "node_modules/@noble/hashes/esm/sha256.js"() { - "use strict"; - init_md(); - init_utils(); - SHA256_K = /* @__PURE__ */ new Uint32Array([ - 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 - ]); - SHA256_IV = /* @__PURE__ */ new Uint32Array([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]); - SHA256_W = /* @__PURE__ */ new Uint32Array(64); - SHA256 = class extends HashMD { - constructor() { - super(64, 32, 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() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } - }; - sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - } -}); - // src/action.ts var import_core = __toESM(require_core()); @@ -20294,12 +19937,12 @@ function defineChain(chain) { } // node_modules/viem/_esm/errors/version.js -var version = "2.21.28"; +var version = "2.21.40"; // node_modules/viem/_esm/errors/base.js var errorConfig = { getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0, - version + version: `viem@${version}` }; var BaseError = class _BaseError extends Error { constructor(shortMessage, args = {}) { @@ -20375,7 +20018,7 @@ var BaseError = class _BaseError extends Error { function walk(err, fn) { if (fn?.(err)) return err; - if (err && typeof err === "object" && "cause" in err) + if (err && typeof err === "object" && "cause" in err && err.cause !== void 0) return walk(err.cause, fn); return fn ? null : err; } @@ -21434,8 +21077,333 @@ function blobsToProofs(parameters) { return to === "bytes" ? proofs : proofs.map((x) => bytesToHex(x)); } +// node_modules/@noble/hashes/esm/_assert.js +function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`positive integer expected, not ${n}`); +} +function isBytes(a) { + return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; +} +function bytes(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}, not of length=${b.length}`); +} +function exists(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 output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } +} + +// node_modules/@noble/hashes/esm/utils.js +var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +var rotr = (word, shift) => word << 32 - shift | word >>> shift; +var isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; +var byteSwap = (word) => 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]); + } +} +function utf8ToBytes(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function toBytes2(data) { + if (typeof data === "string") + data = utf8ToBytes(data); + bytes(data); + return data; +} +var Hash = class { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } +}; +var toStr = {}.toString; +function wrapConstructor(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; +} +function wrapXOFConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} + +// 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); +} +var Chi = (a, b, c) => a & b ^ ~a & c; +var Maj = (a, b, c) => a & b ^ a & c ^ b & c; +var HashMD = class extends Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + exists(this); + const { view, buffer, blockLen } = this; + data = toBytes2(data); + 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) { + exists(this); + output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + 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.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } +}; + +// node_modules/@noble/hashes/esm/sha256.js +var SHA256_K = /* @__PURE__ */ new Uint32Array([ + 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_IV = /* @__PURE__ */ new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 +]); +var SHA256_W = /* @__PURE__ */ new Uint32Array(64); +var SHA256 = class extends HashMD { + constructor() { + super(64, 32, 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() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } +}; +var sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); + // node_modules/viem/_esm/utils/hash/sha256.js -init_sha256(); function sha2562(value, to_) { const to = to_ || "hex"; const bytes2 = sha256(isHex(value, { strict: false }) ? toBytes(value) : value); @@ -21573,7 +21541,7 @@ function serializeAuthorizationList(authorizationList) { for (const authorization of authorizationList) { const { contractAddress, chainId, nonce, ...signature } = authorization; serializedAuthorizationList.push([ - toHex(chainId), + chainId ? toHex(chainId) : "0x", contractAddress, nonce ? toHex(nonce) : "0x", ...toYParitySignatureArray({}, signature) @@ -21804,9 +21772,6 @@ var LruMap = class extends Map { } }; -// node_modules/@noble/hashes/esm/sha3.js -init_assert(); - // node_modules/@noble/hashes/esm/_u64.js var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); var _32n = /* @__PURE__ */ BigInt(32); @@ -21830,7 +21795,6 @@ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; // node_modules/@noble/hashes/esm/sha3.js -init_utils(); var SHA3_PI = []; var SHA3_ROTL = []; var _SHA3_IOTA = []; @@ -22117,7 +22081,7 @@ function assertTransactionEIP7702(transaction) { const { contractAddress, chainId } = authorization; if (!isAddress(contractAddress)) throw new InvalidAddressError({ address: contractAddress }); - if (chainId <= 0) + if (chainId < 0) throw new InvalidChainIdError({ chainId }); } } @@ -22868,6 +22832,11 @@ var base = /* @__PURE__ */ defineChain({ }, contracts: { ...chainConfig2.contracts, + disputeGameFactory: { + [sourceId]: { + address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e" + } + }, l2OutputOracle: { [sourceId]: { address: "0x56315b90c40730925ec5485cf004d835058518A0" @@ -23229,6 +23198,36 @@ var fantomTestnet = /* @__PURE__ */ defineChain({ testnet: true }); +// node_modules/viem/_esm/chains/definitions/gnosis.js +var gnosis = /* @__PURE__ */ defineChain({ + id: 100, + name: "Gnosis", + nativeCurrency: { + decimals: 18, + name: "Gnosis", + symbol: "xDAI" + }, + rpcUrls: { + default: { + http: ["https://rpc.gnosischain.com"], + webSocket: ["wss://rpc.gnosischain.com/wss"] + } + }, + blockExplorers: { + default: { + name: "Gnosisscan", + url: "https://gnosisscan.io", + apiUrl: "https://api.gnosisscan.io/api" + } + }, + contracts: { + multicall3: { + address: "0xca11bde05977b3631167028862be2a173976ca11", + blockCreated: 21022491 + } + } +}); + // node_modules/viem/_esm/chains/definitions/goerli.js var goerli = /* @__PURE__ */ defineChain({ id: 5, @@ -23262,36 +23261,6 @@ var goerli = /* @__PURE__ */ defineChain({ testnet: true }); -// node_modules/viem/_esm/chains/definitions/gnosis.js -var gnosis = /* @__PURE__ */ defineChain({ - id: 100, - name: "Gnosis", - nativeCurrency: { - decimals: 18, - name: "Gnosis", - symbol: "xDAI" - }, - rpcUrls: { - default: { - http: ["https://rpc.gnosischain.com"], - webSocket: ["wss://rpc.gnosischain.com/wss"] - } - }, - blockExplorers: { - default: { - name: "Gnosisscan", - url: "https://gnosisscan.io", - apiUrl: "https://api.gnosisscan.io/api" - } - }, - contracts: { - multicall3: { - address: "0xca11bde05977b3631167028862be2a173976ca11", - blockCreated: 21022491 - } - } -}); - // node_modules/viem/_esm/chains/definitions/harmonyOne.js var harmonyOne = /* @__PURE__ */ defineChain({ id: 16666e5, @@ -23729,7 +23698,7 @@ var ChainId = { mumbai: polygonMumbai.id, avalanche: avalanche.id, fuji: avalancheFuji.id, - arbitrum_one: arbitrum.id, + arbitrum: arbitrum.id, arbitrum_goerli: arbitrumGoerli.id, arbitrum_sepolia: arbitrumSepolia.id, fantom: fantom.id, diff --git a/dist/lib.d.mts b/dist/lib.d.mts index 59a6cbc..24e0e70 100644 --- a/dist/lib.d.mts +++ b/dist/lib.d.mts @@ -68,7 +68,7 @@ declare const ChainId: { readonly mumbai: 80001; readonly avalanche: 43114; readonly fuji: 43113; - readonly arbitrum_one: 42161; + readonly arbitrum: 42161; readonly arbitrum_goerli: 421613; readonly arbitrum_sepolia: 421614; readonly fantom: 250; @@ -92,7 +92,7 @@ declare const ChainId: { type SupportedChainIds = (typeof ChainId)[keyof typeof ChainId] & keyof typeof networkMap; declare const supportedChainIds: SupportedChainIds[]; -declare const getNetworkEnv: (chainId: SupportedChainIds) => "RPC_MAINNET" | "RPC_GOERLI" | "RPC_POLYGON" | "RPC_MUMBAI" | "RPC_AVALANCHE" | "RPC_FUJI" | "RPC_ARBITRUM_ONE" | "RPC_ARBITRUM_GOERLI" | "RPC_ARBITRUM_SEPOLIA" | "RPC_FANTOM" | "RPC_FANTOM_TESTNET" | "RPC_OPTIMISM" | "RPC_OPTIMISM_SEPOLIA" | "RPC_OPTIMISM_GOERLI" | "RPC_HARMONY" | "RPC_SEPOLIA" | "RPC_SCROLL" | "RPC_SCROLL_SEPOLIA" | "RPC_METIS" | "RPC_BASE" | "RPC_BASE_SEPOLIA" | "RPC_BNB" | "RPC_GNOSIS" | "RPC_ZKEVM" | "RPC_CELO" | "RPC_ZKSYNC"; +declare const getNetworkEnv: (chainId: SupportedChainIds) => "RPC_MAINNET" | "RPC_GOERLI" | "RPC_POLYGON" | "RPC_MUMBAI" | "RPC_AVALANCHE" | "RPC_FUJI" | "RPC_ARBITRUM" | "RPC_ARBITRUM_GOERLI" | "RPC_ARBITRUM_SEPOLIA" | "RPC_FANTOM" | "RPC_FANTOM_TESTNET" | "RPC_OPTIMISM" | "RPC_OPTIMISM_SEPOLIA" | "RPC_OPTIMISM_GOERLI" | "RPC_HARMONY" | "RPC_SEPOLIA" | "RPC_SCROLL" | "RPC_SCROLL_SEPOLIA" | "RPC_METIS" | "RPC_BASE" | "RPC_BASE_SEPOLIA" | "RPC_BNB" | "RPC_GNOSIS" | "RPC_ZKEVM" | "RPC_CELO" | "RPC_ZKSYNC"; /** * Return a RPC_URL for supported chains. * If the RPC_URL environment variable is set, it will be used. diff --git a/dist/lib.d.ts b/dist/lib.d.ts index 59a6cbc..24e0e70 100644 --- a/dist/lib.d.ts +++ b/dist/lib.d.ts @@ -68,7 +68,7 @@ declare const ChainId: { readonly mumbai: 80001; readonly avalanche: 43114; readonly fuji: 43113; - readonly arbitrum_one: 42161; + readonly arbitrum: 42161; readonly arbitrum_goerli: 421613; readonly arbitrum_sepolia: 421614; readonly fantom: 250; @@ -92,7 +92,7 @@ declare const ChainId: { type SupportedChainIds = (typeof ChainId)[keyof typeof ChainId] & keyof typeof networkMap; declare const supportedChainIds: SupportedChainIds[]; -declare const getNetworkEnv: (chainId: SupportedChainIds) => "RPC_MAINNET" | "RPC_GOERLI" | "RPC_POLYGON" | "RPC_MUMBAI" | "RPC_AVALANCHE" | "RPC_FUJI" | "RPC_ARBITRUM_ONE" | "RPC_ARBITRUM_GOERLI" | "RPC_ARBITRUM_SEPOLIA" | "RPC_FANTOM" | "RPC_FANTOM_TESTNET" | "RPC_OPTIMISM" | "RPC_OPTIMISM_SEPOLIA" | "RPC_OPTIMISM_GOERLI" | "RPC_HARMONY" | "RPC_SEPOLIA" | "RPC_SCROLL" | "RPC_SCROLL_SEPOLIA" | "RPC_METIS" | "RPC_BASE" | "RPC_BASE_SEPOLIA" | "RPC_BNB" | "RPC_GNOSIS" | "RPC_ZKEVM" | "RPC_CELO" | "RPC_ZKSYNC"; +declare const getNetworkEnv: (chainId: SupportedChainIds) => "RPC_MAINNET" | "RPC_GOERLI" | "RPC_POLYGON" | "RPC_MUMBAI" | "RPC_AVALANCHE" | "RPC_FUJI" | "RPC_ARBITRUM" | "RPC_ARBITRUM_GOERLI" | "RPC_ARBITRUM_SEPOLIA" | "RPC_FANTOM" | "RPC_FANTOM_TESTNET" | "RPC_OPTIMISM" | "RPC_OPTIMISM_SEPOLIA" | "RPC_OPTIMISM_GOERLI" | "RPC_HARMONY" | "RPC_SEPOLIA" | "RPC_SCROLL" | "RPC_SCROLL_SEPOLIA" | "RPC_METIS" | "RPC_BASE" | "RPC_BASE_SEPOLIA" | "RPC_BNB" | "RPC_GNOSIS" | "RPC_ZKEVM" | "RPC_CELO" | "RPC_ZKSYNC"; /** * Return a RPC_URL for supported chains. * If the RPC_URL environment variable is set, it will be used. diff --git a/dist/lib.js b/dist/lib.js index 3f95786..ff11f2c 100644 --- a/dist/lib.js +++ b/dist/lib.js @@ -3,9 +3,6 @@ var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); @@ -20,360 +17,6 @@ var __copyProps = (to, from, except, desc) => { }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -// node_modules/@noble/hashes/esm/_assert.js -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`positive integer expected, not ${n}`); -} -function isBytes(a) { - return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; -} -function bytes(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}, not of length=${b.length}`); -} -function exists(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 output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -var init_assert = __esm({ - "node_modules/@noble/hashes/esm/_assert.js"() { - "use strict"; - } -}); - -// node_modules/@noble/hashes/esm/utils.js -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } -} -function utf8ToBytes(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); -} -function toBytes2(data) { - if (typeof data === "string") - data = utf8ToBytes(data); - bytes(data); - return data; -} -function wrapConstructor(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; -} -function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -var u32, createView, rotr, isLE, byteSwap, Hash, toStr; -var init_utils = __esm({ - "node_modules/@noble/hashes/esm/utils.js"() { - "use strict"; - init_assert(); - u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - rotr = (word, shift) => word << 32 - shift | word >>> shift; - isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; - byteSwap = (word) => word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255; - Hash = class { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } - }; - toStr = {}.toString; - } -}); - -// 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); -} -var Chi, Maj, HashMD; -var init_md = __esm({ - "node_modules/@noble/hashes/esm/_md.js"() { - "use strict"; - init_assert(); - init_utils(); - Chi = (a, b, c) => a & b ^ ~a & c; - Maj = (a, b, c) => a & b ^ a & c ^ b & c; - HashMD = class extends Hash { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes2(data); - 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) { - exists(this); - output(out, this); - this.finished = true; - const { buffer, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer[pos++] = 128; - this.buffer.subarray(pos).fill(0); - 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.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - }; - } -}); - -// node_modules/@noble/hashes/esm/sha256.js -var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256; -var init_sha256 = __esm({ - "node_modules/@noble/hashes/esm/sha256.js"() { - "use strict"; - init_md(); - init_utils(); - SHA256_K = /* @__PURE__ */ new Uint32Array([ - 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 - ]); - SHA256_IV = /* @__PURE__ */ new Uint32Array([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]); - SHA256_W = /* @__PURE__ */ new Uint32Array(64); - SHA256 = class extends HashMD { - constructor() { - super(64, 32, 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() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } - }; - sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - } -}); - // src/lib.ts var lib_exports = {}; __export(lib_exports, { @@ -459,12 +102,12 @@ function defineChain(chain) { } // node_modules/viem/_esm/errors/version.js -var version = "2.21.28"; +var version = "2.21.40"; // node_modules/viem/_esm/errors/base.js var errorConfig = { getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0, - version + version: `viem@${version}` }; var BaseError = class _BaseError extends Error { constructor(shortMessage, args = {}) { @@ -540,7 +183,7 @@ var BaseError = class _BaseError extends Error { function walk(err, fn) { if (fn?.(err)) return err; - if (err && typeof err === "object" && "cause" in err) + if (err && typeof err === "object" && "cause" in err && err.cause !== void 0) return walk(err.cause, fn); return fn ? null : err; } @@ -1599,8 +1242,333 @@ function blobsToProofs(parameters) { return to === "bytes" ? proofs : proofs.map((x) => bytesToHex(x)); } +// node_modules/@noble/hashes/esm/_assert.js +function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`positive integer expected, not ${n}`); +} +function isBytes(a) { + return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; +} +function bytes(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}, not of length=${b.length}`); +} +function exists(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 output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } +} + +// node_modules/@noble/hashes/esm/utils.js +var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +var rotr = (word, shift) => word << 32 - shift | word >>> shift; +var isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; +var byteSwap = (word) => 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]); + } +} +function utf8ToBytes(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function toBytes2(data) { + if (typeof data === "string") + data = utf8ToBytes(data); + bytes(data); + return data; +} +var Hash = class { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } +}; +var toStr = {}.toString; +function wrapConstructor(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; +} +function wrapXOFConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} + +// 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); +} +var Chi = (a, b, c) => a & b ^ ~a & c; +var Maj = (a, b, c) => a & b ^ a & c ^ b & c; +var HashMD = class extends Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + exists(this); + const { view, buffer, blockLen } = this; + data = toBytes2(data); + 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) { + exists(this); + output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + 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.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } +}; + +// node_modules/@noble/hashes/esm/sha256.js +var SHA256_K = /* @__PURE__ */ new Uint32Array([ + 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_IV = /* @__PURE__ */ new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 +]); +var SHA256_W = /* @__PURE__ */ new Uint32Array(64); +var SHA256 = class extends HashMD { + constructor() { + super(64, 32, 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() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } +}; +var sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); + // node_modules/viem/_esm/utils/hash/sha256.js -init_sha256(); function sha2562(value, to_) { const to = to_ || "hex"; const bytes2 = sha256(isHex(value, { strict: false }) ? toBytes(value) : value); @@ -1738,7 +1706,7 @@ function serializeAuthorizationList(authorizationList) { for (const authorization of authorizationList) { const { contractAddress, chainId, nonce, ...signature } = authorization; serializedAuthorizationList.push([ - toHex(chainId), + chainId ? toHex(chainId) : "0x", contractAddress, nonce ? toHex(nonce) : "0x", ...toYParitySignatureArray({}, signature) @@ -1969,9 +1937,6 @@ var LruMap = class extends Map { } }; -// node_modules/@noble/hashes/esm/sha3.js -init_assert(); - // node_modules/@noble/hashes/esm/_u64.js var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); var _32n = /* @__PURE__ */ BigInt(32); @@ -1995,7 +1960,6 @@ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; // node_modules/@noble/hashes/esm/sha3.js -init_utils(); var SHA3_PI = []; var SHA3_ROTL = []; var _SHA3_IOTA = []; @@ -2282,7 +2246,7 @@ function assertTransactionEIP7702(transaction) { const { contractAddress, chainId } = authorization; if (!isAddress(contractAddress)) throw new InvalidAddressError({ address: contractAddress }); - if (chainId <= 0) + if (chainId < 0) throw new InvalidChainIdError({ chainId }); } } @@ -3033,6 +2997,11 @@ var base = /* @__PURE__ */ defineChain({ }, contracts: { ...chainConfig2.contracts, + disputeGameFactory: { + [sourceId]: { + address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e" + } + }, l2OutputOracle: { [sourceId]: { address: "0x56315b90c40730925ec5485cf004d835058518A0" @@ -3394,6 +3363,36 @@ var fantomTestnet = /* @__PURE__ */ defineChain({ testnet: true }); +// node_modules/viem/_esm/chains/definitions/gnosis.js +var gnosis = /* @__PURE__ */ defineChain({ + id: 100, + name: "Gnosis", + nativeCurrency: { + decimals: 18, + name: "Gnosis", + symbol: "xDAI" + }, + rpcUrls: { + default: { + http: ["https://rpc.gnosischain.com"], + webSocket: ["wss://rpc.gnosischain.com/wss"] + } + }, + blockExplorers: { + default: { + name: "Gnosisscan", + url: "https://gnosisscan.io", + apiUrl: "https://api.gnosisscan.io/api" + } + }, + contracts: { + multicall3: { + address: "0xca11bde05977b3631167028862be2a173976ca11", + blockCreated: 21022491 + } + } +}); + // node_modules/viem/_esm/chains/definitions/goerli.js var goerli = /* @__PURE__ */ defineChain({ id: 5, @@ -3427,36 +3426,6 @@ var goerli = /* @__PURE__ */ defineChain({ testnet: true }); -// node_modules/viem/_esm/chains/definitions/gnosis.js -var gnosis = /* @__PURE__ */ defineChain({ - id: 100, - name: "Gnosis", - nativeCurrency: { - decimals: 18, - name: "Gnosis", - symbol: "xDAI" - }, - rpcUrls: { - default: { - http: ["https://rpc.gnosischain.com"], - webSocket: ["wss://rpc.gnosischain.com/wss"] - } - }, - blockExplorers: { - default: { - name: "Gnosisscan", - url: "https://gnosisscan.io", - apiUrl: "https://api.gnosisscan.io/api" - } - }, - contracts: { - multicall3: { - address: "0xca11bde05977b3631167028862be2a173976ca11", - blockCreated: 21022491 - } - } -}); - // node_modules/viem/_esm/chains/definitions/harmonyOne.js var harmonyOne = /* @__PURE__ */ defineChain({ id: 16666e5, @@ -3894,7 +3863,7 @@ var ChainId = { mumbai: polygonMumbai.id, avalanche: avalanche.id, fuji: avalancheFuji.id, - arbitrum_one: arbitrum.id, + arbitrum: arbitrum.id, arbitrum_goerli: arbitrumGoerli.id, arbitrum_sepolia: arbitrumSepolia.id, fantom: fantom.id, diff --git a/dist/lib.mjs b/dist/lib.mjs index 53eab9b..1d6d2e8 100644 --- a/dist/lib.mjs +++ b/dist/lib.mjs @@ -1,362 +1,3 @@ -var __getOwnPropNames = Object.getOwnPropertyNames; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; - -// node_modules/@noble/hashes/esm/_assert.js -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`positive integer expected, not ${n}`); -} -function isBytes(a) { - return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; -} -function bytes(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}, not of length=${b.length}`); -} -function exists(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 output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} -var init_assert = __esm({ - "node_modules/@noble/hashes/esm/_assert.js"() { - "use strict"; - } -}); - -// node_modules/@noble/hashes/esm/utils.js -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } -} -function utf8ToBytes(str) { - if (typeof str !== "string") - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); -} -function toBytes2(data) { - if (typeof data === "string") - data = utf8ToBytes(data); - bytes(data); - return data; -} -function wrapConstructor(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; -} -function wrapXOFConstructorWithOpts(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; -} -var u32, createView, rotr, isLE, byteSwap, Hash, toStr; -var init_utils = __esm({ - "node_modules/@noble/hashes/esm/utils.js"() { - "use strict"; - init_assert(); - u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - rotr = (word, shift) => word << 32 - shift | word >>> shift; - isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; - byteSwap = (word) => word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255; - Hash = class { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } - }; - toStr = {}.toString; - } -}); - -// 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); -} -var Chi, Maj, HashMD; -var init_md = __esm({ - "node_modules/@noble/hashes/esm/_md.js"() { - "use strict"; - init_assert(); - init_utils(); - Chi = (a, b, c) => a & b ^ ~a & c; - Maj = (a, b, c) => a & b ^ a & c ^ b & c; - HashMD = class extends Hash { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes2(data); - 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) { - exists(this); - output(out, this); - this.finished = true; - const { buffer, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer[pos++] = 128; - this.buffer.subarray(pos).fill(0); - 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.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - }; - } -}); - -// node_modules/@noble/hashes/esm/sha256.js -var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256; -var init_sha256 = __esm({ - "node_modules/@noble/hashes/esm/sha256.js"() { - "use strict"; - init_md(); - init_utils(); - SHA256_K = /* @__PURE__ */ new Uint32Array([ - 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 - ]); - SHA256_IV = /* @__PURE__ */ new Uint32Array([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]); - SHA256_W = /* @__PURE__ */ new Uint32Array(64); - SHA256 = class extends HashMD { - constructor() { - super(64, 32, 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() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } - }; - sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - } -}); - // src/alchemyIds.ts var networkMap = { 1: "eth-mainnet", @@ -432,12 +73,12 @@ function defineChain(chain) { } // node_modules/viem/_esm/errors/version.js -var version = "2.21.28"; +var version = "2.21.40"; // node_modules/viem/_esm/errors/base.js var errorConfig = { getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0, - version + version: `viem@${version}` }; var BaseError = class _BaseError extends Error { constructor(shortMessage, args = {}) { @@ -513,7 +154,7 @@ var BaseError = class _BaseError extends Error { function walk(err, fn) { if (fn?.(err)) return err; - if (err && typeof err === "object" && "cause" in err) + if (err && typeof err === "object" && "cause" in err && err.cause !== void 0) return walk(err.cause, fn); return fn ? null : err; } @@ -1572,8 +1213,333 @@ function blobsToProofs(parameters) { return to === "bytes" ? proofs : proofs.map((x) => bytesToHex(x)); } +// node_modules/@noble/hashes/esm/_assert.js +function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`positive integer expected, not ${n}`); +} +function isBytes(a) { + return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array"; +} +function bytes(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}, not of length=${b.length}`); +} +function exists(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 output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } +} + +// node_modules/@noble/hashes/esm/utils.js +var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +var rotr = (word, shift) => word << 32 - shift | word >>> shift; +var isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; +var byteSwap = (word) => 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]); + } +} +function utf8ToBytes(str) { + if (typeof str !== "string") + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + return new Uint8Array(new TextEncoder().encode(str)); +} +function toBytes2(data) { + if (typeof data === "string") + data = utf8ToBytes(data); + bytes(data); + return data; +} +var Hash = class { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } +}; +var toStr = {}.toString; +function wrapConstructor(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; +} +function wrapXOFConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} + +// 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); +} +var Chi = (a, b, c) => a & b ^ ~a & c; +var Maj = (a, b, c) => a & b ^ a & c ^ b & c; +var HashMD = class extends Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + exists(this); + const { view, buffer, blockLen } = this; + data = toBytes2(data); + 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) { + exists(this); + output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + 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.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } +}; + +// node_modules/@noble/hashes/esm/sha256.js +var SHA256_K = /* @__PURE__ */ new Uint32Array([ + 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_IV = /* @__PURE__ */ new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 +]); +var SHA256_W = /* @__PURE__ */ new Uint32Array(64); +var SHA256 = class extends HashMD { + constructor() { + super(64, 32, 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() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } +}; +var sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); + // node_modules/viem/_esm/utils/hash/sha256.js -init_sha256(); function sha2562(value, to_) { const to = to_ || "hex"; const bytes2 = sha256(isHex(value, { strict: false }) ? toBytes(value) : value); @@ -1711,7 +1677,7 @@ function serializeAuthorizationList(authorizationList) { for (const authorization of authorizationList) { const { contractAddress, chainId, nonce, ...signature } = authorization; serializedAuthorizationList.push([ - toHex(chainId), + chainId ? toHex(chainId) : "0x", contractAddress, nonce ? toHex(nonce) : "0x", ...toYParitySignatureArray({}, signature) @@ -1942,9 +1908,6 @@ var LruMap = class extends Map { } }; -// node_modules/@noble/hashes/esm/sha3.js -init_assert(); - // node_modules/@noble/hashes/esm/_u64.js var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); var _32n = /* @__PURE__ */ BigInt(32); @@ -1968,7 +1931,6 @@ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; // node_modules/@noble/hashes/esm/sha3.js -init_utils(); var SHA3_PI = []; var SHA3_ROTL = []; var _SHA3_IOTA = []; @@ -2255,7 +2217,7 @@ function assertTransactionEIP7702(transaction) { const { contractAddress, chainId } = authorization; if (!isAddress(contractAddress)) throw new InvalidAddressError({ address: contractAddress }); - if (chainId <= 0) + if (chainId < 0) throw new InvalidChainIdError({ chainId }); } } @@ -3006,6 +2968,11 @@ var base = /* @__PURE__ */ defineChain({ }, contracts: { ...chainConfig2.contracts, + disputeGameFactory: { + [sourceId]: { + address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e" + } + }, l2OutputOracle: { [sourceId]: { address: "0x56315b90c40730925ec5485cf004d835058518A0" @@ -3367,6 +3334,36 @@ var fantomTestnet = /* @__PURE__ */ defineChain({ testnet: true }); +// node_modules/viem/_esm/chains/definitions/gnosis.js +var gnosis = /* @__PURE__ */ defineChain({ + id: 100, + name: "Gnosis", + nativeCurrency: { + decimals: 18, + name: "Gnosis", + symbol: "xDAI" + }, + rpcUrls: { + default: { + http: ["https://rpc.gnosischain.com"], + webSocket: ["wss://rpc.gnosischain.com/wss"] + } + }, + blockExplorers: { + default: { + name: "Gnosisscan", + url: "https://gnosisscan.io", + apiUrl: "https://api.gnosisscan.io/api" + } + }, + contracts: { + multicall3: { + address: "0xca11bde05977b3631167028862be2a173976ca11", + blockCreated: 21022491 + } + } +}); + // node_modules/viem/_esm/chains/definitions/goerli.js var goerli = /* @__PURE__ */ defineChain({ id: 5, @@ -3400,36 +3397,6 @@ var goerli = /* @__PURE__ */ defineChain({ testnet: true }); -// node_modules/viem/_esm/chains/definitions/gnosis.js -var gnosis = /* @__PURE__ */ defineChain({ - id: 100, - name: "Gnosis", - nativeCurrency: { - decimals: 18, - name: "Gnosis", - symbol: "xDAI" - }, - rpcUrls: { - default: { - http: ["https://rpc.gnosischain.com"], - webSocket: ["wss://rpc.gnosischain.com/wss"] - } - }, - blockExplorers: { - default: { - name: "Gnosisscan", - url: "https://gnosisscan.io", - apiUrl: "https://api.gnosisscan.io/api" - } - }, - contracts: { - multicall3: { - address: "0xca11bde05977b3631167028862be2a173976ca11", - blockCreated: 21022491 - } - } -}); - // node_modules/viem/_esm/chains/definitions/harmonyOne.js var harmonyOne = /* @__PURE__ */ defineChain({ id: 16666e5, @@ -3867,7 +3834,7 @@ var ChainId = { mumbai: polygonMumbai.id, avalanche: avalanche.id, fuji: avalancheFuji.id, - arbitrum_one: arbitrum.id, + arbitrum: arbitrum.id, arbitrum_goerli: arbitrumGoerli.id, arbitrum_sepolia: arbitrumSepolia.id, fantom: fantom.id, diff --git a/src/chainIds.ts b/src/chainIds.ts index 39f9fde..fd5ac6a 100644 --- a/src/chainIds.ts +++ b/src/chainIds.ts @@ -34,7 +34,7 @@ export const ChainId = { mumbai: polygonMumbai.id, avalanche: avalanche.id, fuji: avalancheFuji.id, - arbitrum_one: arbitrum.id, + arbitrum: arbitrum.id, arbitrum_goerli: arbitrumGoerli.id, arbitrum_sepolia: arbitrumSepolia.id, fantom: fantom.id, diff --git a/src/lib.test.ts b/src/lib.test.ts index b4a3e7c..097bdd9 100644 --- a/src/lib.test.ts +++ b/src/lib.test.ts @@ -36,8 +36,8 @@ describe("lib", () => { expect(envs).toMatchInlineSnapshot(` { + "RPC_ARBITRUM": 42161, "RPC_ARBITRUM_GOERLI": 421613, - "RPC_ARBITRUM_ONE": 42161, "RPC_ARBITRUM_SEPOLIA": 421614, "RPC_AVALANCHE": 43114, "RPC_BASE": 8453,