UNPKG

starknetkit

Version:

<!-- logo --> <p align="center"> <img width='300' src="https://starknetkit-website-git-blo-1541-argentlabs.vercel.app/starknetKit-logo.svg"> </p>

14 lines (12 loc) 550 kB
"use strict";var al=Object.defineProperty;var ol=(r,e,t)=>e in r?al(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var He=(r,e,t)=>(ol(r,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const gt=require("./lastConnected-966555c5.cjs"),Nr=require("starknet"),fl=require("./index-c253c51d.cjs");require("./core-aa9478e0.cjs");require("./getStarknetChainId-db957824.cjs");require("./index-725d5c1d.cjs");var Oo={exports:{}},fn=typeof Reflect=="object"?Reflect:null,yf=fn&&typeof fn.apply=="function"?fn.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)},Ss;fn&&typeof fn.ownKeys=="function"?Ss=fn.ownKeys:Object.getOwnPropertySymbols?Ss=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ss=function(e){return Object.getOwnPropertyNames(e)};function cl(r){console&&console.warn&&console.warn(r)}var Ph=Number.isNaN||function(e){return e!==e};function nt(){nt.init.call(this)}Oo.exports=nt;Oo.exports.once=ll;nt.EventEmitter=nt;nt.prototype._events=void 0;nt.prototype._eventsCount=0;nt.prototype._maxListeners=void 0;var wf=10;function ta(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(nt,"defaultMaxListeners",{enumerable:!0,get:function(){return wf},set:function(r){if(typeof r!="number"||r<0||Ph(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");wf=r}});nt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};nt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Ph(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Oh(r){return r._maxListeners===void 0?nt.defaultMaxListeners:r._maxListeners}nt.prototype.getMaxListeners=function(){return Oh(this)};nt.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var f=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw f.context=o,f}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")yf(h,this,t);else for(var d=h.length,v=$h(h,d),i=0;i<d;++i)yf(v[i],this,t);return!0};function Rh(r,e,t,i){var n,s,o;if(ta(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=i?[t,o]:[o,t]:i?o.unshift(t):o.push(t),n=Oh(r),n>0&&o.length>n&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=r,f.type=e,f.count=o.length,cl(f)}return r}nt.prototype.addListener=function(e,t){return Rh(this,e,t,!1)};nt.prototype.on=nt.prototype.addListener;nt.prototype.prependListener=function(e,t){return Rh(this,e,t,!0)};function hl(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Nh(r,e,t){var i={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},n=hl.bind(i);return n.listener=t,i.wrapFn=n,n}nt.prototype.once=function(e,t){return ta(t),this.on(e,Nh(this,e,t)),this};nt.prototype.prependOnceListener=function(e,t){return ta(t),this.prependListener(e,Nh(this,e,t)),this};nt.prototype.removeListener=function(e,t){var i,n,s,o,f;if(ta(t),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){f=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():ul(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,f||t)}return this};nt.prototype.off=nt.prototype.removeListener;nt.prototype.removeAllListeners=function(e){var t,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),o;for(n=0;n<s.length;++n)o=s[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=i[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this};function Th(r,e,t){var i=r._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?t?[n.listener||n]:[n]:t?dl(n):$h(n,n.length)}nt.prototype.listeners=function(e){return Th(this,e,!0)};nt.prototype.rawListeners=function(e){return Th(this,e,!1)};nt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Ch.call(r,e)};nt.prototype.listenerCount=Ch;function Ch(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}nt.prototype.eventNames=function(){return this._eventsCount>0?Ss(this._events):[]};function $h(r,e){for(var t=new Array(e),i=0;i<e;++i)t[i]=r[i];return t}function ul(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function dl(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function ll(r,e){return new Promise(function(t,i){function n(o){r.removeListener(e,s),i(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",n),t([].slice.call(arguments))}Lh(r,e,s,{once:!0}),e!=="error"&&pl(r,n,{once:!0})})}function pl(r,e,t){typeof r.on=="function"&&Lh(r,"error",e,t)}function Lh(r,e,t,i){if(typeof r.on=="function")i.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function n(s){i.once&&r.removeEventListener(e,n),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var ir=Oo.exports;const Fh=gt.getDefaultExportFromCjs(ir);var ie={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var so=function(r,e){return so=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},so(r,e)};function vl(r,e){so(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ao=function(){return ao=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ao.apply(this,arguments)};function bl(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}function gl(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var f=r.length-1;f>=0;f--)(o=r[f])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}function ml(r,e){return function(t,i){e(t,i,r)}}function yl(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function wl(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function f(v){try{d(i.next(v))}catch(w){o(w)}}function h(v){try{d(i.throw(v))}catch(w){o(w)}}function d(v){v.done?s(v.value):n(v.value).then(f,h)}d((i=i.apply(r,e||[])).next())})}function _l(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(d){return function(v){return h([d,v])}}function h(d){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,n=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){t.label=d[1];break}if(d[0]===6&&t.label<s[1]){t.label=s[1],s=d;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(d);break}s[2]&&t.ops.pop(),t.trys.pop();continue}d=e.call(r,t)}catch(v){d=[6,v],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function xl(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function El(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function oo(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function qh(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(f){o={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}function Sl(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(qh(arguments[e]));return r}function Ml(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,f=s.length;o<f;o++,n++)i[n]=s[o];return i}function Vn(r){return this instanceof Vn?(this.v=r,this):new Vn(r)}function Il(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(A){i[A]&&(n[A]=function(I){return new Promise(function(D,N){s.push([A,I,D,N])>1||f(A,I)})})}function f(A,I){try{h(i[A](I))}catch(D){w(s[0][3],D)}}function h(A){A.value instanceof Vn?Promise.resolve(A.value.v).then(d,v):w(s[0][2],A)}function d(A){f("next",A)}function v(A){f("throw",A)}function w(A,I){A(I),s.shift(),s.length&&f(s[0][0],s[0][1])}}function Al(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=r[n]?function(o){return(t=!t)?{value:Vn(r[n](o)),done:n==="return"}:s?s(o):o}:s}}function Dl(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof oo=="function"?oo(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=r[s]&&function(o){return new Promise(function(f,h){o=r[s](o),n(f,h,o.done,o.value)})}}function n(s,o,f,h){Promise.resolve(h).then(function(d){s({value:d,done:f})},o)}}function Pl(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function Ol(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function Rl(r){return r&&r.__esModule?r:{default:r}}function Nl(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function Tl(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const Cl=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return ao},__asyncDelegator:Al,__asyncGenerator:Il,__asyncValues:Dl,__await:Vn,__awaiter:wl,__classPrivateFieldGet:Nl,__classPrivateFieldSet:Tl,__createBinding:xl,__decorate:gl,__exportStar:El,__extends:vl,__generator:_l,__importDefault:Rl,__importStar:Ol,__makeTemplateObject:Pl,__metadata:yl,__param:ml,__read:qh,__rest:bl,__spread:Sl,__spreadArrays:Ml,__values:oo},Symbol.toStringTag,{value:"Module"})),Zn=gt.getAugmentedNamespace(Cl);var Ra={},On={},_f;function $l(){if(_f)return On;_f=1,Object.defineProperty(On,"__esModule",{value:!0}),On.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return On.delay=r,On}var Ri={},Na={},Ni={},xf;function Ll(){return xf||(xf=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.ONE_THOUSAND=Ni.ONE_HUNDRED=void 0,Ni.ONE_HUNDRED=100,Ni.ONE_THOUSAND=1e3),Ni}var Ta={},Ef;function Fl(){return Ef||(Ef=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(Ta)),Ta}var Sf;function Uh(){return Sf||(Sf=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Zn;e.__exportStar(Ll(),r),e.__exportStar(Fl(),r)}(Na)),Na}var Mf;function ql(){if(Mf)return Ri;Mf=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.fromMiliseconds=Ri.toMiliseconds=void 0;const r=Uh();function e(i){return i*r.ONE_THOUSAND}Ri.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return Ri.fromMiliseconds=t,Ri}var If;function Ul(){return If||(If=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Zn;e.__exportStar($l(),r),e.__exportStar(ql(),r)}(Ra)),Ra}var tn={},Af;function zl(){if(Af)return tn;Af=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const n=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:n})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return tn.Watch=r,tn.default=r,tn}var Ca={},Rn={},Df;function Bl(){if(Df)return Rn;Df=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.IWatch=void 0;class r{}return Rn.IWatch=r,Rn}var Pf;function kl(){return Pf||(Pf=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Zn.__exportStar(Bl(),r)}(Ca)),Ca}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Zn;e.__exportStar(Ul(),r),e.__exportStar(zl(),r),e.__exportStar(kl(),r),e.__exportStar(Uh(),r)})(ie);class Wi{}let jl=class extends Wi{constructor(e){super()}};const Of=ie.FIVE_SECONDS,bn={pulse:"heartbeat_pulse"};let Kl=class zh extends jl{constructor(e){super(e),this.events=new ir.EventEmitter,this.interval=Of,this.interval=e?.interval||Of}static async init(e){const t=new zh(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ie.toMiliseconds(this.interval))}pulse(){this.events.emit(bn.pulse)}};const Hl=/"(?:_|\\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*:/,Vl=/"(?: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*:/,Wl=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Gl(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Jl(r);return}return e}function Jl(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function ms(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.endsWith('"')&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const i=t.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!Wl.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(Hl.test(r)||Vl.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,Gl)}return JSON.parse(r)}catch(i){if(e.strict)throw i;return r}}function Yl(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function Et(r,...e){try{return Yl(r(...e))}catch(t){return Promise.reject(t)}}function Xl(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function Zl(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function Ms(r){if(Xl(r))return String(r);if(Zl(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return Ms(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const fo="base64:";function Ql(r){return typeof r=="string"?r:fo+r0(r)}function e0(r){return typeof r!="string"||!r.startsWith(fo)?r:t0(r.slice(fo.length))}function t0(r){return globalThis.Buffer?Buffer.from(r,"base64"):Uint8Array.from(globalThis.atob(r),e=>e.codePointAt(0))}function r0(r){return globalThis.Buffer?Buffer.from(r).toString("base64"):globalThis.btoa(String.fromCodePoint(...r))}function Gt(r){return r&&r.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function i0(...r){return Gt(r.join(":"))}function ys(r){return r=Gt(r),r?r+":":""}const n0="memory",s0=()=>{const r=new Map;return{name:n0,getInstance:()=>r,hasItem(e){return r.has(e)},getItem(e){return r.get(e)??null},getItemRaw(e){return r.get(e)??null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return[...r.keys()]},clear(){r.clear()},dispose(){r.clear()}}};function a0(r={}){const e={mounts:{"":r.driver||s0()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=d=>{for(const v of e.mountpoints)if(d.startsWith(v))return{base:v,relativeKey:d.slice(v.length),driver:e.mounts[v]};return{base:"",relativeKey:d,driver:e.mounts[""]}},i=(d,v)=>e.mountpoints.filter(w=>w.startsWith(d)||v&&d.startsWith(w)).map(w=>({relativeBase:d.length>w.length?d.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),n=(d,v)=>{if(e.watching){v=Gt(v);for(const w of e.watchListeners)w(d,v)}},s=async()=>{if(!e.watching){e.watching=!0;for(const d in e.mounts)e.unwatch[d]=await Rf(e.mounts[d],n,d)}},o=async()=>{if(e.watching){for(const d in e.unwatch)await e.unwatch[d]();e.unwatch={},e.watching=!1}},f=(d,v,w)=>{const A=new Map,I=D=>{let N=A.get(D.base);return N||(N={driver:D.driver,base:D.base,items:[]},A.set(D.base,N)),N};for(const D of d){const N=typeof D=="string",k=Gt(N?D:D.key),j=N?void 0:D.value,T=N||!D.options?v:{...v,...D.options},K=t(k);I(K).items.push({key:k,value:j,relativeKey:K.relativeKey,options:T})}return Promise.all([...A.values()].map(D=>w(D))).then(D=>D.flat())},h={hasItem(d,v={}){d=Gt(d);const{relativeKey:w,driver:A}=t(d);return Et(A.hasItem,w,v)},getItem(d,v={}){d=Gt(d);const{relativeKey:w,driver:A}=t(d);return Et(A.getItem,w,v).then(I=>ms(I))},getItems(d,v={}){return f(d,v,w=>w.driver.getItems?Et(w.driver.getItems,w.items.map(A=>({key:A.relativeKey,options:A.options})),v).then(A=>A.map(I=>({key:i0(w.base,I.key),value:ms(I.value)}))):Promise.all(w.items.map(A=>Et(w.driver.getItem,A.relativeKey,A.options).then(I=>({key:A.key,value:ms(I)})))))},getItemRaw(d,v={}){d=Gt(d);const{relativeKey:w,driver:A}=t(d);return A.getItemRaw?Et(A.getItemRaw,w,v):Et(A.getItem,w,v).then(I=>e0(I))},async setItem(d,v,w={}){if(v===void 0)return h.removeItem(d);d=Gt(d);const{relativeKey:A,driver:I}=t(d);I.setItem&&(await Et(I.setItem,A,Ms(v),w),I.watch||n("update",d))},async setItems(d,v){await f(d,v,async w=>{if(w.driver.setItems)return Et(w.driver.setItems,w.items.map(A=>({key:A.relativeKey,value:Ms(A.value),options:A.options})),v);w.driver.setItem&&await Promise.all(w.items.map(A=>Et(w.driver.setItem,A.relativeKey,Ms(A.value),A.options)))})},async setItemRaw(d,v,w={}){if(v===void 0)return h.removeItem(d,w);d=Gt(d);const{relativeKey:A,driver:I}=t(d);if(I.setItemRaw)await Et(I.setItemRaw,A,v,w);else if(I.setItem)await Et(I.setItem,A,Ql(v),w);else return;I.watch||n("update",d)},async removeItem(d,v={}){typeof v=="boolean"&&(v={removeMeta:v}),d=Gt(d);const{relativeKey:w,driver:A}=t(d);A.removeItem&&(await Et(A.removeItem,w,v),(v.removeMeta||v.removeMata)&&await Et(A.removeItem,w+"$",v),A.watch||n("remove",d))},async getMeta(d,v={}){typeof v=="boolean"&&(v={nativeOnly:v}),d=Gt(d);const{relativeKey:w,driver:A}=t(d),I=Object.create(null);if(A.getMeta&&Object.assign(I,await Et(A.getMeta,w,v)),!v.nativeOnly){const D=await Et(A.getItem,w+"$",v).then(N=>ms(N));D&&typeof D=="object"&&(typeof D.atime=="string"&&(D.atime=new Date(D.atime)),typeof D.mtime=="string"&&(D.mtime=new Date(D.mtime)),Object.assign(I,D))}return I},setMeta(d,v,w={}){return this.setItem(d+"$",v,w)},removeMeta(d,v={}){return this.removeItem(d+"$",v)},async getKeys(d,v={}){d=ys(d);const w=i(d,!0);let A=[];const I=[];for(const D of w){const N=await Et(D.driver.getKeys,D.relativeBase,v);for(const k of N){const j=D.mountpoint+Gt(k);A.some(T=>j.startsWith(T))||I.push(j)}A=[D.mountpoint,...A.filter(k=>!k.startsWith(D.mountpoint))]}return d?I.filter(D=>D.startsWith(d)&&D[D.length-1]!=="$"):I.filter(D=>D[D.length-1]!=="$")},async clear(d,v={}){d=ys(d),await Promise.all(i(d,!1).map(async w=>{if(w.driver.clear)return Et(w.driver.clear,w.relativeBase,v);if(w.driver.removeItem){const A=await w.driver.getKeys(w.relativeBase||"",v);return Promise.all(A.map(I=>w.driver.removeItem(I,v)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(d=>Nf(d)))},async watch(d){return await s(),e.watchListeners.push(d),async()=>{e.watchListeners=e.watchListeners.filter(v=>v!==d),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(d,v){if(d=ys(d),d&&e.mounts[d])throw new Error(`already mounted at ${d}`);return d&&(e.mountpoints.push(d),e.mountpoints.sort((w,A)=>A.length-w.length)),e.mounts[d]=v,e.watching&&Promise.resolve(Rf(v,n,d)).then(w=>{e.unwatch[d]=w}).catch(console.error),h},async unmount(d,v=!0){d=ys(d),!(!d||!e.mounts[d])&&(e.watching&&d in e.unwatch&&(e.unwatch[d]?.(),delete e.unwatch[d]),v&&await Nf(e.mounts[d]),e.mountpoints=e.mountpoints.filter(w=>w!==d),delete e.mounts[d])},getMount(d=""){d=Gt(d)+":";const v=t(d);return{driver:v.driver,base:v.base}},getMounts(d="",v={}){return d=Gt(d),i(d,v.parents).map(A=>({driver:A.driver,base:A.mountpoint}))},keys:(d,v={})=>h.getKeys(d,v),get:(d,v={})=>h.getItem(d,v),set:(d,v,w={})=>h.setItem(d,v,w),has:(d,v={})=>h.hasItem(d,v),del:(d,v={})=>h.removeItem(d,v),remove:(d,v={})=>h.removeItem(d,v)};return h}function Rf(r,e,t){return r.watch?r.watch((i,n)=>e(i,t+n)):()=>{}}async function Nf(r){typeof r.dispose=="function"&&await Et(r.dispose)}function Gi(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function Bh(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const i=Gi(t);return(n,s)=>i.then(o=>s(o.transaction(e,n).objectStore(e)))}let $a;function Qn(){return $a||($a=Bh("keyval-store","keyval")),$a}function Tf(r,e=Qn()){return e("readonly",t=>Gi(t.get(r)))}function o0(r,e,t=Qn()){return t("readwrite",i=>(i.put(e,r),Gi(i.transaction)))}function f0(r,e=Qn()){return e("readwrite",t=>(t.delete(r),Gi(t.transaction)))}function c0(r=Qn()){return r("readwrite",e=>(e.clear(),Gi(e.transaction)))}function h0(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Gi(r.transaction)}function u0(r=Qn()){return r("readonly",e=>{if(e.getAllKeys)return Gi(e.getAllKeys());const t=[];return h0(e,i=>t.push(i.key)).then(()=>t)})}const d0=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),l0=r=>{const e=/([\[:])?(\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,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function un(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return l0(r)}catch{return r}}function ji(r){return typeof r=="string"?r:d0(r)||""}const p0="idb-keyval";var v0=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=n=>e+n;let i;return r.dbName&&r.storeName&&(i=Bh(r.dbName,r.storeName)),{name:p0,options:r,async hasItem(n){return!(typeof await Tf(t(n),i)>"u")},async getItem(n){return await Tf(t(n),i)??null},setItem(n,s){return o0(t(n),s,i)},removeItem(n){return f0(t(n),i)},getKeys(){return u0(i)},clear(){return c0(i)}}};const b0="WALLET_CONNECT_V2_INDEXED_DB",g0="keyvaluestorage";let m0=class{constructor(){this.indexedDb=a0({driver:v0({dbName:b0,storeName:g0})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ji(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var La=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Is={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,i){this[t]=String(i)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(i){t[i]=void 0,delete t[i]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof La<"u"&&La.localStorage?Is.exports=La.localStorage:typeof window<"u"&&window.localStorage?Is.exports=window.localStorage:Is.exports=new e})();function y0(r){var e;return[r[0],un((e=r[1])!=null?e:"")]}let w0=class{constructor(){this.localStorage=Is.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(y0)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return un(t)}async setItem(e,t){this.localStorage.setItem(e,ji(t))}async removeItem(e){this.localStorage.removeItem(e)}};const _0="wc_storage_version",Cf=1,x0=async(r,e,t)=>{const i=_0,n=await e.getItem(i);if(n&&n>=Cf){t(e);return}const s=await r.getKeys();if(!s.length){t(e);return}const o=[];for(;s.length;){const f=s.shift();if(!f)continue;const h=f.toLowerCase();if(h.includes("wc@")||h.includes("walletconnect")||h.includes("wc_")||h.includes("wallet_connect")){const d=await r.getItem(f);await e.setItem(f,d),o.push(f)}}await e.setItem(i,Cf),t(e),E0(r,o)},E0=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};let S0=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new w0;this.storage=e;try{const t=new m0;x0(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};function M0(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}var I0=A0;function A0(r,e,t){var i=t&&t.stringify||M0,n=1;if(typeof r=="object"&&r!==null){var s=e.length+n;if(s===1)return r;var o=new Array(s);o[0]=i(r);for(var f=1;f<s;f++)o[f]=i(e[f]);return o.join(" ")}if(typeof r!="string")return r;var h=e.length;if(h===0)return r;for(var d="",v=1-n,w=-1,A=r&&r.length||0,I=0;I<A;){if(r.charCodeAt(I)===37&&I+1<A){switch(w=w>-1?w:0,r.charCodeAt(I+1)){case 100:case 102:if(v>=h||e[v]==null)break;w<I&&(d+=r.slice(w,I)),d+=Number(e[v]),w=I+2,I++;break;case 105:if(v>=h||e[v]==null)break;w<I&&(d+=r.slice(w,I)),d+=Math.floor(Number(e[v])),w=I+2,I++;break;case 79:case 111:case 106:if(v>=h||e[v]===void 0)break;w<I&&(d+=r.slice(w,I));var D=typeof e[v];if(D==="string"){d+="'"+e[v]+"'",w=I+2,I++;break}if(D==="function"){d+=e[v].name||"<anonymous>",w=I+2,I++;break}d+=i(e[v]),w=I+2,I++;break;case 115:if(v>=h)break;w<I&&(d+=r.slice(w,I)),d+=String(e[v]),w=I+2,I++;break;case 37:w<I&&(d+=r.slice(w,I)),d+="%",w=I+2,I++,v--;break}++v}++I}return w===-1?r:(w<A&&(d+=r.slice(w)),d)}const $f=I0;var an=Lr;const Wn=F0().console||{},D0={mapHttpRequest:ws,mapHttpResponse:ws,wrapRequestSerializer:Fa,wrapResponseSerializer:Fa,wrapErrorSerializer:Fa,req:ws,res:ws,err:T0};function P0(r,e){return Array.isArray(r)?r.filter(function(i){return i!=="!stdSerializers.err"}):r===!0?Object.keys(e):!1}function Lr(r){r=r||{},r.browser=r.browser||{};const e=r.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const t=r.browser.write||Wn;r.browser.write&&(r.browser.asObject=!0);const i=r.serializers||{},n=P0(r.browser.serialize,i);let s=r.browser.serialize;Array.isArray(r.browser.serialize)&&r.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof t=="function"&&(t.error=t.fatal=t.warn=t.info=t.debug=t.trace=t),r.enabled===!1&&(r.level="silent");const f=r.level||"info",h=Object.create(t);h.log||(h.log=Gn),Object.defineProperty(h,"levelVal",{get:v}),Object.defineProperty(h,"level",{get:w,set:A});const d={transmit:e,serialize:n,asObject:r.browser.asObject,levels:o,timestamp:C0(r)};h.levels=Lr.levels,h.level=f,h.setMaxListeners=h.getMaxListeners=h.emit=h.addListener=h.on=h.prependListener=h.once=h.prependOnceListener=h.removeListener=h.removeAllListeners=h.listeners=h.listenerCount=h.eventNames=h.write=h.flush=Gn,h.serializers=i,h._serialize=n,h._stdErrSerialize=s,h.child=I,e&&(h._logEvent=co());function v(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function A(D){if(D!=="silent"&&!this.levels.values[D])throw Error("unknown level "+D);this._level=D,rn(d,h,"error","log"),rn(d,h,"fatal","error"),rn(d,h,"warn","error"),rn(d,h,"info","log"),rn(d,h,"debug","log"),rn(d,h,"trace","log")}function I(D,N){if(!D)throw new Error("missing bindings for child Pino");N=N||{},n&&D.serializers&&(N.serializers=D.serializers);const k=N.serializers;if(n&&k){var j=Object.assign({},i,k),T=r.browser.serialize===!0?Object.keys(j):n;delete D.serializers,ra([D],T,j,this._stdErrSerialize)}function K($){this._childLevel=($._childLevel|0)+1,this.error=nn($,D,"error"),this.fatal=nn($,D,"fatal"),this.warn=nn($,D,"warn"),this.info=nn($,D,"info"),this.debug=nn($,D,"debug"),this.trace=nn($,D,"trace"),j&&(this.serializers=j,this._serialize=T),e&&(this._logEvent=co([].concat($._logEvent.bindings,D)))}return K.prototype=this,new K(this)}return h}Lr.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Lr.stdSerializers=D0;Lr.stdTimeFunctions=Object.assign({},{nullTime:kh,epochTime:jh,unixTime:$0,isoTime:L0});function rn(r,e,t,i){const n=Object.getPrototypeOf(e);e[t]=e.levelVal>e.levels.values[t]?Gn:n[t]?n[t]:Wn[t]||Wn[i]||Gn,O0(r,e,t)}function O0(r,e,t){!r.transmit&&e[t]===Gn||(e[t]=function(i){return function(){const s=r.timestamp(),o=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Wn?Wn:this;for(var h=0;h<o.length;h++)o[h]=arguments[h];if(r.serialize&&!r.asObject&&ra(o,this._serialize,this.serializers,this._stdErrSerialize),r.asObject?i.call(f,R0(this,t,o,s)):i.apply(f,o),r.transmit){const d=r.transmit.level||e.level,v=Lr.levels.values[d],w=Lr.levels.values[t];if(w<v)return;N0(this,{ts:s,methodLevel:t,methodValue:w,transmitLevel:d,transmitValue:Lr.levels.values[r.transmit.level||e.level],send:r.transmit.send,val:e.levelVal},o)}}}(e[t]))}function R0(r,e,t,i){r._serialize&&ra(t,r._serialize,r.serializers,r._stdErrSerialize);const n=t.slice();let s=n[0];const o={};i&&(o.time=i),o.level=Lr.levels.values[e];let f=(r._childLevel|0)+1;if(f<1&&(f=1),s!==null&&typeof s=="object"){for(;f--&&typeof n[0]=="object";)Object.assign(o,n.shift());s=n.length?$f(n.shift(),n):void 0}else typeof s=="string"&&(s=$f(n.shift(),n));return s!==void 0&&(o.msg=s),o}function ra(r,e,t,i){for(const n in r)if(i&&r[n]instanceof Error)r[n]=Lr.stdSerializers.err(r[n]);else if(typeof r[n]=="object"&&!Array.isArray(r[n]))for(const s in r[n])e&&e.indexOf(s)>-1&&s in t&&(r[n][s]=t[s](r[n][s]))}function nn(r,e,t){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return r[t].apply(this,i)}}function N0(r,e,t){const i=e.send,n=e.ts,s=e.methodLevel,o=e.methodValue,f=e.val,h=r._logEvent.bindings;ra(t,r._serialize||Object.keys(r.serializers),r.serializers,r._stdErrSerialize===void 0?!0:r._stdErrSerialize),r._logEvent.ts=n,r._logEvent.messages=t.filter(function(d){return h.indexOf(d)===-1}),r._logEvent.level.label=s,r._logEvent.level.value=o,i(s,r._logEvent,f),r._logEvent=co(h)}function co(r){return{ts:0,messages:[],bindings:r||[],level:{label:"",value:0}}}function T0(r){const e={type:r.constructor.name,msg:r.message,stack:r.stack};for(const t in r)e[t]===void 0&&(e[t]=r[t]);return e}function C0(r){return typeof r.timestamp=="function"?r.timestamp:r.timestamp===!1?kh:jh}function ws(){return{}}function Fa(r){return r}function Gn(){}function kh(){return!1}function jh(){return Date.now()}function $0(){return Math.round(Date.now()/1e3)}function L0(){return new Date(Date.now()).toISOString()}function F0(){function r(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return r(self)||r(window)||r(this)||{}}}const ia=gt.getDefaultExportFromCjs(an),q0={level:"info"},es="custom_context",Ro=1e3*1024;let U0=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},Lf=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new U0(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;t!==null;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}},Kh=class{constructor(e,t=Ro){this.level=e??"error",this.levelValue=an.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new Lf(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===an.levels.values.error?console.error(e):t===an.levels.values.warn?console.warn(e):t===an.levels.values.debug?console.debug(e):t===an.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ji({timestamp:new Date().toISOString(),log:e}));const t=typeof e=="string"?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new Lf(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(ji({extraMetadata:e})),new Blob(t,{type:"application/json"})}};class z0{constructor(e,t=Ro){this.baseChunkLogger=new Kh(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}}class B0{constructor(e,t=Ro){this.baseChunkLogger=new Kh(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var k0=Object.defineProperty,j0=Object.defineProperties,K0=Object.getOwnPropertyDescriptors,Ff=Object.getOwnPropertySymbols,H0=Object.prototype.hasOwnProperty,V0=Object.prototype.propertyIsEnumerable,qf=(r,e,t)=>e in r?k0(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$s=(r,e)=>{for(var t in e||(e={}))H0.call(e,t)&&qf(r,t,e[t]);if(Ff)for(var t of Ff(e))V0.call(e,t)&&qf(r,t,e[t]);return r},Ls=(r,e)=>j0(r,K0(e));function No(r){return Ls($s({},r),{level:r?.level||q0.level})}function W0(r,e=es){return r[e]||""}function G0(r,e,t=es){return r[t]=e,r}function Qt(r,e=es){let t="";return typeof r.bindings>"u"?t=W0(r,e):t=r.bindings().context||"",t}function J0(r,e,t=es){const i=Qt(r,t);return i.trim()?`${i}/${e}`:e}function jt(r,e,t=es){const i=J0(r,e,t),n=r.child({context:i});return G0(n,i,t)}function Y0(r){var e,t;const i=new z0((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:ia(Ls($s({},r.opts),{level:"trace",browser:Ls($s({},(t=r.opts)==null?void 0:t.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function X0(r){var e;const t=new B0((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:ia(Ls($s({},r.opts),{level:"trace"}),t),chunkLoggerController:t}}function Z0(r){return typeof r.loggerOverride<"u"&&typeof r.loggerOverride!="string"?{logger:r.loggerOverride,chunkLoggerController:null}:typeof window<"u"?Y0(r):X0(r)}let Q0=class extends Wi{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},ep=class extends Wi{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}};class tp{constructor(e,t){this.logger=e,this.core=t}}let rp=class extends Wi{constructor(e,t){super(),this.relayer=e,this.logger=t}};class ip extends Wi{constructor(e){super()}}class np{constructor(e,t,i,n){this.core=e,this.logger=t,this.name=i}}let sp=class extends Wi{constructor(e,t){super(),this.relayer=e,this.logger=t}},ap=class extends Wi{constructor(e,t){super(),this.core=e,this.logger=t}},op=class{constructor(e,t,i){this.core=e,this.logger=t,this.store=i}},fp=class{constructor(e,t){this.projectId=e,this.logger=t}},cp=class{constructor(e,t,i){this.core=e,this.logger=t,this.telemetryEnabled=i}},hp=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},up=class{constructor(e){this.client=e}};var To={},Si={},na={},sa={};Object.defineProperty(sa,"__esModule",{value:!0});sa.BrowserRandomSource=void 0;const Uf=65536;class dp{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let i=0;i<t.length;i+=Uf)this._crypto.getRandomValues(t.subarray(i,i+Math.min(t.length-i,Uf)));return t}}sa.BrowserRandomSource=dp;function lp(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var aa={},nr={};Object.defineProperty(nr,"__esModule",{value:!0});function pp(r){for(var e=0;e<r.length;e++)r[e]=0;return r}nr.wipe=pp;const vp={},bp=Object.freeze(Object.defineProperty({__proto__:null,default:vp},Symbol.toStringTag,{value:"Module"})),oa=gt.getAugmentedNamespace(bp);Object.defineProperty(aa,"__esModule",{value:!0});aa.NodeRandomSource=void 0;const gp=nr;class mp{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof lp<"u"){const e=oa;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(e);for(let n=0;n<i.length;n++)i[n]=t[n];return(0,gp.wipe)(t),i}}aa.NodeRandomSource=mp;Object.defineProperty(na,"__esModule",{value:!0});na.SystemRandomSource=void 0;const yp=sa,wp=aa;class _p{constructor(){if(this.isAvailable=!1,this.name="",this._source=new yp.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new wp.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}na.SystemRandomSource=_p;var Ve={},Hh={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(f,h){var d=f>>>16&65535,v=f&65535,w=h>>>16&65535,A=h&65535;return v*A+(d*A+v*w<<16>>>0)|0}r.mul=Math.imul||e;function t(f,h){return f+h|0}r.add=t;function i(f,h){return f-h|0}r.sub=i;function n(f,h){return f<<h|f>>>32-h}r.rotl=n;function s(f,h){return f<<32-h|f>>>h}r.rotr=s;function o(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}r.isInteger=Number.isInteger||o,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(f){return r.isInteger(f)&&f>=-r.MAX_SAFE_INTEGER&&f<=r.MAX_SAFE_INTEGER}})(Hh);Object.defineProperty(Ve,"__esModule",{value:!0});var Vh=Hh;function xp(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Ve.readInt16BE=xp;function Ep(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Ve.readUint16BE=Ep;function Sp(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Ve.readInt16LE=Sp;function Mp(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Ve.readUint16LE=Mp;function Wh(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Ve.writeUint16BE=Wh;Ve.writeInt16BE=Wh;function Gh(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Ve.writeUint16LE=Gh;Ve.writeInt16LE=Gh;function ho(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Ve.readInt32BE=ho;function uo(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Ve.readUint32BE=uo;function lo(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Ve.readInt32LE=lo;function po(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Ve.readUint32LE=po;function Fs(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Ve.writeUint32BE=Fs;Ve.writeInt32BE=Fs;function qs(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Ve.writeUint32LE=qs;Ve.writeInt32LE=qs;function Ip(r,e){e===void 0&&(e=0);var t=ho(r,e),i=ho(r,e+4);return t*4294967296+i-(i>>31)*4294967296}Ve.readInt64BE=Ip;function Ap(r,e){e===void 0&&(e=0);var t=uo(r,e),i=uo(r,e+4);return t*4294967296+i}Ve.readUint64BE=Ap;function Dp(r,e){e===void 0&&(e=0);var t=lo(r,e),i=lo(r,e+4);return i*4294967296+t-(t>>31)*4294967296}Ve.readInt64LE=Dp;function Pp(r,e){e===void 0&&(e=0);var t=po(r,e),i=po(r,e+4);return i*4294967296+t}Ve.readUint64LE=Pp;function Jh(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Fs(r/4294967296>>>0,e,t),Fs(r>>>0,e,t+4),e}Ve.writeUint64BE=Jh;Ve.writeInt64BE=Jh;function Yh(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),qs(r>>>0,e,t),qs(r/4294967296>>>0,e,t+4),e}Ve.writeUint64LE=Yh;Ve.writeInt64LE=Yh;function Op(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,s=r/8+t-1;s>=t;s--)i+=e[s]*n,n*=256;return i}Ve.readUintBE=Op;function Rp(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=t;s<t+r/8;s++)i+=e[s]*n,n*=256;return i}Ve.readUintLE=Rp;function Np(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Vh.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var n=1,s=r/8+i-1;s>=i;s--)t[s]=e/n&255,n*=256;return t}Ve.writeUintBE=Np;function Tp(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Vh.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,s=i;s<i+r/8;s++)t[s]=e/n&255,n*=256;return t}Ve.writeUintLE=Tp;function Cp(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}Ve.readFloat32BE=Cp;function $p(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}Ve.readFloat32LE=$p;function Lp(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}Ve.readFloat64BE=Lp;function Fp(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}Ve.readFloat64LE=Fp;function qp(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r),e}Ve.writeFloat32BE=qp;function Up(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r,!0),e}Ve.writeFloat32LE=Up;function zp(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r),e}Ve.writeFloat64BE=zp;function Bp(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r,!0),e}Ve.writeFloat64LE=Bp;(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=na,t=Ve,i=nr;r.defaultRandomSource=new e.SystemRandomSource;function n(d,v=r.defaultRandomSource){return v.randomBytes(d)}r.randomBytes=n;function s(d=r.defaultRandomSource){const v=n(4,d),w=(0,t.readUint32LE)(v);return(0,i.wipe)(v),w}r.randomUint32=s;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(d,v=o,w=r.def