UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

1 lines 88.2 kB
var rr=Object.create;var Ee=Object.defineProperty,or=Object.defineProperties,ir=Object.getOwnPropertyDescriptor,sr=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertyNames,ze=Object.getOwnPropertySymbols,cr=Object.getPrototypeOf,Pt=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable;var $t=(e,t,n)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t)=>{for(var n in t||(t={}))Pt.call(t,n)&&$t(e,n,t[n]);if(ze)for(var n of ze(t))en.call(t,n)&&$t(e,n,t[n]);return e},le=(e,t)=>or(e,sr(t));var xe=(e,t)=>{var n={};for(var r in e)Pt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ze)for(var r of ze(e))t.indexOf(r)<0&&en.call(e,r)&&(n[r]=e[r]);return n};var ur=(e,t)=>{for(var n in t)Ee(e,n,{get:t[n],enumerable:!0})},tn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ar(t))!Pt.call(e,o)&&o!==n&&Ee(e,o,{get:()=>t[o],enumerable:!(r=ir(t,o))||r.enumerable});return e};var Y=(e,t,n)=>(n=e!=null?rr(cr(e)):{},tn(t||!e||!e.__esModule?Ee(n,"default",{value:e,enumerable:!0}):n,e)),lr=e=>tn(Ee({},"__esModule",{value:!0}),e);var ko={};ur(ko,{default:()=>xt});module.exports=lr(ko);var Ae=require("@solana/web3.js");var rn=require("@solana/web3.js");var De=require("lodash");var At=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(r=>typeof r=="object"?JSON.stringify(r):r).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}},nn={},fr={};function J(e){let t=(0,De.get)(nn,e);if(!t){let n=(0,De.get)(fr,e);t=new At({name:e,logLevel:n}),(0,De.set)(nn,e,t)}return t}var Ye=require("@solana/spl-token"),kt=J("Raydium_accountInfo_util");async function on(e,t,n){let{batchRequest:r,commitment:o="confirmed",chunkCount:i=100}=H({batchRequest:!1},n),s=St(t,i),a=new Array(s.length).fill([]);if(r){let u=s.map(f=>{let p=e._buildArgs([f.map(m=>m.toBase58())],o,"base64");return{methodName:"getMultipleAccounts",args:p}}),c=St(u,10);a=(await(await Promise.all(c.map(async f=>await e._rpcBatchRequest(f)))).flat()).map(f=>(f.error&&kt.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${f.error.message}`),f.result.value.map(p=>{if(p){let{data:m,executable:g,lamports:h,owner:T,rentEpoch:w}=p;return m.length!==2&&m[1]!=="base64"&&kt.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(m[0],"base64"),executable:g,lamports:h,owner:new rn.PublicKey(T),rentEpoch:w}}return null})))}else try{a=await Promise.all(s.map(u=>e.getMultipleAccountsInfo(u,o)))}catch(u){u instanceof Error&&kt.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${u.message}`)}return a.flat()}var ae=Y(require("bn.js"));var Se=9e15,be=1e9,It="0123456789abcdef",Qe="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",$e="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Bt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Se,maxE:Se,crypto:!1},un,fe,C=!0,tt="[DecimalError] ",ge=tt+"Invalid argument: ",ln=tt+"Precision limit exceeded",fn=tt+"crypto unavailable",pn="[object Decimal]",X=Math.floor,Z=Math.pow,pr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,mr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,dr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,mn=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,te=1e7,B=7,hr=9007199254740991,gr=Qe.length-1,Lt=$e.length-1,d={toStringTag:pn};d.absoluteValue=d.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),A(e)};d.ceil=function(){return A(new this.constructor(this),this.e+1,2)};d.clampedTo=d.clamp=function(e,t){var n,r=this,o=r.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(ge+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new o(r)};d.comparedTo=d.cmp=function(e){var t,n,r,o,i=this,s=i.d,a=(e=new i.constructor(e)).d,u=i.s,c=e.s;if(!s||!a)return!u||!c?NaN:u!==c?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-c:0;if(u!==c)return u;if(i.e!==e.e)return i.e>e.e^u<0?1:-1;for(r=s.length,o=a.length,t=0,n=r<o?r:o;t<n;++t)if(s[t]!==a[t])return s[t]>a[t]^u<0?1:-1;return r===o?0:r>o^u<0?1:-1};d.cosine=d.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=br(r,yn(r,n)),r.precision=e,r.rounding=t,A(fe==2||fe==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)};d.cubeRoot=d.cbrt=function(){var e,t,n,r,o,i,s,a,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(C=!1,i=l.s*Z(l.s*l,1/3),!i||Math.abs(i)==1/0?(n=z(l.d),e=l.e,(i=(e-n.length+1)%3)&&(n+=i==1||i==-2?"0":"00"),i=Z(n,1/3),e=X((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?n="5e"+e:(n=i.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new f(n),r.s=l.s):r=new f(i.toString()),s=(e=f.precision)+3;;)if(a=r,u=a.times(a).times(a),c=u.plus(l),r=U(c.plus(l).times(a),c.plus(u),s+2,1),z(a.d).slice(0,s)===(n=z(r.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!o&&n=="4999"){if(!o&&(A(a,e+1,0),a.times(a).times(a).eq(l))){r=a;break}s+=4,o=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(A(r,e+1,1),t=!r.times(r).times(r).eq(l));break}return C=!0,A(r,e,f.rounding,t)};d.decimalPlaces=d.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-X(this.e/B))*B,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n};d.dividedBy=d.div=function(e){return U(this,new this.constructor(e))};d.dividedToIntegerBy=d.divToInt=function(e){var t=this,n=t.constructor;return A(U(t,new n(e),0,1,1),n.precision,n.rounding)};d.equals=d.eq=function(e){return this.cmp(e)===0};d.floor=function(){return A(new this.constructor(this),this.e+1,3)};d.greaterThan=d.gt=function(e){return this.cmp(e)>0};d.greaterThanOrEqualTo=d.gte=function(e){var t=this.cmp(e);return t==1||t===0};d.hyperbolicCosine=d.cosh=function(){var e,t,n,r,o,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(i.e,i.sd())+4,s.rounding=1,o=i.d.length,o<32?(e=Math.ceil(o/3),t=(1/rt(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=Ie(s,1,i.times(t),new s(1),!0);for(var u,c=e,l=new s(8);c--;)u=i.times(i),i=a.minus(u.times(l.minus(u.times(l))));return A(i,s.precision=n,s.rounding=r,!0)};d.hyperbolicSine=d.sinh=function(){var e,t,n,r,o=this,i=o.constructor;if(!o.isFinite()||o.isZero())return new i(o);if(t=i.precision,n=i.rounding,i.precision=t+Math.max(o.e,o.sd())+4,i.rounding=1,r=o.d.length,r<3)o=Ie(i,2,o,o,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,o=o.times(1/rt(5,e)),o=Ie(i,2,o,o,!0);for(var s,a=new i(5),u=new i(16),c=new i(20);e--;)s=o.times(o),o=o.times(a.plus(s.times(u.times(s).plus(c))))}return i.precision=t,i.rounding=n,A(o,t,n,!0)};d.hyperbolicTangent=d.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,U(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)};d.inverseCosine=d.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,o=t.rounding;return n!==-1?n===0?e.isNeg()?ie(t,r,o):new t(0):new t(NaN):e.isZero()?ie(t,r+4,o).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=o,e.times(2))};d.inverseHyperbolicCosine=d.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,C=!1,n=n.times(n).minus(1).sqrt().plus(n),C=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)};d.inverseHyperbolicSine=d.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,C=!1,n=n.times(n).plus(1).sqrt().plus(n),C=!0,r.precision=e,r.rounding=t,n.ln())};d.inverseHyperbolicTangent=d.atanh=function(){var e,t,n,r,o=this,i=o.constructor;return o.isFinite()?o.e>=0?new i(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=i.precision,t=i.rounding,r=o.sd(),Math.max(r,e)<2*-o.e-1?A(new i(o),e,t,!0):(i.precision=n=r-o.e,o=U(o.plus(1),new i(1).minus(o),n+e,1),i.precision=e+4,i.rounding=1,o=o.ln(),i.precision=e,i.rounding=t,o.times(.5))):new i(NaN)};d.inverseSine=d.asin=function(){var e,t,n,r,o=this,i=o.constructor;return o.isZero()?new i(o):(t=o.abs().cmp(1),n=i.precision,r=i.rounding,t!==-1?t===0?(e=ie(i,n+4,r).times(.5),e.s=o.s,e):new i(NaN):(i.precision=n+6,i.rounding=1,o=o.div(new i(1).minus(o.times(o)).sqrt().plus(1)).atan(),i.precision=n,i.rounding=r,o.times(2)))};d.inverseTangent=d.atan=function(){var e,t,n,r,o,i,s,a,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=Lt)return s=ie(l,f+4,p).times(.25),s.s=c.s,s}else{if(!c.s)return new l(NaN);if(f+4<=Lt)return s=ie(l,f+4,p).times(.5),s.s=c.s,s}for(l.precision=a=f+10,l.rounding=1,n=Math.min(28,a/B+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(C=!1,t=Math.ceil(a/B),r=1,u=c.times(c),s=new l(c),o=c;e!==-1;)if(o=o.times(u),i=s.minus(o.div(r+=2)),o=o.times(u),s=i.plus(o.div(r+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===i.d[e]&&e--;);return n&&(s=s.times(2<<n-1)),C=!0,A(s,l.precision=f,l.rounding=p,!0)};d.isFinite=function(){return!!this.d};d.isInteger=d.isInt=function(){return!!this.d&&X(this.e/B)>this.d.length-2};d.isNaN=function(){return!this.s};d.isNegative=d.isNeg=function(){return this.s<0};d.isPositive=d.isPos=function(){return this.s>0};d.isZero=function(){return!!this.d&&this.d[0]===0};d.lessThan=d.lt=function(e){return this.cmp(e)<0};d.lessThanOrEqualTo=d.lte=function(e){return this.cmp(e)<1};d.logarithm=d.log=function(e){var t,n,r,o,i,s,a,u,c=this,l=c.constructor,f=l.precision,p=l.rounding,m=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=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:c.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)i=!0;else{for(o=n[0];o%10===0;)o/=10;i=o!==1}if(C=!1,a=f+m,s=he(c,a),r=t?et(l,a+10):he(e,a),u=U(s,r,a,1),Me(u.d,o=f,p))do if(a+=10,s=he(c,a),r=t?et(l,a+10):he(e,a),u=U(s,r,a,1),!i){+z(u.d).slice(o+1,o+15)+1==1e14&&(u=A(u,f+1,0));break}while(Me(u.d,o+=10,p));return C=!0,A(u,f,p)};d.minus=d.sub=function(e){var t,n,r,o,i,s,a,u,c,l,f,p,m=this,g=m.constructor;if(e=new g(e),!m.d||!e.d)return!m.s||!e.s?e=new g(NaN):m.d?e.s=-e.s:e=new g(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,p=e.d,a=g.precision,u=g.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else if(c[0])e=new g(m);else return new g(u===3?-0:0);return C?A(e,a,u):e}if(n=X(e.e/B),l=X(m.e/B),c=c.slice(),i=l-n,i){for(f=i<0,f?(t=c,i=-i,s=p.length):(t=p,n=l,s=c.length),r=Math.max(Math.ceil(a/B),s)+2,i>r&&(i=r,t.length=1),t.reverse(),r=i;r--;)t.push(0);t.reverse()}else{for(r=c.length,s=p.length,f=r<s,f&&(s=r),r=0;r<s;r++)if(c[r]!=p[r]){f=c[r]<p[r];break}i=0}for(f&&(t=c,c=p,p=t,e.s=-e.s),s=c.length,r=p.length-s;r>0;--r)c[s++]=0;for(r=p.length;r>i;){if(c[--r]<p[r]){for(o=r;o&&c[--o]===0;)c[o]=te-1;--c[o],c[r]+=te}c[r]-=p[r]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=nt(c,n),C?A(e,a,u):e):new g(u===3?-0:0)};d.modulo=d.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?A(new r(n),r.precision,r.rounding):(C=!1,r.modulo==9?(t=U(n,e.abs(),0,3,1),t.s*=e.s):t=U(n,e,0,r.modulo,1),t=t.times(e),C=!0,n.minus(t))};d.naturalExponential=d.exp=function(){return Ct(this)};d.naturalLogarithm=d.ln=function(){return he(this)};d.negated=d.neg=function(){var e=new this.constructor(this);return e.s=-e.s,A(e)};d.plus=d.add=function(e){var t,n,r,o,i,s,a,u,c,l,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,l=e.d,a=p.precision,u=p.rounding,!c[0]||!l[0])return l[0]||(e=new p(f)),C?A(e,a,u):e;if(i=X(f.e/B),r=X(e.e/B),c=c.slice(),o=i-r,o){for(o<0?(n=c,o=-o,s=l.length):(n=l,r=i,s=c.length),i=Math.ceil(a/B),s=i>s?i+1:s+1,o>s&&(o=s,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(s=c.length,o=l.length,s-o<0&&(o=s,n=l,l=c,c=n),t=0;o;)t=(c[--o]=c[o]+l[o]+t)/te|0,c[o]%=te;for(t&&(c.unshift(t),++r),s=c.length;c[--s]==0;)c.pop();return e.d=c,e.e=nt(c,r),C?A(e,a,u):e};d.precision=d.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ge+e);return n.d?(t=dn(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t};d.round=function(){var e=this,t=e.constructor;return A(new t(e),e.e+1,t.rounding)};d.sine=d.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=wr(r,yn(r,n)),r.precision=e,r.rounding=t,A(fe>2?n.neg():n,e,t,!0)):new r(NaN)};d.squareRoot=d.sqrt=function(){var e,t,n,r,o,i,s=this,a=s.d,u=s.e,c=s.s,l=s.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(C=!1,c=Math.sqrt(+s),c==0||c==1/0?(t=z(a),(t.length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=X((u+1)/2)-(u<0||u%2),c==1/0?t="5e"+u:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),r=new l(t)):r=new l(c.toString()),n=(u=l.precision)+3;;)if(i=r,r=i.plus(U(s,i,n+2,1)).times(.5),z(i.d).slice(0,n)===(t=z(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!o&&t=="4999"){if(!o&&(A(i,u+1,0),i.times(i).eq(s))){r=i;break}n+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(A(r,u+1,1),e=!r.times(r).eq(s));break}return C=!0,A(r,u,l.rounding,e)};d.tangent=d.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=U(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,A(fe==2||fe==4?n.neg():n,e,t,!0)):new r(NaN)};d.times=d.mul=function(e){var t,n,r,o,i,s,a,u,c,l=this,f=l.constructor,p=l.d,m=(e=new f(e)).d;if(e.s*=l.s,!p||!p[0]||!m||!m[0])return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:!p||!m?e.s/0:e.s*0);for(n=X(l.e/B)+X(e.e/B),u=p.length,c=m.length,u<c&&(i=p,p=m,m=i,s=u,u=c,c=s),i=[],s=u+c,r=s;r--;)i.push(0);for(r=c;--r>=0;){for(t=0,o=u+r;o>r;)a=i[o]+m[r]*p[o-r-1]+t,i[o--]=a%te|0,t=a/te|0;i[o]=(i[o]+t)%te|0}for(;!i[--s];)i.pop();return t?++n:i.shift(),e.d=i,e.e=nt(i,n),C?A(e,f.precision,f.rounding):e};d.toBinary=function(e,t){return Nt(this,2,e,t)};d.toDecimalPlaces=d.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:($(e,0,be),t===void 0?t=r.rounding:$(t,0,8),A(n,e+n.e+1,t))};d.toExponential=function(e,t){var n,r=this,o=r.constructor;return e===void 0?n=se(r,!0):($(e,0,be),t===void 0?t=o.rounding:$(t,0,8),r=A(new o(r),e+1,t),n=se(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n};d.toFixed=function(e,t){var n,r,o=this,i=o.constructor;return e===void 0?n=se(o):($(e,0,be),t===void 0?t=i.rounding:$(t,0,8),r=A(new i(o),e+o.e+1,t),n=se(r,!1,e+r.e+1)),o.isNeg()&&!o.isZero()?"-"+n:n};d.toFraction=function(e){var t,n,r,o,i,s,a,u,c,l,f,p,m=this,g=m.d,h=m.constructor;if(!g)return new h(m);if(c=n=new h(1),r=u=new h(0),t=new h(r),i=t.e=dn(g)-m.e-1,s=i%B,t.d[0]=Z(10,s<0?B+s:s),e==null)e=i>0?t:c;else{if(a=new h(e),!a.isInt()||a.lt(c))throw Error(ge+a);e=a.gt(t)?i>0?t:c:a}for(C=!1,a=new h(z(g)),l=h.precision,h.precision=i=g.length*B*2;f=U(a,t,0,1,1),o=n.plus(f.times(r)),o.cmp(e)!=1;)n=r,r=o,o=c,c=u.plus(f.times(o)),u=o,o=t,t=a.minus(f.times(o)),a=o;return o=U(e.minus(n),r,0,1,1),u=u.plus(o.times(c)),n=n.plus(o.times(r)),u.s=c.s=m.s,p=U(c,r,i,1).minus(m).abs().cmp(U(u,n,i,1).minus(m).abs())<1?[c,r]:[u,n],h.precision=l,C=!0,p};d.toHexadecimal=d.toHex=function(e,t){return Nt(this,16,e,t)};d.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:$(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]?(C=!1,n=U(n,e,0,t,1).times(e),C=!0,A(n)):(e.s=n.s,n=e),n};d.toNumber=function(){return+this};d.toOctal=function(e,t){return Nt(this,8,e,t)};d.toPower=d.pow=function(e){var t,n,r,o,i,s,a=this,u=a.constructor,c=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(Z(+a,c));if(a=new u(a),a.eq(1))return a;if(r=u.precision,i=u.rounding,e.eq(1))return A(a,r,i);if(t=X(e.e/B),t>=e.d.length-1&&(n=c<0?-c:c)<=hr)return o=hn(u,a,n,r),e.s<0?new u(1).div(o):A(o,r,i);if(s=a.s,s<0){if(t<e.d.length-1)return new u(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=Z(+a,c),t=n==0||!isFinite(n)?X(c*(Math.log("0."+z(a.d))/Math.LN10+a.e+1)):new u(n+"").e,t>u.maxE+1||t<u.minE-1?new u(t>0?s/0:0):(C=!1,u.rounding=a.s=1,n=Math.min(12,(t+"").length),o=Ct(e.times(he(a,r+n)),r),o.d&&(o=A(o,r+5,1),Me(o.d,r,i)&&(t=r+10,o=A(Ct(e.times(he(a,t+n)),t),t+5,1),+z(o.d).slice(r+1,r+15)+1==1e14&&(o=A(o,r+1,0)))),o.s=s,C=!0,u.rounding=i,A(o,r,i))};d.toPrecision=function(e,t){var n,r=this,o=r.constructor;return e===void 0?n=se(r,r.e<=o.toExpNeg||r.e>=o.toExpPos):($(e,1,be),t===void 0?t=o.rounding:$(t,0,8),r=A(new o(r),e,t),n=se(r,e<=r.e||r.e<=o.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n};d.toSignificantDigits=d.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):($(e,1,be),t===void 0?t=r.rounding:$(t,0,8)),A(new r(n),e,t)};d.toString=function(){var e=this,t=e.constructor,n=se(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n};d.truncated=d.trunc=function(){return A(new this.constructor(this),this.e+1,1)};d.valueOf=d.toJSON=function(){var e=this,t=e.constructor,n=se(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function z(e){var t,n,r,o=e.length-1,i="",s=e[0];if(o>0){for(i+=s,t=1;t<o;t++)r=e[t]+"",n=B-r.length,n&&(i+=de(n)),i+=r;s=e[t],r=s+"",n=B-r.length,n&&(i+=de(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}function $(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ge+e)}function Me(e,t,n,r){var o,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=B,o=0):(o=Math.ceil((t+1)/B),t%=B),i=Z(10,B-t),a=e[o]%i|0,r==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==i||n>3&&a+1==i/2)&&(e[o+1]/i/100|0)==Z(10,t-2)-1||(a==i/2||a==0)&&(e[o+1]/i/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(r||n<4)&&a==9999||!r&&n>3&&a==4999):s=((r||n<4)&&a+1==i||!r&&n>3&&a+1==i/2)&&(e[o+1]/i/1e3|0)==Z(10,t-3)-1,s}function Je(e,t,n){for(var r,o=[0],i,s=0,a=e.length;s<a;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=It.indexOf(e.charAt(s++)),r=0;r<o.length;r++)o[r]>n-1&&(o[r+1]===void 0&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function br(e,t){var n,r,o;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),o=(1/rt(4,n)).toString()):(n=16,o="2.3283064365386962890625e-10"),e.precision+=n,t=Ie(e,1,t.times(o),new e(1));for(var i=n;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}var U=function(){function e(r,o,i){var s,a=0,u=r.length;for(r=r.slice();u--;)s=r[u]*o+a,r[u]=s%i|0,a=s/i|0;return a&&r.unshift(a),r}function t(r,o,i,s){var a,u;if(i!=s)u=i>s?1:-1;else for(a=u=0;a<i;a++)if(r[a]!=o[a]){u=r[a]>o[a]?1:-1;break}return u}function n(r,o,i,s){for(var a=0;i--;)r[i]-=a,a=r[i]<o[i]?1:0,r[i]=a*s+r[i]-o[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,o,i,s,a,u){var c,l,f,p,m,g,h,T,w,x,y,S,b,P,I,R,N,M,V,O,v=r.constructor,G=r.s==o.s?1:-1,E=r.d,_=o.d;if(!E||!E[0]||!_||!_[0])return new v(!r.s||!o.s||(E?_&&E[0]==_[0]:!_)?NaN:E&&E[0]==0||!_?G*0:G/0);for(u?(m=1,l=r.e-o.e):(u=te,m=B,l=X(r.e/m)-X(o.e/m)),V=_.length,N=E.length,w=new v(G),x=w.d=[],f=0;_[f]==(E[f]||0);f++);if(_[f]>(E[f]||0)&&l--,i==null?(P=i=v.precision,s=v.rounding):a?P=i+(r.e-o.e)+1:P=i,P<0)x.push(1),g=!0;else{if(P=P/m+2|0,f=0,V==1){for(p=0,_=_[0],P++;(f<N||p)&&P--;f++)I=p*u+(E[f]||0),x[f]=I/_|0,p=I%_|0;g=p||f<N}else{for(p=u/(_[0]+1)|0,p>1&&(_=e(_,p,u),E=e(E,p,u),V=_.length,N=E.length),R=V,y=E.slice(0,V),S=y.length;S<V;)y[S++]=0;O=_.slice(),O.unshift(0),M=_[0],_[1]>=u/2&&++M;do p=0,c=t(_,y,V,S),c<0?(b=y[0],V!=S&&(b=b*u+(y[1]||0)),p=b/M|0,p>1?(p>=u&&(p=u-1),h=e(_,p,u),T=h.length,S=y.length,c=t(h,y,T,S),c==1&&(p--,n(h,V<T?O:_,T,u))):(p==0&&(c=p=1),h=_.slice()),T=h.length,T<S&&h.unshift(0),n(y,h,S,u),c==-1&&(S=y.length,c=t(_,y,V,S),c<1&&(p++,n(y,V<S?O:_,S,u))),S=y.length):c===0&&(p++,y=[0]),x[f++]=p,c&&y[0]?y[S++]=E[R]||0:(y=[E[R]],S=1);while((R++<N||y[0]!==void 0)&&P--);g=y[0]!==void 0}x[0]||x.shift()}if(m==1)w.e=l,un=g;else{for(f=1,p=x[0];p>=10;p/=10)f++;w.e=f+l*m-1,A(w,a?i+w.e+1:i,s,g)}return w}}();function A(e,t,n,r){var o,i,s,a,u,c,l,f,p,m=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(o=1,a=f[0];a>=10;a/=10)o++;if(i=t-o,i<0)i+=B,s=t,l=f[p=0],u=l/Z(10,o-s-1)%10|0;else if(p=Math.ceil((i+1)/B),a=f.length,p>=a)if(r){for(;a++<=p;)f.push(0);l=u=0,o=1,i%=B,s=i-B+1}else break e;else{for(l=a=f[p],o=1;a>=10;a/=10)o++;i%=B,s=i-B+o,u=s<0?0:l/Z(10,o-s-1)%10|0}if(r=r||t<0||f[p+1]!==void 0||(s<0?l:l%Z(10,o-s-1)),c=n<4?(u||r)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||r||n==6&&(i>0?s>0?l/Z(10,o-s):0:f[p-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=Z(10,(B-t%B)%B),e.e=-t||0):f[0]=e.e=0,e;if(i==0?(f.length=p,a=1,p--):(f.length=p+1,a=Z(10,B-i),f[p]=s>0?(l/Z(10,o-s)%Z(10,s)|0)*a:0),c)for(;;)if(p==0){for(i=1,s=f[0];s>=10;s/=10)i++;for(s=f[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,f[0]==te&&(f[0]=1));break}else{if(f[p]+=a,f[p]!=te)break;f[p--]=0,a=1}for(i=f.length;f[--i]===0;)f.pop()}return C&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function se(e,t,n){if(!e.isFinite())return bn(e);var r,o=e.e,i=z(e.d),s=i.length;return t?(n&&(r=n-s)>0?i=i.charAt(0)+"."+i.slice(1)+de(r):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):o<0?(i="0."+de(-o-1)+i,n&&(r=n-s)>0&&(i+=de(r))):o>=s?(i+=de(o+1-s),n&&(r=n-o-1)>0&&(i=i+"."+de(r))):((r=o+1)<s&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-s)>0&&(o+1===s&&(i+="."),i+=de(r))),i}function nt(e,t){var n=e[0];for(t*=B;n>=10;n/=10)t++;return t}function et(e,t,n){if(t>gr)throw C=!0,n&&(e.precision=n),Error(ln);return A(new e(Qe),t,1,!0)}function ie(e,t,n){if(t>Lt)throw Error(ln);return A(new e($e),t,n,!0)}function dn(e){var t=e.length-1,n=t*B+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 de(e){for(var t="";e--;)t+="0";return t}function hn(e,t,n,r){var o,i=new e(1),s=Math.ceil(r/B+4);for(C=!1;;){if(n%2&&(i=i.times(t),an(i.d,s)&&(o=!0)),n=X(n/2),n===0){n=i.d.length-1,o&&i.d[n]===0&&++i.d[n];break}t=t.times(t),an(t.d,s)}return C=!0,i}function sn(e){return e.d[e.d.length-1]&1}function gn(e,t,n){for(var r,o,i=new e(t[0]),s=0;++s<t.length;){if(o=new e(t[s]),!o.s){i=o;break}r=i.cmp(o),(r===n||r===0&&i.s===n)&&(i=o)}return i}function Ct(e,t){var n,r,o,i,s,a,u,c=0,l=0,f=0,p=e.constructor,m=p.rounding,g=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(C=!1,u=g):u=t,a=new p(.03125);e.e>-2;)e=e.times(a),f+=5;for(r=Math.log(Z(2,f))/Math.LN10*2+5|0,u+=r,n=i=s=new p(1),p.precision=u;;){if(i=A(i.times(e),u,1),n=n.times(++l),a=s.plus(U(i,n,u,1)),z(a.d).slice(0,u)===z(s.d).slice(0,u)){for(o=f;o--;)s=A(s.times(s),u,1);if(t==null)if(c<3&&Me(s.d,u-r,m,c))p.precision=u+=10,n=i=a=new p(1),l=0,c++;else return A(s,p.precision=g,m,C=!0);else return p.precision=g,s}s=a}}function he(e,t){var n,r,o,i,s,a,u,c,l,f,p,m=1,g=10,h=e,T=h.d,w=h.constructor,x=w.rounding,y=w.precision;if(h.s<0||!T||!T[0]||!h.e&&T[0]==1&&T.length==1)return new w(T&&!T[0]?-1/0:h.s!=1?NaN:T?0:h);if(t==null?(C=!1,l=y):l=t,w.precision=l+=g,n=z(T),r=n.charAt(0),Math.abs(i=h.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=z(h.d),r=n.charAt(0),m++;i=h.e,r>1?(h=new w("0."+n),i++):h=new w(r+"."+n.slice(1))}else return c=et(w,l+2,y).times(i+""),h=he(new w(r+"."+n.slice(1)),l-g).plus(c),w.precision=y,t==null?A(h,y,x,C=!0):h;for(f=h,u=s=h=U(h.minus(1),h.plus(1),l,1),p=A(h.times(h),l,1),o=3;;){if(s=A(s.times(p),l,1),c=u.plus(U(s,new w(o),l,1)),z(c.d).slice(0,l)===z(u.d).slice(0,l))if(u=u.times(2),i!==0&&(u=u.plus(et(w,l+2,y).times(i+""))),u=U(u,new w(m),l,1),t==null)if(Me(u.d,l-g,x,a))w.precision=l+=g,c=s=h=U(f.minus(1),f.plus(1),l,1),p=A(h.times(h),l,1),o=a=1;else return A(u,w.precision=y,x,C=!0);else return w.precision=y,u;u=c,o+=2}}function bn(e){return String(e.s*e.s/0)}function Xe(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(r,o),t){if(o-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%B,n<0&&(r+=B),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=B;r<o;)e.d.push(+t.slice(r,r+=B));t=t.slice(r),r=B-t.length}else r-=o;for(;r--;)t+="0";e.d.push(+t),C&&(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 yr(e,t){var n,r,o,i,s,a,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),mn.test(t))return Xe(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(mr.test(t))n=16,t=t.toLowerCase();else if(pr.test(t))n=2;else if(dr.test(t))n=8;else throw Error(ge+t);for(i=t.search(/p/i),i>0?(u=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),s=i>=0,r=e.constructor,s&&(t=t.replace(".",""),a=t.length,i=a-i,o=hn(r,new r(n),i,i*2)),c=Je(t,n,te),l=c.length-1,i=l;c[i]===0;--i)c.pop();return i<0?new r(e.s*0):(e.e=nt(c,l),e.d=c,C=!1,s&&(e=U(e,o,a*4)),u&&(e=e.times(Math.abs(u)<54?Z(2,u):ot.pow(2,u))),C=!0,e)}function wr(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Ie(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/rt(5,n)),t=Ie(e,2,t,t);for(var o,i=new e(5),s=new e(16),a=new e(20);n--;)o=t.times(t),t=t.times(i.plus(o.times(s.times(o).minus(a))));return t}function Ie(e,t,n,r,o){var i,s,a,u,c=1,l=e.precision,f=Math.ceil(l/B);for(C=!1,u=n.times(n),a=new e(r);;){if(s=U(a.times(u),new e(t++*t++),l,1),a=o?r.plus(s):r.minus(s),r=U(s.times(u),new e(t++*t++),l,1),s=a.plus(r),s.d[f]!==void 0){for(i=f;s.d[i]===a.d[i]&&i--;);if(i==-1)break}i=a,a=r,r=s,s=i,c++}return C=!0,s.d.length=f+1,s}function rt(e,t){for(var n=e;--t;)n*=e;return n}function yn(e,t){var n,r=t.s<0,o=ie(e,e.precision,1),i=o.times(.5);if(t=t.abs(),t.lte(i))return fe=r?4:1,t;if(n=t.divToInt(o),n.isZero())fe=r?3:2;else{if(t=t.minus(n.times(o)),t.lte(i))return fe=sn(n)?r?2:3:r?4:1,t;fe=sn(n)?r?1:4:r?3:2}return t.minus(o).abs()}function Nt(e,t,n,r){var o,i,s,a,u,c,l,f,p,m=e.constructor,g=n!==void 0;if(g?($(n,1,be),r===void 0?r=m.rounding:$(r,0,8)):(n=m.precision,r=m.rounding),!e.isFinite())l=bn(e);else{for(l=se(e),s=l.indexOf("."),g?(o=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):o=t,s>=0&&(l=l.replace(".",""),p=new m(1),p.e=l.length-s,p.d=Je(se(p),10,o),p.e=p.d.length),f=Je(l,10,o),i=u=f.length;f[--u]==0;)f.pop();if(!f[0])l=g?"0p+0":"0";else{if(s<0?i--:(e=new m(e),e.d=f,e.e=i,e=U(e,p,n,r,0,o),f=e.d,i=e.e,c=un),s=f[n],a=o/2,c=c||f[n+1]!==void 0,c=r<4?(s!==void 0||c)&&(r===0||r===(e.s<0?3:2)):s>a||s===a&&(r===4||c||r===6&&f[n-1]&1||r===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>o-1;)f[n]=0,n||(++i,f.unshift(1));for(u=f.length;!f[u-1];--u);for(s=0,l="";s<u;s++)l+=It.charAt(f[s]);if(g){if(u>1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)l+="0";for(f=Je(l,o,t),u=f.length;!f[u-1];--u);for(s=1,l="1.";s<u;s++)l+=It.charAt(f[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)l="0"+l;l="0."+l}else if(++i>u)for(i-=u;i--;)l+="0";else i<u&&(l=l.slice(0,i)+"."+l.slice(i))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function an(e,t){if(e.length>t)return e.length=t,!0}function Tr(e){return new this(e).abs()}function xr(e){return new this(e).acos()}function Pr(e){return new this(e).acosh()}function Ar(e,t){return new this(e).plus(t)}function kr(e){return new this(e).asin()}function Sr(e){return new this(e).asinh()}function Ir(e){return new this(e).atan()}function Br(e){return new this(e).atanh()}function Lr(e,t){e=new this(e),t=new this(t);var n,r=this.precision,o=this.rounding,i=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=ie(this,i,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?ie(this,r,o):new this(0),n.s=e.s):!e.d||t.isZero()?(n=ie(this,i,1).times(.5),n.s=e.s):t.s<0?(this.precision=i,this.rounding=1,n=this.atan(U(e,t,i,1)),t=ie(this,i,1),this.precision=r,this.rounding=o,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(U(e,t,i,1)),n}function Cr(e){return new this(e).cbrt()}function Nr(e){return A(e=new this(e),e.e+1,2)}function _r(e,t,n){return new this(e).clamp(t,n)}function Rr(e){if(!e||typeof e!="object")throw Error(tt+"Object expected");var t,n,r,o=e.defaults===!0,i=["precision",1,be,"rounding",0,8,"toExpNeg",-Se,0,"toExpPos",0,Se,"maxE",0,Se,"minE",-Se,0,"modulo",0,9];for(t=0;t<i.length;t+=3)if(n=i[t],o&&(this[n]=Bt[n]),(r=e[n])!==void 0)if(X(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ge+n+": "+r);if(n="crypto",o&&(this[n]=Bt[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(fn);else this[n]=!1;else throw Error(ge+n+": "+r);return this}function Er(e){return new this(e).cos()}function Dr(e){return new this(e).cosh()}function wn(e){var t,n,r;function o(i){var s,a,u,c=this;if(!(c instanceof o))return new o(i);if(c.constructor=o,cn(i)){c.s=i.s,C?!i.d||i.e>o.maxE?(c.e=NaN,c.d=null):i.e<o.minE?(c.e=0,c.d=[0]):(c.e=i.e,c.d=i.d.slice()):(c.e=i.e,c.d=i.d?i.d.slice():i.d);return}if(u=typeof i,u==="number"){if(i===0){c.s=1/i<0?-1:1,c.e=0,c.d=[0];return}if(i<0?(i=-i,c.s=-1):c.s=1,i===~~i&&i<1e7){for(s=0,a=i;a>=10;a/=10)s++;C?s>o.maxE?(c.e=NaN,c.d=null):s<o.minE?(c.e=0,c.d=[0]):(c.e=s,c.d=[i]):(c.e=s,c.d=[i]);return}if(i*0!==0){i||(c.s=NaN),c.e=NaN,c.d=null;return}return Xe(c,i.toString())}if(u==="string")return(a=i.charCodeAt(0))===45?(i=i.slice(1),c.s=-1):(a===43&&(i=i.slice(1)),c.s=1),mn.test(i)?Xe(c,i):yr(c,i);if(u==="bigint")return i<0?(i=-i,c.s=-1):c.s=1,Xe(c,i.toString());throw Error(ge+i)}if(o.prototype=d,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=Rr,o.clone=wn,o.isDecimal=cn,o.abs=Tr,o.acos=xr,o.acosh=Pr,o.add=Ar,o.asin=kr,o.asinh=Sr,o.atan=Ir,o.atanh=Br,o.atan2=Lr,o.cbrt=Cr,o.ceil=Nr,o.clamp=_r,o.cos=Er,o.cosh=Dr,o.div=Mr,o.exp=vr,o.floor=Fr,o.hypot=Or,o.ln=Kr,o.log=Ur,o.log10=Wr,o.log2=Vr,o.max=qr,o.min=Gr,o.mod=Hr,o.mul=jr,o.pow=Zr,o.random=zr,o.round=Yr,o.sign=Jr,o.sin=Xr,o.sinh=Qr,o.sqrt=$r,o.sub=eo,o.sum=to,o.tan=no,o.tanh=ro,o.trunc=oo,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return o.config(e),o}function Mr(e,t){return new this(e).div(t)}function vr(e){return new this(e).exp()}function Fr(e){return A(e=new this(e),e.e+1,3)}function Or(){var e,t,n=new this(0);for(C=!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 C=!0,new this(1/0);n=t}return C=!0,n.sqrt()}function cn(e){return e instanceof ot||e&&e.toStringTag===pn||!1}function Kr(e){return new this(e).ln()}function Ur(e,t){return new this(e).log(t)}function Vr(e){return new this(e).log(2)}function Wr(e){return new this(e).log(10)}function qr(){return gn(this,arguments,-1)}function Gr(){return gn(this,arguments,1)}function Hr(e,t){return new this(e).mod(t)}function jr(e,t){return new this(e).mul(t)}function Zr(e,t){return new this(e).pow(t)}function zr(e){var t,n,r,o,i=0,s=new this(1),a=[];if(e===void 0?e=this.precision:$(e,1,be),r=Math.ceil(e/B),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));i<r;)o=t[i],o>=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);i<r;)o=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+((t[i+3]&127)<<24),o>=214e7?crypto.randomBytes(4).copy(t,i):(a.push(o%1e7),i+=4);i=r/4}else throw Error(fn);else for(;i<r;)a[i++]=Math.random()*1e7|0;for(r=a[--i],e%=B,r&&e&&(o=Z(10,B-e),a[i]=(r/o|0)*o);a[i]===0;i--)a.pop();if(i<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=B)a.shift();for(r=1,o=a[0];o>=10;o/=10)r++;r<B&&(n-=B-r)}return s.e=n,s.d=a,s}function Yr(e){return A(e=new this(e),e.e+1,this.rounding)}function Jr(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Xr(e){return new this(e).sin()}function Qr(e){return new this(e).sinh()}function $r(e){return new this(e).sqrt()}function eo(e,t){return new this(e).sub(t)}function to(){var e=0,t=arguments,n=new this(t[e]);for(C=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return C=!0,A(n,this.precision,this.rounding)}function no(e){return new this(e).tan()}function ro(e){return new this(e).tanh()}function oo(e){return A(e=new this(e),e.e+1,1)}d[Symbol.for("nodejs.util.inspect.custom")]=d.toString;d[Symbol.toStringTag]="Decimal";var ot=d.constructor=wn(Bt);Qe=new ot(Qe);$e=new ot($e);var kn=Y(require("big.js")),uo=Y(require("bn.js"));var Tn=Y(require("toformat")),io=Tn.default,ve=io;var Fe=Y(require("big.js")),Pn=Y(require("bn.js")),An=Y(require("decimal.js-light"));var Be=Y(require("bn.js"));var xn=9007199254740991;function ne(e){let t=J("Raydium_parseBigNumberish");if(e instanceof Be.default)return e;if(typeof e=="string"){if(e.match(/^-?[0-9]+$/))return new Be.default(e);t.logWithError(`invalid BigNumberish string: ${e}`)}return typeof e=="number"?(e%1&&t.logWithError(`BigNumberish number underflow: ${e}`),(e>=xn||e<=-xn)&&t.logWithError(`BigNumberish number overflow: ${e}`),new Be.default(String(e))):typeof e=="bigint"?new Be.default(e.toString()):(t.error(`invalid BigNumberish value: ${e}`),new Be.default(0))}var it=J("module/fraction"),_t=ve(Fe.default),Oe=ve(An.default),ao={[0]:Oe.ROUND_DOWN,[1]:Oe.ROUND_HALF_UP,[2]:Oe.ROUND_UP},co={[0]:Fe.default.roundDown,[1]:Fe.default.roundHalfUp,[2]:Fe.default.roundUp},W=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 W(this.denominator,this.numerator)}add(t){let n=t instanceof W?t:new W(ne(t));return this.denominator.eq(n.denominator)?new W(this.numerator.add(n.numerator),this.denominator):new W(this.numerator.mul(n.denominator).add(n.numerator.mul(this.denominator)),this.denominator.mul(n.denominator))}sub(t){let n=t instanceof W?t:new W(ne(t));return this.denominator.eq(n.denominator)?new W(this.numerator.sub(n.numerator),this.denominator):new W(this.numerator.mul(n.denominator).sub(n.numerator.mul(this.denominator)),this.denominator.mul(n.denominator))}mul(t){let n=t instanceof W?t:new W(ne(t));return new W(this.numerator.mul(n.numerator),this.denominator.mul(n.denominator))}div(t){let n=t instanceof W?t:new W(ne(t));return new W(this.numerator.mul(n.denominator),this.denominator.mul(n.numerator))}toSignificant(t,n={groupSeparator:""},r=1){Number.isInteger(t)||it.logWithError(`${t} is not an integer.`),t<=0&&it.logWithError(`${t} is not positive.`),Oe.set({precision:t+1,rounding:ao[r]});let o=new Oe(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return o.toFormat(o.decimalPlaces(),n)}toFixed(t,n={groupSeparator:""},r=1){return Number.isInteger(t)||it.logWithError(`${t} is not an integer.`),t<0&&it.logWithError(`${t} is negative.`),_t.DP=t,_t.RM=co[r]||1,new _t(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,n)}isZero(){return this.numerator.isZero()}};var Xo=J("Raydium_amount"),Qo=ve(kn.default);var Sn=require("@solana/web3.js"),Rt=require("@solana/spl-token"),In={chainId:101,address:Sn.PublicKey.default.toBase58(),programId:Rt.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"}},pe={chainId:101,address:"So11111111111111111111111111111111111111112",programId:Rt.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 st=require("@solana/web3.js");var K=require("@solana/web3.js"),Bn=require("@solana/spl-token");function Et({pubkey:e,isSigner:t=!1,isWritable:n=!0}){return{pubkey:e,isWritable:n,isSigner:t}}var ni=[Et({pubkey:Bn.TOKEN_PROGRAM_ID,isWritable:!1}),Et({pubkey:K.SystemProgram.programId,isWritable:!1}),Et({pubkey:K.SYSVAR_RENT_PUBKEY,isWritable:!1})];function Ln({publicKey:e,transformSol:t}){let n=Cn(e.toString());if(n instanceof K.PublicKey)return t&&n.equals(Ke)?me:n;if(t&&n.toString()===Ke.toBase58())return me;if(typeof n=="string"){if(n===K.PublicKey.default.toBase58())return K.PublicKey.default;try{return new K.PublicKey(n)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function Cn(e){try{return new K.PublicKey(e)}catch{return e}}var ri=new K.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),oi=new K.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),ii=new K.PublicKey("SysvarRent111111111111111111111111111111111"),si=new K.PublicKey("SysvarC1ock11111111111111111111111111111111"),ai=new K.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),ci=new K.PublicKey("Sysvar1nstructions1111111111111111111111111"),ui=K.SystemProgram.programId,li=new K.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),fi=new K.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),pi=new K.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),mi=new K.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),di=new K.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),hi=new K.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),gi=new K.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),bi=new K.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),yi=new K.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),wi=new K.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Ti=new K.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),me=new K.PublicKey("So11111111111111111111111111111111111111112"),Ke=K.PublicKey.default;var Dt=class{constructor({mint:t,decimals:n,symbol:r,name:o,skipMint:i=!1,isToken2022:s=!1}){if(t===Ke.toBase58()||t instanceof st.PublicKey&&Ke.equals(t)){this.decimals=pe.decimals,this.symbol=pe.symbol,this.name=pe.name,this.mint=new st.PublicKey(pe.address),this.isToken2022=!1;return}this.decimals=n,this.symbol=r||t.toString().substring(0,6),this.name=o||t.toString().substring(0,6),this.mint=i?st.PublicKey.default:Ln({publicKey:t}),this.isToken2022=s}equals(t){return this===t?!0:this.mint.equals(t.mint)}},Le=Dt;Le.WSOL=new Dt(le(H({},pe),{mint:pe.address}));var Mt=class{constructor({decimals:t,symbol:n="UNKNOWN",name:r="UNKNOWN"}){this.decimals=t,this.symbol=n,this.name=r}equals(t){return this===t}},at=Mt;at.SOL=new Mt(In);var Nn=Y(require("bn.js"));var Ni=new W(new Nn.default(100));var vi=J("Raydium_price");var fo=new ae.default(0),ls=new ae.default(1),fs=new ae.default(2),ps=new ae.default(3),ms=new ae.default(5),lo=new ae.default(10),ds=new ae.default(100),hs=new ae.default(1e3),gs=new ae.default(1e4);function St(e,t=1,n=[]){let r=[...e];if(t<=0)return n;for(;r.length;)n.push(r.splice(0,t));return n}var On=require("@solana/web3.js"),Kn=require("@solana/spl-token");var Q=require("@solana/web3.js");var j={CreateAccount:"CreateAccount",InitAccount:"InitAccount",CreateATA:"CreateATA",CloseAccount:"CloseAccount",TransferAmount:"TransferAmount",InitMint:"InitMint",MintTo:"MintTo",InitMarket:"InitMarket",Util1216OwnerClaim:"Util1216OwnerClaim",SetComputeUnitPrice:"SetComputeUnitPrice",SetComputeUnitLimit:"SetComputeUnitLimit",ClmmCreatePool:"ClmmCreatePool",ClmmOpenPosition:"ClmmOpenPosition",ClmmIncreasePosition:"ClmmIncreasePosition",ClmmDecreasePosition:"ClmmDecreasePosition",ClmmClosePosition:"ClmmClosePosition",ClmmSwapBaseIn:"ClmmSwapBaseIn",ClmmSwapBaseOut:"ClmmSwapBaseOut",ClmmInitReward:"ClmmInitReward",ClmmSetReward:"ClmmSetReward",ClmmCollectReward:"ClmmCollectReward",ClmmLockPosition:"ClmmLockPosition",ClmmHarvestLockPosition:"ClmmHarvestLockPosition",AmmV4Swap:"AmmV4Swap",AmmV4AddLiquidity:"AmmV4AddLiquidity",AmmV4RemoveLiquidity:"AmmV4RemoveLiquidity",AmmV4SimulatePoolInfo:"AmmV4SimulatePoolInfo",AmmV4SwapBaseIn:"AmmV4SwapBaseIn",AmmV4SwapBaseOut:"AmmV4SwapBaseOut",AmmV4CreatePool:"AmmV4CreatePool",AmmV4InitPool:"AmmV4InitPool",AmmV5AddLiquidity:"AmmV5AddLiquidity",AmmV5RemoveLiquidity:"AmmV5RemoveLiquidity",AmmV5SimulatePoolInfo:"AmmV5SimulatePoolInfo",AmmV5SwapBaseIn:"AmmV5SwapBaseIn",AmmV5SwapBaseOut:"AmmV5SwapBaseOut",RouteSwap:"RouteSwap",RouteSwap1:"RouteSwap1",RouteSwap2:"RouteSwap2",FarmV3Deposit:"FarmV3Deposit",FarmV3Withdraw:"FarmV3Withdraw",FarmV3CreateLedger:"FarmV3CreateLedger",FarmV4Withdraw:"FarmV4Withdraw",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut",CpmmLockLp:"CpmmLockLp",CpmmCollectLockFee:"CpmmCollectLockFee",TransferTip:"TransferTip"};var Mn=require("@solana/spl-token"),Dn=J("Raydium_txUtil"),vn=1644;function ct(e){let t=[],n=[];return e.microLamports&&(t.push(Q.ComputeBudgetProgram.setComputeUnitPrice({microLamports:e.microLamports})),n.push(j.SetComputeUnitPrice)),e.units&&(t.push(Q.ComputeBudgetProgram.setComputeUnitLimit({units:e.units})),n.push(j.SetComputeUnitLimit)),{instructions:t,instructionTypes:n}}async function Ce(e,t){var r,o;let n=t!=null?t:"confirmed";return(o=await((r=e.getLatestBlockhash)==null?void 0:r.call(e,{commitment:n})))==null?void 0:o.blockhash}async function ut(e,t){return e.getSignatureStatuses([t]),new Promise((n,r)=>{let o=setTimeout(r,6e4);e.onSignature(t,i=>{if(clearTimeout(o),!i.err){n("");return}r(Object.assign(i.err,{txId:t}))},"confirmed")})}function po(e,t){e.length<1&&Dn.logWithError(`no instructions provided: ${e.toString()}`),t.length<1&&Dn.logWithError(`no signers provided:, ${t.toString()}`);let n=new Q.Transaction;n.recentBlockhash="11111111111111111111111111111111",n.feePayer=t[0],n.add(...e);try{return Buffer.from(n.serialize({verifySignatures:!1})).toString("base64").length<vn}catch{return!1}}function Fn(e,t){let[n,r]=Q.PublicKey.findProgramAddressSync(e,t);return{publicKey:n,nonce:r}}function Ue({instructions:e,payer:t,signers:n}){return po(e,[t,...n])}function Ve({instructions:e,payer:t,lookupTableAddressAccount:n,recentBlockhash:r=Q.Keypair.generate().publicKey.toString()}){let i=new Q.TransactionMessage({payerKey:t,recentBlockhash:r,instructions:e}).compileToV0Message(Object.values(n!=null?n:{}));try{return Buffer.from(new Q.VersionedTransaction(i).serialize()).toString("base64").length<vn}catch{return!1}}var mo=e=>Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e),ho=e=>{let t=e.serialize({requireAllSignatures:!1,verifySignatures:!1});e instanceof Q.VersionedTransaction&&(t=mo(t));try{return t instanceof Buffer?t.toString("base64"):Buffer.from(t).toString("base64")}catch{return t.toString("base64")}};function Pe(e){let t=[];return e.forEach(n=>{n instanceof Q.Transaction&&(n.recentBlockhash||(n.recentBlockhash=Mn.TOKEN_PROGRAM_ID.toBase58()),n.feePayer||(n.feePayer=Q.Keypair.generate().publicKey)),t.push(ho(n))}),console.log("simulate tx string:",t),t}function lt(e,t,n){return Fn([e.toBuffer(),(n!=null?n:Kn.TOKEN_PROGRAM_ID).toBuffer(),t.toBuffer()],new On.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}var k=require("@solana/web3.js"),Rs=new k.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),Es=new k.PublicKey("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Ds=new k.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),Ms=new k.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),vs=new k.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),Fs=new k.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Os=new k.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),Ks=new k.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),Us=new k.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),Vs=new k.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),Ws=new k.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),qs=new k.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Gs=new k.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),Hs=new k.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),js=new k.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),Zs=new k.PublicKey("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),zs=new k.PublicKey("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),Ys=new k.PublicKey("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),Js=new k.PublicKey("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),Xs=new k.PublicKey("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),Qs=new k.PublicKey("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),$s=new k.PublicKey("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),ea=new k.PublicKey("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),ta=new k.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),na=new k.PublicKey("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),ra=new k.PublicKey("LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"),oa=new k.PublicKey("WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh"),ia=new k.PublicKey("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),sa=new k.PublicKey("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"),aa=new k.PublicKey("4Bu96XjU84XjPDSpveTVf6LYGCkfW5FK7SNkREWcEfV4"),ca=new k.PublicKey("6s1xP3hpbAfFoNtUNF8mfHsjr2Bd97JxFJRWLbL6aHuX");var ua={OPEN_BOOK_PROGRAM:new k.PublicKey("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),SERUM_PROGRAM_ID_V3:new k.PublicKey("Ray1111111111111111111111111111111111111111"),AMM_V4:new k.PublicKey("DRaya7Kj3aMWQSy19kSjvmuwq9docCHofyP9kanQGaav"),AMM_STABLE:new k.PublicKey("DRayDdXc1NZQ9C3hRWmoSf8zK4iapgMnjdNZWrfwsP8m"),CLMM_PROGRAM_ID:new k.PublicKey("DRayAUgENGQBKVaX8owNhgzkEDyoHTGVEGHVJT1E9pfH"),CLMM_LOCK_PROGRAM_ID:new k.PublicKey("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),CLMM_LOCK_AUTH_ID:new k.PublicKey("6Aoh8h2Lw2m5UGxYR8AdAL87jTWYeKoxM52mJRzfYwN"),CREATE_CPMM_POOL_PROGRAM:new k.PublicKey("DRaycpLY18LhpbydsBWbVJtxpNv9oXPgjRSfpF2bWpYb"),CREATE_CPMM_POOL_AUTH:new k.PublicKey("CXniRufdq5xL8t8jZAPxsPZDpuudwuJSPWnbcD5Y5Nxq"),CREATE_CPMM_POOL_FEE_ACC:new k.PublicKey("3oE58BKVt8KuYkGxx8zBojugnymWmBiyafWgMrnb6eYy"),LOCK_CPMM_PROGRAM:new k.PublicKey("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),LOCK_CPMM_AUTH:new k.PublicKey("7qWVV8UY2bRJfDLP4s37YzBPKUkVB46DStYJBpYbQzu3"),UTIL1216:k.PublicKey.default,Router:new k.PublicKey("DRaybByLpbUL57LJARs3j8BitTxVfzBg351EaMr5UTCd"),FARM_PROGRAM_ID_V3:new k.PublicKey("DRayWyrLmEW5KEeqs8kdTMMaBabapqagaBC7KWpGtJeZ"),FARM_PROGRAM_ID_V4:new k.PublicKey("Ray1111111111111111111111111111111111111111"),FARM_PROGRAM_ID_V5:new k.PublicKey("DRayiCGSZgku1GTK6rXD6mVDdingXy6APAH1R6R5L2LC"),FARM_PROGRAM_ID_V6:new k.PublicKey("DRayzbYakXs45ELHkzH6vC3fuhQqTAnv5A68gdFuvZyZ"),LAUNCHPAD_PROGRAM:new k.PublicKey("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),LAUNCHPAD_AUTH:new k.PublicKey("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7