test-rrr-sdk
Version:
An SDK for building applications on top of Raydium.
2 lines • 2.58 kB
JavaScript
import{PublicKey as v}from"@solana/web3.js";import w,{isBN as _}from"bn.js";import{bits as q,BitStructure as M,blob as k,Blob as G,cstr as O,f32 as j,f32be as z,f64 as H,f64be as J,greedy as Q,Layout as C,ns64 as X,ns64be as Y,nu64 as Z,nu64be as $,offset as W,s16 as ee,s16be as te,s24 as ne,s24be as re,s32 as oe,s32be as se,s40 as ue,s40be as ae,s48 as ie,s48be as ye,s8 as ce,seq as I,struct as pe,Structure as A,u16 as D,u16be as de,u24 as Pe,u24be as xe,u32 as fe,u32be as be,u40 as me,u40be as le,u48 as ge,u48be as Le,u8 as N,UInt as E,union as he,Union as Te,unionLayoutDiscriminator as Se,utf8 as Be}from"@solana/buffer-layout";var P=C,L=A;var h=E;var T=N,S=D;var B=I;var c=k;var x=class extends P{constructor(e,n,u){super(e,u);this.blob=c(e),this.signed=n}decode(e,n=0){let u=new w(this.blob.decode(e,n),10,"le");return this.signed?u.fromTwos(this.span*8).clone():u}encode(e,n,u=0){return typeof e=="number"&&(e=new w(e)),this.signed&&(e=e.toTwos(this.span*8)),this.blob.encode(e.toArrayLike(Buffer,"le",this.span),n,u)}};function i(t){return new h(1,t)}function o(t){return new x(8,!1,t)}var d=class extends P{constructor(e,n,u,a){super(e.span,a);this.layout=e,this.decoder=n,this.encoder=u}decode(e,n){return this.decoder(this.layout.decode(e,n))}encode(e,n,u){return this.layout.encode(this.encoder(e),n,u)}getSpan(e,n){return this.layout.getSpan(e,n)}};function s(t){return new d(c(32),r=>new v(r),r=>r.toBuffer(),t)}function U(t){return new d(T(),F,R,t)}function F(t){if(t===0)return!1;if(t===1)return!0;throw new Error("Invalid bool: "+t)}function R(t){return t?1:0}var f=class extends L{decode(r,e){return super.decode(r,e)}};function b(t,r,e){return new f(t,r,e)}function m(t,r,e){let n,u=typeof r=="number"?r:_(r)?r.toNumber():new Proxy(r,{get(a,p){if(!n){let y=Reflect.get(a,"count");n=_(y)?y.toNumber():y,Reflect.set(a,"count",n)}return Reflect.get(a,p)},set(a,p,y){return p==="count"&&(n=y),Reflect.set(a,p,y)}});return B(t,u,e)}var qe=b([c(8),i("bump"),U("disableCreatePool"),S("index"),o("tradeFeeRate"),o("protocolFeeRate"),o("fundFeeRate"),o("createPoolFee"),s("protocolOwner"),s("fundOwner"),m(o(),16)]),Me=b([c(8),s("configId"),s("poolCreator"),s("vaultA"),s("vaultB"),s("mintLp"),s("mintA"),s("mintB"),s("mintProgramA"),s("mintProgramB"),s("observationId"),i("bump"),i("status"),i("lpDecimals"),i("mintDecimalA"),i("mintDecimalB"),o("lpAmount"),o("protocolFeesMintA"),o("protocolFeesMintB"),o("fundFeesMintA"),o("fundFeesMintB"),o("openTime"),m(o(),32)]);export{qe as CpmmConfigInfoLayout,Me as CpmmPoolInfoLayout};
//# sourceMappingURL=layout.mjs.map