UNPKG

@walletconnect/sign-client

Version:
14 lines (12 loc) 425 kB
(function(Z,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(Z=typeof globalThis<"u"?globalThis:Z||self,ut(Z["@walletconnect/sign-client"]={}))})(this,function(Z){"use strict";var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ya(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Fn={exports:{}},wa;function Wf(){if(wa)return Fn.exports;wa=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(_,x,T){return Function.prototype.apply.call(_,x,T)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:r=function(_){return Object.getOwnPropertyNames(_)};function n(m){console&&console.warn&&console.warn(m)}var i=Number.isNaN||function(_){return _!==_};function s(){s.init.call(this)}Fn.exports=s,Fn.exports.once=v,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(m){if(typeof m!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof m)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(m){if(typeof m!="number"||m<0||i(m))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+m+".");o=m}}),s.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},s.prototype.setMaxListeners=function(_){if(typeof _!="number"||_<0||i(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function c(m){return m._maxListeners===void 0?s.defaultMaxListeners:m._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(_){for(var x=[],T=1;T<arguments.length;T++)x.push(arguments[T]);var B=_==="error",P=this._events;if(P!==void 0)B=B&&P.error===void 0;else if(!B)return!1;if(B){var U;if(x.length>0&&(U=x[0]),U instanceof Error)throw U;var L=new Error("Unhandled error."+(U?" ("+U.message+")":""));throw L.context=U,L}var C=P[_];if(C===void 0)return!1;if(typeof C=="function")e(C,this,x);else for(var S=C.length,R=d(C,S),T=0;T<S;++T)e(R[T],this,x);return!0};function u(m,_,x,T){var B,P,U;if(a(x),P=m._events,P===void 0?(P=m._events=Object.create(null),m._eventsCount=0):(P.newListener!==void 0&&(m.emit("newListener",_,x.listener?x.listener:x),P=m._events),U=P[_]),U===void 0)U=P[_]=x,++m._eventsCount;else if(typeof U=="function"?U=P[_]=T?[x,U]:[U,x]:T?U.unshift(x):U.push(x),B=c(m),B>0&&U.length>B&&!U.warned){U.warned=!0;var L=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");L.name="MaxListenersExceededWarning",L.emitter=m,L.type=_,L.count=U.length,n(L)}return m}s.prototype.addListener=function(_,x){return u(this,_,x,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(_,x){return u(this,_,x,!0)};function l(){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 h(m,_,x){var T={fired:!1,wrapFn:void 0,target:m,type:_,listener:x},B=l.bind(T);return B.listener=x,T.wrapFn=B,B}s.prototype.once=function(_,x){return a(x),this.on(_,h(this,_,x)),this},s.prototype.prependOnceListener=function(_,x){return a(x),this.prependListener(_,h(this,_,x)),this},s.prototype.removeListener=function(_,x){var T,B,P,U,L;if(a(x),B=this._events,B===void 0)return this;if(T=B[_],T===void 0)return this;if(T===x||T.listener===x)--this._eventsCount===0?this._events=Object.create(null):(delete B[_],B.removeListener&&this.emit("removeListener",_,T.listener||x));else if(typeof T!="function"){for(P=-1,U=T.length-1;U>=0;U--)if(T[U]===x||T[U].listener===x){L=T[U].listener,P=U;break}if(P<0)return this;P===0?T.shift():g(T,P),T.length===1&&(B[_]=T[0]),B.removeListener!==void 0&&this.emit("removeListener",_,L||x)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(_){var x,T,B;if(T=this._events,T===void 0)return this;if(T.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):T[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete T[_]),this;if(arguments.length===0){var P=Object.keys(T),U;for(B=0;B<P.length;++B)U=P[B],U!=="removeListener"&&this.removeAllListeners(U);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(x=T[_],typeof x=="function")this.removeListener(_,x);else if(x!==void 0)for(B=x.length-1;B>=0;B--)this.removeListener(_,x[B]);return this};function f(m,_,x){var T=m._events;if(T===void 0)return[];var B=T[_];return B===void 0?[]:typeof B=="function"?x?[B.listener||B]:[B]:x?y(B):d(B,B.length)}s.prototype.listeners=function(_){return f(this,_,!0)},s.prototype.rawListeners=function(_){return f(this,_,!1)},s.listenerCount=function(m,_){return typeof m.listenerCount=="function"?m.listenerCount(_):p.call(m,_)},s.prototype.listenerCount=p;function p(m){var _=this._events;if(_!==void 0){var x=_[m];if(typeof x=="function")return 1;if(x!==void 0)return x.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function d(m,_){for(var x=new Array(_),T=0;T<_;++T)x[T]=m[T];return x}function g(m,_){for(;_+1<m.length;_++)m[_]=m[_+1];m.pop()}function y(m){for(var _=new Array(m.length),x=0;x<_.length;++x)_[x]=m[x].listener||m[x];return _}function v(m,_){return new Promise(function(x,T){function B(U){m.removeListener(_,P),T(U)}function P(){typeof m.removeListener=="function"&&m.removeListener("error",B),x([].slice.call(arguments))}w(m,_,P,{once:!0}),_!=="error"&&A(m,B,{once:!0})})}function A(m,_,x){typeof m.on=="function"&&w(m,"error",_,x)}function w(m,_,x,T){if(typeof m.on=="function")T.once?m.once(_,x):m.on(_,x);else if(typeof m.addEventListener=="function")m.addEventListener(_,function B(P){T.once&&m.removeEventListener(_,B),x(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof m)}return Fn.exports}var Xe=Wf(),ma=Hf(Xe),Xi={};/*! ***************************************************************************** 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 Ji=function(t,e){return Ji=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},Ji(t,e)};function Gf(t,e){Ji(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Qi=function(){return Qi=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Qi.apply(this,arguments)};function Yf(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Zf(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Xf(t,e){return function(r,n){e(r,n,t)}}function Jf(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Qf(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{u(n.next(l))}catch(h){o(h)}}function c(l){try{u(n.throw(l))}catch(h){o(h)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((n=n.apply(t,e||[])).next())})}function ed(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(l){u=[6,l],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function td(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function rd(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function es(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ba(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function nd(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(ba(arguments[e]));return t}function id(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Yr(t){return this instanceof Yr?(this.v=t,this):new Yr(t)}function sd(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){n[f]&&(i[f]=function(p){return new Promise(function(d,g){s.push([f,p,d,g])>1||a(f,p)})})}function a(f,p){try{c(n[f](p))}catch(d){h(s[0][3],d)}}function c(f){f.value instanceof Yr?Promise.resolve(f.value.v).then(u,l):h(s[0][2],f)}function u(f){a("next",f)}function l(f){a("throw",f)}function h(f,p){f(p),s.shift(),s.length&&a(s[0][0],s[0][1])}}function od(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Yr(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function ad(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof es=="function"?es(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function cd(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ud(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function ld(t){return t&&t.__esModule?t:{default:t}}function hd(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function fd(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var dd=Object.freeze({__proto__:null,get __assign(){return Qi},__asyncDelegator:od,__asyncGenerator:sd,__asyncValues:ad,__await:Yr,__awaiter:Qf,__classPrivateFieldGet:hd,__classPrivateFieldSet:fd,__createBinding:td,__decorate:Zf,__exportStar:rd,__extends:Gf,__generator:ed,__importDefault:ld,__importStar:ud,__makeTemplateObject:cd,__metadata:Jf,__param:Xf,__read:ba,__rest:Yf,__spread:nd,__spreadArrays:id,__values:es}),qn=ya(dd),ts={},Zr={},Ea;function pd(){if(Ea)return Zr;Ea=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Zr.delay=t,Zr}var cr={},rs={},ur={},va;function gd(){return va||(va=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.ONE_THOUSAND=ur.ONE_HUNDRED=void 0,ur.ONE_HUNDRED=100,ur.ONE_THOUSAND=1e3),ur}var ns={},_a;function yd(){return _a||(_a=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(ns)),ns}var xa;function Sa(){return xa||(xa=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qn;e.__exportStar(gd(),t),e.__exportStar(yd(),t)}(rs)),rs}var Ia;function wd(){if(Ia)return cr;Ia=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.fromMiliseconds=cr.toMiliseconds=void 0;const t=Sa();function e(n){return n*t.ONE_THOUSAND}cr.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return cr.fromMiliseconds=r,cr}var Da;function md(){return Da||(Da=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qn;e.__exportStar(pd(),t),e.__exportStar(wd(),t)}(ts)),ts}var Rr={},Aa;function bd(){if(Aa)return Rr;Aa=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Rr.Watch=t,Rr.default=t,Rr}var is={},Xr={},Oa;function Ed(){if(Oa)return Xr;Oa=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.IWatch=void 0;class t{}return Xr.IWatch=t,Xr}var Ta;function vd(){return Ta||(Ta=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),qn.__exportStar(Ed(),t)}(is)),is}var Ba;function _d(){return Ba||(Ba=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qn;e.__exportStar(md(),t),e.__exportStar(bd(),t),e.__exportStar(vd(),t),e.__exportStar(Sa(),t)}(Xi)),Xi}var M=_d();class lr{}let xd=class extends lr{constructor(e){super()}};const Ra=M.FIVE_SECONDS,hr={pulse:"heartbeat_pulse"};class ss extends xd{constructor(e){super(e),this.events=new Xe.EventEmitter,this.interval=Ra,this.interval=e?.interval||Ra}static async init(e){const r=new ss(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),M.toMiliseconds(this.interval))}pulse(){this.events.emit(hr.pulse)}}const Sd=/"(?:_|\\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*:/,Id=/"(?: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*:/,Dd=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Ad(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Od(t);return}return e}function Od(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function zn(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Dd.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(Sd.test(t)||Id.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Ad)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function Td(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function fe(t,...e){try{return Td(t(...e))}catch(r){return Promise.reject(r)}}function Bd(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function Rd(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function jn(t){if(Bd(t))return String(t);if(Rd(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return jn(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const os="base64:";function Nd(t){return typeof t=="string"?t:os+Cd(t)}function Pd(t){return typeof t!="string"||!t.startsWith(os)?t:$d(t.slice(os.length))}function $d(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function Cd(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Re(t){return t&&t.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function Ud(...t){return Re(t.join(":"))}function Kn(t){return t=Re(t),t?t+":":""}function Ld(t,e){if(e===void 0)return!0;let r=0,n=t.indexOf(":");for(;n>-1;)r++,n=t.indexOf(":",n+1);return r<=e}function kd(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}function WS(t){return t}const Md="memory",Fd=()=>{const t=new Map;return{name:Md,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function qd(t={}){const e={mounts:{"":t.driver||Fd()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=u=>{for(const l of e.mountpoints)if(u.startsWith(l))return{base:l,relativeKey:u.slice(l.length),driver:e.mounts[l]};return{base:"",relativeKey:u,driver:e.mounts[""]}},n=(u,l)=>e.mountpoints.filter(h=>h.startsWith(u)||l&&u.startsWith(h)).map(h=>({relativeBase:u.length>h.length?u.slice(h.length):void 0,mountpoint:h,driver:e.mounts[h]})),i=(u,l)=>{if(e.watching){l=Re(l);for(const h of e.watchListeners)h(u,l)}},s=async()=>{if(!e.watching){e.watching=!0;for(const u in e.mounts)e.unwatch[u]=await Na(e.mounts[u],i,u)}},o=async()=>{if(e.watching){for(const u in e.unwatch)await e.unwatch[u]();e.unwatch={},e.watching=!1}},a=(u,l,h)=>{const f=new Map,p=d=>{let g=f.get(d.base);return g||(g={driver:d.driver,base:d.base,items:[]},f.set(d.base,g)),g};for(const d of u){const g=typeof d=="string",y=Re(g?d:d.key),v=g?void 0:d.value,A=g||!d.options?l:{...l,...d.options},w=r(y);p(w).items.push({key:y,value:v,relativeKey:w.relativeKey,options:A})}return Promise.all([...f.values()].map(d=>h(d))).then(d=>d.flat())},c={hasItem(u,l={}){u=Re(u);const{relativeKey:h,driver:f}=r(u);return fe(f.hasItem,h,l)},getItem(u,l={}){u=Re(u);const{relativeKey:h,driver:f}=r(u);return fe(f.getItem,h,l).then(p=>zn(p))},getItems(u,l={}){return a(u,l,h=>h.driver.getItems?fe(h.driver.getItems,h.items.map(f=>({key:f.relativeKey,options:f.options})),l).then(f=>f.map(p=>({key:Ud(h.base,p.key),value:zn(p.value)}))):Promise.all(h.items.map(f=>fe(h.driver.getItem,f.relativeKey,f.options).then(p=>({key:f.key,value:zn(p)})))))},getItemRaw(u,l={}){u=Re(u);const{relativeKey:h,driver:f}=r(u);return f.getItemRaw?fe(f.getItemRaw,h,l):fe(f.getItem,h,l).then(p=>Pd(p))},async setItem(u,l,h={}){if(l===void 0)return c.removeItem(u);u=Re(u);const{relativeKey:f,driver:p}=r(u);p.setItem&&(await fe(p.setItem,f,jn(l),h),p.watch||i("update",u))},async setItems(u,l){await a(u,l,async h=>{if(h.driver.setItems)return fe(h.driver.setItems,h.items.map(f=>({key:f.relativeKey,value:jn(f.value),options:f.options})),l);h.driver.setItem&&await Promise.all(h.items.map(f=>fe(h.driver.setItem,f.relativeKey,jn(f.value),f.options)))})},async setItemRaw(u,l,h={}){if(l===void 0)return c.removeItem(u,h);u=Re(u);const{relativeKey:f,driver:p}=r(u);if(p.setItemRaw)await fe(p.setItemRaw,f,l,h);else if(p.setItem)await fe(p.setItem,f,Nd(l),h);else return;p.watch||i("update",u)},async removeItem(u,l={}){typeof l=="boolean"&&(l={removeMeta:l}),u=Re(u);const{relativeKey:h,driver:f}=r(u);f.removeItem&&(await fe(f.removeItem,h,l),(l.removeMeta||l.removeMata)&&await fe(f.removeItem,h+"$",l),f.watch||i("remove",u))},async getMeta(u,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),u=Re(u);const{relativeKey:h,driver:f}=r(u),p=Object.create(null);if(f.getMeta&&Object.assign(p,await fe(f.getMeta,h,l)),!l.nativeOnly){const d=await fe(f.getItem,h+"$",l).then(g=>zn(g));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(p,d))}return p},setMeta(u,l,h={}){return this.setItem(u+"$",l,h)},removeMeta(u,l={}){return this.removeItem(u+"$",l)},async getKeys(u,l={}){u=Kn(u);const h=n(u,!0);let f=[];const p=[];let d=!0;for(const y of h){y.driver.flags?.maxDepth||(d=!1);const v=await fe(y.driver.getKeys,y.relativeBase,l);for(const A of v){const w=y.mountpoint+Re(A);f.some(m=>w.startsWith(m))||p.push(w)}f=[y.mountpoint,...f.filter(A=>!A.startsWith(y.mountpoint))]}const g=l.maxDepth!==void 0&&!d;return p.filter(y=>(!g||Ld(y,l.maxDepth))&&kd(y,u))},async clear(u,l={}){u=Kn(u),await Promise.all(n(u,!1).map(async h=>{if(h.driver.clear)return fe(h.driver.clear,h.relativeBase,l);if(h.driver.removeItem){const f=await h.driver.getKeys(h.relativeBase||"",l);return Promise.all(f.map(p=>h.driver.removeItem(p,l)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(u=>Pa(u)))},async watch(u){return await s(),e.watchListeners.push(u),async()=>{e.watchListeners=e.watchListeners.filter(l=>l!==u),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(u,l){if(u=Kn(u),u&&e.mounts[u])throw new Error(`already mounted at ${u}`);return u&&(e.mountpoints.push(u),e.mountpoints.sort((h,f)=>f.length-h.length)),e.mounts[u]=l,e.watching&&Promise.resolve(Na(l,i,u)).then(h=>{e.unwatch[u]=h}).catch(console.error),c},async unmount(u,l=!0){u=Kn(u),!(!u||!e.mounts[u])&&(e.watching&&u in e.unwatch&&(e.unwatch[u]?.(),delete e.unwatch[u]),l&&await Pa(e.mounts[u]),e.mountpoints=e.mountpoints.filter(h=>h!==u),delete e.mounts[u])},getMount(u=""){u=Re(u)+":";const l=r(u);return{driver:l.driver,base:l.base}},getMounts(u="",l={}){return u=Re(u),n(u,l.parents).map(f=>({driver:f.driver,base:f.mountpoint}))},keys:(u,l={})=>c.getKeys(u,l),get:(u,l={})=>c.getItem(u,l),set:(u,l,h={})=>c.setItem(u,l,h),has:(u,l={})=>c.hasItem(u,l),del:(u,l={})=>c.removeItem(u,l),remove:(u,l={})=>c.removeItem(u,l)};return c}function Na(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function Pa(t){typeof t.dispose=="function"&&await fe(t.dispose)}function fr(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function $a(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=fr(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let as;function Jr(){return as||(as=$a("keyval-store","keyval")),as}function Ca(t,e=Jr()){return e("readonly",r=>fr(r.get(t)))}function zd(t,e,r=Jr()){return r("readwrite",n=>(n.put(e,t),fr(n.transaction)))}function jd(t,e=Jr()){return e("readwrite",r=>(r.delete(t),fr(r.transaction)))}function Kd(t=Jr()){return t("readwrite",e=>(e.clear(),fr(e.transaction)))}function Vd(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},fr(t.transaction)}function Hd(t=Jr()){return t("readonly",e=>{if(e.getAllKeys)return fr(e.getAllKeys());const r=[];return Vd(e,n=>r.push(n.key)).then(()=>r)})}const Wd=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),Gd=t=>{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,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Nr(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return Gd(t)}catch{return t}}function Qr(t){return typeof t=="string"?t:Wd(t)||""}const Yd="idb-keyval";var Zd=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=$a(t.dbName,t.storeName)),{name:Yd,options:t,async hasItem(i){return!(typeof await Ca(r(i),n)>"u")},async getItem(i){return await Ca(r(i),n)??null},setItem(i,s){return zd(r(i),s,n)},removeItem(i){return jd(r(i),n)},getKeys(){return Hd(n)},clear(){return Kd(n)}}};const Xd="WALLET_CONNECT_V2_INDEXED_DB",Jd="keyvaluestorage";let Qd=class{constructor(){this.indexedDb=qd({driver:Zd({dbName:Xd,storeName:Jd})})}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 r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Qr(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vn={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof cs<"u"&&cs.localStorage?Vn.exports=cs.localStorage:typeof window<"u"&&window.localStorage?Vn.exports=window.localStorage:Vn.exports=new e})();function ep(t){var e;return[t[0],Nr((e=t[1])!=null?e:"")]}let tp=class{constructor(){this.localStorage=Vn.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(ep)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Nr(r)}async setItem(e,r){this.localStorage.setItem(e,Qr(r))}async removeItem(e){this.localStorage.removeItem(e)}};const rp="wc_storage_version",Ua=1,np=async(t,e,r)=>{const n=rp,i=await e.getItem(n);if(i&&i>=Ua){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const u=await t.getItem(a);await e.setItem(a,u),o.push(a)}}await e.setItem(n,Ua),r(e),ip(t,o)},ip=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let sp=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new tp;this.storage=e;try{const r=new Qd;np(e,r,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,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};var lt={exports:{}};function op(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var ap=cp;function cp(t,e,r){var n=r&&r.stringify||op,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a<s;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var u="",l=1-i,h=-1,f=t&&t.length||0,p=0;p<f;){if(t.charCodeAt(p)===37&&p+1<f){switch(h=h>-1?h:0,t.charCodeAt(p+1)){case 100:case 102:if(l>=c||e[l]==null)break;h<p&&(u+=t.slice(h,p)),u+=Number(e[l]),h=p+2,p++;break;case 105:if(l>=c||e[l]==null)break;h<p&&(u+=t.slice(h,p)),u+=Math.floor(Number(e[l])),h=p+2,p++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;h<p&&(u+=t.slice(h,p));var d=typeof e[l];if(d==="string"){u+="'"+e[l]+"'",h=p+2,p++;break}if(d==="function"){u+=e[l].name||"<anonymous>",h=p+2,p++;break}u+=n(e[l]),h=p+2,p++;break;case 115:if(l>=c)break;h<p&&(u+=t.slice(h,p)),u+=String(e[l]),h=p+2,p++;break;case 37:h<p&&(u+=t.slice(h,p)),u+="%",h=p+2,p++,l--;break}++l}++p}return h===-1?t:(h<f&&(u+=t.slice(h)),u)}const La=ap;lt.exports=mt;const en=xp().console||{},up={mapHttpRequest:Hn,mapHttpResponse:Hn,wrapRequestSerializer:ds,wrapResponseSerializer:ds,wrapErrorSerializer:ds,req:Hn,res:Hn,err:Ma,errWithCause:Ma};function kt(t,e){return t==="silent"?1/0:e.levels.values[t]}const us=Symbol("pino.logFuncs"),ls=Symbol("pino.hierarchy"),lp={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function ka(t,e){const r={logger:e,parent:t[ls]};e[ls]=r}function hp(t,e,r){const n={};e.forEach(i=>{n[i]=r[i]?r[i]:en[i]||en[lp[i]||"log"]||Pr}),t[us]=n}function fp(t,e){return Array.isArray(t)?t.filter(function(r){return r!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function mt(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||en;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=fp(t.browser.serialize,n);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const o=Object.keys(t.customLevels||{}),a=["error","fatal","warn","info","debug","trace"].concat(o);typeof r=="function"&&a.forEach(function(g){r[g]=r}),(t.enabled===!1||t.browser.disabled)&&(t.level="silent");const c=t.level||"info",u=Object.create(r);u.log||(u.log=Pr),hp(u,a,r),ka({},u),Object.defineProperty(u,"levelVal",{get:h}),Object.defineProperty(u,"level",{get:f,set:p});const l={transmit:e,serialize:i,asObject:t.browser.asObject,asObjectBindingsOnly:t.browser.asObjectBindingsOnly,formatters:t.browser.formatters,levels:a,timestamp:Ep(t),messageKey:t.messageKey||"msg",onChild:t.onChild||Pr};u.levels=dp(t),u.level=c,u.isLevelEnabled=function(g){return this.levels.values[g]?this.levels.values[g]>=this.levels.values[this.level]:!1},u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=Pr,u.serializers=n,u._serialize=i,u._stdErrSerialize=s,u.child=function(...g){return d.call(this,l,...g)},e&&(u._logEvent=fs());function h(){return kt(this.level,this)}function f(){return this._level}function p(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,dr(this,l,u,"error"),dr(this,l,u,"fatal"),dr(this,l,u,"warn"),dr(this,l,u,"info"),dr(this,l,u,"debug"),dr(this,l,u,"trace"),o.forEach(y=>{dr(this,l,u,y)})}function d(g,y,v){if(!y)throw new Error("missing bindings for child Pino");v=v||{},i&&y.serializers&&(v.serializers=y.serializers);const A=v.serializers;if(i&&A){var w=Object.assign({},n,A),m=t.browser.serialize===!0?Object.keys(w):i;delete y.serializers,hs([y],m,w,this._stdErrSerialize)}function _(T){this._childLevel=(T._childLevel|0)+1,this.bindings=y,w&&(this.serializers=w,this._serialize=m),e&&(this._logEvent=fs([].concat(T._logEvent.bindings,y)))}_.prototype=this;const x=new _(this);return ka(this,x),x.child=function(...T){return d.call(this,g,...T)},x.level=v.level||this.level,g.onChild(x),x}return u}function dp(t){const e=t.customLevels||{},r=Object.assign({},mt.levels.values,e),n=Object.assign({},mt.levels.labels,pp(e));return{values:r,labels:n}}function pp(t){const e={};return Object.keys(t).forEach(function(r){e[t[r]]=r}),e}mt.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"}},mt.stdSerializers=up,mt.stdTimeFunctions=Object.assign({},{nullTime:Fa,epochTime:qa,unixTime:vp,isoTime:_p});function gp(t){const e=[];t.bindings&&e.push(t.bindings);let r=t[ls];for(;r.parent;)r=r.parent,r.logger.bindings&&e.push(r.logger.bindings);return e.reverse()}function dr(t,e,r,n){if(Object.defineProperty(t,n,{value:kt(t.level,r)>kt(n,r)?Pr:r[us][n],writable:!0,enumerable:!0,configurable:!0}),t[n]===Pr){if(!e.transmit)return;const s=e.transmit.level||t.level,o=kt(s,r);if(kt(n,r)<o)return}t[n]=wp(t,e,r,n);const i=gp(t);i.length!==0&&(t[n]=yp(i,t[n]))}function yp(t,e){return function(){return e.apply(this,[...t,...arguments])}}function wp(t,e,r,n){return function(i){return function(){const s=e.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===en?en:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];var u=!1;if(e.serialize&&(hs(o,this._serialize,this.serializers,this._stdErrSerialize),u=!0),e.asObject||e.formatters?i.call(a,...mp(this,n,o,s,e)):i.apply(a,o),e.transmit){const l=e.transmit.level||t._level,h=kt(l,r),f=kt(n,r);if(f<h)return;bp(this,{ts:s,methodLevel:n,methodValue:f,transmitValue:r.levels.values[e.transmit.level||t._level],send:e.transmit.send,val:kt(t._level,r)},o,u)}}}(t[us][n])}function mp(t,e,r,n,i){const{level:s,log:o=h=>h}=i.formatters||{},a=r.slice();let c=a[0];const u={};let l=(t._childLevel|0)+1;if(l<1&&(l=1),n&&(u.time=n),s){const h=s(e,t.levels.values[e]);Object.assign(u,h)}else u.level=t.levels.values[e];if(i.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;l--&&typeof a[0]=="object";)Object.assign(u,a.shift());return[o(u),...a]}else{if(c!==null&&typeof c=="object"){for(;l--&&typeof a[0]=="object";)Object.assign(u,a.shift());c=a.length?La(a.shift(),a):void 0}else typeof c=="string"&&(c=La(a.shift(),a));return c!==void 0&&(u[i.messageKey]=c),[o(u)]}}function hs(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=mt.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i])&&e)for(const s in t[i])e.indexOf(s)>-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function bp(t,e,r,n=!1){const i=e.send,s=e.ts,o=e.methodLevel,a=e.methodValue,c=e.val,u=t._logEvent.bindings;n||hs(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=s,t._logEvent.messages=r.filter(function(l){return u.indexOf(l)===-1}),t._logEvent.level.label=o,t._logEvent.level.value=a,i(o,t._logEvent,c),t._logEvent=fs(u)}function fs(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function Ma(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function Ep(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Fa:qa}function Hn(){return{}}function ds(t){return t}function Pr(){}function Fa(){return!1}function qa(){return Date.now()}function vp(){return Math.round(Date.now()/1e3)}function _p(){return new Date(Date.now()).toISOString()}function xp(){function t(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 t(self)||t(window)||t(this)||{}}}lt.exports.default=mt,lt.exports.pino=mt;const Sp={level:"info"},Wn="custom_context",ps=1e3*1024;var Ip=Object.defineProperty,Dp=(t,e,r)=>e in t?Ip(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Mt=(t,e,r)=>Dp(t,typeof e!="symbol"?e+"":e,r);let Ap=class{constructor(e){Mt(this,"nodeValue"),Mt(this,"sizeInBytes"),Mt(this,"next"),this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},za=class{constructor(e){Mt(this,"lengthInNodes"),Mt(this,"sizeInBytes"),Mt(this,"head"),Mt(this,"tail"),Mt(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new Ap(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.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 r=this.head;for(;r!==null;)e.push(r.value),r=r.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 r=e.value;return e=e.next,{done:!1,value:r}}}}};const Op=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r);function ja(t){return typeof t=="string"?t:Op(t)||""}var Tp=Object.defineProperty,Bp=(t,e,r)=>e in t?Tp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gn=(t,e,r)=>Bp(t,typeof e!="symbol"?e+"":e,r);let Ka=class{constructor(e,r=ps){Gn(this,"logs"),Gn(this,"level"),Gn(this,"levelValue"),Gn(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=lt.exports.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new za(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===lt.exports.levels.values.error?console.error(e):r===lt.exports.levels.values.warn?console.warn(e):r===lt.exports.levels.values.debug?console.debug(e):r===lt.exports.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ja({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new za(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(ja({extraMetadata:e})),new Blob(r,{type:"application/json"})}};var Rp=Object.defineProperty,Np=(t,e,r)=>e in t?Rp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pp=(t,e,r)=>Np(t,e+"",r);let $p=class{constructor(e,r=ps){Pp(this,"baseChunkLogger"),this.baseChunkLogger=new Ka(e,r)}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 r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}};var Cp=Object.defineProperty,Up=(t,e,r)=>e in t?Cp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Lp=(t,e,r)=>Up(t,e+"",r);let kp=class{constructor(e,r=ps){Lp(this,"baseChunkLogger"),this.baseChunkLogger=new Ka(e,r)}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 Mp=Object.defineProperty,Fp=Object.defineProperties,qp=Object.getOwnPropertyDescriptors,Va=Object.getOwnPropertySymbols,zp=Object.prototype.hasOwnProperty,jp=Object.prototype.propertyIsEnumerable,Ha=(t,e,r)=>e in t?Mp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ft=(t,e)=>{for(var r in e||(e={}))zp.call(e,r)&&Ha(t,r,e[r]);if(Va)for(var r of Va(e))jp.call(e,r)&&Ha(t,r,e[r]);return t},qt=(t,e)=>Fp(t,qp(e));function Kp(t){return qt(Ft({},t),{level:t?.level||Sp.level})}function Vp(t,e,r=Wn){return t[r]=e,t}function Ne(t,e=Wn){return t[e]||""}function Hp(t,e,r=Wn){const n=Ne(t,r);return n.trim()?`${n}/${e}`:e}function Me(t,e,r=Wn){const n=Hp(t,e,r),i=t.child({context:n});return Vp(i,n,r)}function Wp(t){var e,r;const n=new $p((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:lt.exports(qt(Ft({},t.opts),{level:"trace",browser:qt(Ft({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function Gp(t){var e,r;const n=new kp((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:lt.exports(qt(Ft({},t.opts),{level:"trace",browser:qt(Ft({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})}),n),chunkLoggerController:n}}function Wa(t){var e;if(typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string")return{logger:t.loggerOverride,chunkLoggerController:null};const r=qt(Ft({},t.opts),{level:typeof t.loggerOverride=="string"?t.loggerOverride:(e=t.opts)==null?void 0:e.level});return typeof window<"u"?Wp(qt(Ft({},t),{opts:r})):Gp(qt(Ft({},t),{opts:r}))}class Yp extends lr{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class Zp extends lr{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}let Xp=class{constructor(e,r){this.logger=e,this.core=r}},Jp=class extends lr{constructor(e,r){super(),this.relayer=e,this.logger=r}};class Qp extends lr{constructor(e){super()}}let eg=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},tg=class extends lr{constructor(e,r){super(),this.relayer=e,this.logger=r}},rg=class extends lr{constructor(e,r){super(),this.core=e,this.logger=r}},ng=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},ig=class{constructor(e,r){this.projectId=e,this.logger=r}},sg=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},og=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},ag=class{constructor(e){this.client=e}};function cg(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Ga(t,...e){if(!cg(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Ya(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ug(t,e){Ga(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const $r=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gs=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function lg(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Za(t){return typeof t=="string"&&(t=lg(t)),Ga(t),t}let hg=class{clone(){return this._cloneInto()}};function fg(t){const e=n=>t().update(Za(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Xa(t=32){if($r&&typeof $r.getRandomValues=="function")return $r.getRandomValues(new Uint8Array(t));if($r&&typeof $r.randomBytes=="function")return $r.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function dg(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}let pg=class extends hg{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=gs(this.buffer)}update(e){Ya(this);const{view:r,buffer:n,blockLen:i}=this;e=Za(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=gs(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ya(this),ug(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let h=o;h<i;h++)r[h]=0;dg(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=gs(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)a.setUint32(4*h,l[h],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}};const Yn=BigInt(2**32-1),ys=BigInt(32);function Ja(t,e=!1){return e?{h:Number(t&Yn),l:Number(t>>ys&Yn)}:{h:Number(t>>ys&Yn)|0,l:Number(t&Yn)|0}}function gg(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=Ja(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const yg=(t,e)=>BigInt(t>>>0)<<ys|BigInt(e>>>0),wg=(t,e,r)=>t>>>r,mg=(t,e,r)=>t<<32-r|e>>>r,bg=(t,e,r)=>t>>>r|e<<32-r,Eg=(t,e,r)=>t<<32-r|e>>>r,vg=(t,e,r)=>t<<64-r|e>>>r-32,_g=(t,e,r)=>t>>>r-32|e<<64-r,xg=(t,e)=>e,Sg=(t,e)=>t,Ig=(t,e,r)=>t<<r|e>>>32-r,Dg=(t,e,r)=>e<<r|t>>>32-r,Ag=(t,e,r)=>e<<r-32|t>>>64-r,Og=(t,e,r)=>t<<r-32|e>>>64-r;function Tg(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const Bg=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Rg=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Ng=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Pg=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,$g=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Cg=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,Y={fromBig:Ja,split:gg,toBig:yg,shrSH:wg,shrSL:mg,rotrSH:bg,rotrSL:Eg,rotrBH:vg,rotrBL:_g,rotr32H:xg,rotr32L:Sg,rotlSH:Ig,rotlSL:Dg,rotlBH:Ag,rotlBL:Og,add:Tg,add3L:Bg,add3H:Rg,add4L:Ng,add4H:Pg,add5H:Cg,add5L:$g},[Ug,Lg]=Y.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x