import { Connection, PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js'; import { getJupTokenLedgerAndSwapInstructions } from './jup'; import { Basket, FormattedAccumulatedFees, FormattedAddTokenSettings, FormattedAsset, FormattedAutomationSettings, FormattedBasket, FormattedCreatorSettings, FormattedCustomRebalanceSettings, FormattedDepositsSettings, FormattedFeeSettings, FormattedForceRebalanceSettings, FormattedLookupTables, FormattedLpSettings, FormattedMakeDirectSwapSettings, FormattedManagersSettings, FormattedMetadataSettings, FormattedOracle, FormattedOracleAggregator, FormattedOracleSettings, FormattedScheduleSettings, FormattedUpdateWeightsSettings, WithdrawBasketFees } from './layouts/basket'; import { FormattedGlobalConfig, GlobalConfig } from './layouts/config'; import { AddOrEditTokenInput, EditAddTokenSettings, EditAutomationSettings, EditCreatorSettings, EditCustomRebalanceSettings, EditDepositsSettings, EditFeeSettings, EditForceRebalanceSettings, EditLpSettings, EditMakeDirectSwapSettings, EditManagerSettings, EditMetadataSettings, EditScheduleSettings, EditUpdateWeightsSettings, FormattedBounty, FormattedBountySchedule, FormattedIntent, FormattedIntentStatus, FormattedTaskType, Intent, MakeDirectSwapInput, OracleInput, Settings, TaskContext, TaskType, UpdateWeightsInput } from './layouts/intents/intent'; import { FormattedOraclePrice, FormattedRebalanceAction, FormattedRebalanceIntent, FormattedRebalanceType, FormattedTaskCompletion, FormattedTokenAuction, MintData, PriceUpdatesData, RebalanceIntent, AuctionData, RedeemData, DepositData, ClaimBountyData, UIRebalanceIntent } from './layouts/intents/rebalanceIntent'; import { FormattedOracleType } from './layouts/oracle'; import { BasketFilter } from './states/basket'; import { IntentFilter } from './states/intents/intent'; import { RebalanceIntentFilter } from './states/intents/rebalanceIntent'; import { WithdrawBasketFeesFilter } from './states/withdrawBasketFees'; import { BasketCreationTx, TxPayloadBatchSequence, VersionedTxs, Wallet } from './txUtils'; export declare class SymmetryCore { private sdkParams; /** * Initializes the SymmetryCore SDK. * @param params {connection: Connection, network: "devnet" | "mainnet", priorityFee?: number} - The parameters for the SDK. * @param params.connection - The connection to the Solana network. * @param params.network - The network to use (devnet or mainnet). * @param params.priorityFee - Optional. Compute unit price in micro-lamports. Defaults to PRIORITY_FEE (25_000). */ constructor(params: { connection: Connection; network: "devnet" | "mainnet"; priorityFee?: number; }); /** * Fetches the global config account. * @returns {Promise} The global config. */ fetchGlobalConfig(): Promise; /** * Fetches a basket by its public key. * @param {string} basketPubkey - The public key of the basket. * @returns {Promise} The basket. */ fetchBasket(basketPubkey: string): Promise; /** * Fetches multiple baskets by their public keys. * @param {string[]} basketPubkeys - The public keys of the baskets. * @returns {Promise>} A map of basket public keys to baskets. */ fetchMultipleBaskets(basketPubkeys: string[]): Promise>; /** * Fetches all baskets. * @param {BasketFilter} basketFilter - Optional. The filter to apply to the baskets. * @param {"creator" | "host" | "manager"} basketFilter.type - The type of the basket filter ("creator", "host", "manager"). * @param {string} basketFilter.pubkey - The public key of the basket filter. * @returns {Promise} The baskets. */ fetchAllBaskets(basketFilter?: BasketFilter): Promise; /** * Fetches all baskets created by a given public key. * @param {string} creatorPubkey - The public key of the creator. * @returns {Promise} The baskets. */ fetchCreatedBaskets(creatorPubkey: string): Promise; /** * Fetches all baskets hosted by a given public key. * @param {string} hostPubkey - The public key of the host. * @returns {Promise} The baskets. */ fetchHostedBaskets(hostPubkey: string): Promise; /** * Fetches all baskets managed by a given public key. * @param {string} managerPubkey - The public key of the manager. * @returns {Promise} The baskets. */ fetchManagedBaskets(managerPubkey: string): Promise; /** * Derives baskets by their mints. * @param {string[]} mints - The mint public keys of the baskets. * @returns {Promise>} A map of basket mint public keys to basket public keys. */ deriveBasketsByMints(mints: string[]): Promise>; /** * Fetches baskets by their mint public keys. * @param {string[]} mints - The mint public keys of the baskets. * @returns {Promise>} A map of basket mint public keys to baskets. */ fetchBasketsFromMints(mints: string[]): Promise>; /** * Loads the price of a basket. * @param {Basket} basket - The basket. * @returns {Promise} The basket with the price. */ loadBasketPrice(basket: Basket): Promise; /** * Fetches an intent by its public key. * @param {string} intentPubkey - The public key of the intent. * @returns {Promise} The intent. */ fetchIntent(intentPubkey: string): Promise; /** * Fetches multiple intents by their public keys. * @param {string[]} intentPubkeys - The public keys of the intents. * @returns {Promise>} A map of intent public keys to intents. */ fetchMultipleIntents(intentPubkeys: string[]): Promise>; /** * Fetches all intents. * @param {IntentFilter} filter - Optional. The filter to apply to the intents. * @param {"creator" | "host" | "manager" | "basket" | "owner"} filter.type - The type of the intent filter ("creator", "host", "manager", "basket", "owner"). * @param {string} filter.pubkey - The public key of the intent filter. * @returns {Promise} The intents. */ fetchAllIntents(filter?: IntentFilter): Promise; /** * Fetches all intents created by a given public key. * @param {string} creatorPubkey - The public key of the creator. * @returns {Promise} The intents. */ fetchCreatedIntents(creatorPubkey: string): Promise; /** * Fetches all intents for a given basket. * @param {string} basketPubkey - The public key of the basket. * @returns {Promise} The intents. */ fetchBasketIntents(basketPubkey: string): Promise; /** * Fetches a rebalance intent by its public key. * @param {string} rebalanceIntentPubkey - The public key of the rebalance intent. * @returns {Promise} The rebalance intent. */ fetchRebalanceIntent(rebalanceIntentPubkey: string): Promise; /** * Fetches multiple rebalance intents by their public keys. * @param {string[]} rebalanceIntentPubkeys - The public keys of the rebalance intents. * @returns {Promise>} A map of rebalance intent public keys to rebalance intents. */ fetchMultipleRebalanceIntents(rebalanceIntentPubkeys: string[]): Promise>; /** * Fetches all rebalance intents. * @param {RebalanceIntentFilter} filter - Optional. The filter to apply to the rebalance intents. * @param {"owner" | "basket"} filter.type - The type of the rebalance intent filter ("owner", "basket"). * @param {string} filter.pubkey - The public key of the rebalance intent filter. * @returns {Promise} The rebalance intents. */ fetchAllRebalanceIntents(filter?: RebalanceIntentFilter): Promise; /** * Fetches all rebalance intents for a given owner. * @param {string} ownerPubkey - The public key of the owner. * @returns {Promise} The rebalance intents. */ fetchOwnerRebalanceIntents(ownerPubkey: string): Promise; /** * Fetches all rebalance intents for a given basket. * @param {string} basketPubkey - The public key of the basket. * @returns {Promise} The rebalance intents. */ fetchBasketRebalanceIntents(basketPubkey: string): Promise; /** * Fetches a WithdrawBasketFees account by its public key. * @param {string} withdrawBasketFeesPubkey - The public key of the WithdrawBasketFees account. * @returns {Promise} The WithdrawBasketFees account. */ fetchWithdrawBasketFees(withdrawBasketFeesPubkey: string): Promise; /** * Fetches multiple WithdrawBasketFees accounts by their public keys. * @param {string[]} withdrawBasketFeesPubkeys - The public keys of the WithdrawBasketFees accounts. * @returns {Promise>} A map of WithdrawBasketFees public keys to WithdrawBasketFees accounts. */ fetchMultipleWithdrawBasketFees(withdrawBasketFeesPubkeys: string[]): Promise>; /** * Fetches all WithdrawBasketFees accounts with optional filter. * @param {WithdrawBasketFeesFilter} filter - Optional. The filter to apply to the WithdrawBasketFees accounts. * @param {"basket" | "manager" | "creator" | "host" | "symmetry"} filter.type - The type of the filter. * @param {string} filter.pubkey - The public key to filter by. * @returns {Promise} The WithdrawBasketFees accounts. */ fetchAllWithdrawBasketFees(filter?: WithdrawBasketFeesFilter): Promise; /** * Fetches all WithdrawBasketFees accounts for a given basket. * @param {string} basketPubkey - The public key of the basket. * @returns {Promise} The WithdrawBasketFees accounts. */ fetchBasketWithdrawBasketFees(basketPubkey: string): Promise; /** * Fetches all WithdrawBasketFees accounts for a given manager. * @param {string} managerPubkey - The public key of the manager. * @returns {Promise} The WithdrawBasketFees accounts. */ fetchManagerWithdrawBasketFees(managerPubkey: string): Promise; /** * Fetches all WithdrawBasketFees accounts for a given creator. * @param {string} creatorPubkey - The public key of the creator. * @returns {Promise} The WithdrawBasketFees accounts. */ fetchCreatorWithdrawBasketFees(creatorPubkey: string): Promise; /** * Fetches all WithdrawBasketFees accounts for a given host. * @param {string} hostPubkey - The public key of the host. * @returns {Promise} The WithdrawBasketFees accounts. */ fetchHostWithdrawBasketFees(hostPubkey: string): Promise; /** * Fetches all WithdrawBasketFees accounts for a given symmetry fee collector. * @param {string} symmetryPubkey - The public key of the symmetry fee collector. * @returns {Promise} The WithdrawBasketFees accounts. */ fetchSymmetryWithdrawBasketFees(symmetryPubkey: string): Promise; createGlobalConfigTx(params: { signer: PublicKey; }): Promise; editGlobalConfigTx(params: { signer: PublicKey; config: GlobalConfig; }): Promise; /** * Creates a basket. * @param {Object} params - The parameters for the basket creation. * @param {string} params.creator - The public key of the creator. * @param {string} params.start_price - The start price of the basket. * @param {string} params.name - The name of the basket. * @param {string} params.symbol - The symbol of the basket. * @param {string} params.metadata_uri - The metadata URI of the basket. * @param {Object} params.host_platform_params - Optional. The host platform parameters. * @param {string} params.host_platform_params.host_pubkey - The public key of the host. * @param {number} params.host_platform_params.host_deposit_fee_bps - The host deposit fee in basis points. * @param {number} params.host_platform_params.host_withdraw_fee_bps - The host withdrawal fee in basis points. * @param {number} params.host_platform_params.host_management_fee_bps - The host management fee in basis points. * @param {number} params.host_platform_params.host_performance_fee_bps - The host performance fee in basis points. * @returns {Promise} The basket creation transaction. */ createBasketTx(params: { creator: string; start_price: string; name: string; symbol: string; metadata_uri: string; host_platform_params?: { host_pubkey: string; host_deposit_fee_bps: number; host_withdraw_fee_bps: number; host_management_fee_bps: number; host_performance_fee_bps: number; }; }): Promise; /** * Changes the creator of a basket. * @param {TaskContext} context - The context of the task. * @param {EditCreatorSettings} settings - The settings for the creator edit. * @returns {Promise} The transaction payload batch sequence. */ editCreatorTx(context: TaskContext, settings: EditCreatorSettings): Promise; /** * Creates an edit manager settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditManagerSettings} settings - The settings for the manager edit. * @returns {Promise} The transaction payload batch sequence. */ editManagersTx(context: TaskContext, settings: EditManagerSettings): Promise; /** * Creates an edit schedule settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditScheduleSettings} settings - The settings for the schedule edit. * @returns {Promise} The transaction payload batch sequence. */ editScheduleTx(context: TaskContext, settings: EditScheduleSettings): Promise; /** * Creates an edit fees settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditFeeSettings} settings - The settings for the fee edit. * @returns {Promise} The transaction payload batch sequence. */ editFeesTx(context: TaskContext, settings: EditFeeSettings): Promise; /** * Creates an edit automation settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditAutomationSettings} settings - The settings for the automation edit. * @returns {Promise} The transaction payload batch sequence. */ editAutomationTx(context: TaskContext, settings: EditAutomationSettings): Promise; /** * Creates an edit LP settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditLpSettings} settings - The settings for the LP edit. * @returns {Promise} The transaction payload batch sequence. */ editLpTx(context: TaskContext, settings: EditLpSettings): Promise; /** * Creates an edit metadata settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditMetadataSettings} settings - The settings for the metadata edit. * @returns {Promise} The transaction payload batch sequence. */ editMetadataTx(context: TaskContext, settings: EditMetadataSettings): Promise; /** * Creates an edit deposits settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditDepositsSettings} settings - The settings for the deposits edit. * @returns {Promise} The transaction payload batch sequence. */ editDepositsTx(context: TaskContext, settings: EditDepositsSettings): Promise; /** * Creates an edit force rebalance settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditForceRebalanceSettings} settings - The settings for the force rebalance edit. * @returns {Promise} The transaction payload batch sequence. */ editForceRebalanceTx(context: TaskContext, settings: EditForceRebalanceSettings): Promise; /** * Creates an edit custom rebalance settings intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditCustomRebalanceSettings} settings - The settings for the custom rebalance edit. * @returns {Promise} The transaction payload batch sequence. */ editCustomRebalanceTx(context: TaskContext, settings: EditCustomRebalanceSettings): Promise; /** * Creates an edit add token delay intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditAddTokenSettings} settings - The settings for the add token delay edit. * @returns {Promise} The transaction payload batch sequence. */ editAddTokenDelayTx(context: TaskContext, settings: EditAddTokenSettings): Promise; /** * Creates an edit update weights delay intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditUpdateWeightsSettings} settings - The settings for the update weights delay edit. * @returns {Promise} The transaction payload batch sequence. */ editUpdateWeightsDelayTx(context: TaskContext, settings: EditUpdateWeightsSettings): Promise; /** * Creates an edit swap delay intent for a basket. * @param {TaskContext} context - The context of the task. * @param {EditMakeDirectSwapSettings} settings - The settings for the make direct swap delay edit. * @returns {Promise} The transaction payload batch sequence. */ editSwapDelayTx(context: TaskContext, settings: EditMakeDirectSwapSettings): Promise; /** * Creates an add or edit token intent for a basket. * @param {TaskContext} context - The context of the task. * @param {AddOrEditTokenInput} settings - The settings for the add or edit token. * @returns {Promise} The transaction payload batch sequence. */ addOrEditTokenTx(context: TaskContext, settings: AddOrEditTokenInput): Promise; /** * Creates a update weights intent for a basket. * @param {TaskContext} context - The context of the task. * @param {UpdateWeightsInput} settings - The settings for the update weights. * @returns {Promise} The transaction payload batch sequence. */ updateWeightsTx(context: TaskContext, settings: UpdateWeightsInput): Promise; /** * Creates a direct swap intent for a basket. * @param {TaskContext} context - The context of the task. * @param {MakeDirectSwapInput} settings - The settings for the make direct swap. * @param {TransactionInstruction} jup_swap_ix - Optional. The JUP swap instruction. * @returns {Promise} The transaction payload batch sequence. */ makeDirectSwapTx(context: TaskContext, settings: MakeDirectSwapInput, jup_swap_ix?: TransactionInstruction): Promise; /** * Creates basket intent account. * @param {Object} params - The parameters for the basket intent. * @param {TaskContext} params.context - The context of the task. * @param {TaskType} params.type - The type of the task. * @param {Settings} params.settings - The settings for the task. * @param {number} params.min_bounty_per_task - Optional. The minimum bounty per task. * @param {number} params.max_bounty_per_task - Optional. The maximum bounty per task. * @param {TransactionInstruction} params.jup_swap_ix - Optional. The JUP swap instruction (for MakeDirectSwap task). * @returns {Promise} The transaction payload batch sequence. */ openBasketIntentTx(params: { context: TaskContext; type: TaskType; settings: Settings; jup_swap_ix?: TransactionInstruction; }): Promise; /** * Executes a basket intent. Basket intent will be executed immediately. * @param {Object} params - The parameters for the basket intent. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.intent - The public key of the intent. * @returns {Promise} The transaction payload batch sequence. */ executeBasketIntentTx(params: { keeper: string; intent: string; }): Promise; /** * Cancels a basket intent. Basket intent account will get closed. * @param {Object} params - The parameters for the basket intent. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.intent - The public key of the intent. * @returns {Promise} The transaction payload batch sequence. */ cancelBasketIntentTx(params: { keeper: string; intent: string; }): Promise; /** * Cancels a rebalance intent. Rebalance intent status will be set to AuctionFinished. * @param {Object} params - The parameters for the rebalance intent. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.rebalance_intent - The public key of the rebalance intent. * @returns {Promise} The transaction payload batch sequence. */ cancelRebalanceIntentTx(params: { keeper: string; rebalance_intent: string; }): Promise; /** * Creates a rebalance intent for a user to deposit tokens into a basket. * * Batch layout: * * batch 0: * * tx0: [create, resize, init rebalance intent], * * batch 1: * * tx0: [deposit tokens ix], * * tx1: [deposit tokens ix], * * ... * * batch 2: * * tx0: [lock deposits ix, start price updates ix], * * @param {Object} params - The parameters for the basket purchase. * @param {string} params.buyer - The public key of the buyer. * @param {string} params.basket_mint - The mint public key of the basket. * @param {{mint: string, amount: number}[]} params.contributions - The contributions to the basket. * @param {string} params.contributions[].mint - The mint public key of the contribution. * @param {number} params.contributions[].amount - The amount of the contribution. * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points. * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points. * @param {number} params.execution_start_time - Optional. The execution start time. * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount. * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount. * @returns {Promise} The transaction payload batch sequence. */ buyBasketTx(params: { buyer: string; basket_mint: string; contributions: { mint: string; amount: number; }[]; rebalance_slippage_bps?: number; per_trade_rebalance_slippage_bps?: number; execution_start_time?: number; min_bounty_amount?: number; max_bounty_amount?: number; }): Promise; /** * Deposits additional tokens into an existing user deposit rebalance intent. * * This is useful when the user already created a deposit intent (for example via buyBasketTx), * but has not called lockDepositsTx yet and wants to add more contributions. * * @param {Object} params - The parameters for depositing more tokens. * @param {string} params.buyer - The public key of the buyer / deposit owner. * @param {{mint: string, amount: number}[]} params.contributions - Extra token contributions. * @param {string} params.rebalance_intent - Optional. Existing rebalance intent pubkey. * @param {RebalanceIntent} params.rebalance_intent_chain_data - Optional. Existing rebalance intent chain data. * @returns {Promise} The transaction payload batch sequence. */ depositTokensTx(params: { buyer: string; contributions: { mint: string; amount: number; }[]; rebalance_intent?: string; rebalance_intent_chain_data?: RebalanceIntent; }): Promise; /** * Locks deposits for a user and starts auction flow. * @param {Object} params - The parameters for the lock deposits. * @param {string} params.buyer - The public key of the buyer. * @param {string} params.basket_mint - The mint public key of the basket. * @returns {Promise} The transaction payload batch sequence. */ lockDepositsTx(params: { buyer: string; basket_mint: string; }): Promise; /** * Creates a rebalance intent for a user to withdraw tokens from a basket. * @param {{Object}} params - The parameters for the basket sale. * @param {string} params.seller - The public key of the seller. * @param {string} params.basket_mint - The mint public key of the basket. * @param {number} params.withdraw_amount - The amount of the withdrawal. * @param {string[]} params.keep_tokens - The token mints to skip rebalancing (will directly be sent to the user without being rebalanced). * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points. * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points. * @param {number} params.execution_start_time - Optional. The execution start time. * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount. * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount. * @returns {Promise} The transaction payload batch sequence. */ sellBasketTx(params: { seller: string; basket_mint: string; withdraw_amount: number; keep_tokens: string[]; rebalance_slippage_bps?: number; per_trade_rebalance_slippage_bps?: number; execution_start_time?: number; min_bounty_amount?: number; max_bounty_amount?: number; }): Promise; /** * Creates a rebalance intent for a basket rebalance. * @param {Object} params - The parameters for the basket rebalance. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.basket_mint - The basket token mint public key. * @param {number} params.rebalance_slippage_bps - Optional. The rebalance slippage in basis points. * @param {number} params.per_trade_rebalance_slippage_bps - Optional. The per trade rebalance slippage in basis points. * @param {number} params.execution_start_time - Optional. The execution start time. * @param {number} params.min_bounty_amount - Optional. The minimum bounty amount. * @param {number} params.max_bounty_amount - Optional. The maximum bounty amount. * @returns {Promise} The transaction payload batch sequence. */ rebalanceBasketTx(params: { keeper: string; basket_mint: string; rebalance_slippage_bps?: number; per_trade_rebalance_slippage_bps?: number; execution_start_time?: number; min_bounty_amount?: number; max_bounty_amount?: number; }): Promise; /** * Build update token prices transactions. * * For pyth oracle accounts, fetches feed IDs, builds vaa [create init encode], [write verify], * * [update feed], [close vaa] instructions. For all tokens, builds [update token prices] instructions. * * returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * Batch layout: * * batch 0: * * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx], * * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx], * * ... * * batch 1: * * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx], * * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx], * * ... * * batch 2: * * tx0: [updateFeed0Ix], * * tx1: [updateFeed1Ix], * * ... * * batch 3: * * tx0: [updateTokenPricesIx(max 10 tokens)], * * tx1: [updateTokenPricesIx(max 10 tokens)], * * ... * * txLast: [closeVaa0Ix, closeVaa1Ix, ...] * * @param {Object} params - The parameters for the update token prices. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.basket - The public key of the basket. * @param {string} params.rebalance_intent - The public key of the rebalance intent. * @returns {Promise} The transaction payload batch sequence. */ updateTokenPricesTx(params: { keeper: string; basket: string; rebalance_intent: string; }): Promise; /** * Build Pyth price feed update transactions from on-chain price account pubkeys. * Fetches feed IDs from accounts, builds update instructions, and returns * TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * Batch layout: * * batch 0: * * tx0: [vaa0CreateIx, vaa0InitIx, vaa0WriteIx], * * tx1: [vaa1CreateIx, vaa1InitIx, vaa1WriteIx], * * ... * * batch 1: * * tx0: [vaa0WriteVerifyIx, vaa0VerifyIx], * * tx1: [vaa1WriteVerifyIx, vaa1VerifyIx], * * ... * * batch 2: * * tx0: [updateFeed0Ix], * * tx1: [updateFeed1Ix], * * ... * * batch 3: * * txLast: [closeVaa0Ix, closeVaa1Ix, ...] * */ updatePythPriceFeedsTx(params: { keeper: string; accounts: string[]; }): Promise; /** * Build flash swap transactions (Rebalance or MakeDirectSwap). * * Withdraws amount_out tokens(mint_out) from basket, deposits amount_in tokens(mint_in) to basket. * * If jup_swap_ix is provided, uses it to swap amount_out tokens(mint_out) for amount_in tokens(mint_in). * * returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * Batch layout: batch 0: tx: 0: * * create associated token account_mint_out * * create associated token account_mint_in * * jup_token_ledger_ix * * flash withdraw * * jup_swap_ix * * flash deposit * * set compute unit limit * * set compute unit price * * @param {Object} params - The parameters for the flash swap. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.basket - The public key of the basket. * @param {string} params.rebalance_intent - The public key of the rebalance intent (for Rebalance). * @param {string} params.intent - The public key of the intent (for MakeDirectSwap). * @param {string} params.mint_in - The mint of the input token (deposited to basket). * @param {string} params.mint_out - The mint of the output token (withdrawn from basket). * @param {number} params.amount_in - The amount of the input token (deposited to basket). * @param {number} params.amount_out - The amount of the output token (withdrawn from basket). * @param {"exact_in" | "exact_out" | "ioc"} params.mode - The mode of the flash swap. * @param {TransactionInstruction} params.jup_token_ledger_ix - The jup token ledger ix. * @param {TransactionInstruction} params.jup_swap_ix - The jup swap ix. * @param {PublicKey[]} params.jup_address_lookup_table_addresses - The jup address lookup table addresses. * @returns {Promise} The transaction payload batch sequence. */ flashSwapTx(params: { keeper: string; basket: string; rebalance_intent?: string; intent?: string; mint_in: string; mint_out: string; amount_in: number; amount_out: number; mode?: number; jup_token_ledger_ix?: TransactionInstruction; jup_swap_ix?: TransactionInstruction; jup_address_lookup_table_addresses?: PublicKey[]; }): Promise; /** * Mints basket tokens for a user. Executable when the rebalance intent has finished its auctions. * * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * @param {Object} params - The parameters for the mint. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.rebalance_intent - The public key of the rebalance intent. * @returns {Promise} The transaction payload batch sequence. */ mintTx(params: { keeper: string; rebalance_intent: string; }): Promise; /** * Redeems tokens from the rebalance intent with Withdraw status. * * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * @param {Object} params - The parameters for the redeem tokens. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.rebalance_intent - The public key of the rebalance intent. * @returns {Promise} The transaction payload batch sequence. */ redeemTokensTx(params: { keeper: string; rebalance_intent: string; }): Promise; /** * Claims the bounty to keepers who have completed tasks for rebalance intent. * * Executebale when the rebalance intent has finished its auctions. * * For Withdraw status rebalance intent, tokens have to be redeemed first. * * Closes the rebalance intent if all keepers have claimed the bounty. * * @param {Object} params - The parameters for the claim bounty. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.rebalance_intent - The public key of the rebalance intent. * @returns {Promise} The transaction payload batch sequence. */ claimBountyTx(params: { keeper: string; rebalance_intent: string; }): Promise; /** * Adds bounty for automation to basket. * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * @param {Object} params - The parameters for the add bounty. * @param {string} params.keeper - The public key of the keeper. * @param {string} params.basket - The public key of the basket. * @param {number} params.amount - The amount of the bounty. * @returns {Promise} The transaction payload batch sequence. */ addBountyTx(params: { keeper: string; basket: string; amount: number; }): Promise; /** * Withdraws fees from the basket, initializes WithdrawBasketFees accounts, and claims the fee tokens * for all fee types that the claimer is authorized to claim (symmetry, creator, host, or manager fees). * * This function automatically determines which fee types the claimer can claim based on: * - Symmetry fees: if claimer equals globalConfig.symmetryFeeCollector * - Creator fees: if claimer equals basket.settings.creator * - Host fees: if claimer equals basket.settings.host * - Manager fees: if claimer is in basket.settings.managers.managers * * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * Batch layout: * - batch 0: One transaction per claimable fee type, each containing a withdrawFeesIx instruction. * All transactions in this batch can run in parallel. These create and populate the WithdrawBasketFees accounts. * - batch 1: Multiple transactions for claiming fee tokens, automatically batched based on account limits. * All transactions in this batch can run in parallel. These transfer tokens from WithdrawBasketFees accounts to claimers. * * Note: If not all tokens are claimed in batch 1 (e.g., due to account limits or errors), * use claimTokenFeesFromBasketTx to claim the remaining tokens. * * @param {Object} params - The parameters for withdrawing and claiming basket fees. * @param {string} params.claimer - The public key of the claimer. * @param {string} params.basket - The public key of the basket. * @returns {Promise} The transaction payload batch sequence. */ withdrawBasketFeesTx(params: { claimer: string; basket: string; }): Promise; /** * Claims fee tokens from a WithdrawBasketFees account. * * This function transfers accumulated fee tokens from the WithdrawBasketFees account * to the claimers (owners) based on their weights. The tokens are automatically batched * into multiple transactions if needed to respect Solana's account limit (30 accounts per transaction). * * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * @param {Object} params - The parameters for claiming basket fees. * @param {string} params.claimer - The public key of the claimer. * @param {string} params.basket - The public key of the basket. * @returns {Promise} The transaction payload batch sequence. */ claimTokenFeesFromBasketTx(params: { claimer: string; withdrawBasketFees: string; }): Promise; /** * Rewrites lookup tables for the basket. (Used when the basket lookup tables are full) * * Returns TxPayloadBatchSequence ready for signAndSendTxPayloadBatchSequence. * * Batch layout: * * batch 0: * * tx0: [create temp lookup tables], * * batch 1: * * tx0: [extend temp lookup tables (with oracles of active tokens)], * * tx1: [extend temp lookup tables (with oracles of active tokens)], * * ... * * batch 2: * * tx0: [overwrite lookup tables with temp, deactivate old lookup tables], * * @param {Object} params - The parameters for the rewrite lookup tables. * @param {string} params.signer - The public key of the signer. * @param {string} params.basket_mint - The mint of the basket. * @param {string[]} params.additional_accounts - The additional accounts. * @returns {Promise} The transaction payload batch sequence. */ rewriteLookupTablesTx(params: { signer: string; basket_mint: string; additional_accounts: string[]; }): Promise; signAndSendVersionedTxs(params: { versionedTxs: VersionedTxs; wallet: Wallet; }): Promise; signAndSendTxPayloadBatchSequence(params: { txPayloadBatchSequence: TxPayloadBatchSequence; wallet: Wallet; simulateTransactions?: boolean; }): Promise; } export { BasketCreationTx, TxPayloadBatchSequence, VersionedTxs, }; export { GlobalConfig, Basket, BasketFilter, Intent, IntentFilter, RebalanceIntent, RebalanceIntentFilter }; export { FormattedGlobalConfig, FormattedIntentStatus, FormattedTaskType, FormattedBounty, FormattedBountySchedule, FormattedIntent, }; export { FormattedRebalanceType, FormattedRebalanceAction, FormattedOraclePrice, FormattedTokenAuction, FormattedTaskCompletion, FormattedRebalanceIntent, UIRebalanceIntent, DepositData, PriceUpdatesData, AuctionData, MintData, RedeemData, ClaimBountyData, }; export { FormattedCreatorSettings, FormattedManagersSettings, FormattedFeeSettings, FormattedScheduleSettings, FormattedAutomationSettings, FormattedLpSettings, FormattedMetadataSettings, FormattedDepositsSettings, FormattedForceRebalanceSettings, FormattedCustomRebalanceSettings, FormattedAddTokenSettings, FormattedUpdateWeightsSettings, FormattedMakeDirectSwapSettings, FormattedAccumulatedFees, FormattedLookupTables, FormattedAsset, FormattedOracleSettings, FormattedOracleAggregator, FormattedOracle, FormattedOracleType, FormattedBasket, }; export { EditCreatorSettings, EditManagerSettings, EditFeeSettings, EditScheduleSettings, EditAutomationSettings, EditLpSettings, EditMetadataSettings, EditDepositsSettings, EditForceRebalanceSettings, EditCustomRebalanceSettings, EditAddTokenSettings, EditUpdateWeightsSettings, EditMakeDirectSwapSettings, AddOrEditTokenInput, OracleInput, UpdateWeightsInput, MakeDirectSwapInput, Settings, TaskContext, TaskType, }; export { getJupTokenLedgerAndSwapInstructions, }; export { KeeperMonitor, RebalanceHandler, } from './keeperMonitor';