Socket
Socket
Sign inDemoInstall

@json-rpc-tools/provider

Package Overview
Dependencies
17
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-beta.1 to 2.0.0-beta.2

2

dist/cjs/http.d.ts

@@ -7,3 +7,3 @@ /// <reference types="node" />

events: EventEmitter;
private api;
private isAvailable;
private registering;

@@ -10,0 +10,0 @@ constructor(url: string);

@@ -6,6 +6,10 @@ "use strict";

const events_1 = require("events");
const axios_1 = tslib_1.__importDefault(require("axios"));
const cross_fetch_1 = tslib_1.__importDefault(require("cross-fetch"));
const utils_1 = require("@json-rpc-tools/utils");
const safe_json_utils_1 = require("safe-json-utils");
const url_1 = require("./url");
const DEFAULT_HTTP_HEADERS = {
Accept: "application/json",
"Content-Type": "application/json",
};
class HttpConnection {

@@ -15,2 +19,3 @@ constructor(url) {

this.events = new events_1.EventEmitter();
this.isAvailable = false;
this.registering = false;

@@ -23,3 +28,3 @@ if (!url_1.isHttpUrl(url)) {

get connected() {
return typeof this.api !== "undefined";
return this.isAvailable;
}

@@ -43,3 +48,3 @@ get connecting() {

return tslib_1.__awaiter(this, void 0, void 0, function* () {
this.api = yield this.register(url);
yield this.register(url);
});

@@ -54,8 +59,9 @@ }

return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (typeof this.api === "undefined") {
this.api = yield this.register();
}
this.api
.post("/", payload)
.then(res => this.onPayload(res))
cross_fetch_1.default(this.url, {
headers: DEFAULT_HTTP_HEADERS,
method: "POST",
body: safe_json_utils_1.safeJsonStringify(payload),
})
.then(res => res.json())
.then(data => this.onPayload({ data }))
.catch(err => this.onError(payload.id, err));

@@ -72,6 +78,6 @@ });

this.events.once("open", () => {
if (typeof this.api === "undefined") {
if (typeof this.isAvailable === "undefined") {
return reject(new Error("HTTP connection is missing or invalid"));
}
resolve(this.api);
resolve();
});

@@ -82,13 +88,9 @@ });

this.registering = true;
const api = axios_1.default.create({
baseURL: url,
timeout: 30000,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
});
try {
yield api.post("/", { id: 1, jsonrpc: "2.0", method: "test", params: [] });
this.onOpen(api);
yield cross_fetch_1.default(url, {
headers: DEFAULT_HTTP_HEADERS,
method: "POST",
body: safe_json_utils_1.safeJsonStringify({ id: 1, jsonrpc: "2.0", method: "test", params: [] }),
});
this.onOpen();
}

