UNPKG

@cobaltx/sdk-v2

Version:

An SDK for building applications on top of CobaltX.

1 lines 210 kB
"use strict";var ys=Object.create;var In=Object.defineProperty;var gs=Object.getOwnPropertyDescriptor;var ws=Object.getOwnPropertyNames;var ks=Object.getPrototypeOf,hs=Object.prototype.hasOwnProperty;var As=(r,e)=>{for(var t in e)In(r,t,{get:e[t],enumerable:!0})},bi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ws(e))!hs.call(r,i)&&i!==t&&In(r,i,{get:()=>e[i],enumerable:!(n=gs(e,i))||n.enumerable});return r};var ce=(r,e,t)=>(t=r!=null?ys(ks(r)):{},bi(e||!r||!r.__esModule?In(t,"default",{value:r,enumerable:!0}):t,r)),Ps=r=>bi(In({},"__esModule",{value:!0}),r);var Qu={};As(Qu,{default:()=>ar});module.exports=Ps(Qu);var Un=require("@solana/spl-token"),oo=require("@solana/web3.js");var rt=ce(require("bn.js"));var zt=9e15,wt=1e9,cr="0123456789abcdef",Ln="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Nn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",lr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-zt,maxE:zt,crypto:!1},ki,at,H=!0,Rn="[DecimalError] ",gt=Rn+"Invalid argument: ",hi=Rn+"Precision limit exceeded",Ai=Rn+"crypto unavailable",Pi="[object Decimal]",Ce=Math.floor,Se=Math.pow,Ts=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,xs=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ss=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ti=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ye=1e7,X=7,Bs=9007199254740991,Is=Ln.length-1,mr=Nn.length-1,K={toStringTag:Pi};K.absoluteValue=K.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),F(r)};K.ceil=function(){return F(new this.constructor(this),this.e+1,2)};K.clampedTo=K.clamp=function(r,e){var t,n=this,i=n.constructor;if(r=new i(r),e=new i(e),!r.s||!e.s)return new i(NaN);if(r.gt(e))throw Error(gt+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new i(n)};K.comparedTo=K.cmp=function(r){var e,t,n,i,o=this,s=o.d,a=(r=new o.constructor(r)).d,u=o.s,c=r.s;if(!s||!a)return!u||!c?NaN:u!==c?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-c:0;if(u!==c)return u;if(o.e!==r.e)return o.e>r.e^u<0?1:-1;for(n=s.length,i=a.length,e=0,t=n<i?n:i;e<t;++e)if(s[e]!==a[e])return s[e]>a[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};K.cosine=K.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+X,n.rounding=1,t=Ks(n,Ki(n,t)),n.precision=r,n.rounding=e,F(at==2||at==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};K.cubeRoot=K.cbrt=function(){var r,e,t,n,i,o,s,a,u,c,l=this,m=l.constructor;if(!l.isFinite()||l.isZero())return new m(l);for(H=!1,o=l.s*Se(l.s*l,1/3),!o||Math.abs(o)==1/0?(t=Le(l.d),r=l.e,(o=(r-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Se(t,1/3),r=Ce((r+1)/3)-(r%3==(r<0?-1:2)),o==1/0?t="5e"+r:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new m(t),n.s=l.s):n=new m(o.toString()),s=(r=m.precision)+3;;)if(a=n,u=a.times(a).times(a),c=u.plus(l),n=le(c.plus(l).times(a),c.plus(u),s+2,1),Le(a.d).slice(0,s)===(t=Le(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(F(a,r+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(F(n,r+1,1),e=!n.times(n).times(n).eq(l));break}return H=!0,F(n,r,m.rounding,e)};K.decimalPlaces=K.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-Ce(this.e/X))*X,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};K.dividedBy=K.div=function(r){return le(this,new this.constructor(r))};K.dividedToIntegerBy=K.divToInt=function(r){var e=this,t=e.constructor;return F(le(e,new t(r),0,1,1),t.precision,t.rounding)};K.equals=K.eq=function(r){return this.cmp(r)===0};K.floor=function(){return F(new this.constructor(this),this.e+1,3)};K.greaterThan=K.gt=function(r){return this.cmp(r)>0};K.greaterThanOrEqualTo=K.gte=function(r){var e=this.cmp(r);return e==1||e===0};K.hyperbolicCosine=K.cosh=function(){var r,e,t,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(r=Math.ceil(i/3),e=(1/vn(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),o=Qt(s,1,o.times(e),new s(1),!0);for(var u,c=r,l=new s(8);c--;)u=o.times(o),o=a.minus(u.times(l.minus(u.times(l))));return F(o,s.precision=t,s.rounding=n,!0)};K.hyperbolicSine=K.sinh=function(){var r,e,t,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,t=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=Qt(o,2,i,i,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,i=i.times(1/vn(5,r)),i=Qt(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),c=new o(20);r--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(c))))}return o.precision=e,o.rounding=t,F(i,e,t,!0)};K.hyperbolicTangent=K.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,le(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};K.inverseCosine=K.acos=function(){var r,e=this,t=e.constructor,n=e.abs().cmp(1),i=t.precision,o=t.rounding;return n!==-1?n===0?e.isNeg()?je(t,i,o):new t(0):new t(NaN):e.isZero()?je(t,i+4,o).times(.5):(t.precision=i+6,t.rounding=1,e=e.asin(),r=je(t,i+4,o).times(.5),t.precision=i,t.rounding=o,r.minus(e))};K.inverseHyperbolicCosine=K.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,H=!1,t=t.times(t).minus(1).sqrt().plus(t),H=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};K.inverseHyperbolicSine=K.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,H=!1,t=t.times(t).plus(1).sqrt().plus(t),H=!0,n.precision=r,n.rounding=e,t.ln())};K.inverseHyperbolicTangent=K.atanh=function(){var r,e,t,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(r=o.precision,e=o.rounding,n=i.sd(),Math.max(n,r)<2*-i.e-1?F(new o(i),r,e,!0):(o.precision=t=n-i.e,i=le(i.plus(1),new o(1).minus(i),t+r,1),o.precision=r+4,o.rounding=1,i=i.ln(),o.precision=r,o.rounding=e,i.times(.5))):new o(NaN)};K.inverseSine=K.asin=function(){var r,e,t,n,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),t=o.precision,n=o.rounding,e!==-1?e===0?(r=je(o,t+4,n).times(.5),r.s=i.s,r):new o(NaN):(o.precision=t+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,i.times(2)))};K.inverseTangent=K.atan=function(){var r,e,t,n,i,o,s,a,u,c=this,l=c.constructor,m=l.precision,d=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&m+4<=mr)return s=je(l,m+4,d).times(.25),s.s=c.s,s}else{if(!c.s)return new l(NaN);if(m+4<=mr)return s=je(l,m+4,d).times(.5),s.s=c.s,s}for(l.precision=a=m+10,l.rounding=1,t=Math.min(28,a/X+2|0),r=t;r;--r)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(H=!1,e=Math.ceil(a/X),n=1,u=c.times(c),s=new l(c),i=c;r!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),s=o.plus(i.div(n+=2)),s.d[e]!==void 0)for(r=e;s.d[r]===o.d[r]&&r--;);return t&&(s=s.times(2<<t-1)),H=!0,F(s,l.precision=m,l.rounding=d,!0)};K.isFinite=function(){return!!this.d};K.isInteger=K.isInt=function(){return!!this.d&&Ce(this.e/X)>this.d.length-2};K.isNaN=function(){return!this.s};K.isNegative=K.isNeg=function(){return this.s<0};K.isPositive=K.isPos=function(){return this.s>0};K.isZero=function(){return!!this.d&&this.d[0]===0};K.lessThan=K.lt=function(r){return this.cmp(r)<0};K.lessThanOrEqualTo=K.lte=function(r){return this.cmp(r)<1};K.logarithm=K.log=function(r){var e,t,n,i,o,s,a,u,c=this,l=c.constructor,m=l.precision,d=l.rounding,p=5;if(r==null)r=new l(10),e=!0;else{if(r=new l(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new l(NaN);e=r.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new l(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)o=!0;else{for(i=t[0];i%10===0;)i/=10;o=i!==1}if(H=!1,a=m+p,s=yt(c,a),n=e?Cn(l,a+10):yt(r,a),u=le(s,n,a,1),un(u.d,i=m,d))do if(a+=10,s=yt(c,a),n=e?Cn(l,a+10):yt(r,a),u=le(s,n,a,1),!o){+Le(u.d).slice(i+1,i+15)+1==1e14&&(u=F(u,m+1,0));break}while(un(u.d,i+=10,d));return H=!0,F(u,m,d)};K.minus=K.sub=function(r){var e,t,n,i,o,s,a,u,c,l,m,d,p=this,b=p.constructor;if(r=new b(r),!p.d||!r.d)return!p.s||!r.s?r=new b(NaN):p.d?r.s=-r.s:r=new b(r.d||p.s!==r.s?p:NaN),r;if(p.s!=r.s)return r.s=-r.s,p.plus(r);if(c=p.d,d=r.d,a=b.precision,u=b.rounding,!c[0]||!d[0]){if(d[0])r.s=-r.s;else if(c[0])r=new b(p);else return new b(u===3?-0:0);return H?F(r,a,u):r}if(t=Ce(r.e/X),l=Ce(p.e/X),c=c.slice(),o=l-t,o){for(m=o<0,m?(e=c,o=-o,s=d.length):(e=d,t=l,s=c.length),n=Math.max(Math.ceil(a/X),s)+2,o>n&&(o=n,e.length=1),e.reverse(),n=o;n--;)e.push(0);e.reverse()}else{for(n=c.length,s=d.length,m=n<s,m&&(s=n),n=0;n<s;n++)if(c[n]!=d[n]){m=c[n]<d[n];break}o=0}for(m&&(e=c,c=d,d=e,r.s=-r.s),s=c.length,n=d.length-s;n>0;--n)c[s++]=0;for(n=d.length;n>o;){if(c[--n]<d[n]){for(i=n;i&&c[--i]===0;)c[i]=Ye-1;--c[i],c[n]+=Ye}c[n]-=d[n]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(r.d=c,r.e=Mn(c,t),H?F(r,a,u):r):new b(u===3?-0:0)};K.modulo=K.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?F(new n(t),n.precision,n.rounding):(H=!1,n.modulo==9?(e=le(t,r.abs(),0,3,1),e.s*=r.s):e=le(t,r,0,n.modulo,1),e=e.times(r),H=!0,t.minus(e))};K.naturalExponential=K.exp=function(){return dr(this)};K.naturalLogarithm=K.ln=function(){return yt(this)};K.negated=K.neg=function(){var r=new this.constructor(this);return r.s=-r.s,F(r)};K.plus=K.add=function(r){var e,t,n,i,o,s,a,u,c,l,m=this,d=m.constructor;if(r=new d(r),!m.d||!r.d)return!m.s||!r.s?r=new d(NaN):m.d||(r=new d(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(c=m.d,l=r.d,a=d.precision,u=d.rounding,!c[0]||!l[0])return l[0]||(r=new d(m)),H?F(r,a,u):r;if(o=Ce(m.e/X),n=Ce(r.e/X),c=c.slice(),i=o-n,i){for(i<0?(t=c,i=-i,s=l.length):(t=l,n=o,s=c.length),o=Math.ceil(a/X),s=o>s?o+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=c.length,i=l.length,s-i<0&&(i=s,t=l,l=c,c=t),e=0;i;)e=(c[--i]=c[i]+l[i]+e)/Ye|0,c[i]%=Ye;for(e&&(c.unshift(e),++n),s=c.length;c[--s]==0;)c.pop();return r.d=c,r.e=Mn(c,n),H?F(r,a,u):r};K.precision=K.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(gt+r);return t.d?(e=xi(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};K.round=function(){var r=this,e=r.constructor;return F(new e(r),r.e+1,e.rounding)};K.sine=K.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+X,n.rounding=1,t=Ns(n,Ki(n,t)),n.precision=r,n.rounding=e,F(at>2?t.neg():t,r,e,!0)):new n(NaN)};K.squareRoot=K.sqrt=function(){var r,e,t,n,i,o,s=this,a=s.d,u=s.e,c=s.s,l=s.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(H=!1,c=Math.sqrt(+s),c==0||c==1/0?(e=Le(a),(e.length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=Ce((u+1)/2)-(u<0||u%2),c==1/0?e="5e"+u:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+u),n=new l(e)):n=new l(c.toString()),t=(u=l.precision)+3;;)if(o=n,n=o.plus(le(s,o,t+2,1)).times(.5),Le(o.d).slice(0,t)===(e=Le(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!i&&e=="4999"){if(!i&&(F(o,u+1,0),o.times(o).eq(s))){n=o;break}t+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(F(n,u+1,1),r=!n.times(n).eq(s));break}return H=!0,F(n,u,l.rounding,r)};K.tangent=K.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=le(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,F(at==2||at==4?t.neg():t,r,e,!0)):new n(NaN)};K.times=K.mul=function(r){var e,t,n,i,o,s,a,u,c,l=this,m=l.constructor,d=l.d,p=(r=new m(r)).d;if(r.s*=l.s,!d||!d[0]||!p||!p[0])return new m(!r.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:!d||!p?r.s/0:r.s*0);for(t=Ce(l.e/X)+Ce(r.e/X),u=d.length,c=p.length,u<c&&(o=d,d=p,p=o,s=u,u=c,c=s),o=[],s=u+c,n=s;n--;)o.push(0);for(n=c;--n>=0;){for(e=0,i=u+n;i>n;)a=o[i]+p[n]*d[i-n-1]+e,o[i--]=a%Ye|0,e=a/Ye|0;o[i]=(o[i]+e)%Ye|0}for(;!o[--s];)o.pop();return e?++t:o.shift(),r.d=o,r.e=Mn(o,t),H?F(r,m.precision,m.rounding):r};K.toBinary=function(r,e){return fr(this,2,r,e)};K.toDecimalPlaces=K.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Ve(r,0,wt),e===void 0?e=n.rounding:Ve(e,0,8),F(t,r+t.e+1,e))};K.toExponential=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=nt(n,!0):(Ve(r,0,wt),e===void 0?e=i.rounding:Ve(e,0,8),n=F(new i(n),r+1,e),t=nt(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};K.toFixed=function(r,e){var t,n,i=this,o=i.constructor;return r===void 0?t=nt(i):(Ve(r,0,wt),e===void 0?e=o.rounding:Ve(e,0,8),n=F(new o(i),r+i.e+1,e),t=nt(n,!1,r+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};K.toFraction=function(r){var e,t,n,i,o,s,a,u,c,l,m,d,p=this,b=p.d,f=p.constructor;if(!b)return new f(p);if(c=t=new f(1),n=u=new f(0),e=new f(n),o=e.e=xi(b)-p.e-1,s=o%X,e.d[0]=Se(10,s<0?X+s:s),r==null)r=o>0?e:c;else{if(a=new f(r),!a.isInt()||a.lt(c))throw Error(gt+a);r=a.gt(e)?o>0?e:c:a}for(H=!1,a=new f(Le(b)),l=f.precision,f.precision=o=b.length*X*2;m=le(a,e,0,1,1),i=t.plus(m.times(n)),i.cmp(r)!=1;)t=n,n=i,i=c,c=u.plus(m.times(i)),u=i,i=e,e=a.minus(m.times(i)),a=i;return i=le(r.minus(t),n,0,1,1),u=u.plus(i.times(c)),t=t.plus(i.times(n)),u.s=c.s=p.s,d=le(c,n,o,1).minus(p).abs().cmp(le(u,t,o,1).minus(p).abs())<1?[c,n]:[u,t],f.precision=l,H=!0,d};K.toHexadecimal=K.toHex=function(r,e){return fr(this,16,r,e)};K.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Ve(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(H=!1,t=le(t,r,0,e,1).times(r),H=!0,F(t)):(r.s=t.s,t=r),t};K.toNumber=function(){return+this};K.toOctal=function(r,e){return fr(this,8,r,e)};K.toPower=K.pow=function(r){var e,t,n,i,o,s,a=this,u=a.constructor,c=+(r=new u(r));if(!a.d||!r.d||!a.d[0]||!r.d[0])return new u(Se(+a,c));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,r.eq(1))return F(a,n,o);if(e=Ce(r.e/X),e>=r.d.length-1&&(t=c<0?-c:c)<=Bs)return i=Si(u,a,t,n),r.s<0?new u(1).div(i):F(i,n,o);if(s=a.s,s<0){if(e<r.d.length-1)return new u(NaN);if((r.d[e]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return t=Se(+a,c),e=t==0||!isFinite(t)?Ce(c*(Math.log("0."+Le(a.d))/Math.LN10+a.e+1)):new u(t+"").e,e>u.maxE+1||e<u.minE-1?new u(e>0?s/0:0):(H=!1,u.rounding=a.s=1,t=Math.min(12,(e+"").length),i=dr(r.times(yt(a,n+t)),n),i.d&&(i=F(i,n+5,1),un(i.d,n,o)&&(e=n+10,i=F(dr(r.times(yt(a,e+t)),e),e+5,1),+Le(i.d).slice(n+1,n+15)+1==1e14&&(i=F(i,n+1,0)))),i.s=s,H=!0,u.rounding=o,F(i,n,o))};K.toPrecision=function(r,e){var t,n=this,i=n.constructor;return r===void 0?t=nt(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ve(r,1,wt),e===void 0?e=i.rounding:Ve(e,0,8),n=F(new i(n),r,e),t=nt(n,r<=n.e||n.e<=i.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};K.toSignificantDigits=K.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Ve(r,1,wt),e===void 0?e=n.rounding:Ve(e,0,8)),F(new n(t),r,e)};K.toString=function(){var r=this,e=r.constructor,t=nt(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};K.truncated=K.trunc=function(){return F(new this.constructor(this),this.e+1,1)};K.valueOf=K.toJSON=function(){var r=this,e=r.constructor,t=nt(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function Le(r){var e,t,n,i=r.length-1,o="",s=r[0];if(i>0){for(o+=s,e=1;e<i;e++)n=r[e]+"",t=X-n.length,t&&(o+=bt(t)),o+=n;s=r[e],n=s+"",t=X-n.length,t&&(o+=bt(t))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function Ve(r,e,t){if(r!==~~r||r<e||r>t)throw Error(gt+r)}function un(r,e,t,n){var i,o,s,a;for(o=r[0];o>=10;o/=10)--e;return--e<0?(e+=X,i=0):(i=Math.ceil((e+1)/X),e%=X),o=Se(10,X-e),a=r[i]%o|0,n==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(r[i+1]/o/100|0)==Se(10,e-2)-1||(a==o/2||a==0)&&(r[i+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(r[i+1]/o/1e3|0)==Se(10,e-3)-1,s}function Kn(r,e,t){for(var n,i=[0],o,s=0,a=r.length;s<a;){for(o=i.length;o--;)i[o]*=e;for(i[0]+=cr.indexOf(r.charAt(s++)),n=0;n<i.length;n++)i[n]>t-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function Ks(r,e){var t,n,i;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),i=(1/vn(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),r.precision+=t,e=Qt(r,1,e.times(i),new r(1));for(var o=t;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return r.precision-=t,e}var le=function(){function r(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function e(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;a<o;a++)if(n[a]!=i[a]){u=n[a]>i[a]?1:-1;break}return u}function t(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,u){var c,l,m,d,p,b,f,w,g,A,k,P,T,h,B,x,R,E,M,z,W=n.constructor,ee=n.s==i.s?1:-1,J=n.d,q=i.d;if(!J||!J[0]||!q||!q[0])return new W(!n.s||!i.s||(J?q&&J[0]==q[0]:!q)?NaN:J&&J[0]==0||!q?ee*0:ee/0);for(u?(p=1,l=n.e-i.e):(u=Ye,p=X,l=Ce(n.e/p)-Ce(i.e/p)),M=q.length,R=J.length,g=new W(ee),A=g.d=[],m=0;q[m]==(J[m]||0);m++);if(q[m]>(J[m]||0)&&l--,o==null?(h=o=W.precision,s=W.rounding):a?h=o+(n.e-i.e)+1:h=o,h<0)A.push(1),b=!0;else{if(h=h/p+2|0,m=0,M==1){for(d=0,q=q[0],h++;(m<R||d)&&h--;m++)B=d*u+(J[m]||0),A[m]=B/q|0,d=B%q|0;b=d||m<R}else{for(d=u/(q[0]+1)|0,d>1&&(q=r(q,d,u),J=r(J,d,u),M=q.length,R=J.length),x=M,k=J.slice(0,M),P=k.length;P<M;)k[P++]=0;z=q.slice(),z.unshift(0),E=q[0],q[1]>=u/2&&++E;do d=0,c=e(q,k,M,P),c<0?(T=k[0],M!=P&&(T=T*u+(k[1]||0)),d=T/E|0,d>1?(d>=u&&(d=u-1),f=r(q,d,u),w=f.length,P=k.length,c=e(f,k,w,P),c==1&&(d--,t(f,M<w?z:q,w,u))):(d==0&&(c=d=1),f=q.slice()),w=f.length,w<P&&f.unshift(0),t(k,f,P,u),c==-1&&(P=k.length,c=e(q,k,M,P),c<1&&(d++,t(k,M<P?z:q,P,u))),P=k.length):c===0&&(d++,k=[0]),A[m++]=d,c&&k[0]?k[P++]=J[x]||0:(k=[J[x]],P=1);while((x++<R||k[0]!==void 0)&&h--);b=k[0]!==void 0}A[0]||A.shift()}if(p==1)g.e=l,ki=b;else{for(m=1,d=A[0];d>=10;d/=10)m++;g.e=m+l*p-1,F(g,a?o+g.e+1:o,s,b)}return g}}();function F(r,e,t,n){var i,o,s,a,u,c,l,m,d,p=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(i=1,a=m[0];a>=10;a/=10)i++;if(o=e-i,o<0)o+=X,s=e,l=m[d=0],u=l/Se(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/X),a=m.length,d>=a)if(n){for(;a++<=d;)m.push(0);l=u=0,i=1,o%=X,s=o-X+1}else break e;else{for(l=a=m[d],i=1;a>=10;a/=10)i++;o%=X,s=o-X+i,u=s<0?0:l/Se(10,i-s-1)%10|0}if(n=n||e<0||m[d+1]!==void 0||(s<0?l:l%Se(10,i-s-1)),c=t<4?(u||n)&&(t==0||t==(r.s<0?3:2)):u>5||u==5&&(t==4||n||t==6&&(o>0?s>0?l/Se(10,i-s):0:m[d-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,c?(e-=r.e+1,m[0]=Se(10,(X-e%X)%X),r.e=-e||0):m[0]=r.e=0,r;if(o==0?(m.length=d,a=1,d--):(m.length=d+1,a=Se(10,X-o),m[d]=s>0?(l/Se(10,i-s)%Se(10,s)|0)*a:0),c)for(;;)if(d==0){for(o=1,s=m[0];s>=10;s/=10)o++;for(s=m[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(r.e++,m[0]==Ye&&(m[0]=1));break}else{if(m[d]+=a,m[d]!=Ye)break;m[d--]=0,a=1}for(o=m.length;m[--o]===0;)m.pop()}return H&&(r.e>p.maxE?(r.d=null,r.e=NaN):r.e<p.minE&&(r.e=0,r.d=[0])),r}function nt(r,e,t){if(!r.isFinite())return Ii(r);var n,i=r.e,o=Le(r.d),s=o.length;return e?(t&&(n=t-s)>0?o=o.charAt(0)+"."+o.slice(1)+bt(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(r.e<0?"e":"e+")+r.e):i<0?(o="0."+bt(-i-1)+o,t&&(n=t-s)>0&&(o+=bt(n))):i>=s?(o+=bt(i+1-s),t&&(n=t-i-1)>0&&(o=o+"."+bt(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),t&&(n=t-s)>0&&(i+1===s&&(o+="."),o+=bt(n))),o}function Mn(r,e){var t=r[0];for(e*=X;t>=10;t/=10)e++;return e}function Cn(r,e,t){if(e>Is)throw H=!0,t&&(r.precision=t),Error(hi);return F(new r(Ln),e,1,!0)}function je(r,e,t){if(e>mr)throw Error(hi);return F(new r(Nn),e,t,!0)}function xi(r){var e=r.length-1,t=e*X+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}function bt(r){for(var e="";r--;)e+="0";return e}function Si(r,e,t,n){var i,o=new r(1),s=Math.ceil(n/X+4);for(H=!1;;){if(t%2&&(o=o.times(e),gi(o.d,s)&&(i=!0)),t=Ce(t/2),t===0){t=o.d.length-1,i&&o.d[t]===0&&++o.d[t];break}e=e.times(e),gi(e.d,s)}return H=!0,o}function yi(r){return r.d[r.d.length-1]&1}function Bi(r,e,t){for(var n,i=new r(e[0]),o=0;++o<e.length;)if(n=new r(e[o]),n.s)i[t](n)&&(i=n);else{i=n;break}return i}function dr(r,e){var t,n,i,o,s,a,u,c=0,l=0,m=0,d=r.constructor,p=d.rounding,b=d.precision;if(!r.d||!r.d[0]||r.e>17)return new d(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:0/0);for(e==null?(H=!1,u=b):u=e,a=new d(.03125);r.e>-2;)r=r.times(a),m+=5;for(n=Math.log(Se(2,m))/Math.LN10*2+5|0,u+=n,t=o=s=new d(1),d.precision=u;;){if(o=F(o.times(r),u,1),t=t.times(++l),a=s.plus(le(o,t,u,1)),Le(a.d).slice(0,u)===Le(s.d).slice(0,u)){for(i=m;i--;)s=F(s.times(s),u,1);if(e==null)if(c<3&&un(s.d,u-n,p,c))d.precision=u+=10,t=o=a=new d(1),l=0,c++;else return F(s,d.precision=b,p,H=!0);else return d.precision=b,s}s=a}}function yt(r,e){var t,n,i,o,s,a,u,c,l,m,d,p=1,b=10,f=r,w=f.d,g=f.constructor,A=g.rounding,k=g.precision;if(f.s<0||!w||!w[0]||!f.e&&w[0]==1&&w.length==1)return new g(w&&!w[0]?-1/0:f.s!=1?NaN:w?0:f);if(e==null?(H=!1,l=k):l=e,g.precision=l+=b,t=Le(w),n=t.charAt(0),Math.abs(o=f.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)f=f.times(r),t=Le(f.d),n=t.charAt(0),p++;o=f.e,n>1?(f=new g("0."+t),o++):f=new g(n+"."+t.slice(1))}else return c=Cn(g,l+2,k).times(o+""),f=yt(new g(n+"."+t.slice(1)),l-b).plus(c),g.precision=k,e==null?F(f,k,A,H=!0):f;for(m=f,u=s=f=le(f.minus(1),f.plus(1),l,1),d=F(f.times(f),l,1),i=3;;){if(s=F(s.times(d),l,1),c=u.plus(le(s,new g(i),l,1)),Le(c.d).slice(0,l)===Le(u.d).slice(0,l))if(u=u.times(2),o!==0&&(u=u.plus(Cn(g,l+2,k).times(o+""))),u=le(u,new g(p),l,1),e==null)if(un(u.d,l-b,A,a))g.precision=l+=b,c=s=f=le(m.minus(1),m.plus(1),l,1),d=F(f.times(f),l,1),i=a=1;else return F(u,g.precision=k,A,H=!0);else return g.precision=k,u;u=c,i+=2}}function Ii(r){return String(r.s*r.s/0)}function pr(r,e){var t,n,i;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%X,t<0&&(n+=X),n<i){for(n&&r.d.push(+e.slice(0,n)),i-=X;n<i;)r.d.push(+e.slice(n,n+=X));e=e.slice(n),n=X-e.length}else n-=i;for(;n--;)e+="0";r.d.push(+e),H&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}function Ls(r,e){var t,n,i,o,s,a,u,c,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Ti.test(e))return pr(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(xs.test(e))t=16,e=e.toLowerCase();else if(Ts.test(e))t=2;else if(Ss.test(e))t=8;else throw Error(gt+e);for(o=e.search(/p/i),o>0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,n=r.constructor,s&&(e=e.replace(".",""),a=e.length,o=a-o,i=Si(n,new n(t),o,o*2)),c=Kn(e,t,Ye),l=c.length-1,o=l;c[o]===0;--o)c.pop();return o<0?new n(r.s*0):(r.e=Mn(c,l),r.d=c,H=!1,s&&(r=le(r,i,a*4)),u&&(r=r.times(Math.abs(u)<54?Se(2,u):cn.pow(2,u))),H=!0,r)}function Ns(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Qt(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/vn(5,t)),e=Qt(r,2,e,e);for(var i,o=new r(5),s=new r(16),a=new r(20);t--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}function Qt(r,e,t,n,i){var o,s,a,u,c=1,l=r.precision,m=Math.ceil(l/X);for(H=!1,u=t.times(t),a=new r(n);;){if(s=le(a.times(u),new r(e++*e++),l,1),a=i?n.plus(s):n.minus(s),n=le(s.times(u),new r(e++*e++),l,1),s=a.plus(n),s.d[m]!==void 0){for(o=m;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,c++}return H=!0,s.d.length=m+1,s}function vn(r,e){for(var t=r;--e;)t*=r;return t}function Ki(r,e){var t,n=e.s<0,i=je(r,r.precision,1),o=i.times(.5);if(e=e.abs(),e.lte(o))return at=n?4:1,e;if(t=e.divToInt(i),t.isZero())at=n?3:2;else{if(e=e.minus(t.times(i)),e.lte(o))return at=yi(t)?n?2:3:n?4:1,e;at=yi(t)?n?1:4:n?3:2}return e.minus(i).abs()}function fr(r,e,t,n){var i,o,s,a,u,c,l,m,d,p=r.constructor,b=t!==void 0;if(b?(Ve(t,1,wt),n===void 0?n=p.rounding:Ve(n,0,8)):(t=p.precision,n=p.rounding),!r.isFinite())l=Ii(r);else{for(l=nt(r),s=l.indexOf("."),b?(i=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):i=e,s>=0&&(l=l.replace(".",""),d=new p(1),d.e=l.length-s,d.d=Kn(nt(d),10,i),d.e=d.d.length),m=Kn(l,10,i),o=u=m.length;m[--u]==0;)m.pop();if(!m[0])l=b?"0p+0":"0";else{if(s<0?o--:(r=new p(r),r.d=m,r.e=o,r=le(r,d,t,n,0,i),m=r.d,o=r.e,c=ki),s=m[t],a=i/2,c=c||m[t+1]!==void 0,c=n<4?(s!==void 0||c)&&(n===0||n===(r.s<0?3:2)):s>a||s===a&&(n===4||c||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,c)for(;++m[--t]>i-1;)m[t]=0,t||(++o,m.unshift(1));for(u=m.length;!m[u-1];--u);for(s=0,l="";s<u;s++)l+=cr.charAt(m[s]);if(b){if(u>1)if(e==16||e==8){for(s=e==16?4:3,--u;u%s;u++)l+="0";for(m=Kn(l,i,e),u=m.length;!m[u-1];--u);for(s=1,l="1.";s<u;s++)l+=cr.charAt(m[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>u)for(o-=u;o--;)l+="0";else o<u&&(l=l.slice(0,o)+"."+l.slice(o))}l=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return r.s<0?"-"+l:l}function gi(r,e){if(r.length>e)return r.length=e,!0}function Cs(r){return new this(r).abs()}function Rs(r){return new this(r).acos()}function Ms(r){return new this(r).acosh()}function vs(r,e){return new this(r).plus(e)}function Es(r){return new this(r).asin()}function _s(r){return new this(r).asinh()}function Os(r){return new this(r).atan()}function Ws(r){return new this(r).atanh()}function Vs(r,e){r=new this(r),e=new this(e);var t,n=this.precision,i=this.rounding,o=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=je(this,o,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?je(this,n,i):new this(0),t.s=r.s):!r.d||e.isZero()?(t=je(this,o,1).times(.5),t.s=r.s):e.s<0?(this.precision=o,this.rounding=1,t=this.atan(le(r,e,o,1)),e=je(this,o,1),this.precision=n,this.rounding=i,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(le(r,e,o,1)),t}function Fs(r){return new this(r).cbrt()}function Ds(r){return F(r=new this(r),r.e+1,2)}function qs(r,e,t){return new this(r).clamp(e,t)}function Gs(r){if(!r||typeof r!="object")throw Error(Rn+"Object expected");var e,t,n,i=r.defaults===!0,o=["precision",1,wt,"rounding",0,8,"toExpNeg",-zt,0,"toExpPos",0,zt,"maxE",0,zt,"minE",-zt,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(t=o[e],i&&(this[t]=lr[t]),(n=r[t])!==void 0)if(Ce(n)===n&&n>=o[e+1]&&n<=o[e+2])this[t]=n;else throw Error(gt+t+": "+n);if(t="crypto",i&&(this[t]=lr[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Ai);else this[t]=!1;else throw Error(gt+t+": "+n);return this}function Us(r){return new this(r).cos()}function Xs(r){return new this(r).cosh()}function Li(r){var e,t,n;function i(o){var s,a,u,c=this;if(!(c instanceof i))return new i(o);if(c.constructor=i,wi(o)){c.s=o.s,H?!o.d||o.e>i.maxE?(c.e=NaN,c.d=null):o.e<i.minE?(c.e=0,c.d=[0]):(c.e=o.e,c.d=o.d.slice()):(c.e=o.e,c.d=o.d?o.d.slice():o.d);return}if(u=typeof o,u==="number"){if(o===0){c.s=1/o<0?-1:1,c.e=0,c.d=[0];return}if(o<0?(o=-o,c.s=-1):c.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;H?s>i.maxE?(c.e=NaN,c.d=null):s<i.minE?(c.e=0,c.d=[0]):(c.e=s,c.d=[o]):(c.e=s,c.d=[o]);return}else if(o*0!==0){o||(c.s=NaN),c.e=NaN,c.d=null;return}return pr(c,o.toString())}else if(u!=="string")throw Error(gt+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),c.s=-1):(a===43&&(o=o.slice(1)),c.s=1),Ti.test(o)?pr(c,o):Ls(c,o)}if(i.prototype=K,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Gs,i.clone=Li,i.isDecimal=wi,i.abs=Cs,i.acos=Rs,i.acosh=Ms,i.add=vs,i.asin=Es,i.asinh=_s,i.atan=Os,i.atanh=Ws,i.atan2=Vs,i.cbrt=Fs,i.ceil=Ds,i.clamp=qs,i.cos=Us,i.cosh=Xs,i.div=zs,i.exp=Qs,i.floor=Hs,i.hypot=Zs,i.ln=js,i.log=Ys,i.log10=Js,i.log2=$s,i.max=ea,i.min=ta,i.mod=na,i.mul=ra,i.pow=ia,i.random=oa,i.round=sa,i.sign=aa,i.sin=ua,i.sinh=ca,i.sqrt=la,i.sub=ma,i.sum=da,i.tan=pa,i.tanh=fa,i.trunc=ba,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return i.config(r),i}function zs(r,e){return new this(r).div(e)}function Qs(r){return new this(r).exp()}function Hs(r){return F(r=new this(r),r.e+1,3)}function Zs(){var r,e,t=new this(0);for(H=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return H=!0,new this(1/0);t=e}return H=!0,t.sqrt()}function wi(r){return r instanceof cn||r&&r.toStringTag===Pi||!1}function js(r){return new this(r).ln()}function Ys(r,e){return new this(r).log(e)}function $s(r){return new this(r).log(2)}function Js(r){return new this(r).log(10)}function ea(){return Bi(this,arguments,"lt")}function ta(){return Bi(this,arguments,"gt")}function na(r,e){return new this(r).mod(e)}function ra(r,e){return new this(r).mul(e)}function ia(r,e){return new this(r).pow(e)}function oa(r){var e,t,n,i,o=0,s=new this(1),a=[];if(r===void 0?r=this.precision:Ve(r,1,wt),n=Math.ceil(r/X),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));o<n;)i=e[o],i>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);o<n;)i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((e[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Ai);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],r%=X,n&&r&&(i=Se(10,X-r),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)t=0,a=[0];else{for(t=-1;a[0]===0;t-=X)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<X&&(t-=X-n)}return s.e=t,s.d=a,s}function sa(r){return F(r=new this(r),r.e+1,this.rounding)}function aa(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}function ua(r){return new this(r).sin()}function ca(r){return new this(r).sinh()}function la(r){return new this(r).sqrt()}function ma(r,e){return new this(r).sub(e)}function da(){var r=0,e=arguments,t=new this(e[r]);for(H=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return H=!0,F(t,this.precision,this.rounding)}function pa(r){return new this(r).tan()}function fa(r){return new this(r).tanh()}function ba(r){return F(r=new this(r),r.e+1,1)}K[Symbol.for("nodejs.util.inspect.custom")]=K.toString;K[Symbol.toStringTag]="Decimal";var cn=K.constructor=Li(lr);Ln=new cn(Ln);Nn=new cn(Nn);var N=cn;var _i=ce(require("big.js")),fn=ce(require("bn.js"));var ln=require("lodash");var br=class{constructor(e){this.logLevel=e.logLevel!==void 0?e.logLevel:0,this.name=e.name}set level(e){this.logLevel=e}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(e){return e<=this.logLevel}error(...e){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...e),this):this}logWithError(...e){let t=e.map(n=>typeof n=="object"?JSON.stringify(n):n).join(", ");throw new Error(t)}warning(...e){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...e),this):this}info(...e){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...e),this):this}debug(...e){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...e),this):this}},Ni={},ya={};function se(r){let e=(0,ln.get)(Ni,r);if(!e){let t=(0,ln.get)(ya,r);e=new br({name:r,logLevel:t}),(0,ln.set)(Ni,r,e)}return e}var Ci=ce(require("toformat")),ga=Ci.default,mn=ga;var dn=ce(require("big.js")),Mi=ce(require("bn.js")),vi=ce(require("decimal.js-light"));var Ht=ce(require("bn.js"));var Ri=9007199254740991;function te(r){let e=se("CobaltX_parseBigNumberish");if(r instanceof Ht.default)return r;if(typeof r=="string"){if(r.match(/^-?[0-9]+$/))return new Ht.default(r);e.logWithError(`invalid BigNumberish string: ${r}`)}return typeof r=="number"?(r%1&&e.logWithError(`BigNumberish number underflow: ${r}`),(r>=Ri||r<=-Ri)&&e.logWithError(`BigNumberish number overflow: ${r}`),new Ht.default(String(r))):typeof r=="bigint"?new Ht.default(r.toString()):(e.error(`invalid BigNumberish value: ${r}`),new Ht.default(0))}var En=se("module/fraction"),yr=mn(dn.default),pn=mn(vi.default),ka={[0]:pn.ROUND_DOWN,[1]:pn.ROUND_HALF_UP,[2]:pn.ROUND_UP},ha={[0]:dn.default.roundDown,[1]:dn.default.roundHalfUp,[2]:dn.default.roundUp},ie=class{constructor(e,t=new Mi.default(1)){this.numerator=te(e),this.denominator=te(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new ie(this.denominator,this.numerator)}add(e){let t=e instanceof ie?e:new ie(te(e));return this.denominator.eq(t.denominator)?new ie(this.numerator.add(t.numerator),this.denominator):new ie(this.numerator.mul(t.denominator).add(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}sub(e){let t=e instanceof ie?e:new ie(te(e));return this.denominator.eq(t.denominator)?new ie(this.numerator.sub(t.numerator),this.denominator):new ie(this.numerator.mul(t.denominator).sub(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}mul(e){let t=e instanceof ie?e:new ie(te(e));return new ie(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof ie?e:new ie(te(e));return new ie(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},n=1){Number.isInteger(e)||En.logWithError(`${e} is not an integer.`),e<=0&&En.logWithError(`${e} is not positive.`),pn.set({precision:e+1,rounding:ka[n]});let i=new pn(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return i.toFormat(i.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},n=1){return Number.isInteger(e)||En.logWithError(`${e} is not an integer.`),e<0&&En.logWithError(`${e} is negative.`),yr.DP=e,yr.RM=ha[n]||1,new yr(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var Aa=se("CobaltX_amount"),Ei=mn(_i.default);function Pa(r,e){let t="0",n="0";if(r.includes(".")){let i=r.split(".");i.length===2?([t,n]=i,n=n.padEnd(e,"0")):Aa.logWithError(`invalid number string, num: ${r}`)}else t=r;return[t,n.slice(0,e)||n]}var ge=class extends ie{constructor(t,n,i=!0,o){let s=new fn.default(0),a=gr.pow(new fn.default(t.decimals));if(i)s=te(n);else{let u=new fn.default(0),c=new fn.default(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,m]=Pa(n.toString(),t.decimals);u=te(l),c=te(m)}u=u.mul(a),s=u.add(c)}super(s,a);this.logger=se(o||"TokenAmount"),this.token=t}get raw(){return this.numerator}isZero(){return this.raw.isZero()}gt(t){return this.token.equals(t.token)||this.logger.logWithError("gt token not equals"),this.raw.gt(t.raw)}lt(t){return this.token.equals(t.token)||this.logger.logWithError("lt token not equals"),this.raw.lt(t.raw)}add(t){return this.token.equals(t.token)||this.logger.logWithError("add token not equals"),new ge(this.token,this.raw.add(t.raw))}subtract(t){return this.token.equals(t.token)||this.logger.logWithError("sub token not equals"),new ge(this.token,this.raw.sub(t.raw))}toSignificant(t=this.token.decimals,n,i=0){return super.toSignificant(t,n,i)}toFixed(t=this.token.decimals,n,i=0){return t>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(t,n,i)}toExact(t={groupSeparator:""}){return Ei.DP=this.token.decimals,new Ei(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)}};var wr=require("@solana/spl-token"),Oi=require("@solana/web3.js"),kr={chainId:101,address:Oi.PublicKey.default.toBase58(),programId:wr.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"ETH",name:"Ethereum",logoURI:"https://raw.githubusercontent.com/cobaltx-io/tokens/main/logo/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"cobaltx",extensions:{coingeckoId:"solana"}},ut={chainId:101,address:"So11111111111111111111111111111111111111112",programId:wr.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WETH",name:"Wrapped ETH",logoURI:"https://raw.githubusercontent.com/cobaltx-io/tokens/main/logo/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"cobaltx",extensions:{coingeckoId:"solana"}};var On=require("@solana/web3.js");var be=require("@solana/web3.js"),Wi=require("@solana/spl-token");function I({pubkey:r,isSigner:e=!1,isWritable:t=!0}){return{pubkey:r,isWritable:t,isSigner:e}}var Ta=[I({pubkey:Wi.TOKEN_PROGRAM_ID,isWritable:!1}),I({pubkey:be.SystemProgram.programId,isWritable:!1}),I({pubkey:be.SYSVAR_RENT_PUBKEY,isWritable:!1})];function hr({publicKey:r,transformSol:e}){let t=Ar(r.toString());if(t instanceof be.PublicKey)return e&&t.equals(jt)?Zt:t;if(e&&t.toString()===jt.toBase58())return Zt;if(typeof t=="string"){if(t===be.PublicKey.default.toBase58())return be.PublicKey.default;try{return new be.PublicKey(t)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function Ar(r){try{return new be.PublicKey(r)}catch{return r}}var _n=new be.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Pr=new be.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),$e=new be.PublicKey("SysvarRent111111111111111111111111111111111"),yc=new be.PublicKey("SysvarC1ock11111111111111111111111111111111"),Kt=new be.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),xa=new be.PublicKey("Sysvar1nstructions1111111111111111111111111"),gc=be.SystemProgram.programId,wc=new be.PublicKey("a2Gt18uJC8puJT9JRYQLU6rPi6okxQb4WqCjwtYshZB"),kc=new be.PublicKey("bXSKiFqYrALF9gJy1KqHm8tv4QXk8nCgbLN8WRsGEbh"),Zt=new be.PublicKey("So11111111111111111111111111111111111111112"),jt=be.PublicKey.default,hc=new be.PublicKey("71kRXzJMvSeArtXYNEWa8KAjpRJosdMQ7Dpgy5Jt5zfd"),Ac=new be.PublicKey("ERFzpDteGNo8LTDKW1WwVGrkRMmA2y9WZHXNHxMA6BSV");function Yt(r){return hr({publicKey:r,transformSol:!0})}var Tr=class{constructor({mint:e,decimals:t,symbol:n,name:i,skipMint:o=!1,isToken2022:s=!1}){if(e===jt.toBase58()||e instanceof On.PublicKey&&jt.equals(e)){this.decimals=ut.decimals,this.symbol=ut.symbol,this.name=ut.name,this.mint=new On.PublicKey(ut.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=n||e.toString().substring(0,6),this.name=i||e.toString().substring(0,6),this.mint=o?On.PublicKey.default:hr({publicKey:e}),this.isToken2022=s}equals(e){return this===e?!0:this.mint.equals(e.mint)}},Re=Tr;Re.WSOL=new Tr({...ut,mint:ut.address});var xr=class{constructor({decimals:e,symbol:t="UNKNOWN",name:n="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=n}equals(e){return this===e}},Wn=xr;Wn.SOL=new xr(kr);var Fi=ce(require("bn.js"));var Vi=new ie(new Fi.default(100)),Qe=class extends ie{toSignificant(e=5,t,n){return this.mul(Vi).toSignificant(e,t,n)}toFixed(e=2,t,n){return this.mul(Vi).toFixed(e,t,n)}};var Sa=se("CobaltX_price"),He=class extends ie{constructor(t){let{baseToken:n,quoteToken:i,numerator:o,denominator:s}=t;super(o,s);this.baseToken=n,this.quoteToken=i,this.scalar=new ie(Sr(n.decimals),Sr(i.decimals))}get raw(){return new ie(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new He({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(t){this.quoteToken!==t.baseToken&&Sa.logWithError("mul token not equals");let n=super.mul(t);return new He({baseToken:this.baseToken,quoteToken:t.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(t=this.quoteToken.decimals,n,i){return this.adjusted.toSignificant(t,n,i)}toFixed(t=this.quoteToken.decimals,n,i){return this.adjusted.toFixed(t,n,i)}};var Di=require("@solana/web3.js"),qi=ce(require("bn.js"));function Gi(r){return typeof r=="object"&&r!==null&&![Re,ge,Di.PublicKey,ie,qi.default,He,Qe].some(e=>typeof e=="object"&&r instanceof e)}function Lt(r){return typeof r=="string"?Ar(r):Array.isArray(r)?r.map(e=>Lt(e)):Gi(r)?Object.fromEntries(Object.entries(r).map(([e,t])=>[e,Lt(t)])):r}var kt=new rt.default(0),Ui=new rt.default(1),ml=new rt.default(2),dl=new rt.default(3),pl=new rt.default(5),gr=new rt.default(10),fl=new rt.default(100),bl=new rt.default(1e3),yl=new rt.default(1e4);function Sr(r){return gr.pow(te(r))}function Vn(r,e){let t=r.divmod(e);return t.mod.isZero()?t.div:t.div.isNeg()?t.div.isubn(1):t.div.iaddn(1)}function Br(r,e=1,t=[]){let n=[...r];if(e<=0)return t;for(;n.length;)t.push(n.splice(0,e));return t}var Hi=require("@solana/web3.js"),Zi=require("@solana/spl-token");var Me=require("@solana/web3.js");var Q={CreateAccount:"CreateAccount",InitAccount:"InitAccount",CreateATA:"CreateATA",CloseAccount:"CloseAccount",TransferAmount:"TransferAmount",InitMint:"InitMint",MintTo:"MintTo",InitMarket:"InitMarket",Util1216OwnerClaim:"Util1216OwnerClaim",SetComputeUnitPrice:"SetComputeUnitPrice",SetComputeUnitLimit:"SetComputeUnitLimit",ClmmCreatePool:"ClmmCreatePool",ClmmOpenPosition:"ClmmOpenPosition",ClmmIncreasePosition:"ClmmIncreasePosition",ClmmDecreasePosition:"ClmmDecreasePosition",ClmmClosePosition:"ClmmClosePosition",ClmmSwapBaseIn:"ClmmSwapBaseIn",ClmmSwapBaseOut:"ClmmSwapBaseOut",ClmmInitReward:"ClmmInitReward",ClmmSetReward:"ClmmSetReward",ClmmCollectReward:"ClmmCollectReward",ClmmLockPosition:"ClmmLockPosition",ClmmHarvestLockPosition:"ClmmHarvestLockPosition",AmmV4Swap:"AmmV4Swap",AmmV4AddLiquidity:"AmmV4AddLiquidity",AmmV4RemoveLiquidity:"AmmV4RemoveLiquidity",AmmV4SimulatePoolInfo:"AmmV4SimulatePoolInfo",AmmV4SwapBaseIn:"AmmV4SwapBaseIn",AmmV4SwapBaseOut:"AmmV4SwapBaseOut",AmmV4CreatePool:"AmmV4CreatePool",AmmV4InitPool:"AmmV4InitPool",AmmV5AddLiquidity:"AmmV5AddLiquidity",AmmV5RemoveLiquidity:"AmmV5RemoveLiquidity",AmmV5SimulatePoolInfo:"AmmV5SimulatePoolInfo",AmmV5SwapBaseIn:"AmmV5SwapBaseIn",AmmV5SwapBaseOut:"AmmV5SwapBaseOut",RouteSwap:"RouteSwap",RouteSwap1:"RouteSwap1",RouteSwap2:"RouteSwap2",FarmV3Deposit:"FarmV3Deposit",FarmV3Withdraw:"FarmV3Withdraw",FarmV3CreateLedger:"FarmV3CreateLedger",FarmV4Withdraw:"FarmV4Withdraw",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut",CpmmLockLp:"CpmmLockLp",CpmmCollectLockFee:"CpmmCollectLockFee"};var zi=require("@solana/spl-token"),Xi=se("CobaltX_txUtil"),Qi=1644;function Fn(r){let e=[],t=[];return r.microLamports&&(e.push(Me.ComputeBudgetProgram.setComputeUnitPrice({microLamports:r.microLamports})),t.push(Q.SetComputeUnitPrice)),r.units&&(e.push(Me.ComputeBudgetProgram.setComputeUnitLimit({units:r.units})),t.push(Q.SetComputeUnitLimit)),{instructions:e,instructionTypes:t}}async function $t(r,e){var n,i;let t=e!=null?e:"confirmed";return(i=await((n=r.getLatestBlockhash)==null?void 0:n.call(r,{commitment:t})))==null?void 0:i.blockhash}async function Dn(r,e){return r.getSignatureStatuses([e]),new Promise((t,n)=>{let i=setTimeout(n,6e4);r.onSignature(e,o=>{if(clearTimeout(i),!o.err){t("");return}n(o.err.toString())},"confirmed")})}function Ba(r,e){r.length<1&&Xi.logWithError(`no instructions provided: ${r.toString()}`),e.length<1&&Xi.logWithError(`no signers provided:, ${e.toString()}`);let t=new Me.Transaction;t.recentBlockhash="11111111111111111111111111111111",t.feePayer=e[0],t.add(...r);try{return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64").length<Qi}catch{return!1}}function ye(r,e){let[t,n]=Me.PublicKey.findProgramAddressSync(r,e);return{publicKey:t,nonce:n}}function bn({instructions:r,payer:e,signers:t}){return Ba(r,[e,...t])}function yn({instructions:r,payer:e,lookupTableAddressAccount:t,recentBlockhash:n=Me.Keypair.generate().publicKey.toString()}){let o=new Me.TransactionMessage({payerKey:e,recentBlockhash:n,instructions:r}).compileToV0Message(Object.values(t!=null?t:{}));try{return Buffer.from(new Me.VersionedTransaction(o).serialize()).toString("base64").length<Qi}catch{return!1}}var Ia=r=>Buffer.isBuffer(r)?r:r instanceof Uint8Array?Buffer.from(r.buffer,r.byteOffset,r.byteLength):Buffer.from(r),Ka=r=>{let e=r.serialize({requireAllSignatures:!1,verifySignatures:!1});r instanceof Me.VersionedTransaction&&(e=Ia(e));try{return e instanceof Buffer?e.toString("base64"):Buffer.from(e).toString("base64")}catch{return e.toString("base64")}};function Nt(r){let e=[];return r.forEach(t=>{t instanceof Me.Transaction&&(t.recentBlockhash||(t.recentBlockhash=zi.TOKEN_PROGRAM_ID.toBase58()),t.feePayer||(t.feePayer=Me.Keypair.generate().publicKey)),e.push(Ka(t))}),console.log("simulate tx string:",e),e}function me(r,e,t){return ye([r.toBuffer(),(t!=null?t:Zi.TOKEN_PROGRAM_ID).toBuffer(),e.toBuffer()],new Hi.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}var j=require("@solana/web3.js"),ji=new j.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),Yi=new j.PublicKey("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),$i=new j.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),Ji=new j.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),Rl=new j.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),eo=new j.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Ml=new j.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),to=new j.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),vl=new j.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),El=new j.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),_l=new j.PublicKey("2TnjBuwqyBB9to5jURagDT7jLmBPefGRiKL2yh1zPZ4V"),Ol=new j.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Wl=new j.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),Vl=new j.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),no=new j.PublicKey("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),Fl=new j.PublicKey("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),Dl=new j.PublicKey("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),ql=new j.PublicKey("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),Gl=new j.PublicKey("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),Ul=new j.PublicKey("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),Xl=new j.PublicKey("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),zl=new j.PublicKey("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),La=new j.PublicKey("CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW"),Na=new j.PublicKey("7rQ1QFNosMkUCuh7Z7fPbTHvh73b68sQYdirycEzJVuw"),Ca=new j.PublicKey("G11FKBRaAkHAKuLCgLM6K6NUc9rTjPAznRCjZifrTQe2"),Ql=new j.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Ra=new j.PublicKey("DLockwT7X7sxtLmGH9g5kmfcjaBtncdbUmi738m5bvQC"),Hl=new j.PublicKey("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),Ma=new j.PublicKey("7AFUeLVRjBfzqK3tTGw8hN48KLQWSk6DTE8xprWdPqix");var Zl={SERUM_MARKET:j.PublicKey.default,OPENBOOK_MARKET:new j.PublicKey("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),UTIL1216:j.PublicKey.default,FarmV3:new j.PublicKey("85BFyr98MbCUU9MVTEgzx1nbhWACbJqLzho6zd6DZcWL"),FarmV5:new j.PublicKey("EcLzTrNg9V7qhcdyXDe2qjtPkiGzDM2UbdRaeaadU5r2"),FarmV6:new j.PublicKey("Farm2hJLcqPtPg8M4rR6DMrsRNc5TPm5Cs4bVQrMe2T7"),AmmV4:new j.PublicKey("HWy1jotHpo6UqeQxx49dpYYdQB8wj9Qk9MdxwjLvDHB8"),AmmStable:new j.PublicKey("DDg4VmQaJV9ogWce7LpcjBA9bv22wRp5uaTPa5pGjijF"),CLMM:new j.PublicKey("devi51mZmdwUJGU9hjN27vEz64Gps7uUefqxg27EAtH"),CLMM_LOCK_PROGRAM_ID:new j.PublicKey("DLockwT7X7sxtLmGH9g5kmfcjaBtncdbUmi738m5bvQC"),CLMM_LOCK_AUTH_