@powrldgr/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
2 lines • 2.76 kB
JavaScript
var I=Object.create;var x=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var v=(t,r)=>{for(var n in r)x(t,n,{get:r[n],enumerable:!0})},h=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of D(r))!E.call(t,s)&&s!==n&&x(t,s,{get:()=>r[s],enumerable:!(o=A(r,s))||o.enumerable});return t};var F=(t,r,n)=>(n=t!=null?I(N(t)):{},h(r||!t||!t.__esModule?x(n,"default",{value:t,enumerable:!0}):n,t)),R=t=>h(x({},"__esModule",{value:!0}),t);var G={};v(G,{CpmmConfigInfoLayout:()=>q,CpmmPoolInfoLayout:()=>M});module.exports=R(G);var k=require("@solana/web3.js"),d=F(require("bn.js"));var e=require("@solana/buffer-layout"),b=e.Layout,S=e.Structure;var B=e.UInt;var w=e.u8,_=e.u16;var U=e.seq;var p=e.blob;var m=class extends b{constructor(n,o,s){super(n,s);this.blob=p(n),this.signed=o}decode(n,o=0){let s=new d.default(this.blob.decode(n,o),10,"le");return this.signed?s.fromTwos(this.span*8).clone():s}encode(n,o,s=0){return typeof n=="number"&&(n=new d.default(n)),this.signed&&(n=n.toTwos(this.span*8)),this.blob.encode(n.toArrayLike(Buffer,"le",this.span),o,s)}};function y(t){return new B(1,t)}function u(t){return new m(8,!1,t)}var f=class extends b{constructor(n,o,s,i){super(n.span,i);this.layout=n,this.decoder=o,this.encoder=s}decode(n,o){return this.decoder(this.layout.decode(n,o))}encode(n,o,s){return this.layout.encode(this.encoder(n),o,s)}getSpan(n,o){return this.layout.getSpan(n,o)}};function a(t){return new f(p(32),r=>new k.PublicKey(r),r=>r.toBuffer(),t)}function C(t){return new f(w(),V,K,t)}function V(t){if(t===0)return!1;if(t===1)return!0;throw new Error("Invalid bool: "+t)}function K(t){return t?1:0}var l=class extends S{decode(r,n){return super.decode(r,n)}};function g(t,r,n){return new l(t,r,n)}function L(t,r,n){let o,s=typeof r=="number"?r:(0,d.isBN)(r)?r.toNumber():new Proxy(r,{get(i,P){if(!o){let c=Reflect.get(i,"count");o=(0,d.isBN)(c)?c.toNumber():c,Reflect.set(i,"count",o)}return Reflect.get(i,P)},set(i,P,c){return P==="count"&&(o=c),Reflect.set(i,P,c)}});return U(t,s,n)}var q=g([p(8),y("bump"),C("disableCreatePool"),_("index"),u("tradeFeeRate"),u("protocolFeeRate"),u("fundFeeRate"),u("createPoolFee"),a("protocolOwner"),a("fundOwner"),L(u(),16)]),M=g([p(8),a("configId"),a("poolCreator"),a("vaultA"),a("vaultB"),a("mintLp"),a("mintA"),a("mintB"),a("mintProgramA"),a("mintProgramB"),a("observationId"),y("bump"),y("status"),y("lpDecimals"),y("mintDecimalA"),y("mintDecimalB"),u("lpAmount"),u("protocolFeesMintA"),u("protocolFeesMintB"),u("fundFeesMintA"),u("fundFeesMintB"),u("openTime"),L(u(),32)]);0&&(module.exports={CpmmConfigInfoLayout,CpmmPoolInfoLayout});
//# sourceMappingURL=layout.js.map