@flaunch/sdk
Version:
Flaunch SDK to easily interact with the Flaunch protocol
1 lines • 485 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@delvtech/drift"),require("viem"),require("axios"),require("@delvtech/drift-viem")):"function"==typeof define&&define.amd?define(["exports","@delvtech/drift","viem","axios","@delvtech/drift-viem"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@flaunch_sdk"]={},e.drift,e.viem,e.axios,e.driftViem)}(this,(function(e,t,n,a,i){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(a);function o(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const p="2.29.2";let y=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,u=`viem@${p}`;class l extends Error{constructor(e,t={}){const n=t.cause instanceof l?t.cause.details:t.cause?.message?t.cause.message:t.details,a=t.cause instanceof l&&t.cause.docsPath||t.docsPath,i=y?.({...t,docsPath:a});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...n?[`Details: ${n}`]:[],...u?[`Version: ${u}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=p}walk(e){return d(this,e)}}function d(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?d(e.cause,t):t?null:e}class c extends l{constructor({max:e,min:t,signed:n,size:a,value:i}){super(`Number "${i}" is not in safe ${a?`${8*a}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class m extends l{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function T(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function f(e){return T(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function b(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,a=0;for(let e=0;e<n.length-1&&"0"===n["left"===t?e:n.length-e-1].toString();e++)a++;return n="left"===t?n.slice(a):n.slice(0,n.length-a),"string"==typeof e?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}class h extends l{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class g extends l{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function w(e,{dir:t,size:n=32}={}){return"string"==typeof e?I(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new g({size:e.length,targetSize:n,type:"bytes"});const a=new Uint8Array(n);for(let i=0;i<n;i++){const r="right"===t;a[r?i:n-i-1]=e[r?i:e.length-i-1]}return a}(e,{dir:t,size:n})}function I(e,{dir:t,size:n=32}={}){if(null===n)return e;const a=e.replace("0x","");if(a.length>2*n)throw new g({size:Math.ceil(a.length/2),targetSize:n,type:"hex"});return`0x${a["right"===t?"padEnd":"padStart"](2*n,"0")}`}const v=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function x(e,t={}){return"number"==typeof e||"bigint"==typeof e?P(e,t):"string"==typeof e?_(e,t):"boolean"==typeof e?k(e,t):M(e,t)}function k(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(O(n,{size:t.size}),w(n,{size:t.size})):n}function M(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=v[e[t]];const a=`0x${n}`;return"number"==typeof t.size?(O(a,{size:t.size}),w(a,{dir:"right",size:t.size})):a}function P(e,t={}){const{signed:n,size:a}=t,i=BigInt(e);let r;a?r=n?(1n<<8n*BigInt(a)-1n)-1n:2n**(8n*BigInt(a))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof r&&n?-r-1n:0;if(r&&i>r||i<s){const t="bigint"==typeof e?"n":"";throw new c({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:n,size:a,value:`${e}${t}`})}const o=`0x${(n&&i<0?(1n<<BigInt(8*a))+BigInt(i):i).toString(16)}`;return a?w(o,{size:a}):o}const A=new TextEncoder;function _(e,t={}){return M(A.encode(e),t)}const F=new TextEncoder;function C(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=P(e,t);return D(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return O(n,{size:t.size}),w(n,{size:t.size});return n}(e,t):T(e)?D(e,t):B(e,t)}const S={zero:48,nine:57,A:65,F:70,a:97,f:102};function E(e){return e>=S.zero&&e<=S.nine?e-S.zero:e>=S.A&&e<=S.F?e-(S.A-10):e>=S.a&&e<=S.f?e-(S.a-10):void 0}function D(e,t={}){let n=e;t.size&&(O(n,{size:t.size}),n=w(n,{dir:"right",size:t.size}));let a=n.slice(2);a.length%2&&(a=`0${a}`);const i=a.length/2,r=new Uint8Array(i);for(let e=0,t=0;e<i;e++){const n=E(a.charCodeAt(t++)),i=E(a.charCodeAt(t++));if(void 0===n||void 0===i)throw new l(`Invalid byte sequence ("${a[t-2]}${a[t-1]}" in "${a}").`);r[e]=16*n+i}return r}function B(e,t={}){const n=F.encode(e);return"number"==typeof t.size?(O(n,{size:t.size}),w(n,{dir:"right",size:t.size})):n}function O(e,{size:t}){if(f(e)>t)throw new m({givenSize:f(e),maxSize:t})}function L(e,t={}){const{signed:n}=t;t.size&&O(e,{size:t.size});const a=BigInt(e);if(!n)return a;const i=(e.length-2)/2;return a<=(1n<<8n*BigInt(i)-1n)-1n?a:a-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function U(e,t={}){return Number(L(e,t))}function N(e,t){return({exclude:n,format:a})=>({exclude:n,format:e=>{const i=t(e);if(n)for(const e of n)delete i[e];return{...i,...a(e)}},type:e})}const R={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function H(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?U(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?U(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?R[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=e.authorizationList.map((e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)})))),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const z=N("transaction",H);function q(e){const t=(e.transactions??[]).map((e=>"string"==typeof e?e:H(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const V=N("block",q);const K={"0x0":"reverted","0x1":"success"};function W(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((e=>function(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?U(e.transactionIndex):null,status:e.status?K[e.status]:null,type:e.type?R[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const $=N("transactionReceipt",W);const G=2n**256n-1n;function Z(e){return"string"==typeof e[0]?X(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let a=0;for(const t of e)n.set(t,a),a+=t.length;return n}(e)}function X(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class j extends l{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Q extends l{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class Y extends l{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const J={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Y({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Q({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new j({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new j({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function ee(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(J);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function te(e,t="hex"){const n=ne(e),a=ee(new Uint8Array(n.length));return n.encode(a),"hex"===t?M(a.bytes):a.bytes}function ne(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=ae(t);return{length:t<=55?1+t:1+n+t,encode(a){t<=55?a.pushByte(192+t):(a.pushByte(247+n),1===n?a.pushUint8(t):2===n?a.pushUint16(t):3===n?a.pushUint24(t):a.pushUint32(t));for(const{encode:t}of e)t(a)}}}(e.map((e=>ne(e)))):function(e){const t="string"==typeof e?D(e):e,n=ae(t.length),a=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:a,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function ae(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new l("Length is too large.")}const ie={ether:-9,wei:9};function re(e,t="wei"){return function(e,t){let n=e.toString();const a=n.startsWith("-");a&&(n=n.slice(1)),n=n.padStart(t,"0");let[i,r]=[n.slice(0,n.length-t),n.slice(n.length-t)];return r=r.replace(/(0+)$/,""),`${a?"-":""}${i||"0"}${r?`.${r}`:""}`}(e,ie[t])}function se(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class oe extends l{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class pe extends l{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",se(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class ye extends l{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function ue(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),a="string"==typeof e.blobs[0]?e.blobs.map((e=>D(e))):e.blobs,i=[];for(const e of a)i.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?i:i.map((e=>M(e)))}function le(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),a="string"==typeof e.blobs[0]?e.blobs.map((e=>D(e))):e.blobs,i="string"==typeof e.commitments[0]?e.commitments.map((e=>D(e))):e.commitments,r=[];for(let e=0;e<a.length;e++){const n=a[e],s=i[e];r.push(Uint8Array.from(t.computeBlobKzgProof(n,s)))}return"bytes"===n?r:r.map((e=>M(e)))}function de(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ce(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function me(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Te(e,t){ce(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const fe="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function be(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function he(e,t){return e<<32-t|e>>>t}const ge=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function we(e){for(let n=0;n<e.length;n++)e[n]=(t=e[n])<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;var t}function Ie(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function ve(e){return"string"==typeof e&&(e=Ie(e)),ce(e),e}"function"==typeof Uint8Array.from([]).toHex&&Uint8Array.fromHex;class xe{clone(){return this._cloneInto()}}function ke(e){const t=t=>e().update(ve(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Me(e=32){if(fe&&"function"==typeof fe.getRandomValues)return fe.getRandomValues(new Uint8Array(e));if(fe&&"function"==typeof fe.randomBytes)return Uint8Array.from(fe.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function Pe(e,t,n){return e&t^e&n^t&n}class Ae extends xe{constructor(e,t,n,a){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=a,this.buffer=new Uint8Array(e),this.view=be(this.buffer)}update(e){me(this);const{view:t,buffer:n,blockLen:a}=this,i=(e=ve(e)).length;for(let r=0;r<i;){const s=Math.min(a-this.pos,i-r);if(s!==a)n.set(e.subarray(r,r+s),this.pos),this.pos+=s,r+=s,this.pos===a&&(this.process(t,0),this.pos=0);else{const t=be(e);for(;a<=i-r;r+=a)this.process(t,r)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){me(this),Te(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:a,isLE:i}=this;let{pos:r}=this;t[r++]=128,this.buffer.subarray(r).fill(0),this.padOffset>a-r&&(this.process(n,0),r=0);for(let e=r;e<a;e++)t[e]=0;!function(e,t,n,a){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,a);const i=BigInt(32),r=BigInt(4294967295),s=Number(n>>i&r),o=Number(n&r),p=a?4:0,y=a?0:4;e.setUint32(t+p,s,a),e.setUint32(t+y,o,a)}(n,a-8,BigInt(8*this.length),i),this.process(n,0);const s=be(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=o/4,y=this.get();if(p>y.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<p;e++)s.setUint32(4*e,y[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:a,finished:i,destroyed:r,pos:s}=this;return e.length=a,e.pos=s,e.finished=i,e.destroyed=r,a%t&&e.buffer.set(n),e}}const _e=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]),Fe=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ce=new Uint32Array(64);class Se extends Ae{constructor(e=32){super(64,e,8,!1),this.A=0|Fe[0],this.B=0|Fe[1],this.C=0|Fe[2],this.D=0|Fe[3],this.E=0|Fe[4],this.F=0|Fe[5],this.G=0|Fe[6],this.H=0|Fe[7]}get(){const{A:e,B:t,C:n,D:a,E:i,F:r,G:s,H:o}=this;return[e,t,n,a,i,r,s,o]}set(e,t,n,a,i,r,s,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|a,this.E=0|i,this.F=0|r,this.G=0|s,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)Ce[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Ce[e-15],n=Ce[e-2],a=he(t,7)^he(t,18)^t>>>3,i=he(n,17)^he(n,19)^n>>>10;Ce[e]=i+Ce[e-7]+a+Ce[e-16]|0}let{A:n,B:a,C:i,D:r,E:s,F:o,G:p,H:y}=this;for(let e=0;e<64;e++){const t=y+(he(s,6)^he(s,11)^he(s,25))+((u=s)&o^~u&p)+_e[e]+Ce[e]|0,l=(he(n,2)^he(n,13)^he(n,22))+Pe(n,a,i)|0;y=p,p=o,o=s,s=r+t|0,r=i,i=a,a=n,n=t+l|0}var u;n=n+this.A|0,a=a+this.B|0,i=i+this.C|0,r=r+this.D|0,s=s+this.E|0,o=o+this.F|0,p=p+this.G|0,y=y+this.H|0,this.set(n,a,i,r,s,o,p,y)}roundClean(){Ce.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ee=ke((()=>new Se));function De(e){const{commitment:t,version:n=1}=e,a=e.to??("string"==typeof t?"hex":"bytes"),i=function(e,t){const n=t||"hex",a=Ee(T(e,{strict:!1})?C(e):e);return"bytes"===n?a:x(a)}(t,"bytes");return i.set([n],0),"bytes"===a?i:M(i)}const Be=4096,Oe=131072,Le=761855;class Ue extends l{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class Ne extends l{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Re extends l{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class He extends l{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:["Expected: 1",`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}function ze(e){const{data:t,kzg:n,to:a}=e,i=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?D(e.data):e.data,a=f(n);if(!a)throw new Ne;if(a>Le)throw new Ue({maxSize:Le,size:a});const i=[];let r=!0,s=0;for(;r;){const e=ee(new Uint8Array(Oe));let t=0;for(;t<Be;){const a=n.slice(s,s+31);if(e.pushByte(0),e.pushBytes(a),a.length<31){e.pushByte(128),r=!1;break}t++,s+=31}i.push(e)}return"bytes"===t?i.map((e=>e.bytes)):i.map((e=>M(e.bytes)))}({data:t,to:a}),r=e.commitments??ue({blobs:i,kzg:n,to:a}),s=e.proofs??le({blobs:i,commitments:r,kzg:n,to:a}),o=[];for(let e=0;e<i.length;e++)o.push({blob:i[e],commitment:r[e],proof:s[e]});return o}class qe extends l{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class Ve extends l{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class Ke extends l{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${re(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Ke,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class We extends l{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${re(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${re(n)} gwei`:""}).`].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(We,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class $e extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const Ge=BigInt(2**32-1),Ze=BigInt(32);function Xe(e,t=!1){return t?{h:Number(e&Ge),l:Number(e>>Ze&Ge)}:{h:0|Number(e>>Ze&Ge),l:0|Number(e&Ge)}}function je(e,t=!1){let n=new Uint32Array(e.length),a=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:r,l:s}=Xe(e[i],t);[n[i],a[i]]=[r,s]}return[n,a]}const Qe=[],Ye=[],Je=[],et=BigInt(0),tt=BigInt(1),nt=BigInt(2),at=BigInt(7),it=BigInt(256),rt=BigInt(113);for(let e=0,t=tt,n=1,a=0;e<24;e++){[n,a]=[a,(2*n+3*a)%5],Qe.push(2*(5*a+n)),Ye.push((e+1)*(e+2)/2%64);let i=et;for(let e=0;e<7;e++)t=(t<<tt^(t>>at)*rt)%it,t&nt&&(i^=tt<<(tt<<BigInt(e))-tt);Je.push(i)}const[st,ot]=je(Je,!0),pt=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),yt=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class ut extends xe{constructor(e,t,n,a=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=a,this.rounds=i,de(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var r;this.state=new Uint8Array(200),this.state32=(r=this.state,new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)))}keccak(){ge||we(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let a=24-t;a<24;a++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const a=(t+8)%10,i=(t+2)%10,r=n[i],s=n[i+1],o=pt(r,s,1)^n[a],p=yt(r,s,1)^n[a+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=p}let t=e[2],i=e[3];for(let n=0;n<24;n++){const a=Ye[n],r=pt(t,i,a),s=yt(t,i,a),o=Qe[n];t=e[o],i=e[o+1],e[o]=r,e[o+1]=s}for(let t=0;t<50;t+=10){for(let a=0;a<10;a++)n[a]=e[t+a];for(let a=0;a<10;a++)e[t+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=st[a],e[1]^=ot[a]}n.fill(0)}(this.state32,this.rounds),ge||we(this.state32),this.posOut=0,this.pos=0}update(e){me(this);const{blockLen:t,state:n}=this,a=(e=ve(e)).length;for(let i=0;i<a;){const r=Math.min(t-this.pos,a-i);for(let t=0;t<r;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:a}=this;e[n]^=t,128&t&&n===a-1&&this.keccak(),e[a-1]^=128,this.keccak()}writeInto(e){me(this,!1),ce(e),this.finish();const t=this.state,{blockLen:n}=this;for(let a=0,i=e.length;a<i;){this.posOut>=n&&this.keccak();const r=Math.min(n-this.posOut,i-a);e.set(t.subarray(this.posOut,this.posOut+r),a),this.posOut+=r,a+=r}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return de(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Te(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:a,rounds:i,enableXOF:r}=this;return e||(e=new ut(t,n,a,r,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=a,e.enableXOF=r,e.destroyed=this.destroyed,e}}const lt=((e,t,n)=>ke((()=>new ut(t,e,n))))(1,136,32);function dt(e,t){const n=t||"hex",a=lt(T(e,{strict:!1})?C(e):e);return"bytes"===n?a:x(a)}const ct=new $e(8192);function mt(e,t){if(ct.has(`${e}.${t}`))return ct.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),a=dt(B(n),"bytes"),i=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)a[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&a[e>>1])>=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());const r=`0x${i.join("")}`;return ct.set(`${e}.${t}`,r),r}const Tt=/^0x[a-fA-F0-9]{40}$/,ft=new $e(8192);function bt(e,t){const{strict:n=!0}=t??{},a=`${e}.${n}`;if(ft.has(a))return ft.get(a);const i=!(!Tt.test(e)||e.toLowerCase()!==e&&n&&mt(e)!==e);return ft.set(a,i),i}function ht(e,t,n,{strict:a}={}){return T(e,{strict:!1})?function(e,t,n,{strict:a}={}){gt(e,t);const i=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;a&&wt(i,t,n);return i}(e,t,n,{strict:a}):function(e,t,n,{strict:a}={}){gt(e,t);const i=e.slice(t,n);a&&wt(i,t,n);return i}(e,t,n,{strict:a})}function gt(e,t){if("number"==typeof t&&t>0&&t>f(e)-1)throw new h({offset:t,position:"start",size:f(e)})}function wt(e,t,n){if("number"==typeof t&&"number"==typeof n&&f(e)!==n-t)throw new h({offset:n,position:"end",size:f(e)})}function It(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:a,to:i}=e;if(t<=0)throw new Ve({chainId:t});if(i&&!bt(i))throw new qe({address:i});if(a&&a>G)throw new Ke({maxFeePerGas:a});if(n&&a&&n>a)throw new We({maxFeePerGas:a,maxPriorityFeePerGas:n})}function vt(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n<e.length;n++){const{address:a,storageKeys:i}=e[n];for(let e=0;e<i.length;e++)if(i[e].length-2!=64)throw new ye({storageKey:i[e]});if(!bt(a,{strict:!1}))throw new qe({address:a});t.push([a,i])}return t}function xt(e,t){const n=function(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new pe({transaction:e})}(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:a,nonce:i,to:r,value:s,maxFeePerGas:o,maxPriorityFeePerGas:p,accessList:y,data:u}=e;It(e);const l=vt(y),d=[x(n),i?x(i):"0x",p?x(p):"0x",o?x(o):"0x",a?x(a):"0x",r??"0x",s?x(s):"0x",u??"0x",l,...kt(e,t)];return X(["0x02",te(d)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:a,data:i,nonce:r,to:s,value:o,accessList:p,gasPrice:y}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:a,maxFeePerGas:i,to:r}=e;if(t<=0)throw new Ve({chainId:t});if(r&&!bt(r))throw new qe({address:r});if(n||i)throw new l("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(a&&a>G)throw new Ke({maxFeePerGas:a})}(e);const u=vt(p),d=[x(n),r?x(r):"0x",y?x(y):"0x",a?x(a):"0x",s??"0x",o?x(o):"0x",i??"0x",u,...kt(e,t)];return X(["0x01",te(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:a,nonce:i,to:r,value:s,maxFeePerBlobGas:o,maxFeePerGas:p,maxPriorityFeePerGas:y,accessList:u,data:l}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new Ne;for(const e of t){const t=f(e),n=U(ht(e,0,1));if(32!==t)throw new Re({hash:e,size:t});if(1!==n)throw new He({hash:e,version:n})}}It(e)}(e);let d=e.blobVersionedHashes,c=e.sidecars;if(e.blobs&&(void 0===d||void 0===c)){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map((e=>M(e))),n=e.kzg,a=ue({blobs:t,kzg:n});if(void 0===d&&(d=function(e){const{commitments:t,version:n}=e,a=e.to??("string"==typeof t[0]?"hex":"bytes"),i=[];for(const e of t)i.push(De({commitment:e,to:a,version:n}));return i}({commitments:a})),void 0===c){c=ze({blobs:t,commitments:a,proofs:le({blobs:t,commitments:a,kzg:n})})}}const m=vt(u),T=[x(n),i?x(i):"0x",y?x(y):"0x",p?x(p):"0x",a?x(a):"0x",r??"0x",s?x(s):"0x",l??"0x",m,o?x(o):"0x",d??[],...kt(e,t)],b=[],h=[],g=[];if(c)for(let e=0;e<c.length;e++){const{blob:t,commitment:n,proof:a}=c[e];b.push(t),h.push(n),g.push(a)}return X(["0x03",te(c?[T,b,h,g]:T)])}(e,t):"eip7702"===n?function(e,t){const{authorizationList:n,chainId:a,gas:i,nonce:r,to:s,value:o,maxFeePerGas:p,maxPriorityFeePerGas:y,accessList:u,data:l}=e;!function(e){const{authorizationList:t}=e;if(t)for(const e of t){const{chainId:t}=e,n=e.address;if(!bt(n))throw new qe({address:n});if(t<0)throw new Ve({chainId:t})}It(e)}(e);const d=vt(u),c=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const{chainId:e,nonce:a,...i}=n,r=n.address;t.push([e?x(e):"0x",r,a?x(a):"0x",...kt({},i)])}return t}(n);return X(["0x04",te([x(a),r?x(r):"0x",y?x(y):"0x",p?x(p):"0x",i?x(i):"0x",s??"0x",o?x(o):"0x",l??"0x",d,c,...kt(e,t)])])}(e,t):function(e,t){const{chainId:n=0,gas:a,data:i,nonce:r,to:s,value:o,gasPrice:p}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:a,maxFeePerGas:i,to:r}=e;if(r&&!bt(r))throw new qe({address:r});if(void 0!==t&&t<=0)throw new Ve({chainId:t});if(n||i)throw new l("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(a&&a>G)throw new Ke({maxFeePerGas:a})}(e);let y=[r?x(r):"0x",p?x(p):"0x",a?x(a):"0x",s??"0x",o?x(o):"0x",i??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new oe({v:t.v});return e})(),a=b(t.r),i=b(t.s);y=[...y,x(e),"0x00"===a?"0x":a,"0x00"===i?"0x":i]}else n>0&&(y=[...y,x(n),"0x","0x"]);return te(y)}(e,t)}function kt(e,t){const n=t??e,{v:a,yParity:i}=n;if(void 0===n.r)return[];if(void 0===n.s)return[];if(void 0===a&&void 0===i)return[];const r=b(n.r),s=b(n.s);return["number"==typeof i?i?x(1):"0x":0n===a?"0x":1n===a?x(1):27n===a?"0x":x(1),"0x00"===r?"0x":r,"0x00"===s?"0x":s]}const Mt={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};function Pt(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!bt(t))throw new qe({address:t});if(n&&!bt(n))throw new qe({address:n})}(e);const{sourceHash:t,data:n,from:a,gas:i,isSystemTx:r,mint:s,to:o,value:p}=e;return X(["0x7e",te([t,a,o??"0x",s?x(s):"0x",p?x(p):"0x",i?x(i):"0x",r?"0x1":"0x",n??"0x"])])}(e):xt(e,t)}const At={contracts:Mt,formatters:{block:V({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=H(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?L(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:z({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?L(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:$({format:e=>({l1GasPrice:e.l1GasPrice?L(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?L(e.l1GasUsed):null,l1Fee:e.l1Fee?L(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:Pt}},_t=1,Ft=o({...At,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...At.contracts,disputeGameFactory:{[_t]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[_t]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[_t]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[_t]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),Ct=11155111,St=o({...At,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...At.contracts,disputeGameFactory:{[Ct]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[Ct]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[Ct]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[Ct]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:Ct});o({id:53456,name:"BirdLayer",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.birdlayer.xyz","https://rpc1.birdlayer.xyz"],webSocket:["wss://rpc.birdlayer.xyz/ws"]}},blockExplorers:{default:{name:"BirdLayer Explorer",url:"https://scan.birdlayer.xyz"}}});const Et=1;o({...At,id:60808,name:"BOB",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.gobob.xyz"],webSocket:["wss://rpc.gobob.xyz"]}},blockExplorers:{default:{name:"BOB Explorer",url:"https://explorer.gobob.xyz"}},contracts:{...At.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:23131},l2OutputOracle:{[Et]:{address:"0xdDa53E23f8a32640b04D7256e651C1db98dB11C1",blockCreated:4462615}},portal:{[Et]:{address:"0x8AdeE124447435fE03e3CD24dF3f4cAE32E65a3E",blockCreated:4462615}}},sourceId:1});const Dt=11155111;o({...At,id:808813,name:"BOB Sepolia",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://bob-sepolia.rpc.gobob.xyz"],webSocket:["wss://bob-sepolia.rpc.gobob.xyz"]}},blockExplorers:{default:{name:"BOB Sepolia Explorer",url:"https://bob-sepolia.explorer.gobob.xyz"}},contracts:{...At.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:35677},l2OutputOracle:{[Dt]:{address:"0x14D0069452b4AE2b250B395b8adAb771E4267d2f",blockCreated:4462615}},portal:{[Dt]:{address:"0x867B1Aa872b9C8cB5E9F7755feDC45BB24Ad0ae4",blockCreated:4462615}}},testnet:!0,sourceId:Dt});o({id:44,name:"Crab Network",nativeCurrency:{decimals:18,name:"Crab Network Native Token",symbol:"CRAB"},rpcUrls:{default:{http:["https://crab-rpc.darwinia.network"],webSocket:["wss://crab-rpc.darwinia.network"]}},blockExplorers:{default:{name:"Blockscout",url:"https://crab-scan.darwinia.network"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3032593}}}),o({id:66665,name:"Creator",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.creatorchain.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.creatorchain.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}},testnet:!0}),o({id:53457,name:"DODOchain Testnet",nativeCurrency:{decimals:18,name:"DODO",symbol:"DODO"},rpcUrls:{default:{http:["https://dodochain-testnet.alt.technology"],webSocket:["wss://dodochain-testnet.alt.technology/ws"]}},blockExplorers:{default:{name:"DODOchain Testnet (Sepolia) Explorer",url:"https://testnet-scan.dodochain.com"}},testnet:!0});o({...At,id:3397901,network:"funkiSepolia",name:"Funki Sepolia Sandbox",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://funki-testnet.alt.technology"]}},blockExplorers:{default:{name:"Funki Sepolia Sandbox Explorer",url:"https://sepolia-sandbox.funkichain.com/"}},testnet:!0,contracts:{...At.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204}},sourceId:11155111});const Bt=17e3;o({...At,name:"Garnet Testnet",testnet:!0,id:17069,sourceId:Bt,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"],webSocket:["wss://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}},contracts:{...At.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[Bt]:{address:"0x57ee40586fbE286AfC75E67cb69511A6D9aF5909",blockCreated:1274684}},l2OutputOracle:{[Bt]:{address:"0xCb8E7AC561b8EF04F2a15865e9fbc0766FEF569B",blockCreated:1274684}},l1StandardBridge:{[Bt]:{address:"0x09bcDd311FE398F80a78BE37E489f5D440DB95DE",blockCreated:1274684}}}});o({id:701,name:"Koi Network",nativeCurrency:{decimals:18,name:"Koi Network Native Token",symbol:"KRING"},rpcUrls:{default:{http:["https://koi-rpc.darwinia.network"],webSocket:["wss://koi-rpc.darwinia.network"]}},blockExplorers:{default:{name:"Blockscout",url:"https://koi-scan.darwinia.network"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:180001}},testnet:!0});class Ot extends l{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n"),{name:"AbiEncodingArrayLengthMismatchError"})}}class Lt extends l{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${f(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Ut extends l{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n"),{name:"AbiEncodingLengthMismatchError"})}}class Nt extends l{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class Rt extends l{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiEncodingType"})}}class Ht extends l{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n"),{name:"InvalidArrayError"})}}const zt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,qt=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Vt(e,t){if(e.length!==t.length)throw new Ut({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let a=0;a<e.length;a++)n.push(Kt({param:e[a],value:t[a]}));return n}({params:e,values:t}),a=Wt(n);return 0===a.length?"0x":a}function Kt({param:e,value:t}){const n=function(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}(e.type);if(n){const[a,i]=n;return function(e,{length:t,param:n}){const a=null===t;if(!Array.isArray(e))throw new Ht(e);if(!a&&e.length!==t)throw new Ot({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let i=!1;const r=[];for(let t=0;t<e.length;t++){const a=Kt({param:n,value:e[t]});a.dynamic&&(i=!0),r.push(a)}if(a||i){const e=Wt(r);if(a){const t=P(r.length,{size:32});return{dynamic:!0,encoded:r.length>0?Z([t,e]):t}}if(i)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:Z(r.map((({encoded:e})=>e)))}}(t,{length:a,param:{...e,type:i}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const a=[];for(let i=0;i<t.components.length;i++){const r=t.components[i],s=Kt({param:r,value:e[Array.isArray(e)?i:r.name]});a.push(s),s.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Wt(a):Z(a.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!bt(e))throw new qe({address:e});return{dynamic:!1,encoded:I(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new l(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:I(k(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int"),[,,a="256"]=qt.exec(e.type)??[];return function(e,{signed:t,size:n=256}){if("number"==typeof n){const a=2n**(BigInt(n)-(t?1n:0n))-1n,i=t?-a-1n:0n;if(e>a||e<i)throw new c({max:a.toString(),min:i.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:P(e,{size:32,signed:t})}}(t,{signed:n,size:Number(a)})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),a=f(e);if(!n){let t=e;return a%32!=0&&(t=I(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:Z([I(P(a,{size:32})),t])}}if(a!==Number.parseInt(n))throw new Lt({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:I(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=_(e),n=Math.ceil(f(t)/32),a=[];for(let e=0;e<n;e++)a.push(I(ht(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:Z([I(P(f(t),{size:32})),...a])}}(t);throw new Rt(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Wt(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:a,encoded:i}=e[n];t+=a?32:f(i)}const n=[],a=[];let i=0;for(let r=0;r<e.length;r++){const{dynamic:s,encoded:o}=e[r];s?(n.push(P(t+i,{size:32})),a.push(o),i+=f(o)):n.push(o)}return Z([...n,...a])}const $t=11155111;o({...At,name:"Pyrope Testnet",testnet:!0,id:695569,sourceId:$t,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.pyropechain.com"],webSocket:["wss://rpc.pyropechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://pyrope.blockscout.com"}},contracts:{...At.contracts,l1StandardBridge:{[$t]:{address:"0xC24932c31D9621aE9e792576152B7ef010cFC2F8"}}}});const Gt=1;o({...At,name:"Redstone",id:690,sourceId:1,nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.redstonechain.com"],webSocket:["wss://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz"}},contracts:{...At.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[Gt]:{address:"0xC7bCb0e8839a28A1cFadd1CF716de9016CdA51ae",blockCreated:19578329}},l2OutputOracle:{[Gt]:{address:"0xa426A052f657AEEefc298b3B5c35a470e4739d69",blockCreated:19578337}},l1StandardBridge:{[Gt]:{address:"0xc473ca7E02af24c129c2eEf51F2aDf0411c1Df69",blockCreated:19578331}}}});const Zt={[Ft.id]:"0xe52dE1801C10cF709cc8e62d43D783AFe984b510",[St.id]:"0xf0Fd8Bb98c050607d999D6fFF9C617edD6673b75"},Xt={[Ft.id]:"0x51Bba15255406Cfe7099a42183302640ba7dAFDC",[St.id]:"0x9A7059cA00dA92843906Cb4bCa1D005cE848AFdC"},jt={[Ft.id]:"0xf785bb58059fab6fb19bdda2cb9078d9e546efdc",[St.id]:"0x24347e0dd16357059abfc1b321df354873552fdc"},Qt={[Ft.id]:"0x23321f11a6d44fd1ab790044fdfde5758c902fdc",[St.id]:"0x4e7cb1e6800a7b297b38bddcecaf9ca5b6616fdc"},Yt={[Ft.id]:"0x8DC3b85e1dc1C846ebf3971179a751896842e5dC",[St.id]:"0xB4A535B9D35851972736495CC52FBfDaCF32e5dc"},Jt={[Ft.id]:"0xCc7A4A00072ccbeEEbd999edc812C0ce498Fb63B",[St.id]:"0x7D375C9133721083DF7b7e5Cb0Ed8Fc78862dfe3"},en={[Ft.id]:"0xb4512bf57d50fbcb64a3adf8b17a79b2a204c18c",[St.id]:"0x96be8ff5e244294a34bfa507a39190dc7a839baa"},tn={[Ft.id]:"0x516af52d0c629b5e378da4dc64ecb0744ce10109",[St.id]:"0xe2ef58a54ee79dac0D4A130ea58b340124DF9438"},nn={[Ft.id]:"0xc5B2E8F197407263F4B62a35C71bFc394ecF95D5",[St.id]:"0x67Ee6C83956a75f67bD3Fc8Ca4080D95a145c7C9"},an={[Ft.id]:"0xCc7A4A00072ccbeEEbd999edc812C0ce498Fb63B",[St.id]:"0x227Fc288aC56E169f2BfEA82e07F8635054d4136"},rn={[Ft.id]:"0x4dc442403e8c758425b93C59Dc737da522f32640",[St.id]:"0x7922c1ead7c5825fb52ed6b14f397d064508acbe"},sn={[Ft.id]:"0x66681f10BA90496241A25e33380004f30Dfd8aa8",[St.id]:"0xa2107050ACEf4809c88Ab744F8e667605db5ACDB"},on={[Ft.id]:"0x7f22353d1634223a802D1c1Ea5308Ddf5DD0ef9c",[St.id]:"0x6f2fa01a05ff8b6efbfefd91a3b85aaf19265a00"},pn={[Ft.id]:"0x2154c604df568A5285284D1c4918DC98C39240df",[St.id]:"0xcfF222eA42E43F46A98755db237E4c9C2CA9B772"},yn={[Ft.id]:"0x48af8b28DDC5e5A86c4906212fc35Fa808CA8763",[St.id]:"0xD2F3C6185e06925dCBE794C6574315b2202E9CcD"},un={[Ft.id]:"0xc8d4B2Ca8eD6868eE768beAb1f932d7eecCc1b50",[St.id]:"0xA8153b14c8CfdDfb02627807D84AB02D12A85477"},ln={[Ft.id]:"0xfAB4BA48a322Efc8b25815448BE6018D211e89f3",[St.id]:"0x0A3AF63cd86E68a852A1D4923FEfC4e855D8499d"},dn={[Ft.id]:"0xec0069F8DBbbC94058dc895000dd38ef40b3125d",[St.id]:"0xB8f1cb6B4Ff8f07149276bbfA617aed7bd32d20D"},cn={[Ft.id]:"0x3AAF3b1D8cD5b61C77f99bA7cdf41E9eC0Ba8a3f",[St.id]:"0xc3947EC9d687053bBA72b36Fd6b2567e775E82C7"},mn={[Ft.id]:"0x6fb66f4fc262dc86e12136c481ba7c411e668197",[St.id]:"0x7981369D21975F39773f289F759F7d7CE1097139"},Tn={[Ft.id]:"0xFe55dFf581b665479ABe9Fc0A0578FB222cB4Dda",[St.id]:"0x2874F9A30348aCAaaD55D74B0BEc9C18f04b471a"},fn={[Ft.id]:"0xedd66b080b8e9425c39d349a3fb69f480580f993",[St.id]:"0x6428b5C4da36ecB070aBdcB5E1939244A3cC7fb5"},bn={[Ft.id]:"0xba28ac1540893a34476c24b2c4fa32e0506c9055",[St.id]:"0x47226918e518f205584bd75bf81e0b532b0b3ea7"},hn={[Ft.id]:"0x06a089fa231aca48d2aa77365123ad9aca43d3a4",[St.id]:"0x6582d2bc6a7eba3b40bdf46b3868fc7ec2ff96ec"},gn={[Ft.id]:"0x7a04367563a65db574d6b7d084fdbcf4a570c5a6",[St.id]:"0xfde5b79e3e2814edd5f91e8694ae400954d9cfaa"},wn={[Ft.id]:"0x656047fd43d2c3a121f2ef859d7171d7dd59f8b9",[St.id]:"0x05a5763e9199b88bb591c6b112d0424b2cd7a99e"},In={[Ft.id]:"0x4dfc76A31A2a0110739611683a8b6C5201480fa1",[St.id]:"0x551aeD820CAfaca2f9cD1C637AAc076D05a03AC2"},vn={[Ft.id]:"0x828B58B2B2df8ff3221Fbe2b07e75a56a84493Cc",[St.id]:"0xe8691E8f576A98c41EBB5E984207d4F51386621f"},xn={[Ft.id]:"0x72e6f7948b1B1A343B477F39aAbd2E35E6D27dde",[St.id]:"0x73E27908b7d35A9251a54799A8ef4C17e4ED9FF9"},kn={[Ft.id]:"0xBD39c7Be6D98BD1a3e4Ad482baF99d738947fE55",[St.id]:"0xd3d9047CaBE3346C70b510435866565176e8CE12"},Mn={[Ft.id]:"0x000000000D564D5be76f7f0d28fE52605afC7Cf8",[St.id]:"0x79FC52701cD4BE6f9Ba9aDC94c207DE37e3314eb"},Pn={[Ft.id]:"0x9E433F32bb5481a9CA7DFF5b3af74A7ed041a888",[St.id]:"0x4bd2ca15286c96e4e731337de8b375da6841e888"},An={[Ft.id]:"0x68d967d25806fef4aa134db031cd