@towns-labs/wallet 7.2.0 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ var _=($,J)=>()=>($&&(J=$($=0)),J);function Y$($,{strict:J=!0}={}){if(!$)return!1;if(typeof $!=="string")return!1;return J?/^0x[0-9a-fA-F]*$/.test($):$.startsWith("0x")}function y($){if(Y$($,{strict:!1}))return Math.ceil(($.length-2)/2);return $.length}var I$=()=>{};var YJ="2.45.1";function A8($,J){if(J?.($))return $;if($&&typeof $==="object"&&"cause"in $&&$.cause!==void 0)return A8($.cause,J);return J?null:$}var XJ,z;var a=_(()=>{XJ={getDocsUrl:({docsBaseUrl:$,docsPath:J="",docsSlug:Q})=>J?`${$??"https://viem.sh"}${J}${Q?`#${Q}`:""}`:void 0,version:`viem@${YJ}`};z=class z extends Error{constructor($,J={}){let Q=(()=>{if(J.cause instanceof z)return J.cause.details;if(J.cause?.message)return J.cause.message;return J.details})(),Y=(()=>{if(J.cause instanceof z)return J.cause.docsPath||J.docsPath;return J.docsPath})(),X=XJ.getDocsUrl?.({...J,docsPath:Y}),Z=[$||"An error occurred.","",...J.metaMessages?[...J.metaMessages,""]:[],...X?[`Docs: ${X}`]:[],...Q?[`Details: ${Q}`]:[],...XJ.version?[`Version: ${XJ.version}`]:[]].join(`
2
+ `);super(Z,J.cause?{cause:J.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=Q,this.docsPath=Y,this.metaMessages=J.metaMessages,this.name=J.name??this.name,this.shortMessage=$,this.version=YJ}walk($){return A8(this,$)}}});var ZJ,qJ,GJ,KJ,NJ,WJ;var MJ=_(()=>{I$();a();ZJ=class ZJ extends z{constructor({expectedLength:$,givenLength:J,type:Q}){super([`ABI encoding array length mismatch for type ${Q}.`,`Expected length: ${$}`,`Given length: ${J}`].join(`
3
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}};qJ=class qJ extends z{constructor({expectedSize:$,value:J}){super(`Size of bytes "${J}" (bytes${y(J)}) does not match expected size (bytes${$}).`,{name:"AbiEncodingBytesSizeMismatchError"})}};GJ=class GJ extends z{constructor({expectedLength:$,givenLength:J}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${$}`,`Given length (values): ${J}`].join(`
4
+ `),{name:"AbiEncodingLengthMismatchError"})}};KJ=class KJ extends z{constructor({expectedSize:$,givenSize:J}){super(`Expected bytes${$}, got bytes${J}.`,{name:"BytesSizeMismatchError"})}};NJ=class NJ extends z{constructor($,{docsPath:J}){super([`Type "${$}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
5
+ `),{docsPath:J,name:"InvalidAbiEncodingType"})}};WJ=class WJ extends z{constructor($){super([`Value "${$}" is not a valid array.`].join(`
6
+ `),{name:"InvalidArrayError"})}}});var f0,B0;var UJ=_(()=>{a();f0=class f0 extends z{constructor({offset:$,position:J,size:Q}){super(`Slice ${J==="start"?"starting":"ending"} at offset "${$}" is out-of-bounds (size: ${Q}).`,{name:"SliceOffsetOutOfBoundsError"})}};B0=class B0 extends z{constructor({size:$,targetSize:J,type:Q}){super(`${Q.charAt(0).toUpperCase()}${Q.slice(1).toLowerCase()} size (${$}) exceeds padding size (${J}).`,{name:"SizeExceedsPaddingSizeError"})}}});function T$($,{dir:J,size:Q=32}={}){if(typeof $==="string")return C$($,{dir:J,size:Q});return FY($,{dir:J,size:Q})}function C$($,{dir:J,size:Q=32}={}){if(Q===null)return $;let Y=$.replace("0x","");if(Y.length>Q*2)throw new B0({size:Math.ceil(Y.length/2),targetSize:Q,type:"hex"});return`0x${Y[J==="right"?"padEnd":"padStart"](Q*2,"0")}`}function FY($,{dir:J,size:Q=32}={}){if(Q===null)return $;if($.length>Q)throw new B0({size:$.length,targetSize:Q,type:"bytes"});let Y=new Uint8Array(Q);for(let X=0;X<Q;X++){let Z=J==="right";Y[Z?X:Q-X-1]=$[Z?X:$.length-X-1]}return Y}var L0=_(()=>{UJ()});var F$,DJ;var S0=_(()=>{a();F$=class F$ extends z{constructor({max:$,min:J,signed:Q,size:Y,value:X}){super(`Number "${X}" is not in safe ${Y?`${Y*8}-bit ${Q?"signed":"unsigned"} `:""}integer range ${$?`(${J} to ${$})`:`(above ${J})`}`,{name:"IntegerOutOfRangeError"})}};DJ=class DJ extends z{constructor({givenSize:$,maxSize:J}){super(`Size cannot exceed ${J} bytes. Given size: ${$} bytes.`,{name:"SizeOverflowError"})}}});function W0($,{dir:J="left"}={}){let Q=typeof $==="string"?$.replace("0x",""):$,Y=0;for(let X=0;X<Q.length-1;X++)if(Q[J==="left"?X:Q.length-X-1].toString()==="0")Y++;else break;if(Q=J==="left"?Q.slice(Y):Q.slice(0,Q.length-Y),typeof $==="string"){if(Q.length===1&&J==="right")Q=`${Q}0`;return`0x${Q.length%2===1?`0${Q}`:Q}`}return Q}function k$($,{size:J}){if(y($)>J)throw new DJ({givenSize:y($),maxSize:J})}function T0($,J={}){let{signed:Q}=J;if(J.size)k$($,{size:J.size});let Y=BigInt($);if(!Q)return Y;let X=($.length-2)/2,Z=(1n<<BigInt(X)*8n-1n)-1n;if(Y<=Z)return Y;return Y-BigInt(`0x${"f".padStart(X*2,"f")}`)-1n}function j8($,J={}){let Q=T0($,J),Y=Number(Q);if(!Number.isSafeInteger(Y))throw new F$({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:J.signed,size:J.size,value:`${Q}n`});return Y}var M0=_(()=>{S0();I$()});function X$($,J={}){if(typeof $==="number"||typeof $==="bigint")return R($,J);if(typeof $==="string")return a$($,J);if(typeof $==="boolean")return VJ($,J);return n($,J)}function VJ($,J={}){let Q=`0x${Number($)}`;if(typeof J.size==="number")return k$(Q,{size:J.size}),T$(Q,{size:J.size});return Q}function n($,J={}){let Q="";for(let X=0;X<$.length;X++)Q+=bY[$[X]];let Y=`0x${Q}`;if(typeof J.size==="number")return k$(Y,{size:J.size}),T$(Y,{dir:"right",size:J.size});return Y}function R($,J={}){let{signed:Q,size:Y}=J,X=BigInt($),Z;if(Y)if(Q)Z=(1n<<BigInt(Y)*8n-1n)-1n;else Z=2n**(BigInt(Y)*8n)-1n;else if(typeof $==="number")Z=BigInt(Number.MAX_SAFE_INTEGER);let q=typeof Z==="bigint"&&Q?-Z-1n:0;if(Z&&X>Z||X<q){let G=typeof $==="bigint"?"n":"";throw new F$({max:Z?`${Z}${G}`:void 0,min:`${q}${G}`,signed:Q,size:Y,value:`${$}${G}`})}let K=`0x${(Q&&X<0?(1n<<BigInt(Y*8))+BigInt(X):X).toString(16)}`;if(Y)return T$(K,{size:Y});return K}function a$($,J={}){let Q=vY.encode($);return n(Q,J)}var bY,vY;var u=_(()=>{S0();L0();M0();bY=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0"));vY=new TextEncoder});function k0($,J={}){if(typeof $==="number"||typeof $==="bigint")return mY($,J);if(typeof $==="boolean")return yY($,J);if(Y$($))return l($,J);return IJ($,J)}function yY($,J={}){let Q=new Uint8Array(1);if(Q[0]=Number($),typeof J.size==="number")return k$(Q,{size:J.size}),T$(Q,{size:J.size});return Q}function w8($){if($>=O$.zero&&$<=O$.nine)return $-O$.zero;if($>=O$.A&&$<=O$.F)return $-(O$.A-10);if($>=O$.a&&$<=O$.f)return $-(O$.a-10);return}function l($,J={}){let Q=$;if(J.size)k$(Q,{size:J.size}),Q=T$(Q,{dir:"right",size:J.size});let Y=Q.slice(2);if(Y.length%2)Y=`0${Y}`;let X=Y.length/2,Z=new Uint8Array(X);for(let q=0,K=0;q<X;q++){let G=w8(Y.charCodeAt(K++)),N=w8(Y.charCodeAt(K++));if(G===void 0||N===void 0)throw new z(`Invalid byte sequence ("${Y[K-2]}${Y[K-1]}" in "${Y}").`);Z[q]=G*16+N}return Z}function mY($,J){let Q=R($,J);return l(Q)}function IJ($,J={}){let Q=gY.encode($);if(typeof J.size==="number")return k$(Q,{size:J.size}),T$(Q,{dir:"right",size:J.size});return Q}var gY,O$;var q$=_(()=>{a();L0();M0();u();gY=new TextEncoder;O$={zero:48,nine:57,A:65,F:70,a:97,f:102}});function uY($,J=!1){if(J)return{h:Number($&P0),l:Number($>>z8&P0)};return{h:Number($>>z8&P0)|0,l:Number($&P0)|0}}function E8($,J=!1){let Q=$.length,Y=new Uint32Array(Q),X=new Uint32Array(Q);for(let Z=0;Z<Q;Z++){let{h:q,l:K}=uY($[Z],J);[Y[Z],X[Z]]=[q,K]}return[Y,X]}var P0,z8,R8=($,J,Q)=>$<<Q|J>>>32-Q,f8=($,J,Q)=>J<<Q|$>>>32-Q,B8=($,J,Q)=>J<<Q-32|$>>>64-Q,L8=($,J,Q)=>$<<Q-32|J>>>64-Q;var S8=_(()=>{P0=BigInt(4294967295),z8=BigInt(32)});import*as A$ from"node:crypto";var b$;var T8=_(()=>{b$=A$&&typeof A$==="object"&&"webcrypto"in A$?A$.webcrypto:A$&&typeof A$==="object"&&("randomBytes"in A$)?A$:void 0});function hY($){return $ instanceof Uint8Array||ArrayBuffer.isView($)&&$.constructor.name==="Uint8Array"}function v$($){if(!Number.isSafeInteger($)||$<0)throw Error("positive integer expected, got "+$)}function M$($,...J){if(!hY($))throw Error("Uint8Array expected");if(J.length>0&&!J.includes($.length))throw Error("Uint8Array expected of length "+J+", got length="+$.length)}function k8($){if(typeof $!=="function"||typeof $.create!=="function")throw Error("Hash should be wrapped by utils.createHasher");v$($.outputLen),v$($.blockLen)}function j$($,J=!0){if($.destroyed)throw Error("Hash instance has been destroyed");if(J&&$.finished)throw Error("Hash#digest() has already been called")}function H0($,J){M$($);let Q=J.outputLen;if($.length<Q)throw Error("digestInto() expects output buffer of length at least "+Q)}function P8($){return new Uint32Array($.buffer,$.byteOffset,Math.floor($.byteLength/4))}function U$(...$){for(let J=0;J<$.length;J++)$[J].fill(0)}function x0($){return new DataView($.buffer,$.byteOffset,$.byteLength)}function G$($,J){return $<<32-J|$>>>J}function cY($){return $<<24&4278190080|$<<8&16711680|$>>>8&65280|$>>>24&255}function lY($){for(let J=0;J<$.length;J++)$[J]=cY($[J]);return $}function pY($){if(typeof $!=="string")throw Error("string expected");return new Uint8Array(new TextEncoder().encode($))}function g$($){if(typeof $==="string")$=pY($);return M$($),$}function H8(...$){let J=0;for(let Y=0;Y<$.length;Y++){let X=$[Y];M$(X),J+=X.length}let Q=new Uint8Array(J);for(let Y=0,X=0;Y<$.length;Y++){let Z=$[Y];Q.set(Z,X),X+=Z.length}return Q}class y${}function _0($){let J=(Y)=>$().update(g$(Y)).digest(),Q=$();return J.outputLen=Q.outputLen,J.blockLen=Q.blockLen,J.create=()=>$(),J}function x8($=32){if(b$&&typeof b$.getRandomValues==="function")return b$.getRandomValues(new Uint8Array($));if(b$&&typeof b$.randomBytes==="function")return Uint8Array.from(b$.randomBytes($));throw Error("crypto.getRandomValues must be defined")}var dY,CJ;var m$=_(()=>{T8();/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */dY=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();CJ=dY?($)=>$:lY});function eY($,J=24){let Q=new Uint32Array(10);for(let Y=24-J;Y<24;Y++){for(let q=0;q<10;q++)Q[q]=$[q]^$[q+10]^$[q+20]^$[q+30]^$[q+40];for(let q=0;q<10;q+=2){let K=(q+8)%10,G=(q+2)%10,N=Q[G],M=Q[G+1],O=_8(N,M,1)^Q[K],j=F8(N,M,1)^Q[K+1];for(let I=0;I<50;I+=10)$[q+I]^=O,$[q+I+1]^=j}let X=$[2],Z=$[3];for(let q=0;q<24;q++){let K=v8[q],G=_8(X,Z,K),N=F8(X,Z,K),M=b8[q];X=$[M],Z=$[M+1],$[M]=G,$[M+1]=N}for(let q=0;q<50;q+=10){for(let K=0;K<10;K++)Q[K]=$[q+K];for(let K=0;K<10;K++)$[q+K]^=~Q[(K+2)%10]&Q[(K+4)%10]}$[0]^=aY[Y],$[1]^=sY[Y]}U$(Q)}var nY,U0,oY,iY,rY,tY,b8,v8,g8,y8,aY,sY,_8=($,J,Q)=>Q>32?B8($,J,Q):R8($,J,Q),F8=($,J,Q)=>Q>32?L8($,J,Q):f8($,J,Q),OJ,$9=($,J,Q)=>_0(()=>new OJ(J,$,Q)),m8;var u8=_(()=>{S8();m$();nY=BigInt(0),U0=BigInt(1),oY=BigInt(2),iY=BigInt(7),rY=BigInt(256),tY=BigInt(113),b8=[],v8=[],g8=[];for(let $=0,J=U0,Q=1,Y=0;$<24;$++){[Q,Y]=[Y,(2*Q+3*Y)%5],b8.push(2*(5*Y+Q)),v8.push(($+1)*($+2)/2%64);let X=nY;for(let Z=0;Z<7;Z++)if(J=(J<<U0^(J>>iY)*tY)%rY,J&oY)X^=U0<<(U0<<BigInt(Z))-U0;g8.push(X)}y8=E8(g8,!0),aY=y8[0],sY=y8[1];OJ=class OJ extends y${constructor($,J,Q,Y=!1,X=24){super();if(this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=$,this.suffix=J,this.outputLen=Q,this.enableXOF=Y,this.rounds=X,v$(Q),!(0<$&&$<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=P8(this.state)}clone(){return this._cloneInto()}keccak(){CJ(this.state32),eY(this.state32,this.rounds),CJ(this.state32),this.posOut=0,this.pos=0}update($){j$(this),$=g$($),M$($);let{blockLen:J,state:Q}=this,Y=$.length;for(let X=0;X<Y;){let Z=Math.min(J-this.pos,Y-X);for(let q=0;q<Z;q++)Q[this.pos++]^=$[X++];if(this.pos===J)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:$,suffix:J,pos:Q,blockLen:Y}=this;if($[Q]^=J,(J&128)!==0&&Q===Y-1)this.keccak();$[Y-1]^=128,this.keccak()}writeInto($){j$(this,!1),M$($),this.finish();let J=this.state,{blockLen:Q}=this;for(let Y=0,X=$.length;Y<X;){if(this.posOut>=Q)this.keccak();let Z=Math.min(Q-this.posOut,X-Y);$.set(J.subarray(this.posOut,this.posOut+Z),Y),this.posOut+=Z,Y+=Z}return $}xofInto($){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto($)}xof($){return v$($),this.xofInto(new Uint8Array($))}digestInto($){if(H0($,this),this.finished)throw Error("digest() was already called");return this.writeInto($),this.destroy(),$}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,U$(this.state)}_cloneInto($){let{blockLen:J,suffix:Q,outputLen:Y,rounds:X,enableXOF:Z}=this;return $||($=new OJ(J,Q,Y,Z,X)),$.state32.set(this.state32),$.pos=this.pos,$.posOut=this.posOut,$.finished=this.finished,$.rounds=X,$.suffix=Q,$.outputLen=Y,$.enableXOF=Z,$.destroyed=this.destroyed,$}};m8=(()=>$9(1,136,32))()});function h($,J){let Q=J||"hex",Y=m8(Y$($,{strict:!1})?k0($):$);if(Q==="bytes")return Y;return X$(Y)}var u$=_(()=>{u8();q$();u()});var p;var h$=_(()=>{a();p=class p extends z{constructor({address:$}){super(`Address "${$}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var D0;var AJ=_(()=>{D0=class D0 extends Map{constructor($){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=$}get($){let J=super.get($);if(super.has($)&&J!==void 0)this.delete($),super.set($,J);return J}set($,J){if(super.set($,J),this.maxSize&&this.size>this.maxSize){let Q=this.keys().next().value;if(Q)this.delete(Q)}return this}}});function s$($,J){if(jJ.has(`${$}.${J}`))return jJ.get(`${$}.${J}`);let Q=J?`${J}${$.toLowerCase()}`:$.substring(2).toLowerCase(),Y=h(IJ(Q),"bytes"),X=(J?Q.substring(`${J}0x`.length):Q).split("");for(let q=0;q<40;q+=2){if(Y[q>>1]>>4>=8&&X[q])X[q]=X[q].toUpperCase();if((Y[q>>1]&15)>=8&&X[q+1])X[q+1]=X[q+1].toUpperCase()}let Z=`0x${X.join("")}`;return jJ.set(`${$}.${J}`,Z),Z}function F0($,J){if(!o($,{strict:!1}))throw new p({address:$});return s$($,J)}var jJ;var b0=_(()=>{h$();q$();u$();AJ();d$();jJ=new D0(8192)});function o($,J){let{strict:Q=!0}=J??{},Y=`${$}.${Q}`;if(wJ.has(Y))return wJ.get(Y);let X=(()=>{if(!J9.test($))return!1;if($.toLowerCase()===$)return!0;if(Q)return s$($)===$;return!0})();return wJ.set(Y,X),X}var J9,wJ;var d$=_(()=>{AJ();b0();J9=/^0x[a-fA-F0-9]{40}$/,wJ=new D0(8192)});function K$($){if(typeof $[0]==="string")return P$($);return Q9($)}function Q9($){let J=0;for(let X of $)J+=X.length;let Q=new Uint8Array(J),Y=0;for(let X of $)Q.set(X,Y),Y+=X.length;return Q}function P$($){return`0x${$.reduce((J,Q)=>J+Q.replace("0x",""),"")}`}function v0($,J,Q,{strict:Y}={}){if(Y$($,{strict:!1}))return X9($,J,Q,{strict:Y});return Y9($,J,Q,{strict:Y})}function h8($,J){if(typeof J==="number"&&J>0&&J>y($)-1)throw new f0({offset:J,position:"start",size:y($)})}function d8($,J,Q){if(typeof J==="number"&&typeof Q==="number"&&y($)!==Q-J)throw new f0({offset:Q,position:"end",size:y($)})}function Y9($,J,Q,{strict:Y}={}){h8($,J);let X=$.slice(J,Q);if(Y)d8(X,J,Q);return X}function X9($,J,Q,{strict:Y}={}){h8($,J);let X=`0x${$.replace("0x","").slice((J??0)*2,(Q??$.length)*2)}`;if(Y)d8(X,J,Q);return X}var zJ=_(()=>{UJ();I$()});var c8,g0;var EJ=_(()=>{c8=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,g0=/^(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 RJ($,J){if($.length!==J.length)throw new GJ({expectedLength:$.length,givenLength:J.length});let Q=Z9({params:$,values:J}),Y=BJ(Q);if(Y.length===0)return"0x";return Y}function Z9({params:$,values:J}){let Q=[];for(let Y=0;Y<$.length;Y++)Q.push(fJ({param:$[Y],value:J[Y]}));return Q}function fJ({param:$,value:J}){let Q=D9($.type);if(Q){let[Y,X]=Q;return G9(J,{length:Y,param:{...$,type:X}})}if($.type==="tuple")return U9(J,{param:$});if($.type==="address")return q9(J);if($.type==="bool")return N9(J);if($.type.startsWith("uint")||$.type.startsWith("int")){let Y=$.type.startsWith("int"),[,,X="256"]=g0.exec($.type)??[];return W9(J,{signed:Y,size:Number(X)})}if($.type.startsWith("bytes"))return K9(J,{param:$});if($.type==="string")return M9(J);throw new NJ($.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function BJ($){let J=0;for(let Z=0;Z<$.length;Z++){let{dynamic:q,encoded:K}=$[Z];if(q)J+=32;else J+=y(K)}let Q=[],Y=[],X=0;for(let Z=0;Z<$.length;Z++){let{dynamic:q,encoded:K}=$[Z];if(q)Q.push(R(J+X,{size:32})),Y.push(K),X+=y(K);else Q.push(K)}return K$([...Q,...Y])}function q9($){if(!o($))throw new p({address:$});return{dynamic:!1,encoded:C$($.toLowerCase())}}function G9($,{length:J,param:Q}){let Y=J===null;if(!Array.isArray($))throw new WJ($);if(!Y&&$.length!==J)throw new ZJ({expectedLength:J,givenLength:$.length,type:`${Q.type}[${J}]`});let X=!1,Z=[];for(let q=0;q<$.length;q++){let K=fJ({param:Q,value:$[q]});if(K.dynamic)X=!0;Z.push(K)}if(Y||X){let q=BJ(Z);if(Y){let K=R(Z.length,{size:32});return{dynamic:!0,encoded:Z.length>0?K$([K,q]):K}}if(X)return{dynamic:!0,encoded:q}}return{dynamic:!1,encoded:K$(Z.map(({encoded:q})=>q))}}function K9($,{param:J}){let[,Q]=J.type.split("bytes"),Y=y($);if(!Q){let X=$;if(Y%32!==0)X=C$(X,{dir:"right",size:Math.ceil(($.length-2)/2/32)*32});return{dynamic:!0,encoded:K$([C$(R(Y,{size:32})),X])}}if(Y!==Number.parseInt(Q,10))throw new qJ({expectedSize:Number.parseInt(Q,10),value:$});return{dynamic:!1,encoded:C$($,{dir:"right"})}}function N9($){if(typeof $!=="boolean")throw new z(`Invalid boolean value: "${$}" (type: ${typeof $}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:C$(VJ($))}}function W9($,{signed:J,size:Q=256}){if(typeof Q==="number"){let Y=2n**(BigInt(Q)-(J?1n:0n))-1n,X=J?-Y-1n:0n;if($>Y||$<X)throw new F$({max:Y.toString(),min:X.toString(),signed:J,size:Q/8,value:$.toString()})}return{dynamic:!1,encoded:R($,{size:32,signed:J})}}function M9($){let J=a$($),Q=Math.ceil(y(J)/32),Y=[];for(let X=0;X<Q;X++)Y.push(C$(v0(J,X*32,(X+1)*32),{dir:"right"}));return{dynamic:!0,encoded:K$([C$(R(y(J),{size:32})),...Y])}}function U9($,{param:J}){let Q=!1,Y=[];for(let X=0;X<J.components.length;X++){let Z=J.components[X],q=Array.isArray($)?X:Z.name,K=fJ({param:Z,value:$[q]});if(Y.push(K),K.dynamic)Q=!0}return{dynamic:Q,encoded:Q?BJ(Y):K$(Y.map(({encoded:X})=>X))}}function D9($){let J=$.match(/^(.*)\[(\d+)?\]$/);return J?[J[2]?Number(J[2]):null,J[1]]:void 0}var l8=_(()=>{MJ();h$();a();S0();d$();L0();I$();zJ();u();EJ()});var y0,LJ,SJ;var p8=_(()=>{a();y0=class y0 extends z{constructor({offset:$}){super(`Offset \`${$}\` cannot be negative.`,{name:"NegativeOffsetError"})}};LJ=class LJ extends z{constructor({length:$,position:J}){super(`Position \`${J}\` is out of bounds (\`0 < position < ${$}\`).`,{name:"PositionOutOfBoundsError"})}};SJ=class SJ extends z{constructor({count:$,limit:J}){super(`Recursive read limit of \`${J}\` exceeded (recursive read count: \`${$}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function m0($,{recursiveReadLimit:J=8192}={}){let Q=Object.create(V9);return Q.bytes=$,Q.dataView=new DataView($.buffer??$,$.byteOffset,$.byteLength),Q.positionReadCount=new Map,Q.recursiveReadLimit=J,Q}var V9;var TJ=_(()=>{p8();V9={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 SJ({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition($){if($<0||$>this.bytes.length-1)throw new LJ({length:this.bytes.length,position:$})},decrementPosition($){if($<0)throw new y0({offset:$});let J=this.position-$;this.assertPosition(J),this.position=J},getReadCount($){return this.positionReadCount.get($||this.position)||0},incrementPosition($){if($<0)throw new y0({offset:$});let J=this.position+$;this.assertPosition(J),this.position=J},inspectByte($){let J=$??this.position;return this.assertPosition(J),this.bytes[J]},inspectBytes($,J){let Q=J??this.position;return this.assertPosition(Q+$-1),this.bytes.subarray(Q,Q+$)},inspectUint8($){let J=$??this.position;return this.assertPosition(J),this.bytes[J]},inspectUint16($){let J=$??this.position;return this.assertPosition(J+1),this.dataView.getUint16(J)},inspectUint24($){let J=$??this.position;return this.assertPosition(J+2),(this.dataView.getUint16(J)<<8)+this.dataView.getUint8(J+2)},inspectUint32($){let J=$??this.position;return this.assertPosition(J+3),this.dataView.getUint32(J)},pushByte($){this.assertPosition(this.position),this.bytes[this.position]=$,this.position++},pushBytes($){this.assertPosition(this.position+$.length-1),this.bytes.set($,this.position),this.position+=$.length},pushUint8($){this.assertPosition(this.position),this.bytes[this.position]=$,this.position++},pushUint16($){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,$),this.position+=2},pushUint24($){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,$>>8),this.dataView.setUint8(this.position+2,$&255),this.position+=3},pushUint32($){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,$),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let $=this.inspectByte();return this.position++,$},readBytes($,J){this.assertReadLimit(),this._touch();let Q=this.inspectBytes($);return this.position+=J??$,Q},readUint8(){this.assertReadLimit(),this._touch();let $=this.inspectUint8();return this.position+=1,$},readUint16(){this.assertReadLimit(),this._touch();let $=this.inspectUint16();return this.position+=2,$},readUint24(){this.assertReadLimit(),this._touch();let $=this.inspectUint24();return this.position+=3,$},readUint32(){this.assertReadLimit(),this._touch();let $=this.inspectUint32();return this.position+=4,$},get remaining(){return this.bytes.length-this.position},setPosition($){let J=this.position;return this.assertPosition($),this.position=$,()=>this.position=J},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let $=this.getReadCount();if(this.positionReadCount.set(this.position,$+1),$>0)this.recursiveReadCount++}}});var n8=($,J,Q)=>JSON.stringify($,(Y,X)=>{let Z=typeof X==="bigint"?X.toString():X;return typeof J==="function"?J(Y,Z):Z},Q);var o8;var i8=_(()=>{o8={ether:-9,wei:9}});function r8($,J){let Q=$.toString(),Y=Q.startsWith("-");if(Y)Q=Q.slice(1);Q=Q.padStart(J,"0");let[X,Z]=[Q.slice(0,Q.length-J),Q.slice(Q.length-J)];return Z=Z.replace(/(0+)$/,""),`${Y?"-":""}${X||"0"}${Z?`.${Z}`:""}`}function V0($,J="wei"){return r8($,o8[J])}var t8=_(()=>{i8()});function I9($){let J=Object.entries($).map(([Y,X])=>{if(X===void 0||X===!1)return null;return[Y,X]}).filter(Boolean),Q=J.reduce((Y,[X])=>Math.max(Y,X.length),0);return J.map(([Y,X])=>` ${`${Y}:`.padEnd(Q+1)} ${X}`).join(`
7
+ `)}var kJ,PJ,HJ;var u0=_(()=>{a();kJ=class kJ extends z{constructor({v:$}){super(`Invalid \`v\` value "${$}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}};PJ=class PJ extends z{constructor({transaction:$}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",I9($),"}","","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"})}};HJ=class HJ extends z{constructor({storageKey:$}){super(`Size for storage key "${$}" is invalid. Expected 32 bytes. Got ${Math.floor(($.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}});var xJ,e$,JQ,QQ,YQ,XQ,ZQ,qQ,GQ,KQ,h0;var NQ=_(()=>{t8();a();xJ=class xJ extends z{constructor({cause:$,message:J}={}){let Q=J?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${Q?`with reason: ${Q}`:"for an unknown reason"}.`,{cause:$,name:"ExecutionRevertedError"})}};Object.defineProperty(xJ,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(xJ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});e$=class e$ extends z{constructor({cause:$,maxFeePerGas:J}={}){super(`The fee cap (\`maxFeePerGas\`${J?` = ${V0(J)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:$,name:"FeeCapTooHighError"})}};Object.defineProperty(e$,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});JQ=class JQ extends z{constructor({cause:$,maxFeePerGas:J}={}){super(`The fee cap (\`maxFeePerGas\`${J?` = ${V0(J)}`:""} gwei) cannot be lower than the block base fee.`,{cause:$,name:"FeeCapTooLowError"})}};Object.defineProperty(JQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});QQ=class QQ extends z{constructor({cause:$,nonce:J}={}){super(`Nonce provided for the transaction ${J?`(${J}) `:""}is higher than the next one expected.`,{cause:$,name:"NonceTooHighError"})}};Object.defineProperty(QQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});YQ=class YQ extends z{constructor({cause:$,nonce:J}={}){super([`Nonce provided for the transaction ${J?`(${J}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
8
+ `),{cause:$,name:"NonceTooLowError"})}};Object.defineProperty(YQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});XQ=class XQ extends z{constructor({cause:$,nonce:J}={}){super(`Nonce provided for the transaction ${J?`(${J}) `:""}exceeds the maximum allowed nonce.`,{cause:$,name:"NonceMaxValueError"})}};Object.defineProperty(XQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});ZQ=class ZQ extends z{constructor({cause:$}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
9
+ `),{cause:$,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(ZQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});qQ=class qQ extends z{constructor({cause:$,gas:J}={}){super(`The amount of gas ${J?`(${J}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:$,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(qQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});GQ=class GQ extends z{constructor({cause:$,gas:J}={}){super(`The amount of gas ${J?`(${J}) `:""}provided for the transaction is too low.`,{cause:$,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(GQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});KQ=class KQ extends z{constructor({cause:$}){super("The transaction type is not supported for this chain.",{cause:$,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(KQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});h0=class h0 extends z{constructor({cause:$,maxPriorityFeePerGas:J,maxFeePerGas:Q}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${J?` = ${V0(J)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${Q?` = ${V0(Q)} gwei`:""}).`].join(`
10
+ `),{cause:$,name:"TipAboveFeeCapError"})}};Object.defineProperty(h0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/})});var Y1,X1,Z1,q1,G1,K1,N1,W1,M1,U1,D1,V1,I1,C1,O1,A1,j1,w1,z1,E1,R1,f1,B1,L1,S1,T1,k1,P1,H1,x1,_1,F1,b1,v1,g1,y1,m1,u1,h1,d1,c1,l1,p1,n1,o1,i1,r1,t1,a1,s1,e1,$q,Jq,Qq,Yq,Xq,Zq,qq,Gq,Kq,Nq,Wq,Mq,Uq,Dq,Vq,Iq,Cq,Oq,Aq,jq,wq,zq,Eq,Rq,fq,Bq,Lq,Sq,Tq,kq,Pq,Hq,xq,_q,Fq,bq,vq,gq,yq,mq,uq,hq,dq,cq,d0;var WQ=_(()=>{Y1=2n**(8n-1n)-1n,X1=2n**(16n-1n)-1n,Z1=2n**(24n-1n)-1n,q1=2n**(32n-1n)-1n,G1=2n**(40n-1n)-1n,K1=2n**(48n-1n)-1n,N1=2n**(56n-1n)-1n,W1=2n**(64n-1n)-1n,M1=2n**(72n-1n)-1n,U1=2n**(80n-1n)-1n,D1=2n**(88n-1n)-1n,V1=2n**(96n-1n)-1n,I1=2n**(104n-1n)-1n,C1=2n**(112n-1n)-1n,O1=2n**(120n-1n)-1n,A1=2n**(128n-1n)-1n,j1=2n**(136n-1n)-1n,w1=2n**(144n-1n)-1n,z1=2n**(152n-1n)-1n,E1=2n**(160n-1n)-1n,R1=2n**(168n-1n)-1n,f1=2n**(176n-1n)-1n,B1=2n**(184n-1n)-1n,L1=2n**(192n-1n)-1n,S1=2n**(200n-1n)-1n,T1=2n**(208n-1n)-1n,k1=2n**(216n-1n)-1n,P1=2n**(224n-1n)-1n,H1=2n**(232n-1n)-1n,x1=2n**(240n-1n)-1n,_1=2n**(248n-1n)-1n,F1=2n**(256n-1n)-1n,b1=-(2n**(8n-1n)),v1=-(2n**(16n-1n)),g1=-(2n**(24n-1n)),y1=-(2n**(32n-1n)),m1=-(2n**(40n-1n)),u1=-(2n**(48n-1n)),h1=-(2n**(56n-1n)),d1=-(2n**(64n-1n)),c1=-(2n**(72n-1n)),l1=-(2n**(80n-1n)),p1=-(2n**(88n-1n)),n1=-(2n**(96n-1n)),o1=-(2n**(104n-1n)),i1=-(2n**(112n-1n)),r1=-(2n**(120n-1n)),t1=-(2n**(128n-1n)),a1=-(2n**(136n-1n)),s1=-(2n**(144n-1n)),e1=-(2n**(152n-1n)),$q=-(2n**(160n-1n)),Jq=-(2n**(168n-1n)),Qq=-(2n**(176n-1n)),Yq=-(2n**(184n-1n)),Xq=-(2n**(192n-1n)),Zq=-(2n**(200n-1n)),qq=-(2n**(208n-1n)),Gq=-(2n**(216n-1n)),Kq=-(2n**(224n-1n)),Nq=-(2n**(232n-1n)),Wq=-(2n**(240n-1n)),Mq=-(2n**(248n-1n)),Uq=-(2n**(256n-1n)),Dq=2n**8n-1n,Vq=2n**16n-1n,Iq=2n**24n-1n,Cq=2n**32n-1n,Oq=2n**40n-1n,Aq=2n**48n-1n,jq=2n**56n-1n,wq=2n**64n-1n,zq=2n**72n-1n,Eq=2n**80n-1n,Rq=2n**88n-1n,fq=2n**96n-1n,Bq=2n**104n-1n,Lq=2n**112n-1n,Sq=2n**120n-1n,Tq=2n**128n-1n,kq=2n**136n-1n,Pq=2n**144n-1n,Hq=2n**152n-1n,xq=2n**160n-1n,_q=2n**168n-1n,Fq=2n**176n-1n,bq=2n**184n-1n,vq=2n**192n-1n,gq=2n**200n-1n,yq=2n**208n-1n,mq=2n**216n-1n,uq=2n**224n-1n,hq=2n**232n-1n,dq=2n**240n-1n,cq=2n**248n-1n,d0=2n**256n-1n});function A9($,J,Q,Y){if(typeof $.setBigUint64==="function")return $.setBigUint64(J,Q,Y);let X=BigInt(32),Z=BigInt(4294967295),q=Number(Q>>X&Z),K=Number(Q&Z),G=Y?4:0,N=Y?0:4;$.setUint32(J+G,q,Y),$.setUint32(J+N,K,Y)}function MQ($,J,Q){return $&J^~$&Q}function UQ($,J,Q){return $&J^$&Q^J&Q}var _J,z$;var DQ=_(()=>{m$();_J=class _J extends y${constructor($,J,Q,Y){super();this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=$,this.outputLen=J,this.padOffset=Q,this.isLE=Y,this.buffer=new Uint8Array($),this.view=x0(this.buffer)}update($){j$(this),$=g$($),M$($);let{view:J,buffer:Q,blockLen:Y}=this,X=$.length;for(let Z=0;Z<X;){let q=Math.min(Y-this.pos,X-Z);if(q===Y){let K=x0($);for(;Y<=X-Z;Z+=Y)this.process(K,Z);continue}if(Q.set($.subarray(Z,Z+q),this.pos),this.pos+=q,Z+=q,this.pos===Y)this.process(J,0),this.pos=0}return this.length+=$.length,this.roundClean(),this}digestInto($){j$(this),H0($,this),this.finished=!0;let{buffer:J,view:Q,blockLen:Y,isLE:X}=this,{pos:Z}=this;if(J[Z++]=128,U$(this.buffer.subarray(Z)),this.padOffset>Y-Z)this.process(Q,0),Z=0;for(let M=Z;M<Y;M++)J[M]=0;A9(Q,Y-8,BigInt(this.length*8),X),this.process(Q,0);let q=x0($),K=this.outputLen;if(K%4)throw Error("_sha2: outputLen should be aligned to 32bit");let G=K/4,N=this.get();if(G>N.length)throw Error("_sha2: outputLen bigger than state");for(let M=0;M<G;M++)q.setUint32(4*M,N[M],X)}digest(){let{buffer:$,outputLen:J}=this;this.digestInto($);let Q=$.slice(0,J);return this.destroy(),Q}_cloneInto($){$||($=new this.constructor),$.set(...this.get());let{blockLen:J,buffer:Q,length:Y,finished:X,destroyed:Z,pos:q}=this;if($.destroyed=Z,$.finished=X,$.length=Y,$.pos=q,Y%J)$.buffer.set(Q);return $}clone(){return this._cloneInto()}};z$=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var j9,H$,FJ,p0;var bJ=_(()=>{DQ();m$();j9=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);FJ=class FJ extends _J{constructor($=32){super(64,$,8,!1);this.A=z$[0]|0,this.B=z$[1]|0,this.C=z$[2]|0,this.D=z$[3]|0,this.E=z$[4]|0,this.F=z$[5]|0,this.G=z$[6]|0,this.H=z$[7]|0}get(){let{A:$,B:J,C:Q,D:Y,E:X,F:Z,G:q,H:K}=this;return[$,J,Q,Y,X,Z,q,K]}set($,J,Q,Y,X,Z,q,K){this.A=$|0,this.B=J|0,this.C=Q|0,this.D=Y|0,this.E=X|0,this.F=Z|0,this.G=q|0,this.H=K|0}process($,J){for(let M=0;M<16;M++,J+=4)H$[M]=$.getUint32(J,!1);for(let M=16;M<64;M++){let O=H$[M-15],j=H$[M-2],I=G$(O,7)^G$(O,18)^O>>>3,L=G$(j,17)^G$(j,19)^j>>>10;H$[M]=L+H$[M-7]+I+H$[M-16]|0}let{A:Q,B:Y,C:X,D:Z,E:q,F:K,G,H:N}=this;for(let M=0;M<64;M++){let O=G$(q,6)^G$(q,11)^G$(q,25),j=N+O+MQ(q,K,G)+j9[M]+H$[M]|0,L=(G$(Q,2)^G$(Q,13)^G$(Q,22))+UQ(Q,Y,X)|0;N=G,G=K,K=q,q=Z+j|0,Z=X,X=Y,Y=Q,Q=j+L|0}Q=Q+this.A|0,Y=Y+this.B|0,X=X+this.C|0,Z=Z+this.D|0,q=q+this.E|0,K=K+this.F|0,G=G+this.G|0,N=N+this.H|0,this.set(Q,Y,X,Z,q,K,G,N)}roundClean(){U$(H$)}destroy(){this.set(0,0,0,0,0,0,0,0),U$(this.buffer)}};p0=_0(()=>new FJ)});function $0($){return $ instanceof Uint8Array||ArrayBuffer.isView($)&&$.constructor.name==="Uint8Array"}function lJ($){if(!$0($))throw Error("Uint8Array expected")}function J0($,J){if(typeof J!=="boolean")throw Error($+" boolean expected, got "+J)}function C0($){let J=$.toString(16);return J.length&1?"0"+J:J}function LQ($){if(typeof $!=="string")throw Error("hex string expected, got "+typeof $);return $===""?cJ:BigInt("0x"+$)}function Q0($){if(lJ($),SQ)return $.toHex();let J="";for(let Q=0;Q<$.length;Q++)J+=w9[$[Q]];return J}function fQ($){if($>=E$._0&&$<=E$._9)return $-E$._0;if($>=E$.A&&$<=E$.F)return $-(E$.A-10);if($>=E$.a&&$<=E$.f)return $-(E$.a-10);return}function O0($){if(typeof $!=="string")throw Error("hex string expected, got "+typeof $);if(SQ)return Uint8Array.fromHex($);let J=$.length,Q=J/2;if(J%2)throw Error("hex string expected, got unpadded hex of length "+J);let Y=new Uint8Array(Q);for(let X=0,Z=0;X<Q;X++,Z+=2){let q=fQ($.charCodeAt(Z)),K=fQ($.charCodeAt(Z+1));if(q===void 0||K===void 0){let G=$[Z]+$[Z+1];throw Error('hex string expected, got non-hex character "'+G+'" at index '+Z)}Y[X]=q*16+K}return Y}function R$($){return LQ(Q0($))}function pJ($){return lJ($),LQ(Q0(Uint8Array.from($).reverse()))}function c$($,J){return O0($.toString(16).padStart(J*2,"0"))}function nJ($,J){return c$($,J).reverse()}function $$($,J,Q){let Y;if(typeof J==="string")try{Y=O0(J)}catch(Z){throw Error($+" must be hex string or Uint8Array, cause: "+Z)}else if($0(J))Y=Uint8Array.from(J);else throw Error($+" must be hex string or Uint8Array");let X=Y.length;if(typeof Q==="number"&&X!==Q)throw Error($+" of length "+Q+" expected, got "+X);return Y}function A0(...$){let J=0;for(let Y=0;Y<$.length;Y++){let X=$[Y];lJ(X),J+=X.length}let Q=new Uint8Array(J);for(let Y=0,X=0;Y<$.length;Y++){let Z=$[Y];Q.set(Z,X),X+=Z.length}return Q}function o0($,J,Q){return uJ($)&&uJ(J)&&uJ(Q)&&J<=$&&$<Q}function l$($,J,Q,Y){if(!o0(J,Q,Y))throw Error("expected valid "+$+": "+Q+" <= n < "+Y+", got "+J)}function TQ($){let J;for(J=0;$>cJ;$>>=dJ,J+=1);return J}function kQ($,J,Q){if(typeof $!=="number"||$<2)throw Error("hashLen must be a number");if(typeof J!=="number"||J<2)throw Error("qByteLen must be a number");if(typeof Q!=="function")throw Error("hmacFn must be a function");let Y=hJ($),X=hJ($),Z=0,q=()=>{Y.fill(1),X.fill(0),Z=0},K=(...O)=>Q(X,Y,...O),G=(O=hJ(0))=>{if(X=K(BQ([0]),O),Y=K(),O.length===0)return;X=K(BQ([1]),O),Y=K()},N=()=>{if(Z++>=1000)throw Error("drbg: tried 1000 values");let O=0,j=[];while(O<J){Y=K();let I=Y.slice();j.push(I),O+=Y.length}return A0(...j)};return(O,j)=>{q(),G(O);let I=void 0;while(!(I=j(N())))G();return q(),I}}function n$($,J,Q={}){let Y=(X,Z,q)=>{let K=z9[Z];if(typeof K!=="function")throw Error("invalid validator function");let G=$[X];if(q&&G===void 0)return;if(!K(G,$))throw Error("param "+String(X)+" is invalid. Expected "+Z+", got "+G)};for(let[X,Z]of Object.entries(J))Y(X,Z,!1);for(let[X,Z]of Object.entries(Q))Y(X,Z,!0);return $}function oJ($){let J=new WeakMap;return(Q,...Y)=>{let X=J.get(Q);if(X!==void 0)return X;let Z=$(Q,...Y);return J.set(Q,Z),Z}}var cJ,dJ,SQ,w9,E$,uJ=($)=>typeof $==="bigint"&&cJ<=$,p$=($)=>(dJ<<BigInt($))-dJ,hJ=($)=>new Uint8Array($),BQ=($)=>Uint8Array.from($),z9;var i0=_(()=>{/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */cJ=BigInt(0),dJ=BigInt(1);SQ=typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function",w9=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0"));E$={_0:48,_9:57,A:65,F:70,a:97,f:102};z9={bigint:($)=>typeof $==="bigint",function:($)=>typeof $==="function",boolean:($)=>typeof $==="boolean",string:($)=>typeof $==="string",stringOrUint8Array:($)=>typeof $==="string"||$0($),isSafeInteger:($)=>Number.isSafeInteger($),array:($)=>Array.isArray($),field:($,J)=>J.Fp.isValid($),hash:($)=>typeof $==="function"&&Number.isSafeInteger($.outputLen)}});var Y0;var PQ=_(()=>{a();Y0=class Y0 extends z{constructor({chainId:$}){super(typeof $==="number"?`Chain ID "${$}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}});var aJ,sJ=($,J,Q)=>new aJ($,J).update(Q).digest();var oQ=_(()=>{m$();aJ=class aJ extends y${constructor($,J){super();this.finished=!1,this.destroyed=!1,k8($);let Q=g$(J);if(this.iHash=$.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let Y=this.blockLen,X=new Uint8Array(Y);X.set(Q.length>Y?$.create().update(Q).digest():Q);for(let Z=0;Z<X.length;Z++)X[Z]^=54;this.iHash.update(X),this.oHash=$.create();for(let Z=0;Z<X.length;Z++)X[Z]^=106;this.oHash.update(X),U$(X)}update($){return j$(this),this.iHash.update($),this}digestInto($){j$(this),M$($,this.outputLen),this.finished=!0,this.iHash.digestInto($),this.oHash.update($),this.oHash.digestInto($),this.destroy()}digest(){let $=new Uint8Array(this.oHash.outputLen);return this.digestInto($),$}_cloneInto($){$||($=Object.create(Object.getPrototypeOf(this),{}));let{oHash:J,iHash:Q,finished:Y,destroyed:X,blockLen:Z,outputLen:q}=this;return $=$,$.finished=Y,$.destroyed=X,$.blockLen=Z,$.outputLen=q,$.oHash=J._cloneInto($.oHash),$.iHash=Q._cloneInto($.iHash),$}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};sJ.create=($,J)=>new aJ($,J)});function i($,J){let Q=$%J;return Q>=s?Q:J+Q}function J$($,J,Q){let Y=$;while(J-- >s)Y*=Y,Y%=Q;return Y}function t0($,J){if($===s)throw Error("invert: expected non-zero number");if(J<=s)throw Error("invert: expected positive modulus, got "+J);let Q=i($,J),Y=J,X=s,Z=r,q=r,K=s;while(Q!==s){let N=Y/Q,M=Y%Q,O=X-q*N,j=Z-K*N;Y=Q,Q=M,X=q,Z=K,q=O,K=j}if(Y!==r)throw Error("invert: does not exist");return i(X,J)}function sQ($,J){let Q=($.ORDER+r)/rQ,Y=$.pow(J,Q);if(!$.eql($.sqr(Y),J))throw Error("Cannot find square root");return Y}function x9($,J){let Q=($.ORDER-tQ)/aQ,Y=$.mul(J,o$),X=$.pow(Y,Q),Z=$.mul(J,X),q=$.mul($.mul(Z,o$),X),K=$.mul(Z,$.sub(q,$.ONE));if(!$.eql($.sqr(K),J))throw Error("Cannot find square root");return K}function _9($){if($<BigInt(3))throw Error("sqrt is not defined for small field");let J=$-r,Q=0;while(J%o$===s)J/=o$,Q++;let Y=o$,X=w0($);while(iQ(X,Y)===1)if(Y++>1000)throw Error("Cannot find square root: probably non-prime P");if(Q===1)return sQ;let Z=X.pow(Y,J),q=(J+r)/o$;return function(G,N){if(G.is0(N))return N;if(iQ(G,N)!==1)throw Error("Cannot find square root");let M=Q,O=G.mul(G.ONE,Z),j=G.pow(N,J),I=G.pow(N,q);while(!G.eql(j,G.ONE)){if(G.is0(j))return G.ZERO;let L=1,A=G.sqr(j);while(!G.eql(A,G.ONE))if(L++,A=G.sqr(A),L===M)throw Error("Cannot find square root");let H=r<<BigInt(M-L-1),b=G.pow(O,H);M=L,O=G.sqr(b),j=G.mul(j,O),I=G.mul(I,b)}return I}}function F9($){if($%rQ===H9)return sQ;if($%aQ===tQ)return x9;return _9($)}function eJ($){let J={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},Q=b9.reduce((Y,X)=>{return Y[X]="function",Y},J);return n$($,Q)}function v9($,J,Q){if(Q<s)throw Error("invalid exponent, negatives unsupported");if(Q===s)return $.ONE;if(Q===r)return J;let Y=$.ONE,X=J;while(Q>s){if(Q&r)Y=$.mul(Y,X);X=$.sqr(X),Q>>=r}return Y}function $8($,J,Q=!1){let Y=Array(J.length).fill(Q?$.ZERO:void 0),X=J.reduce((q,K,G)=>{if($.is0(K))return q;return Y[G]=q,$.mul(q,K)},$.ONE),Z=$.inv(X);return J.reduceRight((q,K,G)=>{if($.is0(K))return q;return Y[G]=$.mul(q,Y[G]),$.mul(q,K)},Z),Y}function iQ($,J){let Q=($.ORDER-r)/o$,Y=$.pow(J,Q),X=$.eql(Y,$.ONE),Z=$.eql(Y,$.ZERO),q=$.eql(Y,$.neg($.ONE));if(!X&&!Z&&!q)throw Error("invalid Legendre symbol result");return X?1:Z?0:-1}function J8($,J){if(J!==void 0)v$(J);let Q=J!==void 0?J:$.toString(2).length,Y=Math.ceil(Q/8);return{nBitLength:Q,nByteLength:Y}}function w0($,J,Q=!1,Y={}){if($<=s)throw Error("invalid field: expected ORDER > 0, got "+$);let{nBitLength:X,nByteLength:Z}=J8($,J);if(Z>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let q,K=Object.freeze({ORDER:$,isLE:Q,BITS:X,BYTES:Z,MASK:p$(X),ZERO:s,ONE:r,create:(G)=>i(G,$),isValid:(G)=>{if(typeof G!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof G);return s<=G&&G<$},is0:(G)=>G===s,isOdd:(G)=>(G&r)===r,neg:(G)=>i(-G,$),eql:(G,N)=>G===N,sqr:(G)=>i(G*G,$),add:(G,N)=>i(G+N,$),sub:(G,N)=>i(G-N,$),mul:(G,N)=>i(G*N,$),pow:(G,N)=>v9(K,G,N),div:(G,N)=>i(G*t0(N,$),$),sqrN:(G)=>G*G,addN:(G,N)=>G+N,subN:(G,N)=>G-N,mulN:(G,N)=>G*N,inv:(G)=>t0(G,$),sqrt:Y.sqrt||((G)=>{if(!q)q=F9($);return q(K,G)}),toBytes:(G)=>Q?nJ(G,Z):c$(G,Z),fromBytes:(G)=>{if(G.length!==Z)throw Error("Field.fromBytes: expected "+Z+" bytes, got "+G.length);return Q?pJ(G):R$(G)},invertBatch:(G)=>$8(K,G),cmov:(G,N,M)=>M?N:G});return Object.freeze(K)}function eQ($){if(typeof $!=="bigint")throw Error("field order must be bigint");let J=$.toString(2).length;return Math.ceil(J/8)}function Q8($){let J=eQ($);return J+Math.ceil(J/2)}function $Y($,J,Q=!1){let Y=$.length,X=eQ(J),Z=Q8(J);if(Y<16||Y<Z||Y>1024)throw Error("expected "+Z+"-1024 bytes of input, got "+Y);let q=Q?pJ($):R$($),K=i(q,J-r)+r;return Q?nJ(K,X):c$(K,X)}var s,r,o$,H9,rQ,tQ,aQ,b9;var a0=_(()=>{m$();i0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */s=BigInt(0),r=BigInt(1),o$=BigInt(2),H9=BigInt(3),rQ=BigInt(4),tQ=BigInt(5),aQ=BigInt(8);b9=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function Y8($,J){let Q=J.negate();return $?Q:J}function YY($,J){if(!Number.isSafeInteger($)||$<=0||$>J)throw Error("invalid window size, expected [1.."+J+"], got W="+$)}function X8($,J){YY($,J);let Q=Math.ceil(J/$)+1,Y=2**($-1),X=2**$,Z=p$($),q=BigInt($);return{windows:Q,windowSize:Y,mask:Z,maxNumber:X,shiftBy:q}}function QY($,J,Q){let{windowSize:Y,mask:X,maxNumber:Z,shiftBy:q}=Q,K=Number($&X),G=$>>q;if(K>Y)K-=Z,G+=G8;let N=J*Y,M=N+Math.abs(K)-1,O=K===0,j=K<0,I=J%2!==0;return{nextN:G,offset:M,isZero:O,isNeg:j,isNegF:I,offsetF:N}}function g9($,J){if(!Array.isArray($))throw Error("array expected");$.forEach((Q,Y)=>{if(!(Q instanceof J))throw Error("invalid point at index "+Y)})}function y9($,J){if(!Array.isArray($))throw Error("array of scalars expected");$.forEach((Q,Y)=>{if(!J.isValid(Q))throw Error("invalid scalar at index "+Y)})}function q8($){return XY.get($)||1}function ZY($,J){return{constTimeNegate:Y8,hasPrecomputes(Q){return q8(Q)!==1},unsafeLadder(Q,Y,X=$.ZERO){let Z=Q;while(Y>JY){if(Y&G8)X=X.add(Z);Z=Z.double(),Y>>=G8}return X},precomputeWindow(Q,Y){let{windows:X,windowSize:Z}=X8(Y,J),q=[],K=Q,G=K;for(let N=0;N<X;N++){G=K,q.push(G);for(let M=1;M<Z;M++)G=G.add(K),q.push(G);K=G.double()}return q},wNAF(Q,Y,X){let{ZERO:Z,BASE:q}=$,K=X8(Q,J);for(let G=0;G<K.windows;G++){let{nextN:N,offset:M,isZero:O,isNeg:j,isNegF:I,offsetF:L}=QY(X,G,K);if(X=N,O)q=q.add(Y8(I,Y[L]));else Z=Z.add(Y8(j,Y[M]))}return{p:Z,f:q}},wNAFUnsafe(Q,Y,X,Z=$.ZERO){let q=X8(Q,J);for(let K=0;K<q.windows;K++){if(X===JY)break;let{nextN:G,offset:N,isZero:M,isNeg:O}=QY(X,K,q);if(X=G,M)continue;else{let j=Y[N];Z=Z.add(O?j.negate():j)}}return Z},getPrecomputes(Q,Y,X){let Z=Z8.get(Y);if(!Z){if(Z=this.precomputeWindow(Y,Q),Q!==1)Z8.set(Y,X(Z))}return Z},wNAFCached(Q,Y,X){let Z=q8(Q);return this.wNAF(Z,this.getPrecomputes(Z,Q,X),Y)},wNAFCachedUnsafe(Q,Y,X,Z){let q=q8(Q);if(q===1)return this.unsafeLadder(Q,Y,Z);return this.wNAFUnsafe(q,this.getPrecomputes(q,Q,X),Y,Z)},setWindowSize(Q,Y){YY(Y,J),XY.set(Q,Y),Z8.delete(Q)}}}function qY($,J,Q,Y){g9(Q,$),y9(Y,J);let X=Q.length,Z=Y.length;if(X!==Z)throw Error("arrays of points and scalars must have equal length");let q=$.ZERO,K=TQ(BigInt(X)),G=1;if(K>12)G=K-3;else if(K>4)G=K-2;else if(K>0)G=2;let N=p$(G),M=Array(Number(N)+1).fill(q),O=Math.floor((J.BITS-1)/G)*G,j=q;for(let I=O;I>=0;I-=G){M.fill(q);for(let A=0;A<Z;A++){let H=Y[A],b=Number(H>>BigInt(I)&N);M[b]=M[b].add(Q[A])}let L=q;for(let A=M.length-1,H=q;A>0;A--)H=H.add(M[A]),L=L.add(H);if(j=j.add(L),I!==0)for(let A=0;A<G;A++)j=j.double()}return j}function K8($){return eJ($.Fp),n$($,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...J8($.n,$.nBitLength),...$,...{p:$.Fp.ORDER}})}var JY,G8,Z8,XY;var GY=_(()=>{a0();i0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */JY=BigInt(0),G8=BigInt(1);Z8=new WeakMap,XY=new WeakMap});function KY($){if($.lowS!==void 0)J0("lowS",$.lowS);if($.prehash!==void 0)J0("prehash",$.prehash)}function m9($){let J=K8($);n$(J,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:Q,Fp:Y,a:X}=J;if(Q){if(!Y.eql(X,Y.ZERO))throw Error("invalid endo: CURVE.a must be 0");if(typeof Q!=="object"||typeof Q.beta!=="bigint"||typeof Q.splitScalar!=="function")throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...J})}function N8($,J){return Q0(c$($,J))}function h9($){let J=m9($),{Fp:Q}=J,Y=w0(J.n,J.nBitLength),X=J.toBytes||((W,C,D)=>{let V=C.toAffine();return A0(Uint8Array.from([4]),Q.toBytes(V.x),Q.toBytes(V.y))}),Z=J.fromBytes||((W)=>{let C=W.subarray(1),D=Q.fromBytes(C.subarray(0,Q.BYTES)),V=Q.fromBytes(C.subarray(Q.BYTES,2*Q.BYTES));return{x:D,y:V}});function q(W){let{a:C,b:D}=J,V=Q.sqr(W),E=Q.mul(V,W);return Q.add(Q.add(E,Q.mul(W,C)),D)}function K(W,C){let D=Q.sqr(C),V=q(W);return Q.eql(D,V)}if(!K(J.Gx,J.Gy))throw Error("bad curve params: generator point");let G=Q.mul(Q.pow(J.a,W8),u9),N=Q.mul(Q.sqr(J.b),BigInt(27));if(Q.is0(Q.add(G,N)))throw Error("bad curve params: a or b");function M(W){return o0(W,d,J.n)}function O(W){let{allowedPrivateKeyLengths:C,nByteLength:D,wrapPrivateKey:V,n:E}=J;if(C&&typeof W!=="bigint"){if($0(W))W=Q0(W);if(typeof W!=="string"||!C.includes(W.length))throw Error("invalid private key");W=W.padStart(D*2,"0")}let f;try{f=typeof W==="bigint"?W:R$($$("private key",W,D))}catch(x){throw Error("invalid private key, expected hex or "+D+" bytes, got "+typeof W)}if(V)f=i(f,E);return l$("private key",f,d,E),f}function j(W){if(!(W instanceof A))throw Error("ProjectivePoint expected")}let I=oJ((W,C)=>{let{px:D,py:V,pz:E}=W;if(Q.eql(E,Q.ONE))return{x:D,y:V};let f=W.is0();if(C==null)C=f?Q.ONE:Q.inv(E);let x=Q.mul(D,C),B=Q.mul(V,C),P=Q.mul(E,C);if(f)return{x:Q.ZERO,y:Q.ZERO};if(!Q.eql(P,Q.ONE))throw Error("invZ was invalid");return{x,y:B}}),L=oJ((W)=>{if(W.is0()){if(J.allowInfinityPoint&&!Q.is0(W.py))return;throw Error("bad point: ZERO")}let{x:C,y:D}=W.toAffine();if(!Q.isValid(C)||!Q.isValid(D))throw Error("bad point: x or y not FE");if(!K(C,D))throw Error("bad point: equation left != right");if(!W.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class A{constructor(W,C,D){if(W==null||!Q.isValid(W))throw Error("x required");if(C==null||!Q.isValid(C)||Q.is0(C))throw Error("y required");if(D==null||!Q.isValid(D))throw Error("z required");this.px=W,this.py=C,this.pz=D,Object.freeze(this)}static fromAffine(W){let{x:C,y:D}=W||{};if(!W||!Q.isValid(C)||!Q.isValid(D))throw Error("invalid affine point");if(W instanceof A)throw Error("projective point not allowed");let V=(E)=>Q.eql(E,Q.ZERO);if(V(C)&&V(D))return A.ZERO;return new A(C,D,Q.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(W){let C=$8(Q,W.map((D)=>D.pz));return W.map((D,V)=>D.toAffine(C[V])).map(A.fromAffine)}static fromHex(W){let C=A.fromAffine(Z($$("pointHex",W)));return C.assertValidity(),C}static fromPrivateKey(W){return A.BASE.multiply(O(W))}static msm(W,C){return qY(A,Y,W,C)}_setWindowSize(W){c.setWindowSize(this,W)}assertValidity(){L(this)}hasEvenY(){let{y:W}=this.toAffine();if(Q.isOdd)return!Q.isOdd(W);throw Error("Field doesn't support isOdd")}equals(W){j(W);let{px:C,py:D,pz:V}=this,{px:E,py:f,pz:x}=W,B=Q.eql(Q.mul(C,x),Q.mul(E,V)),P=Q.eql(Q.mul(D,x),Q.mul(f,V));return B&&P}negate(){return new A(this.px,Q.neg(this.py),this.pz)}double(){let{a:W,b:C}=J,D=Q.mul(C,W8),{px:V,py:E,pz:f}=this,x=Q.ZERO,B=Q.ZERO,P=Q.ZERO,S=Q.mul(V,V),m=Q.mul(E,E),g=Q.mul(f,f),U=Q.mul(V,E);return U=Q.add(U,U),P=Q.mul(V,f),P=Q.add(P,P),x=Q.mul(W,P),B=Q.mul(D,g),B=Q.add(x,B),x=Q.sub(m,B),B=Q.add(m,B),B=Q.mul(x,B),x=Q.mul(U,x),P=Q.mul(D,P),g=Q.mul(W,g),U=Q.sub(S,g),U=Q.mul(W,U),U=Q.add(U,P),P=Q.add(S,S),S=Q.add(P,S),S=Q.add(S,g),S=Q.mul(S,U),B=Q.add(B,S),g=Q.mul(E,f),g=Q.add(g,g),S=Q.mul(g,U),x=Q.sub(x,S),P=Q.mul(g,m),P=Q.add(P,P),P=Q.add(P,P),new A(x,B,P)}add(W){j(W);let{px:C,py:D,pz:V}=this,{px:E,py:f,pz:x}=W,B=Q.ZERO,P=Q.ZERO,S=Q.ZERO,m=J.a,g=Q.mul(J.b,W8),U=Q.mul(C,E),w=Q.mul(D,f),T=Q.mul(V,x),v=Q.add(C,D),k=Q.add(E,f);v=Q.mul(v,k),k=Q.add(U,w),v=Q.sub(v,k),k=Q.add(C,V);let F=Q.add(E,x);return k=Q.mul(k,F),F=Q.add(U,T),k=Q.sub(k,F),F=Q.add(D,V),B=Q.add(f,x),F=Q.mul(F,B),B=Q.add(w,T),F=Q.sub(F,B),S=Q.mul(m,k),B=Q.mul(g,T),S=Q.add(B,S),B=Q.sub(w,S),S=Q.add(w,S),P=Q.mul(B,S),w=Q.add(U,U),w=Q.add(w,U),T=Q.mul(m,T),k=Q.mul(g,k),w=Q.add(w,T),T=Q.sub(U,T),T=Q.mul(m,T),k=Q.add(k,T),U=Q.mul(w,k),P=Q.add(P,U),U=Q.mul(F,k),B=Q.mul(v,B),B=Q.sub(B,U),U=Q.mul(v,w),S=Q.mul(F,S),S=Q.add(S,U),new A(B,P,S)}subtract(W){return this.add(W.negate())}is0(){return this.equals(A.ZERO)}wNAF(W){return c.wNAFCached(this,W,A.normalizeZ)}multiplyUnsafe(W){let{endo:C,n:D}=J;l$("scalar",W,B$,D);let V=A.ZERO;if(W===B$)return V;if(this.is0()||W===d)return this;if(!C||c.hasPrecomputes(this))return c.wNAFCachedUnsafe(this,W,A.normalizeZ);let{k1neg:E,k1:f,k2neg:x,k2:B}=C.splitScalar(W),P=V,S=V,m=this;while(f>B$||B>B$){if(f&d)P=P.add(m);if(B&d)S=S.add(m);m=m.double(),f>>=d,B>>=d}if(E)P=P.negate();if(x)S=S.negate();return S=new A(Q.mul(S.px,C.beta),S.py,S.pz),P.add(S)}multiply(W){let{endo:C,n:D}=J;l$("scalar",W,d,D);let V,E;if(C){let{k1neg:f,k1:x,k2neg:B,k2:P}=C.splitScalar(W),{p:S,f:m}=this.wNAF(x),{p:g,f:U}=this.wNAF(P);S=c.constTimeNegate(f,S),g=c.constTimeNegate(B,g),g=new A(Q.mul(g.px,C.beta),g.py,g.pz),V=S.add(g),E=m.add(U)}else{let{p:f,f:x}=this.wNAF(W);V=f,E=x}return A.normalizeZ([V,E])[0]}multiplyAndAddUnsafe(W,C,D){let V=A.BASE,E=(x,B)=>B===B$||B===d||!x.equals(V)?x.multiplyUnsafe(B):x.multiply(B),f=E(this,C).add(E(W,D));return f.is0()?void 0:f}toAffine(W){return I(this,W)}isTorsionFree(){let{h:W,isTorsionFree:C}=J;if(W===d)return!0;if(C)return C(A,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:W,clearCofactor:C}=J;if(W===d)return this;if(C)return C(A,this);return this.multiplyUnsafe(J.h)}toRawBytes(W=!0){return J0("isCompressed",W),this.assertValidity(),X(A,this,W)}toHex(W=!0){return J0("isCompressed",W),Q0(this.toRawBytes(W))}}A.BASE=new A(J.Gx,J.Gy,Q.ONE),A.ZERO=new A(Q.ZERO,Q.ONE,Q.ZERO);let{endo:H,nBitLength:b}=J,c=ZY(A,H?Math.ceil(b/2):b);return{CURVE:J,ProjectivePoint:A,normPrivateKeyToScalar:O,weierstrassEquation:q,isWithinCurveOrder:M}}function d9($){let J=K8($);return n$(J,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...J})}function WY($){let J=d9($),{Fp:Q,n:Y,nByteLength:X,nBitLength:Z}=J,q=Q.BYTES+1,K=2*Q.BYTES+1;function G(U){return i(U,Y)}function N(U){return t0(U,Y)}let{ProjectivePoint:M,normPrivateKeyToScalar:O,weierstrassEquation:j,isWithinCurveOrder:I}=h9({...J,toBytes(U,w,T){let v=w.toAffine(),k=Q.toBytes(v.x),F=A0;if(J0("isCompressed",T),T)return F(Uint8Array.from([w.hasEvenY()?2:3]),k);else return F(Uint8Array.from([4]),k,Q.toBytes(v.y))},fromBytes(U){let w=U.length,T=U[0],v=U.subarray(1);if(w===q&&(T===2||T===3)){let k=R$(v);if(!o0(k,d,Q.ORDER))throw Error("Point is not on curve");let F=j(k),Q$;try{Q$=Q.sqrt(F)}catch(W$){let e=W$ instanceof Error?": "+W$.message:"";throw Error("Point is not on curve"+e)}let t=(Q$&d)===d;if((T&1)===1!==t)Q$=Q.neg(Q$);return{x:k,y:Q$}}else if(w===K&&T===4){let k=Q.fromBytes(v.subarray(0,Q.BYTES)),F=Q.fromBytes(v.subarray(Q.BYTES,2*Q.BYTES));return{x:k,y:F}}else{let k=q,F=K;throw Error("invalid Point, expected length of "+k+", or uncompressed "+F+", got "+w)}}});function L(U){let w=Y>>d;return U>w}function A(U){return L(U)?G(-U):U}let H=(U,w,T)=>R$(U.slice(w,T));class b{constructor(U,w,T){if(l$("r",U,d,Y),l$("s",w,d,Y),this.r=U,this.s=w,T!=null)this.recovery=T;Object.freeze(this)}static fromCompact(U){let w=X;return U=$$("compactSignature",U,w*2),new b(H(U,0,w),H(U,w,2*w))}static fromDER(U){let{r:w,s:T}=f$.toSig($$("DER",U));return new b(w,T)}assertValidity(){}addRecoveryBit(U){return new b(this.r,this.s,U)}recoverPublicKey(U){let{r:w,s:T,recovery:v}=this,k=E($$("msgHash",U));if(v==null||![0,1,2,3].includes(v))throw Error("recovery id invalid");let F=v===2||v===3?w+J.n:w;if(F>=Q.ORDER)throw Error("recovery id 2 or 3 invalid");let Q$=(v&1)===0?"02":"03",t=M.fromHex(Q$+N8(F,Q.BYTES)),N$=N(F),W$=G(-k*N$),e=G(T*N$),S$=M.BASE.multiplyAndAddUnsafe(t,W$,e);if(!S$)throw Error("point at infinify");return S$.assertValidity(),S$}hasHighS(){return L(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,G(-this.s),this.recovery):this}toDERRawBytes(){return O0(this.toDERHex())}toDERHex(){return f$.hexFromSig(this)}toCompactRawBytes(){return O0(this.toCompactHex())}toCompactHex(){let U=X;return N8(this.r,U)+N8(this.s,U)}}let c={isValidPrivateKey(U){try{return O(U),!0}catch(w){return!1}},normPrivateKeyToScalar:O,randomPrivateKey:()=>{let U=Q8(J.n);return $Y(J.randomBytes(U),J.n)},precompute(U=8,w=M.BASE){return w._setWindowSize(U),w.multiply(BigInt(3)),w}};function W(U,w=!0){return M.fromPrivateKey(U).toRawBytes(w)}function C(U){if(typeof U==="bigint")return!1;if(U instanceof M)return!0;let T=$$("key",U).length,v=Q.BYTES,k=v+1,F=2*v+1;if(J.allowedPrivateKeyLengths||X===k)return;else return T===k||T===F}function D(U,w,T=!0){if(C(U)===!0)throw Error("first arg must be private key");if(C(w)===!1)throw Error("second arg must be public key");return M.fromHex(w).multiply(O(U)).toRawBytes(T)}let V=J.bits2int||function(U){if(U.length>8192)throw Error("input is too large");let w=R$(U),T=U.length*8-Z;return T>0?w>>BigInt(T):w},E=J.bits2int_modN||function(U){return G(V(U))},f=p$(Z);function x(U){return l$("num < 2^"+Z,U,B$,f),c$(U,X)}function B(U,w,T=P){if(["recovered","canonical"].some((x$)=>(x$ in T)))throw Error("sign() legacy options not supported");let{hash:v,randomBytes:k}=J,{lowS:F,prehash:Q$,extraEntropy:t}=T;if(F==null)F=!0;if(U=$$("msgHash",U),KY(T),Q$)U=$$("prehashed msgHash",v(U));let N$=E(U),W$=O(w),e=[x(W$),x(N$)];if(t!=null&&t!==!1){let x$=t===!0?k(Q.BYTES):t;e.push($$("extraEntropy",x$))}let S$=A0(...e),R0=N$;function JJ(x$){let r$=V(x$);if(!I(r$))return;let QJ=N(r$),K0=M.BASE.multiply(r$).toAffine(),_$=G(K0.x);if(_$===B$)return;let N0=G(QJ*G(R0+_$*W$));if(N0===B$)return;let t$=(K0.x===_$?0:2)|Number(K0.y&d),O8=N0;if(F&&L(N0))O8=A(N0),t$^=1;return new b(_$,O8,t$)}return{seed:S$,k2sig:JJ}}let P={lowS:J.lowS,prehash:!1},S={lowS:J.lowS,prehash:!1};function m(U,w,T=P){let{seed:v,k2sig:k}=B(U,w,T),F=J;return kQ(F.hash.outputLen,F.nByteLength,F.hmac)(v,k)}M.BASE._setWindowSize(8);function g(U,w,T,v=S){let k=U;w=$$("msgHash",w),T=$$("publicKey",T);let{lowS:F,prehash:Q$,format:t}=v;if(KY(v),"strict"in v)throw Error("options.strict was renamed to lowS");if(t!==void 0&&t!=="compact"&&t!=="der")throw Error("format must be compact or der");let N$=typeof k==="string"||$0(k),W$=!N$&&!t&&typeof k==="object"&&k!==null&&typeof k.r==="bigint"&&typeof k.s==="bigint";if(!N$&&!W$)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");let e=void 0,S$;try{if(W$)e=new b(k.r,k.s);if(N$){try{if(t!=="compact")e=b.fromDER(k)}catch(t$){if(!(t$ instanceof f$.Err))throw t$}if(!e&&t!=="der")e=b.fromCompact(k)}S$=M.fromHex(T)}catch(t$){return!1}if(!e)return!1;if(F&&e.hasHighS())return!1;if(Q$)w=J.hash(w);let{r:R0,s:JJ}=e,x$=E(w),r$=N(JJ),QJ=G(x$*r$),K0=G(R0*r$),_$=M.BASE.multiplyAndAddUnsafe(S$,QJ,K0)?.toAffine();if(!_$)return!1;return G(_$.x)===R0}return{CURVE:J,getPublicKey:W,getSharedSecret:D,sign:m,verify:g,ProjectivePoint:M,Signature:b,utils:c}}var NY,f$,B$,d,Q7,W8,u9;var MY=_(()=>{GY();a0();i0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */NY=class NY extends Error{constructor($=""){super($)}};f$={Err:NY,_tlv:{encode:($,J)=>{let{Err:Q}=f$;if($<0||$>256)throw new Q("tlv.encode: wrong tag");if(J.length&1)throw new Q("tlv.encode: unpadded data");let Y=J.length/2,X=C0(Y);if(X.length/2&128)throw new Q("tlv.encode: long form length too big");let Z=Y>127?C0(X.length/2|128):"";return C0($)+Z+X+J},decode($,J){let{Err:Q}=f$,Y=0;if($<0||$>256)throw new Q("tlv.encode: wrong tag");if(J.length<2||J[Y++]!==$)throw new Q("tlv.decode: wrong tlv");let X=J[Y++],Z=!!(X&128),q=0;if(!Z)q=X;else{let G=X&127;if(!G)throw new Q("tlv.decode(long): indefinite length not supported");if(G>4)throw new Q("tlv.decode(long): byte length is too big");let N=J.subarray(Y,Y+G);if(N.length!==G)throw new Q("tlv.decode: length bytes not complete");if(N[0]===0)throw new Q("tlv.decode(long): zero leftmost byte");for(let M of N)q=q<<8|M;if(Y+=G,q<128)throw new Q("tlv.decode(long): not minimal encoding")}let K=J.subarray(Y,Y+q);if(K.length!==q)throw new Q("tlv.decode: wrong value length");return{v:K,l:J.subarray(Y+q)}}},_int:{encode($){let{Err:J}=f$;if($<B$)throw new J("integer: negative integers are not allowed");let Q=C0($);if(Number.parseInt(Q[0],16)&8)Q="00"+Q;if(Q.length&1)throw new J("unexpected DER parsing assertion: unpadded hex");return Q},decode($){let{Err:J}=f$;if($[0]&128)throw new J("invalid signature integer: negative");if($[0]===0&&!($[1]&128))throw new J("invalid signature integer: unnecessary leading zero");return R$($)}},toSig($){let{Err:J,_int:Q,_tlv:Y}=f$,X=$$("signature",$),{v:Z,l:q}=Y.decode(48,X);if(q.length)throw new J("invalid signature: left bytes after parsing");let{v:K,l:G}=Y.decode(2,Z),{v:N,l:M}=Y.decode(2,G);if(M.length)throw new J("invalid signature: left bytes after parsing");return{r:Q.decode(K),s:Q.decode(N)}},hexFromSig($){let{_tlv:J,_int:Q}=f$,Y=J.encode(2,Q.encode($.r)),X=J.encode(2,Q.encode($.s)),Z=Y+X;return J.encode(48,Z)}};B$=BigInt(0),d=BigInt(1),Q7=BigInt(2),W8=BigInt(3),u9=BigInt(4)});function c9($){return{hash:$,hmac:(J,...Q)=>sJ($,J,H8(...Q)),randomBytes:x8}}function UY($,J){let Q=(Y)=>WY({...$,...c9(Y)});return{...Q(J),create:Q}}var DY=_(()=>{oQ();m$();MY();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});function n9($){let J=CY,Q=BigInt(3),Y=BigInt(6),X=BigInt(11),Z=BigInt(22),q=BigInt(23),K=BigInt(44),G=BigInt(88),N=$*$*$%J,M=N*N*$%J,O=J$(M,Q,J)*M%J,j=J$(O,Q,J)*M%J,I=J$(j,M8,J)*N%J,L=J$(I,X,J)*I%J,A=J$(L,Z,J)*L%J,H=J$(A,K,J)*A%J,b=J$(H,G,J)*H%J,c=J$(b,K,J)*A%J,W=J$(c,Q,J)*M%J,C=J$(W,q,J)*L%J,D=J$(C,Y,J)*N%J,V=J$(D,M8,J);if(!U8.eql(U8.sqr(V),$))throw Error("Cannot find square root");return V}var CY,VY,l9,p9,M8,IY=($,J)=>($+J/M8)/J,U8,Z0;var s0=_(()=>{bJ();DY();a0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */CY=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),VY=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l9=BigInt(0),p9=BigInt(1),M8=BigInt(2);U8=w0(CY,void 0,void 0,{sqrt:n9}),Z0=UY({a:l9,b:BigInt(7),Fp:U8,n:VY,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:($)=>{let J=VY,Q=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Y=-p9*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),X=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),Z=Q,q=BigInt("0x100000000000000000000000000000000"),K=IY(Z*$,J),G=IY(-Y*$,J),N=i($-K*Q-G*X,J),M=i(-K*Y-G*Z,J),O=N>q,j=M>q;if(O)N=J-N;if(j)M=J-M;if(N>q||M>q)throw Error("splitScalar: Endomorphism failed, k="+$);return{k1neg:O,k1:N,k2neg:j,k2:M}}}},p0)});import{randomUUID as kY}from"node:crypto";import{access as KN,unlink as $X,writeFile as JX}from"node:fs/promises";import QX from"node:net";b0();u$();function a8($){let J=h(`0x${$.substring(4)}`).substring(26);return s$(`0x${J}`)}q$();u();a();TJ();q$();u();function w$($,J="hex"){let Q=s8($),Y=m0(new Uint8Array(Q.length));if(Q.encode(Y),J==="hex")return n(Y.bytes);return Y.bytes}function s8($){if(Array.isArray($))return C9($.map((J)=>s8(J)));return O9($)}function C9($){let J=$.reduce((X,Z)=>X+Z.length,0),Q=e8(J);return{length:(()=>{if(J<=55)return 1+J;return 1+Q+J})(),encode(X){if(J<=55)X.pushByte(192+J);else if(X.pushByte(247+Q),Q===1)X.pushUint8(J);else if(Q===2)X.pushUint16(J);else if(Q===3)X.pushUint24(J);else X.pushUint32(J);for(let{encode:Z}of $)Z(X)}}}function O9($){let J=typeof $==="string"?l($):$,Q=e8(J.length);return{length:(()=>{if(J.length===1&&J[0]<128)return 1;if(J.length<=55)return 1+J.length;return 1+Q+J.length})(),encode(X){if(J.length===1&&J[0]<128)X.pushBytes(J);else if(J.length<=55)X.pushByte(128+J.length),X.pushBytes(J);else{if(X.pushByte(183+Q),Q===1)X.pushUint8(J.length);else if(Q===2)X.pushUint16(J.length);else if(Q===3)X.pushUint24(J.length);else X.pushUint32(J.length);X.pushBytes(J)}}}}function e8($){if($<256)return 1;if($<65536)return 2;if($<16777216)return 3;if($<4294967296)return 4;throw new z("Length is too large.")}u$();function $Q($){let{chainId:J,nonce:Q,to:Y}=$,X=$.contractAddress??$.address,Z=h(P$(["0x05",w$([J?R(J):"0x",X,Q?R(Q):"0x"])]));if(Y==="bytes")return l(Z);return Z}q$();u();function c0($){let{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),Y=typeof $.blobs[0]==="string"?$.blobs.map((Z)=>l(Z)):$.blobs,X=[];for(let Z of Y)X.push(Uint8Array.from(J.blobToKzgCommitment(Z)));return Q==="bytes"?X:X.map((Z)=>n(Z))}q$();u();function l0($){let{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),Y=typeof $.blobs[0]==="string"?$.blobs.map((q)=>l(q)):$.blobs,X=typeof $.commitments[0]==="string"?$.commitments.map((q)=>l(q)):$.commitments,Z=[];for(let q=0;q<Y.length;q++){let K=Y[q],G=X[q];Z.push(Uint8Array.from(J.computeBlobKzgProof(K,G)))}return Q==="bytes"?Z:Z.map((q)=>n(q))}u();bJ();var VQ=p0;q$();u();function IQ($,J){let Q=J||"hex",Y=VQ(Y$($,{strict:!1})?k0($):$);if(Q==="bytes")return Y;return X$(Y)}function CQ($){let{commitment:J,version:Q=1}=$,Y=$.to??(typeof J==="string"?"hex":"bytes"),X=IQ(J,"bytes");return X.set([Q],0),Y==="bytes"?X:n(X)}function OQ($){let{commitments:J,version:Q}=$,Y=$.to??(typeof J[0]==="string"?"hex":"bytes"),X=[];for(let Z of J)X.push(CQ({commitment:Z,to:Y,version:Q}));return X}var AQ=32,jQ=4096,wQ=131072,vJ=761855;var n0=1;a();class gJ extends z{constructor({maxSize:$,size:J}){super("Blob size is too large.",{metaMessages:[`Max: ${$} bytes`,`Given: ${J} bytes`],name:"BlobSizeTooLargeError"})}}class I0 extends z{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class yJ extends z{constructor({hash:$,size:J}){super(`Versioned hash "${$}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${J}`],name:"InvalidVersionedHashSizeError"})}}class mJ extends z{constructor({hash:$,version:J}){super(`Versioned hash "${$}" version is invalid.`,{metaMessages:[`Expected: ${n0}`,`Received: ${J}`],name:"InvalidVersionedHashVersionError"})}}TJ();I$();q$();u();function zQ($){let J=$.to??(typeof $.data==="string"?"hex":"bytes"),Q=typeof $.data==="string"?l($.data):$.data,Y=y(Q);if(!Y)throw new I0;if(Y>vJ)throw new gJ({maxSize:vJ,size:Y});let X=[],Z=!0,q=0;while(Z){let K=m0(new Uint8Array(wQ)),G=0;while(G<jQ){let N=Q.slice(q,q+(AQ-1));if(K.pushByte(0),K.pushBytes(N),N.length<31){K.pushByte(128),Z=!1;break}G++,q+=31}X.push(K)}return J==="bytes"?X.map((K)=>K.bytes):X.map((K)=>n(K.bytes))}function EQ($){let{data:J,kzg:Q,to:Y}=$,X=$.blobs??zQ({data:J,to:Y}),Z=$.commitments??c0({blobs:X,kzg:Q,to:Y}),q=$.proofs??l0({blobs:X,commitments:Z,kzg:Q,to:Y}),K=[];for(let G=0;G<X.length;G++)K.push({blob:X[G],commitment:Z[G],proof:q[G]});return K}u0();function RQ($){if($.type)return $.type;if(typeof $.authorizationList<"u")return"eip7702";if(typeof $.blobs<"u"||typeof $.blobVersionedHashes<"u"||typeof $.maxFeePerBlobGas<"u"||typeof $.sidecars<"u")return"eip4844";if(typeof $.maxFeePerGas<"u"||typeof $.maxPriorityFeePerGas<"u")return"eip1559";if(typeof $.gasPrice<"u"){if(typeof $.accessList<"u")return"eip2930";return"legacy"}throw new PJ({transaction:$})}u();u0();u();WQ();h$();a();PQ();NQ();d$();I$();zJ();M0();function HQ($){let{authorizationList:J}=$;if(J)for(let Q of J){let{chainId:Y}=Q,X=Q.address;if(!o(X))throw new p({address:X});if(Y<0)throw new Y0({chainId:Y})}r0($)}function xQ($){let{blobVersionedHashes:J}=$;if(J){if(J.length===0)throw new I0;for(let Q of J){let Y=y(Q),X=j8(v0(Q,0,1));if(Y!==32)throw new yJ({hash:Q,size:Y});if(X!==n0)throw new mJ({hash:Q,version:X})}}r0($)}function r0($){let{chainId:J,maxPriorityFeePerGas:Q,maxFeePerGas:Y,to:X}=$;if(J<=0)throw new Y0({chainId:J});if(X&&!o(X))throw new p({address:X});if(Y&&Y>d0)throw new e$({maxFeePerGas:Y});if(Q&&Y&&Q>Y)throw new h0({maxFeePerGas:Y,maxPriorityFeePerGas:Q})}function _Q($){let{chainId:J,maxPriorityFeePerGas:Q,gasPrice:Y,maxFeePerGas:X,to:Z}=$;if(J<=0)throw new Y0({chainId:J});if(Z&&!o(Z))throw new p({address:Z});if(Q||X)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(Y&&Y>d0)throw new e$({maxFeePerGas:Y})}function FQ($){let{chainId:J,maxPriorityFeePerGas:Q,gasPrice:Y,maxFeePerGas:X,to:Z}=$;if(Z&&!o(Z))throw new p({address:Z});if(typeof J<"u"&&J<=0)throw new Y0({chainId:J});if(Q||X)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(Y&&Y>d0)throw new e$({maxFeePerGas:Y})}h$();u0();d$();function j0($){if(!$||$.length===0)return[];let J=[];for(let Q=0;Q<$.length;Q++){let{address:Y,storageKeys:X}=$[Q];for(let Z=0;Z<X.length;Z++)if(X[Z].length-2!==64)throw new HJ({storageKey:X[Z]});if(!o(Y,{strict:!1}))throw new p({address:Y});J.push([Y,X])}return J}function bQ($,J){let Q=RQ($);if(Q==="eip1559")return f9($,J);if(Q==="eip2930")return B9($,J);if(Q==="eip4844")return R9($,J);if(Q==="eip7702")return E9($,J);return L9($,J)}function E9($,J){let{authorizationList:Q,chainId:Y,gas:X,nonce:Z,to:q,value:K,maxFeePerGas:G,maxPriorityFeePerGas:N,accessList:M,data:O}=$;HQ($);let j=j0(M),I=vQ(Q);return P$(["0x04",w$([R(Y),Z?R(Z):"0x",N?R(N):"0x",G?R(G):"0x",X?R(X):"0x",q??"0x",K?R(K):"0x",O??"0x",j,I,...X0($,J)])])}function R9($,J){let{chainId:Q,gas:Y,nonce:X,to:Z,value:q,maxFeePerBlobGas:K,maxFeePerGas:G,maxPriorityFeePerGas:N,accessList:M,data:O}=$;xQ($);let{blobVersionedHashes:j,sidecars:I}=$;if($.blobs&&(typeof j>"u"||typeof I>"u")){let W=typeof $.blobs[0]==="string"?$.blobs:$.blobs.map((V)=>n(V)),C=$.kzg,D=c0({blobs:W,kzg:C});if(typeof j>"u")j=OQ({commitments:D});if(typeof I>"u"){let V=l0({blobs:W,commitments:D,kzg:C});I=EQ({blobs:W,commitments:D,proofs:V})}}let L=j0(M),A=[R(Q),X?R(X):"0x",N?R(N):"0x",G?R(G):"0x",Y?R(Y):"0x",Z??"0x",q?R(q):"0x",O??"0x",L,K?R(K):"0x",j??[],...X0($,J)],H=[],b=[],c=[];if(I)for(let W=0;W<I.length;W++){let{blob:C,commitment:D,proof:V}=I[W];H.push(C),b.push(D),c.push(V)}return P$(["0x03",I?w$([A,H,b,c]):w$(A)])}function f9($,J){let{chainId:Q,gas:Y,nonce:X,to:Z,value:q,maxFeePerGas:K,maxPriorityFeePerGas:G,accessList:N,data:M}=$;r0($);let O=j0(N),j=[R(Q),X?R(X):"0x",G?R(G):"0x",K?R(K):"0x",Y?R(Y):"0x",Z??"0x",q?R(q):"0x",M??"0x",O,...X0($,J)];return P$(["0x02",w$(j)])}function B9($,J){let{chainId:Q,gas:Y,data:X,nonce:Z,to:q,value:K,accessList:G,gasPrice:N}=$;_Q($);let M=j0(G),O=[R(Q),Z?R(Z):"0x",N?R(N):"0x",Y?R(Y):"0x",q??"0x",K?R(K):"0x",X??"0x",M,...X0($,J)];return P$(["0x01",w$(O)])}function L9($,J){let{chainId:Q=0,gas:Y,data:X,nonce:Z,to:q,value:K,gasPrice:G}=$;FQ($);let N=[Z?R(Z):"0x",G?R(G):"0x",Y?R(Y):"0x",q??"0x",K?R(K):"0x",X??"0x"];if(J){let M=(()=>{if(J.v>=35n){if((J.v-35n)/2n>0)return J.v;return 27n+(J.v===35n?0n:1n)}if(Q>0)return BigInt(Q*2)+BigInt(35n+J.v-27n);let I=27n+(J.v===27n?0n:1n);if(J.v!==I)throw new kJ({v:J.v});return I})(),O=W0(J.r),j=W0(J.s);N=[...N,R(M),O==="0x00"?"0x":O,j==="0x00"?"0x":j]}else if(Q>0)N=[...N,R(Q),"0x","0x"];return w$(N)}function X0($,J){let Q=J??$,{v:Y,yParity:X}=Q;if(typeof Q.r>"u")return[];if(typeof Q.s>"u")return[];if(typeof Y>"u"&&typeof X>"u")return[];let Z=W0(Q.r),q=W0(Q.s);return[(()=>{if(typeof X==="number")return X?R(1):"0x";if(Y===0n)return"0x";if(Y===1n)return R(1);return Y===27n?"0x":R(1)})(),Z==="0x00"?"0x":Z,q==="0x00"?"0x":q]}function vQ($){if(!$||$.length===0)return[];let J=[];for(let Q of $){let{chainId:Y,nonce:X,...Z}=Q,q=Q.address;J.push([Y?X$(Y):"0x",q,X?X$(X):"0x",...X0({},Z)])}return J}u$();var gQ=`\x19Ethereum Signed Message:
11
+ `;I$();u();function yQ($){let J=(()=>{if(typeof $==="string")return a$($);if(typeof $.raw==="string")return $.raw;return n($.raw)})(),Q=a$(`${gQ}${y(J)}`);return K$([Q,J])}function mQ($,J){return h(yQ($),J)}l8();u();u$();MJ();h$();a();class iJ extends z{constructor({domain:$}){super(`Invalid domain "${n8($)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class rJ extends z{constructor({primaryType:$,types:J}){super(`Invalid primary type \`${$}\` must be one of \`${JSON.stringify(Object.keys(J))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class tJ extends z{constructor({type:$}){super(`Struct type "${$}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}d$();I$();u();EJ();function uQ($){let{domain:J,message:Q,primaryType:Y,types:X}=$,Z=(q,K)=>{for(let G of q){let{name:N,type:M}=G,O=K[N],j=M.match(g0);if(j&&(typeof O==="number"||typeof O==="bigint")){let[A,H,b]=j;R(O,{signed:H==="int",size:Number.parseInt(b,10)/8})}if(M==="address"&&typeof O==="string"&&!o(O))throw new p({address:O});let I=M.match(c8);if(I){let[A,H]=I;if(H&&y(O)!==Number.parseInt(H,10))throw new KJ({expectedSize:Number.parseInt(H,10),givenSize:y(O)})}let L=X[M];if(L)S9(M),Z(L,O)}};if(X.EIP712Domain&&J){if(typeof J!=="object")throw new iJ({domain:J});Z(X.EIP712Domain,J)}if(Y!=="EIP712Domain")if(X[Y])Z(X[Y],Q);else throw new rJ({primaryType:Y,types:X})}function hQ({domain:$}){return[typeof $?.name==="string"&&{name:"name",type:"string"},$?.version&&{name:"version",type:"string"},(typeof $?.chainId==="number"||typeof $?.chainId==="bigint")&&{name:"chainId",type:"uint256"},$?.verifyingContract&&{name:"verifyingContract",type:"address"},$?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function S9($){if($==="address"||$==="bool"||$==="string"||$.startsWith("bytes")||$.startsWith("uint")||$.startsWith("int"))throw new tJ({type:$})}function dQ($){let{domain:J={},message:Q,primaryType:Y}=$,X={EIP712Domain:hQ({domain:J}),...$.types};uQ({domain:J,message:Q,primaryType:Y,types:X});let Z=["0x1901"];if(J)Z.push(T9({domain:J,types:X}));if(Y!=="EIP712Domain")Z.push(cQ({data:Q,primaryType:Y,types:X}));return h(K$(Z))}function T9({domain:$,types:J}){return cQ({data:$,primaryType:"EIP712Domain",types:J})}function cQ({data:$,primaryType:J,types:Q}){let Y=lQ({data:$,primaryType:J,types:Q});return h(Y)}function lQ({data:$,primaryType:J,types:Q}){let Y=[{type:"bytes32"}],X=[k9({primaryType:J,types:Q})];for(let Z of Q[J]){let[q,K]=nQ({types:Q,name:Z.name,type:Z.type,value:$[Z.name]});Y.push(q),X.push(K)}return RJ(Y,X)}function k9({primaryType:$,types:J}){let Q=X$(P9({primaryType:$,types:J}));return h(Q)}function P9({primaryType:$,types:J}){let Q="",Y=pQ({primaryType:$,types:J});Y.delete($);let X=[$,...Array.from(Y).sort()];for(let Z of X)Q+=`${Z}(${J[Z].map(({name:q,type:K})=>`${K} ${q}`).join(",")})`;return Q}function pQ({primaryType:$,types:J},Q=new Set){let X=$.match(/^\w*/u)?.[0];if(Q.has(X)||J[X]===void 0)return Q;Q.add(X);for(let Z of J[X])pQ({primaryType:Z.type,types:J},Q);return Q}function nQ({types:$,name:J,type:Q,value:Y}){if($[Q]!==void 0)return[{type:"bytes32"},h(lQ({data:Y,primaryType:Q,types:$}))];if(Q==="bytes")return[{type:"bytes32"},h(Y)];if(Q==="string")return[{type:"bytes32"},h(X$(Y))];if(Q.lastIndexOf("]")===Q.length-1){let X=Q.slice(0,Q.lastIndexOf("[")),Z=Y.map((q)=>nQ({name:J,type:X,types:$,value:q}));return[{type:"bytes32"},h(RJ(Z.map(([q])=>q),Z.map(([,q])=>q)))]}return[{type:Q},Y]}s0();M0();q$();function OY({r:$,s:J,to:Q="hex",v:Y,yParity:X}){let Z=(()=>{if(X===0||X===1)return X;if(Y&&(Y===27n||Y===28n||Y>=35n))return Y%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),q=`0x${new Z0.Signature(T0($),T0(J)).toCompactHex()}${Z===0?"1b":"1c"}`;if(Q==="hex")return q;return l(q)}b0();s0();u();h$();d$();function AY($){if(typeof $==="string"){if(!o($,{strict:!1}))throw new p({address:$});return{address:$,type:"json-rpc"}}if(!o($.address,{strict:!1}))throw new p({address:$.address});return{address:$.address,nonceManager:$.nonceManager,sign:$.sign,signAuthorization:$.signAuthorization,signMessage:$.signMessage,signTransaction:$.signTransaction,signTypedData:$.signTypedData,source:"custom",type:"local"}}s0();q$();u();var D8=!1;async function D$({hash:$,privateKey:J,to:Q="object"}){let{r:Y,s:X,recovery:Z}=Z0.sign($.slice(2),J.slice(2),{lowS:!0,extraEntropy:Y$(D8,{strict:!1})?l(D8):D8}),q={r:R(Y,{size:32}),s:R(X,{size:32}),v:Z?28n:27n,yParity:Z};return(()=>{if(Q==="bytes"||Q==="hex")return OY({...q,to:Q});return q})()}async function jY($){let{chainId:J,nonce:Q,privateKey:Y,to:X="object"}=$,Z=$.contractAddress??$.address,q=await D$({hash:$Q({address:Z,chainId:J,nonce:Q}),privateKey:Y,to:X});if(X==="object")return{address:Z,chainId:J,nonce:Q,...q};return q}async function wY({message:$,privateKey:J}){return await D$({hash:mQ($),privateKey:J,to:"hex"})}u$();async function zY($){let{privateKey:J,transaction:Q,serializer:Y=bQ}=$,X=(()=>{if(Q.type==="eip4844")return{...Q,sidecars:!1};return Q})(),Z=await D$({hash:h(await Y(X)),privateKey:J});return await Y(Q,Z)}async function EY($){let{privateKey:J,...Q}=$;return await D$({hash:dQ(Q),privateKey:J,to:"hex"})}function z0($,J={}){let{nonceManager:Q}=J,Y=X$(Z0.getPublicKey($.slice(2),!1)),X=a8(Y);return{...AY({address:X,nonceManager:Q,async sign({hash:q}){return D$({hash:q,privateKey:$,to:"hex"})},async signAuthorization(q){return jY({...q,privateKey:$})},async signMessage({message:q}){return wY({message:q,privateKey:$})},async signTransaction(q,{serializer:K}={}){return zY({privateKey:$,transaction:q,serializer:K})},async signTypedData(q){return EY({...q,privateKey:$})}}),publicKey:Y,source:"privateKey"}}function i$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var V$={SESSION_NOT_FOUND:"SESSION_NOT_FOUND",SESSION_EXPIRED:"SESSION_EXPIRED",INVALID_REQUEST:"INVALID_REQUEST",INTERNAL_ERROR:"INTERNAL_ERROR",INVALID_RESPONSE:"INVALID_RESPONSE"},V8="$bigint:";function I8($,J){if(typeof $==="bigint")return`${V8}${$.toString()}`;if(typeof $==="string"&&J&&$.startsWith(V8)){let Q=$.slice(V8.length);if(/^-?\d+$/.test(Q))return BigInt(Q);return $}if(Array.isArray($))return $.map((Q)=>I8(Q,J));if(i$($)){let Q={};for(let[Y,X]of Object.entries($))Q[Y]=I8(X,J);return Q}return $}function o9($){return I8($,!0)}function q0($){return $.trim()}function RY($){let J=JSON.parse($);if(!i$(J)||typeof J.method!=="string")throw Error("Invalid daemon request payload");if(typeof J.id!=="string")throw Error("Invalid daemon request id");if(!i9(J.method))throw Error(`Unknown daemon method: ${String(J.method)}`);if(!i$(J.params))throw Error("Invalid daemon request params");switch(J.method){case"ping":case"list":return{id:J.id,method:J.method,params:{}};case"sign":{if(typeof J.params.sessionName!=="string")throw Error("Invalid sign params.sessionName");if(!i$(J.params.typedData))throw Error("Invalid sign params.typedData");return{id:J.id,method:"sign",params:{sessionName:J.params.sessionName,typedData:o9(J.params.typedData)}}}case"signMessage":{if(typeof J.params.sessionName!=="string"||typeof J.params.message!=="string")throw Error("Invalid signMessage params");return{id:J.id,method:"signMessage",params:{sessionName:J.params.sessionName,message:J.params.message}}}case"loadKey":{if(typeof J.params.name!=="string"||typeof J.params.privateKey!=="string"||typeof J.params.address!=="string"||typeof J.params.durationSeconds!=="number"||J.params.kind!==void 0&&typeof J.params.kind!=="string"||J.params.encryptionDevice!==void 0&&typeof J.params.encryptionDevice!=="string")throw Error("Invalid loadKey params");return{id:J.id,method:"loadKey",params:{name:J.params.name,privateKey:J.params.privateKey,address:J.params.address,durationSeconds:J.params.durationSeconds,kind:J.params.kind,encryptionDevice:J.params.encryptionDevice}}}case"getSessionSecrets":{if(typeof J.params.sessionName!=="string")throw Error("Invalid getSessionSecrets params.sessionName");return{id:J.id,method:"getSessionSecrets",params:{sessionName:J.params.sessionName}}}case"remove":{if(typeof J.params.sessionName!=="string")throw Error("Invalid remove params.sessionName");return{id:J.id,method:"remove",params:{sessionName:J.params.sessionName}}}default:{let Q=J.method;throw Error(`Unhandled daemon method: ${String(J.method)}`)}}}function i9($){return $==="ping"||$==="list"||$==="sign"||$==="signMessage"||$==="loadKey"||$==="getSessionSecrets"||$==="remove"}import{chmod as r9,mkdir as t9,readFile as a9}from"node:fs/promises";import{tmpdir as s9}from"node:os";import{dirname as fY,join as BY,resolve as e0}from"node:path";async function LY($){try{let J=(await a9($,"utf8")).trim(),Q=Number.parseInt(J,10);return Number.isFinite(Q)&&Q>0?Q:void 0}catch{return}}function e9(){let $=process.env.XDG_RUNTIME_DIR;if(process.platform==="linux"&&$)return e0($,"towns-tw");let J=typeof process.getuid==="function"?String(process.getuid()):"unknown";return e0(s9(),`towns-tw-${J}`)}function SY(){let $=process.env.TW_AGENT_SOCK;if($){let Q=e0($);return{stateDir:fY(Q),socketPath:Q,pidPath:e0(fY(Q),"session-daemon.pid")}}let J=e9();return{stateDir:J,socketPath:BY(J,"session-daemon.sock"),pidPath:BY(J,"session-daemon.pid")}}async function TY($){await t9($,{recursive:!0,mode:448}),await r9($,448)}var PY=262144,YX=30000;function xY($,J){return typeof $==="object"&&$!==null&&"code"in $&&$.code===J}async function $J($){try{await $X($)}catch(J){if(xY(J,"ENOENT"))return;throw J}}async function XX($){let J=await LY($);if(J!==void 0)return J;await $J($);return}function L$($,J,Q){return{id:$,error:{code:J,message:Q}}}function C8($,J,Q,Y,X){let Z=$.get(J);if(!Z)return X(L$(Y,V$.SESSION_NOT_FOUND,`Session not loaded: ${J}`)),null;if(Z.expiresAt<=Q)return Z.privateKey.fill(0),Z.encryptionDevice?.fill(0),$.delete(J),X(L$(Y,V$.SESSION_EXPIRED,`Session expired: ${J}`)),null;return Z}function ZX($){if(!/^0x[0-9a-fA-F]{64}$/.test($))throw Error("privateKey must be a 32-byte hex string");return $}function HY($){if(!/^0x[0-9a-fA-F]*$/.test($)||$.length%2!==0)throw Error("message must be a hex string");return $}function G0(){return Date.now()}async function qX($){let J=G0(),Q=$?.paths??SY();await TY(Q.stateDir);let Y=await XX(Q.pidPath);if(Y!==void 0)try{throw process.kill(Y,0),Error(`Session daemon already running with pid ${Y}`)}catch(I){if(!xY(I,"ESRCH"))throw I}let X=new Map,Z=new Set,q=setInterval(()=>{let I=G0();for(let[L,A]of X.entries())if(A.expiresAt<=I)A.privateKey.fill(0),A.encryptionDevice?.fill(0),X.delete(L)},YX);q.unref();let K=QX.createServer((I)=>{Z.add(I),I.setEncoding("utf8");let L="",A=Promise.resolve(),H=(b)=>{I.write(`${JSON.stringify(b)}
12
+ `)};I.on("data",(b)=>{if(L+=b,Buffer.byteLength(L,"utf8")>PY){I.destroy();return}for(;;){let c=L.indexOf(`
13
+ `);if(c===-1)break;let W=L.slice(0,c);L=L.slice(c+1),A=A.then(async()=>{if(Buffer.byteLength(W,"utf8")>PY){H(L$(kY(),V$.INVALID_REQUEST,"Request exceeds 256KB limit"));return}let C=kY();try{let V=JSON.parse(W);if(i$(V)&&typeof V.id==="string")C=V.id}catch{}let D;try{D=RY(W)}catch(V){E0("Invalid request payload",{linePreview:W.slice(0,200),error:V instanceof Error?V.message:String(V)}),H(L$(C,V$.INVALID_REQUEST,"Invalid JSON payload"));return}try{switch(D.method){case"ping":{H({id:D.id,result:{ok:!0,startedAt:J}});return}case"list":{H({id:D.id,result:{startedAt:J,keys:Array.from(X.entries()).map(([V,E])=>({name:V,kind:E.kind,address:E.address,expiresAt:E.expiresAt}))}});return}case"loadKey":{let V=q0(D.params.name);if(!V){H(L$(D.id,V$.INVALID_REQUEST,"Session name is required"));return}if(!Number.isFinite(D.params.durationSeconds)||D.params.durationSeconds<=0){H(L$(D.id,V$.INVALID_REQUEST,"durationSeconds must be positive"));return}let E,f;try{E=ZX(D.params.privateKey),f=F0(D.params.address)}catch(g){H(L$(D.id,V$.INVALID_REQUEST,g instanceof Error?g.message:"Invalid key input"));return}let x=z0(E);if(F0(x.address)!==f){H(L$(D.id,V$.INVALID_REQUEST,"Session key address mismatch"));return}let B=X.get(V);if(B)B.privateKey.fill(0),B.encryptionDevice?.fill(0);let P=Buffer.from(E.slice(2),"hex"),S;if(D.params.encryptionDevice!==void 0){let g=HY(D.params.encryptionDevice);S=Buffer.from(g.slice(2),"hex")}let m=G0()+D.params.durationSeconds*1000;X.set(V,{privateKey:P,address:f,expiresAt:m,kind:D.params.kind,encryptionDevice:S}),H({id:D.id,result:{name:V,address:f,expiresAt:m}});return}case"getSessionSecrets":{let V=q0(D.params.sessionName),E=G0(),f=C8(X,V,E,D.id,H);if(!f)return;H({id:D.id,result:{name:V,privateKey:`0x${f.privateKey.toString("hex")}`,address:f.address,expiresAt:f.expiresAt,...f.encryptionDevice?{encryptionDevice:`0x${f.encryptionDevice.toString("hex")}`}:{}}});return}case"remove":{let V=q0(D.params.sessionName),E=X.get(V);if(E)E.privateKey.fill(0),E.encryptionDevice?.fill(0),X.delete(V);H({id:D.id,result:{ok:!0}});return}case"sign":{let V=q0(D.params.sessionName),E=G0(),f=C8(X,V,E,D.id,H);if(!f)return;let x=`0x${f.privateKey.toString("hex")}`,P=await z0(x).signTypedData(D.params.typedData);H({id:D.id,result:{signature:P}});return}case"signMessage":{let V=q0(D.params.sessionName),E=G0(),f=C8(X,V,E,D.id,H);if(!f)return;let x=`0x${f.privateKey.toString("hex")}`,B=z0(x),P=HY(D.params.message),S=await B.signMessage({message:{raw:Buffer.from(P.slice(2),"hex")}});H({id:D.id,result:{signature:S}});return}}}catch(V){E0("Method error",{method:D.method,id:D.id,error:V instanceof Error?V.message:String(V)}),H(L$(D.id,V$.INTERNAL_ERROR,V instanceof Error?V.message:"Internal daemon error"))}})}}),I.on("close",()=>{Z.delete(I)}),I.on("error",(b)=>{E0("Socket error",{socketPath:Q.socketPath,message:b.message}),Z.delete(I)})}),G=!1,N,M,O=new Promise((I)=>{M=I}),j=async()=>{if(G)return;G=!0;try{await new Promise((I)=>{K.close(()=>I()),setTimeout(()=>I(),2000).unref()}),clearInterval(q);for(let I of X.values())I.privateKey.fill(0),I.encryptionDevice?.fill(0);X.clear();for(let I of Z)I.destroy();if(Z.clear(),await $J(Q.socketPath),await $J(Q.pidPath),N)process.removeListener("SIGTERM",N),process.removeListener("SIGINT",N)}catch(I){E0("Stop cleanup error",{error:I instanceof Error?I.message:String(I)})}finally{M()}};return await $J(Q.socketPath),await new Promise((I,L)=>{K.once("error",L),K.listen(Q.socketPath,()=>{K.off("error",L),I()})}),await JX(Q.pidPath,`${process.pid}
14
+ `,{flag:"wx"}),N=async(I)=>{try{await j()}catch(L){E0("Stop failed during signal shutdown",{signal:I,error:L instanceof Error?L.message:String(L)})}finally{process.removeListener("SIGTERM",N),process.removeListener("SIGINT",N),process.exit(I==="SIGINT"?130:0)}},process.on("SIGTERM",N),process.on("SIGINT",N),await $?.onReady?.({pid:process.pid,socketPath:Q.socketPath}),{pid:process.pid,socketPath:Q.socketPath,stop:j,untilStopped:O}}async function _Y($=!1){return qX({onReady:$?async()=>{process.stdout.write(`ready
15
+ `)}:async()=>{process.stdout.write(`ready
16
+ `),await Promise.resolve(),process.stdout.destroy(),process.stderr.destroy()}})}function E0($,J){if(process.env.TW_DAEMON_DEBUG!=="1")return;let Q=J===void 0?"":` ${JSON.stringify(J)}`;console.error(`[tw session daemon] ${$}${Q}`)}var GX=await _Y();await GX.untilStopped;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towns-labs/wallet",
3
- "version": "7.2.0",
3
+ "version": "7.3.1",
4
4
  "bin": {
5
5
  "wallet": "./dist/cli.js",
6
6
  "tw": "./dist/cli.js"
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "clear": "rimraf dist",
18
18
  "test": "FORCE_COLOR=0 NODE_ENV=test bun test",
19
- "build": "bun run clear && bun build src/cli.ts --outfile=./dist/cli.js --target=node --format=esm -e argon2 --banner='#!/usr/bin/env node' --minify",
19
+ "build": "bun run clear && bun build src/cli.ts --outfile=./dist/cli.js --target=node --format=esm -e argon2 --banner='#!/usr/bin/env node' --minify && bun build src/session-daemon.ts --outfile=./dist/session-daemon.js --target=node --format=esm -e argon2 --minify",
20
20
  "start": "node ./dist/cli.js",
21
21
  "dev": "bun ./src/cli.ts",
22
22
  "prepublishOnly": "bun run build",
@@ -28,13 +28,13 @@
28
28
  "dependencies": {
29
29
  "@bufbuild/protobuf": "^2.9.0",
30
30
  "@clack/prompts": "^1.0.1",
31
- "@towns-labs/contracts": "^7.2.0",
32
- "@towns-labs/proto": "^7.2.0",
33
- "@towns-labs/relayer-client": "^7.2.0",
34
- "@towns-labs/sdk": "^7.2.0",
35
- "@towns-labs/utils": "^7.2.0",
31
+ "@towns-labs/contracts": "^7.3.1",
32
+ "@towns-labs/proto": "^7.3.1",
33
+ "@towns-labs/relayer-client": "^7.3.1",
34
+ "@towns-labs/sdk": "^7.3.1",
35
+ "@towns-labs/utils": "^7.3.1",
36
36
  "argon2": "^0.44.0",
37
- "incur": "^0.1.5",
37
+ "incur": "^0.3.1",
38
38
  "proper-lockfile": "^4.1.2",
39
39
  "viem": "2.45.1"
40
40
  },