UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

71 lines (68 loc) 2.72 kB
import BN__default from 'bn.js'; import { LaunchpadCurveRuleBaseTokenProgram, LaunchpadCurveRuleConstraint, LaunchpadCurveRuleInfo } from './type.js'; import '@solana/web3.js'; import '../../api-97e39847.js'; import 'axios'; import '../../solana/type.js'; import '@solana/spl-token'; import '../../api/url.js'; import '../../common/owner.js'; import '../../common/txTool/lookupTable.js'; import '../../common/txTool/txType.js'; import 'decimal.js'; import '../../module/token.js'; import '../../common/pubKey.js'; import '../../common/logger.js'; import '../../module/currency.js'; import '../../marshmallow/index.js'; import '../../marshmallow/buffer-layout.js'; import './layout.js'; interface LaunchpadCurveRuleContext { curveType: number; migrateType: number; migrateCpmmFeeOn: number; supply: BN__default; totalSellA: BN__default; totalFundRaisingB: BN__default; totalLockedAmount: BN__default; cliffPeriod: BN__default; unlockPeriod: BN__default; baseTokenProgram: LaunchpadCurveRuleBaseTokenProgram; transferFee?: { basisPoints: number; maximumFee: BN__default; }; unixTimestamp: BN__default; } declare function getCurveRuleFieldValue(context: LaunchpadCurveRuleContext, field: number): BN__default | undefined; declare function isCurveRuleConstraintSatisfied(constraint: LaunchpadCurveRuleConstraint, context: LaunchpadCurveRuleContext): boolean; interface CurveRuleUnsatisfiedConstraint extends LaunchpadCurveRuleConstraint { /** the value these launch parameters produce, `undefined` when it cannot be computed */ actual?: BN__default; } interface CurveRuleCheckResult { ok: boolean; matchedGroupId?: number; groupFailures: { groupId: number; unsatisfied: CurveRuleUnsatisfiedConstraint[]; }[]; } declare function checkLaunchAgainstCurveRule({ rule, context, }: { rule: Pick<LaunchpadCurveRuleInfo, "groups"> | undefined; context: LaunchpadCurveRuleContext; }): CurveRuleCheckResult; interface CurveRuleWriteCheckResult { ok: boolean; errors: { code: "CurveRuleGroupsExceeded" | "InvalidCurveRuleConstraint" | "CurveRuleFieldNotSupportedByCurve"; message: string; }[]; } declare function checkCurveRuleGroupWritable({ groupId, constraints, curveType, existingGroupIds, }: { groupId: number; constraints: LaunchpadCurveRuleConstraint[]; curveType: number; existingGroupIds?: number[]; }): CurveRuleWriteCheckResult; export { CurveRuleCheckResult, CurveRuleUnsatisfiedConstraint, CurveRuleWriteCheckResult, LaunchpadCurveRuleContext, checkCurveRuleGroupWritable, checkLaunchAgainstCurveRule, getCurveRuleFieldValue, isCurveRuleConstraintSatisfied };