UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

1 lines 158 kB
var or=Object.defineProperty,sr=Object.defineProperties;var ar=Object.getOwnPropertyDescriptors;var ni=Object.getOwnPropertySymbols;var ur=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable;var ii=(i,e,t)=>e in i?or(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,$=(i,e)=>{for(var t in e||(e={}))ur.call(e,t)&&ii(i,t,e[t]);if(ni)for(var t of ni(e))cr.call(e,t)&&ii(i,t,e[t]);return i},ne=(i,e)=>sr(i,ar(e));import{PublicKey as w,SystemProgram as Vt,TransactionInstruction as Dt}from"@solana/web3.js";import He from"bn.js";import{ASSOCIATED_TOKEN_PROGRAM_ID as Jn,TOKEN_2022_PROGRAM_ID as $n,TOKEN_PROGRAM_ID as bt}from"@solana/spl-token";import{PublicKey as pr}from"@solana/web3.js";import{get as ri,set as lr}from"lodash";var gn=class{constructor(e){this.logLevel=e.logLevel!==void 0?e.logLevel:0,this.name=e.name}set level(e){this.logLevel=e}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(e){return e<=this.logLevel}error(...e){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...e),this):this}logWithError(...e){let t=e.map(n=>typeof n=="object"?JSON.stringify(n):n).join(", ");throw new Error(t)}warning(...e){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...e),this):this}info(...e){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...e),this):this}debug(...e){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...e),this):this}},oi={},mr={};function ge(i){let e=ri(oi,i);if(!e){let t=ri(mr,i);e=new gn({name:i,logLevel:t}),lr(oi,i,e)}return e}import{MINT_SIZE as zs,TOKEN_PROGRAM_ID as Zs,getTransferFeeConfig as Ys,unpackMint as Qs}from"@solana/spl-token";var kn=ge("Raydium_accountInfo_util");async function st(i,e,t){let{batchRequest:n,commitment:r="confirmed",chunkCount:o=100}=$({batchRequest:!1},t),s=Pn(e,o),a=new Array(s.length).fill([]);if(n){let u=s.map(p=>{let d=i._buildArgs([p.map(m=>m.toBase58())],r,"base64");return{methodName:"getMultipleAccounts",args:d}}),c=Pn(u,10);a=(await(await Promise.all(c.map(async p=>await i._rpcBatchRequest(p)))).flat()).map(p=>(p.error&&kn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${p.error.message}`),p.result.value.map(d=>{if(d){let{data:m,executable:g,lamports:f,owner:b,rentEpoch:y}=d;return m.length!==2&&m[1]!=="base64"&&kn.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(m[0],"base64"),executable:g,lamports:f,owner:new pr(b),rentEpoch:y}}return null})))}else try{a=await Promise.all(s.map(u=>i.getMultipleAccountsInfo(u,r)))}catch(u){u instanceof Error&&kn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${u.message}`)}return a.flat()}async function qt(i,e,t){let n=await st(i,e.map(r=>r.pubkey),t);return e.map((r,o)=>ne($({},r),{accountInfo:n[o]}))}import tt from"bn.js";var At=9e15,lt=1e9,wn="0123456789abcdef",Xt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ht="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",An={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-At,maxE:At,crypto:!1},ci,$e,U=!0,Zt="[DecimalError] ",ct=Zt+"Invalid argument: ",li=Zt+"Precision limit exceeded",mi=Zt+"crypto unavailable",pi="[object Decimal]",Ke=Math.floor,Pe=Math.pow,dr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,fr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,br=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,di=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ge=1e7,V=7,yr=9007199254740991,gr=Xt.length-1,hn=Ht.length-1,A={toStringTag:pi};A.absoluteValue=A.abs=function(){var i=new this.constructor(this);return i.s<0&&(i.s=1),E(i)};A.ceil=function(){return E(new this.constructor(this),this.e+1,2)};A.clampedTo=A.clamp=function(i,e){var t,n=this,r=n.constructor;if(i=new r(i),e=new r(e),!i.s||!e.s)return new r(NaN);if(i.gt(e))throw Error(ct+e);return t=n.cmp(i),t<0?i:n.cmp(e)>0?e:new r(n)};A.comparedTo=A.cmp=function(i){var e,t,n,r,o=this,s=o.d,a=(i=new o.constructor(i)).d,u=o.s,c=i.s;if(!s||!a)return!u||!c?NaN:u!==c?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-c:0;if(u!==c)return u;if(o.e!==i.e)return o.e>i.e^u<0?1:-1;for(n=s.length,r=a.length,e=0,t=n<r?n:r;e<t;++e)if(s[e]!==a[e])return s[e]>a[e]^u<0?1:-1;return n===r?0:n>r^u<0?1:-1};A.cosine=A.cos=function(){var i,e,t=this,n=t.constructor;return t.d?t.d[0]?(i=n.precision,e=n.rounding,n.precision=i+Math.max(t.e,t.sd())+V,n.rounding=1,t=kr(n,ki(n,t)),n.precision=i,n.rounding=e,E($e==2||$e==3?t.neg():t,i,e,!0)):new n(1):new n(NaN)};A.cubeRoot=A.cbrt=function(){var i,e,t,n,r,o,s,a,u,c,l=this,p=l.constructor;if(!l.isFinite()||l.isZero())return new p(l);for(U=!1,o=l.s*Pe(l.s*l,1/3),!o||Math.abs(o)==1/0?(t=Ie(l.d),i=l.e,(o=(i-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Pe(t,1/3),i=Ke((i+1)/3)-(i%3==(i<0?-1:2)),o==1/0?t="5e"+i:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+i),n=new p(t),n.s=l.s):n=new p(o.toString()),s=(i=p.precision)+3;;)if(a=n,u=a.times(a).times(a),c=u.plus(l),n=ie(c.plus(l).times(a),c.plus(u),s+2,1),Ie(a.d).slice(0,s)===(t=Ie(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!r&&t=="4999"){if(!r&&(E(a,i+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(E(n,i+1,1),e=!n.times(n).times(n).eq(l));break}return U=!0,E(n,i,p.rounding,e)};A.decimalPlaces=A.dp=function(){var i,e=this.d,t=NaN;if(e){if(i=e.length-1,t=(i-Ke(this.e/V))*V,i=e[i],i)for(;i%10==0;i/=10)t--;t<0&&(t=0)}return t};A.dividedBy=A.div=function(i){return ie(this,new this.constructor(i))};A.dividedToIntegerBy=A.divToInt=function(i){var e=this,t=e.constructor;return E(ie(e,new t(i),0,1,1),t.precision,t.rounding)};A.equals=A.eq=function(i){return this.cmp(i)===0};A.floor=function(){return E(new this.constructor(this),this.e+1,3)};A.greaterThan=A.gt=function(i){return this.cmp(i)>0};A.greaterThanOrEqualTo=A.gte=function(i){var e=this.cmp(i);return e==1||e===0};A.hyperbolicCosine=A.cosh=function(){var i,e,t,n,r,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,r=o.d.length,r<32?(i=Math.ceil(r/3),e=(1/Qt(4,i)).toString()):(i=16,e="2.3283064365386962890625e-10"),o=ht(s,1,o.times(e),new s(1),!0);for(var u,c=i,l=new s(8);c--;)u=o.times(o),o=a.minus(u.times(l.minus(u.times(l))));return E(o,s.precision=t,s.rounding=n,!0)};A.hyperbolicSine=A.sinh=function(){var i,e,t,n,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(e=o.precision,t=o.rounding,o.precision=e+Math.max(r.e,r.sd())+4,o.rounding=1,n=r.d.length,n<3)r=ht(o,2,r,r,!0);else{i=1.4*Math.sqrt(n),i=i>16?16:i|0,r=r.times(1/Qt(5,i)),r=ht(o,2,r,r,!0);for(var s,a=new o(5),u=new o(16),c=new o(20);i--;)s=r.times(r),r=r.times(a.plus(s.times(u.times(s).plus(c))))}return o.precision=e,o.rounding=t,E(r,e,t,!0)};A.hyperbolicTangent=A.tanh=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+7,n.rounding=1,ie(t.sinh(),t.cosh(),n.precision=i,n.rounding=e)):new n(t.s)};A.inverseCosine=A.acos=function(){var i,e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,o=t.rounding;return n!==-1?n===0?e.isNeg()?qe(t,r,o):new t(0):new t(NaN):e.isZero()?qe(t,r+4,o).times(.5):(t.precision=r+6,t.rounding=1,e=e.asin(),i=qe(t,r+4,o).times(.5),t.precision=r,t.rounding=o,i.minus(e))};A.inverseHyperbolicCosine=A.acosh=function(){var i,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(i=n.precision,e=n.rounding,n.precision=i+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,U=!1,t=t.times(t).minus(1).sqrt().plus(t),U=!0,n.precision=i,n.rounding=e,t.ln()):new n(t)};A.inverseHyperbolicSine=A.asinh=function(){var i,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,U=!1,t=t.times(t).plus(1).sqrt().plus(t),U=!0,n.precision=i,n.rounding=e,t.ln())};A.inverseHyperbolicTangent=A.atanh=function(){var i,e,t,n,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(i=o.precision,e=o.rounding,n=r.sd(),Math.max(n,i)<2*-r.e-1?E(new o(r),i,e,!0):(o.precision=t=n-r.e,r=ie(r.plus(1),new o(1).minus(r),t+i,1),o.precision=i+4,o.rounding=1,r=r.ln(),o.precision=i,o.rounding=e,r.times(.5))):new o(NaN)};A.inverseSine=A.asin=function(){var i,e,t,n,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),t=o.precision,n=o.rounding,e!==-1?e===0?(i=qe(o,t+4,n).times(.5),i.s=r.s,i):new o(NaN):(o.precision=t+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,r.times(2)))};A.inverseTangent=A.atan=function(){var i,e,t,n,r,o,s,a,u,c=this,l=c.constructor,p=l.precision,d=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&p+4<=hn)return s=qe(l,p+4,d).times(.25),s.s=c.s,s}else{if(!c.s)return new l(NaN);if(p+4<=hn)return s=qe(l,p+4,d).times(.5),s.s=c.s,s}for(l.precision=a=p+10,l.rounding=1,t=Math.min(28,a/V+2|0),i=t;i;--i)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(U=!1,e=Math.ceil(a/V),n=1,u=c.times(c),s=new l(c),r=c;i!==-1;)if(r=r.times(u),o=s.minus(r.div(n+=2)),r=r.times(u),s=o.plus(r.div(n+=2)),s.d[e]!==void 0)for(i=e;s.d[i]===o.d[i]&&i--;);return t&&(s=s.times(2<<t-1)),U=!0,E(s,l.precision=p,l.rounding=d,!0)};A.isFinite=function(){return!!this.d};A.isInteger=A.isInt=function(){return!!this.d&&Ke(this.e/V)>this.d.length-2};A.isNaN=function(){return!this.s};A.isNegative=A.isNeg=function(){return this.s<0};A.isPositive=A.isPos=function(){return this.s>0};A.isZero=function(){return!!this.d&&this.d[0]===0};A.lessThan=A.lt=function(i){return this.cmp(i)<0};A.lessThanOrEqualTo=A.lte=function(i){return this.cmp(i)<1};A.logarithm=A.log=function(i){var e,t,n,r,o,s,a,u,c=this,l=c.constructor,p=l.precision,d=l.rounding,m=5;if(i==null)i=new l(10),e=!0;else{if(i=new l(i),t=i.d,i.s<0||!t||!t[0]||i.eq(1))return new l(NaN);e=i.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new l(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)o=!0;else{for(r=t[0];r%10===0;)r/=10;o=r!==1}if(U=!1,a=p+m,s=ut(c,a),n=e?zt(l,a+10):ut(i,a),u=ie(s,n,a,1),St(u.d,r=p,d))do if(a+=10,s=ut(c,a),n=e?zt(l,a+10):ut(i,a),u=ie(s,n,a,1),!o){+Ie(u.d).slice(r+1,r+15)+1==1e14&&(u=E(u,p+1,0));break}while(St(u.d,r+=10,d));return U=!0,E(u,p,d)};A.minus=A.sub=function(i){var e,t,n,r,o,s,a,u,c,l,p,d,m=this,g=m.constructor;if(i=new g(i),!m.d||!i.d)return!m.s||!i.s?i=new g(NaN):m.d?i.s=-i.s:i=new g(i.d||m.s!==i.s?m:NaN),i;if(m.s!=i.s)return i.s=-i.s,m.plus(i);if(c=m.d,d=i.d,a=g.precision,u=g.rounding,!c[0]||!d[0]){if(d[0])i.s=-i.s;else if(c[0])i=new g(m);else return new g(u===3?-0:0);return U?E(i,a,u):i}if(t=Ke(i.e/V),l=Ke(m.e/V),c=c.slice(),o=l-t,o){for(p=o<0,p?(e=c,o=-o,s=d.length):(e=d,t=l,s=c.length),n=Math.max(Math.ceil(a/V),s)+2,o>n&&(o=n,e.length=1),e.reverse(),n=o;n--;)e.push(0);e.reverse()}else{for(n=c.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(c[n]!=d[n]){p=c[n]<d[n];break}o=0}for(p&&(e=c,c=d,d=e,i.s=-i.s),s=c.length,n=d.length-s;n>0;--n)c[s++]=0;for(n=d.length;n>o;){if(c[--n]<d[n]){for(r=n;r&&c[--r]===0;)c[r]=Ge-1;--c[r],c[n]+=Ge}c[n]-=d[n]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(i.d=c,i.e=Yt(c,t),U?E(i,a,u):i):new g(u===3?-0:0)};A.modulo=A.mod=function(i){var e,t=this,n=t.constructor;return i=new n(i),!t.d||!i.s||i.d&&!i.d[0]?new n(NaN):!i.d||t.d&&!t.d[0]?E(new n(t),n.precision,n.rounding):(U=!1,n.modulo==9?(e=ie(t,i.abs(),0,3,1),e.s*=i.s):e=ie(t,i,0,n.modulo,1),e=e.times(i),U=!0,t.minus(e))};A.naturalExponential=A.exp=function(){return Tn(this)};A.naturalLogarithm=A.ln=function(){return ut(this)};A.negated=A.neg=function(){var i=new this.constructor(this);return i.s=-i.s,E(i)};A.plus=A.add=function(i){var e,t,n,r,o,s,a,u,c,l,p=this,d=p.constructor;if(i=new d(i),!p.d||!i.d)return!p.s||!i.s?i=new d(NaN):p.d||(i=new d(i.d||p.s===i.s?p:NaN)),i;if(p.s!=i.s)return i.s=-i.s,p.minus(i);if(c=p.d,l=i.d,a=d.precision,u=d.rounding,!c[0]||!l[0])return l[0]||(i=new d(p)),U?E(i,a,u):i;if(o=Ke(p.e/V),n=Ke(i.e/V),c=c.slice(),r=o-n,r){for(r<0?(t=c,r=-r,s=l.length):(t=l,n=o,s=c.length),o=Math.ceil(a/V),s=o>s?o+1:s+1,r>s&&(r=s,t.length=1),t.reverse();r--;)t.push(0);t.reverse()}for(s=c.length,r=l.length,s-r<0&&(r=s,t=l,l=c,c=t),e=0;r;)e=(c[--r]=c[r]+l[r]+e)/Ge|0,c[r]%=Ge;for(e&&(c.unshift(e),++n),s=c.length;c[--s]==0;)c.pop();return i.d=c,i.e=Yt(c,n),U?E(i,a,u):i};A.precision=A.sd=function(i){var e,t=this;if(i!==void 0&&i!==!!i&&i!==1&&i!==0)throw Error(ct+i);return t.d?(e=fi(t.d),i&&t.e+1>e&&(e=t.e+1)):e=NaN,e};A.round=function(){var i=this,e=i.constructor;return E(new e(i),i.e+1,e.rounding)};A.sine=A.sin=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+Math.max(t.e,t.sd())+V,n.rounding=1,t=wr(n,ki(n,t)),n.precision=i,n.rounding=e,E($e>2?t.neg():t,i,e,!0)):new n(NaN)};A.squareRoot=A.sqrt=function(){var i,e,t,n,r,o,s=this,a=s.d,u=s.e,c=s.s,l=s.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(U=!1,c=Math.sqrt(+s),c==0||c==1/0?(e=Ie(a),(e.length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=Ke((u+1)/2)-(u<0||u%2),c==1/0?e="5e"+u:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+u),n=new l(e)):n=new l(c.toString()),t=(u=l.precision)+3;;)if(o=n,n=o.plus(ie(s,o,t+2,1)).times(.5),Ie(o.d).slice(0,t)===(e=Ie(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!r&&e=="4999"){if(!r&&(E(o,u+1,0),o.times(o).eq(s))){n=o;break}t+=4,r=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(E(n,u+1,1),i=!n.times(n).eq(s));break}return U=!0,E(n,u,l.rounding,i)};A.tangent=A.tan=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+10,n.rounding=1,t=t.sin(),t.s=1,t=ie(t,new n(1).minus(t.times(t)).sqrt(),i+10,0),n.precision=i,n.rounding=e,E($e==2||$e==4?t.neg():t,i,e,!0)):new n(NaN)};A.times=A.mul=function(i){var e,t,n,r,o,s,a,u,c,l=this,p=l.constructor,d=l.d,m=(i=new p(i)).d;if(i.s*=l.s,!d||!d[0]||!m||!m[0])return new p(!i.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?i.s/0:i.s*0);for(t=Ke(l.e/V)+Ke(i.e/V),u=d.length,c=m.length,u<c&&(o=d,d=m,m=o,s=u,u=c,c=s),o=[],s=u+c,n=s;n--;)o.push(0);for(n=c;--n>=0;){for(e=0,r=u+n;r>n;)a=o[r]+m[n]*d[r-n-1]+e,o[r--]=a%Ge|0,e=a/Ge|0;o[r]=(o[r]+e)%Ge|0}for(;!o[--s];)o.pop();return e?++t:o.shift(),i.d=o,i.e=Yt(o,t),U?E(i,p.precision,p.rounding):i};A.toBinary=function(i,e){return In(this,2,i,e)};A.toDecimalPlaces=A.toDP=function(i,e){var t=this,n=t.constructor;return t=new n(t),i===void 0?t:(Me(i,0,lt),e===void 0?e=n.rounding:Me(e,0,8),E(t,i+t.e+1,e))};A.toExponential=function(i,e){var t,n=this,r=n.constructor;return i===void 0?t=ze(n,!0):(Me(i,0,lt),e===void 0?e=r.rounding:Me(e,0,8),n=E(new r(n),i+1,e),t=ze(n,!0,i+1)),n.isNeg()&&!n.isZero()?"-"+t:t};A.toFixed=function(i,e){var t,n,r=this,o=r.constructor;return i===void 0?t=ze(r):(Me(i,0,lt),e===void 0?e=o.rounding:Me(e,0,8),n=E(new o(r),i+r.e+1,e),t=ze(n,!1,i+n.e+1)),r.isNeg()&&!r.isZero()?"-"+t:t};A.toFraction=function(i){var e,t,n,r,o,s,a,u,c,l,p,d,m=this,g=m.d,f=m.constructor;if(!g)return new f(m);if(c=t=new f(1),n=u=new f(0),e=new f(n),o=e.e=fi(g)-m.e-1,s=o%V,e.d[0]=Pe(10,s<0?V+s:s),i==null)i=o>0?e:c;else{if(a=new f(i),!a.isInt()||a.lt(c))throw Error(ct+a);i=a.gt(e)?o>0?e:c:a}for(U=!1,a=new f(Ie(g)),l=f.precision,f.precision=o=g.length*V*2;p=ie(a,e,0,1,1),r=t.plus(p.times(n)),r.cmp(i)!=1;)t=n,n=r,r=c,c=u.plus(p.times(r)),u=r,r=e,e=a.minus(p.times(r)),a=r;return r=ie(i.minus(t),n,0,1,1),u=u.plus(r.times(c)),t=t.plus(r.times(n)),u.s=c.s=m.s,d=ie(c,n,o,1).minus(m).abs().cmp(ie(u,t,o,1).minus(m).abs())<1?[c,n]:[u,t],f.precision=l,U=!0,d};A.toHexadecimal=A.toHex=function(i,e){return In(this,16,i,e)};A.toNearest=function(i,e){var t=this,n=t.constructor;if(t=new n(t),i==null){if(!t.d)return t;i=new n(1),e=n.rounding}else{if(i=new n(i),e===void 0?e=n.rounding:Me(e,0,8),!t.d)return i.s?t:i;if(!i.d)return i.s&&(i.s=t.s),i}return i.d[0]?(U=!1,t=ie(t,i,0,e,1).times(i),U=!0,E(t)):(i.s=t.s,t=i),t};A.toNumber=function(){return+this};A.toOctal=function(i,e){return In(this,8,i,e)};A.toPower=A.pow=function(i){var e,t,n,r,o,s,a=this,u=a.constructor,c=+(i=new u(i));if(!a.d||!i.d||!a.d[0]||!i.d[0])return new u(Pe(+a,c));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,i.eq(1))return E(a,n,o);if(e=Ke(i.e/V),e>=i.d.length-1&&(t=c<0?-c:c)<=yr)return r=bi(u,a,t,n),i.s<0?new u(1).div(r):E(r,n,o);if(s=a.s,s<0){if(e<i.d.length-1)return new u(NaN);if((i.d[e]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return t=Pe(+a,c),e=t==0||!isFinite(t)?Ke(c*(Math.log("0."+Ie(a.d))/Math.LN10+a.e+1)):new u(t+"").e,e>u.maxE+1||e<u.minE-1?new u(e>0?s/0:0):(U=!1,u.rounding=a.s=1,t=Math.min(12,(e+"").length),r=Tn(i.times(ut(a,n+t)),n),r.d&&(r=E(r,n+5,1),St(r.d,n,o)&&(e=n+10,r=E(Tn(i.times(ut(a,e+t)),e),e+5,1),+Ie(r.d).slice(n+1,n+15)+1==1e14&&(r=E(r,n+1,0)))),r.s=s,U=!0,u.rounding=o,E(r,n,o))};A.toPrecision=function(i,e){var t,n=this,r=n.constructor;return i===void 0?t=ze(n,n.e<=r.toExpNeg||n.e>=r.toExpPos):(Me(i,1,lt),e===void 0?e=r.rounding:Me(e,0,8),n=E(new r(n),i,e),t=ze(n,i<=n.e||n.e<=r.toExpNeg,i)),n.isNeg()&&!n.isZero()?"-"+t:t};A.toSignificantDigits=A.toSD=function(i,e){var t=this,n=t.constructor;return i===void 0?(i=n.precision,e=n.rounding):(Me(i,1,lt),e===void 0?e=n.rounding:Me(e,0,8)),E(new n(t),i,e)};A.toString=function(){var i=this,e=i.constructor,t=ze(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()&&!i.isZero()?"-"+t:t};A.truncated=A.trunc=function(){return E(new this.constructor(this),this.e+1,1)};A.valueOf=A.toJSON=function(){var i=this,e=i.constructor,t=ze(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()?"-"+t:t};function Ie(i){var e,t,n,r=i.length-1,o="",s=i[0];if(r>0){for(o+=s,e=1;e<r;e++)n=i[e]+"",t=V-n.length,t&&(o+=at(t)),o+=n;s=i[e],n=s+"",t=V-n.length,t&&(o+=at(t))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function Me(i,e,t){if(i!==~~i||i<e||i>t)throw Error(ct+i)}function St(i,e,t,n){var r,o,s,a;for(o=i[0];o>=10;o/=10)--e;return--e<0?(e+=V,r=0):(r=Math.ceil((e+1)/V),e%=V),o=Pe(10,V-e),a=i[r]%o|0,n==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(i[r+1]/o/100|0)==Pe(10,e-2)-1||(a==o/2||a==0)&&(i[r+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(i[r+1]/o/1e3|0)==Pe(10,e-3)-1,s}function Ut(i,e,t){for(var n,r=[0],o,s=0,a=i.length;s<a;){for(o=r.length;o--;)r[o]*=e;for(r[0]+=wn.indexOf(i.charAt(s++)),n=0;n<r.length;n++)r[n]>t-1&&(r[n+1]===void 0&&(r[n+1]=0),r[n+1]+=r[n]/t|0,r[n]%=t)}return r.reverse()}function kr(i,e){var t,n,r;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),r=(1/Qt(4,t)).toString()):(t=16,r="2.3283064365386962890625e-10"),i.precision+=t,e=ht(i,1,e.times(r),new i(1));for(var o=t;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return i.precision-=t,e}var ie=function(){function i(n,r,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*r+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function e(n,r,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;a<o;a++)if(n[a]!=r[a]){u=n[a]>r[a]?1:-1;break}return u}function t(n,r,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<r[o]?1:0,n[o]=a*s+n[o]-r[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,r,o,s,a,u){var c,l,p,d,m,g,f,b,y,T,h,S,M,B,K,N,q,x,F,fe,se=n.constructor,he=n.s==r.s?1:-1,me=n.d,ee=r.d;if(!me||!me[0]||!ee||!ee[0])return new se(!n.s||!r.s||(me?ee&&me[0]==ee[0]:!ee)?NaN:me&&me[0]==0||!ee?he*0:he/0);for(u?(m=1,l=n.e-r.e):(u=Ge,m=V,l=Ke(n.e/m)-Ke(r.e/m)),F=ee.length,q=me.length,y=new se(he),T=y.d=[],p=0;ee[p]==(me[p]||0);p++);if(ee[p]>(me[p]||0)&&l--,o==null?(B=o=se.precision,s=se.rounding):a?B=o+(n.e-r.e)+1:B=o,B<0)T.push(1),g=!0;else{if(B=B/m+2|0,p=0,F==1){for(d=0,ee=ee[0],B++;(p<q||d)&&B--;p++)K=d*u+(me[p]||0),T[p]=K/ee|0,d=K%ee|0;g=d||p<q}else{for(d=u/(ee[0]+1)|0,d>1&&(ee=i(ee,d,u),me=i(me,d,u),F=ee.length,q=me.length),N=F,h=me.slice(0,F),S=h.length;S<F;)h[S++]=0;fe=ee.slice(),fe.unshift(0),x=ee[0],ee[1]>=u/2&&++x;do d=0,c=e(ee,h,F,S),c<0?(M=h[0],F!=S&&(M=M*u+(h[1]||0)),d=M/x|0,d>1?(d>=u&&(d=u-1),f=i(ee,d,u),b=f.length,S=h.length,c=e(f,h,b,S),c==1&&(d--,t(f,F<b?fe:ee,b,u))):(d==0&&(c=d=1),f=ee.slice()),b=f.length,b<S&&f.unshift(0),t(h,f,S,u),c==-1&&(S=h.length,c=e(ee,h,F,S),c<1&&(d++,t(h,F<S?fe:ee,S,u))),S=h.length):c===0&&(d++,h=[0]),T[p++]=d,c&&h[0]?h[S++]=me[N]||0:(h=[me[N]],S=1);while((N++<q||h[0]!==void 0)&&B--);g=h[0]!==void 0}T[0]||T.shift()}if(m==1)y.e=l,ci=g;else{for(p=1,d=T[0];d>=10;d/=10)p++;y.e=p+l*m-1,E(y,a?o+y.e+1:o,s,g)}return y}}();function E(i,e,t,n){var r,o,s,a,u,c,l,p,d,m=i.constructor;e:if(e!=null){if(p=i.d,!p)return i;for(r=1,a=p[0];a>=10;a/=10)r++;if(o=e-r,o<0)o+=V,s=e,l=p[d=0],u=l/Pe(10,r-s-1)%10|0;else if(d=Math.ceil((o+1)/V),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);l=u=0,r=1,o%=V,s=o-V+1}else break e;else{for(l=a=p[d],r=1;a>=10;a/=10)r++;o%=V,s=o-V+r,u=s<0?0:l/Pe(10,r-s-1)%10|0}if(n=n||e<0||p[d+1]!==void 0||(s<0?l:l%Pe(10,r-s-1)),c=t<4?(u||n)&&(t==0||t==(i.s<0?3:2)):u>5||u==5&&(t==4||n||t==6&&(o>0?s>0?l/Pe(10,r-s):0:p[d-1])%10&1||t==(i.s<0?8:7)),e<1||!p[0])return p.length=0,c?(e-=i.e+1,p[0]=Pe(10,(V-e%V)%V),i.e=-e||0):p[0]=i.e=0,i;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=Pe(10,V-o),p[d]=s>0?(l/Pe(10,r-s)%Pe(10,s)|0)*a:0),c)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(i.e++,p[0]==Ge&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=Ge)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return U&&(i.e>m.maxE?(i.d=null,i.e=NaN):i.e<m.minE&&(i.e=0,i.d=[0])),i}function ze(i,e,t){if(!i.isFinite())return gi(i);var n,r=i.e,o=Ie(i.d),s=o.length;return e?(t&&(n=t-s)>0?o=o.charAt(0)+"."+o.slice(1)+at(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i.e<0?"e":"e+")+i.e):r<0?(o="0."+at(-r-1)+o,t&&(n=t-s)>0&&(o+=at(n))):r>=s?(o+=at(r+1-s),t&&(n=t-r-1)>0&&(o=o+"."+at(n))):((n=r+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),t&&(n=t-s)>0&&(r+1===s&&(o+="."),o+=at(n))),o}function Yt(i,e){var t=i[0];for(e*=V;t>=10;t/=10)e++;return e}function zt(i,e,t){if(e>gr)throw U=!0,t&&(i.precision=t),Error(li);return E(new i(Xt),e,1,!0)}function qe(i,e,t){if(e>hn)throw Error(li);return E(new i(Ht),e,t,!0)}function fi(i){var e=i.length-1,t=e*V+1;if(e=i[e],e){for(;e%10==0;e/=10)t--;for(e=i[0];e>=10;e/=10)t++}return t}function at(i){for(var e="";i--;)e+="0";return e}function bi(i,e,t,n){var r,o=new i(1),s=Math.ceil(n/V+4);for(U=!1;;){if(t%2&&(o=o.times(e),ai(o.d,s)&&(r=!0)),t=Ke(t/2),t===0){t=o.d.length-1,r&&o.d[t]===0&&++o.d[t];break}e=e.times(e),ai(e.d,s)}return U=!0,o}function si(i){return i.d[i.d.length-1]&1}function yi(i,e,t){for(var n,r=new i(e[0]),o=0;++o<e.length;)if(n=new i(e[o]),n.s)r[t](n)&&(r=n);else{r=n;break}return r}function Tn(i,e){var t,n,r,o,s,a,u,c=0,l=0,p=0,d=i.constructor,m=d.rounding,g=d.precision;if(!i.d||!i.d[0]||i.e>17)return new d(i.d?i.d[0]?i.s<0?0:1/0:1:i.s?i.s<0?0:i:0/0);for(e==null?(U=!1,u=g):u=e,a=new d(.03125);i.e>-2;)i=i.times(a),p+=5;for(n=Math.log(Pe(2,p))/Math.LN10*2+5|0,u+=n,t=o=s=new d(1),d.precision=u;;){if(o=E(o.times(i),u,1),t=t.times(++l),a=s.plus(ie(o,t,u,1)),Ie(a.d).slice(0,u)===Ie(s.d).slice(0,u)){for(r=p;r--;)s=E(s.times(s),u,1);if(e==null)if(c<3&&St(s.d,u-n,m,c))d.precision=u+=10,t=o=a=new d(1),l=0,c++;else return E(s,d.precision=g,m,U=!0);else return d.precision=g,s}s=a}}function ut(i,e){var t,n,r,o,s,a,u,c,l,p,d,m=1,g=10,f=i,b=f.d,y=f.constructor,T=y.rounding,h=y.precision;if(f.s<0||!b||!b[0]||!f.e&&b[0]==1&&b.length==1)return new y(b&&!b[0]?-1/0:f.s!=1?NaN:b?0:f);if(e==null?(U=!1,l=h):l=e,y.precision=l+=g,t=Ie(b),n=t.charAt(0),Math.abs(o=f.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)f=f.times(i),t=Ie(f.d),n=t.charAt(0),m++;o=f.e,n>1?(f=new y("0."+t),o++):f=new y(n+"."+t.slice(1))}else return c=zt(y,l+2,h).times(o+""),f=ut(new y(n+"."+t.slice(1)),l-g).plus(c),y.precision=h,e==null?E(f,h,T,U=!0):f;for(p=f,u=s=f=ie(f.minus(1),f.plus(1),l,1),d=E(f.times(f),l,1),r=3;;){if(s=E(s.times(d),l,1),c=u.plus(ie(s,new y(r),l,1)),Ie(c.d).slice(0,l)===Ie(u.d).slice(0,l))if(u=u.times(2),o!==0&&(u=u.plus(zt(y,l+2,h).times(o+""))),u=ie(u,new y(m),l,1),e==null)if(St(u.d,l-g,T,a))y.precision=l+=g,c=s=f=ie(p.minus(1),p.plus(1),l,1),d=E(f.times(f),l,1),r=a=1;else return E(u,y.precision=h,T,U=!0);else return y.precision=h,u;u=c,r+=2}}function gi(i){return String(i.s*i.s/0)}function Bn(i,e){var t,n,r;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(r=e.length;e.charCodeAt(r-1)===48;--r);if(e=e.slice(n,r),e){if(r-=n,i.e=t=t-n-1,i.d=[],n=(t+1)%V,t<0&&(n+=V),n<r){for(n&&i.d.push(+e.slice(0,n)),r-=V;n<r;)i.d.push(+e.slice(n,n+=V));e=e.slice(n),n=V-e.length}else n-=r;for(;n--;)e+="0";i.d.push(+e),U&&(i.e>i.constructor.maxE?(i.d=null,i.e=NaN):i.e<i.constructor.minE&&(i.e=0,i.d=[0]))}else i.e=0,i.d=[0];return i}function Pr(i,e){var t,n,r,o,s,a,u,c,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),di.test(e))return Bn(i,e)}else if(e==="Infinity"||e==="NaN")return+e||(i.s=NaN),i.e=NaN,i.d=null,i;if(fr.test(e))t=16,e=e.toLowerCase();else if(dr.test(e))t=2;else if(br.test(e))t=8;else throw Error(ct+e);for(o=e.search(/p/i),o>0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,n=i.constructor,s&&(e=e.replace(".",""),a=e.length,o=a-o,r=bi(n,new n(t),o,o*2)),c=Ut(e,t,Ge),l=c.length-1,o=l;c[o]===0;--o)c.pop();return o<0?new n(i.s*0):(i.e=Yt(c,l),i.d=c,U=!1,s&&(i=ie(i,r,a*4)),u&&(i=i.times(Math.abs(u)<54?Pe(2,u):Kt.pow(2,u))),U=!0,i)}function wr(i,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:ht(i,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Qt(5,t)),e=ht(i,2,e,e);for(var r,o=new i(5),s=new i(16),a=new i(20);t--;)r=e.times(e),e=e.times(o.plus(r.times(s.times(r).minus(a))));return e}function ht(i,e,t,n,r){var o,s,a,u,c=1,l=i.precision,p=Math.ceil(l/V);for(U=!1,u=t.times(t),a=new i(n);;){if(s=ie(a.times(u),new i(e++*e++),l,1),a=r?n.plus(s):n.minus(s),n=ie(s.times(u),new i(e++*e++),l,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,c++}return U=!0,s.d.length=p+1,s}function Qt(i,e){for(var t=i;--e;)t*=i;return t}function ki(i,e){var t,n=e.s<0,r=qe(i,i.precision,1),o=r.times(.5);if(e=e.abs(),e.lte(o))return $e=n?4:1,e;if(t=e.divToInt(r),t.isZero())$e=n?3:2;else{if(e=e.minus(t.times(r)),e.lte(o))return $e=si(t)?n?2:3:n?4:1,e;$e=si(t)?n?1:4:n?3:2}return e.minus(r).abs()}function In(i,e,t,n){var r,o,s,a,u,c,l,p,d,m=i.constructor,g=t!==void 0;if(g?(Me(t,1,lt),n===void 0?n=m.rounding:Me(n,0,8)):(t=m.precision,n=m.rounding),!i.isFinite())l=gi(i);else{for(l=ze(i),s=l.indexOf("."),g?(r=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):r=e,s>=0&&(l=l.replace(".",""),d=new m(1),d.e=l.length-s,d.d=Ut(ze(d),10,r),d.e=d.d.length),p=Ut(l,10,r),o=u=p.length;p[--u]==0;)p.pop();if(!p[0])l=g?"0p+0":"0";else{if(s<0?o--:(i=new m(i),i.d=p,i.e=o,i=ie(i,d,t,n,0,r),p=i.d,o=i.e,c=ci),s=p[t],a=r/2,c=c||p[t+1]!==void 0,c=n<4?(s!==void 0||c)&&(n===0||n===(i.s<0?3:2)):s>a||s===a&&(n===4||c||n===6&&p[t-1]&1||n===(i.s<0?8:7)),p.length=t,c)for(;++p[--t]>r-1;)p[t]=0,t||(++o,p.unshift(1));for(u=p.length;!p[u-1];--u);for(s=0,l="";s<u;s++)l+=wn.charAt(p[s]);if(g){if(u>1)if(e==16||e==8){for(s=e==16?4:3,--u;u%s;u++)l+="0";for(p=Ut(l,r,e),u=p.length;!p[u-1];--u);for(s=1,l="1.";s<u;s++)l+=wn.charAt(p[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>u)for(o-=u;o--;)l+="0";else o<u&&(l=l.slice(0,o)+"."+l.slice(o))}l=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return i.s<0?"-"+l:l}function ai(i,e){if(i.length>e)return i.length=e,!0}function Ar(i){return new this(i).abs()}function hr(i){return new this(i).acos()}function Tr(i){return new this(i).acosh()}function Br(i,e){return new this(i).plus(e)}function Ir(i){return new this(i).asin()}function xr(i){return new this(i).asinh()}function Sr(i){return new this(i).atan()}function Kr(i){return new this(i).atanh()}function Cr(i,e){i=new this(i),e=new this(e);var t,n=this.precision,r=this.rounding,o=n+4;return!i.s||!e.s?t=new this(NaN):!i.d&&!e.d?(t=qe(this,o,1).times(e.s>0?.25:.75),t.s=i.s):!e.d||i.isZero()?(t=e.s<0?qe(this,n,r):new this(0),t.s=i.s):!i.d||e.isZero()?(t=qe(this,o,1).times(.5),t.s=i.s):e.s<0?(this.precision=o,this.rounding=1,t=this.atan(ie(i,e,o,1)),e=qe(this,o,1),this.precision=n,this.rounding=r,t=i.s<0?t.minus(e):t.plus(e)):t=this.atan(ie(i,e,o,1)),t}function Nr(i){return new this(i).cbrt()}function Lr(i){return E(i=new this(i),i.e+1,2)}function Rr(i,e,t){return new this(i).clamp(e,t)}function Mr(i){if(!i||typeof i!="object")throw Error(Zt+"Object expected");var e,t,n,r=i.defaults===!0,o=["precision",1,lt,"rounding",0,8,"toExpNeg",-At,0,"toExpPos",0,At,"maxE",0,At,"minE",-At,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(t=o[e],r&&(this[t]=An[t]),(n=i[t])!==void 0)if(Ke(n)===n&&n>=o[e+1]&&n<=o[e+2])this[t]=n;else throw Error(ct+t+": "+n);if(t="crypto",r&&(this[t]=An[t]),(n=i[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(mi);else this[t]=!1;else throw Error(ct+t+": "+n);return this}function Or(i){return new this(i).cos()}function Wr(i){return new this(i).cosh()}function Pi(i){var e,t,n;function r(o){var s,a,u,c=this;if(!(c instanceof r))return new r(o);if(c.constructor=r,ui(o)){c.s=o.s,U?!o.d||o.e>r.maxE?(c.e=NaN,c.d=null):o.e<r.minE?(c.e=0,c.d=[0]):(c.e=o.e,c.d=o.d.slice()):(c.e=o.e,c.d=o.d?o.d.slice():o.d);return}if(u=typeof o,u==="number"){if(o===0){c.s=1/o<0?-1:1,c.e=0,c.d=[0];return}if(o<0?(o=-o,c.s=-1):c.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;U?s>r.maxE?(c.e=NaN,c.d=null):s<r.minE?(c.e=0,c.d=[0]):(c.e=s,c.d=[o]):(c.e=s,c.d=[o]);return}else if(o*0!==0){o||(c.s=NaN),c.e=NaN,c.d=null;return}return Bn(c,o.toString())}else if(u!=="string")throw Error(ct+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),c.s=-1):(a===43&&(o=o.slice(1)),c.s=1),di.test(o)?Bn(c,o):Pr(c,o)}if(r.prototype=A,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=Mr,r.clone=Pi,r.isDecimal=ui,r.abs=Ar,r.acos=hr,r.acosh=Tr,r.add=Br,r.asin=Ir,r.asinh=xr,r.atan=Sr,r.atanh=Kr,r.atan2=Cr,r.cbrt=Nr,r.ceil=Lr,r.clamp=Rr,r.cos=Or,r.cosh=Wr,r.div=Fr,r.exp=Er,r.floor=vr,r.hypot=_r,r.ln=Vr,r.log=Dr,r.log10=Gr,r.log2=qr,r.max=Ur,r.min=Xr,r.mod=Hr,r.mul=zr,r.pow=Zr,r.random=Yr,r.round=Qr,r.sign=jr,r.sin=Jr,r.sinh=$r,r.sqrt=eo,r.sub=to,r.sum=no,r.tan=io,r.tanh=ro,r.trunc=oo,i===void 0&&(i={}),i&&i.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)i.hasOwnProperty(t=n[e++])||(i[t]=this[t]);return r.config(i),r}function Fr(i,e){return new this(i).div(e)}function Er(i){return new this(i).exp()}function vr(i){return E(i=new this(i),i.e+1,3)}function _r(){var i,e,t=new this(0);for(U=!1,i=0;i<arguments.length;)if(e=new this(arguments[i++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return U=!0,new this(1/0);t=e}return U=!0,t.sqrt()}function ui(i){return i instanceof Kt||i&&i.toStringTag===pi||!1}function Vr(i){return new this(i).ln()}function Dr(i,e){return new this(i).log(e)}function qr(i){return new this(i).log(2)}function Gr(i){return new this(i).log(10)}function Ur(){return yi(this,arguments,"lt")}function Xr(){return yi(this,arguments,"gt")}function Hr(i,e){return new this(i).mod(e)}function zr(i,e){return new this(i).mul(e)}function Zr(i,e){return new this(i).pow(e)}function Yr(i){var e,t,n,r,o=0,s=new this(1),a=[];if(i===void 0?i=this.precision:Me(i,1,lt),n=Math.ceil(i/V),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));o<n;)r=e[o],r>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=r%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);o<n;)r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((e[o+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(e,o):(a.push(r%1e7),o+=4);o=n/4}else throw Error(mi);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],i%=V,n&&i&&(r=Pe(10,V-i),a[o]=(n/r|0)*r);a[o]===0;o--)a.pop();if(o<0)t=0,a=[0];else{for(t=-1;a[0]===0;t-=V)a.shift();for(n=1,r=a[0];r>=10;r/=10)n++;n<V&&(t-=V-n)}return s.e=t,s.d=a,s}function Qr(i){return E(i=new this(i),i.e+1,this.rounding)}function jr(i){return i=new this(i),i.d?i.d[0]?i.s:0*i.s:i.s||NaN}function Jr(i){return new this(i).sin()}function $r(i){return new this(i).sinh()}function eo(i){return new this(i).sqrt()}function to(i,e){return new this(i).sub(e)}function no(){var i=0,e=arguments,t=new this(e[i]);for(U=!1;t.s&&++i<e.length;)t=t.plus(e[i]);return U=!0,E(t,this.precision,this.rounding)}function io(i){return new this(i).tan()}function ro(i){return new this(i).tanh()}function oo(i){return E(i=new this(i),i.e+1,1)}A[Symbol.for("nodejs.util.inspect.custom")]=A.toString;A[Symbol.toStringTag]="Decimal";var Kt=A.constructor=Pi(An);Xt=new Kt(Xt);Ht=new Kt(Ht);var R=Kt;import fo from"big.js";import $t from"bn.js";import so from"toformat";var ao=so,Ct=ao;import Jt from"big.js";import co from"bn.js";import lo from"decimal.js-light";import Nt from"bn.js";var wi=9007199254740991;function pe(i){let e=ge("Raydium_parseBigNumberish");if(i instanceof Nt)return i;if(typeof i=="string"){if(i.match(/^-?[0-9]+$/))return new Nt(i);e.logWithError(`invalid BigNumberish string: ${i}`)}return typeof i=="number"?(i%1&&e.logWithError(`BigNumberish number underflow: ${i}`),(i>=wi||i<=-wi)&&e.logWithError(`BigNumberish number overflow: ${i}`),new Nt(String(i))):typeof i=="bigint"?new Nt(i.toString()):(e.error(`invalid BigNumberish value: ${i}`),new Nt(0))}var jt=ge("module/fraction"),xn=Ct(Jt),Lt=Ct(lo),mo={[0]:Lt.ROUND_DOWN,[1]:Lt.ROUND_HALF_UP,[2]:Lt.ROUND_UP},po={[0]:Jt.roundDown,[1]:Jt.roundHalfUp,[2]:Jt.roundUp},j=class{constructor(e,t=new co(1)){this.numerator=pe(e),this.denominator=pe(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new j(this.denominator,this.numerator)}add(e){let t=e instanceof j?e:new j(pe(e));return this.denominator.eq(t.denominator)?new j(this.numerator.add(t.numerator),this.denominator):new j(this.numerator.mul(t.denominator).add(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}sub(e){let t=e instanceof j?e:new j(pe(e));return this.denominator.eq(t.denominator)?new j(this.numerator.sub(t.numerator),this.denominator):new j(this.numerator.mul(t.denominator).sub(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}mul(e){let t=e instanceof j?e:new j(pe(e));return new j(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof j?e:new j(pe(e));return new j(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},n=1){Number.isInteger(e)||jt.logWithError(`${e} is not an integer.`),e<=0&&jt.logWithError(`${e} is not positive.`),Lt.set({precision:e+1,rounding:mo[n]});let r=new Lt(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return r.toFormat(r.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},n=1){return Number.isInteger(e)||jt.logWithError(`${e} is not an integer.`),e<0&&jt.logWithError(`${e} is negative.`),xn.DP=e,xn.RM=po[n]||1,new xn(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var bo=ge("Raydium_amount"),Ai=Ct(fo);function yo(i,e){let t="0",n="0";if(i.includes(".")){let r=i.split(".");r.length===2?([t,n]=r,n=n.padEnd(e,"0")):bo.logWithError(`invalid number string, num: ${i}`)}else t=i;return[t,n.slice(0,e)||n]}var Te=class extends j{constructor(t,n,r=!0,o){let s=new $t(0),a=Sn.pow(new $t(t.decimals));if(r)s=pe(n);else{let u=new $t(0),c=new $t(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,p]=yo(n.toString(),t.decimals);u=pe(l),c=pe(p)}u=u.mul(a),s=u.add(c)}super(s,a);this.logger=ge(o||"TokenAmount"),this.token=t}get raw(){return this.numerator}isZero(){return this.raw.isZero()}gt(t){return this.token.equals(t.token)||this.logger.logWithError("gt token not equals"),this.raw.gt(t.raw)}lt(t){return this.token.equals(t.token)||this.logger.logWithError("lt token not equals"),this.raw.lt(t.raw)}add(t){return this.token.equals(t.token)||this.logger.logWithError("add token not equals"),new Te(this.token,this.raw.add(t.raw))}subtract(t){return this.token.equals(t.token)||this.logger.logWithError("sub token not equals"),new Te(this.token,this.raw.sub(t.raw))}toSignificant(t=this.token.decimals,n,r=0){return super.toSignificant(t,n,r)}toFixed(t=this.token.decimals,n,r=0){return t>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(t,n,r)}toExact(t={groupSeparator:""}){return Ai.DP=this.token.decimals,new Ai(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)}};import{PublicKey as go}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as hi}from"@solana/spl-token";var Kn={chainId:101,address:go.default.toBase58(),programId:hi.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},mt={chainId:101,address:"So11111111111111111111111111111111111111112",programId:hi.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 Ln}from"@solana/web3.js";import{PublicKey as ce,SystemProgram as Ti,SYSVAR_RENT_PUBKEY as ko}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Po}from"@solana/spl-token";function k({pubkey:i,isSigner:e=!1,isWritable:t=!0}){return{pubkey:i,isWritable:t,isSigner:e}}var Ca=[k({pubkey:Po,isWritable:!1}),k({pubkey:Ti.programId,isWritable:!1}),k({pubkey:ko,isWritable:!1})];function Cn({publicKey:i,transformSol:e}){let t=Nn(i.toString());if(t instanceof ce)return e&&t.equals(Rt)?Gt:t;if(e&&t.toString()===Rt.toBase58())return Gt;if(typeof t=="string"){if(t===ce.default.toBase58())return ce.default;try{return new ce(t)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function Nn(i){try{return new ce(i)}catch{return i}}var en=new ce("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),pt=new ce("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Ze=new ce("SysvarRent111111111111111111111111111111111"),Na=new ce("SysvarC1ock11111111111111111111111111111111"),dt=new ce("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),La=new ce("Sysvar1nstructions1111111111111111111111111"),wo=Ti.programId,Ra=new ce("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),Ma=new ce("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),Oa=new ce("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),Wa=new ce("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),Fa=new ce("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),Ea=new ce("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),va=new ce("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),_a=new ce("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),Va=new ce("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Da=new ce("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),qa=new ce("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),Gt=new ce("So11111111111111111111111111111111111111112"),Rt=ce.default;function xt(i){return Cn({publicKey:i,transformSol:!0})}var Rn=class{constructor({mint:e,decimals:t,symbol:n,name:r,skipMint:o=!1,isToken2022:s=!1}){if(e===Rt.toBase58()||e instanceof Ln&&Rt.equals(e)){this.decimals=mt.decimals,this.symbol=mt.symbol,this.name=mt.name,this.mint=new Ln(mt.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=n||e.toString().substring(0,6),this.name=r||e.toString().substring(0,6),this.mint=o?Ln.default:Cn({publicKey:e}),this.isToken2022=s}equals(e){return this===e?!0:this.mint.equals(e.mint)}},Ue=Rn;Ue.WSOL=new Rn(ne($({},mt),{mint:mt.address}));var Mn=class{constructor({decimals:e,symbol:t="UNKNOWN",name:n="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=n}equals(e){return this===e}},tn=Mn;tn.SOL=new Mn(Kn);import Ao from"bn.js";var Bi=new j(new Ao(100)),et=class extends j{toSignificant(e=5,t,n){return this.mul(Bi).toSignificant(e,t,n)}toFixed(e=2,t,n){return this.mul(Bi).toFixed(e,t,n)}};var ho=ge("Raydium_price"),Ve=class extends j{constructor(t){let{baseToken:n,quoteToken:r,numerator:o,denominator:s}=t;super(o,s);this.baseToken=n,this.quoteToken=r,this.scalar=new j(On(n.decimals),On(r.decimals))}get raw(){return new j(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new Ve({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(t){this.quoteToken!==t.baseToken&&ho.logWithError("mul token not equals");let n=super.mul(t);return new Ve({baseToken:this.baseToken,quoteToken:t.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(t=this.quoteToken.decimals,n,r){return this.adjusted.toSignificant(t,n,r)}toFixed(t=this.quoteToken.decimals,n,r){return this.adjusted.toFixed(t,n,r)}};var Ii=new tt(0),To=new tt(1),Lu=new tt(2),Ru=new tt(3),Mu=new tt(5),Sn=new tt(10),Ou=new tt(100),Wu=new tt(1e3),Fu=new tt(1e4);function On(i){return Sn.pow(pe(i))}function Pn(i,e=1,t=[]){let n=[...i];if(e<=0)return t;for(;n.length;)t.push(n.splice(0,e));return t}import{PublicKey as Io}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as xo}from"@solana/spl-token";import{ComputeBudgetProgram as Uu,Keypair as zu,PublicKey as Bo,Transaction as Yu,TransactionMessage as ju,VersionedTransaction as Ju}from"@solana/web3.js";var re={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"};import{TOKEN_PROGRAM_ID as nc}from"@solana/spl-token";var ic=ge("Raydium_txUtil");function Ce(i,e){let[t,n]=Bo.findProgramAddressSync(i,e);return{publicKey:t,nonce:n}}function oe(i,e,t){return Ce([i.toBuffer(),(t!=null?t:xo).toBuffer(),e.toBuffer()],new Io("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}import{PublicKey as v}from"@solana/web3.js";var So=new v("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),Ko=new v("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Co=new v("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),No=new v("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),Lo=new v("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),Ro=new v("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Mo=new v("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),Oo=new v("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),Wo=new v("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),nn=new v("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),xi=new v("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),Si=new v("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Ki=new v("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),rn=new v("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),Fo=new v("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),Eo=new v("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),lc=new v("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),mc=new v("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),pc=new v("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),dc=new v("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),Ci=new v("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),Ni=new v("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),vo=new v("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),_o=new v("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Vo=new v("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),Do=new v("LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"),qo=new v("WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh"),fc=new v("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),bc=new v("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"),Go=new v("4Bu96XjU84XjPDSpveTVf6LYGCkfW5FK7SNkREWcEfV4"),Uo=new v("6s1xP3hpbAfFoNtUNF8mfHsjr2Bd97JxFJRWLbL6aHuX");var Le={AMM_V4:Oo,AMM_STABLE:Wo,CLMM_PROGRAM_ID:xi,CLMM_LOCK_PROGRAM_ID:Si,CLMM_LOCK_AUTH_ID:Ki,FARM_PROGRAM_ID_V3:So,FARM_PROGRAM_ID_V4:Ko,FARM_PROGRAM_ID_V5:Co,FARM_PROGRAM_ID_V6:No,OPEN_BOOK_PROGRAM:Ro,SERUM_PROGRAM_ID_V3:Mo,UTIL1216:Lo,Router:Fo,CREATE_CPMM_POOL_PROGRAM:Ci,CREATE_CPMM_POOL_AUTH:Ni,CREATE_CPMM_POOL_FEE_ACC:vo,LOCK_CPMM_PROGRAM:_o,LOCK_CPMM_AUTH:Vo,LAUNCHPAD_PROGRAM:Do,LAUNCHPAD_AUTH:qo,LAUNCHPAD_PLATFORM:Go,LAUNCHPAD_CONFIG:Uo,FEE_DESTINATION_ID:Eo,MODEL_DATA_PUBKEY:rn},yc={OPEN_BOOK_PROGRAM:new v("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),SERUM_PROGRAM_ID_V3:new v("Ray1111111111111111111111111111111111111111"),AMM_V4:new v("DRaya7Kj3aMWQSy19kSjvmuwq9docCHofyP9kanQGaav"),AMM_STABLE:new v("DRayDdXc1NZQ9C3hRWmoSf8zK4iapgMnjdNZWrfwsP8m"),CLMM_PROGRAM_ID:new v("DRayAUgENGQBKVaX8owNhgzkEDyoHTGVEGHVJT1E9pfH"),CLMM_LOCK_PROGRAM_ID:new v("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),CLMM_LOCK_AUTH_ID:new v("6Aoh8h2Lw2m5UGxYR8AdAL87jTWYeKoxM52mJRzfYwN"),CREATE_CPMM_POOL_PROGRAM:new v("DRaycpLY18LhpbydsBWbVJtxpNv9oXPgjRSfpF2bWpYb"),CREATE_CPMM_POOL_AUTH:new v("CXniRufdq5xL8t8jZAPxsPZDpuudwuJSPWnbcD5Y5Nxq"),CREATE_CPMM_POOL_FEE_ACC:new v("3oE58BKVt8KuYkGxx8zBojugnymWmBiyafWgMrnb6eYy"),LOCK_CPMM_PROGRAM:new v("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),LOCK_CPMM_AUTH:new v("7qWVV8UY2bRJfDLP4s37YzBPKUkVB46DStYJBpYbQzu3"),UTIL1216:v.default,Router:new v("DRaybByLpbUL57LJARs3j8BitTxVfzBg351EaMr5UTCd"),FARM_PROGRAM_ID_V3:new v("DRayWyrLmEW5KEeqs8kdTMMaBabapqagaBC7KWpGtJeZ"),FARM_PROGRAM_ID_V4:new v("Ray1111111111111111111111111111111111111111"),FARM_PROGRAM_ID_V5:new v("DRayiCGSZgku1GTK6rXD6mVDdingXy6APAH1R6R5L2LC"),FARM_PROGRAM_ID_V6:new v("DRayzbYakXs45ELHkzH6vC3fuhQqTAnv5A68gdFuvZyZ"),LAUNCHPAD_PROGRAM:new v("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),LAUNCHPAD_AUTH:new v("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"),LAUNCHPAD_PLATFORM:new v("2Jx4KTDrVSdWNazuGpcA8n3ZLTRGGBDxAWhuKe2Xcj2a"),LAUNCHPAD_CONFIG:new v("7ZR4zD7PYfY2XxoG1Gxcy2EgEeGYrpxrwzPuwdUBssEt"),FEE_DESTINATION_ID:new v("9y8ENuuZ3b19qu