@silencelaboratories/walletprovider-sdk 0.0.2 → 0.0.5
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/{sdkEOAauthentication.d.ts → EOAauthentication.d.ts} +8 -4
- package/dist/EOAauthentication.d.ts.map +1 -0
- package/dist/authentication.d.ts +17 -9
- package/dist/authentication.d.ts.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/networkSigner.d.ts +15 -12
- package/dist/networkSigner.d.ts.map +1 -1
- package/dist/viemSigner.d.ts.map +1 -1
- package/dist/walletProviderServiceClient.d.ts +15 -11
- package/dist/walletProviderServiceClient.d.ts.map +1 -1
- package/dist/walletProviderServiceClientInterface.d.ts +20 -0
- package/dist/walletProviderServiceClientInterface.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/sdkEOAauthentication.d.ts.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KeygenSetupOpts, type SignSetupOpts } from './networkSigner.ts';
|
|
2
2
|
import { type UserAuthentication } from './authentication.ts';
|
|
3
|
-
import { type IWalletProviderServiceClient } from './walletProviderServiceClient.ts';
|
|
4
3
|
import type { TypedDataDomain } from 'viem';
|
|
5
4
|
export type FieldDefinition = {
|
|
6
5
|
name: string;
|
|
@@ -15,5 +14,10 @@ export type TypedData<T> = {
|
|
|
15
14
|
export interface IBrowserWallet {
|
|
16
15
|
signTypedData<T>(from: string, request: TypedData<T>): Promise<unknown>;
|
|
17
16
|
}
|
|
18
|
-
export declare function authenticateUsingEOA(setup
|
|
19
|
-
|
|
17
|
+
export declare function authenticateUsingEOA({ setup, user_id, challenge, browserWallet, }: {
|
|
18
|
+
setup: KeygenSetupOpts | SignSetupOpts;
|
|
19
|
+
user_id: string;
|
|
20
|
+
challenge: string;
|
|
21
|
+
browserWallet: IBrowserWallet;
|
|
22
|
+
}): Promise<UserAuthentication>;
|
|
23
|
+
//# sourceMappingURL=EOAauthentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EOAauthentication.d.ts","sourceRoot":"","sources":["../src/EOAauthentication.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,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;AAkJD,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,OAAO,EACP,SAAS,EACT,aAAa,GACd,EAAE;IACD,KAAK,EAAE,eAAe,GAAG,aAAa,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,cAAc,CAAC;CAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4B9B"}
|
package/dist/authentication.d.ts
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import { KeygenSetupOpts, SignSetupOpts } from './networkSigner';
|
|
2
|
-
import { IBrowserWallet } from './
|
|
3
|
-
import { IWalletProviderServiceClient } from './
|
|
2
|
+
import { IBrowserWallet } from './EOAauthentication';
|
|
3
|
+
import { IWalletProviderServiceClient } from './walletProviderServiceClientInterface';
|
|
4
4
|
export declare enum AuthMethod {
|
|
5
5
|
EOA = 0,
|
|
6
6
|
NONE = 1
|
|
7
7
|
}
|
|
8
|
-
export type
|
|
9
|
-
|
|
8
|
+
export type UserCredentials = {
|
|
9
|
+
id: string;
|
|
10
|
+
method: string;
|
|
11
|
+
credentials: string;
|
|
12
|
+
};
|
|
10
13
|
export type UserAuthentication = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
user_sig: UserSignature;
|
|
14
|
+
credentials: UserCredentials;
|
|
15
|
+
signature: string;
|
|
14
16
|
};
|
|
15
17
|
export interface AuthModule {
|
|
16
|
-
authenticate(
|
|
18
|
+
authenticate({ setup, challenge, }: {
|
|
19
|
+
setup: KeygenSetupOpts | SignSetupOpts;
|
|
20
|
+
challenge: string;
|
|
21
|
+
}): Promise<UserAuthentication>;
|
|
17
22
|
}
|
|
18
23
|
export declare class EOAAuth implements AuthModule {
|
|
19
24
|
userId: string;
|
|
20
25
|
browserWallet: IBrowserWallet;
|
|
21
26
|
wpClient: IWalletProviderServiceClient;
|
|
22
27
|
constructor(userId: string, browserWallet: IBrowserWallet, wpClient: IWalletProviderServiceClient);
|
|
23
|
-
authenticate(
|
|
28
|
+
authenticate({ setup, challenge, }: {
|
|
29
|
+
setup: KeygenSetupOpts | SignSetupOpts;
|
|
30
|
+
challenge: string;
|
|
31
|
+
}): Promise<UserAuthentication>;
|
|
24
32
|
}
|
|
25
33
|
//# 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;AACjE,OAAO,EAAE,cAAc,EAAwB,MAAM,
|
|
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,qBAAqB,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAEtF,oBAAY,UAAU;IACpB,GAAG,IAAA;IACH,IAAI,IAAA;CACL;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IAEX,MAAM,EAAE,MAAM,CAAC;IAEf,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,EACX,KAAK,EACL,SAAS,GACV,EAAE;QACD,KAAK,EAAE,eAAe,GAAG,aAAa,CAAC;QACvC,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjC;AAED,qBAAa,OAAQ,YAAW,UAAU;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,cAAc,CAAC;IAC9B,QAAQ,EAAE,4BAA4B,CAAC;gBAE3B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,4BAA4B;IAM3F,YAAY,CAAC,EACjB,KAAK,EACL,SAAS,GACV,EAAE;QACD,KAAK,EAAE,eAAe,GAAG,aAAa,CAAC;QACvC,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAQhC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { KeygenSetupOpts, NetworkSigner } from './networkSigner.ts';
|
|
2
2
|
export { createViemAccount } from './viemSigner.ts';
|
|
3
3
|
export { AuthMethod, EOAAuth } from './authentication.ts';
|
|
4
|
-
export type {
|
|
4
|
+
export type { TypedData } from './EOAauthentication.ts';
|
|
5
|
+
export type { UserAuthenticatedRequest, KeygenResponse, SignSetupOpts, SignResponse } from './networkSigner.ts';
|
|
6
|
+
export type { IWalletProviderServiceClient } from './walletProviderServiceClientInterface.ts';
|
|
7
|
+
export { WalletProviderServiceClient } from './walletProviderServiceClient.ts';
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
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,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,YAAY,EAAE,wBAAwB,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEhH,YAAY,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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();
|
|
1
|
+
var Oq=Object.defineProperty;var Uq=($,J)=>{for(var Q in J)Oq($,Q,{get:J[Q],enumerable:!0,configurable:!0,set:(q)=>J[Q]=()=>q})};var f=($,J)=>()=>($&&(J=$($=0)),J);function I$($,{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(I$($,{strict:!1}))return Math.ceil(($.length-2)/2);return $.length}var w$=f(()=>{u$()});var Z8;var G8=f(()=>{Z8="2.11.1"});var K8;var N8=f(()=>{G8();K8=()=>`viem@${Z8}`});class C 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:K8()});const Q=J.cause instanceof C?J.cause.details:J.cause?.message?J.cause.message:J.details,q=J.cause instanceof C?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 M8(this,$)}}var M8;var i=f(()=>{N8();M8=function($,J){if(J?.($))return $;if($&&typeof $==="object"&&"cause"in $)return M8($.cause,J);return J?null:$}});class t0 extends C{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 a0 extends C{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 C{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 e0 extends C{constructor({expectedSize:$,givenSize:J}){super(`Expected bytes${$}, got bytes${J}.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class $J extends C{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 JJ extends C{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(()=>{w$();i()});class N0 extends C{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 M0 extends C{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 qJ=f(()=>{i()});function z$($,{dir:J,size:Q=32}={}){if(typeof $==="string")return G$($,{dir:J,size:Q});return zq($,{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 M0({size:Math.ceil(q.length/2),targetSize:Q,type:"hex"});return`0x${q[J==="right"?"padEnd":"padStart"](Q*2,"0")}`}function zq($,{dir:J,size:Q=32}={}){if(Q===null)return $;if($.length>Q)throw new M0({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 V0=f(()=>{qJ()});class YJ extends C{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 WJ extends C{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 DJ=f(()=>{i()});function XJ($,{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 V8=f(()=>{});function C$($,{size:J}){if(b($)>J)throw new WJ({givenSize:b($),maxSize:J})}function O0($,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 O8($,J={}){return Number(O0($,J))}var r$=f(()=>{DJ();w$()});function B($,J={}){if(typeof $==="number"||typeof $==="bigint")return J$($,J);if(typeof $==="string")return w0($,J);if(typeof $==="boolean")return U0($,J);return d($,J)}function U0($,J={}){const Q=`0x${Number($)}`;if(typeof J.size==="number")return C$(Q,{size:J.size}),z$(Q,{size:J.size});return Q}function d($,J={}){let Q="";for(let Y=0;Y<$.length;Y++)Q+=Cq[$[Y]];const q=`0x${Q}`;if(typeof J.size==="number")return C$(q,{size:J.size}),z$(q,{dir:"right",size:J.size});return q}function J$($,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 A=typeof $==="bigint"?"n":"";throw new YJ({max:W?`${W}${A}`:void 0,min:`${D}${A}`,signed:Q,size:q,value:`${$}${A}`})}const X=`0x${(Q&&Y<0?(1n<<BigInt(q*8))+BigInt(Y):Y).toString(16)}`;if(q)return z$(X,{size:q});return X}function w0($,J={}){const Q=jq.encode($);return d(Q,J)}var Cq,jq;var o=f(()=>{DJ();V0();r$();Cq=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0")),jq=new TextEncoder});function h$($,J={}){if(typeof $==="number"||typeof $==="bigint")return Hq($,J);if(typeof $==="boolean")return Tq($,J);if(I$($))return W$($,J);return l$($,J)}function Tq($,J={}){const Q=new Uint8Array(1);if(Q[0]=Number($),typeof J.size==="number")return C$(Q,{size:J.size}),z$(Q,{size:J.size});return Q}function W$($,J={}){let Q=$;if(J.size)C$(Q,{size:J.size}),Q=z$(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,X=0;D<Y;D++){const A=U8(q.charCodeAt(X++)),I=U8(q.charCodeAt(X++));if(A===void 0||I===void 0)throw new C(`Invalid byte sequence ("${q[X-2]}${q[X-1]}" in "${q}").`);W[D]=A*16+I}return W}function Hq($,J){const Q=J$($,J);return W$(Q)}function l$($,J={}){const Q=Eq.encode($);if(typeof J.size==="number")return C$(Q,{size:J.size}),z$(Q,{dir:"right",size:J.size});return Q}var U8,Eq,K$;var N$=f(()=>{i();u$();V0();r$();o();U8=function($){if($>=K$.zero&&$<=K$.nine)return $-K$.zero;if($>=K$.A&&$<=K$.F)return $-(K$.A-10);if($>=K$.a&&$<=K$.f)return $-(K$.a-10);return};Eq=new TextEncoder,K$={zero:48,nine:57,A:65,F:70,a:97,f:102}});var t$,a$,w8,M$,z0;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}`)},w8=function($){if(typeof $!=="function"||typeof $.create!=="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t$($.outputLen),t$($.blockLen)},M$=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 Sq,C8,j0,z8,j8,E8,T8,H8;var S8=f(()=>{Sq=function($,J=!1){if(J)return{h:Number($&j0),l:Number($>>z8&j0)};return{h:Number($>>z8&j0)|0,l:Number($&j0)|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}=Sq($[Y],J);[Q[Y],q[Y]]=[W,D]}return[Q,q]},j0=BigInt(4294967295),z8=BigInt(32),j8=($,J,Q)=>$<<Q|J>>>32-Q,E8=($,J,Q)=>J<<Q|$>>>32-Q,T8=($,J,Q)=>J<<Q-32|$>>>64-Q,H8=($,J,Q)=>$<<Q-32|J>>>64-Q});var E0;var f8=f(()=>{E0=typeof globalThis==="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function Rq($){if(typeof $!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof $}`);return new Uint8Array((new TextEncoder()).encode($))}function B$($){if(typeof $==="string")$=Rq($);if(!R8($))throw new Error(`expected Uint8Array, got ${typeof $}`);return $}function L8(...$){const J=new Uint8Array($.reduce((q,Y)=>q+Y.length,0));let Q=0;return $.forEach((q)=>{if(!R8(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 k8($=32){if(E0&&typeof E0.getRandomValues==="function")return E0.getRandomValues(new Uint8Array($));throw new Error("crypto.getRandomValues must be defined")}class L${clone(){return this._cloneInto()}}var R8,B8,T0,D$,fq,n9;var c$=f(()=>{f8();/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */R8=($)=>$ instanceof Uint8Array,B8=($)=>new Uint32Array($.buffer,$.byteOffset,Math.floor($.byteLength/4)),T0=($)=>new DataView($.buffer,$.byteOffset,$.byteLength),D$=($,J)=>$<<32-J|$>>>J,fq=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!fq)throw new Error("Non little-endian hardware is not supported");n9={}.toString});function bq($,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 X=(D+8)%10,A=(D+2)%10,I=Q[A],G=Q[A+1],K=_8(I,G,1)^Q[X],U=P8(I,G,1)^Q[X+1];for(let z=0;z<50;z+=10)$[D+z]^=K,$[D+z+1]^=U}let Y=$[2],W=$[3];for(let D=0;D<24;D++){const X=F8[D],A=_8(Y,W,X),I=P8(Y,W,X),G=x8[D];Y=$[G],W=$[G+1],$[G]=A,$[G+1]=I}for(let D=0;D<50;D+=10){for(let X=0;X<10;X++)Q[X]=$[D+X];for(let X=0;X<10;X++)$[D+X]^=~Q[(X+2)%10]&Q[(X+4)%10]}$[0]^=xq[q],$[1]^=Fq[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=B8(this.state)}keccak(){bq(this.state32,this.rounds),this.posOut=0,this.pos=0}update($){M$(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($){M$(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 x8,F8,b8,Bq,s$,Lq,kq,_q,Pq,xq,Fq,_8,P8,vq,v8;var g8=f(()=>{C0();S8();c$();[x8,F8,b8]=[[],[],[]],Bq=BigInt(0),s$=BigInt(1),Lq=BigInt(2),kq=BigInt(7),_q=BigInt(256),Pq=BigInt(113);for(let $=0,J=s$,Q=1,q=0;$<24;$++){[Q,q]=[q,(2*Q+3*q)%5],x8.push(2*(5*q+Q)),F8.push(($+1)*($+2)/2%64);let Y=Bq;for(let W=0;W<7;W++)if(J=(J<<s$^(J>>kq)*Pq)%_q,J&Lq)Y^=s$<<(s$<<BigInt(W))-s$;b8.push(Y)}[xq,Fq]=C8(b8,!0),_8=($,J,Q)=>Q>32?T8($,J,Q):j8($,J,Q),P8=($,J,Q)=>Q>32?H8($,J,Q):E8($,J,Q);vq=($,J,Q)=>H0(()=>new AJ(J,$,Q)),v8=vq(1,136,32)});function c($,J){const Q=J||"hex",q=v8(I$($,{strict:!1})?h$($):$);if(Q==="bytes")return q;return B(q)}var m$=f(()=>{g8();u$();N$();o()});class r extends C{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(()=>{i()});class e$ 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 S0($,J){if(ZJ.has(`${$}.${J}`))return ZJ.get(`${$}.${J}`);const Q=J?`${J}${$.toLowerCase()}`:$.substring(2).toLowerCase(),q=c(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 ZJ.set(`${$}.${J}`,W),W}var ZJ;var GJ=f(()=>{N$();m$();IJ();ZJ=new e$(8192)});function s($,J){const{strict:Q=!0}=J??{};if(KJ.has($))return KJ.get($);const q=(()=>{if(!gq.test($))return!1;if($.toLowerCase()===$)return!0;if(Q)return S0($)===$;return!0})();return KJ.set($,q),q}var gq,KJ;var p$=f(()=>{IJ();GJ();gq=/^0x[a-fA-F0-9]{40}$/,KJ=new e$(8192)});function X$($){if(typeof $[0]==="string")return $0($);return yq($)}function yq($){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 f0($,J,Q,{strict:q}={}){if(I$($,{strict:!1}))return hq($,J,Q,{strict:q});return uq($,J,Q,{strict:q})}function uq($,J,Q,{strict:q}={}){y8($,J);const Y=$.slice(J,Q);if(q)u8(Y,J,Q);return Y}function hq($,J,Q,{strict:q}={}){y8($,J);const Y=`0x${$.replace("0x","").slice((J??0)*2,(Q??$.length)*2)}`;if(q)u8(Y,J,Q);return Y}var y8,u8;var NJ=f(()=>{qJ();u$();w$();y8=function($,J){if(typeof J==="number"&&J>0&&J>b($)-1)throw new N0({offset:J,position:"start",size:b($)})},u8=function($,J,Q){if(typeof J==="number"&&typeof Q==="number"&&b($)!==Q-J)throw new N0({offset:Q,position:"end",size:b($)})}});function MJ($,J){if($.length!==J.length)throw new s0({expectedLength:$.length,givenLength:J.length});const Q=lq({params:$,values:J}),q=OJ(Q);if(q.length===0)return"0x";return q}function rq($){const J=$.match(/^(.*)\[(\d+)?\]$/);return J?[J[2]?Number(J[2]):null,J[1]]:void 0}var lq,VJ,OJ,cq,mq,dq,pq,nq,iq,oq;var h8=f(()=>{QJ();d$();i();p$();J0();V0();w$();NJ();o();lq=function({params:$,values:J}){const Q=[];for(let q=0;q<$.length;q++)Q.push(VJ({param:$[q],value:J[q]}));return Q},VJ=function({param:$,value:J}){const Q=rq($.type);if(Q){const[q,Y]=Q;return mq(J,{length:q,param:{...$,type:Y}})}if($.type==="tuple")return oq(J,{param:$});if($.type==="address")return cq(J);if($.type==="bool")return pq(J);if($.type.startsWith("uint")||$.type.startsWith("int")){const q=$.type.startsWith("int");return nq(J,{signed:q})}if($.type.startsWith("bytes"))return dq(J,{param:$});if($.type==="string")return iq(J);throw new $J($.type,{docsPath:"/docs/contract/encodeAbiParameters"})},OJ=function($){let J=0;for(let W=0;W<$.length;W++){const{dynamic:D,encoded:X}=$[W];if(D)J+=32;else J+=b(X)}const Q=[],q=[];let Y=0;for(let W=0;W<$.length;W++){const{dynamic:D,encoded:X}=$[W];if(D)Q.push(J$(J+Y,{size:32})),q.push(X),Y+=b(X);else Q.push(X)}return X$([...Q,...q])},cq=function($){if(!s($))throw new r({address:$});return{dynamic:!1,encoded:G$($.toLowerCase())}},mq=function($,{length:J,param:Q}){const q=J===null;if(!Array.isArray($))throw new JJ($);if(!q&&$.length!==J)throw new t0({expectedLength:J,givenLength:$.length,type:`${Q.type}[${J}]`});let Y=!1;const W=[];for(let D=0;D<$.length;D++){const X=VJ({param:Q,value:$[D]});if(X.dynamic)Y=!0;W.push(X)}if(q||Y){const D=OJ(W);if(q){const X=J$(W.length,{size:32});return{dynamic:!0,encoded:W.length>0?X$([X,D]):X}}if(Y)return{dynamic:!0,encoded:D}}return{dynamic:!1,encoded:X$(W.map(({encoded:D})=>D))}},dq=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:X$([G$(J$(q,{size:32})),Y])}}if(q!==Number.parseInt(Q))throw new a0({expectedSize:Number.parseInt(Q),value:$});return{dynamic:!1,encoded:G$($,{dir:"right"})}},pq=function($){if(typeof $!=="boolean")throw new C(`Invalid boolean value: "${$}" (type: ${typeof $}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:G$(U0($))}},nq=function($,{signed:J}){return{dynamic:!1,encoded:J$($,{size:32,signed:J})}},iq=function($){const J=w0($),Q=Math.ceil(b(J)/32),q=[];for(let Y=0;Y<Q;Y++)q.push(G$(f0(J,Y*32,(Y+1)*32),{dir:"right"}));return{dynamic:!0,encoded:X$([G$(J$(b(J),{size:32})),...q])}},oq=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,X=VJ({param:W,value:$[D]});if(q.push(X),X.dynamic)Q=!0}return{dynamic:Q,encoded:Q?OJ(q):X$(q.map(({encoded:Y})=>Y))}}});class R0 extends C{constructor({offset:$}){super(`Offset \`${$}\` cannot be negative.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class UJ extends C{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 wJ extends C{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 l8=f(()=>{i()});function B0($,{recursiveReadLimit:J=8192}={}){const Q=Object.create(tq);return Q.bytes=$,Q.dataView=new DataView($.buffer,$.byteOffset,$.byteLength),Q.positionReadCount=new Map,Q.recursiveReadLimit=J,Q}var tq;var zJ=f(()=>{l8();tq={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 wJ({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition($){if($<0||$>this.bytes.length-1)throw new UJ({length:this.bytes.length,position:$})},decrementPosition($){if($<0)throw new R0({offset:$});const J=this.position-$;this.assertPosition(J),this.position=J},getReadCount($){return this.positionReadCount.get($||this.position)||0},incrementPosition($){if($<0)throw new R0({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 c8;var m8=f(()=>{c8={ether:-9,wei:9}});function d8($,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 p8=f(()=>{});function Q0($,J="wei"){return d8($,c8[J])}var n8=f(()=>{m8();p8()});function aq($){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 CJ extends C{constructor({v:$}){super(`Invalid \`v\` value "${$}". Expected 27 or 28.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class jJ extends C{constructor({transaction:$}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",aq($),"}","","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 EJ extends C{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 L0=f(()=>{i()});class TJ extends C{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 C{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 i8 extends C{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 o8 extends C{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 r8 extends C{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 t8 extends C{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 a8 extends C{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 s8 extends C{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 C{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 $Q extends C{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 k0 extends C{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 JQ=f(()=>{n8();i();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(i8,"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(o8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});Object.defineProperty(r8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});Object.defineProperty(t8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});Object.defineProperty(a8,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});Object.defineProperty(s8,"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($Q,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Object.defineProperty(k0,"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($){M$(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 X=T0($);for(;q<=Y-W;W+=q)this.process(X,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($){M$(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 G=W;G<q;G++)J[G]=0;sq(Q,q-8,BigInt(this.length*8),Y),this.process(Q,0);const D=T0($),X=this.outputLen;if(X%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const A=X/4,I=this.get();if(A>I.length)throw new Error("_sha2: outputLen bigger than state");for(let G=0;G<A;G++)D.setUint32(4*G,I[G],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 sq;var QQ=f(()=>{C0();c$();sq=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),X=Number(Q&W),A=q?4:0,I=q?0:4;$.setUint32(J+A,D,q),$.setUint32(J+I,X,q)}});class qQ extends HJ{constructor(){super(64,32,8,!1);this.A=j$[0]|0,this.B=j$[1]|0,this.C=j$[2]|0,this.D=j$[3]|0,this.E=j$[4]|0,this.F=j$[5]|0,this.G=j$[6]|0,this.H=j$[7]|0}get(){const{A:$,B:J,C:Q,D:q,E:Y,F:W,G:D,H:X}=this;return[$,J,Q,q,Y,W,D,X]}set($,J,Q,q,Y,W,D,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=D|0,this.H=X|0}process($,J){for(let G=0;G<16;G++,J+=4)E$[G]=$.getUint32(J,!1);for(let G=16;G<64;G++){const K=E$[G-15],U=E$[G-2],z=D$(K,7)^D$(K,18)^K>>>3,Z=D$(U,17)^D$(U,19)^U>>>10;E$[G]=Z+E$[G-7]+z+E$[G-16]|0}let{A:Q,B:q,C:Y,D:W,E:D,F:X,G:A,H:I}=this;for(let G=0;G<64;G++){const K=D$(D,6)^D$(D,11)^D$(D,25),U=I+K+eq(D,X,A)+JY[G]+E$[G]|0,Z=(D$(Q,2)^D$(Q,13)^D$(Q,22))+$Y(Q,q,Y)|0;I=A,A=X,X=D,D=W+U|0,W=Y,Y=q,q=Q,Q=U+Z|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,X=X+this.F|0,A=A+this.G|0,I=I+this.H|0,this.set(Q,q,Y,W,D,X,A,I)}roundClean(){E$.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}var eq,$Y,JY,j$,E$,x0;var SJ=f(()=>{QQ();c$();eq=($,J,Q)=>$&J^~$&Q,$Y=($,J,Q)=>$&J^$&Q^J&Q,JY=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]),j$=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),E$=new Uint32Array(64);x0=H0(()=>new qQ)});class Y0 extends C{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 NQ=f(()=>{i()});var yJ={};Uq(yJ,{validateObject:()=>{{return H$}},utf8ToBytes:()=>{{return MY}},numberToVarBytesBE:()=>{{return KY}},numberToHexUnpadded:()=>{{return _Q}},numberToBytesLE:()=>{{return h0}},numberToBytesBE:()=>{{return T$}},hexToNumber:()=>{{return vJ}},hexToBytes:()=>{{return _$}},equalBytes:()=>{{return NY}},ensureBytes:()=>{{return e}},createHmacDrbg:()=>{{return gJ}},concatBytes:()=>{{return o$}},bytesToNumberLE:()=>{{return u0}},bytesToNumberBE:()=>{{return V$}},bytesToHex:()=>{{return k$}},bitSet:()=>{{return UY}},bitMask:()=>{{return W0}},bitLen:()=>{{return VY}},bitGet:()=>{{return OY}}});function k$($){if(!y0($))throw new Error("Uint8Array expected");let J="";for(let Q=0;Q<$.length;Q++)J+=GY[$[Q]];return J}function _Q($){const J=$.toString(16);return J.length&1?`0${J}`:J}function vJ($){if(typeof $!=="string")throw new Error("hex string expected, got "+typeof $);return BigInt($===""?"0":`0x${$}`)}function _$($){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 V$($){return vJ(k$($))}function u0($){if(!y0($))throw new Error("Uint8Array expected");return vJ(k$(Uint8Array.from($).reverse()))}function T$($,J){return _$($.toString(16).padStart(J*2,"0"))}function h0($,J){return T$($,J).reverse()}function KY($){return _$(_Q($))}function e($,J,Q){let q;if(typeof J==="string")try{q=_$(J)}catch(W){throw new Error(`${$} must be valid hex string, got "${J}". Cause: ${W}`)}else if(y0(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(!y0(q))throw new Error("Uint8Array expected");J.set(q,Q),Q+=q.length}),J}function NY($,J){if($.length!==J.length)return!1;for(let Q=0;Q<$.length;Q++)if($[Q]!==J[Q])return!1;return!0}function MY($){if(typeof $!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof $}`);return new Uint8Array((new TextEncoder()).encode($))}function VY($){let J;for(J=0;$>kQ;$>>=g0,J+=1);return J}function OY($,J){return $>>BigInt(J)&g0}function gJ($,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=bJ($),Y=bJ($),W=0;const D=()=>{q.fill(1),Y.fill(0),W=0},X=(...K)=>Q(Y,q,...K),A=(K=bJ())=>{if(Y=X(LQ([0]),K),q=X(),K.length===0)return;Y=X(LQ([1]),K),q=X()},I=()=>{if(W++>=1000)throw new Error("drbg: tried 1000 values");let K=0;const U=[];while(K<J){q=X();const z=q.slice();U.push(z),K+=q.length}return o$(...U)};return(K,U)=>{D(),A(K);let z=void 0;while(!(z=U(I())))A();return D(),z}}function H$($,J,Q={}){const q=(Y,W,D)=>{const X=wY[W];if(typeof X!=="function")throw new Error(`Invalid validator "${W}", expected function`);const A=$[Y];if(D&&A===void 0)return;if(!X(A,$))throw new Error(`Invalid param ${String(Y)}=${A} (${typeof A}), 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 kQ,g0,ZY,y0,GY,UY,W0,bJ,LQ,wY;var D0=f(()=>{/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */kQ=BigInt(0),g0=BigInt(1),ZY=BigInt(2),y0=($)=>$ instanceof Uint8Array,GY=Array.from({length:256},($,J)=>J.toString(16).padStart(2,"0")),UY=($,J,Q)=>{return $|(Q?g0:kQ)<<BigInt(J)},W0=($)=>(ZY<<BigInt($-1))-g0,bJ=($)=>new Uint8Array($),LQ=($)=>Uint8Array.from($),wY={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>=u?Q:J+Q}function EY($,J,Q){if(Q<=u||J<u)throw new Error("Expected power/modulo > 0");if(Q===v)return u;let q=v;while(J>u){if(J&v)q=q*$%Q;$=$*$%Q,J>>=v}return q}function $$($,J,Q){let q=$;while(J-- >u)q*=q,q%=Q;return q}function l0($,J){if($===u||J<=u)throw new Error(`invert: expected positive integers, got n=${$} mod=${J}`);let Q=m($,J),q=J,Y=u,W=v,D=v,X=u;while(Q!==u){const I=q/Q,G=q%Q,K=Y-D*I,U=W-X*I;q=Q,Q=G,Y=D,W=X,D=K,X=U}if(q!==v)throw new Error("invert: does not exist");return m(Y,J)}function TY($){const J=($-v)/P$;let Q,q,Y;for(Q=$-v,q=0;Q%P$===u;Q/=P$,q++);for(Y=P$;Y<$&&EY(Y,J,$)!==$-v;Y++);if(q===1){const D=($+v)/uJ;return function X(A,I){const G=A.pow(I,D);if(!A.eql(A.sqr(G),I))throw new Error("Cannot find square root");return G}}const W=(Q+v)/P$;return function D(X,A){if(X.pow(A,J)===X.neg(X.ONE))throw new Error("Cannot find square root");let I=q,G=X.pow(X.mul(X.ONE,Y),Q),K=X.pow(A,W),U=X.pow(A,Q);while(!X.eql(U,X.ONE)){if(X.eql(U,X.ZERO))return X.ZERO;let z=1;for(let N=X.sqr(U);z<I;z++){if(X.eql(N,X.ONE))break;N=X.sqr(N)}const Z=X.pow(G,v<<BigInt(I-z-1));G=X.sqr(Z),K=X.mul(K,Z),U=X.mul(U,G),I=z}return K}}function HY($){if($%uJ===zY){const J=($+v)/uJ;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($%xQ===PQ){const J=($-PQ)/xQ;return function Q(q,Y){const W=q.mul(Y,P$),D=q.pow(W,J),X=q.mul(Y,D),A=q.mul(q.mul(X,P$),D),I=q.mul(X,q.sub(A,q.ONE));if(!q.eql(q.sqr(I),Y))throw new Error("Cannot find square root");return I}}if($%jY===CY);return TY($)}function hJ($){const J={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},Q=SY.reduce((q,Y)=>{return q[Y]="function",q},J);return H$($,Q)}function fY($,J,Q){if(Q<u)throw new Error("Expected power > 0");if(Q===u)return $.ONE;if(Q===v)return J;let q=$.ONE,Y=J;while(Q>u){if(Q&v)q=$.mul(q,Y);Y=$.sqr(Y),Q>>=v}return q}function RY($,J){const Q=new Array(J.length),q=J.reduce((W,D,X)=>{if($.is0(D))return W;return Q[X]=W,$.mul(W,D)},$.ONE),Y=$.inv(q);return J.reduceRight((W,D,X)=>{if($.is0(D))return W;return Q[X]=$.mul(W,Q[X]),$.mul(W,D)},Y),Q}function lJ($,J){const Q=J!==void 0?J:$.toString(2).length,q=Math.ceil(Q/8);return{nBitLength:Q,nByteLength:q}}function FQ($,J,Q=!1,q={}){if($<=u)throw new Error(`Expected Field ORDER > 0, got ${$}`);const{nBitLength:Y,nByteLength:W}=lJ($,J);if(W>2048)throw new Error("Field lengths over 2048 bytes are not supported");const D=HY($),X=Object.freeze({ORDER:$,BITS:Y,BYTES:W,MASK:W0(Y),ZERO:u,ONE:v,create:(A)=>m(A,$),isValid:(A)=>{if(typeof A!=="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof A}`);return u<=A&&A<$},is0:(A)=>A===u,isOdd:(A)=>(A&v)===v,neg:(A)=>m(-A,$),eql:(A,I)=>A===I,sqr:(A)=>m(A*A,$),add:(A,I)=>m(A+I,$),sub:(A,I)=>m(A-I,$),mul:(A,I)=>m(A*I,$),pow:(A,I)=>fY(X,A,I),div:(A,I)=>m(A*l0(I,$),$),sqrN:(A)=>A*A,addN:(A,I)=>A+I,subN:(A,I)=>A-I,mulN:(A,I)=>A*I,inv:(A)=>l0(A,$),sqrt:q.sqrt||((A)=>D(X,A)),invertBatch:(A)=>RY(X,A),cmov:(A,I,G)=>G?I:A,toBytes:(A)=>Q?h0(A,W):T$(A,W),fromBytes:(A)=>{if(A.length!==W)throw new Error(`Fp.fromBytes: expected ${W}, got ${A.length}`);return Q?u0(A):V$(A)}});return Object.freeze(X)}function bQ($){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=bQ($);return J+Math.ceil(J/2)}function vQ($,J,Q=!1){const q=$.length,Y=bQ(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?V$($):u0($),X=m(D,J-v)+v;return Q?h0(X,Y):T$(X,Y)}var u,v,P$,zY,uJ,PQ,xQ,CY,jY,SY;var c0=f(()=>{D0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */u=BigInt(0),v=BigInt(1),P$=BigInt(2),zY=BigInt(3),uJ=BigInt(4),PQ=BigInt(5),xQ=BigInt(8),CY=BigInt(9),jY=BigInt(16),SY=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function gQ($,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,X=Y;while(W>LY){if(W&mJ)D=D.add(X);X=X.double(),W>>=mJ}return D},precomputeWindow(Y,W){const{windows:D,windowSize:X}=q(W),A=[];let I=Y,G=I;for(let K=0;K<D;K++){G=I,A.push(G);for(let U=1;U<X;U++)G=G.add(I),A.push(G);I=G.double()}return A},wNAF(Y,W,D){const{windows:X,windowSize:A}=q(Y);let{ZERO:I,BASE:G}=$;const K=BigInt(2**Y-1),U=2**Y,z=BigInt(Y);for(let Z=0;Z<X;Z++){const N=Z*A;let O=Number(D&K);if(D>>=z,O>A)O-=U,D+=mJ;const V=N,j=N+Math.abs(O)-1,R=Z%2!==0,S=O<0;if(O===0)G=G.add(Q(R,W[V]));else I=I.add(Q(S,W[j]))}return{p:I,f:G}},wNAFCached(Y,W,D,X){const A=Y._WINDOW_SIZE||1;let I=W.get(Y);if(!I){if(I=this.precomputeWindow(Y,A),A!==1)W.set(Y,X(I))}return this.wNAF(A,I,D)}}}function dJ($){return hJ($.Fp),H$($,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...lJ($.n,$.nBitLength),...$,...{p:$.Fp.ORDER}})}var LY,mJ;var yQ=f(()=>{c0();D0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */LY=BigInt(0),mJ=BigInt(1)});function xY($){const J=kY($),{Fp:Q}=J,q=J.toBytes||((Z,N,O)=>{const V=N.toAffine();return o$(Uint8Array.from([4]),Q.toBytes(V.x),Q.toBytes(V.y))}),Y=J.fromBytes||((Z)=>{const N=Z.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(Z){const{a:N,b:O}=J,V=Q.sqr(Z),j=Q.mul(V,Z);return Q.add(Q.add(j,Q.mul(Z,N)),O)}if(!Q.eql(Q.sqr(J.Gy),W(J.Gx)))throw new Error("bad generator point: equation left != right");function D(Z){return typeof Z==="bigint"&&O$<Z&&Z<J.n}function X(Z){if(!D(Z))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function A(Z){const{allowedPrivateKeyLengths:N,nByteLength:O,wrapPrivateKey:V,n:j}=J;if(N&&typeof Z!=="bigint"){if(Z instanceof Uint8Array)Z=k$(Z);if(typeof Z!=="string"||!N.includes(Z.length))throw new Error("Invalid key");Z=Z.padStart(O*2,"0")}let R;try{R=typeof Z==="bigint"?Z:V$(e("private key",Z,O))}catch(S){throw new Error(`private key must be ${O} bytes, hex or bigint, not ${typeof Z}`)}if(V)R=m(R,j);return X(R),R}const I=new Map;function G(Z){if(!(Z instanceof K))throw new Error("ProjectivePoint expected")}class K{constructor(Z,N,O){if(this.px=Z,this.py=N,this.pz=O,Z==null||!Q.isValid(Z))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(Z){const{x:N,y:O}=Z||{};if(!Z||!Q.isValid(N)||!Q.isValid(O))throw new Error("invalid affine point");if(Z 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(Z){const N=Q.invertBatch(Z.map((O)=>O.pz));return Z.map((O,V)=>O.toAffine(N[V])).map(K.fromAffine)}static fromHex(Z){const N=K.fromAffine(Y(e("pointHex",Z)));return N.assertValidity(),N}static fromPrivateKey(Z){return K.BASE.multiply(A(Z))}_setWindowSize(Z){this._WINDOW_SIZE=Z,I.delete(this)}assertValidity(){if(this.is0()){if(J.allowInfinityPoint&&!Q.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:Z,y:N}=this.toAffine();if(!Q.isValid(Z)||!Q.isValid(N))throw new Error("bad point: x or y not FE");const O=Q.sqr(N),V=W(Z);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:Z}=this.toAffine();if(Q.isOdd)return!Q.isOdd(Z);throw new Error("Field doesn't support isOdd")}equals(Z){G(Z);const{px:N,py:O,pz:V}=this,{px:j,py:R,pz:S}=Z,E=Q.eql(Q.mul(N,S),Q.mul(j,V)),T=Q.eql(Q.mul(O,S),Q.mul(R,V));return E&&T}negate(){return new K(this.px,Q.neg(this.py),this.pz)}double(){const{a:Z,b:N}=J,O=Q.mul(N,uQ),{px:V,py:j,pz:R}=this;let{ZERO:S,ZERO:E,ZERO:T}=Q,L=Q.mul(V,V),q$=Q.mul(j,j),P=Q.mul(R,R),_=Q.mul(V,j);return _=Q.add(_,_),T=Q.mul(V,R),T=Q.add(T,T),S=Q.mul(Z,T),E=Q.mul(O,P),E=Q.add(S,E),S=Q.sub(q$,E),E=Q.add(q$,E),E=Q.mul(S,E),S=Q.mul(_,S),T=Q.mul(O,T),P=Q.mul(Z,P),_=Q.sub(L,P),_=Q.mul(Z,_),_=Q.add(_,T),T=Q.add(L,L),L=Q.add(T,L),L=Q.add(L,P),L=Q.mul(L,_),E=Q.add(E,L),P=Q.mul(j,R),P=Q.add(P,P),L=Q.mul(P,_),S=Q.sub(S,L),T=Q.mul(P,q$),T=Q.add(T,T),T=Q.add(T,T),new K(S,E,T)}add(Z){G(Z);const{px:N,py:O,pz:V}=this,{px:j,py:R,pz:S}=Z;let{ZERO:E,ZERO:T,ZERO:L}=Q;const q$=J.a,P=Q.mul(J.b,uQ);let _=Q.mul(N,j),n=Q.mul(O,R),t=Q.mul(V,S),U$=Q.add(N,O),l=Q.add(j,R);U$=Q.mul(U$,l),l=Q.add(_,n),U$=Q.sub(U$,l),l=Q.add(N,V);let M=Q.add(j,S);return l=Q.mul(l,M),M=Q.add(_,t),l=Q.sub(l,M),M=Q.add(O,V),E=Q.add(R,S),M=Q.mul(M,E),E=Q.add(n,t),M=Q.sub(M,E),L=Q.mul(q$,l),E=Q.mul(P,t),L=Q.add(E,L),E=Q.sub(n,L),L=Q.add(n,L),T=Q.mul(E,L),n=Q.add(_,_),n=Q.add(n,_),t=Q.mul(q$,t),l=Q.mul(P,l),n=Q.add(n,t),t=Q.sub(_,t),t=Q.mul(q$,t),l=Q.add(l,t),_=Q.mul(n,l),T=Q.add(T,_),_=Q.mul(M,l),E=Q.mul(U$,E),E=Q.sub(E,_),_=Q.mul(U$,n),L=Q.mul(M,L),L=Q.add(L,_),new K(E,T,L)}subtract(Z){return this.add(Z.negate())}is0(){return this.equals(K.ZERO)}wNAF(Z){return z.wNAFCached(this,I,Z,(N)=>{const O=Q.invertBatch(N.map((V)=>V.pz));return N.map((V,j)=>V.toAffine(O[j])).map(K.fromAffine)})}multiplyUnsafe(Z){const N=K.ZERO;if(Z===O$)return N;if(X(Z),Z===Q$)return this;const{endo:O}=J;if(!O)return z.unsafeLadder(this,Z);let{k1neg:V,k1:j,k2neg:R,k2:S}=O.splitScalar(Z),E=N,T=N,L=this;while(j>O$||S>O$){if(j&Q$)E=E.add(L);if(S&Q$)T=T.add(L);L=L.double(),j>>=Q$,S>>=Q$}if(V)E=E.negate();if(R)T=T.negate();return T=new K(Q.mul(T.px,O.beta),T.py,T.pz),E.add(T)}multiply(Z){X(Z);let N=Z,O,V;const{endo:j}=J;if(j){const{k1neg:R,k1:S,k2neg:E,k2:T}=j.splitScalar(N);let{p:L,f:q$}=this.wNAF(S),{p:P,f:_}=this.wNAF(T);L=z.constTimeNegate(R,L),P=z.constTimeNegate(E,P),P=new K(Q.mul(P.px,j.beta),P.py,P.pz),O=L.add(P),V=q$.add(_)}else{const{p:R,f:S}=this.wNAF(N);O=R,V=S}return K.normalizeZ([O,V])[0]}multiplyAndAddUnsafe(Z,N,O){const V=K.BASE,j=(S,E)=>E===O$||E===Q$||!S.equals(V)?S.multiplyUnsafe(E):S.multiply(E),R=j(this,N).add(j(Z,O));return R.is0()?void 0:R}toAffine(Z){const{px:N,py:O,pz:V}=this,j=this.is0();if(Z==null)Z=j?Q.ONE:Q.inv(V);const R=Q.mul(N,Z),S=Q.mul(O,Z),E=Q.mul(V,Z);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:S}}isTorsionFree(){const{h:Z,isTorsionFree:N}=J;if(Z===Q$)return!0;if(N)return N(K,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:Z,clearCofactor:N}=J;if(Z===Q$)return this;if(N)return N(K,this);return this.multiplyUnsafe(J.h)}toRawBytes(Z=!0){return this.assertValidity(),q(K,this,Z)}toHex(Z=!0){return k$(this.toRawBytes(Z))}}K.BASE=new K(J.Gx,J.Gy,Q.ONE),K.ZERO=new K(Q.ZERO,Q.ONE,Q.ZERO);const U=J.nBitLength,z=gQ(K,J.endo?Math.ceil(U/2):U);return{CURVE:J,ProjectivePoint:K,normPrivateKeyToScalar:A,weierstrassEquation:W,isWithinCurveOrder:D}}function hQ($){const J=FY($),{Fp:Q,n:q}=J,Y=Q.BYTES+1,W=2*Q.BYTES+1;function D(M){return O$<M&&M<Q.ORDER}function X(M){return m(M,q)}function A(M){return l0(M,q)}const{ProjectivePoint:I,normPrivateKeyToScalar:G,weierstrassEquation:K,isWithinCurveOrder:U}=xY({...J,toBytes(M,H,k){const x=H.toAffine(),F=Q.toBytes(x.x),g=o$;if(k)return g(Uint8Array.from([H.hasEvenY()?2:3]),F);else return g(Uint8Array.from([4]),F,Q.toBytes(x.y))},fromBytes(M){const H=M.length,k=M[0],x=M.subarray(1);if(H===Y&&(k===2||k===3)){const F=V$(x);if(!D(F))throw new Error("Point is not on curve");const g=K(F);let Y$=Q.sqrt(g);const a=(Y$&Q$)===Q$;if((k&1)===1!==a)Y$=Q.neg(Y$);return{x:F,y:Y$}}else if(H===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 ${H} was invalid. Expected ${Y} compressed bytes or ${W} uncompressed bytes`)}}),z=(M)=>k$(T$(M,J.nByteLength));function Z(M){const H=q>>Q$;return M>H}function N(M){return Z(M)?X(-M):M}const O=(M,H,k)=>V$(M.slice(H,k));class V{constructor(M,H,k){this.r=M,this.s=H,this.recovery=k,this.assertValidity()}static fromCompact(M){const H=J.nByteLength;return M=e("compactSignature",M,H*2),new V(O(M,0,H),O(M,H,2*H))}static fromDER(M){const{r:H,s:k}=x$.toSig(e("DER",M));return new V(H,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:H,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?H+J.n:H;if(g>=Q.ORDER)throw new Error("recovery id 2 or 3 invalid");const Y$=(x&1)===0?"02":"03",a=I.fromHex(Y$+z(g)),Z$=A(g),S$=X(-F*Z$),v$=X(k*Z$),f$=I.BASE.multiplyAndAddUnsafe(a,S$,v$);if(!f$)throw new Error("point at infinify");return f$.assertValidity(),f$}hasHighS(){return Z(this.s)}normalizeS(){return this.hasHighS()?new V(this.r,X(-this.s),this.recovery):this}toDERRawBytes(){return _$(this.toDERHex())}toDERHex(){return x$.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return _$(this.toCompactHex())}toCompactHex(){return z(this.r)+z(this.s)}}const j={isValidPrivateKey(M){try{return G(M),!0}catch(H){return!1}},normPrivateKeyToScalar:G,randomPrivateKey:()=>{const M=cJ(J.n);return vQ(J.randomBytes(M),J.n)},precompute(M=8,H=I.BASE){return H._setWindowSize(M),H.multiply(BigInt(3)),H}};function R(M,H=!0){return I.fromPrivateKey(M).toRawBytes(H)}function S(M){const H=M instanceof Uint8Array,k=typeof M==="string",x=(H||k)&&M.length;if(H)return x===Y||x===W;if(k)return x===2*Y||x===2*W;if(M instanceof I)return!0;return!1}function E(M,H,k=!0){if(S(M))throw new Error("first arg must be private key");if(!S(H))throw new Error("second arg must be public key");return I.fromHex(H).multiply(G(M)).toRawBytes(k)}const T=J.bits2int||function(M){const H=V$(M),k=M.length*8-J.nBitLength;return k>0?H>>BigInt(k):H},L=J.bits2int_modN||function(M){return X(T(M))},q$=W0(J.nBitLength);function P(M){if(typeof M!=="bigint")throw new Error("bigint expected");if(!(O$<=M&&M<q$))throw new Error(`bigint expected < 2^${J.nBitLength}`);return T$(M,J.nByteLength)}function _(M,H,k=n){if(["recovered","canonical"].some((R$)=>(R$ in k)))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:F}=J;let{lowS:g,prehash:Y$,extraEntropy:a}=k;if(g==null)g=!0;if(M=e("msgHash",M),Y$)M=e("prehashed msgHash",x(M));const Z$=L(M),S$=G(H),v$=[P(S$),P(Z$)];if(a!=null){const R$=a===!0?F(Q.BYTES):a;v$.push(e("extraEntropy",R$))}const f$=o$(...v$),Z0=Z$;function o0(R$){const g$=T(R$);if(!U(g$))return;const D8=A(g$),A$=I.BASE.multiply(g$).toAffine(),y$=X(A$.x);if(y$===O$)return;const G0=X(D8*X(Z0+y$*S$));if(G0===O$)return;let X8=(A$.x===y$?0:2)|Number(A$.y&Q$),A8=G0;if(g&&Z(G0))A8=N(G0),X8^=1;return new V(y$,A8,X8)}return{seed:f$,k2sig:o0}}const n={lowS:J.lowS,prehash:!1},t={lowS:J.lowS,prehash:!1};function U$(M,H,k=n){const{seed:x,k2sig:F}=_(M,H,k),g=J;return gJ(g.hash.outputLen,g.nByteLength,g.hmac)(x,F)}I.BASE._setWindowSize(8);function l(M,H,k,x=t){const F=M;if(H=e("msgHash",H),k=e("publicKey",k),"strict"in x)throw new Error("options.strict was renamed to lowS");const{lowS:g,prehash:Y$}=x;let a=void 0,Z$;try{if(typeof F==="string"||F instanceof Uint8Array)try{a=V.fromDER(F)}catch(A$){if(!(A$ instanceof x$.Err))throw A$;a=V.fromCompact(F)}else if(typeof F==="object"&&typeof F.r==="bigint"&&typeof F.s==="bigint"){const{r:A$,s:y$}=F;a=new V(A$,y$)}else throw new Error("PARSE");Z$=I.fromHex(k)}catch(A$){if(A$.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(g&&a.hasHighS())return!1;if(Y$)H=J.hash(H);const{r:S$,s:v$}=a,f$=L(H),Z0=A(v$),o0=X(f$*Z0),R$=X(S$*Z0),g$=I.BASE.multiplyAndAddUnsafe(Z$,o0,R$)?.toAffine();if(!g$)return!1;return X(g$.x)===S$}return{CURVE:J,getPublicKey:R,getSharedSecret:E,sign:U$,verify:l,ProjectivePoint:I,Signature:V,utils:j}}var kY,FY,_Y,PY,x$,O$,Q$,uX,uQ,hX;var lQ=f(()=>{c0();D0();D0();yQ();kY=function($){const J=dJ($);H$(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})};FY=function($){const J=dJ($);return H$(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:_Y,hexToBytes:PY}=yJ),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:_Y(q),l:$.subarray(Q+2)}},toSig($){const{Err:J}=x$,Q=typeof $==="string"?PY($):$;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:X}=x$._parseInt(W);if(X.length)throw new J("Invalid signature: left bytes after parsing");return{r:Y,s:D}},hexFromSig($){const J=(I)=>Number.parseInt(I[0],16)&8?"00"+I:I,Q=(I)=>{const G=I.toString(16);return G.length&1?`0${G}`:G},q=J(Q($.s)),Y=J(Q($.r)),W=q.length/2,D=Y.length/2,X=Q(W),A=Q(D);return`30${Q(D+W+4)}02${A}${Y}02${X}${q}`}},O$=BigInt(0),Q$=BigInt(1),uX=BigInt(2),uQ=BigInt(3),hX=BigInt(4)});class pJ extends L${constructor($,J){super();this.finished=!1,this.destroyed=!1,w8($);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 M$(this),this.iHash.update($),this}digestInto($){M$(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 nJ;var cQ=f(()=>{C0();c$();nJ=($,J,Q)=>new pJ($,J).update(Q).digest();nJ.create=($,J)=>new pJ($,J)});function bY($){return{hash:$,hmac:(J,...Q)=>nJ($,J,L8(...Q)),randomBytes:k8}}function mQ($,J){const Q=(q)=>hQ({...$,...bY(q)});return Object.freeze({...Q(J),create:Q})}var dQ=f(()=>{cQ();c$();lQ();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});var gY,iQ,pQ,vY,iJ,nQ,oJ,rJ,sX,eX;var oQ=f(()=>{SJ();c0();dQ();gY=function($){const J=iQ,Q=BigInt(3),q=BigInt(6),Y=BigInt(11),W=BigInt(22),D=BigInt(23),X=BigInt(44),A=BigInt(88),I=$*$*$%J,G=I*I*$%J,K=$$(G,Q,J)*G%J,U=$$(K,Q,J)*G%J,z=$$(U,iJ,J)*I%J,Z=$$(z,Y,J)*z%J,N=$$(Z,W,J)*Z%J,O=$$(N,X,J)*N%J,V=$$(O,A,J)*O%J,j=$$(V,X,J)*N%J,R=$$(j,Q,J)*G%J,S=$$(R,D,J)*Z%J,E=$$(S,q,J)*I%J,T=$$(E,iJ,J);if(!oJ.eql(oJ.sqr(T),$))throw new Error("Cannot find square root");return T};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */iQ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),pQ=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),vY=BigInt(1),iJ=BigInt(2),nQ=($,J)=>($+J/iJ)/J,oJ=FQ(iQ,void 0,void 0,{sqrt:gY}),rJ=mQ({a:BigInt(0),b:BigInt(7),Fp:oJ,n:pQ,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:($)=>{const J=pQ,Q=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),q=-vY*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),Y=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),W=Q,D=BigInt("0x100000000000000000000000000000000"),X=nQ(W*$,J),A=nQ(-q*$,J);let I=m($-X*Q-A*Y,J),G=m(-X*q-A*W,J);const K=I>D,U=G>D;if(K)I=J-I;if(U)G=J-G;if(I>D||G>D)throw new Error("splitScalar: Endomorphism failed, k="+$);return{k1neg:K,k1:I,k2neg:U,k2:G}}}},x0),sX=BigInt(0),eX=rJ.ProjectivePoint});function K0($){return $.message!==void 0}var wq=1;class r0{t;n;key_label;metadata;constructor({t:$,n:J,key_label:Q,permissions:q}){if(this.t=$,this.n=J,this.key_label=Q,this.metadata=[],q)this.metadata.push([wq,q])}}class I8{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 J=new r0({t:this.threshold,n:this.totalNodes,permissions:$});console.log("Generated Payload:",J);const Q=(Y)=>this.authModule.authenticate({setup:J,challenge:Y}),q=await this.wp_client.startKeygen({setup:J,signer:Q});return console.log("Keygen response:",q),q}catch(J){throw console.error(J),J}}async authenticateAndSign($,J){const Q={t:this.threshold,key_id:$,message:J},q=(W)=>this.authModule.authenticate({setup:Q,challenge:W}),Y=await this.wp_client.startSigngen({setup:Q,signer:q});return console.log("Sign response:",Y),Y}}N$();o();function _0($){const{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),q=typeof $.blobs[0]==="string"?$.blobs.map((W)=>W$(W)):$.blobs,Y=[];for(let W of q)Y.push(Uint8Array.from(J.blobToKzgCommitment(W)));return Q==="bytes"?Y:Y.map((W)=>d(W))}N$();o();function P0($){const{kzg:J}=$,Q=$.to??(typeof $.blobs[0]==="string"?"hex":"bytes"),q=typeof $.blobs[0]==="string"?$.blobs.map((D)=>W$(D)):$.blobs,Y=typeof $.commitments[0]==="string"?$.commitments.map((D)=>W$(D)):$.commitments,W=[];for(let D=0;D<q.length;D++){const X=q[D],A=Y[D];W.push(Uint8Array.from(J.computeBlobKzgProof(X,A)))}return Q==="bytes"?W:W.map((D)=>d(D))}o();SJ();u$();N$();o();function YQ($,J){const Q=J||"hex",q=x0(I$($,{strict:!1})?h$($):$);if(Q==="bytes")return q;return B(q)}function WQ($){const{commitment:J,version:Q=1}=$,q=$.to??(typeof J==="string"?"hex":"bytes"),Y=YQ(J,"bytes");return Y.set([Q],0),q==="bytes"?Y:d(Y)}function DQ($){const{commitments:J,version:Q}=$,q=$.to??(typeof J[0]==="string"?"hex":"bytes"),Y=[];for(let W of J)Y.push(WQ({commitment:W,to:q,version:Q}));return Y}var XQ=32,AQ=4096,IQ=131072,fJ=761855;var F0=1;i();class RJ extends C{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 C{constructor(){super("Blob data must not be empty.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class BJ extends C{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 LJ extends C{constructor({hash:$,version:J}){super(`Versioned hash "${$}" version is invalid.`,{metaMessages:[`Expected: ${F0}`,`Received: ${J}`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}zJ();w$();N$();o();function ZQ($){const J=$.to??(typeof $.data==="string"?"hex":"bytes"),Q=typeof $.data==="string"?W$($.data):$.data,q=b(Q);if(!q)throw new q0;if(q>fJ)throw new RJ({maxSize:fJ,size:q});const Y=[];let W=!0,D=0;while(W){const X=B0(new Uint8Array(IQ));let A=0;while(A<AQ){const I=Q.slice(D,D+(XQ-1));if(X.pushByte(0),X.pushBytes(I),I.length<31){X.pushByte(128),W=!1;break}A++,D+=31}Y.push(X)}return J==="bytes"?Y.map((X)=>X.bytes):Y.map((X)=>d(X.bytes))}function GQ($){const{data:J,kzg:Q,to:q}=$,Y=$.blobs??ZQ({data:J,to:q}),W=$.commitments??_0({blobs:Y,kzg:Q,to:q}),D=$.proofs??P0({blobs:Y,commitments:W,kzg:Q,to:q}),X=[];for(let A=0;A<Y.length;A++)X.push({blob:Y[A],commitment:W[A],proof:D[A]});return X}L0();function KQ($){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 jJ({transaction:$})}GJ();m$();function b0($){const J=c(`0x${$.substring(4)}`).substring(26);return S0(`0x${J}`)}var MQ=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,VQ=/^(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$();w$();o();h8();J0();o();m$();function kJ($){const{domain:J={},message:Q,primaryType:q}=$,Y={EIP712Domain:EQ({domain:J}),...$.types};jQ({domain:J,message:Q,primaryType:q,types:Y});const W=["0x1901"];if(J)W.push(OQ({domain:J,types:Y}));if(q!=="EIP712Domain")W.push(UQ({data:Q,primaryType:q,types:Y}));return c(X$(W))}function OQ({domain:$,types:J}){return UQ({data:$,primaryType:"EIP712Domain",types:J})}var UQ=function({data:$,primaryType:J,types:Q}){const q=wQ({data:$,primaryType:J,types:Q});return c(q)},wQ=function({data:$,primaryType:J,types:Q}){const q=[{type:"bytes32"}],Y=[QY({primaryType:J,types:Q})];for(let W of Q[J]){const[D,X]=CQ({types:Q,name:W.name,type:W.type,value:$[W.name]});q.push(D),Y.push(X)}return MJ(q,Y)},QY=function({primaryType:$,types:J}){const Q=B(qY({primaryType:$,types:J}));return c(Q)},qY=function({primaryType:$,types:J}){let Q="";const q=zQ({primaryType:$,types:J});q.delete($);const Y=[$,...Array.from(q).sort()];for(let W of Y)Q+=`${W}(${J[W].map(({name:D,type:X})=>`${X} ${D}`).join(",")})`;return Q},zQ=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])zQ({primaryType:W.type,types:J},Q);return Q},CQ=function({types:$,name:J,type:Q,value:q}){if($[Q]!==void 0)return[{type:"bytes32"},c(wQ({data:q,primaryType:Q,types:$}))];if(Q==="bytes")return q=`0x${(q.length%2?"0":"")+q.slice(2)}`,[{type:"bytes32"},c(q)];if(Q==="string")return[{type:"bytes32"},c(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"},c(MJ(W.map(([D])=>D),W.map(([,D])=>D)))]}return[{type:Q},q]};function jQ($){const{domain:J,message:Q,primaryType:q,types:Y}=$,W=(D,X)=>{for(let A of D){const{name:I,type:G}=A,K=X[I],U=G.match(VQ);if(U&&(typeof K==="number"||typeof K==="bigint")){const[N,O,V]=U;J$(K,{signed:O==="int",size:Number.parseInt(V)/8})}if(G==="address"&&typeof K==="string"&&!s(K))throw new r({address:K});const z=G.match(MQ);if(z){const[N,O]=z;if(O&&b(K)!==Number.parseInt(O))throw new e0({expectedSize:Number.parseInt(O),givenSize:b(K)})}const Z=Y[G];if(Z)W(Z,K)}};if(Y.EIP712Domain&&J)W(Y.EIP712Domain,J);if(q!=="EIP712Domain"){const D=Y[q];W(D,Q)}}function EQ({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)}i();zJ();N$();o();function i$($,J="hex"){const Q=TQ($),q=B0(new Uint8Array(Q.length));if(Q.encode(q),J==="hex")return d(q.bytes);return q.bytes}var TQ=function($){if(Array.isArray($))return YY($.map((J)=>TQ(J)));return WY($)},YY=function($){const J=$.reduce((Y,W)=>Y+W.length,0),Q=HQ(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)}}},WY=function($){const J=typeof $==="string"?W$($):$,Q=HQ(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)}}}},HQ=function($){if($<256)return 1;if($<65536)return 2;if($<16777216)return 3;if($<4294967296)return 4;throw new C("Length is too large.")};var SQ=`\x19Ethereum Signed Message:
|
|
2
|
+
`;J0();N$();m$();function _J($,J){const Q=(()=>{if(typeof $==="string")return l$($);if($.raw instanceof Uint8Array)return $.raw;return h$($.raw)})(),q=l$(`${SQ}${Q.length}`);return c(X$([q,Q]),J)}d$();i();NQ();JQ();p$();w$();NJ();r$();function fQ($){const{blobVersionedHashes:J}=$;if(J){if(J.length===0)throw new q0;for(let Q of J){const q=b(Q),Y=O8(f0(Q,0,1));if(q!==32)throw new BJ({hash:Q,size:q});if(Y!==F0)throw new LJ({hash:Q,version:Y})}}PJ($)}function PJ($){const{chainId:J,maxPriorityFeePerGas:Q,maxFeePerGas:q,to:Y}=$;if(J<=0)throw new Y0({chainId:J});if(Y&&!s(Y))throw new r({address:Y});if(q&&q>2n**256n-1n)throw new n$({maxFeePerGas:q});if(Q&&q&&Q>q)throw new k0({maxFeePerGas:q,maxPriorityFeePerGas:Q})}function RQ($){const{chainId:J,maxPriorityFeePerGas:Q,gasPrice:q,maxFeePerGas:Y,to:W}=$;if(J<=0)throw new Y0({chainId:J});if(W&&!s(W))throw new r({address:W});if(Q||Y)throw new C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(q&&q>2n**256n-1n)throw new n$({maxFeePerGas:q})}function BQ($){const{chainId:J,maxPriorityFeePerGas:Q,gasPrice:q,maxFeePerGas:Y,to:W,accessList:D}=$;if(W&&!s(W))throw new r({address:W});if(typeof J!=="undefined"&&J<=0)throw new Y0({chainId:J});if(Q||Y)throw new C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(q&&q>2n**256n-1n)throw new n$({maxFeePerGas:q});if(D)throw new C("`accessList` is not a valid Legacy Transaction attribute.")}L0();J0();V8();o();d$();L0();p$();function v0($){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 EJ({storageKey:Y[W]});if(!s(q,{strict:!1}))throw new r({address:q});J.push([q,Y])}return J}function xJ($,J){const Q=KQ($);if(Q==="eip1559")return XY($,J);if(Q==="eip2930")return AY($,J);if(Q==="eip4844")return DY($,J);return IY($,J)}var DY=function($,J){const{chainId:Q,gas:q,nonce:Y,to:W,value:D,maxFeePerBlobGas:X,maxFeePerGas:A,maxPriorityFeePerGas:I,accessList:G,data:K}=$;fQ($);let{blobVersionedHashes:U,sidecars:z}=$;if($.blobs&&(typeof U==="undefined"||typeof z==="undefined")){const R=typeof $.blobs[0]==="string"?$.blobs:$.blobs.map((T)=>d(T)),S=$.kzg,E=_0({blobs:R,kzg:S});if(typeof U==="undefined")U=DQ({commitments:E});if(typeof z==="undefined"){const T=P0({blobs:R,commitments:E,kzg:S});z=GQ({blobs:R,commitments:E,proofs:T})}}const Z=v0(G),N=[B(Q),Y?B(Y):"0x",I?B(I):"0x",A?B(A):"0x",q?B(q):"0x",W??"0x",D?B(D):"0x",K??"0x",Z,X?B(X):"0x",U??[],...FJ($,J)],O=[],V=[],j=[];if(z)for(let R=0;R<z.length;R++){const{blob:S,commitment:E,proof:T}=z[R];O.push(S),V.push(E),j.push(T)}return $0(["0x03",z?i$([N,O,V,j]):i$(N)])},XY=function($,J){const{chainId:Q,gas:q,nonce:Y,to:W,value:D,maxFeePerGas:X,maxPriorityFeePerGas:A,accessList:I,data:G}=$;PJ($);const K=v0(I),U=[B(Q),Y?B(Y):"0x",A?B(A):"0x",X?B(X):"0x",q?B(q):"0x",W??"0x",D?B(D):"0x",G??"0x",K,...FJ($,J)];return $0(["0x02",i$(U)])},AY=function($,J){const{chainId:Q,gas:q,data:Y,nonce:W,to:D,value:X,accessList:A,gasPrice:I}=$;RQ($);const G=v0(A),K=[B(Q),W?B(W):"0x",I?B(I):"0x",q?B(q):"0x",D??"0x",X?B(X):"0x",Y??"0x",G,...FJ($,J)];return $0(["0x01",i$(K)])},IY=function($,J){const{chainId:Q=0,gas:q,data:Y,nonce:W,to:D,value:X,gasPrice:A}=$;BQ($);let I=[W?B(W):"0x",A?B(A):"0x",q?B(q):"0x",D??"0x",X?B(X):"0x",Y??"0x"];if(J){const G=(()=>{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 CJ({v:J.v});return K})();I=[...I,B(G),J.r,J.s]}else if(Q>0)I=[...I,B(Q),"0x","0x"];return i$(I)};function FJ($,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)})(),XJ(Q),XJ(q)]}oQ();r$();function X0({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 rJ.Signature(O0($),O0(J)).toCompactHex()}${Y===0?"1b":"1c"}`}o();m$();var uY=`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 hY=`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 lY=`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 cY=`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 mY=`\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 cY=`\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 dY=`\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 cY=`\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 pY=`\u7684
|
|
12285
12285
|
\u4E00
|
|
12286
12286
|
\u662F
|
|
12287
12287
|
\u5728
|
|
@@ -14328,7 +14328,7 @@ zuppa`.split("\n");var cY=`\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 nY=`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 iY=`\u7684
|
|
16379
16379
|
\u4E00
|
|
16380
16380
|
\u662F
|
|
16381
16381
|
\u5728
|
|
@@ -18422,4 +18422,4 @@ zurdo`.split("\n");var dY=`\u7684
|
|
|
18422
18422
|
\u97CB
|
|
18423
18423
|
\u6028
|
|
18424
18424
|
\u77EE
|
|
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};
|
|
18425
|
+
\u6B47`.split("\n");d$();p$();function tJ($){if(typeof $==="string"){if(!s($,{strict:!1}))throw new r({address:$});return{address:$,type:"json-rpc"}}if(!s($.address,{strict:!1}))throw new r({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 eJ=2n**256n,b$=eJ-0x1000003d1n,$8=eJ-0x14551231950b75fc4402da1732fc9bebfn,Qq=0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,qq=0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n,Yq={p:b$,n:$8,a:0n,b:7n,Gx:Qq,Gy:qq};var rQ=($)=>w(w($*$)*$+Yq.b),h=($="")=>{throw new Error($)},p0=($)=>typeof $==="bigint",Wq=($)=>typeof $==="string",aJ=($)=>p0($)&&0n<$&&$<b$,Dq=($)=>p0($)&&0n<$&&$<$8,oY=($)=>$ instanceof Uint8Array||$!=null&&typeof $==="object"&&$.constructor.name==="Uint8Array",sJ=($,J)=>!oY($)||typeof J==="number"&&J>0&&$.length!==J?h("Uint8Array expected"):$,I0=($)=>new Uint8Array($),J8=($,J)=>sJ(Wq($)?n0($):I0(sJ($)),J),w=($,J=b$)=>{let Q=$%J;return Q>=0n?Q:J+Q},tQ=($)=>$ instanceof p?$:h("Point expected");class p{constructor($,J,Q){this.px=$,this.py=J,this.pz=Q}static fromAffine($){return $.x===0n&&$.y===0n?p.ZERO:new p($.x,$.y,1n)}static fromHex($){$=J8($);let J=void 0;const Q=$[0],q=$.subarray(1),Y=aQ(q,0,32),W=$.length;if(W===33&&[2,3].includes(Q)){if(!aJ(Y))h("Point hex invalid: x not FE");let D=rY(rQ(Y));const X=(D&1n)===1n;if((Q&1)===1!==X)D=w(-D);J=new p(Y,D,1n)}if(W===65&&Q===4)J=new p(Y,aQ(q,32,64),1n);return J?J.ok():h("Point is not on curve")}static fromPrivateKey($){return A0.mul(tY($))}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}=tQ($),X=w(J*D),A=w(Y*q),I=w(Q*D),G=w(W*q);return X===A&&I===G}negate(){return new p(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}=tQ($),{a:X,b:A}=Yq;let I=0n,G=0n,K=0n;const U=w(A*3n);let z=w(J*Y),Z=w(Q*W),N=w(q*D),O=w(J+Q),V=w(Y+W);O=w(O*V),V=w(z+Z),O=w(O-V),V=w(J+q);let j=w(Y+D);return V=w(V*j),j=w(z+N),V=w(V-j),j=w(Q+q),I=w(W+D),j=w(j*I),I=w(Z+N),j=w(j-I),K=w(X*V),I=w(U*N),K=w(I+K),I=w(Z-K),K=w(Z+K),G=w(I*K),Z=w(z+z),Z=w(Z+z),N=w(X*N),V=w(U*V),Z=w(Z+N),N=w(z-N),N=w(X*N),V=w(V+N),z=w(Z*V),G=w(G+z),z=w(j*V),I=w(O*I),I=w(I-z),z=w(O*Z),K=w(j*K),K=w(K+z),new p(I,G,K)}mul($,J=!0){if(!J&&$===0n)return m0;if(!Dq($))h("invalid scalar");if(this.equals(A0))return $9($).p;let Q=m0,q=A0;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=Aq(Q);if(w(Q*q)!==1n)h("invalid inverse");return{x:w($*q),y:w(J*q)}}assertValidity(){const{x:$,y:J}=this.aff();if(!aJ($)||!aJ(J))h("Point invalid: x or y");return w(J*J)===rQ($)?this:h("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")+sQ(J)+($?"":sQ(Q))}toRawBytes($=!0){return n0(this.toHex($))}}p.BASE=new p(Qq,qq,1n);p.ZERO=new p(0n,1n,0n);var{BASE:A0,ZERO:m0}=p,Xq=($,J)=>$.toString(16).padStart(J,"0"),Q8=($)=>Array.from($).map((J)=>Xq(J,2)).join(""),n0=($)=>{const J=$.length;if(!Wq($)||J%2)h("hex invalid 1");const Q=I0(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)h("hex invalid 2");Q[q]=D}return Q},i0=($)=>BigInt("0x"+(Q8($)||"0")),aQ=($,J,Q)=>i0($.slice(J,Q)),q8=($)=>{return p0($)&&$>=0n&&$<eJ?n0(Xq($,64)):h("bigint expected")},sQ=($)=>Q8(q8($)),eQ=(...$)=>{const J=I0($.reduce((q,Y)=>q+sJ(Y).length,0));let Q=0;return $.forEach((q)=>{J.set(q,Q),Q+=q.length}),J},Aq=($,J=b$)=>{if($===0n||J<=0n)h("no inverse n="+$+" mod="+J);let Q=w($,J),q=J,Y=0n,W=1n,D=1n,X=0n;while(Q!==0n){const A=q/Q,I=q%Q,G=Y-D*A,K=W-X*A;q=Q,Q=I,Y=D,W=X,D=G,X=K}return q===1n?w(Y,J):h("no inverse")},rY=($)=>{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:h("sqrt invalid")},tY=($)=>{if(!p0($))$=i0(J8($,32));return Dq($)?$:h("private key out of range")};var $q=()=>typeof globalThis==="object"&&("crypto"in globalThis)?globalThis.crypto:void 0,d0;var aY=($)=>{$=J8($);const J=40;if($.length<J||$.length>1024)h("expected proper params");const Q=w(i0($),$8-1n)+1n;return q8(Q)},sY={hexToBytes:n0,bytesToHex:Q8,concatBytes:eQ,bytesToNumberBE:i0,numberToBytesBE:q8,mod:w,invert:Aq,hmacSha256Async:async($,...J)=>{const Q=$q(),q=Q&&Q.subtle;if(!q)return h("etc.hmacSha256Async not set");const Y=await q.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return I0(await q.sign("HMAC",Y,eQ(...J)))},hmacSha256Sync:d0,hashToPrivateKey:aY,randomBytes:($=32)=>{const J=$q();if(!J||!J.getRandomValues)h("crypto.getRandomValues must be defined");return J.getRandomValues(I0($))}};Object.defineProperties(sY,{hmacSha256Sync:{configurable:!1,get(){return d0},set($){if(!d0)d0=$}}});var F$=8,eY=()=>{const $=[],J=256/F$+1;let Q=A0,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 $},Jq=void 0,$9=($)=>{const J=Jq||(Jq=eY()),Q=(G,K)=>{let U=K.negate();return G?U:K};let q=m0,Y=A0;const W=1+256/F$,D=2**(F$-1),X=BigInt(2**F$-1),A=2**F$,I=BigInt(F$);for(let G=0;G<W;G++){const K=G*D;let U=Number($&X);if($>>=I,U>D)U-=A,$+=1n;const z=K,Z=K+Math.abs(U)-1,N=G%2!==0,O=U<0;if(U===0)Y=Y.add(Q(N,J[z]));else q=q.add(Q(O,J[Z]))}return{p:q,f:Y}};var Iq=($)=>Uint8Array.from(atob($),(J)=>J.charCodeAt(0)),Zq=($)=>btoa(String.fromCodePoint.apply(null,Array.from($)));function J9($,J,Q){const q=Q9(Q);return tJ({address:q,keyId:J,async signMessage({message:Y}){const W=await $.authenticateAndSign(J,_J(Y)),D=Y8(W);return X0(D)},async signTransaction(Y,W){const D=W?.serializer||xJ,X=(()=>{if(Y.type==="eip4844")return{...Y,sidecars:!1};return Y})(),A=await $.authenticateAndSign(J,c(D(X))),I=Y8(A);return console.log("GENERATED SIGN ",I),D(Y,I)},async signTypedData(Y){const W=await $.authenticateAndSign(J,kJ(Y)),D=Y8(W);return X0(D)}})}var Q9=function($){if($.startsWith("0x"))$=$.slice(2);if($.startsWith("04"))return b0(`0x${$} `);else if($.startsWith("02")||$.startsWith("03")){const J=p.fromHex($).toHex(!1);return b0(`0x${J}`)}else throw new Error("Invalid public key")},Y8=function($){const J=$.sign,Q=Iq(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 D9=function($,J){const Q={t:$.t,n:$.n,key_label:$.key_label,metadata:[]};return{types:{EIP712Domain:Kq,...Y9},domain:Gq,primaryType:"Request",message:{setup:Q,challenge:J}}},X9=function($,J){return{types:{EIP712Domain:Kq,...W9},domain:Gq,primaryType:"Request",message:{setup:$,challenge:J}}};async function Nq({setup:$,user_id:J,challenge:Q,browserWallet:q}){let Y;if(K0($))console.log("Creating Sign request"),Y=X9($,Q);else console.log("Creating Keygen request"),Y=D9($,Q);console.log("typed request:"),console.log(JSON.stringify(Y,void 0,4));const W=await q.signTypedData(J,Y);return console.log("User signed a request",W),{credentials:{credentials:J,method:"eoa",id:"id"},signature:W}}var q9=[{name:"tag",type:"uint16"},{name:"value",type:"string"}],Y9={Request:[{name:"setup",type:"KeygenSetupOpts"},{name:"challenge",type:"string"}],KeygenSetupOpts:[{name:"t",type:"uint32"},{name:"n",type:"uint32"},{name:"metadata",type:"TaggedValue[]"}],TaggedValue:q9},W9={Request:[{name:"setup",type:"SignSetupOpts"},{name:"challenge",type:"string"}],SignSetupOpts:[{name:"t",type:"uint32"},{name:"key_id",type:"string"},{name:"message",type:"string"}]},Gq={name:"SilentShard authentication",version:"0.1.0"},Kq=[{name:"name",type:"string"},{name:"version",type:"string"}];var W8;(function(Q){Q[Q["EOA"]=0]="EOA";Q[Q["NONE"]=1]="NONE"})(W8||(W8={}));class Mq{userId;browserWallet;wpClient;constructor($,J,Q){this.userId=$,this.browserWallet=J,this.wpClient=Q}async authenticate({setup:$,challenge:J}){return await Nq({setup:$,user_id:this.userId,challenge:J,browserWallet:this.browserWallet})}}var y;(function(Y){Y[Y["initiated"]=0]="initiated";Y[Y["waitingForSign"]=1]="waitingForSign";Y[Y["waitingForResult"]=2]="waitingForResult";Y[Y["finished"]=3]="finished"})(y||(y={}));class Vq{walletProviderId;walletProviderUrl;constructor($){this.walletProviderId=$.walletProviderId,this.walletProviderUrl=$.walletProviderUrl}getWalletId(){return this.walletProviderId}async startKeygen({setup:$,signer:J}){return this.connect($,J).then((Q)=>Q)}async startSigngen({setup:$,signer:J}){return this.connect($,J).then((Q)=>Q)}connect($,J){return new Promise((Q,q)=>{let Y=y.initiated,W;if(K0($))W="signgen",$.message=Zq((new TextEncoder()).encode($.message));else W="keygen";const D=new WebSocket(`${this.walletProviderUrl}/${W}`);D.addEventListener("open",(X)=>{switch(console.log(`Connection opened in state ${Y} with event ${JSON.stringify(X,void 0,"\t")}`),Y){case y.initiated:Y=y.waitingForSign,console.log(`Sending setup: ${JSON.stringify($)}`),D.send(JSON.stringify($));break;case y.waitingForSign:case y.waitingForResult:Y=y.finished,q("Incorrect protocol state");break;case y.finished:break}}),D.addEventListener("message",async(X)=>{switch(console.log(`Connection message in state ${Y} with event ${JSON.stringify(X,void 0,"\t")}`),Y){case y.initiated:Y=y.finished,q("Incorrect protocol state");break;case y.waitingForSign:{Y=y.waitingForResult;const A=await J(X.data);console.log(`Sending signature: ${JSON.stringify(A)}`),D.send(JSON.stringify(A));break}case y.waitingForResult:Y=y.finished,D.close(),Q(X.data);break;case y.finished:break}}),D.addEventListener("error",(X)=>{if(console.log(`Connection error in state ${Y} with event ${JSON.stringify(X,void 0,"\t")}`),Y!=y.finished)Y=y.finished,q("Incorrect protocol state")}),D.addEventListener("close",(X)=>{if(console.log(`Connection closed in state ${Y} with event ${JSON.stringify(X,void 0,"\t")}`),Y!=y.finished)Y=y.finished,q("Incorrect protocol state")})})}}export{J9 as createViemAccount,Vq as WalletProviderServiceClient,I8 as NetworkSigner,r0 as KeygenSetupOpts,Mq as EOAAuth,W8 as AuthMethod};
|
package/dist/networkSigner.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { AuthModule, UserAuthentication } from './authentication.ts';
|
|
2
|
-
import { type IWalletProviderServiceClient } from './
|
|
3
|
-
export declare enum HashAlgo {
|
|
4
|
-
SHA256 = "sha256",
|
|
5
|
-
SHA256D = "sha256d",
|
|
6
|
-
NO_HASH = "nohash"
|
|
7
|
-
}
|
|
2
|
+
import { type IWalletProviderServiceClient } from './walletProviderServiceClientInterface.ts';
|
|
8
3
|
export interface KeygenResponse {
|
|
9
4
|
key_id: string;
|
|
10
5
|
public_key: string;
|
|
@@ -14,14 +9,22 @@ export interface SignResponse {
|
|
|
14
9
|
recid?: number;
|
|
15
10
|
preSignId?: string;
|
|
16
11
|
}
|
|
17
|
-
export
|
|
12
|
+
export declare class KeygenSetupOpts {
|
|
18
13
|
t: number;
|
|
19
14
|
n: number;
|
|
20
|
-
|
|
15
|
+
key_label?: string;
|
|
16
|
+
metadata: [number, string][];
|
|
17
|
+
constructor({ t, n, key_label, permissions }: {
|
|
18
|
+
t: number;
|
|
19
|
+
n: number;
|
|
20
|
+
key_label?: string;
|
|
21
|
+
permissions?: string;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
21
24
|
export type SignSetupOpts = {
|
|
22
|
-
|
|
25
|
+
t: number;
|
|
23
26
|
key_id: string;
|
|
24
|
-
|
|
27
|
+
message: string;
|
|
25
28
|
};
|
|
26
29
|
export declare function isSignSetupOpts(params: KeygenSetupOpts | SignSetupOpts): params is SignSetupOpts;
|
|
27
30
|
export type UserAuthenticatedRequest<T> = {
|
|
@@ -36,7 +39,7 @@ export declare class NetworkSigner {
|
|
|
36
39
|
ttl: number;
|
|
37
40
|
wp_client: IWalletProviderServiceClient;
|
|
38
41
|
constructor(wp_client: IWalletProviderServiceClient, threshold: number, totalNodes: number, authModule: AuthModule, ttl?: number);
|
|
39
|
-
authenticateAndCreateKey(): Promise<KeygenResponse>;
|
|
40
|
-
authenticateAndSign(keyId: string,
|
|
42
|
+
authenticateAndCreateKey(permissions?: string): Promise<KeygenResponse>;
|
|
43
|
+
authenticateAndSign(keyId: string, message: string): Promise<SignResponse>;
|
|
41
44
|
}
|
|
42
45
|
//# sourceMappingURL=networkSigner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networkSigner.d.ts","sourceRoot":"","sources":["../src/networkSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,
|
|
1
|
+
{"version":3,"file":"networkSigner.d.ts","sourceRoot":"","sources":["../src/networkSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAU,KAAK,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAEtG,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,qBAAa,eAAe;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;gBAEjB,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;CAUjH;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAGF,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,GAAG,MAAM,IAAI,aAAa,CAEhG;AAGD,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,mBAAmB,EAAE,kBAAkB,CAAC;IAExC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,qBAAa,aAAa;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,4BAA4B,CAAC;gBAGtC,SAAS,EAAE,4BAA4B,EACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,UAAU,EACtB,GAAG,GAAE,MAAW;IAcZ,wBAAwB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAuBvE,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAejF"}
|
package/dist/viemSigner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viemSigner.d.ts","sourceRoot":"","sources":["../src/viemSigner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B,OAAO,
|
|
1
|
+
{"version":3,"file":"viemSigner.d.ts","sourceRoot":"","sources":["../src/viemSigner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,YAAY,CAmCnH"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface IWalletProviderServiceClient {
|
|
1
|
+
import { type KeygenSetupOpts, type KeygenResponse, type SignSetupOpts, type SignResponse } from './networkSigner';
|
|
2
|
+
import { type ClientConfig, IWalletProviderServiceClient, type Signer } from './walletProviderServiceClientInterface';
|
|
3
|
+
export declare class WalletProviderServiceClient implements IWalletProviderServiceClient {
|
|
4
|
+
walletProviderId: string;
|
|
5
|
+
walletProviderUrl: string;
|
|
6
|
+
constructor(config: ClientConfig);
|
|
8
7
|
getWalletId(): string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
startKeygen({ setup, signer }: {
|
|
9
|
+
setup: KeygenSetupOpts;
|
|
10
|
+
signer: Signer;
|
|
11
|
+
}): Promise<KeygenResponse>;
|
|
12
|
+
startSigngen({ setup, signer }: {
|
|
13
|
+
setup: SignSetupOpts;
|
|
14
|
+
signer: Signer;
|
|
15
|
+
}): Promise<SignResponse>;
|
|
16
|
+
connect(params: KeygenSetupOpts | SignSetupOpts, signer: Signer): Promise<KeygenResponse | SignResponse>;
|
|
13
17
|
}
|
|
14
18
|
//# sourceMappingURL=walletProviderServiceClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletProviderServiceClient.d.ts","sourceRoot":"","sources":["../src/walletProviderServiceClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"walletProviderServiceClient.d.ts","sourceRoot":"","sources":["../src/walletProviderServiceClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,YAAY,EAAE,4BAA4B,EAAE,KAAK,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAStH,qBAAa,2BAA4B,YAAW,4BAA4B;IAC9E,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;gBAEd,MAAM,EAAE,YAAY;IAKhC,WAAW,IAAI,MAAM;IAIf,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAAE,KAAK,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAInG,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAItG,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,YAAY,CAAC;CAkFzG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UserAuthentication } from './authentication';
|
|
2
|
+
import { KeygenResponse, KeygenSetupOpts, SignResponse, SignSetupOpts } from './networkSigner';
|
|
3
|
+
export type ClientConfig = {
|
|
4
|
+
walletProviderId: string;
|
|
5
|
+
walletProviderUrl: string;
|
|
6
|
+
secretKey: string;
|
|
7
|
+
};
|
|
8
|
+
export type Signer = (challenge: string) => Promise<UserAuthentication>;
|
|
9
|
+
export interface IWalletProviderServiceClient {
|
|
10
|
+
getWalletId(): string;
|
|
11
|
+
startKeygen({ setup, signer }: {
|
|
12
|
+
setup: KeygenSetupOpts;
|
|
13
|
+
signer: Signer;
|
|
14
|
+
}): Promise<KeygenResponse>;
|
|
15
|
+
startSigngen({ setup, signer }: {
|
|
16
|
+
setup: SignSetupOpts;
|
|
17
|
+
signer: Signer;
|
|
18
|
+
}): Promise<SignResponse>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=walletProviderServiceClientInterface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletProviderServiceClientInterface.d.ts","sourceRoot":"","sources":["../src/walletProviderServiceClientInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE/F,MAAM,MAAM,YAAY,GAAG;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAExE,MAAM,WAAW,4BAA4B;IAC3C,WAAW,IAAI,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAAE,KAAK,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACpG,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAClG"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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"}
|