@0dotxyz/p0-ts-sdk 2.2.0-alpha.2 → 2.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vendor.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _solana_web3_js from '@solana/web3.js';
2
- import { PublicKey, TransactionInstruction, Connection, Transaction, Commitment, AccountInfo, AccountMeta, Signer } from '@solana/web3.js';
2
+ import { PublicKey, TransactionInstruction, Connection, Transaction, Commitment, AccountInfo, AccountMeta as AccountMeta$1, Signer, AddressLookupTableAccount } from '@solana/web3.js';
3
3
  import BigNumber from 'bignumber.js';
4
4
  import { R as ReserveRaw, d as ObligationRaw, O as ObligationJSON, b as ReserveJSON, C as CurvePointFields, s as RewardInfoFields, e as FarmStateRaw, c as FarmStateJSON, H as HistoricalOracleData, t as HistoricalIndexData, P as PoolBalance, I as InsuranceFund, u as FeeStructureJSON, v as OracleGuardRailsJSON, w as FeeStructure, x as OracleGuardRails, S as SpotPosition, k as DriftUserStats, i as DriftUserStatsJSON, j as DriftUser, g as DriftUserJSON, D as DriftSpotMarket, f as DriftSpotMarketJSON, a as DriftRewards, h as DriftRewardsJSON, y as DriftSpotBalanceType, J as JupLendingState, l as JupLendingStateJSON, p as JupTokenReserve, m as JupTokenReserveJSON, q as JupLendingRewardsRateModel, n as JupLendingRewardsRateModelJSON, r as JupRateModel, o as JupRateModelJSON } from './dto-rate-model.types-gN82ZYyC.cjs';
5
5
  export { aj as BigFractionBytesFields, al as BigFractionBytesJSON, V as BorrowRateCurveFields, a4 as BorrowRateCurveJSON, G as CrossbarSimulatePayload, A as CurrentResult, a5 as CurvePointJSON, at as FeeTier, au as FeeTierJSON, F as FeedResponse, aC as HistoricalIndexDataJSON, aB as HistoricalOracleDataJSON, aE as InsuranceFundJSON, ai as LastUpdateFields, ak as LastUpdateJSON, af as ObligationCollateralFields, ad as ObligationCollateralJSON, ag as ObligationLiquidityFields, ac as ObligationLiquidityJSON, ah as ObligationOrderFields, ae as ObligationOrderJSON, B as OracleSubmission, av as OrderFillerRewardStructure, aw as OrderFillerRewardStructureJSON, aD as PoolBalanceJSON, ax as PriceDivergenceGuardRails, ay as PriceDivergenceGuardRailsJSON, X as PriceHeuristicFields, a7 as PriceHeuristicJSON, E as PullFeedAccountData, _ as PythConfigurationFields, aa as PythConfigurationJSON, Q as ReserveCollateralFields, a1 as ReserveCollateralJSON, T as ReserveConfigFields, a2 as ReserveConfigJSON, U as ReserveFeesFields, a3 as ReserveFeesJSON, N as ReserveLiquidityFields, a0 as ReserveLiquidityJSON, am as RewardPerTimeUnitPointFields, ap as RewardPerTimeUnitPointJSON, an as RewardScheduleCurveFields, ao as RewardScheduleCurveJSON, z as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, Y as ScopeConfigurationFields, a8 as ScopeConfigurationJSON, aF as SpotBalanceType, aG as SpotPositionJSON, Z as SwitchboardConfigurationFields, a9 as SwitchboardConfigurationJSON, W as TokenInfoFields, a6 as TokenInfoJSON, ar as UserFeesFields, aq as UserFeesJSON, az as ValidityGuardRails, aA as ValidityGuardRailsJSON, $ as WithdrawalCapsFields, ab as WithdrawalCapsJSON, M as decodeSwitchboardPullFeedData, L as getSwitchboardProgram, as as isSpotBalanceTypeVariant, K as switchboardAccountCoder } from './dto-rate-model.types-gN82ZYyC.cjs';
