@raydium-io/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
2 lines • 2.95 kB
JavaScript
var I=Object.create;var f=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var F=(t,r)=>{for(var n in r)f(t,n,{get:r[n],enumerable:!0})},T=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of D(r))!E.call(t,s)&&s!==n&&f(t,s,{get:()=>r[s],enumerable:!(o=A(r,s))||o.enumerable});return t};var v=(t,r,n)=>(n=t!=null?I(N(t)):{},T(r||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t)),R=t=>T(f({},"__esModule",{value:!0}),t);var G={};F(G,{CpmmConfigInfoLayout:()=>q,CpmmPermission:()=>O,CpmmPoolInfoLayout:()=>M});module.exports=R(G);var C=require("@solana/web3.js"),d=v(require("bn.js"));var e=require("@solana/buffer-layout"),l=e.Layout,B=e.Structure;var w=e.UInt;var _=e.u8,U=e.u16;var k=e.seq;var y=e.blob;var g=class extends l{constructor(n,o,s){super(n,s);this.blob=y(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 i(t){return new w(1,t)}function u(t){return new g(8,!1,t)}var b=class extends l{constructor(n,o,s,c){super(n.span,c);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 b(y(32),r=>new C.PublicKey(r),r=>r.toBuffer(),t)}function h(t){return new b(_(),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 B{decode(r,n){return super.decode(r,n)}};function m(t,r,n){return new L(t,r,n)}function P(t,r,n){let o,s=typeof r=="number"?r:(0,d.isBN)(r)?r.toNumber():new Proxy(r,{get(c,x){if(!o){let p=Reflect.get(c,"count");o=(0,d.isBN)(p)?p.toNumber():p,Reflect.set(c,"count",o)}return Reflect.get(c,x)},set(c,x,p){return x==="count"&&(o=p),Reflect.set(c,x,p)}});return k(t,s,n)}var q=m([y(8),i("bump"),h("disableCreatePool"),U("index"),u("tradeFeeRate"),u("protocolFeeRate"),u("fundFeeRate"),u("createPoolFee"),a("protocolOwner"),a("fundOwner"),u("creatorFeeRate"),P(u(),15)]),M=m([y(8),a("configId"),a("poolCreator"),a("vaultA"),a("vaultB"),a("mintLp"),a("mintA"),a("mintB"),a("mintProgramA"),a("mintProgramB"),a("observationId"),i("bump"),i("status"),i("lpDecimals"),i("mintDecimalA"),i("mintDecimalB"),u("lpAmount"),u("protocolFeesMintA"),u("protocolFeesMintB"),u("fundFeesMintA"),u("fundFeesMintB"),u("openTime"),u("epoch"),i("feeOn"),h("enableCreatorFee"),P(i(),6),u("creatorFeesMintA"),u("creatorFeesMintB"),P(u(),28)]),O=m([y(8),a("configId"),P(u(),30)]);0&&(module.exports={CpmmConfigInfoLayout,CpmmPermission,CpmmPoolInfoLayout});
//# sourceMappingURL=layout.js.map