@raydium-io/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
1 lines • 165 kB
JavaScript
var Co=Object.defineProperty,No=Object.defineProperties;var Ro=Object.getOwnPropertyDescriptors;var li=Object.getOwnPropertySymbols;var Lo=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var mi=(i,e,t)=>e in i?Co(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Q=(i,e)=>{for(var t in e||(e={}))Lo.call(e,t)&&mi(i,t,e[t]);if(li)for(var t of li(e))Oo.call(e,t)&&mi(i,t,e[t]);return i},J=(i,e)=>No(i,Ro(e));import{PublicKey as $w,SystemProgram as eh}from"@solana/web3.js";import{createTransferInstruction as nh,TOKEN_PROGRAM_ID as ih,TOKEN_2022_PROGRAM_ID as oh,createAssociatedTokenAccountIdempotentInstruction as rh,createSyncNativeInstruction as uh,createTransferCheckedInstruction as ch}from"@solana/spl-token";import hs from"bn.js";var Bt=9e15,bt=1e9,hn="0123456789abcdef",Qt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Zt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Tn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Bt,maxE:Bt,crypto:!1},bi,nt,X=!0,Jt="[DecimalError] ",ft=Jt+"Invalid argument: ",yi=Jt+"Precision limit exceeded",gi=Jt+"crypto unavailable",Pi="[object Decimal]",Ne=Math.floor,ke=Math.pow,Fo=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Mo=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,vo=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ai=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ue=1e7,_=7,Eo=9007199254740991,Wo=Qt.length-1,Bn=Zt.length-1,h={toStringTag:Pi};h.absoluteValue=h.abs=function(){var i=new this.constructor(this);return i.s<0&&(i.s=1),V(i)};h.ceil=function(){return V(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(i,e){var t,n=this,o=n.constructor;if(i=new o(i),e=new o(e),!i.s||!e.s)return new o(NaN);if(i.gt(e))throw Error(ft+e);return t=n.cmp(i),t<0?i:n.cmp(e)>0?e:new o(n)};h.comparedTo=h.cmp=function(i){var e,t,n,o,r=this,a=r.d,s=(i=new r.constructor(i)).d,u=r.s,c=i.s;if(!a||!s)return!u||!c?NaN:u!==c?u:a===s?0:!a^u<0?1:-1;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(r.e!==i.e)return r.e>i.e^u<0?1:-1;for(n=a.length,o=s.length,e=0,t=n<o?n:o;e<t;++e)if(a[e]!==s[e])return a[e]>s[e]^u<0?1:-1;return n===o?0:n>o^u<0?1:-1};h.cosine=h.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())+_,n.rounding=1,t=Vo(n,Bi(n,t)),n.precision=i,n.rounding=e,V(nt==2||nt==3?t.neg():t,i,e,!0)):new n(1):new n(NaN)};h.cubeRoot=h.cbrt=function(){var i,e,t,n,o,r,a,s,u,c,l=this,p=l.constructor;if(!l.isFinite()||l.isZero())return new p(l);for(X=!1,r=l.s*ke(l.s*l,1/3),!r||Math.abs(r)==1/0?(t=Ke(l.d),i=l.e,(r=(i-t.length+1)%3)&&(t+=r==1||r==-2?"0":"00"),r=ke(t,1/3),i=Ne((i+1)/3)-(i%3==(i<0?-1:2)),r==1/0?t="5e"+i:(t=r.toExponential(),t=t.slice(0,t.indexOf("e")+1)+i),n=new p(t),n.s=l.s):n=new p(r.toString()),a=(i=p.precision)+3;;)if(s=n,u=s.times(s).times(s),c=u.plus(l),n=re(c.plus(l).times(s),c.plus(u),a+2,1),Ke(s.d).slice(0,a)===(t=Ke(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!o&&t=="4999"){if(!o&&(V(s,i+1,0),s.times(s).times(s).eq(l))){n=s;break}a+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(V(n,i+1,1),e=!n.times(n).times(n).eq(l));break}return X=!0,V(n,i,p.rounding,e)};h.decimalPlaces=h.dp=function(){var i,e=this.d,t=NaN;if(e){if(i=e.length-1,t=(i-Ne(this.e/_))*_,i=e[i],i)for(;i%10==0;i/=10)t--;t<0&&(t=0)}return t};h.dividedBy=h.div=function(i){return re(this,new this.constructor(i))};h.dividedToIntegerBy=h.divToInt=function(i){var e=this,t=e.constructor;return V(re(e,new t(i),0,1,1),t.precision,t.rounding)};h.equals=h.eq=function(i){return this.cmp(i)===0};h.floor=function(){return V(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(i){return this.cmp(i)>0};h.greaterThanOrEqualTo=h.gte=function(i){var e=this.cmp(i);return e==1||e===0};h.hyperbolicCosine=h.cosh=function(){var i,e,t,n,o,r=this,a=r.constructor,s=new a(1);if(!r.isFinite())return new a(r.s?1/0:NaN);if(r.isZero())return s;t=a.precision,n=a.rounding,a.precision=t+Math.max(r.e,r.sd())+4,a.rounding=1,o=r.d.length,o<32?(i=Math.ceil(o/3),e=(1/en(4,i)).toString()):(i=16,e="2.3283064365386962890625e-10"),r=It(a,1,r.times(e),new a(1),!0);for(var u,c=i,l=new a(8);c--;)u=r.times(r),r=s.minus(u.times(l.minus(u.times(l))));return V(r,a.precision=t,a.rounding=n,!0)};h.hyperbolicSine=h.sinh=function(){var i,e,t,n,o=this,r=o.constructor;if(!o.isFinite()||o.isZero())return new r(o);if(e=r.precision,t=r.rounding,r.precision=e+Math.max(o.e,o.sd())+4,r.rounding=1,n=o.d.length,n<3)o=It(r,2,o,o,!0);else{i=1.4*Math.sqrt(n),i=i>16?16:i|0,o=o.times(1/en(5,i)),o=It(r,2,o,o,!0);for(var a,s=new r(5),u=new r(16),c=new r(20);i--;)a=o.times(o),o=o.times(s.plus(a.times(u.times(a).plus(c))))}return r.precision=e,r.rounding=t,V(o,e,t,!0)};h.hyperbolicTangent=h.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,re(t.sinh(),t.cosh(),n.precision=i,n.rounding=e)):new n(t.s)};h.inverseCosine=h.acos=function(){var i=this,e=i.constructor,t=i.abs().cmp(1),n=e.precision,o=e.rounding;return t!==-1?t===0?i.isNeg()?je(e,n,o):new e(0):new e(NaN):i.isZero()?je(e,n+4,o).times(.5):(e.precision=n+6,e.rounding=1,i=new e(1).minus(i).div(i.plus(1)).sqrt().atan(),e.precision=n,e.rounding=o,i.times(2))};h.inverseHyperbolicCosine=h.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,X=!1,t=t.times(t).minus(1).sqrt().plus(t),X=!0,n.precision=i,n.rounding=e,t.ln()):new n(t)};h.inverseHyperbolicSine=h.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,X=!1,t=t.times(t).plus(1).sqrt().plus(t),X=!0,n.precision=i,n.rounding=e,t.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var i,e,t,n,o=this,r=o.constructor;return o.isFinite()?o.e>=0?new r(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(i=r.precision,e=r.rounding,n=o.sd(),Math.max(n,i)<2*-o.e-1?V(new r(o),i,e,!0):(r.precision=t=n-o.e,o=re(o.plus(1),new r(1).minus(o),t+i,1),r.precision=i+4,r.rounding=1,o=o.ln(),r.precision=i,r.rounding=e,o.times(.5))):new r(NaN)};h.inverseSine=h.asin=function(){var i,e,t,n,o=this,r=o.constructor;return o.isZero()?new r(o):(e=o.abs().cmp(1),t=r.precision,n=r.rounding,e!==-1?e===0?(i=je(r,t+4,n).times(.5),i.s=o.s,i):new r(NaN):(r.precision=t+6,r.rounding=1,o=o.div(new r(1).minus(o.times(o)).sqrt().plus(1)).atan(),r.precision=t,r.rounding=n,o.times(2)))};h.inverseTangent=h.atan=function(){var i,e,t,n,o,r,a,s,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<=Bn)return a=je(l,p+4,d).times(.25),a.s=c.s,a}else{if(!c.s)return new l(NaN);if(p+4<=Bn)return a=je(l,p+4,d).times(.5),a.s=c.s,a}for(l.precision=s=p+10,l.rounding=1,t=Math.min(28,s/_+2|0),i=t;i;--i)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(X=!1,e=Math.ceil(s/_),n=1,u=c.times(c),a=new l(c),o=c;i!==-1;)if(o=o.times(u),r=a.minus(o.div(n+=2)),o=o.times(u),a=r.plus(o.div(n+=2)),a.d[e]!==void 0)for(i=e;a.d[i]===r.d[i]&&i--;);return t&&(a=a.times(2<<t-1)),X=!0,V(a,l.precision=p,l.rounding=d,!0)};h.isFinite=function(){return!!this.d};h.isInteger=h.isInt=function(){return!!this.d&&Ne(this.e/_)>this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(i){return this.cmp(i)<0};h.lessThanOrEqualTo=h.lte=function(i){return this.cmp(i)<1};h.logarithm=h.log=function(i){var e,t,n,o,r,a,s,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)r=!0;else{for(o=t[0];o%10===0;)o/=10;r=o!==1}if(X=!1,s=p+m,a=dt(c,s),n=e?jt(l,s+10):dt(i,s),u=re(a,n,s,1),Ct(u.d,o=p,d))do if(s+=10,a=dt(c,s),n=e?jt(l,s+10):dt(i,s),u=re(a,n,s,1),!r){+Ke(u.d).slice(o+1,o+15)+1==1e14&&(u=V(u,p+1,0));break}while(Ct(u.d,o+=10,d));return X=!0,V(u,p,d)};h.minus=h.sub=function(i){var e,t,n,o,r,a,s,u,c,l,p,d,m=this,P=m.constructor;if(i=new P(i),!m.d||!i.d)return!m.s||!i.s?i=new P(NaN):m.d?i.s=-i.s:i=new P(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,s=P.precision,u=P.rounding,!c[0]||!d[0]){if(d[0])i.s=-i.s;else if(c[0])i=new P(m);else return new P(u===3?-0:0);return X?V(i,s,u):i}if(t=Ne(i.e/_),l=Ne(m.e/_),c=c.slice(),r=l-t,r){for(p=r<0,p?(e=c,r=-r,a=d.length):(e=d,t=l,a=c.length),n=Math.max(Math.ceil(s/_),a)+2,r>n&&(r=n,e.length=1),e.reverse(),n=r;n--;)e.push(0);e.reverse()}else{for(n=c.length,a=d.length,p=n<a,p&&(a=n),n=0;n<a;n++)if(c[n]!=d[n]){p=c[n]<d[n];break}r=0}for(p&&(e=c,c=d,d=e,i.s=-i.s),a=c.length,n=d.length-a;n>0;--n)c[a++]=0;for(n=d.length;n>r;){if(c[--n]<d[n]){for(o=n;o&&c[--o]===0;)c[o]=Ue-1;--c[o],c[n]+=Ue}c[n]-=d[n]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(i.d=c,i.e=$t(c,t),X?V(i,s,u):i):new P(u===3?-0:0)};h.modulo=h.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]?V(new n(t),n.precision,n.rounding):(X=!1,n.modulo==9?(e=re(t,i.abs(),0,3,1),e.s*=i.s):e=re(t,i,0,n.modulo,1),e=e.times(i),X=!0,t.minus(e))};h.naturalExponential=h.exp=function(){return In(this)};h.naturalLogarithm=h.ln=function(){return dt(this)};h.negated=h.neg=function(){var i=new this.constructor(this);return i.s=-i.s,V(i)};h.plus=h.add=function(i){var e,t,n,o,r,a,s,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,s=d.precision,u=d.rounding,!c[0]||!l[0])return l[0]||(i=new d(p)),X?V(i,s,u):i;if(r=Ne(p.e/_),n=Ne(i.e/_),c=c.slice(),o=r-n,o){for(o<0?(t=c,o=-o,a=l.length):(t=l,n=r,a=c.length),r=Math.ceil(s/_),a=r>a?r+1:a+1,o>a&&(o=a,t.length=1),t.reverse();o--;)t.push(0);t.reverse()}for(a=c.length,o=l.length,a-o<0&&(o=a,t=l,l=c,c=t),e=0;o;)e=(c[--o]=c[o]+l[o]+e)/Ue|0,c[o]%=Ue;for(e&&(c.unshift(e),++n),a=c.length;c[--a]==0;)c.pop();return i.d=c,i.e=$t(c,n),X?V(i,s,u):i};h.precision=h.sd=function(i){var e,t=this;if(i!==void 0&&i!==!!i&&i!==1&&i!==0)throw Error(ft+i);return t.d?(e=ki(t.d),i&&t.e+1>e&&(e=t.e+1)):e=NaN,e};h.round=function(){var i=this,e=i.constructor;return V(new e(i),i.e+1,e.rounding)};h.sine=h.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())+_,n.rounding=1,t=_o(n,Bi(n,t)),n.precision=i,n.rounding=e,V(nt>2?t.neg():t,i,e,!0)):new n(NaN)};h.squareRoot=h.sqrt=function(){var i,e,t,n,o,r,a=this,s=a.d,u=a.e,c=a.s,l=a.constructor;if(c!==1||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(X=!1,c=Math.sqrt(+a),c==0||c==1/0?(e=Ke(s),(e.length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=Ne((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(r=n,n=r.plus(re(a,r,t+2,1)).times(.5),Ke(r.d).slice(0,t)===(e=Ke(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!o&&e=="4999"){if(!o&&(V(r,u+1,0),r.times(r).eq(a))){n=r;break}t+=4,o=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(V(n,u+1,1),i=!n.times(n).eq(a));break}return X=!0,V(n,u,l.rounding,i)};h.tangent=h.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=re(t,new n(1).minus(t.times(t)).sqrt(),i+10,0),n.precision=i,n.rounding=e,V(nt==2||nt==4?t.neg():t,i,e,!0)):new n(NaN)};h.times=h.mul=function(i){var e,t,n,o,r,a,s,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=Ne(l.e/_)+Ne(i.e/_),u=d.length,c=m.length,u<c&&(r=d,d=m,m=r,a=u,u=c,c=a),r=[],a=u+c,n=a;n--;)r.push(0);for(n=c;--n>=0;){for(e=0,o=u+n;o>n;)s=r[o]+m[n]*d[o-n-1]+e,r[o--]=s%Ue|0,e=s/Ue|0;r[o]=(r[o]+e)%Ue|0}for(;!r[--a];)r.pop();return e?++t:r.shift(),i.d=r,i.e=$t(r,t),X?V(i,p.precision,p.rounding):i};h.toBinary=function(i,e){return xn(this,2,i,e)};h.toDecimalPlaces=h.toDP=function(i,e){var t=this,n=t.constructor;return t=new n(t),i===void 0?t:(Fe(i,0,bt),e===void 0?e=n.rounding:Fe(e,0,8),V(t,i+t.e+1,e))};h.toExponential=function(i,e){var t,n=this,o=n.constructor;return i===void 0?t=Je(n,!0):(Fe(i,0,bt),e===void 0?e=o.rounding:Fe(e,0,8),n=V(new o(n),i+1,e),t=Je(n,!0,i+1)),n.isNeg()&&!n.isZero()?"-"+t:t};h.toFixed=function(i,e){var t,n,o=this,r=o.constructor;return i===void 0?t=Je(o):(Fe(i,0,bt),e===void 0?e=r.rounding:Fe(e,0,8),n=V(new r(o),i+o.e+1,e),t=Je(n,!1,i+n.e+1)),o.isNeg()&&!o.isZero()?"-"+t:t};h.toFraction=function(i){var e,t,n,o,r,a,s,u,c,l,p,d,m=this,P=m.d,f=m.constructor;if(!P)return new f(m);if(c=t=new f(1),n=u=new f(0),e=new f(n),r=e.e=ki(P)-m.e-1,a=r%_,e.d[0]=ke(10,a<0?_+a:a),i==null)i=r>0?e:c;else{if(s=new f(i),!s.isInt()||s.lt(c))throw Error(ft+s);i=s.gt(e)?r>0?e:c:s}for(X=!1,s=new f(Ke(P)),l=f.precision,f.precision=r=P.length*_*2;p=re(s,e,0,1,1),o=t.plus(p.times(n)),o.cmp(i)!=1;)t=n,n=o,o=c,c=u.plus(p.times(o)),u=o,o=e,e=s.minus(p.times(o)),s=o;return o=re(i.minus(t),n,0,1,1),u=u.plus(o.times(c)),t=t.plus(o.times(n)),u.s=c.s=m.s,d=re(c,n,r,1).minus(m).abs().cmp(re(u,t,r,1).minus(m).abs())<1?[c,n]:[u,t],f.precision=l,X=!0,d};h.toHexadecimal=h.toHex=function(i,e){return xn(this,16,i,e)};h.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:Fe(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]?(X=!1,t=re(t,i,0,e,1).times(i),X=!0,V(t)):(i.s=t.s,t=i),t};h.toNumber=function(){return+this};h.toOctal=function(i,e){return xn(this,8,i,e)};h.toPower=h.pow=function(i){var e,t,n,o,r,a,s=this,u=s.constructor,c=+(i=new u(i));if(!s.d||!i.d||!s.d[0]||!i.d[0])return new u(ke(+s,c));if(s=new u(s),s.eq(1))return s;if(n=u.precision,r=u.rounding,i.eq(1))return V(s,n,r);if(e=Ne(i.e/_),e>=i.d.length-1&&(t=c<0?-c:c)<=Eo)return o=wi(u,s,t,n),i.s<0?new u(1).div(o):V(o,n,r);if(a=s.s,a<0){if(e<i.d.length-1)return new u(NaN);if((i.d[e]&1)==0&&(a=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=a,s}return t=ke(+s,c),e=t==0||!isFinite(t)?Ne(c*(Math.log("0."+Ke(s.d))/Math.LN10+s.e+1)):new u(t+"").e,e>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(X=!1,u.rounding=s.s=1,t=Math.min(12,(e+"").length),o=In(i.times(dt(s,n+t)),n),o.d&&(o=V(o,n+5,1),Ct(o.d,n,r)&&(e=n+10,o=V(In(i.times(dt(s,e+t)),e),e+5,1),+Ke(o.d).slice(n+1,n+15)+1==1e14&&(o=V(o,n+1,0)))),o.s=a,X=!0,u.rounding=r,V(o,n,r))};h.toPrecision=function(i,e){var t,n=this,o=n.constructor;return i===void 0?t=Je(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(Fe(i,1,bt),e===void 0?e=o.rounding:Fe(e,0,8),n=V(new o(n),i,e),t=Je(n,i<=n.e||n.e<=o.toExpNeg,i)),n.isNeg()&&!n.isZero()?"-"+t:t};h.toSignificantDigits=h.toSD=function(i,e){var t=this,n=t.constructor;return i===void 0?(i=n.precision,e=n.rounding):(Fe(i,1,bt),e===void 0?e=n.rounding:Fe(e,0,8)),V(new n(t),i,e)};h.toString=function(){var i=this,e=i.constructor,t=Je(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()&&!i.isZero()?"-"+t:t};h.truncated=h.trunc=function(){return V(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var i=this,e=i.constructor,t=Je(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()?"-"+t:t};function Ke(i){var e,t,n,o=i.length-1,r="",a=i[0];if(o>0){for(r+=a,e=1;e<o;e++)n=i[e]+"",t=_-n.length,t&&(r+=pt(t)),r+=n;a=i[e],n=a+"",t=_-n.length,t&&(r+=pt(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return r+a}function Fe(i,e,t){if(i!==~~i||i<e||i>t)throw Error(ft+i)}function Ct(i,e,t,n){var o,r,a,s;for(r=i[0];r>=10;r/=10)--e;return--e<0?(e+=_,o=0):(o=Math.ceil((e+1)/_),e%=_),r=ke(10,_-e),s=i[o]%r|0,n==null?e<3?(e==0?s=s/100|0:e==1&&(s=s/10|0),a=t<4&&s==99999||t>3&&s==49999||s==5e4||s==0):a=(t<4&&s+1==r||t>3&&s+1==r/2)&&(i[o+1]/r/100|0)==ke(10,e-2)-1||(s==r/2||s==0)&&(i[o+1]/r/100|0)==0:e<4?(e==0?s=s/1e3|0:e==1?s=s/100|0:e==2&&(s=s/10|0),a=(n||t<4)&&s==9999||!n&&t>3&&s==4999):a=((n||t<4)&&s+1==r||!n&&t>3&&s+1==r/2)&&(i[o+1]/r/1e3|0)==ke(10,e-3)-1,a}function Yt(i,e,t){for(var n,o=[0],r,a=0,s=i.length;a<s;){for(r=o.length;r--;)o[r]*=e;for(o[0]+=hn.indexOf(i.charAt(a++)),n=0;n<o.length;n++)o[n]>t-1&&(o[n+1]===void 0&&(o[n+1]=0),o[n+1]+=o[n]/t|0,o[n]%=t)}return o.reverse()}function Vo(i,e){var t,n,o;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),o=(1/en(4,t)).toString()):(t=16,o="2.3283064365386962890625e-10"),i.precision+=t,e=It(i,1,e.times(o),new i(1));for(var r=t;r--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return i.precision-=t,e}var re=function(){function i(n,o,r){var a,s=0,u=n.length;for(n=n.slice();u--;)a=n[u]*o+s,n[u]=a%r|0,s=a/r|0;return s&&n.unshift(s),n}function e(n,o,r,a){var s,u;if(r!=a)u=r>a?1:-1;else for(s=u=0;s<r;s++)if(n[s]!=o[s]){u=n[s]>o[s]?1:-1;break}return u}function t(n,o,r,a){for(var s=0;r--;)n[r]-=s,s=n[r]<o[r]?1:0,n[r]=s*a+n[r]-o[r];for(;!n[0]&&n.length>1;)n.shift()}return function(n,o,r,a,s,u){var c,l,p,d,m,P,f,b,g,B,T,R,E,I,F,M,q,C,W,ye,ae=n.constructor,Ie=n.s==o.s?1:-1,de=n.d,te=o.d;if(!de||!de[0]||!te||!te[0])return new ae(!n.s||!o.s||(de?te&&de[0]==te[0]:!te)?NaN:de&&de[0]==0||!te?Ie*0:Ie/0);for(u?(m=1,l=n.e-o.e):(u=Ue,m=_,l=Ne(n.e/m)-Ne(o.e/m)),W=te.length,q=de.length,g=new ae(Ie),B=g.d=[],p=0;te[p]==(de[p]||0);p++);if(te[p]>(de[p]||0)&&l--,r==null?(I=r=ae.precision,a=ae.rounding):s?I=r+(n.e-o.e)+1:I=r,I<0)B.push(1),P=!0;else{if(I=I/m+2|0,p=0,W==1){for(d=0,te=te[0],I++;(p<q||d)&&I--;p++)F=d*u+(de[p]||0),B[p]=F/te|0,d=F%te|0;P=d||p<q}else{for(d=u/(te[0]+1)|0,d>1&&(te=i(te,d,u),de=i(de,d,u),W=te.length,q=de.length),M=W,T=de.slice(0,W),R=T.length;R<W;)T[R++]=0;ye=te.slice(),ye.unshift(0),C=te[0],te[1]>=u/2&&++C;do d=0,c=e(te,T,W,R),c<0?(E=T[0],W!=R&&(E=E*u+(T[1]||0)),d=E/C|0,d>1?(d>=u&&(d=u-1),f=i(te,d,u),b=f.length,R=T.length,c=e(f,T,b,R),c==1&&(d--,t(f,W<b?ye:te,b,u))):(d==0&&(c=d=1),f=te.slice()),b=f.length,b<R&&f.unshift(0),t(T,f,R,u),c==-1&&(R=T.length,c=e(te,T,W,R),c<1&&(d++,t(T,W<R?ye:te,R,u))),R=T.length):c===0&&(d++,T=[0]),B[p++]=d,c&&T[0]?T[R++]=de[M]||0:(T=[de[M]],R=1);while((M++<q||T[0]!==void 0)&&I--);P=T[0]!==void 0}B[0]||B.shift()}if(m==1)g.e=l,bi=P;else{for(p=1,d=B[0];d>=10;d/=10)p++;g.e=p+l*m-1,V(g,s?r+g.e+1:r,a,P)}return g}}();function V(i,e,t,n){var o,r,a,s,u,c,l,p,d,m=i.constructor;e:if(e!=null){if(p=i.d,!p)return i;for(o=1,s=p[0];s>=10;s/=10)o++;if(r=e-o,r<0)r+=_,a=e,l=p[d=0],u=l/ke(10,o-a-1)%10|0;else if(d=Math.ceil((r+1)/_),s=p.length,d>=s)if(n){for(;s++<=d;)p.push(0);l=u=0,o=1,r%=_,a=r-_+1}else break e;else{for(l=s=p[d],o=1;s>=10;s/=10)o++;r%=_,a=r-_+o,u=a<0?0:l/ke(10,o-a-1)%10|0}if(n=n||e<0||p[d+1]!==void 0||(a<0?l:l%ke(10,o-a-1)),c=t<4?(u||n)&&(t==0||t==(i.s<0?3:2)):u>5||u==5&&(t==4||n||t==6&&(r>0?a>0?l/ke(10,o-a):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]=ke(10,(_-e%_)%_),i.e=-e||0):p[0]=i.e=0,i;if(r==0?(p.length=d,s=1,d--):(p.length=d+1,s=ke(10,_-r),p[d]=a>0?(l/ke(10,o-a)%ke(10,a)|0)*s:0),c)for(;;)if(d==0){for(r=1,a=p[0];a>=10;a/=10)r++;for(a=p[0]+=s,s=1;a>=10;a/=10)s++;r!=s&&(i.e++,p[0]==Ue&&(p[0]=1));break}else{if(p[d]+=s,p[d]!=Ue)break;p[d--]=0,s=1}for(r=p.length;p[--r]===0;)p.pop()}return X&&(i.e>m.maxE?(i.d=null,i.e=NaN):i.e<m.minE&&(i.e=0,i.d=[0])),i}function Je(i,e,t){if(!i.isFinite())return Ti(i);var n,o=i.e,r=Ke(i.d),a=r.length;return e?(t&&(n=t-a)>0?r=r.charAt(0)+"."+r.slice(1)+pt(n):a>1&&(r=r.charAt(0)+"."+r.slice(1)),r=r+(i.e<0?"e":"e+")+i.e):o<0?(r="0."+pt(-o-1)+r,t&&(n=t-a)>0&&(r+=pt(n))):o>=a?(r+=pt(o+1-a),t&&(n=t-o-1)>0&&(r=r+"."+pt(n))):((n=o+1)<a&&(r=r.slice(0,n)+"."+r.slice(n)),t&&(n=t-a)>0&&(o+1===a&&(r+="."),r+=pt(n))),r}function $t(i,e){var t=i[0];for(e*=_;t>=10;t/=10)e++;return e}function jt(i,e,t){if(e>Wo)throw X=!0,t&&(i.precision=t),Error(yi);return V(new i(Qt),e,1,!0)}function je(i,e,t){if(e>Bn)throw Error(yi);return V(new i(Zt),e,t,!0)}function ki(i){var e=i.length-1,t=e*_+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 pt(i){for(var e="";i--;)e+="0";return e}function wi(i,e,t,n){var o,r=new i(1),a=Math.ceil(n/_+4);for(X=!1;;){if(t%2&&(r=r.times(e),di(r.d,a)&&(o=!0)),t=Ne(t/2),t===0){t=r.d.length-1,o&&r.d[t]===0&&++r.d[t];break}e=e.times(e),di(e.d,a)}return X=!0,r}function pi(i){return i.d[i.d.length-1]&1}function hi(i,e,t){for(var n,o,r=new i(e[0]),a=0;++a<e.length;){if(o=new i(e[a]),!o.s){r=o;break}n=r.cmp(o),(n===t||n===0&&r.s===t)&&(r=o)}return r}function In(i,e){var t,n,o,r,a,s,u,c=0,l=0,p=0,d=i.constructor,m=d.rounding,P=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?(X=!1,u=P):u=e,s=new d(.03125);i.e>-2;)i=i.times(s),p+=5;for(n=Math.log(ke(2,p))/Math.LN10*2+5|0,u+=n,t=r=a=new d(1),d.precision=u;;){if(r=V(r.times(i),u,1),t=t.times(++l),s=a.plus(re(r,t,u,1)),Ke(s.d).slice(0,u)===Ke(a.d).slice(0,u)){for(o=p;o--;)a=V(a.times(a),u,1);if(e==null)if(c<3&&Ct(a.d,u-n,m,c))d.precision=u+=10,t=r=s=new d(1),l=0,c++;else return V(a,d.precision=P,m,X=!0);else return d.precision=P,a}a=s}}function dt(i,e){var t,n,o,r,a,s,u,c,l,p,d,m=1,P=10,f=i,b=f.d,g=f.constructor,B=g.rounding,T=g.precision;if(f.s<0||!b||!b[0]||!f.e&&b[0]==1&&b.length==1)return new g(b&&!b[0]?-1/0:f.s!=1?NaN:b?0:f);if(e==null?(X=!1,l=T):l=e,g.precision=l+=P,t=Ke(b),n=t.charAt(0),Math.abs(r=f.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)f=f.times(i),t=Ke(f.d),n=t.charAt(0),m++;r=f.e,n>1?(f=new g("0."+t),r++):f=new g(n+"."+t.slice(1))}else return c=jt(g,l+2,T).times(r+""),f=dt(new g(n+"."+t.slice(1)),l-P).plus(c),g.precision=T,e==null?V(f,T,B,X=!0):f;for(p=f,u=a=f=re(f.minus(1),f.plus(1),l,1),d=V(f.times(f),l,1),o=3;;){if(a=V(a.times(d),l,1),c=u.plus(re(a,new g(o),l,1)),Ke(c.d).slice(0,l)===Ke(u.d).slice(0,l))if(u=u.times(2),r!==0&&(u=u.plus(jt(g,l+2,T).times(r+""))),u=re(u,new g(m),l,1),e==null)if(Ct(u.d,l-P,B,s))g.precision=l+=P,c=a=f=re(p.minus(1),p.plus(1),l,1),d=V(f.times(f),l,1),o=s=1;else return V(u,g.precision=T,B,X=!0);else return g.precision=T,u;u=c,o+=2}}function Ti(i){return String(i.s*i.s/0)}function Ht(i,e){var t,n,o;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(o=e.length;e.charCodeAt(o-1)===48;--o);if(e=e.slice(n,o),e){if(o-=n,i.e=t=t-n-1,i.d=[],n=(t+1)%_,t<0&&(n+=_),n<o){for(n&&i.d.push(+e.slice(0,n)),o-=_;n<o;)i.d.push(+e.slice(n,n+=_));e=e.slice(n),n=_-e.length}else n-=o;for(;n--;)e+="0";i.d.push(+e),X&&(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 Do(i,e){var t,n,o,r,a,s,u,c,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Ai.test(e))return Ht(i,e)}else if(e==="Infinity"||e==="NaN")return+e||(i.s=NaN),i.e=NaN,i.d=null,i;if(Mo.test(e))t=16,e=e.toLowerCase();else if(Fo.test(e))t=2;else if(vo.test(e))t=8;else throw Error(ft+e);for(r=e.search(/p/i),r>0?(u=+e.slice(r+1),e=e.substring(2,r)):e=e.slice(2),r=e.indexOf("."),a=r>=0,n=i.constructor,a&&(e=e.replace(".",""),s=e.length,r=s-r,o=wi(n,new n(t),r,r*2)),c=Yt(e,t,Ue),l=c.length-1,r=l;c[r]===0;--r)c.pop();return r<0?new n(i.s*0):(i.e=$t(c,l),i.d=c,X=!1,a&&(i=re(i,o,s*4)),u&&(i=i.times(Math.abs(u)<54?ke(2,u):Nt.pow(2,u))),X=!0,i)}function _o(i,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:It(i,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/en(5,t)),e=It(i,2,e,e);for(var o,r=new i(5),a=new i(16),s=new i(20);t--;)o=e.times(e),e=e.times(r.plus(o.times(a.times(o).minus(s))));return e}function It(i,e,t,n,o){var r,a,s,u,c=1,l=i.precision,p=Math.ceil(l/_);for(X=!1,u=t.times(t),s=new i(n);;){if(a=re(s.times(u),new i(e++*e++),l,1),s=o?n.plus(a):n.minus(a),n=re(a.times(u),new i(e++*e++),l,1),a=s.plus(n),a.d[p]!==void 0){for(r=p;a.d[r]===s.d[r]&&r--;);if(r==-1)break}r=s,s=n,n=a,a=r,c++}return X=!0,a.d.length=p+1,a}function en(i,e){for(var t=i;--e;)t*=i;return t}function Bi(i,e){var t,n=e.s<0,o=je(i,i.precision,1),r=o.times(.5);if(e=e.abs(),e.lte(r))return nt=n?4:1,e;if(t=e.divToInt(o),t.isZero())nt=n?3:2;else{if(e=e.minus(t.times(o)),e.lte(r))return nt=pi(t)?n?2:3:n?4:1,e;nt=pi(t)?n?1:4:n?3:2}return e.minus(o).abs()}function xn(i,e,t,n){var o,r,a,s,u,c,l,p,d,m=i.constructor,P=t!==void 0;if(P?(Fe(t,1,bt),n===void 0?n=m.rounding:Fe(n,0,8)):(t=m.precision,n=m.rounding),!i.isFinite())l=Ti(i);else{for(l=Je(i),a=l.indexOf("."),P?(o=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):o=e,a>=0&&(l=l.replace(".",""),d=new m(1),d.e=l.length-a,d.d=Yt(Je(d),10,o),d.e=d.d.length),p=Yt(l,10,o),r=u=p.length;p[--u]==0;)p.pop();if(!p[0])l=P?"0p+0":"0";else{if(a<0?r--:(i=new m(i),i.d=p,i.e=r,i=re(i,d,t,n,0,o),p=i.d,r=i.e,c=bi),a=p[t],s=o/2,c=c||p[t+1]!==void 0,c=n<4?(a!==void 0||c)&&(n===0||n===(i.s<0?3:2)):a>s||a===s&&(n===4||c||n===6&&p[t-1]&1||n===(i.s<0?8:7)),p.length=t,c)for(;++p[--t]>o-1;)p[t]=0,t||(++r,p.unshift(1));for(u=p.length;!p[u-1];--u);for(a=0,l="";a<u;a++)l+=hn.charAt(p[a]);if(P){if(u>1)if(e==16||e==8){for(a=e==16?4:3,--u;u%a;u++)l+="0";for(p=Yt(l,o,e),u=p.length;!p[u-1];--u);for(a=1,l="1.";a<u;a++)l+=hn.charAt(p[a])}else l=l.charAt(0)+"."+l.slice(1);l=l+(r<0?"p":"p+")+r}else if(r<0){for(;++r;)l="0"+l;l="0."+l}else if(++r>u)for(r-=u;r--;)l+="0";else r<u&&(l=l.slice(0,r)+"."+l.slice(r))}l=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return i.s<0?"-"+l:l}function di(i,e){if(i.length>e)return i.length=e,!0}function qo(i){return new this(i).abs()}function Go(i){return new this(i).acos()}function Uo(i){return new this(i).acosh()}function Xo(i,e){return new this(i).plus(e)}function zo(i){return new this(i).asin()}function Yo(i){return new this(i).asinh()}function Ho(i){return new this(i).atan()}function Qo(i){return new this(i).atanh()}function Zo(i,e){i=new this(i),e=new this(e);var t,n=this.precision,o=this.rounding,r=n+4;return!i.s||!e.s?t=new this(NaN):!i.d&&!e.d?(t=je(this,r,1).times(e.s>0?.25:.75),t.s=i.s):!e.d||i.isZero()?(t=e.s<0?je(this,n,o):new this(0),t.s=i.s):!i.d||e.isZero()?(t=je(this,r,1).times(.5),t.s=i.s):e.s<0?(this.precision=r,this.rounding=1,t=this.atan(re(i,e,r,1)),e=je(this,r,1),this.precision=n,this.rounding=o,t=i.s<0?t.minus(e):t.plus(e)):t=this.atan(re(i,e,r,1)),t}function jo(i){return new this(i).cbrt()}function Jo(i){return V(i=new this(i),i.e+1,2)}function $o(i,e,t){return new this(i).clamp(e,t)}function er(i){if(!i||typeof i!="object")throw Error(Jt+"Object expected");var e,t,n,o=i.defaults===!0,r=["precision",1,bt,"rounding",0,8,"toExpNeg",-Bt,0,"toExpPos",0,Bt,"maxE",0,Bt,"minE",-Bt,0,"modulo",0,9];for(e=0;e<r.length;e+=3)if(t=r[e],o&&(this[t]=Tn[t]),(n=i[t])!==void 0)if(Ne(n)===n&&n>=r[e+1]&&n<=r[e+2])this[t]=n;else throw Error(ft+t+": "+n);if(t="crypto",o&&(this[t]=Tn[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(gi);else this[t]=!1;else throw Error(ft+t+": "+n);return this}function tr(i){return new this(i).cos()}function nr(i){return new this(i).cosh()}function Ii(i){var e,t,n;function o(r){var a,s,u,c=this;if(!(c instanceof o))return new o(r);if(c.constructor=o,fi(r)){c.s=r.s,X?!r.d||r.e>o.maxE?(c.e=NaN,c.d=null):r.e<o.minE?(c.e=0,c.d=[0]):(c.e=r.e,c.d=r.d.slice()):(c.e=r.e,c.d=r.d?r.d.slice():r.d);return}if(u=typeof r,u==="number"){if(r===0){c.s=1/r<0?-1:1,c.e=0,c.d=[0];return}if(r<0?(r=-r,c.s=-1):c.s=1,r===~~r&&r<1e7){for(a=0,s=r;s>=10;s/=10)a++;X?a>o.maxE?(c.e=NaN,c.d=null):a<o.minE?(c.e=0,c.d=[0]):(c.e=a,c.d=[r]):(c.e=a,c.d=[r]);return}if(r*0!==0){r||(c.s=NaN),c.e=NaN,c.d=null;return}return Ht(c,r.toString())}if(u==="string")return(s=r.charCodeAt(0))===45?(r=r.slice(1),c.s=-1):(s===43&&(r=r.slice(1)),c.s=1),Ai.test(r)?Ht(c,r):Do(c,r);if(u==="bigint")return r<0?(r=-r,c.s=-1):c.s=1,Ht(c,r.toString());throw Error(ft+r)}if(o.prototype=h,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=er,o.clone=Ii,o.isDecimal=fi,o.abs=qo,o.acos=Go,o.acosh=Uo,o.add=Xo,o.asin=zo,o.asinh=Yo,o.atan=Ho,o.atanh=Qo,o.atan2=Zo,o.cbrt=jo,o.ceil=Jo,o.clamp=$o,o.cos=tr,o.cosh=nr,o.div=ir,o.exp=or,o.floor=rr,o.hypot=ar,o.ln=sr,o.log=ur,o.log10=lr,o.log2=cr,o.max=mr,o.min=pr,o.mod=dr,o.mul=fr,o.pow=br,o.random=yr,o.round=gr,o.sign=Pr,o.sin=Ar,o.sinh=kr,o.sqrt=wr,o.sub=hr,o.sum=Tr,o.tan=Br,o.tanh=Ir,o.trunc=xr,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 o.config(i),o}function ir(i,e){return new this(i).div(e)}function or(i){return new this(i).exp()}function rr(i){return V(i=new this(i),i.e+1,3)}function ar(){var i,e,t=new this(0);for(X=!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 X=!0,new this(1/0);t=e}return X=!0,t.sqrt()}function fi(i){return i instanceof Nt||i&&i.toStringTag===Pi||!1}function sr(i){return new this(i).ln()}function ur(i,e){return new this(i).log(e)}function cr(i){return new this(i).log(2)}function lr(i){return new this(i).log(10)}function mr(){return hi(this,arguments,-1)}function pr(){return hi(this,arguments,1)}function dr(i,e){return new this(i).mod(e)}function fr(i,e){return new this(i).mul(e)}function br(i,e){return new this(i).pow(e)}function yr(i){var e,t,n,o,r=0,a=new this(1),s=[];if(i===void 0?i=this.precision:Fe(i,1,bt),n=Math.ceil(i/_),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));r<n;)o=e[r],o>=429e7?e[r]=crypto.getRandomValues(new Uint32Array(1))[0]:s[r++]=o%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);r<n;)o=e[r]+(e[r+1]<<8)+(e[r+2]<<16)+((e[r+3]&127)<<24),o>=214e7?crypto.randomBytes(4).copy(e,r):(s.push(o%1e7),r+=4);r=n/4}else throw Error(gi);else for(;r<n;)s[r++]=Math.random()*1e7|0;for(n=s[--r],i%=_,n&&i&&(o=ke(10,_-i),s[r]=(n/o|0)*o);s[r]===0;r--)s.pop();if(r<0)t=0,s=[0];else{for(t=-1;s[0]===0;t-=_)s.shift();for(n=1,o=s[0];o>=10;o/=10)n++;n<_&&(t-=_-n)}return a.e=t,a.d=s,a}function gr(i){return V(i=new this(i),i.e+1,this.rounding)}function Pr(i){return i=new this(i),i.d?i.d[0]?i.s:0*i.s:i.s||NaN}function Ar(i){return new this(i).sin()}function kr(i){return new this(i).sinh()}function wr(i){return new this(i).sqrt()}function hr(i,e){return new this(i).sub(e)}function Tr(){var i=0,e=arguments,t=new this(e[i]);for(X=!1;t.s&&++i<e.length;)t=t.plus(e[i]);return X=!0,V(t,this.precision,this.rounding)}function Br(i){return new this(i).tan()}function Ir(i){return new this(i).tanh()}function xr(i){return V(i=new this(i),i.e+1,1)}h[Symbol.for("nodejs.util.inspect.custom")]=h.toString;h[Symbol.toStringTag]="Decimal";var Nt=h.constructor=Ii(Tn);Qt=new Nt(Qt);Zt=new Nt(Zt);var O=Nt;import{PublicKey as Cr}from"@solana/web3.js";import{get as xi,set as Sr}from"lodash";var Sn=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}},Si={},Kr={};function se(i){let e=xi(Si,i);if(!e){let t=xi(Kr,i);e=new Sn({name:i,logLevel:t}),Sr(Si,i,e)}return e}import{MINT_SIZE as Fs,TOKEN_PROGRAM_ID as Ms,getTransferFeeConfig as vs,unpackMint as Es}from"@solana/spl-token";var Kn=se("Raydium_accountInfo_util");async function yt(i,e,t){let{batchRequest:n,commitment:o="confirmed",chunkCount:r=100}=Q({batchRequest:!1},t),a=Cn(e,r),s=new Array(a.length).fill([]);if(n){let u=a.map(p=>{let d=i._buildArgs([p.map(m=>m.toBase58())],o,"base64");return{methodName:"getMultipleAccounts",args:d}}),c=Cn(u,10);s=(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:P,lamports:f,owner:b,rentEpoch:g}=d;return m.length!==2&&m[1]!=="base64"&&Kn.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(m[0],"base64"),executable:P,lamports:f,owner:new Cr(b),rentEpoch:g}}return null})))}else try{s=await Promise.all(a.map(u=>i.getMultipleAccountsInfo(u,o)))}catch(u){u instanceof Error&&Kn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${u.message}`)}return s.flat()}async function xt(i,e,t){let n=await yt(i,e.map(o=>o.pubkey),t);return e.map((o,r)=>J(Q({},o),{accountInfo:n[r]}))}import at from"bn.js";import Er from"big.js";import on from"bn.js";import Nr from"toformat";var Rr=Nr,Lt=Rr;import nn from"big.js";import Or from"bn.js";import Fr from"decimal.js-light";import Ot from"bn.js";var Ki=9007199254740991;function ue(i){let e=se("Raydium_parseBigNumberish");if(i instanceof Ot)return i;if(typeof i=="string"){if(i.match(/^-?[0-9]+$/))return new Ot(i);e.logWithError(`invalid BigNumberish string: ${i}`)}return typeof i=="number"?(i%1&&e.logWithError(`BigNumberish number underflow: ${i}`),(i>=Ki||i<=-Ki)&&e.logWithError(`BigNumberish number overflow: ${i}`),new Ot(String(i))):typeof i=="bigint"?new Ot(i.toString()):(e.error(`invalid BigNumberish value: ${i}`),new Ot(0))}var tn=se("module/fraction"),Nn=Lt(nn),Ft=Lt(Fr),Mr={[0]:Ft.ROUND_DOWN,[1]:Ft.ROUND_HALF_UP,[2]:Ft.ROUND_UP},vr={[0]:nn.roundDown,[1]:nn.roundHalfUp,[2]:nn.roundUp},$=class{constructor(e,t=new Or(1)){this.numerator=ue(e),this.denominator=ue(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new $(this.denominator,this.numerator)}add(e){let t=e instanceof $?e:new $(ue(e));return this.denominator.eq(t.denominator)?new $(this.numerator.add(t.numerator),this.denominator):new $(this.numerator.mul(t.denominator).add(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}sub(e){let t=e instanceof $?e:new $(ue(e));return this.denominator.eq(t.denominator)?new $(this.numerator.sub(t.numerator),this.denominator):new $(this.numerator.mul(t.denominator).sub(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}mul(e){let t=e instanceof $?e:new $(ue(e));return new $(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof $?e:new $(ue(e));return new $(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},n=1){Number.isInteger(e)||tn.logWithError(`${e} is not an integer.`),e<=0&&tn.logWithError(`${e} is not positive.`),Ft.set({precision:e+1,rounding:Mr[n]});let o=new Ft(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return o.toFormat(o.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},n=1){return Number.isInteger(e)||tn.logWithError(`${e} is not an integer.`),e<0&&tn.logWithError(`${e} is negative.`),Nn.DP=e,Nn.RM=vr[n]||1,new Nn(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var Wr=se("Raydium_amount"),Ci=Lt(Er);function Vr(i,e){let t="0",n="0";if(i.includes(".")){let o=i.split(".");o.length===2?([t,n]=o,n=n.padEnd(e,"0")):Wr.logWithError(`invalid number string, num: ${i}`)}else t=i;return[t,n.slice(0,e)||n]}var we=class extends ${constructor(t,n,o=!0,r){let a=new on(0),s=Rn.pow(new on(t.decimals));if(o)a=ue(n);else{let u=new on(0),c=new on(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,p]=Vr(n.toString(),t.decimals);u=ue(l),c=ue(p)}u=u.mul(s),a=u.add(c)}super(a,s);this.logger=se(r||"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 we(this.token,this.raw.add(t.raw))}subtract(t){return this.token.equals(t.token)||this.logger.logWithError("sub token not equals"),new we(this.token,this.raw.sub(t.raw))}toSignificant(t=this.token.decimals,n,o=0){return super.toSignificant(t,n,o)}toFixed(t=this.token.decimals,n,o=0){return t>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(t,n,o)}toExact(t={groupSeparator:""}){return Ci.DP=this.token.decimals,new Ci(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)}};import{PublicKey as Dr}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Ni}from"@solana/spl-token";var Ln={chainId:101,address:Dr.default.toBase58(),programId:Ni.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},it={chainId:101,address:"So11111111111111111111111111111111111111112",programId:Ni.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 Mn}from"@solana/web3.js";import{PublicKey as me,SystemProgram as Ri,SYSVAR_RENT_PUBKEY as _r}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as qr}from"@solana/spl-token";function A({pubkey:i,isSigner:e=!1,isWritable:t=!0}){return{pubkey:i,isWritable:t,isSigner:e}}var bu=[A({pubkey:qr,isWritable:!1}),A({pubkey:Ri.programId,isWritable:!1}),A({pubkey:_r,isWritable:!1})];function On({publicKey:i,transformSol:e}){let t=Fn(i.toString());if(t instanceof me)return e&&t.equals(Mt)?Rt:t;if(e&&t.toString()===Mt.toBase58())return Rt;if(typeof t=="string"){if(t===me.default.toBase58())return me.default;try{return new me(t)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function Fn(i){try{return new me(i)}catch{return i}}var rn=new me("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),gt=new me("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Xe=new me("SysvarRent111111111111111111111111111111111"),yu=new me("SysvarC1ock11111111111111111111111111111111"),ot=new me("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),gu=new me("Sysvar1nstructions1111111111111111111111111"),Gr=Ri.programId,Pu=new me("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),Au=new me("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),ku=new me("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),wu=new me("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),hu=new me("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),Tu=new me("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),Bu=new me("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),Iu=new me("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),xu=new me("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Su=new me("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Ku=new me("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),Rt=new me("So11111111111111111111111111111111111111112"),Mt=me.default;function St(i){return On({publicKey:i,transformSol:!0})}var vn=class{constructor({mint:e,decimals:t,symbol:n,name:o,skipMint:r=!1,isToken2022:a=!1}){if(e===Mt.toBase58()||e instanceof Mn&&Mt.equals(e)){this.decimals=it.decimals,this.symbol=it.symbol,this.name=it.name,this.mint=new Mn(it.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=n||e.toString().substring(0,6),this.name=o||e.toString().substring(0,6),this.mint=r?Mn.default:On({publicKey:e}),this.isToken2022=a}equals(e){return this===e?!0:this.mint.equals(e.mint)}},ze=vn;ze.WSOL=new vn(J(Q({},it),{mint:it.address}));var En=class{constructor({decimals:e,symbol:t="UNKNOWN",name:n="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=n}equals(e){return this===e}},an=En;an.SOL=new En(Ln);import Ur from"bn.js";var Li=new $(new Ur(100)),rt=class extends ${toSignificant(e=5,t,n){return this.mul(Li).toSignificant(e,t,n)}toFixed(e=2,t,n){return this.mul(Li).toFixed(e,t,n)}};var Xr=se("Raydium_price"),Ee=class extends ${constructor(t){let{baseToken:n,quoteToken:o,numerator:r,denominator:a}=t;super(r,a);this.baseToken=n,this.quoteToken=o,this.scalar=new $(Wn(n.decimals),Wn(o.decimals))}get raw(){return new $(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new Ee({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(t){this.quoteToken!==t.baseToken&&Xr.logWithError("mul token not equals");let n=super.mul(t);return new Ee({baseToken:this.baseToken,quoteToken:t.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(t=this.quoteToken.decimals,n,o){return this.adjusted.toSignificant(t,n,o)}toFixed(t=this.quoteToken.decimals,n,o){return this.adjusted.toFixed(t,n,o)}};var Oi=new at(0),zr=new at(1),gc=new at(2),Pc=new at(3),Ac=new at(5),Rn=new at(10),kc=new at(100),wc=new at(1e3),hc=new at(1e4);function Wn(i){return Rn.pow(ue(i))}function Cn(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 Hr}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Qr}from"@solana/spl-token";import{ComputeBudgetProgram as Nc,Keypair as Oc,PublicKey as Yr,Transaction as Mc,TransactionMessage as Ec,VersionedTransaction as Wc}from"@solana/web3.js";var ne={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 qc}from"@solana/spl-token";var Gc=se("Raydium_txUtil");function xe(i,e){let[t,n]=Yr.findProgramAddressSync(i,e);return{publicKey:t,nonce:n}}function ie(i,e,t){return xe([i.toBuffer(),(t!=null?t:Qr).toBuffer(),e.toBuffer()],new Hr("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}import{PublicKey as D}from"@solana/web3.js";var Zr=new D("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),jr=new D("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Jr=new D("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),$r=new D("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),ea=new D("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),ta=new D("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Vn=new D("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),Fi=new D("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),na=new D("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),sn=new D("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),Dn=new D("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),Mi=new D("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),vi=new D("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),vt=new D("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),ia=new D("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),oa=new D("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),Zc=new D("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),jc=new D("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),Jc=new D("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),$c=new D("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),_n=new D("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),Ei=new D("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),ra=new D("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),aa=new D("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),sa=new D("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),Wi=new D("LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"),ua=new D("WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh"),el=new D("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),tl=new D("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"),ca=new D("4Bu96XjU84XjPDSpveTVf6LYGCkfW5FK7SNkREWcEfV4"),la=new D("6s1xP3hpbAfFoNtUNF8mfHsjr2Bd97JxFJRWLbL6aHuX");var Le={AMM_V4:Fi,AMM_STABLE:na,CLMM_PROGRAM_ID:Dn,CLMM_LOCK_PROGRAM_ID:Mi,CLMM_LOCK_AUTH_ID:vi,FARM_PROGRAM_ID_V3:Zr,FARM_PROGRAM_ID_V4:jr,FARM_PROGRAM_ID_V5:Jr,FARM_PROGRAM_ID_V6:$r,OPEN_BOOK_PROGRAM:ta,SERUM_PROGRAM_ID_V3:Vn,UTIL1216:ea,Router:ia,CREATE_CPMM_POOL_PROGRAM:_n,CREATE_CPMM_POOL_AUTH:Ei,CREATE_CPMM_POOL_FEE_ACC:ra,LOCK_CPMM_PROGRAM:aa,LOCK_CPMM_AUTH:sa,LAUNCHPAD_PROGRAM:Wi,LAUNCHPAD_AUTH:ua,LAUNCHPAD_PLATFORM:ca,LAUNCHPAD_CONFIG:la,FEE_DESTINATION_ID:oa,MODEL_DATA_PUBKEY:vt},nl={OPEN_BOOK_PROGRAM:new D("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),SERUM_PROGRAM_ID_V3:new D("Ray1111111111111111111111111111111111111111"),AMM_V4:new D("DRaya7Kj3aMWQSy19kSjvmuwq9docCHofyP9kanQGaav"),AMM_STABLE:new D("DRayDdXc1NZQ9C3hRWmoSf8zK4iapgMnjdNZWrfwsP8m"),CLMM_PROGRAM_ID:new D("DRayAUgENGQBKVaX8owNhgzkEDyoHTGVEGHVJT1E9pfH"),CLMM_LOCK_PROGRAM_ID:new D("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),CLMM_LOCK_AUTH_ID:new D("6Aoh8h2Lw2m5UGxYR8AdAL87jTWYeKoxM52mJRzfYwN"),CREATE_CPMM_POOL_PROGRAM:new D("DRaycpLY18LhpbydsBWbVJtxpNv9oXPgjRSfpF2bWpYb"),CREATE_CPMM_POOL_AUTH:new D("CXniRufdq5xL8t8jZAPxsPZDpuudwuJSPWnbcD5Y5Nxq"),CREATE_CPMM_POOL_FEE_ACC:new D("3oE58BKVt8KuYkGxx8zBojugnymWmBiyafWgMrnb6eYy"),LOCK_CPMM_PROGRAM:new D("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),LOCK_CPMM_AUTH:new D("7qWVV8UY2bRJfDLP4s37YzBPKUkVB46DStYJBpYbQzu3"),UTIL1216:D.default,Router:new D("DRaybByLpbUL57LJARs3j8BitTxVfzBg351EaMr5UTCd"),FARM_PROGRAM_ID_V3:new D("DRayWyrLmEW5KEeqs8kdTMMaBabapqagaBC7KWpGtJeZ"),FARM_PROGRAM_ID_V4:new D("Ray1111111111111111111111111111111111111111"),FARM_PROGRAM_ID_V5:new D("DRayiCGSZgku1GTK6rXD6mVDdingXy6APAH1R6R5L2LC"),FARM_PROGRAM_ID_V6:new D("DRayzbYakXs45ELHkzH6vC3fuhQqTAnv5A68gdFuvZyZ"),LAUNCHPAD_PROGRAM:new D("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),LAUNCHPAD_AUTH:new D("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"