@@ -99,7 +101,6 @@ catch (e) {

}
return api;
});
}
onOpen(api) {
this.api = api;
onOpen() {
this.isAvailable = true;
this.registering = false;

@@ -109,3 +110,3 @@ this.events.emit("open");

onClose() {
this.api = undefined;
this.isAvailable = false;
this.events.emit("close");

@@ -112,0 +113,0 @@ }

@@ -7,3 +7,3 @@ /// <reference types="node" />

events: EventEmitter;
private api;
private isAvailable;
private registering;

@@ -10,0 +10,0 @@ constructor(url: string);

import { EventEmitter } from "events";
import axios from "axios";
import fetch from "cross-fetch";
import { formatJsonRpcError } from "@json-rpc-tools/utils";
import { safeJsonParse } from "safe-json-utils";
import { safeJsonParse, safeJsonStringify } from "safe-json-utils";
import { isHttpUrl } from "./url";
const DEFAULT_HTTP_HEADERS = {
Accept: "application/json",
"Content-Type": "application/json",
};
export class HttpConnection {

@@ -10,2 +14,3 @@ constructor(url) {

this.events = new EventEmitter();
this.isAvailable = false;
this.registering = false;

@@ -18,3 +23,3 @@ if (!isHttpUrl(url)) {

get connected() {
return typeof this.api !== "undefined";
return this.isAvailable;
}

@@ -37,3 +42,3 @@ get connecting() {

async open(url = this.url) {
this.api = await this.register(url);
await this.register(url);
}

@@ -44,8 +49,9 @@ async close() {

async send(payload, context) {
if (typeof this.api === "undefined") {
this.api = await this.register();
}
this.api
.post("/", payload)
.then(res => this.onPayload(res))
fetch(this.url, {
headers: DEFAULT_HTTP_HEADERS,
method: "POST",
body: safeJsonStringify(payload),
})
.then(res => res.json())
.then(data => this.onPayload({ data }))
.catch(err => this.onError(payload.id, err));

@@ -60,6 +66,6 @@ }

this.events.once("open", () => {
if (typeof this.api === "undefined") {
if (typeof this.isAvailable === "undefined") {
return reject(new Error("HTTP connection is missing or invalid"));
}
resolve(this.api);
resolve();
});

@@ -70,13 +76,9 @@ });

this.registering = true;
const api = axios.create({
baseURL: url,
timeout: 30000,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
});
try {
await api.post("/", { id: 1, jsonrpc: "2.0", method: "test", params: [] });
this.onOpen(api);
await fetch(url, {
headers: DEFAULT_HTTP_HEADERS,
method: "POST",
body: safeJsonStringify({ id: 1, jsonrpc: "2.0", method: "test", params: [] }),
});
this.onOpen();
}

@@ -87,6 +89,5 @@ catch (e) {

}
return api;
}
onOpen(api) {
this.api = api;
onOpen() {
this.isAvailable = true;
this.registering = false;

@@ -96,3 +97,3 @@ this.events.emit("open");

onClose() {
this.api = undefined;
this.isAvailable = false;
this.events.emit("close");

@@ -99,0 +100,0 @@ }

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("JsonRpcProvider",[],t):"object"==typeof exports?exports.JsonRpcProvider=t():e.JsonRpcProvider=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=36)}([function(e,t,n){"use strict";n.d(t,"e",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"f",(function(){return a})),n.d(t,"h",(function(){return f})),n.d(t,"i",(function(){return d}));const r="PARSE_ERROR",o="INVALID_REQUEST",i="METHOD_NOT_FOUND",s="INVALID_PARAMS",u="INTERNAL_ERROR",c="SERVER_ERROR",a=[-32700,-32600,-32601,-32602,-32603],f=[-32e3,-32099],d={[r]:{code:-32700,message:"Parse error"},[o]:{code:-32600,message:"Invalid Request"},[i]:{code:-32601,message:"Method not found"},[s]:{code:-32602,message:"Invalid params"},[u]:{code:-32603,message:"Internal error"},[c]:{code:-32e3,message:"Server error"}}},function(e,t,n){"use strict";var r=n(26),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function a(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:a,isStream:function(e){return u(e)&&a(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)f(arguments[r],n);return t},extend:function(e,t,n){return f(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"f",(function(){return a}));var r=n(0);function o(e){return e<=r.h[0]&&e>=r.h[1]}function i(e){return r.f.includes(e)}function s(e){return"number"==typeof e}function u(e){return Object.keys(r.i).includes(e)?r.i[e]:r.i[r.a]}function c(e){const t=Object.values(r.i).find(t=>t.code===e);return t||r.i[r.a]}function a(e){if(void 0===e.error.code)return{valid:!1,error:"Missing code for JSON-RPC error"};if(void 0===e.error.message)return{valid:!1,error:"Missing message for JSON-RPC error"};if(!s(e.error.code))return{valid:!1,error:"Invalid error code type for JSON-RPC: "+e.error.code};if(i(e.error.code)){const t=c(e.error.code);if(t.message!==r.i[r.a].message&&e.error.message===t.message)return{valid:!1,error:"Invalid error code message for JSON-RPC: "+e.error.code}}return{valid:!0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r{}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return s}));var r=n(3);class o extends r.a{constructor(e){super()}}class i extends r.a{constructor(){super()}}class s extends i{constructor(e){super()}}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return s})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return a})),n.d(t,"__awaiter",(function(){return f})),n.d(t,"__generator",(function(){return d})),n.d(t,"__createBinding",(function(){return l})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return m})),n.d(t,"__spreadArrays",(function(){return y})),n.d(t,"__await",(function(){return g})),n.d(t,"__asyncGenerator",(function(){return R})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return _})),n.d(t,"__makeTemplateObject",(function(){return b})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return O})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return S}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("JsonRpcProvider",[],e):"object"==typeof exports?exports.JsonRpcProvider=e():t.JsonRpcProvider=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=26)}([function(t,e,n){"use strict";n.d(e,"e",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"g",(function(){return c})),n.d(e,"f",(function(){return a})),n.d(e,"h",(function(){return f})),n.d(e,"i",(function(){return d}));const r="PARSE_ERROR",o="INVALID_REQUEST",i="METHOD_NOT_FOUND",s="INVALID_PARAMS",u="INTERNAL_ERROR",c="SERVER_ERROR",a=[-32700,-32600,-32601,-32602,-32603],f=[-32e3,-32099],d={[r]:{code:-32700,message:"Parse error"},[o]:{code:-32600,message:"Invalid Request"},[i]:{code:-32601,message:"Method not found"},[s]:{code:-32602,message:"Invalid params"},[u]:{code:-32603,message:"Internal error"},[c]:{code:-32e3,message:"Server error"}}},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"f",(function(){return a}));var r=n(0);function o(t){return t<=r.h[0]&&t>=r.h[1]}function i(t){return r.f.includes(t)}function s(t){return"number"==typeof t}function u(t){return Object.keys(r.i).includes(t)?r.i[t]:r.i[r.a]}function c(t){const e=Object.values(r.i).find(e=>e.code===t);return e||r.i[r.a]}function a(t){if(void 0===t.error.code)return{valid:!1,error:"Missing code for JSON-RPC error"};if(void 0===t.error.message)return{valid:!1,error:"Missing message for JSON-RPC error"};if(!s(t.error.code))return{valid:!1,error:"Invalid error code type for JSON-RPC: "+t.error.code};if(i(t.error.code)){const e=c(t.error.code);if(e.message!==r.i[r.a].message&&t.error.message===e.message)return{valid:!1,error:"Invalid error code message for JSON-RPC: "+t.error.code}}return{valid:!0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return s}));var r=n(2);class o extends r.a{constructor(t){super()}}class i extends r.a{constructor(){super()}}class s extends i{constructor(t){super()}}},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return u})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return a})),n.d(e,"__awaiter",(function(){return f})),n.d(e,"__generator",(function(){return d})),n.d(e,"__createBinding",(function(){return l})),n.d(e,"__exportStar",(function(){return h})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return y})),n.d(e,"__spreadArrays",(function(){return m})),n.d(e,"__await",(function(){return b})),n.d(e,"__asyncGenerator",(function(){return _})),n.d(e,"__asyncDelegator",(function(){return g})),n.d(e,"__asyncValues",(function(){return R})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return E})),n.d(e,"__importDefault",(function(){return O})),n.d(e,"__classPrivateFieldGet",(function(){return P})),n.d(e,"__classPrivateFieldSet",(function(){return S}));
/*! *****************************************************************************

@@ -16,2 +16,2 @@ Copyright (c) Microsoft Corporation.

***************************************************************************** */
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function c(e,t){return function(n,r){t(n,r,e)}}function a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}c((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function l(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,o++)r[o]=i[s];return r}function g(e){return this instanceof g?(this.v=e,this):new g(e)}function R(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof g?Promise.resolve(n.value.v).then(c,a):f(i[0][2],n)}catch(e){f(i[0][3],e)}var n}function c(e){u("next",e)}function a(e){u("throw",e)}function f(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:g(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function _(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function b(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function O(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(37),t),o(n(38),t)},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new Promise((function(n,r){function o(){void 0!==i&&e.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==t&&(i=function(n){e.removeListener(t,o),r(n)},e.once("error",i)),e.once(t,o)}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var o,i,s,u;if(a(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=f(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(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},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var a=c.length,f=m(c,a);for(n=0;n<a;++n)i(f[n],this,t)}return!0},u.prototype.addListener=function(e,t){return d(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return d(this,e,t,!0)},u.prototype.once=function(e,t){return a(t),this.on(e,p(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,p(this,e,t)),this},u.prototype.removeListener=function(e,t){var n,r,o,i,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return h(this,e,!0)},u.prototype.rawListeners=function(e){return h(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";n.r(t);var r=n(0);n.d(t,"PARSE_ERROR",(function(){return r.e})),n.d(t,"INVALID_REQUEST",(function(){return r.c})),n.d(t,"METHOD_NOT_FOUND",(function(){return r.d})),n.d(t,"INVALID_PARAMS",(function(){return r.b})),n.d(t,"INTERNAL_ERROR",(function(){return r.a})),n.d(t,"SERVER_ERROR",(function(){return r.g})),n.d(t,"RESERVED_ERROR_CODES",(function(){return r.f})),n.d(t,"SERVER_ERROR_CODE_RANGE",(function(){return r.h})),n.d(t,"STANDARD_ERROR_MAP",(function(){return r.i}));var o=n(2);n.d(t,"isServerErrorCode",(function(){return o.d})),n.d(t,"isReservedErrorCode",(function(){return o.c})),n.d(t,"isValidErrorCode",(function(){return o.e})),n.d(t,"getError",(function(){return o.a})),n.d(t,"getErrorByCode",(function(){return o.b})),n.d(t,"validateJsonRpcError",(function(){return o.f}));var i=n(11);for(var s in i)["default","PARSE_ERROR","INVALID_REQUEST","METHOD_NOT_FOUND","INVALID_PARAMS","INTERNAL_ERROR","SERVER_ERROR","RESERVED_ERROR_CODES","SERVER_ERROR_CODE_RANGE","STANDARD_ERROR_MAP","isServerErrorCode","isReservedErrorCode","isValidErrorCode","getError","getErrorByCode","validateJsonRpcError"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(s);var u=n(14);n.d(t,"payloadId",(function(){return u.e})),n.d(t,"formatJsonRpcRequest",(function(){return u.c})),n.d(t,"formatJsonRpcResult",(function(){return u.d})),n.d(t,"formatJsonRpcError",(function(){return u.b})),n.d(t,"formatErrorMessage",(function(){return u.a}));var c=n(15);n.d(t,"isValidRoute",(function(){return c.c})),n.d(t,"isValidDefaultRoute",(function(){return c.a})),n.d(t,"isValidWildcardRoute",(function(){return c.e})),n.d(t,"isValidLeadingWildcardRoute",(function(){return c.b})),n.d(t,"isValidTrailingWildcardRoute",(function(){return c.d}));var a=n(16);for(var s in a)["default","PARSE_ERROR","INVALID_REQUEST","METHOD_NOT_FOUND","INVALID_PARAMS","INTERNAL_ERROR","SERVER_ERROR","RESERVED_ERROR_CODES","SERVER_ERROR_CODE_RANGE","STANDARD_ERROR_MAP","isServerErrorCode","isReservedErrorCode","isValidErrorCode","getError","getErrorByCode","validateJsonRpcError","payloadId","formatJsonRpcRequest","formatJsonRpcResult","formatJsonRpcError","formatErrorMessage","isValidRoute","isValidDefaultRoute","isValidWildcardRoute","isValidLeadingWildcardRoute","isValidTrailingWildcardRoute"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(s);var f=n(24);n.d(t,"isJsonRpcPayload",(function(){return f.b})),n.d(t,"isJsonRpcRequest",(function(){return f.c})),n.d(t,"isJsonRpcResponse",(function(){return f.d})),n.d(t,"isJsonRpcResult",(function(){return f.e})),n.d(t,"isJsonRpcError",(function(){return f.a})),n.d(t,"isJsonRpcValidationInvalid",(function(){return f.f}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLocalhostUrl=t.isWsUrl=t.isHttpUrl=void 0;function r(e,t){const n=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==n&&new RegExp(t).test(n)}t.isHttpUrl=function(e){return r(e,"^https?:")},t.isWsUrl=function(e){return r(e,"^wss?:")},t.isLocalhostUrl=function(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=void 0;const r=n(5),o=n(7),i=n(8),s=n(9),u=n(25),c=n(35);class a extends i.IJsonRpcProvider{constructor(e){super(e),this.events=new o.EventEmitter,this.connection=this.setConnection(e)}connect(e=this.connection){return r.__awaiter(this,void 0,void 0,(function*(){yield this.open(e)}))}disconnect(){return r.__awaiter(this,void 0,void 0,(function*(){yield this.close()}))}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)}request(e,t){return r.__awaiter(this,void 0,void 0,(function*(){return this.requestStrict(i.formatJsonRpcRequest(e.method,e.params||[]),t)}))}requestStrict(e,t){return r.__awaiter(this,void 0,void 0,(function*(){return new Promise((t,n)=>r.__awaiter(this,void 0,void 0,(function*(){if(!this.connection.connected)try{yield this.open()}catch(e){n(e.message)}this.events.on(""+e.id,e=>{i.isJsonRpcError(e)?n(e.error.message):t(e.result)}),yield this.connection.send(e)})))}))}setConnection(e=this.connection){return"string"==typeof e?s.isHttpUrl(e)?new u.HttpConnection(e):new c.WsConnection(e):e}onPayload(e){this.events.emit("payload",e),i.isJsonRpcResponse(e)?this.events.emit(""+e.id,e):this.events.emit("message",{type:e.method,data:e.params})}open(e=this.connection){return r.__awaiter(this,void 0,void 0,(function*(){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),this.connection=this.setConnection(),yield this.connection.open(),this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",()=>this.events.emit("disconnect")),this.connection.on("error",()=>this.events.emit("error")),this.events.emit("connect"))}))}close(){return r.__awaiter(this,void 0,void 0,(function*(){yield this.connection.close(),this.events.emit("disconnect")}))}}t.JsonRpcProvider=a,t.default=a},function(e,t,n){"use strict";n.r(t),n.d(t,"isNodeJs",(function(){return i}));var r=n(6);for(var o in r)["default","isNodeJs"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);const i=r.isNode},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,a=[],f=!1,d=-1;function l(){f&&c&&(f=!1,c.length?a=c.concat(a):d=-1,a.length&&p())}function p(){if(!f){var e=u(l);f=!0;for(var t=a.length;t;){for(c=a,a=[];++d<t;)c&&c[d].run();d=-1,t=a.length}c=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new h(e,t)),1!==a.length||f||u(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.d(t,"e",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return a}));var r=n(2),o=n(0);function i(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}function s(e,t,n){return{id:n||i(),jsonrpc:"2.0",method:e,params:t}}function u(e,t){return{id:e,jsonrpc:"2.0",result:t}}function c(e,t){return{id:e,jsonrpc:"2.0",error:a(t)}}function a(e){if(void 0===e)return Object(r.a)(o.a);if("string"==typeof e&&(e=Object.assign(Object.assign({},Object(r.a)(o.g)),{message:e})),Object(r.c)(e.code)&&(e=Object(r.b)(e.code)),!Object(r.d)(e.code))throw new Error("Error code is not in server code range");return e}},function(e,t,n){"use strict";function r(e){return e.includes("*")?i(e):!/\W/g.test(e)}function o(e){return"*"===e}function i(e){return!!o(e)||!!e.includes("*")&&(2===e.split("*").length&&1===e.split("*").filter(e=>""===e.trim()).length)}function s(e){return!o(e)&&i(e)&&!e.split("*")[0].trim()}function u(e){return!o(e)&&i(e)&&!e.split("*")[1].trim()}n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return u}))},function(e,t,n){"use strict";n.r(t);var r=n(17);for(var o in r)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o)},function(e,t,n){"use strict";n.r(t);var r=n(18);n.d(t,"IPendingRequests",(function(){return r.c})),n.d(t,"IBlockchainAuthenticator",(function(){return r.a})),n.d(t,"IBlockchainProvider",(function(){return r.b}));var o=n(19);for(var i in o)["default","IPendingRequests","IBlockchainAuthenticator","IBlockchainProvider"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var s=n(3);n.d(t,"IEvents",(function(){return s.a}));var u=n(20);n.d(t,"IMultiServiceProvider",(function(){return u.a}));var c=n(4);n.d(t,"IJsonRpcConnection",(function(){return c.b})),n.d(t,"IBaseJsonRpcProvider",(function(){return c.a})),n.d(t,"IJsonRpcProvider",(function(){return c.c}));var a=n(21);n.d(t,"IJsonRpcRouter",(function(){return a.a}));var f=n(22);for(var i in f)["default","IPendingRequests","IBlockchainAuthenticator","IBlockchainProvider","IEvents","IMultiServiceProvider","IJsonRpcConnection","IBaseJsonRpcProvider","IJsonRpcProvider","IJsonRpcRouter"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return f[e]}))}(i);var d=n(23);n.d(t,"IJsonRpcValidator",(function(){return d.a}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(3),o=n(4);class i{constructor(e){this.storage=e}}class s extends r.a{constructor(e){super(),this.config=e}}class u extends o.c{constructor(e,t){super(e)}}},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4);class o extends r.a{constructor(e){super(),this.config=e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r{constructor(e){this.routes=e}}},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r{constructor(e){this.schemas=e}}},function(e,t,n){"use strict";function r(e){return"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function o(e){return r(e)&&"method"in e}function i(e){return r(e)&&(s(e)||u(e))}function s(e){return"result"in e}function u(e){return"error"in e}function c(e){return"error"in e&&!1===e.valid}n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return u})),n.d(t,"f",(function(){return c}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpConnection=void 0;const r=n(5),o=n(7),i=r.__importDefault(n(39)),s=n(8),u=n(34),c=n(9);t.HttpConnection=class{constructor(e){if(this.url=e,this.events=new o.EventEmitter,this.registering=!1,!c.isHttpUrl(e))throw new Error("Provided URL is not compatible with HTTP connection: "+e);this.url=e}get connected(){return void 0!==this.api}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}open(e=this.url){return r.__awaiter(this,void 0,void 0,(function*(){this.api=yield this.register(e)}))}close(){return r.__awaiter(this,void 0,void 0,(function*(){this.onClose()}))}send(e,t){return r.__awaiter(this,void 0,void 0,(function*(){void 0===this.api&&(this.api=yield this.register()),this.api.post("/",e).then(e=>this.onPayload(e)).catch(t=>this.onError(e.id,t))}))}register(e=this.url){return r.__awaiter(this,void 0,void 0,(function*(){if(!c.isHttpUrl(e))throw new Error("Provided URL is not compatible with HTTP connection: "+e);if(this.registering)return new Promise((e,t)=>{this.events.once("open",()=>{if(void 0===this.api)return t(new Error("HTTP connection is missing or invalid"));e(this.api)})});this.url=e,this.registering=!0;const t=i.default.create({baseURL:e,timeout:3e4,headers:{Accept:"application/json","Content-Type":"application/json"}});try{yield t.post("/",{id:1,jsonrpc:"2.0",method:"test",params:[]}),this.onOpen(t)}catch(t){throw this.onClose(),new Error("Unavailable HTTP RPC url at "+e)}return t}))}onOpen(e){this.api=e,this.registering=!1,this.events.emit("open")}onClose(){this.api=void 0,this.events.emit("close")}onPayload(e){if(void 0===e.data)return;const t="string"==typeof e.data?u.safeJsonParse(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=t.message||t.toString(),r=s.formatJsonRpcError(e,n);this.events.emit("payload",r)}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(1);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(1),o=n(45),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(u=n(30)),u),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(i)})),e.exports=c}).call(this,n(13))},function(e,t,n){"use strict";var r=n(1),o=n(46),i=n(48),s=n(27),u=n(49),c=n(52),a=n(53),f=n(31);e.exports=function(e){return new Promise((function(t,n){var d=e.data,l=e.headers;r.isFormData(d)&&delete l["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.Authorization="Basic "+btoa(h+":"+v)}var m=u(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),s(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,i),p=null}},p.onabort=function(){p&&(n(f("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(f("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(f(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||a(m))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;y&&(l[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(l,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete l[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},function(e,t,n){"use strict";var r=n(47);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t,n){"use strict";var r=n(1);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function a(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=c(void 0,e[o])):n[o]=c(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(i,a),r.forEach(s,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=c(void 0,e[o])):n[o]=c(void 0,t[o])})),r.forEach(u,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var f=o.concat(i).concat(s).concat(u),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return r.forEach(d,a),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeJsonParse=function(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return JSON.parse(e)}catch(t){return e}},t.safeJsonStringify=function(e){return"string"==typeof e?e:JSON.stringify(e,(e,t)=>void 0===t?null:t)}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.WsConnection=void 0;const r=n(5),o=n(7),i=n(34),s=n(8),u=n(9),c=void 0!==e.WebSocket?e.WebSocket:n(56);t.WsConnection=class{constructor(e){if(this.url=e,this.events=new o.EventEmitter,this.registering=!1,!u.isWsUrl(e))throw new Error("Provided URL is not compatible with WebSocket connection: "+e);this.url=e}get connected(){return void 0!==this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}open(e=this.url){return r.__awaiter(this,void 0,void 0,(function*(){this.socket=yield this.register(e)}))}close(){return r.__awaiter(this,void 0,void 0,(function*(){if(void 0===this.socket)throw new Error("Already disconnected");this.socket.close(),this.onClose()}))}send(e,t){return r.__awaiter(this,void 0,void 0,(function*(){void 0===this.socket&&(this.socket=yield this.register()),this.socket.send(i.safeJsonStringify(e))}))}register(e=this.url){if(!u.isWsUrl(e))throw new Error("Provided URL is not compatible with WebSocket connection: "+e);return this.registering?new Promise((e,t)=>{this.events.once("open",()=>{if(void 0===this.socket)return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)})}):(this.url=e,this.registering=!0,new Promise((t,n)=>{const r=s.isReactNative()?void 0:{rejectUnauthorized:!u.isLocalhostUrl(e)},o=new c(e,[],r);o.onopen=()=>{this.onOpen(o),t(o)},o.onerror=e=>{this.events.emit("error",e),n(e)}}))}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=()=>this.onClose(),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(){this.socket=void 0,this.events.emit("close")}onPayload(e){if(void 0===e.data)return;const t="string"==typeof e.data?i.safeJsonParse(e.data):e.data;this.events.emit("payload",t)}}}).call(this,n(12))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5),o=r.__importDefault(n(10));r.__exportStar(n(25),t),r.__exportStar(n(35),t),r.__exportStar(n(10),t),t.default=o.default},function(e,t,n){"use strict";(function(e){function n(){return(null==e?void 0:e.crypto)||(null==e?void 0:e.msCrypto)||{}}function r(){const e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=r,t.isBrowserCryptoAvailable=function(){return!!n()&&!!r()}}).call(this,n(12))},function(e,t,n){"use strict";(function(e){function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function r(){return void 0!==e&&void 0!==e.versions&&void 0!==e.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=r,t.isBrowser=function(){return!n()&&!r()}}).call(this,n(13))},function(e,t,n){e.exports=n(40)},function(e,t,n){"use strict";var r=n(1),o=n(26),i=n(41),s=n(32);function u(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var c=u(n(29));c.Axios=i,c.create=function(e){return u(s(c.defaults,e))},c.Cancel=n(33),c.CancelToken=n(54),c.isCancel=n(28),c.all=function(e){return Promise.all(e)},c.spread=n(55),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";var r=n(1),o=n(27),i=n(42),s=n(43),u=n(32);function c(e){this.defaults=e,this.interceptors={request:new i,response:new i}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=u(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[s,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},c.prototype.getUri=function(e){return e=u(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(u(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(u(r||{},{method:e,url:t,data:n}))}})),e.exports=c},function(e,t,n){"use strict";var r=n(1);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,n){"use strict";var r=n(1),o=n(44),i=n(28),s=n(29);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return u(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(1);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){"use strict";var r=n(1);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(31);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(1);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,s){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===s&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(50),o=n(51);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(1),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(1);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(33);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}])}));
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function u(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}c((r=r.apply(t,e||[])).next())}))}function d(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function l(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function h(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v(arguments[e]));return t}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,u=i.length;s<u;s++,o++)r[o]=i[s];return r}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function _(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||u(t,e)}))})}function u(t,e){try{(n=o[t](e)).value instanceof b?Promise.resolve(n.value.v).then(c,a):f(i[0][2],n)}catch(t){f(i[0][3],t)}var n}function c(t){u("next",t)}function a(t){u("throw",t)}function f(t,e){t(e),i.shift(),i.length&&u(i[0][0],i[0][1])}}function g(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function R(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function O(t){return t&&t.__esModule?t:{default:t}}function P(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function S(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(27),e),o(n(28),e)},function(t,e,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(t,e){return new Promise((function(n,r){function o(){void 0!==i&&t.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==e&&(i=function(n){t.removeListener(e,o),r(n)},t.once("error",i)),t.once(e,o)}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function d(t,e,n,r){var o,i,s,u;if(a(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),s=i[e]),void 0===s)s=i[e]=n,++t._eventsCount;else if("function"==typeof s?s=i[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=f(t))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function p(t,e,n){var r=t._events;if(void 0===r)return[];var o=r[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(o):y(o,o.length)}function v(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)i(c,this,e);else{var a=c.length,f=y(c,a);for(n=0;n<a;++n)i(f[n],this,e)}return!0},u.prototype.addListener=function(t,e){return d(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return d(this,t,e,!0)},u.prototype.once=function(t,e){return a(e),this.on(t,h(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,h(this,t,e)),this},u.prototype.removeListener=function(t,e){var n,r,o,i,s;if(a(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===e||n[i].listener===e){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,o),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return p(this,t,!0)},u.prototype.rawListeners=function(t){return p(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";n.r(e);var r=n(0);n.d(e,"PARSE_ERROR",(function(){return r.e})),n.d(e,"INVALID_REQUEST",(function(){return r.c})),n.d(e,"METHOD_NOT_FOUND",(function(){return r.d})),n.d(e,"INVALID_PARAMS",(function(){return r.b})),n.d(e,"INTERNAL_ERROR",(function(){return r.a})),n.d(e,"SERVER_ERROR",(function(){return r.g})),n.d(e,"RESERVED_ERROR_CODES",(function(){return r.f})),n.d(e,"SERVER_ERROR_CODE_RANGE",(function(){return r.h})),n.d(e,"STANDARD_ERROR_MAP",(function(){return r.i}));var o=n(1);n.d(e,"isServerErrorCode",(function(){return o.d})),n.d(e,"isReservedErrorCode",(function(){return o.c})),n.d(e,"isValidErrorCode",(function(){return o.e})),n.d(e,"getError",(function(){return o.a})),n.d(e,"getErrorByCode",(function(){return o.b})),n.d(e,"validateJsonRpcError",(function(){return o.f}));var i=n(10);for(var s in i)["default","PARSE_ERROR","INVALID_REQUEST","METHOD_NOT_FOUND","INVALID_PARAMS","INTERNAL_ERROR","SERVER_ERROR","RESERVED_ERROR_CODES","SERVER_ERROR_CODE_RANGE","STANDARD_ERROR_MAP","isServerErrorCode","isReservedErrorCode","isValidErrorCode","getError","getErrorByCode","validateJsonRpcError"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);var u=n(12);n.d(e,"payloadId",(function(){return u.e})),n.d(e,"formatJsonRpcRequest",(function(){return u.c})),n.d(e,"formatJsonRpcResult",(function(){return u.d})),n.d(e,"formatJsonRpcError",(function(){return u.b})),n.d(e,"formatErrorMessage",(function(){return u.a}));var c=n(13);n.d(e,"isValidRoute",(function(){return c.c})),n.d(e,"isValidDefaultRoute",(function(){return c.a})),n.d(e,"isValidWildcardRoute",(function(){return c.e})),n.d(e,"isValidLeadingWildcardRoute",(function(){return c.b})),n.d(e,"isValidTrailingWildcardRoute",(function(){return c.d}));var a=n(14);for(var s in a)["default","PARSE_ERROR","INVALID_REQUEST","METHOD_NOT_FOUND","INVALID_PARAMS","INTERNAL_ERROR","SERVER_ERROR","RESERVED_ERROR_CODES","SERVER_ERROR_CODE_RANGE","STANDARD_ERROR_MAP","isServerErrorCode","isReservedErrorCode","isValidErrorCode","getError","getErrorByCode","validateJsonRpcError","payloadId","formatJsonRpcRequest","formatJsonRpcResult","formatJsonRpcError","formatErrorMessage","isValidRoute","isValidDefaultRoute","isValidWildcardRoute","isValidLeadingWildcardRoute","isValidTrailingWildcardRoute"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);var f=n(22);n.d(e,"isJsonRpcPayload",(function(){return f.b})),n.d(e,"isJsonRpcRequest",(function(){return f.c})),n.d(e,"isJsonRpcResponse",(function(){return f.d})),n.d(e,"isJsonRpcResult",(function(){return f.e})),n.d(e,"isJsonRpcError",(function(){return f.a})),n.d(e,"isJsonRpcValidationInvalid",(function(){return f.f}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isLocalhostUrl=e.isWsUrl=e.isHttpUrl=void 0;function r(t,e){const n=function(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(e&&e.length)return e[0]}(t);return void 0!==n&&new RegExp(e).test(n)}e.isHttpUrl=function(t){return r(t,"^https?:")},e.isWsUrl=function(t){return r(t,"^wss?:")},e.isLocalhostUrl=function(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JsonRpcProvider=void 0;const r=n(4),o=n(6),i=n(7),s=n(8),u=n(23),c=n(25);class a extends i.IJsonRpcProvider{constructor(t){super(t),this.events=new o.EventEmitter,this.connection=this.setConnection(t)}connect(t=this.connection){return r.__awaiter(this,void 0,void 0,(function*(){yield this.open(t)}))}disconnect(){return r.__awaiter(this,void 0,void 0,(function*(){yield this.close()}))}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}request(t,e){return r.__awaiter(this,void 0,void 0,(function*(){return this.requestStrict(i.formatJsonRpcRequest(t.method,t.params||[]),e)}))}requestStrict(t,e){return r.__awaiter(this,void 0,void 0,(function*(){return new Promise((e,n)=>r.__awaiter(this,void 0,void 0,(function*(){if(!this.connection.connected)try{yield this.open()}catch(t){n(t.message)}this.events.on(""+t.id,t=>{i.isJsonRpcError(t)?n(t.error.message):e(t.result)}),yield this.connection.send(t)})))}))}setConnection(t=this.connection){return"string"==typeof t?s.isHttpUrl(t)?new u.HttpConnection(t):new c.WsConnection(t):t}onPayload(t){this.events.emit("payload",t),i.isJsonRpcResponse(t)?this.events.emit(""+t.id,t):this.events.emit("message",{type:t.method,data:t.params})}open(t=this.connection){return r.__awaiter(this,void 0,void 0,(function*(){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),this.connection=this.setConnection(),yield this.connection.open(),this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",()=>this.events.emit("disconnect")),this.connection.on("error",()=>this.events.emit("error")),this.events.emit("connect"))}))}close(){return r.__awaiter(this,void 0,void 0,(function*(){yield this.connection.close(),this.events.emit("disconnect")}))}}e.JsonRpcProvider=a,e.default=a},function(t,e,n){"use strict";n.r(e),n.d(e,"isNodeJs",(function(){return i}));var r=n(5);for(var o in r)["default","isNodeJs"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);const i=r.isNode},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.d(e,"e",(function(){return i})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return a}));var r=n(1),o=n(0);function i(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}function s(t,e,n){return{id:n||i(),jsonrpc:"2.0",method:t,params:e}}function u(t,e){return{id:t,jsonrpc:"2.0",result:e}}function c(t,e){return{id:t,jsonrpc:"2.0",error:a(e)}}function a(t){if(void 0===t)return Object(r.a)(o.a);if("string"==typeof t&&(t=Object.assign(Object.assign({},Object(r.a)(o.g)),{message:t})),Object(r.c)(t.code)&&(t=Object(r.b)(t.code)),!Object(r.d)(t.code))throw new Error("Error code is not in server code range");return t}},function(t,e,n){"use strict";function r(t){return t.includes("*")?i(t):!/\W/g.test(t)}function o(t){return"*"===t}function i(t){return!!o(t)||!!t.includes("*")&&(2===t.split("*").length&&1===t.split("*").filter(t=>""===t.trim()).length)}function s(t){return!o(t)&&i(t)&&!t.split("*")[0].trim()}function u(t){return!o(t)&&i(t)&&!t.split("*")[1].trim()}n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return u}))},function(t,e,n){"use strict";n.r(e);var r=n(15);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o)},function(t,e,n){"use strict";n.r(e);var r=n(16);n.d(e,"IPendingRequests",(function(){return r.c})),n.d(e,"IBlockchainAuthenticator",(function(){return r.a})),n.d(e,"IBlockchainProvider",(function(){return r.b}));var o=n(17);for(var i in o)["default","IPendingRequests","IBlockchainAuthenticator","IBlockchainProvider"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);var s=n(2);n.d(e,"IEvents",(function(){return s.a}));var u=n(18);n.d(e,"IMultiServiceProvider",(function(){return u.a}));var c=n(3);n.d(e,"IJsonRpcConnection",(function(){return c.b})),n.d(e,"IBaseJsonRpcProvider",(function(){return c.a})),n.d(e,"IJsonRpcProvider",(function(){return c.c}));var a=n(19);n.d(e,"IJsonRpcRouter",(function(){return a.a}));var f=n(20);for(var i in f)["default","IPendingRequests","IBlockchainAuthenticator","IBlockchainProvider","IEvents","IMultiServiceProvider","IJsonRpcConnection","IBaseJsonRpcProvider","IJsonRpcProvider","IJsonRpcRouter"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return f[t]}))}(i);var d=n(21);n.d(e,"IJsonRpcValidator",(function(){return d.a}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));var r=n(2),o=n(3);class i{constructor(t){this.storage=t}}class s extends r.a{constructor(t){super(),this.config=t}}class u extends o.c{constructor(t,e){super(t)}}},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3);class o extends r.a{constructor(t){super(),this.config=t}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{constructor(t){this.routes=t}}},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{constructor(t){this.schemas=t}}},function(t,e,n){"use strict";function r(t){return"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function o(t){return r(t)&&"method"in t}function i(t){return r(t)&&(s(t)||u(t))}function s(t){return"result"in t}function u(t){return"error"in t}function c(t){return"error"in t&&!1===t.valid}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"f",(function(){return c}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HttpConnection=void 0;const r=n(4),o=n(6),i=r.__importDefault(n(30)),s=n(7),u=n(24),c=n(8),a={Accept:"application/json","Content-Type":"application/json"};e.HttpConnection=class{constructor(t){if(this.url=t,this.events=new o.EventEmitter,this.isAvailable=!1,this.registering=!1,!c.isHttpUrl(t))throw new Error("Provided URL is not compatible with HTTP connection: "+t);this.url=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}open(t=this.url){return r.__awaiter(this,void 0,void 0,(function*(){yield this.register(t)}))}close(){return r.__awaiter(this,void 0,void 0,(function*(){this.onClose()}))}send(t,e){return r.__awaiter(this,void 0,void 0,(function*(){i.default(this.url,{headers:a,method:"POST",body:u.safeJsonStringify(t)}).then(t=>t.json()).then(t=>this.onPayload({data:t})).catch(e=>this.onError(t.id,e))}))}register(t=this.url){return r.__awaiter(this,void 0,void 0,(function*(){if(!c.isHttpUrl(t))throw new Error("Provided URL is not compatible with HTTP connection: "+t);if(this.registering)return new Promise((t,e)=>{this.events.once("open",()=>{if(void 0===this.isAvailable)return e(new Error("HTTP connection is missing or invalid"));t()})});this.url=t,this.registering=!0;try{yield i.default(t,{headers:a,method:"POST",body:u.safeJsonStringify({id:1,jsonrpc:"2.0",method:"test",params:[]})}),this.onOpen()}catch(e){throw this.onClose(),new Error("Unavailable HTTP RPC url at "+t)}}))}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.events.emit("close")}onPayload(t){if(void 0===t.data)return;const e="string"==typeof t.data?u.safeJsonParse(t.data):t.data;this.events.emit("payload",e)}onError(t,e){const n=e.message||e.toString(),r=s.formatJsonRpcError(t,n);this.events.emit("payload",r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.safeJsonParse=function(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}},e.safeJsonStringify=function(t){return"string"==typeof t?t:JSON.stringify(t,(t,e)=>void 0===e?null:e)}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.WsConnection=void 0;const r=n(4),o=n(6),i=n(24),s=n(7),u=n(8),c=void 0!==t.WebSocket?t.WebSocket:n(31);e.WsConnection=class{constructor(t){if(this.url=t,this.events=new o.EventEmitter,this.registering=!1,!u.isWsUrl(t))throw new Error("Provided URL is not compatible with WebSocket connection: "+t);this.url=t}get connected(){return void 0!==this.socket}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}open(t=this.url){return r.__awaiter(this,void 0,void 0,(function*(){this.socket=yield this.register(t)}))}close(){return r.__awaiter(this,void 0,void 0,(function*(){if(void 0===this.socket)throw new Error("Already disconnected");this.socket.close(),this.onClose()}))}send(t,e){return r.__awaiter(this,void 0,void 0,(function*(){void 0===this.socket&&(this.socket=yield this.register()),this.socket.send(i.safeJsonStringify(t))}))}register(t=this.url){if(!u.isWsUrl(t))throw new Error("Provided URL is not compatible with WebSocket connection: "+t);return this.registering?new Promise((t,e)=>{this.events.once("open",()=>{if(void 0===this.socket)return e(new Error("WebSocket connection is missing or invalid"));t(this.socket)})}):(this.url=t,this.registering=!0,new Promise((e,n)=>{const r=s.isReactNative()?void 0:{rejectUnauthorized:!u.isLocalhostUrl(t)},o=new c(t,[],r);o.onopen=()=>{this.onOpen(o),e(o)},o.onerror=t=>{this.events.emit("error",t),n(t)}}))}onOpen(t){t.onmessage=t=>this.onPayload(t),t.onclose=()=>this.onClose(),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(){this.socket=void 0,this.events.emit("close")}onPayload(t){if(void 0===t.data)return;const e="string"==typeof t.data?i.safeJsonParse(t.data):t.data;this.events.emit("payload",e)}}}).call(this,n(11))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(4),o=r.__importDefault(n(9));r.__exportStar(n(23),e),r.__exportStar(n(25),e),r.__exportStar(n(9),e),e.default=o.default},function(t,e,n){"use strict";(function(t){function n(){return(null==t?void 0:t.crypto)||(null==t?void 0:t.msCrypto)||{}}function r(){const t=n();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=n,e.getSubtleCrypto=r,e.isBrowserCryptoAvailable=function(){return!!n()&&!!r()}}).call(this,n(11))},function(t,e,n){"use strict";(function(t){function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function r(){return void 0!==t&&void 0!==t.versions&&void 0!==t.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=n,e.isNode=r,e.isBrowser=function(){return!n()&&!r()}}).call(this,n(29))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var c,a=[],f=!1,d=-1;function l(){f&&c&&(f=!1,c.length?a=c.concat(a):d=-1,a.length&&h())}function h(){if(!f){var t=u(l);f=!0;for(var e=a.length;e;){for(c=a,a=[];++d<e;)c&&c[d].run();d=-1,e=a.length}c=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new p(t,e)),1!==a.length||f||u(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){var n="undefined"!=typeof self?self:this,r=function(){function t(){this.fetch=!1,this.DOMException=n.DOMException}return t.prototype=n,new t}();!function(t){!function(e){var n="URLSearchParams"in t,r="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,s="ArrayBuffer"in t;if(s)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function a(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function f(t){return"string"!=typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function v(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||c(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var t,e,n,r=h(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=p(e),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=a(t),e=f(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},l.prototype.delete=function(t){delete this.map[a(t)]},l.prototype.get=function(t){return t=a(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(a(t))},l.prototype.set=function(t,e){this.map[a(t)]=f(e)},l.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),d(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),d(t)},r&&(l.prototype[Symbol.iterator]=l.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(t,e){var n,r,o=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),b.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function g(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}})),e}function R(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},m.call(_.prototype),m.call(R.prototype),R.prototype.clone=function(){return new R(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},R.error=function(){var t=new R(null,{status:0,statusText:""});return t.type="error",t};var w=[301,302,303,307,308];R.redirect=function(t,e){if(-1===w.indexOf(e))throw new RangeError("Invalid status code");return new R(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function E(t,n){return new Promise((function(r,i){var s=new _(t,n);if(s.signal&&s.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var t,e,n={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}})),e)};n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL");var o="response"in u?u.response:u.responseText;r(new R(o,n))},u.onerror=function(){i(new TypeError("Network request failed"))},u.ontimeout=function(){i(new TypeError("Network request failed"))},u.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},u.open(s.method,s.url,!0),"include"===s.credentials?u.withCredentials=!0:"omit"===s.credentials&&(u.withCredentials=!1),"responseType"in u&&o&&(u.responseType="blob"),s.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&s.signal.removeEventListener("abort",c)}),u.send(void 0===s._bodyInit?null:s._bodyInit)}))}E.polyfill=!0,t.fetch||(t.fetch=E,t.Headers=l,t.Request=_,t.Response=R),e.Headers=l,e.Request=_,e.Response=R,e.fetch=E,Object.defineProperty(e,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e},function(t,e,n){"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}])}));
{
"name": "@json-rpc-tools/provider",
"description": "Provider for JSON-RPC",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"author": "Pedro Gomes <github.com/pedrouid>",

@@ -39,4 +39,4 @@ "homepage": "https://github.com/pedrouid/json-rpc-tools/",

"dependencies": {
"@json-rpc-tools/utils": "^2.0.0-beta.1",
"axios": "^0.21.0",
"@json-rpc-tools/utils": "^2.0.0-beta.2",
"cross-fetch": "^3.1.4",
"safe-json-utils": "^1.1.1",

@@ -43,0 +43,0 @@ "ws": "^7.4.0"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc