@wormhole-foundation/wormhole-connect 0.3.9-beta.0-development → 0.3.9

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.
Files changed (50) hide show
  1. package/dist/assets/{ccip-VZmm9Ynz.js → ccip-BM2KTJKS.js} +1 -1
  2. package/dist/assets/{cosmos-J21Kldym.js → cosmos-BX1BekzP.js} +1 -1
  3. package/dist/assets/{evm-CceEkY8D.js → evm-BXEmCPMX.js} +4 -4
  4. package/dist/assets/index-BvyW3wwj.js +3 -0
  5. package/dist/assets/index-CaMXNKLm.js +2 -0
  6. package/dist/assets/{index-IWZOuhzu.js → index-D0lqVeXm.js} +1 -1
  7. package/dist/assets/{index.es-BpbdjECw.js → index.es-DYz79wKC.js} +2 -2
  8. package/dist/assets/{solana-BHV_-eCx.js → solana-CAUt8JQI.js} +2 -2
  9. package/dist/assets/{solanaEmbed.esm-B9sWifH1.js → solanaEmbed.esm-H1FtxXdm.js} +1 -1
  10. package/dist/main.js +85 -85
  11. package/dist/src/routes/utils.d.ts.map +1 -1
  12. package/lib/{aptos-Di9E2_wp.js → aptos-BD9dLPo0.js} +1 -1
  13. package/lib/{aptos-CBux549u.mjs → aptos-BFfGA69R.mjs} +1 -1
  14. package/lib/{ccip-pyZLTcW7.js → ccip-BRt-YHc-.js} +1 -1
  15. package/lib/{ccip-BDLKT_93.mjs → ccip-DUFlgF1_.mjs} +1 -1
  16. package/lib/{cosmos-CdVnlqzd.js → cosmos-CQgiFVOc.js} +1 -1
  17. package/lib/{cosmos-C39_QwJ5.mjs → cosmos-adL_JGZ6.mjs} +2 -2
  18. package/lib/{evm-aN59q_R_.js → evm-Bl7undtj.js} +4 -4
  19. package/lib/{evm-B-YLcddr.mjs → evm-zMaXwqxg.mjs} +6 -6
  20. package/lib/{index-V_SPxmrQ.mjs → index-6_27Y5fq.mjs} +2 -2
  21. package/lib/{index-CiT2h5gE.js → index-Bgq8r33i.js} +1 -1
  22. package/lib/{index-BSkg4LjK.js → index-C8F998ax.js} +1 -1
  23. package/lib/index-Ci2FvrOh.js +1 -0
  24. package/lib/{index-C6Wvczhr.js → index-DTOQHhz5.js} +2 -2
  25. package/lib/{index-DL8L1ROt.mjs → index-DV6sNreL.mjs} +23 -22
  26. package/lib/{index-BkGesTg8.mjs → index-Da6eXxi9.mjs} +3 -3
  27. package/lib/{index-8_RCXn3f.js → index-U9aI6SMh.js} +1 -1
  28. package/lib/{index-b-1s4RBl.mjs → index-YvQiXdUE.mjs} +1 -1
  29. package/lib/{index-Dav5vlPz.mjs → index-jL8n_lZd.mjs} +2 -2
  30. package/lib/{index.es-BiFBfhQG.mjs → index.es--nOdm892.mjs} +1 -1
  31. package/lib/{index.es-C3-YBNbP.mjs → index.es-Bx6K8dMp.mjs} +4 -4
  32. package/lib/{index.es-ChPrRrlN.js → index.es-CM2UFhO6.js} +1 -1
  33. package/lib/{index.es-BQUa7Vv7.js → index.es-CnPkjyNd.js} +1 -1
  34. package/lib/{index.es-Bb_BiFnk.js → index.es-DLsJAPWM.js} +2 -2
  35. package/lib/{index.es-VnkPP7nS.mjs → index.es-DTpG_imm.mjs} +2 -2
  36. package/lib/index.js +1 -1
  37. package/lib/index.mjs +1 -1
  38. package/lib/{sei-BoQhh6Mb.js → sei-BvR89XbN.js} +1 -1
  39. package/lib/{sei-Hg6zXjFL.mjs → sei-C5tfWv0i.mjs} +1 -1
  40. package/lib/{solana-Depj19nP.js → solana-CRhTLHaG.js} +1 -1
  41. package/lib/{solana-DLUxtso2.mjs → solana-vzDc-ufj.mjs} +3 -3
  42. package/lib/{solanaEmbed.esm-13cDHD8t.js → solanaEmbed.esm-B7yFNTk4.js} +1 -1
  43. package/lib/{solanaEmbed.esm-C7fwNyMo.mjs → solanaEmbed.esm-DHYvoxHh.mjs} +2 -2
  44. package/lib/src/routes/utils.d.ts.map +1 -1
  45. package/lib/{sui-4jYajsRL.js → sui-DdAX-NLr.js} +1 -1
  46. package/lib/{sui-BMRM04YZ.mjs → sui-FUMrQjvP.mjs} +1 -1
  47. package/package.json +1 -1
  48. package/dist/assets/index-BGRtIcKb.js +0 -2
  49. package/dist/assets/index-By11uCvO.js +0 -3
  50. package/lib/index-DymMdCti.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("./index-C6Wvczhr.js"),nt=require("./index.es-ChPrRrlN.js"),pt=require("./index.es-BQUa7Vv7.js");var es={exports:{}};(function(b,s){var i=typeof self<"u"?self:ke.commonjsGlobal,f=function(){function P(){this.fetch=!1,this.DOMException=i.DOMException}return P.prototype=i,new P}();(function(P){(function(O){var N={searchParams:"URLSearchParams"in P,iterable:"Symbol"in P&&"iterator"in Symbol,blob:"FileReader"in P&&"Blob"in P&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in P,arrayBuffer:"ArrayBuffer"in P};function ut(v){return v&&DataView.prototype.isPrototypeOf(v)}if(N.arrayBuffer)var st=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],dt=ArrayBuffer.isView||function(v){return v&&st.indexOf(Object.prototype.toString.call(v))>-1};function it(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function vt(v){return typeof v!="string"&&(v=String(v)),v}function ct(v){var E={next:function(){var $=v.shift();return{done:$===void 0,value:$}}};return N.iterable&&(E[Symbol.iterator]=function(){return E}),E}function J(v){this.map={},v instanceof J?v.forEach(function(E,$){this.append($,E)},this):Array.isArray(v)?v.forEach(function(E){this.append(E[0],E[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(E){this.append(E,v[E])},this)}J.prototype.append=function(v,E){v=it(v),E=vt(E);var $=this.map[v];this.map[v]=$?$+", "+E:E},J.prototype.delete=function(v){delete this.map[it(v)]},J.prototype.get=function(v){return v=it(v),this.has(v)?this.map[v]:null},J.prototype.has=function(v){return this.map.hasOwnProperty(it(v))},J.prototype.set=function(v,E){this.map[it(v)]=vt(E)},J.prototype.forEach=function(v,E){for(var $ in this.map)this.map.hasOwnProperty($)&&v.call(E,this.map[$],$,this)},J.prototype.keys=function(){var v=[];return this.forEach(function(E,$){v.push($)}),ct(v)},J.prototype.values=function(){var v=[];return this.forEach(function(E){v.push(E)}),ct(v)},J.prototype.entries=function(){var v=[];return this.forEach(function(E,$){v.push([$,E])}),ct(v)},N.iterable&&(J.prototype[Symbol.iterator]=J.prototype.entries);function ve(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function yt(v){return new Promise(function(E,$){v.onload=function(){E(v.result)},v.onerror=function(){$(v.error)}})}function ee(v){var E=new FileReader,$=yt(E);return E.readAsArrayBuffer(v),$}function jr(v){var E=new FileReader,$=yt(E);return E.readAsText(v),$}function Ht(v){for(var E=new Uint8Array(v),$=new Array(E.length),K=0;K<E.length;K++)$[K]=String.fromCharCode(E[K]);return $.join("")}function re(v){if(v.slice)return v.slice(0);var E=new Uint8Array(v.byteLength);return E.set(new Uint8Array(v)),E.buffer}function Ot(){return this.bodyUsed=!1,this._initBody=function(v){this._bodyInit=v,v?typeof v=="string"?this._bodyText=v:N.blob&&Blob.prototype.isPrototypeOf(v)?this._bodyBlob=v:N.formData&&FormData.prototype.isPrototypeOf(v)?this._bodyFormData=v:N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)?this._bodyText=v.toString():N.arrayBuffer&&N.blob&&ut(v)?(this._bodyArrayBuffer=re(v.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):N.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(v)||dt(v))?this._bodyArrayBuffer=re(v):this._bodyText=v=Object.prototype.toString.call(v):this._bodyText="",this.headers.get("content-type")||(typeof v=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},N.blob&&(this.blob=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?ve(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(ee)}),this.text=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return jr(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ht(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},N.formData&&(this.formData=function(){return this.text().then(er)}),this.json=function(){return this.text().then(JSON.parse)},this}var ge=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Wt(v){var E=v.toUpperCase();return ge.indexOf(E)>-1?E:v}function jt(v,E){E=E||{};var $=E.body;if(v instanceof jt){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,E.headers||(this.headers=new J(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!$&&v._bodyInit!=null&&($=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new J(E.headers)),this.method=Wt(E.method||this.method||"GET"),this.mode=E.mode||this.mode||null,this.signal=E.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&$)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody($)}jt.prototype.clone=function(){return new jt(this,{body:this._bodyInit})};function er(v){var E=new FormData;return v.trim().split("&").forEach(function($){if($){var K=$.split("="),G=K.shift().replace(/\+/g," "),F=K.join("=").replace(/\+/g," ");E.append(decodeURIComponent(G),decodeURIComponent(F))}}),E}function jn(v){var E=new J,$=v.replace(/\r?\n[\t ]+/g," ");return $.split(/\r?\n/).forEach(function(K){var G=K.split(":"),F=G.shift().trim();if(F){var ne=G.join(":").trim();E.append(F,ne)}}),E}Ot.call(jt.prototype);function qt(v,E){E||(E={}),this.type="default",this.status=E.status===void 0?200:E.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in E?E.statusText:"OK",this.headers=new J(E.headers),this.url=E.url||"",this._initBody(v)}Ot.call(qt.prototype),qt.prototype.clone=function(){return new qt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new J(this.headers),url:this.url})},qt.error=function(){var v=new qt(null,{status:0,statusText:""});return v.type="error",v};var xn=[301,302,303,307,308];qt.redirect=function(v,E){if(xn.indexOf(E)===-1)throw new RangeError("Invalid status code");return new qt(null,{status:E,headers:{location:v}})},O.DOMException=P.DOMException;try{new O.DOMException}catch{O.DOMException=function(E,$){this.message=E,this.name=$;var K=Error(E);this.stack=K.stack},O.DOMException.prototype=Object.create(Error.prototype),O.DOMException.prototype.constructor=O.DOMException}function rr(v,E){return new Promise(function($,K){var G=new jt(v,E);if(G.signal&&G.signal.aborted)return K(new O.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function ne(){F.abort()}F.onload=function(){var gt={status:F.status,statusText:F.statusText,headers:jn(F.getAllResponseHeaders()||"")};gt.url="responseURL"in F?F.responseURL:gt.headers.get("X-Request-URL");var nr="response"in F?F.response:F.responseText;$(new qt(nr,gt))},F.onerror=function(){K(new TypeError("Network request failed"))},F.ontimeout=function(){K(new TypeError("Network request failed"))},F.onabort=function(){K(new O.DOMException("Aborted","AbortError"))},F.open(G.method,G.url,!0),G.credentials==="include"?F.withCredentials=!0:G.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&N.blob&&(F.responseType="blob"),G.headers.forEach(function(gt,nr){F.setRequestHeader(nr,gt)}),G.signal&&(G.signal.addEventListener("abort",ne),F.onreadystatechange=function(){F.readyState===4&&G.signal.removeEventListener("abort",ne)}),F.send(typeof G._bodyInit>"u"?null:G._bodyInit)})}return rr.polyfill=!0,P.fetch||(P.fetch=rr,P.Headers=J,P.Request=jt,P.Response=qt),O.Headers=J,O.Request=jt,O.Response=qt,O.fetch=rr,Object.defineProperty(O,"__esModule",{value:!0}),O})({})})(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var g=f;s=g.fetch,s.default=g.fetch,s.fetch=g.fetch,s.Headers=g.Headers,s.Request=g.Request,s.Response=g.Response,b.exports=s})(es,es.exports);var Uv=es.exports;const qo=ke.getDefaultExportFromCjs(Uv),Fv=b=>JSON.stringify(b,(s,i)=>typeof i=="bigint"?i.toString()+"n":i),zv=b=>{const s=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,i=b.replace(s,'$1"$2n"$3');return JSON.parse(i,(f,g)=>typeof g=="string"&&g.match(/^\d+n$/)?BigInt(g.substring(0,g.length-1)):g)};function Wv(b){if(typeof b!="string")throw new Error(`Cannot safe json parse value of type ${typeof b}`);try{return zv(b)}catch{return b}}function ko(b){return typeof b=="string"?b:Fv(b)||""}const Jv={Accept:"application/json","Content-Type":"application/json"},Gv="POST",Mo={headers:Jv,method:Gv},Bo=10;class Oe{constructor(s,i=!1){if(this.url=s,this.disableProviderPing=i,this.events=new ke.eventsExports.EventEmitter,this.isAvailable=!1,this.registering=!1,!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);this.url=s,this.disableProviderPing=i}get connected(){return this.isAvailable}get connecting(){return this.registering}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}off(s,i){this.events.off(s,i)}removeListener(s,i){this.events.removeListener(s,i)}async open(s=this.url){await this.register(s)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(s,i){this.isAvailable||await this.register();try{const f=ko(s),P=await(await qo(this.url,Object.assign(Object.assign({},Mo),{body:f}))).json();this.onPayload({data:P})}catch(f){this.onError(s.id,f)}}async register(s=this.url){if(!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((f,g)=>{this.events.once("register_error",P=>{this.resetMaxListeners(),g(P)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return g(new Error("HTTP connection is missing or invalid"));f()})})}this.url=s,this.registering=!0;try{if(!this.disableProviderPing){const i=ko({id:1,jsonrpc:"2.0",method:"test",params:[]});await qo(s,Object.assign(Object.assign({},Mo),{body:i}))}this.onOpen()}catch(i){const f=this.parseError(i);throw this.events.emit("register_error",f),this.onClose(),f}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(s){if(typeof s.data>"u")return;const i=typeof s.data=="string"?Wv(s.data):s.data;this.events.emit("payload",i)}onError(s,i){const f=this.parseError(i),g=f.message||f.toString(),P=pt.formatJsonRpcError(s,g);this.events.emit("payload",P)}parseError(s,i=this.url){return pt.parseConnectionError(s,i,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Bo&&this.events.setMaxListeners(Bo)}}const No="error",Qv="wss://relay.walletconnect.com",Vv="wc",Kv="universal_provider",Lo=`${Vv}@2:${Kv}:`,Zv="https://rpc.walletconnect.com/v1/",de={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ke.dist.global<"u"?ke.dist.global:typeof self<"u"?self:{},rs={exports:{}};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("./index-DTOQHhz5.js"),nt=require("./index.es-CM2UFhO6.js"),pt=require("./index.es-CnPkjyNd.js");var es={exports:{}};(function(b,s){var i=typeof self<"u"?self:ke.commonjsGlobal,f=function(){function P(){this.fetch=!1,this.DOMException=i.DOMException}return P.prototype=i,new P}();(function(P){(function(O){var N={searchParams:"URLSearchParams"in P,iterable:"Symbol"in P&&"iterator"in Symbol,blob:"FileReader"in P&&"Blob"in P&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in P,arrayBuffer:"ArrayBuffer"in P};function ut(v){return v&&DataView.prototype.isPrototypeOf(v)}if(N.arrayBuffer)var st=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],dt=ArrayBuffer.isView||function(v){return v&&st.indexOf(Object.prototype.toString.call(v))>-1};function it(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function vt(v){return typeof v!="string"&&(v=String(v)),v}function ct(v){var E={next:function(){var $=v.shift();return{done:$===void 0,value:$}}};return N.iterable&&(E[Symbol.iterator]=function(){return E}),E}function J(v){this.map={},v instanceof J?v.forEach(function(E,$){this.append($,E)},this):Array.isArray(v)?v.forEach(function(E){this.append(E[0],E[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(E){this.append(E,v[E])},this)}J.prototype.append=function(v,E){v=it(v),E=vt(E);var $=this.map[v];this.map[v]=$?$+", "+E:E},J.prototype.delete=function(v){delete this.map[it(v)]},J.prototype.get=function(v){return v=it(v),this.has(v)?this.map[v]:null},J.prototype.has=function(v){return this.map.hasOwnProperty(it(v))},J.prototype.set=function(v,E){this.map[it(v)]=vt(E)},J.prototype.forEach=function(v,E){for(var $ in this.map)this.map.hasOwnProperty($)&&v.call(E,this.map[$],$,this)},J.prototype.keys=function(){var v=[];return this.forEach(function(E,$){v.push($)}),ct(v)},J.prototype.values=function(){var v=[];return this.forEach(function(E){v.push(E)}),ct(v)},J.prototype.entries=function(){var v=[];return this.forEach(function(E,$){v.push([$,E])}),ct(v)},N.iterable&&(J.prototype[Symbol.iterator]=J.prototype.entries);function ve(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function yt(v){return new Promise(function(E,$){v.onload=function(){E(v.result)},v.onerror=function(){$(v.error)}})}function ee(v){var E=new FileReader,$=yt(E);return E.readAsArrayBuffer(v),$}function jr(v){var E=new FileReader,$=yt(E);return E.readAsText(v),$}function Ht(v){for(var E=new Uint8Array(v),$=new Array(E.length),K=0;K<E.length;K++)$[K]=String.fromCharCode(E[K]);return $.join("")}function re(v){if(v.slice)return v.slice(0);var E=new Uint8Array(v.byteLength);return E.set(new Uint8Array(v)),E.buffer}function Ot(){return this.bodyUsed=!1,this._initBody=function(v){this._bodyInit=v,v?typeof v=="string"?this._bodyText=v:N.blob&&Blob.prototype.isPrototypeOf(v)?this._bodyBlob=v:N.formData&&FormData.prototype.isPrototypeOf(v)?this._bodyFormData=v:N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)?this._bodyText=v.toString():N.arrayBuffer&&N.blob&&ut(v)?(this._bodyArrayBuffer=re(v.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):N.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(v)||dt(v))?this._bodyArrayBuffer=re(v):this._bodyText=v=Object.prototype.toString.call(v):this._bodyText="",this.headers.get("content-type")||(typeof v=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},N.blob&&(this.blob=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?ve(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(ee)}),this.text=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return jr(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ht(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},N.formData&&(this.formData=function(){return this.text().then(er)}),this.json=function(){return this.text().then(JSON.parse)},this}var ge=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Wt(v){var E=v.toUpperCase();return ge.indexOf(E)>-1?E:v}function jt(v,E){E=E||{};var $=E.body;if(v instanceof jt){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,E.headers||(this.headers=new J(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!$&&v._bodyInit!=null&&($=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new J(E.headers)),this.method=Wt(E.method||this.method||"GET"),this.mode=E.mode||this.mode||null,this.signal=E.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&$)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody($)}jt.prototype.clone=function(){return new jt(this,{body:this._bodyInit})};function er(v){var E=new FormData;return v.trim().split("&").forEach(function($){if($){var K=$.split("="),G=K.shift().replace(/\+/g," "),F=K.join("=").replace(/\+/g," ");E.append(decodeURIComponent(G),decodeURIComponent(F))}}),E}function jn(v){var E=new J,$=v.replace(/\r?\n[\t ]+/g," ");return $.split(/\r?\n/).forEach(function(K){var G=K.split(":"),F=G.shift().trim();if(F){var ne=G.join(":").trim();E.append(F,ne)}}),E}Ot.call(jt.prototype);function qt(v,E){E||(E={}),this.type="default",this.status=E.status===void 0?200:E.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in E?E.statusText:"OK",this.headers=new J(E.headers),this.url=E.url||"",this._initBody(v)}Ot.call(qt.prototype),qt.prototype.clone=function(){return new qt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new J(this.headers),url:this.url})},qt.error=function(){var v=new qt(null,{status:0,statusText:""});return v.type="error",v};var xn=[301,302,303,307,308];qt.redirect=function(v,E){if(xn.indexOf(E)===-1)throw new RangeError("Invalid status code");return new qt(null,{status:E,headers:{location:v}})},O.DOMException=P.DOMException;try{new O.DOMException}catch{O.DOMException=function(E,$){this.message=E,this.name=$;var K=Error(E);this.stack=K.stack},O.DOMException.prototype=Object.create(Error.prototype),O.DOMException.prototype.constructor=O.DOMException}function rr(v,E){return new Promise(function($,K){var G=new jt(v,E);if(G.signal&&G.signal.aborted)return K(new O.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function ne(){F.abort()}F.onload=function(){var gt={status:F.status,statusText:F.statusText,headers:jn(F.getAllResponseHeaders()||"")};gt.url="responseURL"in F?F.responseURL:gt.headers.get("X-Request-URL");var nr="response"in F?F.response:F.responseText;$(new qt(nr,gt))},F.onerror=function(){K(new TypeError("Network request failed"))},F.ontimeout=function(){K(new TypeError("Network request failed"))},F.onabort=function(){K(new O.DOMException("Aborted","AbortError"))},F.open(G.method,G.url,!0),G.credentials==="include"?F.withCredentials=!0:G.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&N.blob&&(F.responseType="blob"),G.headers.forEach(function(gt,nr){F.setRequestHeader(nr,gt)}),G.signal&&(G.signal.addEventListener("abort",ne),F.onreadystatechange=function(){F.readyState===4&&G.signal.removeEventListener("abort",ne)}),F.send(typeof G._bodyInit>"u"?null:G._bodyInit)})}return rr.polyfill=!0,P.fetch||(P.fetch=rr,P.Headers=J,P.Request=jt,P.Response=qt),O.Headers=J,O.Request=jt,O.Response=qt,O.fetch=rr,Object.defineProperty(O,"__esModule",{value:!0}),O})({})})(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var g=f;s=g.fetch,s.default=g.fetch,s.fetch=g.fetch,s.Headers=g.Headers,s.Request=g.Request,s.Response=g.Response,b.exports=s})(es,es.exports);var Uv=es.exports;const qo=ke.getDefaultExportFromCjs(Uv),Fv=b=>JSON.stringify(b,(s,i)=>typeof i=="bigint"?i.toString()+"n":i),zv=b=>{const s=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,i=b.replace(s,'$1"$2n"$3');return JSON.parse(i,(f,g)=>typeof g=="string"&&g.match(/^\d+n$/)?BigInt(g.substring(0,g.length-1)):g)};function Wv(b){if(typeof b!="string")throw new Error(`Cannot safe json parse value of type ${typeof b}`);try{return zv(b)}catch{return b}}function ko(b){return typeof b=="string"?b:Fv(b)||""}const Jv={Accept:"application/json","Content-Type":"application/json"},Gv="POST",Mo={headers:Jv,method:Gv},Bo=10;class Oe{constructor(s,i=!1){if(this.url=s,this.disableProviderPing=i,this.events=new ke.eventsExports.EventEmitter,this.isAvailable=!1,this.registering=!1,!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);this.url=s,this.disableProviderPing=i}get connected(){return this.isAvailable}get connecting(){return this.registering}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}off(s,i){this.events.off(s,i)}removeListener(s,i){this.events.removeListener(s,i)}async open(s=this.url){await this.register(s)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(s,i){this.isAvailable||await this.register();try{const f=ko(s),P=await(await qo(this.url,Object.assign(Object.assign({},Mo),{body:f}))).json();this.onPayload({data:P})}catch(f){this.onError(s.id,f)}}async register(s=this.url){if(!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((f,g)=>{this.events.once("register_error",P=>{this.resetMaxListeners(),g(P)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return g(new Error("HTTP connection is missing or invalid"));f()})})}this.url=s,this.registering=!0;try{if(!this.disableProviderPing){const i=ko({id:1,jsonrpc:"2.0",method:"test",params:[]});await qo(s,Object.assign(Object.assign({},Mo),{body:i}))}this.onOpen()}catch(i){const f=this.parseError(i);throw this.events.emit("register_error",f),this.onClose(),f}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(s){if(typeof s.data>"u")return;const i=typeof s.data=="string"?Wv(s.data):s.data;this.events.emit("payload",i)}onError(s,i){const f=this.parseError(i),g=f.message||f.toString(),P=pt.formatJsonRpcError(s,g);this.events.emit("payload",P)}parseError(s,i=this.url){return pt.parseConnectionError(s,i,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Bo&&this.events.setMaxListeners(Bo)}}const No="error",Qv="wss://relay.walletconnect.com",Vv="wc",Kv="universal_provider",Lo=`${Vv}@2:${Kv}:`,Zv="https://rpc.walletconnect.com/v1/",de={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ke.dist.global<"u"?ke.dist.global:typeof self<"u"?self:{},rs={exports:{}};/**
2
2
  * @license
3
3
  * Lodash <https://lodash.com/>
4
4
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -24,4 +24,4 @@ __p += '`),B&&(w+=`' +
24
24
  function print() { __p += __j.call(arguments, '') }
25
25
  `:`;
26
26
  `)+w+`return __p
27
- }`;var H=To(function(){return L(u,A+"return "+w).apply(i,c)});if(H.source=w,Ni(H))throw H;return H}function Vd(t){return U(t).toLowerCase()}function Kd(t){return U(t).toUpperCase()}function Zd(t,e,r){if(t=U(t),t&&(r||e===i))return Ls(t);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Qt(e),u=Us(n,a),c=Fs(n,a)+1;return Ce(n,u,c).join("")}function Yd(t,e,r){if(t=U(t),t&&(r||e===i))return t.slice(0,Ws(t)+1);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Fs(n,Qt(e))+1;return Ce(n,0,a).join("")}function Xd(t,e,r){if(t=U(t),t&&(r||e===i))return t.replace(Nn,"");if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Us(n,Qt(e));return Ce(n,a).join("")}function tv(t,e){var r=jn,n=qt;if(X(e)){var a="separator"in e?e.separator:a;r="length"in e?T(e.length):r,n="omission"in e?Dt(e.omission):n}t=U(t);var u=t.length;if(Fe(t)){var c=Qt(t);u=c.length}if(r>=u)return t;var h=r-ze(n);if(h<1)return n;var p=c?Ce(c,0,h).join(""):t.slice(0,h);if(a===i)return p+n;if(c&&(h+=p.length-h),Li(a)){if(t.slice(h).search(a)){var m,y=p;for(a.global||(a=ni(a.source,U(cs.exec(a))+"g")),a.lastIndex=0;m=a.exec(y);)var w=m.index;p=p.slice(0,w===i?h:w)}}else if(t.indexOf(Dt(a),h)!=h){var C=p.lastIndexOf(a);C>-1&&(p=p.slice(0,C))}return p+n}function ev(t){return t=U(t),t&&fu.test(t)?t.replace(as,xc):t}var rv=Ze(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),zi=Ta("toUpperCase");function Ro(t,e,r){return t=U(t),e=r?i:e,e===i?Cc(t)?Rc(t):vc(t):t.match(e)||[]}var To=q(function(t,e){try{return xt(t,i,e)}catch(r){return Ni(r)?r:new D(r)}}),nv=ce(function(t,e){return Mt(e,function(r){r=te(r),oe(t,r,Mi(t[r],t))}),t});function iv(t){var e=t==null?0:t.length,r=j();return t=e?Z(t,function(n){if(typeof n[1]!="function")throw new Bt(O);return[r(n[0]),n[1]]}):[],q(function(n){for(var a=-1;++a<e;){var u=t[a];if(xt(u[0],this,n))return xt(u[1],this,n)}})}function sv(t){return xh(Lt(t,it))}function Wi(t){return function(){return t}}function av(t,e){return t==null||t!==t?e:t}var ov=Ha(),uv=Ha(!0);function At(t){return t}function Ji(t){return fa(typeof t=="function"?t:Lt(t,it))}function cv(t){return pa(Lt(t,it))}function hv(t,e){return da(t,Lt(e,it))}var fv=q(function(t,e){return function(r){return yr(r,t,e)}}),lv=q(function(t,e){return function(r){return yr(t,r,e)}});function Gi(t,e,r){var n=ht(e),a=en(e,n);r==null&&!(X(e)&&(a.length||!n.length))&&(r=e,e=t,t=this,a=en(e,ht(e)));var u=!(X(r)&&"chain"in r)||!!r.chain,c=fe(t);return Mt(a,function(h){var p=e[h];t[h]=p,c&&(t.prototype[h]=function(){var m=this.__chain__;if(u||m){var y=t(this.__wrapped__),w=y.__actions__=Et(this.__actions__);return w.push({func:p,args:arguments,thisArg:t}),y.__chain__=m,y}return p.apply(t,me([this.value()],arguments))})}),t}function pv(){return ft._===this&&(ft._=Mc),this}function Qi(){}function dv(t){return t=T(t),q(function(e){return va(e,t)})}var vv=Ii(Z),gv=Ii(qs),_v=Ii(Kn);function $o(t){return Ri(t)?Zn(te(t)):Jh(t)}function mv(t){return function(e){return t==null?i:Te(t,e)}}var yv=ka(),wv=ka(!0);function Vi(){return[]}function Ki(){return!1}function bv(){return{}}function Pv(){return""}function Ev(){return!0}function Cv(t,e){if(t=T(t),t<1||t>G)return[];var r=gt,n=_t(t,gt);e=j(e),t-=gt;for(var a=ti(n,e);++r<t;)e(r);return a}function Iv(t){return R(t)?Z(t,te):Rt(t)?[t]:Et(Xa(U(t)))}function Av(t){var e=++qc;return U(t)+e}var Ov=un(function(t,e){return t+e},0),jv=Ai("ceil"),xv=un(function(t,e){return t/e},1),Sv=Ai("floor");function Dv(t){return t&&t.length?tn(t,At,fi):i}function Rv(t,e){return t&&t.length?tn(t,j(e,2),fi):i}function Tv(t){return Bs(t,At)}function $v(t,e){return Bs(t,j(e,2))}function Hv(t){return t&&t.length?tn(t,At,vi):i}function qv(t,e){return t&&t.length?tn(t,j(e,2),vi):i}var kv=un(function(t,e){return t*e},1),Mv=Ai("round"),Bv=un(function(t,e){return t-e},0);function Nv(t){return t&&t.length?Xn(t,At):0}function Lv(t,e){return t&&t.length?Xn(t,j(e,2)):0}return o.after=cp,o.ary=ho,o.assign=Kp,o.assignIn=Io,o.assignInWith=bn,o.assignWith=Zp,o.at=Yp,o.before=fo,o.bind=Mi,o.bindAll=nv,o.bindKey=lo,o.castArray=bp,o.chain=oo,o.chunk=Sf,o.compact=Df,o.concat=Rf,o.cond=iv,o.conforms=sv,o.constant=Wi,o.countBy=Nl,o.create=Xp,o.curry=po,o.curryRight=vo,o.debounce=go,o.defaults=td,o.defaultsDeep=ed,o.defer=hp,o.delay=fp,o.difference=Tf,o.differenceBy=$f,o.differenceWith=Hf,o.drop=qf,o.dropRight=kf,o.dropRightWhile=Mf,o.dropWhile=Bf,o.fill=Nf,o.filter=Ul,o.flatMap=Wl,o.flatMapDeep=Jl,o.flatMapDepth=Gl,o.flatten=no,o.flattenDeep=Lf,o.flattenDepth=Uf,o.flip=lp,o.flow=ov,o.flowRight=uv,o.fromPairs=Ff,o.functions=ud,o.functionsIn=cd,o.groupBy=Ql,o.initial=Wf,o.intersection=Jf,o.intersectionBy=Gf,o.intersectionWith=Qf,o.invert=fd,o.invertBy=ld,o.invokeMap=Kl,o.iteratee=Ji,o.keyBy=Zl,o.keys=ht,o.keysIn=It,o.map=vn,o.mapKeys=dd,o.mapValues=vd,o.matches=cv,o.matchesProperty=hv,o.memoize=_n,o.merge=gd,o.mergeWith=Ao,o.method=fv,o.methodOf=lv,o.mixin=Gi,o.negate=mn,o.nthArg=dv,o.omit=_d,o.omitBy=md,o.once=pp,o.orderBy=Yl,o.over=vv,o.overArgs=dp,o.overEvery=gv,o.overSome=_v,o.partial=Bi,o.partialRight=_o,o.partition=Xl,o.pick=yd,o.pickBy=Oo,o.property=$o,o.propertyOf=mv,o.pull=Yf,o.pullAll=so,o.pullAllBy=Xf,o.pullAllWith=tl,o.pullAt=el,o.range=yv,o.rangeRight=wv,o.rearg=vp,o.reject=rp,o.remove=rl,o.rest=gp,o.reverse=qi,o.sampleSize=ip,o.set=bd,o.setWith=Pd,o.shuffle=sp,o.slice=nl,o.sortBy=up,o.sortedUniq=hl,o.sortedUniqBy=fl,o.split=Wd,o.spread=_p,o.tail=ll,o.take=pl,o.takeRight=dl,o.takeRightWhile=vl,o.takeWhile=gl,o.tap=Dl,o.throttle=mp,o.thru=dn,o.toArray=Po,o.toPairs=jo,o.toPairsIn=xo,o.toPath=Iv,o.toPlainObject=Co,o.transform=Ed,o.unary=yp,o.union=_l,o.unionBy=ml,o.unionWith=yl,o.uniq=wl,o.uniqBy=bl,o.uniqWith=Pl,o.unset=Cd,o.unzip=ki,o.unzipWith=ao,o.update=Id,o.updateWith=Ad,o.values=tr,o.valuesIn=Od,o.without=El,o.words=Ro,o.wrap=wp,o.xor=Cl,o.xorBy=Il,o.xorWith=Al,o.zip=Ol,o.zipObject=jl,o.zipObjectDeep=xl,o.zipWith=Sl,o.entries=jo,o.entriesIn=xo,o.extend=Io,o.extendWith=bn,Gi(o,o),o.add=Ov,o.attempt=To,o.camelCase=Dd,o.capitalize=So,o.ceil=jv,o.clamp=jd,o.clone=Pp,o.cloneDeep=Cp,o.cloneDeepWith=Ip,o.cloneWith=Ep,o.conformsTo=Ap,o.deburr=Do,o.defaultTo=av,o.divide=xv,o.endsWith=Rd,o.eq=Kt,o.escape=Td,o.escapeRegExp=$d,o.every=Ll,o.find=Fl,o.findIndex=eo,o.findKey=rd,o.findLast=zl,o.findLastIndex=ro,o.findLastKey=nd,o.floor=Sv,o.forEach=uo,o.forEachRight=co,o.forIn=id,o.forInRight=sd,o.forOwn=ad,o.forOwnRight=od,o.get=Ui,o.gt=Op,o.gte=jp,o.has=hd,o.hasIn=Fi,o.head=io,o.identity=At,o.includes=Vl,o.indexOf=zf,o.inRange=xd,o.invoke=pd,o.isArguments=qe,o.isArray=R,o.isArrayBuffer=xp,o.isArrayLike=Ct,o.isArrayLikeObject=et,o.isBoolean=Sp,o.isBuffer=Ie,o.isDate=Dp,o.isElement=Rp,o.isEmpty=Tp,o.isEqual=$p,o.isEqualWith=Hp,o.isError=Ni,o.isFinite=qp,o.isFunction=fe,o.isInteger=mo,o.isLength=yn,o.isMap=yo,o.isMatch=kp,o.isMatchWith=Mp,o.isNaN=Bp,o.isNative=Np,o.isNil=Up,o.isNull=Lp,o.isNumber=wo,o.isObject=X,o.isObjectLike=tt,o.isPlainObject=Ir,o.isRegExp=Li,o.isSafeInteger=Fp,o.isSet=bo,o.isString=wn,o.isSymbol=Rt,o.isTypedArray=Xe,o.isUndefined=zp,o.isWeakMap=Wp,o.isWeakSet=Jp,o.join=Vf,o.kebabCase=Hd,o.last=Ft,o.lastIndexOf=Kf,o.lowerCase=qd,o.lowerFirst=kd,o.lt=Gp,o.lte=Qp,o.max=Dv,o.maxBy=Rv,o.mean=Tv,o.meanBy=$v,o.min=Hv,o.minBy=qv,o.stubArray=Vi,o.stubFalse=Ki,o.stubObject=bv,o.stubString=Pv,o.stubTrue=Ev,o.multiply=kv,o.nth=Zf,o.noConflict=pv,o.noop=Qi,o.now=gn,o.pad=Md,o.padEnd=Bd,o.padStart=Nd,o.parseInt=Ld,o.random=Sd,o.reduce=tp,o.reduceRight=ep,o.repeat=Ud,o.replace=Fd,o.result=wd,o.round=Mv,o.runInContext=l,o.sample=np,o.size=ap,o.snakeCase=zd,o.some=op,o.sortedIndex=il,o.sortedIndexBy=sl,o.sortedIndexOf=al,o.sortedLastIndex=ol,o.sortedLastIndexBy=ul,o.sortedLastIndexOf=cl,o.startCase=Jd,o.startsWith=Gd,o.subtract=Bv,o.sum=Nv,o.sumBy=Lv,o.template=Qd,o.times=Cv,o.toFinite=le,o.toInteger=T,o.toLength=Eo,o.toLower=Vd,o.toNumber=zt,o.toSafeInteger=Vp,o.toString=U,o.toUpper=Kd,o.trim=Zd,o.trimEnd=Yd,o.trimStart=Xd,o.truncate=tv,o.unescape=ev,o.uniqueId=Av,o.upperCase=rv,o.upperFirst=zi,o.each=uo,o.eachRight=co,o.first=io,Gi(o,function(){var t={};return Yt(o,function(e,r){z.call(o.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),o.VERSION=f,Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){o[t].placeholder=o}),Mt(["drop","take"],function(t,e){M.prototype[t]=function(r){r=r===i?1:ot(T(r),0);var n=this.__filtered__&&!e?new M(this):this.clone();return n.__filtered__?n.__takeCount__=_t(r,n.__takeCount__):n.__views__.push({size:_t(r,gt),type:t+(n.__dir__<0?"Right":"")}),n},M.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),Mt(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==v||r==$;M.prototype[t]=function(a){var u=this.clone();return u.__iteratees__.push({iteratee:j(a,3),type:r}),u.__filtered__=u.__filtered__||n,u}}),Mt(["head","last"],function(t,e){var r="take"+(e?"Right":"");M.prototype[t]=function(){return this[r](1).value()[0]}}),Mt(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");M.prototype[t]=function(){return this.__filtered__?new M(this):this[r](1)}}),M.prototype.compact=function(){return this.filter(At)},M.prototype.find=function(t){return this.filter(t).head()},M.prototype.findLast=function(t){return this.reverse().find(t)},M.prototype.invokeMap=q(function(t,e){return typeof t=="function"?new M(this):this.map(function(r){return yr(r,t,e)})}),M.prototype.reject=function(t){return this.filter(mn(j(t)))},M.prototype.slice=function(t,e){t=T(t);var r=this;return r.__filtered__&&(t>0||e<0)?new M(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(e=T(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},M.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},M.prototype.toArray=function(){return this.take(gt)},Yt(M.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),a=o[n?"take"+(e=="last"?"Right":""):e],u=n||/^find/.test(e);a&&(o.prototype[e]=function(){var c=this.__wrapped__,h=n?[1]:arguments,p=c instanceof M,m=h[0],y=p||R(c),w=function(k){var B=a.apply(o,me([k],h));return n&&C?B[0]:B};y&&r&&typeof m=="function"&&m.length!=1&&(p=y=!1);var C=this.__chain__,A=!!this.__actions__.length,x=u&&!C,H=p&&!A;if(!u&&y){c=H?c:new M(this);var S=t.apply(c,h);return S.__actions__.push({func:dn,args:[w],thisArg:i}),new Nt(S,C)}return x&&H?t.apply(this,h):(S=this.thru(w),x?n?S.value()[0]:S.value():S)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(t){var e=Br[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);o.prototype[t]=function(){var a=arguments;if(n&&!this.__chain__){var u=this.value();return e.apply(R(u)?u:[],a)}return this[r](function(c){return e.apply(R(c)?c:[],a)})}}),Yt(M.prototype,function(t,e){var r=o[e];if(r){var n=r.name+"";z.call(Qe,n)||(Qe[n]=[]),Qe[n].push({name:e,func:r})}}),Qe[on(i,ee).name]=[{name:"wrapper",func:i}],M.prototype.clone=th,M.prototype.reverse=eh,M.prototype.value=rh,o.prototype.at=Rl,o.prototype.chain=Tl,o.prototype.commit=$l,o.prototype.next=Hl,o.prototype.plant=kl,o.prototype.reverse=Ml,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=Bl,o.prototype.first=o.prototype.head,lr&&(o.prototype[lr]=ql),o},We=Tc();je?((je.exports=We)._=We,Jn._=We):ft._=We}).call(Ar)})(rs,rs.exports);var Yv=Object.defineProperty,Xv=Object.defineProperties,tg=Object.getOwnPropertyDescriptors,Uo=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,rg=Object.prototype.propertyIsEnumerable,Fo=(b,s,i)=>s in b?Yv(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Pn=(b,s)=>{for(var i in s||(s={}))eg.call(s,i)&&Fo(b,i,s[i]);if(Uo)for(var i of Uo(s))rg.call(s,i)&&Fo(b,i,s[i]);return b},ng=(b,s)=>Xv(b,tg(s));function Ae(b,s,i){var f;const g=nt.ve(b);return((f=s.rpcMap)==null?void 0:f[g.reference])||`${Zv}?chainId=${g.namespace}:${g.reference}&projectId=${i}`}function Me(b){return b.includes(":")?b.split(":")[1]:b}function Ko(b){return b.map(s=>`${s.split(":")[0]}:${s.split(":")[1]}`)}function ig(b,s){const i=Object.keys(s.namespaces).filter(g=>g.includes(b));if(!i.length)return[];const f=[];return i.forEach(g=>{const P=s.namespaces[g].accounts;f.push(...P)}),f}function sg(b={},s={}){const i=zo(b),f=zo(s);return rs.exports.merge(i,f)}function zo(b){var s,i,f,g;const P={};if(!nt.B(b))return P;for(const[O,N]of Object.entries(b)){const ut=nt.oe(O)?[O]:N.chains,st=N.methods||[],dt=N.events||[],it=N.rpcMap||{},vt=nt.en(O);P[vt]=ng(Pn(Pn({},P[vt]),N),{chains:nt.S(ut,(s=P[vt])==null?void 0:s.chains),methods:nt.S(st,(i=P[vt])==null?void 0:i.methods),events:nt.S(dt,(f=P[vt])==null?void 0:f.events),rpcMap:Pn(Pn({},it),(g=P[vt])==null?void 0:g.rpcMap)})}return P}function ag(b){return b.includes(":")?b.split(":")[2]:b}function og(b){const s={};for(const[i,f]of Object.entries(b)){const g=f.methods||[],P=f.events||[],O=f.accounts||[],N=nt.oe(i)?[i]:f.chains?f.chains:Ko(f.accounts);s[i]={chains:N,methods:g,events:P,accounts:O}}return s}function Zi(b){return typeof b=="number"?b:b.includes("0x")?parseInt(b,16):b.includes(":")?Number(b.split(":")[1]):Number(b)}const Zo={},Y=b=>Zo[b],Yi=(b,s)=>{Zo[b]=s};class ug{constructor(s){this.name="polkadot",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class cg{constructor(s){this.name="eip155",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(s){switch(s.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(s);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(s.request.method)?await this.client.request(s):this.getHttpProvider().request(s.request)}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(parseInt(s),i),this.chainId=parseInt(s),this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}createHttpProvider(s,i){const f=i||Ae(`${this.name}:${s}`,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=parseInt(Me(i));s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}getHttpProvider(){const s=this.chainId,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}async handleSwitchChain(s){var i,f;let g=s.request.params?(i=s.request.params[0])==null?void 0:i.chainId:"0x0";g=g.startsWith("0x")?g:`0x${g}`;const P=parseInt(g,16);if(this.isChainApproved(P))this.setDefaultChain(`${P}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:s.topic,request:{method:s.request.method,params:[{chainId:g}]},chainId:(f=this.namespace.chains)==null?void 0:f[0]}),this.setDefaultChain(`${P}`);else throw new Error(`Failed to switch to chain 'eip155:${P}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(s){return this.namespace.chains.includes(`${this.name}:${s}`)}}class hg{constructor(s){this.name="solana",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class fg{constructor(s){this.name="cosmos",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class lg{constructor(s){this.name="cip34",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{const f=this.getCardanoRPCUrl(i),g=Me(i);s[g]=this.createHttpProvider(g,f)}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}getCardanoRPCUrl(s){const i=this.namespace.rpcMap;if(i)return i[s]}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||this.getCardanoRPCUrl(s);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class pg{constructor(s){this.name="elrond",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class dg{constructor(s){this.name="multiversx",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class vg{constructor(s){this.name="near",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){if(this.chainId=s,!this.httpProviders[s]){const f=i||Ae(`${this.name}:${s}`,this.namespace);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);this.setHttpProvider(s,f)}this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;s[i]=this.createHttpProvider(i,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace);return typeof f>"u"?void 0:new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}var gg=Object.defineProperty,_g=Object.defineProperties,mg=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,yg=Object.prototype.hasOwnProperty,wg=Object.prototype.propertyIsEnumerable,Jo=(b,s,i)=>s in b?gg(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,En=(b,s)=>{for(var i in s||(s={}))yg.call(s,i)&&Jo(b,i,s[i]);if(Wo)for(var i of Wo(s))wg.call(s,i)&&Jo(b,i,s[i]);return b},Xi=(b,s)=>_g(b,mg(s));class ns{constructor(s){this.events=new ke.EventEmitter,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=s,this.logger=typeof(s==null?void 0:s.logger)<"u"&&typeof(s==null?void 0:s.logger)!="string"?s.logger:pt.cjs.pino(pt.cjs.getDefaultLoggerOptions({level:(s==null?void 0:s.logger)||No})),this.disableProviderPing=(s==null?void 0:s.disableProviderPing)||!1}static async init(s){const i=new ns(s);return await i.initialize(),i}async request(s,i){const[f,g]=this.validateChain(i);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(f).request({request:En({},s),chainId:`${f}:${g}`,topic:this.session.topic})}sendAsync(s,i,f){const g=new Date().getTime();this.request(s,f).then(P=>i(null,pt.formatJsonRpcResult(g,P))).catch(P=>i(P,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 s;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(s=this.session)==null?void 0:s.topic,reason:nt.U("USER_DISCONNECTED")}),await this.cleanup()}async connect(s){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(s),await this.cleanupPendingPairings(),!s.skipPairing)return await this.pair(s.pairingTopic)}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}removeListener(s,i){this.events.removeListener(s,i)}off(s,i){this.events.off(s,i)}get isWalletConnect(){return!0}async pair(s){this.shouldAbortPairingAttempt=!1;let i=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(i>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:f,approval:g}=await this.client.connect({pairingTopic:s,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});f&&(this.uri=f,this.events.emit("display_uri",f)),await g().then(P=>{this.session=P,this.namespaces||(this.namespaces=og(P.namespaces),this.persist("namespaces",this.namespaces))}).catch(P=>{if(P.message!==pt.oe)throw P;i++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(s,i){try{if(!this.session)return;const[f,g]=this.validateChain(s);this.getProvider(f).setDefaultChain(g,i)}catch(f){if(!/Please call connect/.test(f.message))throw f}}async cleanupPendingPairings(s={}){this.logger.info("Cleaning up inactive pairings...");const i=this.client.pairing.getAll();if(nt.k(i)){for(const f of i)s.deletePairings?this.client.core.expirer.set(f.topic,0):await this.client.core.relayer.subscriber.unsubscribe(f.topic);this.logger.info(`Inactive pairings cleared: ${i.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 s=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[s]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await pt.Q.init({logger:this.providerOpts.logger||No,relayUrl:this.providerOpts.relayUrl||Qv,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),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 s=[...new Set(Object.keys(this.session.namespaces).map(i=>nt.en(i)))];Yi("client",this.client),Yi("events",this.events),Yi("disableProviderPing",this.disableProviderPing),s.forEach(i=>{if(!this.session)return;const f=ig(i,this.session),g=Ko(f),P=sg(this.namespaces,this.optionalNamespaces),O=Xi(En({},P[i]),{accounts:f,chains:g});switch(i){case"eip155":this.rpcProviders[i]=new cg({namespace:O});break;case"solana":this.rpcProviders[i]=new hg({namespace:O});break;case"cosmos":this.rpcProviders[i]=new fg({namespace:O});break;case"polkadot":this.rpcProviders[i]=new ug({namespace:O});break;case"cip34":this.rpcProviders[i]=new lg({namespace:O});break;case"elrond":this.rpcProviders[i]=new pg({namespace:O});break;case"multiversx":this.rpcProviders[i]=new dg({namespace:O});break;case"near":this.rpcProviders[i]=new vg({namespace:O});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",s=>{this.events.emit("session_ping",s)}),this.client.on("session_event",s=>{const{params:i}=s,{event:f}=i;if(f.name==="accountsChanged"){const g=f.data;g&&nt.k(g)&&this.events.emit("accountsChanged",g.map(ag))}else if(f.name==="chainChanged"){const g=i.chainId,P=i.event.data,O=nt.en(g),N=Zi(g)!==Zi(P)?`${O}:${Zi(P)}`:g;this.onChainChanged(N)}else this.events.emit(f.name,f.data);this.events.emit("session_event",s)}),this.client.on("session_update",({topic:s,params:i})=>{var f;const{namespaces:g}=i,P=(f=this.client)==null?void 0:f.session.get(s);this.session=Xi(En({},P),{namespaces:g}),this.onSessionUpdate(),this.events.emit("session_update",{topic:s,params:i})}),this.client.on("session_delete",async s=>{await this.cleanup(),this.events.emit("session_delete",s),this.events.emit("disconnect",Xi(En({},nt.U("USER_DISCONNECTED")),{data:s.topic}))}),this.on(de.DEFAULT_CHAIN_CHANGED,s=>{this.onChainChanged(s,!0)})}getProvider(s){if(!this.rpcProviders[s])throw new Error(`Provider not found: ${s}`);return this.rpcProviders[s]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(s=>{var i;this.getProvider(s).updateNamespace((i=this.session)==null?void 0:i.namespaces[s])})}setNamespaces(s){const{namespaces:i,optionalNamespaces:f,sessionProperties:g}=s;i&&Object.keys(i).length&&(this.namespaces=i),f&&Object.keys(f).length&&(this.optionalNamespaces=f),this.sessionProperties=g,this.persist("namespaces",i),this.persist("optionalNamespaces",f)}validateChain(s){const[i,f]=(s==null?void 0:s.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,f];if(i&&!Object.keys(this.namespaces||{}).map(O=>nt.en(O)).includes(i))throw new Error(`Namespace '${i}' is not configured. Please call connect() first with namespace config.`);if(i&&f)return[i,f];const g=nt.en(Object.keys(this.namespaces)[0]),P=this.rpcProviders[g].getDefaultChain();return[g,P]}async requestAccounts(){const[s]=this.validateChain();return await this.getProvider(s).requestAccounts()}onChainChanged(s,i=!1){var f;if(!this.namespaces)return;const[g,P]=this.validateChain(s);i||this.getProvider(g).setDefaultChain(P),((f=this.namespaces[g])!=null?f:this.namespaces[`${g}:${P}`]).defaultChain=P,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",P)}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(s,i){this.client.core.storage.setItem(`${Lo}/${s}`,i)}async getFromStore(s){return await this.client.core.storage.getItem(`${Lo}/${s}`)}}const bg=ns,Pg="wc",Eg="ethereum_provider",Cg=`${Pg}@2:${Eg}:`,Ig="https://rpc.walletconnect.com/v1/",Cn=["eth_sendTransaction","personal_sign"],Yo=["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"],In=["chainChanged","accountsChanged"],Xo=["chainChanged","accountsChanged","message","disconnect","connect"];var Ag=Object.defineProperty,Og=Object.defineProperties,jg=Object.getOwnPropertyDescriptors,Go=Object.getOwnPropertySymbols,xg=Object.prototype.hasOwnProperty,Sg=Object.prototype.propertyIsEnumerable,Qo=(b,s,i)=>s in b?Ag(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Or=(b,s)=>{for(var i in s||(s={}))xg.call(s,i)&&Qo(b,i,s[i]);if(Go)for(var i of Go(s))Sg.call(s,i)&&Qo(b,i,s[i]);return b},Vo=(b,s)=>Og(b,jg(s));function An(b){return Number(b[0].split(":")[1])}function ts(b){return`0x${b.toString(16)}`}function Dg(b){const{chains:s,optionalChains:i,methods:f,optionalMethods:g,events:P,optionalEvents:O,rpcMap:N}=b;if(!nt.k(s))throw new Error("Invalid chains");const ut={chains:s,methods:f||Cn,events:P||In,rpcMap:Or({},s.length?{[An(s)]:N[An(s)]}:{})},st=P==null?void 0:P.filter(ct=>!In.includes(ct)),dt=f==null?void 0:f.filter(ct=>!Cn.includes(ct));if(!i&&!O&&!g&&!(st!=null&&st.length)&&!(dt!=null&&dt.length))return{required:s.length?ut:void 0};const it=(st==null?void 0:st.length)&&(dt==null?void 0:dt.length)||!i,vt={chains:[...new Set(it?ut.chains.concat(i||[]):i)],methods:[...new Set(ut.methods.concat(g!=null&&g.length?g:Yo))],events:[...new Set(ut.events.concat(O!=null&&O.length?O:Xo))],rpcMap:N};return{required:s.length?ut:void 0,optional:i.length?vt:void 0}}class On{constructor(){this.events=new ke.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Cg,this.on=(s,i)=>(this.events.on(s,i),this),this.once=(s,i)=>(this.events.once(s,i),this),this.removeListener=(s,i)=>(this.events.removeListener(s,i),this),this.off=(s,i)=>(this.events.off(s,i),this),this.parseAccount=s=>this.isCompatibleChainId(s)?this.parseAccountId(s).address:s,this.signer={},this.rpc={}}static async init(s){const i=new On;return await i.initialize(s),i}async request(s){return await this.signer.request(s,this.formatChainId(this.chainId))}sendAsync(s,i){this.signer.sendAsync(s,i,this.formatChainId(this.chainId))}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(s){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(s);const{required:i,optional:f}=Dg(this.rpc);try{const g=await new Promise(async(O,N)=>{var ut;this.rpc.showQrModal&&((ut=this.modal)==null||ut.subscribeModal(st=>{!st.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),N(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Vo(Or({namespaces:Or({},i&&{[this.namespace]:i})},f&&{optionalNamespaces:{[this.namespace]:f}}),{pairingTopic:s==null?void 0:s.pairingTopic})).then(st=>{O(st)}).catch(st=>{N(new Error(st.message))})});if(!g)return;const P=nt.Un(g.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:P),this.setAccounts(P),this.events.emit("connect",{chainId:ts(this.chainId)})}catch(g){throw this.signer.logger.error(g),g}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",s=>{const{params:i}=s,{event:f}=i;f.name==="accountsChanged"?(this.accounts=this.parseAccounts(f.data),this.events.emit("accountsChanged",this.accounts)):f.name==="chainChanged"?this.setChainId(this.formatChainId(f.data)):this.events.emit(f.name,f.data),this.events.emit("session_event",s)}),this.signer.on("chainChanged",s=>{const i=parseInt(s);this.chainId=i,this.events.emit("chainChanged",ts(this.chainId)),this.persist()}),this.signer.on("session_update",s=>{this.events.emit("session_update",s)}),this.signer.on("session_delete",s=>{this.reset(),this.events.emit("session_delete",s),this.events.emit("disconnect",Vo(Or({},nt.U("USER_DISCONNECTED")),{data:s.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",s=>{var i,f;this.rpc.showQrModal&&((i=this.modal)==null||i.closeModal(),(f=this.modal)==null||f.openModal({uri:s})),this.events.emit("display_uri",s)})}switchEthereumChain(s){this.request({method:"wallet_switchEthereumChain",params:[{chainId:s.toString(16)}]})}isCompatibleChainId(s){return typeof s=="string"?s.startsWith(`${this.namespace}:`):!1}formatChainId(s){return`${this.namespace}:${s}`}parseChainId(s){return Number(s.split(":")[1])}setChainIds(s){const i=s.filter(f=>this.isCompatibleChainId(f)).map(f=>this.parseChainId(f));i.length&&(this.chainId=i[0],this.events.emit("chainChanged",ts(this.chainId)),this.persist())}setChainId(s){if(this.isCompatibleChainId(s)){const i=this.parseChainId(s);this.chainId=i,this.switchEthereumChain(i)}}parseAccountId(s){const[i,f,g]=s.split(":");return{chainId:`${i}:${f}`,address:g}}setAccounts(s){this.accounts=s.filter(i=>this.parseChainId(this.parseAccountId(i).chainId)===this.chainId).map(i=>this.parseAccountId(i).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(s){var i,f;const g=(i=s==null?void 0:s.chains)!=null?i:[],P=(f=s==null?void 0:s.optionalChains)!=null?f:[],O=g.concat(P);if(!O.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const N=g.length?(s==null?void 0:s.methods)||Cn:[],ut=g.length?(s==null?void 0:s.events)||In:[],st=(s==null?void 0:s.optionalMethods)||[],dt=(s==null?void 0:s.optionalEvents)||[],it=(s==null?void 0:s.rpcMap)||this.buildRpcMap(O,s.projectId),vt=(s==null?void 0:s.qrModalOptions)||void 0;return{chains:g==null?void 0:g.map(ct=>this.formatChainId(ct)),optionalChains:P.map(ct=>this.formatChainId(ct)),methods:N,events:ut,optionalMethods:st,optionalEvents:dt,rpcMap:it,showQrModal:!!(s!=null&&s.showQrModal),qrModalOptions:vt,projectId:s.projectId,metadata:s.metadata}}buildRpcMap(s,i){const f={};return s.forEach(g=>{f[g]=this.getRpcUrl(g,i)}),f}async initialize(s){if(this.rpc=this.getRpcConfig(s),this.chainId=this.rpc.chains.length?An(this.rpc.chains):An(this.rpc.optionalChains),this.signer=await bg.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:s.disableProviderPing,relayUrl:s.relayUrl,storageOptions:s.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let i;try{const{WalletConnectModal:f}=await Promise.resolve().then(()=>require("./index-DymMdCti.js")).then(g=>g.index);i=f}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(i)try{this.modal=new i(Or({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(f){throw this.signer.logger.error(f),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(s){if(!s)return;const{chains:i,optionalChains:f,rpcMap:g}=s;i&&nt.k(i)&&(this.rpc.chains=i.map(P=>this.formatChainId(P)),i.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)})),f&&nt.k(f)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=f==null?void 0:f.map(P=>this.formatChainId(P)),f.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)}))}getRpcUrl(s,i){var f;return((f=this.rpc.rpcMap)==null?void 0:f[s])||`${Ig}?chainId=eip155:${s}&projectId=${i||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const s=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),i=this.session.namespaces[`${this.namespace}:${s}`]?this.session.namespaces[`${this.namespace}:${s}`]:this.session.namespaces[this.namespace];this.setChainIds(s?[this.formatChainId(s)]:i==null?void 0:i.accounts),this.setAccounts(i==null?void 0:i.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(s){return typeof s=="string"||s instanceof String?[this.parseAccount(s)]:s.map(i=>this.parseAccount(i))}}const Rg=On;exports.EthereumProvider=Rg;exports.OPTIONAL_EVENTS=Xo;exports.OPTIONAL_METHODS=Yo;exports.REQUIRED_EVENTS=In;exports.REQUIRED_METHODS=Cn;exports.default=On;
27
+ }`;var H=To(function(){return L(u,A+"return "+w).apply(i,c)});if(H.source=w,Ni(H))throw H;return H}function Vd(t){return U(t).toLowerCase()}function Kd(t){return U(t).toUpperCase()}function Zd(t,e,r){if(t=U(t),t&&(r||e===i))return Ls(t);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Qt(e),u=Us(n,a),c=Fs(n,a)+1;return Ce(n,u,c).join("")}function Yd(t,e,r){if(t=U(t),t&&(r||e===i))return t.slice(0,Ws(t)+1);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Fs(n,Qt(e))+1;return Ce(n,0,a).join("")}function Xd(t,e,r){if(t=U(t),t&&(r||e===i))return t.replace(Nn,"");if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Us(n,Qt(e));return Ce(n,a).join("")}function tv(t,e){var r=jn,n=qt;if(X(e)){var a="separator"in e?e.separator:a;r="length"in e?T(e.length):r,n="omission"in e?Dt(e.omission):n}t=U(t);var u=t.length;if(Fe(t)){var c=Qt(t);u=c.length}if(r>=u)return t;var h=r-ze(n);if(h<1)return n;var p=c?Ce(c,0,h).join(""):t.slice(0,h);if(a===i)return p+n;if(c&&(h+=p.length-h),Li(a)){if(t.slice(h).search(a)){var m,y=p;for(a.global||(a=ni(a.source,U(cs.exec(a))+"g")),a.lastIndex=0;m=a.exec(y);)var w=m.index;p=p.slice(0,w===i?h:w)}}else if(t.indexOf(Dt(a),h)!=h){var C=p.lastIndexOf(a);C>-1&&(p=p.slice(0,C))}return p+n}function ev(t){return t=U(t),t&&fu.test(t)?t.replace(as,xc):t}var rv=Ze(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),zi=Ta("toUpperCase");function Ro(t,e,r){return t=U(t),e=r?i:e,e===i?Cc(t)?Rc(t):vc(t):t.match(e)||[]}var To=q(function(t,e){try{return xt(t,i,e)}catch(r){return Ni(r)?r:new D(r)}}),nv=ce(function(t,e){return Mt(e,function(r){r=te(r),oe(t,r,Mi(t[r],t))}),t});function iv(t){var e=t==null?0:t.length,r=j();return t=e?Z(t,function(n){if(typeof n[1]!="function")throw new Bt(O);return[r(n[0]),n[1]]}):[],q(function(n){for(var a=-1;++a<e;){var u=t[a];if(xt(u[0],this,n))return xt(u[1],this,n)}})}function sv(t){return xh(Lt(t,it))}function Wi(t){return function(){return t}}function av(t,e){return t==null||t!==t?e:t}var ov=Ha(),uv=Ha(!0);function At(t){return t}function Ji(t){return fa(typeof t=="function"?t:Lt(t,it))}function cv(t){return pa(Lt(t,it))}function hv(t,e){return da(t,Lt(e,it))}var fv=q(function(t,e){return function(r){return yr(r,t,e)}}),lv=q(function(t,e){return function(r){return yr(t,r,e)}});function Gi(t,e,r){var n=ht(e),a=en(e,n);r==null&&!(X(e)&&(a.length||!n.length))&&(r=e,e=t,t=this,a=en(e,ht(e)));var u=!(X(r)&&"chain"in r)||!!r.chain,c=fe(t);return Mt(a,function(h){var p=e[h];t[h]=p,c&&(t.prototype[h]=function(){var m=this.__chain__;if(u||m){var y=t(this.__wrapped__),w=y.__actions__=Et(this.__actions__);return w.push({func:p,args:arguments,thisArg:t}),y.__chain__=m,y}return p.apply(t,me([this.value()],arguments))})}),t}function pv(){return ft._===this&&(ft._=Mc),this}function Qi(){}function dv(t){return t=T(t),q(function(e){return va(e,t)})}var vv=Ii(Z),gv=Ii(qs),_v=Ii(Kn);function $o(t){return Ri(t)?Zn(te(t)):Jh(t)}function mv(t){return function(e){return t==null?i:Te(t,e)}}var yv=ka(),wv=ka(!0);function Vi(){return[]}function Ki(){return!1}function bv(){return{}}function Pv(){return""}function Ev(){return!0}function Cv(t,e){if(t=T(t),t<1||t>G)return[];var r=gt,n=_t(t,gt);e=j(e),t-=gt;for(var a=ti(n,e);++r<t;)e(r);return a}function Iv(t){return R(t)?Z(t,te):Rt(t)?[t]:Et(Xa(U(t)))}function Av(t){var e=++qc;return U(t)+e}var Ov=un(function(t,e){return t+e},0),jv=Ai("ceil"),xv=un(function(t,e){return t/e},1),Sv=Ai("floor");function Dv(t){return t&&t.length?tn(t,At,fi):i}function Rv(t,e){return t&&t.length?tn(t,j(e,2),fi):i}function Tv(t){return Bs(t,At)}function $v(t,e){return Bs(t,j(e,2))}function Hv(t){return t&&t.length?tn(t,At,vi):i}function qv(t,e){return t&&t.length?tn(t,j(e,2),vi):i}var kv=un(function(t,e){return t*e},1),Mv=Ai("round"),Bv=un(function(t,e){return t-e},0);function Nv(t){return t&&t.length?Xn(t,At):0}function Lv(t,e){return t&&t.length?Xn(t,j(e,2)):0}return o.after=cp,o.ary=ho,o.assign=Kp,o.assignIn=Io,o.assignInWith=bn,o.assignWith=Zp,o.at=Yp,o.before=fo,o.bind=Mi,o.bindAll=nv,o.bindKey=lo,o.castArray=bp,o.chain=oo,o.chunk=Sf,o.compact=Df,o.concat=Rf,o.cond=iv,o.conforms=sv,o.constant=Wi,o.countBy=Nl,o.create=Xp,o.curry=po,o.curryRight=vo,o.debounce=go,o.defaults=td,o.defaultsDeep=ed,o.defer=hp,o.delay=fp,o.difference=Tf,o.differenceBy=$f,o.differenceWith=Hf,o.drop=qf,o.dropRight=kf,o.dropRightWhile=Mf,o.dropWhile=Bf,o.fill=Nf,o.filter=Ul,o.flatMap=Wl,o.flatMapDeep=Jl,o.flatMapDepth=Gl,o.flatten=no,o.flattenDeep=Lf,o.flattenDepth=Uf,o.flip=lp,o.flow=ov,o.flowRight=uv,o.fromPairs=Ff,o.functions=ud,o.functionsIn=cd,o.groupBy=Ql,o.initial=Wf,o.intersection=Jf,o.intersectionBy=Gf,o.intersectionWith=Qf,o.invert=fd,o.invertBy=ld,o.invokeMap=Kl,o.iteratee=Ji,o.keyBy=Zl,o.keys=ht,o.keysIn=It,o.map=vn,o.mapKeys=dd,o.mapValues=vd,o.matches=cv,o.matchesProperty=hv,o.memoize=_n,o.merge=gd,o.mergeWith=Ao,o.method=fv,o.methodOf=lv,o.mixin=Gi,o.negate=mn,o.nthArg=dv,o.omit=_d,o.omitBy=md,o.once=pp,o.orderBy=Yl,o.over=vv,o.overArgs=dp,o.overEvery=gv,o.overSome=_v,o.partial=Bi,o.partialRight=_o,o.partition=Xl,o.pick=yd,o.pickBy=Oo,o.property=$o,o.propertyOf=mv,o.pull=Yf,o.pullAll=so,o.pullAllBy=Xf,o.pullAllWith=tl,o.pullAt=el,o.range=yv,o.rangeRight=wv,o.rearg=vp,o.reject=rp,o.remove=rl,o.rest=gp,o.reverse=qi,o.sampleSize=ip,o.set=bd,o.setWith=Pd,o.shuffle=sp,o.slice=nl,o.sortBy=up,o.sortedUniq=hl,o.sortedUniqBy=fl,o.split=Wd,o.spread=_p,o.tail=ll,o.take=pl,o.takeRight=dl,o.takeRightWhile=vl,o.takeWhile=gl,o.tap=Dl,o.throttle=mp,o.thru=dn,o.toArray=Po,o.toPairs=jo,o.toPairsIn=xo,o.toPath=Iv,o.toPlainObject=Co,o.transform=Ed,o.unary=yp,o.union=_l,o.unionBy=ml,o.unionWith=yl,o.uniq=wl,o.uniqBy=bl,o.uniqWith=Pl,o.unset=Cd,o.unzip=ki,o.unzipWith=ao,o.update=Id,o.updateWith=Ad,o.values=tr,o.valuesIn=Od,o.without=El,o.words=Ro,o.wrap=wp,o.xor=Cl,o.xorBy=Il,o.xorWith=Al,o.zip=Ol,o.zipObject=jl,o.zipObjectDeep=xl,o.zipWith=Sl,o.entries=jo,o.entriesIn=xo,o.extend=Io,o.extendWith=bn,Gi(o,o),o.add=Ov,o.attempt=To,o.camelCase=Dd,o.capitalize=So,o.ceil=jv,o.clamp=jd,o.clone=Pp,o.cloneDeep=Cp,o.cloneDeepWith=Ip,o.cloneWith=Ep,o.conformsTo=Ap,o.deburr=Do,o.defaultTo=av,o.divide=xv,o.endsWith=Rd,o.eq=Kt,o.escape=Td,o.escapeRegExp=$d,o.every=Ll,o.find=Fl,o.findIndex=eo,o.findKey=rd,o.findLast=zl,o.findLastIndex=ro,o.findLastKey=nd,o.floor=Sv,o.forEach=uo,o.forEachRight=co,o.forIn=id,o.forInRight=sd,o.forOwn=ad,o.forOwnRight=od,o.get=Ui,o.gt=Op,o.gte=jp,o.has=hd,o.hasIn=Fi,o.head=io,o.identity=At,o.includes=Vl,o.indexOf=zf,o.inRange=xd,o.invoke=pd,o.isArguments=qe,o.isArray=R,o.isArrayBuffer=xp,o.isArrayLike=Ct,o.isArrayLikeObject=et,o.isBoolean=Sp,o.isBuffer=Ie,o.isDate=Dp,o.isElement=Rp,o.isEmpty=Tp,o.isEqual=$p,o.isEqualWith=Hp,o.isError=Ni,o.isFinite=qp,o.isFunction=fe,o.isInteger=mo,o.isLength=yn,o.isMap=yo,o.isMatch=kp,o.isMatchWith=Mp,o.isNaN=Bp,o.isNative=Np,o.isNil=Up,o.isNull=Lp,o.isNumber=wo,o.isObject=X,o.isObjectLike=tt,o.isPlainObject=Ir,o.isRegExp=Li,o.isSafeInteger=Fp,o.isSet=bo,o.isString=wn,o.isSymbol=Rt,o.isTypedArray=Xe,o.isUndefined=zp,o.isWeakMap=Wp,o.isWeakSet=Jp,o.join=Vf,o.kebabCase=Hd,o.last=Ft,o.lastIndexOf=Kf,o.lowerCase=qd,o.lowerFirst=kd,o.lt=Gp,o.lte=Qp,o.max=Dv,o.maxBy=Rv,o.mean=Tv,o.meanBy=$v,o.min=Hv,o.minBy=qv,o.stubArray=Vi,o.stubFalse=Ki,o.stubObject=bv,o.stubString=Pv,o.stubTrue=Ev,o.multiply=kv,o.nth=Zf,o.noConflict=pv,o.noop=Qi,o.now=gn,o.pad=Md,o.padEnd=Bd,o.padStart=Nd,o.parseInt=Ld,o.random=Sd,o.reduce=tp,o.reduceRight=ep,o.repeat=Ud,o.replace=Fd,o.result=wd,o.round=Mv,o.runInContext=l,o.sample=np,o.size=ap,o.snakeCase=zd,o.some=op,o.sortedIndex=il,o.sortedIndexBy=sl,o.sortedIndexOf=al,o.sortedLastIndex=ol,o.sortedLastIndexBy=ul,o.sortedLastIndexOf=cl,o.startCase=Jd,o.startsWith=Gd,o.subtract=Bv,o.sum=Nv,o.sumBy=Lv,o.template=Qd,o.times=Cv,o.toFinite=le,o.toInteger=T,o.toLength=Eo,o.toLower=Vd,o.toNumber=zt,o.toSafeInteger=Vp,o.toString=U,o.toUpper=Kd,o.trim=Zd,o.trimEnd=Yd,o.trimStart=Xd,o.truncate=tv,o.unescape=ev,o.uniqueId=Av,o.upperCase=rv,o.upperFirst=zi,o.each=uo,o.eachRight=co,o.first=io,Gi(o,function(){var t={};return Yt(o,function(e,r){z.call(o.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),o.VERSION=f,Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){o[t].placeholder=o}),Mt(["drop","take"],function(t,e){M.prototype[t]=function(r){r=r===i?1:ot(T(r),0);var n=this.__filtered__&&!e?new M(this):this.clone();return n.__filtered__?n.__takeCount__=_t(r,n.__takeCount__):n.__views__.push({size:_t(r,gt),type:t+(n.__dir__<0?"Right":"")}),n},M.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),Mt(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==v||r==$;M.prototype[t]=function(a){var u=this.clone();return u.__iteratees__.push({iteratee:j(a,3),type:r}),u.__filtered__=u.__filtered__||n,u}}),Mt(["head","last"],function(t,e){var r="take"+(e?"Right":"");M.prototype[t]=function(){return this[r](1).value()[0]}}),Mt(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");M.prototype[t]=function(){return this.__filtered__?new M(this):this[r](1)}}),M.prototype.compact=function(){return this.filter(At)},M.prototype.find=function(t){return this.filter(t).head()},M.prototype.findLast=function(t){return this.reverse().find(t)},M.prototype.invokeMap=q(function(t,e){return typeof t=="function"?new M(this):this.map(function(r){return yr(r,t,e)})}),M.prototype.reject=function(t){return this.filter(mn(j(t)))},M.prototype.slice=function(t,e){t=T(t);var r=this;return r.__filtered__&&(t>0||e<0)?new M(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(e=T(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},M.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},M.prototype.toArray=function(){return this.take(gt)},Yt(M.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),a=o[n?"take"+(e=="last"?"Right":""):e],u=n||/^find/.test(e);a&&(o.prototype[e]=function(){var c=this.__wrapped__,h=n?[1]:arguments,p=c instanceof M,m=h[0],y=p||R(c),w=function(k){var B=a.apply(o,me([k],h));return n&&C?B[0]:B};y&&r&&typeof m=="function"&&m.length!=1&&(p=y=!1);var C=this.__chain__,A=!!this.__actions__.length,x=u&&!C,H=p&&!A;if(!u&&y){c=H?c:new M(this);var S=t.apply(c,h);return S.__actions__.push({func:dn,args:[w],thisArg:i}),new Nt(S,C)}return x&&H?t.apply(this,h):(S=this.thru(w),x?n?S.value()[0]:S.value():S)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(t){var e=Br[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);o.prototype[t]=function(){var a=arguments;if(n&&!this.__chain__){var u=this.value();return e.apply(R(u)?u:[],a)}return this[r](function(c){return e.apply(R(c)?c:[],a)})}}),Yt(M.prototype,function(t,e){var r=o[e];if(r){var n=r.name+"";z.call(Qe,n)||(Qe[n]=[]),Qe[n].push({name:e,func:r})}}),Qe[on(i,ee).name]=[{name:"wrapper",func:i}],M.prototype.clone=th,M.prototype.reverse=eh,M.prototype.value=rh,o.prototype.at=Rl,o.prototype.chain=Tl,o.prototype.commit=$l,o.prototype.next=Hl,o.prototype.plant=kl,o.prototype.reverse=Ml,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=Bl,o.prototype.first=o.prototype.head,lr&&(o.prototype[lr]=ql),o},We=Tc();je?((je.exports=We)._=We,Jn._=We):ft._=We}).call(Ar)})(rs,rs.exports);var Yv=Object.defineProperty,Xv=Object.defineProperties,tg=Object.getOwnPropertyDescriptors,Uo=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,rg=Object.prototype.propertyIsEnumerable,Fo=(b,s,i)=>s in b?Yv(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Pn=(b,s)=>{for(var i in s||(s={}))eg.call(s,i)&&Fo(b,i,s[i]);if(Uo)for(var i of Uo(s))rg.call(s,i)&&Fo(b,i,s[i]);return b},ng=(b,s)=>Xv(b,tg(s));function Ae(b,s,i){var f;const g=nt.ve(b);return((f=s.rpcMap)==null?void 0:f[g.reference])||`${Zv}?chainId=${g.namespace}:${g.reference}&projectId=${i}`}function Me(b){return b.includes(":")?b.split(":")[1]:b}function Ko(b){return b.map(s=>`${s.split(":")[0]}:${s.split(":")[1]}`)}function ig(b,s){const i=Object.keys(s.namespaces).filter(g=>g.includes(b));if(!i.length)return[];const f=[];return i.forEach(g=>{const P=s.namespaces[g].accounts;f.push(...P)}),f}function sg(b={},s={}){const i=zo(b),f=zo(s);return rs.exports.merge(i,f)}function zo(b){var s,i,f,g;const P={};if(!nt.B(b))return P;for(const[O,N]of Object.entries(b)){const ut=nt.oe(O)?[O]:N.chains,st=N.methods||[],dt=N.events||[],it=N.rpcMap||{},vt=nt.en(O);P[vt]=ng(Pn(Pn({},P[vt]),N),{chains:nt.S(ut,(s=P[vt])==null?void 0:s.chains),methods:nt.S(st,(i=P[vt])==null?void 0:i.methods),events:nt.S(dt,(f=P[vt])==null?void 0:f.events),rpcMap:Pn(Pn({},it),(g=P[vt])==null?void 0:g.rpcMap)})}return P}function ag(b){return b.includes(":")?b.split(":")[2]:b}function og(b){const s={};for(const[i,f]of Object.entries(b)){const g=f.methods||[],P=f.events||[],O=f.accounts||[],N=nt.oe(i)?[i]:f.chains?f.chains:Ko(f.accounts);s[i]={chains:N,methods:g,events:P,accounts:O}}return s}function Zi(b){return typeof b=="number"?b:b.includes("0x")?parseInt(b,16):b.includes(":")?Number(b.split(":")[1]):Number(b)}const Zo={},Y=b=>Zo[b],Yi=(b,s)=>{Zo[b]=s};class ug{constructor(s){this.name="polkadot",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class cg{constructor(s){this.name="eip155",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(s){switch(s.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(s);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(s.request.method)?await this.client.request(s):this.getHttpProvider().request(s.request)}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(parseInt(s),i),this.chainId=parseInt(s),this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}createHttpProvider(s,i){const f=i||Ae(`${this.name}:${s}`,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=parseInt(Me(i));s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}getHttpProvider(){const s=this.chainId,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}async handleSwitchChain(s){var i,f;let g=s.request.params?(i=s.request.params[0])==null?void 0:i.chainId:"0x0";g=g.startsWith("0x")?g:`0x${g}`;const P=parseInt(g,16);if(this.isChainApproved(P))this.setDefaultChain(`${P}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:s.topic,request:{method:s.request.method,params:[{chainId:g}]},chainId:(f=this.namespace.chains)==null?void 0:f[0]}),this.setDefaultChain(`${P}`);else throw new Error(`Failed to switch to chain 'eip155:${P}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(s){return this.namespace.chains.includes(`${this.name}:${s}`)}}class hg{constructor(s){this.name="solana",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class fg{constructor(s){this.name="cosmos",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class lg{constructor(s){this.name="cip34",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{const f=this.getCardanoRPCUrl(i),g=Me(i);s[g]=this.createHttpProvider(g,f)}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}getCardanoRPCUrl(s){const i=this.namespace.rpcMap;if(i)return i[s]}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||this.getCardanoRPCUrl(s);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class pg{constructor(s){this.name="elrond",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class dg{constructor(s){this.name="multiversx",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class vg{constructor(s){this.name="near",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){if(this.chainId=s,!this.httpProviders[s]){const f=i||Ae(`${this.name}:${s}`,this.namespace);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);this.setHttpProvider(s,f)}this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;s[i]=this.createHttpProvider(i,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace);return typeof f>"u"?void 0:new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}var gg=Object.defineProperty,_g=Object.defineProperties,mg=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,yg=Object.prototype.hasOwnProperty,wg=Object.prototype.propertyIsEnumerable,Jo=(b,s,i)=>s in b?gg(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,En=(b,s)=>{for(var i in s||(s={}))yg.call(s,i)&&Jo(b,i,s[i]);if(Wo)for(var i of Wo(s))wg.call(s,i)&&Jo(b,i,s[i]);return b},Xi=(b,s)=>_g(b,mg(s));class ns{constructor(s){this.events=new ke.EventEmitter,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=s,this.logger=typeof(s==null?void 0:s.logger)<"u"&&typeof(s==null?void 0:s.logger)!="string"?s.logger:pt.cjs.pino(pt.cjs.getDefaultLoggerOptions({level:(s==null?void 0:s.logger)||No})),this.disableProviderPing=(s==null?void 0:s.disableProviderPing)||!1}static async init(s){const i=new ns(s);return await i.initialize(),i}async request(s,i){const[f,g]=this.validateChain(i);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(f).request({request:En({},s),chainId:`${f}:${g}`,topic:this.session.topic})}sendAsync(s,i,f){const g=new Date().getTime();this.request(s,f).then(P=>i(null,pt.formatJsonRpcResult(g,P))).catch(P=>i(P,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 s;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(s=this.session)==null?void 0:s.topic,reason:nt.U("USER_DISCONNECTED")}),await this.cleanup()}async connect(s){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(s),await this.cleanupPendingPairings(),!s.skipPairing)return await this.pair(s.pairingTopic)}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}removeListener(s,i){this.events.removeListener(s,i)}off(s,i){this.events.off(s,i)}get isWalletConnect(){return!0}async pair(s){this.shouldAbortPairingAttempt=!1;let i=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(i>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:f,approval:g}=await this.client.connect({pairingTopic:s,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});f&&(this.uri=f,this.events.emit("display_uri",f)),await g().then(P=>{this.session=P,this.namespaces||(this.namespaces=og(P.namespaces),this.persist("namespaces",this.namespaces))}).catch(P=>{if(P.message!==pt.oe)throw P;i++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(s,i){try{if(!this.session)return;const[f,g]=this.validateChain(s);this.getProvider(f).setDefaultChain(g,i)}catch(f){if(!/Please call connect/.test(f.message))throw f}}async cleanupPendingPairings(s={}){this.logger.info("Cleaning up inactive pairings...");const i=this.client.pairing.getAll();if(nt.k(i)){for(const f of i)s.deletePairings?this.client.core.expirer.set(f.topic,0):await this.client.core.relayer.subscriber.unsubscribe(f.topic);this.logger.info(`Inactive pairings cleared: ${i.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 s=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[s]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await pt.Q.init({logger:this.providerOpts.logger||No,relayUrl:this.providerOpts.relayUrl||Qv,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),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 s=[...new Set(Object.keys(this.session.namespaces).map(i=>nt.en(i)))];Yi("client",this.client),Yi("events",this.events),Yi("disableProviderPing",this.disableProviderPing),s.forEach(i=>{if(!this.session)return;const f=ig(i,this.session),g=Ko(f),P=sg(this.namespaces,this.optionalNamespaces),O=Xi(En({},P[i]),{accounts:f,chains:g});switch(i){case"eip155":this.rpcProviders[i]=new cg({namespace:O});break;case"solana":this.rpcProviders[i]=new hg({namespace:O});break;case"cosmos":this.rpcProviders[i]=new fg({namespace:O});break;case"polkadot":this.rpcProviders[i]=new ug({namespace:O});break;case"cip34":this.rpcProviders[i]=new lg({namespace:O});break;case"elrond":this.rpcProviders[i]=new pg({namespace:O});break;case"multiversx":this.rpcProviders[i]=new dg({namespace:O});break;case"near":this.rpcProviders[i]=new vg({namespace:O});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",s=>{this.events.emit("session_ping",s)}),this.client.on("session_event",s=>{const{params:i}=s,{event:f}=i;if(f.name==="accountsChanged"){const g=f.data;g&&nt.k(g)&&this.events.emit("accountsChanged",g.map(ag))}else if(f.name==="chainChanged"){const g=i.chainId,P=i.event.data,O=nt.en(g),N=Zi(g)!==Zi(P)?`${O}:${Zi(P)}`:g;this.onChainChanged(N)}else this.events.emit(f.name,f.data);this.events.emit("session_event",s)}),this.client.on("session_update",({topic:s,params:i})=>{var f;const{namespaces:g}=i,P=(f=this.client)==null?void 0:f.session.get(s);this.session=Xi(En({},P),{namespaces:g}),this.onSessionUpdate(),this.events.emit("session_update",{topic:s,params:i})}),this.client.on("session_delete",async s=>{await this.cleanup(),this.events.emit("session_delete",s),this.events.emit("disconnect",Xi(En({},nt.U("USER_DISCONNECTED")),{data:s.topic}))}),this.on(de.DEFAULT_CHAIN_CHANGED,s=>{this.onChainChanged(s,!0)})}getProvider(s){if(!this.rpcProviders[s])throw new Error(`Provider not found: ${s}`);return this.rpcProviders[s]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(s=>{var i;this.getProvider(s).updateNamespace((i=this.session)==null?void 0:i.namespaces[s])})}setNamespaces(s){const{namespaces:i,optionalNamespaces:f,sessionProperties:g}=s;i&&Object.keys(i).length&&(this.namespaces=i),f&&Object.keys(f).length&&(this.optionalNamespaces=f),this.sessionProperties=g,this.persist("namespaces",i),this.persist("optionalNamespaces",f)}validateChain(s){const[i,f]=(s==null?void 0:s.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,f];if(i&&!Object.keys(this.namespaces||{}).map(O=>nt.en(O)).includes(i))throw new Error(`Namespace '${i}' is not configured. Please call connect() first with namespace config.`);if(i&&f)return[i,f];const g=nt.en(Object.keys(this.namespaces)[0]),P=this.rpcProviders[g].getDefaultChain();return[g,P]}async requestAccounts(){const[s]=this.validateChain();return await this.getProvider(s).requestAccounts()}onChainChanged(s,i=!1){var f;if(!this.namespaces)return;const[g,P]=this.validateChain(s);i||this.getProvider(g).setDefaultChain(P),((f=this.namespaces[g])!=null?f:this.namespaces[`${g}:${P}`]).defaultChain=P,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",P)}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(s,i){this.client.core.storage.setItem(`${Lo}/${s}`,i)}async getFromStore(s){return await this.client.core.storage.getItem(`${Lo}/${s}`)}}const bg=ns,Pg="wc",Eg="ethereum_provider",Cg=`${Pg}@2:${Eg}:`,Ig="https://rpc.walletconnect.com/v1/",Cn=["eth_sendTransaction","personal_sign"],Yo=["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"],In=["chainChanged","accountsChanged"],Xo=["chainChanged","accountsChanged","message","disconnect","connect"];var Ag=Object.defineProperty,Og=Object.defineProperties,jg=Object.getOwnPropertyDescriptors,Go=Object.getOwnPropertySymbols,xg=Object.prototype.hasOwnProperty,Sg=Object.prototype.propertyIsEnumerable,Qo=(b,s,i)=>s in b?Ag(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Or=(b,s)=>{for(var i in s||(s={}))xg.call(s,i)&&Qo(b,i,s[i]);if(Go)for(var i of Go(s))Sg.call(s,i)&&Qo(b,i,s[i]);return b},Vo=(b,s)=>Og(b,jg(s));function An(b){return Number(b[0].split(":")[1])}function ts(b){return`0x${b.toString(16)}`}function Dg(b){const{chains:s,optionalChains:i,methods:f,optionalMethods:g,events:P,optionalEvents:O,rpcMap:N}=b;if(!nt.k(s))throw new Error("Invalid chains");const ut={chains:s,methods:f||Cn,events:P||In,rpcMap:Or({},s.length?{[An(s)]:N[An(s)]}:{})},st=P==null?void 0:P.filter(ct=>!In.includes(ct)),dt=f==null?void 0:f.filter(ct=>!Cn.includes(ct));if(!i&&!O&&!g&&!(st!=null&&st.length)&&!(dt!=null&&dt.length))return{required:s.length?ut:void 0};const it=(st==null?void 0:st.length)&&(dt==null?void 0:dt.length)||!i,vt={chains:[...new Set(it?ut.chains.concat(i||[]):i)],methods:[...new Set(ut.methods.concat(g!=null&&g.length?g:Yo))],events:[...new Set(ut.events.concat(O!=null&&O.length?O:Xo))],rpcMap:N};return{required:s.length?ut:void 0,optional:i.length?vt:void 0}}class On{constructor(){this.events=new ke.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Cg,this.on=(s,i)=>(this.events.on(s,i),this),this.once=(s,i)=>(this.events.once(s,i),this),this.removeListener=(s,i)=>(this.events.removeListener(s,i),this),this.off=(s,i)=>(this.events.off(s,i),this),this.parseAccount=s=>this.isCompatibleChainId(s)?this.parseAccountId(s).address:s,this.signer={},this.rpc={}}static async init(s){const i=new On;return await i.initialize(s),i}async request(s){return await this.signer.request(s,this.formatChainId(this.chainId))}sendAsync(s,i){this.signer.sendAsync(s,i,this.formatChainId(this.chainId))}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(s){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(s);const{required:i,optional:f}=Dg(this.rpc);try{const g=await new Promise(async(O,N)=>{var ut;this.rpc.showQrModal&&((ut=this.modal)==null||ut.subscribeModal(st=>{!st.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),N(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Vo(Or({namespaces:Or({},i&&{[this.namespace]:i})},f&&{optionalNamespaces:{[this.namespace]:f}}),{pairingTopic:s==null?void 0:s.pairingTopic})).then(st=>{O(st)}).catch(st=>{N(new Error(st.message))})});if(!g)return;const P=nt.Un(g.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:P),this.setAccounts(P),this.events.emit("connect",{chainId:ts(this.chainId)})}catch(g){throw this.signer.logger.error(g),g}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",s=>{const{params:i}=s,{event:f}=i;f.name==="accountsChanged"?(this.accounts=this.parseAccounts(f.data),this.events.emit("accountsChanged",this.accounts)):f.name==="chainChanged"?this.setChainId(this.formatChainId(f.data)):this.events.emit(f.name,f.data),this.events.emit("session_event",s)}),this.signer.on("chainChanged",s=>{const i=parseInt(s);this.chainId=i,this.events.emit("chainChanged",ts(this.chainId)),this.persist()}),this.signer.on("session_update",s=>{this.events.emit("session_update",s)}),this.signer.on("session_delete",s=>{this.reset(),this.events.emit("session_delete",s),this.events.emit("disconnect",Vo(Or({},nt.U("USER_DISCONNECTED")),{data:s.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",s=>{var i,f;this.rpc.showQrModal&&((i=this.modal)==null||i.closeModal(),(f=this.modal)==null||f.openModal({uri:s})),this.events.emit("display_uri",s)})}switchEthereumChain(s){this.request({method:"wallet_switchEthereumChain",params:[{chainId:s.toString(16)}]})}isCompatibleChainId(s){return typeof s=="string"?s.startsWith(`${this.namespace}:`):!1}formatChainId(s){return`${this.namespace}:${s}`}parseChainId(s){return Number(s.split(":")[1])}setChainIds(s){const i=s.filter(f=>this.isCompatibleChainId(f)).map(f=>this.parseChainId(f));i.length&&(this.chainId=i[0],this.events.emit("chainChanged",ts(this.chainId)),this.persist())}setChainId(s){if(this.isCompatibleChainId(s)){const i=this.parseChainId(s);this.chainId=i,this.switchEthereumChain(i)}}parseAccountId(s){const[i,f,g]=s.split(":");return{chainId:`${i}:${f}`,address:g}}setAccounts(s){this.accounts=s.filter(i=>this.parseChainId(this.parseAccountId(i).chainId)===this.chainId).map(i=>this.parseAccountId(i).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(s){var i,f;const g=(i=s==null?void 0:s.chains)!=null?i:[],P=(f=s==null?void 0:s.optionalChains)!=null?f:[],O=g.concat(P);if(!O.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const N=g.length?(s==null?void 0:s.methods)||Cn:[],ut=g.length?(s==null?void 0:s.events)||In:[],st=(s==null?void 0:s.optionalMethods)||[],dt=(s==null?void 0:s.optionalEvents)||[],it=(s==null?void 0:s.rpcMap)||this.buildRpcMap(O,s.projectId),vt=(s==null?void 0:s.qrModalOptions)||void 0;return{chains:g==null?void 0:g.map(ct=>this.formatChainId(ct)),optionalChains:P.map(ct=>this.formatChainId(ct)),methods:N,events:ut,optionalMethods:st,optionalEvents:dt,rpcMap:it,showQrModal:!!(s!=null&&s.showQrModal),qrModalOptions:vt,projectId:s.projectId,metadata:s.metadata}}buildRpcMap(s,i){const f={};return s.forEach(g=>{f[g]=this.getRpcUrl(g,i)}),f}async initialize(s){if(this.rpc=this.getRpcConfig(s),this.chainId=this.rpc.chains.length?An(this.rpc.chains):An(this.rpc.optionalChains),this.signer=await bg.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:s.disableProviderPing,relayUrl:s.relayUrl,storageOptions:s.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let i;try{const{WalletConnectModal:f}=await Promise.resolve().then(()=>require("./index-Ci2FvrOh.js")).then(g=>g.index);i=f}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(i)try{this.modal=new i(Or({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(f){throw this.signer.logger.error(f),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(s){if(!s)return;const{chains:i,optionalChains:f,rpcMap:g}=s;i&&nt.k(i)&&(this.rpc.chains=i.map(P=>this.formatChainId(P)),i.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)})),f&&nt.k(f)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=f==null?void 0:f.map(P=>this.formatChainId(P)),f.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)}))}getRpcUrl(s,i){var f;return((f=this.rpc.rpcMap)==null?void 0:f[s])||`${Ig}?chainId=eip155:${s}&projectId=${i||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const s=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),i=this.session.namespaces[`${this.namespace}:${s}`]?this.session.namespaces[`${this.namespace}:${s}`]:this.session.namespaces[this.namespace];this.setChainIds(s?[this.formatChainId(s)]:i==null?void 0:i.accounts),this.setAccounts(i==null?void 0:i.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(s){return typeof s=="string"||s instanceof String?[this.parseAccount(s)]:s.map(i=>this.parseAccount(i))}}const Rg=On;exports.EthereumProvider=Rg;exports.OPTIONAL_EVENTS=Xo;exports.OPTIONAL_METHODS=Yo;exports.REQUIRED_EVENTS=In;exports.REQUIRED_METHODS=Cn;exports.default=On;
@@ -1,5 +1,5 @@
1
- import { d as Ze, q as ci, aW as yt, p as gt, g as Er, aX as xr } from "./index-DL8L1ROt.mjs";
2
- import { c as M, b as so, w as Ir, r as Sr, f as as, t as Oi, d as ro, g as Nt, V as no, M as oo, N, h as ao, i as Gi, j as co, K as ho, A as lo, q as Os, x as uo, H as fo, F as po, l as Rs, $ as go, p as yo, J as mo, u as ri, m as Ts, X as wo, n as bo, _ as Pr, y as ut, I as _o, C as Ns, D as Ut, E as Ie, U as rt, G as Tt, L as Xe, O as vo, P as Kt, Q as Or, R as Eo, T as xo, W as Io, Y as Rr, Z as So, a0 as Tr, a1 as Nr, a2 as Bt, a3 as ki, a4 as Ei, k as Po, a5 as Oo, B as $i, a6 as Ro, a7 as To, a8 as No, a9 as Ao, aa as wi, ab as Fo, ac as $o, ad as Ci, ae as As, af as Co, ag as Lo, ah as Do, ai as Fs, aj as Mo, ak as qo, al as zo, am as jo, an as Uo, ao as Ko, ap as Vo } from "./index.es-BiFBfhQG.mjs";
1
+ import { d as Ze, q as ci, aW as yt, p as gt, g as Er, aX as xr } from "./index-DV6sNreL.mjs";
2
+ import { c as M, b as so, w as Ir, r as Sr, f as as, t as Oi, d as ro, g as Nt, V as no, M as oo, N, h as ao, i as Gi, j as co, K as ho, A as lo, q as Os, x as uo, H as fo, F as po, l as Rs, $ as go, p as yo, J as mo, u as ri, m as Ts, X as wo, n as bo, _ as Pr, y as ut, I as _o, C as Ns, D as Ut, E as Ie, U as rt, G as Tt, L as Xe, O as vo, P as Kt, Q as Or, R as Eo, T as xo, W as Io, Y as Rr, Z as So, a0 as Tr, a1 as Nr, a2 as Bt, a3 as ki, a4 as Ei, k as Po, a5 as Oo, B as $i, a6 as Ro, a7 as To, a8 as No, a9 as Ao, aa as wi, ab as Fo, ac as $o, ad as Ci, ae as As, af as Co, ag as Lo, ah as Do, ai as Fs, aj as Mo, ak as qo, al as zo, am as jo, an as Uo, ao as Ko, ap as Vo } from "./index.es--nOdm892.mjs";
3
3
  const Bo = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, Ho = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, Go = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
4
4
  function ko(r, e) {
5
5
  if (r === "__proto__" || r === "constructor" && e && typeof e == "object" && "prototype" in e) {
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-C6Wvczhr.js");exports.MAINNET=e.MAINNET;exports.TESTNET=e.TESTNET;exports.dark=e.dark;exports.default=e.WormholeConnect;exports.light=e.light;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-DTOQHhz5.js");exports.MAINNET=e.MAINNET;exports.TESTNET=e.TESTNET;exports.dark=e.dark;exports.default=e.WormholeConnect;exports.light=e.light;
package/lib/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { b3 as s, b4 as T, b5 as r, b2 as t, b6 as E } from "./index-DL8L1ROt.mjs";
1
+ import { b3 as s, b4 as T, b5 as r, b2 as t, b6 as E } from "./index-DV6sNreL.mjs";
2
2
  export {
3
3
  s as MAINNET,
4
4
  T as TESTNET,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("./index-C6Wvczhr.js");var kc={},zN={},XN={},Ph={},cA={},lA={},Tl={};const xr=oe.getAugmentedNamespace(oe.defineProperty);var St={},fA={},pA={},gA,sC;function jM(){if(sC)return gA;sC=1,gA=w;var e=Cc();function w(f,l){this.lo=f>>>0,this.hi=l>>>0}var c=w.zero=new w(0,0);c.toNumber=function(){return 0},c.zzEncode=c.zzDecode=function(){return this},c.length=function(){return 1};var n=w.zeroHash="\0\0\0\0\0\0\0\0";w.fromNumber=function(l){if(l===0)return c;var v=l<0;v&&(l=-l);var P=l>>>0,p=(l-P)/4294967296>>>0;return v&&(p=~p>>>0,P=~P>>>0,++P>4294967295&&(P=0,++p>4294967295&&(p=0))),new w(P,p)},w.from=function(l){if(typeof l=="number")return w.fromNumber(l);if(e.isString(l))if(e.Long)l=e.Long.fromString(l);else return w.fromNumber(parseInt(l,10));return l.low||l.high?new w(l.low>>>0,l.high>>>0):c},w.prototype.toNumber=function(l){if(!l&&this.hi>>>31){var v=~this.lo+1>>>0,P=~this.hi>>>0;return v||(P=P+1>>>0),-(v+P*4294967296)}return this.lo+this.hi*4294967296},w.prototype.toLong=function(l){return e.Long?new e.Long(this.lo|0,this.hi|0,!!l):{low:this.lo|0,high:this.hi|0,unsigned:!!l}};var g=String.prototype.charCodeAt;return w.fromHash=function(l){return l===n?c:new w((g.call(l,0)|g.call(l,1)<<8|g.call(l,2)<<16|g.call(l,3)<<24)>>>0,(g.call(l,4)|g.call(l,5)<<8|g.call(l,6)<<16|g.call(l,7)<<24)>>>0)},w.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},w.prototype.zzEncode=function(){var l=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^l)>>>0,this.lo=(this.lo<<1^l)>>>0,this},w.prototype.zzDecode=function(){var l=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^l)>>>0,this.hi=(this.hi>>>1^l)>>>0,this},w.prototype.length=function(){var l=this.lo,v=(this.lo>>>28|this.hi<<4)>>>0,P=this.hi>>>24;return P===0?v===0?l<16384?l<128?1:2:l<2097152?3:4:v<16384?v<128?5:6:v<2097152?7:8:P<128?9:10},gA}var cC;function Cc(){return cC||(cC=1,function(e){var w=e;w.asPromise=oe.aspromise,w.base64=oe.base64,w.EventEmitter=oe.eventemitter,w.float=oe.float,w.inquire=oe.inquire_1,w.utf8=oe.utf8,w.pool=oe.pool_1,w.LongBits=jM(),w.isNode=!!(typeof oe.commonjsGlobal<"u"&&oe.commonjsGlobal&&oe.commonjsGlobal.process&&oe.commonjsGlobal.process.versions&&oe.commonjsGlobal.process.versions.node),w.global=w.isNode&&oe.commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||oe.commonjsGlobal,w.emptyArray=Object.freeze?Object.freeze([]):[],w.emptyObject=Object.freeze?Object.freeze({}):{},w.isInteger=Number.isInteger||function(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f},w.isString=function(f){return typeof f=="string"||f instanceof String},w.isObject=function(f){return f&&typeof f=="object"},w.isset=w.isSet=function(f,l){var v=f[l];return v!=null&&f.hasOwnProperty(l)?typeof v!="object"||(Array.isArray(v)?v.length:Object.keys(v).length)>0:!1},w.Buffer=function(){try{var g=w.inquire("buffer").Buffer;return g.prototype.utf8Write?g:null}catch{return null}}(),w._Buffer_from=null,w._Buffer_allocUnsafe=null,w.newBuffer=function(f){return typeof f=="number"?w.Buffer?w._Buffer_allocUnsafe(f):new w.Array(f):w.Buffer?w._Buffer_from(f):typeof Uint8Array>"u"?f:new Uint8Array(f)},w.Array=typeof Uint8Array<"u"?Uint8Array:Array,w.Long=w.global.dcodeIO&&w.global.dcodeIO.Long||w.global.Long||w.inquire("long"),w.key2Re=/^true|false|0|1$/,w.key32Re=/^-?(?:0|[1-9][0-9]*)$/,w.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,w.longToHash=function(f){return f?w.LongBits.from(f).toHash():w.LongBits.zeroHash},w.longFromHash=function(f,l){var v=w.LongBits.fromHash(f);return w.Long?w.Long.fromBits(v.lo,v.hi,l):v.toNumber(!!l)};function c(g,f,l){for(var v=Object.keys(f),P=0;P<v.length;++P)(g[v[P]]===void 0||!l)&&(g[v[P]]=f[v[P]]);return g}w.merge=c,w.lcFirst=function(f){return f.charAt(0).toLowerCase()+f.substring(1)};function n(g){function f(l,v){if(!(this instanceof f))return new f(l,v);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,f):Object.defineProperty(this,"stack",{value:new Error().stack||""}),v&&c(this,v)}return(f.prototype=Object.create(Error.prototype)).constructor=f,Object.defineProperty(f.prototype,"name",{get:function(){return g}}),f.prototype.toString=function(){return this.name+": "+this.message},f}w.newError=n,w.ProtocolError=n("ProtocolError"),w.oneOfGetter=function(f){for(var l={},v=0;v<f.length;++v)l[f[v]]=1;return function(){for(var P=Object.keys(this),p=P.length-1;p>-1;--p)if(l[P[p]]===1&&this[P[p]]!==void 0&&this[P[p]]!==null)return P[p]}},w.oneOfSetter=function(f){return function(l){for(var v=0;v<f.length;++v)f[v]!==l&&delete this[f[v]]}},w.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},w._configure=function(){var g=w.Buffer;if(!g){w._Buffer_from=w._Buffer_allocUnsafe=null;return}w._Buffer_from=g.from!==Uint8Array.from&&g.from||function(l,v){return new g(l,v)},w._Buffer_allocUnsafe=g.allocUnsafe||function(l){return new g(l)}}}(pA)),pA}var hA,lC;function jN(){if(lC)return hA;lC=1,hA=P;var e=Cc(),w,c=e.LongBits,n=e.base64,g=e.utf8;function f(r,o,u){this.fn=r,this.len=o,this.next=void 0,this.val=u}function l(){}function v(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function P(){this.len=0,this.head=new f(l,0,0),this.tail=this.head,this.states=null}var p=function(){return e.Buffer?function(){return(P.create=function(){return new w})()}:function(){return new P}};P.create=p(),P.alloc=function(o){return new e.Array(o)},e.Array!==Array&&(P.alloc=e.pool(P.alloc,e.Array.prototype.subarray)),P.prototype._push=function(o,u,R){return this.tail=this.tail.next=new f(o,u,R),this.len+=u,this};function A(r,o,u){o[u]=r&255}function I(r,o,u){for(;r>127;)o[u++]=r&127|128,r>>>=7;o[u]=r}function d(r,o){this.len=r,this.next=void 0,this.val=o}d.prototype=Object.create(f.prototype),d.prototype.fn=I,P.prototype.uint32=function(o){return this.len+=(this.tail=this.tail.next=new d((o=o>>>0)<128?1:o<16384?2:o<2097152?3:o<268435456?4:5,o)).len,this},P.prototype.int32=function(o){return o<0?this._push(i,10,c.fromNumber(o)):this.uint32(o)},P.prototype.sint32=function(o){return this.uint32((o<<1^o>>31)>>>0)};function i(r,o,u){for(;r.hi;)o[u++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)o[u++]=r.lo&127|128,r.lo=r.lo>>>7;o[u++]=r.lo}P.prototype.uint64=function(o){var u=c.from(o);return this._push(i,u.length(),u)},P.prototype.int64=P.prototype.uint64,P.prototype.sint64=function(o){var u=c.from(o).zzEncode();return this._push(i,u.length(),u)},P.prototype.bool=function(o){return this._push(A,1,o?1:0)};function t(r,o,u){o[u]=r&255,o[u+1]=r>>>8&255,o[u+2]=r>>>16&255,o[u+3]=r>>>24}P.prototype.fixed32=function(o){return this._push(t,4,o>>>0)},P.prototype.sfixed32=P.prototype.fixed32,P.prototype.fixed64=function(o){var u=c.from(o);return this._push(t,4,u.lo)._push(t,4,u.hi)},P.prototype.sfixed64=P.prototype.fixed64,P.prototype.float=function(o){return this._push(e.float.writeFloatLE,4,o)},P.prototype.double=function(o){return this._push(e.float.writeDoubleLE,8,o)};var a=e.Array.prototype.set?function(o,u,R){u.set(o,R)}:function(o,u,R){for(var h=0;h<o.length;++h)u[R+h]=o[h]};return P.prototype.bytes=function(o){var u=o.length>>>0;if(!u)return this._push(A,1,0);if(e.isString(o)){var R=P.alloc(u=n.length(o));n.decode(o,R,0),o=R}return this.uint32(u)._push(a,u,o)},P.prototype.string=function(o){var u=g.length(o);return u?this.uint32(u)._push(g.write,u,o):this._push(A,1,0)},P.prototype.fork=function(){return this.states=new v(this),this.head=this.tail=new f(l,0,0),this.len=0,this},P.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new f(l,0,0),this.len=0),this},P.prototype.ldelim=function(){var o=this.head,u=this.tail,R=this.len;return this.reset().uint32(R),R&&(this.tail.next=o.next,this.tail=u,this.len+=R),this},P.prototype.finish=function(){for(var o=this.head.next,u=this.constructor.alloc(this.len),R=0;o;)o.fn(o.val,u,R),R+=o.len,o=o.next;return u},P._configure=function(r){w=r,P.create=p(),w._configure()},hA}var AA,fC;function e6(){if(fC)return AA;fC=1,AA=c;var e=jN();(c.prototype=Object.create(e.prototype)).constructor=c;var w=Cc();function c(){e.call(this)}c._configure=function(){c.alloc=w._Buffer_allocUnsafe,c.writeBytesBuffer=w.Buffer&&w.Buffer.prototype instanceof Uint8Array&&w.Buffer.prototype.set.name==="set"?function(f,l,v){l.set(f,v)}:function(f,l,v){if(f.copy)f.copy(l,v,0,f.length);else for(var P=0;P<f.length;)l[v++]=f[P++]}},c.prototype.bytes=function(f){w.isString(f)&&(f=w._Buffer_from(f,"base64"));var l=f.length>>>0;return this.uint32(l),l&&this._push(c.writeBytesBuffer,l,f),this};function n(g,f,l){g.length<40?w.utf8.write(g,f,l):f.utf8Write?f.utf8Write(g,l):f.write(g,l)}return c.prototype.string=function(f){var l=w.Buffer.byteLength(f);return this.uint32(l),l&&this._push(n,l,f),this},c._configure(),AA}var mA,pC;function e8(){if(pC)return mA;pC=1,mA=f;var e=Cc(),w,c=e.LongBits,n=e.utf8;function g(I,d){return RangeError("index out of range: "+I.pos+" + "+(d||1)+" > "+I.len)}function f(I){this.buf=I,this.pos=0,this.len=I.length}var l=typeof Uint8Array<"u"?function(d){if(d instanceof Uint8Array||Array.isArray(d))return new f(d);throw Error("illegal buffer")}:function(d){if(Array.isArray(d))return new f(d);throw Error("illegal buffer")},v=function(){return e.Buffer?function(i){return(f.create=function(a){return e.Buffer.isBuffer(a)?new w(a):l(a)})(i)}:l};f.create=v(),f.prototype._slice=e.Array.prototype.subarray||e.Array.prototype.slice,f.prototype.uint32=function(){var d=4294967295;return function(){if(d=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(d=(d|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(d=(d|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(d=(d|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(d=(d|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return d;if((this.pos+=5)>this.len)throw this.pos=this.len,g(this,10);return d}}(),f.prototype.int32=function(){return this.uint32()|0},f.prototype.sint32=function(){var d=this.uint32();return d>>>1^-(d&1)|0};function P(){var I=new c(0,0),d=0;if(this.len-this.pos>4){for(;d<4;++d)if(I.lo=(I.lo|(this.buf[this.pos]&127)<<d*7)>>>0,this.buf[this.pos++]<128)return I;if(I.lo=(I.lo|(this.buf[this.pos]&127)<<28)>>>0,I.hi=(I.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return I;d=0}else{for(;d<3;++d){if(this.pos>=this.len)throw g(this);if(I.lo=(I.lo|(this.buf[this.pos]&127)<<d*7)>>>0,this.buf[this.pos++]<128)return I}return I.lo=(I.lo|(this.buf[this.pos++]&127)<<d*7)>>>0,I}if(this.len-this.pos>4){for(;d<5;++d)if(I.hi=(I.hi|(this.buf[this.pos]&127)<<d*7+3)>>>0,this.buf[this.pos++]<128)return I}else for(;d<5;++d){if(this.pos>=this.len)throw g(this);if(I.hi=(I.hi|(this.buf[this.pos]&127)<<d*7+3)>>>0,this.buf[this.pos++]<128)return I}throw Error("invalid varint encoding")}f.prototype.bool=function(){return this.uint32()!==0};function p(I,d){return(I[d-4]|I[d-3]<<8|I[d-2]<<16|I[d-1]<<24)>>>0}f.prototype.fixed32=function(){if(this.pos+4>this.len)throw g(this,4);return p(this.buf,this.pos+=4)},f.prototype.sfixed32=function(){if(this.pos+4>this.len)throw g(this,4);return p(this.buf,this.pos+=4)|0};function A(){if(this.pos+8>this.len)throw g(this,8);return new c(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}return f.prototype.float=function(){if(this.pos+4>this.len)throw g(this,4);var d=e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,d},f.prototype.double=function(){if(this.pos+8>this.len)throw g(this,4);var d=e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,d},f.prototype.bytes=function(){var d=this.uint32(),i=this.pos,t=this.pos+d;if(t>this.len)throw g(this,d);return this.pos+=d,Array.isArray(this.buf)?this.buf.slice(i,t):i===t?new this.buf.constructor(0):this._slice.call(this.buf,i,t)},f.prototype.string=function(){var d=this.bytes();return n.read(d,0,d.length)},f.prototype.skip=function(d){if(typeof d=="number"){if(this.pos+d>this.len)throw g(this,d);this.pos+=d}else do if(this.pos>=this.len)throw g(this);while(this.buf[this.pos++]&128);return this},f.prototype.skipType=function(I){switch(I){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(I=this.uint32()&7)!==4;)this.skipType(I);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+I+" at offset "+this.pos)}return this},f._configure=function(I){w=I,f.create=v(),w._configure();var d=e.Long?"toLong":"toNumber";e.merge(f.prototype,{int64:function(){return P.call(this)[d](!1)},uint64:function(){return P.call(this)[d](!0)},sint64:function(){return P.call(this).zzDecode()[d](!1)},fixed64:function(){return A.call(this)[d](!0)},sfixed64:function(){return A.call(this)[d](!1)}})},mA}var vA,gC;function n6(){if(gC)return vA;gC=1,vA=c;var e=e8();(c.prototype=Object.create(e.prototype)).constructor=c;var w=Cc();function c(n){e.call(this,n)}return c._configure=function(){w.Buffer&&(c.prototype._slice=w.Buffer.prototype.slice)},c.prototype.string=function(){var g=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+g,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+g,this.len))},c._configure(),vA}var yA={},kA,hC;function r6(){if(hC)return kA;hC=1,kA=w;var e=Cc();(w.prototype=Object.create(e.EventEmitter.prototype)).constructor=w;function w(c,n,g){if(typeof c!="function")throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=c,this.requestDelimited=!!n,this.responseDelimited=!!g}return w.prototype.rpcCall=function c(n,g,f,l,v){if(!l)throw TypeError("request must be specified");var P=this;if(!v)return e.asPromise(c,P,n,g,f,l);if(!P.rpcImpl){setTimeout(function(){v(Error("already ended"))},0);return}try{return P.rpcImpl(n,g[P.requestDelimited?"encodeDelimited":"encode"](l).finish(),function(A,I){if(A)return P.emit("error",A,n),v(A);if(I===null){P.end(!0);return}if(!(I instanceof f))try{I=f[P.responseDelimited?"decodeDelimited":"decode"](I)}catch(d){return P.emit("error",d,n),v(d)}return P.emit("data",I,n),v(null,I)})}catch(p){P.emit("error",p,n),setTimeout(function(){v(p)},0);return}},w.prototype.end=function(n){return this.rpcImpl&&(n||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},kA}var AC;function t6(){return AC||(AC=1,function(e){var w=e;w.Service=r6()}(yA)),yA}var CA,mC;function a6(){return mC||(mC=1,CA={}),CA}var vC;function i6(){return vC||(vC=1,function(e){var w=e;w.build="minimal",w.Writer=jN(),w.BufferWriter=e6(),w.Reader=e8(),w.BufferReader=n6(),w.util=Cc(),w.rpc=t6(),w.roots=a6(),w.configure=c;function c(){w.util._configure(),w.Writer._configure(w.BufferWriter),w.Reader._configure(w.BufferReader)}c()}(fA)),fA}var RA,yC;function Jn(){return yC||(yC=1,RA=i6()),RA}var kC;function M1(){if(kC)return St;kC=1;var e=oe.require_typeof();Object.defineProperty(St,"__esModule",{value:!0}),St.ProofSpec=St.NonExistenceProof=St.LengthOpSDKType=St.LengthOp=St.LeafOp=St.InnerSpec=St.InnerOp=St.HashOpSDKType=St.HashOp=St.ExistenceProof=St.CompressedNonExistenceProof=St.CompressedExistenceProof=St.CompressedBatchProof=St.CompressedBatchEntry=St.CommitmentProof=St.BatchProof=St.BatchEntry=void 0,St.hashOpFromJSON=p,St.hashOpToJSON=A,St.lengthOpFromJSON=i,St.lengthOpToJSON=t;var w=n(Jn());function c(x){if(typeof WeakMap!="function")return null;var se=new WeakMap,ue=new WeakMap;return(c=function(ge){return ge?ue:se})(x)}function n(x,se){if(!se&&x&&x.__esModule)return x;if(x===null||e(x)!=="object"&&typeof x!="function")return{default:x};var ue=c(se);if(ue&&ue.has(x))return ue.get(x);var ie={},ge=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var me in x)if(me!=="default"&&Object.prototype.hasOwnProperty.call(x,me)){var de=ge?Object.getOwnPropertyDescriptor(x,me):null;de&&(de.get||de.set)?Object.defineProperty(ie,me,de):ie[me]=x[me]}return ie.default=x,ue&&ue.set(x,ie),ie}function g(x,se){var ue=typeof Symbol<"u"&&x[Symbol.iterator]||x["@@iterator"];if(!ue){if(Array.isArray(x)||(ue=f(x))||se&&x&&typeof x.length=="number"){ue&&(x=ue);var ie=0,ge=function(){};return{s:ge,n:function(){return ie>=x.length?{done:!0}:{done:!1,value:x[ie++]}},e:function(re){throw re},f:ge}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("./index-DTOQHhz5.js");var kc={},zN={},XN={},Ph={},cA={},lA={},Tl={};const xr=oe.getAugmentedNamespace(oe.defineProperty);var St={},fA={},pA={},gA,sC;function jM(){if(sC)return gA;sC=1,gA=w;var e=Cc();function w(f,l){this.lo=f>>>0,this.hi=l>>>0}var c=w.zero=new w(0,0);c.toNumber=function(){return 0},c.zzEncode=c.zzDecode=function(){return this},c.length=function(){return 1};var n=w.zeroHash="\0\0\0\0\0\0\0\0";w.fromNumber=function(l){if(l===0)return c;var v=l<0;v&&(l=-l);var P=l>>>0,p=(l-P)/4294967296>>>0;return v&&(p=~p>>>0,P=~P>>>0,++P>4294967295&&(P=0,++p>4294967295&&(p=0))),new w(P,p)},w.from=function(l){if(typeof l=="number")return w.fromNumber(l);if(e.isString(l))if(e.Long)l=e.Long.fromString(l);else return w.fromNumber(parseInt(l,10));return l.low||l.high?new w(l.low>>>0,l.high>>>0):c},w.prototype.toNumber=function(l){if(!l&&this.hi>>>31){var v=~this.lo+1>>>0,P=~this.hi>>>0;return v||(P=P+1>>>0),-(v+P*4294967296)}return this.lo+this.hi*4294967296},w.prototype.toLong=function(l){return e.Long?new e.Long(this.lo|0,this.hi|0,!!l):{low:this.lo|0,high:this.hi|0,unsigned:!!l}};var g=String.prototype.charCodeAt;return w.fromHash=function(l){return l===n?c:new w((g.call(l,0)|g.call(l,1)<<8|g.call(l,2)<<16|g.call(l,3)<<24)>>>0,(g.call(l,4)|g.call(l,5)<<8|g.call(l,6)<<16|g.call(l,7)<<24)>>>0)},w.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},w.prototype.zzEncode=function(){var l=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^l)>>>0,this.lo=(this.lo<<1^l)>>>0,this},w.prototype.zzDecode=function(){var l=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^l)>>>0,this.hi=(this.hi>>>1^l)>>>0,this},w.prototype.length=function(){var l=this.lo,v=(this.lo>>>28|this.hi<<4)>>>0,P=this.hi>>>24;return P===0?v===0?l<16384?l<128?1:2:l<2097152?3:4:v<16384?v<128?5:6:v<2097152?7:8:P<128?9:10},gA}var cC;function Cc(){return cC||(cC=1,function(e){var w=e;w.asPromise=oe.aspromise,w.base64=oe.base64,w.EventEmitter=oe.eventemitter,w.float=oe.float,w.inquire=oe.inquire_1,w.utf8=oe.utf8,w.pool=oe.pool_1,w.LongBits=jM(),w.isNode=!!(typeof oe.commonjsGlobal<"u"&&oe.commonjsGlobal&&oe.commonjsGlobal.process&&oe.commonjsGlobal.process.versions&&oe.commonjsGlobal.process.versions.node),w.global=w.isNode&&oe.commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||oe.commonjsGlobal,w.emptyArray=Object.freeze?Object.freeze([]):[],w.emptyObject=Object.freeze?Object.freeze({}):{},w.isInteger=Number.isInteger||function(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f},w.isString=function(f){return typeof f=="string"||f instanceof String},w.isObject=function(f){return f&&typeof f=="object"},w.isset=w.isSet=function(f,l){var v=f[l];return v!=null&&f.hasOwnProperty(l)?typeof v!="object"||(Array.isArray(v)?v.length:Object.keys(v).length)>0:!1},w.Buffer=function(){try{var g=w.inquire("buffer").Buffer;return g.prototype.utf8Write?g:null}catch{return null}}(),w._Buffer_from=null,w._Buffer_allocUnsafe=null,w.newBuffer=function(f){return typeof f=="number"?w.Buffer?w._Buffer_allocUnsafe(f):new w.Array(f):w.Buffer?w._Buffer_from(f):typeof Uint8Array>"u"?f:new Uint8Array(f)},w.Array=typeof Uint8Array<"u"?Uint8Array:Array,w.Long=w.global.dcodeIO&&w.global.dcodeIO.Long||w.global.Long||w.inquire("long"),w.key2Re=/^true|false|0|1$/,w.key32Re=/^-?(?:0|[1-9][0-9]*)$/,w.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,w.longToHash=function(f){return f?w.LongBits.from(f).toHash():w.LongBits.zeroHash},w.longFromHash=function(f,l){var v=w.LongBits.fromHash(f);return w.Long?w.Long.fromBits(v.lo,v.hi,l):v.toNumber(!!l)};function c(g,f,l){for(var v=Object.keys(f),P=0;P<v.length;++P)(g[v[P]]===void 0||!l)&&(g[v[P]]=f[v[P]]);return g}w.merge=c,w.lcFirst=function(f){return f.charAt(0).toLowerCase()+f.substring(1)};function n(g){function f(l,v){if(!(this instanceof f))return new f(l,v);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,f):Object.defineProperty(this,"stack",{value:new Error().stack||""}),v&&c(this,v)}return(f.prototype=Object.create(Error.prototype)).constructor=f,Object.defineProperty(f.prototype,"name",{get:function(){return g}}),f.prototype.toString=function(){return this.name+": "+this.message},f}w.newError=n,w.ProtocolError=n("ProtocolError"),w.oneOfGetter=function(f){for(var l={},v=0;v<f.length;++v)l[f[v]]=1;return function(){for(var P=Object.keys(this),p=P.length-1;p>-1;--p)if(l[P[p]]===1&&this[P[p]]!==void 0&&this[P[p]]!==null)return P[p]}},w.oneOfSetter=function(f){return function(l){for(var v=0;v<f.length;++v)f[v]!==l&&delete this[f[v]]}},w.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},w._configure=function(){var g=w.Buffer;if(!g){w._Buffer_from=w._Buffer_allocUnsafe=null;return}w._Buffer_from=g.from!==Uint8Array.from&&g.from||function(l,v){return new g(l,v)},w._Buffer_allocUnsafe=g.allocUnsafe||function(l){return new g(l)}}}(pA)),pA}var hA,lC;function jN(){if(lC)return hA;lC=1,hA=P;var e=Cc(),w,c=e.LongBits,n=e.base64,g=e.utf8;function f(r,o,u){this.fn=r,this.len=o,this.next=void 0,this.val=u}function l(){}function v(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function P(){this.len=0,this.head=new f(l,0,0),this.tail=this.head,this.states=null}var p=function(){return e.Buffer?function(){return(P.create=function(){return new w})()}:function(){return new P}};P.create=p(),P.alloc=function(o){return new e.Array(o)},e.Array!==Array&&(P.alloc=e.pool(P.alloc,e.Array.prototype.subarray)),P.prototype._push=function(o,u,R){return this.tail=this.tail.next=new f(o,u,R),this.len+=u,this};function A(r,o,u){o[u]=r&255}function I(r,o,u){for(;r>127;)o[u++]=r&127|128,r>>>=7;o[u]=r}function d(r,o){this.len=r,this.next=void 0,this.val=o}d.prototype=Object.create(f.prototype),d.prototype.fn=I,P.prototype.uint32=function(o){return this.len+=(this.tail=this.tail.next=new d((o=o>>>0)<128?1:o<16384?2:o<2097152?3:o<268435456?4:5,o)).len,this},P.prototype.int32=function(o){return o<0?this._push(i,10,c.fromNumber(o)):this.uint32(o)},P.prototype.sint32=function(o){return this.uint32((o<<1^o>>31)>>>0)};function i(r,o,u){for(;r.hi;)o[u++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)o[u++]=r.lo&127|128,r.lo=r.lo>>>7;o[u++]=r.lo}P.prototype.uint64=function(o){var u=c.from(o);return this._push(i,u.length(),u)},P.prototype.int64=P.prototype.uint64,P.prototype.sint64=function(o){var u=c.from(o).zzEncode();return this._push(i,u.length(),u)},P.prototype.bool=function(o){return this._push(A,1,o?1:0)};function t(r,o,u){o[u]=r&255,o[u+1]=r>>>8&255,o[u+2]=r>>>16&255,o[u+3]=r>>>24}P.prototype.fixed32=function(o){return this._push(t,4,o>>>0)},P.prototype.sfixed32=P.prototype.fixed32,P.prototype.fixed64=function(o){var u=c.from(o);return this._push(t,4,u.lo)._push(t,4,u.hi)},P.prototype.sfixed64=P.prototype.fixed64,P.prototype.float=function(o){return this._push(e.float.writeFloatLE,4,o)},P.prototype.double=function(o){return this._push(e.float.writeDoubleLE,8,o)};var a=e.Array.prototype.set?function(o,u,R){u.set(o,R)}:function(o,u,R){for(var h=0;h<o.length;++h)u[R+h]=o[h]};return P.prototype.bytes=function(o){var u=o.length>>>0;if(!u)return this._push(A,1,0);if(e.isString(o)){var R=P.alloc(u=n.length(o));n.decode(o,R,0),o=R}return this.uint32(u)._push(a,u,o)},P.prototype.string=function(o){var u=g.length(o);return u?this.uint32(u)._push(g.write,u,o):this._push(A,1,0)},P.prototype.fork=function(){return this.states=new v(this),this.head=this.tail=new f(l,0,0),this.len=0,this},P.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new f(l,0,0),this.len=0),this},P.prototype.ldelim=function(){var o=this.head,u=this.tail,R=this.len;return this.reset().uint32(R),R&&(this.tail.next=o.next,this.tail=u,this.len+=R),this},P.prototype.finish=function(){for(var o=this.head.next,u=this.constructor.alloc(this.len),R=0;o;)o.fn(o.val,u,R),R+=o.len,o=o.next;return u},P._configure=function(r){w=r,P.create=p(),w._configure()},hA}var AA,fC;function e6(){if(fC)return AA;fC=1,AA=c;var e=jN();(c.prototype=Object.create(e.prototype)).constructor=c;var w=Cc();function c(){e.call(this)}c._configure=function(){c.alloc=w._Buffer_allocUnsafe,c.writeBytesBuffer=w.Buffer&&w.Buffer.prototype instanceof Uint8Array&&w.Buffer.prototype.set.name==="set"?function(f,l,v){l.set(f,v)}:function(f,l,v){if(f.copy)f.copy(l,v,0,f.length);else for(var P=0;P<f.length;)l[v++]=f[P++]}},c.prototype.bytes=function(f){w.isString(f)&&(f=w._Buffer_from(f,"base64"));var l=f.length>>>0;return this.uint32(l),l&&this._push(c.writeBytesBuffer,l,f),this};function n(g,f,l){g.length<40?w.utf8.write(g,f,l):f.utf8Write?f.utf8Write(g,l):f.write(g,l)}return c.prototype.string=function(f){var l=w.Buffer.byteLength(f);return this.uint32(l),l&&this._push(n,l,f),this},c._configure(),AA}var mA,pC;function e8(){if(pC)return mA;pC=1,mA=f;var e=Cc(),w,c=e.LongBits,n=e.utf8;function g(I,d){return RangeError("index out of range: "+I.pos+" + "+(d||1)+" > "+I.len)}function f(I){this.buf=I,this.pos=0,this.len=I.length}var l=typeof Uint8Array<"u"?function(d){if(d instanceof Uint8Array||Array.isArray(d))return new f(d);throw Error("illegal buffer")}:function(d){if(Array.isArray(d))return new f(d);throw Error("illegal buffer")},v=function(){return e.Buffer?function(i){return(f.create=function(a){return e.Buffer.isBuffer(a)?new w(a):l(a)})(i)}:l};f.create=v(),f.prototype._slice=e.Array.prototype.subarray||e.Array.prototype.slice,f.prototype.uint32=function(){var d=4294967295;return function(){if(d=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(d=(d|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(d=(d|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(d=(d|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(d=(d|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return d;if((this.pos+=5)>this.len)throw this.pos=this.len,g(this,10);return d}}(),f.prototype.int32=function(){return this.uint32()|0},f.prototype.sint32=function(){var d=this.uint32();return d>>>1^-(d&1)|0};function P(){var I=new c(0,0),d=0;if(this.len-this.pos>4){for(;d<4;++d)if(I.lo=(I.lo|(this.buf[this.pos]&127)<<d*7)>>>0,this.buf[this.pos++]<128)return I;if(I.lo=(I.lo|(this.buf[this.pos]&127)<<28)>>>0,I.hi=(I.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return I;d=0}else{for(;d<3;++d){if(this.pos>=this.len)throw g(this);if(I.lo=(I.lo|(this.buf[this.pos]&127)<<d*7)>>>0,this.buf[this.pos++]<128)return I}return I.lo=(I.lo|(this.buf[this.pos++]&127)<<d*7)>>>0,I}if(this.len-this.pos>4){for(;d<5;++d)if(I.hi=(I.hi|(this.buf[this.pos]&127)<<d*7+3)>>>0,this.buf[this.pos++]<128)return I}else for(;d<5;++d){if(this.pos>=this.len)throw g(this);if(I.hi=(I.hi|(this.buf[this.pos]&127)<<d*7+3)>>>0,this.buf[this.pos++]<128)return I}throw Error("invalid varint encoding")}f.prototype.bool=function(){return this.uint32()!==0};function p(I,d){return(I[d-4]|I[d-3]<<8|I[d-2]<<16|I[d-1]<<24)>>>0}f.prototype.fixed32=function(){if(this.pos+4>this.len)throw g(this,4);return p(this.buf,this.pos+=4)},f.prototype.sfixed32=function(){if(this.pos+4>this.len)throw g(this,4);return p(this.buf,this.pos+=4)|0};function A(){if(this.pos+8>this.len)throw g(this,8);return new c(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}return f.prototype.float=function(){if(this.pos+4>this.len)throw g(this,4);var d=e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,d},f.prototype.double=function(){if(this.pos+8>this.len)throw g(this,4);var d=e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,d},f.prototype.bytes=function(){var d=this.uint32(),i=this.pos,t=this.pos+d;if(t>this.len)throw g(this,d);return this.pos+=d,Array.isArray(this.buf)?this.buf.slice(i,t):i===t?new this.buf.constructor(0):this._slice.call(this.buf,i,t)},f.prototype.string=function(){var d=this.bytes();return n.read(d,0,d.length)},f.prototype.skip=function(d){if(typeof d=="number"){if(this.pos+d>this.len)throw g(this,d);this.pos+=d}else do if(this.pos>=this.len)throw g(this);while(this.buf[this.pos++]&128);return this},f.prototype.skipType=function(I){switch(I){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(I=this.uint32()&7)!==4;)this.skipType(I);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+I+" at offset "+this.pos)}return this},f._configure=function(I){w=I,f.create=v(),w._configure();var d=e.Long?"toLong":"toNumber";e.merge(f.prototype,{int64:function(){return P.call(this)[d](!1)},uint64:function(){return P.call(this)[d](!0)},sint64:function(){return P.call(this).zzDecode()[d](!1)},fixed64:function(){return A.call(this)[d](!0)},sfixed64:function(){return A.call(this)[d](!1)}})},mA}var vA,gC;function n6(){if(gC)return vA;gC=1,vA=c;var e=e8();(c.prototype=Object.create(e.prototype)).constructor=c;var w=Cc();function c(n){e.call(this,n)}return c._configure=function(){w.Buffer&&(c.prototype._slice=w.Buffer.prototype.slice)},c.prototype.string=function(){var g=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+g,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+g,this.len))},c._configure(),vA}var yA={},kA,hC;function r6(){if(hC)return kA;hC=1,kA=w;var e=Cc();(w.prototype=Object.create(e.EventEmitter.prototype)).constructor=w;function w(c,n,g){if(typeof c!="function")throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=c,this.requestDelimited=!!n,this.responseDelimited=!!g}return w.prototype.rpcCall=function c(n,g,f,l,v){if(!l)throw TypeError("request must be specified");var P=this;if(!v)return e.asPromise(c,P,n,g,f,l);if(!P.rpcImpl){setTimeout(function(){v(Error("already ended"))},0);return}try{return P.rpcImpl(n,g[P.requestDelimited?"encodeDelimited":"encode"](l).finish(),function(A,I){if(A)return P.emit("error",A,n),v(A);if(I===null){P.end(!0);return}if(!(I instanceof f))try{I=f[P.responseDelimited?"decodeDelimited":"decode"](I)}catch(d){return P.emit("error",d,n),v(d)}return P.emit("data",I,n),v(null,I)})}catch(p){P.emit("error",p,n),setTimeout(function(){v(p)},0);return}},w.prototype.end=function(n){return this.rpcImpl&&(n||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},kA}var AC;function t6(){return AC||(AC=1,function(e){var w=e;w.Service=r6()}(yA)),yA}var CA,mC;function a6(){return mC||(mC=1,CA={}),CA}var vC;function i6(){return vC||(vC=1,function(e){var w=e;w.build="minimal",w.Writer=jN(),w.BufferWriter=e6(),w.Reader=e8(),w.BufferReader=n6(),w.util=Cc(),w.rpc=t6(),w.roots=a6(),w.configure=c;function c(){w.util._configure(),w.Writer._configure(w.BufferWriter),w.Reader._configure(w.BufferReader)}c()}(fA)),fA}var RA,yC;function Jn(){return yC||(yC=1,RA=i6()),RA}var kC;function M1(){if(kC)return St;kC=1;var e=oe.require_typeof();Object.defineProperty(St,"__esModule",{value:!0}),St.ProofSpec=St.NonExistenceProof=St.LengthOpSDKType=St.LengthOp=St.LeafOp=St.InnerSpec=St.InnerOp=St.HashOpSDKType=St.HashOp=St.ExistenceProof=St.CompressedNonExistenceProof=St.CompressedExistenceProof=St.CompressedBatchProof=St.CompressedBatchEntry=St.CommitmentProof=St.BatchProof=St.BatchEntry=void 0,St.hashOpFromJSON=p,St.hashOpToJSON=A,St.lengthOpFromJSON=i,St.lengthOpToJSON=t;var w=n(Jn());function c(x){if(typeof WeakMap!="function")return null;var se=new WeakMap,ue=new WeakMap;return(c=function(ge){return ge?ue:se})(x)}function n(x,se){if(!se&&x&&x.__esModule)return x;if(x===null||e(x)!=="object"&&typeof x!="function")return{default:x};var ue=c(se);if(ue&&ue.has(x))return ue.get(x);var ie={},ge=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var me in x)if(me!=="default"&&Object.prototype.hasOwnProperty.call(x,me)){var de=ge?Object.getOwnPropertyDescriptor(x,me):null;de&&(de.get||de.set)?Object.defineProperty(ie,me,de):ie[me]=x[me]}return ie.default=x,ue&&ue.set(x,ie),ie}function g(x,se){var ue=typeof Symbol<"u"&&x[Symbol.iterator]||x["@@iterator"];if(!ue){if(Array.isArray(x)||(ue=f(x))||se&&x&&typeof x.length=="number"){ue&&(x=ue);var ie=0,ge=function(){};return{s:ge,n:function(){return ie>=x.length?{done:!0}:{done:!1,value:x[ie++]}},e:function(re){throw re},f:ge}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var me=!0,de=!1,te;return{s:function(){ue=ue.call(x)},n:function(){var re=ue.next();return me=re.done,re},e:function(re){de=!0,te=re},f:function(){try{!me&&ue.return!=null&&ue.return()}finally{if(de)throw te}}}}function f(x,se){if(x){if(typeof x=="string")return l(x,se);var ue=Object.prototype.toString.call(x).slice(8,-1);if(ue==="Object"&&x.constructor&&(ue=x.constructor.name),ue==="Map"||ue==="Set")return Array.from(x);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return l(x,se)}}function l(x,se){(se==null||se>x.length)&&(se=x.length);for(var ue=0,ie=new Array(se);ue<se;ue++)ie[ue]=x[ue];return ie}var v;St.HashOp=v,function(x){x[x.NO_HASH=0]="NO_HASH",x[x.SHA256=1]="SHA256",x[x.SHA512=2]="SHA512",x[x.KECCAK=3]="KECCAK",x[x.RIPEMD160=4]="RIPEMD160",x[x.BITCOIN=5]="BITCOIN",x[x.UNRECOGNIZED=-1]="UNRECOGNIZED"}(v||(St.HashOp=v={}));var P=v;St.HashOpSDKType=P;function p(x){switch(x){case 0:case"NO_HASH":return v.NO_HASH;case 1:case"SHA256":return v.SHA256;case 2:case"SHA512":return v.SHA512;case 3:case"KECCAK":return v.KECCAK;case 4:case"RIPEMD160":return v.RIPEMD160;case 5:case"BITCOIN":return v.BITCOIN;case-1:case"UNRECOGNIZED":default:return v.UNRECOGNIZED}}function A(x){switch(x){case v.NO_HASH:return"NO_HASH";case v.SHA256:return"SHA256";case v.SHA512:return"SHA512";case v.KECCAK:return"KECCAK";case v.RIPEMD160:return"RIPEMD160";case v.BITCOIN:return"BITCOIN";case v.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var I;St.LengthOp=I,function(x){x[x.NO_PREFIX=0]="NO_PREFIX",x[x.VAR_PROTO=1]="VAR_PROTO",x[x.VAR_RLP=2]="VAR_RLP",x[x.FIXED32_BIG=3]="FIXED32_BIG",x[x.FIXED32_LITTLE=4]="FIXED32_LITTLE",x[x.FIXED64_BIG=5]="FIXED64_BIG",x[x.FIXED64_LITTLE=6]="FIXED64_LITTLE",x[x.REQUIRE_32_BYTES=7]="REQUIRE_32_BYTES",x[x.REQUIRE_64_BYTES=8]="REQUIRE_64_BYTES",x[x.UNRECOGNIZED=-1]="UNRECOGNIZED"}(I||(St.LengthOp=I={}));var d=I;St.LengthOpSDKType=d;function i(x){switch(x){case 0:case"NO_PREFIX":return I.NO_PREFIX;case 1:case"VAR_PROTO":return I.VAR_PROTO;case 2:case"VAR_RLP":return I.VAR_RLP;case 3:case"FIXED32_BIG":return I.FIXED32_BIG;case 4:case"FIXED32_LITTLE":return I.FIXED32_LITTLE;case 5:case"FIXED64_BIG":return I.FIXED64_BIG;case 6:case"FIXED64_LITTLE":return I.FIXED64_LITTLE;case 7:case"REQUIRE_32_BYTES":return I.REQUIRE_32_BYTES;case 8:case"REQUIRE_64_BYTES":return I.REQUIRE_64_BYTES;case-1:case"UNRECOGNIZED":default:return I.UNRECOGNIZED}}function t(x){switch(x){case I.NO_PREFIX:return"NO_PREFIX";case I.VAR_PROTO:return"VAR_PROTO";case I.VAR_RLP:return"VAR_RLP";case I.FIXED32_BIG:return"FIXED32_BIG";case I.FIXED32_LITTLE:return"FIXED32_LITTLE";case I.FIXED64_BIG:return"FIXED64_BIG";case I.FIXED64_LITTLE:return"FIXED64_LITTLE";case I.REQUIRE_32_BYTES:return"REQUIRE_32_BYTES";case I.REQUIRE_64_BYTES:return"REQUIRE_64_BYTES";case I.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function a(){return{key:new Uint8Array,value:new Uint8Array,leaf:C.fromPartial({}),path:[]}}var r={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();se.key.length!==0&&ue.uint32(10).bytes(se.key),se.value.length!==0&&ue.uint32(18).bytes(se.value),se.leaf!==void 0&&C.encode(se.leaf,ue.uint32(26).fork()).ldelim();var ie=g(se.path),ge;try{for(ie.s();!(ge=ie.n()).done;){var me=ge.value;s.encode(me,ue.uint32(34).fork()).ldelim()}}catch(de){ie.e(de)}finally{ie.f()}return ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=a();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.key=ie.bytes();break;case 2:me.value=ie.bytes();break;case 3:me.leaf=C.decode(ie,ie.uint32());break;case 4:me.path.push(s.decode(ie,ie.uint32()));break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie,ge,me=a();return me.key=(ue=se.key)!==null&&ue!==void 0?ue:new Uint8Array,me.value=(ie=se.value)!==null&&ie!==void 0?ie:new Uint8Array,me.leaf=se.leaf!==void 0&&se.leaf!==null?C.fromPartial(se.leaf):void 0,me.path=((ge=se.path)===null||ge===void 0?void 0:ge.map(function(de){return s.fromPartial(de)}))||[],me}};St.ExistenceProof=r;function o(){return{key:new Uint8Array,left:r.fromPartial({}),right:r.fromPartial({})}}var u={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.key.length!==0&&ue.uint32(10).bytes(se.key),se.left!==void 0&&r.encode(se.left,ue.uint32(18).fork()).ldelim(),se.right!==void 0&&r.encode(se.right,ue.uint32(26).fork()).ldelim(),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=o();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.key=ie.bytes();break;case 2:me.left=r.decode(ie,ie.uint32());break;case 3:me.right=r.decode(ie,ie.uint32());break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie=o();return ie.key=(ue=se.key)!==null&&ue!==void 0?ue:new Uint8Array,ie.left=se.left!==void 0&&se.left!==null?r.fromPartial(se.left):void 0,ie.right=se.right!==void 0&&se.right!==null?r.fromPartial(se.right):void 0,ie}};St.NonExistenceProof=u;function R(){return{exist:void 0,nonexist:void 0,batch:void 0,compressed:void 0}}var h={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.exist!==void 0&&r.encode(se.exist,ue.uint32(10).fork()).ldelim(),se.nonexist!==void 0&&u.encode(se.nonexist,ue.uint32(18).fork()).ldelim(),se.batch!==void 0&&T.encode(se.batch,ue.uint32(26).fork()).ldelim(),se.compressed!==void 0&&F.encode(se.compressed,ue.uint32(34).fork()).ldelim(),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=R();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.exist=r.decode(ie,ie.uint32());break;case 2:me.nonexist=u.decode(ie,ie.uint32());break;case 3:me.batch=T.decode(ie,ie.uint32());break;case 4:me.compressed=F.decode(ie,ie.uint32());break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue=R();return ue.exist=se.exist!==void 0&&se.exist!==null?r.fromPartial(se.exist):void 0,ue.nonexist=se.nonexist!==void 0&&se.nonexist!==null?u.fromPartial(se.nonexist):void 0,ue.batch=se.batch!==void 0&&se.batch!==null?T.fromPartial(se.batch):void 0,ue.compressed=se.compressed!==void 0&&se.compressed!==null?F.fromPartial(se.compressed):void 0,ue}};St.CommitmentProof=h;function S(){return{hash:0,prehashKey:0,prehashValue:0,length:0,prefix:new Uint8Array}}var C={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.hash!==0&&ue.uint32(8).int32(se.hash),se.prehashKey!==0&&ue.uint32(16).int32(se.prehashKey),se.prehashValue!==0&&ue.uint32(24).int32(se.prehashValue),se.length!==0&&ue.uint32(32).int32(se.length),se.prefix.length!==0&&ue.uint32(42).bytes(se.prefix),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=S();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.hash=ie.int32();break;case 2:me.prehashKey=ie.int32();break;case 3:me.prehashValue=ie.int32();break;case 4:me.length=ie.int32();break;case 5:me.prefix=ie.bytes();break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie,ge,me,de,te=S();return te.hash=(ue=se.hash)!==null&&ue!==void 0?ue:0,te.prehashKey=(ie=se.prehashKey)!==null&&ie!==void 0?ie:0,te.prehashValue=(ge=se.prehashValue)!==null&&ge!==void 0?ge:0,te.length=(me=se.length)!==null&&me!==void 0?me:0,te.prefix=(de=se.prefix)!==null&&de!==void 0?de:new Uint8Array,te}};St.LeafOp=C;function y(){return{hash:0,prefix:new Uint8Array,suffix:new Uint8Array}}var s={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.hash!==0&&ue.uint32(8).int32(se.hash),se.prefix.length!==0&&ue.uint32(18).bytes(se.prefix),se.suffix.length!==0&&ue.uint32(26).bytes(se.suffix),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=y();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.hash=ie.int32();break;case 2:me.prefix=ie.bytes();break;case 3:me.suffix=ie.bytes();break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie,ge,me=y();return me.hash=(ue=se.hash)!==null&&ue!==void 0?ue:0,me.prefix=(ie=se.prefix)!==null&&ie!==void 0?ie:new Uint8Array,me.suffix=(ge=se.suffix)!==null&&ge!==void 0?ge:new Uint8Array,me}};St.InnerOp=s;function k(){return{leafSpec:C.fromPartial({}),innerSpec:b.fromPartial({}),maxDepth:0,minDepth:0}}var D={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.leafSpec!==void 0&&C.encode(se.leafSpec,ue.uint32(10).fork()).ldelim(),se.innerSpec!==void 0&&b.encode(se.innerSpec,ue.uint32(18).fork()).ldelim(),se.maxDepth!==0&&ue.uint32(24).int32(se.maxDepth),se.minDepth!==0&&ue.uint32(32).int32(se.minDepth),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=k();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.leafSpec=C.decode(ie,ie.uint32());break;case 2:me.innerSpec=b.decode(ie,ie.uint32());break;case 3:me.maxDepth=ie.int32();break;case 4:me.minDepth=ie.int32();break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie,ge=k();return ge.leafSpec=se.leafSpec!==void 0&&se.leafSpec!==null?C.fromPartial(se.leafSpec):void 0,ge.innerSpec=se.innerSpec!==void 0&&se.innerSpec!==null?b.fromPartial(se.innerSpec):void 0,ge.maxDepth=(ue=se.maxDepth)!==null&&ue!==void 0?ue:0,ge.minDepth=(ie=se.minDepth)!==null&&ie!==void 0?ie:0,ge}};St.ProofSpec=D;function m(){return{childOrder:[],childSize:0,minPrefixLength:0,maxPrefixLength:0,emptyChild:new Uint8Array,hash:0}}var b={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();ue.uint32(10).fork();var ie=g(se.childOrder),ge;try{for(ie.s();!(ge=ie.n()).done;){var me=ge.value;ue.int32(me)}}catch(de){ie.e(de)}finally{ie.f()}return ue.ldelim(),se.childSize!==0&&ue.uint32(16).int32(se.childSize),se.minPrefixLength!==0&&ue.uint32(24).int32(se.minPrefixLength),se.maxPrefixLength!==0&&ue.uint32(32).int32(se.maxPrefixLength),se.emptyChild.length!==0&&ue.uint32(42).bytes(se.emptyChild),se.hash!==0&&ue.uint32(48).int32(se.hash),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=m();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:if((de&7)===2)for(var te=ie.uint32()+ie.pos;ie.pos<te;)me.childOrder.push(ie.int32());else me.childOrder.push(ie.int32());break;case 2:me.childSize=ie.int32();break;case 3:me.minPrefixLength=ie.int32();break;case 4:me.maxPrefixLength=ie.int32();break;case 5:me.emptyChild=ie.bytes();break;case 6:me.hash=ie.int32();break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie,ge,me,de,te,Y=m();return Y.childOrder=((ue=se.childOrder)===null||ue===void 0?void 0:ue.map(function(re){return re}))||[],Y.childSize=(ie=se.childSize)!==null&&ie!==void 0?ie:0,Y.minPrefixLength=(ge=se.minPrefixLength)!==null&&ge!==void 0?ge:0,Y.maxPrefixLength=(me=se.maxPrefixLength)!==null&&me!==void 0?me:0,Y.emptyChild=(de=se.emptyChild)!==null&&de!==void 0?de:new Uint8Array,Y.hash=(te=se.hash)!==null&&te!==void 0?te:0,Y}};St.InnerSpec=b;function Q(){return{entries:[]}}var T={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create(),ie=g(se.entries),ge;try{for(ie.s();!(ge=ie.n()).done;){var me=ge.value;Z.encode(me,ue.uint32(10).fork()).ldelim()}}catch(de){ie.e(de)}finally{ie.f()}return ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=Q();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.entries.push(Z.decode(ie,ie.uint32()));break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie=Q();return ie.entries=((ue=se.entries)===null||ue===void 0?void 0:ue.map(function(ge){return Z.fromPartial(ge)}))||[],ie}};St.BatchProof=T;function q(){return{exist:void 0,nonexist:void 0}}var Z={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.exist!==void 0&&r.encode(se.exist,ue.uint32(10).fork()).ldelim(),se.nonexist!==void 0&&u.encode(se.nonexist,ue.uint32(18).fork()).ldelim(),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=q();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.exist=r.decode(ie,ie.uint32());break;case 2:me.nonexist=u.decode(ie,ie.uint32());break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue=q();return ue.exist=se.exist!==void 0&&se.exist!==null?r.fromPartial(se.exist):void 0,ue.nonexist=se.nonexist!==void 0&&se.nonexist!==null?u.fromPartial(se.nonexist):void 0,ue}};St.BatchEntry=Z;function z(){return{entries:[],lookupInners:[]}}var F={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create(),ie=g(se.entries),ge;try{for(ie.s();!(ge=ie.n()).done;){var me=ge.value;J.encode(me,ue.uint32(10).fork()).ldelim()}}catch(re){ie.e(re)}finally{ie.f()}var de=g(se.lookupInners),te;try{for(de.s();!(te=de.n()).done;){var Y=te.value;s.encode(Y,ue.uint32(18).fork()).ldelim()}}catch(re){de.e(re)}finally{de.f()}return ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=z();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.entries.push(J.decode(ie,ie.uint32()));break;case 2:me.lookupInners.push(s.decode(ie,ie.uint32()));break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie,ge=z();return ge.entries=((ue=se.entries)===null||ue===void 0?void 0:ue.map(function(me){return J.fromPartial(me)}))||[],ge.lookupInners=((ie=se.lookupInners)===null||ie===void 0?void 0:ie.map(function(me){return s.fromPartial(me)}))||[],ge}};St.CompressedBatchProof=F;function H(){return{exist:void 0,nonexist:void 0}}var J={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.exist!==void 0&&L.encode(se.exist,ue.uint32(10).fork()).ldelim(),se.nonexist!==void 0&&K.encode(se.nonexist,ue.uint32(18).fork()).ldelim(),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=H();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.exist=L.decode(ie,ie.uint32());break;case 2:me.nonexist=K.decode(ie,ie.uint32());break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue=H();return ue.exist=se.exist!==void 0&&se.exist!==null?L.fromPartial(se.exist):void 0,ue.nonexist=se.nonexist!==void 0&&se.nonexist!==null?K.fromPartial(se.nonexist):void 0,ue}};St.CompressedBatchEntry=J;function N(){return{key:new Uint8Array,value:new Uint8Array,leaf:C.fromPartial({}),path:[]}}var L={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();se.key.length!==0&&ue.uint32(10).bytes(se.key),se.value.length!==0&&ue.uint32(18).bytes(se.value),se.leaf!==void 0&&C.encode(se.leaf,ue.uint32(26).fork()).ldelim(),ue.uint32(34).fork();var ie=g(se.path),ge;try{for(ie.s();!(ge=ie.n()).done;){var me=ge.value;ue.int32(me)}}catch(de){ie.e(de)}finally{ie.f()}return ue.ldelim(),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=N();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.key=ie.bytes();break;case 2:me.value=ie.bytes();break;case 3:me.leaf=C.decode(ie,ie.uint32());break;case 4:if((de&7)===2)for(var te=ie.uint32()+ie.pos;ie.pos<te;)me.path.push(ie.int32());else me.path.push(ie.int32());break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie,ge,me=N();return me.key=(ue=se.key)!==null&&ue!==void 0?ue:new Uint8Array,me.value=(ie=se.value)!==null&&ie!==void 0?ie:new Uint8Array,me.leaf=se.leaf!==void 0&&se.leaf!==null?C.fromPartial(se.leaf):void 0,me.path=((ge=se.path)===null||ge===void 0?void 0:ge.map(function(de){return de}))||[],me}};St.CompressedExistenceProof=L;function B(){return{key:new Uint8Array,left:L.fromPartial({}),right:L.fromPartial({})}}var K={encode:function(se){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return se.key.length!==0&&ue.uint32(10).bytes(se.key),se.left!==void 0&&L.encode(se.left,ue.uint32(18).fork()).ldelim(),se.right!==void 0&&L.encode(se.right,ue.uint32(26).fork()).ldelim(),ue},decode:function(se,ue){for(var ie=se instanceof w.Reader?se:new w.Reader(se),ge=ue===void 0?ie.len:ie.pos+ue,me=B();ie.pos<ge;){var de=ie.uint32();switch(de>>>3){case 1:me.key=ie.bytes();break;case 2:me.left=L.decode(ie,ie.uint32());break;case 3:me.right=L.decode(ie,ie.uint32());break;default:ie.skipType(de&7);break}}return me},fromPartial:function(se){var ue,ie=B();return ie.key=(ue=se.key)!==null&&ue!==void 0?ue:new Uint8Array,ie.left=se.left!==void 0&&se.left!==null?L.fromPartial(se.left):void 0,ie.right=se.right!==void 0&&se.right!==null?L.fromPartial(se.right):void 0,ie}};return St.CompressedNonExistenceProof=K,St}var CC;function o6(){if(CC)return Tl;CC=1;var e=oe.interopRequireDefaultExports,w=oe.require_typeof();Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.ics23=void 0;var c=e(xr),n=f(M1());function g(p){if(typeof WeakMap!="function")return null;var A=new WeakMap,I=new WeakMap;return(g=function(i){return i?I:A})(p)}function f(p,A){if(!A&&p&&p.__esModule)return p;if(p===null||w(p)!=="object"&&typeof p!="function")return{default:p};var I=g(A);if(I&&I.has(p))return I.get(p);var d={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in p)if(t!=="default"&&Object.prototype.hasOwnProperty.call(p,t)){var a=i?Object.getOwnPropertyDescriptor(p,t):null;a&&(a.get||a.set)?Object.defineProperty(d,t,a):d[t]=p[t]}return d.default=p,I&&I.set(p,d),d}function l(p,A){var I=Object.keys(p);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(p);A&&(d=d.filter(function(i){return Object.getOwnPropertyDescriptor(p,i).enumerable})),I.push.apply(I,d)}return I}function v(p){for(var A=1;A<arguments.length;A++){var I=arguments[A]!=null?arguments[A]:{};A%2?l(Object(I),!0).forEach(function(d){(0,c.default)(p,d,I[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(I)):l(Object(I)).forEach(function(d){Object.defineProperty(p,d,Object.getOwnPropertyDescriptor(I,d))})}return p}var P=v({},n);return Tl.ics23=P,Tl}var Dl={},pi={},RC;function d6(){if(RC)return pi;RC=1;var e=oe.require_typeof();Object.defineProperty(pi,"__esModule",{value:!0}),pi.ScalarTypeSDKType=pi.ScalarType=pi.ScalarDescriptor=pi.InterfaceDescriptor=void 0,pi.scalarTypeFromJSON=p,pi.scalarTypeToJSON=A;var w=n(Jn());function c(a){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(c=function(R){return R?o:r})(a)}function n(a,r){if(!r&&a&&a.__esModule)return a;if(a===null||e(a)!=="object"&&typeof a!="function")return{default:a};var o=c(r);if(o&&o.has(a))return o.get(a);var u={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in a)if(h!=="default"&&Object.prototype.hasOwnProperty.call(a,h)){var S=R?Object.getOwnPropertyDescriptor(a,h):null;S&&(S.get||S.set)?Object.defineProperty(u,h,S):u[h]=a[h]}return u.default=a,o&&o.set(a,u),u}function g(a,r){var o=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(!o){if(Array.isArray(a)||(o=f(a))||r&&a&&typeof a.length=="number"){o&&(a=o);var u=0,R=function(){};return{s:R,n:function(){return u>=a.length?{done:!0}:{done:!1,value:a[u++]}},e:function(s){throw s},f:R}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=!0,S=!1,C;return{s:function(){o=o.call(a)},n:function(){var s=o.next();return h=s.done,s},e:function(s){S=!0,C=s},f:function(){try{!h&&o.return!=null&&o.return()}finally{if(S)throw C}}}}function f(a,r){if(a){if(typeof a=="string")return l(a,r);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return l(a,r)}}function l(a,r){(r==null||r>a.length)&&(r=a.length);for(var o=0,u=new Array(r);o<r;o++)u[o]=a[o];return u}var v;pi.ScalarType=v,function(a){a[a.SCALAR_TYPE_UNSPECIFIED=0]="SCALAR_TYPE_UNSPECIFIED",a[a.SCALAR_TYPE_STRING=1]="SCALAR_TYPE_STRING",a[a.SCALAR_TYPE_BYTES=2]="SCALAR_TYPE_BYTES",a[a.UNRECOGNIZED=-1]="UNRECOGNIZED"}(v||(pi.ScalarType=v={}));var P=v;pi.ScalarTypeSDKType=P;function p(a){switch(a){case 0:case"SCALAR_TYPE_UNSPECIFIED":return v.SCALAR_TYPE_UNSPECIFIED;case 1:case"SCALAR_TYPE_STRING":return v.SCALAR_TYPE_STRING;case 2:case"SCALAR_TYPE_BYTES":return v.SCALAR_TYPE_BYTES;case-1:case"UNRECOGNIZED":default:return v.UNRECOGNIZED}}function A(a){switch(a){case v.SCALAR_TYPE_UNSPECIFIED:return"SCALAR_TYPE_UNSPECIFIED";case v.SCALAR_TYPE_STRING:return"SCALAR_TYPE_STRING";case v.SCALAR_TYPE_BYTES:return"SCALAR_TYPE_BYTES";case v.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function I(){return{name:"",description:""}}var d={encode:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return r.name!==""&&o.uint32(10).string(r.name),r.description!==""&&o.uint32(18).string(r.description),o},decode:function(r,o){for(var u=r instanceof w.Reader?r:new w.Reader(r),R=o===void 0?u.len:u.pos+o,h=I();u.pos<R;){var S=u.uint32();switch(S>>>3){case 1:h.name=u.string();break;case 2:h.description=u.string();break;default:u.skipType(S&7);break}}return h},fromPartial:function(r){var o,u,R=I();return R.name=(o=r.name)!==null&&o!==void 0?o:"",R.description=(u=r.description)!==null&&u!==void 0?u:"",R}};pi.InterfaceDescriptor=d;function i(){return{name:"",description:"",fieldType:[]}}var t={encode:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();r.name!==""&&o.uint32(10).string(r.name),r.description!==""&&o.uint32(18).string(r.description),o.uint32(26).fork();var u=g(r.fieldType),R;try{for(u.s();!(R=u.n()).done;){var h=R.value;o.int32(h)}}catch(S){u.e(S)}finally{u.f()}return o.ldelim(),o},decode:function(r,o){for(var u=r instanceof w.Reader?r:new w.Reader(r),R=o===void 0?u.len:u.pos+o,h=i();u.pos<R;){var S=u.uint32();switch(S>>>3){case 1:h.name=u.string();break;case 2:h.description=u.string();break;case 3:if((S&7)===2)for(var C=u.uint32()+u.pos;u.pos<C;)h.fieldType.push(u.int32());else h.fieldType.push(u.int32());break;default:u.skipType(S&7);break}}return h},fromPartial:function(r){var o,u,R,h=i();return h.name=(o=r.name)!==null&&o!==void 0?o:"",h.description=(u=r.description)!==null&&u!==void 0?u:"",h.fieldType=((R=r.fieldType)===null||R===void 0?void 0:R.map(function(S){return S}))||[],h}};return pi.ScalarDescriptor=t,pi}var SC;function u6(){if(SC)return Dl;SC=1;var e=oe.interopRequireDefaultExports,w=oe.require_typeof();Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.cosmos_proto=void 0;var c=e(xr),n=f(d6());function g(p){if(typeof WeakMap!="function")return null;var A=new WeakMap,I=new WeakMap;return(g=function(i){return i?I:A})(p)}function f(p,A){if(!A&&p&&p.__esModule)return p;if(p===null||w(p)!=="object"&&typeof p!="function")return{default:p};var I=g(A);if(I&&I.has(p))return I.get(p);var d={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in p)if(t!=="default"&&Object.prototype.hasOwnProperty.call(p,t)){var a=i?Object.getOwnPropertyDescriptor(p,t):null;a&&(a.get||a.set)?Object.defineProperty(d,t,a):d[t]=p[t]}return d.default=p,I&&I.set(p,d),d}function l(p,A){var I=Object.keys(p);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(p);A&&(d=d.filter(function(i){return Object.getOwnPropertyDescriptor(p,i).enumerable})),I.push.apply(I,d)}return I}function v(p){for(var A=1;A<arguments.length;A++){var I=arguments[A]!=null?arguments[A]:{};A%2?l(Object(I),!0).forEach(function(d){(0,c.default)(p,d,I[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(I)):l(Object(I)).forEach(function(d){Object.defineProperty(p,d,Object.getOwnPropertyDescriptor(I,d))})}return p}var P=v({},n);return Dl.cosmos_proto=P,Dl}var Jc={},id={},Nl={},wC;function ua(){if(wC)return Nl;wC=1;var e=oe.require_typeof();Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.Any=void 0;var w=n(Jn());function c(l){if(typeof WeakMap!="function")return null;var v=new WeakMap,P=new WeakMap;return(c=function(A){return A?P:v})(l)}function n(l,v){if(!v&&l&&l.__esModule)return l;if(l===null||e(l)!=="object"&&typeof l!="function")return{default:l};var P=c(v);if(P&&P.has(l))return P.get(l);var p={},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in l)if(I!=="default"&&Object.prototype.hasOwnProperty.call(l,I)){var d=A?Object.getOwnPropertyDescriptor(l,I):null;d&&(d.get||d.set)?Object.defineProperty(p,I,d):p[I]=l[I]}return p.default=l,P&&P.set(l,p),p}function g(){return{typeUrl:"",value:new Uint8Array}}var f={encode:function(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.Writer.create();return v.typeUrl!==""&&P.uint32(10).string(v.typeUrl),v.value.length!==0&&P.uint32(18).bytes(v.value),P},decode:function(v,P){for(var p=v instanceof w.Reader?v:new w.Reader(v),A=P===void 0?p.len:p.pos+P,I=g();p.pos<A;){var d=p.uint32();switch(d>>>3){case 1:I.typeUrl=p.string();break;case 2:I.value=p.bytes();break;default:p.skipType(d&7);break}}return I},fromPartial:function(v){var P,p,A=g();return A.typeUrl=(P=v.typeUrl)!==null&&P!==void 0?P:"",A.value=(p=v.value)!==null&&p!==void 0?p:new Uint8Array,A}};return Nl.Any=f,Nl}var SA={},PC;function Br(){return PC||(PC=1,function(e){var w=oe.interopRequireDefaultExports,c=oe.require_typeof();Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Long",{enumerable:!0,get:function(){return f.default}}),e.base64FromBytes=d,e.bytesFromBase64=A,e.fromDuration=a,e.fromJsonTimestamp=C,e.fromTimestamp=h,e.isObject=o,e.isSet=r,e.omitDefault=i,e.setPaginationParams=void 0,e.toDuration=t,e.toTimestamp=R;var n=w(oe.require_typeof()),g=v(Jn()),f=w(oe.long);function l(s){if(typeof WeakMap!="function")return null;var k=new WeakMap,D=new WeakMap;return(l=function(b){return b?D:k})(s)}function v(s,k){if(!k&&s&&s.__esModule)return s;if(s===null||c(s)!=="object"&&typeof s!="function")return{default:s};var D=l(k);if(D&&D.has(s))return D.get(s);var m={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in s)if(Q!=="default"&&Object.prototype.hasOwnProperty.call(s,Q)){var T=b?Object.getOwnPropertyDescriptor(s,Q):null;T&&(T.get||T.set)?Object.defineProperty(m,Q,T):m[Q]=s[Q]}return m.default=s,D&&D.set(s,m),m}g.util.Long!==f.default&&(g.util.Long=f.default,g.configure());var P=function(){if(typeof P<"u")return P;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof oe.commonjsGlobal<"u")return oe.commonjsGlobal;throw"Unable to locate global object"}(),p=P.atob||function(s){return P.Buffer.from(s,"base64").toString("binary")};function A(s){for(var k=p(s),D=new Uint8Array(k.length),m=0;m<k.length;++m)D[m]=k.charCodeAt(m);return D}var I=P.btoa||function(s){return P.Buffer.from(s,"binary").toString("base64")};function d(s){var k=[];return s.forEach(function(D){k.push(String.fromCharCode(D))}),I(k.join(""))}function i(s){if(typeof s=="string")return s===""?void 0:s;if(typeof s=="number")return s===0?void 0:s;if(f.default.isLong(s))return s.isZero()?void 0:s;throw new Error("Got unsupported type ".concat((0,n.default)(s)))}function t(s){return{seconds:f.default.fromNumber(Math.floor(parseInt(s)/1e9)),nanos:parseInt(s)%1e9}}function a(s){return(parseInt(s.seconds.toString())*1e9+s.nanos).toString()}function r(s){return s!=null}function o(s){return(0,n.default)(s)==="object"&&s!==null}var u=function(k,D){return D&&(typeof(D==null?void 0:D.countTotal)<"u"&&(k.params["pagination.count_total"]=D.countTotal),typeof(D==null?void 0:D.key)<"u"&&(k.params["pagination.key"]=oe.dist.Buffer.from(D.key).toString("base64")),typeof(D==null?void 0:D.limit)<"u"&&(k.params["pagination.limit"]=D.limit.toString()),typeof(D==null?void 0:D.offset)<"u"&&(k.params["pagination.offset"]=D.offset.toString()),typeof(D==null?void 0:D.reverse)<"u"&&(k.params["pagination.reverse"]=D.reverse)),k};e.setPaginationParams=u;function R(s){var k=y(s.getTime()/1e3),D=s.getTime()%1e3*1e6;return{seconds:k,nanos:D}}function h(s){var k=s.seconds.toNumber()*1e3;return k+=s.nanos/1e6,new Date(k)}var S=function(k){return{seconds:r(k.seconds)?f.default.fromValue(k.seconds):f.default.ZERO,nanos:r(k.nanos)?Number(k.nanos):0}};function C(s){return s instanceof Date?R(s):typeof s=="string"?R(new Date(s)):S(s)}function y(s){return f.default.fromNumber(s)}}(SA)),SA}var _C;function q1(){if(_C)return id;_C=1;var e=oe.require_typeof();Object.defineProperty(id,"__esModule",{value:!0}),id.Params=id.ModuleAccount=id.BaseAccount=void 0;var w=ua(),c=Br(),n=f(Jn());function g(a){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(g=function(R){return R?o:r})(a)}function f(a,r){if(!r&&a&&a.__esModule)return a;if(a===null||e(a)!=="object"&&typeof a!="function")return{default:a};var o=g(r);if(o&&o.has(a))return o.get(a);var u={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in a)if(h!=="default"&&Object.prototype.hasOwnProperty.call(a,h)){var S=R?Object.getOwnPropertyDescriptor(a,h):null;S&&(S.get||S.set)?Object.defineProperty(u,h,S):u[h]=a[h]}return u.default=a,o&&o.set(a,u),u}function l(a,r){var o=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(!o){if(Array.isArray(a)||(o=v(a))||r&&a&&typeof a.length=="number"){o&&(a=o);var u=0,R=function(){};return{s:R,n:function(){return u>=a.length?{done:!0}:{done:!1,value:a[u++]}},e:function(s){throw s},f:R}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=!0,S=!1,C;return{s:function(){o=o.call(a)},n:function(){var s=o.next();return h=s.done,s},e:function(s){S=!0,C=s},f:function(){try{!h&&o.return!=null&&o.return()}finally{if(S)throw C}}}}function v(a,r){if(a){if(typeof a=="string")return P(a,r);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return P(a,r)}}function P(a,r){(r==null||r>a.length)&&(r=a.length);for(var o=0,u=new Array(r);o<r;o++)u[o]=a[o];return u}function p(){return{address:"",pubKey:void 0,accountNumber:c.Long.UZERO,sequence:c.Long.UZERO}}var A={encode:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n.Writer.create();return r.address!==""&&o.uint32(10).string(r.address),r.pubKey!==void 0&&w.Any.encode(r.pubKey,o.uint32(18).fork()).ldelim(),r.accountNumber.isZero()||o.uint32(24).uint64(r.accountNumber),r.sequence.isZero()||o.uint32(32).uint64(r.sequence),o},decode:function(r,o){for(var u=r instanceof n.Reader?r:new n.Reader(r),R=o===void 0?u.len:u.pos+o,h=p();u.pos<R;){var S=u.uint32();switch(S>>>3){case 1:h.address=u.string();break;case 2:h.pubKey=w.Any.decode(u,u.uint32());break;case 3:h.accountNumber=u.uint64();break;case 4:h.sequence=u.uint64();break;default:u.skipType(S&7);break}}return h},fromPartial:function(r){var o,u=p();return u.address=(o=r.address)!==null&&o!==void 0?o:"",u.pubKey=r.pubKey!==void 0&&r.pubKey!==null?w.Any.fromPartial(r.pubKey):void 0,u.accountNumber=r.accountNumber!==void 0&&r.accountNumber!==null?c.Long.fromValue(r.accountNumber):c.Long.UZERO,u.sequence=r.sequence!==void 0&&r.sequence!==null?c.Long.fromValue(r.sequence):c.Long.UZERO,u}};id.BaseAccount=A;function I(){return{baseAccount:A.fromPartial({}),name:"",permissions:[]}}var d={encode:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n.Writer.create();r.baseAccount!==void 0&&A.encode(r.baseAccount,o.uint32(10).fork()).ldelim(),r.name!==""&&o.uint32(18).string(r.name);var u=l(r.permissions),R;try{for(u.s();!(R=u.n()).done;){var h=R.value;o.uint32(26).string(h)}}catch(S){u.e(S)}finally{u.f()}return o},decode:function(r,o){for(var u=r instanceof n.Reader?r:new n.Reader(r),R=o===void 0?u.len:u.pos+o,h=I();u.pos<R;){var S=u.uint32();switch(S>>>3){case 1:h.baseAccount=A.decode(u,u.uint32());break;case 2:h.name=u.string();break;case 3:h.permissions.push(u.string());break;default:u.skipType(S&7);break}}return h},fromPartial:function(r){var o,u,R=I();return R.baseAccount=r.baseAccount!==void 0&&r.baseAccount!==null?A.fromPartial(r.baseAccount):void 0,R.name=(o=r.name)!==null&&o!==void 0?o:"",R.permissions=((u=r.permissions)===null||u===void 0?void 0:u.map(function(h){return h}))||[],R}};id.ModuleAccount=d;function i(){return{maxMemoCharacters:c.Long.UZERO,txSigLimit:c.Long.UZERO,txSizeCostPerByte:c.Long.UZERO,sigVerifyCostEd25519:c.Long.UZERO,sigVerifyCostSecp256k1:c.Long.UZERO}}var t={encode:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n.Writer.create();return r.maxMemoCharacters.isZero()||o.uint32(8).uint64(r.maxMemoCharacters),r.txSigLimit.isZero()||o.uint32(16).uint64(r.txSigLimit),r.txSizeCostPerByte.isZero()||o.uint32(24).uint64(r.txSizeCostPerByte),r.sigVerifyCostEd25519.isZero()||o.uint32(32).uint64(r.sigVerifyCostEd25519),r.sigVerifyCostSecp256k1.isZero()||o.uint32(40).uint64(r.sigVerifyCostSecp256k1),o},decode:function(r,o){for(var u=r instanceof n.Reader?r:new n.Reader(r),R=o===void 0?u.len:u.pos+o,h=i();u.pos<R;){var S=u.uint32();switch(S>>>3){case 1:h.maxMemoCharacters=u.uint64();break;case 2:h.txSigLimit=u.uint64();break;case 3:h.txSizeCostPerByte=u.uint64();break;case 4:h.sigVerifyCostEd25519=u.uint64();break;case 5:h.sigVerifyCostSecp256k1=u.uint64();break;default:u.skipType(S&7);break}}return h},fromPartial:function(r){var o=i();return o.maxMemoCharacters=r.maxMemoCharacters!==void 0&&r.maxMemoCharacters!==null?c.Long.fromValue(r.maxMemoCharacters):c.Long.UZERO,o.txSigLimit=r.txSigLimit!==void 0&&r.txSigLimit!==null?c.Long.fromValue(r.txSigLimit):c.Long.UZERO,o.txSizeCostPerByte=r.txSizeCostPerByte!==void 0&&r.txSizeCostPerByte!==null?c.Long.fromValue(r.txSizeCostPerByte):c.Long.UZERO,o.sigVerifyCostEd25519=r.sigVerifyCostEd25519!==void 0&&r.sigVerifyCostEd25519!==null?c.Long.fromValue(r.sigVerifyCostEd25519):c.Long.UZERO,o.sigVerifyCostSecp256k1=r.sigVerifyCostSecp256k1!==void 0&&r.sigVerifyCostSecp256k1!==null?c.Long.fromValue(r.sigVerifyCostSecp256k1):c.Long.UZERO,o}};return id.Params=t,id}var Ql={},IC;function s6(){if(IC)return Ql;IC=1;var e=oe.require_typeof();Object.defineProperty(Ql,"__esModule",{value:!0}),Ql.GenesisState=void 0;var w=q1(),c=ua(),n=f(Jn());function g(I){if(typeof WeakMap!="function")return null;var d=new WeakMap,i=new WeakMap;return(g=function(a){return a?i:d})(I)}function f(I,d){if(!d&&I&&I.__esModule)return I;if(I===null||e(I)!=="object"&&typeof I!="function")return{default:I};var i=g(d);if(i&&i.has(I))return i.get(I);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in I)if(r!=="default"&&Object.prototype.hasOwnProperty.call(I,r)){var o=a?Object.getOwnPropertyDescriptor(I,r):null;o&&(o.get||o.set)?Object.defineProperty(t,r,o):t[r]=I[r]}return t.default=I,i&&i.set(I,t),t}function l(I,d){var i=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!i){if(Array.isArray(I)||(i=v(I))||d&&I&&typeof I.length=="number"){i&&(I=i);var t=0,a=function(){};return{s:a,n:function(){return t>=I.length?{done:!0}:{done:!1,value:I[t++]}},e:function(h){throw h},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
@@ -1,4 +1,4 @@
1
- import { q as m8, aw as D6, ax as v8, ay as y8, az as k8, aA as C8, aB as R8, aC as S8, aD as w8, p as qe, aE as $n, aF as Br, aG as or, d as Rt, J as P8, K as Bc, M as _8, O as Jh, P as I8, Q as E8, aH as Sh, T as O8, s as Du, x as Eg, aI as Ut, aJ as qt, aK as yt, aL as kt, aM as Pi, aN as b8, aO as B8, g as N6, aP as $1, aQ as Q6, aR as M6, aS as U6, t as q6, aT as H6, W as J6, aU as IC, c as zc, f as _A, B as wh, o as EC, aV as V6 } from "./index-DL8L1ROt.mjs";
1
+ import { q as m8, aw as D6, ax as v8, ay as y8, az as k8, aA as C8, aB as R8, aC as S8, aD as w8, p as qe, aE as $n, aF as Br, aG as or, d as Rt, J as P8, K as Bc, M as _8, O as Jh, P as I8, Q as E8, aH as Sh, T as O8, s as Du, x as Eg, aI as Ut, aJ as qt, aK as yt, aL as kt, aM as Pi, aN as b8, aO as B8, g as N6, aP as $1, aQ as Q6, aR as M6, aS as U6, t as q6, aT as H6, W as J6, aU as IC, c as zc, f as _A, B as wh, o as EC, aV as V6 } from "./index-DV6sNreL.mjs";
2
2
  var bc = {}, T8 = {}, D8 = {}, Vh = {}, IA = {}, EA = {}, Gl = {};
3
3
  const zr = /* @__PURE__ */ m8(D6);
4
4
  var Ot = {}, OA = {}, bA = {}, BA, OC;