import BN from "bn.js"; import { PublicKey } from "@solana/web3.js"; import { u8 } from '@coral-xyz/borsh'; import { Fraction } from "../fraction"; import { Bounty } from "./bounty"; import { OraclePriceOnChain } from "../oracle"; import { FeeSettings } from "../config"; import { FormattedFeeSettings } from "../basket"; import { FormattedBountySchedule } from "./intent"; export declare enum RebalanceType { Deposit = 0, Withdraw = 1, Basket = 2, BasketCustom = 3 } export declare enum RebalanceAction { NotActive = 0, DepositTokens = 1, PlaceholderAction = 2, UpdatePrices = 3, Auction = 4 } export interface AuctionTimestamps { startTime: BN; endTime: BN; } export declare const AuctionTimestampsLayout: any; export interface TokenAuction { mint: PublicKey; amount: BN; targetAmount: BN; price: OraclePriceOnChain; keepToken: number; } export declare const TokenAuctionLayout: any; export interface TaskCompletion { completedBy: PublicKey; completedBounty: BN; completedTime: BN; } export declare const TaskCompletionLayout: any; export type FormattedRebalanceType = "deposit" | "withdraw" | "basket" | "basket_custom"; export declare const REBALANCE_TYPE_STRINGS: Map; export type FormattedRebalanceAction = "not_active" | "deposit_tokens" | "placeholder_action" | "update_prices" | "auction"; export declare const REBALANCE_ACTION_STRINGS: Map; export interface FormattedOraclePrice { price: number; conf: number; update_time: number; } export interface FormattedTokenAuction { mint: string; amount: number; target_amount: number; price: FormattedOraclePrice; keep_token: boolean; } export interface FormattedTaskCompletion { completed_by: string; completed_bounty: number; completed_time: number; } export interface DepositData { tokens: { mint: string; amount: number; }[]; } export interface PriceUpdatesData { tokens: { mint: string; updated: boolean; expiration: number; update_time: number; price: number; conf: number; }[]; } export interface AuctionData { auction_stages: { start_time: number; end_time: number; }[]; tokens: { mint: string; amount: number; target_amount: number; price: number; conf: number; }[]; } export interface MintData { mintAmount: number; mintValue: number; fees: { host: number; creator: number; managers: number; symmetry: number; basket: number; }; tokens: { mint: string; contribution_amount: number; remaining_amount: number; }[]; } export interface RedeemData { tokens: { mint: string; amount: number; }[]; } export interface ClaimBountyData { bounty_mint: string; keepers: { pubkey: string; bounty_amount: number; }[]; unused_bounty: { pubkey: string; bounty_amount: number; }; rent: { pubkey: string; sol_amount: number; }; } export interface UIRebalanceIntent { rebalance_type: FormattedRebalanceType; deposit_data: DepositData | null; price_updates_data: PriceUpdatesData | null; auction_data: AuctionData | null; mint_data: MintData | null; redeem_data: RedeemData | null; claim_bounty_data: ClaimBountyData | null; formatted_data: FormattedRebalanceIntent; chain_data: RebalanceIntent; } export interface FormattedRebalanceIntent { pubkey: string; sol_balance: number; basket: string; owner: string; rent_payer: string; rebalance_type: FormattedRebalanceType; current_action: FormattedRebalanceAction; withdraw_params_burn_amount: number; withdraw_params_amount_wo_fees: number; withdraw_params_keep_tokens_bitmask: number[]; withdraw_params_keep_all_tokens: boolean; basket_fee_settings: FormattedFeeSettings; execution_start_time: number; rebalance_threshold_slippage_bps: number; per_trade_rebalance_threshold_slippage_bps: number; initial_tvl: number; auction_update_timestamp: number; auctions: { start_time: number; end_time: number; }[]; tokens: FormattedTokenAuction[]; last_action_timestamp: number; bounty: { bounty_depositor: string; bounty_mint: string; bounty_per_price_update_task: FormattedBountySchedule; bounty_per_task: FormattedBountySchedule; bounty_total: number; bounty_left: number; }; bounty_adjustment_amount: number; placeholder_task: FormattedTaskCompletion; price_update_tasks: FormattedTaskCompletion[]; finish_price_update_task: FormattedTaskCompletion; auction_creation_task: FormattedTaskCompletion; mint_basket_task: FormattedTaskCompletion; cancel_rebalance_task: FormattedTaskCompletion; token_settlement_tasks: FormattedTaskCompletion[]; } export interface RebalanceIntent { basket: PublicKey; owner: PublicKey; rentPayer: PublicKey; rebalanceType: RebalanceType; currentAction: RebalanceAction; withdrawParamsBurnAmount: BN; withdrawParamsAmountWoFees: BN; withdrawParamsKeepTokensBitmask: number[]; withdrawParamsKeepAllTokens: u8; basketFeeSettings: FeeSettings; executionStartTime: BN; rebalanceThresholdSlippageBps: number; perTradeRebalanceThresholdSlippageBps: number; initialTvl: Fraction; auctionUpdateTimestamp: BN; auctions: AuctionTimestamps[]; tokens: TokenAuction[]; lastActionTimestamp: BN; bounty: Bounty; bountyAdjustmentAmount: BN; placeholderTask: TaskCompletion; priceUpdateTasks: TaskCompletion[]; finishPriceUpdateTask: TaskCompletion; auctionCreationTask: TaskCompletion; mintBasketTask: TaskCompletion; cancelRebalanceTask: TaskCompletion; tokenSettlementTasks: TaskCompletion[]; ownAddress?: PublicKey; solBalance?: number; } export declare const RebalanceIntentLayout: any;