sui-explorer-local
Version:
Local Sui Explorer
2 lines (1 loc) • 20.1 kB
JavaScript
import{u as Ae,a as Se}from"./index-d4ae957a.js";import{S as _e}from"./index-71a27fc6.js";import{r as we}from"./index-76fb7be0.js";var xe=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ce=Math.ceil,q=Math.floor,T="[BigNumber Error] ",me=T+"Number primitive has more than 15 significant digits: ",z=1e14,O=14,ae=9007199254740991,he=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],K=1e7,M=1e9;function de(p){var w,N,_,g=h.prototype={constructor:h,toString:null,valueOf:null},B=new h(1),d=20,R=4,C=-7,y=21,Q=-1e7,$=1e7,J=!1,b=1,Y=0,te={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Z="0123456789abcdefghijklmnopqrstuvwxyz",fe=!0;function h(e,r){var i,o,t,l,c,n,f,u,s=this;if(!(s instanceof h))return new h(e,r);if(r==null){if(e&&e._isBigNumber===!0){s.s=e.s,!e.c||e.e>$?s.c=s.e=null:e.e<Q?s.c=[s.e=0]:(s.e=e.e,s.c=e.c.slice());return}if((n=typeof e=="number")&&e*0==0){if(s.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,c=e;c>=10;c/=10,l++);l>$?s.c=s.e=null:(s.e=l,s.c=[e]);return}u=String(e)}else{if(!xe.test(u=String(e)))return _(s,u,n);s.s=u.charCodeAt(0)==45?(u=u.slice(1),-1):1}(l=u.indexOf("."))>-1&&(u=u.replace(".","")),(c=u.search(/e/i))>0?(l<0&&(l=c),l+=+u.slice(c+1),u=u.substring(0,c)):l<0&&(l=u.length)}else{if(v(r,2,Z.length,"Base"),r==10&&fe)return s=new h(e),F(s,d+s.e+1,R);if(u=String(e),n=typeof e=="number"){if(e*0!=0)return _(s,u,n,r);if(s.s=1/e<0?(u=u.slice(1),-1):1,h.DEBUG&&u.replace(/^0\.0*|\./,"").length>15)throw Error(me+e)}else s.s=u.charCodeAt(0)===45?(u=u.slice(1),-1):1;for(i=Z.slice(0,r),l=c=0,f=u.length;c<f;c++)if(i.indexOf(o=u.charAt(c))<0){if(o=="."){if(c>l){l=f;continue}}else if(!t&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){t=!0,c=-1,l=0;continue}return _(s,String(e),n,r)}n=!1,u=N(u,r,10,s.s),(l=u.indexOf("."))>-1?u=u.replace(".",""):l=u.length}for(c=0;u.charCodeAt(c)===48;c++);for(f=u.length;u.charCodeAt(--f)===48;);if(u=u.slice(c,++f)){if(f-=c,n&&h.DEBUG&&f>15&&(e>ae||e!==q(e)))throw Error(me+s.s*e);if((l=l-c-1)>$)s.c=s.e=null;else if(l<Q)s.c=[s.e=0];else{if(s.e=l,s.c=[],c=(l+1)%O,l<0&&(c+=O),c<f){for(c&&s.c.push(+u.slice(0,c)),f-=O;c<f;)s.c.push(+u.slice(c,c+=O));c=O-(u=u.slice(c)).length}else c-=f;for(;c--;u+="0");s.c.push(+u)}}else s.c=[s.e=0]}h.clone=de,h.ROUND_UP=0,h.ROUND_DOWN=1,h.ROUND_CEIL=2,h.ROUND_FLOOR=3,h.ROUND_HALF_UP=4,h.ROUND_HALF_DOWN=5,h.ROUND_HALF_EVEN=6,h.ROUND_HALF_CEIL=7,h.ROUND_HALF_FLOOR=8,h.EUCLID=9,h.config=h.set=function(e){var r,i;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(i=e[r],v(i,0,M,r),d=i),e.hasOwnProperty(r="ROUNDING_MODE")&&(i=e[r],v(i,0,8,r),R=i),e.hasOwnProperty(r="EXPONENTIAL_AT")&&(i=e[r],i&&i.pop?(v(i[0],-M,0,r),v(i[1],0,M,r),C=i[0],y=i[1]):(v(i,-M,M,r),C=-(y=i<0?-i:i))),e.hasOwnProperty(r="RANGE"))if(i=e[r],i&&i.pop)v(i[0],-M,-1,r),v(i[1],1,M,r),Q=i[0],$=i[1];else if(v(i,-M,M,r),i)Q=-($=i<0?-i:i);else throw Error(T+r+" cannot be zero: "+i);if(e.hasOwnProperty(r="CRYPTO"))if(i=e[r],i===!!i)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))J=i;else throw J=!i,Error(T+"crypto unavailable");else J=i;else throw Error(T+r+" not true or false: "+i);if(e.hasOwnProperty(r="MODULO_MODE")&&(i=e[r],v(i,0,9,r),b=i),e.hasOwnProperty(r="POW_PRECISION")&&(i=e[r],v(i,0,M,r),Y=i),e.hasOwnProperty(r="FORMAT"))if(i=e[r],typeof i=="object")te=i;else throw Error(T+r+" not an object: "+i);if(e.hasOwnProperty(r="ALPHABET"))if(i=e[r],typeof i=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(i))fe=i.slice(0,10)=="0123456789",Z=i;else throw Error(T+r+" invalid: "+i)}else throw Error(T+"Object expected: "+e);return{DECIMAL_PLACES:d,ROUNDING_MODE:R,EXPONENTIAL_AT:[C,y],RANGE:[Q,$],CRYPTO:J,MODULO_MODE:b,POW_PRECISION:Y,FORMAT:te,ALPHABET:Z}},h.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!h.DEBUG)return!0;var r,i,o=e.c,t=e.e,l=e.s;e:if({}.toString.call(o)=="[object Array]"){if((l===1||l===-1)&&t>=-M&&t<=M&&t===q(t)){if(o[0]===0){if(t===0&&o.length===1)return!0;break e}if(r=(t+1)%O,r<1&&(r+=O),String(o[0]).length==r){for(r=0;r<o.length;r++)if(i=o[r],i<0||i>=z||i!==q(i))break e;if(i!==0)return!0}}}else if(o===null&&t===null&&(l===null||l===1||l===-1))return!0;throw Error(T+"Invalid BigNumber: "+e)},h.maximum=h.max=function(){return pe(arguments,-1)},h.minimum=h.min=function(){return pe(arguments,1)},h.random=function(){var e=9007199254740992,r=Math.random()*e&2097151?function(){return q(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(i){var o,t,l,c,n,f=0,u=[],s=new h(B);if(i==null?i=d:v(i,0,M),c=ce(i/O),J)if(crypto.getRandomValues){for(o=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)n=o[f]*131072+(o[f+1]>>>11),n>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),o[f]=t[0],o[f+1]=t[1]):(u.push(n%1e14),f+=2);f=c/2}else if(crypto.randomBytes){for(o=crypto.randomBytes(c*=7);f<c;)n=(o[f]&31)*281474976710656+o[f+1]*1099511627776+o[f+2]*4294967296+o[f+3]*16777216+(o[f+4]<<16)+(o[f+5]<<8)+o[f+6],n>=9e15?crypto.randomBytes(7).copy(o,f):(u.push(n%1e14),f+=7);f=c/7}else throw J=!1,Error(T+"crypto unavailable");if(!J)for(;f<c;)n=r(),n<9e15&&(u[f++]=n%1e14);for(c=u[--f],i%=O,c&&i&&(n=he[O-i],u[f]=q(c/n)*n);u[f]===0;u.pop(),f--);if(f<0)u=[l=0];else{for(l=-1;u[0]===0;u.splice(0,1),l-=O);for(f=1,n=u[0];n>=10;n/=10,f++);f<O&&(l-=O-f)}return s.e=l,s.c=u,s}}(),h.sum=function(){for(var e=1,r=arguments,i=new h(r[0]);e<r.length;)i=i.plus(r[e++]);return i},N=function(){var e="0123456789";function r(i,o,t,l){for(var c,n=[0],f,u=0,s=i.length;u<s;){for(f=n.length;f--;n[f]*=o);for(n[0]+=l.indexOf(i.charAt(u++)),c=0;c<n.length;c++)n[c]>t-1&&(n[c+1]==null&&(n[c+1]=0),n[c+1]+=n[c]/t|0,n[c]%=t)}return n.reverse()}return function(i,o,t,l,c){var n,f,u,s,a,m,E,S,D=i.indexOf("."),I=d,A=R;for(D>=0&&(s=Y,Y=0,i=i.replace(".",""),S=new h(o),m=S.pow(i.length-D),Y=s,S.c=r(W(G(m.c),m.e,"0"),10,t,e),S.e=S.c.length),E=r(i,o,t,c?(n=Z,e):(n=e,Z)),u=s=E.length;E[--s]==0;E.pop());if(!E[0])return n.charAt(0);if(D<0?--u:(m.c=E,m.e=u,m.s=l,m=w(m,S,I,A,t),E=m.c,a=m.r,u=m.e),f=u+I+1,D=E[f],s=t/2,a=a||f<0||E[f+1]!=null,a=A<4?(D!=null||a)&&(A==0||A==(m.s<0?3:2)):D>s||D==s&&(A==4||a||A==6&&E[f-1]&1||A==(m.s<0?8:7)),f<1||!E[0])i=a?W(n.charAt(1),-I,n.charAt(0)):n.charAt(0);else{if(E.length=f,a)for(--t;++E[--f]>t;)E[f]=0,f||(++u,E=[1].concat(E));for(s=E.length;!E[--s];);for(D=0,i="";D<=s;i+=n.charAt(E[D++]));i=W(i,u,n.charAt(0))}return i}}(),w=function(){function e(o,t,l){var c,n,f,u,s=0,a=o.length,m=t%K,E=t/K|0;for(o=o.slice();a--;)f=o[a]%K,u=o[a]/K|0,c=E*f+u*m,n=m*f+c%K*K+s,s=(n/l|0)+(c/K|0)+E*u,o[a]=n%l;return s&&(o=[s].concat(o)),o}function r(o,t,l,c){var n,f;if(l!=c)f=l>c?1:-1;else for(n=f=0;n<l;n++)if(o[n]!=t[n]){f=o[n]>t[n]?1:-1;break}return f}function i(o,t,l,c){for(var n=0;l--;)o[l]-=n,n=o[l]<t[l]?1:0,o[l]=n*c+o[l]-t[l];for(;!o[0]&&o.length>1;o.splice(0,1));}return function(o,t,l,c,n){var f,u,s,a,m,E,S,D,I,A,x,U,re,oe,ue,X,ee,k=o.s==t.s?1:-1,P=o.c,L=t.c;if(!P||!P[0]||!L||!L[0])return new h(!o.s||!t.s||(P?L&&P[0]==L[0]:!L)?NaN:P&&P[0]==0||!L?k*0:k/0);for(D=new h(k),I=D.c=[],u=o.e-t.e,k=l+u+1,n||(n=z,u=H(o.e/O)-H(t.e/O),k=k/O|0),s=0;L[s]==(P[s]||0);s++);if(L[s]>(P[s]||0)&&u--,k<0)I.push(1),a=!0;else{for(oe=P.length,X=L.length,s=0,k+=2,m=q(n/(L[0]+1)),m>1&&(L=e(L,m,n),P=e(P,m,n),X=L.length,oe=P.length),re=X,A=P.slice(0,X),x=A.length;x<X;A[x++]=0);ee=L.slice(),ee=[0].concat(ee),ue=L[0],L[1]>=n/2&&ue++;do{if(m=0,f=r(L,A,X,x),f<0){if(U=A[0],X!=x&&(U=U*n+(A[1]||0)),m=q(U/ue),m>1)for(m>=n&&(m=n-1),E=e(L,m,n),S=E.length,x=A.length;r(E,A,S,x)==1;)m--,i(E,X<S?ee:L,S,n),S=E.length,f=1;else m==0&&(f=m=1),E=L.slice(),S=E.length;if(S<x&&(E=[0].concat(E)),i(A,E,x,n),x=A.length,f==-1)for(;r(L,A,X,x)<1;)m++,i(A,X<x?ee:L,x,n),x=A.length}else f===0&&(m++,A=[0]);I[s++]=m,A[0]?A[x++]=P[re]||0:(A=[P[re]],x=1)}while((re++<oe||A[0]!=null)&&k--);a=A[0]!=null,I[0]||I.splice(0,1)}if(n==z){for(s=1,k=I[0];k>=10;k/=10,s++);F(D,l+(D.e=s+u*O-1)+1,c,a)}else D.e=u,D.r=+a;return D}}();function le(e,r,i,o){var t,l,c,n,f;if(i==null?i=R:v(i,0,8),!e.c)return e.toString();if(t=e.c[0],c=e.e,r==null)f=G(e.c),f=o==1||o==2&&(c<=C||c>=y)?ne(f,c):W(f,c,"0");else if(e=F(new h(e),r,i),l=e.e,f=G(e.c),n=f.length,o==1||o==2&&(r<=l||l<=C)){for(;n<r;f+="0",n++);f=ne(f,l)}else if(r-=c,f=W(f,l,"0"),l+1>n){if(--r>0)for(f+=".";r--;f+="0");}else if(r+=l-n,r>0)for(l+1==n&&(f+=".");r--;f+="0");return e.s<0&&t?"-"+f:f}function pe(e,r){for(var i,o,t=1,l=new h(e[0]);t<e.length;t++)o=new h(e[t]),(!o.s||(i=j(l,o))===r||i===0&&l.s===r)&&(l=o);return l}function se(e,r,i){for(var o=1,t=r.length;!r[--t];r.pop());for(t=r[0];t>=10;t/=10,o++);return(i=o+i*O-1)>$?e.c=e.e=null:i<Q?e.c=[e.e=0]:(e.e=i,e.c=r),e}_=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,i=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,t=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(l,c,n,f){var u,s=n?c:c.replace(t,"");if(o.test(s))l.s=isNaN(s)?null:s<0?-1:1;else{if(!n&&(s=s.replace(e,function(a,m,E){return u=(E=E.toLowerCase())=="x"?16:E=="b"?2:8,!f||f==u?m:a}),f&&(u=f,s=s.replace(r,"$1").replace(i,"0.$1")),c!=s))return new h(s,u);if(h.DEBUG)throw Error(T+"Not a"+(f?" base "+f:"")+" number: "+c);l.s=null}l.c=l.e=null}}();function F(e,r,i,o){var t,l,c,n,f,u,s,a=e.c,m=he;if(a){e:{for(t=1,n=a[0];n>=10;n/=10,t++);if(l=r-t,l<0)l+=O,c=r,f=a[u=0],s=q(f/m[t-c-1]%10);else if(u=ce((l+1)/O),u>=a.length)if(o){for(;a.length<=u;a.push(0));f=s=0,t=1,l%=O,c=l-O+1}else break e;else{for(f=n=a[u],t=1;n>=10;n/=10,t++);l%=O,c=l-O+t,s=c<0?0:q(f/m[t-c-1]%10)}if(o=o||r<0||a[u+1]!=null||(c<0?f:f%m[t-c-1]),o=i<4?(s||o)&&(i==0||i==(e.s<0?3:2)):s>5||s==5&&(i==4||o||i==6&&(l>0?c>0?f/m[t-c]:0:a[u-1])%10&1||i==(e.s<0?8:7)),r<1||!a[0])return a.length=0,o?(r-=e.e+1,a[0]=m[(O-r%O)%O],e.e=-r||0):a[0]=e.e=0,e;if(l==0?(a.length=u,n=1,u--):(a.length=u+1,n=m[O-l],a[u]=c>0?q(f/m[t-c]%m[c])*n:0),o)for(;;)if(u==0){for(l=1,c=a[0];c>=10;c/=10,l++);for(c=a[0]+=n,n=1;c>=10;c/=10,n++);l!=n&&(e.e++,a[0]==z&&(a[0]=1));break}else{if(a[u]+=n,a[u]!=z)break;a[u--]=0,n=1}for(l=a.length;a[--l]===0;a.pop());}e.e>$?e.c=e.e=null:e.e<Q&&(e.c=[e.e=0])}return e}function V(e){var r,i=e.e;return i===null?e.toString():(r=G(e.c),r=i<=C||i>=y?ne(r,i):W(r,i,"0"),e.s<0?"-"+r:r)}return g.absoluteValue=g.abs=function(){var e=new h(this);return e.s<0&&(e.s=1),e},g.comparedTo=function(e,r){return j(this,new h(e,r))},g.decimalPlaces=g.dp=function(e,r){var i,o,t,l=this;if(e!=null)return v(e,0,M),r==null?r=R:v(r,0,8),F(new h(l),e+l.e+1,r);if(!(i=l.c))return null;if(o=((t=i.length-1)-H(this.e/O))*O,t=i[t])for(;t%10==0;t/=10,o--);return o<0&&(o=0),o},g.dividedBy=g.div=function(e,r){return w(this,new h(e,r),d,R)},g.dividedToIntegerBy=g.idiv=function(e,r){return w(this,new h(e,r),0,1)},g.exponentiatedBy=g.pow=function(e,r){var i,o,t,l,c,n,f,u,s,a=this;if(e=new h(e),e.c&&!e.isInteger())throw Error(T+"Exponent not an integer: "+V(e));if(r!=null&&(r=new h(r)),n=e.e>14,!a.c||!a.c[0]||a.c[0]==1&&!a.e&&a.c.length==1||!e.c||!e.c[0])return s=new h(Math.pow(+V(a),n?e.s*(2-ie(e)):+V(e))),r?s.mod(r):s;if(f=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new h(NaN);o=!f&&a.isInteger()&&r.isInteger(),o&&(a=a.mod(r))}else{if(e.e>9&&(a.e>0||a.e<-1||(a.e==0?a.c[0]>1||n&&a.c[1]>=24e7:a.c[0]<8e13||n&&a.c[0]<=9999975e7)))return l=a.s<0&&ie(e)?-0:0,a.e>-1&&(l=1/l),new h(f?1/l:l);Y&&(l=ce(Y/O+2))}for(n?(i=new h(.5),f&&(e.s=1),u=ie(e)):(t=Math.abs(+V(e)),u=t%2),s=new h(B);;){if(u){if(s=s.times(a),!s.c)break;l?s.c.length>l&&(s.c.length=l):o&&(s=s.mod(r))}if(t){if(t=q(t/2),t===0)break;u=t%2}else if(e=e.times(i),F(e,e.e+1,1),e.e>14)u=ie(e);else{if(t=+V(e),t===0)break;u=t%2}a=a.times(a),l?a.c&&a.c.length>l&&(a.c.length=l):o&&(a=a.mod(r))}return o?s:(f&&(s=B.div(s)),r?s.mod(r):l?F(s,Y,R,c):s)},g.integerValue=function(e){var r=new h(this);return e==null?e=R:v(e,0,8),F(r,r.e+1,e)},g.isEqualTo=g.eq=function(e,r){return j(this,new h(e,r))===0},g.isFinite=function(){return!!this.c},g.isGreaterThan=g.gt=function(e,r){return j(this,new h(e,r))>0},g.isGreaterThanOrEqualTo=g.gte=function(e,r){return(r=j(this,new h(e,r)))===1||r===0},g.isInteger=function(){return!!this.c&&H(this.e/O)>this.c.length-2},g.isLessThan=g.lt=function(e,r){return j(this,new h(e,r))<0},g.isLessThanOrEqualTo=g.lte=function(e,r){return(r=j(this,new h(e,r)))===-1||r===0},g.isNaN=function(){return!this.s},g.isNegative=function(){return this.s<0},g.isPositive=function(){return this.s>0},g.isZero=function(){return!!this.c&&this.c[0]==0},g.minus=function(e,r){var i,o,t,l,c=this,n=c.s;if(e=new h(e,r),r=e.s,!n||!r)return new h(NaN);if(n!=r)return e.s=-r,c.plus(e);var f=c.e/O,u=e.e/O,s=c.c,a=e.c;if(!f||!u){if(!s||!a)return s?(e.s=-r,e):new h(a?c:NaN);if(!s[0]||!a[0])return a[0]?(e.s=-r,e):new h(s[0]?c:R==3?-0:0)}if(f=H(f),u=H(u),s=s.slice(),n=f-u){for((l=n<0)?(n=-n,t=s):(u=f,t=a),t.reverse(),r=n;r--;t.push(0));t.reverse()}else for(o=(l=(n=s.length)<(r=a.length))?n:r,n=r=0;r<o;r++)if(s[r]!=a[r]){l=s[r]<a[r];break}if(l&&(t=s,s=a,a=t,e.s=-e.s),r=(o=a.length)-(i=s.length),r>0)for(;r--;s[i++]=0);for(r=z-1;o>n;){if(s[--o]<a[o]){for(i=o;i&&!s[--i];s[i]=r);--s[i],s[o]+=z}s[o]-=a[o]}for(;s[0]==0;s.splice(0,1),--u);return s[0]?se(e,s,u):(e.s=R==3?-1:1,e.c=[e.e=0],e)},g.modulo=g.mod=function(e,r){var i,o,t=this;return e=new h(e,r),!t.c||!e.s||e.c&&!e.c[0]?new h(NaN):!e.c||t.c&&!t.c[0]?new h(t):(b==9?(o=e.s,e.s=1,i=w(t,e,0,3),e.s=o,i.s*=o):i=w(t,e,0,b),e=t.minus(i.times(e)),!e.c[0]&&b==1&&(e.s=t.s),e)},g.multipliedBy=g.times=function(e,r){var i,o,t,l,c,n,f,u,s,a,m,E,S,D,I,A=this,x=A.c,U=(e=new h(e,r)).c;if(!x||!U||!x[0]||!U[0])return!A.s||!e.s||x&&!x[0]&&!U||U&&!U[0]&&!x?e.c=e.e=e.s=null:(e.s*=A.s,!x||!U?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(o=H(A.e/O)+H(e.e/O),e.s*=A.s,f=x.length,a=U.length,f<a&&(S=x,x=U,U=S,t=f,f=a,a=t),t=f+a,S=[];t--;S.push(0));for(D=z,I=K,t=a;--t>=0;){for(i=0,m=U[t]%I,E=U[t]/I|0,c=f,l=t+c;l>t;)u=x[--c]%I,s=x[c]/I|0,n=E*u+s*m,u=m*u+n%I*I+S[l]+i,i=(u/D|0)+(n/I|0)+E*s,S[l--]=u%D;S[l]=i}return i?++o:S.splice(0,1),se(e,S,o)},g.negated=function(){var e=new h(this);return e.s=-e.s||null,e},g.plus=function(e,r){var i,o=this,t=o.s;if(e=new h(e,r),r=e.s,!t||!r)return new h(NaN);if(t!=r)return e.s=-r,o.minus(e);var l=o.e/O,c=e.e/O,n=o.c,f=e.c;if(!l||!c){if(!n||!f)return new h(t/0);if(!n[0]||!f[0])return f[0]?e:new h(n[0]?o:t*0)}if(l=H(l),c=H(c),n=n.slice(),t=l-c){for(t>0?(c=l,i=f):(t=-t,i=n),i.reverse();t--;i.push(0));i.reverse()}for(t=n.length,r=f.length,t-r<0&&(i=f,f=n,n=i,r=t),t=0;r;)t=(n[--r]=n[r]+f[r]+t)/z|0,n[r]=z===n[r]?0:n[r]%z;return t&&(n=[t].concat(n),++c),se(e,n,c)},g.precision=g.sd=function(e,r){var i,o,t,l=this;if(e!=null&&e!==!!e)return v(e,1,M),r==null?r=R:v(r,0,8),F(new h(l),e,r);if(!(i=l.c))return null;if(t=i.length-1,o=t*O+1,t=i[t]){for(;t%10==0;t/=10,o--);for(t=i[0];t>=10;t/=10,o++);}return e&&l.e+1>o&&(o=l.e+1),o},g.shiftedBy=function(e){return v(e,-ae,ae),this.times("1e"+e)},g.squareRoot=g.sqrt=function(){var e,r,i,o,t,l=this,c=l.c,n=l.s,f=l.e,u=d+4,s=new h("0.5");if(n!==1||!c||!c[0])return new h(!n||n<0&&(!c||c[0])?NaN:c?l:1/0);if(n=Math.sqrt(+V(l)),n==0||n==1/0?(r=G(c),(r.length+f)%2==0&&(r+="0"),n=Math.sqrt(+r),f=H((f+1)/2)-(f<0||f%2),n==1/0?r="5e"+f:(r=n.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),i=new h(r)):i=new h(n+""),i.c[0]){for(f=i.e,n=f+u,n<3&&(n=0);;)if(t=i,i=s.times(t.plus(w(l,t,u,1))),G(t.c).slice(0,n)===(r=G(i.c)).slice(0,n))if(i.e<f&&--n,r=r.slice(n-3,n+1),r=="9999"||!o&&r=="4999"){if(!o&&(F(t,t.e+d+2,0),t.times(t).eq(l))){i=t;break}u+=4,n+=4,o=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(F(i,i.e+d+2,1),e=!i.times(i).eq(l));break}}return F(i,i.e+d+1,R,e)},g.toExponential=function(e,r){return e!=null&&(v(e,0,M),e++),le(this,e,r,1)},g.toFixed=function(e,r){return e!=null&&(v(e,0,M),e=e+this.e+1),le(this,e,r)},g.toFormat=function(e,r,i){var o,t=this;if(i==null)e!=null&&r&&typeof r=="object"?(i=r,r=null):e&&typeof e=="object"?(i=e,e=r=null):i=te;else if(typeof i!="object")throw Error(T+"Argument not an object: "+i);if(o=t.toFixed(e,r),t.c){var l,c=o.split("."),n=+i.groupSize,f=+i.secondaryGroupSize,u=i.groupSeparator||"",s=c[0],a=c[1],m=t.s<0,E=m?s.slice(1):s,S=E.length;if(f&&(l=n,n=f,f=l,S-=l),n>0&&S>0){for(l=S%n||n,s=E.substr(0,l);l<S;l+=n)s+=u+E.substr(l,n);f>0&&(s+=u+E.slice(l)),m&&(s="-"+s)}o=a?s+(i.decimalSeparator||"")+((f=+i.fractionGroupSize)?a.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):a):s}return(i.prefix||"")+o+(i.suffix||"")},g.toFraction=function(e){var r,i,o,t,l,c,n,f,u,s,a,m,E=this,S=E.c;if(e!=null&&(n=new h(e),!n.isInteger()&&(n.c||n.s!==1)||n.lt(B)))throw Error(T+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+V(n));if(!S)return new h(E);for(r=new h(B),u=i=new h(B),o=f=new h(B),m=G(S),l=r.e=m.length-E.e-1,r.c[0]=he[(c=l%O)<0?O+c:c],e=!e||n.comparedTo(r)>0?l>0?r:u:n,c=$,$=1/0,n=new h(m),f.c[0]=0;s=w(n,r,0,1),t=i.plus(s.times(o)),t.comparedTo(e)!=1;)i=o,o=t,u=f.plus(s.times(t=u)),f=t,r=n.minus(s.times(t=r)),n=t;return t=w(e.minus(i),o,0,1),f=f.plus(t.times(u)),i=i.plus(t.times(o)),f.s=u.s=E.s,l=l*2,a=w(u,o,l,R).minus(E).abs().comparedTo(w(f,i,l,R).minus(E).abs())<1?[u,o]:[f,i],$=c,a},g.toNumber=function(){return+V(this)},g.toPrecision=function(e,r){return e!=null&&v(e,1,M),le(this,e,r,2)},g.toString=function(e){var r,i=this,o=i.s,t=i.e;return t===null?o?(r="Infinity",o<0&&(r="-"+r)):r="NaN":(e==null?r=t<=C||t>=y?ne(G(i.c),t):W(G(i.c),t,"0"):e===10&&fe?(i=F(new h(i),d+t+1,R),r=W(G(i.c),i.e,"0")):(v(e,2,Z.length,"Base"),r=N(W(G(i.c),t,"0"),10,e,o,!0)),o<0&&i.c[0]&&(r="-"+r)),r},g.valueOf=g.toJSON=function(){return V(this)},g._isBigNumber=!0,g[Symbol.toStringTag]="BigNumber",g[Symbol.for("nodejs.util.inspect.custom")]=g.valueOf,p!=null&&h.set(p),h}function H(p){var w=p|0;return p>0||p===w?w:w-1}function G(p){for(var w,N,_=1,g=p.length,B=p[0]+"";_<g;){for(w=p[_++]+"",N=O-w.length;N--;w="0"+w);B+=w}for(g=B.length;B.charCodeAt(--g)===48;);return B.slice(0,g+1||1)}function j(p,w){var N,_,g=p.c,B=w.c,d=p.s,R=w.s,C=p.e,y=w.e;if(!d||!R)return null;if(N=g&&!g[0],_=B&&!B[0],N||_)return N?_?0:-R:d;if(d!=R)return d;if(N=d<0,_=C==y,!g||!B)return _?0:!g^N?1:-1;if(!_)return C>y^N?1:-1;for(R=(C=g.length)<(y=B.length)?C:y,d=0;d<R;d++)if(g[d]!=B[d])return g[d]>B[d]^N?1:-1;return C==y?0:C>y^N?1:-1}function v(p,w,N,_){if(p<w||p>N||p!==q(p))throw Error(T+(_||"Argument")+(typeof p=="number"?p<w||p>N?" out of range: ":" not an integer: ":" not a primitive number: ")+String(p))}function ie(p){var w=p.c.length-1;return H(p.e/O)==w&&p.c[w]%2!=0}function ne(p,w){return(p.length>1?p.charAt(0)+"."+p.slice(1):p)+(w<0?"e":"e+")+w}function W(p,w,N){var _,g;if(w<0){for(g=N+".";++w;g+=N);p=g+p}else if(_=p.length,++w>_){for(g=N,w-=_;--w;g+=N);p+=g}else w<_&&(p=p.slice(0,w)+"."+p.slice(w));return p}var ge=de();function Be(p){if(typeof p>"u"||p===null)return["--"];let w="",N=new ge(p.toString());const _=N.abs();return _.gte(1e9)?(N=N.shiftedBy(-9),w="B"):_.gte(1e6)?(N=N.shiftedBy(-6),w="M"):_.gte(1e4)&&(N=N.shiftedBy(-3),w="K"),_.gte(1)&&(N=N.decimalPlaces(2,ge.ROUND_DOWN)),[N.toFormat(),w]}function Re(...p){return Be(...p).filter(Boolean).join(" ")}var ve=(p=>(p.ROUNDED="ROUNDED",p.FULL="FULL",p))(ve||{});function De(p,w,N="ROUNDED"){const _=new ge(p.toString()).shiftedBy(-1*w);return N==="FULL"?_.toFormat():Re(_)}const Ee="…",Ne=5,Oe=10;function Le(p){const w=Ae();return Se({queryKey:["coin-metadata",p],queryFn:async()=>{if(!p)throw new Error("Fetching coin metadata should be disabled when coin type is disabled.");return p===_e?{id:null,decimals:9,description:"",iconUrl:null,name:"Sui",symbol:"SUI"}:w.getCoinMetadata({coinType:p})},select(N){return N?{...N,symbol:N.symbol.length>Ne?N.symbol.slice(0,Ne)+Ee:N.symbol,name:N.name.length>Oe?N.name.slice(0,Oe)+Ee:N.name}:null},retry:!1,enabled:!!p,staleTime:1/0,gcTime:24*60*60*1e3})}function Ce(p,w,N="ROUNDED"){const _=we.useMemo(()=>w?Ie(w)??"":"",[w]),g=Le(w),{isFetched:B,data:d}=g;return[we.useMemo(()=>typeof p>"u"||p===null?"":B?De(p,(d==null?void 0:d.decimals)??0,N):"...",[d==null?void 0:d.decimals,B,p,N]),B?(d==null?void 0:d.symbol)||_:"",g]}function Ie(p){return p.substring(p.lastIndexOf(":")+1)}export{ve as C,Ce as a,De as f,Le as u};