UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

2 lines 4.05 kB
import{PublicKey as V}from"@solana/web3.js";import U,{isBN as C}from"bn.js";import{bits as j,BitStructure as z,blob as A,Blob as H,cstr as J,f32 as Q,f32be as X,f64 as Y,f64be as Z,greedy as $,Layout as v,ns64 as ee,ns64be as te,nu64 as ne,nu64be as re,offset as I,s16 as oe,s16be as se,s24 as ae,s24be as ue,s32 as ie,s32be as ce,s40 as pe,s40be as ye,s48 as de,s48be as Pe,s8 as le,seq as F,struct as xe,Structure as R,u16 as D,u16be as me,u24 as fe,u24be as be,u32 as N,u32be as ge,u40 as Le,u40be as he,u48 as Te,u48be as Se,u8 as Be,UInt as E,union as we,Union as _e,unionLayoutDiscriminator as Ue,utf8 as Ce}from"@solana/buffer-layout";var x=v,T=R;var S=E;var m=D;var B=N;var w=F;var f=A;var _=I;var P=class extends x{constructor(t,o,u){super(t,u);this.blob=f(t),this.signed=o}decode(t,o=0){let u=new U(this.blob.decode(t,o),10,"le");return this.signed?u.fromTwos(this.span*8).clone():u}encode(t,o,u=0){return typeof t=="number"&&(t=new U(t)),this.signed&&(t=t.toTwos(this.span*8)),this.blob.encode(t.toArrayLike(Buffer,"le",this.span),o,u)}};function r(a){return new S(1,a)}function e(a){return new P(8,!1,a)}function k(a){return new P(16,!1,a)}var l=class extends x{constructor(t,o,u,p){super(t.span,p);this.layout=t,this.decoder=o,this.encoder=u}decode(t,o){return this.decoder(this.layout.decode(t,o))}encode(t,o,u){return this.layout.encode(this.encoder(t),o,u)}getSpan(t,o){return this.layout.getSpan(t,o)}};function n(a){return new l(f(32),s=>new V(s),s=>s.toBuffer(),a)}function g(a,s){let t=B("length"),o=i([t,c(a,_(t,-t.span),"values")]);return new l(o,({values:u})=>u,u=>({values:u}),s)}var b=class extends T{decode(s,t){return super.decode(s,t)}};function i(a,s,t){return new b(a,s,t)}function c(a,s,t){let o,u=typeof s=="number"?s:C(s)?s.toNumber():new Proxy(s,{get(p,d){if(!o){let y=Reflect.get(p,"count");o=C(y)?y.toNumber():y,Reflect.set(p,"count",o)}return Reflect.get(p,d)},set(p,d,y){return d==="count"&&(o=y),Reflect.set(p,d,y)}});return w(a,u,t)}var Oe=i([e(),e("epoch"),r("curveType"),m("index"),e("migrateFee"),e("tradeFeeRate"),e("maxShareFeeRate"),e("minSupplyA"),e("maxLockRate"),e("minSellRateA"),e("minMigrateRateA"),e("minFundRaisingB"),n("mintB"),n("protocolFeeOwner"),n("migrateFeeOwner"),n("migrateToAmmWallet"),n("migrateToCpmmWallet"),c(e(),16)]),K=i([e("totalLockedAmount"),e("cliffPeriod"),e("unlockPeriod"),e("startTime"),e("totalAllocatedShare")]),Me=i([e(),e("epoch"),r("bump"),r("status"),r("mintDecimalsA"),r("mintDecimalsB"),r("migrateType"),e("supply"),e("totalSellA"),e("virtualA"),e("virtualB"),e("realA"),e("realB"),e("totalFundRaisingB"),e("protocolFee"),e("platformFee"),e("migrateFee"),K.replicate("vestingSchedule"),n("configId"),n("platformId"),n("mintA"),n("mintB"),n("vaultA"),n("vaultB"),n("creator"),r("mintProgramFlag"),r("cpmmCreatorFeeOn"),e("platformVestingShare"),c(r(),54)]),We=i([e(),e("epoch"),n("poolId"),n("beneficiary"),e("claimedAmount"),e("tokenShareAmount"),c(e(),8)]),q=i([r("migrateType"),r("migrateCpmmFeeOn"),e("supply"),e("totalSellA"),e("totalFundRaisingB"),e("totalLockedAmount"),e("cliffPeriod"),e("unlockPeriod")]),je=i([e("epoch"),r("index"),n("configId"),q.replicate("bondingCurveParam"),c(e(),50)]),ze=i([e(),e("epoch"),n("platformClaimFeeWallet"),n("platformLockNftWallet"),e("platformScale"),e("creatorScale"),e("burnScale"),e("feeRate"),c(r(),64,"name"),c(r(),256,"web"),c(r(),256,"img"),n("cpConfigId"),e("creatorFeeRate"),n("transferFeeExtensionAuth"),n("platformVestingWallet"),e("platformVestingScale"),n("platformCpCreator"),r("restrictGlobalConfig"),r("restrictCurveParam"),n("curveRuleManager"),c(r(),78)]),G=i([r("field"),r("op"),k("value")]),O=i([m("groupId"),e("epoch"),g(G,"constraints")]),He=i([e(),r("bump"),r("version"),n("platformId"),n("configId"),e("epoch"),c(e(),8),g(O,"groups")]);export{q as BondingCurveParam,O as CurveRuleGroup,Oe as LaunchpadConfig,Me as LaunchpadPool,We as LaunchpadVesting,G as ParamConstraint,ze as PlatformConfig,je as PlatformCurveParam,He as PlatformCurveRule,K as VestingSchedule}; //# sourceMappingURL=layout.mjs.map