import { MarinadeConfig } from './config/marinade-config'; import { BN, Provider, web3 } from '@coral-xyz/anchor'; import { MarinadeState } from './marinade-state/marinade-state'; import { DepositOptions, MarinadeResult, ValidatorStats } from './marinade.types'; import { MarinadeFinanceProgram } from './programs/marinade-finance-program'; import { MarinadeReferralProgram } from './programs/marinade-referral-program'; import { MarinadeReferralPartnerState } from './marinade-referral-state/marinade-referral-partner-state'; import { MarinadeReferralGlobalState } from './marinade-referral-state/marinade-referral-global-state'; import { TicketAccount } from './marinade-state/borsh/ticket-account'; import { ParsedStakeAccountInfo } from './util'; import { PublicKey } from '@solana/web3.js'; export declare class Marinade { readonly config: MarinadeConfig; constructor(config?: MarinadeConfig); readonly provider: Provider; /** * The main Marinade Program */ readonly marinadeFinanceProgram: MarinadeFinanceProgram; /** * The Marinade Program for referral partners */ readonly marinadeReferralProgram: MarinadeReferralProgram; private isReferralProgram; private provideReferralOrMainProgram; /** * Fetch the Marinade's internal state */ getMarinadeState(): Promise; /** * Fetch the Marinade referral partner's state */ getReferralPartnerState(referralCode?: web3.PublicKey): Promise; /** * Fetch the Marinade referral program's global state */ getReferralGlobalState(): Promise; /** * Fetch all the referral partners */ getReferralPartners(): Promise; /** * Returns a transaction with the instructions to * Add liquidity to the liquidity pool and receive LP tokens * * @param {BN} amountLamports - The amount of lamports added to the liquidity pool */ addLiquidity(amountLamports: BN): Promise; /** * Returns a transaction with the instructions to * Burn LP tokens and get SOL and mSOL back from the liquidity pool * * @param {BN} amountLamports - The amount of LP tokens burned */ removeLiquidity(amountLamports: BN): Promise; /** * Returns a transaction with the instructions to * Stake SOL in exchange for mSOL * * @param {BN} amountLamports - The amount lamports staked * @param {DepositOptions} options - Additional deposit options */ deposit(amountLamports: BN, options?: DepositOptions): Promise; /** * * ⚠️ WARNING ⚠️ The liquidity in the pool for this swap is typically low, * which can result in high transaction fees. It is advisable to consider * Jup swap API or proceed with caution. * * Returns a transaction with the instructions to * Swap your mSOL to get back SOL immediately using the liquidity pool * * @param {BN} amountLamports - The amount of mSOL exchanged for SOL */ liquidUnstake(amountLamports: BN, associatedMSolTokenAccountAddress?: web3.PublicKey): Promise; /** * Returns a transaction with the instructions to * Deposit a delegated stake account. * Note that the stake must be fully activated and the validator must be known to Marinade * * @param {web3.PublicKey} stakeAccountAddress - The account to be deposited */ depositStakeAccount(stakeAccountAddress: web3.PublicKey): Promise; /** * @beta * * Returns a transaction with the instructions to * Deposit a deactivating stake account. * Note that the stake must be deactivating and the validator must be known to Marinade * * @param {web3.PublicKey} stakeAccountAddress - The account to be deposited */ depositDeactivatingStakeAccount(stakeAccountAddress: web3.PublicKey): Promise; /** * Returns a transaction with the instructions to * Deposit a delegated stake account. * Note that the stake must be fully activated and the validator must be known to Marinade * * @param {ParsedStakeAccountInfo} stakeAccountInfo - Parsed Stake Account info * @param {number} rent - Rent needed for a stake account * @param {MarinadeState} marinadeState - Marinade State needed for retrieving validator info */ depositStakeAccountByAccount(stakeAccountInfo: ParsedStakeAccountInfo, rent: number, marinadeState: MarinadeState): Promise; /** * @beta * * Generates a transaction to partially convert a fully activated delegated stake account into mSOL, * while the remaining balance continues to be staked in its native form. * * Requirements: * - The stake's validator should be recognized by Marinade. * - The transaction should be executed immediately after being generated. * - A minimum amount of 1 SOL is required for conversion to mSOL. * * @param {web3.PublicKey} stakeAccountAddress - The account to be deposited * @param {BN} solToKeep - Amount of SOL lamports to keep */ partiallyDepositStakeAccount(stakeAccountAddress: web3.PublicKey, solToKeep: BN): Promise; /** * @beta * * Generates a transaction to convert an activating stake account into mSOL, * while the remaining balance continues to be staked in its native form. * * Requirements: * - The stake's validator should be recognized by Marinade. * - The transaction should be executed immediately after being generated. * * @param {web3.PublicKey} stakeAccountAddress - The account to be deposited * @param {BN} solToKeep - Amount of SOL lamports to keep as a stake account */ depositActivatingStakeAccount(stakeAccountAddress: web3.PublicKey, solToKeep: BN): Promise; /** * Retrieve all ticket accounts * */ getAllDelayedUnstakeTickets(): Promise>; /** * Retrieve user's ticket accounts * * @param {web3.PublicKey} beneficiary - The owner of the ticket accounts */ getDelayedUnstakeTickets(beneficiary: web3.PublicKey): Promise>; /** * Returns estimated Due date for an unstake ticket created now * */ getEstimatedUnstakeTicketDueDate(): Promise; /** * Returns a transaction with the instructions to * Order Unstake to create a ticket which can be claimed later (with {@link claim}). * * @param {BN} msolAmount - The amount of mSOL in lamports to order for unstaking */ orderUnstake(msolAmount: BN): Promise; /** * Returns a transaction with the instructions to * Order Unstake to create a ticket which can be claimed later (with {@link claim}). * * @param {BN} msolAmount - The amount of mSOL in lamports to order for unstaking * @param {PublicKey} ticketAccountPublicKey - The public key of the ticket account that will sign the transaction */ orderUnstakeWithPublicKey(msolAmount: BN, ticketAccountPublicKey: PublicKey): Promise; /** * Returns a transaction with the instructions to * claim a ticket (created by {@link orderUnstake} beforehand). * Claimed SOLs will be sent to {@link MarinadeConfig.publicKey}. * * @param {web3.PublicKey} ticketAccount - Address of the ticket account for SOLs being claimed from */ claim(ticketAccount: web3.PublicKey): Promise; /** * @beta * * Returns a transaction with the instructions to * Deposit an amount of stake pool tokens. * * This method is in beta stage. It may be changed or removed in future versions. * * @param {web3.PublicKey} stakePoolTokenAddress - The stake pool token account to be deposited * @param {number} amountToDeposit - Amount to deposit * @param {ValidatorStats[]} validators - List of validators to prio where to take the stake from */ depositStakePoolToken(stakePoolTokenAddress: web3.PublicKey, amountToDeposit: number, validators: ValidatorStats[]): Promise; /** * @beta * * Returns a transaction with the instructions to * Liquidate an amount of stake pool tokens. * * This method is in beta stage. It may be changed or removed in future versions. * * @param {web3.PublicKey} stakePoolTokenAddress - The stake pool token account to be liquidated * @param {number} amountToLiquidate - Amount to liquidate * @param {ValidatorStats[]} validators - List of validators to prio where to take the stake from */ liquidateStakePoolToken(stakePoolTokenAddress: web3.PublicKey, amountToLiquidate: number, validators: ValidatorStats[]): Promise; }