@silencelaboratories/walletprovider-sdk 0.0.1 → 0.0.2
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.
- package/dist/authentication.d.ts +5 -2
- package/dist/authentication.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/sdkEOAauthentication.d.ts +15 -1
- package/dist/sdkEOAauthentication.d.ts.map +1 -1
- package/dist/walletProviderServiceClient.d.ts +1 -1
- package/dist/walletProviderServiceClient.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/walletEIP6963.d.ts +0 -40
- package/dist/walletEIP6963.d.ts.map +0 -1
package/dist/authentication.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KeygenSetupOpts, SignSetupOpts } from './networkSigner';
|
|
2
|
+
import { IBrowserWallet } from './sdkEOAauthentication';
|
|
2
3
|
import { IWalletProviderServiceClient } from './walletProviderServiceClient';
|
|
3
4
|
export declare enum AuthMethod {
|
|
4
5
|
EOA = 0,
|
|
@@ -16,7 +17,9 @@ export interface AuthModule {
|
|
|
16
17
|
}
|
|
17
18
|
export declare class EOAAuth implements AuthModule {
|
|
18
19
|
userId: string;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
browserWallet: IBrowserWallet;
|
|
21
|
+
wpClient: IWalletProviderServiceClient;
|
|
22
|
+
constructor(userId: string, browserWallet: IBrowserWallet, wpClient: IWalletProviderServiceClient);
|
|
23
|
+
authenticate(payload: KeygenSetupOpts | SignSetupOpts): Promise<UserAuthentication>;
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=authentication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../src/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../src/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,oBAAY,UAAU;IACpB,GAAG,IAAA;IACH,IAAI,IAAA;CACL;AAGD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,YAAY,CACV,OAAO,EAAE,eAAe,GAAG,aAAa,EACxC,SAAS,EAAE,4BAA4B,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChC;AAED,qBAAa,OAAQ,YAAW,UAAU;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,cAAc,CAAC;IAC9B,QAAQ,EAAE,4BAA4B,CAAC;gBAC3B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,4BAA4B;IAM3F,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAG1F"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { accountsFromBrowserWallet, connectToBrowserWallet, detectBrowserWallets, discoveredBrowserWallets, selectedBrowserWalletId, setActiveBrowserWallet, } from './walletEIP6963.ts';
|
|
2
|
-
export type { TypedData } from './walletEIP6963.ts';
|
|
3
1
|
export { HashAlgo, NetworkSigner } from './networkSigner.ts';
|
|
4
2
|
export { createViemAccount } from './viemSigner.ts';
|
|
5
3
|
export { AuthMethod, EOAAuth } from './authentication.ts';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var zq=Object.defineProperty;var jq=($,J)=>{for(var Q in J)zq($,Q,{get:J[Q],enumerable:!0,configurable:!0,set:(q)=>J[Q]=()=>q})};var f=($,J)=>()=>($&&(J=$($=0)),J);function D$($,{strict:J=!0}={}){if(!$)return!1;if(typeof $!=="string")return!1;return J?/^0x[0-9a-fA-F]*$/.test($):$.startsWith("0x")}var u$=f(()=>{});function b($){if(D$($,{strict:!1}))return Math.ceil(($.length-2)/2);return $.length}var U$=f(()=>{u$()});var V8;var O8=f(()=>{V8="2.11.1"});var U8;var w8=f(()=>{O8();U8=()=>`viem@${V8}`});class z extends Error{constructor($,J={}){super();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:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:U8()});const Q=J.cause instanceof z?J.cause.details:J.cause?.message?J.cause.message:J.details,q=J.cause instanceof z?J.cause.docsPath||J.docsPath:J.docsPath;if(this.message=[$||"An error occurred.","",...J.metaMessages?[...J.metaMessages,""]:[],...q?[`Docs: https://viem.sh${q}${J.docsSlug?`#${J.docsSlug}`:""}`]:[],...Q?[`Details: ${Q}`]:[],`Version: ${this.version}`].join("\n"),J.cause)this.cause=J.cause;this.details=Q,this.docsPath=q,this.metaMessages=J.metaMessages,this.shortMessage=$}walk($){return C8(this,$)}}var C8;var n=f(()=>{w8();C8=function($,J){if(J?.($))return $;if($&&typeof $==="object"&&"cause"in $)return C8($.cause,J);return J?null:$}});class a0 extends z{constructor({expectedLength:$,givenLength:J,type:Q}){super([`ABI encoding array length mismatch for type ${Q}.`,`Expected length: ${$}`,`Given length: ${J}`].join("\n"));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class e0 extends z{constructor({expectedSize:$,value:J}){super(`Size of bytes "${J}" (bytes${b(J)}) does not match expected size (bytes${$}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class s0 extends z{constructor({expectedLength:$,givenLength:J}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${$}`,`Given length (values): ${J}`].join("\n"));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class $J extends z{constructor({expectedSize:$,givenSize:J}){super(`Expected bytes${$}, got bytes${J}.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class JJ extends z{constructor($,{docsPath:J}){super([`Type "${$}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:J});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class QJ extends z{constructor($){super([`Value "${$}" is not a valid array.`].join("\n"));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}var qJ=f(()=>{U$();n()});class M0 extends z{constructor({offset:$,position:J,size:Q}){super(`Slice ${J==="start"?"starting":"ending"} at offset "${$}" is out-of-bounds (size: ${Q}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class V0 extends z{constructor({size:$,targetSize:J,type:Q}){super(`${Q.charAt(0).toUpperCase()}${Q.slice(1).toLowerCase()} size (${$}) exceeds padding size (${J}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}var YJ=f(()=>{n()});function w$($,{dir:J,size:Q=32}={}){if(typeof $==="string")return G$($,{dir:J,size:Q});return Hq($,{dir:J,size:Q})}function G$($,{dir:J,size:Q=32}={}){if(Q===null)return $;const q=$.replace("0x","");if(q.length>Q*2)throw new V0({size:Math.ceil(q.length/2),targetSize:Q,type:"hex"});return`0x${q[J==="right"?"padEnd":"padStart"](Q*2,"0")}`}function Hq($,{dir:J,size:Q=32}={}){if(Q===null)return $;if($.length>Q)throw new V0({size:$.length,targetSize:Q,type:"bytes"});const q=new Uint8Array(Q);for(let Y=0;Y<Q;Y++){const W=J==="right";q[W?Y:Q-Y-1]=$[W?Y:$.length-Y-1]}return q}var O0=f(()=>{YJ()});class WJ extends z{constructor({max:$,min:J,signed:Q,size:q,value:Y}){super(`Number "${Y}" is not in safe ${q?`${q*8}-bit ${Q?"signed":"unsigned"} `:""}integer range ${$?`(${J} to ${$})`:`(above ${J})`}`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class IJ extends z{constructor({givenSize:$,maxSize:J}){super(`Size cannot exceed ${J} bytes. Given size: ${$} bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}var XJ=f(()=>{n()});function DJ($,{dir:J="left"}={}){let Q=typeof $==="string"?$.replace("0x",""):$,q=0;for(let Y=0;Y<Q.length-1;Y++)if(Q[J==="left"?Y:Q.length-Y-1].toString()==="0")q++;else break;if(Q=J==="left"?Q.slice(q):Q.slice(0,Q.length-q),typeof $==="string"){if(Q.length===1&&J==="right")Q=`${Q}0`;return`0x${Q.length%2===1?`0${Q}`:Q}`}return Q}var z8=f(()=>{});function C$($,{size:J}){if(b($)>J)throw new IJ({givenSize:b($),maxSize:J})}function U0($,J={}){const{signed:Q}=J;if(J.size)C$($,{size:J.size});const q=BigInt($);if(!Q)return q;const Y=($.length-2)/2,W=(1n<<BigInt(Y)*8n-1n)-1n;if(q<=W)return q;return q-BigInt(`0x${"f".padStart(Y*2,"f")}`)-1n}function j8($,J={}){return Number(U0($,J))}var r$=f(()=>{XJ();U$()});function B($,J={}){if(typeof $==="number"||typeof $==="bigint")return $$($,J);if(typeof $==="string")return C0($,J);if(typeof $==="boolean")return w0($,J);return m($,J)}function w0($,J={}){const Q=`0x${Number($)}`;if(typeof J.size==="number")return C$(Q,{size:J.size}),w$(Q,{size:J.size});return Q}function m($,J={}){let Q="";for(let Y=0;Y<$.length;Y++)Q+=fq[$[Y]];const q=`0x${Q}`;if(typeof J.size==="number")return C$(q,{size:J.size}),w$(q,{dir:"right",size:J.size});return q}function $$($,J={}){const{signed:Q,size:q}=J,Y=BigInt($);let W;if(q)if(Q)W=(1n<<BigInt(q)*8n-1n)-1n;else W=2n**(BigInt(q)*8n)-1n;else if(typeof $==="number")W=BigInt(Number.MAX_SAFE_INTEGER);const I=typeof W==="bigint"&&Q?-W-1n:0;if(W&&Y>W||Y<I){const D=typeof $==="bigint"?"n":"";throw new WJ({max:W?`${W}${D}`:void 0,min:`${I}${D}`,signed:Q,size:q,value:`${$}${D}`})}const X=`0x${(Q&&Y<0?(1n<<BigInt(q*8))+BigInt(Y):Y).toString(16)}`;if(q)return w$(X,{size:q});return X}function C0($,J={}){const Q=Rq.encode($);return m(Q,J)}var fq,Rq;var i=f(()=>{XJ();O0();r$();fq=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0")),Rq=new TextEncoder});function c$($,J={}){if(typeof $==="number"||typeof $==="bigint")return kq($,J);if(typeof $==="boolean")return Lq($,J);if(D$($))return Y$($,J);return l$($,J)}function Lq($,J={}){const Q=new Uint8Array(1);if(Q[0]=Number($),typeof J.size==="number")return C$(Q,{size:J.size}),w$(Q,{size:J.size});return Q}function Y$($,J={}){let Q=$;if(J.size)C$(Q,{size:J.size}),Q=w$(Q,{dir:"right",size:J.size});let q=Q.slice(2);if(q.length%2)q=`0${q}`;const Y=q.length/2,W=new Uint8Array(Y);for(let I=0,X=0;I<Y;I++){const D=E8(q.charCodeAt(X++)),A=E8(q.charCodeAt(X++));if(D===void 0||A===void 0)throw new z(`Invalid byte sequence ("${q[X-2]}${q[X-1]}" in "${q}").`);W[I]=D*16+A}return W}function kq($,J){const Q=$$($,J);return Y$(Q)}function l$($,J={}){const Q=Bq.encode($);if(typeof J.size==="number")return C$(Q,{size:J.size}),w$(Q,{dir:"right",size:J.size});return Q}var E8,Bq,Z$;var K$=f(()=>{n();u$();O0();r$();i();E8=function($){if($>=Z$.zero&&$<=Z$.nine)return $-Z$.zero;if($>=Z$.A&&$<=Z$.F)return $-(Z$.A-10);if($>=Z$.a&&$<=Z$.f)return $-(Z$.a-10);return};Bq=new TextEncoder,Z$={zero:48,nine:57,A:65,F:70,a:97,f:102}});var t$,a$,S8,N$,z0;var j0=f(()=>{t$=function($){if(!Number.isSafeInteger($)||$<0)throw new Error(`Wrong positive integer: ${$}`)},a$=function($,...J){if(!($ instanceof Uint8Array))throw new Error("Expected Uint8Array");if(J.length>0&&!J.includes($.length))throw new Error(`Expected Uint8Array of length ${J}, not of length=${$.length}`)},S8=function($){if(typeof $!=="function"||typeof $.create!=="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t$($.outputLen),t$($.blockLen)},N$=function($,J=!0){if($.destroyed)throw new Error("Hash instance has been destroyed");if(J&&$.finished)throw new Error("Hash#digest() has already been called")},z0=function($,J){a$($);const Q=J.outputLen;if($.length<Q)throw new Error(`digestInto() expects output buffer of length at least ${Q}`)}});var Pq,H8,E0,T8,f8,R8,B8,L8;var k8=f(()=>{Pq=function($,J=!1){if(J)return{h:Number($&E0),l:Number($>>T8&E0)};return{h:Number($>>T8&E0)|0,l:Number($&E0)|0}},H8=function($,J=!1){let Q=new Uint32Array($.length),q=new Uint32Array($.length);for(let Y=0;Y<$.length;Y++){const{h:W,l:I}=Pq($[Y],J);[Q[Y],q[Y]]=[W,I]}return[Q,q]},E0=BigInt(4294967295),T8=BigInt(32),f8=($,J,Q)=>$<<Q|J>>>32-Q,R8=($,J,Q)=>J<<Q|$>>>32-Q,B8=($,J,Q)=>J<<Q-32|$>>>64-Q,L8=($,J,Q)=>$<<Q-32|J>>>64-Q});var S0;var P8=f(()=>{S0=typeof globalThis==="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function xq($){if(typeof $!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof $}`);return new Uint8Array((new TextEncoder()).encode($))}function B$($){if(typeof $==="string")$=xq($);if(!_8($))throw new Error(`expected Uint8Array, got ${typeof $}`);return $}function F8(...$){const J=new Uint8Array($.reduce((q,Y)=>q+Y.length,0));let Q=0;return $.forEach((q)=>{if(!_8(q))throw new Error("Uint8Array expected");J.set(q,Q),Q+=q.length}),J}function H0($){const J=(q)=>$().update(B$(q)).digest(),Q=$();return J.outputLen=Q.outputLen,J.blockLen=Q.blockLen,J.create=()=>$(),J}function b8($=32){if(S0&&typeof S0.getRandomValues==="function")return S0.getRandomValues(new Uint8Array($));throw new Error("crypto.getRandomValues must be defined")}class L${clone(){return this._cloneInto()}}var _8,x8,T0,W$,_q,e9;var h$=f(()=>{P8();/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */_8=($)=>$ instanceof Uint8Array,x8=($)=>new Uint32Array($.buffer,$.byteOffset,Math.floor($.byteLength/4)),T0=($)=>new DataView($.buffer,$.byteOffset,$.byteLength),W$=($,J)=>$<<32-J|$>>>J,_q=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!_q)throw new Error("Non little-endian hardware is not supported");e9={}.toString});function lq($,J=24){const Q=new Uint32Array(10);for(let q=24-J;q<24;q++){for(let I=0;I<10;I++)Q[I]=$[I]^$[I+10]^$[I+20]^$[I+30]^$[I+40];for(let I=0;I<10;I+=2){const X=(I+8)%10,D=(I+2)%10,A=Q[D],Z=Q[D+1],K=v8(A,Z,1)^Q[X],U=g8(A,Z,1)^Q[X+1];for(let C=0;C<50;C+=10)$[I+C]^=K,$[I+C+1]^=U}let Y=$[2],W=$[3];for(let I=0;I<24;I++){const X=u8[I],D=v8(Y,W,X),A=g8(Y,W,X),Z=y8[I];Y=$[Z],W=$[Z+1],$[Z]=D,$[Z+1]=A}for(let I=0;I<50;I+=10){for(let X=0;X<10;X++)Q[X]=$[I+X];for(let X=0;X<10;X++)$[I+X]^=~Q[(X+2)%10]&Q[(X+4)%10]}$[0]^=uq[q],$[1]^=cq[q]}Q.fill(0)}class AJ extends L${constructor($,J,Q,q=!1,Y=24){super();if(this.blockLen=$,this.suffix=J,this.outputLen=Q,this.enableXOF=q,this.rounds=Y,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,t$(Q),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=x8(this.state)}keccak(){lq(this.state32,this.rounds),this.posOut=0,this.pos=0}update($){N$(this);const{blockLen:J,state:Q}=this;$=B$($);const q=$.length;for(let Y=0;Y<q;){const W=Math.min(J-this.pos,q-Y);for(let I=0;I<W;I++)Q[this.pos++]^=$[Y++];if(this.pos===J)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:$,suffix:J,pos:Q,blockLen:q}=this;if($[Q]^=J,(J&128)!==0&&Q===q-1)this.keccak();$[q-1]^=128,this.keccak()}writeInto($){N$(this,!1),a$($),this.finish();const J=this.state,{blockLen:Q}=this;for(let q=0,Y=$.length;q<Y;){if(this.posOut>=Q)this.keccak();const W=Math.min(Q-this.posOut,Y-q);$.set(J.subarray(this.posOut,this.posOut+W),q),this.posOut+=W,q+=W}return $}xofInto($){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto($)}xof($){return t$($),this.xofInto(new Uint8Array($))}digestInto($){if(z0($,this),this.finished)throw new Error("digest() was already called");return this.writeInto($),this.destroy(),$}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto($){const{blockLen:J,suffix:Q,outputLen:q,rounds:Y,enableXOF:W}=this;return $||($=new AJ(J,Q,q,W,Y)),$.state32.set(this.state32),$.pos=this.pos,$.posOut=this.posOut,$.finished=this.finished,$.rounds=Y,$.suffix=Q,$.outputLen=q,$.enableXOF=W,$.destroyed=this.destroyed,$}}var y8,u8,c8,Fq,e$,bq,vq,gq,yq,uq,cq,v8,g8,hq,l8;var h8=f(()=>{j0();k8();h$();[y8,u8,c8]=[[],[],[]],Fq=BigInt(0),e$=BigInt(1),bq=BigInt(2),vq=BigInt(7),gq=BigInt(256),yq=BigInt(113);for(let $=0,J=e$,Q=1,q=0;$<24;$++){[Q,q]=[q,(2*Q+3*q)%5],y8.push(2*(5*q+Q)),u8.push(($+1)*($+2)/2%64);let Y=Fq;for(let W=0;W<7;W++)if(J=(J<<e$^(J>>vq)*yq)%gq,J&bq)Y^=e$<<(e$<<BigInt(W))-e$;c8.push(Y)}[uq,cq]=H8(c8,!0),v8=($,J,Q)=>Q>32?B8($,J,Q):f8($,J,Q),g8=($,J,Q)=>Q>32?L8($,J,Q):R8($,J,Q);hq=($,J,Q)=>H0(()=>new AJ(J,$,Q)),l8=hq(1,136,32)});function l($,J){const Q=J||"hex",q=l8(D$($,{strict:!1})?c$($):$);if(Q==="bytes")return q;return B(q)}var m$=f(()=>{h8();u$();K$();i()});class o 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."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}var d$=f(()=>{n()});class s$ extends Map{constructor($){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=$}set($,J){if(super.set($,J),this.maxSize&&this.size>this.maxSize)this.delete(this.keys().next().value);return this}}var GJ=f(()=>{});function f0($,J){if(ZJ.has(`${$}.${J}`))return ZJ.get(`${$}.${J}`);const Q=J?`${J}${$.toLowerCase()}`:$.substring(2).toLowerCase(),q=l(l$(Q),"bytes"),Y=(J?Q.substring(`${J}0x`.length):Q).split("");for(let I=0;I<40;I+=2){if(q[I>>1]>>4>=8&&Y[I])Y[I]=Y[I].toUpperCase();if((q[I>>1]&15)>=8&&Y[I+1])Y[I+1]=Y[I+1].toUpperCase()}const W=`0x${Y.join("")}`;return ZJ.set(`${$}.${J}`,W),W}var ZJ;var KJ=f(()=>{K$();m$();GJ();ZJ=new s$(8192)});function a($,J){const{strict:Q=!0}=J??{};if(NJ.has($))return NJ.get($);const q=(()=>{if(!mq.test($))return!1;if($.toLowerCase()===$)return!0;if(Q)return f0($)===$;return!0})();return NJ.set($,q),q}var mq,NJ;var p$=f(()=>{GJ();KJ();mq=/^0x[a-fA-F0-9]{40}$/,NJ=new s$(8192)});function I$($){if(typeof $[0]==="string")return $0($);return dq($)}function dq($){let J=0;for(let Y of $)J+=Y.length;const Q=new Uint8Array(J);let q=0;for(let Y of $)Q.set(Y,q),q+=Y.length;return Q}function $0($){return`0x${$.reduce((J,Q)=>J+Q.replace("0x",""),"")}`}var J0=f(()=>{});function R0($,J,Q,{strict:q}={}){if(D$($,{strict:!1}))return nq($,J,Q,{strict:q});return pq($,J,Q,{strict:q})}function pq($,J,Q,{strict:q}={}){m8($,J);const Y=$.slice(J,Q);if(q)d8(Y,J,Q);return Y}function nq($,J,Q,{strict:q}={}){m8($,J);const Y=`0x${$.replace("0x","").slice((J??0)*2,(Q??$.length)*2)}`;if(q)d8(Y,J,Q);return Y}var m8,d8;var MJ=f(()=>{YJ();u$();U$();m8=function($,J){if(typeof J==="number"&&J>0&&J>b($)-1)throw new M0({offset:J,position:"start",size:b($)})},d8=function($,J,Q){if(typeof J==="number"&&typeof Q==="number"&&b($)!==Q-J)throw new M0({offset:Q,position:"end",size:b($)})}});function VJ($,J){if($.length!==J.length)throw new s0({expectedLength:$.length,givenLength:J.length});const Q=iq({params:$,values:J}),q=UJ(Q);if(q.length===0)return"0x";return q}function JY($){const J=$.match(/^(.*)\[(\d+)?\]$/);return J?[J[2]?Number(J[2]):null,J[1]]:void 0}var iq,OJ,UJ,oq,rq,tq,aq,eq,sq,$Y;var p8=f(()=>{qJ();d$();n();p$();J0();O0();U$();MJ();i();iq=function({params:$,values:J}){const Q=[];for(let q=0;q<$.length;q++)Q.push(OJ({param:$[q],value:J[q]}));return Q},OJ=function({param:$,value:J}){const Q=JY($.type);if(Q){const[q,Y]=Q;return rq(J,{length:q,param:{...$,type:Y}})}if($.type==="tuple")return $Y(J,{param:$});if($.type==="address")return oq(J);if($.type==="bool")return aq(J);if($.type.startsWith("uint")||$.type.startsWith("int")){const q=$.type.startsWith("int");return eq(J,{signed:q})}if($.type.startsWith("bytes"))return tq(J,{param:$});if($.type==="string")return sq(J);throw new JJ($.type,{docsPath:"/docs/contract/encodeAbiParameters"})},UJ=function($){let J=0;for(let W=0;W<$.length;W++){const{dynamic:I,encoded:X}=$[W];if(I)J+=32;else J+=b(X)}const Q=[],q=[];let Y=0;for(let W=0;W<$.length;W++){const{dynamic:I,encoded:X}=$[W];if(I)Q.push($$(J+Y,{size:32})),q.push(X),Y+=b(X);else Q.push(X)}return I$([...Q,...q])},oq=function($){if(!a($))throw new o({address:$});return{dynamic:!1,encoded:G$($.toLowerCase())}},rq=function($,{length:J,param:Q}){const q=J===null;if(!Array.isArray($))throw new QJ($);if(!q&&$.length!==J)throw new a0({expectedLength:J,givenLength:$.length,type:`${Q.type}[${J}]`});let Y=!1;const W=[];for(let I=0;I<$.length;I++){const X=OJ({param:Q,value:$[I]});if(X.dynamic)Y=!0;W.push(X)}if(q||Y){const I=UJ(W);if(q){const X=$$(W.length,{size:32});return{dynamic:!0,encoded:W.length>0?I$([X,I]):X}}if(Y)return{dynamic:!0,encoded:I}}return{dynamic:!1,encoded:I$(W.map(({encoded:I})=>I))}},tq=function($,{param:J}){const[,Q]=J.type.split("bytes"),q=b($);if(!Q){let Y=$;if(q%32!==0)Y=G$(Y,{dir:"right",size:Math.ceil(($.length-2)/2/32)*32});return{dynamic:!0,encoded:I$([G$($$(q,{size:32})),Y])}}if(q!==Number.parseInt(Q))throw new e0({expectedSize:Number.parseInt(Q),value:$});return{dynamic:!1,encoded:G$($,{dir:"right"})}},aq=function($){if(typeof $!=="boolean")throw new z(`Invalid boolean value: "${$}" (type: ${typeof $}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:G$(w0($))}},eq=function($,{signed:J}){return{dynamic:!1,encoded:$$($,{size:32,signed:J})}},sq=function($){const J=C0($),Q=Math.ceil(b(J)/32),q=[];for(let Y=0;Y<Q;Y++)q.push(G$(R0(J,Y*32,(Y+1)*32),{dir:"right"}));return{dynamic:!0,encoded:I$([G$($$(b(J),{size:32})),...q])}},$Y=function($,{param:J}){let Q=!1;const q=[];for(let Y=0;Y<J.components.length;Y++){const W=J.components[Y],I=Array.isArray($)?Y:W.name,X=OJ({param:W,value:$[I]});if(q.push(X),X.dynamic)Q=!0}return{dynamic:Q,encoded:Q?UJ(q):I$(q.map(({encoded:Y})=>Y))}}});class B0 extends z{constructor({offset:$}){super(`Offset \`${$}\` cannot be negative.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class wJ extends z{constructor({length:$,position:J}){super(`Position \`${J}\` is out of bounds (\`0 < position < ${$}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class CJ extends z{constructor({count:$,limit:J}){super(`Recursive read limit of \`${J}\` exceeded (recursive read count: \`${$}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}var n8=f(()=>{n()});function L0($,{recursiveReadLimit:J=8192}={}){const Q=Object.create(QY);return Q.bytes=$,Q.dataView=new DataView($.buffer,$.byteOffset,$.byteLength),Q.positionReadCount=new Map,Q.recursiveReadLimit=J,Q}var QY;var zJ=f(()=>{n8();QY={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 CJ({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition($){if($<0||$>this.bytes.length-1)throw new wJ({length:this.bytes.length,position:$})},decrementPosition($){if($<0)throw new B0({offset:$});const J=this.position-$;this.assertPosition(J),this.position=J},getReadCount($){return this.positionReadCount.get($||this.position)||0},incrementPosition($){if($<0)throw new B0({offset:$});const J=this.position+$;this.assertPosition(J),this.position=J},inspectByte($){const J=$??this.position;return this.assertPosition(J),this.bytes[J]},inspectBytes($,J){const Q=J??this.position;return this.assertPosition(Q+$-1),this.bytes.subarray(Q,Q+$)},inspectUint8($){const J=$??this.position;return this.assertPosition(J),this.bytes[J]},inspectUint16($){const J=$??this.position;return this.assertPosition(J+1),this.dataView.getUint16(J)},inspectUint24($){const J=$??this.position;return this.assertPosition(J+2),(this.dataView.getUint16(J)<<8)+this.dataView.getUint8(J+2)},inspectUint32($){const 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,$&~4294967040),this.position+=3},pushUint32($){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,$),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const $=this.inspectByte();return this.position++,$},readBytes($,J){this.assertReadLimit(),this._touch();const Q=this.inspectBytes($);return this.position+=J??$,Q},readUint8(){this.assertReadLimit(),this._touch();const $=this.inspectUint8();return this.position+=1,$},readUint16(){this.assertReadLimit(),this._touch();const $=this.inspectUint16();return this.position+=2,$},readUint24(){this.assertReadLimit(),this._touch();const $=this.inspectUint24();return this.position+=3,$},readUint32(){this.assertReadLimit(),this._touch();const $=this.inspectUint32();return this.position+=4,$},get remaining(){return this.bytes.length-this.position},setPosition($){const J=this.position;return this.assertPosition($),this.position=$,()=>this.position=J},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const $=this.getReadCount();if(this.positionReadCount.set(this.position,$+1),$>0)this.recursiveReadCount++}}});var i8;var o8=f(()=>{i8={ether:-9,wei:9}});function r8($,J){let Q=$.toString();const q=Q.startsWith("-");if(q)Q=Q.slice(1);Q=Q.padStart(J,"0");let[Y,W]=[Q.slice(0,Q.length-J),Q.slice(Q.length-J)];return W=W.replace(/(0+)$/,""),`${q?"-":""}${Y||"0"}${W?`.${W}`:""}`}var t8=f(()=>{});function Q0($,J="wei"){return r8($,i8[J])}var a8=f(()=>{o8();t8()});function qY($){const J=Object.entries($).map(([q,Y])=>{if(Y===void 0||Y===!1)return null;return[q,Y]}).filter(Boolean),Q=J.reduce((q,[Y])=>Math.max(q,Y.length),0);return J.map(([q,Y])=>` ${`${q}:`.padEnd(Q+1)} ${Y}`).join("\n")}class jJ extends z{constructor({v:$}){super(`Invalid \`v\` value "${$}". Expected 27 or 28.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class EJ extends z{constructor({transaction:$}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",qY($),"}","","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","- a Legacy Transaction with `gasPrice`"]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class SJ extends z{constructor({storageKey:$}){super(`Size for storage key "${$}" is invalid. Expected 32 bytes. Got ${Math.floor(($.length-2)/2)} bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}var k0=f(()=>{n()});class TJ extends z{constructor({cause:$,message:J}={}){const Q=J?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${Q?`with reason: ${Q}`:"for an unknown reason"}.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}class n$ extends z{constructor({cause:$,maxFeePerGas:J}={}){super(`The fee cap (\`maxFeePerGas\`${J?` = ${Q0(J)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}class e8 extends z{constructor({cause:$,maxFeePerGas:J}={}){super(`The fee cap (\`maxFeePerGas\`${J?` = ${Q0(J)}`:""} gwei) cannot be lower than the block base fee.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}class s8 extends z{constructor({cause:$,nonce:J}={}){super(`Nonce provided for the transaction ${J?`(${J}) `:""}is higher than the next one expected.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}class $Q 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("\n"),{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}class JQ extends z{constructor({cause:$,nonce:J}={}){super(`Nonce provided for the transaction ${J?`(${J}) `:""}exceeds the maximum allowed nonce.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}class QQ extends z{constructor({cause:$}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{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."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}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:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}class YQ extends z{constructor({cause:$,gas:J}={}){super(`The amount of gas ${J?`(${J}) `:""}provided for the transaction is too low.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}class WQ extends z{constructor({cause:$}){super("The transaction type is not supported for this chain.",{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}class P0 extends z{constructor({cause:$,maxPriorityFeePerGas:J,maxFeePerGas:Q}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${J?` = ${Q0(J)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${Q?` = ${Q0(Q)} gwei`:""}).`].join("\n"),{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}var IQ=f(()=>{a8();n();Object.defineProperty(TJ,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(TJ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});Object.defineProperty(n$,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});Object.defineProperty(e8,"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/});Object.defineProperty(s8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});Object.defineProperty($Q,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});Object.defineProperty(JQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});Object.defineProperty(QQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});Object.defineProperty(qQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});Object.defineProperty(YQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});Object.defineProperty(WQ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Object.defineProperty(P0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/})});class HJ extends L${constructor($,J,Q,q){super();this.blockLen=$,this.outputLen=J,this.padOffset=Q,this.isLE=q,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array($),this.view=T0(this.buffer)}update($){N$(this);const{view:J,buffer:Q,blockLen:q}=this;$=B$($);const Y=$.length;for(let W=0;W<Y;){const I=Math.min(q-this.pos,Y-W);if(I===q){const X=T0($);for(;q<=Y-W;W+=q)this.process(X,W);continue}if(Q.set($.subarray(W,W+I),this.pos),this.pos+=I,W+=I,this.pos===q)this.process(J,0),this.pos=0}return this.length+=$.length,this.roundClean(),this}digestInto($){N$(this),z0($,this),this.finished=!0;const{buffer:J,view:Q,blockLen:q,isLE:Y}=this;let{pos:W}=this;if(J[W++]=128,this.buffer.subarray(W).fill(0),this.padOffset>q-W)this.process(Q,0),W=0;for(let Z=W;Z<q;Z++)J[Z]=0;YY(Q,q-8,BigInt(this.length*8),Y),this.process(Q,0);const I=T0($),X=this.outputLen;if(X%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const D=X/4,A=this.get();if(D>A.length)throw new Error("_sha2: outputLen bigger than state");for(let Z=0;Z<D;Z++)I.setUint32(4*Z,A[Z],Y)}digest(){const{buffer:$,outputLen:J}=this;this.digestInto($);const Q=$.slice(0,J);return this.destroy(),Q}_cloneInto($){$||($=new this.constructor),$.set(...this.get());const{blockLen:J,buffer:Q,length:q,finished:Y,destroyed:W,pos:I}=this;if($.length=q,$.pos=I,$.finished=Y,$.destroyed=W,q%J)$.buffer.set(Q);return $}}var YY;var XQ=f(()=>{j0();h$();YY=function($,J,Q,q){if(typeof $.setBigUint64==="function")return $.setBigUint64(J,Q,q);const Y=BigInt(32),W=BigInt(4294967295),I=Number(Q>>Y&W),X=Number(Q&W),D=q?4:0,A=q?0:4;$.setUint32(J+D,I,q),$.setUint32(J+A,X,q)}});class DQ extends HJ{constructor(){super(64,32,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(){const{A:$,B:J,C:Q,D:q,E:Y,F:W,G:I,H:X}=this;return[$,J,Q,q,Y,W,I,X]}set($,J,Q,q,Y,W,I,X){this.A=$|0,this.B=J|0,this.C=Q|0,this.D=q|0,this.E=Y|0,this.F=W|0,this.G=I|0,this.H=X|0}process($,J){for(let Z=0;Z<16;Z++,J+=4)j$[Z]=$.getUint32(J,!1);for(let Z=16;Z<64;Z++){const K=j$[Z-15],U=j$[Z-2],C=W$(K,7)^W$(K,18)^K>>>3,G=W$(U,17)^W$(U,19)^U>>>10;j$[Z]=G+j$[Z-7]+C+j$[Z-16]|0}let{A:Q,B:q,C:Y,D:W,E:I,F:X,G:D,H:A}=this;for(let Z=0;Z<64;Z++){const K=W$(I,6)^W$(I,11)^W$(I,25),U=A+K+WY(I,X,D)+XY[Z]+j$[Z]|0,G=(W$(Q,2)^W$(Q,13)^W$(Q,22))+IY(Q,q,Y)|0;A=D,D=X,X=I,I=W+U|0,W=Y,Y=q,q=Q,Q=U+G|0}Q=Q+this.A|0,q=q+this.B|0,Y=Y+this.C|0,W=W+this.D|0,I=I+this.E|0,X=X+this.F|0,D=D+this.G|0,A=A+this.H|0,this.set(Q,q,Y,W,I,X,D,A)}roundClean(){j$.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}var WY,IY,XY,z$,j$,F0;var fJ=f(()=>{XQ();h$();WY=($,J,Q)=>$&J^~$&Q,IY=($,J,Q)=>$&J^$&Q^J&Q,XY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),z$=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),j$=new Uint32Array(64);F0=H0(()=>new DQ)});class Y0 extends z{constructor({chainId:$}){super(typeof $==="number"?`Chain ID "${$}" is invalid.`:"Chain ID is invalid.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}var wQ=f(()=>{n()});var uJ={};jq(uJ,{validateObject:()=>{{return S$}},utf8ToBytes:()=>{{return zY}},numberToVarBytesBE:()=>{{return wY}},numberToHexUnpadded:()=>{{return vQ}},numberToBytesLE:()=>{{return l0}},numberToBytesBE:()=>{{return E$}},hexToNumber:()=>{{return gJ}},hexToBytes:()=>{{return P$}},equalBytes:()=>{{return CY}},ensureBytes:()=>{{return e}},createHmacDrbg:()=>{{return yJ}},concatBytes:()=>{{return o$}},bytesToNumberLE:()=>{{return c0}},bytesToNumberBE:()=>{{return M$}},bytesToHex:()=>{{return k$}},bitSet:()=>{{return SY}},bitMask:()=>{{return W0}},bitLen:()=>{{return jY}},bitGet:()=>{{return EY}}});function k$($){if(!u0($))throw new Error("Uint8Array expected");let J="";for(let Q=0;Q<$.length;Q++)J+=UY[$[Q]];return J}function vQ($){const J=$.toString(16);return J.length&1?`0${J}`:J}function gJ($){if(typeof $!=="string")throw new Error("hex string expected, got "+typeof $);return BigInt($===""?"0":`0x${$}`)}function P$($){if(typeof $!=="string")throw new Error("hex string expected, got "+typeof $);const J=$.length;if(J%2)throw new Error("padded hex string expected, got unpadded hex of length "+J);const Q=new Uint8Array(J/2);for(let q=0;q<Q.length;q++){const Y=q*2,W=$.slice(Y,Y+2),I=Number.parseInt(W,16);if(Number.isNaN(I)||I<0)throw new Error("Invalid byte sequence");Q[q]=I}return Q}function M$($){return gJ(k$($))}function c0($){if(!u0($))throw new Error("Uint8Array expected");return gJ(k$(Uint8Array.from($).reverse()))}function E$($,J){return P$($.toString(16).padStart(J*2,"0"))}function l0($,J){return E$($,J).reverse()}function wY($){return P$(vQ($))}function e($,J,Q){let q;if(typeof J==="string")try{q=P$(J)}catch(W){throw new Error(`${$} must be valid hex string, got "${J}". Cause: ${W}`)}else if(u0(J))q=Uint8Array.from(J);else throw new Error(`${$} must be hex string or Uint8Array`);const Y=q.length;if(typeof Q==="number"&&Y!==Q)throw new Error(`${$} expected ${Q} bytes, got ${Y}`);return q}function o$(...$){const J=new Uint8Array($.reduce((q,Y)=>q+Y.length,0));let Q=0;return $.forEach((q)=>{if(!u0(q))throw new Error("Uint8Array expected");J.set(q,Q),Q+=q.length}),J}function CY($,J){if($.length!==J.length)return!1;for(let Q=0;Q<$.length;Q++)if($[Q]!==J[Q])return!1;return!0}function zY($){if(typeof $!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof $}`);return new Uint8Array((new TextEncoder()).encode($))}function jY($){let J;for(J=0;$>bQ;$>>=y0,J+=1);return J}function EY($,J){return $>>BigInt(J)&y0}function yJ($,J,Q){if(typeof $!=="number"||$<2)throw new Error("hashLen must be a number");if(typeof J!=="number"||J<2)throw new Error("qByteLen must be a number");if(typeof Q!=="function")throw new Error("hmacFn must be a function");let q=vJ($),Y=vJ($),W=0;const I=()=>{q.fill(1),Y.fill(0),W=0},X=(...K)=>Q(Y,q,...K),D=(K=vJ())=>{if(Y=X(FQ([0]),K),q=X(),K.length===0)return;Y=X(FQ([1]),K),q=X()},A=()=>{if(W++>=1000)throw new Error("drbg: tried 1000 values");let K=0;const U=[];while(K<J){q=X();const C=q.slice();U.push(C),K+=q.length}return o$(...U)};return(K,U)=>{I(),D(K);let C=void 0;while(!(C=U(A())))D();return I(),C}}function S$($,J,Q={}){const q=(Y,W,I)=>{const X=TY[W];if(typeof X!=="function")throw new Error(`Invalid validator "${W}", expected function`);const D=$[Y];if(I&&D===void 0)return;if(!X(D,$))throw new Error(`Invalid param ${String(Y)}=${D} (${typeof D}), expected ${W}`)};for(let[Y,W]of Object.entries(J))q(Y,W,!1);for(let[Y,W]of Object.entries(Q))q(Y,W,!0);return $}var bQ,y0,OY,u0,UY,SY,W0,vJ,FQ,TY;var I0=f(()=>{/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */bQ=BigInt(0),y0=BigInt(1),OY=BigInt(2),u0=($)=>$ instanceof Uint8Array,UY=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0")),SY=($,J,Q)=>{return $|(Q?y0:bQ)<<BigInt(J)},W0=($)=>(OY<<BigInt($-1))-y0,vJ=($)=>new Uint8Array($),FQ=($)=>Uint8Array.from($),TY={bigint:($)=>typeof $==="bigint",function:($)=>typeof $==="function",boolean:($)=>typeof $==="boolean",string:($)=>typeof $==="string",stringOrUint8Array:($)=>typeof $==="string"||$ instanceof Uint8Array,isSafeInteger:($)=>Number.isSafeInteger($),array:($)=>Array.isArray($),field:($,J)=>J.Fp.isValid($),hash:($)=>typeof $==="function"&&Number.isSafeInteger($.outputLen)}});function h($,J){const Q=$%J;return Q>=y?Q:J+Q}function BY($,J,Q){if(Q<=y||J<y)throw new Error("Expected power/modulo > 0");if(Q===v)return y;let q=v;while(J>y){if(J&v)q=q*$%Q;$=$*$%Q,J>>=v}return q}function s($,J,Q){let q=$;while(J-- >y)q*=q,q%=Q;return q}function h0($,J){if($===y||J<=y)throw new Error(`invert: expected positive integers, got n=${$} mod=${J}`);let Q=h($,J),q=J,Y=y,W=v,I=v,X=y;while(Q!==y){const A=q/Q,Z=q%Q,K=Y-I*A,U=W-X*A;q=Q,Q=Z,Y=I,W=X,I=K,X=U}if(q!==v)throw new Error("invert: does not exist");return h(Y,J)}function LY($){const J=($-v)/_$;let Q,q,Y;for(Q=$-v,q=0;Q%_$===y;Q/=_$,q++);for(Y=_$;Y<$&&BY(Y,J,$)!==$-v;Y++);if(q===1){const I=($+v)/cJ;return function X(D,A){const Z=D.pow(A,I);if(!D.eql(D.sqr(Z),A))throw new Error("Cannot find square root");return Z}}const W=(Q+v)/_$;return function I(X,D){if(X.pow(D,J)===X.neg(X.ONE))throw new Error("Cannot find square root");let A=q,Z=X.pow(X.mul(X.ONE,Y),Q),K=X.pow(D,W),U=X.pow(D,Q);while(!X.eql(U,X.ONE)){if(X.eql(U,X.ZERO))return X.ZERO;let C=1;for(let N=X.sqr(U);C<A;C++){if(X.eql(N,X.ONE))break;N=X.sqr(N)}const G=X.pow(Z,v<<BigInt(A-C-1));Z=X.sqr(G),K=X.mul(K,G),U=X.mul(U,Z),A=C}return K}}function kY($){if($%cJ===HY){const J=($+v)/cJ;return function Q(q,Y){const W=q.pow(Y,J);if(!q.eql(q.sqr(W),Y))throw new Error("Cannot find square root");return W}}if($%yQ===gQ){const J=($-gQ)/yQ;return function Q(q,Y){const W=q.mul(Y,_$),I=q.pow(W,J),X=q.mul(Y,I),D=q.mul(q.mul(X,_$),I),A=q.mul(X,q.sub(D,q.ONE));if(!q.eql(q.sqr(A),Y))throw new Error("Cannot find square root");return A}}if($%RY===fY);return LY($)}function lJ($){const J={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},Q=PY.reduce((q,Y)=>{return q[Y]="function",q},J);return S$($,Q)}function _Y($,J,Q){if(Q<y)throw new Error("Expected power > 0");if(Q===y)return $.ONE;if(Q===v)return J;let q=$.ONE,Y=J;while(Q>y){if(Q&v)q=$.mul(q,Y);Y=$.sqr(Y),Q>>=v}return q}function xY($,J){const Q=new Array(J.length),q=J.reduce((W,I,X)=>{if($.is0(I))return W;return Q[X]=W,$.mul(W,I)},$.ONE),Y=$.inv(q);return J.reduceRight((W,I,X)=>{if($.is0(I))return W;return Q[X]=$.mul(W,Q[X]),$.mul(W,I)},Y),Q}function hJ($,J){const Q=J!==void 0?J:$.toString(2).length,q=Math.ceil(Q/8);return{nBitLength:Q,nByteLength:q}}function uQ($,J,Q=!1,q={}){if($<=y)throw new Error(`Expected Field ORDER > 0, got ${$}`);const{nBitLength:Y,nByteLength:W}=hJ($,J);if(W>2048)throw new Error("Field lengths over 2048 bytes are not supported");const I=kY($),X=Object.freeze({ORDER:$,BITS:Y,BYTES:W,MASK:W0(Y),ZERO:y,ONE:v,create:(D)=>h(D,$),isValid:(D)=>{if(typeof D!=="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof D}`);return y<=D&&D<$},is0:(D)=>D===y,isOdd:(D)=>(D&v)===v,neg:(D)=>h(-D,$),eql:(D,A)=>D===A,sqr:(D)=>h(D*D,$),add:(D,A)=>h(D+A,$),sub:(D,A)=>h(D-A,$),mul:(D,A)=>h(D*A,$),pow:(D,A)=>_Y(X,D,A),div:(D,A)=>h(D*h0(A,$),$),sqrN:(D)=>D*D,addN:(D,A)=>D+A,subN:(D,A)=>D-A,mulN:(D,A)=>D*A,inv:(D)=>h0(D,$),sqrt:q.sqrt||((D)=>I(X,D)),invertBatch:(D)=>xY(X,D),cmov:(D,A,Z)=>Z?A:D,toBytes:(D)=>Q?l0(D,W):E$(D,W),fromBytes:(D)=>{if(D.length!==W)throw new Error(`Fp.fromBytes: expected ${W}, got ${D.length}`);return Q?c0(D):M$(D)}});return Object.freeze(X)}function cQ($){if(typeof $!=="bigint")throw new Error("field order must be bigint");const J=$.toString(2).length;return Math.ceil(J/8)}function mJ($){const J=cQ($);return J+Math.ceil(J/2)}function lQ($,J,Q=!1){const q=$.length,Y=cQ(J),W=mJ(J);if(q<16||q<W||q>1024)throw new Error(`expected ${W}-1024 bytes of input, got ${q}`);const I=Q?M$($):c0($),X=h(I,J-v)+v;return Q?l0(X,Y):E$(X,Y)}var y,v,_$,HY,cJ,gQ,yQ,fY,RY,PY;var m0=f(()=>{I0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */y=BigInt(0),v=BigInt(1),_$=BigInt(2),HY=BigInt(3),cJ=BigInt(4),gQ=BigInt(5),yQ=BigInt(8),fY=BigInt(9),RY=BigInt(16),PY=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function hQ($,J){const Q=(Y,W)=>{const I=W.negate();return Y?I:W},q=(Y)=>{const W=Math.ceil(J/Y)+1,I=2**(Y-1);return{windows:W,windowSize:I}};return{constTimeNegate:Q,unsafeLadder(Y,W){let I=$.ZERO,X=Y;while(W>bY){if(W&dJ)I=I.add(X);X=X.double(),W>>=dJ}return I},precomputeWindow(Y,W){const{windows:I,windowSize:X}=q(W),D=[];let A=Y,Z=A;for(let K=0;K<I;K++){Z=A,D.push(Z);for(let U=1;U<X;U++)Z=Z.add(A),D.push(Z);A=Z.double()}return D},wNAF(Y,W,I){const{windows:X,windowSize:D}=q(Y);let{ZERO:A,BASE:Z}=$;const K=BigInt(2**Y-1),U=2**Y,C=BigInt(Y);for(let G=0;G<X;G++){const N=G*D;let O=Number(I&K);if(I>>=C,O>D)O-=U,I+=dJ;const V=N,j=N+Math.abs(O)-1,R=G%2!==0,H=O<0;if(O===0)Z=Z.add(Q(R,W[V]));else A=A.add(Q(H,W[j]))}return{p:A,f:Z}},wNAFCached(Y,W,I,X){const D=Y._WINDOW_SIZE||1;let A=W.get(Y);if(!A){if(A=this.precomputeWindow(Y,D),D!==1)W.set(Y,X(A))}return this.wNAF(D,A,I)}}}function pJ($){return lJ($.Fp),S$($,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...hJ($.n,$.nBitLength),...$,...{p:$.Fp.ORDER}})}var bY,dJ;var mQ=f(()=>{m0();I0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */bY=BigInt(0),dJ=BigInt(1)});function uY($){const J=vY($),{Fp:Q}=J,q=J.toBytes||((G,N,O)=>{const V=N.toAffine();return o$(Uint8Array.from([4]),Q.toBytes(V.x),Q.toBytes(V.y))}),Y=J.fromBytes||((G)=>{const N=G.subarray(1),O=Q.fromBytes(N.subarray(0,Q.BYTES)),V=Q.fromBytes(N.subarray(Q.BYTES,2*Q.BYTES));return{x:O,y:V}});function W(G){const{a:N,b:O}=J,V=Q.sqr(G),j=Q.mul(V,G);return Q.add(Q.add(j,Q.mul(G,N)),O)}if(!Q.eql(Q.sqr(J.Gy),W(J.Gx)))throw new Error("bad generator point: equation left != right");function I(G){return typeof G==="bigint"&&V$<G&&G<J.n}function X(G){if(!I(G))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function D(G){const{allowedPrivateKeyLengths:N,nByteLength:O,wrapPrivateKey:V,n:j}=J;if(N&&typeof G!=="bigint"){if(G instanceof Uint8Array)G=k$(G);if(typeof G!=="string"||!N.includes(G.length))throw new Error("Invalid key");G=G.padStart(O*2,"0")}let R;try{R=typeof G==="bigint"?G:M$(e("private key",G,O))}catch(H){throw new Error(`private key must be ${O} bytes, hex or bigint, not ${typeof G}`)}if(V)R=h(R,j);return X(R),R}const A=new Map;function Z(G){if(!(G instanceof K))throw new Error("ProjectivePoint expected")}class K{constructor(G,N,O){if(this.px=G,this.py=N,this.pz=O,G==null||!Q.isValid(G))throw new Error("x required");if(N==null||!Q.isValid(N))throw new Error("y required");if(O==null||!Q.isValid(O))throw new Error("z required")}static fromAffine(G){const{x:N,y:O}=G||{};if(!G||!Q.isValid(N)||!Q.isValid(O))throw new Error("invalid affine point");if(G instanceof K)throw new Error("projective point not allowed");const V=(j)=>Q.eql(j,Q.ZERO);if(V(N)&&V(O))return K.ZERO;return new K(N,O,Q.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(G){const N=Q.invertBatch(G.map((O)=>O.pz));return G.map((O,V)=>O.toAffine(N[V])).map(K.fromAffine)}static fromHex(G){const N=K.fromAffine(Y(e("pointHex",G)));return N.assertValidity(),N}static fromPrivateKey(G){return K.BASE.multiply(D(G))}_setWindowSize(G){this._WINDOW_SIZE=G,A.delete(this)}assertValidity(){if(this.is0()){if(J.allowInfinityPoint&&!Q.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:G,y:N}=this.toAffine();if(!Q.isValid(G)||!Q.isValid(N))throw new Error("bad point: x or y not FE");const O=Q.sqr(N),V=W(G);if(!Q.eql(O,V))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:G}=this.toAffine();if(Q.isOdd)return!Q.isOdd(G);throw new Error("Field doesn't support isOdd")}equals(G){Z(G);const{px:N,py:O,pz:V}=this,{px:j,py:R,pz:H}=G,E=Q.eql(Q.mul(N,H),Q.mul(j,V)),S=Q.eql(Q.mul(O,H),Q.mul(R,V));return E&&S}negate(){return new K(this.px,Q.neg(this.py),this.pz)}double(){const{a:G,b:N}=J,O=Q.mul(N,dQ),{px:V,py:j,pz:R}=this;let{ZERO:H,ZERO:E,ZERO:S}=Q,L=Q.mul(V,V),Q$=Q.mul(j,j),_=Q.mul(R,R),P=Q.mul(V,j);return P=Q.add(P,P),S=Q.mul(V,R),S=Q.add(S,S),H=Q.mul(G,S),E=Q.mul(O,_),E=Q.add(H,E),H=Q.sub(Q$,E),E=Q.add(Q$,E),E=Q.mul(H,E),H=Q.mul(P,H),S=Q.mul(O,S),_=Q.mul(G,_),P=Q.sub(L,_),P=Q.mul(G,P),P=Q.add(P,S),S=Q.add(L,L),L=Q.add(S,L),L=Q.add(L,_),L=Q.mul(L,P),E=Q.add(E,L),_=Q.mul(j,R),_=Q.add(_,_),L=Q.mul(_,P),H=Q.sub(H,L),S=Q.mul(_,Q$),S=Q.add(S,S),S=Q.add(S,S),new K(H,E,S)}add(G){Z(G);const{px:N,py:O,pz:V}=this,{px:j,py:R,pz:H}=G;let{ZERO:E,ZERO:S,ZERO:L}=Q;const Q$=J.a,_=Q.mul(J.b,dQ);let P=Q.mul(N,j),p=Q.mul(O,R),r=Q.mul(V,H),O$=Q.add(N,O),c=Q.add(j,R);O$=Q.mul(O$,c),c=Q.add(P,p),O$=Q.sub(O$,c),c=Q.add(N,V);let M=Q.add(j,H);return c=Q.mul(c,M),M=Q.add(P,r),c=Q.sub(c,M),M=Q.add(O,V),E=Q.add(R,H),M=Q.mul(M,E),E=Q.add(p,r),M=Q.sub(M,E),L=Q.mul(Q$,c),E=Q.mul(_,r),L=Q.add(E,L),E=Q.sub(p,L),L=Q.add(p,L),S=Q.mul(E,L),p=Q.add(P,P),p=Q.add(p,P),r=Q.mul(Q$,r),c=Q.mul(_,c),p=Q.add(p,r),r=Q.sub(P,r),r=Q.mul(Q$,r),c=Q.add(c,r),P=Q.mul(p,c),S=Q.add(S,P),P=Q.mul(M,c),E=Q.mul(O$,E),E=Q.sub(E,P),P=Q.mul(O$,p),L=Q.mul(M,L),L=Q.add(L,P),new K(E,S,L)}subtract(G){return this.add(G.negate())}is0(){return this.equals(K.ZERO)}wNAF(G){return C.wNAFCached(this,A,G,(N)=>{const O=Q.invertBatch(N.map((V)=>V.pz));return N.map((V,j)=>V.toAffine(O[j])).map(K.fromAffine)})}multiplyUnsafe(G){const N=K.ZERO;if(G===V$)return N;if(X(G),G===J$)return this;const{endo:O}=J;if(!O)return C.unsafeLadder(this,G);let{k1neg:V,k1:j,k2neg:R,k2:H}=O.splitScalar(G),E=N,S=N,L=this;while(j>V$||H>V$){if(j&J$)E=E.add(L);if(H&J$)S=S.add(L);L=L.double(),j>>=J$,H>>=J$}if(V)E=E.negate();if(R)S=S.negate();return S=new K(Q.mul(S.px,O.beta),S.py,S.pz),E.add(S)}multiply(G){X(G);let N=G,O,V;const{endo:j}=J;if(j){const{k1neg:R,k1:H,k2neg:E,k2:S}=j.splitScalar(N);let{p:L,f:Q$}=this.wNAF(H),{p:_,f:P}=this.wNAF(S);L=C.constTimeNegate(R,L),_=C.constTimeNegate(E,_),_=new K(Q.mul(_.px,j.beta),_.py,_.pz),O=L.add(_),V=Q$.add(P)}else{const{p:R,f:H}=this.wNAF(N);O=R,V=H}return K.normalizeZ([O,V])[0]}multiplyAndAddUnsafe(G,N,O){const V=K.BASE,j=(H,E)=>E===V$||E===J$||!H.equals(V)?H.multiplyUnsafe(E):H.multiply(E),R=j(this,N).add(j(G,O));return R.is0()?void 0:R}toAffine(G){const{px:N,py:O,pz:V}=this,j=this.is0();if(G==null)G=j?Q.ONE:Q.inv(V);const R=Q.mul(N,G),H=Q.mul(O,G),E=Q.mul(V,G);if(j)return{x:Q.ZERO,y:Q.ZERO};if(!Q.eql(E,Q.ONE))throw new Error("invZ was invalid");return{x:R,y:H}}isTorsionFree(){const{h:G,isTorsionFree:N}=J;if(G===J$)return!0;if(N)return N(K,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:G,clearCofactor:N}=J;if(G===J$)return this;if(N)return N(K,this);return this.multiplyUnsafe(J.h)}toRawBytes(G=!0){return this.assertValidity(),q(K,this,G)}toHex(G=!0){return k$(this.toRawBytes(G))}}K.BASE=new K(J.Gx,J.Gy,Q.ONE),K.ZERO=new K(Q.ZERO,Q.ONE,Q.ZERO);const U=J.nBitLength,C=hQ(K,J.endo?Math.ceil(U/2):U);return{CURVE:J,ProjectivePoint:K,normPrivateKeyToScalar:D,weierstrassEquation:W,isWithinCurveOrder:I}}function pQ($){const J=cY($),{Fp:Q,n:q}=J,Y=Q.BYTES+1,W=2*Q.BYTES+1;function I(M){return V$<M&&M<Q.ORDER}function X(M){return h(M,q)}function D(M){return h0(M,q)}const{ProjectivePoint:A,normPrivateKeyToScalar:Z,weierstrassEquation:K,isWithinCurveOrder:U}=uY({...J,toBytes(M,T,k){const x=T.toAffine(),F=Q.toBytes(x.x),g=o$;if(k)return g(Uint8Array.from([T.hasEvenY()?2:3]),F);else return g(Uint8Array.from([4]),F,Q.toBytes(x.y))},fromBytes(M){const T=M.length,k=M[0],x=M.subarray(1);if(T===Y&&(k===2||k===3)){const F=M$(x);if(!I(F))throw new Error("Point is not on curve");const g=K(F);let q$=Q.sqrt(g);const t=(q$&J$)===J$;if((k&1)===1!==t)q$=Q.neg(q$);return{x:F,y:q$}}else if(T===W&&k===4){const F=Q.fromBytes(x.subarray(0,Q.BYTES)),g=Q.fromBytes(x.subarray(Q.BYTES,2*Q.BYTES));return{x:F,y:g}}else throw new Error(`Point of length ${T} was invalid. Expected ${Y} compressed bytes or ${W} uncompressed bytes`)}}),C=(M)=>k$(E$(M,J.nByteLength));function G(M){const T=q>>J$;return M>T}function N(M){return G(M)?X(-M):M}const O=(M,T,k)=>M$(M.slice(T,k));class V{constructor(M,T,k){this.r=M,this.s=T,this.recovery=k,this.assertValidity()}static fromCompact(M){const T=J.nByteLength;return M=e("compactSignature",M,T*2),new V(O(M,0,T),O(M,T,2*T))}static fromDER(M){const{r:T,s:k}=x$.toSig(e("DER",M));return new V(T,k)}assertValidity(){if(!U(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!U(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(M){return new V(this.r,this.s,M)}recoverPublicKey(M){const{r:T,s:k,recovery:x}=this,F=L(e("msgHash",M));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const g=x===2||x===3?T+J.n:T;if(g>=Q.ORDER)throw new Error("recovery id 2 or 3 invalid");const q$=(x&1)===0?"02":"03",t=A.fromHex(q$+C(g)),A$=D(g),T$=X(-F*A$),v$=X(k*A$),H$=A.BASE.multiplyAndAddUnsafe(t,T$,v$);if(!H$)throw new Error("point at infinify");return H$.assertValidity(),H$}hasHighS(){return G(this.s)}normalizeS(){return this.hasHighS()?new V(this.r,X(-this.s),this.recovery):this}toDERRawBytes(){return P$(this.toDERHex())}toDERHex(){return x$.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return P$(this.toCompactHex())}toCompactHex(){return C(this.r)+C(this.s)}}const j={isValidPrivateKey(M){try{return Z(M),!0}catch(T){return!1}},normPrivateKeyToScalar:Z,randomPrivateKey:()=>{const M=mJ(J.n);return lQ(J.randomBytes(M),J.n)},precompute(M=8,T=A.BASE){return T._setWindowSize(M),T.multiply(BigInt(3)),T}};function R(M,T=!0){return A.fromPrivateKey(M).toRawBytes(T)}function H(M){const T=M instanceof Uint8Array,k=typeof M==="string",x=(T||k)&&M.length;if(T)return x===Y||x===W;if(k)return x===2*Y||x===2*W;if(M instanceof A)return!0;return!1}function E(M,T,k=!0){if(H(M))throw new Error("first arg must be private key");if(!H(T))throw new Error("second arg must be public key");return A.fromHex(T).multiply(Z(M)).toRawBytes(k)}const S=J.bits2int||function(M){const T=M$(M),k=M.length*8-J.nBitLength;return k>0?T>>BigInt(k):T},L=J.bits2int_modN||function(M){return X(S(M))},Q$=W0(J.nBitLength);function _(M){if(typeof M!=="bigint")throw new Error("bigint expected");if(!(V$<=M&&M<Q$))throw new Error(`bigint expected < 2^${J.nBitLength}`);return E$(M,J.nByteLength)}function P(M,T,k=p){if(["recovered","canonical"].some((f$)=>(f$ in k)))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:F}=J;let{lowS:g,prehash:q$,extraEntropy:t}=k;if(g==null)g=!0;if(M=e("msgHash",M),q$)M=e("prehashed msgHash",x(M));const A$=L(M),T$=Z(T),v$=[_(T$),_(A$)];if(t!=null){const f$=t===!0?F(Q.BYTES):t;v$.push(e("extraEntropy",f$))}const H$=o$(...v$),G0=A$;function r0(f$){const g$=S(f$);if(!U(g$))return;const X8=D(g$),X$=A.BASE.multiply(g$).toAffine(),y$=X(X$.x);if(y$===V$)return;const Z0=X(X8*X(G0+y$*T$));if(Z0===V$)return;let D8=(X$.x===y$?0:2)|Number(X$.y&J$),A8=Z0;if(g&&G(Z0))A8=N(Z0),D8^=1;return new V(y$,A8,D8)}return{seed:H$,k2sig:r0}}const p={lowS:J.lowS,prehash:!1},r={lowS:J.lowS,prehash:!1};function O$(M,T,k=p){const{seed:x,k2sig:F}=P(M,T,k),g=J;return yJ(g.hash.outputLen,g.nByteLength,g.hmac)(x,F)}A.BASE._setWindowSize(8);function c(M,T,k,x=r){const F=M;if(T=e("msgHash",T),k=e("publicKey",k),"strict"in x)throw new Error("options.strict was renamed to lowS");const{lowS:g,prehash:q$}=x;let t=void 0,A$;try{if(typeof F==="string"||F instanceof Uint8Array)try{t=V.fromDER(F)}catch(X$){if(!(X$ instanceof x$.Err))throw X$;t=V.fromCompact(F)}else if(typeof F==="object"&&typeof F.r==="bigint"&&typeof F.s==="bigint"){const{r:X$,s:y$}=F;t=new V(X$,y$)}else throw new Error("PARSE");A$=A.fromHex(k)}catch(X$){if(X$.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(g&&t.hasHighS())return!1;if(q$)T=J.hash(T);const{r:T$,s:v$}=t,H$=L(T),G0=D(v$),r0=X(H$*G0),f$=X(T$*G0),g$=A.BASE.multiplyAndAddUnsafe(A$,r0,f$)?.toAffine();if(!g$)return!1;return X(g$.x)===T$}return{CURVE:J,getPublicKey:R,getSharedSecret:E,sign:O$,verify:c,ProjectivePoint:A,Signature:V,utils:j}}var vY,cY,gY,yY,x$,V$,J$,pX,dQ,nX;var nQ=f(()=>{m0();I0();I0();mQ();vY=function($){const J=pJ($);S$(J,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:Q,Fp:q,a:Y}=J;if(Q){if(!q.eql(Y,q.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof Q!=="object"||typeof Q.beta!=="bigint"||typeof Q.splitScalar!=="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...J})};cY=function($){const J=pJ($);return S$(J,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...J})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */({bytesToNumberBE:gY,hexToBytes:yY}=uJ),x$={Err:class $ extends Error{constructor(J=""){super(J)}},_parseInt($){const{Err:J}=x$;if($.length<2||$[0]!==2)throw new J("Invalid signature integer tag");const Q=$[1],q=$.subarray(2,Q+2);if(!Q||q.length!==Q)throw new J("Invalid signature integer: wrong length");if(q[0]&128)throw new J("Invalid signature integer: negative");if(q[0]===0&&!(q[1]&128))throw new J("Invalid signature integer: unnecessary leading zero");return{d:gY(q),l:$.subarray(Q+2)}},toSig($){const{Err:J}=x$,Q=typeof $==="string"?yY($):$;if(!(Q instanceof Uint8Array))throw new Error("ui8a expected");let q=Q.length;if(q<2||Q[0]!=48)throw new J("Invalid signature tag");if(Q[1]!==q-2)throw new J("Invalid signature: incorrect length");const{d:Y,l:W}=x$._parseInt(Q.subarray(2)),{d:I,l:X}=x$._parseInt(W);if(X.length)throw new J("Invalid signature: left bytes after parsing");return{r:Y,s:I}},hexFromSig($){const J=(A)=>Number.parseInt(A[0],16)&8?"00"+A:A,Q=(A)=>{const Z=A.toString(16);return Z.length&1?`0${Z}`:Z},q=J(Q($.s)),Y=J(Q($.r)),W=q.length/2,I=Y.length/2,X=Q(W),D=Q(I);return`30${Q(I+W+4)}02${D}${Y}02${X}${q}`}},V$=BigInt(0),J$=BigInt(1),pX=BigInt(2),dQ=BigInt(3),nX=BigInt(4)});class nJ extends L${constructor($,J){super();this.finished=!1,this.destroyed=!1,S8($);const Q=B$(J);if(this.iHash=$.create(),typeof this.iHash.update!=="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const q=this.blockLen,Y=new Uint8Array(q);Y.set(Q.length>q?$.create().update(Q).digest():Q);for(let W=0;W<Y.length;W++)Y[W]^=54;this.iHash.update(Y),this.oHash=$.create();for(let W=0;W<Y.length;W++)Y[W]^=54^92;this.oHash.update(Y),Y.fill(0)}update($){return N$(this),this.iHash.update($),this}digestInto($){N$(this),a$($,this.outputLen),this.finished=!0,this.iHash.digestInto($),this.oHash.update($),this.oHash.digestInto($),this.destroy()}digest(){const $=new Uint8Array(this.oHash.outputLen);return this.digestInto($),$}_cloneInto($){$||($=Object.create(Object.getPrototypeOf(this),{}));const{oHash:J,iHash:Q,finished:q,destroyed:Y,blockLen:W,outputLen:I}=this;return $=$,$.finished=q,$.destroyed=Y,$.blockLen=W,$.outputLen=I,$.oHash=J._cloneInto($.oHash),$.iHash=Q._cloneInto($.iHash),$}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}var iJ;var iQ=f(()=>{j0();h$();iJ=($,J,Q)=>new nJ($,J).update(Q).digest();iJ.create=($,J)=>new nJ($,J)});function lY($){return{hash:$,hmac:(J,...Q)=>iJ($,J,F8(...Q)),randomBytes:b8}}function oQ($,J){const Q=(q)=>pQ({...$,...lY(q)});return Object.freeze({...Q(J),create:Q})}var rQ=f(()=>{iQ();h$();nQ();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});var mY,eQ,tQ,hY,oJ,aQ,rJ,tJ,YD,WD;var sQ=f(()=>{fJ();m0();rQ();mY=function($){const J=eQ,Q=BigInt(3),q=BigInt(6),Y=BigInt(11),W=BigInt(22),I=BigInt(23),X=BigInt(44),D=BigInt(88),A=$*$*$%J,Z=A*A*$%J,K=s(Z,Q,J)*Z%J,U=s(K,Q,J)*Z%J,C=s(U,oJ,J)*A%J,G=s(C,Y,J)*C%J,N=s(G,W,J)*G%J,O=s(N,X,J)*N%J,V=s(O,D,J)*O%J,j=s(V,X,J)*N%J,R=s(j,Q,J)*Z%J,H=s(R,I,J)*G%J,E=s(H,q,J)*A%J,S=s(E,oJ,J);if(!rJ.eql(rJ.sqr(S),$))throw new Error("Cannot find square root");return S};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */eQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tQ=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),hY=BigInt(1),oJ=BigInt(2),aQ=($,J)=>($+J/oJ)/J,rJ=uQ(eQ,void 0,void 0,{sqrt:mY}),tJ=oQ({a:BigInt(0),b:BigInt(7),Fp:rJ,n:tQ,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:($)=>{const J=tQ,Q=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),q=-hY*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),Y=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),W=Q,I=BigInt("0x100000000000000000000000000000000"),X=aQ(W*$,J),D=aQ(-q*$,J);let A=h($-X*Q-D*Y,J),Z=h(-X*q-D*W,J);const K=A>I,U=Z>I;if(K)A=J-A;if(U)Z=J-Z;if(A>I||Z>I)throw new Error("splitScalar: Endomorphism failed, k="+$);return{k1neg:K,k1:A,k2neg:U,k2:Z}}}},F0),YD=BigInt(0),WD=tJ.ProjectivePoint});function Z8($){console.log("Setting up browser wallet as active",$.info.name),K0=$.provider,N0=[]}async function Tq(){if(!K0)throw Error("No wallet selected!");N0=await K0.request({method:"eth_requestAccounts"}),console.log("Wallet connected with accounts ",N0)}async function K8($,J){return K0?.request({method:"eth_signTypedData_v4",params:[$,JSON.stringify(J)]})}var G8=new Map,t0="",K0=null,N0,Eq=()=>{console.log("Waiting for wallets to announce"),window.addEventListener("eip6963:announceProvider",($)=>{const J=$;console.log("Wallet announced:",J.detail.info.name),Sq(J.detail)}),window.dispatchEvent(new Event("eip6963:requestProvider"))},Sq=async($)=>{if(t0==="")t0=$.info.name,Z8($);G8.set($.info.name,$)};function N8($){return $.message!==void 0}var R$;(function(q){q["SHA256"]="sha256";q["SHA256D"]="sha256d";q["NO_HASH"]="nohash"})(R$||(R$={}));class M8{authModule;threshold;totalNodes;ttl;wp_client;constructor($,J,Q,q,Y=10){if(J===0)throw new Error("Threshold cannot be 0");this.threshold=J,this.totalNodes=Q,this.authModule=q,this.ttl=Y,this.wp_client=$}async authenticateAndCreateKey(){try{const $={t:this.threshold,n:this.totalNodes};console.log("Generated Payload:",$);const J=await this.authModule.authenticate($,this.wp_client),Q={setup:$,user_authentication:J,ttl:this.ttl},q=await this.wp_client.startKeygen(Q);return console.log("Keygen response:",q),q}catch($){throw console.error($),$}}async authenticateAndSign($,J,Q){const q={hash_algo:Q,key_id:$,message:J},Y=await this.authModule.authenticate(q,this.wp_client),W={setup:q,user_authentication:Y,ttl:this.ttl},I=await this.wp_client.startSigngen(W);return console.log("Sign response:",I),I}}K$();i();function _0($){const{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),q=typeof $.blobs[0]==="string"?$.blobs.map((W)=>Y$(W)):$.blobs,Y=[];for(let W of q)Y.push(Uint8Array.from(J.blobToKzgCommitment(W)));return Q==="bytes"?Y:Y.map((W)=>m(W))}K$();i();function x0($){const{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),q=typeof $.blobs[0]==="string"?$.blobs.map((I)=>Y$(I)):$.blobs,Y=typeof $.commitments[0]==="string"?$.commitments.map((I)=>Y$(I)):$.commitments,W=[];for(let I=0;I<q.length;I++){const X=q[I],D=Y[I];W.push(Uint8Array.from(J.computeBlobKzgProof(X,D)))}return Q==="bytes"?W:W.map((I)=>m(I))}i();fJ();u$();K$();i();function AQ($,J){const Q=J||"hex",q=F0(D$($,{strict:!1})?c$($):$);if(Q==="bytes")return q;return B(q)}function GQ($){const{commitment:J,version:Q=1}=$,q=$.to??(typeof J==="string"?"hex":"bytes"),Y=AQ(J,"bytes");return Y.set([Q],0),q==="bytes"?Y:m(Y)}function ZQ($){const{commitments:J,version:Q}=$,q=$.to??(typeof J[0]==="string"?"hex":"bytes"),Y=[];for(let W of J)Y.push(GQ({commitment:W,to:q,version:Q}));return Y}var KQ=32,NQ=4096,MQ=131072,RJ=761855;var b0=1;n();class BJ extends z{constructor({maxSize:$,size:J}){super("Blob size is too large.",{metaMessages:[`Max: ${$} bytes`,`Given: ${J} bytes`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class q0 extends z{constructor(){super("Blob data must not be empty.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class LJ extends z{constructor({hash:$,size:J}){super(`Versioned hash "${$}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${J}`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class kJ extends z{constructor({hash:$,version:J}){super(`Versioned hash "${$}" version is invalid.`,{metaMessages:[`Expected: ${b0}`,`Received: ${J}`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}zJ();U$();K$();i();function VQ($){const J=$.to??(typeof $.data==="string"?"hex":"bytes"),Q=typeof $.data==="string"?Y$($.data):$.data,q=b(Q);if(!q)throw new q0;if(q>RJ)throw new BJ({maxSize:RJ,size:q});const Y=[];let W=!0,I=0;while(W){const X=L0(new Uint8Array(MQ));let D=0;while(D<NQ){const A=Q.slice(I,I+(KQ-1));if(X.pushByte(0),X.pushBytes(A),A.length<31){X.pushByte(128),W=!1;break}D++,I+=31}Y.push(X)}return J==="bytes"?Y.map((X)=>X.bytes):Y.map((X)=>m(X.bytes))}function OQ($){const{data:J,kzg:Q,to:q}=$,Y=$.blobs??VQ({data:J,to:q}),W=$.commitments??_0({blobs:Y,kzg:Q,to:q}),I=$.proofs??x0({blobs:Y,commitments:W,kzg:Q,to:q}),X=[];for(let D=0;D<Y.length;D++)X.push({blob:Y[D],commitment:W[D],proof:I[D]});return X}k0();function UQ($){if($.type)return $.type;if(typeof $.blobs!=="undefined"||typeof $.blobVersionedHashes!=="undefined"||typeof $.maxFeePerBlobGas!=="undefined"||typeof $.sidecars!=="undefined")return"eip4844";if(typeof $.maxFeePerGas!=="undefined"||typeof $.maxPriorityFeePerGas!=="undefined")return"eip1559";if(typeof $.gasPrice!=="undefined"){if(typeof $.accessList!=="undefined")return"eip2930";return"legacy"}throw new EJ({transaction:$})}KJ();m$();function v0($){const J=l(`0x${$.substring(4)}`).substring(26);return f0(`0x${J}`)}var CQ=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,zQ=/^(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)?$/;qJ();d$();p$();U$();i();p8();J0();i();m$();function PJ($){const{domain:J={},message:Q,primaryType:q}=$,Y={EIP712Domain:RQ({domain:J}),...$.types};fQ({domain:J,message:Q,primaryType:q,types:Y});const W=["0x1901"];if(J)W.push(jQ({domain:J,types:Y}));if(q!=="EIP712Domain")W.push(EQ({data:Q,primaryType:q,types:Y}));return l(I$(W))}function jQ({domain:$,types:J}){return EQ({data:$,primaryType:"EIP712Domain",types:J})}var EQ=function({data:$,primaryType:J,types:Q}){const q=SQ({data:$,primaryType:J,types:Q});return l(q)},SQ=function({data:$,primaryType:J,types:Q}){const q=[{type:"bytes32"}],Y=[DY({primaryType:J,types:Q})];for(let W of Q[J]){const[I,X]=HQ({types:Q,name:W.name,type:W.type,value:$[W.name]});q.push(I),Y.push(X)}return VJ(q,Y)},DY=function({primaryType:$,types:J}){const Q=B(AY({primaryType:$,types:J}));return l(Q)},AY=function({primaryType:$,types:J}){let Q="";const q=TQ({primaryType:$,types:J});q.delete($);const Y=[$,...Array.from(q).sort()];for(let W of Y)Q+=`${W}(${J[W].map(({name:I,type:X})=>`${X} ${I}`).join(",")})`;return Q},TQ=function({primaryType:$,types:J},Q=new Set){const Y=$.match(/^\w*/u)?.[0];if(Q.has(Y)||J[Y]===void 0)return Q;Q.add(Y);for(let W of J[Y])TQ({primaryType:W.type,types:J},Q);return Q},HQ=function({types:$,name:J,type:Q,value:q}){if($[Q]!==void 0)return[{type:"bytes32"},l(SQ({data:q,primaryType:Q,types:$}))];if(Q==="bytes")return q=`0x${(q.length%2?"0":"")+q.slice(2)}`,[{type:"bytes32"},l(q)];if(Q==="string")return[{type:"bytes32"},l(B(q))];if(Q.lastIndexOf("]")===Q.length-1){const Y=Q.slice(0,Q.lastIndexOf("[")),W=q.map((I)=>HQ({name:J,type:Y,types:$,value:I}));return[{type:"bytes32"},l(VJ(W.map(([I])=>I),W.map(([,I])=>I)))]}return[{type:Q},q]};function fQ($){const{domain:J,message:Q,primaryType:q,types:Y}=$,W=(I,X)=>{for(let D of I){const{name:A,type:Z}=D,K=X[A],U=Z.match(zQ);if(U&&(typeof K==="number"||typeof K==="bigint")){const[N,O,V]=U;$$(K,{signed:O==="int",size:Number.parseInt(V)/8})}if(Z==="address"&&typeof K==="string"&&!a(K))throw new o({address:K});const C=Z.match(CQ);if(C){const[N,O]=C;if(O&&b(K)!==Number.parseInt(O))throw new $J({expectedSize:Number.parseInt(O),givenSize:b(K)})}const G=Y[Z];if(G)W(G,K)}};if(Y.EIP712Domain&&J)W(Y.EIP712Domain,J);if(q!=="EIP712Domain"){const I=Y[q];W(I,Q)}}function RQ({domain:$}){return[typeof $?.name==="string"&&{name:"name",type:"string"},$?.version&&{name:"version",type:"string"},typeof $?.chainId==="number"&&{name:"chainId",type:"uint256"},$?.verifyingContract&&{name:"verifyingContract",type:"address"},$?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}n();zJ();K$();i();function i$($,J="hex"){const Q=BQ($),q=L0(new Uint8Array(Q.length));if(Q.encode(q),J==="hex")return m(q.bytes);return q.bytes}var BQ=function($){if(Array.isArray($))return GY($.map((J)=>BQ(J)));return ZY($)},GY=function($){const J=$.reduce((Y,W)=>Y+W.length,0),Q=LQ(J);return{length:(()=>{if(J<=55)return 1+J;return 1+Q+J})(),encode(Y){if(J<=55)Y.pushByte(192+J);else if(Y.pushByte(247+Q),Q===1)Y.pushUint8(J);else if(Q===2)Y.pushUint16(J);else if(Q===3)Y.pushUint24(J);else Y.pushUint32(J);for(let{encode:W}of $)W(Y)}}},ZY=function($){const J=typeof $==="string"?Y$($):$,Q=LQ(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(Y){if(J.length===1&&J[0]<128)Y.pushBytes(J);else if(J.length<=55)Y.pushByte(128+J.length),Y.pushBytes(J);else{if(Y.pushByte(183+Q),Q===1)Y.pushUint8(J.length);else if(Q===2)Y.pushUint16(J.length);else if(Q===3)Y.pushUint24(J.length);else Y.pushUint32(J.length);Y.pushBytes(J)}}}},LQ=function($){if($<256)return 1;if($<65536)return 2;if($<16777216)return 3;if($<4294967296)return 4;throw new z("Length is too large.")};var kQ=`\x19Ethereum Signed Message:
|
|
2
|
-
`;J0();K$();
|
|
1
|
+
var Mq=Object.defineProperty;var Vq=($,J)=>{for(var Q in J)Mq($,Q,{get:J[Q],enumerable:!0,configurable:!0,set:(q)=>J[Q]=()=>q})};var f=($,J)=>()=>($&&(J=$($=0)),J);function X$($,{strict:J=!0}={}){if(!$)return!1;if(typeof $!=="string")return!1;return J?/^0x[0-9a-fA-F]*$/.test($):$.startsWith("0x")}var u$=f(()=>{});function b($){if(X$($,{strict:!1}))return Math.ceil(($.length-2)/2);return $.length}var U$=f(()=>{u$()});var A8;var G8=f(()=>{A8="2.11.1"});var Z8;var K8=f(()=>{G8();Z8=()=>`viem@${A8}`});class z extends Error{constructor($,J={}){super();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:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Z8()});const Q=J.cause instanceof z?J.cause.details:J.cause?.message?J.cause.message:J.details,q=J.cause instanceof z?J.cause.docsPath||J.docsPath:J.docsPath;if(this.message=[$||"An error occurred.","",...J.metaMessages?[...J.metaMessages,""]:[],...q?[`Docs: https://viem.sh${q}${J.docsSlug?`#${J.docsSlug}`:""}`]:[],...Q?[`Details: ${Q}`]:[],`Version: ${this.version}`].join("\n"),J.cause)this.cause=J.cause;this.details=Q,this.docsPath=q,this.metaMessages=J.metaMessages,this.shortMessage=$}walk($){return N8(this,$)}}var N8;var n=f(()=>{K8();N8=function($,J){if(J?.($))return $;if($&&typeof $==="object"&&"cause"in $)return N8($.cause,J);return J?null:$}});class o0 extends z{constructor({expectedLength:$,givenLength:J,type:Q}){super([`ABI encoding array length mismatch for type ${Q}.`,`Expected length: ${$}`,`Given length: ${J}`].join("\n"));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class r0 extends z{constructor({expectedSize:$,value:J}){super(`Size of bytes "${J}" (bytes${b(J)}) does not match expected size (bytes${$}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class t0 extends z{constructor({expectedLength:$,givenLength:J}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${$}`,`Given length (values): ${J}`].join("\n"));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class a0 extends z{constructor({expectedSize:$,givenSize:J}){super(`Expected bytes${$}, got bytes${J}.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class e0 extends z{constructor($,{docsPath:J}){super([`Type "${$}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:J});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class s0 extends z{constructor($){super([`Value "${$}" is not a valid array.`].join("\n"));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}var $J=f(()=>{U$();n()});class K0 extends z{constructor({offset:$,position:J,size:Q}){super(`Slice ${J==="start"?"starting":"ending"} at offset "${$}" is out-of-bounds (size: ${Q}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class N0 extends z{constructor({size:$,targetSize:J,type:Q}){super(`${Q.charAt(0).toUpperCase()}${Q.slice(1).toLowerCase()} size (${$}) exceeds padding size (${J}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}var JJ=f(()=>{n()});function w$($,{dir:J,size:Q=32}={}){if(typeof $==="string")return G$($,{dir:J,size:Q});return Oq($,{dir:J,size:Q})}function G$($,{dir:J,size:Q=32}={}){if(Q===null)return $;const q=$.replace("0x","");if(q.length>Q*2)throw new N0({size:Math.ceil(q.length/2),targetSize:Q,type:"hex"});return`0x${q[J==="right"?"padEnd":"padStart"](Q*2,"0")}`}function Oq($,{dir:J,size:Q=32}={}){if(Q===null)return $;if($.length>Q)throw new N0({size:$.length,targetSize:Q,type:"bytes"});const q=new Uint8Array(Q);for(let Y=0;Y<Q;Y++){const W=J==="right";q[W?Y:Q-Y-1]=$[W?Y:$.length-Y-1]}return q}var M0=f(()=>{JJ()});class QJ extends z{constructor({max:$,min:J,signed:Q,size:q,value:Y}){super(`Number "${Y}" is not in safe ${q?`${q*8}-bit ${Q?"signed":"unsigned"} `:""}integer range ${$?`(${J} to ${$})`:`(above ${J})`}`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class qJ extends z{constructor({givenSize:$,maxSize:J}){super(`Size cannot exceed ${J} bytes. Given size: ${$} bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}var YJ=f(()=>{n()});function WJ($,{dir:J="left"}={}){let Q=typeof $==="string"?$.replace("0x",""):$,q=0;for(let Y=0;Y<Q.length-1;Y++)if(Q[J==="left"?Y:Q.length-Y-1].toString()==="0")q++;else break;if(Q=J==="left"?Q.slice(q):Q.slice(0,Q.length-q),typeof $==="string"){if(Q.length===1&&J==="right")Q=`${Q}0`;return`0x${Q.length%2===1?`0${Q}`:Q}`}return Q}var M8=f(()=>{});function C$($,{size:J}){if(b($)>J)throw new qJ({givenSize:b($),maxSize:J})}function V0($,J={}){const{signed:Q}=J;if(J.size)C$($,{size:J.size});const q=BigInt($);if(!Q)return q;const Y=($.length-2)/2,W=(1n<<BigInt(Y)*8n-1n)-1n;if(q<=W)return q;return q-BigInt(`0x${"f".padStart(Y*2,"f")}`)-1n}function V8($,J={}){return Number(V0($,J))}var r$=f(()=>{YJ();U$()});function B($,J={}){if(typeof $==="number"||typeof $==="bigint")return $$($,J);if(typeof $==="string")return U0($,J);if(typeof $==="boolean")return O0($,J);return h($,J)}function O0($,J={}){const Q=`0x${Number($)}`;if(typeof J.size==="number")return C$(Q,{size:J.size}),w$(Q,{size:J.size});return Q}function h($,J={}){let Q="";for(let Y=0;Y<$.length;Y++)Q+=Uq[$[Y]];const q=`0x${Q}`;if(typeof J.size==="number")return C$(q,{size:J.size}),w$(q,{dir:"right",size:J.size});return q}function $$($,J={}){const{signed:Q,size:q}=J,Y=BigInt($);let W;if(q)if(Q)W=(1n<<BigInt(q)*8n-1n)-1n;else W=2n**(BigInt(q)*8n)-1n;else if(typeof $==="number")W=BigInt(Number.MAX_SAFE_INTEGER);const D=typeof W==="bigint"&&Q?-W-1n:0;if(W&&Y>W||Y<D){const X=typeof $==="bigint"?"n":"";throw new QJ({max:W?`${W}${X}`:void 0,min:`${D}${X}`,signed:Q,size:q,value:`${$}${X}`})}const I=`0x${(Q&&Y<0?(1n<<BigInt(q*8))+BigInt(Y):Y).toString(16)}`;if(q)return w$(I,{size:q});return I}function U0($,J={}){const Q=wq.encode($);return h(Q,J)}var Uq,wq;var i=f(()=>{YJ();M0();r$();Uq=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0")),wq=new TextEncoder});function c$($,J={}){if(typeof $==="number"||typeof $==="bigint")return jq($,J);if(typeof $==="boolean")return zq($,J);if(X$($))return Y$($,J);return l$($,J)}function zq($,J={}){const Q=new Uint8Array(1);if(Q[0]=Number($),typeof J.size==="number")return C$(Q,{size:J.size}),w$(Q,{size:J.size});return Q}function Y$($,J={}){let Q=$;if(J.size)C$(Q,{size:J.size}),Q=w$(Q,{dir:"right",size:J.size});let q=Q.slice(2);if(q.length%2)q=`0${q}`;const Y=q.length/2,W=new Uint8Array(Y);for(let D=0,I=0;D<Y;D++){const X=O8(q.charCodeAt(I++)),A=O8(q.charCodeAt(I++));if(X===void 0||A===void 0)throw new z(`Invalid byte sequence ("${q[I-2]}${q[I-1]}" in "${q}").`);W[D]=X*16+A}return W}function jq($,J){const Q=$$($,J);return Y$(Q)}function l$($,J={}){const Q=Cq.encode($);if(typeof J.size==="number")return C$(Q,{size:J.size}),w$(Q,{dir:"right",size:J.size});return Q}var O8,Cq,Z$;var K$=f(()=>{n();u$();M0();r$();i();O8=function($){if($>=Z$.zero&&$<=Z$.nine)return $-Z$.zero;if($>=Z$.A&&$<=Z$.F)return $-(Z$.A-10);if($>=Z$.a&&$<=Z$.f)return $-(Z$.a-10);return};Cq=new TextEncoder,Z$={zero:48,nine:57,A:65,F:70,a:97,f:102}});var t$,a$,U8,N$,w0;var C0=f(()=>{t$=function($){if(!Number.isSafeInteger($)||$<0)throw new Error(`Wrong positive integer: ${$}`)},a$=function($,...J){if(!($ instanceof Uint8Array))throw new Error("Expected Uint8Array");if(J.length>0&&!J.includes($.length))throw new Error(`Expected Uint8Array of length ${J}, not of length=${$.length}`)},U8=function($){if(typeof $!=="function"||typeof $.create!=="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t$($.outputLen),t$($.blockLen)},N$=function($,J=!0){if($.destroyed)throw new Error("Hash instance has been destroyed");if(J&&$.finished)throw new Error("Hash#digest() has already been called")},w0=function($,J){a$($);const Q=J.outputLen;if($.length<Q)throw new Error(`digestInto() expects output buffer of length at least ${Q}`)}});var Eq,C8,z0,w8,z8,j8,E8,S8;var T8=f(()=>{Eq=function($,J=!1){if(J)return{h:Number($&z0),l:Number($>>w8&z0)};return{h:Number($>>w8&z0)|0,l:Number($&z0)|0}},C8=function($,J=!1){let Q=new Uint32Array($.length),q=new Uint32Array($.length);for(let Y=0;Y<$.length;Y++){const{h:W,l:D}=Eq($[Y],J);[Q[Y],q[Y]]=[W,D]}return[Q,q]},z0=BigInt(4294967295),w8=BigInt(32),z8=($,J,Q)=>$<<Q|J>>>32-Q,j8=($,J,Q)=>J<<Q|$>>>32-Q,E8=($,J,Q)=>J<<Q-32|$>>>64-Q,S8=($,J,Q)=>$<<Q-32|J>>>64-Q});var j0;var H8=f(()=>{j0=typeof globalThis==="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function Tq($){if(typeof $!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof $}`);return new Uint8Array((new TextEncoder()).encode($))}function B$($){if(typeof $==="string")$=Tq($);if(!f8($))throw new Error(`expected Uint8Array, got ${typeof $}`);return $}function B8(...$){const J=new Uint8Array($.reduce((q,Y)=>q+Y.length,0));let Q=0;return $.forEach((q)=>{if(!f8(q))throw new Error("Uint8Array expected");J.set(q,Q),Q+=q.length}),J}function S0($){const J=(q)=>$().update(B$(q)).digest(),Q=$();return J.outputLen=Q.outputLen,J.blockLen=Q.blockLen,J.create=()=>$(),J}function L8($=32){if(j0&&typeof j0.getRandomValues==="function")return j0.getRandomValues(new Uint8Array($));throw new Error("crypto.getRandomValues must be defined")}class L${clone(){return this._cloneInto()}}var f8,R8,E0,W$,Sq,m9;var m$=f(()=>{H8();/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */f8=($)=>$ instanceof Uint8Array,R8=($)=>new Uint32Array($.buffer,$.byteOffset,Math.floor($.byteLength/4)),E0=($)=>new DataView($.buffer,$.byteOffset,$.byteLength),W$=($,J)=>$<<32-J|$>>>J,Sq=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Sq)throw new Error("Non little-endian hardware is not supported");m9={}.toString});function _q($,J=24){const Q=new Uint32Array(10);for(let q=24-J;q<24;q++){for(let D=0;D<10;D++)Q[D]=$[D]^$[D+10]^$[D+20]^$[D+30]^$[D+40];for(let D=0;D<10;D+=2){const I=(D+8)%10,X=(D+2)%10,A=Q[X],Z=Q[X+1],K=k8(A,Z,1)^Q[I],U=P8(A,Z,1)^Q[I+1];for(let C=0;C<50;C+=10)$[D+C]^=K,$[D+C+1]^=U}let Y=$[2],W=$[3];for(let D=0;D<24;D++){const I=x8[D],X=k8(Y,W,I),A=P8(Y,W,I),Z=_8[D];Y=$[Z],W=$[Z+1],$[Z]=X,$[Z+1]=A}for(let D=0;D<50;D+=10){for(let I=0;I<10;I++)Q[I]=$[D+I];for(let I=0;I<10;I++)$[D+I]^=~Q[(I+2)%10]&Q[(I+4)%10]}$[0]^=kq[q],$[1]^=Pq[q]}Q.fill(0)}class DJ extends L${constructor($,J,Q,q=!1,Y=24){super();if(this.blockLen=$,this.suffix=J,this.outputLen=Q,this.enableXOF=q,this.rounds=Y,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,t$(Q),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=R8(this.state)}keccak(){_q(this.state32,this.rounds),this.posOut=0,this.pos=0}update($){N$(this);const{blockLen:J,state:Q}=this;$=B$($);const q=$.length;for(let Y=0;Y<q;){const W=Math.min(J-this.pos,q-Y);for(let D=0;D<W;D++)Q[this.pos++]^=$[Y++];if(this.pos===J)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:$,suffix:J,pos:Q,blockLen:q}=this;if($[Q]^=J,(J&128)!==0&&Q===q-1)this.keccak();$[q-1]^=128,this.keccak()}writeInto($){N$(this,!1),a$($),this.finish();const J=this.state,{blockLen:Q}=this;for(let q=0,Y=$.length;q<Y;){if(this.posOut>=Q)this.keccak();const W=Math.min(Q-this.posOut,Y-q);$.set(J.subarray(this.posOut,this.posOut+W),q),this.posOut+=W,q+=W}return $}xofInto($){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto($)}xof($){return t$($),this.xofInto(new Uint8Array($))}digestInto($){if(w0($,this),this.finished)throw new Error("digest() was already called");return this.writeInto($),this.destroy(),$}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto($){const{blockLen:J,suffix:Q,outputLen:q,rounds:Y,enableXOF:W}=this;return $||($=new DJ(J,Q,q,W,Y)),$.state32.set(this.state32),$.pos=this.pos,$.posOut=this.posOut,$.finished=this.finished,$.rounds=Y,$.suffix=Q,$.outputLen=q,$.enableXOF=W,$.destroyed=this.destroyed,$}}var _8,x8,F8,Hq,e$,fq,Rq,Bq,Lq,kq,Pq,k8,P8,xq,b8;var v8=f(()=>{C0();T8();m$();[_8,x8,F8]=[[],[],[]],Hq=BigInt(0),e$=BigInt(1),fq=BigInt(2),Rq=BigInt(7),Bq=BigInt(256),Lq=BigInt(113);for(let $=0,J=e$,Q=1,q=0;$<24;$++){[Q,q]=[q,(2*Q+3*q)%5],_8.push(2*(5*q+Q)),x8.push(($+1)*($+2)/2%64);let Y=Hq;for(let W=0;W<7;W++)if(J=(J<<e$^(J>>Rq)*Lq)%Bq,J&fq)Y^=e$<<(e$<<BigInt(W))-e$;F8.push(Y)}[kq,Pq]=C8(F8,!0),k8=($,J,Q)=>Q>32?E8($,J,Q):z8($,J,Q),P8=($,J,Q)=>Q>32?S8($,J,Q):j8($,J,Q);xq=($,J,Q)=>S0(()=>new DJ(J,$,Q)),b8=xq(1,136,32)});function l($,J){const Q=J||"hex",q=b8(X$($,{strict:!1})?c$($):$);if(Q==="bytes")return q;return B(q)}var h$=f(()=>{v8();u$();K$();i()});class o 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."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}var d$=f(()=>{n()});class s$ extends Map{constructor($){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=$}set($,J){if(super.set($,J),this.maxSize&&this.size>this.maxSize)this.delete(this.keys().next().value);return this}}var IJ=f(()=>{});function T0($,J){if(XJ.has(`${$}.${J}`))return XJ.get(`${$}.${J}`);const Q=J?`${J}${$.toLowerCase()}`:$.substring(2).toLowerCase(),q=l(l$(Q),"bytes"),Y=(J?Q.substring(`${J}0x`.length):Q).split("");for(let D=0;D<40;D+=2){if(q[D>>1]>>4>=8&&Y[D])Y[D]=Y[D].toUpperCase();if((q[D>>1]&15)>=8&&Y[D+1])Y[D+1]=Y[D+1].toUpperCase()}const W=`0x${Y.join("")}`;return XJ.set(`${$}.${J}`,W),W}var XJ;var AJ=f(()=>{K$();h$();IJ();XJ=new s$(8192)});function a($,J){const{strict:Q=!0}=J??{};if(GJ.has($))return GJ.get($);const q=(()=>{if(!Fq.test($))return!1;if($.toLowerCase()===$)return!0;if(Q)return T0($)===$;return!0})();return GJ.set($,q),q}var Fq,GJ;var p$=f(()=>{IJ();AJ();Fq=/^0x[a-fA-F0-9]{40}$/,GJ=new s$(8192)});function D$($){if(typeof $[0]==="string")return $0($);return bq($)}function bq($){let J=0;for(let Y of $)J+=Y.length;const Q=new Uint8Array(J);let q=0;for(let Y of $)Q.set(Y,q),q+=Y.length;return Q}function $0($){return`0x${$.reduce((J,Q)=>J+Q.replace("0x",""),"")}`}var J0=f(()=>{});function H0($,J,Q,{strict:q}={}){if(X$($,{strict:!1}))return gq($,J,Q,{strict:q});return vq($,J,Q,{strict:q})}function vq($,J,Q,{strict:q}={}){g8($,J);const Y=$.slice(J,Q);if(q)y8(Y,J,Q);return Y}function gq($,J,Q,{strict:q}={}){g8($,J);const Y=`0x${$.replace("0x","").slice((J??0)*2,(Q??$.length)*2)}`;if(q)y8(Y,J,Q);return Y}var g8,y8;var ZJ=f(()=>{JJ();u$();U$();g8=function($,J){if(typeof J==="number"&&J>0&&J>b($)-1)throw new K0({offset:J,position:"start",size:b($)})},y8=function($,J,Q){if(typeof J==="number"&&typeof Q==="number"&&b($)!==Q-J)throw new K0({offset:Q,position:"end",size:b($)})}});function KJ($,J){if($.length!==J.length)throw new t0({expectedLength:$.length,givenLength:J.length});const Q=yq({params:$,values:J}),q=MJ(Q);if(q.length===0)return"0x";return q}function nq($){const J=$.match(/^(.*)\[(\d+)?\]$/);return J?[J[2]?Number(J[2]):null,J[1]]:void 0}var yq,NJ,MJ,uq,cq,lq,mq,hq,dq,pq;var u8=f(()=>{$J();d$();n();p$();J0();M0();U$();ZJ();i();yq=function({params:$,values:J}){const Q=[];for(let q=0;q<$.length;q++)Q.push(NJ({param:$[q],value:J[q]}));return Q},NJ=function({param:$,value:J}){const Q=nq($.type);if(Q){const[q,Y]=Q;return cq(J,{length:q,param:{...$,type:Y}})}if($.type==="tuple")return pq(J,{param:$});if($.type==="address")return uq(J);if($.type==="bool")return mq(J);if($.type.startsWith("uint")||$.type.startsWith("int")){const q=$.type.startsWith("int");return hq(J,{signed:q})}if($.type.startsWith("bytes"))return lq(J,{param:$});if($.type==="string")return dq(J);throw new e0($.type,{docsPath:"/docs/contract/encodeAbiParameters"})},MJ=function($){let J=0;for(let W=0;W<$.length;W++){const{dynamic:D,encoded:I}=$[W];if(D)J+=32;else J+=b(I)}const Q=[],q=[];let Y=0;for(let W=0;W<$.length;W++){const{dynamic:D,encoded:I}=$[W];if(D)Q.push($$(J+Y,{size:32})),q.push(I),Y+=b(I);else Q.push(I)}return D$([...Q,...q])},uq=function($){if(!a($))throw new o({address:$});return{dynamic:!1,encoded:G$($.toLowerCase())}},cq=function($,{length:J,param:Q}){const q=J===null;if(!Array.isArray($))throw new s0($);if(!q&&$.length!==J)throw new o0({expectedLength:J,givenLength:$.length,type:`${Q.type}[${J}]`});let Y=!1;const W=[];for(let D=0;D<$.length;D++){const I=NJ({param:Q,value:$[D]});if(I.dynamic)Y=!0;W.push(I)}if(q||Y){const D=MJ(W);if(q){const I=$$(W.length,{size:32});return{dynamic:!0,encoded:W.length>0?D$([I,D]):I}}if(Y)return{dynamic:!0,encoded:D}}return{dynamic:!1,encoded:D$(W.map(({encoded:D})=>D))}},lq=function($,{param:J}){const[,Q]=J.type.split("bytes"),q=b($);if(!Q){let Y=$;if(q%32!==0)Y=G$(Y,{dir:"right",size:Math.ceil(($.length-2)/2/32)*32});return{dynamic:!0,encoded:D$([G$($$(q,{size:32})),Y])}}if(q!==Number.parseInt(Q))throw new r0({expectedSize:Number.parseInt(Q),value:$});return{dynamic:!1,encoded:G$($,{dir:"right"})}},mq=function($){if(typeof $!=="boolean")throw new z(`Invalid boolean value: "${$}" (type: ${typeof $}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:G$(O0($))}},hq=function($,{signed:J}){return{dynamic:!1,encoded:$$($,{size:32,signed:J})}},dq=function($){const J=U0($),Q=Math.ceil(b(J)/32),q=[];for(let Y=0;Y<Q;Y++)q.push(G$(H0(J,Y*32,(Y+1)*32),{dir:"right"}));return{dynamic:!0,encoded:D$([G$($$(b(J),{size:32})),...q])}},pq=function($,{param:J}){let Q=!1;const q=[];for(let Y=0;Y<J.components.length;Y++){const W=J.components[Y],D=Array.isArray($)?Y:W.name,I=NJ({param:W,value:$[D]});if(q.push(I),I.dynamic)Q=!0}return{dynamic:Q,encoded:Q?MJ(q):D$(q.map(({encoded:Y})=>Y))}}});class f0 extends z{constructor({offset:$}){super(`Offset \`${$}\` cannot be negative.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class VJ extends z{constructor({length:$,position:J}){super(`Position \`${J}\` is out of bounds (\`0 < position < ${$}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class OJ extends z{constructor({count:$,limit:J}){super(`Recursive read limit of \`${J}\` exceeded (recursive read count: \`${$}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}var c8=f(()=>{n()});function R0($,{recursiveReadLimit:J=8192}={}){const Q=Object.create(iq);return Q.bytes=$,Q.dataView=new DataView($.buffer,$.byteOffset,$.byteLength),Q.positionReadCount=new Map,Q.recursiveReadLimit=J,Q}var iq;var UJ=f(()=>{c8();iq={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 OJ({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition($){if($<0||$>this.bytes.length-1)throw new VJ({length:this.bytes.length,position:$})},decrementPosition($){if($<0)throw new f0({offset:$});const J=this.position-$;this.assertPosition(J),this.position=J},getReadCount($){return this.positionReadCount.get($||this.position)||0},incrementPosition($){if($<0)throw new f0({offset:$});const J=this.position+$;this.assertPosition(J),this.position=J},inspectByte($){const J=$??this.position;return this.assertPosition(J),this.bytes[J]},inspectBytes($,J){const Q=J??this.position;return this.assertPosition(Q+$-1),this.bytes.subarray(Q,Q+$)},inspectUint8($){const J=$??this.position;return this.assertPosition(J),this.bytes[J]},inspectUint16($){const J=$??this.position;return this.assertPosition(J+1),this.dataView.getUint16(J)},inspectUint24($){const J=$??this.position;return this.assertPosition(J+2),(this.dataView.getUint16(J)<<8)+this.dataView.getUint8(J+2)},inspectUint32($){const 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,$&~4294967040),this.position+=3},pushUint32($){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,$),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const $=this.inspectByte();return this.position++,$},readBytes($,J){this.assertReadLimit(),this._touch();const Q=this.inspectBytes($);return this.position+=J??$,Q},readUint8(){this.assertReadLimit(),this._touch();const $=this.inspectUint8();return this.position+=1,$},readUint16(){this.assertReadLimit(),this._touch();const $=this.inspectUint16();return this.position+=2,$},readUint24(){this.assertReadLimit(),this._touch();const $=this.inspectUint24();return this.position+=3,$},readUint32(){this.assertReadLimit(),this._touch();const $=this.inspectUint32();return this.position+=4,$},get remaining(){return this.bytes.length-this.position},setPosition($){const J=this.position;return this.assertPosition($),this.position=$,()=>this.position=J},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const $=this.getReadCount();if(this.positionReadCount.set(this.position,$+1),$>0)this.recursiveReadCount++}}});var l8;var m8=f(()=>{l8={ether:-9,wei:9}});function h8($,J){let Q=$.toString();const q=Q.startsWith("-");if(q)Q=Q.slice(1);Q=Q.padStart(J,"0");let[Y,W]=[Q.slice(0,Q.length-J),Q.slice(Q.length-J)];return W=W.replace(/(0+)$/,""),`${q?"-":""}${Y||"0"}${W?`.${W}`:""}`}var d8=f(()=>{});function Q0($,J="wei"){return h8($,l8[J])}var p8=f(()=>{m8();d8()});function oq($){const J=Object.entries($).map(([q,Y])=>{if(Y===void 0||Y===!1)return null;return[q,Y]}).filter(Boolean),Q=J.reduce((q,[Y])=>Math.max(q,Y.length),0);return J.map(([q,Y])=>` ${`${q}:`.padEnd(Q+1)} ${Y}`).join("\n")}class wJ extends z{constructor({v:$}){super(`Invalid \`v\` value "${$}". Expected 27 or 28.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class CJ extends z{constructor({transaction:$}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",oq($),"}","","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","- a Legacy Transaction with `gasPrice`"]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class zJ extends z{constructor({storageKey:$}){super(`Size for storage key "${$}" is invalid. Expected 32 bytes. Got ${Math.floor(($.length-2)/2)} bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}var B0=f(()=>{n()});class jJ extends z{constructor({cause:$,message:J}={}){const Q=J?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${Q?`with reason: ${Q}`:"for an unknown reason"}.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}class n$ extends z{constructor({cause:$,maxFeePerGas:J}={}){super(`The fee cap (\`maxFeePerGas\`${J?` = ${Q0(J)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}class n8 extends z{constructor({cause:$,maxFeePerGas:J}={}){super(`The fee cap (\`maxFeePerGas\`${J?` = ${Q0(J)}`:""} gwei) cannot be lower than the block base fee.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}class i8 extends z{constructor({cause:$,nonce:J}={}){super(`Nonce provided for the transaction ${J?`(${J}) `:""}is higher than the next one expected.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}class o8 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("\n"),{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}class r8 extends z{constructor({cause:$,nonce:J}={}){super(`Nonce provided for the transaction ${J?`(${J}) `:""}exceeds the maximum allowed nonce.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}class t8 extends z{constructor({cause:$}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{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."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}class a8 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:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}class e8 extends z{constructor({cause:$,gas:J}={}){super(`The amount of gas ${J?`(${J}) `:""}provided for the transaction is too low.`,{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}class s8 extends z{constructor({cause:$}){super("The transaction type is not supported for this chain.",{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}class L0 extends z{constructor({cause:$,maxPriorityFeePerGas:J,maxFeePerGas:Q}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${J?` = ${Q0(J)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${Q?` = ${Q0(Q)} gwei`:""}).`].join("\n"),{cause:$});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}var $Q=f(()=>{p8();n();Object.defineProperty(jJ,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(jJ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});Object.defineProperty(n$,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});Object.defineProperty(n8,"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/});Object.defineProperty(i8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});Object.defineProperty(o8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});Object.defineProperty(r8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});Object.defineProperty(t8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});Object.defineProperty(a8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});Object.defineProperty(e8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});Object.defineProperty(s8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Object.defineProperty(L0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/})});class EJ extends L${constructor($,J,Q,q){super();this.blockLen=$,this.outputLen=J,this.padOffset=Q,this.isLE=q,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array($),this.view=E0(this.buffer)}update($){N$(this);const{view:J,buffer:Q,blockLen:q}=this;$=B$($);const Y=$.length;for(let W=0;W<Y;){const D=Math.min(q-this.pos,Y-W);if(D===q){const I=E0($);for(;q<=Y-W;W+=q)this.process(I,W);continue}if(Q.set($.subarray(W,W+D),this.pos),this.pos+=D,W+=D,this.pos===q)this.process(J,0),this.pos=0}return this.length+=$.length,this.roundClean(),this}digestInto($){N$(this),w0($,this),this.finished=!0;const{buffer:J,view:Q,blockLen:q,isLE:Y}=this;let{pos:W}=this;if(J[W++]=128,this.buffer.subarray(W).fill(0),this.padOffset>q-W)this.process(Q,0),W=0;for(let Z=W;Z<q;Z++)J[Z]=0;rq(Q,q-8,BigInt(this.length*8),Y),this.process(Q,0);const D=E0($),I=this.outputLen;if(I%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const X=I/4,A=this.get();if(X>A.length)throw new Error("_sha2: outputLen bigger than state");for(let Z=0;Z<X;Z++)D.setUint32(4*Z,A[Z],Y)}digest(){const{buffer:$,outputLen:J}=this;this.digestInto($);const Q=$.slice(0,J);return this.destroy(),Q}_cloneInto($){$||($=new this.constructor),$.set(...this.get());const{blockLen:J,buffer:Q,length:q,finished:Y,destroyed:W,pos:D}=this;if($.length=q,$.pos=D,$.finished=Y,$.destroyed=W,q%J)$.buffer.set(Q);return $}}var rq;var JQ=f(()=>{C0();m$();rq=function($,J,Q,q){if(typeof $.setBigUint64==="function")return $.setBigUint64(J,Q,q);const Y=BigInt(32),W=BigInt(4294967295),D=Number(Q>>Y&W),I=Number(Q&W),X=q?4:0,A=q?0:4;$.setUint32(J+X,D,q),$.setUint32(J+A,I,q)}});class QQ extends EJ{constructor(){super(64,32,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(){const{A:$,B:J,C:Q,D:q,E:Y,F:W,G:D,H:I}=this;return[$,J,Q,q,Y,W,D,I]}set($,J,Q,q,Y,W,D,I){this.A=$|0,this.B=J|0,this.C=Q|0,this.D=q|0,this.E=Y|0,this.F=W|0,this.G=D|0,this.H=I|0}process($,J){for(let Z=0;Z<16;Z++,J+=4)j$[Z]=$.getUint32(J,!1);for(let Z=16;Z<64;Z++){const K=j$[Z-15],U=j$[Z-2],C=W$(K,7)^W$(K,18)^K>>>3,G=W$(U,17)^W$(U,19)^U>>>10;j$[Z]=G+j$[Z-7]+C+j$[Z-16]|0}let{A:Q,B:q,C:Y,D:W,E:D,F:I,G:X,H:A}=this;for(let Z=0;Z<64;Z++){const K=W$(D,6)^W$(D,11)^W$(D,25),U=A+K+tq(D,I,X)+eq[Z]+j$[Z]|0,G=(W$(Q,2)^W$(Q,13)^W$(Q,22))+aq(Q,q,Y)|0;A=X,X=I,I=D,D=W+U|0,W=Y,Y=q,q=Q,Q=U+G|0}Q=Q+this.A|0,q=q+this.B|0,Y=Y+this.C|0,W=W+this.D|0,D=D+this.E|0,I=I+this.F|0,X=X+this.G|0,A=A+this.H|0,this.set(Q,q,Y,W,D,I,X,A)}roundClean(){j$.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}var tq,aq,eq,z$,j$,_0;var SJ=f(()=>{JQ();m$();tq=($,J,Q)=>$&J^~$&Q,aq=($,J,Q)=>$&J^$&Q^J&Q,eq=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),z$=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),j$=new Uint32Array(64);_0=S0(()=>new QQ)});class Y0 extends z{constructor({chainId:$}){super(typeof $==="number"?`Chain ID "${$}" is invalid.`:"Chain ID is invalid.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}var KQ=f(()=>{n()});var vJ={};Vq(vJ,{validateObject:()=>{{return S$}},utf8ToBytes:()=>{{return ZY}},numberToVarBytesBE:()=>{{return AY}},numberToHexUnpadded:()=>{{return kQ}},numberToBytesLE:()=>{{return u0}},numberToBytesBE:()=>{{return E$}},hexToNumber:()=>{{return FJ}},hexToBytes:()=>{{return P$}},equalBytes:()=>{{return GY}},ensureBytes:()=>{{return e}},createHmacDrbg:()=>{{return bJ}},concatBytes:()=>{{return o$}},bytesToNumberLE:()=>{{return y0}},bytesToNumberBE:()=>{{return M$}},bytesToHex:()=>{{return k$}},bitSet:()=>{{return MY}},bitMask:()=>{{return W0}},bitLen:()=>{{return KY}},bitGet:()=>{{return NY}}});function k$($){if(!g0($))throw new Error("Uint8Array expected");let J="";for(let Q=0;Q<$.length;Q++)J+=XY[$[Q]];return J}function kQ($){const J=$.toString(16);return J.length&1?`0${J}`:J}function FJ($){if(typeof $!=="string")throw new Error("hex string expected, got "+typeof $);return BigInt($===""?"0":`0x${$}`)}function P$($){if(typeof $!=="string")throw new Error("hex string expected, got "+typeof $);const J=$.length;if(J%2)throw new Error("padded hex string expected, got unpadded hex of length "+J);const Q=new Uint8Array(J/2);for(let q=0;q<Q.length;q++){const Y=q*2,W=$.slice(Y,Y+2),D=Number.parseInt(W,16);if(Number.isNaN(D)||D<0)throw new Error("Invalid byte sequence");Q[q]=D}return Q}function M$($){return FJ(k$($))}function y0($){if(!g0($))throw new Error("Uint8Array expected");return FJ(k$(Uint8Array.from($).reverse()))}function E$($,J){return P$($.toString(16).padStart(J*2,"0"))}function u0($,J){return E$($,J).reverse()}function AY($){return P$(kQ($))}function e($,J,Q){let q;if(typeof J==="string")try{q=P$(J)}catch(W){throw new Error(`${$} must be valid hex string, got "${J}". Cause: ${W}`)}else if(g0(J))q=Uint8Array.from(J);else throw new Error(`${$} must be hex string or Uint8Array`);const Y=q.length;if(typeof Q==="number"&&Y!==Q)throw new Error(`${$} expected ${Q} bytes, got ${Y}`);return q}function o$(...$){const J=new Uint8Array($.reduce((q,Y)=>q+Y.length,0));let Q=0;return $.forEach((q)=>{if(!g0(q))throw new Error("Uint8Array expected");J.set(q,Q),Q+=q.length}),J}function GY($,J){if($.length!==J.length)return!1;for(let Q=0;Q<$.length;Q++)if($[Q]!==J[Q])return!1;return!0}function ZY($){if(typeof $!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof $}`);return new Uint8Array((new TextEncoder()).encode($))}function KY($){let J;for(J=0;$>LQ;$>>=v0,J+=1);return J}function NY($,J){return $>>BigInt(J)&v0}function bJ($,J,Q){if(typeof $!=="number"||$<2)throw new Error("hashLen must be a number");if(typeof J!=="number"||J<2)throw new Error("qByteLen must be a number");if(typeof Q!=="function")throw new Error("hmacFn must be a function");let q=xJ($),Y=xJ($),W=0;const D=()=>{q.fill(1),Y.fill(0),W=0},I=(...K)=>Q(Y,q,...K),X=(K=xJ())=>{if(Y=I(BQ([0]),K),q=I(),K.length===0)return;Y=I(BQ([1]),K),q=I()},A=()=>{if(W++>=1000)throw new Error("drbg: tried 1000 values");let K=0;const U=[];while(K<J){q=I();const C=q.slice();U.push(C),K+=q.length}return o$(...U)};return(K,U)=>{D(),X(K);let C=void 0;while(!(C=U(A())))X();return D(),C}}function S$($,J,Q={}){const q=(Y,W,D)=>{const I=VY[W];if(typeof I!=="function")throw new Error(`Invalid validator "${W}", expected function`);const X=$[Y];if(D&&X===void 0)return;if(!I(X,$))throw new Error(`Invalid param ${String(Y)}=${X} (${typeof X}), expected ${W}`)};for(let[Y,W]of Object.entries(J))q(Y,W,!1);for(let[Y,W]of Object.entries(Q))q(Y,W,!0);return $}var LQ,v0,IY,g0,XY,MY,W0,xJ,BQ,VY;var D0=f(()=>{/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */LQ=BigInt(0),v0=BigInt(1),IY=BigInt(2),g0=($)=>$ instanceof Uint8Array,XY=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0")),MY=($,J,Q)=>{return $|(Q?v0:LQ)<<BigInt(J)},W0=($)=>(IY<<BigInt($-1))-v0,xJ=($)=>new Uint8Array($),BQ=($)=>Uint8Array.from($),VY={bigint:($)=>typeof $==="bigint",function:($)=>typeof $==="function",boolean:($)=>typeof $==="boolean",string:($)=>typeof $==="string",stringOrUint8Array:($)=>typeof $==="string"||$ instanceof Uint8Array,isSafeInteger:($)=>Number.isSafeInteger($),array:($)=>Array.isArray($),field:($,J)=>J.Fp.isValid($),hash:($)=>typeof $==="function"&&Number.isSafeInteger($.outputLen)}});function m($,J){const Q=$%J;return Q>=y?Q:J+Q}function CY($,J,Q){if(Q<=y||J<y)throw new Error("Expected power/modulo > 0");if(Q===v)return y;let q=v;while(J>y){if(J&v)q=q*$%Q;$=$*$%Q,J>>=v}return q}function s($,J,Q){let q=$;while(J-- >y)q*=q,q%=Q;return q}function c0($,J){if($===y||J<=y)throw new Error(`invert: expected positive integers, got n=${$} mod=${J}`);let Q=m($,J),q=J,Y=y,W=v,D=v,I=y;while(Q!==y){const A=q/Q,Z=q%Q,K=Y-D*A,U=W-I*A;q=Q,Q=Z,Y=D,W=I,D=K,I=U}if(q!==v)throw new Error("invert: does not exist");return m(Y,J)}function zY($){const J=($-v)/_$;let Q,q,Y;for(Q=$-v,q=0;Q%_$===y;Q/=_$,q++);for(Y=_$;Y<$&&CY(Y,J,$)!==$-v;Y++);if(q===1){const D=($+v)/gJ;return function I(X,A){const Z=X.pow(A,D);if(!X.eql(X.sqr(Z),A))throw new Error("Cannot find square root");return Z}}const W=(Q+v)/_$;return function D(I,X){if(I.pow(X,J)===I.neg(I.ONE))throw new Error("Cannot find square root");let A=q,Z=I.pow(I.mul(I.ONE,Y),Q),K=I.pow(X,W),U=I.pow(X,Q);while(!I.eql(U,I.ONE)){if(I.eql(U,I.ZERO))return I.ZERO;let C=1;for(let N=I.sqr(U);C<A;C++){if(I.eql(N,I.ONE))break;N=I.sqr(N)}const G=I.pow(Z,v<<BigInt(A-C-1));Z=I.sqr(G),K=I.mul(K,G),U=I.mul(U,Z),A=C}return K}}function jY($){if($%gJ===OY){const J=($+v)/gJ;return function Q(q,Y){const W=q.pow(Y,J);if(!q.eql(q.sqr(W),Y))throw new Error("Cannot find square root");return W}}if($%_Q===PQ){const J=($-PQ)/_Q;return function Q(q,Y){const W=q.mul(Y,_$),D=q.pow(W,J),I=q.mul(Y,D),X=q.mul(q.mul(I,_$),D),A=q.mul(I,q.sub(X,q.ONE));if(!q.eql(q.sqr(A),Y))throw new Error("Cannot find square root");return A}}if($%wY===UY);return zY($)}function yJ($){const J={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},Q=EY.reduce((q,Y)=>{return q[Y]="function",q},J);return S$($,Q)}function SY($,J,Q){if(Q<y)throw new Error("Expected power > 0");if(Q===y)return $.ONE;if(Q===v)return J;let q=$.ONE,Y=J;while(Q>y){if(Q&v)q=$.mul(q,Y);Y=$.sqr(Y),Q>>=v}return q}function TY($,J){const Q=new Array(J.length),q=J.reduce((W,D,I)=>{if($.is0(D))return W;return Q[I]=W,$.mul(W,D)},$.ONE),Y=$.inv(q);return J.reduceRight((W,D,I)=>{if($.is0(D))return W;return Q[I]=$.mul(W,Q[I]),$.mul(W,D)},Y),Q}function uJ($,J){const Q=J!==void 0?J:$.toString(2).length,q=Math.ceil(Q/8);return{nBitLength:Q,nByteLength:q}}function xQ($,J,Q=!1,q={}){if($<=y)throw new Error(`Expected Field ORDER > 0, got ${$}`);const{nBitLength:Y,nByteLength:W}=uJ($,J);if(W>2048)throw new Error("Field lengths over 2048 bytes are not supported");const D=jY($),I=Object.freeze({ORDER:$,BITS:Y,BYTES:W,MASK:W0(Y),ZERO:y,ONE:v,create:(X)=>m(X,$),isValid:(X)=>{if(typeof X!=="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof X}`);return y<=X&&X<$},is0:(X)=>X===y,isOdd:(X)=>(X&v)===v,neg:(X)=>m(-X,$),eql:(X,A)=>X===A,sqr:(X)=>m(X*X,$),add:(X,A)=>m(X+A,$),sub:(X,A)=>m(X-A,$),mul:(X,A)=>m(X*A,$),pow:(X,A)=>SY(I,X,A),div:(X,A)=>m(X*c0(A,$),$),sqrN:(X)=>X*X,addN:(X,A)=>X+A,subN:(X,A)=>X-A,mulN:(X,A)=>X*A,inv:(X)=>c0(X,$),sqrt:q.sqrt||((X)=>D(I,X)),invertBatch:(X)=>TY(I,X),cmov:(X,A,Z)=>Z?A:X,toBytes:(X)=>Q?u0(X,W):E$(X,W),fromBytes:(X)=>{if(X.length!==W)throw new Error(`Fp.fromBytes: expected ${W}, got ${X.length}`);return Q?y0(X):M$(X)}});return Object.freeze(I)}function FQ($){if(typeof $!=="bigint")throw new Error("field order must be bigint");const J=$.toString(2).length;return Math.ceil(J/8)}function cJ($){const J=FQ($);return J+Math.ceil(J/2)}function bQ($,J,Q=!1){const q=$.length,Y=FQ(J),W=cJ(J);if(q<16||q<W||q>1024)throw new Error(`expected ${W}-1024 bytes of input, got ${q}`);const D=Q?M$($):y0($),I=m(D,J-v)+v;return Q?u0(I,Y):E$(I,Y)}var y,v,_$,OY,gJ,PQ,_Q,UY,wY,EY;var l0=f(()=>{D0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */y=BigInt(0),v=BigInt(1),_$=BigInt(2),OY=BigInt(3),gJ=BigInt(4),PQ=BigInt(5),_Q=BigInt(8),UY=BigInt(9),wY=BigInt(16),EY=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function vQ($,J){const Q=(Y,W)=>{const D=W.negate();return Y?D:W},q=(Y)=>{const W=Math.ceil(J/Y)+1,D=2**(Y-1);return{windows:W,windowSize:D}};return{constTimeNegate:Q,unsafeLadder(Y,W){let D=$.ZERO,I=Y;while(W>fY){if(W&lJ)D=D.add(I);I=I.double(),W>>=lJ}return D},precomputeWindow(Y,W){const{windows:D,windowSize:I}=q(W),X=[];let A=Y,Z=A;for(let K=0;K<D;K++){Z=A,X.push(Z);for(let U=1;U<I;U++)Z=Z.add(A),X.push(Z);A=Z.double()}return X},wNAF(Y,W,D){const{windows:I,windowSize:X}=q(Y);let{ZERO:A,BASE:Z}=$;const K=BigInt(2**Y-1),U=2**Y,C=BigInt(Y);for(let G=0;G<I;G++){const N=G*X;let O=Number(D&K);if(D>>=C,O>X)O-=U,D+=lJ;const V=N,j=N+Math.abs(O)-1,R=G%2!==0,H=O<0;if(O===0)Z=Z.add(Q(R,W[V]));else A=A.add(Q(H,W[j]))}return{p:A,f:Z}},wNAFCached(Y,W,D,I){const X=Y._WINDOW_SIZE||1;let A=W.get(Y);if(!A){if(A=this.precomputeWindow(Y,X),X!==1)W.set(Y,I(A))}return this.wNAF(X,A,D)}}}function mJ($){return yJ($.Fp),S$($,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...uJ($.n,$.nBitLength),...$,...{p:$.Fp.ORDER}})}var fY,lJ;var gQ=f(()=>{l0();D0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */fY=BigInt(0),lJ=BigInt(1)});function kY($){const J=RY($),{Fp:Q}=J,q=J.toBytes||((G,N,O)=>{const V=N.toAffine();return o$(Uint8Array.from([4]),Q.toBytes(V.x),Q.toBytes(V.y))}),Y=J.fromBytes||((G)=>{const N=G.subarray(1),O=Q.fromBytes(N.subarray(0,Q.BYTES)),V=Q.fromBytes(N.subarray(Q.BYTES,2*Q.BYTES));return{x:O,y:V}});function W(G){const{a:N,b:O}=J,V=Q.sqr(G),j=Q.mul(V,G);return Q.add(Q.add(j,Q.mul(G,N)),O)}if(!Q.eql(Q.sqr(J.Gy),W(J.Gx)))throw new Error("bad generator point: equation left != right");function D(G){return typeof G==="bigint"&&V$<G&&G<J.n}function I(G){if(!D(G))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function X(G){const{allowedPrivateKeyLengths:N,nByteLength:O,wrapPrivateKey:V,n:j}=J;if(N&&typeof G!=="bigint"){if(G instanceof Uint8Array)G=k$(G);if(typeof G!=="string"||!N.includes(G.length))throw new Error("Invalid key");G=G.padStart(O*2,"0")}let R;try{R=typeof G==="bigint"?G:M$(e("private key",G,O))}catch(H){throw new Error(`private key must be ${O} bytes, hex or bigint, not ${typeof G}`)}if(V)R=m(R,j);return I(R),R}const A=new Map;function Z(G){if(!(G instanceof K))throw new Error("ProjectivePoint expected")}class K{constructor(G,N,O){if(this.px=G,this.py=N,this.pz=O,G==null||!Q.isValid(G))throw new Error("x required");if(N==null||!Q.isValid(N))throw new Error("y required");if(O==null||!Q.isValid(O))throw new Error("z required")}static fromAffine(G){const{x:N,y:O}=G||{};if(!G||!Q.isValid(N)||!Q.isValid(O))throw new Error("invalid affine point");if(G instanceof K)throw new Error("projective point not allowed");const V=(j)=>Q.eql(j,Q.ZERO);if(V(N)&&V(O))return K.ZERO;return new K(N,O,Q.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(G){const N=Q.invertBatch(G.map((O)=>O.pz));return G.map((O,V)=>O.toAffine(N[V])).map(K.fromAffine)}static fromHex(G){const N=K.fromAffine(Y(e("pointHex",G)));return N.assertValidity(),N}static fromPrivateKey(G){return K.BASE.multiply(X(G))}_setWindowSize(G){this._WINDOW_SIZE=G,A.delete(this)}assertValidity(){if(this.is0()){if(J.allowInfinityPoint&&!Q.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:G,y:N}=this.toAffine();if(!Q.isValid(G)||!Q.isValid(N))throw new Error("bad point: x or y not FE");const O=Q.sqr(N),V=W(G);if(!Q.eql(O,V))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:G}=this.toAffine();if(Q.isOdd)return!Q.isOdd(G);throw new Error("Field doesn't support isOdd")}equals(G){Z(G);const{px:N,py:O,pz:V}=this,{px:j,py:R,pz:H}=G,E=Q.eql(Q.mul(N,H),Q.mul(j,V)),S=Q.eql(Q.mul(O,H),Q.mul(R,V));return E&&S}negate(){return new K(this.px,Q.neg(this.py),this.pz)}double(){const{a:G,b:N}=J,O=Q.mul(N,yQ),{px:V,py:j,pz:R}=this;let{ZERO:H,ZERO:E,ZERO:S}=Q,L=Q.mul(V,V),Q$=Q.mul(j,j),_=Q.mul(R,R),P=Q.mul(V,j);return P=Q.add(P,P),S=Q.mul(V,R),S=Q.add(S,S),H=Q.mul(G,S),E=Q.mul(O,_),E=Q.add(H,E),H=Q.sub(Q$,E),E=Q.add(Q$,E),E=Q.mul(H,E),H=Q.mul(P,H),S=Q.mul(O,S),_=Q.mul(G,_),P=Q.sub(L,_),P=Q.mul(G,P),P=Q.add(P,S),S=Q.add(L,L),L=Q.add(S,L),L=Q.add(L,_),L=Q.mul(L,P),E=Q.add(E,L),_=Q.mul(j,R),_=Q.add(_,_),L=Q.mul(_,P),H=Q.sub(H,L),S=Q.mul(_,Q$),S=Q.add(S,S),S=Q.add(S,S),new K(H,E,S)}add(G){Z(G);const{px:N,py:O,pz:V}=this,{px:j,py:R,pz:H}=G;let{ZERO:E,ZERO:S,ZERO:L}=Q;const Q$=J.a,_=Q.mul(J.b,yQ);let P=Q.mul(N,j),p=Q.mul(O,R),r=Q.mul(V,H),O$=Q.add(N,O),c=Q.add(j,R);O$=Q.mul(O$,c),c=Q.add(P,p),O$=Q.sub(O$,c),c=Q.add(N,V);let M=Q.add(j,H);return c=Q.mul(c,M),M=Q.add(P,r),c=Q.sub(c,M),M=Q.add(O,V),E=Q.add(R,H),M=Q.mul(M,E),E=Q.add(p,r),M=Q.sub(M,E),L=Q.mul(Q$,c),E=Q.mul(_,r),L=Q.add(E,L),E=Q.sub(p,L),L=Q.add(p,L),S=Q.mul(E,L),p=Q.add(P,P),p=Q.add(p,P),r=Q.mul(Q$,r),c=Q.mul(_,c),p=Q.add(p,r),r=Q.sub(P,r),r=Q.mul(Q$,r),c=Q.add(c,r),P=Q.mul(p,c),S=Q.add(S,P),P=Q.mul(M,c),E=Q.mul(O$,E),E=Q.sub(E,P),P=Q.mul(O$,p),L=Q.mul(M,L),L=Q.add(L,P),new K(E,S,L)}subtract(G){return this.add(G.negate())}is0(){return this.equals(K.ZERO)}wNAF(G){return C.wNAFCached(this,A,G,(N)=>{const O=Q.invertBatch(N.map((V)=>V.pz));return N.map((V,j)=>V.toAffine(O[j])).map(K.fromAffine)})}multiplyUnsafe(G){const N=K.ZERO;if(G===V$)return N;if(I(G),G===J$)return this;const{endo:O}=J;if(!O)return C.unsafeLadder(this,G);let{k1neg:V,k1:j,k2neg:R,k2:H}=O.splitScalar(G),E=N,S=N,L=this;while(j>V$||H>V$){if(j&J$)E=E.add(L);if(H&J$)S=S.add(L);L=L.double(),j>>=J$,H>>=J$}if(V)E=E.negate();if(R)S=S.negate();return S=new K(Q.mul(S.px,O.beta),S.py,S.pz),E.add(S)}multiply(G){I(G);let N=G,O,V;const{endo:j}=J;if(j){const{k1neg:R,k1:H,k2neg:E,k2:S}=j.splitScalar(N);let{p:L,f:Q$}=this.wNAF(H),{p:_,f:P}=this.wNAF(S);L=C.constTimeNegate(R,L),_=C.constTimeNegate(E,_),_=new K(Q.mul(_.px,j.beta),_.py,_.pz),O=L.add(_),V=Q$.add(P)}else{const{p:R,f:H}=this.wNAF(N);O=R,V=H}return K.normalizeZ([O,V])[0]}multiplyAndAddUnsafe(G,N,O){const V=K.BASE,j=(H,E)=>E===V$||E===J$||!H.equals(V)?H.multiplyUnsafe(E):H.multiply(E),R=j(this,N).add(j(G,O));return R.is0()?void 0:R}toAffine(G){const{px:N,py:O,pz:V}=this,j=this.is0();if(G==null)G=j?Q.ONE:Q.inv(V);const R=Q.mul(N,G),H=Q.mul(O,G),E=Q.mul(V,G);if(j)return{x:Q.ZERO,y:Q.ZERO};if(!Q.eql(E,Q.ONE))throw new Error("invZ was invalid");return{x:R,y:H}}isTorsionFree(){const{h:G,isTorsionFree:N}=J;if(G===J$)return!0;if(N)return N(K,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:G,clearCofactor:N}=J;if(G===J$)return this;if(N)return N(K,this);return this.multiplyUnsafe(J.h)}toRawBytes(G=!0){return this.assertValidity(),q(K,this,G)}toHex(G=!0){return k$(this.toRawBytes(G))}}K.BASE=new K(J.Gx,J.Gy,Q.ONE),K.ZERO=new K(Q.ZERO,Q.ONE,Q.ZERO);const U=J.nBitLength,C=vQ(K,J.endo?Math.ceil(U/2):U);return{CURVE:J,ProjectivePoint:K,normPrivateKeyToScalar:X,weierstrassEquation:W,isWithinCurveOrder:D}}function uQ($){const J=PY($),{Fp:Q,n:q}=J,Y=Q.BYTES+1,W=2*Q.BYTES+1;function D(M){return V$<M&&M<Q.ORDER}function I(M){return m(M,q)}function X(M){return c0(M,q)}const{ProjectivePoint:A,normPrivateKeyToScalar:Z,weierstrassEquation:K,isWithinCurveOrder:U}=kY({...J,toBytes(M,T,k){const x=T.toAffine(),F=Q.toBytes(x.x),g=o$;if(k)return g(Uint8Array.from([T.hasEvenY()?2:3]),F);else return g(Uint8Array.from([4]),F,Q.toBytes(x.y))},fromBytes(M){const T=M.length,k=M[0],x=M.subarray(1);if(T===Y&&(k===2||k===3)){const F=M$(x);if(!D(F))throw new Error("Point is not on curve");const g=K(F);let q$=Q.sqrt(g);const t=(q$&J$)===J$;if((k&1)===1!==t)q$=Q.neg(q$);return{x:F,y:q$}}else if(T===W&&k===4){const F=Q.fromBytes(x.subarray(0,Q.BYTES)),g=Q.fromBytes(x.subarray(Q.BYTES,2*Q.BYTES));return{x:F,y:g}}else throw new Error(`Point of length ${T} was invalid. Expected ${Y} compressed bytes or ${W} uncompressed bytes`)}}),C=(M)=>k$(E$(M,J.nByteLength));function G(M){const T=q>>J$;return M>T}function N(M){return G(M)?I(-M):M}const O=(M,T,k)=>M$(M.slice(T,k));class V{constructor(M,T,k){this.r=M,this.s=T,this.recovery=k,this.assertValidity()}static fromCompact(M){const T=J.nByteLength;return M=e("compactSignature",M,T*2),new V(O(M,0,T),O(M,T,2*T))}static fromDER(M){const{r:T,s:k}=x$.toSig(e("DER",M));return new V(T,k)}assertValidity(){if(!U(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!U(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(M){return new V(this.r,this.s,M)}recoverPublicKey(M){const{r:T,s:k,recovery:x}=this,F=L(e("msgHash",M));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const g=x===2||x===3?T+J.n:T;if(g>=Q.ORDER)throw new Error("recovery id 2 or 3 invalid");const q$=(x&1)===0?"02":"03",t=A.fromHex(q$+C(g)),A$=X(g),T$=I(-F*A$),v$=I(k*A$),H$=A.BASE.multiplyAndAddUnsafe(t,T$,v$);if(!H$)throw new Error("point at infinify");return H$.assertValidity(),H$}hasHighS(){return G(this.s)}normalizeS(){return this.hasHighS()?new V(this.r,I(-this.s),this.recovery):this}toDERRawBytes(){return P$(this.toDERHex())}toDERHex(){return x$.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return P$(this.toCompactHex())}toCompactHex(){return C(this.r)+C(this.s)}}const j={isValidPrivateKey(M){try{return Z(M),!0}catch(T){return!1}},normPrivateKeyToScalar:Z,randomPrivateKey:()=>{const M=cJ(J.n);return bQ(J.randomBytes(M),J.n)},precompute(M=8,T=A.BASE){return T._setWindowSize(M),T.multiply(BigInt(3)),T}};function R(M,T=!0){return A.fromPrivateKey(M).toRawBytes(T)}function H(M){const T=M instanceof Uint8Array,k=typeof M==="string",x=(T||k)&&M.length;if(T)return x===Y||x===W;if(k)return x===2*Y||x===2*W;if(M instanceof A)return!0;return!1}function E(M,T,k=!0){if(H(M))throw new Error("first arg must be private key");if(!H(T))throw new Error("second arg must be public key");return A.fromHex(T).multiply(Z(M)).toRawBytes(k)}const S=J.bits2int||function(M){const T=M$(M),k=M.length*8-J.nBitLength;return k>0?T>>BigInt(k):T},L=J.bits2int_modN||function(M){return I(S(M))},Q$=W0(J.nBitLength);function _(M){if(typeof M!=="bigint")throw new Error("bigint expected");if(!(V$<=M&&M<Q$))throw new Error(`bigint expected < 2^${J.nBitLength}`);return E$(M,J.nByteLength)}function P(M,T,k=p){if(["recovered","canonical"].some((f$)=>(f$ in k)))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:F}=J;let{lowS:g,prehash:q$,extraEntropy:t}=k;if(g==null)g=!0;if(M=e("msgHash",M),q$)M=e("prehashed msgHash",x(M));const A$=L(M),T$=Z(T),v$=[_(T$),_(A$)];if(t!=null){const f$=t===!0?F(Q.BYTES):t;v$.push(e("extraEntropy",f$))}const H$=o$(...v$),G0=A$;function i0(f$){const g$=S(f$);if(!U(g$))return;const Y8=X(g$),I$=A.BASE.multiply(g$).toAffine(),y$=I(I$.x);if(y$===V$)return;const Z0=I(Y8*I(G0+y$*T$));if(Z0===V$)return;let W8=(I$.x===y$?0:2)|Number(I$.y&J$),D8=Z0;if(g&&G(Z0))D8=N(Z0),W8^=1;return new V(y$,D8,W8)}return{seed:H$,k2sig:i0}}const p={lowS:J.lowS,prehash:!1},r={lowS:J.lowS,prehash:!1};function O$(M,T,k=p){const{seed:x,k2sig:F}=P(M,T,k),g=J;return bJ(g.hash.outputLen,g.nByteLength,g.hmac)(x,F)}A.BASE._setWindowSize(8);function c(M,T,k,x=r){const F=M;if(T=e("msgHash",T),k=e("publicKey",k),"strict"in x)throw new Error("options.strict was renamed to lowS");const{lowS:g,prehash:q$}=x;let t=void 0,A$;try{if(typeof F==="string"||F instanceof Uint8Array)try{t=V.fromDER(F)}catch(I$){if(!(I$ instanceof x$.Err))throw I$;t=V.fromCompact(F)}else if(typeof F==="object"&&typeof F.r==="bigint"&&typeof F.s==="bigint"){const{r:I$,s:y$}=F;t=new V(I$,y$)}else throw new Error("PARSE");A$=A.fromHex(k)}catch(I$){if(I$.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(g&&t.hasHighS())return!1;if(q$)T=J.hash(T);const{r:T$,s:v$}=t,H$=L(T),G0=X(v$),i0=I(H$*G0),f$=I(T$*G0),g$=A.BASE.multiplyAndAddUnsafe(A$,i0,f$)?.toAffine();if(!g$)return!1;return I(g$.x)===T$}return{CURVE:J,getPublicKey:R,getSharedSecret:E,sign:O$,verify:c,ProjectivePoint:A,Signature:V,utils:j}}var RY,PY,BY,LY,x$,V$,J$,bI,yQ,vI;var cQ=f(()=>{l0();D0();D0();gQ();RY=function($){const J=mJ($);S$(J,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:Q,Fp:q,a:Y}=J;if(Q){if(!q.eql(Y,q.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof Q!=="object"||typeof Q.beta!=="bigint"||typeof Q.splitScalar!=="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...J})};PY=function($){const J=mJ($);return S$(J,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...J})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */({bytesToNumberBE:BY,hexToBytes:LY}=vJ),x$={Err:class $ extends Error{constructor(J=""){super(J)}},_parseInt($){const{Err:J}=x$;if($.length<2||$[0]!==2)throw new J("Invalid signature integer tag");const Q=$[1],q=$.subarray(2,Q+2);if(!Q||q.length!==Q)throw new J("Invalid signature integer: wrong length");if(q[0]&128)throw new J("Invalid signature integer: negative");if(q[0]===0&&!(q[1]&128))throw new J("Invalid signature integer: unnecessary leading zero");return{d:BY(q),l:$.subarray(Q+2)}},toSig($){const{Err:J}=x$,Q=typeof $==="string"?LY($):$;if(!(Q instanceof Uint8Array))throw new Error("ui8a expected");let q=Q.length;if(q<2||Q[0]!=48)throw new J("Invalid signature tag");if(Q[1]!==q-2)throw new J("Invalid signature: incorrect length");const{d:Y,l:W}=x$._parseInt(Q.subarray(2)),{d:D,l:I}=x$._parseInt(W);if(I.length)throw new J("Invalid signature: left bytes after parsing");return{r:Y,s:D}},hexFromSig($){const J=(A)=>Number.parseInt(A[0],16)&8?"00"+A:A,Q=(A)=>{const Z=A.toString(16);return Z.length&1?`0${Z}`:Z},q=J(Q($.s)),Y=J(Q($.r)),W=q.length/2,D=Y.length/2,I=Q(W),X=Q(D);return`30${Q(D+W+4)}02${X}${Y}02${I}${q}`}},V$=BigInt(0),J$=BigInt(1),bI=BigInt(2),yQ=BigInt(3),vI=BigInt(4)});class hJ extends L${constructor($,J){super();this.finished=!1,this.destroyed=!1,U8($);const Q=B$(J);if(this.iHash=$.create(),typeof this.iHash.update!=="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const q=this.blockLen,Y=new Uint8Array(q);Y.set(Q.length>q?$.create().update(Q).digest():Q);for(let W=0;W<Y.length;W++)Y[W]^=54;this.iHash.update(Y),this.oHash=$.create();for(let W=0;W<Y.length;W++)Y[W]^=54^92;this.oHash.update(Y),Y.fill(0)}update($){return N$(this),this.iHash.update($),this}digestInto($){N$(this),a$($,this.outputLen),this.finished=!0,this.iHash.digestInto($),this.oHash.update($),this.oHash.digestInto($),this.destroy()}digest(){const $=new Uint8Array(this.oHash.outputLen);return this.digestInto($),$}_cloneInto($){$||($=Object.create(Object.getPrototypeOf(this),{}));const{oHash:J,iHash:Q,finished:q,destroyed:Y,blockLen:W,outputLen:D}=this;return $=$,$.finished=q,$.destroyed=Y,$.blockLen=W,$.outputLen=D,$.oHash=J._cloneInto($.oHash),$.iHash=Q._cloneInto($.iHash),$}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}var dJ;var lQ=f(()=>{C0();m$();dJ=($,J,Q)=>new hJ($,J).update(Q).digest();dJ.create=($,J)=>new hJ($,J)});function _Y($){return{hash:$,hmac:(J,...Q)=>dJ($,J,B8(...Q)),randomBytes:L8}}function mQ($,J){const Q=(q)=>uQ({...$,..._Y(q)});return Object.freeze({...Q(J),create:Q})}var hQ=f(()=>{lQ();m$();cQ();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});var FY,nQ,dQ,xY,pJ,pQ,nJ,iJ,oI,rI;var iQ=f(()=>{SJ();l0();hQ();FY=function($){const J=nQ,Q=BigInt(3),q=BigInt(6),Y=BigInt(11),W=BigInt(22),D=BigInt(23),I=BigInt(44),X=BigInt(88),A=$*$*$%J,Z=A*A*$%J,K=s(Z,Q,J)*Z%J,U=s(K,Q,J)*Z%J,C=s(U,pJ,J)*A%J,G=s(C,Y,J)*C%J,N=s(G,W,J)*G%J,O=s(N,I,J)*N%J,V=s(O,X,J)*O%J,j=s(V,I,J)*N%J,R=s(j,Q,J)*Z%J,H=s(R,D,J)*G%J,E=s(H,q,J)*A%J,S=s(E,pJ,J);if(!nJ.eql(nJ.sqr(S),$))throw new Error("Cannot find square root");return S};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */nQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),dQ=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xY=BigInt(1),pJ=BigInt(2),pQ=($,J)=>($+J/pJ)/J,nJ=xQ(nQ,void 0,void 0,{sqrt:FY}),iJ=mQ({a:BigInt(0),b:BigInt(7),Fp:nJ,n:dQ,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:($)=>{const J=dQ,Q=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),q=-xY*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),Y=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),W=Q,D=BigInt("0x100000000000000000000000000000000"),I=pQ(W*$,J),X=pQ(-q*$,J);let A=m($-I*Q-X*Y,J),Z=m(-I*q-X*W,J);const K=A>D,U=Z>D;if(K)A=J-A;if(U)Z=J-Z;if(A>D||Z>D)throw new Error("splitScalar: Endomorphism failed, k="+$);return{k1neg:K,k1:A,k2neg:U,k2:Z}}}},_0),oI=BigInt(0),rI=iJ.ProjectivePoint});function I8($){return $.message!==void 0}var R$;(function(q){q["SHA256"]="sha256";q["SHA256D"]="sha256d";q["NO_HASH"]="nohash"})(R$||(R$={}));class X8{authModule;threshold;totalNodes;ttl;wp_client;constructor($,J,Q,q,Y=10){if(J===0)throw new Error("Threshold cannot be 0");this.threshold=J,this.totalNodes=Q,this.authModule=q,this.ttl=Y,this.wp_client=$}async authenticateAndCreateKey(){try{const $={t:this.threshold,n:this.totalNodes};console.log("Generated Payload:",$);const J=await this.authModule.authenticate($,this.wp_client),Q={setup:$,user_authentication:J,ttl:this.ttl},q=await this.wp_client.startKeygen(Q);return console.log("Keygen response:",q),q}catch($){throw console.error($),$}}async authenticateAndSign($,J,Q){const q={hash_algo:Q,key_id:$,message:J},Y=await this.authModule.authenticate(q,this.wp_client),W={setup:q,user_authentication:Y,ttl:this.ttl},D=await this.wp_client.startSigngen(W);return console.log("Sign response:",D),D}}K$();i();function k0($){const{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),q=typeof $.blobs[0]==="string"?$.blobs.map((W)=>Y$(W)):$.blobs,Y=[];for(let W of q)Y.push(Uint8Array.from(J.blobToKzgCommitment(W)));return Q==="bytes"?Y:Y.map((W)=>h(W))}K$();i();function P0($){const{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),q=typeof $.blobs[0]==="string"?$.blobs.map((D)=>Y$(D)):$.blobs,Y=typeof $.commitments[0]==="string"?$.commitments.map((D)=>Y$(D)):$.commitments,W=[];for(let D=0;D<q.length;D++){const I=q[D],X=Y[D];W.push(Uint8Array.from(J.computeBlobKzgProof(I,X)))}return Q==="bytes"?W:W.map((D)=>h(D))}i();SJ();u$();K$();i();function qQ($,J){const Q=J||"hex",q=_0(X$($,{strict:!1})?c$($):$);if(Q==="bytes")return q;return B(q)}function YQ($){const{commitment:J,version:Q=1}=$,q=$.to??(typeof J==="string"?"hex":"bytes"),Y=qQ(J,"bytes");return Y.set([Q],0),q==="bytes"?Y:h(Y)}function WQ($){const{commitments:J,version:Q}=$,q=$.to??(typeof J[0]==="string"?"hex":"bytes"),Y=[];for(let W of J)Y.push(YQ({commitment:W,to:q,version:Q}));return Y}var DQ=32,IQ=4096,XQ=131072,TJ=761855;var x0=1;n();class HJ extends z{constructor({maxSize:$,size:J}){super("Blob size is too large.",{metaMessages:[`Max: ${$} bytes`,`Given: ${J} bytes`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class q0 extends z{constructor(){super("Blob data must not be empty.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class fJ extends z{constructor({hash:$,size:J}){super(`Versioned hash "${$}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${J}`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class RJ extends z{constructor({hash:$,version:J}){super(`Versioned hash "${$}" version is invalid.`,{metaMessages:[`Expected: ${x0}`,`Received: ${J}`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}UJ();U$();K$();i();function AQ($){const J=$.to??(typeof $.data==="string"?"hex":"bytes"),Q=typeof $.data==="string"?Y$($.data):$.data,q=b(Q);if(!q)throw new q0;if(q>TJ)throw new HJ({maxSize:TJ,size:q});const Y=[];let W=!0,D=0;while(W){const I=R0(new Uint8Array(XQ));let X=0;while(X<IQ){const A=Q.slice(D,D+(DQ-1));if(I.pushByte(0),I.pushBytes(A),A.length<31){I.pushByte(128),W=!1;break}X++,D+=31}Y.push(I)}return J==="bytes"?Y.map((I)=>I.bytes):Y.map((I)=>h(I.bytes))}function GQ($){const{data:J,kzg:Q,to:q}=$,Y=$.blobs??AQ({data:J,to:q}),W=$.commitments??k0({blobs:Y,kzg:Q,to:q}),D=$.proofs??P0({blobs:Y,commitments:W,kzg:Q,to:q}),I=[];for(let X=0;X<Y.length;X++)I.push({blob:Y[X],commitment:W[X],proof:D[X]});return I}B0();function ZQ($){if($.type)return $.type;if(typeof $.blobs!=="undefined"||typeof $.blobVersionedHashes!=="undefined"||typeof $.maxFeePerBlobGas!=="undefined"||typeof $.sidecars!=="undefined")return"eip4844";if(typeof $.maxFeePerGas!=="undefined"||typeof $.maxPriorityFeePerGas!=="undefined")return"eip1559";if(typeof $.gasPrice!=="undefined"){if(typeof $.accessList!=="undefined")return"eip2930";return"legacy"}throw new CJ({transaction:$})}AJ();h$();function F0($){const J=l(`0x${$.substring(4)}`).substring(26);return T0(`0x${J}`)}var NQ=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,MQ=/^(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)?$/;$J();d$();p$();U$();i();u8();J0();i();h$();function BJ($){const{domain:J={},message:Q,primaryType:q}=$,Y={EIP712Domain:jQ({domain:J}),...$.types};zQ({domain:J,message:Q,primaryType:q,types:Y});const W=["0x1901"];if(J)W.push(VQ({domain:J,types:Y}));if(q!=="EIP712Domain")W.push(OQ({data:Q,primaryType:q,types:Y}));return l(D$(W))}function VQ({domain:$,types:J}){return OQ({data:$,primaryType:"EIP712Domain",types:J})}var OQ=function({data:$,primaryType:J,types:Q}){const q=UQ({data:$,primaryType:J,types:Q});return l(q)},UQ=function({data:$,primaryType:J,types:Q}){const q=[{type:"bytes32"}],Y=[sq({primaryType:J,types:Q})];for(let W of Q[J]){const[D,I]=CQ({types:Q,name:W.name,type:W.type,value:$[W.name]});q.push(D),Y.push(I)}return KJ(q,Y)},sq=function({primaryType:$,types:J}){const Q=B($Y({primaryType:$,types:J}));return l(Q)},$Y=function({primaryType:$,types:J}){let Q="";const q=wQ({primaryType:$,types:J});q.delete($);const Y=[$,...Array.from(q).sort()];for(let W of Y)Q+=`${W}(${J[W].map(({name:D,type:I})=>`${I} ${D}`).join(",")})`;return Q},wQ=function({primaryType:$,types:J},Q=new Set){const Y=$.match(/^\w*/u)?.[0];if(Q.has(Y)||J[Y]===void 0)return Q;Q.add(Y);for(let W of J[Y])wQ({primaryType:W.type,types:J},Q);return Q},CQ=function({types:$,name:J,type:Q,value:q}){if($[Q]!==void 0)return[{type:"bytes32"},l(UQ({data:q,primaryType:Q,types:$}))];if(Q==="bytes")return q=`0x${(q.length%2?"0":"")+q.slice(2)}`,[{type:"bytes32"},l(q)];if(Q==="string")return[{type:"bytes32"},l(B(q))];if(Q.lastIndexOf("]")===Q.length-1){const Y=Q.slice(0,Q.lastIndexOf("[")),W=q.map((D)=>CQ({name:J,type:Y,types:$,value:D}));return[{type:"bytes32"},l(KJ(W.map(([D])=>D),W.map(([,D])=>D)))]}return[{type:Q},q]};function zQ($){const{domain:J,message:Q,primaryType:q,types:Y}=$,W=(D,I)=>{for(let X of D){const{name:A,type:Z}=X,K=I[A],U=Z.match(MQ);if(U&&(typeof K==="number"||typeof K==="bigint")){const[N,O,V]=U;$$(K,{signed:O==="int",size:Number.parseInt(V)/8})}if(Z==="address"&&typeof K==="string"&&!a(K))throw new o({address:K});const C=Z.match(NQ);if(C){const[N,O]=C;if(O&&b(K)!==Number.parseInt(O))throw new a0({expectedSize:Number.parseInt(O),givenSize:b(K)})}const G=Y[Z];if(G)W(G,K)}};if(Y.EIP712Domain&&J)W(Y.EIP712Domain,J);if(q!=="EIP712Domain"){const D=Y[q];W(D,Q)}}function jQ({domain:$}){return[typeof $?.name==="string"&&{name:"name",type:"string"},$?.version&&{name:"version",type:"string"},typeof $?.chainId==="number"&&{name:"chainId",type:"uint256"},$?.verifyingContract&&{name:"verifyingContract",type:"address"},$?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}n();UJ();K$();i();function i$($,J="hex"){const Q=EQ($),q=R0(new Uint8Array(Q.length));if(Q.encode(q),J==="hex")return h(q.bytes);return q.bytes}var EQ=function($){if(Array.isArray($))return JY($.map((J)=>EQ(J)));return QY($)},JY=function($){const J=$.reduce((Y,W)=>Y+W.length,0),Q=SQ(J);return{length:(()=>{if(J<=55)return 1+J;return 1+Q+J})(),encode(Y){if(J<=55)Y.pushByte(192+J);else if(Y.pushByte(247+Q),Q===1)Y.pushUint8(J);else if(Q===2)Y.pushUint16(J);else if(Q===3)Y.pushUint24(J);else Y.pushUint32(J);for(let{encode:W}of $)W(Y)}}},QY=function($){const J=typeof $==="string"?Y$($):$,Q=SQ(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(Y){if(J.length===1&&J[0]<128)Y.pushBytes(J);else if(J.length<=55)Y.pushByte(128+J.length),Y.pushBytes(J);else{if(Y.pushByte(183+Q),Q===1)Y.pushUint8(J.length);else if(Q===2)Y.pushUint16(J.length);else if(Q===3)Y.pushUint24(J.length);else Y.pushUint32(J.length);Y.pushBytes(J)}}}},SQ=function($){if($<256)return 1;if($<65536)return 2;if($<16777216)return 3;if($<4294967296)return 4;throw new z("Length is too large.")};var TQ=`\x19Ethereum Signed Message:
|
|
2
|
+
`;J0();K$();h$();function LJ($,J){const Q=(()=>{if(typeof $==="string")return l$($);if($.raw instanceof Uint8Array)return $.raw;return c$($.raw)})(),q=l$(`${TQ}${Q.length}`);return l(D$([q,Q]),J)}d$();n();KQ();$Q();p$();U$();ZJ();r$();function HQ($){const{blobVersionedHashes:J}=$;if(J){if(J.length===0)throw new q0;for(let Q of J){const q=b(Q),Y=V8(H0(Q,0,1));if(q!==32)throw new fJ({hash:Q,size:q});if(Y!==x0)throw new RJ({hash:Q,version:Y})}}kJ($)}function kJ($){const{chainId:J,maxPriorityFeePerGas:Q,maxFeePerGas:q,to:Y}=$;if(J<=0)throw new Y0({chainId:J});if(Y&&!a(Y))throw new o({address:Y});if(q&&q>2n**256n-1n)throw new n$({maxFeePerGas:q});if(Q&&q&&Q>q)throw new L0({maxFeePerGas:q,maxPriorityFeePerGas:Q})}function fQ($){const{chainId:J,maxPriorityFeePerGas:Q,gasPrice:q,maxFeePerGas:Y,to:W}=$;if(J<=0)throw new Y0({chainId:J});if(W&&!a(W))throw new o({address:W});if(Q||Y)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(q&&q>2n**256n-1n)throw new n$({maxFeePerGas:q})}function RQ($){const{chainId:J,maxPriorityFeePerGas:Q,gasPrice:q,maxFeePerGas:Y,to:W,accessList:D}=$;if(W&&!a(W))throw new o({address:W});if(typeof J!=="undefined"&&J<=0)throw new Y0({chainId:J});if(Q||Y)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(q&&q>2n**256n-1n)throw new n$({maxFeePerGas:q});if(D)throw new z("`accessList` is not a valid Legacy Transaction attribute.")}B0();J0();M8();i();d$();B0();p$();function b0($){if(!$||$.length===0)return[];const J=[];for(let Q=0;Q<$.length;Q++){const{address:q,storageKeys:Y}=$[Q];for(let W=0;W<Y.length;W++)if(Y[W].length-2!==64)throw new zJ({storageKey:Y[W]});if(!a(q,{strict:!1}))throw new o({address:q});J.push([q,Y])}return J}function PJ($,J){const Q=ZQ($);if(Q==="eip1559")return YY($,J);if(Q==="eip2930")return WY($,J);if(Q==="eip4844")return qY($,J);return DY($,J)}var qY=function($,J){const{chainId:Q,gas:q,nonce:Y,to:W,value:D,maxFeePerBlobGas:I,maxFeePerGas:X,maxPriorityFeePerGas:A,accessList:Z,data:K}=$;HQ($);let{blobVersionedHashes:U,sidecars:C}=$;if($.blobs&&(typeof U==="undefined"||typeof C==="undefined")){const R=typeof $.blobs[0]==="string"?$.blobs:$.blobs.map((S)=>h(S)),H=$.kzg,E=k0({blobs:R,kzg:H});if(typeof U==="undefined")U=WQ({commitments:E});if(typeof C==="undefined"){const S=P0({blobs:R,commitments:E,kzg:H});C=GQ({blobs:R,commitments:E,proofs:S})}}const G=b0(Z),N=[B(Q),Y?B(Y):"0x",A?B(A):"0x",X?B(X):"0x",q?B(q):"0x",W??"0x",D?B(D):"0x",K??"0x",G,I?B(I):"0x",U??[],..._J($,J)],O=[],V=[],j=[];if(C)for(let R=0;R<C.length;R++){const{blob:H,commitment:E,proof:S}=C[R];O.push(H),V.push(E),j.push(S)}return $0(["0x03",C?i$([N,O,V,j]):i$(N)])},YY=function($,J){const{chainId:Q,gas:q,nonce:Y,to:W,value:D,maxFeePerGas:I,maxPriorityFeePerGas:X,accessList:A,data:Z}=$;kJ($);const K=b0(A),U=[B(Q),Y?B(Y):"0x",X?B(X):"0x",I?B(I):"0x",q?B(q):"0x",W??"0x",D?B(D):"0x",Z??"0x",K,..._J($,J)];return $0(["0x02",i$(U)])},WY=function($,J){const{chainId:Q,gas:q,data:Y,nonce:W,to:D,value:I,accessList:X,gasPrice:A}=$;fQ($);const Z=b0(X),K=[B(Q),W?B(W):"0x",A?B(A):"0x",q?B(q):"0x",D??"0x",I?B(I):"0x",Y??"0x",Z,..._J($,J)];return $0(["0x01",i$(K)])},DY=function($,J){const{chainId:Q=0,gas:q,data:Y,nonce:W,to:D,value:I,gasPrice:X}=$;RQ($);let A=[W?B(W):"0x",X?B(X):"0x",q?B(q):"0x",D??"0x",I?B(I):"0x",Y??"0x"];if(J){const Z=(()=>{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);const K=27n+(J.v===27n?0n:1n);if(J.v!==K)throw new wJ({v:J.v});return K})();A=[...A,B(Z),J.r,J.s]}else if(Q>0)A=[...A,B(Q),"0x","0x"];return i$(A)};function _J($,J){const{r:Q,s:q,v:Y,yParity:W}=J??$;if(typeof Q==="undefined")return[];if(typeof q==="undefined")return[];if(typeof Y==="undefined"&&typeof W==="undefined")return[];return[(()=>{if(typeof W==="number")return W?B(1):"0x";if(Y===0n)return"0x";if(Y===1n)return B(1);return Y===27n?"0x":B(1)})(),WJ(Q),WJ(q)]}iQ();r$();function I0({r:$,s:J,v:Q,yParity:q}){const Y=(()=>{if(q===0||q===1)return q;if(Q&&(Q===27n||Q===28n||Q>=35n))return Q%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new iJ.Signature(V0($),V0(J)).toCompactHex()}${Y===0?"1b":"1c"}`}i();h$();var vY=`abdikace
|
|
3
3
|
abeceda
|
|
4
4
|
adresa
|
|
5
5
|
agrese
|
|
@@ -2046,7 +2046,7 @@ zvesela
|
|
|
2046
2046
|
zvon
|
|
2047
2047
|
zvrat
|
|
2048
2048
|
zvukovod
|
|
2049
|
-
zvyk`.split("\n");var
|
|
2049
|
+
zvyk`.split("\n");var gY=`abandon
|
|
2050
2050
|
ability
|
|
2051
2051
|
able
|
|
2052
2052
|
about
|
|
@@ -4093,7 +4093,7 @@ youth
|
|
|
4093
4093
|
zebra
|
|
4094
4094
|
zero
|
|
4095
4095
|
zone
|
|
4096
|
-
zoo`.split("\n");var
|
|
4096
|
+
zoo`.split("\n");var yY=`abaisser
|
|
4097
4097
|
abandon
|
|
4098
4098
|
abdiquer
|
|
4099
4099
|
abeille
|
|
@@ -6140,7 +6140,7 @@ yacht
|
|
|
6140
6140
|
ze\u0300bre
|
|
6141
6141
|
ze\u0301nith
|
|
6142
6142
|
zeste
|
|
6143
|
-
zoologie`.split("\n");var
|
|
6143
|
+
zoologie`.split("\n");var uY=`abaco
|
|
6144
6144
|
abbaglio
|
|
6145
6145
|
abbinato
|
|
6146
6146
|
abete
|
|
@@ -8187,7 +8187,7 @@ zotico
|
|
|
8187
8187
|
zucchero
|
|
8188
8188
|
zufolo
|
|
8189
8189
|
zulu
|
|
8190
|
-
zuppa`.split("\n");var
|
|
8190
|
+
zuppa`.split("\n");var cY=`\u3042\u3044\u3053\u304F\u3057\u3093
|
|
8191
8191
|
\u3042\u3044\u3055\u3064
|
|
8192
8192
|
\u3042\u3044\u305F\u3099
|
|
8193
8193
|
\u3042\u304A\u305D\u3099\u3089
|
|
@@ -10234,7 +10234,7 @@ zuppa`.split("\n");var rY=`\u3042\u3044\u3053\u304F\u3057\u3093
|
|
|
10234
10234
|
\u308F\u3057\u3099\u307E\u3057
|
|
10235
10235
|
\u308F\u3059\u308C\u3082\u306E
|
|
10236
10236
|
\u308F\u3089\u3046
|
|
10237
|
-
\u308F\u308C\u308B`.split("\n");var
|
|
10237
|
+
\u308F\u308C\u308B`.split("\n");var lY=`\u1100\u1161\u1100\u1167\u11A8
|
|
10238
10238
|
\u1100\u1161\u1101\u1173\u11B7
|
|
10239
10239
|
\u1100\u1161\u1102\u1161\u11AB
|
|
10240
10240
|
\u1100\u1161\u1102\u1173\u11BC
|
|
@@ -12281,7 +12281,7 @@ zuppa`.split("\n");var rY=`\u3042\u3044\u3053\u304F\u3057\u3093
|
|
|
12281
12281
|
\u1112\u1174\u1106\u1161\u11BC
|
|
12282
12282
|
\u1112\u1174\u1109\u1162\u11BC
|
|
12283
12283
|
\u1112\u1174\u11AB\u1109\u1162\u11A8
|
|
12284
|
-
\u1112\u1175\u11B7\u1101\u1165\u11BA`.split("\n");var
|
|
12284
|
+
\u1112\u1175\u11B7\u1101\u1165\u11BA`.split("\n");var mY=`\u7684
|
|
12285
12285
|
\u4E00
|
|
12286
12286
|
\u662F
|
|
12287
12287
|
\u5728
|
|
@@ -14328,7 +14328,7 @@ zuppa`.split("\n");var rY=`\u3042\u3044\u3053\u304F\u3057\u3093
|
|
|
14328
14328
|
\u97E6
|
|
14329
14329
|
\u6028
|
|
14330
14330
|
\u77EE
|
|
14331
|
-
\u6B47`.split("\n");var
|
|
14331
|
+
\u6B47`.split("\n");var hY=`a\u0301baco
|
|
14332
14332
|
abdomen
|
|
14333
14333
|
abeja
|
|
14334
14334
|
abierto
|
|
@@ -16375,7 +16375,7 @@ zarza
|
|
|
16375
16375
|
zona
|
|
16376
16376
|
zorro
|
|
16377
16377
|
zumo
|
|
16378
|
-
zurdo`.split("\n");var
|
|
16378
|
+
zurdo`.split("\n");var dY=`\u7684
|
|
16379
16379
|
\u4E00
|
|
16380
16380
|
\u662F
|
|
16381
16381
|
\u5728
|
|
@@ -18422,4 +18422,4 @@ zurdo`.split("\n");var sY=`\u7684
|
|
|
18422
18422
|
\u97CB
|
|
18423
18423
|
\u6028
|
|
18424
18424
|
\u77EE
|
|
18425
|
-
\u6B47`.split("\n");d$();p$();function
|
|
18425
|
+
\u6B47`.split("\n");d$();p$();function oJ($){if(typeof $==="string"){if(!a($,{strict:!1}))throw new o({address:$});return{address:$,type:"json-rpc"}}if(!a($.address,{strict:!1}))throw new o({address:$.address});return{address:$.address,experimental_signAuthMessage:$.experimental_signAuthMessage,signMessage:$.signMessage,signTransaction:$.signTransaction,signTypedData:$.signTypedData,source:"custom",type:"local"}}/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */var aJ=2n**256n,b$=aJ-0x1000003d1n,eJ=aJ-0x14551231950b75fc4402da1732fc9bebfn,Jq=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Qq=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n,qq={p:b$,n:eJ,a:0n,b:7n,Gx:Jq,Gy:Qq};var oQ=($)=>w(w($*$)*$+qq.b),u=($="")=>{throw new Error($)},d0=($)=>typeof $==="bigint",Yq=($)=>typeof $==="string",rJ=($)=>d0($)&&0n<$&&$<b$,Wq=($)=>d0($)&&0n<$&&$<eJ,pY=($)=>$ instanceof Uint8Array||$!=null&&typeof $==="object"&&$.constructor.name==="Uint8Array",tJ=($,J)=>!pY($)||typeof J==="number"&&J>0&&$.length!==J?u("Uint8Array expected"):$,A0=($)=>new Uint8Array($),sJ=($,J)=>tJ(Yq($)?p0($):A0(tJ($)),J),w=($,J=b$)=>{let Q=$%J;return Q>=0n?Q:J+Q},rQ=($)=>$ instanceof d?$:u("Point expected");class d{constructor($,J,Q){this.px=$,this.py=J,this.pz=Q}static fromAffine($){return $.x===0n&&$.y===0n?d.ZERO:new d($.x,$.y,1n)}static fromHex($){$=sJ($);let J=void 0;const Q=$[0],q=$.subarray(1),Y=tQ(q,0,32),W=$.length;if(W===33&&[2,3].includes(Q)){if(!rJ(Y))u("Point hex invalid: x not FE");let D=nY(oQ(Y));const I=(D&1n)===1n;if((Q&1)===1!==I)D=w(-D);J=new d(Y,D,1n)}if(W===65&&Q===4)J=new d(Y,tQ(q,32,64),1n);return J?J.ok():u("Point is not on curve")}static fromPrivateKey($){return X0.mul(iY($))}get x(){return this.aff().x}get y(){return this.aff().y}equals($){const{px:J,py:Q,pz:q}=this,{px:Y,py:W,pz:D}=rQ($),I=w(J*D),X=w(Y*q),A=w(Q*D),Z=w(W*q);return I===X&&A===Z}negate(){return new d(this.px,w(-this.py),this.pz)}double(){return this.add(this)}add($){const{px:J,py:Q,pz:q}=this,{px:Y,py:W,pz:D}=rQ($),{a:I,b:X}=qq;let A=0n,Z=0n,K=0n;const U=w(X*3n);let C=w(J*Y),G=w(Q*W),N=w(q*D),O=w(J+Q),V=w(Y+W);O=w(O*V),V=w(C+G),O=w(O-V),V=w(J+q);let j=w(Y+D);return V=w(V*j),j=w(C+N),V=w(V-j),j=w(Q+q),A=w(W+D),j=w(j*A),A=w(G+N),j=w(j-A),K=w(I*V),A=w(U*N),K=w(A+K),A=w(G-K),K=w(G+K),Z=w(A*K),G=w(C+C),G=w(G+C),N=w(I*N),V=w(U*V),G=w(G+N),N=w(C-N),N=w(I*N),V=w(V+N),C=w(G*V),Z=w(Z+C),C=w(j*V),A=w(O*A),A=w(A-C),C=w(O*G),K=w(j*K),K=w(K+C),new d(A,Z,K)}mul($,J=!0){if(!J&&$===0n)return m0;if(!Wq($))u("invalid scalar");if(this.equals(X0))return aY($).p;let Q=m0,q=X0;for(let Y=this;$>0n;Y=Y.double(),$>>=1n)if($&1n)Q=Q.add(Y);else if(J)q=q.add(Y);return Q}mulAddQUns($,J,Q){return this.mul(J,!1).add($.mul(Q,!1)).ok()}toAffine(){const{px:$,py:J,pz:Q}=this;if(this.equals(m0))return{x:0n,y:0n};if(Q===1n)return{x:$,y:J};const q=Iq(Q);if(w(Q*q)!==1n)u("invalid inverse");return{x:w($*q),y:w(J*q)}}assertValidity(){const{x:$,y:J}=this.aff();if(!rJ($)||!rJ(J))u("Point invalid: x or y");return w(J*J)===oQ($)?this:u("Point invalid: not on curve")}multiply($){return this.mul($)}aff(){return this.toAffine()}ok(){return this.assertValidity()}toHex($=!0){const{x:J,y:Q}=this.aff();return($?(Q&1n)===0n?"02":"03":"04")+aQ(J)+($?"":aQ(Q))}toRawBytes($=!0){return p0(this.toHex($))}}d.BASE=new d(Jq,Qq,1n);d.ZERO=new d(0n,1n,0n);var{BASE:X0,ZERO:m0}=d,Dq=($,J)=>$.toString(16).padStart(J,"0"),$8=($)=>Array.from($).map((J)=>Dq(J,2)).join(""),p0=($)=>{const J=$.length;if(!Yq($)||J%2)u("hex invalid 1");const Q=A0(J/2);for(let q=0;q<Q.length;q++){const Y=q*2,W=$.slice(Y,Y+2),D=Number.parseInt(W,16);if(Number.isNaN(D)||D<0)u("hex invalid 2");Q[q]=D}return Q},n0=($)=>BigInt("0x"+($8($)||"0")),tQ=($,J,Q)=>n0($.slice(J,Q)),J8=($)=>{return d0($)&&$>=0n&&$<aJ?p0(Dq($,64)):u("bigint expected")},aQ=($)=>$8(J8($)),eQ=(...$)=>{const J=A0($.reduce((q,Y)=>q+tJ(Y).length,0));let Q=0;return $.forEach((q)=>{J.set(q,Q),Q+=q.length}),J},Iq=($,J=b$)=>{if($===0n||J<=0n)u("no inverse n="+$+" mod="+J);let Q=w($,J),q=J,Y=0n,W=1n,D=1n,I=0n;while(Q!==0n){const X=q/Q,A=q%Q,Z=Y-D*X,K=W-I*X;q=Q,Q=A,Y=D,W=I,D=Z,I=K}return q===1n?w(Y,J):u("no inverse")},nY=($)=>{let J=1n;for(let Q=$,q=(b$+1n)/4n;q>0n;q>>=1n){if(q&1n)J=J*Q%b$;Q=Q*Q%b$}return w(J*J)===$?J:u("sqrt invalid")},iY=($)=>{if(!d0($))$=n0(sJ($,32));return Wq($)?$:u("private key out of range")};var sQ=()=>typeof globalThis==="object"&&("crypto"in globalThis)?globalThis.crypto:void 0,h0;var oY=($)=>{$=sJ($);const J=40;if($.length<J||$.length>1024)u("expected proper params");const Q=w(n0($),eJ-1n)+1n;return J8(Q)},rY={hexToBytes:p0,bytesToHex:$8,concatBytes:eQ,bytesToNumberBE:n0,numberToBytesBE:J8,mod:w,invert:Iq,hmacSha256Async:async($,...J)=>{const Q=sQ(),q=Q&&Q.subtle;if(!q)return u("etc.hmacSha256Async not set");const Y=await q.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return A0(await q.sign("HMAC",Y,eQ(...J)))},hmacSha256Sync:h0,hashToPrivateKey:oY,randomBytes:($=32)=>{const J=sQ();if(!J||!J.getRandomValues)u("crypto.getRandomValues must be defined");return J.getRandomValues(A0($))}};Object.defineProperties(rY,{hmacSha256Sync:{configurable:!1,get(){return h0},set($){if(!h0)h0=$}}});var F$=8,tY=()=>{const $=[],J=256/F$+1;let Q=X0,q=Q;for(let Y=0;Y<J;Y++){q=Q,$.push(q);for(let W=1;W<2**(F$-1);W++)q=q.add(Q),$.push(q);Q=q.double()}return $},$q=void 0,aY=($)=>{const J=$q||($q=tY()),Q=(Z,K)=>{let U=K.negate();return Z?U:K};let q=m0,Y=X0;const W=1+256/F$,D=2**(F$-1),I=BigInt(2**F$-1),X=2**F$,A=BigInt(F$);for(let Z=0;Z<W;Z++){const K=Z*D;let U=Number($&I);if($>>=A,U>D)U-=X,$+=1n;const C=K,G=K+Math.abs(U)-1,N=Z%2!==0,O=U<0;if(U===0)Y=Y.add(Q(N,J[C]));else q=q.add(Q(O,J[G]))}return{p:q,f:Y}};var Xq=($)=>Uint8Array.from(atob($),(J)=>J.charCodeAt(0));function eY($,J,Q){const q=sY(Q);return oJ({address:q,keyId:J,async signMessage({message:Y}){const W=await $.authenticateAndSign(J,LJ(Y),R$.NO_HASH),D=Q8(W);return I0(D)},async signTransaction(Y,W){const D=W?.serializer||PJ,I=(()=>{if(Y.type==="eip4844")return{...Y,sidecars:!1};return Y})(),X=await $.authenticateAndSign(J,l(D(I)),R$.NO_HASH),A=Q8(X);return console.log("GENERATED SIGN ",A),D(Y,A)},async signTypedData(Y){const W=await $.authenticateAndSign(J,BJ(Y),R$.NO_HASH),D=Q8(W);return I0(D)}})}var sY=function($){if($.startsWith("0x"))$=$.slice(2);if($.startsWith("04"))return F0(`0x${$} `);else if($.startsWith("02")||$.startsWith("03")){const J=d.fromHex($).toHex(!1);return F0(`0x${J}`)}else throw new Error("Invalid public key")},Q8=function($){const J=$.sign,Q=Xq(J),q=B(Q.slice(0,32)),Y=B(Q.slice(32,64)),W=$.recid;return{r:q,s:Y,v:W===0?BigInt(27):BigInt(28),yParity:W}};var Q9=function($,J,Q){return{types:{EIP712Domain:Zq,...$9},domain:Gq,primaryType:"Request",message:{setup:$,authentication:{challenge:J,wallet_id:Q}}}},q9=function($,J,Q){return{types:{EIP712Domain:Zq,...J9},domain:Gq,primaryType:"Request",message:{setup:$,authentication:{challenge:J,wallet_id:Q}}}};async function Kq($,J,Q,q){const Y=await Q.requestAggregatedChallenge(J),W=Q.getWalletId();let D;if(I8($))console.log("Creating Sign request"),D=q9($,Y.challenge,W);else console.log("Creating Keygen request"),D=Q9($,Y.challenge,W);const I=await q.signTypedData(J,D);return console.log("User signed a request",I),await Q.verifyUserSignature(J,D,I,Y.instance),{challenge:Y.challenge,instance:Y.instance,user_sig:I}}var Aq=[{name:"wallet_id",type:"string"},{name:"challenge",type:"string"}],$9={Request:[{name:"setup",type:"KeygenSetupOpts"},{name:"authentication",type:"AuthenticationOpts"}],AuthenticationOpts:Aq,KeygenSetupOpts:[{name:"t",type:"uint32"},{name:"n",type:"uint32"}]},J9={Request:[{name:"setup",type:"SignSetupOpts"},{name:"authentication",type:"AuthenticationOpts"}],AuthenticationOpts:Aq,SignSetupOpts:[{name:"message",type:"string"},{name:"key_id",type:"string"},{name:"hash_algo",type:"string"}]},Gq={name:"SilentShard authentication",version:"0.1.0"},Zq=[{name:"name",type:"string"},{name:"version",type:"string"}];var q8;(function(Q){Q[Q["EOA"]=0]="EOA";Q[Q["NONE"]=1]="NONE"})(q8||(q8={}));class Nq{userId;browserWallet;wpClient;constructor($,J,Q){this.userId=$,this.browserWallet=J,this.wpClient=Q}async authenticate($){return await Kq($,this.userId,this.wpClient,this.browserWallet)}}export{eY as createViemAccount,X8 as NetworkSigner,R$ as HashAlgo,Nq as EOAAuth,q8 as AuthMethod};
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { type KeygenSetupOpts, type SignSetupOpts } from './networkSigner.ts';
|
|
2
2
|
import { type UserAuthentication } from './authentication.ts';
|
|
3
3
|
import { type IWalletProviderServiceClient } from './walletProviderServiceClient.ts';
|
|
4
|
-
|
|
4
|
+
import type { TypedDataDomain } from 'viem';
|
|
5
|
+
export type FieldDefinition = {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
export type TypedData<T> = {
|
|
10
|
+
types: Record<string, Array<FieldDefinition>>;
|
|
11
|
+
domain: TypedDataDomain;
|
|
12
|
+
primaryType: string;
|
|
13
|
+
message: T;
|
|
14
|
+
};
|
|
15
|
+
export interface IBrowserWallet {
|
|
16
|
+
signTypedData<T>(from: string, request: TypedData<T>): Promise<unknown>;
|
|
17
|
+
}
|
|
18
|
+
export declare function authenticateUsingEOA(setup: KeygenSetupOpts | SignSetupOpts, user_id: string, wp_client: IWalletProviderServiceClient, browserWallet: IBrowserWallet): Promise<UserAuthentication>;
|
|
5
19
|
//# sourceMappingURL=sdkEOAauthentication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkEOAauthentication.d.ts","sourceRoot":"","sources":["../src/sdkEOAauthentication.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"sdkEOAauthentication.d.ts","sourceRoot":"","sources":["../src/sdkEOAauthentication.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAOF,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF,MAAM,WAAW,cAAc;IAa7B,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACzE;AAmJD,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,eAAe,GAAG,aAAa,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,4BAA4B,EACvC,aAAa,EAAE,cAAc,GAC5B,OAAO,CAAC,kBAAkB,CAAC,CAiC7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KeygenResponse, KeygenSetupOpts, SignResponse, SignSetupOpts, UserAuthenticatedRequest } from './networkSigner';
|
|
2
|
-
import
|
|
2
|
+
import { TypedData } from './sdkEOAauthentication';
|
|
3
3
|
export type AggregatedChallenge = {
|
|
4
4
|
instance: string;
|
|
5
5
|
challenge: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletProviderServiceClient.d.ts","sourceRoot":"","sources":["../src/walletProviderServiceClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"walletProviderServiceClient.d.ts","sourceRoot":"","sources":["../src/walletProviderServiceClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,WAAW,IAAI,MAAM,CAAC;IACtB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1E,mBAAmB,CAAC,CAAC,EACnB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,EAC1B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,WAAW,CAAC,GAAG,EAAE,wBAAwB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACrF,YAAY,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACrG"}
|
package/package.json
CHANGED
package/dist/walletEIP6963.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { TypedDataDomain } from 'viem';
|
|
2
|
-
interface EIP6963ProviderInfo {
|
|
3
|
-
uuid: string;
|
|
4
|
-
name: string;
|
|
5
|
-
icon: string;
|
|
6
|
-
rdns: string;
|
|
7
|
-
}
|
|
8
|
-
interface RequestArguments {
|
|
9
|
-
readonly method: string;
|
|
10
|
-
readonly params?: readonly unknown[] | object;
|
|
11
|
-
}
|
|
12
|
-
interface EIP1193Provider {
|
|
13
|
-
isStatus?: boolean;
|
|
14
|
-
host?: string;
|
|
15
|
-
path?: string;
|
|
16
|
-
request: (request: RequestArguments) => Promise<unknown>;
|
|
17
|
-
}
|
|
18
|
-
interface EIP6963ProviderDetail {
|
|
19
|
-
info: EIP6963ProviderInfo;
|
|
20
|
-
provider: EIP1193Provider;
|
|
21
|
-
}
|
|
22
|
-
export declare const discoveredBrowserWallets: Map<string, EIP6963ProviderDetail>;
|
|
23
|
-
export declare let selectedBrowserWalletId: string;
|
|
24
|
-
export declare let accountsFromBrowserWallet: Array<string>;
|
|
25
|
-
export declare const detectBrowserWallets: () => void;
|
|
26
|
-
export declare function setActiveBrowserWallet(wallet: EIP6963ProviderDetail): void;
|
|
27
|
-
export declare function connectToBrowserWallet(): Promise<void>;
|
|
28
|
-
export type FieldDefinition = {
|
|
29
|
-
name: string;
|
|
30
|
-
type: string;
|
|
31
|
-
};
|
|
32
|
-
export type TypedData<T> = {
|
|
33
|
-
types: Record<string, Array<FieldDefinition>>;
|
|
34
|
-
domain: TypedDataDomain;
|
|
35
|
-
primaryType: string;
|
|
36
|
-
message: T;
|
|
37
|
-
};
|
|
38
|
-
export declare function signTypedData<T>(from: string, request: TypedData<T>): Promise<unknown>;
|
|
39
|
-
export {};
|
|
40
|
-
//# sourceMappingURL=walletEIP6963.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"walletEIP6963.d.ts","sourceRoot":"","sources":["../src/walletEIP6963.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAG5C,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAAC;CAC/C;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1D;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;CAC3B;AASD,eAAO,MAAM,wBAAwB,oCAA2C,CAAC;AACjF,eAAO,IAAI,uBAAuB,EAAE,MAAW,CAAC;AAIhD,eAAO,IAAI,yBAAyB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;AAGpD,eAAO,MAAM,oBAAoB,YAShC,CAAC;AAaF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,qBAAqB,QAOnE;AAQD,wBAAsB,sBAAsB,kBAW3C;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAOF,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC;AAKF,wBAAsB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAK5F"}
|