/// <reference types="node" />
/// <reference types="bn.js" />
/// <reference types="node" />
/// <reference types="node" />
/**
 * DriftClient — main SDK entry point for all trading and keeper operations.
 *
 * Responsibilities:
 *   - Builds and sends all on-chain instructions (place/cancel/fill orders, deposits, withdrawals,
 *     settle PnL, update funding rate, liquidations).
 *   - Manages the program account subscription lifecycle (markets, oracles, user accounts).
 *   - Provides oracle price reads, market config lookups, and PDA derivation helpers.
 *
 * Admin operations (market init, fee updates, oracle config) live in {@link AdminClient} (adminClient.ts).
 * Read-only user account queries (margin, positions, PnL) live in {@link User} (user.ts).
 *
 * Instruction → on-chain handler mapping: see ARCHITECTURE.md § SDK↔Instruction Mapping.
 */
import { AnchorProvider, BN } from './isomorphic/anchor';
import type { ProgramAccount } from '@coral-xyz/anchor';
import { DriftClientMetricsEvents, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, ScaleOrderParams, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SignedMsgOrderParamsMessage, TxParams, UserAccount, UserStatsAccount, ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, PostOnlyParams, LPPoolAccount, ConstituentAccount, ConstituentTargetBaseAccount, AmmCache } from './types';
import { AccountMeta, AddressLookupTableAccount, BlockhashWithExpiryBlockHeight, ConfirmOptions, Connection, Keypair, PublicKey, Signer, Transaction, TransactionInstruction, TransactionSignature, TransactionVersion, VersionedTransaction } from '@solana/web3.js';
import { TokenFaucet } from './tokenFaucet';
import { EventEmitter } from 'events';
import StrictEventEmitter from 'strict-event-emitter-types';
import { DataAndSlot, DriftClientAccountEvents, DriftClientAccountSubscriber } from './accounts/types';
import { TxSender, TxSigAndSlot } from './tx/types';
import { MMOraclePriceData, OraclePriceData } from './oracles/types';
import { DriftClientConfig } from './driftClientConfig';
import { User } from './user';
import { UserSubscriptionConfig } from './userConfig';
import { DriftEnv, DriftProgram } from './config';
import { UserStats } from './userStats';
import { JupiterClient, QuoteResponse } from './jupiter/jupiterClient';
import { SwapMode, UnifiedQuoteResponse } from './swap/UnifiedSwapClient';
import { UserStatsSubscriptionConfig } from './userStatsConfig';
import { TxHandler } from './tx/txHandler';
import { SignedMsgOrderParams } from './types';
import { TakerInfo } from './types';
import { ConstituentMap } from './constituentMap/constituentMap';
import { RevenueShareEscrowMap } from './userMap/revenueShareEscrowMap';
import { TitanClient } from './titan/titanClient';
import { UnifiedSwapClient } from './swap/UnifiedSwapClient';
/**
 * Union type for swap clients (Titan and Jupiter) - Legacy type
 * @deprecated Use UnifiedSwapClient class instead
 */
export type SwapClient = TitanClient | JupiterClient;
type RemainingAccountParams = import('./core/remainingAccounts').RemainingAccountParams;
/**
 * # DriftClient
 * This class is the main way to interact with Drift Protocol. It allows you to subscribe to the various accounts where the Market's state is stored, as well as: opening positions, liquidating, settling funding, depositing & withdrawing, and more.
 */
