ethers.js/packages/ethers/dist/ethers-all.esm.min.js

11 lines
374 KiB
JavaScript
Raw Normal View History

var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,r){return e(r={exports:{}},r.exports),r.exports}function n(e){return e&&e.default||e}var i=n(Object.freeze({default:{}})),o=t((function(r){!function(e,r){function t(e,r){if(!e)throw new Error(r||"Assertion failed")}function n(e,r){e.super_=r;var t=function(){};t.prototype=r.prototype,e.prototype=new t,e.prototype.constructor=e}function o(e,r,t){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==r&&"be"!==r||(t=r,r=10),this._init(e||0,r||10,t||"be"))}var a;"object"==typeof e?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{a=i.Buffer}catch(e){}function s(e,r,t){for(var n=0,i=Math.min(e.length,t),o=r;o<i;o++){var a=e.charCodeAt(o)-48;n<<=4,n|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function l(e,r,t,n){for(var i=0,o=Math.min(e.length,t),a=r;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,r){return e.cmp(r)>0?e:r},o.min=function(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof e)return this._initArray(e,r,n);"hex"===r&&(r=16),t(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===r?this._parseHex(e,i):this._parseBase(e,r,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initNumber=function(e,r,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(t(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function(e,r,n){if(t("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var t=0;t<this.length;t++)this.words[t]=0;var n,i,o=0;for(t=e.length-6,n=0;t>=r;t-=6)i=s(e,t,t+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);t+6!==r&&(i=s(e,r,t+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,r,t){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=r)n++;n--,i=i/r|0;for(var o=e.length-t,a=o%n,s=Math.min(o,o-a)+t,u=0,c=t;c<s;c+=n)u=l(e,c,c+n,r),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var h=1;for(u=l(e,c,e.length,r),c=0;c<a;c++)h*=r;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},o.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+t
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.5.7
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2016
* @license MIT
*/
2019-11-24 18:02:22 +03:00
!function(){var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=e);for(var n=!t.JS_SHA3_NO_COMMON_JS&&r.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],a=[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],s=[224,256,384,512],l=["hex","buffer","arrayBuffer","array"],u=function(e,r,t){return function(n){return new A(e,r,e).update(n)[t]()}},c=function(e,r,t){return function(n,i){return new A(e,r,i).update(n)[t]()}},h=function(e,r){var t=u(e,r,"hex");t.create=function(){return new A(e,r,e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<l.length;++n){var i=l[n];t[i]=u(e,r,i)}return t},f=[{name:"keccak",padding:[1,256,65536,16777216],bits:s,createMethod:h},{name:"sha3",padding:[6,1536,393216,100663296],bits:s,createMethod:h},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(e,r){var t=c(e,r,"hex");t.create=function(t){return new A(e,r,t)},t.update=function(e,r){return t.create(r).update(e)};for(var n=0;n<l.length;++n){var i=l[n];t[i]=c(e,r,i)}return t}}],d={},p=[],g=0;g<f.length;++g)for(var m=f[g],v=m.bits,b=0;b<v.length;++b){var y=m.name+"_"+v[b];p.push(y),d[y]=m.createMethod(v[b],m.padding)}function A(e,r,t){this.blocks=[],this.s=[],this.padding=r,this.outputBits=t,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var n=0;n<50;++n)this.s[n]=0}A.prototype.update=function(e){var r="string"!=typeof e;r&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var t,n,i=e.length,a=this.blocks,s=this.byteCount,l=this.blockCount,u=0,c=this.s;u<i;){if(this.reset)for(this.reset=!1,a[0]=this.block,t=1;t<l+1;++t)a[t]=0;if(r)for(t=this.start;u<i&&t<s;++u)a[t>>2]|=e[u]<<o[3&t++];else for(t=this.start;u<i&&t<s;++u)(n=e.charCodeAt(u))<128?a[t>>2]|=n<<o[3&t++]:n<2048?(a[t>>2]|=(192|n>>6)<<o[3&t++],a[t>>2]|=(128|63&n)<<o[3&t++]):n<55296||n>=57344?(a[t>>2]|=(224|n>>12)<<o[3&t++],a[t>>2]|=(128|n>>6&63)<<o[3&t++],a[t>>2]|=(128|63&n)<<o[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++u)),a[t>>2]|=(240|n>>18)<<o[3&t++],a[t>>2]|=(128|n>>12&63)<<o[3&t++],a[t>>2]|=(128|n>>6&63)<<o[3&t++],a[t>>2]|=(128|63&n)<<o[3&t++]);if(this.lastByteIndex=t,t>=s){for(this.start=t-s,this.block=a[l],t=0;t<l;++t)c[t]^=a[t];T(c),this.reset=!0}else this.start=t}return this},A.prototype.finalize=function(){var e=this.blocks,r=this.lastByteIndex,t=this.blockCount,n=this.s;if(e[r>>2]|=this.padding[3&r],this.lastByteIndex===this.byteCount)for(e[0]=e[t],r=1;r<t+1;++r)e[r]=0;for(e[t-1]|=2147483648,r=0;r<t;++r)n[r]^=e[r];T(n)},A.prototype.toString=A.prototype.hex=function(){this.finalize();for(var e,r=this.blockCount,t=this.s,n=this.outputBlocks,o=this.extraBytes,a=0,s=0,l="";s<n;){for(a=0;a<r&&s<n;++a,++s)e=t[a],l+=i[e>>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];s%r==0&&(T(t),a=0)}return o&&(e=t[a],o>0&&(l+=i[e>>4&15]+i[15&e]),o>1&&(l+=i[e>>12&15]+i[e>>8&15]),o>2&&(l+=i[e>>20&15]+i[e>>16&15])),l},A.prototype.arrayBuffer=function(){this.finalize();var e,r=this.blockCount,t=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var l=new Uint32Array(e);a<n;){for(o=0;o<r&&a<n;++o,++a)l[a]=t[o];a%r==0&&T(t)}return i&&(l[o]=t[o],e=e.slice(0,s)),e},A.prototype.buffer=A.prototype.arrayBuffer,A.prototype.digest=A.prototype.array=function(){this.finalize();for(var e,r,t=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,l=[];s<i;){for(a=0;a<t&&s<i;++a,++s)e=s<<2,r=n[a],l[e]=255&r,l[e+1]=r>>8&255,l[e+2]=r>>16&255,l[e+3]=r>>24&255;s%t==0&&T(n)}return o&&(e=s<<2,r=n[a],o>0&&(l[e]=255&r),o>1&&(l[e+1]=r>>8&255),o>2&&(l[e