@frames.js/debugger
Version:
Debug your Frames.js applications
3 lines • 192 kB
JavaScript
"use strict";exports.id=1027,exports.ids=[1027],exports.modules={13264:(e,t,r)=>{r.d(t,{nr:()=>n,cL:()=>i,KS:()=>A,cN:()=>g,GN:()=>w,MV:()=>v,Tn:()=>x,_G:()=>I});var n={};r.r(n),r.d(n,{S:()=>s,R:()=>o});var i={};r.r(i),r.d(i,{R:()=>l});class a extends Error{name="BaseError";cause;constructor(e,t={}){super(e,t.cause?{cause:t.cause}:void 0),this.cause=t.cause}}class s extends a{name="AddFrame.InvalidDomainManifest";constructor(){super("Invalid domain manifest")}}class o extends a{name="AddFrame.RejectedByUser";constructor(){super("Add frame rejected by user")}}class l extends a{name="SignIn.RejectedByUser";constructor(){super("Sign in rejected by user")}}var c=r(53797);let u=c.z.string().url().startsWith("https://",{message:"Must be an https url"}).max(512),d=c.z.string().max(32),f=c.z.string().max(32),h=c.z.string().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,{message:"Invalid hex color code. It should be in the format #RRGGBB or #RGB."}),b=c.z.object({header:c.z.string(),payload:c.z.string(),signature:c.z.string()});c.z.object({fid:c.z.number(),type:c.z.literal("app_key"),key:c.z.string().startsWith("0x")});let p=c.z.object({type:c.z.literal("launch_frame"),name:d,url:u,splashImageUrl:u.optional(),splashBackgroundColor:h.optional()}),m=c.z.discriminatedUnion("type",[p]),y=c.z.object({title:f,action:m}),g=c.z.object({version:c.z.literal("next"),imageUrl:u,button:y}),w=c.z.object({url:c.z.string(),token:c.z.string()}),v=c.z.object({notificationId:c.z.string().max(128),title:c.z.string().max(32),body:c.z.string().max(128),targetUrl:u,tokens:c.z.string().array().max(100)}),x=c.z.object({result:c.z.object({successfulTokens:c.z.array(c.z.string()),invalidTokens:c.z.array(c.z.string()),rateLimitedTokens:c.z.array(c.z.string())})}),P=c.z.object({event:c.z.literal("frame_added"),notificationDetails:w.optional()}),$=c.z.object({event:c.z.literal("frame_removed")}),B=c.z.object({event:c.z.literal("notifications_enabled"),notificationDetails:w.required()}),E=c.z.object({event:c.z.literal("notifications_disabled")}),I=c.z.discriminatedUnion("event",[P,$,B,E]),O=c.z.object({version:c.z.union([c.z.literal("0.0.0"),c.z.literal("0.0.1"),c.z.literal("1"),c.z.literal("next")]),name:d,iconUrl:u,homeUrl:u,imageUrl:u.optional(),buttonTitle:f.optional(),splashImageUrl:u.optional(),splashBackgroundColor:h.optional(),webhookUrl:u.optional()}),A=c.z.object({accountAssociation:b,frame:O.optional()})},49510:(e,t,r)=>{r.d(t,{FF:()=>P,S5:()=>h,Wd:()=>m,bytesToNumberBE:()=>u,ci:()=>o,dQ:()=>y,eV:()=>p,hexToBytes:()=>c,n$:()=>v,ql:()=>b,tL:()=>f,ty:()=>d}),BigInt(0);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let n=BigInt(1),i=BigInt(2),a=e=>e instanceof Uint8Array,s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e){if(!a(e))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t}function l(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function c(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){let n=2*t,i=Number.parseInt(e.slice(n,n+2),16);if(Number.isNaN(i)||i<0)throw Error("Invalid byte sequence");r[t]=i}return r}function u(e){return l(o(e))}function d(e){if(!a(e))throw Error("Uint8Array expected");return l(o(Uint8Array.from(e).reverse()))}function f(e,t){return c(e.toString(16).padStart(2*t,"0"))}function h(e,t){return f(e,t).reverse()}function b(e,t,r){let n;if("string"==typeof t)try{n=c(t)}catch(r){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else if(a(t))n=Uint8Array.from(t);else throw Error(`${e} must be hex string or Uint8Array`);let i=n.length;if("number"==typeof r&&i!==r)throw Error(`${e} expected ${r} bytes, got ${i}`);return n}function p(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;return e.forEach(e=>{if(!a(e))throw Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}function m(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}let y=e=>(i<<BigInt(e-1))-n,g=e=>new Uint8Array(e),w=e=>Uint8Array.from(e);function v(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=g(e),i=g(e),a=0,s=()=>{n.fill(1),i.fill(0),a=0},o=(...e)=>r(i,n,...e),l=(e=g())=>{i=o(w([0]),e),n=o(),0!==e.length&&(i=o(w([1]),e),n=o())},c=()=>{if(a++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=o()).slice();r.push(t),e+=n.length}return p(...r)};return(e,t)=>{let r;for(s(),l(e);!(r=t(c()));)l();return s(),r}}let x={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function P(e,t,r={}){let n=(t,r,n)=>{let i=x[r];if("function"!=typeof i)throw Error(`Invalid validator "${r}", expected function`);let a=e[t];if((!n||void 0!==a)&&!i(a,e))throw Error(`Invalid param ${String(t)}=${a} (${typeof a}), expected ${r}`)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}},25657:(e,t,r)=>{r.d(t,{t:()=>s});var n=r(94778);let i=/^tuple(?<array>(\[(\d*)\])*)$/;function a(e){let t="",r=e.length;for(let a=0;a<r;a++)t+=function e(t){let r=t.type;if(i.test(t.type)&&"components"in t){r="(";let a=t.components.length;for(let n=0;n<a;n++)r+=e(t.components[n]),n<a-1&&(r+=", ");let s=(0,n.Zw)(i,t.type);return r+=`)${s?.array??""}`,e({...t,type:r})}return("indexed"in t&&t.indexed&&(r=`${r} indexed`),t.name)?`${r} ${t.name}`:r}(e[a]),a!==r-1&&(t+=", ");return t}function s(e){return"function"===e.type?`function ${e.name}(${a(e.inputs)})${e.stateMutability&&"nonpayable"!==e.stateMutability?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${a(e.outputs)})`:""}`:"event"===e.type?`event ${e.name}(${a(e.inputs)})`:"error"===e.type?`error ${e.name}(${a(e.inputs)})`:"constructor"===e.type?`constructor(${a(e.inputs)})${"payable"===e.stateMutability?" payable":""}`:"fallback"===e.type?"fallback()":"receive() external payable"}},27581:(e,t,r)=>{r.d(t,{V:()=>N});var n=r(94778);let i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/,a=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/,s=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/,o=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/,l=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/,c=/^fallback\(\)$/,u=/^receive\(\) external payable$/,d=new Set(["indexed"]),f=new Set(["calldata","memory","storage"]);class h extends Error{constructor(e,t={}){let r=t.cause instanceof h?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof h&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@1.0.0"].join("\n")),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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}}class b extends h{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class p extends h{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class m extends h{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class y extends h{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class g extends h{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class w extends h{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class v extends h{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class x extends h{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class P extends h{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class $ extends h{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class B extends h{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class E extends h{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let I=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),O=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,A=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,G=/^u?int$/;function j(e,t){var r,i,a;let s;let o=(r=t?.type)?`${r}:${e}`:e;if(I.has(o))return I.get(o);let l=n.cN.test(e),c=(0,n.Zw)(l?A:O,e);if(!c)throw new m({param:e});if(c.name&&("address"===(i=c.name)||"bool"===i||"function"===i||"string"===i||"tuple"===i||n.eL.test(i)||n.lh.test(i)||z.test(i)))throw new y({param:e,name:c.name});let u=c.name?{name:c.name}:{},d="indexed"===c.modifier?{indexed:!0}:{},h=t?.structs??{},b={};if(l){s="tuple";let e=C(c.type),t=[],r=e.length;for(let n=0;n<r;n++)t.push(j(e[n],{structs:h}));b={components:t}}else if(c.type in h)s="tuple",b={components:h[c.type]};else if(G.test(c.type))s=`${c.type}256`;else if(s=c.type,t?.type!=="struct"&&!k(s))throw new p({type:s});if(c.modifier){if(!t?.modifiers?.has?.(c.modifier))throw new g({param:e,type:t?.type,modifier:c.modifier});if(f.has(c.modifier)&&(a=s,!c.array&&"bytes"!==a&&"string"!==a&&"tuple"!==a))throw new w({param:e,type:t?.type,modifier:c.modifier})}let v={type:`${s}${c.array??""}`,...u,...d,...b};return I.set(o,v),v}function C(e,t=[],r="",n=0){let i=e.trim().length;for(let a=0;a<i;a++){let i=e[a],s=e.slice(a+1);switch(i){case",":return 0===n?C(s,[...t,r.trim()]):C(s,t,`${r}${i}`,n);case"(":return C(s,t,`${r}${i}`,n+1);case")":return C(s,t,`${r}${i}`,n-1);default:return C(s,t,`${r}${i}`,n)}}if(""===r)return t;if(0!==n)throw new E({current:r,depth:n});return t.push(r.trim()),t}function k(e){return"address"===e||"bool"===e||"function"===e||"string"===e||n.eL.test(e)||n.lh.test(e)}let z=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/,U=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function N(e){let t=function(e){let t={},r=e.length;for(let i=0;i<r;i++){let r=e[i];if(!o.test(r))continue;let a=(0,n.Zw)(o,r);if(!a)throw new x({signature:r,type:"struct"});let s=a.properties.split(";"),l=[],c=s.length;for(let e=0;e<c;e++){let t=s[e].trim();if(!t)continue;let r=j(t,{type:"struct"});l.push(r)}if(!l.length)throw new $({signature:r});t[a.name]=l}let i={},a=Object.entries(t),s=a.length;for(let e=0;e<s;e++){let[r,s]=a[e];i[r]=function e(t,r,i=new Set){let a=[],s=t.length;for(let o=0;o<s;o++){let s=t[o];if(n.cN.test(s.type))a.push(s);else{let t=(0,n.Zw)(U,s.type);if(!t?.type)throw new v({abiParameter:s});let{array:o,type:l}=t;if(l in r){if(i.has(l))throw new B({type:l});a.push({...s,type:`tuple${o??""}`,components:e(r[l]??[],r,new Set([...i,l]))})}else if(k(l))a.push(s);else throw new b({type:l})}}return a}(s,t)}return i}(e),r=[],h=e.length;for(let b=0;b<h;b++){let h=e[b];o.test(h)||r.push(function(e,t={}){if(s.test(e)){let r=(0,n.Zw)(s,e);if(!r)throw new x({signature:e,type:"function"});let i=C(r.parameters),a=[],o=i.length;for(let e=0;e<o;e++)a.push(j(i[e],{modifiers:f,structs:t,type:"function"}));let l=[];if(r.returns){let e=C(r.returns),n=e.length;for(let r=0;r<n;r++)l.push(j(e[r],{modifiers:f,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:a,outputs:l}}if(a.test(e)){let r=(0,n.Zw)(a,e);if(!r)throw new x({signature:e,type:"event"});let i=C(r.parameters),s=[],o=i.length;for(let e=0;e<o;e++)s.push(j(i[e],{modifiers:d,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:s}}if(i.test(e)){let r=(0,n.Zw)(i,e);if(!r)throw new x({signature:e,type:"error"});let a=C(r.parameters),s=[],o=a.length;for(let e=0;e<o;e++)s.push(j(a[e],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:s}}if(l.test(e)){let r=(0,n.Zw)(l,e);if(!r)throw new x({signature:e,type:"constructor"});let i=C(r.parameters),a=[],s=i.length;for(let e=0;e<s;e++)a.push(j(i[e],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:a}}if(c.test(e))return{type:"fallback"};if(u.test(e))return{type:"receive",stateMutability:"payable"};throw new P({signature:e})}(h,t))}return r}},94778:(e,t,r)=>{function n(e,t){let r=e.exec(t);return r?.groups}r.d(t,{Zw:()=>n,cN:()=>s,eL:()=>i,lh:()=>a});let i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,a=/^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)?$/,s=/^\(.+?\).*?$/},78822:(e,t,r)=>{r.d(t,{Db:()=>eC,Jx:()=>eE});let n=/^tuple(?<array>(\[(\d*)\])*)$/;var i=r(93245);function a(e,t){if(h(e)>t)throw new m({givenSize:h(e),maxSize:t})}function s(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;let i=e.replace("0x","");if(i.length>2*n)throw new y({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i["right"===r?"padEnd":"padStart"](2*n,"0")}`}let o=new TextEncoder,l=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function c(...e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function u(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=l[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(a(n,t.size),f(n,t.size)):n}function d(e,t){return s(e,{dir:"left",size:t})}function f(e,t){return s(e,{dir:"right",size:t})}function h(e){return Math.ceil((e.length-2)/2)}function b(e,t={}){let{signed:r}=t;t.size&&a(e,t.size);let n=BigInt(e);if(!r)return n;let i=(1n<<8n*BigInt((e.length-2)/2))-1n;return n<=i>>1n?n:n-i-1n}class p extends i.G{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number \`${i}\` is not in safe${n?` ${8*n}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}i.G,i.G,i.G;class m extends i.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class y extends i.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function g(e,t){if(E(e)>t)throw new G({givenSize:E(e),maxSize:t})}let w={zero:48,nine:57,A:65,F:70,a:97,f:102};function v(e){return e>=w.zero&&e<=w.nine?e-w.zero:e>=w.A&&e<=w.F?e-(w.A-10):e>=w.a&&e<=w.f?e-(w.a-10):void 0}function x(e,t={}){let{dir:r="left"}=t,n=0;for(let t=0;t<e.length-1&&"0"===e["left"===r?t:e.length-t-1].toString();t++)n++;return"left"===r?e.slice(n):e.slice(0,e.length-n)}let P=new TextDecoder,$=new TextEncoder;function B(e,t={}){let{size:r}=t,n=e;r&&(a(e,r),n=f(e,r));let s=n.slice(2);s.length%2&&(s=`0${s}`);let o=s.length/2,l=new Uint8Array(o);for(let e=0,t=0;e<o;e++){let r=v(s.charCodeAt(t++)),n=v(s.charCodeAt(t++));if(void 0===r||void 0===n)throw new i.G(`Invalid byte sequence ("${s[t-2]}${s[t-1]}" in "${s}").`);l[e]=16*r+n}return l}function E(e){return e.length}function I(e,t={}){let{size:r}=t;return void 0!==r&&g(e,r),function(e,t={}){let{signed:r,size:n}=t;return r||n?Number(b(e,t)):Number(e)}(u(e,t),t)}function O(e){return x(e,{dir:"left"})}class A extends i.G{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}i.G;class G extends i.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class j extends i.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}class C extends i.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}class k extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let 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){let e=this.keys().next().value;e&&this.delete(e)}return this}}let z={checksum:new k(8192)}.checksum;function U(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function N(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function M(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}let F=BigInt(4294967296-1),T=BigInt(32),S=(e,t,r)=>e<<r|t>>>32-r,R=(e,t,r)=>t<<r|e>>>32-r,L=(e,t,r)=>t<<r-32|e>>>64-r,_=(e,t,r)=>e<<r-32|t>>>64-r,D=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),q=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],H=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function V(e){for(let t=0;t<e.length;t++)e[t]=H(e[t])}function Z(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),N(e),e}class W{clone(){return this._cloneInto()}}let X=[],J=[],Y=[],K=BigInt(0),Q=BigInt(1),ee=BigInt(2),et=BigInt(7),er=BigInt(256),en=BigInt(113);for(let e=0,t=Q,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],X.push(2*(5*n+r)),J.push((e+1)*(e+2)/2%64);let i=K;for(let e=0;e<7;e++)(t=(t<<Q^(t>>et)*en)%er)&ee&&(i^=Q<<(Q<<BigInt(e))-Q);Y.push(i)}let[ei,ea]=function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:a,l:s}=function(e,t=!1){return t?{h:Number(e&F),l:Number(e>>T&F)}:{h:0|Number(e>>T&F),l:0|Number(e&F)}}(e[i],t);[r[i],n[i]]=[a,s]}return[r,n]}(Y,!0),es=(e,t,r)=>r>32?L(e,t,r):S(e,t,r),eo=(e,t,r)=>r>32?_(e,t,r):R(e,t,r);class el extends W{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,U(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=D(this.state)}keccak(){q||V(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,a=r[i],s=r[i+1],o=es(a,s,1)^r[n],l=eo(a,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=J[r],a=es(t,i,n),s=eo(t,i,n),o=X[r];t=e[o],i=e[o+1],e[o]=a,e[o+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=ei[n],e[1]^=ea[n]}r.fill(0)}(this.state32,this.rounds),q||V(this.state32),this.posOut=0,this.pos=0}update(e){M(this);let{blockLen:t,state:r}=this,n=(e=Z(e)).length;for(let i=0;i<n;){let a=Math.min(t-this.pos,n-i);for(let t=0;t<a;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){M(this,!1),N(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return U(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){N(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished)throw 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){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:a}=this;return e||(e=new el(t,r,n,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=a,e.destroyed=this.destroyed,e}}let ec=function(e){let t=t=>e().update(Z(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}(()=>new el(136,1,32)),eu=/^0x[a-fA-F0-9]{40}$/;function ed(e,t={}){let{strict:r=!0}=t;if(!eu.test(e))throw new eh({address:e,cause:new eb});if(r){if(e.toLowerCase()===e)return;if(ef(e)!==e)throw new eh({address:e,cause:new ep})}}function ef(e){if(z.has(e))return z.get(e);ed(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=function(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,n=ec(e instanceof Uint8Array?e:"string"==typeof e?B(e):e instanceof Uint8Array?e:new Uint8Array(e));return"Bytes"===r?n:u(n)}(function(e,t={}){let{size:r}=t,n=$.encode(e);return"number"==typeof r?(g(n,r),function(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;if(e.length>n)throw new C({size:e.length,targetSize:n,type:"Bytes"});let i=new Uint8Array(n);for(let t=0;t<n;t++){let a="right"===r;i[a?t:n-t-1]=e[a?t:e.length-t-1]}return i}(n,{dir:"right",size:r})):n}(t),{as:"Bytes"}),n=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&n[e]&&(n[e]=n[e].toUpperCase()),(15&r[e>>1])>=8&&n[e+1]&&(n[e+1]=n[e+1].toUpperCase());let i=`0x${n.join("")}`;return z.set(e,i),i}class eh extends i.G{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class eb extends i.G{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class ep extends i.G{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}let em=/^(.*)\[([0-9]*)\]$/,ey=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,eg=/^(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 ew(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function ev(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(ev);let r=ew(e.type);return!!(r&&ev({...e,type:r[1]}))}let ex={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 eB({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new e$({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new eP({offset:e});let 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 eP({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let 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();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};class eP extends i.G{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class e$ extends i.G{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class eB extends i.G{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function eE(e,t,r={}){let{as:n="Array",checksumAddress:i=!1}=r,a="string"==typeof t?B(t):t,s=function(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(ex);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}(a);if(0===E(a)&&e.length>0)throw new eA;if(E(a)&&32>E(a))throw new eO({data:"string"==typeof t?t:u(t),parameters:e,size:E(a)});let o=0,l="Array"===n?[]:{};for(let t=0;t<e.length;++t){let r=e[t];s.setPosition(o);let[a,c]=function e(t,r,n){let{checksumAddress:i,staticPosition:a}=n,s=ew(r.type);if(s){let[n,o]=s;return function(t,r,n){let{checksumAddress:i,length:a,staticPosition:s}=n;if(!a){let n=s+I(t.readBytes(32)),a=n+32;t.setPosition(n);let o=I(t.readBytes(32)),l=ev(r),c=0,u=[];for(let n=0;n<o;++n){t.setPosition(a+(l?32*n:c));let[s,o]=e(t,r,{checksumAddress:i,staticPosition:a});c+=o,u.push(s)}return t.setPosition(s+32),[u,32]}if(ev(r)){let n=s+I(t.readBytes(32)),o=[];for(let s=0;s<a;++s){t.setPosition(n+32*s);let[a]=e(t,r,{checksumAddress:i,staticPosition:n});o.push(a)}return t.setPosition(s+32),[o,32]}let o=0,l=[];for(let n=0;n<a;++n){let[n,a]=e(t,r,{checksumAddress:i,staticPosition:s+o});o+=a,l.push(n)}return[l,o]}(t,{...r,type:o},{checksumAddress:i,length:n,staticPosition:a})}if("tuple"===r.type)return function(t,r,n){let{checksumAddress:i,staticPosition:a}=n,s=0===r.components.length||r.components.some(({name:e})=>!e),o=s?[]:{},l=0;if(ev(r)){let n=a+I(t.readBytes(32));for(let a=0;a<r.components.length;++a){let c=r.components[a];t.setPosition(n+l);let[u,d]=e(t,c,{checksumAddress:i,staticPosition:n});l+=d,o[s?a:c?.name]=u}return t.setPosition(a+32),[o,32]}for(let n=0;n<r.components.length;++n){let c=r.components[n],[u,d]=e(t,c,{checksumAddress:i,staticPosition:a});o[s?n:c?.name]=u,l+=d}return[o,l]}(t,r,{checksumAddress:i,staticPosition:a});if("address"===r.type)return function(e,t={}){var r;let{checksum:n=!1}=t;return[(r=u(function(e,t,r,n={}){let{strict:i}=n;!function(e,t){if("number"==typeof t&&t>0&&t>E(e)-1)throw new j({offset:t,position:"start",size:E(e)})}(e,t);let a=e.slice(t,r);return i&&function(e,t,r){if("number"==typeof t&&"number"==typeof r&&E(e)!==r-t)throw new j({offset:r,position:"end",size:E(e)})}(a,t,r),a}(e.readBytes(32),-20)),n?ef(r):r),32]}(t,{checksum:i});if("bool"===r.type)return[function(e,t={}){let{size:r}=t,n=e;if(void 0!==r&&(g(n,r),n=O(n)),n.length>1||n[0]>1)throw new A(n);return!!n[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=I(e.readBytes(32));e.setPosition(r+t);let n=I(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[u(i),32]}return[u(e.readBytes(Number.parseInt(i),32)),32]}(t,r,{staticPosition:a});if(r.type.startsWith("uint")||r.type.startsWith("int"))return function(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256"),i=e.readBytes(32);return[n>48?function(e,t={}){let{size:r}=t;return void 0!==r&&g(e,r),b(u(e,t),t)}(i,{signed:r}):I(i,{signed:r}),32]}(t,r);if("string"===r.type)return function(e,{staticPosition:t}){let r=I(e.readBytes(32));e.setPosition(t+r);let n=I(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=function(e,t={}){let{size:r}=t,n=e;return void 0!==r&&(g(n,r),n=x(n,{dir:"right"})),P.decode(n)}(O(e.readBytes(n,32)));return e.setPosition(t+32),[i,32]}(t,{staticPosition:a});throw new eC(r.type)}(s,r,{checksumAddress:i,staticPosition:0});o+=c,"Array"===n?l.push(a):l[r.name??t]=a}return l}function eI(e,t){if(e.length!==t.length)throw new ej({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t[n];r.push(eI.encode(i,a))}return c(...r)}(eI||(eI={})).encode=function e(t,r,n=!1){if("address"===t)return ed(r),d(r.toLowerCase(),n?32:0);if("string"===t)return function(e,t={}){return u(o.encode(e),t)}(r);if("bytes"===t)return r;if("bool"===t)return d(function(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(a(r,t.size),d(r,t.size)):r}(r),n?32:1);let i=t.match(eg);if(i){let[e,t,a="256"]=i,s=Number.parseInt(a)/8;return function(e,t={}){let r;let{signed:n,size:i}=t,a=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof r&&n?-r-1n:0;if(r&&a>r||a<s){let t="bigint"==typeof e?"n":"";throw new p({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}let o=(n&&a<0?(1n<<BigInt(8*i))+BigInt(a):a).toString(16),l=`0x${o}`;return i?d(l,i):l}(r,{size:n?32:s,signed:"int"===t})}let s=t.match(ey);if(s){let[e,t]=s;if(Number.parseInt(t)!==(r.length-2)/2)throw new eG({expectedSize:Number.parseInt(t),value:r});return f(r,n?32:0)}let l=t.match(em);if(l&&Array.isArray(r)){let[t,n]=l,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":c(...i)}throw new eC(t)};class eO extends i.G{constructor({data:e,parameters:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${function(e){let t="",r=e.length;for(let i=0;i<r;i++)t+=function e(t){let r=t.type;if(n.test(t.type)&&"components"in t){r="(";let i=t.components.length;for(let n=0;n<i;n++)r+=e(t.components[n]),n<i-1&&(r+=", ");let a=function(e,t){let r=e.exec(t);return r?.groups}(n,t.type);return r+=`)${a?.array??""}`,e({...t,type:r})}return("indexed"in t&&t.indexed&&(r=`${r} indexed`),t.name)?`${r} ${t.name}`:r}(e[i]),i!==r-1&&(t+=", ");return t}(t)})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class eA extends i.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class eG extends i.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${h(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class ej extends i.G{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding parameters/values length mismatch.
Expected length (parameters): ${e}
Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class eC extends i.G{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}},93245:(e,t,r)=>{r.d(t,{G:()=>n});class n extends Error{constructor(e,t={}){let r=(()=>{if(t.cause instanceof n){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof n&&t.cause.docsPath||t.docsPath,a=`https://oxlib.sh${i??""}`;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||i?["",r?`Details: ${r}`:void 0,i?`See: ${a}`:void 0]:[]].filter(e=>"string"==typeof e).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,"docs",{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,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"ox@0.1.1"}),this.cause=t.cause,this.details=r,this.docs=a,this.docsPath=i,this.shortMessage=e}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}},37877:(e,t,r)=>{let n,i;r.d(t,{$3:()=>M,T:()=>_,UG:()=>q,Xx:()=>S});/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */let a=2n**255n-19n,s=2n**252n+0x14def9dea2f79cd65812631a5cf5d3edn,o={a:-1n,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,p:a,n:s,h:8,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},l=(e="")=>{throw Error(e)},c=e=>"string"==typeof e,u=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name,d=(e,t)=>!u(e)||"number"==typeof t&&t>0&&e.length!==t?l("Uint8Array of valid length expected"):e,f=e=>new Uint8Array(e),h=(e,t)=>d(c(e)?$(e):f(d(e)),t),b=(e,t=a)=>{let r=e%t;return r>=0n?r:t+r},p=e=>e instanceof m?e:l("Point expected");class m{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n}static fromAffine(e){return new m(e.x,e.y,1n,b(e.x*e.y))}static fromHex(e,t=!1){let{d:r}=o,n=(e=h(e,32)).slice(),i=e[31];n[31]=-129&i;let s=E(n);t&&!(0n<=s&&s<2n**256n)&&l("bad y coord 1"),t||0n<=s&&s<a||l("bad y coord 2");let c=b(s*s),{isValid:u,value:d}=j(b(c-1n),b(r*c+1n));u||l("bad y coordinate 3");let f=(1n&d)===1n,p=(128&i)!=0;return!t&&0n===d&&p&&l("bad y coord 3"),p!==f&&(d=b(-d)),new m(d,s,1n,b(d*s))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(e){let{ex:t,ey:r,ez:n}=this,{ex:i,ey:a,ez:s}=p(e),o=b(t*s),l=b(i*n),c=b(r*s),u=b(a*n);return o===l&&c===u}is0(){return this.equals(g)}negate(){return new m(b(-this.ex),this.ey,this.ez,b(-this.et))}double(){let{ex:e,ey:t,ez:r}=this,{a:n}=o,i=b(e*e),a=b(t*t),s=b(2n*b(r*r)),l=b(n*i),c=e+t,u=b(b(c*c)-i-a),d=l+a,f=d-s,h=l-a,p=b(u*f),y=b(d*h),g=b(u*h);return new m(p,y,b(f*d),g)}add(e){let{ex:t,ey:r,ez:n,et:i}=this,{ex:a,ey:s,ez:l,et:c}=p(e),{a:u,d}=o,f=b(t*a),h=b(r*s),y=b(i*d*c),g=b(n*l),w=b((t+r)*(a+s)-f-h),v=b(g-y),x=b(g+y),P=b(h-u*f),$=b(w*v),B=b(x*P),E=b(w*P);return new m($,B,b(v*x),E)}mul(e,t=!0){if(0n===e)return!0===t?l("cannot multiply by 0"):g;if("bigint"==typeof e&&0n<e&&e<s||l("invalid scalar, must be < L"),!t&&this.is0()||1n===e)return this;if(this.equals(y))return V(e).p;let r=g,n=y;for(let i=this;e>0n;i=i.double(),e>>=1n)1n&e?r=r.add(i):t&&(n=n.add(i));return r}multiply(e){return this.mul(e)}clearCofactor(){return this.mul(BigInt(o.h),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.mul(s/2n,!1).double();return s%2n&&(e=e.add(this)),e.is0()}toAffine(){let{ex:e,ey:t,ez:r}=this;if(this.equals(g))return{x:0n,y:1n};let n=O(r,a);return 1n!==b(r*n)&&l("invalid inverse"),{x:b(e*n),y:b(t*n)}}toRawBytes(){let{x:e,y:t}=this.toAffine(),r=B(t);return r[31]|=1n&e?128:0,r}toHex(){return v(this.toRawBytes())}}m.BASE=new m(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,0x6666666666666666666666666666666666666666666666666666666666666658n,1n,b(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an*0x6666666666666666666666666666666666666666666666666666666666666658n)),m.ZERO=new m(0n,1n,1n,0n);let{BASE:y,ZERO:g}=m,w=(e,t)=>e.toString(16).padStart(t,"0"),v=e=>Array.from(d(e)).map(e=>w(e,2)).join(""),x={_0:48,_9:57,A:65,F:70,a:97,f:102},P=e=>e>=x._0&&e<=x._9?e-x._0:e>=x.A&&e<=x.F?e-(x.A-10):e>=x.a&&e<=x.f?e-(x.a-10):void 0,$=e=>{let t="hex invalid";if(!c(e))return l(t);let r=e.length,n=r/2;if(r%2)return l(t);let i=f(n);for(let r=0,a=0;r<n;r++,a+=2){let n=P(e.charCodeAt(a)),s=P(e.charCodeAt(a+1));if(void 0===n||void 0===s)return l(t);i[r]=16*n+s}return i},B=e=>$(w(e,64)).reverse(),E=e=>BigInt("0x"+v(f(d(e)).reverse())),I=(...e)=>{let t=f(e.reduce((e,t)=>e+d(t).length,0)),r=0;return e.forEach(e=>{t.set(e,r),r+=e.length}),t},O=(e,t)=>{(0n===e||t<=0n)&&l("no inverse n="+e+" mod="+t);let r=b(e,t),n=t,i=0n,a=1n,s=1n,o=0n;for(;0n!==r;){let e=n/r,t=n%r,l=i-s*e,c=a-o*e;n=r,r=t,i=s,a=o,s=l,o=c}return 1n===n?b(i,t):l("no inverse")},A=(e,t)=>{let r=e;for(;t-- >0n;)r*=r,r%=a;return r},G=e=>{let t=e*e%a*e%a,r=A(t,2n)*t%a,n=A(r,1n)*e%a,i=A(n,5n)*n%a,s=A(i,10n)*i%a,o=A(s,20n)*s%a,l=A(o,40n)*o%a,c=A(l,80n)*l%a,u=A(c,80n)*l%a,d=A(u,10n)*i%a;return{pow_p_5_8:A(d,2n)*e%a,b2:t}},j=(e,t)=>{let r=b(t*t*t),n=G(e*b(r*r*t)).pow_p_5_8,i=b(e*r*n),a=b(t*i*i),s=i,o=b(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*i),l=a===e,c=a===b(-e),u=a===b(-(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*e));return l&&(i=s),(c||u)&&(i=o),(1n&b(i))===1n&&(i=b(-i)),{isValid:l||c,value:i}},C=e=>b(E(e),s),k=(...e)=>q.sha512Async(...e),z=(...e)=>"function"==typeof n?n(...e):l("etc.sha512Sync not set"),U=e=>{let t=e.slice(0,32);t[0]&=248,t[31]&=127,t[31]|=64;let r=e.slice(32,64),n=C(t),i=y.mul(n),a=i.toRawBytes();return{head:t,prefix:r,scalar:n,point:i,pointBytes:a}},N=e=>U(z(h(e,32))),M=e=>N(e).pointBytes;function F(e,t){return e?k(t.hashable).then(t.finish):t.finish(z(t.hashable))}let T=(e,t,r)=>{let{pointBytes:n,scalar:i}=e,a=C(t),o=y.mul(a).toRawBytes();return{hashable:I(o,n,r),finish:e=>d(I(o,B(b(a+C(e)*i,s))),64)}},S=(e,t)=>{let r=h(e),n=N(t),i=z(n.prefix,r);return F(!1,T(n,i,r))},R={zip215:!0},L=(e,t,r,n=R)=>{e=h(e,64),t=h(t),r=h(r,32);let{zip215:i}=n,a,s,o,l,c=new Uint8Array;try{a=m.fromHex(r,i),s=m.fromHex(e.slice(0,32),i),o=E(e.slice(32,64)),l=y.mul(o,!1),c=I(s.toRawBytes(),a.toRawBytes(),t)}catch(e){}return{hashable:c,finish:e=>{if(null==l||!i&&a.isSmallOrder())return!1;let t=C(e);return s.add(a.mul(t,!1)).add(l.negate()).clearCofactor().is0()}}},_=(e,t,r,n=R)=>F(!1,L(e,t,r,n)),D=()=>"object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,q={bytesToHex:v,hexToBytes:$,concatBytes:I,mod:b,invert:O,randomBytes:(e=32)=>{let t=D();return t&&t.getRandomValues||l("crypto.getRandomValues must be defined"),t.getRandomValues(f(e))},sha512Async:async(...e)=>{let t=D(),r=t&&t.subtle;r||l("etc.sha512Async or crypto.subtle must be defined");let n=I(...e);return f(await r.digest("SHA-512",n.buffer))},sha512Sync:void 0};Object.defineProperties(q,{sha512Sync:{configurable:!1,get:()=>n,set(e){n||(n=e)}}});let H=()=>{let e=[],t=y,r=t;for(let n=0;n<33;n++){r=t,e.push(r);for(let n=1;n<128;n++)r=r.add(t),e.push(r);t=r.double()}return e},V=e=>{let t=i||(i=H()),r=(e,t)=>{let r=t.negate();return e?r:t},n=g,a=y,s=BigInt(255),o=BigInt(8);for(let i=0;i<33;i++){let l=128*i,c=Number(e&s);e>>=o,c>128&&(c-=256,e+=1n);let u=l+Math.abs(c)-1,d=i%2!=0,f=c<0;0===c?a=a.add(r(d,t[l])):n=n.add(r(f,t[u]))}return{p:n,f:a}}},44382:(e,t,r)=>{function n(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function i(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}r.d(t,{o:()=>g}),(e,t)=>t.toString(16).padStart(2,"0");function s(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),n(e),e}class o{clone(){return this._cloneInto()}}class l extends o{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=a(this.buffer)}update(e){i(this);let{view:t,buffer:r,blockLen:n}=this,o=(e=s(e)).length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);if(s===n){let t=a(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){i(this),function(e,t){n(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:o}=this,{pos:l}=this;t[l++]=128,this.buffer.subarray(l).fill(0),this.padOffset>s-l&&(this.process(r,0),l=0);for(let e=l;e<s;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),l=n?4:0,c=n?0:4;e.setUint32(t+l,s,n),e.setUint32(t+c,o,n)})(r,s-8,BigInt(8*this.length),o),this.process(r,0);let c=a(e),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=u/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)c.setUint32(4*e,f[e],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:a,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=a,n%t&&e.buffer.set(r),e}}let c=BigInt(4294967296-1),u=BigInt(32);function d(e,t=!1){return t?{h:Number(e&c),l:Number(e>>u&c)}:{h:0|Number(e>>u&c),l:0|Number(e&c)}}let f={fromBig:d,split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:a,l:s}=d(e[i],t);[r[i],n[i]]=[a,s]}return[r,n]},toBig:(e,t)=>BigInt(e>>>0)<<u|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:function(e,t,r