@dodoex/wallet-web3 0.0.3-1 → 0.0.3-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/_commonjsHelpers-70de2c37.js +1 -0
  2. package/dist/bn-16003306.js +1 -0
  3. package/dist/cjs/_commonjsHelpers-66ecbaf8.cjs +1 -0
  4. package/dist/cjs/bn-1bd77809.cjs +1 -0
  5. package/dist/cjs/elliptic-174586a6.cjs +1 -0
  6. package/dist/cjs/hash-121fdd2c.cjs +1 -0
  7. package/dist/cjs/index-23606273.cjs +1 -0
  8. package/dist/cjs/index-33e57d81.cjs +1 -0
  9. package/dist/cjs/index-5976e357.cjs +1 -0
  10. package/dist/cjs/index-6d7369f7.cjs +1 -0
  11. package/dist/cjs/index-a32c3cfa.cjs +22 -0
  12. package/dist/cjs/index-e0e60b3b.cjs +3 -0
  13. package/dist/cjs/index-e948d9e4.cjs +19 -0
  14. package/dist/cjs/index-f7522058.cjs +1 -0
  15. package/dist/cjs/index.cjs +1 -1
  16. package/dist/cjs/inherits-6d52d55b.cjs +1 -0
  17. package/dist/cjs/interface-6a2093d7.cjs +1 -0
  18. package/dist/cjs/node-ponyfill-c08c51bf.cjs +1 -0
  19. package/dist/cjs/portis-cf05b1f4.cjs +1 -0
  20. package/dist/cjs/provider-de4ee5b7.cjs +1 -0
  21. package/dist/cjs/providers/connector/safeGnosis/adapter.d.ts +1 -6
  22. package/dist/cjs/sha256-21fccd26.cjs +1 -0
  23. package/dist/cjs/sha3-499f6bea.cjs +10 -0
  24. package/dist/cjs/uAuth-075fec28.cjs +1 -0
  25. package/dist/cjs/walletConnect-58449a61.cjs +1 -0
  26. package/dist/cjs/walletLink-e3b39e1b.cjs +1 -0
  27. package/dist/elliptic-1100204f.js +1 -0
  28. package/dist/hash-4b8ad136.js +1 -0
  29. package/dist/index-5c16deff.js +1 -0
  30. package/dist/index-632fbf92.js +1 -0
  31. package/dist/index-6cdefd52.js +22 -0
  32. package/dist/index-822c6d78.js +1 -0
  33. package/dist/index-83293e8e.js +2 -0
  34. package/dist/index-9547c0cf.js +1 -0
  35. package/dist/index-e3ab6de5.js +1 -0
  36. package/dist/index-ecbe3d8d.js +19 -0
  37. package/dist/index.js +1 -1
  38. package/dist/inherits-e2363129.js +1 -0
  39. package/dist/interface-36a3c8cf.js +1 -0
  40. package/dist/node-ponyfill-bda9b4f4.js +1 -0
  41. package/dist/portis-b3fee0d6.js +1 -0
  42. package/dist/provider-30d55a46.js +1 -0
  43. package/dist/providers/connector/safeGnosis/adapter.d.ts +1 -6
  44. package/dist/sha256-8f7b3565.js +1 -0
  45. package/dist/sha3-a5661517.js +9 -0
  46. package/dist/uAuth-343d653d.js +1 -0
  47. package/dist/walletConnect-ea07b187.js +1 -0
  48. package/dist/walletLink-39bc8bdc.js +1 -0
  49. package/package.json +8 -8
  50. package/dist/cjs/index-1d035f96.cjs +0 -1
  51. package/dist/cjs/index-20589cad.cjs +0 -1
  52. package/dist/cjs/index-3c0f322c.cjs +0 -1
  53. package/dist/cjs/index-57e7ce01.cjs +0 -1
  54. package/dist/cjs/index-5f524b54.cjs +0 -1
  55. package/dist/cjs/index-809d42db.cjs +0 -1
  56. package/dist/cjs/index-9726ade3.cjs +0 -1
  57. package/dist/cjs/index-a53895dd.cjs +0 -1
  58. package/dist/cjs/index-b3bae54d.cjs +0 -1
  59. package/dist/cjs/index-b787ad60.cjs +0 -1
  60. package/dist/cjs/index-bd507185.cjs +0 -1
  61. package/dist/cjs/index-e43297ee.cjs +0 -1
  62. package/dist/cjs/portis-0d0ed336.cjs +0 -1
  63. package/dist/cjs/portis-139a9e4d.cjs +0 -1
  64. package/dist/cjs/portis-19c00eba.cjs +0 -1
  65. package/dist/cjs/portis-2053ea4b.cjs +0 -1
  66. package/dist/cjs/provider-216c4ecc.cjs +0 -1
  67. package/dist/cjs/provider-664da1b0.cjs +0 -1
  68. package/dist/cjs/provider-9bce34ab.cjs +0 -1
  69. package/dist/cjs/provider-a9b8a548.cjs +0 -1
  70. package/dist/cjs/uAuth-218d5a4e.cjs +0 -1
  71. package/dist/cjs/uAuth-384147c3.cjs +0 -1
  72. package/dist/cjs/uAuth-5d059de5.cjs +0 -1
  73. package/dist/cjs/uAuth-b52b01e0.cjs +0 -1
  74. package/dist/cjs/walletConnect-02bcbc5c.cjs +0 -1
  75. package/dist/cjs/walletConnect-712b3724.cjs +0 -1
  76. package/dist/cjs/walletConnect-9a4bbbc8.cjs +0 -1
  77. package/dist/cjs/walletConnect-b6ac4960.cjs +0 -1
  78. package/dist/cjs/walletLink-2cd8be6e.cjs +0 -1
  79. package/dist/cjs/walletLink-349e1bf5.cjs +0 -1
  80. package/dist/cjs/walletLink-92f211ff.cjs +0 -1
  81. package/dist/cjs/walletLink-f4cbd510.cjs +0 -1
  82. package/dist/index-4025ab08.js +0 -1
  83. package/dist/index-5ced3e7a.js +0 -1
  84. package/dist/index-677159b8.js +0 -1
  85. package/dist/index-6b9ad9a8.js +0 -1
  86. package/dist/index-6f08dc42.js +0 -1
  87. package/dist/index-829e82f9.js +0 -1
  88. package/dist/index-853b673b.js +0 -1
  89. package/dist/index-8dfaf647.js +0 -1
  90. package/dist/index-be16dd4e.js +0 -1
  91. package/dist/index-be47cca9.js +0 -1
  92. package/dist/index-c7eb0cf4.js +0 -1
  93. package/dist/index-fa3d2d50.js +0 -1
  94. package/dist/portis-32658178.js +0 -1
  95. package/dist/portis-5cb50e65.js +0 -1
  96. package/dist/portis-db858db8.js +0 -1
  97. package/dist/portis-fbb3c228.js +0 -1
  98. package/dist/provider-3fe99d2c.js +0 -1
  99. package/dist/provider-9ab2eb6e.js +0 -1
  100. package/dist/provider-e2314677.js +0 -1
  101. package/dist/provider-f7f5cb2b.js +0 -1
  102. package/dist/uAuth-64c3dda3.js +0 -1
  103. package/dist/uAuth-9f7c98e7.js +0 -1
  104. package/dist/uAuth-ddaae2b5.js +0 -1
  105. package/dist/uAuth-e4b5c839.js +0 -1
  106. package/dist/walletConnect-1a1a1062.js +0 -1
  107. package/dist/walletConnect-2b8f3354.js +0 -1
  108. package/dist/walletConnect-4c410280.js +0 -1
  109. package/dist/walletConnect-fb4a3e3c.js +0 -1
  110. package/dist/walletLink-5b9fdf98.js +0 -1
  111. package/dist/walletLink-98193680.js +0 -1
  112. package/dist/walletLink-986484a1.js +0 -1
  113. package/dist/walletLink-cf8da449.js +0 -1