@@ -23838,7 +23838,7 @@ declare function unpackAccount(address: PublicKey, info: AccountInfo<Buffer$1> |
23838
23838
  declare function getAssociatedTokenAddressSync(mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, programId?: PublicKey, associatedTokenProgramId?: PublicKey): PublicKey;
23839
23839
 
23840
23840
  /** @internal */
23841
- declare function addSigners(keys: AccountMeta[], ownerOrAuthority: PublicKey, multiSigners: Signer[]): AccountMeta[];
23841
+ declare function addSigners(keys: AccountMeta$1[], ownerOrAuthority: PublicKey, multiSigners: Signer[]): AccountMeta$1[];
23842
23842
 
23843
23843
  /** Buffer layout for de/serializing a mint */
23844
23844
  declare const MintLayout: _solana_buffer_layout.Structure<RawMint>;
@@ -23944,32 +23944,12 @@ declare class TokenUnsupportedInstructionError extends TokenError {
23944
23944
  declare function createMemoInstruction(memo: string, signerPubkeys?: Array<PublicKey>): TransactionInstruction;
23945
23945
  /** Instructions defined by the program */
23946
23946
  declare enum TokenInstruction {
23947
- Approve = 4,
23948
23947
  InitializeAccount = 1,
23949
23948
  TransferChecked = 12,
23950
23949
  CloseAccount = 9,
23951
23950
  SyncNative = 17
23952
23951
  }
23953
23952
  /** TODO: docs */
23954
- interface ApproveInstructionData {
23955
- instruction: TokenInstruction.Approve;
23956
- amount: bigint;
23957
- }
23958
- declare const approveInstructionData: _solana_buffer_layout.Structure<ApproveInstructionData>;
23959
- /**
23960
- * Construct an Approve instruction
23961
- *
23962
- * @param account Account to set the delegate for
23963
- * @param delegate Account authorized to transfer tokens from the account
23964
- * @param owner Owner of the account
23965
- * @param amount Maximum number of tokens the delegate may transfer
23966
- * @param multiSigners Signing accounts if `owner` is a multisig
23967
- * @param programId SPL Token program account
23968
- *
23969
- * @return Instruction to add to a transaction
23970
- */
23971
- declare function createApproveInstruction(account: PublicKey, delegate: PublicKey, owner: PublicKey, amount: number | bigint, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
23972
- /** TODO: docs */
23973
23953
  interface InitializeAccountInstructionData {
23974
23954
  instruction: TokenInstruction.InitializeAccount;
23975
23955
  }
@@ -24068,4 +24048,289 @@ declare const transferCheckedInstructionData: _solana_buffer_layout.Structure<Tr
24068
24048
  */
24069
24049
  declare function createTransferCheckedInstruction(source: PublicKey, mint: PublicKey, destination: PublicKey, owner: PublicKey, amount: number | bigint, decimals: number, multiSigners?: Signer[], programId?: PublicKey): TransactionInstruction;
24070
24050
 
24071
- export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, type Account, AccountLayout, AccountState, AccountType, type ApproveInstructionData, type Base, type CloseAccountInstructionData, CorpAction, CurvePointFields, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, type DriftIdlType, type DriftInterestRateCurvePoint, DriftRewards, DriftRewardsJSON, DriftSpotBalanceType, DriftSpotMarket, DriftSpotMarketJSON, type DriftSpotMarketRaw, type DriftState, type DriftStateJSON, DriftUser, DriftUserJSON, type DriftUserRaw, DriftUserStats, DriftUserStatsJSON, type Ema, ExtensionType, FARMS_PROGRAM_ID, FarmStateJSON, FarmStateRaw, FeeStructure, FeeStructureJSON, HistoricalIndexData, HistoricalOracleData, type InitializeAccountInstructionData, InsuranceFund, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, type JupLendIdlType, type JupLendInterestRateCurvePoint, type JupLendRewardsResult, JupLendingRewardsRateModel, JupLendingRewardsRateModelJSON, type JupLendingRewardsRateModelRaw, JupLendingState, JupLendingStateJSON, type JupLendingStateRaw, JupRateModel, JupRateModelJSON, type JupRateModelRaw, JupTokenReserve, JupTokenReserveJSON, type JupTokenReserveRaw, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, type KaminoReserveCurveData, type KfarmsIdlType, type KlendIdlType, type KlendInterestRateCurvePoint, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, type Mint, MintLayout, type Multisig, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, ObligationJSON, ObligationRaw, OracleGuardRails, OracleGuardRailsJSON, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PoolBalance, type Price, type PriceComponent, type PriceData, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, type RawAccount, type RawMint, type RawMultisig, type RefreshObligationAccounts, ReserveJSON, ReserveRaw, RewardInfoFields, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, SinglePoolInstruction, SplAccountType, SpotPosition, type StakeAccount, type SyncNativeInstructionData, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, type TransferCheckedInstructionData, ZERO, addSigners, approveInstructionData, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createApproveInstruction, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToObligationRaw, dtoToReserveRaw, farmRawToDto, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, interpolateLinear, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo, replenishPoolIx, reserveRawToDto, scaledSupplies, slotAdjustmentFactor, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
24051
+ /** A Solana account public key, encoded as 32 bytes by msgpack. */
24052
+ type Pubkey = Uint8Array;
24053
+ /** Solana account metadata for an instruction. */
24054
+ interface AccountMeta {
24055
+ /** Public key for the account. */
24056
+ p: Pubkey;
24057
+ /** Whether the account is a signer. */
24058
+ s: boolean;
24059
+ /** Whether the account is writable. */
24060
+ w: boolean;
24061
+ }
24062
+ /** A single instruction to be executed as part of a transaction. */
24063
+ interface Instruction {
24064
+ /** Program id. */
24065
+ p: Pubkey;
24066
+ /** Account metadata. */
24067
+ a: AccountMeta[];
24068
+ /** Instruction data. */
24069
+ d: Uint8Array;
24070
+ }
24071
+ declare enum SwapMode {
24072
+ ExactIn = "ExactIn",
24073
+ ExactOut = "ExactOut"
24074
+ }
24075
+ type Uint64 = number | bigint;
24076
+ interface ClientRequest {
24077
+ id: number;
24078
+ data: RequestData;
24079
+ }
24080
+ type RequestData = {
24081
+ NewSwapQuoteStream: SwapQuoteRequest;
24082
+ } | {
24083
+ StopStream: StopStreamRequest;
24084
+ };
24085
+ interface SwapQuoteRequest {
24086
+ swap: SwapParams;
24087
+ transaction: TransactionParams;
24088
+ update?: QuoteUpdateParams;
24089
+ }
24090
+ interface SwapParams {
24091
+ inputMint: Pubkey;
24092
+ outputMint: Pubkey;
24093
+ amount: Uint64;
24094
+ swapMode?: SwapMode;
24095
+ slippageBps?: number;
24096
+ dexes?: string[];
24097
+ excludeDexes?: string[];
24098
+ onlyDirectRoutes?: boolean;
24099
+ addSizeConstraint?: boolean;
24100
+ sizeConstraint?: number;
24101
+ providers?: string[];
24102
+ /** Limit total number of accounts used by routes. Default: 256. Available since v1.1. */
24103
+ accountsLimitTotal?: number;
24104
+ /** Limit writable accounts used by routes. Default: 64. Available since v1.1. */
24105
+ accountsLimitWritable?: number;
24106
+ }
24107
+ interface TransactionParams {
24108
+ userPublicKey: Pubkey;
24109
+ closeInputTokenAccount?: boolean;
24110
+ createOutputTokenAccount?: boolean;
24111
+ feeAccount?: Pubkey;
24112
+ feeBps?: number;
24113
+ feeFromInputMint?: boolean;
24114
+ outputAccount?: Pubkey;
24115
+ titanSwapVersion?: SwapVersion;
24116
+ }
24117
+ declare enum SwapVersion {
24118
+ V2 = 2,
24119
+ V3 = 3
24120
+ }
24121
+ interface QuoteUpdateParams {
24122
+ intervalMs?: Uint64;
24123
+ num_quotes: number;
24124
+ }
24125
+ interface StopStreamRequest {
24126
+ id: number;
24127
+ }
24128
+ type ServerMessage = {
24129
+ Response: ResponseSuccess;
24130
+ } | {
24131
+ Error: ResponseError;
24132
+ } | {
24133
+ StreamData: StreamData;
24134
+ } | {
24135
+ StreamEnd: StreamEnd;
24136
+ };
24137
+ type ResponseData = {
24138
+ NewSwapQuoteStream: QuoteSwapStreamResponse;
24139
+ } | {
24140
+ StreamStopped: StopStreamResponse;
24141
+ };
24142
+ interface StreamStart {
24143
+ id: number;
24144
+ dataType: string;
24145
+ }
24146
+ interface ResponseSuccess {
24147
+ requestId: number;
24148
+ data: ResponseData;
24149
+ stream?: StreamStart;
24150
+ }
24151
+ interface ResponseError {
24152
+ requestId: number;
24153
+ code: number;
24154
+ message: string;
24155
+ }
24156
+ type StreamDataPayload = {
24157
+ SwapQuotes: SwapQuotes;
24158
+ };
24159
+ interface StreamData {
24160
+ id: number;
24161
+ seq: number;
24162
+ payload: StreamDataPayload;
24163
+ }
24164
+ interface StreamEnd {
24165
+ id: number;
24166
+ errorCode?: number;
24167
+ errorMessage?: string;
24168
+ }
24169
+ interface QuoteSwapStreamResponse {
24170
+ intervalMs: number;
24171
+ }
24172
+ interface StopStreamResponse {
24173
+ id: number;
24174
+ }
24175
+ interface SwapQuotes {
24176
+ id: string;
24177
+ inputMint: Uint8Array;
24178
+ outputMint: Uint8Array;
24179
+ swapMode: SwapMode;
24180
+ amount: number;
24181
+ quotes: {
24182
+ [key: string]: SwapRoute;
24183
+ };
24184
+ }
24185
+ interface SwapRoute {
24186
+ inAmount: number;
24187
+ outAmount: number;
24188
+ slippageBps: number;
24189
+ platformFee?: PlatformFee;
24190
+ steps: RoutePlanStep[];
24191
+ instructions: Instruction[];
24192
+ addressLookupTables: Pubkey[];
24193
+ contextSlot?: number;
24194
+ timeTaken?: number;
24195
+ expiresAtMs?: number;
24196
+ expiresAfterSlot?: number;
24197
+ computeUnits?: number;
24198
+ computeUnitsSafe?: number;
24199
+ transaction?: Uint8Array;
24200
+ referenceId?: string;
24201
+ }
24202
+ interface PlatformFee {
24203
+ amount: number;
24204
+ fee_bps: number;
24205
+ }
24206
+ interface RoutePlanStep {
24207
+ ammKey: Uint8Array;
24208
+ label: string;
24209
+ inputMint: Uint8Array;
24210
+ outputMint: Uint8Array;
24211
+ inAmount: number;
24212
+ outAmount: number;
24213
+ allocPpb: number;
24214
+ feeMint?: Uint8Array;
24215
+ feeAmount?: number;
24216
+ contextSlot?: number;
24217
+ }
24218
+
24219
+ declare class ConnectionClosed extends Error {
24220
+ code: number;
24221
+ reason: string;
24222
+ constructor(code: number, reason: string);
24223
+ }
24224
+ declare class ErrorResponse extends Error {
24225
+ response: ResponseError;
24226
+ constructor(response: ResponseError);
24227
+ }
24228
+ declare class StreamError extends Error {
24229
+ streamId: number;
24230
+ errorCode: number;
24231
+ errorMessage: string;
24232
+ constructor(packet: StreamEnd);
24233
+ }
24234
+ interface ResponseWithStream<T, D> {
24235
+ response: T;
24236
+ stream: ReadableStream<D>;
24237
+ streamId: number;
24238
+ }
24239
+ declare class V1Client {
24240
+ private socket;
24241
+ private nextId;
24242
+ private _closed;
24243
+ private _closing;
24244
+ private pending;
24245
+ private streams;
24246
+ private streamStopping;
24247
+ private closeListeners;
24248
+ static connect(url: string): Promise<V1Client>;
24249
+ private constructor();
24250
+ private nextRequestId;
24251
+ get closed(): boolean;
24252
+ close(): Promise<void>;
24253
+ newSwapQuoteStream(params: SwapQuoteRequest): Promise<ResponseWithStream<QuoteSwapStreamResponse, SwapQuotes>>;
24254
+ stopStream(streamId: number): Promise<StopStreamResponse>;
24255
+ private send;
24256
+ private handleMessage;
24257
+ private handleResponse;
24258
+ private handleResponseError;
24259
+ private handleStreamData;
24260
+ private handleStreamEnd;
24261
+ private cancelStream;
24262
+ private rejectAll;
24263
+ private handleClose;
24264
+ private handleError;
24265
+ }
24266
+
24267
+ interface SerializedInstruction {
24268
+ p: string;
24269
+ a: {
24270
+ p: string;
24271
+ s: boolean;
24272
+ w: boolean;
24273
+ }[];
24274
+ d: string;
24275
+ }
24276
+ interface SerializedSwapRoute {
24277
+ inAmount: number;
24278
+ outAmount: number;
24279
+ slippageBps: number;
24280
+ platformFee?: {
24281
+ amount: number;
24282
+ fee_bps: number;
24283
+ };
24284
+ instructions: SerializedInstruction[];
24285
+ addressLookupTables: string[];
24286
+ contextSlot?: number;
24287
+ timeTaken?: number;
24288
+ }
24289
+ interface TitanProxySwapQuoteResponse {
24290
+ quotes: {
24291
+ [providerId: string]: SerializedSwapRoute;
24292
+ };
24293
+ inputMint: string;
24294
+ outputMint: string;
24295
+ swapMode: string;
24296
+ amount: number;
24297
+ }
24298
+ interface TitanProxyExactOutResponse {
24299
+ inAmount: number;
24300
+ outAmount: number;
24301
+ otherAmountThreshold: string;
24302
+ slippageBps: number;
24303
+ }
24304
+ declare function deserializeSerializedInstruction(ix: SerializedInstruction): TransactionInstruction;
24305
+ declare function selectBestRoute<T extends {
24306
+ inAmount: number;
24307
+ outAmount: number;
24308
+ }>(quotes: {
24309
+ [id: string]: T;
24310
+ }, swapMode: "ExactIn" | "ExactOut"): T | null;
24311
+ interface TitanSwapQuoteResult {
24312
+ inAmount: string;
24313
+ outAmount: string;
24314
+ otherAmountThreshold: string;
24315
+ slippageBps: number;
24316
+ platformFee?: {
24317
+ amount: string;
24318
+ feeBps: number;
24319
+ };
24320
+ contextSlot?: number;
24321
+ timeTaken?: number;
24322
+ }
24323
+ declare function buildSwapQuoteResult(route: {
24324
+ inAmount: number;
24325
+ outAmount: number;
24326
+ slippageBps: number;
24327
+ platformFee?: {
24328
+ amount: number;
24329
+ fee_bps: number;
24330
+ };
24331
+ contextSlot?: number;
24332
+ timeTaken?: number;
24333
+ }, swapMode: "ExactIn" | "ExactOut"): TitanSwapQuoteResult;
24334
+ declare function resolveLookupTables(connection: Connection, lutPubkeys: PublicKey[]): Promise<AddressLookupTableAccount[]>;
24335
+
24336
+ export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, type Account, AccountLayout, type AccountMeta, AccountState, AccountType, type Base, type ClientRequest, type CloseAccountInstructionData, ConnectionClosed, CorpAction, CurvePointFields, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, type DriftIdlType, type DriftInterestRateCurvePoint, DriftRewards, DriftRewardsJSON, DriftSpotBalanceType, DriftSpotMarket, DriftSpotMarketJSON, type DriftSpotMarketRaw, type DriftState, type DriftStateJSON, DriftUser, DriftUserJSON, type DriftUserRaw, DriftUserStats, DriftUserStatsJSON, type Ema, ErrorResponse, ExtensionType, FARMS_PROGRAM_ID, FarmStateJSON, FarmStateRaw, FeeStructure, FeeStructureJSON, HistoricalIndexData, HistoricalOracleData, type InitializeAccountInstructionData, type Instruction, InsuranceFund, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, type JupLendIdlType, type JupLendInterestRateCurvePoint, type JupLendRewardsResult, JupLendingRewardsRateModel, JupLendingRewardsRateModelJSON, type JupLendingRewardsRateModelRaw, JupLendingState, JupLendingStateJSON, type JupLendingStateRaw, JupRateModel, JupRateModelJSON, type JupRateModelRaw, JupTokenReserve, JupTokenReserveJSON, type JupTokenReserveRaw, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, type KaminoReserveCurveData, type KfarmsIdlType, type KlendIdlType, type KlendInterestRateCurvePoint, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, type Mint, MintLayout, type Multisig, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, ObligationJSON, ObligationRaw, OracleGuardRails, OracleGuardRailsJSON, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, type PlatformFee, PoolBalance, type Price, type PriceComponent, type PriceData, PriceStatus, PriceType, type Pubkey, type QuoteSwapStreamResponse, type QuoteUpdateParams, REFRESH_OBLIGATION_DISCRIMINATOR, type RawAccount, type RawMint, type RawMultisig, type RefreshObligationAccounts, type RequestData, ReserveJSON, ReserveRaw, type ResponseData, type ResponseError, type ResponseSuccess, type ResponseWithStream, RewardInfoFields, type RoutePlanStep, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, type SerializedInstruction, type SerializedSwapRoute, type ServerMessage, SinglePoolInstruction, SplAccountType, SpotPosition, type StakeAccount, type StopStreamRequest, type StopStreamResponse, type StreamData, type StreamDataPayload, type StreamEnd, StreamError, type StreamStart, SwapMode, type SwapParams, type SwapQuoteRequest, type SwapQuotes, type SwapRoute, SwapVersion, type SyncNativeInstructionData, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, type TitanProxyExactOutResponse, type TitanProxySwapQuoteResponse, type TitanSwapQuoteResult, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, type TransactionParams, type TransferCheckedInstructionData, type Uint64, V1Client, ZERO, addSigners, buildSwapQuoteResult, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, deserializeSerializedInstruction, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToObligationRaw, dtoToReserveRaw, farmRawToDto, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, interpolateLinear, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo, replenishPoolIx, reserveRawToDto, resolveLookupTables, scaledSupplies, selectBestRoute, slotAdjustmentFactor, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };