ethers.js/packages/hardware-wallets/dist/hardware-wallets.esm.min.js

2 lines
45 KiB
JavaScript
Raw Normal View History

2020-01-11 04:09:40 +03:00
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var n=r((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r={};t.ethers=r;var n=window;null==n._ethers?console.log("WARNING: @ethersproject/hardware-wallet requires ethers loaded first"):t.ethers=r=n._ethers})),o=(t(n),n.ethers);var i="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,h=!1;function f(){h=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)s[t]=e[t],a[e.charCodeAt(t)]=t;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63}function c(e,t,r){for(var n,o,i=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(s[(o=n)>>18&63]+s[o>>12&63]+s[o>>6&63]+s[63&o]);return i.join("")}function l(e){var t;h||f();for(var r=e.length,n=r%3,o="",i=[],a=0,u=r-n;a<u;a+=16383)i.push(c(e,a,a+16383>u?u:a+16383));return 1===n?(t=e[r-1],o+=s[t>>2],o+=s[t<<4&63],o+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],o+=s[t>>10],o+=s[t>>4&63],o+=s[t<<2&63],o+="="),i.push(o),i.join("")}function p(e,t,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,h=u>>1,f=-7,c=r?o-1:0,l=r?-1:1,p=e[t+c];for(c+=l,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+e[t+c],c+=l,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+e[t+c],c+=l,f-=8);if(0===i)i=1-h;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=h}return(p?-1:1)*s*Math.pow(2,i-n)}function d(e,t,r,n,o,i){var s,a,u,h=8*i-o-1,f=(1<<h)-1,c=f>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(t*u-1)*Math.pow(2,o),s+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,o),s=0));o>=8;e[r+p]=255&a,p+=d,a/=256,o-=8);for(s=s<<o|a,h+=o;h>0;e[r+p]=255&s,p+=d,s/=256,h-=8);e[r+p-d]|=128*g}var g={}.toString,v=Array.isArray||function(e){return"[object Array]"==g.call(e)};w.TYPED_ARRAY_SUPPORT=void 0===i.TYPED_ARRAY_SUPPORT||i.TYPED_ARRAY_SUPPORT;y();function y(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function E(e,t){if(y()<t)throw new RangeError("Invalid typed array length");return w.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=w.prototype:(null===e&&(e=new w(t)),e.length=t),e}function w(e,t,r){if(!(w.TYPED_ARRAY_SUPPORT||this instanceof w))return new w(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return T(this,e)}return m(this,e,t,r)}function m(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);w.TYPED_ARRAY_SUPPORT?(e=t).__proto__=w.prototype:e=A(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!w.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|b(t,r),o=(e=E(e,n)).write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(I(t)){var r=0|R(t.length);return 0===(e=E(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?E(e,0):A(e,t);if("Buffer"===t.type&&v(t.data))return A(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function _(e){if("number"!=typeof e)throw new T