@@ -0,0 +1 @@
1
+ import e from"stream";import t from"http";import r from"url";import{p as o}from"./interface-36a3c8cf.js";import n from"https";import s from"zlib";import{g as i}from"./_commonjsHelpers-70de2c37.js";var a={exports:{}};const u=e.Readable,c=Symbol("buffer"),l=Symbol("type");class f{constructor(){this[l]="";const e=arguments[0],t=arguments[1],r=[];let o=0;if(e){const t=e,n=Number(t.length);for(let e=0;e<n;e++){const n=t[e];let s;s=n instanceof Buffer?n:ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?Buffer.from(n):n instanceof f?n[c]:Buffer.from("string"==typeof n?n:String(n)),o+=s.length,r.push(s)}}this[c]=Buffer.concat(r);let n=t&&void 0!==t.type&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[l]=n)}get size(){return this[c].length}get type(){return this[l]}text(){return Promise.resolve(this[c].toString())}arrayBuffer(){const e=this[c],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new u;return e._read=function(){},e.push(this[c]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],r=arguments[1];let o,n;o=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),n=void 0===r?e:r<0?Math.max(e+r,0):Math.min(r,e);const s=Math.max(n-o,0),i=this[c].slice(o,o+s),a=new f([],{type:arguments[2]});return a[c]=i,a}}function d(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}let h;Object.defineProperties(f.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(f.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.name="FetchError";try{h=require("encoding").convert}catch(e){}const p=Symbol("Body internals"),m=e.PassThrough;function b(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.size;let s=void 0===n?0:n;var i=o.timeout;let a=void 0===i?0:i;null==t?t=null:g(t)?t=Buffer.from(t.toString()):w(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof e||(t=Buffer.from(String(t)))),this[p]={body:t,disturbed:!1,error:null},this.size=s,this.timeout=a,t instanceof e&&t.on("error",(function(e){const t="AbortError"===e.name?e:new d(`Invalid response body while trying to fetch ${r.url}: ${e.message}`,"system",e);r[p].error=t}))}function y(){var t=this;if(this[p].disturbed)return b.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[p].disturbed=!0,this[p].error)return b.Promise.reject(this[p].error);let r=this.body;if(null===r)return b.Promise.resolve(Buffer.alloc(0));if(w(r)&&(r=r.stream()),Buffer.isBuffer(r))return b.Promise.resolve(r);if(!(r instanceof e))return b.Promise.resolve(Buffer.alloc(0));let o=[],n=0,s=!1;return new b.Promise((function(e,i){let a;t.timeout&&(a=setTimeout((function(){s=!0,i(new d(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),r.on("error",(function(e){"AbortError"===e.name?(s=!0,i(e)):i(new d(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),r.on("data",(function(e){if(!s&&null!==e){if(t.size&&n+e.length>t.size)return s=!0,void i(new d(`content size at ${t.url} over limit: ${t.size}`,"max-size"));n+=e.length,o.push(e)}})),r.on("end",(function(){if(!s){clearTimeout(a);try{e(Buffer.concat(o,n))}catch(e){i(new d(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function g(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function w(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function v(t){let r,o,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof e&&"function"!=typeof n.getBoundary&&(r=new m,o=new m,n.pipe(r),n.pipe(o),t[p].body=r,n=o),n}function S(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":g(t)?"application/x-www-form-urlencoded;charset=UTF-8":w(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof e?null:"text/plain;charset=UTF-8"}function T(e){const t=e.body;return null===t?0:w(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}b.prototype={get body(){return this[p].body},get bodyUsed(){return this[p].disturbed},arrayBuffer(){return y.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return y.call(this).then((function(t){return Object.assign(new f([],{type:e.toLowerCase()}),{[c]:t})}))},json(){var e=this;return y.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return b.Promise.reject(new d(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return y.call(this).then((function(e){return e.toString()}))},buffer(){return y.call(this)},textConverted(){var e=this;return y.call(this).then((function(t){return function(e,t){if("function"!=typeof h)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let o,n,s="utf-8";r&&(o=/charset=([^;]*)/i.exec(r));n=e.slice(0,1024).toString(),!o&&n&&(o=/<meta.+?charset=(['"])(.+?)\1/i.exec(n));!o&&n&&(o=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),o||(o=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),o&&o.pop()),o&&(o=/charset=(.*)/i.exec(o.pop())));!o&&n&&(o=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n));o&&(s=o.pop(),"gb2312"!==s&&"gbk"!==s||(s="gb18030"));return h(e,"UTF-8",s).toString()}(t,e.headers)}))}},Object.defineProperties(b.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),b.mixIn=function(e){for(const t of Object.getOwnPropertyNames(b.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(b.prototype,t);Object.defineProperty(e,t,r)}},b.Promise=global.Promise;const j=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,O=/[^\t\x20-\x7e\x80-\xff]/;function x(e){if(e=`${e}`,j.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function E(e){if(e=`${e}`,O.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function P(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const B=Symbol("map");class ${constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[B]=Object.create(null),e instanceof $){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){x(e=`${e}`);const t=P(this[B],e);return void 0===t?null:this[B][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=L(this),o=0;for(;o<r.length;){var n=r[o];const s=n[0],i=n[1];e.call(t,i,s,this),r=L(this),o++}}set(e,t){t=`${t}`,x(e=`${e}`),E(t);const r=P(this[B],e);this[B][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,x(e=`${e}`),E(t);const r=P(this[B],e);void 0!==r?this[B][r].push(t):this[B][e]=[t]}has(e){return x(e=`${e}`),void 0!==P(this[B],e)}delete(e){x(e=`${e}`);const t=P(this[B],e);void 0!==t&&delete this[B][t]}raw(){return this[B]}keys(){return C(this,"key")}values(){return C(this,"value")}[Symbol.iterator](){return C(this,"key+value")}}function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[B]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[B][t].join(", ")}:function(t){return[t.toLowerCase(),e[B][t].join(", ")]})}$.prototype.entries=$.prototype[Symbol.iterator],Object.defineProperty($.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties($.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const R=Symbol("internal");function C(e,t){const r=Object.create(z);return r[R]={target:e,kind:t,index:0},r}const z=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==z)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[R];const t=e.target,r=e.kind,o=e.index,n=L(t,r);return o>=n.length?{value:void 0,done:!0}:(this[R].index=o+1,{value:n[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function A(e){const t=Object.assign({__proto__:null},e[B]),r=P(e[B],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(z,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const k=Symbol("Response internals"),U=t.STATUS_CODES;class _{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b.call(this,e,t);const r=t.status||200,o=new $(t.headers);if(null!=e&&!o.has("Content-Type")){const t=S(e);t&&o.append("Content-Type",t)}this[k]={url:t.url,status:r,statusText:t.statusText||U[r],headers:o,counter:t.counter}}get url(){return this[k].url||""}get status(){return this[k].status}get ok(){return this[k].status>=200&&this[k].status<300}get redirected(){return this[k].counter>0}get statusText(){return this[k].statusText}get headers(){return this[k].headers}clone(){return new _(v(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}b.mixIn(_.prototype),Object.defineProperties(_.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(_.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const H=Symbol("Request internals"),q=r.URL||o.URL,F=r.parse,I=r.format;function D(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new q(e).toString()),F(e)}const M="destroy"in e.Readable.prototype;function G(e){return"object"==typeof e&&"object"==typeof e[H]}class N{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};G(e)?t=D(e.url):(t=e&&e.href?D(e.href):D(`${e}`),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||G(e)&&null!==e.body)&&("GET"===o||"HEAD"===o))throw new TypeError("Request with GET/HEAD method cannot have body");let n=null!=r.body?r.body:G(e)&&null!==e.body?v(e):null;b.call(this,n,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const s=new $(r.headers||e.headers||{});if(null!=n&&!s.has("Content-Type")){const e=S(n);e&&s.append("Content-Type",e)}let i=G(e)?e.signal:null;if("signal"in r&&(i=r.signal),null!=i&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(i))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[H]={method:o,redirect:r.redirect||e.redirect||"follow",headers:s,parsedURL:t,signal:i},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[H].method}get url(){return I(this[H].parsedURL)}get headers(){return this[H].headers}get redirect(){return this[H].redirect}get signal(){return this[H].signal}clone(){return new N(this)}}function Z(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}b.mixIn(N.prototype),Object.defineProperty(N.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(N.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),Z.prototype=Object.create(Error.prototype),Z.prototype.constructor=Z,Z.prototype.name="AbortError";const V=r.URL||o.URL,K=e.PassThrough;function Y(r,o){if(!Y.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return b.Promise=Y.Promise,new Y.Promise((function(i,a){const u=new N(r,o),c=function(t){const r=t[H].parsedURL,o=new $(t[H].headers);if(o.has("Accept")||o.set("Accept","*/*"),!r.protocol||!r.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(r.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof e.Readable&&!M)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),null!=t.body){const e=T(t);"number"==typeof e&&(n=String(e))}n&&o.set("Content-Length",n),o.has("User-Agent")||o.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!o.has("Accept-Encoding")&&o.set("Accept-Encoding","gzip,deflate");let s=t.agent;return"function"==typeof s&&(s=s(r)),o.has("Connection")||s||o.set("Connection","close"),Object.assign({},r,{method:t.method,headers:A(o),agent:s})}(u),l=("https:"===c.protocol?n:t).request,f=u.signal;let h=null;const p=function(){let t=new Z("The user aborted a request.");a(t),u.body&&u.body instanceof e.Readable&&u.body.destroy(t),h&&h.body&&h.body.emit("error",t)};if(f&&f.aborted)return void p();const m=function(){p(),g()},b=l(c);let y;function g(){b.abort(),f&&f.removeEventListener("abort",m),clearTimeout(y)}f&&f.addEventListener("abort",m),u.timeout&&b.once("socket",(function(e){y=setTimeout((function(){a(new d(`network timeout at: ${u.url}`,"request-timeout")),g()}),u.timeout)})),b.on("error",(function(e){a(new d(`request to ${u.url} failed, reason: ${e.message}`,"system",e)),g()})),b.on("response",(function(e){clearTimeout(y);const t=function(e){const t=new $;for(const r of Object.keys(e))if(!j.test(r))if(Array.isArray(e[r]))for(const o of e[r])O.test(o)||(void 0===t[B][r]?t[B][r]=[o]:t[B][r].push(o));else O.test(e[r])||(t[B][r]=[e[r]]);return t}(e.headers);if(Y.isRedirect(e.statusCode)){const r=t.get("Location");let o=null;try{o=null===r?null:new V(r,u.url).toString()}catch(e){if("manual"!==u.redirect)return a(new d(`uri requested responds with an invalid redirect URL: ${r}`,"invalid-redirect")),void g()}switch(u.redirect){case"error":return a(new d(`uri requested responds with a redirect, redirect mode is set to error: ${u.url}`,"no-redirect")),void g();case"manual":if(null!==o)try{t.set("Location",o)}catch(e){a(e)}break;case"follow":if(null===o)break;if(u.counter>=u.follow)return a(new d(`maximum redirect reached at: ${u.url}`,"max-redirect")),void g();const r={headers:new $(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout,size:u.size};if(!function(e,t){const r=new V(t).hostname,o=new V(e).hostname;return r===o||"."===r[r.length-o.length-1]&&r.endsWith(o)}(u.url,o))for(const e of["authorization","www-authenticate","cookie","cookie2"])r.headers.delete(e);return 303!==e.statusCode&&u.body&&null===T(u)?(a(new d("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void g()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==u.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),i(Y(new N(o,r))),void g())}}e.once("end",(function(){f&&f.removeEventListener("abort",m)}));let r=e.pipe(new K);const o={url:u.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:u.size,timeout:u.timeout,counter:u.counter},n=t.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===n||204===e.statusCode||304===e.statusCode)return h=new _(r,o),void i(h);const c={flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH};if("gzip"==n||"x-gzip"==n)return r=r.pipe(s.createGunzip(c)),h=new _(r,o),void i(h);if("deflate"!=n&&"x-deflate"!=n){if("br"==n&&"function"==typeof s.createBrotliDecompress)return r=r.pipe(s.createBrotliDecompress()),h=new _(r,o),void i(h);h=new _(r,o),i(h)}else{e.pipe(new K).once("data",(function(e){r=8==(15&e[0])?r.pipe(s.createInflate()):r.pipe(s.createInflateRaw()),h=new _(r,o),i(h)}))}})),function(e,t){const r=t.body;null===r?e.end():w(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(b,u)}))}Y.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Y.Promise=global.Promise;var J=i(Object.freeze({__proto__:null,default:Y,Headers:$,Request:N,Response:_,FetchError:d}));!function(e,t){const r=J,o=r.default||r,n=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),o.call(this,e,t)};n.ponyfill=!0,e.exports=t=n,t.fetch=n,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,t.default=n}(a,a.exports);export{a as n};
@@ -0,0 +1 @@
1
+ import{_ as e,a as t,d as n}from"./index-ecbe3d8d.js";import"@ethersproject/providers";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/address";import"valtio";function i(e,t){var n="string"==typeof e?Object.assign({},r[e]):e;if("object"!=typeof n)throw new Error("[Portis] illegal 'network' parameter. Read more about it here: https://docs.portis.io/#/configuration?id=network");if(!n.nodeUrl)throw new Error("[Portis] 'nodeUrl' is required. Read more about it here: https://docs.portis.io/#/configuration?id=network");if(t&&!n.gasRelayHubAddress)throw new Error("[Portis] can't find default gas relay hub for "+e);return"string"!=typeof e||t||delete n.gasRelayHubAddress,n}var r={mainnet:{nodeUrl:"https://mainnet.infura.io/v3/faa4639b090f46499f29d894da0551a0",chainId:"1",gasRelayHubAddress:"0xD216153c06E857cD7f72665E0aF1d7D82172F494"},ropsten:{nodeUrl:"https://ropsten.infura.io/v3/faa4639b090f46499f29d894da0551a0",chainId:"3",gasRelayHubAddress:"0xD216153c06E857cD7f72665E0aF1d7D82172F494"},rinkeby:{nodeUrl:"https://rinkeby.infura.io/v3/faa4639b090f46499f29d894da0551a0",chainId:"4",gasRelayHubAddress:"0xD216153c06E857cD7f72665E0aF1d7D82172F494"},goerli:{nodeUrl:"https://goerli.infura.io/v3/faa4639b090f46499f29d894da0551a0",chainId:"5"},ubiq:{nodeUrl:"https://rpc1.ubiqscan.io",chainId:"8"},thundercoreTestnet:{nodeUrl:"https://testnet-rpc.thundercore.com:8544",chainId:"18"},orchid:{nodeUrl:"https://public-node.rsk.co",chainId:"30"},orchidTestnet:{nodeUrl:"https://public-node.testnet.rsk.co",chainId:"31"},kovan:{nodeUrl:"https://kovan.infura.io/v3/faa4639b090f46499f29d894da0551a0",chainId:"42",gasRelayHubAddress:"0xD216153c06E857cD7f72665E0aF1d7D82172F494"},classic:{nodeUrl:"https://ethereumclassic.network",chainId:"61"},sokol:{nodeUrl:"https://sokol.poa.network",chainId:"77"},core:{nodeUrl:"https://core.poa.network",chainId:"99"},xdai:{nodeUrl:"https://dai.poa.network",chainId:"100",gasRelayHubAddress:"0xD216153c06E857cD7f72665E0aF1d7D82172F494"},thundercore:{nodeUrl:"https://mainnet-rpc.thundercore.com",chainId:"108"},fuse:{nodeUrl:"https://rpc.fusenet.io",chainId:"122"},lightstreams:{nodeUrl:"https://node.mainnet.lightstreams.io",chainId:"163"},matic:{nodeUrl:"https://polygon-rpc.com",chainId:"137"},maticMumbai:{nodeUrl:"https://rpc-mumbai.matic.today",chainId:"80001"},maticAlpha:{nodeUrl:"https://alpha.ethereum.matic.network",chainId:"4626"},maticTestnet:{nodeUrl:"https://testnet2.matic.network",chainId:"8995"}},o=function(){return!("undefined"==typeof window||!window.document)},a=!1;function s(){return new Promise((function(e,t){o()?a?e():["loaded","interactive","complete"].indexOf(document.readyState)>-1?(a=!0,e()):window.addEventListener("load",(function(){a=!0,e()}),!1):t()}))}function c(){var e="localhost"===location.hostname||"127.0.0.1"===location.hostname,t="https:"===location.protocol;if(!(e||t))throw"[Portis] Access to the WebCrypto API is restricted to secure origins.\nIf this is a development environment please use http://localhost:"+location.port+" instead.\nOtherwise, please use an SSL certificate."}var u={};Object.defineProperty(u,"__esModule",{value:!0});var d=u.default=u.ERR_NOT_IN_IFRAME=u.ERR_CONNECTION_TIMEOUT=u.ERR_CONNECTION_DESTROYED=void 0,l="handshake",h="handshake-reply",f="call",g="reply",p="fulfilled",m="rejected",v="message",w="ConnectionDestroyed";u.ERR_CONNECTION_DESTROYED=w;var b="ConnectionTimeout";u.ERR_CONNECTION_TIMEOUT=b;var y="NotInIframe";u.ERR_NOT_IN_IFRAME=y;var _,E={"http:":"80","https:":"443"},C=/^(https?:)?\/\/([^/:]+)(:(\d+))?/,k={ERR_CONNECTION_DESTROYED:w,ERR_CONNECTION_TIMEOUT:b,ERR_NOT_IN_IFRAME:y,Promise:function(){try{return window?window.Promise:null}catch(e){return null}}(),debug:!1},P=(_=0,function(){return++_}),I=function(){if(k.debug){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];(e=console).log.apply(e,["[Penpal]"].concat(n))}},W=function(e){var t=[];return e((function(){t.forEach((function(e){e()}))})),{then:function(e){t.push(e)}}},x=function(e){return{name:e.name,message:e.message,stack:e.stack}},T=function(e,t,n,i){var r=t.localName,o=t.local,a=t.remote,s=t.remoteOrigin,c=!1;I("".concat(r,": Connecting call sender"));var u=function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(I("".concat(r,": Sending ").concat(e,"() call")),c){var u=new Error("Unable to send ".concat(e,"() call due ")+"to destroyed connection");throw u.code=w,u}return new k.Promise((function(t,i){var c=P();o.addEventListener(v,(function n(u){if(u.source===a&&u.origin===s&&u.data.penpal===g&&u.data.id===c){I("".concat(r,": Received ").concat(e,"() reply")),o.removeEventListener(v,n);var d=u.data.returnValue;u.data.returnValueIsError&&(l=d,h=new Error,Object.keys(l).forEach((function(e){return h[e]=l[e]})),d=h),(u.data.resolution===p?t:i)(d)}var l,h})),a.postMessage({penpal:f,id:c,methodName:e,args:n},s)}))}};i.then((function(){c=!0})),n.reduce((function(e,t){return e[t]=u(t),e}),e)},A=function(e,t,n){var i=e.localName,r=e.local,o=e.remote,a=e.remoteOrigin,s=!1;I("".concat(i,": Connecting call receiver"));var c=function(e){if(e.source===o&&e.origin===a&&e.data.penpal===f){var n=e.data,r=n.methodName,c=n.args,u=n.id;if(I("".concat(i,": Received ").concat(r,"() call")),r in t){var d=function(e){return function(t){if(I("".concat(i,": Sending ").concat(r,"() reply")),s)I("".concat(i,": Unable to send ").concat(r,"() reply due to destroyed connection"));else{var n={penpal:g,id:u,resolution:e,returnValue:t};e===m&&t instanceof Error&&(n.returnValue=x(t),n.returnValueIsError=!0);try{o.postMessage(n,a)}catch(e){throw"DataCloneError"===e.name&&o.postMessage({penpal:g,id:u,resolution:m,returnValue:x(e),returnValueIsError:!0},a),e}}}};new k.Promise((function(e){return e(t[r].apply(t,c))})).then(d(p),d(m))}}};r.addEventListener(v,c),n.then((function(){s=!0,r.removeEventListener(v,c)}))};k.connectToChild=function(e){var t,n=e.url,i=e.appendTo,r=e.methods,o=void 0===r?{}:r,a=e.timeout,s=new W((function(e){t=e})),c=window,u=document.createElement("iframe");(i||document.body).appendChild(u),s.then((function(){u.parentNode&&u.parentNode.removeChild(u)}));var d=u.contentWindow||u.contentDocument.parentWindow,f=function(e){var t,n,i,r=document.location,o=C.exec(e);o?(t=o[1]?o[1]:r.protocol,n=o[2],i=o[4]):(t=r.protocol,n=r.hostname,i=r.port);var a=i&&i!==E[t]?":".concat(i):"";return"".concat(t,"//").concat(n).concat(a)}(n);return{promise:new k.Promise((function(e,i){var r;void 0!==a&&(r=setTimeout((function(){var e=new Error("Connection to child timed out after ".concat(a,"ms"));e.code=b,i(e),t()}),a));var g,p,m={},y=function(t){if(t.source===d&&t.origin===f&&t.data.penpal===l){I("Parent: Received handshake, sending reply"),t.source.postMessage({penpal:h,methodNames:Object.keys(o)},t.origin);var n={localName:"Parent",local:c,remote:d,remoteOrigin:t.origin};p&&p();var i=new W((function(e){s.then(e),p=e}));A(n,o,i),g&&g.forEach((function(e){delete m[e]})),g=t.data.methodNames,T(m,n,g,s),clearTimeout(r),e(m)}};c.addEventListener(v,y),s.then((function(){c.removeEventListener(v,y);var e=new Error("Connection destroyed");e.code=w,i(e)})),I("Parent: Loading iframe"),u.src=n})),iframe:u,destroy:t}},k.connectToParent=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.parentOrigin,i=void 0===n?"*":n,r=t.methods,o=void 0===r?{}:r,a=t.timeout;if(window===window.top){var s=new Error("connectToParent() must be called within an iframe");throw s.code=y,s}var c=new W((function(t){e=t})),u=window,d=u.parent,f=new k.Promise((function(t,n){var r;void 0!==a&&(r=setTimeout((function(){var t=new Error("Connection to parent timed out after ".concat(a,"ms"));t.code=b,n(t),e()}),a));var s=function e(n){if(("*"===i||i===n.origin)&&n.source===d&&n.data.penpal===h){I("Child: Received handshake reply"),u.removeEventListener(v,e);var a={localName:"Child",local:u,remote:d,remoteOrigin:n.origin},s={};A(a,o,c),T(s,a,n.data.methodNames,c),clearTimeout(r),t(s)}};u.addEventListener(v,s),c.then((function(){u.removeEventListener(v,s);var e=new Error("Connection destroyed");e.code=w,n(e)})),I("Child: Sending handshake"),d.postMessage({penpal:l,methodNames:Object.keys(o)},i)}));return{promise:f,destroy:e}};var O=k;d=u.default=O;var M=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))},N=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},L=process.env.PORTIS_WIDGET_URL||"https://widget.portis.io",R="por_portis-widget-frame",S="por_portis-container";var D=function(){function e(t,n){this._widgetConfig=t,this._clearProviderSession=n,this._widgetUrl=L,this._onLoginCallback=function(){},this._onLogoutCallback=function(){},this._onErrorCallback=function(){},c(),t.staging?(console.warn("Please note: you are using the Portis STAGING environment."),this._widgetUrl="https://widget-staging.portis.io"):t.feature&&(console.warn("Please note: you are using the Portis FEATURE environment."),this._widgetUrl="https://widget-feature.portis.io"),e._checkIfWidgetAlreadyInitialized()}return e.prototype.getWidget=function(){return M(this,void 0,void 0,(function(){var e;return N(this,(function(t){switch(t.label){case 0:return this.widgetInstance?[3,2]:(this.widgetPromise||(this.widgetPromise=this._initWidget()),e=this,[4,this.widgetPromise]);case 1:e.widgetInstance=t.sent(),t.label=2;case 2:return[2,this.widgetInstance]}}))}))},e.prototype.setDefaultEmail=function(e){this._widgetConfig.defaultEmail=e},e.prototype.setOnLoginCallback=function(e){this._onLoginCallback=e},e.prototype.setOnLogoutCallback=function(e){this._onLogoutCallback=e},e.prototype.setOnActiveWalletChangedCallback=function(e){this._onActiveWalletChangedCallback=e},e.prototype.setOnErrorCallback=function(e){this._onErrorCallback=e},e.prototype.showPortis=function(){return M(this,void 0,void 0,(function(){return N(this,(function(e){switch(e.label){case 0:return[4,this.getWidget()];case 1:return[2,e.sent().communication.showPortis(this._widgetConfig)]}}))}))},e.prototype.getCampaignInfo=function(e){return M(this,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return[4,this.getWidget()];case 1:return[2,t.sent().communication.getCampaignInfo(e)]}}))}))},e.prototype.claimVoucher=function(e){return M(this,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return[4,this.getWidget()];case 1:return[2,t.sent().communication.claimVoucher(e,this._widgetConfig)]}}))}))},e.prototype.logout=function(){return M(this,void 0,void 0,(function(){return N(this,(function(e){switch(e.label){case 0:return[4,this.getWidget()];case 1:return[2,e.sent().communication.logout()]}}))}))},e.prototype.getExtendedPublicKey=function(e,t){return void 0===e&&(e="m/44'/60'/0'/0/0"),void 0===t&&(t="Ethereum"),M(this,void 0,void 0,(function(){return N(this,(function(n){switch(n.label){case 0:return[4,this.getWidget()];case 1:return[2,n.sent().communication.getExtendedPublicKey(e,t,this._widgetConfig)]}}))}))},e.prototype.importWallet=function(e){return M(this,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return[4,this.getWidget()];case 1:return[2,t.sent().communication.importWallet(e,this._widgetConfig)]}}))}))},e.prototype.isLoggedIn=function(){return M(this,void 0,void 0,(function(){return N(this,(function(e){switch(e.label){case 0:return[4,this.getWidget()];case 1:return[2,e.sent().communication.isLoggedIn()]}}))}))},e.prototype.signBitcoinTransaction=function(e){return M(this,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return[4,this.getWidget()];case 1:return[2,t.sent().communication.signBitcoinTransaction(e,this._widgetConfig)]}}))}))},e.prototype.showBitcoinWallet=function(e){return void 0===e&&(e="m/49'/0'/0'/0/0"),M(this,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return[4,this.getWidget()];case 1:return[2,t.sent().communication.showBitcoinWallet(e,this._widgetConfig)]}}))}))},e.prototype.purchaseERC20=function(e){return M(this,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return[4,this.getWidget()];case 1:return[2,t.sent().communication.purchaseERC20(e,this._widgetConfig)]}}))}))},e._checkIfWidgetAlreadyInitialized=function(){document.getElementsByClassName(S).length&&console.warn("An instance of Portis was already initialized. This is probably a mistake. Make sure that you use the same Portis instance throughout your app.")},e.prototype._initWidget=function(){return M(this,void 0,void 0,(function(){var t,n,i,r,o;return N(this,(function(a){switch(a.label){case 0:return[4,s()];case 1:return a.sent(),(t=document.createElement("style")).innerHTML="\n.por_portis-container {\n position: fixed;\n width: 0px;\n height: 0px;\n top: 0px;\n right: 0px;\n z-index: 2147483647;\n}\n\n@media (max-width: 576px) {\n .por_portis-container {\n bottom: 0;\n top: auto;\n }\n}\n\n.por_portis-widget-frame {\n position: fixed;\n width: 375px;\n height: 0;\n top: 20px;\n right: 20px;\n box-shadow: 0 5px 40px rgba(0,0,0,.16);\n border-radius: 8px;\n overflow: hidden;\n z-index: 2147483000;\n}\n\n@media (max-width: 576px) {\n .por_portis-widget-frame {\n bottom: 0;\n top: auto;\n width: 100%;\n right: 0;\n left: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n}\n",(n=document.createElement("div")).className=S,(i=document.createElement("div")).id="portis-container-"+Date.now(),i.className=R,n.appendChild(i),document.body.appendChild(n),document.head.appendChild(t),[4,(r=d.connectToChild({url:this._widgetUrl,appendTo:document.getElementById(i.id),methods:{setHeight:this._setHeight.bind(this),getWindowSize:e._getWindowSize.bind(this),onLogin:this._onLogin.bind(this),onLogout:this._onLogout.bind(this),onActiveWalletChanged:this._onActiveWalletChanged.bind(this),hasOnActiveWalletChanged:this.hasOnActiveWalletChanged.bind(this),onError:this._onError.bind(this)}})).promise];case 2:return(o=a.sent()).setSdkConfig(this._widgetConfig),r.iframe.style.position="absolute",r.iframe.style.height="100%",r.iframe.style.width="100%",r.iframe.style.border="0 transparent",[2,{communication:o,widgetFrame:i}]}}))}))},e.prototype._setHeight=function(e){return M(this,void 0,void 0,(function(){return N(this,(function(t){switch(t.label){case 0:return[4,this.getWidget()];case 1:return t.sent().widgetFrame.style.height=e+"px",[2]}}))}))},e._getWindowSize=function(){var e=document.getElementsByTagName("body")[0];return{width:window.innerWidth||document.documentElement.clientWidth||e.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||e.clientHeight}},e.prototype._onLogin=function(e,t,n){this._onLoginCallback&&this._onLoginCallback(e,t,n)},e.prototype._onLogout=function(){this._clearProviderSession(),this._onLogoutCallback&&this._onLogoutCallback()},e.prototype._onActiveWalletChanged=function(e){this._onActiveWalletChangedCallback&&this._onActiveWalletChangedCallback(e)},e.prototype.hasOnActiveWalletChanged=function(){return!!this._onActiveWalletChangedCallback},e.prototype._onError=function(e){this._onErrorCallback&&this._onErrorCallback(e)},e}(),U=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))},j=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},B=require("ethereumjs-util"),F=B.addHexPrefix,G=B.stripHexPrefix,V=B.BN,H="0x5208";function q(e,t){return U(this,void 0,void 0,(function(){var n,i,r,o,a;return j(this,(function(s){switch(s.label){case 0:return[4,e.getBlockByNumber("latest",!1)];case 1:return n=s.sent(),[4,z(e,t,n.gasLimit)];case 2:if(i=s.sent(),r=i.safeGas,o=i.simpleSend,a=i.gasLimitSpecified,o||a)return[2,r];s.label=3;case 3:return s.trys.push([3,5,,6]),[4,K(e,t,n.gasLimit,r)];case 4:return[2,s.sent()];case 5:return s.sent(),[2,r];case 6:return[2]}}))}))}function z(e,t,n){return U(this,void 0,void 0,(function(){var i,r,o;return j(this,(function(a){switch(a.label){case 0:return Boolean(t.gas)?[2,{safeGas:t.gas,simpleSend:!1,gasLimitSpecified:!0}]:(i=t.to,Boolean(i)?[4,e.getCode(i)]:[3,2]);case 1:if(r=a.sent(),!r||"0x"===r||"0x0"===r){if(t.data)throw new Error("Trying to call a function on a non-contract address");return[2,{safeGas:H,simpleSend:!0,gasLimitSpecified:!1}]}a.label=2;case 2:return o=J(n),s=o,c=20,u=new V(19),d=new V(c),[2,{safeGas:Q(s.mul(u).div(d)),simpleSend:!1,gasLimitSpecified:!1}]}var s,c,u,d}))}))}function K(e,t,n,i){return U(this,void 0,void 0,(function(){var r;return j(this,(function(o){switch(o.label){case 0:return t.gas=i,r=F,[4,e.estimateGas(t)];case 1:return[2,Y(r.apply(void 0,[o.sent()]),n)]}}))}))}function Y(e,t){var n=J(e),i=J(t).muln(.9),r=n.muln(1.5);return n.gt(i)?Q(n):r.lt(i)?Q(r):Q(i)}function J(e){return new V(G(e),16)}function Q(e){return F(e.toString(16))}var X=function(){function e(e){this.provider=e}return e.prototype.getBlockByNumber=function(e,t){return this.sendAsync("eth_getBlockByNumber",e,t)},e.prototype.getCode=function(e,t){return void 0===t&&(t="latest"),this.sendAsync("eth_getCode",e,t)},e.prototype.estimateGas=function(e){return this.sendAsync("eth_estimateGas",e)},e.prototype.sendAsync=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return new Promise((function(i,r){t.provider.sendAsync({id:42,jsonrpc:"2.0",method:e,params:n},(function(e,t){e?r(e):i(t.result)}))}))},e}(),Z=function(){return Z=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Z.apply(this,arguments)},$=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))},ee=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},te=require("web3-provider-engine"),ne=require("web3-provider-engine/dist/es5/subproviders/cache.js"),ie=require("web3-provider-engine/dist/es5/subproviders/fixture.js"),re=require("web3-provider-engine/dist/es5/subproviders/filters.js"),oe=require("web3-provider-engine/dist/es5/subproviders/hooked-wallet.js"),ae=require("web3-provider-engine/dist/es5/subproviders/nonce-tracker.js"),se=require("web3-provider-engine/dist/es5/subproviders/subscriptions.js"),ce=function(){function e(e,t){this.config=e,this._getWidgetCommunication=t,this.provider=this._initProvider()}return e.prototype.setSelectedAddress=function(e){this._selectedAddress=e},e.prototype.changeNetwork=function(e,t){var n=i(e,t);this.clearSubprovider(ae),this.clearSubprovider(ne),this.config.network=n},e.prototype._initProvider=function(){var e=this;if(this.engine)return this.engine;this.engine=new te;var t=new X(this.engine);return this.engine.send=function(t,n){if("string"==typeof t)return new Promise((function(i,r){e.engine.sendAsync({jsonrpc:"2.0",id:42,method:t,params:n||[]},(function(e,t){e?r(e):i(t.result)}))}));if(!n){var i=null;switch(t.method){case"eth_accounts":case"eth_coinbase":i=e._selectedAddress?[e._selectedAddress]:[];break;case"net_version":i=e._network;break;case"eth_uninstallFilter":e.engine.sendAsync(t,(function(e){return e})),i=!0;break;default:var r="The Portis Web3 object does not support synchronous methods like "+t.method+" without a callback parameter.";throw new Error(r)}return{id:t.id,jsonrpc:t.jsonrpc,result:i}}e.engine.sendAsync(t,n)},this.engine.addProvider(new ie({web3_clientVersion:"Portis/v"+this.config.version+"/javascript",net_listening:!0,eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0})),this.engine.addProvider(new ne),this.engine.addProvider(new se),this.engine.addProvider(new re),this.engine.addProvider(new ae),this.engine.addProvider({setEngine:function(e){return e},handleRequest:function(t,n){return $(e,void 0,void 0,(function(){return ee(this,(function(e){return t.id||(t.id=42),n(),[2]}))}))}}),this.engine.addProvider(new oe({getAccounts:function(t){return $(e,void 0,void 0,(function(){var e,n,i;return ee(this,(function(r){switch(r.label){case 0:return[4,this._getWidgetCommunication()];case 1:return[4,r.sent().getAccounts(this.config)];case 2:return e=r.sent(),n=e.error,i=e.result,!n&&i&&(this._selectedAddress=i[0]),t(n,i),[2]}}))}))},signTransaction:function(t,n){return $(e,void 0,void 0,(function(){var e,i,r;return ee(this,(function(o){switch(o.label){case 0:return[4,this._getWidgetCommunication()];case 1:return[4,o.sent().signTransaction(t,this.config)];case 2:return e=o.sent(),i=e.error,r=e.result,n(i,r),[2]}}))}))},signMessage:function(t,n){return $(e,void 0,void 0,(function(){var e,i,r,o,a;return ee(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Z({},t,{messageStandard:"signMessage"}),[4,e.signMessage(i,this.config)];case 2:return r=s.sent(),o=r.error,a=r.result,n(o,a),[2]}}))}))},signPersonalMessage:function(t,n){return $(e,void 0,void 0,(function(){var e,i,r,o,a;return ee(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Z({},t,{messageStandard:"signPersonalMessage"}),[4,e.signMessage(i,this.config)];case 2:return r=s.sent(),o=r.error,a=r.result,n(o,a),[2]}}))}))},signTypedMessage:function(t,n){return $(e,void 0,void 0,(function(){var e,i,r,o,a;return ee(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Z({},t,{messageStandard:"signTypedMessage"}),[4,e.signMessage(i,this.config)];case 2:return r=s.sent(),o=r.error,a=r.result,n(o,a),[2]}}))}))},signTypedMessageV3:function(t,n){return $(e,void 0,void 0,(function(){var e,i,r,o,a;return ee(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Z({},t,{messageStandard:"signTypedMessageV3"}),[4,e.signMessage(i,this.config)];case 2:return r=s.sent(),o=r.error,a=r.result,n(o,a),[2]}}))}))},estimateGas:function(n,i){return $(e,void 0,void 0,(function(){var e;return ee(this,(function(r){switch(r.label){case 0:return[4,q(t,n)];case 1:return e=r.sent(),i(null,e),[2]}}))}))},getGasPrice:function(t){return $(e,void 0,void 0,(function(){return ee(this,(function(e){return t(null,""),[2]}))}))}})),this.engine.addProvider({setEngine:function(e){return e},handleRequest:function(t,n,i){return $(e,void 0,void 0,(function(){var e,n,r;return ee(this,(function(o){switch(o.label){case 0:return[4,this._getWidgetCommunication()];case 1:return[4,o.sent().relay(t,this.config)];case 2:return e=o.sent(),n=e.error,r=e.result,"net_version"===t.method&&(this._network=r,this.engine.networkVersion=this._network),i(n,r),[2]}}))}))}}),this.engine.enable=function(){return new Promise((function(t,n){e.engine.sendAsync({method:"eth_accounts"},(function(e,i){e?n(e):t(i.result)}))}))},this.engine.isConnected=function(){return!0},this.engine.isPortis=!0,this.engine.on("error",(function(e){e&&e.message&&e.message.includes("PollingBlockTracker")?console.warn("If you see this warning constantly, there might be an error with your RPC node."):console.error(e)})),this.engine.start(),this.engine},e.prototype.clearSubprovider=function(e){var t=this.provider._providers.find((function(t){return t instanceof e}));this.provider.removeProvider(t),this.provider.addProvider(new e)},e}(),ue=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))},de=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},le=["email","reputation"];s().then((function(){document.getElementsByClassName(R).length&&console.warn("Portis script was already loaded. This might cause unexpected behavior. If loading with a <script> tag, please make sure that you only load it once.")})).catch((function(){}));var he=function(){function e(e,t,n){if(void 0===n&&(n={}),!o())return new Proxy(this,{get:function(e,t){return e[t]instanceof Function?function(){}:void 0}});c(),this._validateParams(e,t,n),this._config={dappId:e,network:i(t,n.gasRelay),version:"4.0.7",scope:n.scope,registerPageByDefault:n.registerPageByDefault,staging:n.staging,feature:n.feature},this._getWidgetCommunication=this._getWidgetCommunication.bind(this),this._widgetManagerInstance=new D(this.config,this._clearProviderSession),this._web3ManagerInstance=new ce(this.config,this._getWidgetCommunication),this.setDefaultEmail=this.setDefaultEmail.bind(this),this.changeNetwork=this.changeNetwork.bind(this),this.getWidget=this.getWidget.bind(this),this.onLogin=this.onLogin.bind(this),this.onLogout=this.onLogout.bind(this),this.onActiveWalletChanged=this.onActiveWalletChanged.bind(this),this.onError=this.onError.bind(this),this.showPortis=this.showPortis.bind(this),this.getCampaignInfo=this.getCampaignInfo.bind(this),this.claimVoucher=this.claimVoucher.bind(this),this.getExtendedPublicKey=this.getExtendedPublicKey.bind(this),this.importWallet=this.importWallet.bind(this),this.isLoggedIn=this.isLoggedIn.bind(this),this.signBitcoinTransaction=this.signBitcoinTransaction.bind(this),this.showBitcoinWallet=this.showBitcoinWallet.bind(this)}return Object.defineProperty(e.prototype,"_widgetManager",{get:function(){return this._widgetManagerInstance},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_web3Manager",{get:function(){return this._web3ManagerInstance},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!0,configurable:!0}),e.prototype._clearProviderSession=function(){this._web3Manager.setSelectedAddress("")},e.prototype._getWidgetCommunication=function(){return ue(this,void 0,void 0,(function(){return de(this,(function(e){switch(e.label){case 0:return[4,this._widgetManager.getWidget()];case 1:return[2,e.sent().communication]}}))}))},Object.defineProperty(e.prototype,"web3Provider",{get:function(){return this._web3Manager.provider},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"provider",{get:function(){return this.web3Provider},enumerable:!0,configurable:!0}),e.prototype.changeNetwork=function(e,t){this._web3Manager.changeNetwork(e,t)},e.prototype.setDefaultEmail=function(e){this._widgetManager.setDefaultEmail(e)},e.prototype.getWidget=function(){return ue(this,void 0,void 0,(function(){return de(this,(function(e){return[2,this._widgetManager.getWidget()]}))}))},e.prototype.onLogin=function(e){this._widgetManager.setOnLoginCallback(e)},e.prototype.onLogout=function(e){this._widgetManager.setOnLogoutCallback(e)},e.prototype.onActiveWalletChanged=function(e){this._widgetManager.setOnActiveWalletChangedCallback(e)},e.prototype.onError=function(e){this._widgetManager.setOnErrorCallback(e)},e.prototype.showPortis=function(){return ue(this,void 0,void 0,(function(){return de(this,(function(e){return[2,this._widgetManager.showPortis()]}))}))},e.prototype.getCampaignInfo=function(e){return ue(this,void 0,void 0,(function(){return de(this,(function(t){return[2,this._widgetManager.getCampaignInfo(e)]}))}))},e.prototype.claimVoucher=function(e){return ue(this,void 0,void 0,(function(){return de(this,(function(t){return[2,this._widgetManager.claimVoucher(e)]}))}))},e.prototype.logout=function(){return ue(this,void 0,void 0,(function(){return de(this,(function(e){return[2,this._widgetManager.logout()]}))}))},e.prototype.getExtendedPublicKey=function(e,t){return void 0===e&&(e="m/44'/60'/0'/0/0"),void 0===t&&(t="Ethereum"),ue(this,void 0,void 0,(function(){return de(this,(function(n){return[2,this._widgetManager.getExtendedPublicKey(e,t)]}))}))},e.prototype.importWallet=function(e){return ue(this,void 0,void 0,(function(){return de(this,(function(t){return[2,this._widgetManager.importWallet(e)]}))}))},e.prototype.isLoggedIn=function(){return ue(this,void 0,void 0,(function(){return de(this,(function(e){return[2,this._widgetManager.isLoggedIn()]}))}))},e.prototype.signBitcoinTransaction=function(e){return ue(this,void 0,void 0,(function(){return de(this,(function(t){return[2,this._widgetManager.signBitcoinTransaction(e)]}))}))},e.prototype.showBitcoinWallet=function(e){return void 0===e&&(e="m/49'/0'/0'/0/0"),ue(this,void 0,void 0,(function(){return de(this,(function(t){return[2,this._widgetManager.showBitcoinWallet(e)]}))}))},e.prototype._validateParams=function(e,t,n){if(!e)throw new Error("[Portis] 'dappId' is required. Get your dappId here: https://dashboard.portis.io");if(!t)throw new Error("[Portis] 'network' is required. Read more about it here: https://docs.portis.io/#/configuration?id=network");if(n.scope){if(!Array.isArray(n.scope))throw new Error("[Portis] 'scope' must be an array. Read more about it here: https://docs.portis.io/#/configuration?id=scope");if(n.scope.filter((function(e){return le.indexOf(e)<0})).length>0)throw new Error("[Portis] invalid 'scope' parameter. Read more about it here: https://docs.portis.io/#/configuration?id=scope")}if(void 0!==n.registerPageByDefault&&"boolean"!=typeof n.registerPageByDefault)throw new Error("[Portis] invalid 'registerPageByDefault' parameter, must be a boolean. Read more about it here: https://docs.portis.io/#/configuration?id=registerPageByDefault")},e}(),fe=he;function ge(i,r){var o=i.chainId,a=i.portisParams;return e(this,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:if(!(null==a?void 0:a.id))throw new Error("uAuthParams is not valid.");switch(e="",o){case 1:default:e="mainnet";break;case 5:e="goerli"}return[4,(i=new fe(a.id,e,a.config)).provider.enable()];case 1:return t.sent(),i.provider._portis=i,i.provider.on("connect",r.connect),i.provider.on("disconnect",r.disconnect),i.provider.on("accountsChanged",r.accountsChanged),i.provider.on("chainChanged",r.chainChanged),i.provider.on("message",r.message),[2,n(i.provider)]}}))}))}export{ge as default};
@@ -0,0 +1 @@
1
+ import{e as t,_ as e,a as n,b as i,c as o}from"./index-ecbe3d8d.js";import"@ethersproject/providers";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/address";import"valtio";var r="dapp-inpage-integration",s="openblock-content-integration",a=["https://cocoswap.com","https://app.openocean.finance"],d=["https://oec.cocoswap.com"],u=function(){function u(){console.log("start initialize openblockinpage provider"),this.callBackList={},this.eventListener={},this.isMetaMask=!0,this.isOpenBlock=!0,this.chainId=null,this.networkVersion=null,this.selectedAddress=null,this.request=this.request.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.on=this.on.bind(this),this.isConnected=this.isConnected.bind(this),this.enable=this.enable.bind(this),this._metamask=this._getExperimentalApi(),this._initInpageListener(),this.getProviderData()}return u.prototype.getProviderData=function(){var t;return e(this,void 0,void 0,(function(){var e;return n(this,(function(n){switch(n.label){case 0:return[4,this.request("metamask_getProviderState")];case 1:return e=n.sent(),this.chainId=null==e?void 0:e.chainId,this.networkVersion=null==e?void 0:e.networkVersion,this.selectedAddress=null===(t=null==e?void 0:e.accounts)||void 0===t?void 0:t[0],[2]}}))}))},u.prototype.request=function(t){return e(this,void 0,void 0,(function(){var e;return n(this,(function(n){switch(n.label){case 0:return"eth_requestAccounts"!==t.method?[3,2]:[4,this._hookRequest("eth_accounts")];case 1:if((e=n.sent()).length)return[2,new Promise((function(t){return t(e)}))];n.label=2;case 2:return[2,this._hookRequest(t)]}}))}))},u.prototype.send=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e(this,void 0,void 0,(function(){return n(this,(function(e){return"function"==typeof t[1]?(this.sendAsync(t[0],t[1]),[2]):"string"==typeof t[0]?[2,this.request({method:t[0],params:t[1]})]:1===t.length?[2,this.request(t)]:[2]}))}))},u.prototype.sendAsync=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e(this,void 0,void 0,(function(){var e,i;return n(this,(function(n){return e={method:t[0].method,params:t[0].params},i=t[0].id,this.request(e).then((function(e){t[1](null,{id:i,jsonrpc:"2.0",result:e})})).catch((function(e){t[1](null,{id:i,jsonrpc:"2.0",error:e})})),[2]}))}))},u.prototype.isConnected=function(){return!0},u.prototype.enable=function(){return e(this,void 0,void 0,(function(){var t;return n(this,(function(e){switch(e.label){case 0:return[4,this._hookRequest("eth_accounts")];case 1:return(t=e.sent()).length?[2,new Promise((function(e){return e(t)}))]:[2,this.request({method:"eth_requestAccounts"})]}}))}))},u.prototype.on=function(e,n){var i;"string"==typeof e&&"function"==typeof n&&(this.eventListener[e]&&this.eventListener[e].length>5||(this.eventListener[e]?(this.eventListener[e].push(n),this.eventListener[e]=Array.from(new Set(this.eventListener[e]))):this.eventListener[e]||(this.eventListener=t(t({},this.eventListener),((i={})[e]=[n],i))),this._registerEvent(e)))},u.prototype.removeListener=function(){},u.prototype._initInpageListener=function(){var t=this;window.addEventListener("message",(function(e){var n,i,o;if(e.data.target===r){var s=null===(o=null===(i=null===(n=e.data)||void 0===n?void 0:n.value)||void 0===i?void 0:i.data)||void 0===o?void 0:o.mark;s&&("call_method"===s.type?t._handleNormalMethod(s,e):"register_event"===s.type&&t._handleEventMethod(s,e))}}),!1)},u.prototype._handleNormalMethod=function(t,e){var n,i,o,r,s;(null===(n=e.data.value.data)||void 0===n?void 0:n.error)?null===(i=this.callBackList[t.id])||void 0===i||i.reject(null===(o=e.data.value.data)||void 0===o?void 0:o.error):null===(r=this.callBackList[t.id])||void 0===r||r.resolve(null===(s=e.data.value.data)||void 0===s?void 0:s.result),delete this.callBackList[t.id]},u.prototype._handleEventMethod=function(t,e){var n,i,o,r,s,u,c,h=this,l=null===(r=null===(o=null===(i=null===(n=e.data)||void 0===n?void 0:n.value)||void 0===i?void 0:i.data)||void 0===o?void 0:o.mark)||void 0===r?void 0:r.eventName,v=null===(c=null===(u=null===(s=e.data)||void 0===s?void 0:s.value)||void 0===u?void 0:u.data)||void 0===c?void 0:c.params;if(l){var p=this.eventListener[l];if(!p)return void("https://app.openocean.finance"===window.location.origin&&window.location.reload());p.forEach((function(t){"chainChanged"===l&&(h.chainId=v,h.networkVersion=Number(v)),d.includes(window.location.origin)&&"chainChanged"===l||(a.includes(window.location.origin)?window.location.reload():t(v))}))}},u.prototype._hookRequest=function(e){var n=this;return new Promise((function(i,o){var a=function(){function t(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return t()+t()+t()+t()+t()+t()+t()+t()}();"string"==typeof e&&(e={method:e}),e=t(t({},e),{mark:{id:a,method:e.method,type:"call_method"}}),window.parent.postMessage({from:r,target:s,data:e},"*"),n.callBackList[a]={resolve:i,reject:o}}))},u.prototype._registerEvent=function(t){var e={mark:{eventName:t,type:"register_event"},eventName:t};window.parent.postMessage({from:r,target:s,data:e},"*")},u.prototype._getExperimentalApi=function(){return new Proxy({isUnlocked:function(){return new Promise((function(t){return t(!0)}))}},{get:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return Reflect.get.apply(Reflect,i([t,e],o(n),!1))}})},u}();function c(){var e;if(null===(e=window.obethereum)||void 0===e?void 0:e.isOpenBlock)return window.obethereum;var n=new u;n=new Proxy(n,{deleteProperty:function(){return!0}});try{Object.defineProperty(window,"obethereum",{set:function(t){console.log("set ethereum",t)},get:function(){return n}})}catch(t){console.log("initializeProvider error",t),window.obethereum=n}return window.web3=t({},window.web3),window.web3.currentProvider=n,window.dispatchEvent(new Event("ethereum#initialized")),n}export{c as default};
@@ -1,6 +1 @@
1
- export default function getAdapter(): {
2
- getEip3770Address: (fullAddress: string) => Promise<{
3
- address: string;
4
- prefix: string;
5
- }>;
6
- };
1
+ export default function getAdapter(): any;
@@ -0,0 +1 @@
1
+ import{c as t}from"./_commonjsHelpers-70de2c37.js";import{c as n}from"./bn-16003306.js";var r,e={exports:{}};function i(){return r||(r=1,e.exports=(i=i||function(r,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==t&&t.crypto&&(i=t.crypto),!i&&"function"==typeof n)try{i=require("crypto")}catch(t){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function t(){}return function(n){var r;return t.prototype=n,r=new t,t.prototype=null,r}}(),a={},c=a.lib={},f=c.Base={extend:function(t){var n=s(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},u=c.WordArray=f.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=e?n:4*t.length},toString:function(t){return(t||p).stringify(this)},concat:function(t){var n=this.words,r=t.words,e=this.sigBytes,i=t.sigBytes;if(this.clamp(),e%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;n[e+o>>>2]|=s<<24-(e+o)%4*8}else for(var a=0;a<i;a+=4)n[e+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=r.ceil(n/4)},clone:function(){var t=f.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(o());return new u.init(n,t)}}),h=a.enc={},p=h.Hex={stringify:function(t){for(var n=t.words,r=t.sigBytes,e=[],i=0;i<r;i++){var o=n[i>>>2]>>>24-i%4*8&255;e.push((o>>>4).toString(16)),e.push((15&o).toString(16))}return e.join("")},parse:function(t){for(var n=t.length,r=[],e=0;e<n;e+=2)r[e>>>3]|=parseInt(t.substr(e,2),16)<<24-e%8*4;return new u.init(r,n/2)}},d=h.Latin1={stringify:function(t){for(var n=t.words,r=t.sigBytes,e=[],i=0;i<r;i++){var o=n[i>>>2]>>>24-i%4*8&255;e.push(String.fromCharCode(o))}return e.join("")},parse:function(t){for(var n=t.length,r=[],e=0;e<n;e++)r[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new u.init(r,n)}},l=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},y=c.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var n,e=this._data,i=e.words,o=e.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?r.ceil(a):r.max((0|a)-this._minBufferSize,0))*s,f=r.min(4*c,o);if(c){for(var h=0;h<c;h+=s)this._doProcessBlock(i,h);n=i.splice(0,c),e.sigBytes-=f}return new u.init(n,f)},clone:function(){var t=f.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});c.Hasher=y.extend({cfg:f.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(n,r){return new t.init(r).finalize(n)}},_createHmacHelper:function(t){return function(n,r){return new g.HMAC.init(t,r).finalize(n)}}});var g=a.algo={};return a}(Math),i)),e.exports;var i}var o,s={exports:{}};s.exports=(o=i(),function(t){var n=o,r=n.lib,e=r.WordArray,i=r.Hasher,s=n.algo,a=[],c=[];!function(){function n(n){for(var r=t.sqrt(n),e=2;e<=r;e++)if(!(n%e))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var e=2,i=0;i<64;)n(e)&&(i<8&&(a[i]=r(t.pow(e,.5))),c[i]=r(t.pow(e,1/3)),i++),e++}();var f=[],u=s.SHA256=i.extend({_doReset:function(){this._hash=new e.init(a.slice(0))},_doProcessBlock:function(t,n){for(var r=this._hash.words,e=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=r[5],h=r[6],p=r[7],d=0;d<64;d++){if(d<16)f[d]=0|t[n+d];else{var l=f[d-15],y=(l<<25|l>>>7)^(l<<14|l>>>18)^l>>>3,g=f[d-2],w=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;f[d]=y+f[d-7]+w+f[d-16]}var v=e&i^e&o^i&o,_=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),m=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&h)+c[d]+f[d];p=h,h=u,u=a,a=s+m|0,s=o,o=i,i=e,e=m+(_+v)|0}r[0]=r[0]+e|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+u|0,r[6]=r[6]+h|0,r[7]=r[7]+p|0},_doFinalize:function(){var n=this._data,r=n.words,e=8*this._nDataBytes,i=8*n.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(e/4294967296),r[15+(i+64>>>9<<4)]=e,n.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=i._createHelper(u),n.HmacSHA256=i._createHmacHelper(u)}(Math),o.SHA256);export{i as r,s};
@@ -0,0 +1,9 @@
1
+ import{c as t}from"./_commonjsHelpers-70de2c37.js";var r,e={exports:{}};
2
+ /**
3
+ * [js-sha3]{@link https://github.com/emn178/js-sha3}
4
+ *
5
+ * @version 0.8.0
6
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
7
+ * @copyright Chen, Yi-Cyuan 2015-2018
8
+ * @license MIT
9
+ */r=e,function(){var e="input is invalid type",n="object"==typeof window,i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self;!i.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?i=t:o&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&r.exports,s=!i.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),u=[4,1024,262144,67108864],c=[0,8,16,24],h=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],p=[224,256,384,512],d=[128,256],l=["hex","buffer","arrayBuffer","array","digest"],y={128:168,256:136};!i.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!s||!i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var b=function(t,r,e){return function(n){return new j(t,r,t).update(n)[e]()}},A=function(t,r,e){return function(n,i){return new j(t,r,i).update(n)[e]()}},v=function(t,r,e){return function(r,n,i,o){return k["cshake"+t].update(r,n,i,o)[e]()}},w=function(t,r,e){return function(r,n,i,o){return k["kmac"+t].update(r,n,i,o)[e]()}},B=function(t,r,e,n){for(var i=0;i<l.length;++i){var o=l[i];t[o]=r(e,n,o)}return t},_=function(t,r){var e=b(t,r,"hex");return e.create=function(){return new j(t,r,t)},e.update=function(t){return e.create().update(t)},B(e,b,t,r)},g=[{name:"keccak",padding:[1,256,65536,16777216],bits:p,createMethod:_},{name:"sha3",padding:[6,1536,393216,100663296],bits:p,createMethod:_},{name:"shake",padding:[31,7936,2031616,520093696],bits:d,createMethod:function(t,r){var e=A(t,r,"hex");return e.create=function(e){return new j(t,r,e)},e.update=function(t,r){return e.create(r).update(t)},B(e,A,t,r)}},{name:"cshake",padding:u,bits:d,createMethod:function(t,r){var e=y[t],n=v(t,0,"hex");return n.create=function(n,i,o){return i||o?new j(t,r,n).bytepad([i,o],e):k["shake"+t].create(n)},n.update=function(t,r,e,i){return n.create(r,e,i).update(t)},B(n,v,t,r)}},{name:"kmac",padding:u,bits:d,createMethod:function(t,r){var e=y[t],n=w(t,0,"hex");return n.create=function(n,i,o){return new N(t,r,i).bytepad(["KMAC",o],e).bytepad([n],e)},n.update=function(t,r,e,i){return n.create(t,e,i).update(r)},B(n,w,t,r)}}],k={},S=[],x=0;x<g.length;++x)for(var C=g[x],m=C.bits,E=0;E<m.length;++E){var O=C.name+"_"+m[E];if(S.push(O),k[O]=C.createMethod(m[E],C.padding),"sha3"!==C.name){var z=C.name+m[E];S.push(z),k[z]=k[O]}}function j(t,r,e){this.blocks=[],this.s=[],this.padding=r,this.outputBits=e,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=e>>5,this.extraBytes=(31&e)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(t,r,e){j.call(this,t,r,e)}j.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,a=this.blocks,f=this.byteCount,u=t.length,h=this.blockCount,p=0,d=this.s;p<u;){if(this.reset)for(this.reset=!1,a[0]=this.block,i=1;i<h+1;++i)a[i]=0;if(r)for(i=this.start;p<u&&i<f;++p)a[i>>2]|=t[p]<<c[3&i++];else for(i=this.start;p<u&&i<f;++p)(o=t.charCodeAt(p))<128?a[i>>2]|=o<<c[3&i++]:o<2048?(a[i>>2]|=(192|o>>6)<<c[3&i++],a[i>>2]|=(128|63&o)<<c[3&i++]):o<55296||o>=57344?(a[i>>2]|=(224|o>>12)<<c[3&i++],a[i>>2]|=(128|o>>6&63)<<c[3&i++],a[i>>2]|=(128|63&o)<<c[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++p)),a[i>>2]|=(240|o>>18)<<c[3&i++],a[i>>2]|=(128|o>>12&63)<<c[3&i++],a[i>>2]|=(128|o>>6&63)<<c[3&i++],a[i>>2]|=(128|63&o)<<c[3&i++]);if(this.lastByteIndex=i,i>=f){for(this.start=i-f,this.block=a[h],i=0;i<h;++i)d[i]^=a[i];J(d),this.reset=!0}else this.start=i}return this},j.prototype.encode=function(t,r){var e=255&t,n=1,i=[e];for(e=255&(t>>=8);e>0;)i.unshift(e),e=255&(t>>=8),++n;return r?i.push(n):i.unshift(n),this.update(i),i.length},j.prototype.encodeString=function(t){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}var i=0,o=t.length;if(r)i=o;else for(var a=0;a<t.length;++a){var f=t.charCodeAt(a);f<128?i+=1:f<2048?i+=2:f<55296||f>=57344?i+=3:(f=65536+((1023&f)<<10|1023&t.charCodeAt(++a)),i+=4)}return i+=this.encode(8*i),this.update(t),i},j.prototype.bytepad=function(t,r){for(var e=this.encode(r),n=0;n<t.length;++n)e+=this.encodeString(t[n]);var i=r-e%r,o=[];return o.length=i,this.update(o),this},j.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex,e=this.blockCount,n=this.s;if(t[r>>2]|=this.padding[3&r],this.lastByteIndex===this.byteCount)for(t[0]=t[e],r=1;r<e+1;++r)t[r]=0;for(t[e-1]|=2147483648,r=0;r<e;++r)n[r]^=t[r];J(n)}},j.prototype.toString=j.prototype.hex=function(){this.finalize();for(var t,r=this.blockCount,e=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<r&&a<n;++o,++a)t=e[o],s+=f[t>>4&15]+f[15&t]+f[t>>12&15]+f[t>>8&15]+f[t>>20&15]+f[t>>16&15]+f[t>>28&15]+f[t>>24&15];a%r==0&&(J(e),o=0)}return i&&(t=e[o],s+=f[t>>4&15]+f[15&t],i>1&&(s+=f[t>>12&15]+f[t>>8&15]),i>2&&(s+=f[t>>20&15]+f[t>>16&15])),s},j.prototype.arrayBuffer=function(){this.finalize();var t,r=this.blockCount,e=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var f=new Uint32Array(t);a<n;){for(o=0;o<r&&a<n;++o,++a)f[a]=e[o];a%r==0&&J(e)}return i&&(f[o]=e[o],t=t.slice(0,s)),t},j.prototype.buffer=j.prototype.arrayBuffer,j.prototype.digest=j.prototype.array=function(){this.finalize();for(var t,r,e=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,f=[];s<i;){for(a=0;a<e&&s<i;++a,++s)t=s<<2,r=n[a],f[t]=255&r,f[t+1]=r>>8&255,f[t+2]=r>>16&255,f[t+3]=r>>24&255;s%e==0&&J(n)}return o&&(t=s<<2,r=n[a],f[t]=255&r,o>1&&(f[t+1]=r>>8&255),o>2&&(f[t+2]=r>>16&255)),f},N.prototype=new j,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),j.prototype.finalize.call(this)};var J=function(t){var r,e,n,i,o,a,s,f,u,c,p,d,l,y,b,A,v,w,B,_,g,k,S,x,C,m,E,O,z,j,N,J,M,H,I,R,U,V,F,D,W,Y,K,q,G,L,P,Q,T,X,Z,$,tt,rt,et,nt,it,ot,at,st,ft,ut,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],p=t[7]^t[17]^t[27]^t[37]^t[47],r=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),e=(l=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=r,t[1]^=e,t[10]^=r,t[11]^=e,t[20]^=r,t[21]^=e,t[30]^=r,t[31]^=e,t[40]^=r,t[41]^=e,r=i^(f<<1|u>>>31),e=o^(u<<1|f>>>31),t[2]^=r,t[3]^=e,t[12]^=r,t[13]^=e,t[22]^=r,t[23]^=e,t[32]^=r,t[33]^=e,t[42]^=r,t[43]^=e,r=a^(c<<1|p>>>31),e=s^(p<<1|c>>>31),t[4]^=r,t[5]^=e,t[14]^=r,t[15]^=e,t[24]^=r,t[25]^=e,t[34]^=r,t[35]^=e,t[44]^=r,t[45]^=e,r=f^(d<<1|l>>>31),e=u^(l<<1|d>>>31),t[6]^=r,t[7]^=e,t[16]^=r,t[17]^=e,t[26]^=r,t[27]^=e,t[36]^=r,t[37]^=e,t[46]^=r,t[47]^=e,r=c^(i<<1|o>>>31),e=p^(o<<1|i>>>31),t[8]^=r,t[9]^=e,t[18]^=r,t[19]^=e,t[28]^=r,t[29]^=e,t[38]^=r,t[39]^=e,t[48]^=r,t[49]^=e,y=t[0],b=t[1],L=t[11]<<4|t[10]>>>28,P=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,z=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ft=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,H=t[2]<<1|t[3]>>>31,I=t[3]<<1|t[2]>>>31,A=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,Q=t[22]<<10|t[23]>>>22,T=t[23]<<10|t[22]>>>22,j=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,rt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,R=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,B=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,J=t[45]<<29|t[44]>>>3,M=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,C=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,V=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,g=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,G=t[9]<<27|t[8]>>>5,m=t[18]<<20|t[19]>>>12,E=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,W=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=y^~A&w,t[1]=b^~v&B,t[10]=x^~m&O,t[11]=C^~E&z,t[20]=H^~R&V,t[21]=I^~U&F,t[30]=q^~L&Q,t[31]=G^~P&T,t[40]=rt^~nt&ot,t[41]=et^~it&at,t[2]=A^~w&_,t[3]=v^~B&g,t[12]=m^~O&j,t[13]=E^~z&N,t[22]=R^~V&D,t[23]=U^~F&W,t[32]=L^~Q&X,t[33]=P^~T&Z,t[42]=nt^~ot&st,t[43]=it^~at&ft,t[4]=w^~_&k,t[5]=B^~g&S,t[14]=O^~j&J,t[15]=z^~N&M,t[24]=V^~D&Y,t[25]=F^~W&K,t[34]=Q^~X&$,t[35]=T^~Z&tt,t[44]=ot^~st&ut,t[45]=at^~ft&ct,t[6]=_^~k&y,t[7]=g^~S&b,t[16]=j^~J&x,t[17]=N^~M&C,t[26]=D^~Y&H,t[27]=W^~K&I,t[36]=X^~$&q,t[37]=Z^~tt&G,t[46]=st^~ut&rt,t[47]=ft^~ct&et,t[8]=k^~y&A,t[9]=S^~b&v,t[18]=J^~x&m,t[19]=M^~C&E,t[28]=Y^~H&R,t[29]=K^~I&U,t[38]=$^~q&L,t[39]=tt^~G&P,t[48]=ut^~rt&nt,t[49]=ct^~et&it,t[0]^=h[n],t[1]^=h[n+1]};if(a)r.exports=k;else for(x=0;x<S.length;++x)i[S[x]]=k[S[x]]}();var n=e.exports;export{e as a,n as s};