wallet-engine-lib
Version:
Professional, reusable wallet UI components with Gelato SDK integration. Enterprise-grade React components for building smart wallet applications.
100 lines • 70.2 kB
JavaScript
(function(v,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(v=typeof globalThis<"u"?globalThis:v||self,m(v.WalletEngineLib={},v.React))})(this,(function(v,m){"use strict";var de={exports:{}},Q={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var He;function Wt(){if(He)return Q;He=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(n,r,i){var a=null;if(i!==void 0&&(a=""+i),r.key!==void 0&&(a=""+r.key),"key"in r){i={};for(var l in r)l!=="key"&&(i[l]=r[l])}else i=r;return r=i.ref,{$$typeof:e,type:n,key:a,ref:r!==void 0?r:null,props:i}}return Q.Fragment=t,Q.jsx=s,Q.jsxs=s,Q}var ee={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Me;function qt(){return Me||(Me=1,process.env.NODE_ENV!=="production"&&(function(){function e(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===ir?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case j:return"Fragment";case $:return"Profiler";case _:return"StrictMode";case U:return"Suspense";case P:return"SuspenseList";case ze:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case k:return"Portal";case y:return(c.displayName||"Context")+".Provider";case h:return(c._context.displayName||"Context")+".Consumer";case C:var p=c.render;return c=c.displayName,c||(c=p.displayName||p.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case T:return p=c.displayName||null,p!==null?p:e(c.type)||"Memo";case z:p=c._payload,c=c._init;try{return e(c(p))}catch{}}return null}function t(c){return""+c}function s(c){try{t(c);var p=!1}catch{p=!0}if(p){p=console;var E=p.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return E.call(p,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),t(c)}}function n(c){if(c===j)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===z)return"<...>";try{var p=e(c);return p?"<"+p+">":"<...>"}catch{return"<...>"}}function r(){var c=Le.A;return c===null?null:c.getOwner()}function i(){return Error("react-stack-top-frame")}function a(c){if(Ht.call(c,"key")){var p=Object.getOwnPropertyDescriptor(c,"key").get;if(p&&p.isReactWarning)return!1}return c.key!==void 0}function l(c,p){function E(){Mt||(Mt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",p))}E.isReactWarning=!0,Object.defineProperty(c,"key",{get:E,configurable:!0})}function d(){var c=e(this.type);return Dt[c]||(Dt[c]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),c=this.props.ref,c!==void 0?c:null}function u(c,p,E,I,M,L,Ue,Oe){return E=L.ref,c={$$typeof:g,type:c,key:p,props:L,_owner:M},(E!==void 0?E:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:d}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Oe}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function x(c,p,E,I,M,L,Ue,Oe){var A=p.children;if(A!==void 0)if(I)if(or(A)){for(I=0;I<A.length;I++)f(A[I]);Object.freeze&&Object.freeze(A)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(A);if(Ht.call(p,"key")){A=e(c);var Z=Object.keys(p).filter(function(ar){return ar!=="key"});I=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",Yt[A+I]||(Z=0<Z.length?"{"+Z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,I,A,Z,A),Yt[A+I]=!0)}if(A=null,E!==void 0&&(s(E),A=""+E),a(p)&&(s(p.key),A=""+p.key),"key"in p){E={};for(var Ge in p)Ge!=="key"&&(E[Ge]=p[Ge])}else E=p;return A&&l(E,typeof c=="function"?c.displayName||c.name||"Unknown":c),u(c,A,L,M,r(),E,Ue,Oe)}function f(c){typeof c=="object"&&c!==null&&c.$$typeof===g&&c._store&&(c._store.validated=1)}var w=m,g=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),y=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),ze=Symbol.for("react.activity"),ir=Symbol.for("react.client.reference"),Le=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ht=Object.prototype.hasOwnProperty,or=Array.isArray,Fe=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(c){return c()}};var Mt,Dt={},Rt=w.react_stack_bottom_frame.bind(w,i)(),Vt=Fe(n(i)),Yt={};ee.Fragment=j,ee.jsx=function(c,p,E,I,M){var L=1e4>Le.recentlyCreatedOwnerStacks++;return x(c,p,E,!1,I,M,L?Error("react-stack-top-frame"):Rt,L?Fe(n(c)):Vt)},ee.jsxs=function(c,p,E,I,M){var L=1e4>Le.recentlyCreatedOwnerStacks++;return x(c,p,E,!0,I,M,L?Error("react-stack-top-frame"):Rt,L?Fe(n(c)):Vt)}})()),ee}var De;function Xt(){return De||(De=1,process.env.NODE_ENV==="production"?de.exports=Wt():de.exports=qt()),de.exports}var o=Xt();const Re=(e,t=6)=>!e||e.length<10?e:`${e.slice(0,t)}...${e.slice(-t)}`,we=e=>/^0x[a-fA-F0-9]{40}$/.test(e),Kt=e=>({1:{name:"Ethereum Mainnet",explorer:"https://etherscan.io"},11155111:{name:"Sepolia Testnet",explorer:"https://sepolia.etherscan.io"},84532:{name:"Base Sepolia Testnet",explorer:"https://sepolia.basescan.org"}})[e]||{name:`Chain ${e}`,explorer:""};/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,n)=>n?n.toUpperCase():s.toLowerCase()),Ve=e=>{const t=Zt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ye=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim(),Qt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var es={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ts=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:r="",children:i,iconNode:a,...l},d)=>m.createElement("svg",{ref:d,...es,width:t,height:t,stroke:e,strokeWidth:n?Number(s)*24/Number(t):s,className:Ye("lucide",r),...!i&&!Qt(l)&&{"aria-hidden":"true"},...l},[...a.map(([u,x])=>m.createElement(u,x)),...Array.isArray(i)?i:[i]]));/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const S=(e,t)=>{const s=m.forwardRef(({className:n,...r},i)=>m.createElement(ts,{ref:i,iconNode:t,className:Ye(`lucide-${Jt(Ve(e))}`,`lucide-${e}`,n),...r}));return s.displayName=Ve(e),s};/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const We=S("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qe=S("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xe=S("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ss=S("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ue=S("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ke=S("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Je=S("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ze=S("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const te=S("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ns=S("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.541.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qe=S("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),rs=m.memo(({smartWalletAddress:e,isConnected:t,chainId:s,className:n="",onAddressCopied:r})=>{const[i,a]=m.useState(!1),l=m.useCallback(async()=>{if(e)try{await navigator.clipboard.writeText(e),a(!0),r?.(e),setTimeout(()=>a(!1),2e3)}catch(u){console.error("Failed to copy address:",u)}},[e,r]),d=m.useCallback(()=>{if(!(!e||!s))try{const u=`https://sepolia.inkonchain.com/address/${e}`;window.open(u,"_blank","noopener,noreferrer")}catch(u){console.error("Failed to open explorer:",u)}},[e,s]);return!t||!e?null:o.jsx("div",{className:`bg-white/5 backdrop-blur-sm rounded-xl p-4 sm:p-6 ${n}`,children:o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx("span",{className:"text-xs sm:text-sm text-gray-400",children:"Address"}),o.jsxs("button",{onClick:l,className:"flex items-center gap-2 sm:gap-3 text-xs sm:text-sm text-blue-400 hover:text-blue-300 transition-colors break-all sm:break-normal",children:[i?o.jsx(We,{size:12,className:"sm:w-3.5 sm:h-3.5"}):o.jsx(Je,{size:12,className:"sm:w-3.5 sm:h-3.5"}),o.jsx("span",{className:"truncate",children:Re(e)})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx("span",{className:"text-xs sm:text-sm text-gray-400",children:"Network"}),o.jsx("span",{className:"text-xs sm:text-sm text-white",children:"INK Sepolia"})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx("span",{className:"text-xs sm:text-sm text-gray-400",children:"Status"}),o.jsx("span",{className:"text-xs sm:text-sm text-green-400",children:"Connected"})]}),o.jsxs("button",{onClick:d,className:"flex items-center gap-2 text-xs sm:text-sm text-blue-400 hover:text-blue-300 transition-colors w-full sm:w-auto justify-center sm:justify-start",children:[o.jsx(Ze,{size:12,className:"sm:w-3.5 sm:h-3.5"}),o.jsx("span",{className:"sm:hidden",children:"View Explorer"}),o.jsx("span",{className:"hidden sm:inline",children:"View on Explorer"})]})]})})});function ve(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const et="2.34.0";let Ne={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:s})=>t?`${e??"https://viem.sh"}${t}${s?`#${s}`:""}`:void 0,version:`viem@${et}`};class N extends Error{constructor(t,s={}){const n=s.cause instanceof N?s.cause.details:s.cause?.message?s.cause.message:s.details,r=s.cause instanceof N&&s.cause.docsPath||s.docsPath,i=Ne.getDocsUrl?.({...s,docsPath:r}),a=[t||"An error occurred.","",...s.metaMessages?[...s.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...n?[`Details: ${n}`]:[],...Ne.version?[`Version: ${Ne.version}`]:[]].join(`
`);super(a,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=r,this.metaMessages=s.metaMessages,this.name=s.name??this.name,this.shortMessage=t,this.version=et}walk(t){return tt(this,t)}}function tt(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?tt(e.cause,t):t?null:e}class is extends N{constructor({max:t,min:s,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${r*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${s} to ${t})`:`(above ${s})`}`,{name:"IntegerOutOfRangeError"})}}class os extends N{constructor({givenSize:t,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function se(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function q(e){return se(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function fe(e,{dir:t="left"}={}){let s=typeof e=="string"?e.replace("0x",""):e,n=0;for(let r=0;r<s.length-1&&s[t==="left"?r:s.length-r-1].toString()==="0";r++)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 as extends N{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 st extends N{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 X(e,{dir:t,size:s=32}={}){return typeof e=="string"?ls(e,{dir:t,size:s}):cs(e,{dir:t,size:s})}function ls(e,{dir:t,size:s=32}={}){if(s===null)return e;const n=e.replace("0x","");if(n.length>s*2)throw new st({size:Math.ceil(n.length/2),targetSize:s,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](s*2,"0")}`}function cs(e,{dir:t,size:s=32}={}){if(s===null)return e;if(e.length>s)throw new st({size:e.length,targetSize:s,type:"bytes"});const n=new Uint8Array(s);for(let r=0;r<s;r++){const i=t==="right";n[i?r:s-r-1]=e[i?r:e.length-r-1]}return n}const ds=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ne(e,t={}){return typeof e=="number"||typeof e=="bigint"?b(e,t):typeof e=="string"?hs(e,t):typeof e=="boolean"?us(e,t):O(e,t)}function us(e,t={}){const s=`0x${Number(e)}`;return typeof t.size=="number"?(K(s,{size:t.size}),X(s,{size:t.size})):s}function O(e,t={}){let s="";for(let r=0;r<e.length;r++)s+=ds[e[r]];const n=`0x${s}`;return typeof t.size=="number"?(K(n,{size:t.size}),X(n,{dir:"right",size:t.size})):n}function b(e,t={}){const{signed:s,size:n}=t,r=BigInt(e);let i;n?s?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof i=="bigint"&&s?-i-1n:0;if(i&&r>i||r<a){const d=typeof e=="bigint"?"n":"";throw new is({max:i?`${i}${d}`:void 0,min:`${a}${d}`,signed:s,size:n,value:`${e}${d}`})}const l=`0x${(s&&r<0?(1n<<BigInt(n*8))+BigInt(r):r).toString(16)}`;return n?X(l,{size:n}):l}const fs=new TextEncoder;function hs(e,t={}){const s=fs.encode(e);return O(s,t)}const ms=new TextEncoder;function nt(e,t={}){return typeof e=="number"||typeof e=="bigint"?ps(e,t):typeof e=="boolean"?xs(e,t):se(e)?D(e,t):it(e,t)}function xs(e,t={}){const s=new Uint8Array(1);return s[0]=Number(e),typeof t.size=="number"?(K(s,{size:t.size}),X(s,{size:t.size})):s}const F={zero:48,nine:57,A:65,F:70,a:97,f:102};function rt(e){if(e>=F.zero&&e<=F.nine)return e-F.zero;if(e>=F.A&&e<=F.F)return e-(F.A-10);if(e>=F.a&&e<=F.f)return e-(F.a-10)}function D(e,t={}){let s=e;t.size&&(K(s,{size:t.size}),s=X(s,{dir:"right",size:t.size}));let n=s.slice(2);n.length%2&&(n=`0${n}`);const r=n.length/2,i=new Uint8Array(r);for(let a=0,l=0;a<r;a++){const d=rt(n.charCodeAt(l++)),u=rt(n.charCodeAt(l++));if(d===void 0||u===void 0)throw new N(`Invalid byte sequence ("${n[l-2]}${n[l-1]}" in "${n}").`);i[a]=d*16+u}return i}function ps(e,t){const s=b(e,t);return D(s)}function it(e,t={}){const s=ms.encode(e);return typeof t.size=="number"?(K(s,{size:t.size}),X(s,{dir:"right",size:t.size})):s}function K(e,{size:t}){if(q(e)>t)throw new os({givenSize:q(e),maxSize:t})}function J(e,t={}){const{signed:s}=t;t.size&&K(e,{size:t.size});const n=BigInt(e);if(!s)return n;const r=(e.length-2)/2,i=(1n<<BigInt(r)*8n-1n)-1n;return n<=i?n:n-BigInt(`0x${"f".padStart(r*2,"f")}`)-1n}function he(e,t={}){return Number(J(e,t))}function Ee(e,t){return({exclude:s,format:n})=>({exclude:s,format:r=>{const i=t(r);if(s)for(const a of s)delete i[a];return{...i,...n(r)}},type:e})}const ot={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function je(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?he(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?he(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?ot[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=gs(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 bs=Ee("transaction",je);function gs(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 ys(e){const t=(e.transactions??[]).map(s=>typeof s=="string"?s:je(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 ws=Ee("block",ys);function vs(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 Ns={"0x0":"reverted","0x1":"success"};function Es(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=>vs(s)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?he(e.transactionIndex):null,status:e.status?Ns[e.status]:null,type:e.type?ot[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const js=Ee("transactionReceipt",Es),Pe=2n**256n-1n;function re(e){return`0x${e.reduce((t,s)=>t+s.replace("0x",""),"")}`}class at extends N{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Ps extends N{constructor({length:t,position:s}){super(`Position \`${s}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class ks extends N{constructor({count:t,limit:s}){super(`Recursive read limit of \`${s}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const Ts={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 ks({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Ps({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new at({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 at({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 lt(e,{recursiveReadLimit:t=8192}={}){const s=Object.create(Ts);return s.bytes=e,s.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),s.positionReadCount=new Map,s.recursiveReadLimit=t,s}function R(e,t="hex"){const s=ct(e),n=lt(new Uint8Array(s.length));return s.encode(n),t==="hex"?O(n.bytes):n.bytes}function ct(e){return Array.isArray(e)?Is(e.map(t=>ct(t))):As(e)}function Is(e){const t=e.reduce((r,i)=>r+i.length,0),s=dt(t);return{length:t<=55?1+t:1+s+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+s),s===1?r.pushUint8(t):s===2?r.pushUint16(t):s===3?r.pushUint24(t):r.pushUint32(t));for(const{encode:i}of e)i(r)}}}function As(e){const t=typeof e=="string"?D(e):e,s=dt(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+s+t.length,encode(r){t.length===1&&t[0]<128?r.pushBytes(t):t.length<=55?(r.pushByte(128+t.length),r.pushBytes(t)):(r.pushByte(183+s),s===1?r.pushUint8(t.length):s===2?r.pushUint16(t.length):s===3?r.pushUint24(t.length):r.pushUint32(t.length),r.pushBytes(t))}}}function dt(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 N("Length is too large.")}const _s={ether:-9,wei:9};function Cs(e,t){let s=e.toString();const n=s.startsWith("-");n&&(s=s.slice(1)),s=s.padStart(t,"0");let[r,i]=[s.slice(0,s.length-t),s.slice(s.length-t)];return i=i.replace(/(0+)$/,""),`${n?"-":""}${r||"0"}${i?`.${i}`:""}`}function ke(e,t="wei"){return Cs(e,_s[t])}function Ss(e){const t=Object.entries(e).map(([n,r])=>r===void 0||r===!1?null:[n,r]).filter(Boolean),s=t.reduce((n,[r])=>Math.max(n,r.length),0);return t.map(([n,r])=>` ${`${n}:`.padEnd(s+1)} ${r}`).join(`
`)}class Bs extends N{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class $s extends N{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ss(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 zs extends N{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 Ls(e){if(!e||e.length===0)return[];const t=[];for(const s of e){const{chainId:n,nonce:r,...i}=s,a=s.address;t.push([n?ne(n):"0x",a,r?ne(r):"0x",...le({},i)])}return t}function ut(e){const{kzg:t}=e,s=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(i=>D(i)):e.blobs,r=[];for(const i of n)r.push(Uint8Array.from(t.blobToKzgCommitment(i)));return s==="bytes"?r:r.map(i=>O(i))}function ft(e){const{kzg:t}=e,s=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(a=>D(a)):e.blobs,r=typeof e.commitments[0]=="string"?e.commitments.map(a=>D(a)):e.commitments,i=[];for(let a=0;a<n.length;a++){const l=n[a],d=r[a];i.push(Uint8Array.from(t.computeBlobKzgProof(l,d)))}return s==="bytes"?i:i.map(a=>O(a))}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Fs(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ht(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ie(e,...t){if(!Fs(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 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 mt(e,t){ie(e);const s=t.outputLen;if(e.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function Us(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function oe(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Te(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function B(e,t){return e<<32-t|e>>>t}const Os=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Gs(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Hs(e){for(let t=0;t<e.length;t++)e[t]=Gs(e[t]);return e}const xt=Os?e=>e:Hs;function Ms(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ie(e){return typeof e=="string"&&(e=Ms(e)),ie(e),e}class pt{}function bt(e){const t=n=>e().update(Ie(n)).digest(),s=e();return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=()=>e(),t}function Ds(e,t,s,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,s,n);const r=BigInt(32),i=BigInt(4294967295),a=Number(s>>r&i),l=Number(s&i),d=n?4:0,u=n?0:4;e.setUint32(t+d,a,n),e.setUint32(t+u,l,n)}function Rs(e,t,s){return e&t^~e&s}function Vs(e,t,s){return e&t^e&s^t&s}class Ys extends pt{constructor(t,s,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=s,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(t),this.view=Te(this.buffer)}update(t){me(this),t=Ie(t),ie(t);const{view:s,buffer:n,blockLen:r}=this,i=t.length;for(let a=0;a<i;){const l=Math.min(r-this.pos,i-a);if(l===r){const d=Te(t);for(;r<=i-a;a+=r)this.process(d,a);continue}n.set(t.subarray(a,a+l),this.pos),this.pos+=l,a+=l,this.pos===r&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){me(this),mt(t,this),this.finished=!0;const{buffer:s,view:n,blockLen:r,isLE:i}=this;let{pos:a}=this;s[a++]=128,oe(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let f=a;f<r;f++)s[f]=0;Ds(n,r-8,BigInt(this.length*8),i),this.process(n,0);const l=Te(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=d/4,x=this.get();if(u>x.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,x[f],i)}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:r,finished:i,destroyed:a,pos:l}=this;return t.destroyed=a,t.finished=i,t.length=r,t.pos=l,r%s&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const G=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),xe=BigInt(2**32-1),gt=BigInt(32);function Ws(e,t=!1){return t?{h:Number(e&xe),l:Number(e>>gt&xe)}:{h:Number(e>>gt&xe)|0,l:Number(e&xe)|0}}function qs(e,t=!1){const s=e.length;let n=new Uint32Array(s),r=new Uint32Array(s);for(let i=0;i<s;i++){const{h:a,l}=Ws(e[i],t);[n[i],r[i]]=[a,l]}return[n,r]}const Xs=(e,t,s)=>e<<s|t>>>32-s,Ks=(e,t,s)=>t<<s|e>>>32-s,Js=(e,t,s)=>t<<s-32|e>>>64-s,Zs=(e,t,s)=>e<<s-32|t>>>64-s,Qs=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),H=new Uint32Array(64);class en extends Ys{constructor(t=32){super(64,t,8,!1),this.A=G[0]|0,this.B=G[1]|0,this.C=G[2]|0,this.D=G[3]|0,this.E=G[4]|0,this.F=G[5]|0,this.G=G[6]|0,this.H=G[7]|0}get(){const{A:t,B:s,C:n,D:r,E:i,F:a,G:l,H:d}=this;return[t,s,n,r,i,a,l,d]}set(t,s,n,r,i,a,l,d){this.A=t|0,this.B=s|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=l|0,this.H=d|0}process(t,s){for(let f=0;f<16;f++,s+=4)H[f]=t.getUint32(s,!1);for(let f=16;f<64;f++){const w=H[f-15],g=H[f-2],k=B(w,7)^B(w,18)^w>>>3,j=B(g,17)^B(g,19)^g>>>10;H[f]=j+H[f-7]+k+H[f-16]|0}let{A:n,B:r,C:i,D:a,E:l,F:d,G:u,H:x}=this;for(let f=0;f<64;f++){const w=B(l,6)^B(l,11)^B(l,25),g=x+w+Rs(l,d,u)+Qs[f]+H[f]|0,j=(B(n,2)^B(n,13)^B(n,22))+Vs(n,r,i)|0;x=u,u=d,d=l,l=a+g|0,a=i,i=r,r=n,n=g+j|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,l=l+this.E|0,d=d+this.F|0,u=u+this.G|0,x=x+this.H|0,this.set(n,r,i,a,l,d,u,x)}roundClean(){oe(H)}destroy(){this.set(0,0,0,0,0,0,0,0),oe(this.buffer)}}const tn=bt(()=>new en);function sn(e,t){return tn(se(e,{strict:!1})?nt(e):e)}function nn(e){const{commitment:t,version:s=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),r=sn(t);return r.set([s],0),n==="bytes"?r:O(r)}function rn(e){const{commitments:t,version:s}=e,n=e.to??(typeof t[0]=="string"?"hex":"bytes"),r=[];for(const i of t)r.push(nn({commitment:i,to:n,version:s}));return r}const yt=6,wt=32,Ae=4096,vt=wt*Ae,Nt=vt*yt-1-1*Ae*yt,Et=1;class on extends N{constructor({maxSize:t,size:s}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${s} bytes`],name:"BlobSizeTooLargeError"})}}class jt extends N{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class an extends N{constructor({hash:t,size:s}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${s}`],name:"InvalidVersionedHashSizeError"})}}class ln extends N{constructor({hash:t,version:s}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Et}`,`Received: ${s}`],name:"InvalidVersionedHashVersionError"})}}function cn(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),s=typeof e.data=="string"?D(e.data):e.data,n=q(s);if(!n)throw new jt;if(n>Nt)throw new on({maxSize:Nt,size:n});const r=[];let i=!0,a=0;for(;i;){const l=lt(new Uint8Array(vt));let d=0;for(;d<Ae;){const u=s.slice(a,a+(wt-1));if(l.pushByte(0),l.pushBytes(u),u.length<31){l.pushByte(128),i=!1;break}d++,a+=31}r.push(l)}return t==="bytes"?r.map(l=>l.bytes):r.map(l=>O(l.bytes))}function dn(e){const{data:t,kzg:s,to:n}=e,r=e.blobs??cn({data:t,to:n}),i=e.commitments??ut({blobs:r,kzg:s,to:n}),a=e.proofs??ft({blobs:r,commitments:i,kzg:s,to:n}),l=[];for(let d=0;d<r.length;d++)l.push({blob:r[d],commitment:i[d],proof:a[d]});return l}class V extends N{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 pe extends N{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class be extends N{constructor({cause:t,maxFeePerGas:s}={}){super(`The fee cap (\`maxFeePerGas\`${s?` = ${ke(s)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(be,"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 Pt extends N{constructor({cause:t,maxPriorityFeePerGas:s,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${s?` = ${ke(s)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${ke(n)} gwei`:""}).`].join(`
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Pt,"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 kt 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 un=BigInt(0),ae=BigInt(1),fn=BigInt(2),hn=BigInt(7),mn=BigInt(256),xn=BigInt(113),Tt=[],It=[],At=[];for(let e=0,t=ae,s=1,n=0;e<24;e++){[s,n]=[n,(2*s+3*n)%5],Tt.push(2*(5*n+s)),It.push((e+1)*(e+2)/2%64);let r=un;for(let i=0;i<7;i++)t=(t<<ae^(t>>hn)*xn)%mn,t&fn&&(r^=ae<<(ae<<BigInt(i))-ae);At.push(r)}const _t=qs(At,!0),pn=_t[0],bn=_t[1],Ct=(e,t,s)=>s>32?Js(e,t,s):Xs(e,t,s),St=(e,t,s)=>s>32?Zs(e,t,s):Ks(e,t,s);function gn(e,t=24){const s=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)s[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const l=(a+8)%10,d=(a+2)%10,u=s[d],x=s[d+1],f=Ct(u,x,1)^s[l],w=St(u,x,1)^s[l+1];for(let g=0;g<50;g+=10)e[a+g]^=f,e[a+g+1]^=w}let r=e[2],i=e[3];for(let a=0;a<24;a++){const l=It[a],d=Ct(r,i,l),u=St(r,i,l),x=Tt[a];r=e[x],i=e[x+1],e[x]=d,e[x+1]=u}for(let a=0;a<50;a+=10){for(let l=0;l<10;l++)s[l]=e[a+l];for(let l=0;l<10;l++)e[a+l]^=~s[(l+2)%10]&s[(l+4)%10]}e[0]^=pn[n],e[1]^=bn[n]}oe(s)}class _e extends pt{constructor(t,s,n,r=!1,i=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=r,this.rounds=i,ht(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Us(this.state)}clone(){return this._cloneInto()}keccak(){xt(this.state32),gn(this.state32,this.rounds),xt(this.state32),this.posOut=0,this.pos=0}update(t){me(this),t=Ie(t),ie(t);const{blockLen:s,state:n}=this,r=t.length;for(let i=0;i<r;){const a=Math.min(s-this.pos,r-i);for(let l=0;l<a;l++)n[this.pos++]^=t[i++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:n,blockLen:r}=this;t[n]^=s,(s&128)!==0&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){me(this,!1),ie(t),this.finish();const s=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,i-r);t.set(s.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ht(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(mt(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,oe(this.state)}_cloneInto(t){const{blockLen:s,suffix:n,outputLen:r,rounds:i,enableXOF:a}=this;return t||(t=new _e(s,n,r,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=a,t.destroyed=this.destroyed,t}}const yn=(e,t,s)=>bt(()=>new _e(t,e,s)),wn=yn(1,136,256/8);function vn(e,t){return wn(se(e,{strict:!1})?nt(e):e)}const Ce=new kt(8192);function Nn(e,t){if(Ce.has(`${e}.${t}`))return Ce.get(`${e}.${t}`);const s=e.substring(2).toLowerCase(),n=vn(it(s)),r=s.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&r[a]&&(r[a]=r[a].toUpperCase()),(n[a>>1]&15)>=8&&r[a+1]&&(r[a+1]=r[a+1].toUpperCase());const i=`0x${r.join("")}`;return Ce.set(`${e}.${t}`,i),i}const En=/^0x[a-fA-F0-9]{40}$/,Se=new kt(8192);function Y(e,t){const{strict:s=!0}=t??{},n=`${e}.${s}`;if(Se.has(n))return Se.get(n);const r=En.test(e)?e.toLowerCase()===e?!0:s?Nn(e)===e:!0:!1;return Se.set(n,r),r}function jn(e,t,s,{strict:n}={}){return se(e,{strict:!1})?kn(e,t,s,{strict:n}):Pn(e,t,s,{strict:n})}function Bt(e,t,s){if(q(e)!==s-t)throw new as({offset:s,position:"end",size:q(e)})}function Pn(e,t,s,{strict:n}={}){const r=e.slice(t,s);return n&&Bt(r,t,s),r}function kn(e,t,s,{strict:n}={}){const r=`0x${e.replace("0x","").slice(t*2,s*2)}`;return n&&Bt(r,t,s),r}function Tn(e){const{authorizationList:t}=e;if(t)for(const s of t){const{chainId:n}=s,r=s.address;if(!Y(r))throw new V({address:r});if(n<0)throw new pe({chainId:n})}Be(e)}function In(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new jt;for(const s of t){const n=q(s),r=he(jn(s,0,1));if(n!==32)throw new an({hash:s,size:n});if(r!==Et)throw new ln({hash:s,version:r})}}Be(e)}function Be(e){const{chainId:t,maxPriorityFeePerGas:s,maxFeePerGas:n,to:r}=e;if(t<=0)throw new pe({chainId:t});if(r&&!Y(r))throw new V({address:r});if(n&&n>Pe)throw new be({maxFeePerGas:n});if(s&&n&&s>n)throw new Pt({maxFeePerGas:n,maxPriorityFeePerGas:s})}function An(e){const{chainId:t,maxPriorityFeePerGas:s,gasPrice:n,maxFeePerGas:r,to:i}=e;if(t<=0)throw new pe({chainId:t});if(i&&!Y(i))throw new V({address:i});if(s||r)throw new N("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>Pe)throw new be({maxFeePerGas:n})}function _n(e){const{chainId:t,maxPriorityFeePerGas:s,gasPrice:n,maxFeePerGas:r,to:i}=e;if(i&&!Y(i))throw new V({address:i});if(typeof t<"u"&&t<=0)throw new pe({chainId:t});if(s||r)throw new N("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>Pe)throw new be({maxFeePerGas:n})}function Cn(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 $s({transaction:e})}function ge(e){if(!e||e.length===0)return[];const t=[];for(let s=0;s<e.length;s++){const{address:n,storageKeys:r}=e[s];for(let i=0;i<r.length;i++)if(r[i].length-2!==64)throw new zs({storageKey:r[i]});if(!Y(n,{strict:!1}))throw new V({address:n});t.push([n,r])}return t}function Sn(e,t){const s=Cn(e);return s==="eip1559"?zn(e,t):s==="eip2930"?Ln(e,t):s==="eip4844"?$n(e,t):s==="eip7702"?Bn(e,t):Fn(e,t)}function Bn(e,t){const{authorizationList:s,chainId:n,gas:r,nonce:i,to:a,value:l,maxFeePerGas:d,maxPriorityFeePerGas:u,accessList:x,data:f}=e;Tn(e);const w=ge(x),g=Ls(s);return re(["0x04",R([b(n),i?b(i):"0x",u?b(u):"0x",d?b(d):"0x",r?b(r):"0x",a??"0x",l?b(l):"0x",f??"0x",w,g,...le(e,t)])])}function $n(e,t){const{chainId:s,gas:n,nonce:r,to:i,value:a,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:u,accessList:x,data:f}=e;In(e);let w=e.blobVersionedHashes,g=e.sidecars;if(e.blobs&&(typeof w>"u"||typeof g>"u")){const y=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(P=>O(P)),C=e.kzg,U=ut({blobs:y,kzg:C});if(typeof w>"u"&&(w=rn({commitments:U})),typeof g>"u"){const P=ft({blobs:y,commitments:U,kzg:C});g=dn({blobs:y,commitments:U,proofs:P})}}const k=ge(x),j=[b(s),r?b(r):"0x",u?b(u):"0x",d?b(d):"0x",n?b(n):"0x",i??"0x",a?b(a):"0x",f??"0x",k,l?b(l):"0x",w??[],...le(e,t)],_=[],$=[],h=[];if(g)for(let y=0;y<g.length;y++){const{blob:C,commitment:U,proof:P}=g[y];_.push(C),$.push(U),h.push(P)}return re(["0x03",R(g?[j,_,$,h]:j)])}function zn(e,t){const{chainId:s,gas:n,nonce:r,to:i,value:a,maxFeePerGas:l,maxPriorityFeePerGas:d,accessList:u,data:x}=e;Be(e);const f=ge(u),w=[b(s),r?b(r):"0x",d?b(d):"0x",l?b(l):"0x",n?b(n):"0x",i??"0x",a?b(a):"0x",x??"0x",f,...le(e,t)];return re(["0x02",R(w)])}function Ln(e,t){const{chainId:s,gas:n,data:r,nonce:i,to:a,value:l,accessList:d,gasPrice:u}=e;An(e);const x=ge(d),f=[b(s),i?b(i):"0x",u?b(u):"0x",n?b(n):"0x",a??"0x",l?b(l):"0x",r??"0x",x,...le(e,t)];return re(["0x01",R(f)])}function Fn(e,t){const{chainId:s=0,gas:n,data:r,nonce:i,to:a,value:l,gasPrice:d}=e;_n(e);let u=[i?b(i):"0x",d?b(d):"0x",n?b(n):"0x",a??"0x",l?b(l):"0x",r??"0x"];if(t){const x=(()=>{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 g=27n+(t.v===27n?0n:1n);if(t.v!==g)throw new Bs({v:t.v});return g})(),f=fe(t.r),w=fe(t.s);u=[...u,b(x),f==="0x00"?"0x":f,w==="0x00"?"0x":w]}else s>0&&(u=[...u,b(s),"0x","0x"]);return R(u)}function le(e,t){const s=t??e,{v:n,yParity:r}=s;if(typeof s.r>"u")return[];if(typeof s.s>"u")return[];if(typeof n>"u"&&typeof r>"u")return[];const i=fe(s.r),a=fe(s.s);return[typeof r=="number"?r?b(1):"0x":n===0n?"0x":n===1n?b(1):n===27n?"0x":b(1),i==="0x00"?"0x":i,a==="0x00"?"0x":a]}const Un={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},On={block:ws({format(e){return{transactions:e.transactions?.map(s=>{if(typeof s=="string")return s;const n=je(s);return n.typeHex==="0x7e"&&(n.isSystemTx=s.isSystemTx,n.mint=s.mint?J(s.mint):void 0,n.sourceHash=s.sourceHash,n.type="deposit"),n}),stateRoot:e.stateRoot}}}),transaction:bs({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?J(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:js({format(e){return{l1GasPrice:e.l1GasPrice?J(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?J(e.l1GasUsed):null,l1Fee:e.l1Fee?J(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function Gn(e,t){return Dn(e)?Mn(e):Sn(e,t)}const Hn={transaction:Gn};function Mn(e){Rn(e);const{sourceHash:t,data:s,from:n,gas:r,isSystemTx:i,mint:a,to:l,value:d}=e,u=[t,n,l??"0x",a?ne(a):"0x",d?ne(d):"0x",r?ne(r):"0x",i?"0x1":"0x",s??"0x"];return re(["0x7e",R(u)])}function Dn(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function Rn(e){const{from:t,to:s}=e;if(t&&!Y(t))throw new V({address:t});if(s&&!Y(s))throw new V({address:s})}const $t={blockTime:2e3,contracts:Un,formatters:On,serializers:Hn},ce=11155111,ye=ve({...$t,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:{...$t.contracts,disputeGameFactory:{[ce]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[ce]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[ce]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[ce]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:ce});({...ye});const zt=ve({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.drpc.org"]}},blockExplorers