UNPKG

test-rrr-sdk

Version:

An SDK for building applications on top of Raydium.

1 lines 63.3 kB
var qn=Object.create;var Le=Object.defineProperty,Gn=Object.defineProperties,Un=Object.getOwnPropertyDescriptor,Xn=Object.getOwnPropertyDescriptors,Hn=Object.getOwnPropertyNames,_t=Object.getOwnPropertySymbols,zn=Object.getPrototypeOf,Gt=Object.prototype.hasOwnProperty,Zn=Object.prototype.propertyIsEnumerable;var qt=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G=(e,t)=>{for(var n in t||(t={}))Gt.call(t,n)&&qt(e,n,t[n]);if(_t)for(var n of _t(t))Zn.call(t,n)&&qt(e,n,t[n]);return e},z=(e,t)=>Gn(e,Xn(t));var jn=(e,t)=>{for(var n in t)Le(e,n,{get:t[n],enumerable:!0})},Ut=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Hn(t))!Gt.call(e,r)&&r!==n&&Le(e,r,{get:()=>t[r],enumerable:!(i=Un(t,r))||i.enumerable});return e};var W=(e,t,n)=>(n=e!=null?qn(zn(e)):{},Ut(t||!e||!e.__esModule?Le(n,"default",{value:e,enumerable:!0}):n,e)),Qn=e=>Ut(Le({},"__esModule",{value:!0}),e);var uo={};jn(uo,{anchorDataBuf:()=>ee,buyExactInInstruction:()=>$r,buyExactOutInstruction:()=>eo,claimPlatformFee:()=>oo,claimVestedToken:()=>io,createPlatformConfig:()=>so,createVestingAccount:()=>ro,initialize:()=>Jr,sellExactInInstruction:()=>to,sellExactOut:()=>no,updatePlatformConfig:()=>ao});module.exports=Qn(uo);var _=require("@solana/web3.js"),Vt=require("@solana/spl-token"),Ue=W(require("bn.js"));var Qt=require("@solana/web3.js"),ke=W(require("bn.js"));var g=require("@solana/buffer-layout"),mt=g.Layout,Xt=g.Structure;var dt=g.UInt;var Ht=g.u8,Re=g.u16;var zt=g.u32;var oe=g.s32;var Zt=g.seq;var Z=g.blob;var jt=g.offset;var Ae=class extends mt{constructor(n,i,r){super(n,r);this.blob=Z(n),this.signed=i}decode(n,i=0){let r=new ke.default(this.blob.decode(n,i),10,"le");return this.signed?r.fromTwos(this.span*8).clone():r}encode(n,i,r=0){return typeof n=="number"&&(n=new ke.default(n)),this.signed&&(n=n.toTwos(this.span*8)),this.blob.encode(n.toArrayLike(Buffer,"le",this.span),i,r)}};function O(e){return new dt(1,e)}function he(e){return new dt(4,e)}function b(e){return new Ae(8,!1,e)}function E(e){return new Ae(16,!1,e)}function Yt(e){return new Ae(8,!0,e)}function Jt(e){return new Ae(16,!0,e)}var Te=class extends mt{constructor(n,i,r,o){super(n.span,o);this.layout=n,this.decoder=i,this.encoder=r}decode(n,i){return this.decoder(this.layout.decode(n,i))}encode(n,i,r){return this.layout.encode(this.encoder(n),i,r)}getSpan(n,i){return this.layout.getSpan(n,i)}};function K(e){return new Te(Z(32),t=>new Qt.PublicKey(t),t=>t.toBuffer(),e)}function ft(e){return new Te(Ht(),Yn,Jn,e)}function Yn(e){if(e===0)return!1;if(e===1)return!0;throw new Error("Invalid bool: "+e)}function Jn(e){return e?1:0}function $n(e){let t=zt("length"),n=C([t,Z(jt(t,-t.span),"data")]);return new Te(n,({data:i})=>i,i=>({data:i}),e)}function ce(e){return new Te($n(),t=>t.toString("utf-8"),t=>Buffer.from(t,"utf-8"),e)}var pt=class extends Xt{decode(t,n){return super.decode(t,n)}};function C(e,t,n){return new pt(e,t,n)}function v(e,t,n){let i,r=typeof t=="number"?t:(0,ke.isBN)(t)?t.toNumber():new Proxy(t,{get(o,s){if(!i){let a=Reflect.get(o,"count");i=(0,ke.isBN)(a)?a.toNumber():a,Reflect.set(o,"count",i)}return Reflect.get(o,s)},set(o,s,a){return s==="count"&&(i=a),Reflect.set(o,s,a)}});return Zt(e,r,n)}var ti=require("@solana/web3.js");var Me=require("lodash");var bt=class{constructor(t){this.logLevel=t.logLevel!==void 0?t.logLevel:0,this.name=t.name}set level(t){this.logLevel=t}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(t){return t<=this.logLevel}error(...t){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...t),this):this}logWithError(...t){let n=t.map(i=>typeof i=="object"?JSON.stringify(i):i).join(", ");throw new Error(n)}warning(...t){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...t),this):this}info(...t){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...t),this):this}debug(...t){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...t),this):this}},$t={},ei={};function X(e){let t=(0,Me.get)($t,e);if(!t){let n=(0,Me.get)(ei,e);t=new bt({name:e,logLevel:n}),(0,Me.set)($t,e,t)}return t}var Xe=require("@solana/spl-token"),Bo=X("Raydium_accountInfo_util");var ie=W(require("bn.js"));var xe=9e15,pe=1e9,yt="0123456789abcdef",Ze="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",je="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",gt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-xe,maxE:xe,crypto:!1},on,se,T=!0,Ye="[DecimalError] ",de=Ye+"Invalid argument: ",sn=Ye+"Precision limit exceeded",an=Ye+"crypto unavailable",un="[object Decimal]",U=Math.floor,D=Math.pow,ni=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ii=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ri=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,cn=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$=1e7,w=7,oi=9007199254740991,si=Ze.length-1,Pt=je.length-1,p={toStringTag:un};p.absoluteValue=p.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),P(e)};p.ceil=function(){return P(new this.constructor(this),this.e+1,2)};p.clampedTo=p.clamp=function(e,t){var n,i=this,r=i.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(de+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new r(i)};p.comparedTo=p.cmp=function(e){var t,n,i,r,o=this,s=o.d,a=(e=new o.constructor(e)).d,c=o.s,u=e.s;if(!s||!a)return!c||!u?NaN:c!==u?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-u:0;if(c!==u)return c;if(o.e!==e.e)return o.e>e.e^c<0?1:-1;for(i=s.length,r=a.length,t=0,n=i<r?i:r;t<n;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return i===r?0:i>r^c<0?1:-1};p.cosine=p.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+w,i.rounding=1,n=ai(i,fn(i,n)),i.precision=e,i.rounding=t,P(se==2||se==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)};p.cubeRoot=p.cbrt=function(){var e,t,n,i,r,o,s,a,c,u,l=this,m=l.constructor;if(!l.isFinite()||l.isZero())return new m(l);for(T=!1,o=l.s*D(l.s*l,1/3),!o||Math.abs(o)==1/0?(n=V(l.d),e=l.e,(o=(e-n.length+1)%3)&&(n+=o==1||o==-2?"0":"00"),o=D(n,1/3),e=U((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?n="5e"+e:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new m(n),i.s=l.s):i=new m(o.toString()),s=(e=m.precision)+3;;)if(a=i,c=a.times(a).times(a),u=c.plus(l),i=R(u.plus(l).times(a),u.plus(c),s+2,1),V(a.d).slice(0,s)===(n=V(i.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!r&&n=="4999"){if(!r&&(P(a,e+1,0),a.times(a).times(a).eq(l))){i=a;break}s+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(P(i,e+1,1),t=!i.times(i).times(i).eq(l));break}return T=!0,P(i,e,m.rounding,t)};p.decimalPlaces=p.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-U(this.e/w))*w,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n};p.dividedBy=p.div=function(e){return R(this,new this.constructor(e))};p.dividedToIntegerBy=p.divToInt=function(e){var t=this,n=t.constructor;return P(R(t,new n(e),0,1,1),n.precision,n.rounding)};p.equals=p.eq=function(e){return this.cmp(e)===0};p.floor=function(){return P(new this.constructor(this),this.e+1,3)};p.greaterThan=p.gt=function(e){return this.cmp(e)>0};p.greaterThanOrEqualTo=p.gte=function(e){var t=this.cmp(e);return t==1||t===0};p.hyperbolicCosine=p.cosh=function(){var e,t,n,i,r,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;n=s.precision,i=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,r=o.d.length,r<32?(e=Math.ceil(r/3),t=(1/$e(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=Be(s,1,o.times(t),new s(1),!0);for(var c,u=e,l=new s(8);u--;)c=o.times(o),o=a.minus(c.times(l.minus(c.times(l))));return P(o,s.precision=n,s.rounding=i,!0)};p.hyperbolicSine=p.sinh=function(){var e,t,n,i,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(r.e,r.sd())+4,o.rounding=1,i=r.d.length,i<3)r=Be(o,2,r,r,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,r=r.times(1/$e(5,e)),r=Be(o,2,r,r,!0);for(var s,a=new o(5),c=new o(16),u=new o(20);e--;)s=r.times(r),r=r.times(a.plus(s.times(c.times(s).plus(u))))}return o.precision=t,o.rounding=n,P(r,t,n,!0)};p.hyperbolicTangent=p.tanh=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,R(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)};p.inverseCosine=p.acos=function(){var e,t=this,n=t.constructor,i=t.abs().cmp(1),r=n.precision,o=n.rounding;return i!==-1?i===0?t.isNeg()?J(n,r,o):new n(0):new n(NaN):t.isZero()?J(n,r+4,o).times(.5):(n.precision=r+6,n.rounding=1,t=t.asin(),e=J(n,r+4,o).times(.5),n.precision=r,n.rounding=o,e.minus(t))};p.inverseHyperbolicCosine=p.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,T=!1,n=n.times(n).minus(1).sqrt().plus(n),T=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)};p.inverseHyperbolicSine=p.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,T=!1,n=n.times(n).plus(1).sqrt().plus(n),T=!0,i.precision=e,i.rounding=t,n.ln())};p.inverseHyperbolicTangent=p.atanh=function(){var e,t,n,i,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=o.precision,t=o.rounding,i=r.sd(),Math.max(i,e)<2*-r.e-1?P(new o(r),e,t,!0):(o.precision=n=i-r.e,r=R(r.plus(1),new o(1).minus(r),n+e,1),o.precision=e+4,o.rounding=1,r=r.ln(),o.precision=e,o.rounding=t,r.times(.5))):new o(NaN)};p.inverseSine=p.asin=function(){var e,t,n,i,r=this,o=r.constructor;return r.isZero()?new o(r):(t=r.abs().cmp(1),n=o.precision,i=o.rounding,t!==-1?t===0?(e=J(o,n+4,i).times(.5),e.s=r.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=i,r.times(2)))};p.inverseTangent=p.atan=function(){var e,t,n,i,r,o,s,a,c,u=this,l=u.constructor,m=l.precision,d=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&m+4<=Pt)return s=J(l,m+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(m+4<=Pt)return s=J(l,m+4,d).times(.5),s.s=u.s,s}for(l.precision=a=m+10,l.rounding=1,n=Math.min(28,a/w+2|0),e=n;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(T=!1,t=Math.ceil(a/w),i=1,c=u.times(u),s=new l(u),r=u;e!==-1;)if(r=r.times(c),o=s.minus(r.div(i+=2)),r=r.times(c),s=o.plus(r.div(i+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return n&&(s=s.times(2<<n-1)),T=!0,P(s,l.precision=m,l.rounding=d,!0)};p.isFinite=function(){return!!this.d};p.isInteger=p.isInt=function(){return!!this.d&&U(this.e/w)>this.d.length-2};p.isNaN=function(){return!this.s};p.isNegative=p.isNeg=function(){return this.s<0};p.isPositive=p.isPos=function(){return this.s>0};p.isZero=function(){return!!this.d&&this.d[0]===0};p.lessThan=p.lt=function(e){return this.cmp(e)<0};p.lessThanOrEqualTo=p.lte=function(e){return this.cmp(e)<1};p.logarithm=p.log=function(e){var t,n,i,r,o,s,a,c,u=this,l=u.constructor,m=l.precision,d=l.rounding,f=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new l(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(r=n[0];r%10===0;)r/=10;o=r!==1}if(T=!1,a=m+f,s=me(u,a),i=t?Qe(l,a+10):me(e,a),c=R(s,i,a,1),Oe(c.d,r=m,d))do if(a+=10,s=me(u,a),i=t?Qe(l,a+10):me(e,a),c=R(s,i,a,1),!o){+V(c.d).slice(r+1,r+15)+1==1e14&&(c=P(c,m+1,0));break}while(Oe(c.d,r+=10,d));return T=!0,P(c,m,d)};p.minus=p.sub=function(e){var t,n,i,r,o,s,a,c,u,l,m,d,f=this,h=f.constructor;if(e=new h(e),!f.d||!e.d)return!f.s||!e.s?e=new h(NaN):f.d?e.s=-e.s:e=new h(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,d=e.d,a=h.precision,c=h.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new h(f);else return new h(c===3?-0:0);return T?P(e,a,c):e}if(n=U(e.e/w),l=U(f.e/w),u=u.slice(),o=l-n,o){for(m=o<0,m?(t=u,o=-o,s=d.length):(t=d,n=l,s=u.length),i=Math.max(Math.ceil(a/w),s)+2,o>i&&(o=i,t.length=1),t.reverse(),i=o;i--;)t.push(0);t.reverse()}else{for(i=u.length,s=d.length,m=i<s,m&&(s=i),i=0;i<s;i++)if(u[i]!=d[i]){m=u[i]<d[i];break}o=0}for(m&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,i=d.length-s;i>0;--i)u[s++]=0;for(i=d.length;i>o;){if(u[--i]<d[i]){for(r=i;r&&u[--r]===0;)u[r]=$-1;--u[r],u[i]+=$}u[i]-=d[i]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=Je(u,n),T?P(e,a,c):e):new h(c===3?-0:0)};p.modulo=p.mod=function(e){var t,n=this,i=n.constructor;return e=new i(e),!n.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||n.d&&!n.d[0]?P(new i(n),i.precision,i.rounding):(T=!1,i.modulo==9?(t=R(n,e.abs(),0,3,1),t.s*=e.s):t=R(n,e,0,i.modulo,1),t=t.times(e),T=!0,n.minus(t))};p.naturalExponential=p.exp=function(){return wt(this)};p.naturalLogarithm=p.ln=function(){return me(this)};p.negated=p.neg=function(){var e=new this.constructor(this);return e.s=-e.s,P(e)};p.plus=p.add=function(e){var t,n,i,r,o,s,a,c,u,l,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return!m.s||!e.s?e=new d(NaN):m.d||(e=new d(e.d||m.s===e.s?m:NaN)),e;if(m.s!=e.s)return e.s=-e.s,m.minus(e);if(u=m.d,l=e.d,a=d.precision,c=d.rounding,!u[0]||!l[0])return l[0]||(e=new d(m)),T?P(e,a,c):e;if(o=U(m.e/w),i=U(e.e/w),u=u.slice(),r=o-i,r){for(r<0?(n=u,r=-r,s=l.length):(n=l,i=o,s=u.length),o=Math.ceil(a/w),s=o>s?o+1:s+1,r>s&&(r=s,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for(s=u.length,r=l.length,s-r<0&&(r=s,n=l,l=u,u=n),t=0;r;)t=(u[--r]=u[r]+l[r]+t)/$|0,u[r]%=$;for(t&&(u.unshift(t),++i),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Je(u,i),T?P(e,a,c):e};p.precision=p.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(de+e);return n.d?(t=ln(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t};p.round=function(){var e=this,t=e.constructor;return P(new t(e),e.e+1,t.rounding)};p.sine=p.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+w,i.rounding=1,n=ci(i,fn(i,n)),i.precision=e,i.rounding=t,P(se>2?n.neg():n,e,t,!0)):new i(NaN)};p.squareRoot=p.sqrt=function(){var e,t,n,i,r,o,s=this,a=s.d,c=s.e,u=s.s,l=s.constructor;if(u!==1||!a||!a[0])return new l(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(T=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=V(a),(t.length+c)%2==0&&(t+="0"),u=Math.sqrt(t),c=U((c+1)/2)-(c<0||c%2),u==1/0?t="5e"+c:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),i=new l(t)):i=new l(u.toString()),n=(c=l.precision)+3;;)if(o=i,i=o.plus(R(s,o,n+2,1)).times(.5),V(o.d).slice(0,n)===(t=V(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!r&&t=="4999"){if(!r&&(P(o,c+1,0),o.times(o).eq(s))){i=o;break}n+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(P(i,c+1,1),e=!i.times(i).eq(s));break}return T=!0,P(i,c,l.rounding,e)};p.tangent=p.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,n=n.sin(),n.s=1,n=R(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,P(se==2||se==4?n.neg():n,e,t,!0)):new i(NaN)};p.times=p.mul=function(e){var t,n,i,r,o,s,a,c,u,l=this,m=l.constructor,d=l.d,f=(e=new m(e)).d;if(e.s*=l.s,!d||!d[0]||!f||!f[0])return new m(!e.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?e.s/0:e.s*0);for(n=U(l.e/w)+U(e.e/w),c=d.length,u=f.length,c<u&&(o=d,d=f,f=o,s=c,c=u,u=s),o=[],s=c+u,i=s;i--;)o.push(0);for(i=u;--i>=0;){for(t=0,r=c+i;r>i;)a=o[r]+f[i]*d[r-i-1]+t,o[r--]=a%$|0,t=a/$|0;o[r]=(o[r]+t)%$|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=Je(o,n),T?P(e,m.precision,m.rounding):e};p.toBinary=function(e,t){return At(this,2,e,t)};p.toDecimalPlaces=p.toDP=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(j(e,0,pe),t===void 0?t=i.rounding:j(t,0,8),P(n,e+n.e+1,t))};p.toExponential=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=te(i,!0):(j(e,0,pe),t===void 0?t=r.rounding:j(t,0,8),i=P(new r(i),e+1,t),n=te(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n};p.toFixed=function(e,t){var n,i,r=this,o=r.constructor;return e===void 0?n=te(r):(j(e,0,pe),t===void 0?t=o.rounding:j(t,0,8),i=P(new o(r),e+r.e+1,t),n=te(i,!1,e+i.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n};p.toFraction=function(e){var t,n,i,r,o,s,a,c,u,l,m,d,f=this,h=f.d,y=f.constructor;if(!h)return new y(f);if(u=n=new y(1),i=c=new y(0),t=new y(i),o=t.e=ln(h)-f.e-1,s=o%w,t.d[0]=D(10,s<0?w+s:s),e==null)e=o>0?t:u;else{if(a=new y(e),!a.isInt()||a.lt(u))throw Error(de+a);e=a.gt(t)?o>0?t:u:a}for(T=!1,a=new y(V(h)),l=y.precision,y.precision=o=h.length*w*2;m=R(a,t,0,1,1),r=n.plus(m.times(i)),r.cmp(e)!=1;)n=i,i=r,r=u,u=c.plus(m.times(r)),c=r,r=t,t=a.minus(m.times(r)),a=r;return r=R(e.minus(n),i,0,1,1),c=c.plus(r.times(u)),n=n.plus(r.times(i)),c.s=u.s=f.s,d=R(u,i,o,1).minus(f).abs().cmp(R(c,n,o,1).minus(f).abs())<1?[u,i]:[c,n],y.precision=l,T=!0,d};p.toHexadecimal=p.toHex=function(e,t){return At(this,16,e,t)};p.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),e==null){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),t===void 0?t=i.rounding:j(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(T=!1,n=R(n,e,0,t,1).times(e),T=!0,P(n)):(e.s=n.s,n=e),n};p.toNumber=function(){return+this};p.toOctal=function(e,t){return At(this,8,e,t)};p.toPower=p.pow=function(e){var t,n,i,r,o,s,a=this,c=a.constructor,u=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(D(+a,u));if(a=new c(a),a.eq(1))return a;if(i=c.precision,o=c.rounding,e.eq(1))return P(a,i,o);if(t=U(e.e/w),t>=e.d.length-1&&(n=u<0?-u:u)<=oi)return r=mn(c,a,n,i),e.s<0?new c(1).div(r):P(r,i,o);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return n=D(+a,u),t=n==0||!isFinite(n)?U(u*(Math.log("0."+V(a.d))/Math.LN10+a.e+1)):new c(n+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(T=!1,c.rounding=a.s=1,n=Math.min(12,(t+"").length),r=wt(e.times(me(a,i+n)),i),r.d&&(r=P(r,i+5,1),Oe(r.d,i,o)&&(t=i+10,r=P(wt(e.times(me(a,t+n)),t),t+5,1),+V(r.d).slice(i+1,i+15)+1==1e14&&(r=P(r,i+1,0)))),r.s=s,T=!0,c.rounding=o,P(r,i,o))};p.toPrecision=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=te(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(j(e,1,pe),t===void 0?t=r.rounding:j(t,0,8),i=P(new r(i),e,t),n=te(i,e<=i.e||i.e<=r.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n};p.toSignificantDigits=p.toSD=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(j(e,1,pe),t===void 0?t=i.rounding:j(t,0,8)),P(new i(n),e,t)};p.toString=function(){var e=this,t=e.constructor,n=te(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n};p.truncated=p.trunc=function(){return P(new this.constructor(this),this.e+1,1)};p.valueOf=p.toJSON=function(){var e=this,t=e.constructor,n=te(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function V(e){var t,n,i,r=e.length-1,o="",s=e[0];if(r>0){for(o+=s,t=1;t<r;t++)i=e[t]+"",n=w-i.length,n&&(o+=le(n)),o+=i;s=e[t],i=s+"",n=w-i.length,n&&(o+=le(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function j(e,t,n){if(e!==~~e||e<t||e>n)throw Error(de+e)}function Oe(e,t,n,i){var r,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=w,r=0):(r=Math.ceil((t+1)/w),t%=w),o=D(10,w-t),a=e[r]%o|0,i==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(e[r+1]/o/100|0)==D(10,t-2)-1||(a==o/2||a==0)&&(e[r+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(i||n<4)&&a==9999||!i&&n>3&&a==4999):s=((i||n<4)&&a+1==o||!i&&n>3&&a+1==o/2)&&(e[r+1]/o/1e3|0)==D(10,t-3)-1,s}function ze(e,t,n){for(var i,r=[0],o,s=0,a=e.length;s<a;){for(o=r.length;o--;)r[o]*=t;for(r[0]+=yt.indexOf(e.charAt(s++)),i=0;i<r.length;i++)r[i]>n-1&&(r[i+1]===void 0&&(r[i+1]=0),r[i+1]+=r[i]/n|0,r[i]%=n)}return r.reverse()}function ai(e,t){var n,i,r;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),r=(1/$e(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=Be(e,1,t.times(r),new e(1));for(var o=n;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}var R=function(){function e(i,r,o){var s,a=0,c=i.length;for(i=i.slice();c--;)s=i[c]*r+a,i[c]=s%o|0,a=s/o|0;return a&&i.unshift(a),i}function t(i,r,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(i[a]!=r[a]){c=i[a]>r[a]?1:-1;break}return c}function n(i,r,o,s){for(var a=0;o--;)i[o]-=a,a=i[o]<r[o]?1:0,i[o]=a*s+i[o]-r[o];for(;!i[0]&&i.length>1;)i.shift()}return function(i,r,o,s,a,c){var u,l,m,d,f,h,y,I,B,S,x,N,Pe,Y,we,ae,ue,Ne,H,ye,re=i.constructor,lt=i.s==r.s?1:-1,q=i.d,M=r.d;if(!q||!q[0]||!M||!M[0])return new re(!i.s||!r.s||(q?M&&q[0]==M[0]:!M)?NaN:q&&q[0]==0||!M?lt*0:lt/0);for(c?(f=1,l=i.e-r.e):(c=$,f=w,l=U(i.e/f)-U(r.e/f)),H=M.length,ue=q.length,B=new re(lt),S=B.d=[],m=0;M[m]==(q[m]||0);m++);if(M[m]>(q[m]||0)&&l--,o==null?(Y=o=re.precision,s=re.rounding):a?Y=o+(i.e-r.e)+1:Y=o,Y<0)S.push(1),h=!0;else{if(Y=Y/f+2|0,m=0,H==1){for(d=0,M=M[0],Y++;(m<ue||d)&&Y--;m++)we=d*c+(q[m]||0),S[m]=we/M|0,d=we%M|0;h=d||m<ue}else{for(d=c/(M[0]+1)|0,d>1&&(M=e(M,d,c),q=e(q,d,c),H=M.length,ue=q.length),ae=H,x=q.slice(0,H),N=x.length;N<H;)x[N++]=0;ye=M.slice(),ye.unshift(0),Ne=M[0],M[1]>=c/2&&++Ne;do d=0,u=t(M,x,H,N),u<0?(Pe=x[0],H!=N&&(Pe=Pe*c+(x[1]||0)),d=Pe/Ne|0,d>1?(d>=c&&(d=c-1),y=e(M,d,c),I=y.length,N=x.length,u=t(y,x,I,N),u==1&&(d--,n(y,H<I?ye:M,I,c))):(d==0&&(u=d=1),y=M.slice()),I=y.length,I<N&&y.unshift(0),n(x,y,N,c),u==-1&&(N=x.length,u=t(M,x,H,N),u<1&&(d++,n(x,H<N?ye:M,N,c))),N=x.length):u===0&&(d++,x=[0]),S[m++]=d,u&&x[0]?x[N++]=q[ae]||0:(x=[q[ae]],N=1);while((ae++<ue||x[0]!==void 0)&&Y--);h=x[0]!==void 0}S[0]||S.shift()}if(f==1)B.e=l,on=h;else{for(m=1,d=S[0];d>=10;d/=10)m++;B.e=m+l*f-1,P(B,a?o+B.e+1:o,s,h)}return B}}();function P(e,t,n,i){var r,o,s,a,c,u,l,m,d,f=e.constructor;e:if(t!=null){if(m=e.d,!m)return e;for(r=1,a=m[0];a>=10;a/=10)r++;if(o=t-r,o<0)o+=w,s=t,l=m[d=0],c=l/D(10,r-s-1)%10|0;else if(d=Math.ceil((o+1)/w),a=m.length,d>=a)if(i){for(;a++<=d;)m.push(0);l=c=0,r=1,o%=w,s=o-w+1}else break e;else{for(l=a=m[d],r=1;a>=10;a/=10)r++;o%=w,s=o-w+r,c=s<0?0:l/D(10,r-s-1)%10|0}if(i=i||t<0||m[d+1]!==void 0||(s<0?l:l%D(10,r-s-1)),u=n<4?(c||i)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||i||n==6&&(o>0?s>0?l/D(10,r-s):0:m[d-1])%10&1||n==(e.s<0?8:7)),t<1||!m[0])return m.length=0,u?(t-=e.e+1,m[0]=D(10,(w-t%w)%w),e.e=-t||0):m[0]=e.e=0,e;if(o==0?(m.length=d,a=1,d--):(m.length=d+1,a=D(10,w-o),m[d]=s>0?(l/D(10,r-s)%D(10,s)|0)*a:0),u)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&&(e.e++,m[0]==$&&(m[0]=1));break}else{if(m[d]+=a,m[d]!=$)break;m[d--]=0,a=1}for(o=m.length;m[--o]===0;)m.pop()}return T&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function te(e,t,n){if(!e.isFinite())return pn(e);var i,r=e.e,o=V(e.d),s=o.length;return t?(n&&(i=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+le(i):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):r<0?(o="0."+le(-r-1)+o,n&&(i=n-s)>0&&(o+=le(i))):r>=s?(o+=le(r+1-s),n&&(i=n-r-1)>0&&(o=o+"."+le(i))):((i=r+1)<s&&(o=o.slice(0,i)+"."+o.slice(i)),n&&(i=n-s)>0&&(r+1===s&&(o+="."),o+=le(i))),o}function Je(e,t){var n=e[0];for(t*=w;n>=10;n/=10)t++;return t}function Qe(e,t,n){if(t>si)throw T=!0,n&&(e.precision=n),Error(sn);return P(new e(Ze),t,1,!0)}function J(e,t,n){if(t>Pt)throw Error(sn);return P(new e(je),t,n,!0)}function ln(e){var t=e.length-1,n=t*w+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function le(e){for(var t="";e--;)t+="0";return t}function mn(e,t,n,i){var r,o=new e(1),s=Math.ceil(i/w+4);for(T=!1;;){if(n%2&&(o=o.times(t),nn(o.d,s)&&(r=!0)),n=U(n/2),n===0){n=o.d.length-1,r&&o.d[n]===0&&++o.d[n];break}t=t.times(t),nn(t.d,s)}return T=!0,o}function tn(e){return e.d[e.d.length-1]&1}function dn(e,t,n){for(var i,r=new e(t[0]),o=0;++o<t.length;)if(i=new e(t[o]),i.s)r[n](i)&&(r=i);else{r=i;break}return r}function wt(e,t){var n,i,r,o,s,a,c,u=0,l=0,m=0,d=e.constructor,f=d.rounding,h=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(T=!1,c=h):c=t,a=new d(.03125);e.e>-2;)e=e.times(a),m+=5;for(i=Math.log(D(2,m))/Math.LN10*2+5|0,c+=i,n=o=s=new d(1),d.precision=c;;){if(o=P(o.times(e),c,1),n=n.times(++l),a=s.plus(R(o,n,c,1)),V(a.d).slice(0,c)===V(s.d).slice(0,c)){for(r=m;r--;)s=P(s.times(s),c,1);if(t==null)if(u<3&&Oe(s.d,c-i,f,u))d.precision=c+=10,n=o=a=new d(1),l=0,u++;else return P(s,d.precision=h,f,T=!0);else return d.precision=h,s}s=a}}function me(e,t){var n,i,r,o,s,a,c,u,l,m,d,f=1,h=10,y=e,I=y.d,B=y.constructor,S=B.rounding,x=B.precision;if(y.s<0||!I||!I[0]||!y.e&&I[0]==1&&I.length==1)return new B(I&&!I[0]?-1/0:y.s!=1?NaN:I?0:y);if(t==null?(T=!1,l=x):l=t,B.precision=l+=h,n=V(I),i=n.charAt(0),Math.abs(o=y.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)y=y.times(e),n=V(y.d),i=n.charAt(0),f++;o=y.e,i>1?(y=new B("0."+n),o++):y=new B(i+"."+n.slice(1))}else return u=Qe(B,l+2,x).times(o+""),y=me(new B(i+"."+n.slice(1)),l-h).plus(u),B.precision=x,t==null?P(y,x,S,T=!0):y;for(m=y,c=s=y=R(y.minus(1),y.plus(1),l,1),d=P(y.times(y),l,1),r=3;;){if(s=P(s.times(d),l,1),u=c.plus(R(s,new B(r),l,1)),V(u.d).slice(0,l)===V(c.d).slice(0,l))if(c=c.times(2),o!==0&&(c=c.plus(Qe(B,l+2,x).times(o+""))),c=R(c,new B(f),l,1),t==null)if(Oe(c.d,l-h,S,a))B.precision=l+=h,u=s=y=R(m.minus(1),m.plus(1),l,1),d=P(y.times(y),l,1),r=a=1;else return P(c,B.precision=x,S,T=!0);else return B.precision=x,c;c=u,r+=2}}function pn(e){return String(e.s*e.s/0)}function kt(e,t){var n,i,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;t.charCodeAt(i)===48;i++);for(r=t.length;t.charCodeAt(r-1)===48;--r);if(t=t.slice(i,r),t){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%w,n<0&&(i+=w),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=w;i<r;)e.d.push(+t.slice(i,i+=w));t=t.slice(i),i=w-t.length}else i-=r;for(;i--;)t+="0";e.d.push(+t),T&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function ui(e,t){var n,i,r,o,s,a,c,u,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),cn.test(t))return kt(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(ii.test(t))n=16,t=t.toLowerCase();else if(ni.test(t))n=2;else if(ri.test(t))n=8;else throw Error(de+t);for(o=t.search(/p/i),o>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,i=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,r=mn(i,new i(n),o,o*2)),u=ze(t,n,$),l=u.length-1,o=l;u[o]===0;--o)u.pop();return o<0?new i(e.s*0):(e.e=Je(u,l),e.d=u,T=!1,s&&(e=R(e,r,a*4)),c&&(e=e.times(Math.abs(c)<54?D(2,c):et.pow(2,c))),T=!0,e)}function ci(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:Be(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/$e(5,n)),t=Be(e,2,t,t);for(var r,o=new e(5),s=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(o.plus(r.times(s.times(r).minus(a))));return t}function Be(e,t,n,i,r){var o,s,a,c,u=1,l=e.precision,m=Math.ceil(l/w);for(T=!1,c=n.times(n),a=new e(i);;){if(s=R(a.times(c),new e(t++*t++),l,1),a=r?i.plus(s):i.minus(s),i=R(s.times(c),new e(t++*t++),l,1),s=a.plus(i),s.d[m]!==void 0){for(o=m;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=i,i=s,s=o,u++}return T=!0,s.d.length=m+1,s}function $e(e,t){for(var n=e;--t;)n*=e;return n}function fn(e,t){var n,i=t.s<0,r=J(e,e.precision,1),o=r.times(.5);if(t=t.abs(),t.lte(o))return se=i?4:1,t;if(n=t.divToInt(r),n.isZero())se=i?3:2;else{if(t=t.minus(n.times(r)),t.lte(o))return se=tn(n)?i?2:3:i?4:1,t;se=tn(n)?i?1:4:i?3:2}return t.minus(r).abs()}function At(e,t,n,i){var r,o,s,a,c,u,l,m,d,f=e.constructor,h=n!==void 0;if(h?(j(n,1,pe),i===void 0?i=f.rounding:j(i,0,8)):(n=f.precision,i=f.rounding),!e.isFinite())l=pn(e);else{for(l=te(e),s=l.indexOf("."),h?(r=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):r=t,s>=0&&(l=l.replace(".",""),d=new f(1),d.e=l.length-s,d.d=ze(te(d),10,r),d.e=d.d.length),m=ze(l,10,r),o=c=m.length;m[--c]==0;)m.pop();if(!m[0])l=h?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=m,e.e=o,e=R(e,d,n,i,0,r),m=e.d,o=e.e,u=on),s=m[n],a=r/2,u=u||m[n+1]!==void 0,u=i<4?(s!==void 0||u)&&(i===0||i===(e.s<0?3:2)):s>a||s===a&&(i===4||u||i===6&&m[n-1]&1||i===(e.s<0?8:7)),m.length=n,u)for(;++m[--n]>r-1;)m[n]=0,n||(++o,m.unshift(1));for(c=m.length;!m[c-1];--c);for(s=0,l="";s<c;s++)l+=yt.charAt(m[s]);if(h){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)l+="0";for(m=ze(l,r,t),c=m.length;!m[c-1];--c);for(s=1,l="1.";s<c;s++)l+=yt.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>c)for(o-=c;o--;)l+="0";else o<c&&(l=l.slice(0,o)+"."+l.slice(o))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function nn(e,t){if(e.length>t)return e.length=t,!0}function li(e){return new this(e).abs()}function mi(e){return new this(e).acos()}function di(e){return new this(e).acosh()}function pi(e,t){return new this(e).plus(t)}function fi(e){return new this(e).asin()}function bi(e){return new this(e).asinh()}function yi(e){return new this(e).atan()}function gi(e){return new this(e).atanh()}function Pi(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,o=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=J(this,o,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?J(this,i,r):new this(0),n.s=e.s):!e.d||t.isZero()?(n=J(this,o,1).times(.5),n.s=e.s):t.s<0?(this.precision=o,this.rounding=1,n=this.atan(R(e,t,o,1)),t=J(this,o,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(R(e,t,o,1)),n}function wi(e){return new this(e).cbrt()}function ki(e){return P(e=new this(e),e.e+1,2)}function Ai(e,t,n){return new this(e).clamp(t,n)}function Ti(e){if(!e||typeof e!="object")throw Error(Ye+"Object expected");var t,n,i,r=e.defaults===!0,o=["precision",1,pe,"rounding",0,8,"toExpNeg",-xe,0,"toExpPos",0,xe,"maxE",0,xe,"minE",-xe,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],r&&(this[n]=gt[n]),(i=e[n])!==void 0)if(U(i)===i&&i>=o[t+1]&&i<=o[t+2])this[n]=i;else throw Error(de+n+": "+i);if(n="crypto",r&&(this[n]=gt[n]),(i=e[n])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(an);else this[n]=!1;else throw Error(de+n+": "+i);return this}function hi(e){return new this(e).cos()}function xi(e){return new this(e).cosh()}function bn(e){var t,n,i;function r(o){var s,a,c,u=this;if(!(u instanceof r))return new r(o);if(u.constructor=r,rn(o)){u.s=o.s,T?!o.d||o.e>r.maxE?(u.e=NaN,u.d=null):o.e<r.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;T?s>r.maxE?(u.e=NaN,u.d=null):s<r.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}else if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return kt(u,o.toString())}else if(c!=="string")throw Error(de+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),cn.test(o)?kt(u,o):ui(u,o)}if(r.prototype=p,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=Ti,r.clone=bn,r.isDecimal=rn,r.abs=li,r.acos=mi,r.acosh=di,r.add=pi,r.asin=fi,r.asinh=bi,r.atan=yi,r.atanh=gi,r.atan2=Pi,r.cbrt=wi,r.ceil=ki,r.clamp=Ai,r.cos=hi,r.cosh=xi,r.div=Bi,r.exp=Ii,r.floor=Si,r.hypot=Ci,r.ln=Ki,r.log=Ni,r.log10=Ri,r.log2=Li,r.max=Mi,r.min=Oi,r.mod=Fi,r.mul=Ei,r.pow=vi,r.random=Wi,r.round=Di,r.sign=Vi,r.sin=_i,r.sinh=qi,r.sqrt=Gi,r.sub=Ui,r.sum=Xi,r.tan=Hi,r.tanh=zi,r.trunc=Zi,e===void 0&&(e={}),e&&e.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(n=i[t++])||(e[n]=this[n]);return r.config(e),r}function Bi(e,t){return new this(e).div(t)}function Ii(e){return new this(e).exp()}function Si(e){return P(e=new this(e),e.e+1,3)}function Ci(){var e,t,n=new this(0);for(T=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return T=!0,new this(1/0);n=t}return T=!0,n.sqrt()}function rn(e){return e instanceof et||e&&e.toStringTag===un||!1}function Ki(e){return new this(e).ln()}function Ni(e,t){return new this(e).log(t)}function Li(e){return new this(e).log(2)}function Ri(e){return new this(e).log(10)}function Mi(){return dn(this,arguments,"lt")}function Oi(){return dn(this,arguments,"gt")}function Fi(e,t){return new this(e).mod(t)}function Ei(e,t){return new this(e).mul(t)}function vi(e,t){return new this(e).pow(t)}function Wi(e){var t,n,i,r,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:j(e,1,pe),i=Math.ceil(e/w),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));o<i;)r=t[o],r>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);o<i;)r=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(r%1e7),o+=4);o=i/4}else throw Error(an);else for(;o<i;)a[o++]=Math.random()*1e7|0;for(i=a[--o],e%=w,i&&e&&(r=D(10,w-e),a[o]=(i/r|0)*r);a[o]===0;o--)a.pop();if(o<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=w)a.shift();for(i=1,r=a[0];r>=10;r/=10)i++;i<w&&(n-=w-i)}return s.e=n,s.d=a,s}function Di(e){return P(e=new this(e),e.e+1,this.rounding)}function Vi(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function _i(e){return new this(e).sin()}function qi(e){return new this(e).sinh()}function Gi(e){return new this(e).sqrt()}function Ui(e,t){return new this(e).sub(t)}function Xi(){var e=0,t=arguments,n=new this(t[e]);for(T=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return T=!0,P(n,this.precision,this.rounding)}function Hi(e){return new this(e).tan()}function zi(e){return new this(e).tanh()}function Zi(e){return P(e=new this(e),e.e+1,1)}p[Symbol.for("nodejs.util.inspect.custom")]=p.toString;p[Symbol.toStringTag]="Decimal";var et=p.constructor=bn(gt);Ze=new et(Ze);je=new et(je);var kn=W(require("big.js")),$i=W(require("bn.js"));var yn=W(require("toformat")),ji=yn.default,Fe=ji;var Ee=W(require("big.js")),Pn=W(require("bn.js")),wn=W(require("decimal.js-light"));var Ie=W(require("bn.js"));var gn=9007199254740991;function ne(e){let t=X("Raydium_parseBigNumberish");if(e instanceof Ie.default)return e;if(typeof e=="string"){if(e.match(/^-?[0-9]+$/))return new Ie.default(e);t.logWithError(`invalid BigNumberish string: ${e}`)}return typeof e=="number"?(e%1&&t.logWithError(`BigNumberish number underflow: ${e}`),(e>=gn||e<=-gn)&&t.logWithError(`BigNumberish number overflow: ${e}`),new Ie.default(String(e))):typeof e=="bigint"?new Ie.default(e.toString()):(t.error(`invalid BigNumberish value: ${e}`),new Ie.default(0))}var tt=X("module/fraction"),Tt=Fe(Ee.default),ve=Fe(wn.default),Yi={[0]:ve.ROUND_DOWN,[1]:ve.ROUND_HALF_UP,[2]:ve.ROUND_UP},Ji={[0]:Ee.default.roundDown,[1]:Ee.default.roundHalfUp,[2]:Ee.default.roundUp},F=class{constructor(t,n=new Pn.default(1)){this.numerator=ne(t),this.denominator=ne(n)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new F(this.denominator,this.numerator)}add(t){let n=t instanceof F?t:new F(ne(t));return this.denominator.eq(n.denominator)?new F(this.numerator.add(n.numerator),this.denominator):new F(this.numerator.mul(n.denominator).add(n.numerator.mul(this.denominator)),this.denominator.mul(n.denominator))}sub(t){let n=t instanceof F?t:new F(ne(t));return this.denominator.eq(n.denominator)?new F(this.numerator.sub(n.numerator),this.denominator):new F(this.numerator.mul(n.denominator).sub(n.numerator.mul(this.denominator)),this.denominator.mul(n.denominator))}mul(t){let n=t instanceof F?t:new F(ne(t));return new F(this.numerator.mul(n.numerator),this.denominator.mul(n.denominator))}div(t){let n=t instanceof F?t:new F(ne(t));return new F(this.numerator.mul(n.denominator),this.denominator.mul(n.numerator))}toSignificant(t,n={groupSeparator:""},i=1){Number.isInteger(t)||tt.logWithError(`${t} is not an integer.`),t<=0&&tt.logWithError(`${t} is not positive.`),ve.set({precision:t+1,rounding:Yi[i]});let r=new ve(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return r.toFormat(r.decimalPlaces(),n)}toFixed(t,n={groupSeparator:""},i=1){return Number.isInteger(t)||tt.logWithError(`${t} is not an integer.`),t<0&&tt.logWithError(`${t} is negative.`),Tt.DP=t,Tt.RM=Ji[i]||1,new Tt(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,n)}isZero(){return this.numerator.isZero()}};var Xo=X("Raydium_amount"),Ho=Fe(kn.default);var An=require("@solana/web3.js"),ht=require("@solana/spl-token"),xt={chainId:101,address:An.PublicKey.default.toBase58(),programId:ht.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},fe={chainId:101,address:"So11111111111111111111111111111111111111112",programId:ht.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var it=require("@solana/web3.js");var L=require("@solana/web3.js"),Tn=require("@solana/spl-token");function Bt({pubkey:e,isSigner:t=!1,isWritable:n=!0}){return{pubkey:e,isWritable:n,isSigner:t}}var Qo=[Bt({pubkey:Tn.TOKEN_PROGRAM_ID,isWritable:!1}),Bt({pubkey:L.SystemProgram.programId,isWritable:!1}),Bt({pubkey:L.SYSVAR_RENT_PUBKEY,isWritable:!1})];function hn({publicKey:e,transformSol:t}){let n=xn(e.toString());if(n instanceof L.PublicKey)return t&&n.equals(We)?He:n;if(t&&n.toString()===We.toBase58())return He;if(typeof n=="string"){if(n===L.PublicKey.default.toBase58())return L.PublicKey.default;try{return new L.PublicKey(n)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function xn(e){try{return new L.PublicKey(e)}catch{return e}}var tr=new L.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),nr=new L.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),It=new L.PublicKey("SysvarRent111111111111111111111111111111111"),Yo=new L.PublicKey("SysvarC1ock11111111111111111111111111111111"),nt=new L.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Jo=new L.PublicKey("Sysvar1nstructions1111111111111111111111111"),$o=L.SystemProgram.programId,es=new L.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),ts=new L.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),ns=new L.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),is=new L.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),rs=new L.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),os=new L.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),ss=new L.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),as=new L.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),us=new L.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),cs=new L.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),ls=new L.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),He=new L.PublicKey("So11111111111111111111111111111111111111112"),We=L.PublicKey.default;var St=class{constructor({mint:t,decimals:n,symbol:i,name:r,skipMint:o=!1,isToken2022:s=!1}){if(t===We.toBase58()||t instanceof it.PublicKey&&We.equals(t)){this.decimals=fe.decimals,this.symbol=fe.symbol,this.name=fe.name,this.mint=new it.PublicKey(fe.address),this.isToken2022=!1;return}this.decimals=n,this.symbol=i||t.toString().substring(0,6),this.name=r||t.toString().substring(0,6),this.mint=o?it.PublicKey.default:hn({publicKey:t}),this.isToken2022=s}equals(t){return this===t?!0:this.mint.equals(t.mint)}},be=St;be.WSOL=new St(z(G({},fe),{mint:fe.address}));var Ct=class{constructor({decimals:t,symbol:n="UNKNOWN",name:i="UNKNOWN"}){this.decimals=t,this.symbol=n,this.name=i}equals(t){return this===t}},rt=Ct;rt.SOL=new Ct(xt);var Bn=W(require("bn.js"));var ks=new F(new Bn.default(100));var Is=X("Raydium_price");var rr=require("@solana/web3.js"),or=W(require("bn.js"));var ir=new ie.default(0),ra=new ie.default(1),oa=new ie.default(2),sa=new ie.default(3),aa=new ie.default(5),er=new ie.default(10),ua=new ie.default(100),ca=new ie.default(1e3),la=new ie.default(1e4);var ar=require("@solana/web3.js"),ur=require("@solana/spl-token");var ge=require("@solana/web3.js");var sr=require("@solana/spl-token"),ha=X("Raydium_txUtil");function st(e,t){let[n,i]=ge.PublicKey.findProgramAddressSync(e,t);return{publicKey:n,nonce:i}}var A=require("@solana/web3.js"),Sa=new A.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),Ca=new A.PublicKey("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Ka=new A.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),Na=new A.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),La=new A.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),Ra=new A.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Ma=new A.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),Oa=new A.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),Fa=new A.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),Ea=new A.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),cr=new A.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),lr=new A.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),mr=new A.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),va=new A.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),Wa=new A.PublicKey("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),Da=new A.PublicKey("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),Va=new A.PublicKey("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),_a=new A.PublicKey("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),qa=new A.PublicKey("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),Ga=new A.PublicKey("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),Ua=new A.PublicKey("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),Xa=new A.PublicKey("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),dr=new A.PublicKey("CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW"),pr=new A.PublicKey("7rQ1QFNosMkUCuh7Z7fPbTHvh73b68sQYdirycEzJVuw"),fr=new A.PublicKey("G11FKBRaAkHAKuLCgLM6K6NUc9rTjPAznRCjZifrTQe2"),Ha=new A.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),br=new A.PublicKey("DLockwT7X7sxtLmGH9g5kmfcjaBtncdbUmi738m5bvQC"),za=new A.PublicKey("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),yr=new A.PublicKey("7AFUeLVRjBfzqK3tTGw8hN48KLQWSk6DTE8xprWdPqix"),Za=new A.PublicKey("LanMkFSVSncjWqWAM8MUHenZzt9xTcT3DcAp949ZwbF"),ja=new A.PublicKey("495mQpkX8mHAv18yGsfubCXbFQ9Jok1L1BvMrV9KvCHr"),gr=new A.PublicKey("7soRSLviCKHCKzCbRuVpZDif76NWLVqFtbjt8LpyxWSq"),Pr=new A.PublicKey("DG6kZFFCqxdtWXw53Zc28hLs3MTr28Efkm2FrsNERNSQ");var Qa={SERUM_MARKET:A.PublicKey.default,OPENBOOK_MARKET:new A.PublicKey("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),UTIL1216:A.PublicKey.default,FarmV3:new A.PublicKey("85BFyr98MbCUU9MVTEgzx1nbhWACbJqLzho6zd6DZcWL"),FarmV5:new A.PublicKey("EcLzTrNg9V7qhcdyXDe2qjtPkiGzDM2UbdRaeaadU5r2"),FarmV6:new A.PublicKey("Farm2hJLcqPtPg8M4rR6DMrsRNc5TPm5Cs4bVQrMe2T7"),AmmV4:new A.PublicKey("HWy1jotHpo6UqeQxx49dpYYdQB8wj9Qk9MdxwjLvDHB8"),AmmStable:new A.PublicKey("DDg4VmQaJV9ogWce7LpcjBA9bv22wRp5uaTPa5pGjijF"),CLMM:new A.PublicKey("devi51mZmdwUJGU9hjN27vEz64Gps7uUefqxg27EAtH"),CLMM_LOCK_PROGRAM_ID:new A.PublicKey("DLockwT7X7sxtLmGH9g5kmfcjaBtncdbUmi738m5bvQC"),CLMM_LOCK_AUTH_ID:new A.PublicKey("8qmHNvu2Kr2C7U8mJL4Vz1vTDxMhVuXKREwU7TNoaVEo"),Router:new A.PublicKey("BVChZ3XFEwTMUk1o9i3HAf91H6mFxSwa5X2wFAWhYPhU"),CREATE_CPMM_POOL_PROGRAM:dr,CREATE_CPMM_POOL_AUTH:pr,CREATE_CPMM_POOL_FEE_ACC:fr,FEE_DESTINATION_ID:new A.PublicKey("3XMrhbv989VxAMi3DErLV9eJht1pHppW5LbKxe9fkEFR"),LOCK_CPMM_PROGRAM:br,LCOK_CPMM_AUTH:yr,LAUNCHPAD_PROGRAM:gr,LAUNCHPAD_AUTH:Pr};var wr=W(require("bn.js"));var Ve=require("@solana/web3.js");var kr={AcL1Vo8oy1ULiavEcjSUcwfBSForXMudcZvDZy5nzJkU:new Ve.AddressLookupTableAccount({key:new Ve.PublicKey("AcL1Vo8oy1ULiavEcjSUcwfBSForXMudcZvDZy5nzJkU"),state:Ve.AddressLookupTableAccount.deserialize(Buffer.from("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","base64"))})};var Se=require("@solana/web3.js"),hr=W(require("axios"));var Sn=W(require("bn.js")),wu=new Sn.default(1e6);var Qr=require("@solana/web3.js"),Yr=W(require("bn.js"));var Dt=require("@solana/spl-token");var xr=require("@solana/web3.js"),Cn=require("@solana/spl-token");var ct=require("@solana/web3.js"),jr=W(require("bn.js"));var Wt=require("@solana/spl-token");var Wr=W(require("bn.js"));var Q=W(require("bn.js")),Rt=new Q.default(0),Kn=new Q.default(1),Nn=new Q.default(-1),at=new Q.default(1).shln(64),Ln=new Q.default(1).shln(128),Br=at.sub(Kn);var Ir=Ln.subn(1),Ce=-443636,_e=-Ce,Mt=new Q.default("4295048016"),Ot=new Q.default("79226673521