UNPKG

@web3auth/no-modal

Version:
2 lines 2.85 MB
/*! For license information please see noModal.umd.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NoModal=t():e.NoModal=t()}(self,()=>(()=>{var e,t,n={22:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(e,t,n)=>JSON.stringify(e,(e,n)=>{const r="bigint"==typeof n?n.toString():n;return"function"==typeof t?t(e,r):r},n)},36:(e,t,n)=>{"use strict";n.d(t,{Vw:()=>_,DO:()=>s,CC:()=>c,sd:()=>o,Fe:()=>a,Ht:()=>d,My:()=>g,uH:()=>l,Id:()=>A,qj:()=>S,O8:()=>f,aT:()=>E,aY:()=>i,po:()=>x,Ow:()=>p,fd:()=>b,ZJ:()=>T,DH:()=>u});const r="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function a(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function s(e,...t){if(!i(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");a(e.outputLen),a(e.blockLen)}function c(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function d(e,t){s(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function u(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function l(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function f(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function p(e,t){return e<<32-t|e>>>t}function h(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const b=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=h(e[t]);return e},y=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),m=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e){if(s(e),y)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=m[e[n]];return t}const v={_0:48,_9:57,A:65,F:70,a:97,f:102};function w(e){return e>=v._0&&e<=v._9?e-v._0:e>=v.A&&e<=v.F?e-(v.A-10):e>=v.a&&e<=v.f?e-(v.a-10):void 0}function E(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(y)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=w(e.charCodeAt(i)),a=w(e.charCodeAt(i+1));if(void 0===n||void 0===a){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+a}return r}function T(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e)),s(e),e}function A(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];s(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}class _{}function S(e){const t=t=>e().update(T(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function x(e=32){if(r&&"function"==typeof r.getRandomValues)return r.getRandomValues(new Uint8Array(e));if(r&&"function"==typeof r.randomBytes)return Uint8Array.from(r.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}},44:(e,t,n)=>{"use strict";n.d(t,{BI:()=>A,EB:()=>E,Iy:()=>c,Iz:()=>v,MR:()=>w,M_:()=>g,Nc:()=>u,O:()=>d,Wl:()=>O,Wq:()=>b,YE:()=>f,YF:()=>o,YW:()=>s,ZP:()=>p,_z:()=>y,d_:()=>P,dm:()=>C,fo:()=>_,gH:()=>l,j:()=>I,kE:()=>m,l3:()=>S,nK:()=>x,nM:()=>T,yy:()=>h});var r=n(7438),i=n(6943),a=n(4323);class s extends a.C{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class o extends a.C{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}a.C;class c extends a.C{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${(0,r.A)(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}}class d extends a.C{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class u extends a.C{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n"),{name:"AbiEncodingArrayLengthMismatchError"})}}class l extends a.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.E)(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class f extends a.C{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n"),{name:"AbiEncodingLengthMismatchError"})}}class p extends a.C{constructor(e,{docsPath:t}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join("\n"),{docsPath:t,name:"AbiErrorInputsNotFoundError"})}}class h extends a.C{constructor(e,{docsPath:t}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join("\n"),{docsPath:t,name:"AbiErrorNotFoundError"})}}class b extends a.C{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class y extends a.C{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class m extends a.C{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t,name:"AbiEventSignatureNotFoundError"})}}class g extends a.C{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t,name:"AbiEventNotFoundError"})}}class v extends a.C{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t,name:"AbiFunctionNotFoundError"})}}class w extends a.C{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t,name:"AbiFunctionOutputsNotFoundError"})}}class E extends a.C{constructor(e,{docsPath:t}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}}class T extends a.C{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${(0,r.B)(e.abiItem)}\`, and`,`\`${t.type}\` in \`${(0,r.B)(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class A extends a.C{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class _ extends a.C{constructor({abiItem:e,data:t,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${(0,r.A)(n,{includeName:!0})})`,`Data: ${t} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=i}}class S extends a.C{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,r.B)(e,{includeName:!0})}".`].join("\n"),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class x extends a.C{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiEncodingType"})}}class I extends a.C{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiDecodingType"})}}class C extends a.C{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n"),{name:"InvalidArrayError"})}}class P extends a.C{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n"),{name:"InvalidDefinitionTypeError"})}}class O extends a.C{constructor(e){super(`Type "${e}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}},46:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}b(e,t,a,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&b(e,"error",t,{once:!0})}(e,i)})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,s,d;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"==typeof s?s=a[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,d=u,console&&console.warn&&console.warn(d)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):h(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function b(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var d=c.length,u=h(c,d);for(n=0;n<d;++n)r(u[n],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,l(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,l(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},97:(e,t,n)=>{"use strict";n.d(t,{J:()=>A});var r=n(9740),i=n(8158),a=n(184),s=n(2558),o=n(327),c=n(5839),d=n(5864),u=n(5682),l=n(1795),f=n(6212),p=n(5874),h=n(8501),b=n(5339),y=n(4052),m=n(6702),g=n(286);const v=async({bytes:e,index:t,secp256k1VerificationFacetAddress:n})=>(0,g.p)({abi:[{inputs:[{internalType:"address",name:"_verificationFacet",type:"address"},{internalType:"bytes",name:"_owner",type:"bytes"},{internalType:"uint256",name:"_salt",type:"uint256"}],name:"createAccount",outputs:[{internalType:"contract Barz",name:"barz",type:"address"}],stateMutability:"nonpayable",type:"function"}],functionName:"createAccount",args:[n,e,t]});async function w(e,t,n,r){return e.signTypedData({domain:{chainId:Number(t),name:"Barz",verifyingContract:n,version:"v0.2.0"},types:{BarzMessage:[{name:"message",type:"bytes"}]},message:{message:r},primaryType:"BarzMessage"})}const E={secp256k1VerificationFacetAddress:"0x81b9E3689390C7e74cF526594A105Dea21a8cdD5",factoryAddress:"0x729c310186a57833f622630a16d13f710b83272a"};var T=n(2336);class A{constructor(e){(0,i.A)(this,"name",T.o0.TRUST),(0,i.A)(this,"options",void 0),this.options=e}async getSmartAccount(e){var t,n;return async function(e){const{owner:t,client:n,index:r=0n,address:i,factoryAddress:T=E.factoryAddress,secp256k1VerificationFacetAddress:A=E.secp256k1VerificationFacetAddress}=e,_=await(0,y.F)({owner:t});let S=i;const x={address:e.entryPoint?.address??u.B9,abi:l.hw,version:e.entryPoint?.version??"0.6"};let I;const C=async()=>I||(I=n.chain?n.chain.id:await(0,h.T)(n,o.T,"getChainId")({}),I),P=async()=>({factory:T,factoryData:await v({bytes:_.address,secp256k1VerificationFacetAddress:A,index:r})});return(0,f.q)({client:n,entryPoint:x,getFactoryArgs:P,async getAddress(){if(S)return S;const{factory:e,factoryData:t}=await P();return S=await(0,b.s)(n,{factory:e,factoryData:t,entryPointAddress:x.address}),S},encodeCalls:async e=>(async e=>{if(e.length>1)return(0,g.p)({abi:[{inputs:[{internalType:"address[]",name:"dest",type:"address[]"},{internalType:"uint256[]",name:"value",type:"uint256[]"},{internalType:"bytes[]",name:"func",type:"bytes[]"}],name:"executeBatch",outputs:[],stateMutability:"nonpayable",type:"function"}],functionName:"executeBatch",args:[e.map(e=>e.to),e.map(e=>e.value??0n),e.map(e=>e.data??"0x")]});const t=0===e.length?void 0:e[0];if(!t)throw new Error("No calls to encode");return(0,g.p)({abi:[{inputs:[{internalType:"address",name:"dest",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"func",type:"bytes"}],name:"execute",outputs:[],stateMutability:"nonpayable",type:"function"}],functionName:"execute",args:[t.to,t.value??0n,t.data??"0x"]})})(e),decodeCalls:async e=>(async e=>{try{const t=(0,m.J)({abi:[{inputs:[{internalType:"address[]",name:"dest",type:"address[]"},{internalType:"uint256[]",name:"value",type:"uint256[]"},{internalType:"bytes[]",name:"func",type:"bytes[]"}],name:"executeBatch",outputs:[],stateMutability:"nonpayable",type:"function"}],data:e}),n=[];for(let e=0;e<t.args[0].length;e++)n.push({to:t.args[0][e],value:t.args[1][e],data:t.args[2][e]});return n}catch(e){}const t=(0,m.J)({abi:[{inputs:[{internalType:"address",name:"dest",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"func",type:"bytes"}],name:"execute",outputs:[],stateMutability:"nonpayable",type:"function"}],data:e});return[{to:t.args[0],value:t.args[1],data:t.args[2]}]})(e),async getNonce(t){return(0,d.p)(n,{address:await this.getAddress(),entryPointAddress:x.address,key:e?.nonceKey??t?.key})},getStubSignature:async()=>"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",async sign({hash:e}){return this.signMessage({message:e})},async signMessage({message:e}){return w(_,await C(),await this.getAddress(),(0,a.A)(e))},async signTypedData(e){return w(_,await C(),await this.getAddress(),(0,s.Zh)(e))},async signUserOperation(e){const{chainId:t=await C(),...r}=e;return(0,c.l)(n,{account:_,message:{raw:(0,p.Z)({userOperation:{...r,sender:r.sender??await this.getAddress(),signature:"0x"},entryPointAddress:x.address,entryPointVersion:x.version,chainId:t})}})}})}((0,r.A)((0,r.A)((0,r.A)({},this.options||{}),{},{entryPoint:{address:(null===(t=this.options)||void 0===t||null===(t=t.entryPoint)||void 0===t?void 0:t.address)||u.B9,version:(null===(n=this.options)||void 0===n||null===(n=n.entryPoint)||void 0===n?void 0:n.version)||"0.6"}},e),{},{owner:e.walletClient,client:e.client}))}}},111:(e,t,n)=>{"use strict";n.d(t,{X9:()=>s,s7:()=>i,x8:()=>a});var r=n(8644);class i extends r.C{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class a extends r.C{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class s extends r.C{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}},113:(e,t,n)=>{"use strict";n.d(t,{DZ:()=>A,Md:()=>E,a0:()=>_,lY:()=>T});var r=n(9964),i=n(36);const a=BigInt(0),s=BigInt(1),o=BigInt(2),c=BigInt(7),d=BigInt(256),u=BigInt(113),l=[],f=[],p=[];for(let e=0,t=s,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],l.push(2*(5*r+n)),f.push((e+1)*(e+2)/2%64);let i=a;for(let e=0;e<7;e++)t=(t<<s^(t>>c)*u)%d,t&o&&(i^=s<<(s<<BigInt(e))-s);p.push(i)}const h=(0,r.lD)(p,!0),b=h[0],y=h[1],m=(e,t,n)=>n>32?(0,r.WM)(e,t,n):(0,r.P5)(e,t,n),g=(e,t,n)=>n>32?(0,r.im)(e,t,n):(0,r.B4)(e,t,n);class v extends i.Vw{constructor(e,t,n,r=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=a,(0,i.Fe)(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.DH)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.fd)(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,a=n[i],s=n[i+1],o=m(a,s,1)^n[r],c=g(a,s,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=f[n],a=m(t,i,r),s=g(t,i,r),o=l[n];t=e[o],i=e[o+1],e[o]=a,e[o+1]=s}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=b[r],e[1]^=y[r]}(0,i.uH)(n)}(this.state32,this.rounds),(0,i.fd)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.CC)(this),e=(0,i.ZJ)(e),(0,i.DO)(e);const{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){const a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){(0,i.CC)(this,!1),(0,i.DO)(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.Fe)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.Ht)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.uH)(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:a}=this;return e||(e=new v(t,n,r,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=a,e.destroyed=this.destroyed,e}}const w=(e,t,n)=>(0,i.qj)(()=>new v(t,e,n)),E=(()=>w(1,144,28))(),T=(()=>w(1,136,32))(),A=(()=>w(1,104,48))(),_=(()=>w(1,72,64))()},124:(e,t,n)=>{var r=n(9907);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(7891)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},145:(e,t,n)=>{"use strict";n.d(t,{J:()=>c});var r=n(339),i=n(286),a=n(3747),s=n(8501),o=n(6067);async function c(e,t){const{abi:n,address:c,args:d,functionName:u,...l}=t,f=(0,i.p)({abi:n,args:d,functionName:u});try{const{data:t}=await(0,s.T)(e,o.T,"call")({...l,data:f,to:c});return(0,r.e)({abi:n,args:d,functionName:u,data:t||"0x"})}catch(e){throw(0,a.j)(e,{abi:n,address:c,args:d,docsPath:"/docs/contract/readContract",functionName:u})}}},162:(e,t,n)=>{"use strict";function r(e){return Array.prototype.slice.call(window.document.querySelectorAll("script")).find(function(t){return t.src===e})}function i(e,t){var n=r(e);if(void 0!==n){var i=null==n?void 0:n.getAttribute("status");if("loaded"===i)return Promise.resolve(n);if("loading"===i)return new Promise(function(e,t){n.addEventListener("load",function(){return e(n)}),n.addEventListener("error",function(e){return t(e)})})}return new Promise(function(n,r){var i,a=window.document.createElement("script");a.type="text/javascript",a.src=e,a.async=!0,a.setAttribute("status","loading");for(var s=0,o=Object.entries(null!=t?t:{});s<o.length;s++){var c=o[s],d=c[0],u=c[1];a.setAttribute(d,u)}a.onload=function(){a.onerror=a.onload=null,a.setAttribute("status","loaded"),n(a)},a.onerror=function(){a.onerror=a.onload=null,a.setAttribute("status","error"),r(new Error("Failed to load ".concat(e)))};var l=window.document.querySelector("script");l?null===(i=l.parentElement)||void 0===i||i.insertBefore(a,l):window.document.head.appendChild(a)})}function a(e){var t=r(e);return void 0!==t&&t.remove(),Promise.resolve()}n.d(t,{d:()=>a,k:()=>i})},183:e=>{"use strict";e.exports={rE:"6.6.1"}},184:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(9555);const i="Ethereum Signed Message:\n";var a=n(666),s=n(6943),o=n(8903);function c(e,t){return(0,r.S)(function(e){const t="string"==typeof e?(0,o.i3)(e):"string"==typeof e.raw?e.raw:(0,o.My)(e.raw),n=(0,o.i3)(`${i}${(0,s.E)(t)}`);return(0,a.xW)([n,t])}(e),t)}},204:(e,t,n)=>{"use strict";n.d(t,{O:()=>d,_:()=>c});var r=n(6237),i=n(8501),a=n(8775),s=n(4846),o=n(6761);async function c(e,t){return d(e,t)}async function d(e,t){const{block:n,chain:c=e.chain,request:d,type:u="eip1559"}=t||{},l=await(async()=>"function"==typeof c?.fees?.baseFeeMultiplier?c.fees.baseFeeMultiplier({block:n,client:e,request:d}):c?.fees?.baseFeeMultiplier??1.2)();if(l<1)throw new r.sM;const f=10**(l.toString().split(".")[1]?.length??0),p=e=>e*BigInt(Math.ceil(l*f))/BigInt(f),h=n||await(0,i.T)(e,s.g,"getBlock")({});if("function"==typeof c?.fees?.estimateFeesPerGas){const t=await c.fees.estimateFeesPerGas({block:n,client:e,multiply:p,request:d,type:u});if(null!==t)return t}if("eip1559"===u){if("bigint"!=typeof h.baseFeePerGas)throw new r.pw;const t="bigint"==typeof d?.maxPriorityFeePerGas?d.maxPriorityFeePerGas:await(0,a.N)(e,{block:h,chain:c,request:d}),n=p(h.baseFeePerGas);return{maxFeePerGas:d?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:d?.gasPrice??p(await(0,i.T)(e,o.L,"getGasPrice")({}))}}},247:(e,t,n)=>{"use strict";n.r(t),n.d(t,{remoteMiddlewares:()=>o});var r=n(5608),i=n(8730),a=n(162),s=n(4695);function o(e,t,n){var o;return(0,r.sH)(this,void 0,void 0,function(){var c,d,u,l,f=this;return(0,r.YH)(this,function(p){switch(p.label){case 0:return(0,i.S)()?[2,[]]:(c=(0,s.YM)(),d=null!==(o=t.enabledMiddleware)&&void 0!==o?o:{},u=Object.entries(d).filter(function(e){return e[0],e[1]}).map(function(e){return e[0]}),l=u.map(function(t){return(0,r.sH)(f,void 0,void 0,function(){var i,s,o,d;return(0,r.YH)(this,function(r){switch(r.label){case 0:i=t.replace("@segment/",""),s=i,n&&(s=btoa(i).replace(/=/g,"")),o="".concat(c,"/middleware/").concat(s,"/latest/").concat(s,".js.gz"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,a.k)(o)];case 2:return r.sent(),[2,window["".concat(i,"Middleware")]];case 3:return d=r.sent(),e.log("error",d),e.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}})})}),[4,Promise.all(l)]);case 1:return[2,p.sent().filter(Boolean)]}})})}},253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0,t.IWatch=class{}},273:e=>{"use strict";class t extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:t,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,n)=>e.slice(t,n),Error,FunctionPrototypeCall:(e,t,...n)=>e.call(t,...n),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,n)=>Object.defineProperty(e,t,n),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,n)=>e.then(t,n),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,n)=>e.slice(t,n),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,n)=>e.set(t,n),Boolean,Uint8Array}},277:(e,t,n)=>{"use strict";var r=n(1874),i=n(2823),a=n(5615),s=n(5174),o=r.assert;function c(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(e,t,n,r){s.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,n,r){s.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(n,16),this.z=new i(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)n=new i(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?n=a[0]:(n=a[1],o(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(n)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),n=new i(2).toRed(t).redInvm(),r=n.redNeg(),a=new i(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(a).fromRed(),r.redSub(a).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,n,r,a,s,o,c,d,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,p=this.n.clone(),h=new i(1),b=new i(0),y=new i(0),m=new i(1),g=0;0!==f.cmpn(0);){var v=p.div(f);d=p.sub(v.mul(f)),u=y.sub(v.mul(h));var w=m.sub(v.mul(b));if(!r&&d.cmp(l)<0)t=c.neg(),n=h,r=d.neg(),a=u;else if(r&&2===++g)break;c=d,p=f,f=d,y=h,h=u,m=b,b=w}s=d.neg(),o=u;var E=r.sqr().add(a.sqr());return s.sqr().add(o.sqr()).cmp(E)>=0&&(s=t,o=n),r.negative&&(r=r.neg(),a=a.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:r,b:a},{a:s,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),s=i.mul(n.a),o=a.mul(r.a),c=i.mul(n.b),d=a.mul(r.b);return{k1:e.sub(s).sub(o),k2:c.add(d).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var a=r.fromRed().isOdd();return(t&&!a||!t&&a)&&(r=r.redNeg()),this.point(e,r)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(t[a]),o=e[a],c=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),r[2*a]=o,r[2*a+1]=c,i[2*a]=s.k1,i[2*a+1]=s.k2}for(var d=this._wnafMulAdd(1,r,i,2*a,n),u=0;u<2*a;u++)r[u]=null,i[u]=null;return d},a(d,s.BasePoint),c.prototype.point=function(e,t,n){return new d(this,e,t,n)},c.prototype.pointFromJSON=function(e,t){return d.fromJSON(this,e,t)},d.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},d.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},d.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var a=t[2];return r.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[r].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[r].concat(a.naf.points.map(i))}},r},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},d.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),a=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},d.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},d.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},d.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(u,s.BasePoint),c.prototype.jpoint=function(e,t,n){return new u(this,e,t,n)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(n.redMul(this.z)),o=r.redSub(i),c=a.redSub(s);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=o.redSqr(),u=d.redMul(o),l=r.redMul(d),f=c.redSqr().redIAdd(u).redISub(l).redISub(l),p=c.redMul(l.redISub(f)).redISub(a.redMul(u)),h=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(f,p,h)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),s=n.redSub(r),o=i.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),d=c.redMul(s),u=n.redMul(c),l=o.redSqr().redIAdd(d).redISub(u).redISub(u),f=o.redMul(u.redISub(l)).redISub(i.redMul(d)),p=this.z.redMul(s);return this.curve.jpoint(l,f,p)},u.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,a=this.x,s=this.y,o=this.z,c=o.redSqr().redSqr(),d=s.redAdd(s);for(t=0;t<e;t++){var u=a.redSqr(),l=d.redSqr(),f=l.redSqr(),p=u.redAdd(u).redIAdd(u).redIAdd(r.redMul(c)),h=a.redMul(l),b=p.redSqr().redISub(h.redAdd(h)),y=h.redISub(b),m=p.redMul(y);m=m.redIAdd(m).redISub(f);var g=d.redMul(o);t+1<e&&(c=c.redMul(f)),a=b,o=g,d=m}return this.curve.jpoint(a,d.redMul(i),o)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(r).redISub(a);s=s.redIAdd(s);var o=r.redAdd(r).redIAdd(r),c=o.redSqr().redISub(s).redISub(s),d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),e=c,t=o.redMul(s.redISub(c)).redISub(d),n=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),l=this.y.redSqr(),f=l.redSqr(),p=this.x.redAdd(l).redSqr().redISub(u).redISub(f);p=p.redIAdd(p);var h=u.redAdd(u).redIAdd(u),b=h.redSqr(),y=f.redIAdd(f);y=(y=y.redIAdd(y)).redIAdd(y),e=b.redISub(p).redISub(p),t=h.redMul(p.redISub(e)).redISub(y),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},u.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(r).redISub(a);s=s.redIAdd(s);var o=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),c=o.redSqr().redISub(s).redISub(s);e=c;var d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),t=o.redMul(s.redISub(c)).redISub(d),n=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),l=this.y.redSqr(),f=this.x.redMul(l),p=this.x.redSub(u).redMul(this.x.redAdd(u));p=p.redAdd(p).redIAdd(p);var h=f.redIAdd(f),b=(h=h.redIAdd(h)).redAdd(h);e=p.redSqr().redISub(b),n=this.y.redAdd(this.z).redSqr().redISub(l).redISub(u);var y=l.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),t=p.redMul(h.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,n)},u.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),a=t.redSqr(),s=n.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),c=t.redAdd(t),d=(c=c.redIAdd(c)).redMul(s),u=o.redSqr().redISub(d.redAdd(d)),l=d.redISub(u),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var p=o.redMul(l).redISub(f),h=n.redAdd(n).redMul(r);return this.curve.jpoint(u,p,h)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(r),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),c=r.redIAdd(r);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=i.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(c),u=t.redMul(d);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.x.redMul(o).redISub(u);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.y.redMul(d.redMul(c.redISub(d)).redISub(s.redMul(o)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var p=this.z.redAdd(s).redSqr().redISub(n).redISub(o);return this.curve.jpoint(l,f,p)},u.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},u.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},u.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},286:(e,t,n)=>{"use strict";n.d(t,{p:()=>u});var r=n(666),i=n(8470),a=n(44),s=n(7190),o=n(7438),c=n(8390);const d="/docs/contract/encodeFunctionData";function u(e){const{args:t}=e,{abi:n,functionName:u}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){const{abi:t,args:n,functionName:r}=e;let i=t[0];if(r){const e=(0,c.iY)({abi:t,args:n,name:r});if(!e)throw new a.Iz(r,{docsPath:d});i=e}if("function"!==i.type)throw new a.Iz(void 0,{docsPath:d});return{abi:[i],functionName:(0,s.V)((0,o.B)(i))}}(e),l=n[0],f=u,p="inputs"in l&&l.inputs?(0,i.h)(l.inputs,t??[]):void 0;return(0,r.aP)([f,p??"0x"])}},288:(e,t,n)=>{var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n.g&&n.g,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==n.g&&n.g||{},i="URLSearchParams"in r,a="Symbol"in r&&"iterator"in Symbol,s="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in r,c="ArrayBuffer"in r;if(c)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&d.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function b(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function y(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function m(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&s&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content