UNPKG

snapper-sdk

Version:

An SDK for building applications on top of Snapper.

1 lines 105 kB
"use strict";var On=Object.create;var it=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var Un=Object.getOwnPropertyNames;var qn=Object.getPrototypeOf,Gn=Object.prototype.hasOwnProperty;var Hn=(e,t)=>{for(var r in t)it(e,r,{get:t[r],enumerable:!0})},Sr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Un(t))!Gn.call(e,o)&&o!==r&&it(e,o,{get:()=>t[o],enumerable:!(n=Wn(t,o))||n.enumerable});return e};var ne=(e,t,r)=>(r=e!=null?On(qn(e)):{},Sr(t||!e||!e.__esModule?it(r,"default",{value:e,enumerable:!0}):r,e)),jn=e=>Sr(it({},"__esModule",{value:!0}),e);var Ci={};Hn(Ci,{default:()=>Ct});module.exports=jn(Ci);var D=require("@solana/web3.js"),Dn=require("@solana/spl-token");var Br=require("@solana/web3.js");var He=require("lodash");var Vt=class{constructor(t){this.logLevel=t.logLevel!==void 0?t.logLevel:0,this.name=t.name}set level(t){this.logLevel=t}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(t){return t<=this.logLevel}error(...t){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...t),this):this}logWithError(...t){let r=t.map(n=>typeof n=="object"?JSON.stringify(n):n).join(", ");throw new Error(r)}warning(...t){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...t),this):this}info(...t){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...t),this):this}debug(...t){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...t),this):this}},Lr={},zn={};function J(e){let t=(0,He.get)(Lr,e);if(!t){let r=(0,He.get)(zn,e);t=new Vt({name:e,logLevel:r}),(0,He.set)(Lr,e,t)}return t}var st=require("@solana/spl-token"),Et=J("Raydium_accountInfo_util");async function Rr(e,t,r){let{batchRequest:n,commitment:o="confirmed",chunkCount:i=100}={batchRequest:!1,...r},s=Mt(t,i),a=new Array(s.length).fill([]);if(n){let c=s.map(d=>{let f=e._buildArgs([d.map(p=>p.toBase58())],o,"base64");return{methodName:"getMultipleAccounts",args:f}}),u=Mt(c,10);a=(await(await Promise.all(u.map(async d=>await e._rpcBatchRequest(d)))).flat()).map(d=>(d.error&&Et.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${d.error.message}`),d.result.value.map(f=>{if(f){let{data:p,executable:g,lamports:m,owner:T,rentEpoch:w}=f;return p.length!==2&&p[1]!=="base64"&&Et.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(p[0],"base64"),executable:g,lamports:m,owner:new Br.PublicKey(T),rentEpoch:w}}return null})))}else try{a=await Promise.all(s.map(c=>e.getMultipleAccountsInfo(c,o)))}catch(c){c instanceof Error&&Et.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${c.message}`)}return a.flat()}var ye=ne(require("bn.js"));var _e=9e15,Be=1e9,Nt="0123456789abcdef",ut="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ct="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ft={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-_e,maxE:_e,crypto:!1},Er,we,K=!0,dt="[DecimalError] ",Le=dt+"Invalid argument: ",Mr=dt+"Precision limit exceeded",Nr=dt+"crypto unavailable",Fr="[object Decimal]",ie=Math.floor,ee=Math.pow,Yn=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Zn=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Xn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_r=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de=1e7,B=7,Qn=9007199254740991,Jn=ut.length-1,_t=ct.length-1,y={toStringTag:Fr};y.absoluteValue=y.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),I(e)};y.ceil=function(){return I(new this.constructor(this),this.e+1,2)};y.clampedTo=y.clamp=function(e,t){var r,n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(Le+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new o(n)};y.comparedTo=y.cmp=function(e){var t,r,n,o,i=this,s=i.d,a=(e=new i.constructor(e)).d,c=i.s,u=e.s;if(!s||!a)return!c||!u?NaN:c!==u?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-u:0;if(c!==u)return c;if(i.e!==e.e)return i.e>e.e^c<0?1:-1;for(n=s.length,o=a.length,t=0,r=n<o?n:o;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return n===o?0:n>o^c<0?1:-1};y.cosine=y.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+B,n.rounding=1,r=$n(n,Ur(n,r)),n.precision=e,n.rounding=t,I(we==2||we==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};y.cubeRoot=y.cbrt=function(){var e,t,r,n,o,i,s,a,c,u,l=this,d=l.constructor;if(!l.isFinite()||l.isZero())return new d(l);for(K=!1,i=l.s*ee(l.s*l,1/3),!i||Math.abs(i)==1/0?(r=oe(l.d),e=l.e,(i=(e-r.length+1)%3)&&(r+=i==1||i==-2?"0":"00"),i=ee(r,1/3),e=ie((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?r="5e"+e:(r=i.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new d(r),n.s=l.s):n=new d(i.toString()),s=(e=d.precision)+3;;)if(a=n,c=a.times(a).times(a),u=c.plus(l),n=j(u.plus(l).times(a),u.plus(c),s+2,1),oe(a.d).slice(0,s)===(r=oe(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!o&&r=="4999"){if(!o&&(I(a,e+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,o=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(I(n,e+1,1),t=!n.times(n).times(n).eq(l));break}return K=!0,I(n,e,d.rounding,t)};y.decimalPlaces=y.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ie(this.e/B))*B,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};y.dividedBy=y.div=function(e){return j(this,new this.constructor(e))};y.dividedToIntegerBy=y.divToInt=function(e){var t=this,r=t.constructor;return I(j(t,new r(e),0,1,1),r.precision,r.rounding)};y.equals=y.eq=function(e){return this.cmp(e)===0};y.floor=function(){return I(new this.constructor(this),this.e+1,3)};y.greaterThan=y.gt=function(e){return this.cmp(e)>0};y.greaterThanOrEqualTo=y.gte=function(e){var t=this.cmp(e);return t==1||t===0};y.hyperbolicCosine=y.cosh=function(){var e,t,r,n,o,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(i.e,i.sd())+4,s.rounding=1,o=i.d.length,o<32?(e=Math.ceil(o/3),t=(1/pt(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=ve(s,1,i.times(t),new s(1),!0);for(var c,u=e,l=new s(8);u--;)c=i.times(i),i=a.minus(c.times(l.minus(c.times(l))));return I(i,s.precision=r,s.rounding=n,!0)};y.hyperbolicSine=y.sinh=function(){var e,t,r,n,o=this,i=o.constructor;if(!o.isFinite()||o.isZero())return new i(o);if(t=i.precision,r=i.rounding,i.precision=t+Math.max(o.e,o.sd())+4,i.rounding=1,n=o.d.length,n<3)o=ve(i,2,o,o,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,o=o.times(1/pt(5,e)),o=ve(i,2,o,o,!0);for(var s,a=new i(5),c=new i(16),u=new i(20);e--;)s=o.times(o),o=o.times(a.plus(s.times(c.times(s).plus(u))))}return i.precision=t,i.rounding=r,I(o,t,r,!0)};y.hyperbolicTangent=y.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,j(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};y.inverseCosine=y.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),o=r.precision,i=r.rounding;return n!==-1?n===0?t.isNeg()?le(r,o,i):new r(0):new r(NaN):t.isZero()?le(r,o+4,i).times(.5):(r.precision=o+6,r.rounding=1,t=t.asin(),e=le(r,o+4,i).times(.5),r.precision=o,r.rounding=i,e.minus(t))};y.inverseHyperbolicCosine=y.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,K=!1,r=r.times(r).minus(1).sqrt().plus(r),K=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};y.inverseHyperbolicSine=y.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,K=!1,r=r.times(r).plus(1).sqrt().plus(r),K=!0,n.precision=e,n.rounding=t,r.ln())};y.inverseHyperbolicTangent=y.atanh=function(){var e,t,r,n,o=this,i=o.constructor;return o.isFinite()?o.e>=0?new i(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=i.precision,t=i.rounding,n=o.sd(),Math.max(n,e)<2*-o.e-1?I(new i(o),e,t,!0):(i.precision=r=n-o.e,o=j(o.plus(1),new i(1).minus(o),r+e,1),i.precision=e+4,i.rounding=1,o=o.ln(),i.precision=e,i.rounding=t,o.times(.5))):new i(NaN)};y.inverseSine=y.asin=function(){var e,t,r,n,o=this,i=o.constructor;return o.isZero()?new i(o):(t=o.abs().cmp(1),r=i.precision,n=i.rounding,t!==-1?t===0?(e=le(i,r+4,n).times(.5),e.s=o.s,e):new i(NaN):(i.precision=r+6,i.rounding=1,o=o.div(new i(1).minus(o.times(o)).sqrt().plus(1)).atan(),i.precision=r,i.rounding=n,o.times(2)))};y.inverseTangent=y.atan=function(){var e,t,r,n,o,i,s,a,c,u=this,l=u.constructor,d=l.precision,f=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&d+4<=_t)return s=le(l,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(d+4<=_t)return s=le(l,d+4,f).times(.5),s.s=u.s,s}for(l.precision=a=d+10,l.rounding=1,r=Math.min(28,a/B+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(K=!1,t=Math.ceil(a/B),n=1,c=u.times(u),s=new l(u),o=u;e!==-1;)if(o=o.times(c),i=s.minus(o.div(n+=2)),o=o.times(c),s=i.plus(o.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===i.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),K=!0,I(s,l.precision=d,l.rounding=f,!0)};y.isFinite=function(){return!!this.d};y.isInteger=y.isInt=function(){return!!this.d&&ie(this.e/B)>this.d.length-2};y.isNaN=function(){return!this.s};y.isNegative=y.isNeg=function(){return this.s<0};y.isPositive=y.isPos=function(){return this.s>0};y.isZero=function(){return!!this.d&&this.d[0]===0};y.lessThan=y.lt=function(e){return this.cmp(e)<0};y.lessThanOrEqualTo=y.lte=function(e){return this.cmp(e)<1};y.logarithm=y.log=function(e){var t,r,n,o,i,s,a,c,u=this,l=u.constructor,d=l.precision,f=l.rounding,p=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new l(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)i=!0;else{for(o=r[0];o%10===0;)o/=10;i=o!==1}if(K=!1,a=d+p,s=Se(u,a),n=t?lt(l,a+10):Se(e,a),c=j(s,n,a,1),je(c.d,o=d,f))do if(a+=10,s=Se(u,a),n=t?lt(l,a+10):Se(e,a),c=j(s,n,a,1),!i){+oe(c.d).slice(o+1,o+15)+1==1e14&&(c=I(c,d+1,0));break}while(je(c.d,o+=10,f));return K=!0,I(c,d,f)};y.minus=y.sub=function(e){var t,r,n,o,i,s,a,c,u,l,d,f,p=this,g=p.constructor;if(e=new g(e),!p.d||!e.d)return!p.s||!e.s?e=new g(NaN):p.d?e.s=-e.s:e=new g(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(u=p.d,f=e.d,a=g.precision,c=g.rounding,!u[0]||!f[0]){if(f[0])e.s=-e.s;else if(u[0])e=new g(p);else return new g(c===3?-0:0);return K?I(e,a,c):e}if(r=ie(e.e/B),l=ie(p.e/B),u=u.slice(),i=l-r,i){for(d=i<0,d?(t=u,i=-i,s=f.length):(t=f,r=l,s=u.length),n=Math.max(Math.ceil(a/B),s)+2,i>n&&(i=n,t.length=1),t.reverse(),n=i;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=f.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}i=0}for(d&&(t=u,u=f,f=t,e.s=-e.s),s=u.length,n=f.length-s;n>0;--n)u[s++]=0;for(n=f.length;n>i;){if(u[--n]<f[n]){for(o=n;o&&u[--o]===0;)u[o]=de-1;--u[o],u[n]+=de}u[n]-=f[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=ft(u,r),K?I(e,a,c):e):new g(c===3?-0:0)};y.modulo=y.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?I(new n(r),n.precision,n.rounding):(K=!1,n.modulo==9?(t=j(r,e.abs(),0,3,1),t.s*=e.s):t=j(r,e,0,n.modulo,1),t=t.times(e),K=!0,r.minus(t))};y.naturalExponential=y.exp=function(){return vt(this)};y.naturalLogarithm=y.ln=function(){return Se(this)};y.negated=y.neg=function(){var e=new this.constructor(this);return e.s=-e.s,I(e)};y.plus=y.add=function(e){var t,r,n,o,i,s,a,c,u,l,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(u=d.d,l=e.d,a=f.precision,c=f.rounding,!u[0]||!l[0])return l[0]||(e=new f(d)),K?I(e,a,c):e;if(i=ie(d.e/B),n=ie(e.e/B),u=u.slice(),o=i-n,o){for(o<0?(r=u,o=-o,s=l.length):(r=l,n=i,s=u.length),i=Math.ceil(a/B),s=i>s?i+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=u.length,o=l.length,s-o<0&&(o=s,r=l,l=u,u=r),t=0;o;)t=(u[--o]=u[o]+l[o]+t)/de|0,u[o]%=de;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=ft(u,n),K?I(e,a,c):e};y.precision=y.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Le+e);return r.d?(t=vr(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};y.round=function(){var e=this,t=e.constructor;return I(new t(e),e.e+1,t.rounding)};y.sine=y.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+B,n.rounding=1,r=to(n,Ur(n,r)),n.precision=e,n.rounding=t,I(we>2?r.neg():r,e,t,!0)):new n(NaN)};y.squareRoot=y.sqrt=function(){var e,t,r,n,o,i,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(K=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=oe(a),(t.length+c)%2==0&&(t+="0"),u=Math.sqrt(t),c=ie((c+1)/2)-(c<0||c%2),u==1/0?t="5e"+c:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new l(t)):n=new l(u.toString()),r=(c=l.precision)+3;;)if(i=n,n=i.plus(j(s,i,r+2,1)).times(.5),oe(i.d).slice(0,r)===(t=oe(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!o&&t=="4999"){if(!o&&(I(i,c+1,0),i.times(i).eq(s))){n=i;break}r+=4,o=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(I(n,c+1,1),e=!n.times(n).eq(s));break}return K=!0,I(n,c,l.rounding,e)};y.tangent=y.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=j(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,I(we==2||we==4?r.neg():r,e,t,!0)):new n(NaN)};y.times=y.mul=function(e){var t,r,n,o,i,s,a,c,u,l=this,d=l.constructor,f=l.d,p=(e=new d(e)).d;if(e.s*=l.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(r=ie(l.e/B)+ie(e.e/B),c=f.length,u=p.length,c<u&&(i=f,f=p,p=i,s=c,c=u,u=s),i=[],s=c+u,n=s;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,o=c+n;o>n;)a=i[o]+p[n]*f[o-n-1]+t,i[o--]=a%de|0,t=a/de|0;i[o]=(i[o]+t)%de|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=ft(i,r),K?I(e,d.precision,d.rounding):e};y.toBinary=function(e,t){return Ot(this,2,e,t)};y.toDecimalPlaces=y.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ue(e,0,Be),t===void 0?t=n.rounding:ue(t,0,8),I(r,e+r.e+1,t))};y.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=ge(n,!0):(ue(e,0,Be),t===void 0?t=o.rounding:ue(t,0,8),n=I(new o(n),e+1,t),r=ge(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};y.toFixed=function(e,t){var r,n,o=this,i=o.constructor;return e===void 0?r=ge(o):(ue(e,0,Be),t===void 0?t=i.rounding:ue(t,0,8),n=I(new i(o),e+o.e+1,t),r=ge(n,!1,e+n.e+1)),o.isNeg()&&!o.isZero()?"-"+r:r};y.toFraction=function(e){var t,r,n,o,i,s,a,c,u,l,d,f,p=this,g=p.d,m=p.constructor;if(!g)return new m(p);if(u=r=new m(1),n=c=new m(0),t=new m(n),i=t.e=vr(g)-p.e-1,s=i%B,t.d[0]=ee(10,s<0?B+s:s),e==null)e=i>0?t:u;else{if(a=new m(e),!a.isInt()||a.lt(u))throw Error(Le+a);e=a.gt(t)?i>0?t:u:a}for(K=!1,a=new m(oe(g)),l=m.precision,m.precision=i=g.length*B*2;d=j(a,t,0,1,1),o=r.plus(d.times(n)),o.cmp(e)!=1;)r=n,n=o,o=u,u=c.plus(d.times(o)),c=o,o=t,t=a.minus(d.times(o)),a=o;return o=j(e.minus(r),n,0,1,1),c=c.plus(o.times(u)),r=r.plus(o.times(n)),c.s=u.s=p.s,f=j(u,n,i,1).minus(p).abs().cmp(j(c,r,i,1).minus(p).abs())<1?[u,n]:[c,r],m.precision=l,K=!0,f};y.toHexadecimal=y.toHex=function(e,t){return Ot(this,16,e,t)};y.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ue(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(K=!1,r=j(r,e,0,t,1).times(e),K=!0,I(r)):(e.s=r.s,r=e),r};y.toNumber=function(){return+this};y.toOctal=function(e,t){return Ot(this,8,e,t)};y.toPower=y.pow=function(e){var t,r,n,o,i,s,a=this,c=a.constructor,u=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(ee(+a,u));if(a=new c(a),a.eq(1))return a;if(n=c.precision,i=c.rounding,e.eq(1))return I(a,n,i);if(t=ie(e.e/B),t>=e.d.length-1&&(r=u<0?-u:u)<=Qn)return o=Dr(c,a,r,n),e.s<0?new c(1).div(o):I(o,n,i);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=ee(+a,u),t=r==0||!isFinite(r)?ie(u*(Math.log("0."+oe(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(K=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),o=vt(e.times(Se(a,n+r)),n),o.d&&(o=I(o,n+5,1),je(o.d,n,i)&&(t=n+10,o=I(vt(e.times(Se(a,t+r)),t),t+5,1),+oe(o.d).slice(n+1,n+15)+1==1e14&&(o=I(o,n+1,0)))),o.s=s,K=!0,c.rounding=i,I(o,n,i))};y.toPrecision=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=ge(n,n.e<=o.toExpNeg||n.e>=o.toExpPos):(ue(e,1,Be),t===void 0?t=o.rounding:ue(t,0,8),n=I(new o(n),e,t),r=ge(n,e<=n.e||n.e<=o.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};y.toSignificantDigits=y.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ue(e,1,Be),t===void 0?t=n.rounding:ue(t,0,8)),I(new n(r),e,t)};y.toString=function(){var e=this,t=e.constructor,r=ge(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};y.truncated=y.trunc=function(){return I(new this.constructor(this),this.e+1,1)};y.valueOf=y.toJSON=function(){var e=this,t=e.constructor,r=ge(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function oe(e){var t,r,n,o=e.length-1,i="",s=e[0];if(o>0){for(i+=s,t=1;t<o;t++)n=e[t]+"",r=B-n.length,r&&(i+=Ie(r)),i+=n;s=e[t],n=s+"",r=B-n.length,r&&(i+=Ie(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}function ue(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Le+e)}function je(e,t,r,n){var o,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=B,o=0):(o=Math.ceil((t+1)/B),t%=B),i=ee(10,B-t),a=e[o]%i|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==i||r>3&&a+1==i/2)&&(e[o+1]/i/100|0)==ee(10,t-2)-1||(a==i/2||a==0)&&(e[o+1]/i/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==i||!n&&r>3&&a+1==i/2)&&(e[o+1]/i/1e3|0)==ee(10,t-3)-1,s}function at(e,t,r){for(var n,o=[0],i,s=0,a=e.length;s<a;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=Nt.indexOf(e.charAt(s++)),n=0;n<o.length;n++)o[n]>r-1&&(o[n+1]===void 0&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function $n(e,t){var r,n,o;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),o=(1/pt(4,r)).toString()):(r=16,o="2.3283064365386962890625e-10"),e.precision+=r,t=ve(e,1,t.times(o),new e(1));for(var i=r;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var j=function(){function e(n,o,i){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*o+a,n[c]=s%i|0,a=s/i|0;return a&&n.unshift(a),n}function t(n,o,i,s){var a,c;if(i!=s)c=i>s?1:-1;else for(a=c=0;a<i;a++)if(n[a]!=o[a]){c=n[a]>o[a]?1:-1;break}return c}function r(n,o,i,s){for(var a=0;i--;)n[i]-=a,a=n[i]<o[i]?1:0,n[i]=a*s+n[i]-o[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,o,i,s,a,c){var u,l,d,f,p,g,m,T,w,x,b,k,A,C,F,v,R,H,q,Z,_=n.constructor,re=n.s==o.s?1:-1,Q=n.d,O=o.d;if(!Q||!Q[0]||!O||!O[0])return new _(!n.s||!o.s||(Q?O&&Q[0]==O[0]:!O)?NaN:Q&&Q[0]==0||!O?re*0:re/0);for(c?(p=1,l=n.e-o.e):(c=de,p=B,l=ie(n.e/p)-ie(o.e/p)),q=O.length,R=Q.length,w=new _(re),x=w.d=[],d=0;O[d]==(Q[d]||0);d++);if(O[d]>(Q[d]||0)&&l--,i==null?(C=i=_.precision,s=_.rounding):a?C=i+(n.e-o.e)+1:C=i,C<0)x.push(1),g=!0;else{if(C=C/p+2|0,d=0,q==1){for(f=0,O=O[0],C++;(d<R||f)&&C--;d++)F=f*c+(Q[d]||0),x[d]=F/O|0,f=F%O|0;g=f||d<R}else{for(f=c/(O[0]+1)|0,f>1&&(O=e(O,f,c),Q=e(Q,f,c),q=O.length,R=Q.length),v=q,b=Q.slice(0,q),k=b.length;k<q;)b[k++]=0;Z=O.slice(),Z.unshift(0),H=O[0],O[1]>=c/2&&++H;do f=0,u=t(O,b,q,k),u<0?(A=b[0],q!=k&&(A=A*c+(b[1]||0)),f=A/H|0,f>1?(f>=c&&(f=c-1),m=e(O,f,c),T=m.length,k=b.length,u=t(m,b,T,k),u==1&&(f--,r(m,q<T?Z:O,T,c))):(f==0&&(u=f=1),m=O.slice()),T=m.length,T<k&&m.unshift(0),r(b,m,k,c),u==-1&&(k=b.length,u=t(O,b,q,k),u<1&&(f++,r(b,q<k?Z:O,k,c))),k=b.length):u===0&&(f++,b=[0]),x[d++]=f,u&&b[0]?b[k++]=Q[v]||0:(b=[Q[v]],k=1);while((v++<R||b[0]!==void 0)&&C--);g=b[0]!==void 0}x[0]||x.shift()}if(p==1)w.e=l,Er=g;else{for(d=1,f=x[0];f>=10;f/=10)d++;w.e=d+l*p-1,I(w,a?i+w.e+1:i,s,g)}return w}}();function I(e,t,r,n){var o,i,s,a,c,u,l,d,f,p=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(o=1,a=d[0];a>=10;a/=10)o++;if(i=t-o,i<0)i+=B,s=t,l=d[f=0],c=l/ee(10,o-s-1)%10|0;else if(f=Math.ceil((i+1)/B),a=d.length,f>=a)if(n){for(;a++<=f;)d.push(0);l=c=0,o=1,i%=B,s=i-B+1}else break e;else{for(l=a=d[f],o=1;a>=10;a/=10)o++;i%=B,s=i-B+o,c=s<0?0:l/ee(10,o-s-1)%10|0}if(n=n||t<0||d[f+1]!==void 0||(s<0?l:l%ee(10,o-s-1)),u=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(i>0?s>0?l/ee(10,o-s):0:d[f-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,u?(t-=e.e+1,d[0]=ee(10,(B-t%B)%B),e.e=-t||0):d[0]=e.e=0,e;if(i==0?(d.length=f,a=1,f--):(d.length=f+1,a=ee(10,B-i),d[f]=s>0?(l/ee(10,o-s)%ee(10,s)|0)*a:0),u)for(;;)if(f==0){for(i=1,s=d[0];s>=10;s/=10)i++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,d[0]==de&&(d[0]=1));break}else{if(d[f]+=a,d[f]!=de)break;d[f--]=0,a=1}for(i=d.length;d[--i]===0;)d.pop()}return K&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function ge(e,t,r){if(!e.isFinite())return Wr(e);var n,o=e.e,i=oe(e.d),s=i.length;return t?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+Ie(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):o<0?(i="0."+Ie(-o-1)+i,r&&(n=r-s)>0&&(i+=Ie(n))):o>=s?(i+=Ie(o+1-s),r&&(n=r-o-1)>0&&(i=i+"."+Ie(n))):((n=o+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(o+1===s&&(i+="."),i+=Ie(n))),i}function ft(e,t){var r=e[0];for(t*=B;r>=10;r/=10)t++;return t}function lt(e,t,r){if(t>Jn)throw K=!0,r&&(e.precision=r),Error(Mr);return I(new e(ut),t,1,!0)}function le(e,t,r){if(t>_t)throw Error(Mr);return I(new e(ct),t,r,!0)}function vr(e){var t=e.length-1,r=t*B+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Ie(e){for(var t="";e--;)t+="0";return t}function Dr(e,t,r,n){var o,i=new e(1),s=Math.ceil(n/B+4);for(K=!1;;){if(r%2&&(i=i.times(t),Cr(i.d,s)&&(o=!0)),r=ie(r/2),r===0){r=i.d.length-1,o&&i.d[r]===0&&++i.d[r];break}t=t.times(t),Cr(t.d,s)}return K=!0,i}function Kr(e){return e.d[e.d.length-1]&1}function Or(e,t,r){for(var n,o=new e(t[0]),i=0;++i<t.length;)if(n=new e(t[i]),n.s)o[r](n)&&(o=n);else{o=n;break}return o}function vt(e,t){var r,n,o,i,s,a,c,u=0,l=0,d=0,f=e.constructor,p=f.rounding,g=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(K=!1,c=g):c=t,a=new f(.03125);e.e>-2;)e=e.times(a),d+=5;for(n=Math.log(ee(2,d))/Math.LN10*2+5|0,c+=n,r=i=s=new f(1),f.precision=c;;){if(i=I(i.times(e),c,1),r=r.times(++l),a=s.plus(j(i,r,c,1)),oe(a.d).slice(0,c)===oe(s.d).slice(0,c)){for(o=d;o--;)s=I(s.times(s),c,1);if(t==null)if(u<3&&je(s.d,c-n,p,u))f.precision=c+=10,r=i=a=new f(1),l=0,u++;else return I(s,f.precision=g,p,K=!0);else return f.precision=g,s}s=a}}function Se(e,t){var r,n,o,i,s,a,c,u,l,d,f,p=1,g=10,m=e,T=m.d,w=m.constructor,x=w.rounding,b=w.precision;if(m.s<0||!T||!T[0]||!m.e&&T[0]==1&&T.length==1)return new w(T&&!T[0]?-1/0:m.s!=1?NaN:T?0:m);if(t==null?(K=!1,l=b):l=t,w.precision=l+=g,r=oe(T),n=r.charAt(0),Math.abs(i=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=oe(m.d),n=r.charAt(0),p++;i=m.e,n>1?(m=new w("0."+r),i++):m=new w(n+"."+r.slice(1))}else return u=lt(w,l+2,b).times(i+""),m=Se(new w(n+"."+r.slice(1)),l-g).plus(u),w.precision=b,t==null?I(m,b,x,K=!0):m;for(d=m,c=s=m=j(m.minus(1),m.plus(1),l,1),f=I(m.times(m),l,1),o=3;;){if(s=I(s.times(f),l,1),u=c.plus(j(s,new w(o),l,1)),oe(u.d).slice(0,l)===oe(c.d).slice(0,l))if(c=c.times(2),i!==0&&(c=c.plus(lt(w,l+2,b).times(i+""))),c=j(c,new w(p),l,1),t==null)if(je(c.d,l-g,x,a))w.precision=l+=g,u=s=m=j(d.minus(1),d.plus(1),l,1),f=I(m.times(m),l,1),o=a=1;else return I(c,w.precision=b,x,K=!0);else return w.precision=b,c;c=u,o+=2}}function Wr(e){return String(e.s*e.s/0)}function Dt(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(o=t.length;t.charCodeAt(o-1)===48;--o);if(t=t.slice(n,o),t){if(o-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%B,r<0&&(n+=B),n<o){for(n&&e.d.push(+t.slice(0,n)),o-=B;n<o;)e.d.push(+t.slice(n,n+=B));t=t.slice(n),n=B-t.length}else n-=o;for(;n--;)t+="0";e.d.push(+t),K&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function eo(e,t){var r,n,o,i,s,a,c,u,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),_r.test(t))return Dt(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Zn.test(t))r=16,t=t.toLowerCase();else if(Yn.test(t))r=2;else if(Xn.test(t))r=8;else throw Error(Le+t);for(i=t.search(/p/i),i>0?(c=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),s=i>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,i=a-i,o=Dr(n,new n(r),i,i*2)),u=at(t,r,de),l=u.length-1,i=l;u[i]===0;--i)u.pop();return i<0?new n(e.s*0):(e.e=ft(u,l),e.d=u,K=!1,s&&(e=j(e,o,a*4)),c&&(e=e.times(Math.abs(c)<54?ee(2,c):ze.pow(2,c))),K=!0,e)}function to(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ve(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/pt(5,r)),t=ve(e,2,t,t);for(var o,i=new e(5),s=new e(16),a=new e(20);r--;)o=t.times(t),t=t.times(i.plus(o.times(s.times(o).minus(a))));return t}function ve(e,t,r,n,o){var i,s,a,c,u=1,l=e.precision,d=Math.ceil(l/B);for(K=!1,c=r.times(r),a=new e(n);;){if(s=j(a.times(c),new e(t++*t++),l,1),a=o?n.plus(s):n.minus(s),n=j(s.times(c),new e(t++*t++),l,1),s=a.plus(n),s.d[d]!==void 0){for(i=d;s.d[i]===a.d[i]&&i--;);if(i==-1)break}i=a,a=n,n=s,s=i,u++}return K=!0,s.d.length=d+1,s}function pt(e,t){for(var r=e;--t;)r*=e;return r}function Ur(e,t){var r,n=t.s<0,o=le(e,e.precision,1),i=o.times(.5);if(t=t.abs(),t.lte(i))return we=n?4:1,t;if(r=t.divToInt(o),r.isZero())we=n?3:2;else{if(t=t.minus(r.times(o)),t.lte(i))return we=Kr(r)?n?2:3:n?4:1,t;we=Kr(r)?n?1:4:n?3:2}return t.minus(o).abs()}function Ot(e,t,r,n){var o,i,s,a,c,u,l,d,f,p=e.constructor,g=r!==void 0;if(g?(ue(r,1,Be),n===void 0?n=p.rounding:ue(n,0,8)):(r=p.precision,n=p.rounding),!e.isFinite())l=Wr(e);else{for(l=ge(e),s=l.indexOf("."),g?(o=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):o=t,s>=0&&(l=l.replace(".",""),f=new p(1),f.e=l.length-s,f.d=at(ge(f),10,o),f.e=f.d.length),d=at(l,10,o),i=c=d.length;d[--c]==0;)d.pop();if(!d[0])l=g?"0p+0":"0";else{if(s<0?i--:(e=new p(e),e.d=d,e.e=i,e=j(e,f,r,n,0,o),d=e.d,i=e.e,u=Er),s=d[r],a=o/2,u=u||d[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&d[r-1]&1||n===(e.s<0?8:7)),d.length=r,u)for(;++d[--r]>o-1;)d[r]=0,r||(++i,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,l="";s<c;s++)l+=Nt.charAt(d[s]);if(g){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)l+="0";for(d=at(l,o,t),c=d.length;!d[c-1];--c);for(s=1,l="1.";s<c;s++)l+=Nt.charAt(d[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)l="0"+l;l="0."+l}else if(++i>c)for(i-=c;i--;)l+="0";else i<c&&(l=l.slice(0,i)+"."+l.slice(i))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function Cr(e,t){if(e.length>t)return e.length=t,!0}function ro(e){return new this(e).abs()}function no(e){return new this(e).acos()}function oo(e){return new this(e).acosh()}function io(e,t){return new this(e).plus(t)}function so(e){return new this(e).asin()}function ao(e){return new this(e).asinh()}function uo(e){return new this(e).atan()}function co(e){return new this(e).atanh()}function lo(e,t){e=new this(e),t=new this(t);var r,n=this.precision,o=this.rounding,i=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=le(this,i,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?le(this,n,o):new this(0),r.s=e.s):!e.d||t.isZero()?(r=le(this,i,1).times(.5),r.s=e.s):t.s<0?(this.precision=i,this.rounding=1,r=this.atan(j(e,t,i,1)),t=le(this,i,1),this.precision=n,this.rounding=o,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(j(e,t,i,1)),r}function fo(e){return new this(e).cbrt()}function po(e){return I(e=new this(e),e.e+1,2)}function mo(e,t,r){return new this(e).clamp(t,r)}function go(e){if(!e||typeof e!="object")throw Error(dt+"Object expected");var t,r,n,o=e.defaults===!0,i=["precision",1,Be,"rounding",0,8,"toExpNeg",-_e,0,"toExpPos",0,_e,"maxE",0,_e,"minE",-_e,0,"modulo",0,9];for(t=0;t<i.length;t+=3)if(r=i[t],o&&(this[r]=Ft[r]),(n=e[r])!==void 0)if(ie(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Le+r+": "+n);if(r="crypto",o&&(this[r]=Ft[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Nr);else this[r]=!1;else throw Error(Le+r+": "+n);return this}function yo(e){return new this(e).cos()}function ho(e){return new this(e).cosh()}function qr(e){var t,r,n;function o(i){var s,a,c,u=this;if(!(u instanceof o))return new o(i);if(u.constructor=o,Vr(i)){u.s=i.s,K?!i.d||i.e>o.maxE?(u.e=NaN,u.d=null):i.e<o.minE?(u.e=0,u.d=[0]):(u.e=i.e,u.d=i.d.slice()):(u.e=i.e,u.d=i.d?i.d.slice():i.d);return}if(c=typeof i,c==="number"){if(i===0){u.s=1/i<0?-1:1,u.e=0,u.d=[0];return}if(i<0?(i=-i,u.s=-1):u.s=1,i===~~i&&i<1e7){for(s=0,a=i;a>=10;a/=10)s++;K?s>o.maxE?(u.e=NaN,u.d=null):s<o.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[i]):(u.e=s,u.d=[i]);return}else if(i*0!==0){i||(u.s=NaN),u.e=NaN,u.d=null;return}return Dt(u,i.toString())}else if(c!=="string")throw Error(Le+i);return(a=i.charCodeAt(0))===45?(i=i.slice(1),u.s=-1):(a===43&&(i=i.slice(1)),u.s=1),_r.test(i)?Dt(u,i):eo(u,i)}if(o.prototype=y,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=go,o.clone=qr,o.isDecimal=Vr,o.abs=ro,o.acos=no,o.acosh=oo,o.add=io,o.asin=so,o.asinh=ao,o.atan=uo,o.atanh=co,o.atan2=lo,o.cbrt=fo,o.ceil=po,o.clamp=mo,o.cos=yo,o.cosh=ho,o.div=bo,o.exp=wo,o.floor=xo,o.hypot=Po,o.ln=To,o.log=ko,o.log10=Io,o.log2=Ao,o.max=So,o.min=Lo,o.mod=Bo,o.mul=Ro,o.pow=Ko,o.random=Co,o.round=Vo,o.sign=Eo,o.sin=Mo,o.sinh=No,o.sqrt=Fo,o.sub=_o,o.sum=vo,o.tan=Do,o.tanh=Oo,o.trunc=Wo,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return o.config(e),o}function bo(e,t){return new this(e).div(t)}function wo(e){return new this(e).exp()}function xo(e){return I(e=new this(e),e.e+1,3)}function Po(){var e,t,r=new this(0);for(K=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return K=!0,new this(1/0);r=t}return K=!0,r.sqrt()}function Vr(e){return e instanceof ze||e&&e.toStringTag===Fr||!1}function To(e){return new this(e).ln()}function ko(e,t){return new this(e).log(t)}function Ao(e){return new this(e).log(2)}function Io(e){return new this(e).log(10)}function So(){return Or(this,arguments,"lt")}function Lo(){return Or(this,arguments,"gt")}function Bo(e,t){return new this(e).mod(t)}function Ro(e,t){return new this(e).mul(t)}function Ko(e,t){return new this(e).pow(t)}function Co(e){var t,r,n,o,i=0,s=new this(1),a=[];if(e===void 0?e=this.precision:ue(e,1,Be),n=Math.ceil(e/B),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));i<n;)o=t[i],o>=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=o%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);i<n;)o=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+((t[i+3]&127)<<24),o>=214e7?crypto.randomBytes(4).copy(t,i):(a.push(o%1e7),i+=4);i=n/4}else throw Error(Nr);else for(;i<n;)a[i++]=Math.random()*1e7|0;for(n=a[--i],e%=B,n&&e&&(o=ee(10,B-e),a[i]=(n/o|0)*o);a[i]===0;i--)a.pop();if(i<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=B)a.shift();for(n=1,o=a[0];o>=10;o/=10)n++;n<B&&(r-=B-n)}return s.e=r,s.d=a,s}function Vo(e){return I(e=new this(e),e.e+1,this.rounding)}function Eo(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Mo(e){return new this(e).sin()}function No(e){return new this(e).sinh()}function Fo(e){return new this(e).sqrt()}function _o(e,t){return new this(e).sub(t)}function vo(){var e=0,t=arguments,r=new this(t[e]);for(K=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return K=!0,I(r,this.precision,this.rounding)}function Do(e){return new this(e).tan()}function Oo(e){return new this(e).tanh()}function Wo(e){return I(e=new this(e),e.e+1,1)}y[Symbol.for("nodejs.util.inspect.custom")]=y.toString;y[Symbol.toStringTag]="Decimal";var ze=y.constructor=qr(Ft);ut=new ze(ut);ct=new ze(ct);var Wt=ze;var Zr=ne(require("big.js")),Qe=ne(require("bn.js"));var Gr=ne(require("toformat")),Uo=Gr.default,Ye=Uo;var Ze=ne(require("big.js")),jr=ne(require("bn.js")),zr=ne(require("decimal.js-light"));var De=ne(require("bn.js"));var Hr=9007199254740991;function M(e){let t=J("Raydium_parseBigNumberish");if(e instanceof De.default)return e;if(typeof e=="string"){if(e.match(/^-?[0-9]+$/))return new De.default(e);t.logWithError(`invalid BigNumberish string: ${e}`)}return typeof e=="number"?(e%1&&t.logWithError(`BigNumberish number underflow: ${e}`),(e>=Hr||e<=-Hr)&&t.logWithError(`BigNumberish number overflow: ${e}`),new De.default(String(e))):typeof e=="bigint"?new De.default(e.toString()):(t.error(`invalid BigNumberish value: ${e}`),new De.default(0))}var mt=J("module/fraction"),Ut=Ye(Ze.default),Xe=Ye(zr.default),Go={[0]:Xe.ROUND_DOWN,[1]:Xe.ROUND_HALF_UP,[2]:Xe.ROUND_UP},Ho={[0]:Ze.default.roundDown,[1]:Ze.default.roundHalfUp,[2]:Ze.default.roundUp},W=class{constructor(t,r=new jr.default(1)){this.numerator=M(t),this.denominator=M(r)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new W(this.denominator,this.numerator)}add(t){let r=t instanceof W?t:new W(M(t));return this.denominator.eq(r.denominator)?new W(this.numerator.add(r.numerator),this.denominator):new W(this.numerator.mul(r.denominator).add(r.numerator.mul(this.denominator)),this.denominator.mul(r.denominator))}sub(t){let r=t instanceof W?t:new W(M(t));return this.denominator.eq(r.denominator)?new W(this.numerator.sub(r.numerator),this.denominator):new W(this.numerator.mul(r.denominator).sub(r.numerator.mul(this.denominator)),this.denominator.mul(r.denominator))}mul(t){let r=t instanceof W?t:new W(M(t));return new W(this.numerator.mul(r.numerator),this.denominator.mul(r.denominator))}div(t){let r=t instanceof W?t:new W(M(t));return new W(this.numerator.mul(r.denominator),this.denominator.mul(r.numerator))}toSignificant(t,r={groupSeparator:""},n=1){Number.isInteger(t)||mt.logWithError(`${t} is not an integer.`),t<=0&&mt.logWithError(`${t} is not positive.`),Xe.set({precision:t+1,rounding:Go[n]});let o=new Xe(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return o.toFormat(o.decimalPlaces(),r)}toFixed(t,r={groupSeparator:""},n=1){return Number.isInteger(t)||mt.logWithError(`${t} is not an integer.`),t<0&&mt.logWithError(`${t} is negative.`),Ut.DP=t,Ut.RM=Ho[n]||1,new Ut(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,r)}isZero(){return this.numerator.isZero()}};var jo=J("Raydium_amount"),Yr=Ye(Zr.default);function zo(e,t){let r="0",n="0";if(e.includes(".")){let o=e.split(".");o.length===2?([r,n]=o,n=n.padEnd(t,"0")):jo.logWithError(`invalid number string, num: ${e}`)}else r=e;return[r,n.slice(0,t)||n]}var xe=class extends W{constructor(r,n,o=!0,i){let s=new Qe.default(0),a=qt.pow(new Qe.default(r.decimals));if(o)s=M(n);else{let c=new Qe.default(0),u=new Qe.default(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,d]=zo(n.toString(),r.decimals);c=M(l),u=M(d)}c=c.mul(a),s=c.add(u)}super(s,a);this.logger=J(i||"TokenAmount"),this.token=r}get raw(){return this.numerator}isZero(){return this.raw.isZero()}gt(r){return this.token.equals(r.token)||this.logger.logWithError("gt token not equals"),this.raw.gt(r.raw)}lt(r){return this.token.equals(r.token)||this.logger.logWithError("lt token not equals"),this.raw.lt(r.raw)}add(r){return this.token.equals(r.token)||this.logger.logWithError("add token not equals"),new xe(this.token,this.raw.add(r.raw))}subtract(r){return this.token.equals(r.token)||this.logger.logWithError("sub token not equals"),new xe(this.token,this.raw.sub(r.raw))}toSignificant(r=this.token.decimals,n,o=0){return super.toSignificant(r,n,o)}toFixed(r=this.token.decimals,n,o=0){return r>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(r,n,o)}toExact(r={groupSeparator:""}){return Yr.DP=this.token.decimals,new Yr(this.numerator.toString()).div(this.denominator.toString()).toFormat(r)}};var Xr=require("@solana/web3.js"),Gt=require("@solana/spl-token"),Qr={chainId:101,address:Xr.PublicKey.default.toBase58(),programId:Gt.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},se={chainId:101,address:"So11111111111111111111111111111111111111112",programId:Gt.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var gt=require("@solana/web3.js");var U=require("@solana/web3.js"),Jr=require("@solana/spl-token");function h({pubkey:e,isSigner:t=!1,isWritable:r=!0}){return{pubkey:e,isWritable:r,isSigner:t}}var Ht=[h({pubkey:Jr.TOKEN_PROGRAM_ID,isWritable:!1}),h({pubkey:U.SystemProgram.programId,isWritable:!1}),h({pubkey:U.SYSVAR_RENT_PUBKEY,isWritable:!1})];function $r({publicKey:e,transformSol:t}){let r=jt(e.toString());if(r instanceof U.PublicKey)return t&&r.equals(te)?be:r;if(t&&r.toString()===te.toBase58())return be;if(typeof r=="string"){if(r===U.PublicKey.default.toBase58())return U.PublicKey.default;try{return new U.PublicKey(r)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function jt(e){try{return new U.PublicKey(e)}catch{return e}}var as=new U.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),us=new U.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Yo=new U.PublicKey("SysvarRent111111111111111111111111111111111"),cs=new U.PublicKey("SysvarC1ock11111111111111111111111111111111"),ls=new U.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Zo=new U.PublicKey("Sysvar1nstructions1111111111111111111111111"),ds=U.SystemProgram.programId,fs=new U.PublicKey("2cpMA1jNS4obgRz8XNg38QuSP83L1AXpUgfxPNcvnAGj"),ps=new U.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),ms=new U.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),gs=new U.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),ys=new U.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),hs=new U.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),bs=new U.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),ws=new U.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),xs=new U.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Ps=new U.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Ts=new U.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),be=new U.PublicKey("So11111111111111111111111111111111111111112"),te=U.PublicKey.default;var zt=class{constructor({mint:t,decimals:r,symbol:n,name:o,skipMint:i=!1,isToken2022:s=!1}){if(t===te.toBase58()||t instanceof gt.PublicKey&&te.equals(t)){this.decimals=se.decimals,this.symbol=se.symbol,this.name=se.name,this.mint=new gt.PublicKey(se.address),this.isToken2022=!1;return}this.decimals=r,this.symbol=n||t.toString().substring(0,6),this.name=o||t.toString().substring(0,6),this.mint=i?gt.PublicKey.default:$r({publicKey:t}),this.isToken2022=s}equals(t){return this===t?!0:this.mint.equals(t.mint)}},Ee=zt;Ee.WSOL=new zt({...se,mint:se.address});var Yt=class{constructor({decimals:t,symbol:r="UNKNOWN",name:n="UNKNOWN"}){this.decimals=t,this.symbol=r,this.name=n}equals(t){return this===t}},yt=Yt;yt.SOL=new Yt(Qr);var tn=ne(require("bn.js"));var en=new W(new tn.default(100)),Oe=class extends W{toSignificant(t=5,r,n){return this.mul(en).toSignificant(t,r,n)}toFixed(t=2,r,n){return this.mul(en).toFixed(t,r,n)}};var Xo=J("Raydium_price"),Pe=class extends W{constructor(r){let{baseToken:n,quoteToken:o,numerator:i,denominator:s}=r;super(i,s);this.baseToken=n,this.quoteToken=o,this.scalar=new W(Zt(n.decimals),Zt(o.decimals))}get raw(){return new W(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new Pe({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(r){this.quoteToken!==r.baseToken&&Xo.logWithError("mul token not equals");let n=super.mul(r);return new Pe({baseToken:this.baseToken,quoteToken:r.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(r=this.quoteToken.decimals,n,o){return this.adjusted.toSignificant(r,n,o)}toFixed(r=this.quoteToken.decimals,n,o){return this.adjusted.toFixed(r,n,o)}};var rn=require("@solana/web3.js"),nn=ne(require("bn.js"));function on(e){return typeof e=="object"&&e!==null&&![Ee,xe,rn.PublicKey,W,nn.default,Pe,Oe].some(t=>typeof t=="object"&&e instanceof t)}function Te(e){return typeof e=="string"?jt(e):Array.isArray(e)?e.map(t=>Te(t)):on(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Te(r)])):e}var Xt=new ye.default(0),fa=new ye.default(1),pa=new ye.default(2),ma=new ye.default(3),ga=new ye.default(5),qt=new ye.default(10),ya=new ye.default(100),ha=new ye.default(1e3),ba=new ye.default(1e4);function Zt(e){return qt.pow(M(e))}function Mt(e,t=1,r=[]){let n=[...e];if(t<=0)return r;for(;n.length;)r.push(n.splice(0,t));return r}var cn=require("@solana/web3.js"),ln=require("@solana/spl-token");var ae=require("@solana/web3.js");var z={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",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmCreateConfig:"CpmmCreateConfig",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut",CpmmLockLp:"CpmmLockLp",CpmmCollectLockFee:"CpmmCollectLockFee"};var an=require("@solana/spl-token"),sn=J("Raydium_txUtil"),un=1644;function ht(e){let t=[],r=[];return e.microLamports&&(t.push(ae.ComputeBudgetProgram.setComputeUnitPrice({microLamports:e.microLamports})),r.push(z.SetComputeUnitPrice)),e.units&&(t.push(ae.ComputeBudgetProgram.setComputeUnitLimit({units:e.units})),r.push(z.SetComputeUnitLimit)),{instructions:t,instructionTypes:r}}async function We(e,t){var n,o;let r=t!=null?t:"confirmed";return(o=await((n=e.getLatestBlockhash)==null?void 0:n.call(e,{commitment:r})))==null?void 0:o.blockhash}async function bt(e,t){return e.getSignatureStatuses([t]),new Promise((r,n)=>{let o=setTimeout(n,6e4);e.onSignature(t,i=>{if(clearTimeout(o),!i.err){r("");return}n(i.err.toString())},"confirmed")})}function Qo(e,t){e.length<1&&sn.logWithError(`no instructions provided: ${e.toString()}`),t.length<1&&sn.logWithError(`no signers provided:, ${t.toString()}`);let r=new ae.Transaction;r.recentBlockhash="11111111111111111111111111111111",r.feePayer=t[0],r.add(...e);try{return Buffer.from(r.serialize({verifySignatures:!1})).toString("base64").length<un}catch{return!1}}function Me(e,t){let[r,n]=ae.PublicKey.findProgramAddressSync(e,t);return{publicKey:r,nonce:n}}function Je({instructions:e,payer:t,signers:r}){return Qo(e,[t,...r])}function $e({instructions:e,payer:t,lookupTableAddressAccount:r,recentBlockhash:n=ae.Keypair.generate().publicKey.toString()}){let i=new ae.TransactionMessage({payerKey:t,recentBlockhash:n,instructions:e}).compileToV0Message(Object.values(r!=null?r:{}));try{return Buffer.from(new ae.VersionedTransaction(i).serialize()).toString("base64").length<un}catch{return!1}}var Jo=e=>Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e),$o=e=>{let t=e.serialize({requireAllSignatures:!1,verifySignatures:!1});e instanceof ae.VersionedTransaction&&(t=Jo(t));try{return t instanceof Buffer?t.toString("base64"):Buffer.from(t).toString("base64")}catch{return t.toString("base64")}};function Ne(e){let t=[];return e.forEach(r=>{r instanceof ae.Transaction&&(r.recentBlockhash||(r.recentBlockhash=an.TOKEN_PROGRAM_ID.toBase58()),r.feePayer||(r.feePayer=ae.Keypair.generate().publicKey)),t.push($o(r))}),console.log("simulate tx string:",t),t}function Ue(e,t,r){return Me([e.toBuffer(),(r!=null?r:ln.TOKEN_PROGRAM_ID).toBuffer(),t.toBuffer()],new cn.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}var E=require("@solana/web3.js"),dn=new E.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),fn=new E.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),et=new E.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),Ma=new E.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),Na=new E.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Fa=new E.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),_a=new E.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),va=new E.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),Da=new E.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),Oa=new E.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),Wa=new E.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Ua=new E.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),qa=new E.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),Ga=new E.PublicKey("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),Ha=new E.PublicKey("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),ja=new E.PublicKey("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),za=new E.PublicKey("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),Ya=new E.PublicKey("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),Za=new E.PublicKey("SNaPnpKUY656VPwbKmKT8FG4T85g4VWhRH1B4TQUfKs"),Xa=new E.PublicKey("9pR79Lqe6wDNjag3v8MeVYUostoXjY2ognTydor6AtEZ"),Qa=new E.PublicKey("DNXgeM9EiiaAbaWvwjHj9fQQLAX5Zsf