UNPKG

@sega-so/sega-sdk

Version:

An SDK for building applications on top of SEGA.

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