UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

2 lines 3.97 kB
var D=Object.create;var l=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var K=(r,o)=>{for(var n in o)l(r,n,{get:o[n],enumerable:!0})},h=(r,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of R(o))!V.call(r,a)&&a!==n&&l(r,a,{get:()=>o[a],enumerable:!(s=N(o,a))||s.enumerable});return r};var q=(r,o,n)=>(n=r!=null?D(E(r)):{},h(o||!r||!r.__esModule?l(n,"default",{value:r,enumerable:!0}):n,r)),O=r=>h(l({},"__esModule",{value:!0}),r);var z={};K(z,{BondingCurveParam:()=>v,LaunchpadConfig:()=>G,LaunchpadPool:()=>M,LaunchpadVesting:()=>W,PlatformConfig:()=>j,PlatformCurveParam:()=>F,VestingSchedule:()=>I});module.exports=O(z);var A=require("@solana/web3.js"),P=q(require("bn.js"));var e=require("@solana/buffer-layout"),f=e.Layout,S=e.Structure;var B=e.UInt;var w=e.u16;var _=e.u32;var U=e.seq;var b=e.blob;var k=e.offset;var g=class extends f{constructor(n,s,a){super(n,a);this.blob=b(n),this.signed=s}decode(n,s=0){let a=new P.default(this.blob.decode(n,s),10,"le");return this.signed?a.fromTwos(this.span*8).clone():a}encode(n,s,a=0){return typeof n=="number"&&(n=new P.default(n)),this.signed&&(n=n.toTwos(this.span*8)),this.blob.encode(n.toArrayLike(Buffer,"le",this.span),s,a)}};function i(r){return new B(1,r)}function t(r){return new g(8,!1,r)}var m=class extends f{constructor(n,s,a,y){super(n.span,y);this.layout=n,this.decoder=s,this.encoder=a}decode(n,s){return this.decoder(this.layout.decode(n,s))}encode(n,s,a){return this.layout.encode(this.encoder(n),s,a)}getSpan(n,s){return this.layout.getSpan(n,s)}};function u(r){return new m(b(32),o=>new A.PublicKey(o),o=>o.toBuffer(),r)}function C(r,o){let n=_("length"),s=p([n,c(r,k(n,-n.span),"values")]);return new m(s,({values:a})=>a,a=>({values:a}),o)}var L=class extends S{decode(o,n){return super.decode(o,n)}};function p(r,o,n){return new L(r,o,n)}function c(r,o,n){let s,a=typeof o=="number"?o:(0,P.isBN)(o)?o.toNumber():new Proxy(o,{get(y,x){if(!s){let d=Reflect.get(y,"count");s=(0,P.isBN)(d)?d.toNumber():d,Reflect.set(y,"count",s)}return Reflect.get(y,x)},set(y,x,d){return x==="count"&&(s=d),Reflect.set(y,x,d)}});return U(r,a,n)}var G=p([t(),t("epoch"),i("curveType"),w("index"),t("migrateFee"),t("tradeFeeRate"),t("maxShareFeeRate"),t("minSupplyA"),t("maxLockRate"),t("minSellRateA"),t("minMigrateRateA"),t("minFundRaisingB"),u("mintB"),u("protocolFeeOwner"),u("migrateFeeOwner"),u("migrateToAmmWallet"),u("migrateToCpmmWallet"),c(t(),16)]),I=p([t("totalLockedAmount"),t("cliffPeriod"),t("unlockPeriod"),t("startTime"),t("totalAllocatedShare")]),M=p([t(),t("epoch"),i("bump"),i("status"),i("mintDecimalsA"),i("mintDecimalsB"),i("migrateType"),t("supply"),t("totalSellA"),t("virtualA"),t("virtualB"),t("realA"),t("realB"),t("totalFundRaisingB"),t("protocolFee"),t("platformFee"),t("migrateFee"),I.replicate("vestingSchedule"),u("configId"),u("platformId"),u("mintA"),u("mintB"),u("vaultA"),u("vaultB"),u("creator"),i("mintProgramFlag"),i("cpmmCreatorFeeOn"),t("platformVestingShare"),c(i(),54)]),W=p([t(),t("epoch"),u("poolId"),u("beneficiary"),t("claimedAmount"),t("tokenShareAmount"),c(t(),8)]),v=p([i("migrateType"),i("migrateCpmmFeeOn"),t("supply"),t("totalSellA"),t("totalFundRaisingB"),t("totalLockedAmount"),t("cliffPeriod"),t("unlockPeriod")]),F=p([t("epoch"),i("index"),u("configId"),v.replicate("bondingCurveParam"),c(t(),50)]),j=p([t(),t("epoch"),u("platformClaimFeeWallet"),u("platformLockNftWallet"),t("platformScale"),t("creatorScale"),t("burnScale"),t("feeRate"),c(i(),64,"name"),c(i(),256,"web"),c(i(),256,"img"),u("cpConfigId"),t("creatorFeeRate"),u("transferFeeExtensionAuth"),u("platformVestingWallet"),t("platformVestingScale"),u("platformCpCreator"),c(i(),108),C(F,"platformCurve")]);0&&(module.exports={BondingCurveParam,LaunchpadConfig,LaunchpadPool,LaunchpadVesting,PlatformConfig,PlatformCurveParam,VestingSchedule}); //# sourceMappingURL=layout.js.map