@dcl/vesting-dashboard 3.5.0 → 3.5.1-12673527432.commit-460bd01
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/assets/{fortmatic-791bdc81.js → fortmatic-9c696318.js} +1 -1
- package/assets/{index-d9381e59.js → index-3cd7d6d5.js} +1 -1
- package/assets/{index-f362c400.js → index-3cf5371a.js} +1 -1
- package/assets/{index-3594f7e6.js → index-68c80c29.js} +1 -1
- package/assets/{index-6270079b.js → index-6d2c795c.js} +5 -5
- package/assets/{index-04cdb9e3.js → index-88136dd0.js} +1 -1
- package/assets/{index-755f14fc.css → index-a5bcbbe8.css} +7 -7
- package/assets/{index-daeedd19.js → index-e93a944d.js} +1 -1
- package/assets/{index-6333032a.js → index-ef7b353b.js} +1 -1
- package/assets/{index.es-12fce34a.js → index.es-cf70ba0e.js} +2 -2
- package/index.html +4 -4
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as dh,k as Jw,c as Yw,p as Di,g as Xw,a as Zw,r as Qw,b as e2,d as _r,m as t2,u as r2,i as ru,h as qp,e as Up,f as i2,j as Fe,B as Ai,l as n2,n as ui,o as Bp,q as iu,s as Il,_ as s2}from"./index-
|
|
1
|
+
import{t as dh,k as Jw,c as Yw,p as Di,g as Xw,a as Zw,r as Qw,b as e2,d as _r,m as t2,u as r2,i as ru,h as qp,e as Up,f as i2,j as Fe,B as Ai,l as n2,n as ui,o as Bp,q as iu,s as Il,_ as s2}from"./index-6d2c795c.js";const a2=`Ethereum Signed Message:
|
|
2
2
|
`;function zp(r){return typeof r=="string"&&(r=dh(r)),Jw(Yw([dh(a2),dh(String(r.length)),r]))}var Dl=globalThis&&globalThis.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,o;n<s;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))},o2=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}(),c2=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=Di.platform}return r}(),f2=function(){function r(e,t,n,s){this.name=e,this.version=t,this.os=n,this.bot=s,this.type="bot-device"}return r}(),h2=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),u2=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),d2=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,l2=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Al=3,p2=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",d2]],Pl=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function g2(r){return r?Ml(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new u2:typeof navigator<"u"?Ml(navigator.userAgent):m2()}function b2(r){return r!==""&&p2.reduce(function(e,t){var n=t[0],s=t[1];if(e)return e;var o=s.exec(r);return!!o&&[n,o]},!1)}function Ml(r){var e=b2(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new h2;var s=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);s?s.length<Al&&(s=Dl(Dl([],s,!0),y2(Al-s.length),!0)):s=[];var o=s.join("."),f=v2(r),h=l2.exec(r);return h&&h[1]?new f2(t,o,f,h[1]):new o2(t,o,f)}function v2(r){for(var e=0,t=Pl.length;e<t;e++){var n=Pl[e],s=n[0],o=n[1],f=o.exec(r);if(f)return s}return null}function m2(){var r=typeof Di<"u"&&Di.version;return r?new c2(Di.version.slice(1)):null}function y2(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var pe={};/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -46,4 +46,4 @@ __p += '`),mt&&(ue+=`' +
|
|
|
46
46
|
function print() { __p += __j.call(arguments, '') }
|
|
47
47
|
`:`;
|
|
48
48
|
`)+ue+`return __p
|
|
49
|
-
}`;var ot=El(function(){return wt(C,Pe+"return "+ue).apply(t,B)});if(ot.source=ue,th(ot))throw ot;return ot}function rw(i){return Et(i).toLowerCase()}function iw(i){return Et(i).toUpperCase()}function nw(i,a,c){if(i=Et(i),i&&(c||a===t))return Cu(i);if(!i||!(a=Kr(a)))return i;var g=mi(i),S=mi(a),C=Ru(g,S),B=Tu(g,S)+1;return _n(g,C,B).join("")}function sw(i,a,c){if(i=Et(i),i&&(c||a===t))return i.slice(0,$u(i)+1);if(!i||!(a=Kr(a)))return i;var g=mi(i),S=Tu(g,mi(a))+1;return _n(g,0,S).join("")}function aw(i,a,c){if(i=Et(i),i&&(c||a===t))return i.replace(Ft,"");if(!i||!(a=Kr(a)))return i;var g=mi(i),S=Ru(g,mi(a));return _n(g,S).join("")}function ow(i,a){var c=de,g=L;if(Kt(a)){var S="separator"in a?a.separator:S;c="length"in a?at(a.length):c,g="omission"in a?Kr(a.omission):g}i=Et(i);var C=i.length;if(Ds(i)){var B=mi(i);C=B.length}if(c>=C)return i;var W=c-As(g);if(W<1)return g;var Q=B?_n(B,0,W).join(""):i.slice(0,W);if(S===t)return Q+g;if(B&&(W+=Q.length-W),rh(S)){if(i.slice(W).search(S)){var se,ae=Q;for(S.global||(S=mf(S.source,Et(vr.exec(S))+"g")),S.lastIndex=0;se=S.exec(ae);)var ue=se.index;Q=Q.slice(0,ue===t?W:ue)}}else if(i.indexOf(Kr(S),W)!=W){var ve=Q.lastIndexOf(S);ve>-1&&(Q=Q.slice(0,ve))}return Q+g}function cw(i){return i=Et(i),i&&We.test(i)?i.replace(bi,Fg):i}var fw=Ns(function(i,a,c){return i+(c?" ":"")+a.toUpperCase()}),sh=Sd("toUpperCase");function _l(i,a,c){return i=Et(i),a=c?t:a,a===t?Rg(i)?Bg(i):Sg(i):i.match(a)||[]}var El=ft(function(i,a){try{return ir(i,t,a)}catch(c){return th(c)?c:new Ke(c)}}),hw=Ji(function(i,a){return ei(a,function(c){c=Li(c),Vi(i,c,Qf(i[c],i))}),i});function uw(i){var a=i==null?0:i.length,c=Ne();return i=a?Ht(i,function(g){if(typeof g[1]!="function")throw new ti(f);return[c(g[0]),g[1]]}):[],ft(function(g){for(var S=-1;++S<a;){var C=i[S];if(ir(C[0],this,g))return ir(C[1],this,g)}})}function dw(i){return Fb(ii(i,_))}function ah(i){return function(){return i}}function lw(i,a){return i==null||i!==i?a:i}var pw=Id(),gw=Id(!0);function $r(i){return i}function oh(i){return td(typeof i=="function"?i:ii(i,_))}function bw(i){return id(ii(i,_))}function vw(i,a){return nd(i,ii(a,_))}var mw=ft(function(i,a){return function(c){return da(c,i,a)}}),yw=ft(function(i,a){return function(c){return da(i,c,a)}});function ch(i,a,c){var g=nr(a),S=Fo(a,g);c==null&&!(Kt(a)&&(S.length||!g.length))&&(c=a,a=i,i=this,S=Fo(a,nr(a)));var C=!(Kt(c)&&"chain"in c)||!!c.chain,B=Xi(i);return ei(S,function(W){var Q=a[W];i[W]=Q,B&&(i.prototype[W]=function(){var se=this.__chain__;if(C||se){var ae=i(this.__wrapped__),ue=ae.__actions__=Rr(this.__actions__);return ue.push({func:Q,args:arguments,thisArg:i}),ae.__chain__=se,ae}return Q.apply(i,gn([this.value()],arguments))})}),i}function ww(){return vt._===this&&(vt._=Wg),this}function fh(){}function _w(i){return i=at(i),ft(function(a){return sd(a,i)})}var Ew=Bf(Ht),Sw=Bf(Du),xw=Bf(uf);function Sl(i){return Vf(i)?df(Li(i)):ev(i)}function Iw(i){return function(a){return i==null?t:Xn(i,a)}}var Dw=Ad(),Aw=Ad(!0);function hh(){return[]}function uh(){return!1}function Pw(){return{}}function Mw(){return""}function Ow(){return!0}function Cw(i,a){if(i=at(i),i<1||i>R)return[];var c=A,g=mr(i,A);a=Ne(a),i-=A;for(var S=gf(g,a);++c<i;)a(c);return S}function Rw(i){return Ze(i)?Ht(i,Li):kr(i)?[i]:Rr(jd(Et(i)))}function Tw(i){var a=++Kg;return Et(i)+a}var Nw=jo(function(i,a){return i+a},0),$w=zf("ceil"),Lw=jo(function(i,a){return i/a},1),Fw=zf("floor");function qw(i){return i&&i.length?Lo(i,$r,Df):t}function Uw(i,a){return i&&i.length?Lo(i,Ne(a,2),Df):t}function Bw(i){return Mu(i,$r)}function zw(i,a){return Mu(i,Ne(a,2))}function Hw(i){return i&&i.length?Lo(i,$r,Of):t}function jw(i,a){return i&&i.length?Lo(i,Ne(a,2),Of):t}var Kw=jo(function(i,a){return i*a},1),kw=zf("round"),Ww=jo(function(i,a){return i-a},0);function Vw(i){return i&&i.length?pf(i,$r):0}function Gw(i,a){return i&&i.length?pf(i,Ne(a,2)):0}return P.after=by,P.ary=el,P.assign=i3,P.assignIn=pl,P.assignInWith=rc,P.assignWith=n3,P.at=s3,P.before=tl,P.bind=Qf,P.bindAll=hw,P.bindKey=rl,P.castArray=Py,P.chain=Xd,P.chunk=Fv,P.compact=qv,P.concat=Uv,P.cond=uw,P.conforms=dw,P.constant=ah,P.countBy=Vm,P.create=a3,P.curry=il,P.curryRight=nl,P.debounce=sl,P.defaults=o3,P.defaultsDeep=c3,P.defer=vy,P.delay=my,P.difference=Bv,P.differenceBy=zv,P.differenceWith=Hv,P.drop=jv,P.dropRight=Kv,P.dropRightWhile=kv,P.dropWhile=Wv,P.fill=Vv,P.filter=Jm,P.flatMap=Zm,P.flatMapDeep=Qm,P.flatMapDepth=ey,P.flatten=Vd,P.flattenDeep=Gv,P.flattenDepth=Jv,P.flip=yy,P.flow=pw,P.flowRight=gw,P.fromPairs=Yv,P.functions=g3,P.functionsIn=b3,P.groupBy=ty,P.initial=Zv,P.intersection=Qv,P.intersectionBy=em,P.intersectionWith=tm,P.invert=m3,P.invertBy=y3,P.invokeMap=iy,P.iteratee=oh,P.keyBy=ny,P.keys=nr,P.keysIn=Nr,P.map=Yo,P.mapKeys=_3,P.mapValues=E3,P.matches=bw,P.matchesProperty=vw,P.memoize=Zo,P.merge=S3,P.mergeWith=gl,P.method=mw,P.methodOf=yw,P.mixin=ch,P.negate=Qo,P.nthArg=_w,P.omit=x3,P.omitBy=I3,P.once=wy,P.orderBy=sy,P.over=Ew,P.overArgs=_y,P.overEvery=Sw,P.overSome=xw,P.partial=eh,P.partialRight=al,P.partition=ay,P.pick=D3,P.pickBy=bl,P.property=Sl,P.propertyOf=Iw,P.pull=sm,P.pullAll=Jd,P.pullAllBy=am,P.pullAllWith=om,P.pullAt=cm,P.range=Dw,P.rangeRight=Aw,P.rearg=Ey,P.reject=fy,P.remove=fm,P.rest=Sy,P.reverse=Xf,P.sampleSize=uy,P.set=P3,P.setWith=M3,P.shuffle=dy,P.slice=hm,P.sortBy=gy,P.sortedUniq=vm,P.sortedUniqBy=mm,P.split=Z3,P.spread=xy,P.tail=ym,P.take=wm,P.takeRight=_m,P.takeRightWhile=Em,P.takeWhile=Sm,P.tap=qm,P.throttle=Iy,P.thru=Jo,P.toArray=ul,P.toPairs=vl,P.toPairsIn=ml,P.toPath=Rw,P.toPlainObject=ll,P.transform=O3,P.unary=Dy,P.union=xm,P.unionBy=Im,P.unionWith=Dm,P.uniq=Am,P.uniqBy=Pm,P.uniqWith=Mm,P.unset=C3,P.unzip=Zf,P.unzipWith=Yd,P.update=R3,P.updateWith=T3,P.values=Fs,P.valuesIn=N3,P.without=Om,P.words=_l,P.wrap=Ay,P.xor=Cm,P.xorBy=Rm,P.xorWith=Tm,P.zip=Nm,P.zipObject=$m,P.zipObjectDeep=Lm,P.zipWith=Fm,P.entries=vl,P.entriesIn=ml,P.extend=pl,P.extendWith=rc,ch(P,P),P.add=Nw,P.attempt=El,P.camelCase=q3,P.capitalize=yl,P.ceil=$w,P.clamp=$3,P.clone=My,P.cloneDeep=Cy,P.cloneDeepWith=Ry,P.cloneWith=Oy,P.conformsTo=Ty,P.deburr=wl,P.defaultTo=lw,P.divide=Lw,P.endsWith=U3,P.eq=wi,P.escape=B3,P.escapeRegExp=z3,P.every=Gm,P.find=Ym,P.findIndex=kd,P.findKey=f3,P.findLast=Xm,P.findLastIndex=Wd,P.findLastKey=h3,P.floor=Fw,P.forEach=Zd,P.forEachRight=Qd,P.forIn=u3,P.forInRight=d3,P.forOwn=l3,P.forOwnRight=p3,P.get=ih,P.gt=Ny,P.gte=$y,P.has=v3,P.hasIn=nh,P.head=Gd,P.identity=$r,P.includes=ry,P.indexOf=Xv,P.inRange=L3,P.invoke=w3,P.isArguments=es,P.isArray=Ze,P.isArrayBuffer=Ly,P.isArrayLike=Tr,P.isArrayLikeObject=Jt,P.isBoolean=Fy,P.isBuffer=En,P.isDate=qy,P.isElement=Uy,P.isEmpty=By,P.isEqual=zy,P.isEqualWith=Hy,P.isError=th,P.isFinite=jy,P.isFunction=Xi,P.isInteger=ol,P.isLength=ec,P.isMap=cl,P.isMatch=Ky,P.isMatchWith=ky,P.isNaN=Wy,P.isNative=Vy,P.isNil=Jy,P.isNull=Gy,P.isNumber=fl,P.isObject=Kt,P.isObjectLike=kt,P.isPlainObject=ma,P.isRegExp=rh,P.isSafeInteger=Yy,P.isSet=hl,P.isString=tc,P.isSymbol=kr,P.isTypedArray=Ls,P.isUndefined=Xy,P.isWeakMap=Zy,P.isWeakSet=Qy,P.join=rm,P.kebabCase=H3,P.last=si,P.lastIndexOf=im,P.lowerCase=j3,P.lowerFirst=K3,P.lt=e3,P.lte=t3,P.max=qw,P.maxBy=Uw,P.mean=Bw,P.meanBy=zw,P.min=Hw,P.minBy=jw,P.stubArray=hh,P.stubFalse=uh,P.stubObject=Pw,P.stubString=Mw,P.stubTrue=Ow,P.multiply=Kw,P.nth=nm,P.noConflict=ww,P.noop=fh,P.now=Xo,P.pad=k3,P.padEnd=W3,P.padStart=V3,P.parseInt=G3,P.random=F3,P.reduce=oy,P.reduceRight=cy,P.repeat=J3,P.replace=Y3,P.result=A3,P.round=kw,P.runInContext=J,P.sample=hy,P.size=ly,P.snakeCase=X3,P.some=py,P.sortedIndex=um,P.sortedIndexBy=dm,P.sortedIndexOf=lm,P.sortedLastIndex=pm,P.sortedLastIndexBy=gm,P.sortedLastIndexOf=bm,P.startCase=Q3,P.startsWith=ew,P.subtract=Ww,P.sum=Vw,P.sumBy=Gw,P.template=tw,P.times=Cw,P.toFinite=Zi,P.toInteger=at,P.toLength=dl,P.toLower=rw,P.toNumber=ai,P.toSafeInteger=r3,P.toString=Et,P.toUpper=iw,P.trim=nw,P.trimEnd=sw,P.trimStart=aw,P.truncate=ow,P.unescape=cw,P.uniqueId=Tw,P.upperCase=fw,P.upperFirst=sh,P.each=Zd,P.eachRight=Qd,P.first=Gd,ch(P,function(){var i={};return Ni(P,function(a,c){xt.call(P.prototype,c)||(i[c]=a)}),i}(),{chain:!1}),P.VERSION=n,ei(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){P[i].placeholder=P}),ei(["drop","take"],function(i,a){gt.prototype[i]=function(c){c=c===t?1:tr(at(c),0);var g=this.__filtered__&&!a?new gt(this):this.clone();return g.__filtered__?g.__takeCount__=mr(c,g.__takeCount__):g.__views__.push({size:mr(c,A),type:i+(g.__dir__<0?"Right":"")}),g},gt.prototype[i+"Right"]=function(c){return this.reverse()[i](c).reverse()}}),ei(["filter","map","takeWhile"],function(i,a){var c=a+1,g=c==w||c==O;gt.prototype[i]=function(S){var C=this.clone();return C.__iteratees__.push({iteratee:Ne(S,3),type:c}),C.__filtered__=C.__filtered__||g,C}}),ei(["head","last"],function(i,a){var c="take"+(a?"Right":"");gt.prototype[i]=function(){return this[c](1).value()[0]}}),ei(["initial","tail"],function(i,a){var c="drop"+(a?"":"Right");gt.prototype[i]=function(){return this.__filtered__?new gt(this):this[c](1)}}),gt.prototype.compact=function(){return this.filter($r)},gt.prototype.find=function(i){return this.filter(i).head()},gt.prototype.findLast=function(i){return this.reverse().find(i)},gt.prototype.invokeMap=ft(function(i,a){return typeof i=="function"?new gt(this):this.map(function(c){return da(c,i,a)})}),gt.prototype.reject=function(i){return this.filter(Qo(Ne(i)))},gt.prototype.slice=function(i,a){i=at(i);var c=this;return c.__filtered__&&(i>0||a<0)?new gt(c):(i<0?c=c.takeRight(-i):i&&(c=c.drop(i)),a!==t&&(a=at(a),c=a<0?c.dropRight(-a):c.take(a-i)),c)},gt.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},gt.prototype.toArray=function(){return this.take(A)},Ni(gt.prototype,function(i,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),S=P[g?"take"+(a=="last"?"Right":""):a],C=g||/^find/.test(a);S&&(P.prototype[a]=function(){var B=this.__wrapped__,W=g?[1]:arguments,Q=B instanceof gt,se=W[0],ae=Q||Ze(B),ue=function(ut){var mt=S.apply(P,gn([ut],W));return g&&ve?mt[0]:mt};ae&&c&&typeof se=="function"&&se.length!=1&&(Q=ae=!1);var ve=this.__chain__,Pe=!!this.__actions__.length,$e=C&&!ve,ot=Q&&!Pe;if(!C&&ae){B=ot?B:new gt(this);var Le=i.apply(B,W);return Le.__actions__.push({func:Jo,args:[ue],thisArg:t}),new ri(Le,ve)}return $e&&ot?i.apply(this,W):(Le=this.thru(ue),$e?g?Le.value()[0]:Le.value():Le)})}),ei(["pop","push","shift","sort","splice","unshift"],function(i){var a=_o[i],c=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",g=/^(?:pop|shift)$/.test(i);P.prototype[i]=function(){var S=arguments;if(g&&!this.__chain__){var C=this.value();return a.apply(Ze(C)?C:[],S)}return this[c](function(B){return a.apply(Ze(B)?B:[],S)})}}),Ni(gt.prototype,function(i,a){var c=P[a];if(c){var g=c.name+"";xt.call(Cs,g)||(Cs[g]=[]),Cs[g].push({name:a,func:c})}}),Cs[Ho(t,X).name]=[{name:"wrapper",func:t}],gt.prototype.clone=cb,gt.prototype.reverse=fb,gt.prototype.value=hb,P.prototype.at=Um,P.prototype.chain=Bm,P.prototype.commit=zm,P.prototype.next=Hm,P.prototype.plant=Km,P.prototype.reverse=km,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=Wm,P.prototype.first=P.prototype.head,sa&&(P.prototype[sa]=jm),P},Ps=zg();Gt?((Gt.exports=Ps)._=Ps,Ct._=Ps):vt._=Ps}).call(_r)})(Rc,Rc.exports);var jx=Rc.exports,Kx=Object.defineProperty,kx=Object.defineProperties,Wx=Object.getOwnPropertyDescriptors,mp=Object.getOwnPropertySymbols,Vx=Object.prototype.hasOwnProperty,Gx=Object.prototype.propertyIsEnumerable,yp=(r,e,t)=>e in r?Kx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wp=(r,e)=>{for(var t in e||(e={}))Vx.call(e,t)&&yp(r,t,e[t]);if(mp)for(var t of mp(e))Gx.call(e,t)&&yp(r,t,e[t]);return r},_p=(r,e)=>kx(r,Wx(e));const Jx={Accept:"application/json","Content-Type":"application/json"},Yx="POST",Ep={headers:Jx,method:Yx},Sp=10;let Pi=class{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new ui.EventEmitter,this.isAvailable=!1,this.registering=!1,!U0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=cn(e),n=await(await Il(this.url,_p(wp({},Ep),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!U0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,s)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),s(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return s(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=cn({id:1,jsonrpc:"2.0",method:"test",params:[]});await Il(e,_p(wp({},Ep),{body:t}))}this.onOpen()}catch(t){const n=this.parseError(t);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?us(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),s=n.message||n.toString(),o=Xc(e,s);this.events.emit("payload",o)}parseError(e,t=this.url){return K1(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Sp&&this.events.setMaxListeners(Sp)}};const xp="error",Xx="wss://relay.walletconnect.org",Zx="wc",Qx="universal_provider",Ip=`${Zx}@2:${Qx}:`,pg="https://rpc.walletconnect.org/v1/",js="generic",eI=`${pg}bundler`,gi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var tI=Object.defineProperty,rI=Object.defineProperties,iI=Object.getOwnPropertyDescriptors,Dp=Object.getOwnPropertySymbols,nI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,Ap=(r,e,t)=>e in r?tI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,oc=(r,e)=>{for(var t in e||(e={}))nI.call(e,t)&&Ap(r,t,e[t]);if(Dp)for(var t of Dp(e))sI.call(e,t)&&Ap(r,t,e[t]);return r},aI=(r,e)=>rI(r,iI(e));function Yr(r,e,t){var n;const s=Ws(r);return((n=e.rpcMap)==null?void 0:n[s.reference])||`${pg}?chainId=${s.namespace}:${s.reference}&projectId=${t}`}function ys(r){return r.includes(":")?r.split(":")[1]:r}function gg(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function oI(r,e){const t=Object.keys(e.namespaces).filter(s=>s.includes(r));if(!t.length)return[];const n=[];return t.forEach(s=>{const o=e.namespaces[s].accounts;n.push(...o)}),n}function Ch(r={},e={}){const t=Pp(r),n=Pp(e);return jx.merge(t,n)}function Pp(r){var e,t,n,s;const o={};if(!La(r))return o;for(const[f,h]of Object.entries(r)){const p=mu(f)?[f]:h.chains,l=h.methods||[],m=h.events||[],_=h.rpcMap||{},D=Pa(f);o[D]=aI(oc(oc({},o[D]),h),{chains:uc(p,(e=o[D])==null?void 0:e.chains),methods:uc(l,(t=o[D])==null?void 0:t.methods),events:uc(m,(n=o[D])==null?void 0:n.events),rpcMap:oc(oc({},_),(s=o[D])==null?void 0:s.rpcMap)})}return o}function cI(r){return r.includes(":")?r.split(":")[2]:r}function Mp(r){const e={};for(const[t,n]of Object.entries(r)){const s=n.methods||[],o=n.events||[],f=n.accounts||[],h=mu(t)?[t]:n.chains?n.chains:gg(n.accounts);e[t]={chains:h,methods:s,events:o,accounts:f}}return e}function Rh(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const bg={},yt=r=>bg[r],Th=(r,e)=>{bg[r]=e};class fI{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}var hI=Object.defineProperty,uI=Object.defineProperties,dI=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,Cp=(r,e,t)=>e in r?hI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Rp=(r,e)=>{for(var t in e||(e={}))lI.call(e,t)&&Cp(r,t,e[t]);if(Op)for(var t of Op(e))pI.call(e,t)&&Cp(r,t,e[t]);return r},Tp=(r,e)=>uI(r,dI(e));class gI{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const n=t||Yr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=parseInt(ys(t));e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let s=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const o=parseInt(s,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:s}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,n,s;const o=(n=(t=e.request)==null?void 0:t.params)==null?void 0:n[0];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const f=this.client.session.get(e.topic),h=((s=f==null?void 0:f.sessionProperties)==null?void 0:s.capabilities)||{};if(h!=null&&h[o])return h==null?void 0:h[o];const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:Tp(Rp({},f.sessionProperties||{}),{capabilities:Tp(Rp({},h||{}),{[o]:p})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return p}async getCallStatus(e){var t,n;const s=this.client.session.get(e.topic),o=(t=s.sessionProperties)==null?void 0:t.bundler_name;if(o){const h=this.getBundlerUrl(e.chainId,o);try{return await this.getUserOperationReceipt(h,e)}catch(p){console.warn("Failed to fetch call status from bundler",p,h)}}const f=(n=s.sessionProperties)==null?void 0:n.bundler_url;if(f)try{return await this.getUserOperationReceipt(f,e)}catch(h){console.warn("Failed to fetch call status from custom bundler",h,f)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var n;const s=new URL(e),o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Dn("eth_getUserOperationReceipt",[(n=t.request.params)==null?void 0:n[0]]))});if(!o.ok)throw new Error(`Failed to fetch user operation receipt - ${o.status}`);return await o.json()}getBundlerUrl(e,t){return`${eI}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class bI{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class vI{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class mI{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const n=t||Yr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pi(new Pi(n,yt("disableProviderPing")))}}class yI{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),s=ys(t);e[s]=this.createHttpProvider(s,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class wI{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class _I{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class EI{constructor(e){this.name="near",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace);return typeof n>"u"?void 0:new pi(new Pi(n,yt("disableProviderPing")))}}class SI{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{e[t]=this.createHttpProvider(t)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace);return typeof n>"u"?void 0:new pi(new Pi(n))}}class xI{constructor(e){this.name=js,this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const n={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(s=>{const o=Ws(s);n[`${o.namespace}:${o.reference}`]=this.createHttpProvider(s)}),n}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}var II=Object.defineProperty,DI=Object.defineProperties,AI=Object.getOwnPropertyDescriptors,Np=Object.getOwnPropertySymbols,PI=Object.prototype.hasOwnProperty,MI=Object.prototype.propertyIsEnumerable,$p=(r,e,t)=>e in r?II(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,cc=(r,e)=>{for(var t in e||(e={}))PI.call(e,t)&&$p(r,t,e[t]);if(Np)for(var t of Np(e))MI.call(e,t)&&$p(r,t,e[t]);return r},Nh=(r,e)=>DI(r,AI(e));let OI=class vg{constructor(e){this.events=new iu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Xa(Jc({level:(e==null?void 0:e.logger)||xp})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new vg(e);return await t.initialize(),t}async request(e,t,n){const[s,o]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:cc({},e),chainId:`${s}:${o}`,topic:this.session.topic,expiry:n})}sendAsync(e,t,n,s){const o=new Date().getTime();this.request(e,n,s).then(f=>t(null,Yc(o,f))).catch(f=>t(f,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:It("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:s}=await this.client.authenticate(e,t);n&&(this.uri=n,this.events.emit("display_uri",n));const o=await s();if(this.session=o.session,this.session){const f=Mp(this.session.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces),this.onConnect()}return o}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:s}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await s().then(o=>{this.session=o;const f=Mp(o.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==lg)throw o;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,s]=this.validateChain(e),o=this.getProvider(n);o.name===js?o.setDefaultChain(`${n}:${s}`,t):o.setDefaultChain(s,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(fn(t)){for(const n of t)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await xu.init({core:this.providerOpts.core,logger:this.providerOpts.logger||xp,relayUrl:this.providerOpts.relayUrl||Xx,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>Pa(t)))];Th("client",this.client),Th("events",this.events),Th("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const n=oI(t,this.session),s=gg(n),o=Ch(this.namespaces,this.optionalNamespaces),f=Nh(cc({},o[t]),{accounts:n,chains:s});switch(t){case"eip155":this.rpcProviders[t]=new gI({namespace:f});break;case"algorand":this.rpcProviders[t]=new mI({namespace:f});break;case"solana":this.rpcProviders[t]=new bI({namespace:f});break;case"cosmos":this.rpcProviders[t]=new vI({namespace:f});break;case"polkadot":this.rpcProviders[t]=new fI({namespace:f});break;case"cip34":this.rpcProviders[t]=new yI({namespace:f});break;case"elrond":this.rpcProviders[t]=new wI({namespace:f});break;case"multiversx":this.rpcProviders[t]=new _I({namespace:f});break;case"near":this.rpcProviders[t]=new EI({namespace:f});break;case"tezos":this.rpcProviders[t]=new SI({namespace:f});break;default:this.rpcProviders[js]?this.rpcProviders[js].updateNamespace(f):this.rpcProviders[js]=new xI({namespace:f})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:n}=t;if(n.name==="accountsChanged"){const s=n.data;s&&fn(s)&&this.events.emit("accountsChanged",s.map(cI))}else if(n.name==="chainChanged"){const s=t.chainId,o=t.event.data,f=Pa(s),h=Rh(s)!==Rh(o)?`${f}:${Rh(o)}`:s;this.onChainChanged(h)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var n;const{namespaces:s}=t,o=(n=this.client)==null?void 0:n.session.get(e);this.session=Nh(cc({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Nh(cc({},It("USER_DISCONNECTED")),{data:e.topic}))}),this.on(gi.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[js]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:s}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=s,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(f=>Pa(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const s=Pa(Object.keys(this.namespaces)[0]),o=this.rpcProviders[s].getDefaultChain();return[s,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[n,s]=this.validateChain(e);s&&(t||this.getProvider(n).setDefaultChain(s),this.namespaces[n]?this.namespaces[n].defaultChain=s:this.namespaces[`${n}:${s}`]?this.namespaces[`${n}:${s}`].defaultChain=s:this.namespaces[`${n}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Ip}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Ip}/${e}`)}};const CI=OI,RI="wc",TI="ethereum_provider",NI=`${RI}@2:${TI}:`,$I="https://rpc.walletconnect.org/v1/",eu=["eth_sendTransaction","personal_sign"],LI=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],tu=["chainChanged","accountsChanged"],FI=["chainChanged","accountsChanged","message","disconnect","connect"];var qI=Object.defineProperty,UI=Object.defineProperties,BI=Object.getOwnPropertyDescriptors,Lp=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,Fp=(r,e,t)=>e in r?qI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ks=(r,e)=>{for(var t in e||(e={}))zI.call(e,t)&&Fp(r,t,e[t]);if(Lp)for(var t of Lp(e))HI.call(e,t)&&Fp(r,t,e[t]);return r},$h=(r,e)=>UI(r,BI(e));function Tc(r){return Number(r[0].split(":")[1])}function fc(r){return`0x${r.toString(16)}`}function jI(r){const{chains:e,optionalChains:t,methods:n,optionalMethods:s,events:o,optionalEvents:f,rpcMap:h}=r;if(!fn(e))throw new Error("Invalid chains");const p={chains:e,methods:n||eu,events:o||tu,rpcMap:Ks({},e.length?{[Tc(e)]:h[Tc(e)]}:{})},l=o==null?void 0:o.filter(I=>!tu.includes(I)),m=n==null?void 0:n.filter(I=>!eu.includes(I));if(!t&&!f&&!s&&!(l!=null&&l.length)&&!(m!=null&&m.length))return{required:e.length?p:void 0};const _=(l==null?void 0:l.length)&&(m==null?void 0:m.length)||!t,D={chains:[...new Set(_?p.chains.concat(t||[]):t)],methods:[...new Set(p.methods.concat(s!=null&&s.length?s:LI))],events:[...new Set(p.events.concat(f!=null&&f.length?f:FI))],rpcMap:h};return{required:e.length?p:void 0,optional:t.length?D:void 0}}class Iu{constructor(){this.events=new ui.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=NI,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new Iu;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,n){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:n}=jI(this.rpc);try{const s=await new Promise(async(f,h)=>{var p;this.rpc.showQrModal&&((p=this.modal)==null||p.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),h(new Error("Connection request reset. Please try again.")))})),await this.signer.connect($h(Ks({namespaces:Ks({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{f(l)}).catch(l=>{h(new Error(l.message))})});if(!s)return;const o=t0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:fc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(o,f)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate($h(Ks({},e),{chains:this.rpc.chains}),t).then(p=>{o(p)}).catch(p=>{f(new Error(p.message))})}),s=n.session;if(s){const o=t0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:fc(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:n}=t;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",fc(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",$h(Ks({},It("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",fc(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,s]=e.split(":");return{chainId:`${t}:${n}`,address:s}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,n;const s=(t=e==null?void 0:e.chains)!=null?t:[],o=(n=e==null?void 0:e.optionalChains)!=null?n:[],f=s.concat(o);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const h=s.length?(e==null?void 0:e.methods)||eu:[],p=s.length?(e==null?void 0:e.events)||tu:[],l=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],_=(e==null?void 0:e.rpcMap)||this.buildRpcMap(f,e.projectId),D=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(I=>this.formatChainId(I)),optionalChains:o.map(I=>this.formatChainId(I)),methods:h,events:p,optionalMethods:l,optionalEvents:m,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:D,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach(s=>{n[s]=this.getRpcUrl(s,t)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Tc(this.rpc.chains):Tc(this.rpc.optionalChains),this.signer=await CI.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:n}=await s2(()=>import("./index-3594f7e6.js").then(s=>s.i),["assets/index-3594f7e6.js","assets/index-6270079b.js","assets/index-755f14fc.css"]);t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Ks({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:s}=e;t&&fn(t)&&(this.rpc.chains=t.map(o=>this.formatChainId(o)),t.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)})),n&&fn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)}))}getRpcUrl(e,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${$I}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const bD=Iu;export{bD as EthereumProvider,FI as OPTIONAL_EVENTS,LI as OPTIONAL_METHODS,tu as REQUIRED_EVENTS,eu as REQUIRED_METHODS,Iu as default};
|
|
49
|
+
}`;var ot=El(function(){return wt(C,Pe+"return "+ue).apply(t,B)});if(ot.source=ue,th(ot))throw ot;return ot}function rw(i){return Et(i).toLowerCase()}function iw(i){return Et(i).toUpperCase()}function nw(i,a,c){if(i=Et(i),i&&(c||a===t))return Cu(i);if(!i||!(a=Kr(a)))return i;var g=mi(i),S=mi(a),C=Ru(g,S),B=Tu(g,S)+1;return _n(g,C,B).join("")}function sw(i,a,c){if(i=Et(i),i&&(c||a===t))return i.slice(0,$u(i)+1);if(!i||!(a=Kr(a)))return i;var g=mi(i),S=Tu(g,mi(a))+1;return _n(g,0,S).join("")}function aw(i,a,c){if(i=Et(i),i&&(c||a===t))return i.replace(Ft,"");if(!i||!(a=Kr(a)))return i;var g=mi(i),S=Ru(g,mi(a));return _n(g,S).join("")}function ow(i,a){var c=de,g=L;if(Kt(a)){var S="separator"in a?a.separator:S;c="length"in a?at(a.length):c,g="omission"in a?Kr(a.omission):g}i=Et(i);var C=i.length;if(Ds(i)){var B=mi(i);C=B.length}if(c>=C)return i;var W=c-As(g);if(W<1)return g;var Q=B?_n(B,0,W).join(""):i.slice(0,W);if(S===t)return Q+g;if(B&&(W+=Q.length-W),rh(S)){if(i.slice(W).search(S)){var se,ae=Q;for(S.global||(S=mf(S.source,Et(vr.exec(S))+"g")),S.lastIndex=0;se=S.exec(ae);)var ue=se.index;Q=Q.slice(0,ue===t?W:ue)}}else if(i.indexOf(Kr(S),W)!=W){var ve=Q.lastIndexOf(S);ve>-1&&(Q=Q.slice(0,ve))}return Q+g}function cw(i){return i=Et(i),i&&We.test(i)?i.replace(bi,Fg):i}var fw=Ns(function(i,a,c){return i+(c?" ":"")+a.toUpperCase()}),sh=Sd("toUpperCase");function _l(i,a,c){return i=Et(i),a=c?t:a,a===t?Rg(i)?Bg(i):Sg(i):i.match(a)||[]}var El=ft(function(i,a){try{return ir(i,t,a)}catch(c){return th(c)?c:new Ke(c)}}),hw=Ji(function(i,a){return ei(a,function(c){c=Li(c),Vi(i,c,Qf(i[c],i))}),i});function uw(i){var a=i==null?0:i.length,c=Ne();return i=a?Ht(i,function(g){if(typeof g[1]!="function")throw new ti(f);return[c(g[0]),g[1]]}):[],ft(function(g){for(var S=-1;++S<a;){var C=i[S];if(ir(C[0],this,g))return ir(C[1],this,g)}})}function dw(i){return Fb(ii(i,_))}function ah(i){return function(){return i}}function lw(i,a){return i==null||i!==i?a:i}var pw=Id(),gw=Id(!0);function $r(i){return i}function oh(i){return td(typeof i=="function"?i:ii(i,_))}function bw(i){return id(ii(i,_))}function vw(i,a){return nd(i,ii(a,_))}var mw=ft(function(i,a){return function(c){return da(c,i,a)}}),yw=ft(function(i,a){return function(c){return da(i,c,a)}});function ch(i,a,c){var g=nr(a),S=Fo(a,g);c==null&&!(Kt(a)&&(S.length||!g.length))&&(c=a,a=i,i=this,S=Fo(a,nr(a)));var C=!(Kt(c)&&"chain"in c)||!!c.chain,B=Xi(i);return ei(S,function(W){var Q=a[W];i[W]=Q,B&&(i.prototype[W]=function(){var se=this.__chain__;if(C||se){var ae=i(this.__wrapped__),ue=ae.__actions__=Rr(this.__actions__);return ue.push({func:Q,args:arguments,thisArg:i}),ae.__chain__=se,ae}return Q.apply(i,gn([this.value()],arguments))})}),i}function ww(){return vt._===this&&(vt._=Wg),this}function fh(){}function _w(i){return i=at(i),ft(function(a){return sd(a,i)})}var Ew=Bf(Ht),Sw=Bf(Du),xw=Bf(uf);function Sl(i){return Vf(i)?df(Li(i)):ev(i)}function Iw(i){return function(a){return i==null?t:Xn(i,a)}}var Dw=Ad(),Aw=Ad(!0);function hh(){return[]}function uh(){return!1}function Pw(){return{}}function Mw(){return""}function Ow(){return!0}function Cw(i,a){if(i=at(i),i<1||i>R)return[];var c=A,g=mr(i,A);a=Ne(a),i-=A;for(var S=gf(g,a);++c<i;)a(c);return S}function Rw(i){return Ze(i)?Ht(i,Li):kr(i)?[i]:Rr(jd(Et(i)))}function Tw(i){var a=++Kg;return Et(i)+a}var Nw=jo(function(i,a){return i+a},0),$w=zf("ceil"),Lw=jo(function(i,a){return i/a},1),Fw=zf("floor");function qw(i){return i&&i.length?Lo(i,$r,Df):t}function Uw(i,a){return i&&i.length?Lo(i,Ne(a,2),Df):t}function Bw(i){return Mu(i,$r)}function zw(i,a){return Mu(i,Ne(a,2))}function Hw(i){return i&&i.length?Lo(i,$r,Of):t}function jw(i,a){return i&&i.length?Lo(i,Ne(a,2),Of):t}var Kw=jo(function(i,a){return i*a},1),kw=zf("round"),Ww=jo(function(i,a){return i-a},0);function Vw(i){return i&&i.length?pf(i,$r):0}function Gw(i,a){return i&&i.length?pf(i,Ne(a,2)):0}return P.after=by,P.ary=el,P.assign=i3,P.assignIn=pl,P.assignInWith=rc,P.assignWith=n3,P.at=s3,P.before=tl,P.bind=Qf,P.bindAll=hw,P.bindKey=rl,P.castArray=Py,P.chain=Xd,P.chunk=Fv,P.compact=qv,P.concat=Uv,P.cond=uw,P.conforms=dw,P.constant=ah,P.countBy=Vm,P.create=a3,P.curry=il,P.curryRight=nl,P.debounce=sl,P.defaults=o3,P.defaultsDeep=c3,P.defer=vy,P.delay=my,P.difference=Bv,P.differenceBy=zv,P.differenceWith=Hv,P.drop=jv,P.dropRight=Kv,P.dropRightWhile=kv,P.dropWhile=Wv,P.fill=Vv,P.filter=Jm,P.flatMap=Zm,P.flatMapDeep=Qm,P.flatMapDepth=ey,P.flatten=Vd,P.flattenDeep=Gv,P.flattenDepth=Jv,P.flip=yy,P.flow=pw,P.flowRight=gw,P.fromPairs=Yv,P.functions=g3,P.functionsIn=b3,P.groupBy=ty,P.initial=Zv,P.intersection=Qv,P.intersectionBy=em,P.intersectionWith=tm,P.invert=m3,P.invertBy=y3,P.invokeMap=iy,P.iteratee=oh,P.keyBy=ny,P.keys=nr,P.keysIn=Nr,P.map=Yo,P.mapKeys=_3,P.mapValues=E3,P.matches=bw,P.matchesProperty=vw,P.memoize=Zo,P.merge=S3,P.mergeWith=gl,P.method=mw,P.methodOf=yw,P.mixin=ch,P.negate=Qo,P.nthArg=_w,P.omit=x3,P.omitBy=I3,P.once=wy,P.orderBy=sy,P.over=Ew,P.overArgs=_y,P.overEvery=Sw,P.overSome=xw,P.partial=eh,P.partialRight=al,P.partition=ay,P.pick=D3,P.pickBy=bl,P.property=Sl,P.propertyOf=Iw,P.pull=sm,P.pullAll=Jd,P.pullAllBy=am,P.pullAllWith=om,P.pullAt=cm,P.range=Dw,P.rangeRight=Aw,P.rearg=Ey,P.reject=fy,P.remove=fm,P.rest=Sy,P.reverse=Xf,P.sampleSize=uy,P.set=P3,P.setWith=M3,P.shuffle=dy,P.slice=hm,P.sortBy=gy,P.sortedUniq=vm,P.sortedUniqBy=mm,P.split=Z3,P.spread=xy,P.tail=ym,P.take=wm,P.takeRight=_m,P.takeRightWhile=Em,P.takeWhile=Sm,P.tap=qm,P.throttle=Iy,P.thru=Jo,P.toArray=ul,P.toPairs=vl,P.toPairsIn=ml,P.toPath=Rw,P.toPlainObject=ll,P.transform=O3,P.unary=Dy,P.union=xm,P.unionBy=Im,P.unionWith=Dm,P.uniq=Am,P.uniqBy=Pm,P.uniqWith=Mm,P.unset=C3,P.unzip=Zf,P.unzipWith=Yd,P.update=R3,P.updateWith=T3,P.values=Fs,P.valuesIn=N3,P.without=Om,P.words=_l,P.wrap=Ay,P.xor=Cm,P.xorBy=Rm,P.xorWith=Tm,P.zip=Nm,P.zipObject=$m,P.zipObjectDeep=Lm,P.zipWith=Fm,P.entries=vl,P.entriesIn=ml,P.extend=pl,P.extendWith=rc,ch(P,P),P.add=Nw,P.attempt=El,P.camelCase=q3,P.capitalize=yl,P.ceil=$w,P.clamp=$3,P.clone=My,P.cloneDeep=Cy,P.cloneDeepWith=Ry,P.cloneWith=Oy,P.conformsTo=Ty,P.deburr=wl,P.defaultTo=lw,P.divide=Lw,P.endsWith=U3,P.eq=wi,P.escape=B3,P.escapeRegExp=z3,P.every=Gm,P.find=Ym,P.findIndex=kd,P.findKey=f3,P.findLast=Xm,P.findLastIndex=Wd,P.findLastKey=h3,P.floor=Fw,P.forEach=Zd,P.forEachRight=Qd,P.forIn=u3,P.forInRight=d3,P.forOwn=l3,P.forOwnRight=p3,P.get=ih,P.gt=Ny,P.gte=$y,P.has=v3,P.hasIn=nh,P.head=Gd,P.identity=$r,P.includes=ry,P.indexOf=Xv,P.inRange=L3,P.invoke=w3,P.isArguments=es,P.isArray=Ze,P.isArrayBuffer=Ly,P.isArrayLike=Tr,P.isArrayLikeObject=Jt,P.isBoolean=Fy,P.isBuffer=En,P.isDate=qy,P.isElement=Uy,P.isEmpty=By,P.isEqual=zy,P.isEqualWith=Hy,P.isError=th,P.isFinite=jy,P.isFunction=Xi,P.isInteger=ol,P.isLength=ec,P.isMap=cl,P.isMatch=Ky,P.isMatchWith=ky,P.isNaN=Wy,P.isNative=Vy,P.isNil=Jy,P.isNull=Gy,P.isNumber=fl,P.isObject=Kt,P.isObjectLike=kt,P.isPlainObject=ma,P.isRegExp=rh,P.isSafeInteger=Yy,P.isSet=hl,P.isString=tc,P.isSymbol=kr,P.isTypedArray=Ls,P.isUndefined=Xy,P.isWeakMap=Zy,P.isWeakSet=Qy,P.join=rm,P.kebabCase=H3,P.last=si,P.lastIndexOf=im,P.lowerCase=j3,P.lowerFirst=K3,P.lt=e3,P.lte=t3,P.max=qw,P.maxBy=Uw,P.mean=Bw,P.meanBy=zw,P.min=Hw,P.minBy=jw,P.stubArray=hh,P.stubFalse=uh,P.stubObject=Pw,P.stubString=Mw,P.stubTrue=Ow,P.multiply=Kw,P.nth=nm,P.noConflict=ww,P.noop=fh,P.now=Xo,P.pad=k3,P.padEnd=W3,P.padStart=V3,P.parseInt=G3,P.random=F3,P.reduce=oy,P.reduceRight=cy,P.repeat=J3,P.replace=Y3,P.result=A3,P.round=kw,P.runInContext=J,P.sample=hy,P.size=ly,P.snakeCase=X3,P.some=py,P.sortedIndex=um,P.sortedIndexBy=dm,P.sortedIndexOf=lm,P.sortedLastIndex=pm,P.sortedLastIndexBy=gm,P.sortedLastIndexOf=bm,P.startCase=Q3,P.startsWith=ew,P.subtract=Ww,P.sum=Vw,P.sumBy=Gw,P.template=tw,P.times=Cw,P.toFinite=Zi,P.toInteger=at,P.toLength=dl,P.toLower=rw,P.toNumber=ai,P.toSafeInteger=r3,P.toString=Et,P.toUpper=iw,P.trim=nw,P.trimEnd=sw,P.trimStart=aw,P.truncate=ow,P.unescape=cw,P.uniqueId=Tw,P.upperCase=fw,P.upperFirst=sh,P.each=Zd,P.eachRight=Qd,P.first=Gd,ch(P,function(){var i={};return Ni(P,function(a,c){xt.call(P.prototype,c)||(i[c]=a)}),i}(),{chain:!1}),P.VERSION=n,ei(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){P[i].placeholder=P}),ei(["drop","take"],function(i,a){gt.prototype[i]=function(c){c=c===t?1:tr(at(c),0);var g=this.__filtered__&&!a?new gt(this):this.clone();return g.__filtered__?g.__takeCount__=mr(c,g.__takeCount__):g.__views__.push({size:mr(c,A),type:i+(g.__dir__<0?"Right":"")}),g},gt.prototype[i+"Right"]=function(c){return this.reverse()[i](c).reverse()}}),ei(["filter","map","takeWhile"],function(i,a){var c=a+1,g=c==w||c==O;gt.prototype[i]=function(S){var C=this.clone();return C.__iteratees__.push({iteratee:Ne(S,3),type:c}),C.__filtered__=C.__filtered__||g,C}}),ei(["head","last"],function(i,a){var c="take"+(a?"Right":"");gt.prototype[i]=function(){return this[c](1).value()[0]}}),ei(["initial","tail"],function(i,a){var c="drop"+(a?"":"Right");gt.prototype[i]=function(){return this.__filtered__?new gt(this):this[c](1)}}),gt.prototype.compact=function(){return this.filter($r)},gt.prototype.find=function(i){return this.filter(i).head()},gt.prototype.findLast=function(i){return this.reverse().find(i)},gt.prototype.invokeMap=ft(function(i,a){return typeof i=="function"?new gt(this):this.map(function(c){return da(c,i,a)})}),gt.prototype.reject=function(i){return this.filter(Qo(Ne(i)))},gt.prototype.slice=function(i,a){i=at(i);var c=this;return c.__filtered__&&(i>0||a<0)?new gt(c):(i<0?c=c.takeRight(-i):i&&(c=c.drop(i)),a!==t&&(a=at(a),c=a<0?c.dropRight(-a):c.take(a-i)),c)},gt.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},gt.prototype.toArray=function(){return this.take(A)},Ni(gt.prototype,function(i,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),S=P[g?"take"+(a=="last"?"Right":""):a],C=g||/^find/.test(a);S&&(P.prototype[a]=function(){var B=this.__wrapped__,W=g?[1]:arguments,Q=B instanceof gt,se=W[0],ae=Q||Ze(B),ue=function(ut){var mt=S.apply(P,gn([ut],W));return g&&ve?mt[0]:mt};ae&&c&&typeof se=="function"&&se.length!=1&&(Q=ae=!1);var ve=this.__chain__,Pe=!!this.__actions__.length,$e=C&&!ve,ot=Q&&!Pe;if(!C&&ae){B=ot?B:new gt(this);var Le=i.apply(B,W);return Le.__actions__.push({func:Jo,args:[ue],thisArg:t}),new ri(Le,ve)}return $e&&ot?i.apply(this,W):(Le=this.thru(ue),$e?g?Le.value()[0]:Le.value():Le)})}),ei(["pop","push","shift","sort","splice","unshift"],function(i){var a=_o[i],c=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",g=/^(?:pop|shift)$/.test(i);P.prototype[i]=function(){var S=arguments;if(g&&!this.__chain__){var C=this.value();return a.apply(Ze(C)?C:[],S)}return this[c](function(B){return a.apply(Ze(B)?B:[],S)})}}),Ni(gt.prototype,function(i,a){var c=P[a];if(c){var g=c.name+"";xt.call(Cs,g)||(Cs[g]=[]),Cs[g].push({name:a,func:c})}}),Cs[Ho(t,X).name]=[{name:"wrapper",func:t}],gt.prototype.clone=cb,gt.prototype.reverse=fb,gt.prototype.value=hb,P.prototype.at=Um,P.prototype.chain=Bm,P.prototype.commit=zm,P.prototype.next=Hm,P.prototype.plant=Km,P.prototype.reverse=km,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=Wm,P.prototype.first=P.prototype.head,sa&&(P.prototype[sa]=jm),P},Ps=zg();Gt?((Gt.exports=Ps)._=Ps,Ct._=Ps):vt._=Ps}).call(_r)})(Rc,Rc.exports);var jx=Rc.exports,Kx=Object.defineProperty,kx=Object.defineProperties,Wx=Object.getOwnPropertyDescriptors,mp=Object.getOwnPropertySymbols,Vx=Object.prototype.hasOwnProperty,Gx=Object.prototype.propertyIsEnumerable,yp=(r,e,t)=>e in r?Kx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wp=(r,e)=>{for(var t in e||(e={}))Vx.call(e,t)&&yp(r,t,e[t]);if(mp)for(var t of mp(e))Gx.call(e,t)&&yp(r,t,e[t]);return r},_p=(r,e)=>kx(r,Wx(e));const Jx={Accept:"application/json","Content-Type":"application/json"},Yx="POST",Ep={headers:Jx,method:Yx},Sp=10;let Pi=class{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new ui.EventEmitter,this.isAvailable=!1,this.registering=!1,!U0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=cn(e),n=await(await Il(this.url,_p(wp({},Ep),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!U0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((n,s)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),s(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return s(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=cn({id:1,jsonrpc:"2.0",method:"test",params:[]});await Il(e,_p(wp({},Ep),{body:t}))}this.onOpen()}catch(t){const n=this.parseError(t);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?us(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),s=n.message||n.toString(),o=Xc(e,s);this.events.emit("payload",o)}parseError(e,t=this.url){return K1(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Sp&&this.events.setMaxListeners(Sp)}};const xp="error",Xx="wss://relay.walletconnect.org",Zx="wc",Qx="universal_provider",Ip=`${Zx}@2:${Qx}:`,pg="https://rpc.walletconnect.org/v1/",js="generic",eI=`${pg}bundler`,gi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var tI=Object.defineProperty,rI=Object.defineProperties,iI=Object.getOwnPropertyDescriptors,Dp=Object.getOwnPropertySymbols,nI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,Ap=(r,e,t)=>e in r?tI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,oc=(r,e)=>{for(var t in e||(e={}))nI.call(e,t)&&Ap(r,t,e[t]);if(Dp)for(var t of Dp(e))sI.call(e,t)&&Ap(r,t,e[t]);return r},aI=(r,e)=>rI(r,iI(e));function Yr(r,e,t){var n;const s=Ws(r);return((n=e.rpcMap)==null?void 0:n[s.reference])||`${pg}?chainId=${s.namespace}:${s.reference}&projectId=${t}`}function ys(r){return r.includes(":")?r.split(":")[1]:r}function gg(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function oI(r,e){const t=Object.keys(e.namespaces).filter(s=>s.includes(r));if(!t.length)return[];const n=[];return t.forEach(s=>{const o=e.namespaces[s].accounts;n.push(...o)}),n}function Ch(r={},e={}){const t=Pp(r),n=Pp(e);return jx.merge(t,n)}function Pp(r){var e,t,n,s;const o={};if(!La(r))return o;for(const[f,h]of Object.entries(r)){const p=mu(f)?[f]:h.chains,l=h.methods||[],m=h.events||[],_=h.rpcMap||{},D=Pa(f);o[D]=aI(oc(oc({},o[D]),h),{chains:uc(p,(e=o[D])==null?void 0:e.chains),methods:uc(l,(t=o[D])==null?void 0:t.methods),events:uc(m,(n=o[D])==null?void 0:n.events),rpcMap:oc(oc({},_),(s=o[D])==null?void 0:s.rpcMap)})}return o}function cI(r){return r.includes(":")?r.split(":")[2]:r}function Mp(r){const e={};for(const[t,n]of Object.entries(r)){const s=n.methods||[],o=n.events||[],f=n.accounts||[],h=mu(t)?[t]:n.chains?n.chains:gg(n.accounts);e[t]={chains:h,methods:s,events:o,accounts:f}}return e}function Rh(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const bg={},yt=r=>bg[r],Th=(r,e)=>{bg[r]=e};class fI{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}var hI=Object.defineProperty,uI=Object.defineProperties,dI=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,Cp=(r,e,t)=>e in r?hI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Rp=(r,e)=>{for(var t in e||(e={}))lI.call(e,t)&&Cp(r,t,e[t]);if(Op)for(var t of Op(e))pI.call(e,t)&&Cp(r,t,e[t]);return r},Tp=(r,e)=>uI(r,dI(e));class gI{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const n=t||Yr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=parseInt(ys(t));e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let s=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const o=parseInt(s,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:s}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,n,s;const o=(n=(t=e.request)==null?void 0:t.params)==null?void 0:n[0];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const f=this.client.session.get(e.topic),h=((s=f==null?void 0:f.sessionProperties)==null?void 0:s.capabilities)||{};if(h!=null&&h[o])return h==null?void 0:h[o];const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:Tp(Rp({},f.sessionProperties||{}),{capabilities:Tp(Rp({},h||{}),{[o]:p})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return p}async getCallStatus(e){var t,n;const s=this.client.session.get(e.topic),o=(t=s.sessionProperties)==null?void 0:t.bundler_name;if(o){const h=this.getBundlerUrl(e.chainId,o);try{return await this.getUserOperationReceipt(h,e)}catch(p){console.warn("Failed to fetch call status from bundler",p,h)}}const f=(n=s.sessionProperties)==null?void 0:n.bundler_url;if(f)try{return await this.getUserOperationReceipt(f,e)}catch(h){console.warn("Failed to fetch call status from custom bundler",h,f)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var n;const s=new URL(e),o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Dn("eth_getUserOperationReceipt",[(n=t.request.params)==null?void 0:n[0]]))});if(!o.ok)throw new Error(`Failed to fetch user operation receipt - ${o.status}`);return await o.json()}getBundlerUrl(e,t){return`${eI}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class bI{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class vI{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class mI{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const n=t||Yr(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pi(new Pi(n,yt("disableProviderPing")))}}class yI{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),s=ys(t);e[s]=this.createHttpProvider(s,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class wI{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class _I{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const s=ys(t);e[s]=this.createHttpProvider(s,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}class EI{constructor(e){this.name="near",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;e[t]=this.createHttpProvider(t,(n=this.namespace.rpcMap)==null?void 0:n[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace);return typeof n>"u"?void 0:new pi(new Pi(n,yt("disableProviderPing")))}}class SI{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Yr(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{e[t]=this.createHttpProvider(t)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace);return typeof n>"u"?void 0:new pi(new Pi(n))}}class xI{constructor(e){this.name=js,this.namespace=e.namespace,this.events=yt("events"),this.client=yt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const n={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(s=>{const o=Ws(s);n[`${o.namespace}:${o.reference}`]=this.createHttpProvider(s)}),n}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Yr(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new pi(new Pi(n,yt("disableProviderPing")))}}var II=Object.defineProperty,DI=Object.defineProperties,AI=Object.getOwnPropertyDescriptors,Np=Object.getOwnPropertySymbols,PI=Object.prototype.hasOwnProperty,MI=Object.prototype.propertyIsEnumerable,$p=(r,e,t)=>e in r?II(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,cc=(r,e)=>{for(var t in e||(e={}))PI.call(e,t)&&$p(r,t,e[t]);if(Np)for(var t of Np(e))MI.call(e,t)&&$p(r,t,e[t]);return r},Nh=(r,e)=>DI(r,AI(e));let OI=class vg{constructor(e){this.events=new iu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Xa(Jc({level:(e==null?void 0:e.logger)||xp})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new vg(e);return await t.initialize(),t}async request(e,t,n){const[s,o]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:cc({},e),chainId:`${s}:${o}`,topic:this.session.topic,expiry:n})}sendAsync(e,t,n,s){const o=new Date().getTime();this.request(e,n,s).then(f=>t(null,Yc(o,f))).catch(f=>t(f,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:It("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:s}=await this.client.authenticate(e,t);n&&(this.uri=n,this.events.emit("display_uri",n));const o=await s();if(this.session=o.session,this.session){const f=Mp(this.session.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces),this.onConnect()}return o}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:s}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await s().then(o=>{this.session=o;const f=Mp(o.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==lg)throw o;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,s]=this.validateChain(e),o=this.getProvider(n);o.name===js?o.setDefaultChain(`${n}:${s}`,t):o.setDefaultChain(s,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(fn(t)){for(const n of t)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await xu.init({core:this.providerOpts.core,logger:this.providerOpts.logger||xp,relayUrl:this.providerOpts.relayUrl||Xx,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>Pa(t)))];Th("client",this.client),Th("events",this.events),Th("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const n=oI(t,this.session),s=gg(n),o=Ch(this.namespaces,this.optionalNamespaces),f=Nh(cc({},o[t]),{accounts:n,chains:s});switch(t){case"eip155":this.rpcProviders[t]=new gI({namespace:f});break;case"algorand":this.rpcProviders[t]=new mI({namespace:f});break;case"solana":this.rpcProviders[t]=new bI({namespace:f});break;case"cosmos":this.rpcProviders[t]=new vI({namespace:f});break;case"polkadot":this.rpcProviders[t]=new fI({namespace:f});break;case"cip34":this.rpcProviders[t]=new yI({namespace:f});break;case"elrond":this.rpcProviders[t]=new wI({namespace:f});break;case"multiversx":this.rpcProviders[t]=new _I({namespace:f});break;case"near":this.rpcProviders[t]=new EI({namespace:f});break;case"tezos":this.rpcProviders[t]=new SI({namespace:f});break;default:this.rpcProviders[js]?this.rpcProviders[js].updateNamespace(f):this.rpcProviders[js]=new xI({namespace:f})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:n}=t;if(n.name==="accountsChanged"){const s=n.data;s&&fn(s)&&this.events.emit("accountsChanged",s.map(cI))}else if(n.name==="chainChanged"){const s=t.chainId,o=t.event.data,f=Pa(s),h=Rh(s)!==Rh(o)?`${f}:${Rh(o)}`:s;this.onChainChanged(h)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var n;const{namespaces:s}=t,o=(n=this.client)==null?void 0:n.session.get(e);this.session=Nh(cc({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Nh(cc({},It("USER_DISCONNECTED")),{data:e.topic}))}),this.on(gi.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[js]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:s}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=s,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(f=>Pa(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const s=Pa(Object.keys(this.namespaces)[0]),o=this.rpcProviders[s].getDefaultChain();return[s,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[n,s]=this.validateChain(e);s&&(t||this.getProvider(n).setDefaultChain(s),this.namespaces[n]?this.namespaces[n].defaultChain=s:this.namespaces[`${n}:${s}`]?this.namespaces[`${n}:${s}`].defaultChain=s:this.namespaces[`${n}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Ip}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Ip}/${e}`)}};const CI=OI,RI="wc",TI="ethereum_provider",NI=`${RI}@2:${TI}:`,$I="https://rpc.walletconnect.org/v1/",eu=["eth_sendTransaction","personal_sign"],LI=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],tu=["chainChanged","accountsChanged"],FI=["chainChanged","accountsChanged","message","disconnect","connect"];var qI=Object.defineProperty,UI=Object.defineProperties,BI=Object.getOwnPropertyDescriptors,Lp=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,Fp=(r,e,t)=>e in r?qI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ks=(r,e)=>{for(var t in e||(e={}))zI.call(e,t)&&Fp(r,t,e[t]);if(Lp)for(var t of Lp(e))HI.call(e,t)&&Fp(r,t,e[t]);return r},$h=(r,e)=>UI(r,BI(e));function Tc(r){return Number(r[0].split(":")[1])}function fc(r){return`0x${r.toString(16)}`}function jI(r){const{chains:e,optionalChains:t,methods:n,optionalMethods:s,events:o,optionalEvents:f,rpcMap:h}=r;if(!fn(e))throw new Error("Invalid chains");const p={chains:e,methods:n||eu,events:o||tu,rpcMap:Ks({},e.length?{[Tc(e)]:h[Tc(e)]}:{})},l=o==null?void 0:o.filter(I=>!tu.includes(I)),m=n==null?void 0:n.filter(I=>!eu.includes(I));if(!t&&!f&&!s&&!(l!=null&&l.length)&&!(m!=null&&m.length))return{required:e.length?p:void 0};const _=(l==null?void 0:l.length)&&(m==null?void 0:m.length)||!t,D={chains:[...new Set(_?p.chains.concat(t||[]):t)],methods:[...new Set(p.methods.concat(s!=null&&s.length?s:LI))],events:[...new Set(p.events.concat(f!=null&&f.length?f:FI))],rpcMap:h};return{required:e.length?p:void 0,optional:t.length?D:void 0}}class Iu{constructor(){this.events=new ui.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=NI,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new Iu;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,n){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:n}=jI(this.rpc);try{const s=await new Promise(async(f,h)=>{var p;this.rpc.showQrModal&&((p=this.modal)==null||p.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),h(new Error("Connection request reset. Please try again.")))})),await this.signer.connect($h(Ks({namespaces:Ks({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{f(l)}).catch(l=>{h(new Error(l.message))})});if(!s)return;const o=t0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:fc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(o,f)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate($h(Ks({},e),{chains:this.rpc.chains}),t).then(p=>{o(p)}).catch(p=>{f(new Error(p.message))})}),s=n.session;if(s){const o=t0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:fc(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:n}=t;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",fc(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",$h(Ks({},It("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",fc(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,s]=e.split(":");return{chainId:`${t}:${n}`,address:s}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,n;const s=(t=e==null?void 0:e.chains)!=null?t:[],o=(n=e==null?void 0:e.optionalChains)!=null?n:[],f=s.concat(o);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const h=s.length?(e==null?void 0:e.methods)||eu:[],p=s.length?(e==null?void 0:e.events)||tu:[],l=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],_=(e==null?void 0:e.rpcMap)||this.buildRpcMap(f,e.projectId),D=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(I=>this.formatChainId(I)),optionalChains:o.map(I=>this.formatChainId(I)),methods:h,events:p,optionalMethods:l,optionalEvents:m,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:D,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach(s=>{n[s]=this.getRpcUrl(s,t)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Tc(this.rpc.chains):Tc(this.rpc.optionalChains),this.signer=await CI.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:n}=await s2(()=>import("./index-68c80c29.js").then(s=>s.i),["assets/index-68c80c29.js","assets/index-6d2c795c.js","assets/index-a5bcbbe8.css"]);t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Ks({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:s}=e;t&&fn(t)&&(this.rpc.chains=t.map(o=>this.formatChainId(o)),t.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)})),n&&fn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(o=>this.formatChainId(o)),n.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)}))}getRpcUrl(e,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${$I}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const bD=Iu;export{bD as EthereumProvider,FI as OPTIONAL_EVENTS,LI as OPTIONAL_METHODS,tu as REQUIRED_EVENTS,eu as REQUIRED_METHODS,Iu as default};
|
package/index.html
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<meta name="theme-color" content="#000000" />
|
|
7
7
|
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400" rel="stylesheet" />
|
|
8
8
|
<script defer src="https://use.fontawesome.com/releases/v5.0.1/js/all.js"></script>
|
|
9
|
-
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.
|
|
10
|
-
<link rel="shortcut icon" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.
|
|
9
|
+
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.1-12673527432.commit-460bd01/manifest.json" />
|
|
10
|
+
<link rel="shortcut icon" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.1-12673527432.commit-460bd01/favicon.ico" />
|
|
11
11
|
<title>Decentraland's Vesting Dashboard</title>
|
|
12
|
-
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.
|
|
13
|
-
<link rel="stylesheet" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.
|
|
12
|
+
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.1-12673527432.commit-460bd01/assets/index-6d2c795c.js"></script>
|
|
13
|
+
<link rel="stylesheet" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.1-12673527432.commit-460bd01/assets/index-a5bcbbe8.css">
|
|
14
14
|
</head>
|
|
15
15
|
|
|
16
16
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/vesting-dashboard",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-12673527432.commit-460bd01",
|
|
4
4
|
"description": "Static website for the vesting dashboard",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"type": "git",
|
|
18
18
|
"url": "https://github.com/decentraland/vesting-dashboard.git"
|
|
19
19
|
},
|
|
20
|
-
"homepage": "https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.
|
|
21
|
-
"commit": "
|
|
20
|
+
"homepage": "https://cdn.decentraland.org/@dcl/vesting-dashboard/3.5.1-12673527432.commit-460bd01",
|
|
21
|
+
"commit": "460bd014a74a48aaada847ab416b5aa2761e2efe"
|
|
22
22
|
}
|