long.swap.openex.network Open in urlscan Pro
2600:1f18:16e:df00::65  Public Scan

URL: https://long.swap.openex.network/_next/static/chunks/3597.c30fd460aba45c6d.js
Submission: On November 03 via api from US — Scanned from CA

Form analysis 0 forms found in the DOM

Text Content

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3597],{58481:function(t,n,e){"use strict";e.d(n,{k:function(){return a},Z:function(){return p}});var s=e(22699),r=e(96279),o=e.n(r),i=e(42325),c=e(55494);let u={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class a{constructor(t){if(this.url=t,this.events=new s.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,c.isHttpUrl)(t))throw 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,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(t,n){this.isAvailable||await this.register();try{let e=(0,i.u)(t),s=await o()(this.url,Object.assign(Object.assign({},u),{body:e})),r=await s.json();this.onPayload({data:r})}catch(c){this.onError(t.id,c)}}async register(t=this.url){if(!(0,c.isHttpUrl)(t))throw Error(`Provided URL is not compatible with HTTP connection: ${t}`);if(this.registering){let n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((t,n)=>{this.events.once("register_error",t=>{this.resetMaxListeners(),n(t)}),this.events.once("open",()=>{if(this.resetMaxListeners(),void 0===this.isAvailable)return n(Error("HTTP connection is missing or invalid"));t()})})}this.url=t,this.registering=!0;try{let e=(0,i.u)({id:1,jsonrpc:"2.0",method:"test",params:[]});await o()(t,Object.assign(Object.assign({},u),{body:e})),this.onOpen()}catch(r){let s=this.parseError(r);throw this.events.emit("register_error",s),this.onClose(),s}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(void 0===t.data)return;let n="string"==typeof t.data?(0,i.D)(t.data):t.data;this.events.emit("payload",n)}onError(t,n){let e=this.parseError(n),s=e.message||e.toString(),r=(0,c.formatJsonRpcError)(t,s);this.events.emit("payload",r)}parseError(t,n=this.url){return(0,c.parseConnectionError)(t,n,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}var p=a},23427:function(t,n,e){"use strict";e.d(n,{r:function(){return o}});var s=e(22699),r=e(55494);class o extends r.IJsonRpcProvider{constructor(t){super(t),this.events=new s.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async request(t,n){return this.requestStrict((0,r.formatJsonRpcRequest)(t.method,t.params||[]),n)}async requestStrict(t,n){return new Promise(async(e,s)=>{if(!this.connection.connected)try{await this.open()}catch(o){s(o)}this.events.on(`${t.id}`,t=>{(0,r.isJsonRpcError)(t)?s(t.error):e(t.result)});try{await this.connection.send(t,n)}catch(i){s(i)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),(0,r.isJsonRpcResponse)(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof t&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",()=>this.events.emit("disconnect")),this.connection.on("error",t=>this.events.emit("error",t)),this.hasRegisteredEventListeners=!0)}}},3664:function(t,n,e){"use strict";e.d(n,{IJsonRpcProvider:function(){return r.x0}});var s=e(90514);e.o(s,"IJsonRpcProvider")&&e.d(n,{IJsonRpcProvider:function(){return s.IJsonRpcProvider}}),e.o(s,"isHttpUrl")&&e.d(n,{isHttpUrl:function(){return s.isHttpUrl}}),e.o(s,"isJsonRpcError")&&e.d(n,{isJsonRpcError:function(){return s.isJsonRpcError}}),e.o(s,"isJsonRpcRequest")&&e.d(n,{isJsonRpcRequest:function(){return s.isJsonRpcRequest}}),e.o(s,"isJsonRpcResponse")&&e.d(n,{isJsonRpcResponse:function(){return s.isJsonRpcResponse}}),e.o(s,"isJsonRpcResult")&&e.d(n,{isJsonRpcResult:function(){return s.isJsonRpcResult}}),e.o(s,"isLocalhostUrl")&&e.d(n,{isLocalhostUrl:function(){return s.isLocalhostUrl}}),e.o(s,"isReactNative")&&e.d(n,{isReactNative:function(){return s.isReactNative}}),e.o(s,"isWsUrl")&&e.d(n,{isWsUrl:function(){return s.isWsUrl}});var r=e(20479),o=e(48711);e.o(o,"isHttpUrl")&&e.d(n,{isHttpUrl:function(){return o.isHttpUrl}}),e.o(o,"isJsonRpcError")&&e.d(n,{isJsonRpcError:function(){return o.isJsonRpcError}}),e.o(o,"isJsonRpcRequest")&&e.d(n,{isJsonRpcRequest:function(){return o.isJsonRpcRequest}}),e.o(o,"isJsonRpcResponse")&&e.d(n,{isJsonRpcResponse:function(){return o.isJsonRpcResponse}}),e.o(o,"isJsonRpcResult")&&e.d(n,{isJsonRpcResult:function(){return o.isJsonRpcResult}}),e.o(o,"isLocalhostUrl")&&e.d(n,{isLocalhostUrl:function(){return o.isLocalhostUrl}}),e.o(o,"isReactNative")&&e.d(n,{isReactNative:function(){return o.isReactNative}}),e.o(o,"isWsUrl")&&e.d(n,{isWsUrl:function(){return o.isWsUrl}})},90514:function(){},20479:function(t,n,e){"use strict";e.d(n,{x0:function(){return o}});class s{}class r extends s{constructor(){super()}}class o extends r{constructor(t){super()}}},48711:function(){},16392:function(t,n,e){"use strict";e.d(n,{CA:function(){return r},JV:function(){return c},O4:function(){return s},dQ:function(){return o},xK:function(){return i}});let s="INTERNAL_ERROR",r="SERVER_ERROR",o=[-32700,-32600,-32601,-32602,-32603],i={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[s]:{code:-32603,message:"Internal error"},[r]:{code:-32e3,message:"Server error"}},c=r},36786:function(t,n,e){"use strict";var s=e(36464);e.o(s,"IJsonRpcProvider")&&e.d(n,{IJsonRpcProvider:function(){return s.IJsonRpcProvider}}),e.o(s,"formatJsonRpcError")&&e.d(n,{formatJsonRpcError:function(){return s.formatJsonRpcError}}),e.o(s,"formatJsonRpcRequest")&&e.d(n,{formatJsonRpcRequest:function(){return s.formatJsonRpcRequest}}),e.o(s,"formatJsonRpcResult")&&e.d(n,{formatJsonRpcResult:function(){return s.formatJsonRpcResult}}),e.o(s,"isHttpUrl")&&e.d(n,{isHttpUrl:function(){return s.isHttpUrl}}),e.o(s,"isJsonRpcError")&&e.d(n,{isJsonRpcError:function(){return s.isJsonRpcError}}),e.o(s,"isJsonRpcRequest")&&e.d(n,{isJsonRpcRequest:function(){return s.isJsonRpcRequest}}),e.o(s,"isJsonRpcResponse")&&e.d(n,{isJsonRpcResponse:function(){return s.isJsonRpcResponse}}),e.o(s,"isJsonRpcResult")&&e.d(n,{isJsonRpcResult:function(){return s.isJsonRpcResult}}),e.o(s,"isLocalhostUrl")&&e.d(n,{isLocalhostUrl:function(){return s.isLocalhostUrl}}),e.o(s,"isReactNative")&&e.d(n,{isReactNative:function(){return s.isReactNative}}),e.o(s,"isWsUrl")&&e.d(n,{isWsUrl:function(){return s.isWsUrl}})},38588:function(t,n,e){"use strict";e.d(n,{CX:function(){return c},L2:function(){return i},by:function(){return o},i5:function(){return r}});var s=e(16392);function r(t){return s.dQ.includes(t)}function o(t){return Object.keys(s.xK).includes(t)?s.xK[t]:s.xK[s.JV]}function i(t){let n=Object.values(s.xK).find(n=>n.code===t);return n||s.xK[s.JV]}function c(t,n,e){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${e} RPC url at ${n}`):t}},47234:function(t,n,e){"use strict";e.d(n,{RI:function(){return c},sT:function(){return o},tm:function(){return i}});var s=e(38588),r=e(16392);function o(t,n,e){return{id:e||function(){let t=1e3*Date.now();return t+Math.floor(1e3*Math.random())}(),jsonrpc:"2.0",method:t,params:n}}function i(t,n){return{id:t,jsonrpc:"2.0",result:n}}function c(t,n,e){var o;return{id:t,jsonrpc:"2.0",error:void 0===(o=n)?(0,s.by)(r.O4):("string"==typeof o&&(o=Object.assign(Object.assign({},(0,s.by)(r.CA)),{message:o})),void 0!==e&&(o.data=e),(0,s.i5)(o.code)&&(o=(0,s.L2)(o.code)),o)}}},55494:function(t,n,e){"use strict";e.d(n,{formatJsonRpcError:function(){return o.RI},formatJsonRpcRequest:function(){return o.sT},formatJsonRpcResult:function(){return o.tm},isHttpUrl:function(){return c.jK},isJsonRpcError:function(){return u.jg},isJsonRpcRequest:function(){return u.DW},isJsonRpcResponse:function(){return u.u},isJsonRpcResult:function(){return u.k4},isLocalhostUrl:function(){return c.JF},isWsUrl:function(){return c.UZ},parseConnectionError:function(){return s.CX}}),e(16392);var s=e(38588),r=e(36786);e.o(r,"IJsonRpcProvider")&&e.d(n,{IJsonRpcProvider:function(){return r.IJsonRpcProvider}}),e.o(r,"formatJsonRpcError")&&e.d(n,{formatJsonRpcError:function(){return r.formatJsonRpcError}}),e.o(r,"formatJsonRpcRequest")&&e.d(n,{formatJsonRpcRequest:function(){return r.formatJsonRpcRequest}}),e.o(r,"formatJsonRpcResult")&&e.d(n,{formatJsonRpcResult:function(){return r.formatJsonRpcResult}}),e.o(r,"isHttpUrl")&&e.d(n,{isHttpUrl:function(){return r.isHttpUrl}}),e.o(r,"isJsonRpcError")&&e.d(n,{isJsonRpcError:function(){return r.isJsonRpcError}}),e.o(r,"isJsonRpcRequest")&&e.d(n,{isJsonRpcRequest:function(){return r.isJsonRpcRequest}}),e.o(r,"isJsonRpcResponse")&&e.d(n,{isJsonRpcResponse:function(){return r.isJsonRpcResponse}}),e.o(r,"isJsonRpcResult")&&e.d(n,{isJsonRpcResult:function(){return r.isJsonRpcResult}}),e.o(r,"isLocalhostUrl")&&e.d(n,{isLocalhostUrl:function(){return r.isLocalhostUrl}}),e.o(r,"isReactNative")&&e.d(n,{isReactNative:function(){return r.isReactNative}}),e.o(r,"isWsUrl")&&e.d(n,{isWsUrl:function(){return r.isWsUrl}});var o=e(47234),i=e(42576);e.o(i,"IJsonRpcProvider")&&e.d(n,{IJsonRpcProvider:function(){return i.IJsonRpcProvider}}),e.o(i,"isHttpUrl")&&e.d(n,{isHttpUrl:function(){return i.isHttpUrl}}),e.o(i,"isJsonRpcError")&&e.d(n,{isJsonRpcError:function(){return i.isJsonRpcError}}),e.o(i,"isJsonRpcRequest")&&e.d(n,{isJsonRpcRequest:function(){return i.isJsonRpcRequest}}),e.o(i,"isJsonRpcResponse")&&e.d(n,{isJsonRpcResponse:function(){return i.isJsonRpcResponse}}),e.o(i,"isJsonRpcResult")&&e.d(n,{isJsonRpcResult:function(){return i.isJsonRpcResult}}),e.o(i,"isLocalhostUrl")&&e.d(n,{isLocalhostUrl:function(){return i.isLocalhostUrl}}),e.o(i,"isReactNative")&&e.d(n,{isReactNative:function(){return i.isReactNative}}),e.o(i,"isWsUrl")&&e.d(n,{isWsUrl:function(){return i.isWsUrl}});var c=e(43321),u=e(8270)},42576:function(t,n,e){"use strict";e.d(n,{IJsonRpcProvider:function(){return s.IJsonRpcProvider}});var s=e(3664);e.o(s,"isHttpUrl")&&e.d(n,{isHttpUrl:function(){return s.isHttpUrl}}),e.o(s,"isJsonRpcError")&&e.d(n,{isJsonRpcError:function(){return s.isJsonRpcError}}),e.o(s,"isJsonRpcRequest")&&e.d(n,{isJsonRpcRequest:function(){return s.isJsonRpcRequest}}),e.o(s,"isJsonRpcResponse")&&e.d(n,{isJsonRpcResponse:function(){return s.isJsonRpcResponse}}),e.o(s,"isJsonRpcResult")&&e.d(n,{isJsonRpcResult:function(){return s.isJsonRpcResult}}),e.o(s,"isLocalhostUrl")&&e.d(n,{isLocalhostUrl:function(){return s.isLocalhostUrl}}),e.o(s,"isReactNative")&&e.d(n,{isReactNative:function(){return s.isReactNative}}),e.o(s,"isWsUrl")&&e.d(n,{isWsUrl:function(){return s.isWsUrl}})},43321:function(t,n,e){"use strict";function s(t,n){let e=function(t){let n=t.match(RegExp(/^\w+:/,"gi"));if(n&&n.length)return n[0]}(t);return void 0!==e&&RegExp(n).test(e)}function r(t){return s(t,"^https?:")}function o(t){return s(t,"^wss?:")}function i(t){return RegExp("wss?://localhost(:d{2,5})?").test(t)}e.d(n,{JF:function(){return i},UZ:function(){return o},jK:function(){return r}})},8270:function(t,n,e){"use strict";function s(t){return"object"==typeof t&&"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function r(t){return s(t)&&"method"in t}function o(t){return s(t)&&(i(t)||c(t))}function i(t){return"result"in t}function c(t){return"error"in t}e.d(n,{DW:function(){return r},jg:function(){return c},k4:function(){return i},u:function(){return o}})},32484:function(t,n,e){"use strict";function s(){return(null===e.g||void 0===e.g?void 0:e.g.crypto)||(null===e.g||void 0===e.g?void 0:e.g.msCrypto)||{}}function r(){let t=s();return t.subtle||t.webkitSubtle}Object.defineProperty(n,"__esModule",{value:!0}),n.isBrowserCryptoAvailable=n.getSubtleCrypto=n.getBrowerCrypto=void 0,n.getBrowerCrypto=s,n.getSubtleCrypto=r,n.isBrowserCryptoAvailable=function(){return!!s()&&!!r()}},73314:function(t,n,e){"use strict";var s=e(34406);function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function o(){return void 0!==s&&void 0!==s.versions&&void 0!==s.versions.node}Object.defineProperty(n,"__esModule",{value:!0}),n.isBrowser=n.isNode=n.isReactNative=void 0,n.isReactNative=r,n.isNode=o,n.isBrowser=function(){return!r()&&!o()}},36464:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});let s=e(5163);s.__exportStar(e(32484),n),s.__exportStar(e(73314),n)},42325:function(t,n,e){"use strict";function s(t){if("string"!=typeof t)throw Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch(n){return t}}function r(t){return"string"==typeof t?t:JSON.stringify(t)}e.d(n,{D:function(){return s},u:function(){return r}})},15554:function(t){"use strict";var n="%[a-f0-9]{2}",e=RegExp("("+n+")|([^%]+?)","gi"),s=RegExp("("+n+")+","gi");t.exports=function(t){if("string"!=typeof t)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(n){return function(t){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=s.exec(t);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch(i){var o=function(t){try{return decodeURIComponent(t)}catch(r){for(var n=t.match(e)||[],s=1;s<n.length;s++)n=(t=(function t(n,e){try{return[decodeURIComponent(n.join(""))]}catch(s){}if(1===n.length)return n;e=e||1;var r=n.slice(0,e),o=n.slice(e);return Array.prototype.concat.call([],t(r),t(o))})(n,s).join("")).match(e)||[];return t}}(r[0]);o!==r[0]&&(n[r[0]]=o)}r=s.exec(t)}n["%C2"]="�";for(var c=Object.keys(n),u=0;u<c.length;u++){var a=c[u];t=t.replace(RegExp(a,"g"),n[a])}return t}(t)}}},15452:function(t){"use strict";t.exports=(t,n)=>{if(!("string"==typeof t&&"string"==typeof n))throw TypeError("Expected the arguments to be of type `string`");if(""===n)return[t];let e=t.indexOf(n);return -1===e?[t]:[t.slice(0,e),t.slice(e+n.length)]}},57785:function(t){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}}]);
//# sourceMappingURL=3597.c30fd460aba45c6d.js.map