1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[964],{5553:function(t,r,e){"use strict";e.d(r,{bM:function(){return y},vz:function(){return F}});var o=e(6441),n=e(1581),i=e(8794),s=e(2593);const a=new n.Yd(i.i),u={},l=s.O$.from(0),f=s.O$.from(-1);function m(t,r,e,o){const i={fault:r,operation:e};return void 0!==o&&(i.value=o),a.throwError(t,n.Yd.errors.NUMERIC_FAULT,i)}let c="0";for(;c.length<256;)c+=c;function h(t){if("number"!==typeof t)try{t=s.O$.from(t).toNumber()}catch(r){}return"number"===typeof t&&t>=0&&t<=256&&!(t%1)?"1"+c.substring(0,t):a.throwArgumentError("invalid decimal size","decimals",t)}function d(t,r){null==r&&(r=0);const e=h(r),o=(t=s.O$.from(t)).lt(l);o&&(t=t.mul(f));let n=t.mod(e).toString();for(;n.length<e.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const i=t.div(e).toString();return t=1===e.length?i:i+"."+n,o&&(t="-"+t),t}function g(t,r){null==r&&(r=0);const e=h(r);"string"===typeof t&&t.match(/^-?[0-9.]+$/)||a.throwArgumentError("invalid decimal value","value",t);const o="-"===t.substring(0,1);o&&(t=t.substring(1)),"."===t&&a.throwArgumentError("missing value","value",t);const n=t.split(".");n.length>2&&a.throwArgumentError("too many decimal points","value",t);let i=n[0],u=n[1];for(i||(i="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>e.length-1&&m("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.length<e.length-1;)u+="0";const l=s.O$.from(i),c=s.O$.from(u);let d=l.mul(e).add(c);return o&&(d=d.mul(f)),d}class v{constructor(t,r,e,o){t!==u&&a.throwError("cannot use FixedFormat constructor; use FixedFormat.from",n.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=e,this.decimals=o,this.name=(r?"":"u")+"fixed"+String(e)+"x"+String(o),this._multiplier=h(o),Object.freeze(this)}static from(t){if(t instanceof v)return t;"number"===typeof t&&(t=`fixed128x${t}`);let r=!0,e=128,o=18;if("string"===typeof t)if("fixed"===t);else if("ufixed"===t)r=!1;else{const n=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);n||a.throwArgumentError("invalid fixed format","format",t),r="u"!==n[1],e=parseInt(n[2]),o=parseInt(n[3])}else if(t){const n=(r,e,o)=>null==t[r]?o:(typeof t[r]!==e&&a.throwArgumentError("invalid fixed format ("+r+" not "+e+")","format."+r,t[r]),t[r]);r=n("signed","boolean",r),e=n("width","number",e),o=n("decimals","number",o)}return e%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",e),o>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",o),new v(u,r,e,o)}}class p{constructor(t,r,e,o){t!==u&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",n.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=o,this._hex=r,this._value=e,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const r=g(this._value,this.format.decimals),e=g(t._value,t.format.decimals);return p.fromValue(r.add(e),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const r=g(this._value,this.format.decimals),e=g(t._value,t.format.decimals);return p.fromValue(r.sub(e),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const r=g(this._value,this.format.decimals),e=g(t._value,t.format.decimals);return p.fromValue(r.mul(e).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const r=g(this._value,this.format.decimals),e=g(t._value,t.format.decimals);return p.fromValue(r.mul(this.format._multiplier).div(e),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let r=p.from(t[0],this.format);const e=!t[1].match(/^(0*)$/);return this.isNegative()&&e&&(r=r.subUnsafe(w.toFormat(r.format))),r}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let r=p.from(t[0],this.format);const e=!t[1].match(/^(0*)$/);return!this.isNegative()&&e&&(r=r.addUnsafe(w.toFormat(r.format))),r}round(t){null==t&&(t=0);const r=this.toString().split(".");if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&a.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;const e=p.from("1"+c.substring(0,t),this.format),o=x.toFormat(this.format);return this.mulUnsafe(e).addUnsafe(o).floor().divUnsafe(e)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&a.throwArgumentError("invalid byte width","width",t);const r=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return(0,o.$m)(r,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return p.fromString(this._value,t)}static fromValue(t,r,e){return null!=e||null==r||(0,s.Zm)(r)||(e=r,r=null),null==r&&(r=0),null==e&&(e="fixed"),p.fromString(d(t,r),v.from(e))}static fromString(t,r){null==r&&(r="fixed");const e=v.from(r),n=g(t,e.decimals);!e.signed&&n.lt(l)&&m("unsigned value cannot be negative","overflow","value",t);let i=null;e.signed?i=n.toTwos(e.width).toHexString():(i=n.toHexString(),i=(0,o.$m)(i,e.width/8));const s=d(n,e.decimals);return new p(u,i,s,e)}static fromBytes(t,r){null==r&&(r="fixed");const e=v.from(r);
1if((0,o.lE)(t).length>e.width/8)throw new Error("overflow");let n=s.O$.from(t);e.signed&&(n=n.fromTwos(e.width));const i=n.toTwos((e.signed?0:1)+e.width).toHexString(),a=d(n,e.decimals);return new p(u,i,a,e)}static from(t,r){if("string"===typeof t)return p.fromString(t,r);if((0,o._t)(t))return p.fromBytes(t,r);try{return p.fromValue(t,0,r)}catch(e){if(e.code!==n.Yd.errors.INVALID_ARGUMENT)throw e}return a.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const w=p.from(1),x=p.from("0.5"),b=new n.Yd("units/5.6.1"),_=["wei","kwei","mwei","gwei","szabo","finney","ether"];function y(t,r){if("string"===typeof r){const t=_.indexOf(r);-1!==t&&(r=3*t)}return d(t,null!=r?r:18)}function F(t,r){if("string"!==typeof t&&b.throwArgumentError("value must be a string","value",t),"string"===typeof r){const t=_.indexOf(r);-1!==t&&(r=3*t)}return g(t,null!=r?r:18)}},2705:function(t,r,e){var o=e(5639).Symbol;t.exports=o},2488:function(t){t.exports=function(t,r){for(var e=-1,o=r.length,n=t.length;++e<o;)t[n+e]=r[e];return t}},1078:function(t,r,e){var o=e(2488),n=e(7285);t.exports=function t(r,e,i,s,a){var u=-1,l=r.length;for(i||(i=n),a||(a=[]);++u<l;){var f=r[u];e>0&&i(f)?e>1?t(f,e-1,i,s,a):o(a,f):s||(a[a.length]=f)}return a}},5221:function(t,r,e){var o=e(2705),n=e(9607),i=e(2333),s=o?o.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?n(t):i(t)}},9454:function(t,r,e){var o=e(5221),n=e(7005);t.exports=function(t){return n(t)&&"[object Arguments]"==o(t)}},1957:function(t,r,e){var o="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;t.exports=o},9607:function(t,r,e){var o=e(2705),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,a=o?o.toStringTag:void 0;t.exports=function(t){var r=i.call(t,a),e=t[a];try{t[a]=void 0;var o=!0}catch(u){}var n=s.call(t);return o&&(r?t[a]=e:delete t[a]),n}},7285:function(t,r,e){var o=e(2705),n=e(5694),i=e(1469),s=o?o.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||n(t)||!!(s&&t&&t[s])}},2333:function(t){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},5639:function(t,r,e){var o=e(1957),n="object"==typeof self&&self&&self.Object===Object&&self,i=o||n||Function("return this")();t.exports=i},5564:function(t,r,e){var o=e(1078);t.exports=function(t){return(null==t?0:t.length)?o(t,1):[]}},5694:function(t,r,e){var o=e(9454),n=e(7005),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,u=o(function(){return arguments}())?o:function(t){return n(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=u},1469:function(t){var r=Array.isArray;t.exports=r},7005:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.