@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.
- package/dist/_commonjsHelpers-70de2c37.js +1 -0
- package/dist/bn-16003306.js +1 -0
- package/dist/cjs/_commonjsHelpers-66ecbaf8.cjs +1 -0
- package/dist/cjs/bn-1bd77809.cjs +1 -0
- package/dist/cjs/elliptic-174586a6.cjs +1 -0
- package/dist/cjs/hash-121fdd2c.cjs +1 -0
- package/dist/cjs/index-23606273.cjs +1 -0
- package/dist/cjs/index-33e57d81.cjs +1 -0
- package/dist/cjs/index-5976e357.cjs +1 -0
- package/dist/cjs/index-6d7369f7.cjs +1 -0
- package/dist/cjs/index-a32c3cfa.cjs +22 -0
- package/dist/cjs/index-e0e60b3b.cjs +3 -0
- package/dist/cjs/index-e948d9e4.cjs +19 -0
- package/dist/cjs/index-f7522058.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/inherits-6d52d55b.cjs +1 -0
- package/dist/cjs/interface-6a2093d7.cjs +1 -0
- package/dist/cjs/node-ponyfill-c08c51bf.cjs +1 -0
- package/dist/cjs/portis-cf05b1f4.cjs +1 -0
- package/dist/cjs/provider-de4ee5b7.cjs +1 -0
- package/dist/cjs/providers/connector/safeGnosis/adapter.d.ts +1 -6
- package/dist/cjs/sha256-21fccd26.cjs +1 -0
- package/dist/cjs/sha3-499f6bea.cjs +10 -0
- package/dist/cjs/uAuth-075fec28.cjs +1 -0
- package/dist/cjs/walletConnect-58449a61.cjs +1 -0
- package/dist/cjs/walletLink-e3b39e1b.cjs +1 -0
- package/dist/elliptic-1100204f.js +1 -0
- package/dist/hash-4b8ad136.js +1 -0
- package/dist/index-5c16deff.js +1 -0
- package/dist/index-632fbf92.js +1 -0
- package/dist/index-6cdefd52.js +22 -0
- package/dist/index-822c6d78.js +1 -0
- package/dist/index-83293e8e.js +2 -0
- package/dist/index-9547c0cf.js +1 -0
- package/dist/index-e3ab6de5.js +1 -0
- package/dist/index-ecbe3d8d.js +19 -0
- package/dist/index.js +1 -1
- package/dist/inherits-e2363129.js +1 -0
- package/dist/interface-36a3c8cf.js +1 -0
- package/dist/node-ponyfill-bda9b4f4.js +1 -0
- package/dist/portis-b3fee0d6.js +1 -0
- package/dist/provider-30d55a46.js +1 -0
- package/dist/providers/connector/safeGnosis/adapter.d.ts +1 -6
- package/dist/sha256-8f7b3565.js +1 -0
- package/dist/sha3-a5661517.js +9 -0
- package/dist/uAuth-343d653d.js +1 -0
- package/dist/walletConnect-ea07b187.js +1 -0
- package/dist/walletLink-39bc8bdc.js +1 -0
- package/package.json +8 -8
- package/dist/cjs/index-1d035f96.cjs +0 -1
- package/dist/cjs/index-20589cad.cjs +0 -1
- package/dist/cjs/index-3c0f322c.cjs +0 -1
- package/dist/cjs/index-57e7ce01.cjs +0 -1
- package/dist/cjs/index-5f524b54.cjs +0 -1
- package/dist/cjs/index-809d42db.cjs +0 -1
- package/dist/cjs/index-9726ade3.cjs +0 -1
- package/dist/cjs/index-a53895dd.cjs +0 -1
- package/dist/cjs/index-b3bae54d.cjs +0 -1
- package/dist/cjs/index-b787ad60.cjs +0 -1
- package/dist/cjs/index-bd507185.cjs +0 -1
- package/dist/cjs/index-e43297ee.cjs +0 -1
- package/dist/cjs/portis-0d0ed336.cjs +0 -1
- package/dist/cjs/portis-139a9e4d.cjs +0 -1
- package/dist/cjs/portis-19c00eba.cjs +0 -1
- package/dist/cjs/portis-2053ea4b.cjs +0 -1
- package/dist/cjs/provider-216c4ecc.cjs +0 -1
- package/dist/cjs/provider-664da1b0.cjs +0 -1
- package/dist/cjs/provider-9bce34ab.cjs +0 -1
- package/dist/cjs/provider-a9b8a548.cjs +0 -1
- package/dist/cjs/uAuth-218d5a4e.cjs +0 -1
- package/dist/cjs/uAuth-384147c3.cjs +0 -1
- package/dist/cjs/uAuth-5d059de5.cjs +0 -1
- package/dist/cjs/uAuth-b52b01e0.cjs +0 -1
- package/dist/cjs/walletConnect-02bcbc5c.cjs +0 -1
- package/dist/cjs/walletConnect-712b3724.cjs +0 -1
- package/dist/cjs/walletConnect-9a4bbbc8.cjs +0 -1
- package/dist/cjs/walletConnect-b6ac4960.cjs +0 -1
- package/dist/cjs/walletLink-2cd8be6e.cjs +0 -1
- package/dist/cjs/walletLink-349e1bf5.cjs +0 -1
- package/dist/cjs/walletLink-92f211ff.cjs +0 -1
- package/dist/cjs/walletLink-f4cbd510.cjs +0 -1
- package/dist/index-4025ab08.js +0 -1
- package/dist/index-5ced3e7a.js +0 -1
- package/dist/index-677159b8.js +0 -1
- package/dist/index-6b9ad9a8.js +0 -1
- package/dist/index-6f08dc42.js +0 -1
- package/dist/index-829e82f9.js +0 -1
- package/dist/index-853b673b.js +0 -1
- package/dist/index-8dfaf647.js +0 -1
- package/dist/index-be16dd4e.js +0 -1
- package/dist/index-be47cca9.js +0 -1
- package/dist/index-c7eb0cf4.js +0 -1
- package/dist/index-fa3d2d50.js +0 -1
- package/dist/portis-32658178.js +0 -1
- package/dist/portis-5cb50e65.js +0 -1
- package/dist/portis-db858db8.js +0 -1
- package/dist/portis-fbb3c228.js +0 -1
- package/dist/provider-3fe99d2c.js +0 -1
- package/dist/provider-9ab2eb6e.js +0 -1
- package/dist/provider-e2314677.js +0 -1
- package/dist/provider-f7f5cb2b.js +0 -1
- package/dist/uAuth-64c3dda3.js +0 -1
- package/dist/uAuth-9f7c98e7.js +0 -1
- package/dist/uAuth-ddaae2b5.js +0 -1
- package/dist/uAuth-e4b5c839.js +0 -1
- package/dist/walletConnect-1a1a1062.js +0 -1
- package/dist/walletConnect-2b8f3354.js +0 -1
- package/dist/walletConnect-4c410280.js +0 -1
- package/dist/walletConnect-fb4a3e3c.js +0 -1
- package/dist/walletLink-5b9fdf98.js +0 -1
- package/dist/walletLink-98193680.js +0 -1
- package/dist/walletLink-986484a1.js +0 -1
- package/dist/walletLink-cf8da449.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("stream"),t=require("http"),r=require("url"),o=require("./interface-6a2093d7.cjs"),n=require("https"),s=require("zlib"),i=require("./_commonjsHelpers-66ecbaf8.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=u(e),l=u(t),c=u(r),f=u(n),d=u(s),h={exports:{}};const p=a.default.Readable,b=Symbol("buffer"),y=Symbol("type");class m{constructor(){this[y]="";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 m?n[b]:Buffer.from("string"==typeof n?n:String(n)),o+=s.length,r.push(s)}}this[b]=Buffer.concat(r);let n=t&&void 0!==t.type&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[y]=n)}get size(){return this[b].length}get type(){return this[y]}text(){return Promise.resolve(this[b].toString())}arrayBuffer(){const e=this[b],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new p;return e._read=function(){},e.push(this[b]),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[b].slice(o,o+s),u=new m([],{type:arguments[2]});return u[b]=i,u}}function g(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 w;Object.defineProperties(m.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),g.prototype=Object.create(Error.prototype),g.prototype.constructor=g,g.prototype.name="FetchError";try{w=require("encoding").convert}catch(e){}const v=Symbol("Body internals"),S=a.default.PassThrough;function T(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let n=void 0===o?0:o;var s=r.timeout;let i=void 0===s?0:s;null==e?e=null:O(e)?e=Buffer.from(e.toString()):x(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof a.default||(e=Buffer.from(String(e)))),this[v]={body:e,disturbed:!1,error:null},this.size=n,this.timeout=i,e instanceof a.default&&e.on("error",(function(e){const r="AbortError"===e.name?e:new g(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[v].error=r}))}function j(){var e=this;if(this[v].disturbed)return T.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[v].disturbed=!0,this[v].error)return T.Promise.reject(this[v].error);let t=this.body;if(null===t)return T.Promise.resolve(Buffer.alloc(0));if(x(t)&&(t=t.stream()),Buffer.isBuffer(t))return T.Promise.resolve(t);if(!(t instanceof a.default))return T.Promise.resolve(Buffer.alloc(0));let r=[],o=0,n=!1;return new T.Promise((function(s,i){let u;e.timeout&&(u=setTimeout((function(){n=!0,i(new g(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(n=!0,i(t)):i(new g(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!n&&null!==t){if(e.size&&o+t.length>e.size)return n=!0,void i(new g(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,r.push(t)}})),t.on("end",(function(){if(!n){clearTimeout(u);try{s(Buffer.concat(r,o))}catch(t){i(new g(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function O(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 x(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 P(e){let t,r,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof a.default&&"function"!=typeof o.getBoundary&&(t=new S,r=new S,o.pipe(t),o.pipe(r),e[v].body=t,o=r),o}function E(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":O(e)?"application/x-www-form-urlencoded;charset=UTF-8":x(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof a.default?null:"text/plain;charset=UTF-8"}function B(e){const t=e.body;return null===t?0:x(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}T.prototype={get body(){return this[v].body},get bodyUsed(){return this[v].disturbed},arrayBuffer(){return j.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 j.call(this).then((function(t){return Object.assign(new m([],{type:e.toLowerCase()}),{[b]:t})}))},json(){var e=this;return j.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return T.Promise.reject(new g(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return j.call(this).then((function(e){return e.toString()}))},buffer(){return j.call(this)},textConverted(){var e=this;return j.call(this).then((function(t){return function(e,t){if("function"!=typeof w)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 w(e,"UTF-8",s).toString()}(t,e.headers)}))}},Object.defineProperties(T.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),T.mixIn=function(e){for(const t of Object.getOwnPropertyNames(T.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(T.prototype,t);Object.defineProperty(e,t,r)}},T.Promise=global.Promise;const $=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,L=/[^\t\x20-\x7e\x80-\xff]/;function A(e){if(e=`${e}`,$.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function R(e){if(e=`${e}`,L.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function C(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const z=Symbol("map");class k{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[z]=Object.create(null),e instanceof k){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){A(e=`${e}`);const t=C(this[z],e);return void 0===t?null:this[z][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=U(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=U(this),o++}}set(e,t){t=`${t}`,A(e=`${e}`),R(t);const r=C(this[z],e);this[z][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,A(e=`${e}`),R(t);const r=C(this[z],e);void 0!==r?this[z][r].push(t):this[z][e]=[t]}has(e){return A(e=`${e}`),void 0!==C(this[z],e)}delete(e){A(e=`${e}`);const t=C(this[z],e);void 0!==t&&delete this[z][t]}raw(){return this[z]}keys(){return _(this,"key")}values(){return _(this,"value")}[Symbol.iterator](){return _(this,"key+value")}}function U(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[z]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[z][t].join(", ")}:function(t){return[t.toLowerCase(),e[z][t].join(", ")]})}k.prototype.entries=k.prototype[Symbol.iterator],Object.defineProperty(k.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(k.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 q=Symbol("internal");function _(e,t){const r=Object.create(H);return r[q]={target:e,kind:t,index:0},r}const H=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==H)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[q];const t=e.target,r=e.kind,o=e.index,n=U(t,r);return o>=n.length?{value:void 0,done:!0}:(this[q].index=o+1,{value:n[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function F(e){const t=Object.assign({__proto__:null},e[z]),r=C(e[z],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(H,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const I=Symbol("Response internals"),D=l.default.STATUS_CODES;class M{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};T.call(this,e,t);const r=t.status||200,o=new k(t.headers);if(null!=e&&!o.has("Content-Type")){const t=E(e);t&&o.append("Content-Type",t)}this[I]={url:t.url,status:r,statusText:t.statusText||D[r],headers:o,counter:t.counter}}get url(){return this[I].url||""}get status(){return this[I].status}get ok(){return this[I].status>=200&&this[I].status<300}get redirected(){return this[I].counter>0}get statusText(){return this[I].statusText}get headers(){return this[I].headers}clone(){return new M(P(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}T.mixIn(M.prototype),Object.defineProperties(M.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(M.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const N=Symbol("Request internals"),G=c.default.URL||o.publicApi.URL,Z=c.default.parse,V=c.default.format;function K(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new G(e).toString()),Z(e)}const Y="destroy"in a.default.Readable.prototype;function J(e){return"object"==typeof e&&"object"==typeof e[N]}class W{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};J(e)?t=K(e.url):(t=e&&e.href?K(e.href):K(`${e}`),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||J(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:J(e)&&null!==e.body?P(e):null;T.call(this,n,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const s=new k(r.headers||e.headers||{});if(null!=n&&!s.has("Content-Type")){const e=E(n);e&&s.append("Content-Type",e)}let i=J(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[N]={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[N].method}get url(){return V(this[N].parsedURL)}get headers(){return this[N].headers}get redirect(){return this[N].redirect}get signal(){return this[N].signal}clone(){return new W(this)}}function Q(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}T.mixIn(W.prototype),Object.defineProperty(W.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(W.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),Q.prototype=Object.create(Error.prototype),Q.prototype.constructor=Q,Q.prototype.name="AbortError";const X=c.default.URL||o.publicApi.URL,ee=a.default.PassThrough;function te(e,t){if(!te.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return T.Promise=te.Promise,new te.Promise((function(r,o){const n=new W(e,t),s=function(e){const t=e[N].parsedURL,r=new k(e[N].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof a.default.Readable&&!Y)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=B(e);"number"==typeof t&&(o=String(t))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=e.agent;return"function"==typeof n&&(n=n(t)),r.has("Connection")||n||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:F(r),agent:n})}(n),i=("https:"===s.protocol?f.default:l.default).request,u=n.signal;let c=null;const h=function(){let e=new Q("The user aborted a request.");o(e),n.body&&n.body instanceof a.default.Readable&&n.body.destroy(e),c&&c.body&&c.body.emit("error",e)};if(u&&u.aborted)return void h();const p=function(){h(),m()},b=i(s);let y;function m(){b.abort(),u&&u.removeEventListener("abort",p),clearTimeout(y)}u&&u.addEventListener("abort",p),n.timeout&&b.once("socket",(function(e){y=setTimeout((function(){o(new g(`network timeout at: ${n.url}`,"request-timeout")),m()}),n.timeout)})),b.on("error",(function(e){o(new g(`request to ${n.url} failed, reason: ${e.message}`,"system",e)),m()})),b.on("response",(function(e){clearTimeout(y);const t=function(e){const t=new k;for(const r of Object.keys(e))if(!$.test(r))if(Array.isArray(e[r]))for(const o of e[r])L.test(o)||(void 0===t[z][r]?t[z][r]=[o]:t[z][r].push(o));else L.test(e[r])||(t[z][r]=[e[r]]);return t}(e.headers);if(te.isRedirect(e.statusCode)){const s=t.get("Location");let i=null;try{i=null===s?null:new X(s,n.url).toString()}catch(e){if("manual"!==n.redirect)return o(new g(`uri requested responds with an invalid redirect URL: ${s}`,"invalid-redirect")),void m()}switch(n.redirect){case"error":return o(new g(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),void m();case"manual":if(null!==i)try{t.set("Location",i)}catch(e){o(e)}break;case"follow":if(null===i)break;if(n.counter>=n.follow)return o(new g(`maximum redirect reached at: ${n.url}`,"max-redirect")),void m();const s={headers:new k(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:n.body,signal:n.signal,timeout:n.timeout,size:n.size};if(!function(e,t){const r=new X(t).hostname,o=new X(e).hostname;return r===o||"."===r[r.length-o.length-1]&&r.endsWith(o)}(n.url,i))for(const e of["authorization","www-authenticate","cookie","cookie2"])s.headers.delete(e);return 303!==e.statusCode&&n.body&&null===B(n)?(o(new g("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void m()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==n.method)||(s.method="GET",s.body=void 0,s.headers.delete("content-length")),r(te(new W(i,s))),void m())}}e.once("end",(function(){u&&u.removeEventListener("abort",p)}));let s=e.pipe(new ee);const i={url:n.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:n.size,timeout:n.timeout,counter:n.counter},a=t.get("Content-Encoding");if(!n.compress||"HEAD"===n.method||null===a||204===e.statusCode||304===e.statusCode)return c=new M(s,i),void r(c);const l={flush:d.default.Z_SYNC_FLUSH,finishFlush:d.default.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return s=s.pipe(d.default.createGunzip(l)),c=new M(s,i),void r(c);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof d.default.createBrotliDecompress)return s=s.pipe(d.default.createBrotliDecompress()),c=new M(s,i),void r(c);c=new M(s,i),r(c)}else{e.pipe(new ee).once("data",(function(e){s=8==(15&e[0])?s.pipe(d.default.createInflate()):s.pipe(d.default.createInflateRaw()),c=new M(s,i),r(c)}))}})),function(e,t){const r=t.body;null===r?e.end():x(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(b,n)}))}te.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},te.Promise=global.Promise;var re=Object.freeze({__proto__:null,default:te,Headers:k,Request:W,Response:M,FetchError:g}),oe=i.getAugmentedNamespace(re);!function(e,t){const r=oe,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}(h,h.exports),exports.nodePonyfill=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./index-e948d9e4.cjs");function t(e,t){var i="string"==typeof e?Object.assign({},n[e]):e;if("object"!=typeof i)throw new Error("[Portis] illegal 'network' parameter. Read more about it here: https://docs.portis.io/#/configuration?id=network");if(!i.nodeUrl)throw new Error("[Portis] 'nodeUrl' is required. Read more about it here: https://docs.portis.io/#/configuration?id=network");if(t&&!i.gasRelayHubAddress)throw new Error("[Portis] can't find default gas relay hub for "+e);return"string"!=typeof e||t||delete i.gasRelayHubAddress,i}require("@ethersproject/providers"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/address"),require("valtio");var n={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"}},i=function(){return!("undefined"==typeof window||!window.document)},r=!1;function o(){return new Promise((function(e,t){i()?r?e():["loaded","interactive","complete"].indexOf(document.readyState)>-1?(r=!0,e()):window.addEventListener("load",(function(){r=!0,e()}),!1):t()}))}function a(){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 s={};Object.defineProperty(s,"__esModule",{value:!0});var c=s.default=s.ERR_NOT_IN_IFRAME=s.ERR_CONNECTION_TIMEOUT=s.ERR_CONNECTION_DESTROYED=void 0,u="handshake",d="handshake-reply",l="call",h="reply",f="fulfilled",g="rejected",p="message",v="ConnectionDestroyed";s.ERR_CONNECTION_DESTROYED=v;var m="ConnectionTimeout";s.ERR_CONNECTION_TIMEOUT=m;var w="NotInIframe";s.ERR_NOT_IN_IFRAME=w;var b,y={"http:":"80","https:":"443"},_=/^(https?:)?\/\/([^/:]+)(:(\d+))?/,E={ERR_CONNECTION_DESTROYED:v,ERR_CONNECTION_TIMEOUT:m,ERR_NOT_IN_IFRAME:w,Promise:function(){try{return window?window.Promise:null}catch(e){return null}}(),debug:!1},C=(b=0,function(){return++b}),P=function(){if(E.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))}},k=function(e){var t=[];return e((function(){t.forEach((function(e){e()}))})),{then:function(e){t.push(e)}}},I=function(e){return{name:e.name,message:e.message,stack:e.stack}},W=function(e,t,n,i){var r=t.localName,o=t.local,a=t.remote,s=t.remoteOrigin,c=!1;P("".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(P("".concat(r,": Sending ").concat(e,"() call")),c){var u=new Error("Unable to send ".concat(e,"() call due ")+"to destroyed connection");throw u.code=v,u}return new E.Promise((function(t,i){var c=C();o.addEventListener(p,(function n(u){if(u.source===a&&u.origin===s&&u.data.penpal===h&&u.data.id===c){P("".concat(r,": Received ").concat(e,"() reply")),o.removeEventListener(p,n);var d=u.data.returnValue;u.data.returnValueIsError&&(l=d,g=new Error,Object.keys(l).forEach((function(e){return g[e]=l[e]})),d=g),(u.data.resolution===f?t:i)(d)}var l,g})),a.postMessage({penpal:l,id:c,methodName:e,args:n},s)}))}};i.then((function(){c=!0})),n.reduce((function(e,t){return e[t]=u(t),e}),e)},x=function(e,t,n){var i=e.localName,r=e.local,o=e.remote,a=e.remoteOrigin,s=!1;P("".concat(i,": Connecting call receiver"));var c=function(e){if(e.source===o&&e.origin===a&&e.data.penpal===l){var n=e.data,r=n.methodName,c=n.args,u=n.id;if(P("".concat(i,": Received ").concat(r,"() call")),r in t){var d=function(e){return function(t){if(P("".concat(i,": Sending ").concat(r,"() reply")),s)P("".concat(i,": Unable to send ").concat(r,"() reply due to destroyed connection"));else{var n={penpal:h,id:u,resolution:e,returnValue:t};e===g&&t instanceof Error&&(n.returnValue=I(t),n.returnValueIsError=!0);try{o.postMessage(n,a)}catch(e){throw"DataCloneError"===e.name&&o.postMessage({penpal:h,id:u,resolution:g,returnValue:I(e),returnValueIsError:!0},a),e}}}};new E.Promise((function(e){return e(t[r].apply(t,c))})).then(d(f),d(g))}}};r.addEventListener(p,c),n.then((function(){s=!0,r.removeEventListener(p,c)}))};E.connectToChild=function(e){var t,n=e.url,i=e.appendTo,r=e.methods,o=void 0===r?{}:r,a=e.timeout,s=new k((function(e){t=e})),c=window,l=document.createElement("iframe");(i||document.body).appendChild(l),s.then((function(){l.parentNode&&l.parentNode.removeChild(l)}));var h=l.contentWindow||l.contentDocument.parentWindow,f=function(e){var t,n,i,r=document.location,o=_.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!==y[t]?":".concat(i):"";return"".concat(t,"//").concat(n).concat(a)}(n);return{promise:new E.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=m,i(e),t()}),a));var g,w,b={},y=function(t){if(t.source===h&&t.origin===f&&t.data.penpal===u){P("Parent: Received handshake, sending reply"),t.source.postMessage({penpal:d,methodNames:Object.keys(o)},t.origin);var n={localName:"Parent",local:c,remote:h,remoteOrigin:t.origin};w&&w();var i=new k((function(e){s.then(e),w=e}));x(n,o,i),g&&g.forEach((function(e){delete b[e]})),g=t.data.methodNames,W(b,n,g,s),clearTimeout(r),e(b)}};c.addEventListener(p,y),s.then((function(){c.removeEventListener(p,y);var e=new Error("Connection destroyed");e.code=v,i(e)})),P("Parent: Loading iframe"),l.src=n})),iframe:l,destroy:t}},E.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=w,s}var c=new k((function(t){e=t})),l=window,h=l.parent,f=new E.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=m,n(t),e()}),a));var s=function e(n){if(("*"===i||i===n.origin)&&n.source===h&&n.data.penpal===d){P("Child: Received handshake reply"),l.removeEventListener(p,e);var a={localName:"Child",local:l,remote:h,remoteOrigin:n.origin},s={};x(a,o,c),W(s,a,n.data.methodNames,c),clearTimeout(r),t(s)}};l.addEventListener(p,s),c.then((function(){l.removeEventListener(p,s);var e=new Error("Connection destroyed");e.code=v,n(e)})),P("Child: Sending handshake"),h.postMessage({penpal:u,methodNames:Object.keys(o)},i)}));return{promise:f,destroy:e}};var T=E;c=s.default=T;var A=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())}))},O=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])}}},M=process.env.PORTIS_WIDGET_URL||"https://widget.portis.io",N="por_portis-widget-frame",L="por_portis-container";var R=function(){function e(t,n){this._widgetConfig=t,this._clearProviderSession=n,this._widgetUrl=M,this._onLoginCallback=function(){},this._onLogoutCallback=function(){},this._onErrorCallback=function(){},a(),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 A(this,void 0,void 0,(function(){var e;return O(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 A(this,void 0,void 0,(function(){return O(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 A(this,void 0,void 0,(function(){return O(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 A(this,void 0,void 0,(function(){return O(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 A(this,void 0,void 0,(function(){return O(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"),A(this,void 0,void 0,(function(){return O(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 A(this,void 0,void 0,(function(){return O(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 A(this,void 0,void 0,(function(){return O(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 A(this,void 0,void 0,(function(){return O(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"),A(this,void 0,void 0,(function(){return O(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 A(this,void 0,void 0,(function(){return O(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(L).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 A(this,void 0,void 0,(function(){var t,n,i,r,a;return O(this,(function(s){switch(s.label){case 0:return[4,o()];case 1:return s.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=L,(i=document.createElement("div")).id="portis-container-"+Date.now(),i.className=N,n.appendChild(i),document.body.appendChild(n),document.head.appendChild(t),[4,(r=c.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(a=s.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:a,widgetFrame:i}]}}))}))},e.prototype._setHeight=function(e){return A(this,void 0,void 0,(function(){return O(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}(),S=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())}))},D=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])}}},U=require("ethereumjs-util"),j=U.addHexPrefix,B=U.stripHexPrefix,q=U.BN,F="0x5208";function G(e,t){return S(this,void 0,void 0,(function(){var n,i,r,o,a;return D(this,(function(s){switch(s.label){case 0:return[4,e.getBlockByNumber("latest",!1)];case 1:return n=s.sent(),[4,V(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,H(e,t,n.gasLimit,r)];case 4:return[2,s.sent()];case 5:return s.sent(),[2,r];case 6:return[2]}}))}))}function V(e,t,n){return S(this,void 0,void 0,(function(){var i,r,o;return D(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:F,simpleSend:!0,gasLimitSpecified:!1}]}a.label=2;case 2:return o=K(n),s=o,c=20,u=new q(19),d=new q(c),[2,{safeGas:Y(s.mul(u).div(d)),simpleSend:!1,gasLimitSpecified:!1}]}var s,c,u,d}))}))}function H(e,t,n,i){return S(this,void 0,void 0,(function(){var r;return D(this,(function(o){switch(o.label){case 0:return t.gas=i,r=j,[4,e.estimateGas(t)];case 1:return[2,z(r.apply(void 0,[o.sent()]),n)]}}))}))}function z(e,t){var n=K(e),i=K(t).muln(.9),r=n.muln(1.5);return n.gt(i)?Y(n):r.lt(i)?Y(r):Y(i)}function K(e){return new q(B(e),16)}function Y(e){return j(e.toString(16))}var J=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}(),Q=function(){return Q=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},Q.apply(this,arguments)},X=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())}))},Z=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])}}},$=require("web3-provider-engine"),ee=require("web3-provider-engine/dist/es5/subproviders/cache.js"),te=require("web3-provider-engine/dist/es5/subproviders/fixture.js"),ne=require("web3-provider-engine/dist/es5/subproviders/filters.js"),ie=require("web3-provider-engine/dist/es5/subproviders/hooked-wallet.js"),re=require("web3-provider-engine/dist/es5/subproviders/nonce-tracker.js"),oe=require("web3-provider-engine/dist/es5/subproviders/subscriptions.js"),ae=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,n){var i=t(e,n);this.clearSubprovider(re),this.clearSubprovider(ee),this.config.network=i},e.prototype._initProvider=function(){var e=this;if(this.engine)return this.engine;this.engine=new $;var t=new J(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 te({web3_clientVersion:"Portis/v"+this.config.version+"/javascript",net_listening:!0,eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0})),this.engine.addProvider(new ee),this.engine.addProvider(new oe),this.engine.addProvider(new ne),this.engine.addProvider(new re),this.engine.addProvider({setEngine:function(e){return e},handleRequest:function(t,n){return X(e,void 0,void 0,(function(){return Z(this,(function(e){return t.id||(t.id=42),n(),[2]}))}))}}),this.engine.addProvider(new ie({getAccounts:function(t){return X(e,void 0,void 0,(function(){var e,n,i;return Z(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 X(e,void 0,void 0,(function(){var e,i,r;return Z(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 X(e,void 0,void 0,(function(){var e,i,r,o,a;return Z(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Q({},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 X(e,void 0,void 0,(function(){var e,i,r,o,a;return Z(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Q({},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 X(e,void 0,void 0,(function(){var e,i,r,o,a;return Z(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Q({},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 X(e,void 0,void 0,(function(){var e,i,r,o,a;return Z(this,(function(s){switch(s.label){case 0:return[4,this._getWidgetCommunication()];case 1:return e=s.sent(),i=Q({},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 X(e,void 0,void 0,(function(){var e;return Z(this,(function(r){switch(r.label){case 0:return[4,G(t,n)];case 1:return e=r.sent(),i(null,e),[2]}}))}))},getGasPrice:function(t){return X(e,void 0,void 0,(function(){return Z(this,(function(e){return t(null,""),[2]}))}))}})),this.engine.addProvider({setEngine:function(e){return e},handleRequest:function(t,n,i){return X(e,void 0,void 0,(function(){var e,n,r;return Z(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}(),se=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())}))},ce=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])}}},ue=["email","reputation"];o().then((function(){document.getElementsByClassName(N).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 de=function(){function e(e,n,r){if(void 0===r&&(r={}),!i())return new Proxy(this,{get:function(e,t){return e[t]instanceof Function?function(){}:void 0}});a(),this._validateParams(e,n,r),this._config={dappId:e,network:t(n,r.gasRelay),version:"4.0.7",scope:r.scope,registerPageByDefault:r.registerPageByDefault,staging:r.staging,feature:r.feature},this._getWidgetCommunication=this._getWidgetCommunication.bind(this),this._widgetManagerInstance=new R(this.config,this._clearProviderSession),this._web3ManagerInstance=new ae(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 se(this,void 0,void 0,(function(){return ce(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 se(this,void 0,void 0,(function(){return ce(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 se(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._widgetManager.showPortis()]}))}))},e.prototype.getCampaignInfo=function(e){return se(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._widgetManager.getCampaignInfo(e)]}))}))},e.prototype.claimVoucher=function(e){return se(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._widgetManager.claimVoucher(e)]}))}))},e.prototype.logout=function(){return se(this,void 0,void 0,(function(){return ce(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"),se(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._widgetManager.getExtendedPublicKey(e,t)]}))}))},e.prototype.importWallet=function(e){return se(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._widgetManager.importWallet(e)]}))}))},e.prototype.isLoggedIn=function(){return se(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._widgetManager.isLoggedIn()]}))}))},e.prototype.signBitcoinTransaction=function(e){return se(this,void 0,void 0,(function(){return ce(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"),se(this,void 0,void 0,(function(){return ce(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 ue.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}(),le=de;exports.default=function(t,n){var i=t.chainId,r=t.portisParams;return e.__awaiter(this,void 0,void 0,(function(){var t,o;return e.__generator(this,(function(a){switch(a.label){case 0:if(!(null==r?void 0:r.id))throw new Error("uAuthParams is not valid.");switch(t="",i){case 1:default:t="mainnet";break;case 5:t="goerli"}return[4,(o=new le(r.id,t,r.config)).provider.enable()];case 1:return a.sent(),o.provider._portis=o,o.provider.on("connect",n.connect),o.provider.on("disconnect",n.disconnect),o.provider.on("accountsChanged",n.accountsChanged),o.provider.on("chainChanged",n.chainChanged),o.provider.on("message",n.message),[2,e.convertWeb3Provider(o.provider)]}}))}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./index-e948d9e4.cjs");require("@ethersproject/providers"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/address"),require("valtio");var t="dapp-inpage-integration",n="openblock-content-integration",i=["https://cocoswap.com","https://app.openocean.finance"],r=["https://oec.cocoswap.com"],o=function(){function o(){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 o.prototype.getProviderData=function(){var t;return e.__awaiter(this,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this.request("metamask_getProviderState")];case 1:return n=e.sent(),this.chainId=null==n?void 0:n.chainId,this.networkVersion=null==n?void 0:n.networkVersion,this.selectedAddress=null===(t=null==n?void 0:n.accounts)||void 0===t?void 0:t[0],[2]}}))}))},o.prototype.request=function(t){return e.__awaiter(this,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){switch(e.label){case 0:return"eth_requestAccounts"!==t.method?[3,2]:[4,this._hookRequest("eth_accounts")];case 1:if((n=e.sent()).length)return[2,new Promise((function(e){return e(n)}))];e.label=2;case 2:return[2,this._hookRequest(t)]}}))}))},o.prototype.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(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]}))}))},o.prototype.sendAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.__awaiter(this,void 0,void 0,(function(){var n,i;return e.__generator(this,(function(e){return n={method:t[0].method,params:t[0].params},i=t[0].id,this.request(n).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]}))}))},o.prototype.isConnected=function(){return!0},o.prototype.enable=function(){return e.__awaiter(this,void 0,void 0,(function(){var t;return e.__generator(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"})]}}))}))},o.prototype.on=function(t,n){var i;"string"==typeof t&&"function"==typeof n&&(this.eventListener[t]&&this.eventListener[t].length>5||(this.eventListener[t]?(this.eventListener[t].push(n),this.eventListener[t]=Array.from(new Set(this.eventListener[t]))):this.eventListener[t]||(this.eventListener=e.__assign(e.__assign({},this.eventListener),((i={})[t]=[n],i))),this._registerEvent(t)))},o.prototype.removeListener=function(){},o.prototype._initInpageListener=function(){var e=this;window.addEventListener("message",(function(n){var i,r,o;if(n.data.target===t){var s=null===(o=null===(r=null===(i=n.data)||void 0===i?void 0:i.value)||void 0===r?void 0:r.data)||void 0===o?void 0:o.mark;s&&("call_method"===s.type?e._handleNormalMethod(s,n):"register_event"===s.type&&e._handleEventMethod(s,n))}}),!1)},o.prototype._handleNormalMethod=function(e,t){var n,i,r,o,s;(null===(n=t.data.value.data)||void 0===n?void 0:n.error)?null===(i=this.callBackList[e.id])||void 0===i||i.reject(null===(r=t.data.value.data)||void 0===r?void 0:r.error):null===(o=this.callBackList[e.id])||void 0===o||o.resolve(null===(s=t.data.value.data)||void 0===s?void 0:s.result),delete this.callBackList[e.id]},o.prototype._handleEventMethod=function(e,t){var n,o,s,a,d,u,c,h=this,l=null===(a=null===(s=null===(o=null===(n=t.data)||void 0===n?void 0:n.value)||void 0===o?void 0:o.data)||void 0===s?void 0:s.mark)||void 0===a?void 0:a.eventName,v=null===(c=null===(u=null===(d=t.data)||void 0===d?void 0:d.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(e){"chainChanged"===l&&(h.chainId=v,h.networkVersion=Number(v)),r.includes(window.location.origin)&&"chainChanged"===l||(i.includes(window.location.origin)?window.location.reload():e(v))}))}},o.prototype._hookRequest=function(i){var r=this;return new Promise((function(o,s){var a=function(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+e()+e()+e()+e()+e()+e()}();"string"==typeof i&&(i={method:i}),i=e.__assign(e.__assign({},i),{mark:{id:a,method:i.method,type:"call_method"}}),window.parent.postMessage({from:t,target:n,data:i},"*"),r.callBackList[a]={resolve:o,reject:s}}))},o.prototype._registerEvent=function(e){var i={mark:{eventName:e,type:"register_event"},eventName:e};window.parent.postMessage({from:t,target:n,data:i},"*")},o.prototype._getExperimentalApi=function(){return new Proxy({isUnlocked:function(){return new Promise((function(e){return e(!0)}))}},{get:function(t,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];return Reflect.get.apply(Reflect,e.__spreadArray([t,n],e.__read(i),!1))}})},o}();exports.default=function(){var t;if(null===(t=window.obethereum)||void 0===t?void 0:t.isOpenBlock)return window.obethereum;var n=new o;n=new Proxy(n,{deleteProperty:function(){return!0}});try{Object.defineProperty(window,"obethereum",{set:function(e){console.log("set ethereum",e)},get:function(){return n}})}catch(e){console.log("initializeProvider error",e),window.obethereum=n}return window.web3=e.__assign({},window.web3),window.web3.currentProvider=n,window.dispatchEvent(new Event("ethereum#initialized")),n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t,n=require("./_commonjsHelpers-66ecbaf8.cjs"),e=require("./bn-1bd77809.cjs"),r={exports:{}};function i(){return t||(t=1,i=r,n.commonjsGlobal,i.exports=(o=o||function(t,r){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!==n.commonjsGlobal&&n.commonjsGlobal.crypto&&(i=n.commonjsGlobal.crypto),!i&&"function"==typeof e.commonjsRequire)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 e;return t.prototype=n,e=new t,t.prototype=null,e}}(),a={},c=a.lib={},u=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)}},f=c.WordArray=u.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=r?n:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var n=this.words,e=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=e[o>>>2]>>>24-o%4*8&255;n[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)n[r+a>>>2]=e[a>>>2];return this.sigBytes+=i,this},clamp:function(){var n=this.words,e=this.sigBytes;n[e>>>2]&=4294967295<<32-e%4*8,n.length=t.ceil(e/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var n=[],e=0;e<t;e+=4)n.push(o());return new f.init(n,t)}}),h=a.enc={},l=h.Hex={stringify:function(t){for(var n=t.words,e=t.sigBytes,r=[],i=0;i<e;i++){var o=n[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var n=t.length,e=[],r=0;r<n;r+=2)e[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new f.init(e,n/2)}},p=h.Latin1={stringify:function(t){for(var n=t.words,e=t.sigBytes,r=[],i=0;i<e;i++){var o=n[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var n=t.length,e=[],r=0;r<n;r++)e[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new f.init(e,n)}},d=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},y=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(n){var e,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=n?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,u=t.min(4*c,o);if(c){for(var h=0;h<c;h+=s)this._doProcessBlock(i,h);e=i.splice(0,c),r.sigBytes-=u}return new f.init(e,u)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});c.Hasher=y.extend({cfg:u.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,e){return new t.init(e).finalize(n)}},_createHmacHelper:function(t){return function(n,e){return new g.HMAC.init(t,e).finalize(n)}}});var g=a.algo={};return a}(Math),o)),r.exports;var i,o}var o,s,a={exports:{}};o=a,n.commonjsGlobal,o.exports=(s=i(),function(t){var n=s,e=n.lib,r=e.WordArray,i=e.Hasher,o=n.algo,a=[],c=[];!function(){function n(n){for(var e=t.sqrt(n),r=2;r<=e;r++)if(!(n%r))return!1;return!0}function e(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)n(r)&&(i<8&&(a[i]=e(t.pow(r,.5))),c[i]=e(t.pow(r,1/3)),i++),r++}();var u=[],f=o.SHA256=i.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(t,n){for(var e=this._hash.words,r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],f=e[5],h=e[6],l=e[7],p=0;p<64;p++){if(p<16)u[p]=0|t[n+p];else{var d=u[p-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=u[p-2],w=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=y+u[p-7]+w+u[p-16]}var m=r&i^r&o^i&o,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),_=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&h)+c[p]+u[p];l=h,h=f,f=a,a=s+_|0,s=o,o=i,i=r,r=_+(v+m)|0}e[0]=e[0]+r|0,e[1]=e[1]+i|0,e[2]=e[2]+o|0,e[3]=e[3]+s|0,e[4]=e[4]+a|0,e[5]=e[5]+f|0,e[6]=e[6]+h|0,e[7]=e[7]+l|0},_doFinalize:function(){var n=this._data,e=n.words,r=8*this._nDataBytes,i=8*n.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=t.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,n.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=i._createHelper(f),n.HmacSHA256=i._createHmacHelper(f)}(Math),s.SHA256),exports.requireCore=i,exports.sha256=a;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";var t,r=require("./_commonjsHelpers-66ecbaf8.cjs"),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
|
+
*/
|
|
10
|
+
t=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=r.commonjsGlobal:o&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&t.exports,a=!i.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),f=[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)}),!a||!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 z(t,r,t).update(n)[e]()}},A=function(t,r,e){return function(n,i){return new z(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 z(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 z(t,r,e)},e.update=function(t,r){return e.create(r).update(t)},B(e,A,t,r)}},{name:"cshake",padding:f,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 z(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:f,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 j=C.name+m[E];S.push(j),k[j]=k[O]}}function z(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){z.call(this,t,r,e)}z.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(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,s=this.blocks,u=this.byteCount,f=t.length,h=this.blockCount,p=0,d=this.s;p<f;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<h+1;++i)s[i]=0;if(r)for(i=this.start;p<f&&i<u;++p)s[i>>2]|=t[p]<<c[3&i++];else for(i=this.start;p<f&&i<u;++p)(o=t.charCodeAt(p))<128?s[i>>2]|=o<<c[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++p)),s[i>>2]|=(240|o>>18)<<c[3&i++],s[i>>2]|=(128|o>>12&63)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=s[h],i=0;i<h;++i)d[i]^=s[i];J(d),this.reset=!0}else this.start=i}return this},z.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},z.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(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}var i=0,o=t.length;if(r)i=o;else for(var s=0;s<t.length;++s){var u=t.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},z.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},z.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)}},z.prototype.toString=z.prototype.hex=function(){this.finalize();for(var t,r=this.blockCount,e=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<r&&s<n;++o,++s)t=e[o],a+=u[t>>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15];s%r==0&&(J(e),o=0)}return i&&(t=e[o],a+=u[t>>4&15]+u[15&t],i>1&&(a+=u[t>>12&15]+u[t>>8&15]),i>2&&(a+=u[t>>20&15]+u[t>>16&15])),a},z.prototype.arrayBuffer=function(){this.finalize();var t,r=this.blockCount,e=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<r&&s<n;++o,++s)u[s]=e[o];s%r==0&&J(e)}return i&&(u[o]=e[o],t=t.slice(0,a)),t},z.prototype.buffer=z.prototype.arrayBuffer,z.prototype.digest=z.prototype.array=function(){this.finalize();for(var t,r,e=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<e&&a<i;++s,++a)t=a<<2,r=n[s],u[t]=255&r,u[t+1]=r>>8&255,u[t+2]=r>>16&255,u[t+3]=r>>24&255;a%e==0&&J(n)}return o&&(t=a<<2,r=n[s],u[t]=255&r,o>1&&(u[t+1]=r>>8&255),o>2&&(u[t+2]=r>>16&255)),u},N.prototype=new z,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),z.prototype.finalize.call(this)};var J=function(t){var r,e,n,i,o,s,a,u,f,c,p,d,l,y,b,A,v,w,B,_,g,k,S,x,C,m,E,O,j,z,N,J,M,H,I,R,U,V,F,D,W,Y,q,G,K,$,L,P,Q,T,X,Z,tt,rt,et,nt,it,ot,st,at,ut,ft,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],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=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])^(s<<1|a>>>31),e=(l=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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^(u<<1|f>>>31),e=o^(f<<1|u>>>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=s^(c<<1|p>>>31),e=a^(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=u^(d<<1|l>>>31),e=f^(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],$=t[11]<<4|t[10]>>>28,L=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,j=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,q=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,P=t[22]<<10|t[23]>>>22,Q=t[23]<<10|t[22]>>>22,z=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,ft=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,T=t[34]<<15|t[35]>>>17,X=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,Z=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,K=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,st=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&j,t[20]=H^~R&V,t[21]=I^~U&F,t[30]=G^~$&P,t[31]=K^~L&Q,t[40]=rt^~nt&ot,t[41]=et^~it&st,t[2]=A^~w&_,t[3]=v^~B&g,t[12]=m^~O&z,t[13]=E^~j&N,t[22]=R^~V&D,t[23]=U^~F&W,t[32]=$^~P&T,t[33]=L^~Q&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=w^~_&k,t[5]=B^~g&S,t[14]=O^~z&J,t[15]=j^~N&M,t[24]=V^~D&Y,t[25]=F^~W&q,t[34]=P^~T&Z,t[35]=Q^~X&tt,t[44]=ot^~at&ft,t[45]=st^~ut&ct,t[6]=_^~k&y,t[7]=g^~S&b,t[16]=z^~J&x,t[17]=N^~M&C,t[26]=D^~Y&H,t[27]=W^~q&I,t[36]=T^~Z&G,t[37]=X^~tt&K,t[46]=at^~ft&rt,t[47]=ut^~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]=q^~I&U,t[38]=Z^~G&$,t[39]=tt^~K&L,t[48]=ft^~rt&nt,t[49]=ct^~et&it,t[0]^=h[n],t[1]^=h[n+1]};if(s)t.exports=k;else for(x=0;x<S.length;++x)i[S[x]]=k[S[x]]}();var n=e.exports;exports.sha3=n,exports.sha3$1=e;
|