export declare class DriftClient {
    connection: Connection;
    wallet: IWallet;
    program: DriftProgram;
    provider: AnchorProvider;
    env: DriftEnv;
    opts?: ConfirmOptions;
    useHotWalletAdmin?: boolean;
    users: Map<string, User>;
    userStats?: UserStats;
    activeSubAccountId: number;
    userAccountSubscriptionConfig: UserSubscriptionConfig;
    userStatsAccountSubscriptionConfig: UserStatsSubscriptionConfig;
    accountSubscriber: DriftClientAccountSubscriber;
    eventEmitter: StrictEventEmitter<EventEmitter, DriftClientAccountEvents>;
    metricsEventEmitter: StrictEventEmitter<EventEmitter, DriftClientMetricsEvents>;
    _isSubscribed: boolean;
    txSender: TxSender;
    perpMarketLastSlotCache: Map<number, number>;
    spotMarketLastSlotCache: Map<number, number>;
    mustIncludePerpMarketIndexes: Set<number>;
    mustIncludeSpotMarketIndexes: Set<number>;
    authority: PublicKey;
    /** @deprecated use marketLookupTables */
    marketLookupTable: PublicKey;
    /** @deprecated use lookupTableAccounts */
    lookupTableAccount: AddressLookupTableAccount;
    marketLookupTables: PublicKey[];
    lookupTableAccounts: AddressLookupTableAccount[];
    includeDelegates?: boolean;
    authoritySubAccountMap?: Map<string, number[]>;
    skipLoadUsers?: boolean;
    txVersion: TransactionVersion;
    txParams: TxParams;
    enableMetricsEvents?: boolean;
    txHandler: TxHandler;
    get isSubscribed(): boolean;
    private getPrePlaceOrderIxs;
    set isSubscribed(val: boolean);
    constructor(config: DriftClientConfig);
    getUserMapKey(subAccountId: number, authority: PublicKey): string;
    createUser(subAccountId: number, accountSubscriptionConfig: UserSubscriptionConfig, authority?: PublicKey): User;
    subscribe(): Promise<boolean>;
    subscribeUsers(): Promise<boolean>[];
    /**
     *	Forces the accountSubscriber to fetch account updates from rpc
     */
    fetchAccounts(): Promise<void>;
    unsubscribe(): Promise<void>;
    unsubscribeUsers(): Promise<void>[];
    statePublicKey?: PublicKey;
    getStatePublicKey(): Promise<PublicKey>;
    signerPublicKey?: PublicKey;
    getSignerPublicKey(): PublicKey;
    getStateAccount(): StateAccount;
    /**
     * Forces a fetch to rpc before returning accounts. Useful for anchor tests.
     */
    forceGetStateAccount(): Promise<StateAccount>;
    getPerpMarketAccount(marketIndex: number): PerpMarketAccount | undefined;
    /**
     * Forces a fetch to rpc before returning accounts. Useful for anchor tests.
     * @param marketIndex
     */
    forceGetPerpMarketAccount(marketIndex: number): Promise<PerpMarketAccount | undefined>;
    getPerpMarketAccounts(): PerpMarketAccount[];
    getSpotMarketAccount(marketIndex: number): SpotMarketAccount | undefined;
    /**
     * Forces a fetch to rpc before returning accounts. Useful for anchor tests.
     * @param marketIndex
     */
    forceGetSpotMarketAccount(marketIndex: number): Promise<SpotMarketAccount | undefined>;
    getSpotMarketAccounts(): SpotMarketAccount[];
    getQuoteSpotMarketAccount(): SpotMarketAccount;
    getOraclePriceDataAndSlot(oraclePublicKey: PublicKey, oracleSource: OracleSource): DataAndSlot<OraclePriceData> | undefined;
    getSerumV3FulfillmentConfig(serumMarket: PublicKey): Promise<SerumV3FulfillmentConfigAccount>;
    getSerumV3FulfillmentConfigs(): Promise<SerumV3FulfillmentConfigAccount[]>;
    getPhoenixV1FulfillmentConfig(phoenixMarket: PublicKey): Promise<PhoenixV1FulfillmentConfigAccount>;
    getPhoenixV1FulfillmentConfigs(): Promise<PhoenixV1FulfillmentConfigAccount[]>;
    getOpenbookV2FulfillmentConfig(openbookMarket: PublicKey): Promise<OpenbookV2FulfillmentConfigAccount>;
    getOpenbookV2FulfillmentConfigs(): Promise<OpenbookV2FulfillmentConfigAccount[]>;
    /** @deprecated use fetchAllLookupTableAccounts() */
    fetchMarketLookupTableAccount(): Promise<AddressLookupTableAccount>;
    fetchAllLookupTableAccounts(): Promise<AddressLookupTableAccount[]>;
    private getTxVersionForNewWallet;
    /**
     * Update the wallet to use for drift transactions and linked user account
     * @param newWallet
     * @param subAccountIds
     * @param activeSubAccountId
     * @param includeDelegates
     */
    updateWallet(newWallet: IWallet, subAccountIds?: number[], activeSubAccountId?: number, includeDelegates?: boolean, authoritySubaccountMap?: Map<string, number[]>): Promise<boolean>;
    /**
     * Update the subscribed accounts to a given authority, while leaving the
     * connected wallet intact. This allows a user to emulate another user's
     * account on the UI and sign permissionless transactions with their own wallet.
     * @param emulateAuthority
     */
    emulateAccount(emulateAuthority: PublicKey): Promise<boolean>;
    switchActiveUser(subAccountId: number, authority?: PublicKey): Promise<void>;
    addUser(subAccountId: number, authority?: PublicKey, userAccount?: UserAccount): Promise<boolean>;
    /**
     * Adds and subscribes to users based on params set by the constructor or by updateWallet.
     */
    addAndSubscribeToUsers(authority?: PublicKey): Promise<boolean>;
    /**
     * Returns the instructions to initialize a user account and the public key of the user account.
     * @param subAccountId
     * @param name
     * @param referrerInfo
     * @returns [instructions, userAccountPublicKey]
     */
    getInitializeUserAccountIxs(subAccountId?: number, name?: string, referrerInfo?: ReferrerInfo, poolId?: number): Promise<[TransactionInstruction[], PublicKey]>;
    /**
     * Initializes a user account and returns the transaction signature and the public key of the user account.
     * @param subAccountId
     * @param name
     * @param referrerInfo
     * @param txParams
     * @returns [transactionSignature, userAccountPublicKey]
     */
    initializeUserAccount(subAccountId?: number, name?: string, referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<[TransactionSignature, PublicKey]>;
    getInitializeUserStatsIx(overrides?: {
        /**
         * Optional external wallet to use as payer. If provided, this wallet will pay
         * for the account creation instead of the default wallet.
         */
        externalWallet?: PublicKey;
    }): Promise<TransactionInstruction>;
    initializeSignedMsgUserOrders(authority: PublicKey, numOrders: number, txParams?: TxParams): Promise<[TransactionSignature, PublicKey]>;
    getInitializeSignedMsgUserOrdersAccountIx(authority: PublicKey, numOrders: number, overrides?: {
        /**
         * Optional external wallet to use as payer. If provided, this wallet will pay
         * for the account creation instead of the default wallet.
         */
        externalWallet?: PublicKey;
    }): Promise<[PublicKey, TransactionInstruction]>;
    resizeSignedMsgUserOrders(authority: PublicKey, numOrders: number, userSubaccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
    getResizeSignedMsgUserOrdersInstruction(authority: PublicKey, numOrders: number, userSubaccountId?: number): Promise<TransactionInstruction>;
    initializeSignedMsgWsDelegatesAccount(authority: PublicKey, delegates?: PublicKey[], txParams?: TxParams): Promise<TransactionSignature>;
    getInitializeSignedMsgWsDelegatesAccountIx(authority: PublicKey, delegates?: PublicKey[]): Promise<TransactionInstruction>;
    initializeRevenueShare(authority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getInitializeRevenueShareIx(authority: PublicKey, overrides?: {
        payer?: PublicKey;
    }): Promise<TransactionInstruction>;
    initializeRevenueShareEscrow(authority: PublicKey, numOrders: number, txParams?: TxParams): Promise<TransactionSignature>;
    getInitializeRevenueShareEscrowIx(authority: PublicKey, numOrders: number, overrides?: {
        payer?: PublicKey;
    }): Promise<TransactionInstruction>;
    migrateReferrer(authority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getMigrateReferrerIx(authority: PublicKey): Promise<TransactionInstruction>;
    resizeRevenueShareEscrowOrders(authority: PublicKey, numOrders: number, txParams?: TxParams): Promise<TransactionSignature>;
    getResizeRevenueShareEscrowOrdersIx(authority: PublicKey, numOrders: number): Promise<TransactionInstruction>;
    /**
     * Creates the transaction to add or update an approved builder.
     * This allows the builder to receive revenue share from referrals.
     *
     * @param builder - The public key of the builder to add or update.
     * @param maxFeeTenthBps - The maximum fee tenth bps to set for the builder.
     * @param add - Whether to add or update the builder. If the builder already exists, `add = true` will update the `maxFeeTenthBps`, otherwise it will add the builder. If `add = false`, the builder's `maxFeeTenthBps` will be set to 0.
     * @param txParams - The transaction parameters to use for the transaction.
     * @returns The transaction to add or update an approved builder.
     */
    changeApprovedBuilder(builder: PublicKey, maxFeeTenthBps: number, add: boolean, txParams?: TxParams): Promise<TransactionSignature>;
    /**
     * Creates the transaction instruction to add or update an approved builder.
     * This allows the builder to receive revenue share from referrals.
     *
     * @param builder - The public key of the builder to add or update.
     * @param maxFeeTenthBps - The maximum fee tenth bps to set for the builder.
     * @param add - Whether to add or update the builder. If the builder already exists, `add = true` will update the `maxFeeTenthBps`, otherwise it will add the builder. If `add = false`, the builder's `maxFeeTenthBps` will be set to 0.
     * @returns The transaction instruction to add or update an approved builder.
     */
    getChangeApprovedBuilderIx(builder: PublicKey, maxFeeTenthBps: number, add: boolean, overrides?: {
        authority?: PublicKey;
        payer?: PublicKey;
    }): Promise<TransactionInstruction>;
    addSignedMsgWsDelegate(authority: PublicKey, delegate: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getAddSignedMsgWsDelegateIx(authority: PublicKey, delegate: PublicKey): Promise<TransactionInstruction>;
    removeSignedMsgWsDelegate(authority: PublicKey, delegate: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getRemoveSignedMsgWsDelegateIx(authority: PublicKey, delegate: PublicKey): Promise<TransactionInstruction>;
    initializeFuelOverflow(authority?: PublicKey): Promise<TransactionSignature>;
    getInitializeFuelOverflowIx(authority?: PublicKey): Promise<TransactionInstruction>;
    sweepFuel(authority?: PublicKey): Promise<TransactionSignature>;
    getSweepFuelIx(authority?: PublicKey): Promise<TransactionInstruction>;
    private getInitializeUserInstructions;
    getNextSubAccountId(): Promise<number>;
    initializeReferrerName(name: string): Promise<TransactionSignature>;
    updateUserName(name: string, subAccountId?: number): Promise<TransactionSignature>;
    updateUserCustomMarginRatio(updates: {
        marginRatio: number;
        subAccountId: number;
    }[], txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateUserCustomMarginRatioIx(marginRatio: number, subAccountId?: number): Promise<TransactionInstruction>;
    getUpdateUserPerpPositionCustomMarginRatioIx(perpMarketIndex: number, marginRatio: number, subAccountId?: number, overrides?: {
        userAccountPublicKey?: PublicKey;
        authority?: PublicKey;
        signingAuthority?: PublicKey;
    }): Promise<TransactionInstruction>;
    updateUserPerpPositionCustomMarginRatio(perpMarketIndex: number, marginRatio: number, subAccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateUserMarginTradingEnabledIx(marginTradingEnabled: boolean, subAccountId?: number, userAccountPublicKey?: PublicKey): Promise<TransactionInstruction>;
    updateUserMarginTradingEnabled(updates: {
        marginTradingEnabled: boolean;
        subAccountId: number;
    }[]): Promise<TransactionSignature>;
    getUpdateUserDelegateIx(delegate: PublicKey, overrides: {
        subAccountId?: number;
        userAccountPublicKey?: PublicKey;
        authority?: PublicKey;
    }): Promise<TransactionInstruction>;
    updateUserDelegate(delegate: PublicKey, subAccountId?: number): Promise<TransactionSignature>;
    updateUserAdvancedLp(updates: {
        advancedLp: boolean;
        subAccountId: number;
    }[]): Promise<TransactionSignature>;
    getUpdateAdvancedDlpIx(advancedLp: boolean, subAccountId: number): Promise<any>;
    updateUserReduceOnly(updates: {
        reduceOnly: boolean;
        subAccountId: number;
    }[]): Promise<TransactionSignature>;
    getUpdateUserReduceOnlyIx(reduceOnly: boolean, subAccountId: number): Promise<TransactionInstruction>;
    updateUserPoolId(updates: {
        poolId: number;
        subAccountId: number;
    }[]): Promise<TransactionSignature>;
    getUpdateUserPoolIdIx(poolId: number, subAccountId: number): Promise<TransactionInstruction>;
    fetchAllUserAccounts(includeIdle?: boolean): Promise<ProgramAccount<UserAccount>[]>;
    getUserAccountsForDelegate(delegate: PublicKey): Promise<UserAccount[]>;
    getUserAccountsAndAddressesForAuthority(authority: PublicKey): Promise<ProgramAccount<UserAccount>[]>;
    getUserAccountsForAuthority(authority: PublicKey): Promise<UserAccount[]>;
    getReferredUserStatsAccountsByReferrer(referrer: PublicKey): Promise<UserStatsAccount[]>;
    getReferrerNameAccountsForAuthority(authority: PublicKey): Promise<ReferrerNameAccount[]>;
    deleteUser(subAccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
    getUserDeletionIx(userAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
    forceDeleteUser(userAccountPublicKey: PublicKey, userAccount: UserAccount, txParams?: TxParams): Promise<TransactionSignature>;
    getForceDeleteUserIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionInstruction>;
    deleteSignedMsgUserOrders(txParams?: TxParams): Promise<TransactionSignature>;
    getSignedMsgUserOrdersDeletionIx(authority: PublicKey): Promise<any>;
    /**
     * Checks if a SignedMsg User Orders account exists for the given authority.
     * The account pubkey is derived using the program ID and authority as seeds.
     * Makes an RPC call to check if the account exists on-chain.
     *
     * @param authority The authority public key to check for
     * @returns Promise that resolves to true if the account exists, false otherwise
     */
    isSignedMsgUserOrdersAccountInitialized(authority: PublicKey): Promise<boolean>;
    reclaimRent(subAccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
    getReclaimRentIx(userAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
    getUser(subAccountId?: number, authority?: PublicKey): User;
    hasUser(subAccountId?: number, authority?: PublicKey): boolean;
    getUsers(): User[];
    getUserStats(): UserStats;
    fetchReferrerNameAccount(name: string): Promise<ReferrerNameAccount | undefined>;
    userStatsAccountPublicKey: PublicKey;
    getUserStatsAccountPublicKey(): PublicKey;
    getUserAccountPublicKey(subAccountId?: number, authority?: PublicKey): Promise<PublicKey>;
    getUserAccount(subAccountId?: number, authority?: PublicKey): UserAccount | undefined;
    /**
     * Forces a fetch to rpc before returning accounts. Useful for anchor tests.
     * @param subAccountId
     */
    forceGetUserAccount(subAccountId?: number, authority?: PublicKey): Promise<UserAccount | undefined>;
    getUserAccountAndSlot(subAccountId?: number, authority?: PublicKey): DataAndSlot<UserAccount> | undefined;
    getSpotPosition(marketIndex: number, subAccountId?: number): SpotPosition | undefined;
    getQuoteAssetTokenAmount(): BN;
    getIsolatedPerpPositionTokenAmount(perpMarketIndex: number, subAccountId?: number): BN;
    /**
     * Returns the token amount for a given market. The spot market precision is based on the token mint decimals.
     * Positive if it is a deposit, negative if it is a borrow.
     * @param marketIndex
     */
    getTokenAmount(marketIndex: number): BN;
    /**
     * Converts an amount to the spot precision for a given market. The spot market precision is based on the token mint decimals.
     * @param marketIndex
     * @param amount
     */
    convertToSpotPrecision(marketIndex: number, amount: BN | number): BN;
    /**
     * Converts an amount to the perp precision. The perp market precision is {@link BASE_PRECISION} (1e9).
     * @param amount
     */
    convertToPerpPrecision(amount: BN | number): BN;
    /**
     * Converts an amount to the price precision. The perp market precision is {@link PRICE_PRECISION} (1e6).
     * @param amount
     */
    convertToPricePrecision(amount: BN | number): BN;
    /**
     * Each drift instruction must include perp and sport market accounts in the ix remaining accounts.
     * Use this function to force a subset of markets to be included in the remaining accounts for every ix
     *
     * @param perpMarketIndexes
     * @param spotMarketIndexes
     */
    mustIncludeMarketsInIx({ perpMarketIndexes, spotMarketIndexes, }: {
        perpMarketIndexes: number[];
        spotMarketIndexes: number[];
    }): void;
    getRemainingAccounts(params: RemainingAccountParams): AccountMeta[];
    addPerpMarketToRemainingAccountMaps(marketIndex: number, writable: boolean, oracleAccountMap: Map<string, AccountMeta>, spotMarketAccountMap: Map<number, AccountMeta>, perpMarketAccountMap: Map<number, AccountMeta>): void;
    addSpotMarketToRemainingAccountMaps(marketIndex: number, writable: boolean, oracleAccountMap: Map<string, AccountMeta>, spotMarketAccountMap: Map<number, AccountMeta>): void;
    addBuilderToRemainingAccounts(builders: PublicKey[], remainingAccounts: AccountMeta[]): void;
    getRemainingAccountMapsForUsers(userAccounts: UserAccount[]): {
        oracleAccountMap: Map<string, AccountMeta>;
        spotMarketAccountMap: Map<number, AccountMeta>;
        perpMarketAccountMap: Map<number, AccountMeta>;
    };
    getOrder(orderId: number, subAccountId?: number): Order | undefined;
    getOrderByUserId(userOrderId: number, subAccountId?: number): Order | undefined;
    /**
     * Get the associated token address for the given spot market
     * @param marketIndex
     * @param useNative
     * @param tokenProgram
     */
    getAssociatedTokenAccount(marketIndex: number, useNative?: boolean, tokenProgram?: PublicKey, authority?: PublicKey, allowOwnerOffCurve?: boolean): Promise<PublicKey>;
    createAssociatedTokenAccountIdempotentInstruction(account: PublicKey, payer: PublicKey, owner: PublicKey, mint: PublicKey, tokenProgram?: PublicKey): TransactionInstruction;
    getDepositTxnIx(amount: BN, marketIndex: number, associatedTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionInstruction[]>;
    buildSwiftDepositTx(signedOrderParams: SignedMsgOrderParams, takerInfo: {
        taker: PublicKey;
        takerStats: PublicKey;
        takerUserAccount: UserAccount;
        signingAuthority: PublicKey;
    }, depositAmount: BN, depositSpotMarketIndex: number, tradePerpMarketIndex: number, subAccountId: number, takerAssociatedTokenAccount: PublicKey, initSwiftAccount?: boolean): Promise<void>;
    createDepositTxn(amount: BN, marketIndex: number, associatedTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, txParams?: TxParams, initSwiftAccount?: boolean, overrides?: {
        authority?: PublicKey;
    }): Promise<VersionedTransaction | Transaction>;
    /**
     * Deposit funds into the given spot market
     *
     * @param amount to deposit
     * @param marketIndex spot market index to deposit into
     * @param associatedTokenAccount can be the wallet public key if using native sol
     * @param subAccountId subaccountId to deposit
     * @param reduceOnly if true, deposit must not increase account risk
     * @param txParams transaction parameters
     * @param initSwiftAccount if true, initialize a swift account for the user
     * @param overrides allows overriding authority for the deposit transaction
     */
    deposit(amount: BN, marketIndex: number, associatedTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, txParams?: TxParams, initSwiftAccount?: boolean, overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionSignature>;
    getDepositInstruction(amount: BN, marketIndex: number, userTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, userInitialized?: boolean, overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionInstruction>;
    private checkIfAccountExists;
    getWrappedSolAccountCreationIxs(amount: BN, includeRent?: boolean, overrides?: {
        authority?: PublicKey;
    }): Promise<{
        ixs: TransactionInstruction[];
        /** @deprecated - this array is always going to be empty, in the current implementation */
        signers: Signer[];
        pubkey: PublicKey;
    }>;
    getTokenProgramForSpotMarket(spotMarketAccount: SpotMarketAccount): PublicKey;
    isToken2022(spotMarketAccount: SpotMarketAccount): boolean;
    isTransferHook(spotMarketAccount: SpotMarketAccount): boolean;
    addTokenMintToRemainingAccounts(spotMarketAccount: SpotMarketAccount, remainingAccounts: AccountMeta[]): void;
    addExtraAccountMetasToRemainingAccounts(mint: PublicKey, remainingAccounts: AccountMeta[]): Promise<void>;
    getAssociatedTokenAccountCreationIx(tokenMintAddress: PublicKey, associatedTokenAddress: PublicKey, tokenProgram: PublicKey): TransactionInstruction;
    createInitializeUserAccountAndDepositCollateralIxs(amount: BN, userTokenAccount: PublicKey, marketIndex?: number, subAccountId?: number, name?: string, fromSubAccountId?: number, referrerInfo?: ReferrerInfo, donateAmount?: BN, customMaxMarginRatio?: number, poolId?: number, overrides?: {
        /**
         * Optional external wallet to deposit from. If provided, the deposit will be made
         * from this wallet instead of the user's authority wallet.
         */
        externalWallet?: PublicKey;
    }): Promise<{
        ixs: TransactionInstruction[];
        userAccountPublicKey: PublicKey;
    }>;
    createInitializeUserAccountAndDepositCollateral(amount: BN, userTokenAccount: PublicKey, marketIndex?: number, subAccountId?: number, name?: string, fromSubAccountId?: number, referrerInfo?: ReferrerInfo, donateAmount?: BN, txParams?: TxParams, customMaxMarginRatio?: number, poolId?: number, overrides?: {
        externalWallet?: PublicKey;
    }): Promise<[Transaction | VersionedTransaction, PublicKey]>;
    /**
     * Creates the User account for a user, and deposits some initial collateral
     * @param amount
     * @param userTokenAccount
     * @param marketIndex
     * @param subAccountId
     * @param name
     * @param fromSubAccountId
     * @param referrerInfo
     * @param donateAmount
     * @param txParams
     * @param customMaxMarginRatio
     * @param poolId
     * @param overrides - Optional overrides including externalWallet for depositing from a different wallet
     * @returns
     */
    initializeUserAccountAndDepositCollateral(amount: BN, userTokenAccount: PublicKey, marketIndex?: number, subAccountId?: number, name?: string, fromSubAccountId?: number, referrerInfo?: ReferrerInfo, donateAmount?: BN, txParams?: TxParams, customMaxMarginRatio?: number, poolId?: number, overrides?: {
        externalWallet?: PublicKey;
    }): Promise<[TransactionSignature, PublicKey]>;
    initializeUserAccountForDevnet(subAccountId: number, name: string, marketIndex: number, tokenFaucet: TokenFaucet, amount: BN, referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<[TransactionSignature, PublicKey]>;
    getWithdrawalIxs(amount: BN, marketIndex: number, associatedTokenAddress: PublicKey, reduceOnly?: boolean, subAccountId?: number, _updateFuel?: boolean): Promise<TransactionInstruction[]>;
    /**
     * Withdraws from a user account. If deposit doesn't already exist, creates a borrow
     * @param amount
     * @param marketIndex
     * @param associatedTokenAddress - the token account to withdraw to. can be the wallet public key if using native sol
     * @param reduceOnly
     */
    withdraw(amount: BN, marketIndex: number, associatedTokenAddress: PublicKey, reduceOnly?: boolean, subAccountId?: number, txParams?: TxParams, updateFuel?: boolean): Promise<TransactionSignature>;
    withdrawAllDustPositions(subAccountId?: number, txParams?: TxParams, opts?: {
        dustPositionCountCallback?: (count: number) => void;
    }): Promise<TransactionSignature | undefined>;
    getWithdrawIx(amount: BN, marketIndex: number, userTokenAccount: PublicKey, reduceOnly?: boolean, subAccountId?: number): Promise<TransactionInstruction>;
    /**
     * Withdraws from the fromSubAccount and deposits into the toSubAccount
     * @param amount
     * @param marketIndex
     * @param fromSubAccountId
     * @param toSubAccountId
     * @param txParams
     */
    transferDeposit(amount: BN, marketIndex: number, fromSubAccountId: number, toSubAccountId: number, txParams?: TxParams): Promise<TransactionSignature>;
    getTransferDepositIx(amount: BN, marketIndex: number, fromSubAccountId: number, toSubAccountId: number): Promise<TransactionInstruction>;
    transferPools(depositFromMarketIndex: number, depositToMarketIndex: number, borrowFromMarketIndex: number, borrowToMarketIndex: number, depositAmount: BN | undefined, borrowAmount: BN | undefined, fromSubAccountId: number, toSubAccountId: number, txParams?: TxParams): Promise<TransactionSignature>;
    getTransferPoolsIx(depositFromMarketIndex: number, depositToMarketIndex: number, borrowFromMarketIndex: number, borrowToMarketIndex: number, depositAmount: BN | undefined, borrowAmount: BN | undefined, fromSubAccountId: number, toSubAccountId: number, isToNewSubAccount?: boolean): Promise<TransactionInstruction>;
    transferPerpPosition(fromSubAccountId: number, toSubAccountId: number, marketIndex: number, amount: BN, txParams?: TxParams): Promise<TransactionSignature>;
    getTransferPerpPositionIx(fromSubAccountId: number, toSubAccountId: number, marketIndex: number, amount: BN): Promise<TransactionInstruction>;
    specialTransferPerpPositionToVamm(userAccountPublicKey: PublicKey, marketIndex: number, amount?: BN, txParams?: TxParams): Promise<TransactionSignature>;
    getSpecialTransferPerpPositionToVammIx(userAccountPublicKey: PublicKey, marketIndex: number, amount?: BN): Promise<TransactionInstruction>;
    depositIntoIsolatedPerpPosition(amount: BN, perpMarketIndex: number, userTokenAccount: PublicKey, subAccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
    getDepositIntoIsolatedPerpPositionIx(amount: BN, perpMarketIndex: number, userTokenAccount: PublicKey, subAccountId?: number): Promise<TransactionInstruction>;
    transferIsolatedPerpPositionDeposit(amount: BN, perpMarketIndex: number, subAccountId?: number, txParams?: TxParams, trySettle?: boolean, noBuffer?: boolean): Promise<TransactionSignature>;
    getTransferIsolatedPerpPositionDepositIx(amount: BN, perpMarketIndex: number, subAccountId?: number, noAmountBuffer?: boolean, signingAuthority?: PublicKey): Promise<TransactionInstruction>;
    withdrawFromIsolatedPerpPosition(amount: BN, perpMarketIndex: number, userTokenAccount: PublicKey, subAccountId?: number, txParams?: TxParams): Promise<TransactionSignature>;
    getWithdrawFromIsolatedPerpPositionIxsBundle(amount: BN, perpMarketIndex: number, subAccountId?: number, userTokenAccount?: PublicKey): Promise<TransactionInstruction[]>;
    getWithdrawFromIsolatedPerpPositionIx(amount: BN, perpMarketIndex: number, userTokenAccount: PublicKey, subAccountId?: number): Promise<TransactionInstruction>;
    updateSpotMarketCumulativeInterest(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    updateSpotMarketCumulativeInterestIx(marketIndex: number): Promise<TransactionInstruction>;
    settleLP(settleeUserAccountPublicKey: PublicKey, marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    settleLPIx(settleeUserAccountPublicKey: PublicKey, marketIndex: number): Promise<TransactionInstruction>;
    removePerpLpShares(marketIndex: number, sharesToBurn?: BN, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    removePerpLpSharesInExpiringMarket(marketIndex: number, userAccountPublicKey: PublicKey, sharesToBurn?: BN, txParams?: TxParams): Promise<TransactionSignature>;
    getRemovePerpLpSharesInExpiringMarket(marketIndex: number, userAccountPublicKey: PublicKey, sharesToBurn?: BN): Promise<TransactionInstruction>;
    getRemovePerpLpSharesIx(marketIndex: number, sharesToBurn?: BN, subAccountId?: number): Promise<TransactionInstruction>;
    addPerpLpShares(amount: BN, marketIndex: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    getAddPerpLpSharesIx(amount: BN, marketIndex: number, subAccountId?: number): Promise<TransactionInstruction>;
    getQuoteValuePerLpShare(marketIndex: number): BN;
    /**
     * @deprecated use {@link placePerpOrder} or {@link placeAndTakePerpOrder} instead
     */
    openPosition(direction: PositionDirection, amount: BN, marketIndex: number, limitPrice?: BN, subAccountId?: number): Promise<TransactionSignature>;
    sendSignedTx(tx: Transaction | VersionedTransaction, opts?: ConfirmOptions): Promise<TransactionSignature>;
    prepareMarketOrderTxs(orderParams: OptionalOrderParams, userAccountPublicKey: PublicKey, userAccount: UserAccount, makerInfo?: MakerInfo | MakerInfo[], txParams?: TxParams, bracketOrdersParams?: OptionalOrderParams[], referrerInfo?: ReferrerInfo, cancelExistingOrders?: boolean, settlePnl?: boolean, positionMaxLev?: number, isolatedPositionDepositAmount?: BN): Promise<{
        cancelExistingOrdersTx?: Transaction | VersionedTransaction;
        settlePnlTx?: Transaction | VersionedTransaction;
        fillTx?: Transaction | VersionedTransaction;
        marketOrderTx: Transaction | VersionedTransaction;
    }>;
    /**
     * Sends a market order and returns a signed tx which can fill the order against the vamm, which the caller can use to fill their own order if required.
     * @param orderParams
     * @param userAccountPublicKey
     * @param userAccount
     * @param makerInfo
     * @param txParams
     * @param bracketOrdersParams
     * @param cancelExistingOrders - Builds and returns an extra transaciton to cancel the existing orders in the same perp market. Intended use is to auto-cancel TP/SL orders when closing a position. Ignored if orderParams.marketType is not MarketType.PERP
     * @returns
     */
    sendMarketOrderAndGetSignedFillTx(orderParams: OptionalOrderParams, userAccountPublicKey: PublicKey, userAccount: UserAccount, makerInfo?: MakerInfo | MakerInfo[], txParams?: TxParams, bracketOrdersParams?: OptionalOrderParams[], referrerInfo?: ReferrerInfo, cancelExistingOrders?: boolean, settlePnl?: boolean): Promise<{
        txSig: TransactionSignature;
        signedFillTx?: Transaction;
        signedCancelExistingOrdersTx?: Transaction;
        signedSettlePnlTx?: Transaction;
    }>;
    placePerpOrder(orderParams: OptionalOrderParams, txParams?: TxParams, subAccountId?: number, isolatedPositionDepositAmount?: BN): Promise<TransactionSignature>;
    getPlacePerpOrderIx(orderParams: OptionalOrderParams, subAccountId?: number, depositToTradeArgs?: {
        isMakingNewAccount: boolean;
        depositMarketIndex: number;
    }): Promise<TransactionInstruction>;
    updateAMMs(marketIndexes: number[], txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateAMMsIx(marketIndexes: number[]): Promise<TransactionInstruction>;
    settleExpiredMarket(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    getSettleExpiredMarketIx(marketIndex: number): Promise<TransactionInstruction>;
    settleExpiredMarketPoolsToRevenuePool(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    getSettleExpiredMarketPoolsToRevenuePoolIx(perpMarketIndex: number): Promise<TransactionInstruction>;
    cancelOrder(orderId?: number, txParams?: TxParams, subAccountId?: number, overrides?: {
        withdrawIsolatedDepositAmount?: BN;
    }): Promise<TransactionSignature>;
    getCancelOrderIx(orderId?: number, subAccountId?: number): Promise<TransactionInstruction>;
    cancelOrderByUserId(userOrderId: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    getCancelOrderByUserIdIx(userOrderId: number, subAccountId?: number): Promise<TransactionInstruction>;
    /**
     * Sends a transaction to cancel the provided order ids.
     *
     * @param orderIds - The order ids to cancel.
     * @param txParams - The transaction parameters.
     * @param subAccountId - The sub account id to cancel the orders for.
     * @param user - The user to cancel the orders for. If provided, it will be prioritized over the subAccountId.
     * @returns The transaction signature.
     */
    cancelOrdersByIds(orderIds?: number[], txParams?: TxParams, subAccountId?: number, user?: User, overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionSignature>;
    /**
     * Returns the transaction instruction to cancel the provided order ids.
     *
     * @param orderIds - The order ids to cancel.
     * @param subAccountId - The sub account id to cancel the orders for.
     * @param user - The user to cancel the orders for. If provided, it will be prioritized over the subAccountId.
     * @returns The transaction instruction to cancel the orders.
     */
    getCancelOrdersByIdsIx(orderIds?: number[], subAccountId?: number, user?: User, overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionInstruction>;
    cancelOrders(marketType?: MarketType, marketIndex?: number, direction?: PositionDirection, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    getCancelOrdersIx(marketType: MarketType | null, marketIndex: number | null, direction: PositionDirection | null, subAccountId?: number): Promise<TransactionInstruction>;
    cancelAndPlaceOrders(cancelOrderParams: {
        marketType?: MarketType;
        marketIndex?: number;
        direction?: PositionDirection;
    }, placeOrderParams: OrderParams[], txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    placeOrders(params: OrderParams[], txParams?: TxParams, subAccountId?: number, optionalIxs?: TransactionInstruction[], isolatedPositionDepositAmount?: BN): Promise<TransactionSignature>;
    preparePlaceOrdersTx(params: OrderParams[], txParams?: TxParams, subAccountId?: number, optionalIxs?: TransactionInstruction[], isolatedPositionDepositAmount?: BN): Promise<{
        placeOrdersTx: Transaction | VersionedTransaction;
    }>;
    getPlaceOrdersIx(params: OptionalOrderParams[], subAccountId?: number, overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionInstruction>;
    getPlaceOrdersAndSetPositionMaxLevIx(params: OptionalOrderParams[], positionMaxLev: number, subAccountId?: number): Promise<TransactionInstruction[]>;
    /**
     * Place scale orders: multiple limit orders distributed across a price range
     * @param params Scale order parameters
     * @param txParams Optional transaction parameters
     * @param subAccountId Optional sub account ID
     * @returns Transaction signature
     */
    placeScaleOrders(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    preparePlaceScaleOrdersTx(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<{
        placeScaleOrdersTx: Transaction | VersionedTransaction;
    }>;
    getPlaceScaleOrdersIx(params: ScaleOrderParams, subAccountId?: number): Promise<TransactionInstruction>;
    fillPerpOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams, fillerSubAccountId?: number, fillerAuthority?: PublicKey, hasBuilderFee?: boolean): Promise<TransactionSignature>;
    getFillPerpOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, fillerSubAccountId?: number, isSignedMsg?: boolean, fillerAuthority?: PublicKey, hasBuilderFee?: boolean): Promise<TransactionInstruction>;
    getRevertFillIx(fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
    placeSpotOrder(_orderParams: OptionalOrderParams, _txParams?: TxParams, _subAccountId?: number): Promise<TransactionSignature>;
    preparePlaceSpotOrderTx(_orderParams: OptionalOrderParams, _txParams?: TxParams, _subAccountId?: number): Promise<void>;
    getPlaceSpotOrderIx(_orderParams: OptionalOrderParams, _subAccountId?: number, _overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionInstruction>;
    fillSpotOrder(_userAccountPublicKey: PublicKey, _user: UserAccount, _order?: Pick<Order, 'marketIndex' | 'orderId'>, _fulfillmentConfig?: SerumV3FulfillmentConfigAccount | PhoenixV1FulfillmentConfigAccount | OpenbookV2FulfillmentConfigAccount, _makerInfo?: MakerInfo | MakerInfo[], _referrerInfo?: ReferrerInfo, _txParams?: TxParams): Promise<TransactionSignature>;
    getFillSpotOrderIx(_userAccountPublicKey: PublicKey, _userAccount: UserAccount, _order?: Pick<Order, 'marketIndex' | 'orderId'>, _fulfillmentConfig?: SerumV3FulfillmentConfigAccount | PhoenixV1FulfillmentConfigAccount | OpenbookV2FulfillmentConfigAccount, _makerInfo?: MakerInfo | MakerInfo[], _referrerInfo?: ReferrerInfo, _fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
    addSpotFulfillmentAccounts(marketIndex: number, remainingAccounts: AccountMeta[], fulfillmentConfig?: SerumV3FulfillmentConfigAccount | PhoenixV1FulfillmentConfigAccount | OpenbookV2FulfillmentConfigAccount): void;
    addSerumRemainingAccounts(marketIndex: number, remainingAccounts: AccountMeta[], fulfillmentConfig: SerumV3FulfillmentConfigAccount): void;
    addPhoenixRemainingAccounts(marketIndex: number, remainingAccounts: AccountMeta[], fulfillmentConfig: PhoenixV1FulfillmentConfigAccount): void;
    addOpenbookRemainingAccounts(marketIndex: number, remainingAccounts: AccountMeta[], fulfillmentConfig: OpenbookV2FulfillmentConfigAccount): void;
    /**
     * Swap tokens in drift account using titan or jupiter
     * @param swapClient swap client to find routes and instructions (Titan or Jupiter)
     * @param jupiterClient @deprecated Use swapClient instead. Legacy parameter for backward compatibility
     * @param outMarketIndex the market index of the token you're buying
     * @param inMarketIndex the market index of the token you're selling
     * @param outAssociatedTokenAccount the token account to receive the token being sold on the swap provider
     * @param inAssociatedTokenAccount the token account to
     * @param amount the amount of TokenIn, regardless of swapMode
     * @param slippageBps the max slippage passed to the swap provider api
     * @param swapMode swap provider swapMode (ExactIn or ExactOut), default is ExactIn
     * @param route the swap provider route to use for the swap
     * @param reduceOnly specify if In or Out token on the drift account must reduceOnly, checked at end of swap
     * @param v6 pass in the quote response from swap provider quote's API (deprecated, use quote instead)
     * @param quote pass in the quote response from swap provider quote's API
     * @param txParams
     */
    swap({ swapClient, jupiterClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, reduceOnly, txParams, v6, quote, onlyDirectRoutes, }: {
        swapClient?: UnifiedSwapClient | SwapClient;
        /** @deprecated Use swapClient instead. Legacy parameter for backward compatibility */
        jupiterClient?: JupiterClient;
        outMarketIndex: number;
        inMarketIndex: number;
        outAssociatedTokenAccount?: PublicKey;
        inAssociatedTokenAccount?: PublicKey;
        amount: BN;
        slippageBps?: number;
        swapMode?: SwapMode;
        reduceOnly?: SwapReduceOnly;
        txParams?: TxParams;
        onlyDirectRoutes?: boolean;
        v6?: {
            quote?: QuoteResponse;
        };
        quote?: UnifiedQuoteResponse;
    }): Promise<TransactionSignature>;
    getTitanSwapIx({ titanClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, reduceOnly, userAccountPublicKey, }: {
        titanClient: TitanClient;
        outMarketIndex: number;
        inMarketIndex: number;
        outAssociatedTokenAccount?: PublicKey;
        inAssociatedTokenAccount?: PublicKey;
        amount: BN;
        slippageBps?: number;
        swapMode?: string;
        onlyDirectRoutes?: boolean;
        reduceOnly?: SwapReduceOnly;
        userAccountPublicKey?: PublicKey;
    }): Promise<{
        ixs: TransactionInstruction[];
        lookupTables: AddressLookupTableAccount[];
    }>;
    getJupiterSwapIxV6({ jupiterClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, quote, reduceOnly, userAccountPublicKey, }: {
        jupiterClient: JupiterClient;
        outMarketIndex: number;
        inMarketIndex: number;
        outAssociatedTokenAccount?: PublicKey;
        inAssociatedTokenAccount?: PublicKey;
        amount: BN;
        slippageBps?: number;
        swapMode?: SwapMode;
        onlyDirectRoutes?: boolean;
        quote?: QuoteResponse;
        reduceOnly?: SwapReduceOnly;
        userAccountPublicKey?: PublicKey;
    }): Promise<{
        ixs: TransactionInstruction[];
        lookupTables: AddressLookupTableAccount[];
    }>;
    /**
     * Get the drift begin_swap and end_swap instructions
     *
     * @param outMarketIndex the market index of the token you're buying
     * @param inMarketIndex the market index of the token you're selling
     * @param amountIn the amount of the token to sell
     * @param inTokenAccount the token account to move the tokens being sold
     * @param outTokenAccount the token account to receive the tokens being bought
     * @param limitPrice the limit price of the swap
     * @param reduceOnly
     * @param userAccountPublicKey optional, specify a custom userAccountPublicKey to use instead of getting the current user account; can be helpful if the account is being created within the current tx
     */
    getSwapIx({ outMarketIndex, inMarketIndex, amountIn, inTokenAccount, outTokenAccount, limitPrice, reduceOnly, userAccountPublicKey, }: {
        outMarketIndex: number;
        inMarketIndex: number;
        amountIn: BN;
        inTokenAccount: PublicKey;
        outTokenAccount: PublicKey;
        limitPrice?: BN;
        reduceOnly?: SwapReduceOnly;
        userAccountPublicKey?: PublicKey;
    }): Promise<{
        beginSwapIx: TransactionInstruction;
        endSwapIx: TransactionInstruction;
    }>;
    getSwapIxV2({ swapClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, reduceOnly, quote, v6, userAccountPublicKey, }: {
        swapClient: UnifiedSwapClient;
        outMarketIndex: number;
        inMarketIndex: number;
        outAssociatedTokenAccount?: PublicKey;
        inAssociatedTokenAccount?: PublicKey;
        amount: BN;
        slippageBps?: number;
        swapMode?: SwapMode;
        onlyDirectRoutes?: boolean;
        reduceOnly?: SwapReduceOnly;
        quote?: UnifiedQuoteResponse;
        v6?: {
            quote?: QuoteResponse;
        };
        userAccountPublicKey?: PublicKey;
    }): Promise<{
        ixs: TransactionInstruction[];
        lookupTables: AddressLookupTableAccount[];
    }>;
    stakeForMSOL({ amount }: {
        amount: BN;
    }): Promise<TxSigAndSlot>;
    getStakeForMSOLIx({ amount, userAccountPublicKey, }: {
        amount: BN;
        userAccountPublicKey?: PublicKey;
    }): Promise<TransactionInstruction[]>;
    triggerOrder(userAccountPublicKey: PublicKey, user: UserAccount, order: Order, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
    getTriggerOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Order, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
    forceCancelOrders(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
    getForceCancelOrdersIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
    updateUserIdle(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
    getUpdateUserIdleIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
    logUserBalances(userAccountPublicKey: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getLogUserBalancesIx(userAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
    updateUserFuelBonus(userAccountPublicKey: PublicKey, user: UserAccount, userAuthority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateUserFuelBonusIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, userAuthority: PublicKey): Promise<TransactionInstruction>;
    updateUserStatsReferrerStatus(userAuthority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateUserStatsReferrerStatusIx(userAuthority: PublicKey): Promise<TransactionInstruction>;
    updateUserOpenOrdersCount(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
    getUpdateUserOpenOrdersCountIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
    placeAndTakePerpOrder(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, successCondition?: PlaceAndTakeOrderSuccessCondition, auctionDurationPercentage?: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, bracketOrdersParams?: OptionalOrderParams[], txParams?: TxParams, subAccountId?: number, cancelExistingOrders?: boolean, settlePnl?: boolean, exitEarlyIfSimFails?: boolean, auctionDurationPercentage?: number, optionalIxs?: TransactionInstruction[], isolatedPositionDepositAmount?: BN): Promise<{
        placeAndTakeTx: Transaction | VersionedTransaction;
        cancelExistingOrdersTx: Transaction | VersionedTransaction;
        settlePnlTx: Transaction | VersionedTransaction;
    }>;
    placeAndTakePerpWithAdditionalOrders(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, bracketOrdersParams?: OptionalOrderParams[], txParams?: TxParams, subAccountId?: number, cancelExistingOrders?: boolean, settlePnl?: boolean, exitEarlyIfSimFails?: boolean): Promise<{
        txSig: TransactionSignature;
        signedCancelExistingOrdersTx?: Transaction;
        signedSettlePnlTx?: Transaction;
    }>;
    getPlaceAndTakePerpOrderIx(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, successCondition?: PlaceAndTakeOrderSuccessCondition, auctionDurationPercentage?: number, subAccountId?: number, overrides?: {
        authority?: PublicKey;
    }): Promise<TransactionInstruction>;
    placeAndMakePerpOrder(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    getPlaceAndMakePerpOrderIx(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo, subAccountId?: number): Promise<TransactionInstruction>;
    signSignedMsgOrderParamsMessage(orderParamsMessage: SignedMsgOrderParamsMessage | SignedMsgOrderParamsDelegateMessage, delegateSigner?: boolean): SignedMsgOrderParams;
    /**
     * Builds a deposit and place request for Swift service
     *
     * @param depositTx - The signed tx containing a drift deposit (e.g. see `buildSwiftDepositTx`)
     * @param orderParamsMessage - The order parameters message to sign
     * @param delegateSigner - Whether this is a delegate signer
     *
     * @returns request object for Swift service
     */
    buildDepositAndPlaceSignedMsgOrderRequest(depositTx: VersionedTransaction, orderParamsMessage: SignedMsgOrderParamsMessage | SignedMsgOrderParamsDelegateMessage, delegateSigner?: boolean): {
        deposit_tx: Buffer;
        swift_order: SignedMsgOrderParams;
    };
    encodeSignedMsgOrderParamsMessage(orderParamsMessage: SignedMsgOrderParamsMessage | SignedMsgOrderParamsDelegateMessage, delegateSigner?: boolean): Buffer;
    decodeSignedMsgOrderParamsMessage(encodedMessage: Buffer, delegateSigner?: boolean): SignedMsgOrderParamsMessage | SignedMsgOrderParamsDelegateMessage;
    signMessage(message: Uint8Array, keypair?: Keypair): Buffer;
    placeSignedMsgTakerOrder(signedSignedMsgOrderParams: SignedMsgOrderParams, marketIndex: number, takerInfo: {
        taker: PublicKey;
        takerStats: PublicKey;
        takerUserAccount: UserAccount;
        signingAuthority: PublicKey;
    }, precedingIxs?: TransactionInstruction[], overrideCustomIxIndex?: number, txParams?: TxParams): Promise<TransactionSignature>;
    getPlaceSignedMsgTakerPerpOrderIxs(signedSignedMsgOrderParams: SignedMsgOrderParams, marketIndex: number, takerInfo: {
        taker: PublicKey;
        takerStats: PublicKey;
        takerUserAccount: UserAccount;
        signingAuthority: PublicKey;
    }, precedingIxs?: TransactionInstruction[], overrideCustomIxIndex?: number): Promise<TransactionInstruction[]>;
    placeAndMakeSignedMsgPerpOrder(signedSignedMsgOrderParams: SignedMsgOrderParams, signedMsgOrderUuid: Uint8Array, takerInfo: {
        taker: PublicKey;
        takerStats: PublicKey;
        takerUserAccount: UserAccount;
        signingAuthority: PublicKey;
    }, orderParams: OptionalOrderParams, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number, precedingIxs?: TransactionInstruction[], overrideCustomIxIndex?: number): Promise<TransactionSignature>;
    getPlaceAndMakeSignedMsgPerpOrderIxs(signedSignedMsgOrderParams: SignedMsgOrderParams, signedMsgOrderUuid: Uint8Array, takerInfo: {
        taker: PublicKey;
        takerStats: PublicKey;
        takerUserAccount: UserAccount;
        signingAuthority: PublicKey;
    }, orderParams: OptionalOrderParams, referrerInfo?: ReferrerInfo, subAccountId?: number, precedingIxs?: TransactionInstruction[], overrideCustomIxIndex?: number): Promise<TransactionInstruction[]>;
    preparePlaceAndTakeSpotOrder(_orderParams: OptionalOrderParams, _fulfillmentConfig?: SerumV3FulfillmentConfigAccount, _makerInfo?: MakerInfo, _referrerInfo?: ReferrerInfo, _txParams?: TxParams, _subAccountId?: number): Promise<void>;
    placeAndTakeSpotOrder(_orderParams: OptionalOrderParams, _fulfillmentConfig?: SerumV3FulfillmentConfigAccount, _makerInfo?: MakerInfo, _referrerInfo?: ReferrerInfo, _txParams?: TxParams, _subAccountId?: number): Promise<TransactionSignature>;
    getPlaceAndTakeSpotOrderIx(_orderParams: OptionalOrderParams, _fulfillmentConfig?: SerumV3FulfillmentConfigAccount, _makerInfo?: MakerInfo, _referrerInfo?: ReferrerInfo, _subAccountId?: number): Promise<TransactionInstruction>;
    placeAndMakeSpotOrder(_orderParams: OptionalOrderParams, _takerInfo: TakerInfo, _fulfillmentConfig?: SerumV3FulfillmentConfigAccount, _referrerInfo?: ReferrerInfo, _txParams?: TxParams, _subAccountId?: number): Promise<TransactionSignature>;
    getPlaceAndMakeSpotOrderIx(_orderParams: OptionalOrderParams, _takerInfo: TakerInfo, _fulfillmentConfig?: SerumV3FulfillmentConfigAccount, _referrerInfo?: ReferrerInfo, _subAccountId?: number): Promise<TransactionInstruction>;
    /**
     * @deprecated use {@link placePerpOrder} or {@link placeAndTakePerpOrder} instead
     */
    closePosition(marketIndex: number, limitPrice?: BN, subAccountId?: number): Promise<TransactionSignature>;
    /**
     * Modifies an open order by closing it and replacing it with a new order.
     * @deprecated use modifyOrder instead
     * @param orderId: The open order to modify
     * @param newBaseAmount: The new base amount for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
     * @param newLimitPice: The new limit price for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
     * @param newOraclePriceOffset: The new oracle price offset for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
     * @returns
     */
    modifyPerpOrder(orderId: number, newBaseAmount?: BN, newLimitPrice?: BN, newOraclePriceOffset?: number): Promise<TransactionSignature>;
    /**
     * Modifies an open order by closing it and replacing it with a new order.
     * @deprecated use modifyOrderByUserOrderId instead
     * @param userOrderId: The open order to modify
     * @param newBaseAmount: The new base amount for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
     * @param newLimitPice: The new limit price for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
     * @param newOraclePriceOffset: The new oracle price offset for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
     * @returns
     */
    modifyPerpOrderByUserOrderId(userOrderId: number, newBaseAmount?: BN, newLimitPrice?: BN, newOraclePriceOffset?: number): Promise<TransactionSignature>;
    /**
     * Modifies an open order (spot or perp) by closing it and replacing it with a new order.
     * @param orderParams.orderId: The open order to modify
     * @param orderParams.newDirection: The new direction for the order
     * @param orderParams.newBaseAmount: The new base amount for the order
     * @param orderParams.newLimitPice: The new limit price for the order
     * @param orderParams.newOraclePriceOffset: The new oracle price offset for the order
     * @param orderParams.newTriggerPrice: Optional - Thew new trigger price for the order.
     * @param orderParams.auctionDuration:
     * @param orderParams.auctionStartPrice:
     * @param orderParams.auctionEndPrice:
     * @param orderParams.reduceOnly:
     * @param orderParams.postOnly:
     * @param orderParams.bitFlags:
     * @param orderParams.policy:
     * @param orderParams.maxTs:
     * @returns
     */
    modifyOrder(orderParams: {
        orderId: number;
        newDirection?: PositionDirection;
        newBaseAmount?: BN;
        newLimitPrice?: BN;
        newOraclePriceOffset?: number;
        newTriggerPrice?: BN;
        newTriggerCondition?: OrderTriggerCondition;
        auctionDuration?: number;
        auctionStartPrice?: BN;
        auctionEndPrice?: BN;
        reduceOnly?: boolean;
        postOnly?: PostOnlyParams;
        bitFlags?: number;
        maxTs?: BN;
        policy?: number;
    }, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    /**
     * @param orderParams: The parameters for the order to modify.
     * @param subAccountId: Optional - The subaccount ID of the user to modify the order for.
     * @param userPublicKey: Optional - The public key of the user to modify the order for. This takes precedence over subAccountId.
     * @returns
     */
    getModifyOrderIx({ orderId, newDirection, newBaseAmount, newLimitPrice, newOraclePriceOffset, newTriggerPrice, newTriggerCondition, auctionDuration, auctionStartPrice, auctionEndPrice, reduceOnly, postOnly, bitFlags, maxTs, policy, }: {
        orderId: number;
        newDirection?: PositionDirection;
        newBaseAmount?: BN;
        newLimitPrice?: BN;
        newOraclePriceOffset?: number;
        newTriggerPrice?: BN;
        newTriggerCondition?: OrderTriggerCondition;
        auctionDuration?: number;
        auctionStartPrice?: BN;
        auctionEndPrice?: BN;
        reduceOnly?: boolean;
        postOnly?: PostOnlyParams;
        bitFlags?: number;
        maxTs?: BN;
        policy?: number;
    }, subAccountId?: number, overrides?: {
        user?: User;
        authority?: PublicKey;
    }): Promise<TransactionInstruction>;
    /**
     * Modifies an open order by closing it and replacing it with a new order.
     * @param orderParams.userOrderId: The open order to modify
     * @param orderParams.newDirection: The new direction for the order
     * @param orderParams.newBaseAmount: The new base amount for the order
     * @param orderParams.newLimitPice: The new limit price for the order
     * @param orderParams.newOraclePriceOffset: The new oracle price offset for the order
     * @param orderParams.newTriggerPrice: Optional - Thew new trigger price for the order.
     * @param orderParams.auctionDuration: Only required if order type changed to market from something else
     * @param orderParams.auctionStartPrice: Only required if order type changed to market from something else
     * @param orderParams.auctionEndPrice: Only required if order type changed to market from something else
     * @param orderParams.reduceOnly:
     * @param orderParams.postOnly:
     * @param orderParams.bitFlags:
     * @param orderParams.policy:
     * @param orderParams.maxTs:
     * @returns
     */
    modifyOrderByUserOrderId(orderParams: {
        userOrderId: number;
        newDirection?: PositionDirection;
        newBaseAmount?: BN;
        newLimitPrice?: BN;
        newOraclePriceOffset?: number;
        newTriggerPrice?: BN;
        newTriggerCondition?: OrderTriggerCondition;
        auctionDuration?: number;
        auctionStartPrice?: BN;
        auctionEndPrice?: BN;
        reduceOnly?: boolean;
        postOnly?: PostOnlyParams;
        bitFlags?: number;
        policy?: ModifyOrderPolicy;
        maxTs?: BN;
    }, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
    getModifyOrderByUserIdIx({ userOrderId, newDirection, newBaseAmount, newLimitPrice, newOraclePriceOffset, newTriggerPrice, newTriggerCondition, auctionDuration, auctionStartPrice, auctionEndPrice, reduceOnly, postOnly, bitFlags, maxTs, policy, }: {
        userOrderId: number;
        newDirection?: PositionDirection;
        newBaseAmount?: BN;
        newLimitPrice?: BN;
        newOraclePriceOffset?: number;
        newTriggerPrice?: BN;
        newTriggerCondition?: OrderTriggerCondition;
        auctionDuration?: number;
        auctionStartPrice?: BN;
        auctionEndPrice?: BN;
        reduceOnly?: boolean;
        postOnly?: PostOnlyParams;
        bitFlags?: number;
        policy?: ModifyOrderPolicy;
        maxTs?: BN;
    }, subAccountId?: number): Promise<TransactionInstruction>;
    settlePNLs(users: {
        settleeUserAccountPublicKey: PublicKey;
        settleeUserAccount: UserAccount;
    }[], marketIndexes: number[], opts?: {
        filterInvalidMarkets?: boolean;
    }, txParams?: TxParams): Promise<TransactionSignature>;
    getSettlePNLsIxs(users: {
        settleeUserAccountPublicKey: PublicKey;
        settleeUserAccount: UserAccount;
    }[], marketIndexes: number[], revenueShareEscrowMap?: RevenueShareEscrowMap): Promise<Array<TransactionInstruction>>;
    settlePNL(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndex: number, txParams?: TxParams, optionalIxs?: TransactionInstruction[], revenueShareEscrowMap?: RevenueShareEscrowMap): Promise<TransactionSignature>;
    settlePNLIx(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndex: number, revenueShareEscrowMap?: RevenueShareEscrowMap): Promise<TransactionInstruction>;
    settleMultiplePNLs(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndexes: number[], mode: SettlePnlMode, revenueShareEscrowMap?: RevenueShareEscrowMap, txParams?: TxParams): Promise<TransactionSignature>;
    settleMultiplePNLsMultipleTxs(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndexes: number[], mode: SettlePnlMode, txParams?: TxParams, optionalIxs?: TransactionInstruction[], revenueShareEscrowMap?: RevenueShareEscrowMap): Promise<TransactionSignature[]>;
    settleMultiplePNLsIx(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndexes: number[], mode: SettlePnlMode, overrides?: {
        authority?: PublicKey;
    }, revenueShareEscrowMap?: RevenueShareEscrowMap): Promise<TransactionInstruction>;
    getSetUserStatusToBeingLiquidatedIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionInstruction>;
    setUserStatusToBeingLiquidated(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionSignature>;
    liquidatePerp(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
    getLiquidatePerpIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
    liquidatePerpWithFill(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, makerInfos: MakerInfo[], txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
    getLiquidatePerpWithFillIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, makerInfos: MakerInfo[], liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
    liquidateSpot(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
    getLiquidateSpotIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
    getJupiterLiquidateSpotWithSwapIxV6({ jupiterClient, liabilityMarketIndex, assetMarketIndex, swapAmount, assetTokenAccount, liabilityTokenAccount, slippageBps, swapMode, onlyDirectRoutes, quote, userAccount, userAccountPublicKey, userStatsAccountPublicKey, liquidatorSubAccountId, maxAccounts, }: {
        jupiterClient: JupiterClient;
        liabilityMarketIndex: number;
        assetMarketIndex: number;
        swapAmount: BN;
        assetTokenAccount?: PublicKey;
        liabilityTokenAccount?: PublicKey;
        slippageBps?: number;
        swapMode?: SwapMode;
        onlyDirectRoutes?: boolean;
        quote?: QuoteResponse;
        userAccount: UserAccount;
        userAccountPublicKey: PublicKey;
        userStatsAccountPublicKey: PublicKey;
        liquidatorSubAccountId?: number;
        maxAccounts?: number;
    }): Promise<{
        ixs: TransactionInstruction[];
        lookupTables: AddressLookupTableAccount[];
    }>;
    /**
     * Get the drift liquidate_spot_with_swap instructions
     *
     * @param liabilityMarketIndex the market index of the token you're buying
     * @param assetMarketIndex the market index of the token you're selling
     * @param amountIn the amount of the token to sell
     * @param assetTokenAccount the token account to move the tokens being sold
     * @param liabilityTokenAccount the token account to receive the tokens being bought
     * @param userAccount
     * @param userAccountPublicKey
     * @param userStatsAccountPublicKey
     */
    getLiquidateSpotWithSwapIx({ liabilityMarketIndex, assetMarketIndex, swapAmount: swapAmount, assetTokenAccount, liabilityTokenAccount, userAccount, userAccountPublicKey, userStatsAccountPublicKey, liquidatorSubAccountId, }: {
        liabilityMarketIndex: number;
        assetMarketIndex: number;
        swapAmount: BN;
        assetTokenAccount: PublicKey;
        liabilityTokenAccount: PublicKey;
        userAccount: UserAccount;
        userAccountPublicKey: PublicKey;
        userStatsAccountPublicKey: PublicKey;
        liquidatorSubAccountId?: number;
    }): Promise<{
        beginSwapIx: TransactionInstruction;
        endSwapIx: TransactionInstruction;
    }>;
    getInsuranceFundSwapIx({ inMarketIndex, outMarketIndex, amountIn, inTokenAccount, outTokenAccount, }: {
        inMarketIndex: number;
        outMarketIndex: number;
        amountIn: BN;
        inTokenAccount: PublicKey;
        outTokenAccount: PublicKey;
    }): Promise<{
        beginSwapIx: TransactionInstruction;
        endSwapIx: TransactionInstruction;
    }>;
    liquidateBorrowForPerpPnl(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
    getLiquidateBorrowForPerpPnlIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
    liquidatePerpPnlForDeposit(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, assetMarketIndex: number, maxPnlTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
    getLiquidatePerpPnlForDepositIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, assetMarketIndex: number, maxPnlTransfer: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
    resolvePerpBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
    getResolvePerpBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
    resolveSpotBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
    getResolveSpotBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
    updateFundingRate(perpMarketIndex: number, oracle: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateFundingRateIx(perpMarketIndex: number, oracle: PublicKey): Promise<TransactionInstruction>;
    updatePrelaunchOracle(perpMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdatePrelaunchOracleIx(perpMarketIndex: number): Promise<TransactionInstruction>;
    updatePerpBidAskTwap(perpMarketIndex: number, makers: [PublicKey, PublicKey][], txParams?: TxParams): Promise<TransactionSignature>;
    getUpdatePerpBidAskTwapIx(perpMarketIndex: number, makers: [PublicKey, PublicKey][]): Promise<TransactionInstruction>;
    settleFundingPayment(userAccountPublicKey: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getSettleFundingPaymentIx(userAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
    triggerEvent(eventName: keyof DriftClientAccountEvents, data?: any): void;
    getOracleDataForPerpMarket(marketIndex: number): OraclePriceData;
    getMMOracleDataForPerpMarket(marketIndex: number): MMOraclePriceData;
    getOracleDataForSpotMarket(marketIndex: number): OraclePriceData;
    initializeInsuranceFundStake(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    getInitializeInsuranceFundStakeIx(marketIndex: number): Promise<TransactionInstruction>;
    getAddInsuranceFundStakeIx(marketIndex: number, amount: BN, collateralAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
    /**
     * Add to an insurance fund stake and optionally initialize the account
     */
    addInsuranceFundStake({ marketIndex, amount, collateralAccountPublicKey, initializeStakeAccount, fromSubaccount, txParams, }: {
        /**
         * Spot market index
         */
        marketIndex: number;
        amount: BN;
        /**
         * The account where the funds to stake come from. Usually an associated token account
         */
        collateralAccountPublicKey: PublicKey;
        /**
         * Add instructions to initialize the staking account -- required if its the first time the currrent authority has staked in this market
         */
        initializeStakeAccount?: boolean;
        /**
         * Optional -- withdraw from current subaccount to fund stake amount, instead of wallet balance
         */
        fromSubaccount?: boolean;
        txParams?: TxParams;
    }): Promise<TransactionSignature>;
    /**
     * Get instructions to add to an insurance fund stake and optionally initialize the account
     */
    getAddInsuranceFundStakeIxs({ marketIndex, amount, collateralAccountPublicKey, initializeStakeAccount, fromSubaccount, }: {
        /**
         * Spot market index
         */
        marketIndex: number;
        amount: BN;
        /**
         * The account where the funds to stake come from. Usually an associated token account
         */
        collateralAccountPublicKey: PublicKey;
        /**
         * Add instructions to initialize the staking account -- required if its the first time the currrent authority has staked in this market
         */
        initializeStakeAccount?: boolean;
        /**
         * Optional -- withdraw from current subaccount to fund stake amount, instead of wallet balance
         */
        fromSubaccount?: boolean;
    }): Promise<TransactionInstruction[]>;
    requestRemoveInsuranceFundStake(marketIndex: number, amount: BN, txParams?: TxParams): Promise<TransactionSignature>;
    cancelRequestRemoveInsuranceFundStake(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    removeInsuranceFundStake(marketIndex: number, collateralAccountPublicKey: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    updateUserQuoteAssetInsuranceStake(authority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateUserQuoteAssetInsuranceStakeIx(authority: PublicKey): Promise<TransactionInstruction>;
    updateUserGovTokenInsuranceStake(authority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateUserGovTokenInsuranceStakeIx(authority: PublicKey): Promise<TransactionInstruction>;
    settleRevenueToInsuranceFund(spotMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    getSettleRevenueToInsuranceFundIx(spotMarketIndex: number): Promise<TransactionInstruction>;
    resolvePerpPnlDeficit(spotMarketIndex: number, perpMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    getResolvePerpPnlDeficitIx(spotMarketIndex: number, perpMarketIndex: number): Promise<TransactionInstruction>;
    getDepositIntoSpotMarketRevenuePoolIx(marketIndex: number, amount: BN, userTokenAccountPublicKey: PublicKey): Promise<TransactionInstruction>;
    /**
     * This ix will donate your funds to drift revenue pool. It does not deposit into your user account
     * @param marketIndex
     * @param amount
     * @param userTokenAccountPublicKey
     * @returns
     */
    depositIntoSpotMarketRevenuePool(marketIndex: number, amount: BN, userTokenAccountPublicKey: PublicKey): Promise<TransactionSignature>;
    getPerpMarketExtendedInfo(marketIndex: number): PerpMarketExtendedInfo;
    /**
     * Calculates taker / maker fee (as a percentage, e.g. .001 = 10 basis points) for particular marketType
     * @param marketType
     * @param positionMarketIndex
     * @returns : {takerFee: number, makerFee: number} Precision None
     */
    getMarketFees(marketType: MarketType, marketIndex?: number, user?: User): {
        takerFee: number;
        makerFee: number;
    };
    /**
     * Returns the market index and type for a given market name
     * E.g. "SOL-PERP" -> { marketIndex: 0, marketType: MarketType.PERP }
     *
     * @param name
     */
    getMarketIndexAndType(name: string): {
        marketIndex: number;
        marketType: MarketType;
    } | undefined;
    postPythLazerOracleUpdate(feedIds: number[], pythMessageHex: string): Promise<string>;
    getPostPythLazerOracleUpdateIxs(feedIds: number[], pythMessageHex: string, precedingIxs?: TransactionInstruction[], overrideCustomIxIndex?: number): Promise<TransactionInstruction[]>;
    fetchProtectedMakerModeConfig(): Promise<ProtectedMakerModeConfig>;
    updateUserProtectedMakerOrders(subAccountId: number, protectedOrders: boolean, authority?: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateUserProtectedMakerOrdersIx(subAccountId: number, protectedOrders: boolean, authority?: PublicKey): Promise<TransactionInstruction>;
    getPauseSpotMarketDepositWithdrawIx(spotMarketIndex: number): Promise<TransactionInstruction>;
    pauseSpotMarketDepositWithdraw(spotMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
    updateMmOracleNative(marketIndex: number, oraclePrice: BN, oracleSequenceId: BN): Promise<TransactionSignature>;
    getUpdateMmOracleNativeIx(marketIndex: number, oraclePrice: BN, oracleSequenceId: BN): Promise<TransactionInstruction>;
    updateAmmSpreadAdjustmentNative(marketIndex: number, ammSpreadAdjustment: number): Promise<TransactionSignature>;
    getUpdateAmmSpreadAdjustmentNativeIx(marketIndex: number, ammSpreadAdjustment: number): TransactionInstruction;
    getLpPoolAccount(lpPoolId: number): Promise<LPPoolAccount>;
    getConstituentTargetBaseAccount(lpPoolId: number): Promise<ConstituentTargetBaseAccount>;
    getAmmCache(): Promise<AmmCache>;
    updateLpConstituentTargetBase(lpPoolId: number, constituents: PublicKey[], txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateLpConstituentTargetBaseIx(lpPoolId: number, constituents: PublicKey[]): Promise<TransactionInstruction>;
    updateLpPoolAum(lpPool: LPPoolAccount, spotMarketIndexOfConstituents: number[], txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateLpPoolAumIxs(lpPool: LPPoolAccount, spotMarketIndexOfConstituents: number[]): Promise<TransactionInstruction>;
    updateAmmCache(perpMarketIndexes: number[], txParams?: TxParams): Promise<TransactionSignature>;
    getUpdateAmmCacheIx(perpMarketIndexes: number[]): Promise<TransactionInstruction>;
    updateConstituentOracleInfo(constituent: ConstituentAccount): Promise<TransactionSignature>;
    getUpdateConstituentOracleInfoIx(constituent: ConstituentAccount): Promise<TransactionInstruction>;
    lpPoolSwap(inMarketIndex: number, outMarketIndex: number, inAmount: BN, minOutAmount: BN, lpPool: PublicKey, userAuthority: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getLpPoolSwapIx(inMarketIndex: number, outMarketIndex: number, inAmount: BN, minOutAmount: BN, lpPool: PublicKey, userAuthority: PublicKey): Promise<TransactionInstruction>;
    viewLpPoolSwapFees(inMarketIndex: number, outMarketIndex: number, inAmount: BN, inTargetWeight: BN, outTargetWeight: BN, lpPool: PublicKey, constituentTargetBase: PublicKey, constituentInTokenAccount: PublicKey, constituentOutTokenAccount: PublicKey, inConstituent: PublicKey, outConstituent: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
    getViewLpPoolSwapFeesIx(inMarketIndex: number, outMarketIndex: number, inAmount: BN, inTargetWeight: BN, outTargetWeight: BN, lpPool: PublicKey, constituentTargetBase: PublicKey, constituentInTokenAccount: PublicKey, constituentOutTokenAccount: PublicKey, inConstituent: PublicKey, outConstituent: PublicKey): Promise<TransactionInstruction>;
    getCreateLpPoolTokenAccountIx(lpPool: LPPoolAccount): Promise<TransactionInstruction>;
    createLpPoolTokenAccount(lpPool: LPPoolAccount, txParams?: TxParams): Promise<TransactionSignature>;
    lpPoolAddLiquidity({ inMarketIndex, inAmount, minMintAmount, lpPool, txParams, }: {
        inMarketIndex: number;
        inAmount: BN;
        minMintAmount: BN;
        lpPool: LPPoolAccount;
        txParams?: TxParams;
    }): Promise<TransactionSignature>;
    getLpPoolAddLiquidityIx({ inMarketIndex, inAmount, minMintAmount, lpPool, }: {
        inMarketIndex: number;
        inAmount: BN;
        minMintAmount: BN;
        lpPool: LPPoolAccount;
    }): Promise<TransactionInstruction[]>;
    viewLpPoolAddLiquidityFees({ inMarketIndex, inAmount, lpPool, txParams, }: {
        inMarketIndex: number;
        inAmount: BN;
        lpPool: LPPoolAccount;
        txParams?: TxParams;
    }): Promise<TransactionSignature>;
    getViewLpPoolAddLiquidityFeesIx({ inMarketIndex, inAmount, lpPool, }: {
        inMarketIndex: number;
        inAmount: BN;
        lpPool: LPPoolAccount;
    }): Promise<TransactionInstruction>;
    lpPoolRemoveLiquidity({ outMarketIndex, lpToBurn, minAmountOut, lpPool, txParams, }: {
        outMarketIndex: number;
        lpToBurn: BN;
        minAmountOut: BN;
        lpPool: LPPoolAccount;
        txParams?: TxParams;
    }): Promise<TransactionSignature>;
    getLpPoolRemoveLiquidityIx({ outMarketIndex, lpToBurn, minAmountOut, lpPool, }: {
        outMarketIndex: number;
        lpToBurn: BN;
        minAmountOut: BN;
        lpPool: LPPoolAccount;
    }): Promise<TransactionInstruction[]>;
    viewLpPoolRemoveLiquidityFees({ outMarketIndex, lpToBurn, lpPool, txParams, }: {
        outMarketIndex: number;
        lpToBurn: BN;
        lpPool: LPPoolAccount;
        txParams?: TxParams;
    }): Promise<TransactionSignature>;
    getViewLpPoolRemoveLiquidityFeesIx({ outMarketIndex, lpToBurn, lpPool, }: {
        outMarketIndex: number;
        lpToBurn: BN;
        lpPool: LPPoolAccount;
    }): Promise<TransactionInstruction>;
    getAllLpPoolAddLiquidityIxs({ inMarketIndex, inAmount, minMintAmount, lpPool, }: {
        inMarketIndex: number;
        inAmount: BN;
        minMintAmount: BN;
        lpPool: LPPoolAccount;
    }, constituentMap: ConstituentMap, includeUpdateConstituentOracleInfo?: boolean, view?: boolean): Promise<TransactionInstruction[]>;
    getAllLpPoolRemoveLiquidityIxs({ outMarketIndex, lpToBurn, minAmountOut, lpPool, }: {
        outMarketIndex: number;
        lpToBurn: BN;
        minAmountOut: BN;
        lpPool: LPPoolAccount;
    }, constituentMap: ConstituentMap, includeUpdateConstituentOracleInfo?: boolean, view?: boolean): Promise<TransactionInstruction[]>;
    getAllUpdateLpPoolAumIxs(lpPool: LPPoolAccount, constituentMap: ConstituentMap, includeUpdateConstituentOracleInfo?: boolean): Promise<TransactionInstruction[]>;
    getAllUpdateConstituentTargetBaseIxs(perpMarketIndexes: number[], lpPool: LPPoolAccount, constituentMap: ConstituentMap, includeUpdateConstituentOracleInfo?: boolean): Promise<TransactionInstruction[]>;
    getAllLpPoolSwapIxs(lpPool: LPPoolAccount, constituentMap: ConstituentMap, inMarketIndex: number, outMarketIndex: number, inAmount: BN, minOutAmount: BN, userAuthority: PublicKey): Promise<TransactionInstruction[]>;
    settlePerpToLpPool(lpPoolId: number, perpMarketIndexes: number[]): Promise<TransactionSignature>;
    getSettlePerpToLpPoolIx(lpPoolId: number, perpMarketIndexes: number[]): Promise<TransactionInstruction>;
    getAllSettlePerpToLpPoolIxs(lpPoolId: number, marketIndexes: number[]): Promise<TransactionInstruction[]>;
    /**
     * Below here are the transaction sending functions
     */
    private handleSignedTransaction;
    private handlePreSignedTransaction;
    private isVersionedTransaction;
    /**
     * Send a transaction.
     *
     * @param tx
     * @param additionalSigners
     * @param opts :: Will fallback to DriftClient's opts if not provided
     * @param preSigned
     * @returns
     */
    sendTransaction(tx: Transaction | VersionedTransaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions, preSigned?: boolean): Promise<TxSigAndSlot>;
    buildTransaction(instructions: TransactionInstruction | TransactionInstruction[], txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean, recentBlockhash?: BlockhashWithExpiryBlockHeight, optionalIxs?: TransactionInstruction[]): Promise<Transaction | VersionedTransaction>;
    buildBulkTransactions(instructions: (TransactionInstruction | TransactionInstruction[])[], txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean): Promise<(Transaction | VersionedTransaction)[]>;
    buildTransactionsMap(instructionsMap: Record<string, TransactionInstruction | TransactionInstruction[]>, txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean): Promise<MappedRecord<Record<string, TransactionInstruction | TransactionInstruction[]>, Transaction | VersionedTransaction>>;
    buildAndSignTransactionsMap(instructionsMap: Record<string, TransactionInstruction | TransactionInstruction[]>, txParams?: TxParams, txVersion?: TransactionVersion, lookupTables?: AddressLookupTableAccount[], forceVersionedTransaction?: boolean): Promise<{
        signedTxMap: Record<string, Transaction>;
        signedTxData: SignedTxData[];
    } | {
        signedTxMap: MappedRecord<Record<string, TransactionInstruction | TransactionInstruction[]>, Transaction | VersionedTransaction>;
        signedTxData: SignedTxData[];
    }>;
    isOrderIncreasingPosition(orderParams: OptionalOrderParams, subAccountId: number): boolean;
}
export {};
//# sourceMappingURL=driftClient.d.ts.map