UNPKG

based-auth

Version:

A Next.js/Node.js authentication and wallet API kit for Ethereum and Solana, with utilities for serialization and contract interaction, designed for serverless and API route usage.

6 lines (5 loc) 41.7 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./sui-CTJDL6Rq.js"),Q=require("viem"),ke=require("@solana/web3.js"),Le=require("@solana/wallet-adapter-base");function _(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const $e="2.28.1";let C={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:s})=>t?`${e??"https://viem.sh"}${t}${s?`#${s}`:""}`:void 0,version:`viem@${$e}`};class h extends Error{constructor(t,s={}){var a;const n=(()=>{var c;return s.cause instanceof h?s.cause.details:(c=s.cause)!=null&&c.message?s.cause.message:s.details})(),i=s.cause instanceof h&&s.cause.docsPath||s.docsPath,r=(a=C.getDocsUrl)==null?void 0:a.call(C,{...s,docsPath:i}),o=[t||"An error occurred.","",...s.metaMessages?[...s.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...n?[`Details: ${n}`]:[],...C.version?[`Version: ${C.version}`]:[]].join(` `);super(o,s.cause?{cause:s.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=i,this.metaMessages=s.metaMessages,this.name=s.name??this.name,this.shortMessage=t,this.version=$e}walk(t){return Fe(this,t)}}function Fe(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Fe(e.cause,t):t?null:e}class ft extends h{constructor({max:t,min:s,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${s} to ${t})`:`(above ${s})`}`,{name:"IntegerOutOfRangeError"})}}class dt extends h{constructor({givenSize:t,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function N(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function k(e){return N(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function q(e,{dir:t="left"}={}){let s=typeof e=="string"?e.replace("0x",""):e,n=0;for(let i=0;i<s.length-1&&s[t==="left"?i:s.length-i-1].toString()==="0";i++)n++;return s=t==="left"?s.slice(n):s.slice(0,s.length-n),typeof e=="string"?(s.length===1&&t==="right"&&(s=`${s}0`),`0x${s.length%2===1?`0${s}`:s}`):s}class ht extends h{constructor({offset:t,position:s,size:n}){super(`Slice ${s==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class Ge extends h{constructor({size:t,targetSize:s,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}function L(e,{dir:t,size:s=32}={}){return typeof e=="string"?pt(e,{dir:t,size:s}):bt(e,{dir:t,size:s})}function pt(e,{dir:t,size:s=32}={}){if(s===null)return e;const n=e.replace("0x","");if(n.length>s*2)throw new Ge({size:Math.ceil(n.length/2),targetSize:s,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](s*2,"0")}`}function bt(e,{dir:t,size:s=32}={}){if(s===null)return e;if(e.length>s)throw new Ge({size:e.length,targetSize:s,type:"bytes"});const n=new Uint8Array(s);for(let i=0;i<s;i++){const r=t==="right";n[r?i:s-i-1]=e[r?i:e.length-i-1]}return n}const xt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function f(e,t={}){return typeof e=="number"||typeof e=="bigint"?He(e,t):typeof e=="string"?yt(e,t):typeof e=="boolean"?mt(e,t):v(e,t)}function mt(e,t={}){const s=`0x${Number(e)}`;return typeof t.size=="number"?($(s,{size:t.size}),L(s,{size:t.size})):s}function v(e,t={}){let s="";for(let i=0;i<e.length;i++)s+=xt[e[i]];const n=`0x${s}`;return typeof t.size=="number"?($(n,{size:t.size}),L(n,{dir:"right",size:t.size})):n}function He(e,t={}){const{signed:s,size:n}=t,i=BigInt(e);let r;n?s?r=(1n<<BigInt(n)*8n-1n)-1n:r=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof r=="bigint"&&s?-r-1n:0;if(r&&i>r||i<o){const c=typeof e=="bigint"?"n":"";throw new ft({max:r?`${r}${c}`:void 0,min:`${o}${c}`,signed:s,size:n,value:`${e}${c}`})}const a=`0x${(s&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?L(a,{size:n}):a}const gt=new TextEncoder;function yt(e,t={}){const s=gt.encode(e);return v(s,t)}const wt=new TextEncoder;function Ce(e,t={}){return typeof e=="number"||typeof e=="bigint"?Pt(e,t):typeof e=="boolean"?Bt(e,t):N(e)?I(e,t):Oe(e,t)}function Bt(e,t={}){const s=new Uint8Array(1);return s[0]=Number(e),typeof t.size=="number"?($(s,{size:t.size}),L(s,{size:t.size})):s}const w={zero:48,nine:57,A:65,F:70,a:97,f:102};function Be(e){if(e>=w.zero&&e<=w.nine)return e-w.zero;if(e>=w.A&&e<=w.F)return e-(w.A-10);if(e>=w.a&&e<=w.f)return e-(w.a-10)}function I(e,t={}){let s=e;t.size&&($(s,{size:t.size}),s=L(s,{dir:"right",size:t.size}));let n=s.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,r=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=Be(n.charCodeAt(a++)),u=Be(n.charCodeAt(a++));if(c===void 0||u===void 0)throw new h(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);r[o]=c*16+u}return r}function Pt(e,t){const s=He(e,t);return I(s)}function Oe(e,t={}){const s=wt.encode(e);return typeof t.size=="number"?($(s,{size:t.size}),L(s,{dir:"right",size:t.size})):s}function $(e,{size:t}){if(k(e)>t)throw new dt({givenSize:k(e),maxSize:t})}function T(e,t={}){const{signed:s}=t;t.size&&$(e,{size:t.size});const n=BigInt(e);if(!s)return n;const i=(e.length-2)/2,r=(1n<<BigInt(i)*8n-1n)-1n;return n<=r?n:n-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function Y(e,t={}){return Number(T(e,t))}function le(e,t){return({exclude:s,format:n})=>({exclude:s,format:i=>{const r=t(i);if(s)for(const o of s)delete r[o];return{...r,...n(i)}},type:e})}const De={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function fe(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Y(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?Y(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?De[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=Et(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const vt=le("transaction",fe);function Et(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function It(e){const t=(e.transactions??[]).map(s=>typeof s=="string"?s:fe(s));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 Ut=le("block",It);function zt(e,{args:t,eventName:s}={}){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,...s?{args:t,eventName:s}:{}}}const At={"0x0":"reverted","0x1":"success"};function St(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(s=>zt(s)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Y(e.transactionIndex):null,status:e.status?At[e.status]:null,type:e.type?De[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Tt=le("transactionReceipt",St),de=2n**256n-1n;function V(e){return`0x${e.reduce((t,s)=>t+s.replace("0x",""),"")}`}class Pe extends h{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class kt extends h{constructor({length:t,position:s}){super(`Position \`${s}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class Lt extends h{constructor({count:t,limit:s}){super(`Recursive read limit of \`${s}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const $t={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 Lt({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new kt({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Pe({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 Pe({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 s=t??this.position;return this.assertPosition(s+e-1),this.bytes.subarray(s,s+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,e&255),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 s=this.inspectBytes(e);return this.position+=t??e,s},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 _e(e,{recursiveReadLimit:t=8192}={}){const s=Object.create($t);return s.bytes=e,s.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),s.positionReadCount=new Map,s.recursiveReadLimit=t,s}function U(e,t="hex"){const s=Ne(e),n=_e(new Uint8Array(s.length));return s.encode(n),t==="hex"?v(n.bytes):n.bytes}function Ne(e){return Array.isArray(e)?Ft(e.map(t=>Ne(t))):Gt(e)}function Ft(e){const t=e.reduce((i,r)=>i+r.length,0),s=Ve(t);return{length:t<=55?1+t:1+s+t,encode(i){t<=55?i.pushByte(192+t):(i.pushByte(247+s),s===1?i.pushUint8(t):s===2?i.pushUint16(t):s===3?i.pushUint24(t):i.pushUint32(t));for(const{encode:r}of e)r(i)}}}function Gt(e){const t=typeof e=="string"?I(e):e,s=Ve(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+s+t.length,encode(i){t.length===1&&t[0]<128?i.pushBytes(t):t.length<=55?(i.pushByte(128+t.length),i.pushBytes(t)):(i.pushByte(183+s),s===1?i.pushUint8(t.length):s===2?i.pushUint16(t.length):s===3?i.pushUint24(t.length):i.pushUint32(t.length),i.pushBytes(t))}}}function Ve(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new h("Length is too large.")}const Ht={ether:-9,wei:9};function Ct(e,t){let s=e.toString();const n=s.startsWith("-");n&&(s=s.slice(1)),s=s.padStart(t,"0");let[i,r]=[s.slice(0,s.length-t),s.slice(s.length-t)];return r=r.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${r?`.${r}`:""}`}function ue(e,t="wei"){return Ct(e,Ht[t])}function Ot(e){const t=Object.entries(e).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),s=t.reduce((n,[i])=>Math.max(n,i.length),0);return t.map(([n,i])=>` ${`${n}:`.padEnd(s+1)} ${i}`).join(` `)}class Dt extends h{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class _t extends h{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ot(t),"}","","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 Nt extends h{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function Vt(e){if(!e||e.length===0)return[];const t=[];for(const s of e){const{chainId:n,nonce:i,...r}=s,o=s.address;t.push([n?f(n):"0x",o,i?f(i):"0x",...M({},r)])}return t}function Me(e){const{kzg:t}=e,s=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(r=>I(r)):e.blobs,i=[];for(const r of n)i.push(Uint8Array.from(t.blobToKzgCommitment(r)));return s==="bytes"?i:i.map(r=>v(r))}function je(e){const{kzg:t}=e,s=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(o=>I(o)):e.blobs,i=typeof e.commitments[0]=="string"?e.commitments.map(o=>I(o)):e.commitments,r=[];for(let o=0;o<n.length;o++){const a=n[o],c=i[o];r.push(Uint8Array.from(t.computeBlobKzgProof(a,c)))}return s==="bytes"?r:r.map(o=>v(o))}function ve(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Mt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function he(e,...t){if(!Mt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Z(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 Re(e,t){he(e);const s=t.outputLen;if(e.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ne(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function y(e,t){return e<<32-t|e>>>t}const Ee=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Rt(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Ie(e){for(let t=0;t<e.length;t++)e[t]=Rt(e[t])}typeof Uint8Array.from([]).toHex=="function"&&Uint8Array.fromHex;function Kt(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function pe(e){return typeof e=="string"&&(e=Kt(e)),he(e),e}class Ke{clone(){return this._cloneInto()}}function Xe(e){const t=n=>e().update(pe(n)).digest(),s=e();return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=()=>e(),t}function Xt(e,t,s,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,s,n);const i=BigInt(32),r=BigInt(4294967295),o=Number(s>>i&r),a=Number(s&r),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,a,n)}function Wt(e,t,s){return e&t^~e&s}function qt(e,t,s){return e&t^e&s^t&s}class Yt extends Ke{constructor(t,s,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=s,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(t),this.view=ne(this.buffer)}update(t){Z(this);const{view:s,buffer:n,blockLen:i}=this;t=pe(t);const r=t.length;for(let o=0;o<r;){const a=Math.min(i-this.pos,r-o);if(a===i){const c=ne(t);for(;i<=r-o;o+=i)this.process(c,o);continue}n.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Z(this),Re(t,this),this.finished=!0;const{buffer:s,view:n,blockLen:i,isLE:r}=this;let{pos:o}=this;s[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let l=o;l<i;l++)s[l]=0;Xt(n,i-8,BigInt(this.length*8),r),this.process(n,0);const a=ne(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)a.setUint32(4*l,d[l],r)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const n=t.slice(0,s);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:n,length:i,finished:r,destroyed:o,pos:a}=this;return t.length=i,t.pos=a,t.finished=r,t.destroyed=o,i%s&&t.buffer.set(n),t}}const Zt=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]),B=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),P=new Uint32Array(64);class Jt extends Yt{constructor(t=32){super(64,t,8,!1),this.A=B[0]|0,this.B=B[1]|0,this.C=B[2]|0,this.D=B[3]|0,this.E=B[4]|0,this.F=B[5]|0,this.G=B[6]|0,this.H=B[7]|0}get(){const{A:t,B:s,C:n,D:i,E:r,F:o,G:a,H:c}=this;return[t,s,n,i,r,o,a,c]}set(t,s,n,i,r,o,a,c){this.A=t|0,this.B=s|0,this.C=n|0,this.D=i|0,this.E=r|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,s){for(let l=0;l<16;l++,s+=4)P[l]=t.getUint32(s,!1);for(let l=16;l<64;l++){const b=P[l-15],p=P[l-2],F=y(b,7)^y(b,18)^b>>>3,S=y(p,17)^y(p,19)^p>>>10;P[l]=S+P[l-7]+F+P[l-16]|0}let{A:n,B:i,C:r,D:o,E:a,F:c,G:u,H:d}=this;for(let l=0;l<64;l++){const b=y(a,6)^y(a,11)^y(a,25),p=d+b+Wt(a,c,u)+Zt[l]+P[l]|0,S=(y(n,2)^y(n,13)^y(n,22))+qt(n,i,r)|0;d=u,u=c,c=a,a=o+p|0,o=r,r=i,i=n,n=p+S|0}n=n+this.A|0,i=i+this.B|0,r=r+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(n,i,r,o,a,c,u,d)}roundClean(){P.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Qt=Xe(()=>new Jt);function es(e,t){return Qt(N(e,{strict:!1})?Ce(e):e)}function ts(e){const{commitment:t,version:s=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),i=es(t);return i.set([s],0),n==="bytes"?i:v(i)}function ss(e){const{commitments:t,version:s}=e,n=e.to??(typeof t[0]=="string"?"hex":"bytes"),i=[];for(const r of t)i.push(ts({commitment:r,to:n,version:s}));return i}const Ue=6,We=32,be=4096,qe=We*be,ze=qe*Ue-1-1*be*Ue,Ye=1;class ns extends h{constructor({maxSize:t,size:s}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${s} bytes`],name:"BlobSizeTooLargeError"})}}class Ze extends h{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class is extends h{constructor({hash:t,size:s}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${s}`],name:"InvalidVersionedHashSizeError"})}}class rs extends h{constructor({hash:t,version:s}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Ye}`,`Received: ${s}`],name:"InvalidVersionedHashVersionError"})}}function os(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),s=typeof e.data=="string"?I(e.data):e.data,n=k(s);if(!n)throw new Ze;if(n>ze)throw new ns({maxSize:ze,size:n});const i=[];let r=!0,o=0;for(;r;){const a=_e(new Uint8Array(qe));let c=0;for(;c<be;){const u=s.slice(o,o+(We-1));if(a.pushByte(0),a.pushBytes(u),u.length<31){a.pushByte(128),r=!1;break}c++,o+=31}i.push(a)}return t==="bytes"?i.map(a=>a.bytes):i.map(a=>v(a.bytes))}function as(e){const{data:t,kzg:s,to:n}=e,i=e.blobs??os({data:t,to:n}),r=e.commitments??Me({blobs:i,kzg:s,to:n}),o=e.proofs??je({blobs:i,commitments:r,kzg:s,to:n}),a=[];for(let c=0;c<i.length;c++)a.push({blob:i[c],commitment:r[c],proof:o[c]});return a}class z extends h{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class ee extends h{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class te extends h{constructor({cause:t,maxFeePerGas:s}={}){super(`The fee cap (\`maxFeePerGas\`${s?` = ${ue(s)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(te,"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 Je extends h{constructor({cause:t,maxPriorityFeePerGas:s,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${s?` = ${ue(s)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${ue(n)} gwei`:""}).`].join(` `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Je,"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 Qe extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const s=super.get(t);return super.has(t)&&s!==void 0&&(this.delete(t),super.set(t,s)),s}set(t,s){if(super.set(t,s),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const R=BigInt(2**32-1),Ae=BigInt(32);function cs(e,t=!1){return t?{h:Number(e&R),l:Number(e>>Ae&R)}:{h:Number(e>>Ae&R)|0,l:Number(e&R)|0}}function us(e,t=!1){let s=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:r,l:o}=cs(e[i],t);[s[i],n[i]]=[r,o]}return[s,n]}const ls=(e,t,s)=>e<<s|t>>>32-s,fs=(e,t,s)=>t<<s|e>>>32-s,ds=(e,t,s)=>t<<s-32|e>>>64-s,hs=(e,t,s)=>e<<s-32|t>>>64-s,et=[],tt=[],st=[],ps=BigInt(0),O=BigInt(1),bs=BigInt(2),xs=BigInt(7),ms=BigInt(256),gs=BigInt(113);for(let e=0,t=O,s=1,n=0;e<24;e++){[s,n]=[n,(2*s+3*n)%5],et.push(2*(5*n+s)),tt.push((e+1)*(e+2)/2%64);let i=ps;for(let r=0;r<7;r++)t=(t<<O^(t>>xs)*gs)%ms,t&bs&&(i^=O<<(O<<BigInt(r))-O);st.push(i)}const[ys,ws]=us(st,!0),Se=(e,t,s)=>s>32?ds(e,t,s):ls(e,t,s),Te=(e,t,s)=>s>32?hs(e,t,s):fs(e,t,s);function Bs(e,t=24){const s=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let o=0;o<10;o++)s[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=s[c],d=s[c+1],l=Se(u,d,1)^s[a],b=Te(u,d,1)^s[a+1];for(let p=0;p<50;p+=10)e[o+p]^=l,e[o+p+1]^=b}let i=e[2],r=e[3];for(let o=0;o<24;o++){const a=tt[o],c=Se(i,r,a),u=Te(i,r,a),d=et[o];i=e[d],r=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)s[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~s[(a+2)%10]&s[(a+4)%10]}e[0]^=ys[n],e[1]^=ws[n]}s.fill(0)}class xe extends Ke{constructor(t,s,n,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=s,this.outputLen=n,this.enableXOF=i,this.rounds=r,ve(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=jt(this.state)}keccak(){Ee||Ie(this.state32),Bs(this.state32,this.rounds),Ee||Ie(this.state32),this.posOut=0,this.pos=0}update(t){Z(this);const{blockLen:s,state:n}=this;t=pe(t);const i=t.length;for(let r=0;r<i;){const o=Math.min(s-this.pos,i-r);for(let a=0;a<o;a++)n[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:n,blockLen:i}=this;t[n]^=s,(s&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){Z(this,!1),he(t),this.finish();const s=this.state,{blockLen:n}=this;for(let i=0,r=t.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);t.set(s.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ve(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Re(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:s,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return t||(t=new xe(s,n,i,o,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=n,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}const Ps=(e,t,s)=>Xe(()=>new xe(t,e,s)),vs=Ps(1,136,256/8);function Es(e,t){return vs(N(e,{strict:!1})?Ce(e):e)}const ie=new Qe(8192);function Is(e,t){if(ie.has(`${e}.${t}`))return ie.get(`${e}.${t}`);const s=e.substring(2).toLowerCase(),n=Es(Oe(s)),i=s.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const r=`0x${i.join("")}`;return ie.set(`${e}.${t}`,r),r}const Us=/^0x[a-fA-F0-9]{40}$/,re=new Qe(8192);function A(e,t){const{strict:s=!0}=t??{},n=`${e}.${s}`;if(re.has(n))return re.get(n);const i=Us.test(e)?e.toLowerCase()===e?!0:s?Is(e)===e:!0:!1;return re.set(n,i),i}function zs(e,t,s,{strict:n}={}){return N(e,{strict:!1})?Ss(e,t,s,{strict:n}):As(e,t,s,{strict:n})}function nt(e,t,s){if(k(e)!==s-t)throw new ht({offset:s,position:"end",size:k(e)})}function As(e,t,s,{strict:n}={}){const i=e.slice(t,s);return n&&nt(i,t,s),i}function Ss(e,t,s,{strict:n}={}){const i=`0x${e.replace("0x","").slice(t*2,s*2)}`;return n&&nt(i,t,s),i}function Ts(e){const{authorizationList:t}=e;if(t)for(const s of t){const{chainId:n}=s,i=s.address;if(!A(i))throw new z({address:i});if(n<0)throw new ee({chainId:n})}me(e)}function ks(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Ze;for(const s of t){const n=k(s),i=Y(zs(s,0,1));if(n!==32)throw new is({hash:s,size:n});if(i!==Ye)throw new rs({hash:s,version:i})}}me(e)}function me(e){const{chainId:t,maxPriorityFeePerGas:s,maxFeePerGas:n,to:i}=e;if(t<=0)throw new ee({chainId:t});if(i&&!A(i))throw new z({address:i});if(n&&n>de)throw new te({maxFeePerGas:n});if(s&&n&&s>n)throw new Je({maxFeePerGas:n,maxPriorityFeePerGas:s})}function Ls(e){const{chainId:t,maxPriorityFeePerGas:s,gasPrice:n,maxFeePerGas:i,to:r}=e;if(t<=0)throw new ee({chainId:t});if(r&&!A(r))throw new z({address:r});if(s||i)throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>de)throw new te({maxFeePerGas:n})}function $s(e){const{chainId:t,maxPriorityFeePerGas:s,gasPrice:n,maxFeePerGas:i,to:r}=e;if(r&&!A(r))throw new z({address:r});if(typeof t<"u"&&t<=0)throw new ee({chainId:t});if(s||i)throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>de)throw new te({maxFeePerGas:n})}function Fs(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new _t({transaction:e})}function se(e){if(!e||e.length===0)return[];const t=[];for(let s=0;s<e.length;s++){const{address:n,storageKeys:i}=e[s];for(let r=0;r<i.length;r++)if(i[r].length-2!==64)throw new Nt({storageKey:i[r]});if(!A(n,{strict:!1}))throw new z({address:n});t.push([n,i])}return t}function Gs(e,t){const s=Fs(e);return s==="eip1559"?Os(e,t):s==="eip2930"?Ds(e,t):s==="eip4844"?Cs(e,t):s==="eip7702"?Hs(e,t):_s(e,t)}function Hs(e,t){const{authorizationList:s,chainId:n,gas:i,nonce:r,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:l}=e;Ts(e);const b=se(d),p=Vt(s);return V(["0x04",U([f(n),r?f(r):"0x",u?f(u):"0x",c?f(c):"0x",i?f(i):"0x",o??"0x",a?f(a):"0x",l??"0x",b,p,...M(e,t)])])}function Cs(e,t){const{chainId:s,gas:n,nonce:i,to:r,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:l}=e;ks(e);let b=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(typeof b>"u"||typeof p>"u")){const E=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(H=>v(H)),j=e.kzg,G=Me({blobs:E,kzg:j});if(typeof b>"u"&&(b=ss({commitments:G})),typeof p>"u"){const H=je({blobs:E,commitments:G,kzg:j});p=as({blobs:E,commitments:G,proofs:H})}}const F=se(d),S=[f(s),i?f(i):"0x",u?f(u):"0x",c?f(c):"0x",n?f(n):"0x",r??"0x",o?f(o):"0x",l??"0x",F,a?f(a):"0x",b??[],...M(e,t)],ge=[],ye=[],we=[];if(p)for(let E=0;E<p.length;E++){const{blob:j,commitment:G,proof:H}=p[E];ge.push(j),ye.push(G),we.push(H)}return V(["0x03",U(p?[S,ge,ye,we]:S)])}function Os(e,t){const{chainId:s,gas:n,nonce:i,to:r,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:d}=e;me(e);const l=se(u),b=[f(s),i?f(i):"0x",c?f(c):"0x",a?f(a):"0x",n?f(n):"0x",r??"0x",o?f(o):"0x",d??"0x",l,...M(e,t)];return V(["0x02",U(b)])}function Ds(e,t){const{chainId:s,gas:n,data:i,nonce:r,to:o,value:a,accessList:c,gasPrice:u}=e;Ls(e);const d=se(c),l=[f(s),r?f(r):"0x",u?f(u):"0x",n?f(n):"0x",o??"0x",a?f(a):"0x",i??"0x",d,...M(e,t)];return V(["0x01",U(l)])}function _s(e,t){const{chainId:s=0,gas:n,data:i,nonce:r,to:o,value:a,gasPrice:c}=e;$s(e);let u=[r?f(r):"0x",c?f(c):"0x",n?f(n):"0x",o??"0x",a?f(a):"0x",i??"0x"];if(t){const d=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(s>0)return BigInt(s*2)+BigInt(35n+t.v-27n);const p=27n+(t.v===27n?0n:1n);if(t.v!==p)throw new Dt({v:t.v});return p})(),l=q(t.r),b=q(t.s);u=[...u,f(d),l==="0x00"?"0x":l,b==="0x00"?"0x":b]}else s>0&&(u=[...u,f(s),"0x","0x"]);return U(u)}function M(e,t){const s=t??e,{v:n,yParity:i}=s;if(typeof s.r>"u")return[];if(typeof s.s>"u")return[];if(typeof n>"u"&&typeof i>"u")return[];const r=q(s.r),o=q(s.s);return[typeof i=="number"?i?f(1):"0x":n===0n?"0x":n===1n?f(1):n===27n?"0x":f(1),r==="0x00"?"0x":r,o==="0x00"?"0x":o]}const Ns={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},Vs={block:Ut({format(e){var s;return{transactions:(s=e.transactions)==null?void 0:s.map(n=>{if(typeof n=="string")return n;const i=fe(n);return i.typeHex==="0x7e"&&(i.isSystemTx=n.isSystemTx,i.mint=n.mint?T(n.mint):void 0,i.sourceHash=n.sourceHash,i.type="deposit"),i}),stateRoot:e.stateRoot}}}),transaction:vt({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?T(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Tt({format(e){return{l1GasPrice:e.l1GasPrice?T(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?T(e.l1GasUsed):null,l1Fee:e.l1Fee?T(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function Ms(e,t){return Ks(e)?Rs(e):Gs(e,t)}const js={transaction:Ms};function Rs(e){Xs(e);const{sourceHash:t,data:s,from:n,gas:i,isSystemTx:r,mint:o,to:a,value:c}=e,u=[t,n,a??"0x",o?f(o):"0x",c?f(c):"0x",i?f(i):"0x",r?"0x1":"0x",s??"0x"];return V(["0x7e",U(u)])}function Ks(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function Xs(e){const{from:t,to:s}=e;if(t&&!A(t))throw new z({address:t});if(s&&!A(s))throw new z({address:s})}const J={contracts:Ns,formatters:Vs,serializers:js},D=1,oe=_({...J,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:{...J.contracts,disputeGameFactory:{[D]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[D]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[D]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[D]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:D}),K=_({id:56,name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),X=_({id:97,name:"Binance Smart Chain Testnet",nativeCurrency:{decimals:18,name:"BNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]}},blockExplorers:{default:{name:"BscScan",url:"https://testnet.bscscan.com",apiUrl:"https://api-testnet.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:17422483}},testnet:!0}),ae=_({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),W=11155111,ce=_({...J,id:1301,name:"Unichain Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.unichain.org"]}},blockExplorers:{default:{name:"Uniscan",url:"https://sepolia.uniscan.xyz",apiUrl:"https://api-sepolia.uniscan.xyz/api"}},contracts:{...J.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},portal:{[W]:{address:"0x0d83dab629f0e0F9d36c0Cbc89B69a489f0751bD"}},l1StandardBridge:{[W]:{address:"0xea58fcA6849d79EAd1f26608855c2D6407d54Ce2"}},disputeGameFactory:{[W]:{address:"0xeff73e5aa3B9AEC32c659Aa3E00444d20a84394b"}}},testnet:!0,sourceId:W});var m=(e=>(e.eth="eth",e.uni="uni",e.base="base",e.bsc="bsc",e.tbsc="tbsc",e.sol="sol",e.solDevnet="tsol",e.sui="sui",e.suiDevnet="tsui",e.ton="ton",e.tonDevnet="tton",e))(m||{}),g=(e=>(e[e.eth=1]="eth",e[e.uni=130]="uni",e[e.base=8453]="base",e[e.bsc=56]="bsc",e[e.tbsc=97]="tbsc",e[e.sol=501]="sol",e[e.solDevnet=5011]="solDevnet",e[e.sui=784]="sui",e[e.suiDevnet=7841]="suiDevnet",e[e.ton=461]="ton",e[e.tonDevnet=4611]="tonDevnet",e))(g||{});const it={...ae,id:g.eth,symbol:m.eth,logo:x.f,network:x.networkEth,blockExplorers:{...ae.blockExplorers,default:{...ae.blockExplorers.default,hash:"https://etherscan.io/tx/{{addr}}",address:"https://etherscan.io/address/{{addr}}"}}},rt={...K,id:g.bsc,symbol:m.bsc,logo:x.Z,network:x.networkEth,rpcUrls:{default:{http:[K.rpcUrls.default.http[0],"https://bsc.blockpi.network/v1/rpc/32cdfa234a4a17abbb8e3f23bc6410a9b7d47cb3"]}},blockExplorers:{...K.blockExplorers,default:{...K.blockExplorers.default,hash:"https://bscscan.com/tx/{{addr}}",address:"https://bscscan.com/address/{{addr}}"}}},ot={...X,id:g.tbsc,symbol:m.tbsc,logo:x.Z,network:x.networkEth,rpcUrls:{default:{http:["https://bsc-testnet-rpc.publicnode.com",...X.rpcUrls.default.http],webSocket:["wss://bsc-testnet-rpc.publicnode.com","wss://bsc-testnet.blockpi.network/v1/ws/cd61e00aed93674ae0d608f823e2c2d05a52752d"]}},blockExplorers:{...X.blockExplorers,default:{...X.blockExplorers.default,hash:"https://testnet.bscscan.com/tx/{{addr}}",address:"https://testnet.bscscan.com/address/{{addr}}"}}},at={...ce,id:g.uni,symbol:m.uni,logo:x.X,network:x.networkEth,blockExplorers:{...ce.blockExplorers,default:{...ce.blockExplorers.default,hash:"https://explorer.unichain.io/tx/{{addr}}",address:"https://explorer.unichain.io/address/{{addr}}"}}},ct={...oe,id:g.base,symbol:m.base,logo:x.t,network:x.networkEth,blockExplorers:{...oe.blockExplorers,default:{...oe.blockExplorers.default,hash:"https://basescan.org/tx/{{addr}}",address:"https://basescan.org/address/{{addr}}"}}},ut=Q.defineChain({id:g.sol,symbol:m.sol,name:"Solana",logo:x.p,network:x.networkSol,nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:[ke.clusterApiUrl(Le.WalletAdapterNetwork.Mainnet)]}},blockExplorers:{default:{name:"Solscan",url:"https://explorer.solana.com",hash:"https://solscan.io/tx/{{addr}}",address:"https://solscan.io/account/{{addr}}"}}}),lt=Q.defineChain({id:g.solDevnet,symbol:m.solDevnet,name:"Solana Devnet",logo:x.p,network:x.networkSol,nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:[ke.clusterApiUrl(Le.WalletAdapterNetwork.Devnet),"https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://explorer.solana.com",hash:"https://solscan.io/tx/{{addr}}?cluster=devnet",address:"https://solscan.io/account/{{addr}}?cluster=devnet"},solana:{name:"Solana Explorer",url:"https://explorer.solana.com",hash:"https://solscan.io/tx/{{addr}}?cluster=devnet",address:"https://solscan.io/account/{{addr}}?cluster=devnet"}},testnet:!0}),Ws=Q.defineChain({id:g.sui,symbol:m.sui,name:"Sui",logo:x.P,network:x.networkSui,nativeCurrency:{name:"Sui",symbol:"SUI",decimals:9},rpcUrls:{default:{http:["https://fullnode.mainnet.sui.io"]}},blockExplorers:{default:{name:"Suiexplorer",url:"https://suiexplorer.com",hash:"https://suiexplorer.com/tx/{{addr}}",address:"https://suiexplorer.com/address/{{addr}}"}},testnet:!1}),qs=Q.defineChain({id:g.suiDevnet,symbol:m.suiDevnet,name:"Sui Devnet",logo:x.P,network:x.networkSui,nativeCurrency:{name:"Sui",symbol:"SUI",decimals:9},rpcUrls:{default:{http:["https://fullnode.devnet.sui.io"]}},blockExplorers:{default:{name:"Suiexplorer",url:"https://suiexplorer.com",hash:"https://suiexplorer.com/tx/{{addr}}",address:"https://suiexplorer.com/address/{{addr}}"}},testnet:!0}),Ys=process.env.NEXT_PUBLIC_APP_ENV==="mainnet",Zs=[ot,rt,ct,it,at,ut,lt];exports.AllChains=Zs;exports.ChainIds=g;exports.ChainSymbols=m;exports.chainBSC=rt;exports.chainBSCTestnet=ot;exports.chainBase=ct;exports.chainEth=it;exports.chainSol=ut;exports.chainSolDevnet=lt;exports.chainSui=Ws;exports.chainSuiDevnet=qs;exports.chainUni=at;exports.isMainnet=Ys; //# sourceMappingURL=chains.cjs.map