@raydium-io/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
1 lines • 123 kB
JavaScript
var fr=Object.create;var ut=Object.defineProperty,br=Object.defineProperties,yr=Object.getOwnPropertyDescriptor,gr=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertyNames,Mt=Object.getOwnPropertySymbols,wr=Object.getPrototypeOf,un=Object.prototype.hasOwnProperty,$n=Object.prototype.propertyIsEnumerable;var Jn=(n,e,t)=>e in n?ut(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,q=(n,e)=>{for(var t in e||(e={}))un.call(e,t)&&Jn(n,t,e[t]);if(Mt)for(var t of Mt(e))$n.call(e,t)&&Jn(n,t,e[t]);return n},Z=(n,e)=>br(n,gr(e));var xe=(n,e)=>{var t={};for(var i in n)un.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&Mt)for(var i of Mt(n))e.indexOf(i)<0&&$n.call(n,i)&&(t[i]=n[i]);return t};var Ar=(n,e)=>{for(var t in e)ut(n,t,{get:e[t],enumerable:!0})},ei=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Pr(e))!un.call(n,r)&&r!==t&&ut(n,r,{get:()=>e[r],enumerable:!(i=yr(e,r))||i.enumerable});return n};var ee=(n,e,t)=>(t=n!=null?fr(wr(n)):{},ei(e||!n||!n.__esModule?ut(t,"default",{value:n,enumerable:!0}):t,n)),kr=n=>ei(ut({},"__esModule",{value:!0}),n);var Ps={};Ar(Ps,{default:()=>an});module.exports=kr(Ps);var P=require("@solana/web3.js"),z=require("@solana/spl-token");var Ie=ee(require("bn.js"));var je=9e15,De=1e9,cn="0123456789abcdef",vt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Et="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ln={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-je,maxE:je,crypto:!1},ri,Re,W=!0,Dt="[DecimalError] ",Ve=Dt+"Invalid argument: ",oi=Dt+"Precision limit exceeded",si=Dt+"crypto unavailable",ai="[object Decimal]",me=Math.floor,re=Math.pow,Tr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,hr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Br=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ui=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,he=1e7,V=7,Ir=9007199254740991,xr=vt.length-1,mn=Et.length-1,k={toStringTag:ai};k.absoluteValue=k.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),F(n)};k.ceil=function(){return F(new this.constructor(this),this.e+1,2)};k.clampedTo=k.clamp=function(n,e){var t,i=this,r=i.constructor;if(n=new r(n),e=new r(e),!n.s||!e.s)return new r(NaN);if(n.gt(e))throw Error(Ve+e);return t=i.cmp(n),t<0?n:i.cmp(e)>0?e:new r(i)};k.comparedTo=k.cmp=function(n){var e,t,i,r,o=this,s=o.d,a=(n=new o.constructor(n)).d,c=o.s,u=n.s;if(!s||!a)return!c||!u?NaN:c!==u?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-u:0;if(c!==u)return c;if(o.e!==n.e)return o.e>n.e^c<0?1:-1;for(i=s.length,r=a.length,e=0,t=i<r?i:r;e<t;++e)if(s[e]!==a[e])return s[e]>a[e]^c<0?1:-1;return i===r?0:i>r^c<0?1:-1};k.cosine=k.cos=function(){var n,e,t=this,i=t.constructor;return t.d?t.d[0]?(n=i.precision,e=i.rounding,i.precision=n+Math.max(t.e,t.sd())+V,i.rounding=1,t=Cr(i,pi(i,t)),i.precision=n,i.rounding=e,F(Re==2||Re==3?t.neg():t,n,e,!0)):new i(1):new i(NaN)};k.cubeRoot=k.cbrt=function(){var n,e,t,i,r,o,s,a,c,u,l=this,m=l.constructor;if(!l.isFinite()||l.isZero())return new m(l);for(W=!1,o=l.s*re(l.s*l,1/3),!o||Math.abs(o)==1/0?(t=ce(l.d),n=l.e,(o=(n-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=re(t,1/3),n=me((n+1)/3)-(n%3==(n<0?-1:2)),o==1/0?t="5e"+n:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+n),i=new m(t),i.s=l.s):i=new m(o.toString()),s=(n=m.precision)+3;;)if(a=i,c=a.times(a).times(a),u=c.plus(l),i=Q(u.plus(l).times(a),u.plus(c),s+2,1),ce(a.d).slice(0,s)===(t=ce(i.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!r&&t=="4999"){if(!r&&(F(a,n+1,0),a.times(a).times(a).eq(l))){i=a;break}s+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(F(i,n+1,1),e=!i.times(i).times(i).eq(l));break}return W=!0,F(i,n,m.rounding,e)};k.decimalPlaces=k.dp=function(){var n,e=this.d,t=NaN;if(e){if(n=e.length-1,t=(n-me(this.e/V))*V,n=e[n],n)for(;n%10==0;n/=10)t--;t<0&&(t=0)}return t};k.dividedBy=k.div=function(n){return Q(this,new this.constructor(n))};k.dividedToIntegerBy=k.divToInt=function(n){var e=this,t=e.constructor;return F(Q(e,new t(n),0,1,1),t.precision,t.rounding)};k.equals=k.eq=function(n){return this.cmp(n)===0};k.floor=function(){return F(new this.constructor(this),this.e+1,3)};k.greaterThan=k.gt=function(n){return this.cmp(n)>0};k.greaterThanOrEqualTo=k.gte=function(n){var e=this.cmp(n);return e==1||e===0};k.hyperbolicCosine=k.cosh=function(){var n,e,t,i,r,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,i=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,r=o.d.length,r<32?(n=Math.ceil(r/3),e=(1/_t(4,n)).toString()):(n=16,e="2.3283064365386962890625e-10"),o=Qe(s,1,o.times(e),new s(1),!0);for(var c,u=n,l=new s(8);u--;)c=o.times(o),o=a.minus(c.times(l.minus(c.times(l))));return F(o,s.precision=t,s.rounding=i,!0)};k.hyperbolicSine=k.sinh=function(){var n,e,t,i,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,i=r.d.length,i<3)r=Qe(o,2,r,r,!0);else{n=1.4*Math.sqrt(i),n=n>16?16:n|0,r=r.times(1/_t(5,n)),r=Qe(o,2,r,r,!0);for(var s,a=new o(5),c=new o(16),u=new o(20);n--;)s=r.times(r),r=r.times(a.plus(s.times(c.times(s).plus(u))))}return o.precision=e,o.rounding=t,F(r,e,t,!0)};k.hyperbolicTangent=k.tanh=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+7,i.rounding=1,Q(t.sinh(),t.cosh(),i.precision=n,i.rounding=e)):new i(t.s)};k.inverseCosine=k.acos=function(){var n=this,e=n.constructor,t=n.abs().cmp(1),i=e.precision,r=e.rounding;return t!==-1?t===0?n.isNeg()?Ce(e,i,r):new e(0):new e(NaN):n.isZero()?Ce(e,i+4,r).times(.5):(e.precision=i+6,e.rounding=1,n=new e(1).minus(n).div(n.plus(1)).sqrt().atan(),e.precision=i,e.rounding=r,n.times(2))};k.inverseHyperbolicCosine=k.acosh=function(){var n,e,t=this,i=t.constructor;return t.lte(1)?new i(t.eq(1)?0:NaN):t.isFinite()?(n=i.precision,e=i.rounding,i.precision=n+Math.max(Math.abs(t.e),t.sd())+4,i.rounding=1,W=!1,t=t.times(t).minus(1).sqrt().plus(t),W=!0,i.precision=n,i.rounding=e,t.ln()):new i(t)};k.inverseHyperbolicSine=k.asinh=function(){var n,e,t=this,i=t.constructor;return!t.isFinite()||t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+2*Math.max(Math.abs(t.e),t.sd())+6,i.rounding=1,W=!1,t=t.times(t).plus(1).sqrt().plus(t),W=!0,i.precision=n,i.rounding=e,t.ln())};k.inverseHyperbolicTangent=k.atanh=function(){var n,e,t,i,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(n=o.precision,e=o.rounding,i=r.sd(),Math.max(i,n)<2*-r.e-1?F(new o(r),n,e,!0):(o.precision=t=i-r.e,r=Q(r.plus(1),new o(1).minus(r),t+n,1),o.precision=n+4,o.rounding=1,r=r.ln(),o.precision=n,o.rounding=e,r.times(.5))):new o(NaN)};k.inverseSine=k.asin=function(){var n,e,t,i,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),t=o.precision,i=o.rounding,e!==-1?e===0?(n=Ce(o,t+4,i).times(.5),n.s=r.s,n):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=i,r.times(2)))};k.inverseTangent=k.atan=function(){var n,e,t,i,r,o,s,a,c,u=this,l=u.constructor,m=l.precision,d=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&m+4<=mn)return s=Ce(l,m+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(m+4<=mn)return s=Ce(l,m+4,d).times(.5),s.s=u.s,s}for(l.precision=a=m+10,l.rounding=1,t=Math.min(28,a/V+2|0),n=t;n;--n)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(W=!1,e=Math.ceil(a/V),i=1,c=u.times(u),s=new l(u),r=u;n!==-1;)if(r=r.times(c),o=s.minus(r.div(i+=2)),r=r.times(c),s=o.plus(r.div(i+=2)),s.d[e]!==void 0)for(n=e;s.d[n]===o.d[n]&&n--;);return t&&(s=s.times(2<<t-1)),W=!0,F(s,l.precision=m,l.rounding=d,!0)};k.isFinite=function(){return!!this.d};k.isInteger=k.isInt=function(){return!!this.d&&me(this.e/V)>this.d.length-2};k.isNaN=function(){return!this.s};k.isNegative=k.isNeg=function(){return this.s<0};k.isPositive=k.isPos=function(){return this.s>0};k.isZero=function(){return!!this.d&&this.d[0]===0};k.lessThan=k.lt=function(n){return this.cmp(n)<0};k.lessThanOrEqualTo=k.lte=function(n){return this.cmp(n)<1};k.logarithm=k.log=function(n){var e,t,i,r,o,s,a,c,u=this,l=u.constructor,m=l.precision,d=l.rounding,p=5;if(n==null)n=new l(10),e=!0;else{if(n=new l(n),t=n.d,n.s<0||!t||!t[0]||n.eq(1))return new l(NaN);e=n.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new l(t&&!t[0]?-1/0:u.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(W=!1,a=m+p,s=Ee(u,a),i=e?Vt(l,a+10):Ee(n,a),c=Q(s,i,a,1),ct(c.d,r=m,d))do if(a+=10,s=Ee(u,a),i=e?Vt(l,a+10):Ee(n,a),c=Q(s,i,a,1),!o){+ce(c.d).slice(r+1,r+15)+1==1e14&&(c=F(c,m+1,0));break}while(ct(c.d,r+=10,d));return W=!0,F(c,m,d)};k.minus=k.sub=function(n){var e,t,i,r,o,s,a,c,u,l,m,d,p=this,b=p.constructor;if(n=new b(n),!p.d||!n.d)return!p.s||!n.s?n=new b(NaN):p.d?n.s=-n.s:n=new b(n.d||p.s!==n.s?p:NaN),n;if(p.s!=n.s)return n.s=-n.s,p.plus(n);if(u=p.d,d=n.d,a=b.precision,c=b.rounding,!u[0]||!d[0]){if(d[0])n.s=-n.s;else if(u[0])n=new b(p);else return new b(c===3?-0:0);return W?F(n,a,c):n}if(t=me(n.e/V),l=me(p.e/V),u=u.slice(),o=l-t,o){for(m=o<0,m?(e=u,o=-o,s=d.length):(e=d,t=l,s=u.length),i=Math.max(Math.ceil(a/V),s)+2,o>i&&(o=i,e.length=1),e.reverse(),i=o;i--;)e.push(0);e.reverse()}else{for(i=u.length,s=d.length,m=i<s,m&&(s=i),i=0;i<s;i++)if(u[i]!=d[i]){m=u[i]<d[i];break}o=0}for(m&&(e=u,u=d,d=e,n.s=-n.s),s=u.length,i=d.length-s;i>0;--i)u[s++]=0;for(i=d.length;i>o;){if(u[--i]<d[i]){for(r=i;r&&u[--r]===0;)u[r]=he-1;--u[r],u[i]+=he}u[i]-=d[i]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--t;return u[0]?(n.d=u,n.e=Wt(u,t),W?F(n,a,c):n):new b(c===3?-0:0)};k.modulo=k.mod=function(n){var e,t=this,i=t.constructor;return n=new i(n),!t.d||!n.s||n.d&&!n.d[0]?new i(NaN):!n.d||t.d&&!t.d[0]?F(new i(t),i.precision,i.rounding):(W=!1,i.modulo==9?(e=Q(t,n.abs(),0,3,1),e.s*=n.s):e=Q(t,n,0,i.modulo,1),e=e.times(n),W=!0,t.minus(e))};k.naturalExponential=k.exp=function(){return dn(this)};k.naturalLogarithm=k.ln=function(){return Ee(this)};k.negated=k.neg=function(){var n=new this.constructor(this);return n.s=-n.s,F(n)};k.plus=k.add=function(n){var e,t,i,r,o,s,a,c,u,l,m=this,d=m.constructor;if(n=new d(n),!m.d||!n.d)return!m.s||!n.s?n=new d(NaN):m.d||(n=new d(n.d||m.s===n.s?m:NaN)),n;if(m.s!=n.s)return n.s=-n.s,m.minus(n);if(u=m.d,l=n.d,a=d.precision,c=d.rounding,!u[0]||!l[0])return l[0]||(n=new d(m)),W?F(n,a,c):n;if(o=me(m.e/V),i=me(n.e/V),u=u.slice(),r=o-i,r){for(r<0?(t=u,r=-r,s=l.length):(t=l,i=o,s=u.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=u.length,r=l.length,s-r<0&&(r=s,t=l,l=u,u=t),e=0;r;)e=(u[--r]=u[r]+l[r]+e)/he|0,u[r]%=he;for(e&&(u.unshift(e),++i),s=u.length;u[--s]==0;)u.pop();return n.d=u,n.e=Wt(u,i),W?F(n,a,c):n};k.precision=k.sd=function(n){var e,t=this;if(n!==void 0&&n!==!!n&&n!==1&&n!==0)throw Error(Ve+n);return t.d?(e=ci(t.d),n&&t.e+1>e&&(e=t.e+1)):e=NaN,e};k.round=function(){var n=this,e=n.constructor;return F(new e(n),n.e+1,e.rounding)};k.sine=k.sin=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+Math.max(t.e,t.sd())+V,i.rounding=1,t=Kr(i,pi(i,t)),i.precision=n,i.rounding=e,F(Re>2?t.neg():t,n,e,!0)):new i(NaN)};k.squareRoot=k.sqrt=function(){var n,e,t,i,r,o,s=this,a=s.d,c=s.e,u=s.s,l=s.constructor;if(u!==1||!a||!a[0])return new l(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(W=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=ce(a),(e.length+c)%2==0&&(e+="0"),u=Math.sqrt(e),c=me((c+1)/2)-(c<0||c%2),u==1/0?e="5e"+c:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),i=new l(e)):i=new l(u.toString()),t=(c=l.precision)+3;;)if(o=i,i=o.plus(Q(s,o,t+2,1)).times(.5),ce(o.d).slice(0,t)===(e=ce(i.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!r&&e=="4999"){if(!r&&(F(o,c+1,0),o.times(o).eq(s))){i=o;break}t+=4,r=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(F(i,c+1,1),n=!i.times(i).eq(s));break}return W=!0,F(i,c,l.rounding,n)};k.tangent=k.tan=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+10,i.rounding=1,t=t.sin(),t.s=1,t=Q(t,new i(1).minus(t.times(t)).sqrt(),n+10,0),i.precision=n,i.rounding=e,F(Re==2||Re==4?t.neg():t,n,e,!0)):new i(NaN)};k.times=k.mul=function(n){var e,t,i,r,o,s,a,c,u,l=this,m=l.constructor,d=l.d,p=(n=new m(n)).d;if(n.s*=l.s,!d||!d[0]||!p||!p[0])return new m(!n.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:!d||!p?n.s/0:n.s*0);for(t=me(l.e/V)+me(n.e/V),c=d.length,u=p.length,c<u&&(o=d,d=p,p=o,s=c,c=u,u=s),o=[],s=c+u,i=s;i--;)o.push(0);for(i=u;--i>=0;){for(e=0,r=c+i;r>i;)a=o[r]+p[i]*d[r-i-1]+e,o[r--]=a%he|0,e=a/he|0;o[r]=(o[r]+e)%he|0}for(;!o[--s];)o.pop();return e?++t:o.shift(),n.d=o,n.e=Wt(o,t),W?F(n,m.precision,m.rounding):n};k.toBinary=function(n,e){return pn(this,2,n,e)};k.toDecimalPlaces=k.toDP=function(n,e){var t=this,i=t.constructor;return t=new i(t),n===void 0?t:(pe(n,0,De),e===void 0?e=i.rounding:pe(e,0,8),F(t,n+t.e+1,e))};k.toExponential=function(n,e){var t,i=this,r=i.constructor;return n===void 0?t=Se(i,!0):(pe(n,0,De),e===void 0?e=r.rounding:pe(e,0,8),i=F(new r(i),n+1,e),t=Se(i,!0,n+1)),i.isNeg()&&!i.isZero()?"-"+t:t};k.toFixed=function(n,e){var t,i,r=this,o=r.constructor;return n===void 0?t=Se(r):(pe(n,0,De),e===void 0?e=o.rounding:pe(e,0,8),i=F(new o(r),n+r.e+1,e),t=Se(i,!1,n+i.e+1)),r.isNeg()&&!r.isZero()?"-"+t:t};k.toFraction=function(n){var e,t,i,r,o,s,a,c,u,l,m,d,p=this,b=p.d,f=p.constructor;if(!b)return new f(p);if(u=t=new f(1),i=c=new f(0),e=new f(i),o=e.e=ci(b)-p.e-1,s=o%V,e.d[0]=re(10,s<0?V+s:s),n==null)n=o>0?e:u;else{if(a=new f(n),!a.isInt()||a.lt(u))throw Error(Ve+a);n=a.gt(e)?o>0?e:u:a}for(W=!1,a=new f(ce(b)),l=f.precision,f.precision=o=b.length*V*2;m=Q(a,e,0,1,1),r=t.plus(m.times(i)),r.cmp(n)!=1;)t=i,i=r,r=u,u=c.plus(m.times(r)),c=r,r=e,e=a.minus(m.times(r)),a=r;return r=Q(n.minus(t),i,0,1,1),c=c.plus(r.times(u)),t=t.plus(r.times(i)),c.s=u.s=p.s,d=Q(u,i,o,1).minus(p).abs().cmp(Q(c,t,o,1).minus(p).abs())<1?[u,i]:[c,t],f.precision=l,W=!0,d};k.toHexadecimal=k.toHex=function(n,e){return pn(this,16,n,e)};k.toNearest=function(n,e){var t=this,i=t.constructor;if(t=new i(t),n==null){if(!t.d)return t;n=new i(1),e=i.rounding}else{if(n=new i(n),e===void 0?e=i.rounding:pe(e,0,8),!t.d)return n.s?t:n;if(!n.d)return n.s&&(n.s=t.s),n}return n.d[0]?(W=!1,t=Q(t,n,0,e,1).times(n),W=!0,F(t)):(n.s=t.s,t=n),t};k.toNumber=function(){return+this};k.toOctal=function(n,e){return pn(this,8,n,e)};k.toPower=k.pow=function(n){var e,t,i,r,o,s,a=this,c=a.constructor,u=+(n=new c(n));if(!a.d||!n.d||!a.d[0]||!n.d[0])return new c(re(+a,u));if(a=new c(a),a.eq(1))return a;if(i=c.precision,o=c.rounding,n.eq(1))return F(a,i,o);if(e=me(n.e/V),e>=n.d.length-1&&(t=u<0?-u:u)<=Ir)return r=li(c,a,t,i),n.s<0?new c(1).div(r):F(r,i,o);if(s=a.s,s<0){if(e<n.d.length-1)return new c(NaN);if((n.d[e]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return t=re(+a,u),e=t==0||!isFinite(t)?me(u*(Math.log("0."+ce(a.d))/Math.LN10+a.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?s/0:0):(W=!1,c.rounding=a.s=1,t=Math.min(12,(e+"").length),r=dn(n.times(Ee(a,i+t)),i),r.d&&(r=F(r,i+5,1),ct(r.d,i,o)&&(e=i+10,r=F(dn(n.times(Ee(a,e+t)),e),e+5,1),+ce(r.d).slice(i+1,i+15)+1==1e14&&(r=F(r,i+1,0)))),r.s=s,W=!0,c.rounding=o,F(r,i,o))};k.toPrecision=function(n,e){var t,i=this,r=i.constructor;return n===void 0?t=Se(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(pe(n,1,De),e===void 0?e=r.rounding:pe(e,0,8),i=F(new r(i),n,e),t=Se(i,n<=i.e||i.e<=r.toExpNeg,n)),i.isNeg()&&!i.isZero()?"-"+t:t};k.toSignificantDigits=k.toSD=function(n,e){var t=this,i=t.constructor;return n===void 0?(n=i.precision,e=i.rounding):(pe(n,1,De),e===void 0?e=i.rounding:pe(e,0,8)),F(new i(t),n,e)};k.toString=function(){var n=this,e=n.constructor,t=Se(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()&&!n.isZero()?"-"+t:t};k.truncated=k.trunc=function(){return F(new this.constructor(this),this.e+1,1)};k.valueOf=k.toJSON=function(){var n=this,e=n.constructor,t=Se(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()?"-"+t:t};function ce(n){var e,t,i,r=n.length-1,o="",s=n[0];if(r>0){for(o+=s,e=1;e<r;e++)i=n[e]+"",t=V-i.length,t&&(o+=ve(t)),o+=i;s=n[e],i=s+"",t=V-i.length,t&&(o+=ve(t))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function pe(n,e,t){if(n!==~~n||n<e||n>t)throw Error(Ve+n)}function ct(n,e,t,i){var r,o,s,a;for(o=n[0];o>=10;o/=10)--e;return--e<0?(e+=V,r=0):(r=Math.ceil((e+1)/V),e%=V),o=re(10,V-e),a=n[r]%o|0,i==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)&&(n[r+1]/o/100|0)==re(10,e-2)-1||(a==o/2||a==0)&&(n[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=(i||t<4)&&a==9999||!i&&t>3&&a==4999):s=((i||t<4)&&a+1==o||!i&&t>3&&a+1==o/2)&&(n[r+1]/o/1e3|0)==re(10,e-3)-1,s}function Ot(n,e,t){for(var i,r=[0],o,s=0,a=n.length;s<a;){for(o=r.length;o--;)r[o]*=e;for(r[0]+=cn.indexOf(n.charAt(s++)),i=0;i<r.length;i++)r[i]>t-1&&(r[i+1]===void 0&&(r[i+1]=0),r[i+1]+=r[i]/t|0,r[i]%=t)}return r.reverse()}function Cr(n,e){var t,i,r;if(e.isZero())return e;i=e.d.length,i<32?(t=Math.ceil(i/3),r=(1/_t(4,t)).toString()):(t=16,r="2.3283064365386962890625e-10"),n.precision+=t,e=Qe(n,1,e.times(r),new n(1));for(var o=t;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return n.precision-=t,e}var Q=function(){function n(i,r,o){var s,a=0,c=i.length;for(i=i.slice();c--;)s=i[c]*r+a,i[c]=s%o|0,a=s/o|0;return a&&i.unshift(a),i}function e(i,r,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(i[a]!=r[a]){c=i[a]>r[a]?1:-1;break}return c}function t(i,r,o,s){for(var a=0;o--;)i[o]-=a,a=i[o]<r[o]?1:0,i[o]=a*s+i[o]-r[o];for(;!i[0]&&i.length>1;)i.shift()}return function(i,r,o,s,a,c){var u,l,m,d,p,b,f,y,g,w,A,I,B,T,h,x,S,K,D,R,M=i.constructor,G=i.s==r.s?1:-1,N=i.d,L=r.d;if(!N||!N[0]||!L||!L[0])return new M(!i.s||!r.s||(N?L&&N[0]==L[0]:!L)?NaN:N&&N[0]==0||!L?G*0:G/0);for(c?(p=1,l=i.e-r.e):(c=he,p=V,l=me(i.e/p)-me(r.e/p)),D=L.length,S=N.length,g=new M(G),w=g.d=[],m=0;L[m]==(N[m]||0);m++);if(L[m]>(N[m]||0)&&l--,o==null?(T=o=M.precision,s=M.rounding):a?T=o+(i.e-r.e)+1:T=o,T<0)w.push(1),b=!0;else{if(T=T/p+2|0,m=0,D==1){for(d=0,L=L[0],T++;(m<S||d)&&T--;m++)h=d*c+(N[m]||0),w[m]=h/L|0,d=h%L|0;b=d||m<S}else{for(d=c/(L[0]+1)|0,d>1&&(L=n(L,d,c),N=n(N,d,c),D=L.length,S=N.length),x=D,A=N.slice(0,D),I=A.length;I<D;)A[I++]=0;R=L.slice(),R.unshift(0),K=L[0],L[1]>=c/2&&++K;do d=0,u=e(L,A,D,I),u<0?(B=A[0],D!=I&&(B=B*c+(A[1]||0)),d=B/K|0,d>1?(d>=c&&(d=c-1),f=n(L,d,c),y=f.length,I=A.length,u=e(f,A,y,I),u==1&&(d--,t(f,D<y?R:L,y,c))):(d==0&&(u=d=1),f=L.slice()),y=f.length,y<I&&f.unshift(0),t(A,f,I,c),u==-1&&(I=A.length,u=e(L,A,D,I),u<1&&(d++,t(A,D<I?R:L,I,c))),I=A.length):u===0&&(d++,A=[0]),w[m++]=d,u&&A[0]?A[I++]=N[x]||0:(A=[N[x]],I=1);while((x++<S||A[0]!==void 0)&&T--);b=A[0]!==void 0}w[0]||w.shift()}if(p==1)g.e=l,ri=b;else{for(m=1,d=w[0];d>=10;d/=10)m++;g.e=m+l*p-1,F(g,a?o+g.e+1:o,s,b)}return g}}();function F(n,e,t,i){var r,o,s,a,c,u,l,m,d,p=n.constructor;e:if(e!=null){if(m=n.d,!m)return n;for(r=1,a=m[0];a>=10;a/=10)r++;if(o=e-r,o<0)o+=V,s=e,l=m[d=0],c=l/re(10,r-s-1)%10|0;else if(d=Math.ceil((o+1)/V),a=m.length,d>=a)if(i){for(;a++<=d;)m.push(0);l=c=0,r=1,o%=V,s=o-V+1}else break e;else{for(l=a=m[d],r=1;a>=10;a/=10)r++;o%=V,s=o-V+r,c=s<0?0:l/re(10,r-s-1)%10|0}if(i=i||e<0||m[d+1]!==void 0||(s<0?l:l%re(10,r-s-1)),u=t<4?(c||i)&&(t==0||t==(n.s<0?3:2)):c>5||c==5&&(t==4||i||t==6&&(o>0?s>0?l/re(10,r-s):0:m[d-1])%10&1||t==(n.s<0?8:7)),e<1||!m[0])return m.length=0,u?(e-=n.e+1,m[0]=re(10,(V-e%V)%V),n.e=-e||0):m[0]=n.e=0,n;if(o==0?(m.length=d,a=1,d--):(m.length=d+1,a=re(10,V-o),m[d]=s>0?(l/re(10,r-s)%re(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=m[0];s>=10;s/=10)o++;for(s=m[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(n.e++,m[0]==he&&(m[0]=1));break}else{if(m[d]+=a,m[d]!=he)break;m[d--]=0,a=1}for(o=m.length;m[--o]===0;)m.pop()}return W&&(n.e>p.maxE?(n.d=null,n.e=NaN):n.e<p.minE&&(n.e=0,n.d=[0])),n}function Se(n,e,t){if(!n.isFinite())return di(n);var i,r=n.e,o=ce(n.d),s=o.length;return e?(t&&(i=t-s)>0?o=o.charAt(0)+"."+o.slice(1)+ve(i):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(n.e<0?"e":"e+")+n.e):r<0?(o="0."+ve(-r-1)+o,t&&(i=t-s)>0&&(o+=ve(i))):r>=s?(o+=ve(r+1-s),t&&(i=t-r-1)>0&&(o=o+"."+ve(i))):((i=r+1)<s&&(o=o.slice(0,i)+"."+o.slice(i)),t&&(i=t-s)>0&&(r+1===s&&(o+="."),o+=ve(i))),o}function Wt(n,e){var t=n[0];for(e*=V;t>=10;t/=10)e++;return e}function Vt(n,e,t){if(e>xr)throw W=!0,t&&(n.precision=t),Error(oi);return F(new n(vt),e,1,!0)}function Ce(n,e,t){if(e>mn)throw Error(oi);return F(new n(Et),e,t,!0)}function ci(n){var e=n.length-1,t=e*V+1;if(e=n[e],e){for(;e%10==0;e/=10)t--;for(e=n[0];e>=10;e/=10)t++}return t}function ve(n){for(var e="";n--;)e+="0";return e}function li(n,e,t,i){var r,o=new n(1),s=Math.ceil(i/V+4);for(W=!1;;){if(t%2&&(o=o.times(e),ni(o.d,s)&&(r=!0)),t=me(t/2),t===0){t=o.d.length-1,r&&o.d[t]===0&&++o.d[t];break}e=e.times(e),ni(e.d,s)}return W=!0,o}function ti(n){return n.d[n.d.length-1]&1}function mi(n,e,t){for(var i,r,o=new n(e[0]),s=0;++s<e.length;){if(r=new n(e[s]),!r.s){o=r;break}i=o.cmp(r),(i===t||i===0&&o.s===t)&&(o=r)}return o}function dn(n,e){var t,i,r,o,s,a,c,u=0,l=0,m=0,d=n.constructor,p=d.rounding,b=d.precision;if(!n.d||!n.d[0]||n.e>17)return new d(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:0/0);for(e==null?(W=!1,c=b):c=e,a=new d(.03125);n.e>-2;)n=n.times(a),m+=5;for(i=Math.log(re(2,m))/Math.LN10*2+5|0,c+=i,t=o=s=new d(1),d.precision=c;;){if(o=F(o.times(n),c,1),t=t.times(++l),a=s.plus(Q(o,t,c,1)),ce(a.d).slice(0,c)===ce(s.d).slice(0,c)){for(r=m;r--;)s=F(s.times(s),c,1);if(e==null)if(u<3&&ct(s.d,c-i,p,u))d.precision=c+=10,t=o=a=new d(1),l=0,u++;else return F(s,d.precision=b,p,W=!0);else return d.precision=b,s}s=a}}function Ee(n,e){var t,i,r,o,s,a,c,u,l,m,d,p=1,b=10,f=n,y=f.d,g=f.constructor,w=g.rounding,A=g.precision;if(f.s<0||!y||!y[0]||!f.e&&y[0]==1&&y.length==1)return new g(y&&!y[0]?-1/0:f.s!=1?NaN:y?0:f);if(e==null?(W=!1,l=A):l=e,g.precision=l+=b,t=ce(y),i=t.charAt(0),Math.abs(o=f.e)<15e14){for(;i<7&&i!=1||i==1&&t.charAt(1)>3;)f=f.times(n),t=ce(f.d),i=t.charAt(0),p++;o=f.e,i>1?(f=new g("0."+t),o++):f=new g(i+"."+t.slice(1))}else return u=Vt(g,l+2,A).times(o+""),f=Ee(new g(i+"."+t.slice(1)),l-b).plus(u),g.precision=A,e==null?F(f,A,w,W=!0):f;for(m=f,c=s=f=Q(f.minus(1),f.plus(1),l,1),d=F(f.times(f),l,1),r=3;;){if(s=F(s.times(d),l,1),u=c.plus(Q(s,new g(r),l,1)),ce(u.d).slice(0,l)===ce(c.d).slice(0,l))if(c=c.times(2),o!==0&&(c=c.plus(Vt(g,l+2,A).times(o+""))),c=Q(c,new g(p),l,1),e==null)if(ct(c.d,l-b,w,a))g.precision=l+=b,u=s=f=Q(m.minus(1),m.plus(1),l,1),d=F(f.times(f),l,1),r=a=1;else return F(c,g.precision=A,w,W=!0);else return g.precision=A,c;c=u,r+=2}}function di(n){return String(n.s*n.s/0)}function Ft(n,e){var t,i,r;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(t<0&&(t=i),t+=+e.slice(i+1),e=e.substring(0,i)):t<0&&(t=e.length),i=0;e.charCodeAt(i)===48;i++);for(r=e.length;e.charCodeAt(r-1)===48;--r);if(e=e.slice(i,r),e){if(r-=i,n.e=t=t-i-1,n.d=[],i=(t+1)%V,t<0&&(i+=V),i<r){for(i&&n.d.push(+e.slice(0,i)),r-=V;i<r;)n.d.push(+e.slice(i,i+=V));e=e.slice(i),i=V-e.length}else i-=r;for(;i--;)e+="0";n.d.push(+e),W&&(n.e>n.constructor.maxE?(n.d=null,n.e=NaN):n.e<n.constructor.minE&&(n.e=0,n.d=[0]))}else n.e=0,n.d=[0];return n}function Sr(n,e){var t,i,r,o,s,a,c,u,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),ui.test(e))return Ft(n,e)}else if(e==="Infinity"||e==="NaN")return+e||(n.s=NaN),n.e=NaN,n.d=null,n;if(hr.test(e))t=16,e=e.toLowerCase();else if(Tr.test(e))t=2;else if(Br.test(e))t=8;else throw Error(Ve+e);for(o=e.search(/p/i),o>0?(c=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,i=n.constructor,s&&(e=e.replace(".",""),a=e.length,o=a-o,r=li(i,new i(t),o,o*2)),u=Ot(e,t,he),l=u.length-1,o=l;u[o]===0;--o)u.pop();return o<0?new i(n.s*0):(n.e=Wt(u,l),n.d=u,W=!1,s&&(n=Q(n,r,a*4)),c&&(n=n.times(Math.abs(c)<54?re(2,c):lt.pow(2,c))),W=!0,n)}function Kr(n,e){var t,i=e.d.length;if(i<3)return e.isZero()?e:Qe(n,2,e,e);t=1.4*Math.sqrt(i),t=t>16?16:t|0,e=e.times(1/_t(5,t)),e=Qe(n,2,e,e);for(var r,o=new n(5),s=new n(16),a=new n(20);t--;)r=e.times(e),e=e.times(o.plus(r.times(s.times(r).minus(a))));return e}function Qe(n,e,t,i,r){var o,s,a,c,u=1,l=n.precision,m=Math.ceil(l/V);for(W=!1,c=t.times(t),a=new n(i);;){if(s=Q(a.times(c),new n(e++*e++),l,1),a=r?i.plus(s):i.minus(s),i=Q(s.times(c),new n(e++*e++),l,1),s=a.plus(i),s.d[m]!==void 0){for(o=m;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=i,i=s,s=o,u++}return W=!0,s.d.length=m+1,s}function _t(n,e){for(var t=n;--e;)t*=n;return t}function pi(n,e){var t,i=e.s<0,r=Ce(n,n.precision,1),o=r.times(.5);if(e=e.abs(),e.lte(o))return Re=i?4:1,e;if(t=e.divToInt(r),t.isZero())Re=i?3:2;else{if(e=e.minus(t.times(r)),e.lte(o))return Re=ti(t)?i?2:3:i?4:1,e;Re=ti(t)?i?1:4:i?3:2}return e.minus(r).abs()}function pn(n,e,t,i){var r,o,s,a,c,u,l,m,d,p=n.constructor,b=t!==void 0;if(b?(pe(t,1,De),i===void 0?i=p.rounding:pe(i,0,8)):(t=p.precision,i=p.rounding),!n.isFinite())l=di(n);else{for(l=Se(n),s=l.indexOf("."),b?(r=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):r=e,s>=0&&(l=l.replace(".",""),d=new p(1),d.e=l.length-s,d.d=Ot(Se(d),10,r),d.e=d.d.length),m=Ot(l,10,r),o=c=m.length;m[--c]==0;)m.pop();if(!m[0])l=b?"0p+0":"0";else{if(s<0?o--:(n=new p(n),n.d=m,n.e=o,n=Q(n,d,t,i,0,r),m=n.d,o=n.e,u=ri),s=m[t],a=r/2,u=u||m[t+1]!==void 0,u=i<4?(s!==void 0||u)&&(i===0||i===(n.s<0?3:2)):s>a||s===a&&(i===4||u||i===6&&m[t-1]&1||i===(n.s<0?8:7)),m.length=t,u)for(;++m[--t]>r-1;)m[t]=0,t||(++o,m.unshift(1));for(c=m.length;!m[c-1];--c);for(s=0,l="";s<c;s++)l+=cn.charAt(m[s]);if(b){if(c>1)if(e==16||e==8){for(s=e==16?4:3,--c;c%s;c++)l+="0";for(m=Ot(l,r,e),c=m.length;!m[c-1];--c);for(s=1,l="1.";s<c;s++)l+=cn.charAt(m[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>c)for(o-=c;o--;)l+="0";else o<c&&(l=l.slice(0,o)+"."+l.slice(o))}l=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return n.s<0?"-"+l:l}function ni(n,e){if(n.length>e)return n.length=e,!0}function Nr(n){return new this(n).abs()}function Lr(n){return new this(n).acos()}function Rr(n){return new this(n).acosh()}function Mr(n,e){return new this(n).plus(e)}function Or(n){return new this(n).asin()}function Fr(n){return new this(n).asinh()}function vr(n){return new this(n).atan()}function Er(n){return new this(n).atanh()}function Vr(n,e){n=new this(n),e=new this(e);var t,i=this.precision,r=this.rounding,o=i+4;return!n.s||!e.s?t=new this(NaN):!n.d&&!e.d?(t=Ce(this,o,1).times(e.s>0?.25:.75),t.s=n.s):!e.d||n.isZero()?(t=e.s<0?Ce(this,i,r):new this(0),t.s=n.s):!n.d||e.isZero()?(t=Ce(this,o,1).times(.5),t.s=n.s):e.s<0?(this.precision=o,this.rounding=1,t=this.atan(Q(n,e,o,1)),e=Ce(this,o,1),this.precision=i,this.rounding=r,t=n.s<0?t.minus(e):t.plus(e)):t=this.atan(Q(n,e,o,1)),t}function Dr(n){return new this(n).cbrt()}function Wr(n){return F(n=new this(n),n.e+1,2)}function _r(n,e,t){return new this(n).clamp(e,t)}function qr(n){if(!n||typeof n!="object")throw Error(Dt+"Object expected");var e,t,i,r=n.defaults===!0,o=["precision",1,De,"rounding",0,8,"toExpNeg",-je,0,"toExpPos",0,je,"maxE",0,je,"minE",-je,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(t=o[e],r&&(this[t]=ln[t]),(i=n[t])!==void 0)if(me(i)===i&&i>=o[e+1]&&i<=o[e+2])this[t]=i;else throw Error(Ve+t+": "+i);if(t="crypto",r&&(this[t]=ln[t]),(i=n[t])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(si);else this[t]=!1;else throw Error(Ve+t+": "+i);return this}function Gr(n){return new this(n).cos()}function Ur(n){return new this(n).cosh()}function fi(n){var e,t,i;function r(o){var s,a,c,u=this;if(!(u instanceof r))return new r(o);if(u.constructor=r,ii(o)){u.s=o.s,W?!o.d||o.e>r.maxE?(u.e=NaN,u.d=null):o.e<r.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;W?s>r.maxE?(u.e=NaN,u.d=null):s<r.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return Ft(u,o.toString())}if(c==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),ui.test(o)?Ft(u,o):Sr(u,o);if(c==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,Ft(u,o.toString());throw Error(Ve+o)}if(r.prototype=k,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=qr,r.clone=fi,r.isDecimal=ii,r.abs=Nr,r.acos=Lr,r.acosh=Rr,r.add=Mr,r.asin=Or,r.asinh=Fr,r.atan=vr,r.atanh=Er,r.atan2=Vr,r.cbrt=Dr,r.ceil=Wr,r.clamp=_r,r.cos=Gr,r.cosh=Ur,r.div=Xr,r.exp=Hr,r.floor=zr,r.hypot=Zr,r.ln=Yr,r.log=jr,r.log10=Jr,r.log2=Qr,r.max=$r,r.min=eo,r.mod=to,r.mul=no,r.pow=io,r.random=ro,r.round=oo,r.sign=so,r.sin=ao,r.sinh=uo,r.sqrt=co,r.sub=lo,r.sum=mo,r.tan=po,r.tanh=fo,r.trunc=bo,n===void 0&&(n={}),n&&n.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<i.length;)n.hasOwnProperty(t=i[e++])||(n[t]=this[t]);return r.config(n),r}function Xr(n,e){return new this(n).div(e)}function Hr(n){return new this(n).exp()}function zr(n){return F(n=new this(n),n.e+1,3)}function Zr(){var n,e,t=new this(0);for(W=!1,n=0;n<arguments.length;)if(e=new this(arguments[n++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return W=!0,new this(1/0);t=e}return W=!0,t.sqrt()}function ii(n){return n instanceof lt||n&&n.toStringTag===ai||!1}function Yr(n){return new this(n).ln()}function jr(n,e){return new this(n).log(e)}function Qr(n){return new this(n).log(2)}function Jr(n){return new this(n).log(10)}function $r(){return mi(this,arguments,-1)}function eo(){return mi(this,arguments,1)}function to(n,e){return new this(n).mod(e)}function no(n,e){return new this(n).mul(e)}function io(n,e){return new this(n).pow(e)}function ro(n){var e,t,i,r,o=0,s=new this(1),a=[];if(n===void 0?n=this.precision:pe(n,1,De),i=Math.ceil(n/V),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(i));o<i;)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(i*=4);o<i;)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=i/4}else throw Error(si);else for(;o<i;)a[o++]=Math.random()*1e7|0;for(i=a[--o],n%=V,i&&n&&(r=re(10,V-n),a[o]=(i/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(i=1,r=a[0];r>=10;r/=10)i++;i<V&&(t-=V-i)}return s.e=t,s.d=a,s}function oo(n){return F(n=new this(n),n.e+1,this.rounding)}function so(n){return n=new this(n),n.d?n.d[0]?n.s:0*n.s:n.s||NaN}function ao(n){return new this(n).sin()}function uo(n){return new this(n).sinh()}function co(n){return new this(n).sqrt()}function lo(n,e){return new this(n).sub(e)}function mo(){var n=0,e=arguments,t=new this(e[n]);for(W=!1;t.s&&++n<e.length;)t=t.plus(e[n]);return W=!0,F(t,this.precision,this.rounding)}function po(n){return new this(n).tan()}function fo(n){return new this(n).tanh()}function bo(n){return F(n=new this(n),n.e+1,1)}k[Symbol.for("nodejs.util.inspect.custom")]=k.toString;k[Symbol.toStringTag]="Decimal";var lt=k.constructor=fi(ln);vt=new lt(vt);Et=new lt(Et);var oe=lt;var Fi=ee(require("big.js")),No=ee(require("bn.js"));var mt=require("lodash");var fn=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(i=>typeof i=="object"?JSON.stringify(i):i).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}},bi={},yo={};function ae(n){let e=(0,mt.get)(bi,n);if(!e){let t=(0,mt.get)(yo,n);e=new fn({name:n,logLevel:t}),(0,mt.set)(bi,n,e)}return e}var gn=require("@solana/web3.js");var We=require("@solana/spl-token"),bn=ae("Raydium_accountInfo_util");async function dt(n,e,t){let{batchRequest:i,commitment:r="confirmed",chunkCount:o=100}=q({batchRequest:!1},t),s=yn(e,o),a=new Array(s.length).fill([]);if(i){let c=s.map(m=>{let d=n._buildArgs([m.map(p=>p.toBase58())],r,"base64");return{methodName:"getMultipleAccounts",args:d}}),u=yn(c,10);a=(await(await Promise.all(u.map(async m=>await n._rpcBatchRequest(m)))).flat()).map(m=>(m.error&&bn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${m.error.message}`),m.result.value.map(d=>{if(d){let{data:p,executable:b,lamports:f,owner:y,rentEpoch:g}=d;return p.length!==2&&p[1]!=="base64"&&bn.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(p[0],"base64"),executable:b,lamports:f,owner:new gn.PublicKey(y),rentEpoch:g}}return null})))}else try{a=await Promise.all(s.map(c=>n.getMultipleAccountsInfo(c,r)))}catch(c){c instanceof Error&&bn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${c.message}`)}return a.flat()}async function Xe(n,e,t){let i=await dt(n,e.map(r=>r.pubkey),t);return e.map((r,o)=>Z(q({},r),{accountInfo:i[o]}))}async function Pn({connection:n,mints:e,config:t}){var o,s,a;if(e.length===0)return{};let i=await Xe(n,e.map(c=>({pubkey:pt(c)})),t),r={};for(let c of i){if(!c.accountInfo||c.accountInfo.data.length<We.MINT_SIZE){console.log("invalid mint account",c.pubkey.toBase58());continue}let u=(0,We.unpackMint)(c.pubkey,c.accountInfo,(o=c.accountInfo)==null?void 0:o.owner);r[c.pubkey.toString()]=Z(q({},u),{programId:((s=c.accountInfo)==null?void 0:s.owner)||We.TOKEN_PROGRAM_ID,feeConfig:(a=(0,We.getTransferFeeConfig)(u))!=null?a:void 0})}return r[gn.PublicKey.default.toBase58()]=r[fe.toBase58()],r}var Je=ee(require("bn.js"));var yi=9007199254740991;function Ke(n){let e=ae("Raydium_parseBigNumberish");if(n instanceof Je.default)return n;if(typeof n=="string"){if(n.match(/^-?[0-9]+$/))return new Je.default(n);e.logWithError(`invalid BigNumberish string: ${n}`)}return typeof n=="number"?(n%1&&e.logWithError(`BigNumberish number underflow: ${n}`),(n>=yi||n<=-yi)&&e.logWithError(`BigNumberish number overflow: ${n}`),new Je.default(String(n))):typeof n=="bigint"?new Je.default(n.toString()):(e.error(`invalid BigNumberish value: ${n}`),new Je.default(0))}var gi=require("@solana/web3.js"),wn=require("@solana/spl-token"),An={chainId:101,address:gi.PublicKey.default.toBase58(),programId:wn.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},_e={chainId:101,address:"So11111111111111111111111111111111111111112",programId:wn.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var Ut=require("@solana/web3.js");var H=require("@solana/web3.js"),Pi=require("@solana/spl-token");function kn({pubkey:n,isSigner:e=!1,isWritable:t=!0}){return{pubkey:n,isWritable:t,isSigner:e}}var Ms=[kn({pubkey:Pi.TOKEN_PROGRAM_ID,isWritable:!1}),kn({pubkey:H.SystemProgram.programId,isWritable:!1}),kn({pubkey:H.SYSVAR_RENT_PUBKEY,isWritable:!1})];function Tn({publicKey:n,transformSol:e}){let t=wi(n.toString());if(t instanceof H.PublicKey)return e&&t.equals(ft)?fe:t;if(e&&t.toString()===ft.toBase58())return fe;if(typeof t=="string"){if(t===H.PublicKey.default.toBase58())return H.PublicKey.default;try{return new H.PublicKey(t)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function wi(n){try{return new H.PublicKey(n)}catch{return n}}var go=new H.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),qt=new H.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Gt=new H.PublicKey("SysvarRent111111111111111111111111111111111"),Os=new H.PublicKey("SysvarC1ock11111111111111111111111111111111"),$e=new H.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Fs=new H.PublicKey("Sysvar1nstructions1111111111111111111111111"),Ai=H.SystemProgram.programId,vs=new H.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),Es=new H.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),Vs=new H.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),Ds=new H.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),Ws=new H.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),_s=new H.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),qs=new H.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),Gs=new H.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),Us=new H.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Xs=new H.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Hs=new H.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),fe=new H.PublicKey("So11111111111111111111111111111111111111112"),ft=H.PublicKey.default;function pt(n){return Tn({publicKey:n,transformSol:!0})}var hn=class{constructor({mint:e,decimals:t,symbol:i,name:r,skipMint:o=!1,isToken2022:s=!1}){if(e===ft.toBase58()||e instanceof Ut.PublicKey&&ft.equals(e)){this.decimals=_e.decimals,this.symbol=_e.symbol,this.name=_e.name,this.mint=new Ut.PublicKey(_e.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=i||e.toString().substring(0,6),this.name=r||e.toString().substring(0,6),this.mint=o?Ut.PublicKey.default:Tn({publicKey:e}),this.isToken2022=s}equals(e){return this===e?!0:this.mint.equals(e.mint)}},qe=hn;qe.WSOL=new hn(Z(q({},_e),{mint:_e.address}));var Bn=class{constructor({decimals:e,symbol:t="UNKNOWN",name:i="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=i}equals(e){return this===e}},Xt=Bn;Xt.SOL=new Bn(An);var ki=ee(require("toformat")),Po=ki.default,bt=Po;var yt=ee(require("big.js")),Ti=ee(require("bn.js")),hi=ee(require("decimal.js-light"));var Ht=ae("module/fraction"),In=bt(yt.default),gt=bt(hi.default),Ao={[0]:gt.ROUND_DOWN,[1]:gt.ROUND_HALF_UP,[2]:gt.ROUND_UP},ko={[0]:yt.default.roundDown,[1]:yt.default.roundHalfUp,[2]:yt.default.roundUp},$=class{constructor(e,t=new Ti.default(1)){this.numerator=Ke(e),this.denominator=Ke(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new $(this.denominator,this.numerator)}add(e){let t=e instanceof $?e:new $(Ke(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 $(Ke(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 $(Ke(e));return new $(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof $?e:new $(Ke(e));return new $(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},i=1){Number.isInteger(e)||Ht.logWithError(`${e} is not an integer.`),e<=0&&Ht.logWithError(`${e} is not positive.`),gt.set({precision:e+1,rounding:Ao[i]});let r=new gt(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return r.toFormat(r.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},i=1){return Number.isInteger(e)||Ht.logWithError(`${e} is not an integer.`),e<0&&Ht.logWithError(`${e} is negative.`),In.DP=e,In.RM=ko[i]||1,new In(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var Ii=ee(require("bn.js"));var Bi=new $(new Ii.default(100)),Ae=class extends ${toSignificant(e=5,t,i){return this.mul(Bi).toSignificant(e,t,i)}toFixed(e=2,t,i){return this.mul(Bi).toFixed(e,t,i)}};var pa=ae("Raydium_price");function yn(n,e=1,t=[]){let i=[...n];if(e<=0)return t;for(;i.length;)t.push(i.splice(0,e));return t}var Ki=require("@solana/web3.js"),Ni=require("@solana/spl-token");var de=require("@solana/web3.js");var ue={CreateAccount:"CreateAccount",InitAccount:"InitAccount",CreateATA:"CreateATA",CloseAccount:"CloseAccount",TransferAmount:"TransferAmount",InitMint:"InitMint",MintTo:"MintTo",InitMarket:"InitMarket",Util1216OwnerClaim:"Util1216OwnerClaim",SetComputeUnitPrice:"SetComputeUnitPrice",SetComputeUnitLimit:"SetComputeUnitLimit",ClmmCreatePool:"ClmmCreatePool",ClmmOpenPosition:"ClmmOpenPosition",ClmmIncreasePosition:"ClmmIncreasePosition",ClmmDecreasePosition:"ClmmDecreasePosition",ClmmClosePosition:"ClmmClosePosition",ClmmSwapBaseIn:"ClmmSwapBaseIn",ClmmSwapBaseOut:"ClmmSwapBaseOut",ClmmInitReward:"ClmmInitReward",ClmmSetReward:"ClmmSetReward",ClmmCollectReward:"ClmmCollectReward",ClmmLockPosition:"ClmmLockPosition",ClmmHarvestLockPosition:"ClmmHarvestLockPosition",AmmV4Swap:"AmmV4Swap",AmmV4AddLiquidity:"AmmV4AddLiquidity",AmmV4RemoveLiquidity:"AmmV4RemoveLiquidity",AmmV4SimulatePoolInfo:"AmmV4SimulatePoolInfo",AmmV4SwapBaseIn:"AmmV4SwapBaseIn",AmmV4SwapBaseOut:"AmmV4SwapBaseOut",AmmV4CreatePool:"AmmV4CreatePool",AmmV4InitPool:"AmmV4InitPool",AmmV5AddLiquidity:"AmmV5AddLiquidity",AmmV5RemoveLiquidity:"AmmV5RemoveLiquidity",AmmV5SimulatePoolInfo:"AmmV5SimulatePoolInfo",AmmV5SwapBaseIn:"AmmV5SwapBaseIn",AmmV5SwapBaseOut:"AmmV5SwapBaseOut",RouteSwap:"RouteSwap",RouteSwap1:"RouteSwap1",RouteSwap2:"RouteSwap2",FarmV3Deposit:"FarmV3Deposit",FarmV3Withdraw:"FarmV3Withdraw",FarmV3CreateLedger:"FarmV3CreateLedger",FarmV4Withdraw:"FarmV4Withdraw",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut",CpmmLockLp:"CpmmLockLp",CpmmCollectLockFee:"CpmmCollectLockFee",TransferTip:"TransferTip"};var Ci=require("@solana/spl-token"),xi=ae("Raydium_txUtil"),Si=1644;function Zt(n){let e=[],t=[];return n.microLamports&&(e.push(de.ComputeBudgetProgram.setComputeUnitPrice({microLamports:n.microLamports})),t.push(ue.SetComputeUnitPrice)),n.units&&(e.push(de.ComputeBudgetProgram.setComputeUnitLimit({units:n.units})),t.push(ue.SetComputeUnitLimit)),{instructions:e,instructionTypes:t}}async function et(n,e){var i,r;let t=e!=null?e:"confirmed";return(r=await((i=n.getLatestBlockhash)==null?void 0:i.call(n,{commitment:t})))==null?void 0:r.blockhash}async function Yt(n,e){return n.getSignatureStatuses([e]),new Promise((t,i)=>{let r=setTimeout(i,6e4);n.onSignature(e,o=>{if(clearTimeout(r),!o.err){t("");return}i(Object.assign(o.err,{txId:e}))},"confirmed")})}function To(n,e){n.length<1&&xi.logWithError(`no instructions provided: ${n.toString()}`),e.length<1&&xi.logWithError(`no signers provided:, ${e.toString()}`);let t=new de.Transaction;t.recentBlockhash="11111111111111111111111111111111",t.feePayer=e[0],t.add(...n);try{return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64").length<Si}catch{return!1}}function ke(n,e){let[t,i]=de.PublicKey.findProgramAddressSync(n,e);return{publicKey:t,nonce:i}}function Pt({instructions:n,payer:e,signers:t}){return To(n,[e,...t])}function wt({instructions:n,payer:e,lookupTableAddressAccount:t,recentBlockhash:i=de.Keypair.generate().publicKey.toString()}){let o=new de.TransactionMessage({payerKey:e,recentBlockhash:i,instructions:n}).compileToV0Message(Object.values(t!=null?t:{}));try{return Buffer.from(new de.VersionedTransaction(o).serialize()).toString("base64").length<Si}catch{return!1}}var ho=n=>Buffer.isBuffer(n)?n:n instanceof Uint8Array?Buffer.from(n.buffer,n.byteOffset,n.byteLength):Buffer.from(n),Bo=n=>{let e=n.serialize({requireAllSignatures:!1,verifySignatures:!1});n instanceof de.VersionedTransaction&&(e=ho(e));try{return e instanceof Buffer?e.toString("base64"):Buffer.from(e).toString("base64")}catch{return e.toString("base64")}};function He(n){let e=[];return n.forEach(t=>{t instanceof de.Transaction&&(t.recentBlockhash||(t.recentBlockhash=Ci.TOKEN_PROGRAM_ID.toBase58()),t.feePayer||(t.feePayer=de.Keypair.generate().publicKey)),e.push(Bo(t))}),console.log("simulate tx string:",e),e}function ge(n,e,t){return ke([n.toBuffer(),(t!=null?t:Ni.TOKEN_PROGRAM_ID).toBuffer(),e.toBuffer()],new Ki.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}var v=require("@solana/web3.js"),qa=new v.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),Ga=new v.PublicKey("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Ua=new v.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),Xa=new v.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),Ha=new v.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),za=new v.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Za=new v.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),Ya=new v.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),ja=new v.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),Qa=new v.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),Io=new v.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),xo=new v.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Co=new v.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),Ja=new v.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),$a=new v.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),eu=new v.PublicKey("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),tu=new v.PublicKey("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),nu=new v.PublicKey("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),iu=new v.PublicKey("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),ru=new v.PublicKey("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),At=new v.PublicKey("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),Li=new v.PublicKey("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),ou=new v.PublicKey("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),jt=new v.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Qt=new v.PublicKey("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),su=new v.PublicKey("LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"),au=new v.PublicKey("WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh"),uu=new v.PublicKey("DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6"),cu=new v.PublicKey("5xqNaZXX5eUi4p5HU4oz9i5QnwRNT2y6oN7yyn4qENeq"),lu=new v.PublicKey("4Bu96XjU84XjPDSpveTVf6LYGCkfW5FK7SNkREWcEfV4"),mu=new v.PublicKey("6s1xP3hpbAfFoNtUNF8mfHsjr2Bd97JxFJRWLbL6aHuX");var du={OPEN_BOOK_PROGRAM:new v.PublicKey("EoTcMgcDRTJVZDMZWBoU6rhYHZfkNTVEAfz3uUJRcYGj"),SERUM_PROGRAM_ID_V3:new v.PublicKey("Ray1111111111111111111111111111111111111111"),AMM_V4:new v.PublicKey("DRaya7Kj3aMWQSy19kSjvmuwq9docCHofyP9kanQGaav"),AMM_STABLE:new v.PublicKey("DRayDdXc1NZQ9C3hRWmoSf8zK4iapgMnjdNZWrfwsP8m"),CLMM_PROGRAM_ID:new v.PublicKey("DRayAUgENGQBKVaX8owNhgzkEDyoHTGVEGHVJT1E9pfH"),CLMM_LOCK_PROGRAM_ID:new v.PublicKey("DRay25Usp3YJAi7beckgpGUC7mGJ2cR1AVPxhYfwVCUX"),CLMM_LOCK_AUTH_ID:new v.PublicKey("6Aoh8h2Lw2m5UGxYR8AdAL87jTWYeKoxM52mJRzfYwN"),CREATE_CPMM_POOL_PROGRAM:new v.PublicKey("DRaycpLY18LhpbydsBWbVJtxpNv9oXPgjRSfpF2bWpYb"),CREATE_CPMM_POOL_AUTH:new v.PublicKey("CXniRufdq5xL8t8jZAPxsPZDpuudwuJSPWnbcD5Y5Nxq"),CREATE_CPMM_POOL_FEE_ACC:new v.Publ