@raydium-io/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
1 lines • 61.1 kB
JavaScript
var pr=Object.defineProperty,gr=Object.defineProperties;var hr=Object.getOwnPropertyDescriptors;var gt=Object.getOwnPropertySymbols;var wr=Object.prototype.hasOwnProperty,yr=Object.prototype.propertyIsEnumerable;var ht=(e,t,r)=>t in e?pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t)=>{for(var r in t||(t={}))wr.call(t,r)&&ht(e,r,t[r]);if(gt)for(var r of gt(t))yr.call(t,r)&&ht(e,r,t[r]);return e},G=(e,t)=>gr(e,hr(t));import j from"bn.js";import{PublicKey as xr}from"@solana/web3.js";import{get as wt,set as br}from"lodash";var je=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 r=t.map(n=>typeof n=="object"?JSON.stringify(n):n).join(", ");throw new Error(r)}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}},yt={},Tr={};function K(e){let t=wt(yt,e);if(!t){let r=wt(Tr,e);t=new je({name:e,logLevel:r}),br(yt,e,t)}return t}import{MINT_SIZE as Si,TOKEN_PROGRAM_ID as Li,getTransferFeeConfig as Ai,unpackMint as Bi}from"@solana/spl-token";var Ze=K("Raydium_accountInfo_util");async function bt(e,t,r){let{batchRequest:n,commitment:i="confirmed",chunkCount:o=100}=O({batchRequest:!1},r),s=ze(t,o),a=new Array(s.length).fill([]);if(n){let c=s.map(d=>{let f=e._buildArgs([d.map(p=>p.toBase58())],i,"base64");return{methodName:"getMultipleAccounts",args:f}}),u=ze(c,10);a=(await(await Promise.all(u.map(async d=>await e._rpcBatchRequest(d)))).flat()).map(d=>(d.error&&Ze.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${d.error.message}`),d.result.value.map(f=>{if(f){let{data:p,executable:x,lamports:y,owner:B,rentEpoch:S}=f;return p.length!==2&&p[1]!=="base64"&&Ze.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(p[0],"base64"),executable:x,lamports:y,owner:new xr(B),rentEpoch:S}}return null})))}else try{a=await Promise.all(s.map(c=>e.getMultipleAccountsInfo(c,i)))}catch(c){c instanceof Error&&Ze.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${c.message}`)}return a.flat()}async function Tt(e,t,r){let n=await bt(e,t.map(i=>i.pubkey),r);return t.map((i,o)=>G(O({},i),{accountInfo:n[o]}))}import te from"bn.js";var le=9e15,se=1e9,Xe="0123456789abcdef",ke="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ce="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Je={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-le,maxE:le,crypto:!1},Lt,Y,b=!0,Ne="[DecimalError] ",oe=Ne+"Invalid argument: ",At=Ne+"Precision limit exceeded",Bt=Ne+"crypto unavailable",kt="[object Decimal]",q=Math.floor,V=Math.pow,Pr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Sr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Lr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ct=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Q=1e7,w=7,Ar=9007199254740991,Br=ke.length-1,Ye=Ce.length-1,m={toStringTag:kt};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),h(e)};m.ceil=function(){return h(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(oe+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};m.comparedTo=m.cmp=function(e){var t,r,n,i,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(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};m.cosine=m.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+w,n.rounding=1,r=kr(n,vt(n,r)),n.precision=e,n.rounding=t,h(Y==2||Y==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};m.cubeRoot=m.cbrt=function(){var e,t,r,n,i,o,s,a,c,u,l=this,d=l.constructor;if(!l.isFinite()||l.isZero())return new d(l);for(b=!1,o=l.s*V(l.s*l,1/3),!o||Math.abs(o)==1/0?(r=U(l.d),e=l.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=V(r,1/3),e=q((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new d(r),n.s=l.s):n=new d(o.toString()),s=(e=d.precision)+3;;)if(a=n,c=a.times(a).times(a),u=c.plus(l),n=I(u.plus(l).times(a),u.plus(c),s+2,1),U(a.d).slice(0,s)===(r=U(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(h(a,e+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(h(n,e+1,1),t=!n.times(n).times(n).eq(l));break}return b=!0,h(n,e,d.rounding,t)};m.decimalPlaces=m.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-q(this.e/w))*w,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};m.dividedBy=m.div=function(e){return I(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var t=this,r=t.constructor;return h(I(t,new r(e),0,1,1),r.precision,r.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return h(new this.constructor(this),this.e+1,3)};m.greaterThan=m.gt=function(e){return this.cmp(e)>0};m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0};m.hyperbolicCosine=m.cosh=function(){var e,t,r,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;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Me(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=de(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 h(o,s.precision=r,s.rounding=n,!0)};m.hyperbolicSine=m.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=de(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Me(5,e)),i=de(o,2,i,i,!0);for(var s,a=new o(5),c=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(c.times(s).plus(u))))}return o.precision=t,o.rounding=r,h(i,t,r,!0)};m.hyperbolicTangent=m.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,I(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};m.inverseCosine=m.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?z(r,i,o):new r(0):new r(NaN):t.isZero()?z(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=z(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};m.inverseHyperbolicCosine=m.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,b=!1,r=r.times(r).minus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};m.inverseHyperbolicSine=m.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,b=!1,r=r.times(r).plus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,t,r,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):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?h(new o(i),e,t,!0):(o.precision=r=n-i.e,i=I(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=z(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};m.inverseTangent=m.atan=function(){var e,t,r,n,i,o,s,a,c,u=this,l=u.constructor,d=l.precision,f=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&d+4<=Ye)return s=z(l,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(d+4<=Ye)return s=z(l,d+4,f).times(.5),s.s=u.s,s}for(l.precision=a=d+10,l.rounding=1,r=Math.min(28,a/w+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(b=!1,t=Math.ceil(a/w),n=1,c=u.times(u),s=new l(u),i=u;e!==-1;)if(i=i.times(c),o=s.minus(i.div(n+=2)),i=i.times(c),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),b=!0,h(s,l.precision=d,l.rounding=f,!0)};m.isFinite=function(){return!!this.d};m.isInteger=m.isInt=function(){return!!this.d&&q(this.e/w)>this.d.length-2};m.isNaN=function(){return!this.s};m.isNegative=m.isNeg=function(){return this.s<0};m.isPositive=m.isPos=function(){return this.s>0};m.isZero=function(){return!!this.d&&this.d[0]===0};m.lessThan=m.lt=function(e){return this.cmp(e)<0};m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1};m.logarithm=m.log=function(e){var t,r,n,i,o,s,a,c,u=this,l=u.constructor,d=l.precision,f=l.rounding,p=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new l(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(b=!1,a=d+p,s=ie(u,a),n=t?Ie(l,a+10):ie(e,a),c=I(s,n,a,1),ge(c.d,i=d,f))do if(a+=10,s=ie(u,a),n=t?Ie(l,a+10):ie(e,a),c=I(s,n,a,1),!o){+U(c.d).slice(i+1,i+15)+1==1e14&&(c=h(c,d+1,0));break}while(ge(c.d,i+=10,f));return b=!0,h(c,d,f)};m.minus=m.sub=function(e){var t,r,n,i,o,s,a,c,u,l,d,f,p=this,x=p.constructor;if(e=new x(e),!p.d||!e.d)return!p.s||!e.s?e=new x(NaN):p.d?e.s=-e.s:e=new x(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(u=p.d,f=e.d,a=x.precision,c=x.rounding,!u[0]||!f[0]){if(f[0])e.s=-e.s;else if(u[0])e=new x(p);else return new x(c===3?-0:0);return b?h(e,a,c):e}if(r=q(e.e/w),l=q(p.e/w),u=u.slice(),o=l-r,o){for(d=o<0,d?(t=u,o=-o,s=f.length):(t=f,r=l,s=u.length),n=Math.max(Math.ceil(a/w),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=f.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}o=0}for(d&&(t=u,u=f,f=t,e.s=-e.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>o;){if(u[--n]<f[n]){for(i=n;i&&u[--i]===0;)u[i]=Q-1;--u[i],u[n]+=Q}u[n]-=f[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=Re(u,r),b?h(e,a,c):e):new x(c===3?-0:0)};m.modulo=m.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?h(new n(r),n.precision,n.rounding):(b=!1,n.modulo==9?(t=I(r,e.abs(),0,3,1),t.s*=e.s):t=I(r,e,0,n.modulo,1),t=t.times(e),b=!0,r.minus(t))};m.naturalExponential=m.exp=function(){return $e(this)};m.naturalLogarithm=m.ln=function(){return ie(this)};m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s,h(e)};m.plus=m.add=function(e){var t,r,n,i,o,s,a,c,u,l,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(u=d.d,l=e.d,a=f.precision,c=f.rounding,!u[0]||!l[0])return l[0]||(e=new f(d)),b?h(e,a,c):e;if(o=q(d.e/w),n=q(e.e/w),u=u.slice(),i=o-n,i){for(i<0?(r=u,i=-i,s=l.length):(r=l,n=o,s=u.length),o=Math.ceil(a/w),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=l.length,s-i<0&&(i=s,r=l,l=u,u=r),t=0;i;)t=(u[--i]=u[i]+l[i]+t)/Q|0,u[i]%=Q;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Re(u,n),b?h(e,a,c):e};m.precision=m.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(oe+e);return r.d?(t=It(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};m.round=function(){var e=this,t=e.constructor;return h(new t(e),e.e+1,t.rounding)};m.sine=m.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+w,n.rounding=1,r=Ir(n,vt(n,r)),n.precision=e,n.rounding=t,h(Y>2?r.neg():r,e,t,!0)):new n(NaN)};m.squareRoot=m.sqrt=function(){var e,t,r,n,i,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(b=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=U(a),(t.length+c)%2==0&&(t+="0"),u=Math.sqrt(t),c=q((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),n=new l(t)):n=new l(u.toString()),r=(c=l.precision)+3;;)if(o=n,n=o.plus(I(s,o,r+2,1)).times(.5),U(o.d).slice(0,r)===(t=U(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(h(o,c+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(h(n,c+1,1),e=!n.times(n).eq(s));break}return b=!0,h(n,c,l.rounding,e)};m.tangent=m.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=I(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,h(Y==2||Y==4?r.neg():r,e,t,!0)):new n(NaN)};m.times=m.mul=function(e){var t,r,n,i,o,s,a,c,u,l=this,d=l.constructor,f=l.d,p=(e=new d(e)).d;if(e.s*=l.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(r=q(l.e/w)+q(e.e/w),c=f.length,u=p.length,c<u&&(o=f,f=p,p=o,s=c,c=u,u=s),o=[],s=c+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=c+n;i>n;)a=o[i]+p[n]*f[i-n-1]+t,o[i--]=a%Q|0,t=a/Q|0;o[i]=(o[i]+t)%Q|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Re(o,r),b?h(e,d.precision,d.rounding):e};m.toBinary=function(e,t){return tt(this,2,e,t)};m.toDecimalPlaces=m.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(H(e,0,se),t===void 0?t=n.rounding:H(t,0,8),h(r,e+r.e+1,t))};m.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=X(n,!0):(H(e,0,se),t===void 0?t=i.rounding:H(t,0,8),n=h(new i(n),e+1,t),r=X(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=X(i):(H(e,0,se),t===void 0?t=o.rounding:H(t,0,8),n=h(new o(i),e+i.e+1,t),r=X(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};m.toFraction=function(e){var t,r,n,i,o,s,a,c,u,l,d,f,p=this,x=p.d,y=p.constructor;if(!x)return new y(p);if(u=r=new y(1),n=c=new y(0),t=new y(n),o=t.e=It(x)-p.e-1,s=o%w,t.d[0]=V(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(oe+a);e=a.gt(t)?o>0?t:u:a}for(b=!1,a=new y(U(x)),l=y.precision,y.precision=o=x.length*w*2;d=I(a,t,0,1,1),i=r.plus(d.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=c.plus(d.times(i)),c=i,i=t,t=a.minus(d.times(i)),a=i;return i=I(e.minus(r),n,0,1,1),c=c.plus(i.times(u)),r=r.plus(i.times(n)),c.s=u.s=p.s,f=I(u,n,o,1).minus(p).abs().cmp(I(c,r,o,1).minus(p).abs())<1?[u,n]:[c,r],y.precision=l,b=!0,f};m.toHexadecimal=m.toHex=function(e,t){return tt(this,16,e,t)};m.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:H(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(b=!1,r=I(r,e,0,t,1).times(e),b=!0,h(r)):(e.s=r.s,r=e),r};m.toNumber=function(){return+this};m.toOctal=function(e,t){return tt(this,8,e,t)};m.toPower=m.pow=function(e){var t,r,n,i,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(V(+a,u));if(a=new c(a),a.eq(1))return a;if(n=c.precision,o=c.rounding,e.eq(1))return h(a,n,o);if(t=q(e.e/w),t>=e.d.length-1&&(r=u<0?-u:u)<=Ar)return i=Nt(c,a,r,n),e.s<0?new c(1).div(i):h(i,n,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 r=V(+a,u),t=r==0||!isFinite(r)?q(u*(Math.log("0."+U(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(b=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=$e(e.times(ie(a,n+r)),n),i.d&&(i=h(i,n+5,1),ge(i.d,n,o)&&(t=n+10,i=h($e(e.times(ie(a,t+r)),t),t+5,1),+U(i.d).slice(n+1,n+15)+1==1e14&&(i=h(i,n+1,0)))),i.s=s,b=!0,c.rounding=o,h(i,n,o))};m.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=X(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(H(e,1,se),t===void 0?t=i.rounding:H(t,0,8),n=h(new i(n),e,t),r=X(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toSignificantDigits=m.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(H(e,1,se),t===void 0?t=n.rounding:H(t,0,8)),h(new n(r),e,t)};m.toString=function(){var e=this,t=e.constructor,r=X(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};m.truncated=m.trunc=function(){return h(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,r=X(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function U(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=w-n.length,r&&(o+=ne(r)),o+=n;s=e[t],n=s+"",r=w-n.length,r&&(o+=ne(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function H(e,t,r){if(e!==~~e||e<t||e>r)throw Error(oe+e)}function ge(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=w,i=0):(i=Math.ceil((t+1)/w),t%=w),o=V(10,w-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==V(10,t-2)-1||(a==o/2||a==0)&&(e[i+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=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==V(10,t-3)-1,s}function Be(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Xe.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function kr(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Me(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=de(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var I=function(){function e(n,i,o){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*i+a,n[c]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(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,c){var u,l,d,f,p,x,y,B,S,_,C,D,Pe,J,qe,Se,pe,Ge,Z,Le,Ae=n.constructor,He=n.s==i.s?1:-1,W=n.d,N=i.d;if(!W||!W[0]||!N||!N[0])return new Ae(!n.s||!i.s||(W?N&&W[0]==N[0]:!N)?NaN:W&&W[0]==0||!N?He*0:He/0);for(c?(p=1,l=n.e-i.e):(c=Q,p=w,l=q(n.e/p)-q(i.e/p)),Z=N.length,pe=W.length,S=new Ae(He),_=S.d=[],d=0;N[d]==(W[d]||0);d++);if(N[d]>(W[d]||0)&&l--,o==null?(J=o=Ae.precision,s=Ae.rounding):a?J=o+(n.e-i.e)+1:J=o,J<0)_.push(1),x=!0;else{if(J=J/p+2|0,d=0,Z==1){for(f=0,N=N[0],J++;(d<pe||f)&&J--;d++)qe=f*c+(W[d]||0),_[d]=qe/N|0,f=qe%N|0;x=f||d<pe}else{for(f=c/(N[0]+1)|0,f>1&&(N=e(N,f,c),W=e(W,f,c),Z=N.length,pe=W.length),Se=Z,C=W.slice(0,Z),D=C.length;D<Z;)C[D++]=0;Le=N.slice(),Le.unshift(0),Ge=N[0],N[1]>=c/2&&++Ge;do f=0,u=t(N,C,Z,D),u<0?(Pe=C[0],Z!=D&&(Pe=Pe*c+(C[1]||0)),f=Pe/Ge|0,f>1?(f>=c&&(f=c-1),y=e(N,f,c),B=y.length,D=C.length,u=t(y,C,B,D),u==1&&(f--,r(y,Z<B?Le:N,B,c))):(f==0&&(u=f=1),y=N.slice()),B=y.length,B<D&&y.unshift(0),r(C,y,D,c),u==-1&&(D=C.length,u=t(N,C,Z,D),u<1&&(f++,r(C,Z<D?Le:N,D,c))),D=C.length):u===0&&(f++,C=[0]),_[d++]=f,u&&C[0]?C[D++]=W[Se]||0:(C=[W[Se]],D=1);while((Se++<pe||C[0]!==void 0)&&J--);x=C[0]!==void 0}_[0]||_.shift()}if(p==1)S.e=l,Lt=x;else{for(d=1,f=_[0];f>=10;f/=10)d++;S.e=d+l*p-1,h(S,a?o+S.e+1:o,s,x)}return S}}();function h(e,t,r,n){var i,o,s,a,c,u,l,d,f,p=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=w,s=t,l=d[f=0],c=l/V(10,i-s-1)%10|0;else if(f=Math.ceil((o+1)/w),a=d.length,f>=a)if(n){for(;a++<=f;)d.push(0);l=c=0,i=1,o%=w,s=o-w+1}else break e;else{for(l=a=d[f],i=1;a>=10;a/=10)i++;o%=w,s=o-w+i,c=s<0?0:l/V(10,i-s-1)%10|0}if(n=n||t<0||d[f+1]!==void 0||(s<0?l:l%V(10,i-s-1)),u=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(o>0?s>0?l/V(10,i-s):0:d[f-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,u?(t-=e.e+1,d[0]=V(10,(w-t%w)%w),e.e=-t||0):d[0]=e.e=0,e;if(o==0?(d.length=f,a=1,f--):(d.length=f+1,a=V(10,w-o),d[f]=s>0?(l/V(10,i-s)%V(10,s)|0)*a:0),u)for(;;)if(f==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,d[0]==Q&&(d[0]=1));break}else{if(d[f]+=a,d[f]!=Q)break;d[f--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return b&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function X(e,t,r){if(!e.isFinite())return Mt(e);var n,i=e.e,o=U(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+ne(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+ne(-i-1)+o,r&&(n=r-s)>0&&(o+=ne(n))):i>=s?(o+=ne(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+ne(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=ne(n))),o}function Re(e,t){var r=e[0];for(t*=w;r>=10;r/=10)t++;return t}function Ie(e,t,r){if(t>Br)throw b=!0,r&&(e.precision=r),Error(At);return h(new e(ke),t,1,!0)}function z(e,t,r){if(t>Ye)throw Error(At);return h(new e(Ce),t,r,!0)}function It(e){var t=e.length-1,r=t*w+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function ne(e){for(var t="";e--;)t+="0";return t}function Nt(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/w+4);for(b=!1;;){if(r%2&&(o=o.times(t),Pt(o.d,s)&&(i=!0)),r=q(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Pt(t.d,s)}return b=!0,o}function xt(e){return e.d[e.d.length-1]&1}function Rt(e,t,r){for(var n,i=new e(t[0]),o=0;++o<t.length;)if(n=new e(t[o]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function $e(e,t){var r,n,i,o,s,a,c,u=0,l=0,d=0,f=e.constructor,p=f.rounding,x=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(b=!1,c=x):c=t,a=new f(.03125);e.e>-2;)e=e.times(a),d+=5;for(n=Math.log(V(2,d))/Math.LN10*2+5|0,c+=n,r=o=s=new f(1),f.precision=c;;){if(o=h(o.times(e),c,1),r=r.times(++l),a=s.plus(I(o,r,c,1)),U(a.d).slice(0,c)===U(s.d).slice(0,c)){for(i=d;i--;)s=h(s.times(s),c,1);if(t==null)if(u<3&&ge(s.d,c-n,p,u))f.precision=c+=10,r=o=a=new f(1),l=0,u++;else return h(s,f.precision=x,p,b=!0);else return f.precision=x,s}s=a}}function ie(e,t){var r,n,i,o,s,a,c,u,l,d,f,p=1,x=10,y=e,B=y.d,S=y.constructor,_=S.rounding,C=S.precision;if(y.s<0||!B||!B[0]||!y.e&&B[0]==1&&B.length==1)return new S(B&&!B[0]?-1/0:y.s!=1?NaN:B?0:y);if(t==null?(b=!1,l=C):l=t,S.precision=l+=x,r=U(B),n=r.charAt(0),Math.abs(o=y.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)y=y.times(e),r=U(y.d),n=r.charAt(0),p++;o=y.e,n>1?(y=new S("0."+r),o++):y=new S(n+"."+r.slice(1))}else return u=Ie(S,l+2,C).times(o+""),y=ie(new S(n+"."+r.slice(1)),l-x).plus(u),S.precision=C,t==null?h(y,C,_,b=!0):y;for(d=y,c=s=y=I(y.minus(1),y.plus(1),l,1),f=h(y.times(y),l,1),i=3;;){if(s=h(s.times(f),l,1),u=c.plus(I(s,new S(i),l,1)),U(u.d).slice(0,l)===U(c.d).slice(0,l))if(c=c.times(2),o!==0&&(c=c.plus(Ie(S,l+2,C).times(o+""))),c=I(c,new S(p),l,1),t==null)if(ge(c.d,l-x,_,a))S.precision=l+=x,u=s=y=I(d.minus(1),d.plus(1),l,1),f=h(y.times(y),l,1),i=a=1;else return h(c,S.precision=C,_,b=!0);else return S.precision=C,c;c=u,i+=2}}function Mt(e){return String(e.s*e.s/0)}function et(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%w,r<0&&(n+=w),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=w;n<i;)e.d.push(+t.slice(n,n+=w));t=t.slice(n),n=w-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),b&&(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 Cr(e,t){var r,n,i,o,s,a,c,u,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Ct.test(t))return et(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Sr.test(t))r=16,t=t.toLowerCase();else if(Pr.test(t))r=2;else if(Lr.test(t))r=8;else throw Error(oe+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,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Nt(n,new n(r),o,o*2)),u=Be(t,r,Q),l=u.length-1,o=l;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Re(u,l),e.d=u,b=!1,s&&(e=I(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?V(2,c):ve.pow(2,c))),b=!0,e)}function Ir(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:de(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Me(5,r)),t=de(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function de(e,t,r,n,i){var o,s,a,c,u=1,l=e.precision,d=Math.ceil(l/w);for(b=!1,c=r.times(r),a=new e(n);;){if(s=I(a.times(c),new e(t++*t++),l,1),a=i?n.plus(s):n.minus(s),n=I(s.times(c),new e(t++*t++),l,1),s=a.plus(n),s.d[d]!==void 0){for(o=d;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return b=!0,s.d.length=d+1,s}function Me(e,t){for(var r=e;--t;)r*=e;return r}function vt(e,t){var r,n=t.s<0,i=z(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Y=n?4:1,t;if(r=t.divToInt(i),r.isZero())Y=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Y=xt(r)?n?2:3:n?4:1,t;Y=xt(r)?n?1:4:n?3:2}return t.minus(i).abs()}function tt(e,t,r,n){var i,o,s,a,c,u,l,d,f,p=e.constructor,x=r!==void 0;if(x?(H(r,1,se),n===void 0?n=p.rounding:H(n,0,8)):(r=p.precision,n=p.rounding),!e.isFinite())l=Mt(e);else{for(l=X(e),s=l.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(l=l.replace(".",""),f=new p(1),f.e=l.length-s,f.d=Be(X(f),10,i),f.e=f.d.length),d=Be(l,10,i),o=c=d.length;d[--c]==0;)d.pop();if(!d[0])l=x?"0p+0":"0";else{if(s<0?o--:(e=new p(e),e.d=d,e.e=o,e=I(e,f,r,n,0,i),d=e.d,o=e.e,u=Lt),s=d[r],a=i/2,u=u||d[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&d[r-1]&1||n===(e.s<0?8:7)),d.length=r,u)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,l="";s<c;s++)l+=Xe.charAt(d[s]);if(x){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)l+="0";for(d=Be(l,i,t),c=d.length;!d[c-1];--c);for(s=1,l="1.";s<c;s++)l+=Xe.charAt(d[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 Pt(e,t){if(e.length>t)return e.length=t,!0}function Nr(e){return new this(e).abs()}function Rr(e){return new this(e).acos()}function Mr(e){return new this(e).acosh()}function vr(e,t){return new this(e).plus(t)}function Er(e){return new this(e).asin()}function Fr(e){return new this(e).asinh()}function _r(e){return new this(e).atan()}function Vr(e){return new this(e).atanh()}function Dr(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=z(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?z(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=z(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(I(e,t,o,1)),t=z(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(I(e,t,o,1)),r}function Or(e){return new this(e).cbrt()}function Kr(e){return h(e=new this(e),e.e+1,2)}function Ur(e,t,r){return new this(e).clamp(t,r)}function Wr(e){if(!e||typeof e!="object")throw Error(Ne+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,se,"rounding",0,8,"toExpNeg",-le,0,"toExpPos",0,le,"maxE",0,le,"minE",-le,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=Je[r]),(n=e[r])!==void 0)if(q(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(oe+r+": "+n);if(r="crypto",i&&(this[r]=Je[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Bt);else this[r]=!1;else throw Error(oe+r+": "+n);return this}function qr(e){return new this(e).cos()}function Gr(e){return new this(e).cosh()}function Et(e){var t,r,n;function i(o){var s,a,c,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,St(o)){u.s=o.s,b?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.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++;b?s>i.maxE?(u.e=NaN,u.d=null):s<i.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 et(u,o.toString())}else if(c!=="string")throw Error(oe+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),Ct.test(o)?et(u,o):Cr(u,o)}if(i.prototype=m,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=Wr,i.clone=Et,i.isDecimal=St,i.abs=Nr,i.acos=Rr,i.acosh=Mr,i.add=vr,i.asin=Er,i.asinh=Fr,i.atan=_r,i.atanh=Vr,i.atan2=Dr,i.cbrt=Or,i.ceil=Kr,i.clamp=Ur,i.cos=qr,i.cosh=Gr,i.div=Hr,i.exp=jr,i.floor=Zr,i.hypot=zr,i.ln=Qr,i.log=Xr,i.log10=Yr,i.log2=Jr,i.max=$r,i.min=en,i.mod=tn,i.mul=rn,i.pow=nn,i.random=on,i.round=sn,i.sign=an,i.sin=un,i.sinh=cn,i.sqrt=ln,i.sub=dn,i.sum=fn,i.tan=mn,i.tanh=pn,i.trunc=gn,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function Hr(e,t){return new this(e).div(t)}function jr(e){return new this(e).exp()}function Zr(e){return h(e=new this(e),e.e+1,3)}function zr(){var e,t,r=new this(0);for(b=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return b=!0,new this(1/0);r=t}return b=!0,r.sqrt()}function St(e){return e instanceof ve||e&&e.toStringTag===kt||!1}function Qr(e){return new this(e).ln()}function Xr(e,t){return new this(e).log(t)}function Jr(e){return new this(e).log(2)}function Yr(e){return new this(e).log(10)}function $r(){return Rt(this,arguments,"lt")}function en(){return Rt(this,arguments,"gt")}function tn(e,t){return new this(e).mod(t)}function rn(e,t){return new this(e).mul(t)}function nn(e,t){return new this(e).pow(t)}function on(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:H(e,1,se),n=Math.ceil(e/w),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Bt);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=w,n&&e&&(i=V(10,w-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=w)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<w&&(r-=w-n)}return s.e=r,s.d=a,s}function sn(e){return h(e=new this(e),e.e+1,this.rounding)}function an(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function un(e){return new this(e).sin()}function cn(e){return new this(e).sinh()}function ln(e){return new this(e).sqrt()}function dn(e,t){return new this(e).sub(t)}function fn(){var e=0,t=arguments,r=new this(t[e]);for(b=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return b=!0,h(r,this.precision,this.rounding)}function mn(e){return new this(e).tan()}function pn(e){return new this(e).tanh()}function gn(e){return h(e=new this(e),e.e+1,1)}m[Symbol.for("nodejs.util.inspect.custom")]=m.toString;m[Symbol.toStringTag]="Decimal";var ve=m.constructor=Et(Je);ke=new ve(ke);Ce=new ve(Ce);import Sn from"big.js";import _e from"bn.js";import hn from"toformat";var wn=hn,he=wn;import Fe from"big.js";import bn from"bn.js";import Tn from"decimal.js-light";import we from"bn.js";var Ft=9007199254740991;function E(e){let t=K("Raydium_parseBigNumberish");if(e instanceof we)return e;if(typeof e=="string"){if(e.match(/^-?[0-9]+$/))return new we(e);t.logWithError(`invalid BigNumberish string: ${e}`)}return typeof e=="number"?(e%1&&t.logWithError(`BigNumberish number underflow: ${e}`),(e>=Ft||e<=-Ft)&&t.logWithError(`BigNumberish number overflow: ${e}`),new we(String(e))):typeof e=="bigint"?new we(e.toString()):(t.error(`invalid BigNumberish value: ${e}`),new we(0))}var Ee=K("module/fraction"),rt=he(Fe),ye=he(Tn),xn={[0]:ye.ROUND_DOWN,[1]:ye.ROUND_HALF_UP,[2]:ye.ROUND_UP},Pn={[0]:Fe.roundDown,[1]:Fe.roundHalfUp,[2]:Fe.roundUp},k=class{constructor(t,r=new bn(1)){this.numerator=E(t),this.denominator=E(r)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new k(this.denominator,this.numerator)}add(t){let r=t instanceof k?t:new k(E(t));return this.denominator.eq(r.denominator)?new k(this.numerator.add(r.numerator),this.denominator):new k(this.numerator.mul(r.denominator).add(r.numerator.mul(this.denominator)),this.denominator.mul(r.denominator))}sub(t){let r=t instanceof k?t:new k(E(t));return this.denominator.eq(r.denominator)?new k(this.numerator.sub(r.numerator),this.denominator):new k(this.numerator.mul(r.denominator).sub(r.numerator.mul(this.denominator)),this.denominator.mul(r.denominator))}mul(t){let r=t instanceof k?t:new k(E(t));return new k(this.numerator.mul(r.numerator),this.denominator.mul(r.denominator))}div(t){let r=t instanceof k?t:new k(E(t));return new k(this.numerator.mul(r.denominator),this.denominator.mul(r.numerator))}toSignificant(t,r={groupSeparator:""},n=1){Number.isInteger(t)||Ee.logWithError(`${t} is not an integer.`),t<=0&&Ee.logWithError(`${t} is not positive.`),ye.set({precision:t+1,rounding:xn[n]});let i=new ye(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return i.toFormat(i.decimalPlaces(),r)}toFixed(t,r={groupSeparator:""},n=1){return Number.isInteger(t)||Ee.logWithError(`${t} is not an integer.`),t<0&&Ee.logWithError(`${t} is negative.`),rt.DP=t,rt.RM=Pn[n]||1,new rt(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,r)}isZero(){return this.numerator.isZero()}};var Ln=K("Raydium_amount"),_t=he(Sn);function An(e,t){let r="0",n="0";if(e.includes(".")){let i=e.split(".");i.length===2?([r,n]=i,n=n.padEnd(t,"0")):Ln.logWithError(`invalid number string, num: ${e}`)}else r=e;return[r,n.slice(0,t)||n]}var $=class extends k{constructor(r,n,i=!0,o){let s=new _e(0),a=nt.pow(new _e(r.decimals));if(i)s=E(n);else{let c=new _e(0),u=new _e(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,d]=An(n.toString(),r.decimals);c=E(l),u=E(d)}c=c.mul(a),s=c.add(u)}super(s,a);this.logger=K(o||"TokenAmount"),this.token=r}get raw(){return this.numerator}isZero(){return this.raw.isZero()}gt(r){return this.token.equals(r.token)||this.logger.logWithError("gt token not equals"),this.raw.gt(r.raw)}lt(r){return this.token.equals(r.token)||this.logger.logWithError("lt token not equals"),this.raw.lt(r.raw)}add(r){return this.token.equals(r.token)||this.logger.logWithError("add token not equals"),new $(this.token,this.raw.add(r.raw))}subtract(r){return this.token.equals(r.token)||this.logger.logWithError("sub token not equals"),new $(this.token,this.raw.sub(r.raw))}toSignificant(r=this.token.decimals,n,i=0){return super.toSignificant(r,n,i)}toFixed(r=this.token.decimals,n,i=0){return r>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(r,n,i)}toExact(r={groupSeparator:""}){return _t.DP=this.token.decimals,new _t(this.numerator.toString()).div(this.denominator.toString()).toFormat(r)}};import{PublicKey as Bn}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Vt}from"@solana/spl-token";var Dt={chainId:101,address:Bn.default.toBase58(),programId:Vt.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},ae={chainId:101,address:"So11111111111111111111111111111111111111112",programId:Vt.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"}};import{PublicKey as st}from"@solana/web3.js";import{PublicKey as R,SystemProgram as Ot,SYSVAR_RENT_PUBKEY as kn}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Cn}from"@solana/spl-token";function it({pubkey:e,isSigner:t=!1,isWritable:r=!0}){return{pubkey:e,isWritable:r,isSigner:t}}var so=[it({pubkey:Cn,isWritable:!1}),it({pubkey:Ot.programId,isWritable:!1}),it({pubkey:kn,isWritable:!1})];function Kt({publicKey:e,transformSol:t}){let r=ot(e.toString());if(r instanceof R)return t&&r.equals(be)?Qe:r;if(t&&r.toString()===be.toBase58())return Qe;if(typeof r=="string"){if(r===R.default.toBase58())return R.default;try{return new R(r)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function ot(e){try{return new R(e)}catch{return e}}var ao=new R("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),uo=new R("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),co=new R("SysvarRent111111111111111111111111111111111"),lo=new R("SysvarC1ock11111111111111111111111111111111"),fo=new R("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),mo=new R("Sysvar1nstructions1111111111111111111111111"),po=Ot.programId,go=new R("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),ho=new R("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),wo=new R("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),yo=new R("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),bo=new R("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),To=new R("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),xo=new R("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),Po=new R("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),So=new R("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Lo=new R("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Ao=new R("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),Qe=new R("So11111111111111111111111111111111111111112"),be=R.default;var at=class{constructor({mint:t,decimals:r,symbol:n,name:i,skipMint:o=!1,isToken2022:s=!1}){if(t===be.toBase58()||t instanceof st&&be.equals(t)){this.decimals=ae.decimals,this.symbol=ae.symbol,this.name=ae.name,this.mint=new st(ae.address),this.isToken2022=!1;return}this.decimals=r,this.symbol=n||t.toString().substring(0,6),this.name=i||t.toString().substring(0,6),this.mint=o?st.default:Kt({publicKey:t}),this.isToken2022=s}equals(t){return this===t?!0:this.mint.equals(t.mint)}},ue=at;ue.WSOL=new at(G(O({},ae),{mint:ae.address}));var ut=class{constructor({decimals:t,symbol:r="UNKNOWN",name:n="UNKNOWN"}){this.decimals=t,this.symbol=r,this.name=n}equals(t){return this===t}},Ve=ut;Ve.SOL=new ut(Dt);import In from"bn.js";var Ut=new k(new In(100)),fe=class extends k{toSignificant(t=5,r,n){return this.mul(Ut).toSignificant(t,r,n)}toFixed(t=2,r,n){return this.mul(Ut).toFixed(t,r,n)}};var Nn=K("Raydium_price"),ee=class extends k{constructor(r){let{baseToken:n,quoteToken:i,numerator:o,denominator:s}=r;super(o,s);this.baseToken=n,this.quoteToken=i,this.scalar=new k(ct(n.decimals),ct(i.decimals))}get raw(){return new k(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new ee({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(r){this.quoteToken!==r.baseToken&&Nn.logWithError("mul token not equals");let n=super.mul(r);return new ee({baseToken:this.baseToken,quoteToken:r.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(r=this.quoteToken.decimals,n,i){return this.adjusted.toSignificant(r,n,i)}toFixed(r=this.quoteToken.decimals,n,i){return this.adjusted.toFixed(r,n,i)}};import{PublicKey as Mn}from"@solana/web3.js";import vn from"bn.js";function Wt(e){return typeof e=="object"&&e!==null&&![ue,$,Mn,k,vn,ee,fe].some(t=>typeof t=="object"&&e instanceof t)}function De(e){return typeof e=="string"?ot(e):Array.isArray(e)?e.map(t=>De(t)):Wt(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,De(r)])):e}var Rn=new te(0),xs=new te(1),Ps=new te(2),Ss=new te(3),Ls=new te(5),nt=new te(10),As=new te(100),Bs=new te(1e3),ks=new te(1e4);function ct(e){return nt.pow(E(e))}var qt=e=>typeof e=="number";function Gt(e,t,r){let n=qt(t)?t*((r==null?void 0:r.unit)==="s"?1e3:1):t;return new Date(e).getTime()<=n}function Ht(e,t,r){let n=qt(t)?t*((r==null?void 0:r.unit)==="s"?1e3:1):t;return new Date(e).getTime()>n}function ze(e,t=1,r=[]){let n=[...e];if(t<=0)return r;for(;n.length;)r.push(n.splice(0,t));return r}import{PublicKey as Js}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as $s}from"@solana/spl-token";import{ComputeBudgetProgram as Fs,Keypair as Ds,PublicKey as Fn,Transaction as Ks,TransactionMessage as Ws,VersionedTransaction as qs}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Zs}from"@solana/spl-token";var zs=K("Raydium_txUtil");function Te(e,t){let[r,n]=Fn.findProgramAddressSync(e,t);return{publicKey:r,nonce:n}}import{PublicKey as T}from"@solana/web3.js";var jt=new T("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),Zt=new T("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),zt=new T("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),Qt=new T("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),na=new T("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),ia=new T("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),oa=new T("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),sa=new T("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),aa=new T("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),ua=new T("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),ca=new T("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),la=new T("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),da=new T("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),fa=new T("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),ma=new T("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),pa=new T("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),ga=new T("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),ha=new T("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),wa=new T("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),ya=new T("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),ba=new T("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),Ta=new T("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),_n=new T("CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW"),Vn=new T("7rQ1QFNosMkUCuh7Z7fPbTHvh73b68sQYdirycEzJVuw"),Dn=new T("G11FKBRaAkHAKuLCgLM6K6NUc9rTjPAznRCjZifrTQe2"),xa=new T("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),On=new T("DLockwT7X7sxtLmGH9g5kmfcjaBtncdbUmi738m5bvQC"),Pa=new T("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),Kn=new T("7AFUeLVRjBfzqK3tTGw8hN48KLQWSk6DTE8xprWdPqix"),Sa=new T("LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"),La=new T("WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh"),Un=new T("7soRSLviCKHCKzCbRuVpZDif76NWLVqFtbjt8LpyxWSq"),Wn=new T("DG6kZFFCqxdtWXw53Zc28hLs3MTr28Efkm2FrsNERNSQ");var Aa={SERUM_MARKET:T.default,OPENBOOK_MARKET:new T("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),UTIL1216:T.default,FarmV3:new T("85BFyr98MbCUU9MVTEgzx1nbhWACbJqLzho6zd6DZcWL"),FarmV5:new T("EcLzTrNg9V7qhcdyXDe2qjtPkiGzDM2UbdRaeaadU5r2"),FarmV6:new T("Farm2hJLcqPtPg8M4rR6DMrsRNc5TPm5Cs4bVQrMe2T7"),AmmV4:new T("HWy1jotHpo6UqeQxx49dpYYdQB8wj9Qk9MdxwjLvDHB8"),AmmStable:new T("DDg4VmQaJV9ogWce7LpcjBA9bv22wRp5uaTPa5pGjijF"),CLMM:new T("devi51mZmdwUJGU9hjN27vEz64Gps7uUefqxg27EAtH"),CLMM_LOCK_PROGRAM_ID:new T("DLockwT7X7sxtLmGH9g5kmfcjaBtncdbUmi738m5bvQC"),CLMM_LOCK_AUTH_ID:new T("8qmHNvu2Kr2C7U8mJL4Vz1vTDxMhVuXKREwU7TNoaVEo"),Router:new T("BVChZ3XFEwTMUk1o9i3HAf91H6mFxSwa5X2wFAWhYPhU"),CREATE_CPMM_POOL_PROGRAM:_n,CREATE_CPMM_POOL_AUTH:Vn,CREATE_CPMM_POOL_FEE_ACC:Dn,FEE_DESTINATION_ID:new T("3XMrhbv989VxAMi3DErLV9eJht1pHppW5LbKxe9fkEFR"),LOCK_CPMM_PROGRAM:On,LCOK_CPMM_AUTH:Kn,LAUNCHPAD_PROGRAM:Un,LAUNCHPAD_AUTH:Wn};import Ca from"bn.js";import{PublicKey as qn,AddressLookupTableAccount as Xt}from"@solana/web3.js";var Gn={AcL1Vo8oy1ULiavEcjSUcwfBSForXMudcZvDZy5nzJkU:new Xt({key:new qn("AcL1Vo8oy1ULiavEcjSUcwfBSForXMudcZvDZy5nzJkU"),state:Xt.deserialize(Buffer.from("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","base64"))})};import{PublicKey as ja,sendAndConfirmTr