@0dotxyz/p0-ts-sdk 2.5.5-alpha.7 → 2.5.5
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/index.cjs +2268 -3649
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -659
- package/dist/index.d.ts +68 -659
- package/dist/index.js +2267 -3628
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +0 -1
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.js +0 -1
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -136,17 +136,12 @@ declare function isFlashloan(tx: SolanaTransaction): boolean;
|
|
|
136
136
|
declare function makeVersionedTransaction(blockhash: Blockhash, transaction: Transaction, payer: PublicKey, addressLookupTables?: AddressLookupTableAccount[]): Promise<VersionedTransaction>;
|
|
137
137
|
/**
|
|
138
138
|
* Splits your instructions into as many VersionedTransactions as needed
|
|
139
|
-
* so that none exceed MAX_TX_SIZE
|
|
140
|
-
* `maxAccountLocks` account locks (if given).
|
|
139
|
+
* so that none exceed MAX_TX_SIZE.
|
|
141
140
|
*/
|
|
142
141
|
declare function splitInstructionsToFitTransactions(mandatoryIxs: TransactionInstruction[], ixs: TransactionInstruction[], opts: {
|
|
143
142
|
blockhash: string;
|
|
144
143
|
payerKey: PublicKey;
|
|
145
144
|
luts: AddressLookupTableAccount[];
|
|
146
|
-
/** Bytes reserved below MAX_TX_SIZE, e.g. for compute-budget ixs appended at send time. */
|
|
147
|
-
sizeMargin?: number;
|
|
148
|
-
/** Also cap the total account locks per transaction (e.g. MAX_ACCOUNT_LOCKS). */
|
|
149
|
-
maxAccountLocks?: number;
|
|
150
145
|
}): VersionedTransaction[];
|
|
151
146
|
/**
|
|
152
147
|
* Enhances a given transaction with additional metadata.
|
|
@@ -929,24 +924,9 @@ interface SwapProviderConfig {
|
|
|
929
924
|
}
|
|
930
925
|
interface SwapOpts {
|
|
931
926
|
swapConfig?: SwapProviderConfig;
|
|
932
|
-
/**
|
|
933
|
-
* Pin an exact, caller-reviewed swap route instead of running the swap engine.
|
|
934
|
-
*
|
|
935
|
-
* The caller owns ATA setup for the route, the route's input amount MUST equal the flow's swap
|
|
936
|
-
* input (e.g. the loop's borrow amount), and the route MUST pay out to the flow's destination
|
|
937
|
-
* token account. `quoteResponse.otherAmountThreshold` (guaranteed min-out, native units) sizes
|
|
938
|
-
* the follow-up amount — e.g. the loop's deposit byte-patch — exactly like an engine-selected
|
|
939
|
-
* route would. For dynamic caller-controlled routing (inspect/veto routes at build time),
|
|
940
|
-
* prefer `swapEngineRunner`.
|
|
941
|
-
*
|
|
942
|
-
* Note: the bridged `makeBridged*Tx` fallbacks are disabled when a pinned route is supplied —
|
|
943
|
-
* a pinned route belongs to the direct pair and cannot be spliced into SDK-composed legs.
|
|
944
|
-
*/
|
|
945
927
|
swapIxs?: {
|
|
946
928
|
instructions: TransactionInstruction[];
|
|
947
929
|
lookupTables: AddressLookupTableAccount[];
|
|
948
|
-
/** The pinned route's quote; `otherAmountThreshold` must be the route's min-out (native). */
|
|
949
|
-
quoteResponse: SwapQuoteResult;
|
|
950
930
|
};
|
|
951
931
|
}
|
|
952
932
|
interface SwapQuoteResult {
|
|
@@ -1235,88 +1215,6 @@ interface MakeFlashLoanTxParams {
|
|
|
1235
1215
|
isSync?: boolean;
|
|
1236
1216
|
signers?: Signer[];
|
|
1237
1217
|
}
|
|
1238
|
-
type TransferPositionSide = "collateral" | "debt";
|
|
1239
|
-
interface MakeTransferPositionsTxParams {
|
|
1240
|
-
program: MarginfiProgram;
|
|
1241
|
-
connection: Connection;
|
|
1242
|
-
/** Source account A (positions move out of this account). */
|
|
1243
|
-
marginfiAccount: MarginfiAccountType;
|
|
1244
|
-
/** Banks whose A-positions to move; the side is inferred from A's balance. */
|
|
1245
|
-
bankAddresses: PublicKey[];
|
|
1246
|
-
/** Destination account B. Omit to create a fresh account inside the flashloan tx. */
|
|
1247
|
-
destinationAccount?: MarginfiAccountType;
|
|
1248
|
-
/** Only used when `destinationAccount` is omitted. */
|
|
1249
|
-
createDestinationOpts?: {
|
|
1250
|
-
accountIndex?: number;
|
|
1251
|
-
thirdPartyId?: number;
|
|
1252
|
-
};
|
|
1253
|
-
bankMap: Map<string, BankType>;
|
|
1254
|
-
oraclePrices: Map<string, OraclePrice>;
|
|
1255
|
-
bankMetadataMap: BankIntegrationMetadataMap;
|
|
1256
|
-
assetShareValueMultiplierByBank: Map<string, BigNumber>;
|
|
1257
|
-
/** Token program per transferred bank (base58 bank address → token program id). */
|
|
1258
|
-
tokenProgramsByBank: Map<string, PublicKey>;
|
|
1259
|
-
addressLookupTableAccounts?: AddressLookupTableAccount[];
|
|
1260
|
-
/** Head-room added to each borrow over the estimated debt for interest accrual. Default 10 bps. */
|
|
1261
|
-
borrowPaddingBps?: number;
|
|
1262
|
-
/** Max positions per transfer; a larger selection is rejected. Default 5. */
|
|
1263
|
-
maxPositions?: number;
|
|
1264
|
-
/** Whether the group USD rate limiter is enabled (adds an oracle to each withdraw). Default false. */
|
|
1265
|
-
groupRateLimiterEnabled?: boolean;
|
|
1266
|
-
crossbarUrl?: string;
|
|
1267
|
-
overrideInferAccounts?: {
|
|
1268
|
-
group?: PublicKey;
|
|
1269
|
-
authority?: PublicKey;
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
interface TransferPositionsResult {
|
|
1273
|
-
/** Ordered for sequential execution: [setup/crank txs…, flashloan tx]. */
|
|
1274
|
-
transactions: ExtendedV0Transaction[];
|
|
1275
|
-
/** Index of the flashloan tx in `transactions`. */
|
|
1276
|
-
actionTxIndex: number;
|
|
1277
|
-
/** The destination account (passed-in, or the projected account created in the tx). */
|
|
1278
|
-
destinationAccount: MarginfiAccountType;
|
|
1279
|
-
}
|
|
1280
|
-
interface MakeBulkWithdrawTxParams {
|
|
1281
|
-
program: MarginfiProgram;
|
|
1282
|
-
connection: Connection;
|
|
1283
|
-
marginfiAccount: MarginfiAccountType;
|
|
1284
|
-
/** Banks whose FULL positions to withdraw, in execution order. */
|
|
1285
|
-
bankAddresses: PublicKey[];
|
|
1286
|
-
bankMap: Map<string, BankType>;
|
|
1287
|
-
oraclePrices: Map<string, OraclePrice>;
|
|
1288
|
-
bankMetadataMap: BankIntegrationMetadataMap;
|
|
1289
|
-
assetShareValueMultiplierByBank: Map<string, BigNumber>;
|
|
1290
|
-
/** Token program per withdrawn bank (base58 bank address → token program id). */
|
|
1291
|
-
tokenProgramsByBank: Map<string, PublicKey>;
|
|
1292
|
-
luts: AddressLookupTableAccount[];
|
|
1293
|
-
crossbarUrl?: string;
|
|
1294
|
-
overrideInferAccounts?: {
|
|
1295
|
-
group?: PublicKey;
|
|
1296
|
-
authority?: PublicKey;
|
|
1297
|
-
};
|
|
1298
|
-
}
|
|
1299
|
-
interface MakeBulkRepayTxParams {
|
|
1300
|
-
program: MarginfiProgram;
|
|
1301
|
-
connection: Connection;
|
|
1302
|
-
marginfiAccount: MarginfiAccountType;
|
|
1303
|
-
/** Banks whose FULL debts to repay from the wallet. */
|
|
1304
|
-
bankAddresses: PublicKey[];
|
|
1305
|
-
bankMap: Map<string, BankType>;
|
|
1306
|
-
/** Token program per repaid bank (base58 bank address → token program id). */
|
|
1307
|
-
tokenProgramsByBank: Map<string, PublicKey>;
|
|
1308
|
-
addressLookupTableAccounts?: AddressLookupTableAccount[];
|
|
1309
|
-
overrideInferAccounts?: {
|
|
1310
|
-
group?: PublicKey;
|
|
1311
|
-
authority?: PublicKey;
|
|
1312
|
-
};
|
|
1313
|
-
}
|
|
1314
|
-
interface BulkLendTxsResult {
|
|
1315
|
-
/** Ordered for sequential execution: [setup/crank txs…, action txs…]. */
|
|
1316
|
-
transactions: ExtendedV0Transaction[];
|
|
1317
|
-
/** Index of the first action tx in `transactions`. */
|
|
1318
|
-
actionTxIndex: number;
|
|
1319
|
-
}
|
|
1320
1218
|
interface MakeLoopTxParams {
|
|
1321
1219
|
program: MarginfiProgram;
|
|
1322
1220
|
marginfiAccount: MarginfiAccountType;
|
|
@@ -1350,11 +1248,6 @@ interface MakeLoopTxParams {
|
|
|
1350
1248
|
* Optional override for how the swap engine runs. Defaults to the in-process
|
|
1351
1249
|
* `runSwapEngine`; the app injects a runner that forwards to `/api/tx/swap-engine`
|
|
1352
1250
|
* so the multi-provider fan-out happens server-side.
|
|
1353
|
-
*
|
|
1354
|
-
* Also the seam for caller-controlled routing: wrap the default runner to inspect, veto, or
|
|
1355
|
-
* replace the selected route before it's spliced into the flashloan (see
|
|
1356
|
-
* `examples/16c-loop-pinned-route.ts`). For a fully static, pre-reviewed route use
|
|
1357
|
-
* `swapOpts.swapIxs` instead.
|
|
1358
1251
|
*/
|
|
1359
1252
|
swapEngineRunner?: SwapEngineRunner;
|
|
1360
1253
|
}
|
|
@@ -2601,7 +2494,7 @@ declare function computeTotalOutstandingEmissions(balance: BalanceType, bank: Ba
|
|
|
2601
2494
|
* - Including all active banks (excluding any in the exclusion list)
|
|
2602
2495
|
* - Reserving inactive slots for mandatory banks that aren't currently active
|
|
2603
2496
|
*
|
|
2604
|
-
* @param
|
|
2497
|
+
* @param balances - Current account balances
|
|
2605
2498
|
* @param banksMap - Map of bank addresses to bank data
|
|
2606
2499
|
* @param mandatoryBanks - Banks that must be included (e.g., for pending transactions)
|
|
2607
2500
|
* @param excludedBanks - Banks to exclude from health checks
|
|
@@ -2609,20 +2502,15 @@ declare function computeTotalOutstandingEmissions(balance: BalanceType, bank: Ba
|
|
|
2609
2502
|
*
|
|
2610
2503
|
* @example
|
|
2611
2504
|
* ```typescript
|
|
2612
|
-
* const healthCheckBanks = computeHealthCheckAccounts(
|
|
2613
|
-
* account,
|
|
2505
|
+
* const healthCheckBanks = computeHealthCheckAccounts(
|
|
2506
|
+
* account.balances,
|
|
2614
2507
|
* banksMap,
|
|
2615
|
-
*
|
|
2616
|
-
*
|
|
2617
|
-
*
|
|
2508
|
+
* [newBankToDeposit], // Mandatory: not active yet but will be
|
|
2509
|
+
* [closingBank] // Excluded: being closed in this transaction
|
|
2510
|
+
* );
|
|
2618
2511
|
* ```
|
|
2619
2512
|
*/
|
|
2620
|
-
declare function computeHealthCheckAccounts(
|
|
2621
|
-
account: MarginfiAccountType;
|
|
2622
|
-
banksMap: Map<string, BankType>;
|
|
2623
|
-
mandatoryBanks?: PublicKey[];
|
|
2624
|
-
excludedBanks?: PublicKey[];
|
|
2625
|
-
}): BankType[];
|
|
2513
|
+
declare function computeHealthCheckAccounts(balances: BalanceType[], banksMap: Map<string, BankType>, mandatoryBanks?: PublicKey[], excludedBanks?: PublicKey[]): BankType[];
|
|
2626
2514
|
/**
|
|
2627
2515
|
* Converts bank objects to health check account metas (public keys).
|
|
2628
2516
|
*
|
|
@@ -2644,17 +2532,14 @@ declare function computeHealthCheckAccounts({ account, banksMap, mandatoryBanks,
|
|
|
2644
2532
|
*
|
|
2645
2533
|
* @example
|
|
2646
2534
|
* ```typescript
|
|
2647
|
-
* const healthAccounts = computeHealthAccountMetas(
|
|
2648
|
-
*
|
|
2649
|
-
*
|
|
2535
|
+
* const healthAccounts = computeHealthAccountMetas(
|
|
2536
|
+
* [usdcBank, solBank, kaminoUsdcBank],
|
|
2537
|
+
* true // Enable sorting for optimal transaction size
|
|
2538
|
+
* );
|
|
2650
2539
|
* // Returns: [bank1, oracle1, bank2, oracle2, bank3, oracle3, kaminoReserve3, ...]
|
|
2651
2540
|
* ```
|
|
2652
2541
|
*/
|
|
2653
|
-
declare function computeHealthAccountMetas(
|
|
2654
|
-
banksToInclude: BankType[];
|
|
2655
|
-
enableSorting?: boolean;
|
|
2656
|
-
trailingBanks?: BankType[];
|
|
2657
|
-
}): PublicKey[];
|
|
2542
|
+
declare function computeHealthAccountMetas(banksToInclude: BankType[], enableSorting?: boolean, trailingBanks?: BankType[]): PublicKey[];
|
|
2658
2543
|
/**
|
|
2659
2544
|
* Projects which banks will be active after a series of instructions execute.
|
|
2660
2545
|
*
|
|
@@ -2663,8 +2548,7 @@ declare function computeHealthAccountMetas({ banksToInclude, enableSorting, trai
|
|
|
2663
2548
|
* health check account inclusion by predicting which banks are relevant.
|
|
2664
2549
|
*
|
|
2665
2550
|
* **Note**: This does NOT simulate Cross-Program Invocations (CPI). Only direct
|
|
2666
|
-
* marginfi instructions are considered.
|
|
2667
|
-
* marginfi account than `account` are ignored.
|
|
2551
|
+
* marginfi instructions are considered.
|
|
2668
2552
|
*
|
|
2669
2553
|
* Supported instructions:
|
|
2670
2554
|
* - Deposits: `lendingAccountDeposit`, `kaminoDeposit`, `driftDeposit`, `solendDeposit`
|
|
@@ -2672,26 +2556,22 @@ declare function computeHealthAccountMetas({ banksToInclude, enableSorting, trai
|
|
|
2672
2556
|
* - Repays: `lendingAccountRepay`
|
|
2673
2557
|
* - Withdrawals: `lendingAccountWithdraw`, `kaminoWithdraw`, `driftWithdraw`, `solendWithdraw`
|
|
2674
2558
|
*
|
|
2675
|
-
* @param
|
|
2559
|
+
* @param balances - Current account balances
|
|
2676
2560
|
* @param instructions - Instructions to simulate
|
|
2677
2561
|
* @param program - Marginfi program for instruction decoding
|
|
2678
2562
|
* @returns Array of bank public keys that will be active after instruction execution
|
|
2679
2563
|
*
|
|
2680
2564
|
* @example
|
|
2681
2565
|
* ```typescript
|
|
2682
|
-
* const projectedBanks = computeProjectedActiveBanksNoCpi(
|
|
2683
|
-
* account,
|
|
2684
|
-
*
|
|
2685
|
-
*
|
|
2686
|
-
*
|
|
2566
|
+
* const projectedBanks = computeProjectedActiveBanksNoCpi(
|
|
2567
|
+
* account.balances,
|
|
2568
|
+
* [depositIx, borrowIx],
|
|
2569
|
+
* marginfiProgram
|
|
2570
|
+
* );
|
|
2687
2571
|
* // Use projectedBanks for health check account selection
|
|
2688
2572
|
* ```
|
|
2689
2573
|
*/
|
|
2690
|
-
declare function computeProjectedActiveBanksNoCpi(
|
|
2691
|
-
account: MarginfiAccountType;
|
|
2692
|
-
instructions: TransactionInstruction[];
|
|
2693
|
-
program: MarginfiProgram;
|
|
2694
|
-
}): PublicKey[];
|
|
2574
|
+
declare function computeProjectedActiveBanksNoCpi(balances: BalanceType[], instructions: TransactionInstruction[], program: MarginfiProgram): PublicKey[];
|
|
2695
2575
|
/**
|
|
2696
2576
|
* Computes projected balances after applying a series of instructions.
|
|
2697
2577
|
*
|
|
@@ -2700,13 +2580,12 @@ declare function computeProjectedActiveBanksNoCpi({ account, instructions, progr
|
|
|
2700
2580
|
* than `computeProjectedActiveBanksNoCpi` which only tracks active banks.
|
|
2701
2581
|
*
|
|
2702
2582
|
* **Note**: This does NOT simulate Cross-Program Invocations (CPI). Only direct
|
|
2703
|
-
* marginfi instructions are considered.
|
|
2704
|
-
* marginfi account than `account` are ignored.
|
|
2583
|
+
* marginfi instructions are considered.
|
|
2705
2584
|
*
|
|
2706
2585
|
* **Integrated Protocols**: For Kamino/Drift deposits, the `assetShareValueMultiplierByBank`
|
|
2707
2586
|
* is used to convert cToken amounts to actual asset quantities before computing shares.
|
|
2708
2587
|
*
|
|
2709
|
-
* @param
|
|
2588
|
+
* @param balances - Current account balances
|
|
2710
2589
|
* @param instructions - Instructions to simulate
|
|
2711
2590
|
* @param program - Marginfi program for instruction decoding
|
|
2712
2591
|
* @param banksMap - Map of bank addresses to bank data (needed for share value conversion)
|
|
@@ -2718,24 +2597,18 @@ declare function computeProjectedActiveBanksNoCpi({ account, instructions, progr
|
|
|
2718
2597
|
*
|
|
2719
2598
|
* @example
|
|
2720
2599
|
* ```typescript
|
|
2721
|
-
* const result = computeProjectedActiveBalancesNoCpi(
|
|
2722
|
-
* account,
|
|
2723
|
-
*
|
|
2724
|
-
*
|
|
2600
|
+
* const result = computeProjectedActiveBalancesNoCpi(
|
|
2601
|
+
* account.balances,
|
|
2602
|
+
* [depositIx, borrowIx],
|
|
2603
|
+
* marginfiProgram,
|
|
2725
2604
|
* banksMap,
|
|
2726
|
-
*
|
|
2727
|
-
*
|
|
2605
|
+
* { [driftBankAddress]: driftMultiplier }
|
|
2606
|
+
* );
|
|
2728
2607
|
* console.log(`Projected ${result.projectedBalances.length} balances`);
|
|
2729
2608
|
* console.log(`Impacted ${result.impactedAssetsBanks.length} asset banks`);
|
|
2730
2609
|
* ```
|
|
2731
2610
|
*/
|
|
2732
|
-
declare function computeProjectedActiveBalancesNoCpi(
|
|
2733
|
-
account: MarginfiAccountType;
|
|
2734
|
-
instructions: TransactionInstruction[];
|
|
2735
|
-
program: MarginfiProgram;
|
|
2736
|
-
banksMap: Map<string, BankType>;
|
|
2737
|
-
assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
|
|
2738
|
-
}): {
|
|
2611
|
+
declare function computeProjectedActiveBalancesNoCpi(balances: BalanceType[], instructions: TransactionInstruction[], program: MarginfiProgram, banksMap: Map<string, BankType>, assetShareValueMultiplierByBank: Map<string, BigNumber$1>): {
|
|
2739
2612
|
projectedBalances: BalanceType[];
|
|
2740
2613
|
impactedAssetsBanks: string[];
|
|
2741
2614
|
impactedLiabilityBanks: string[];
|
|
@@ -2982,28 +2855,6 @@ declare const getTitanExactOutEstimate: (params: GetTitanExactOutEstimateParams)
|
|
|
2982
2855
|
quoteResult: SwapQuoteResult;
|
|
2983
2856
|
}>;
|
|
2984
2857
|
|
|
2985
|
-
/** The canonical shape a resolved pinned route yields — mirrors an engine-selected route. */
|
|
2986
|
-
interface ResolvedPinnedSwapRoute {
|
|
2987
|
-
swapInstructions: TransactionInstruction[];
|
|
2988
|
-
setupInstructions: TransactionInstruction[];
|
|
2989
|
-
lookupTables: AddressLookupTableAccount[];
|
|
2990
|
-
quoteResponse: SwapQuoteResult;
|
|
2991
|
-
/** The route's guaranteed min-out (native) — what sizes the follow-up amount (deposit patch). */
|
|
2992
|
-
outputAmountNative: BN;
|
|
2993
|
-
}
|
|
2994
|
-
/**
|
|
2995
|
-
* Resolve a caller-pinned swap route (`swapOpts.swapIxs`) into the engine-result shape, validating
|
|
2996
|
-
* the quote so a pinned route can never silently size a zero follow-up amount:
|
|
2997
|
-
*
|
|
2998
|
-
* - `otherAmountThreshold` (min-out) must be a positive integer — it becomes the loop's deposit
|
|
2999
|
-
* byte-patch, exactly like an engine-selected route's min-out.
|
|
3000
|
-
* - `inAmount` must equal the flow's swap input (e.g. the loop's borrow, native units) — a
|
|
3001
|
-
* mismatch means the route was quoted for a different size than the flow will actually swap.
|
|
3002
|
-
*
|
|
3003
|
-
* Throws plain `Error`s (not `TransactionBuildingError`) so caller-input mistakes are never
|
|
3004
|
-
* classified as decomposable swap failures (which would wrongly engage the bridged fallback).
|
|
3005
|
-
*/
|
|
3006
|
-
declare function resolvePinnedSwapRoute(swapIxs: NonNullable<SwapOpts["swapIxs"]>, expectedInAmountNative: BN | number): ResolvedPinnedSwapRoute;
|
|
3007
2858
|
type GetSwapIxsForFlashloanParams = {
|
|
3008
2859
|
inputMint: string;
|
|
3009
2860
|
outputMint: string;
|
|
@@ -3084,7 +2935,11 @@ interface FlashloanSwapConstraints {
|
|
|
3084
2935
|
*/
|
|
3085
2936
|
declare function computeFlashLoanNonSwapBudget({ program, marginfiAccount, ixs, bankMap, addressLookupTableAccounts, }: {
|
|
3086
2937
|
program: MarginfiProgram;
|
|
3087
|
-
marginfiAccount:
|
|
2938
|
+
marginfiAccount: {
|
|
2939
|
+
address: PublicKey;
|
|
2940
|
+
authority: PublicKey;
|
|
2941
|
+
balances: BalanceType[];
|
|
2942
|
+
};
|
|
3088
2943
|
ixs: TransactionInstruction[];
|
|
3089
2944
|
bankMap: Map<string, BankType>;
|
|
3090
2945
|
addressLookupTableAccounts: AddressLookupTableAccount[];
|
|
@@ -3170,142 +3025,47 @@ declare function isDepositIx(ix: TransactionInstruction): boolean;
|
|
|
3170
3025
|
declare function patchDepositAmount(ix: TransactionInstruction, amountNative: BN): void;
|
|
3171
3026
|
|
|
3172
3027
|
/**
|
|
3173
|
-
*
|
|
3174
|
-
*
|
|
3175
|
-
*
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
*
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
*
|
|
3183
|
-
* -
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
*/
|
|
3188
|
-
|
|
3189
|
-
/**
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
* same bank, so the conflict is always *opposite-side*: a deposit-side bridge conflicts with an
|
|
3193
|
-
* existing liability there, a borrow-side bridge with an existing asset. Same-side positions are
|
|
3194
|
-
* fine (partial-withdraw / exact-repay handle them).
|
|
3195
|
-
*/
|
|
3196
|
-
declare function accountConflictsWithBridgeBank(marginfiAccount: MarginfiAccountType, bridgeBankPk: PublicKey, bridgeTokenSide: BridgeTokenSide): boolean;
|
|
3197
|
-
interface ResolveBridgeCandidateBanksParams {
|
|
3198
|
-
/** Candidate bridge-token mints, highest priority first (product policy — see
|
|
3199
|
-
* `bridge-routing.utils.ts` for the default ordering and the per-call override). */
|
|
3200
|
-
prioritizedBridgeCandidateMints: PublicKey[];
|
|
3201
|
-
/** Banks to resolve the candidate mints against — typically all banks in the marginfi group. */
|
|
3202
|
-
groupBanks: BankType[];
|
|
3203
|
-
/** The account the bridged legs run against (for the conflict check). */
|
|
3028
|
+
* Which side of a bridged (double-hop) swap touches the bridge token:
|
|
3029
|
+
* - `deposit` — the bridge is *deposited* (e.g. collateral-swap: source → bridge → dest).
|
|
3030
|
+
* - `borrow` — the bridge is *borrowed* (e.g. debt-swap / loop: borrow bridge, then repay it).
|
|
3031
|
+
*/
|
|
3032
|
+
type BridgeSide = "deposit" | "borrow";
|
|
3033
|
+
/**
|
|
3034
|
+
* Whether routing through `bankPk` as the bridge would conflict with an existing position on the
|
|
3035
|
+
* account. marginfi forbids holding an asset and a liability on the same bank, so the conflict is
|
|
3036
|
+
* always *opposite-side*: a deposit-side bridge conflicts with an existing liability there, a
|
|
3037
|
+
* borrow-side bridge with an existing asset. Same-side positions are fine (partial-withdraw /
|
|
3038
|
+
* exact-repay handle them).
|
|
3039
|
+
*/
|
|
3040
|
+
declare function accountConflictsWithBridge(account: MarginfiAccountType, bankPk: PublicKey, side: BridgeSide): boolean;
|
|
3041
|
+
interface ResolveBridgeBanksParams {
|
|
3042
|
+
/** Candidate bridge mints in priority order (caller-owned product policy). */
|
|
3043
|
+
orderedBridgeMints: PublicKey[];
|
|
3044
|
+
/** Banks to resolve mints against (e.g. all of the group's banks). */
|
|
3045
|
+
banks: BankType[];
|
|
3046
|
+
/** The account the bridge legs run against (for the conflict check). */
|
|
3204
3047
|
marginfiAccount: MarginfiAccountType;
|
|
3205
|
-
/** Which side the bridge
|
|
3206
|
-
|
|
3207
|
-
bridgeTokenSide: BridgeTokenSide;
|
|
3048
|
+
/** Which side the bridge is used on — picks the standard-bank filter and the conflict rule. */
|
|
3049
|
+
side: BridgeSide;
|
|
3208
3050
|
}
|
|
3209
3051
|
/**
|
|
3210
|
-
* Resolve
|
|
3211
|
-
* those safe to route through and those
|
|
3052
|
+
* Resolve an ordered list of candidate bridge *mints* into usable bridge *banks*, partitioned into
|
|
3053
|
+
* those safe to route through and those that conflict with an existing position.
|
|
3212
3054
|
*
|
|
3213
3055
|
* For each mint (deduped, in priority order) it picks the standard bank that fits the side
|
|
3214
3056
|
* ({@link isStandardBorrowable} for `borrow`, {@link isStandardDepositable} for `deposit`) — this
|
|
3215
3057
|
* skips integration wrappers (`6200`) and `ReduceOnly` banks (`6017`) — then splits by
|
|
3216
|
-
* {@link
|
|
3217
|
-
*
|
|
3058
|
+
* {@link accountConflictsWithBridge}. The caller supplies the ordered mint list (product policy);
|
|
3059
|
+
* this owns only the mechanical filtering.
|
|
3218
3060
|
*
|
|
3219
|
-
* @returns `
|
|
3220
|
-
*
|
|
3221
|
-
* surfacing a "close that position" message).
|
|
3061
|
+
* @returns `bridges` (usable, in priority order) and `conflicts` (resolvable but blocked by an
|
|
3062
|
+
* opposite-side position — useful for surfacing a "close that position" message).
|
|
3222
3063
|
*/
|
|
3223
|
-
declare function
|
|
3224
|
-
|
|
3225
|
-
|
|
3064
|
+
declare function resolveBridgeBanks(params: ResolveBridgeBanksParams): {
|
|
3065
|
+
bridges: BankType[];
|
|
3066
|
+
conflicts: BankType[];
|
|
3226
3067
|
};
|
|
3227
3068
|
|
|
3228
|
-
/**
|
|
3229
|
-
* Shared support for the bridged (double-hop) one-call builders.
|
|
3230
|
-
*
|
|
3231
|
-
* A **bridge token** is NOT a cross-chain bridge: it is the high-liquidity intermediate token
|
|
3232
|
-
* (e.g. USDC or wSOL) a swap is routed *through*. When a direct collateral-swap / debt-swap /
|
|
3233
|
-
* loop `A → C` can't be built — the swap doesn't fit one tx (size / account-locks) or has no
|
|
3234
|
-
* route — it can still succeed decomposed into `A → bridge` + `bridge → C`, submitted as ONE
|
|
3235
|
-
* atomic Jito bundle. The per-flow builders live next to their direct builders
|
|
3236
|
-
* (`makeBridgedLoopTx` in `../actions/loop.ts`, `makeBridgedSwapCollateralTx` in
|
|
3237
|
-
* `../actions/swap-collateral.ts`, `makeBridgedSwapDebtTx` in `../actions/swap-debt.ts`); this
|
|
3238
|
-
* module owns the flow-agnostic routing support: candidate ordering/selection, the
|
|
3239
|
-
* candidate-iteration loop (abort / skip-on-failure / conflict surfacing), token-program
|
|
3240
|
-
* resolution, and the shared leg context.
|
|
3241
|
-
*
|
|
3242
|
-
* Candidate *ordering* is product policy: it defaults to {@link DEFAULT_BRIDGE_MINTS} and can be
|
|
3243
|
-
* overridden per call via {@link BridgeOpts.bridgeCandidateMints} (e.g. a correlation-aware
|
|
3244
|
-
* ordering). Candidate *filtering* (standard-bank resolution, opposite-side conflicts) is
|
|
3245
|
-
* mechanical and lives in {@link resolveBridgeCandidateBanks}.
|
|
3246
|
-
*/
|
|
3247
|
-
/** Default bridge-token candidates, most-liquid first. */
|
|
3248
|
-
declare const DEFAULT_BRIDGE_MINTS: PublicKey[];
|
|
3249
|
-
/** Per-call knobs for the bridged fallback of the `makeBridged*Tx` builders. */
|
|
3250
|
-
interface BridgeOpts {
|
|
3251
|
-
/**
|
|
3252
|
-
* Candidate bridge-token mints, highest priority first. Defaults to
|
|
3253
|
-
* {@link DEFAULT_BRIDGE_MINTS} (USDC, wSOL, USDT). Source/destination mints are always skipped.
|
|
3254
|
-
*/
|
|
3255
|
-
bridgeCandidateMints?: PublicKey[];
|
|
3256
|
-
/** Known token programs by mint (base58) — skips the per-mint RPC owner lookup. */
|
|
3257
|
-
tokenProgramByMint?: Map<string, PublicKey>;
|
|
3258
|
-
/** Override the bundle-size ceiling (see `composeBridgedSwap`). */
|
|
3259
|
-
maxBundleTxs?: number;
|
|
3260
|
-
abortSignal?: AbortSignal;
|
|
3261
|
-
}
|
|
3262
|
-
/** Result of a `makeBridged*Tx` builder — the direct build's result, or the bridged bundle. */
|
|
3263
|
-
interface BridgedTxResult {
|
|
3264
|
-
transactions: SolanaTransaction[];
|
|
3265
|
-
/** Index of the tx that completes the action (the direct action tx, or the bundle's last leg). */
|
|
3266
|
-
actionTxIndex: number;
|
|
3267
|
-
quoteResponse: SwapQuoteResult | undefined;
|
|
3268
|
-
/** The bridge token's mint — set only when the bridged double-hop path was used. */
|
|
3269
|
-
bridgeMint?: PublicKey;
|
|
3270
|
-
}
|
|
3271
|
-
/** A mint's token program: the cache (seedable by the caller), else the mint account's owner. */
|
|
3272
|
-
declare function resolveTokenProgramForMint(mint: PublicKey, connection: Connection, tokenProgramCacheByMint: Map<string, PublicKey>): Promise<PublicKey>;
|
|
3273
|
-
/**
|
|
3274
|
-
* Bridge-token candidate banks for routing `source → bridge → destination`, in priority order,
|
|
3275
|
-
* partitioned into usable and conflict-blocked. Source/destination mints are excluded from the
|
|
3276
|
-
* candidates (a token can't bridge itself).
|
|
3277
|
-
*/
|
|
3278
|
-
declare function selectSwapBridges(args: {
|
|
3279
|
-
sourceMint: PublicKey;
|
|
3280
|
-
destinationMint: PublicKey;
|
|
3281
|
-
bankMap: Map<string, BankType>;
|
|
3282
|
-
marginfiAccount: MarginfiAccountType;
|
|
3283
|
-
bridgeTokenSide: BridgeTokenSide;
|
|
3284
|
-
bridgeCandidateMints?: PublicKey[];
|
|
3285
|
-
}): {
|
|
3286
|
-
usableBridgeBanks: BankType[];
|
|
3287
|
-
conflictingBridgeBanks: BankType[];
|
|
3288
|
-
};
|
|
3289
|
-
/**
|
|
3290
|
-
* Try each usable bridge-token candidate in priority order until one composes a bundle. A
|
|
3291
|
-
* `buildBundleThroughBridge` that returns null or throws (build failure) moves on to the next
|
|
3292
|
-
* candidate; abort errors always propagate. When NO candidate is usable but some were dropped
|
|
3293
|
-
* solely for an existing opposite-side position, throws
|
|
3294
|
-
* `TransactionBuildingError.bridgeConflict` (the caller-facing "close that position" signal);
|
|
3295
|
-
* otherwise resolves null and the caller rethrows the direct build's error.
|
|
3296
|
-
*/
|
|
3297
|
-
declare function tryBridgeCandidates(args: {
|
|
3298
|
-
usableBridgeBanks: BankType[];
|
|
3299
|
-
conflictingBridgeBanks: BankType[];
|
|
3300
|
-
bridgeTokenSide: BridgeTokenSide;
|
|
3301
|
-
abortSignal?: AbortSignal;
|
|
3302
|
-
/** Build the two-leg bundle through one candidate bank; null = didn't work, try the next. */
|
|
3303
|
-
buildBundleThroughBridge: (bridgeBank: BankType) => Promise<BridgedTxResult | null>;
|
|
3304
|
-
}): Promise<BridgedTxResult | null>;
|
|
3305
|
-
/** The flow context shared verbatim by both legs of every bridged build. */
|
|
3306
|
-
type SharedBridgeLegContext = Pick<MakeSwapDebtTxParams, "program" | "marginfiAccount" | "connection" | "bankMap" | "oraclePrices" | "bankMetadataMap" | "assetShareValueMultiplierByBank" | "swapOpts" | "addressLookupTableAccounts" | "overrideInferAccounts" | "crossbarUrl" | "swapEngineRunner">;
|
|
3307
|
-
declare function sharedBridgeLegContext(params: SharedBridgeLegContext): SharedBridgeLegContext;
|
|
3308
|
-
|
|
3309
3069
|
/**
|
|
3310
3070
|
* Creates an instruction to close a Marginfi account.
|
|
3311
3071
|
*
|
|
@@ -3403,7 +3163,7 @@ declare function makeCreateAccountIxWithProjection(props: {
|
|
|
3403
3163
|
declare function makeCreateMarginfiAccountTx(program: MarginfiProgram, authority: PublicKey, groupAddress: PublicKey, addressLookupTables: AddressLookupTableAccount[], accountIndex: number, thirdPartyId?: number): Promise<SolanaTransaction>;
|
|
3404
3164
|
declare function makeCreateMarginfiAccountIx(program: MarginfiProgram, authority: PublicKey, groupAddress: PublicKey, accountIndex: number, thirdPartyId?: number): Promise<TransactionInstruction>;
|
|
3405
3165
|
declare function makeSetupIx({ connection, authority, tokens }: MakeSetupIxParams): Promise<TransactionInstruction[]>;
|
|
3406
|
-
declare function makePulseHealthIx(program: MarginfiProgram,
|
|
3166
|
+
declare function makePulseHealthIx(program: MarginfiProgram, marginfiAccountPk: PublicKey, banks: Map<string, BankType>, balances: BalanceType[], mandatoryBanks: PublicKey[], excludedBanks: PublicKey[]): Promise<{
|
|
3407
3167
|
instructions: TransactionInstruction[];
|
|
3408
3168
|
keys: never[];
|
|
3409
3169
|
}>;
|
|
@@ -3664,19 +3424,6 @@ declare function makeLoopTx(params: MakeLoopTxParams): Promise<{
|
|
|
3664
3424
|
actionTxIndex: number;
|
|
3665
3425
|
quoteResponse: SwapQuoteResult | undefined;
|
|
3666
3426
|
}>;
|
|
3667
|
-
interface MakeBridgedLoopTxParams extends MakeLoopTxParams {
|
|
3668
|
-
bridgeOpts?: BridgeOpts;
|
|
3669
|
-
}
|
|
3670
|
-
/**
|
|
3671
|
-
* {@link makeLoopTx} with a transparent bridged fallback: if the direct loop's borrow→deposit swap
|
|
3672
|
-
* can't fit one tx or has no route, loop P borrowing a value-equivalent amount of a bridge token,
|
|
3673
|
-
* then debt-swap the bridge debt → X, as one atomic bundle.
|
|
3674
|
-
*
|
|
3675
|
-
* Intended for existing accounts — a fresh account's loop has a minimal footprint and fits the
|
|
3676
|
-
* direct path, so callers creating the account in the same flow should call {@link makeLoopTx}
|
|
3677
|
-
* directly.
|
|
3678
|
-
*/
|
|
3679
|
-
declare function makeBridgedLoopTx(params: MakeBridgedLoopTxParams): Promise<BridgedTxResult>;
|
|
3680
3427
|
|
|
3681
3428
|
/**
|
|
3682
3429
|
* Creates a repay instruction for repaying borrowed assets to a Marginfi bank.
|
|
@@ -3766,15 +3513,6 @@ declare function makeSwapCollateralTx(params: MakeSwapCollateralTxParams): Promi
|
|
|
3766
3513
|
actionTxIndex: number;
|
|
3767
3514
|
quoteResponse: SwapQuoteResult | undefined;
|
|
3768
3515
|
}>;
|
|
3769
|
-
interface MakeBridgedSwapCollateralTxParams extends MakeSwapCollateralTxParams {
|
|
3770
|
-
bridgeOpts?: BridgeOpts;
|
|
3771
|
-
}
|
|
3772
|
-
/**
|
|
3773
|
-
* {@link makeSwapCollateralTx} with a transparent bridged fallback: if the direct swap `A → C`
|
|
3774
|
-
* can't fit one tx or has no route, decompose it into `A → bridge` + `bridge → C` through a
|
|
3775
|
-
* high-liquidity bridge collateral, composed into one atomic bundle.
|
|
3776
|
-
*/
|
|
3777
|
-
declare function makeBridgedSwapCollateralTx(params: MakeBridgedSwapCollateralTxParams): Promise<BridgedTxResult>;
|
|
3778
3516
|
|
|
3779
3517
|
/**
|
|
3780
3518
|
* Creates transactions to swap one debt position to another using a flash loan.
|
|
@@ -3800,17 +3538,6 @@ declare function makeSwapDebtTx(params: MakeSwapDebtTxParams): Promise<{
|
|
|
3800
3538
|
actionTxIndex: number;
|
|
3801
3539
|
quoteResponse: SwapQuoteResult | undefined;
|
|
3802
3540
|
}>;
|
|
3803
|
-
interface MakeBridgedSwapDebtTxParams extends MakeSwapDebtTxParams {
|
|
3804
|
-
bridgeOpts?: BridgeOpts;
|
|
3805
|
-
}
|
|
3806
|
-
/**
|
|
3807
|
-
* {@link makeSwapDebtTx} with a transparent bridged fallback: if the direct debt swap `A → C`
|
|
3808
|
-
* (repay A by borrowing C) can't fit one tx or has no route, decompose it into `A → bridge` +
|
|
3809
|
-
* `bridge → C` through a borrowable bridge debt, as one atomic bundle. The first leg repays A by
|
|
3810
|
-
* borrowing the bridge; the second leg repays exactly the bridge the first leg borrowed and
|
|
3811
|
-
* borrows C.
|
|
3812
|
-
*/
|
|
3813
|
-
declare function makeBridgedSwapDebtTx(params: MakeBridgedSwapDebtTxParams): Promise<BridgedTxResult>;
|
|
3814
3541
|
|
|
3815
3542
|
/**
|
|
3816
3543
|
* Roll a matured Exponent PT collateral position into its next-maturity PT, so the **full
|
|
@@ -3892,107 +3619,6 @@ declare function mergeBridgeQuotesLoop(firstLeg: SwapQuoteResult, secondLeg: Swa
|
|
|
3892
3619
|
*/
|
|
3893
3620
|
declare function composeBridgedSwap(params: ComposeBridgedSwapParams): Promise<ComposeBridgedSwapResult | null>;
|
|
3894
3621
|
|
|
3895
|
-
interface ClassifiedPosition {
|
|
3896
|
-
bankAddress: PublicKey;
|
|
3897
|
-
side: TransferPositionSide;
|
|
3898
|
-
/** UI amount of the position (collateral: withdrawn from A / deposited to B; debt: repaid on A). */
|
|
3899
|
-
uiAmount: BigNumber;
|
|
3900
|
-
bank: BankType;
|
|
3901
|
-
tokenProgram: PublicKey;
|
|
3902
|
-
}
|
|
3903
|
-
/**
|
|
3904
|
-
* Validate the selection, infer each position's side, and resolve its UI amount. Correctness of the
|
|
3905
|
-
* transfer itself (both accounts staying healthy) is enforced on-chain by the flashloan's end health
|
|
3906
|
-
* check on A and each borrow's health check on B — so no client-side health/USD math is needed.
|
|
3907
|
-
*/
|
|
3908
|
-
declare function classifyAndValidate(params: MakeTransferPositionsTxParams): ClassifiedPosition[];
|
|
3909
|
-
interface BuildContext {
|
|
3910
|
-
program: MarginfiProgram;
|
|
3911
|
-
accountA: MarginfiAccountType;
|
|
3912
|
-
accountB: MarginfiAccountType;
|
|
3913
|
-
bankMap: Map<string, BankType>;
|
|
3914
|
-
bankMetadataMap: BankIntegrationMetadataMap;
|
|
3915
|
-
assetShareValueMultiplierByBank: Map<string, BigNumber>;
|
|
3916
|
-
borrowPaddingBps: number;
|
|
3917
|
-
groupRateLimiterEnabled: boolean;
|
|
3918
|
-
overrideInferAccounts?: {
|
|
3919
|
-
group?: PublicKey;
|
|
3920
|
-
authority?: PublicKey;
|
|
3921
|
-
};
|
|
3922
|
-
/** Banks the destination account already holds before the transfer starts. */
|
|
3923
|
-
destPreexistingBanks: BankType[];
|
|
3924
|
-
}
|
|
3925
|
-
/**
|
|
3926
|
-
* Build one collateral position's withdraw-from-A + deposit-into-B instructions, dispatching to the
|
|
3927
|
-
* right builder for the bank's asset tag. This is the single place that defines which banks the
|
|
3928
|
-
* action supports: `DEFAULT`/`SOL`/`STAKED` use the standard withdraw/deposit; `KAMINO`/`JUPLEND`
|
|
3929
|
-
* use their dedicated builders (which lock the integration's reserve/vault accounts and, for Kamino,
|
|
3930
|
-
* convert the underlying UI amount to cToken units); anything else throws
|
|
3931
|
-
* `TRANSFER_POSITIONS_UNSUPPORTED_BANK`. The reserve/rate state each integration builder needs is
|
|
3932
|
-
* read from `bankMetadataMap`; the on-chain refresh those reads depend on is emitted separately in
|
|
3933
|
-
* `buildIntegrationRefreshIxs`.
|
|
3934
|
-
*
|
|
3935
|
-
* `observationBanksOverride` controls the withdraw leg's health pack (empty while A is flashloaned
|
|
3936
|
-
* with the group limiter off; the withdrawn bank's oracle when it is on). The deposit leg runs no
|
|
3937
|
-
* health check, so it needs none.
|
|
3938
|
-
*/
|
|
3939
|
-
declare function buildCollateralLegIxs(ctx: BuildContext, position: ClassifiedPosition, isSync: boolean, observationBanksOverride: ReturnType<typeof computeHealthAccountMetas>): Promise<{
|
|
3940
|
-
withdrawIxs: TransactionInstruction[];
|
|
3941
|
-
depositIxs: TransactionInstruction[];
|
|
3942
|
-
}>;
|
|
3943
|
-
/**
|
|
3944
|
-
* Atomically move a selected set of positions from account A to account B in a single flashloan.
|
|
3945
|
-
* Per position: collateral → `withdraw(A)` + `deposit(B)`; debt → `borrow(B)` + `repay(A)`. Returns
|
|
3946
|
-
* unsigned transactions ordered for sequential execution (setup/refresh + crank first, then the
|
|
3947
|
-
* flashloan); the caller signs and sends them.
|
|
3948
|
-
*
|
|
3949
|
-
* The whole transfer must fit one v0 transaction — the selection is capped at `maxPositions`
|
|
3950
|
-
* (default 5), and the built flashloan is size-checked, throwing `TRANSFER_POSITIONS_UNSPLITTABLE`
|
|
3951
|
-
* if it still overflows (possible with several integration positions). Transfer larger sets in
|
|
3952
|
-
* batches. Correctness (both accounts staying healthy) is enforced on-chain: `endFL(A)` checks A's
|
|
3953
|
-
* remainder and each `borrow(B)` checks B — no client-side health prediction.
|
|
3954
|
-
*
|
|
3955
|
-
* Supported asset tags: `DEFAULT`/`SOL`/`STAKED` on either leg, and the collateral-only integrations
|
|
3956
|
-
* `KAMINO`/`JUPLEND` on the collateral leg (dedicated builders + a preceding reserve/rate refresh).
|
|
3957
|
-
* `DRIFT`/`SOLEND` are rejected.
|
|
3958
|
-
*
|
|
3959
|
-
* Runtime notes:
|
|
3960
|
-
* - Each borrow-before-repay transiently spikes the debt bank's rate-limit window; a bank near its
|
|
3961
|
-
* cap can revert with `BankHourly/DailyRateLimitExceeded`. The whole flashloan reverts atomically,
|
|
3962
|
-
* so this is safe and retryable — treat it as such.
|
|
3963
|
-
* - Integration (Kamino/JupLend) reserve/rate refresh rides in the prelude transaction and requires
|
|
3964
|
-
* `bankMetadataMap` to carry fresh `kaminoStates`/`jupLendStates`.
|
|
3965
|
-
* - All transactions share one blockhash; execute them in order within its validity window.
|
|
3966
|
-
* - Dust (borrow padding minus accrued interest; withdraw-all/cToken-conversion excess) remains in
|
|
3967
|
-
* the wallet ATAs.
|
|
3968
|
-
*/
|
|
3969
|
-
declare function makeTransferPositionsTx(params: MakeTransferPositionsTxParams): Promise<TransferPositionsResult>;
|
|
3970
|
-
|
|
3971
|
-
/**
|
|
3972
|
-
* Withdraw the FULL position of every given bank, packing as many withdraws
|
|
3973
|
-
* per transaction as fit the size/lock limits. Venue dispatch (Kamino /
|
|
3974
|
-
* JupLend / Drift / standard) and the per-instruction health packs live here:
|
|
3975
|
-
* each withdraw's remaining accounts exclude every bank already closed by the
|
|
3976
|
-
* withdraws before it — across the whole ordered batch — because the on-chain
|
|
3977
|
-
* health check runs against the account's live (shrinking) balance set.
|
|
3978
|
-
*
|
|
3979
|
-
* The returned transactions MUST land as one atomic Jito bundle (same slot,
|
|
3980
|
-
* sequential): the integration refreshes (Kamino reserves + obligations, rate
|
|
3981
|
-
* cranks) live in a single prelude tx rather than in each withdraw tx, and
|
|
3982
|
-
* Klend's slot-based staleness checks only stay satisfied when the withdraws
|
|
3983
|
-
* execute in the refresh's slot.
|
|
3984
|
-
*
|
|
3985
|
-
* Returns `[ATA setup txs…, crank tx?, refresh tx?, withdraw txs…]`;
|
|
3986
|
-
* `actionTxIndex` points at the first withdraw tx.
|
|
3987
|
-
*/
|
|
3988
|
-
declare function makeBulkWithdrawTx(params: MakeBulkWithdrawTxParams): Promise<BulkLendTxsResult>;
|
|
3989
|
-
/**
|
|
3990
|
-
* Repay the FULL debt of every given bank from the wallet, packing as many
|
|
3991
|
-
* repays per transaction as fit. Repays carry no health pack and need no
|
|
3992
|
-
* oracle cranks, so most batches are a single transaction.
|
|
3993
|
-
*/
|
|
3994
|
-
declare function makeBulkRepayTx(params: MakeBulkRepayTxParams): Promise<BulkLendTxsResult>;
|
|
3995
|
-
|
|
3996
3622
|
type MakeSmartCrankSwbFeedIxParams = {
|
|
3997
3623
|
marginfiAccount: MarginfiAccountType;
|
|
3998
3624
|
bankMap: Map<string, BankType>;
|
|
@@ -4013,25 +3639,6 @@ declare function makeSmartCrankSwbFeedIx(params: MakeSmartCrankSwbFeedIxParams):
|
|
|
4013
3639
|
instructions: TransactionInstruction[];
|
|
4014
3640
|
luts: AddressLookupTableAccount[];
|
|
4015
3641
|
}>;
|
|
4016
|
-
type MakeSmartCrankSwbFeedIxForAccountsParams = Omit<MakeSmartCrankSwbFeedIxParams, "marginfiAccount"> & {
|
|
4017
|
-
/**
|
|
4018
|
-
* Accounts targeted by instructions in the set. Each account is projected against
|
|
4019
|
-
* the instructions that operate on it (the projection filters by account), so the
|
|
4020
|
-
* same full instruction list serves every account. The first account's authority
|
|
4021
|
-
* pays the feed updates.
|
|
4022
|
-
*/
|
|
4023
|
-
marginfiAccounts: MarginfiAccountType[];
|
|
4024
|
-
};
|
|
4025
|
-
/**
|
|
4026
|
-
* Multi-account variant of {@link makeSmartCrankSwbFeedIx} for instruction sets that
|
|
4027
|
-
* span several marginfi accounts (e.g. transferring positions: the source is cranked
|
|
4028
|
-
* against its withdraws, the destination against its projected post-transfer
|
|
4029
|
-
* deposits). Overlapping feeds across accounts are cranked once.
|
|
4030
|
-
*/
|
|
4031
|
-
declare function makeSmartCrankSwbFeedIxForAccounts(params: MakeSmartCrankSwbFeedIxForAccountsParams): Promise<{
|
|
4032
|
-
instructions: TransactionInstruction[];
|
|
4033
|
-
luts: AddressLookupTableAccount[];
|
|
4034
|
-
}>;
|
|
4035
3642
|
declare const DEFAULT_CROSSBAR_URL = "https://crossbar.0.xyz";
|
|
4036
3643
|
declare const DEFAULT_FALLBACK_CROSSBAR_URL = "https://crossbar.switchboard.xyz";
|
|
4037
3644
|
declare function makeCrankSwbFeedIx(marginfiAccount: MarginfiAccountType, bankMap: Map<string, BankType>, newBanksPk: PublicKey[], provider: AnchorProvider, crossbarUrl?: string): Promise<{
|
|
@@ -4102,23 +3709,6 @@ declare function makeUpdateDriftMarketIxs(marginfiAccount: MarginfiAccountType,
|
|
|
4102
3709
|
*/
|
|
4103
3710
|
declare function makeUpdateJupLendRateIxs(marginfiAccount: MarginfiAccountType, bankMap: Map<string, BankType>, banksToExclude: PublicKey[], bankMetadataMap: BankIntegrationMetadataMap): InstructionsWrapper;
|
|
4104
3711
|
|
|
4105
|
-
/**
|
|
4106
|
-
* Groups the per-integration refresh/update instructions (Kamino reserve refresh,
|
|
4107
|
-
* Drift spot market update, JupLend rate update) into a single wrapper.
|
|
4108
|
-
*
|
|
4109
|
-
* JupLend and Drift action instructions update their own bank via CPI, so the bank
|
|
4110
|
-
* being acted on is excluded from those updates. Kamino has no such CPI, so the
|
|
4111
|
-
* action bank must be explicitly included in the refresh set instead.
|
|
4112
|
-
*
|
|
4113
|
-
* @param marginfiAccount - The marginfi account containing active bank balances
|
|
4114
|
-
* @param bankMap - Map of bank addresses (base58) to bank instances
|
|
4115
|
-
* @param banksToExclude - Banks skipped for the JupLend/Drift updates (their CPI already updates them)
|
|
4116
|
-
* @param bankMetadataMap - Map containing Bank-specific metadata (integration states)
|
|
4117
|
-
* @param kaminoNewBanksPk - Banks to union into the Kamino refresh set, defaults to `banksToExclude`
|
|
4118
|
-
* @returns InstructionsWrapper with instructions ordered kamino -> drift -> juplend
|
|
4119
|
-
*/
|
|
4120
|
-
declare function makeRefreshIntegrationBanksIxs(marginfiAccount: MarginfiAccountType, bankMap: Map<string, BankType>, banksToExclude: PublicKey[], bankMetadataMap: BankIntegrationMetadataMap, kaminoNewBanksPk?: PublicKey[]): InstructionsWrapper;
|
|
4121
|
-
|
|
4122
3712
|
type ValidatorVoteAccountByBank = {
|
|
4123
3713
|
[address: string]: string;
|
|
4124
3714
|
};
|
|
@@ -4423,14 +4013,6 @@ declare function computeBankBorrowApy(bank: BankType): number;
|
|
|
4423
4013
|
*/
|
|
4424
4014
|
declare function computeBankMetrics(params: ComputeBankMetricsParams): BankMetrics;
|
|
4425
4015
|
|
|
4426
|
-
/**
|
|
4427
|
-
* Lookup-or-throw helpers for action-builder inputs. The optional `makeError`
|
|
4428
|
-
* lets callers throw their own typed error (e.g. a TransactionBuildingError
|
|
4429
|
-
* with user-facing copy) instead of a plain Error.
|
|
4430
|
-
*/
|
|
4431
|
-
declare function requireBank(bankMap: Map<string, BankType>, address: PublicKey, makeError?: (message: string) => Error): BankType;
|
|
4432
|
-
declare function requireTokenProgram(tokenProgramsByBank: Map<string, PublicKey>, address: PublicKey, makeError?: (message: string) => Error): PublicKey;
|
|
4433
|
-
|
|
4434
4016
|
/**
|
|
4435
4017
|
* Fee state cache - stores information from the global FeeState
|
|
4436
4018
|
* so the FeeState can be omitted on certain instructions
|
|
@@ -5048,11 +4630,7 @@ declare enum TransactionBuildingErrorCode {
|
|
|
5048
4630
|
DRIFT_STATE_NOT_FOUND = "DRIFT_STATE_NOT_FOUND",
|
|
5049
4631
|
JUPLEND_STATE_NOT_FOUND = "JUPLEND_STATE_NOT_FOUND",
|
|
5050
4632
|
SWITCHBOARD_FEED_UPDATE_FAILED = "SWITCHBOARD_FEED_UPDATE_FAILED",
|
|
5051
|
-
SWAP_QUOTE_FAILED = "SWAP_QUOTE_FAILED"
|
|
5052
|
-
TRANSFER_POSITIONS_INVALID_SELECTION = "TRANSFER_POSITIONS_INVALID_SELECTION",
|
|
5053
|
-
TRANSFER_POSITIONS_UNSUPPORTED_BANK = "TRANSFER_POSITIONS_UNSUPPORTED_BANK",
|
|
5054
|
-
TRANSFER_POSITIONS_UNSPLITTABLE = "TRANSFER_POSITIONS_UNSPLITTABLE",
|
|
5055
|
-
BRIDGE_CONFLICT = "BRIDGE_CONFLICT"
|
|
4633
|
+
SWAP_QUOTE_FAILED = "SWAP_QUOTE_FAILED"
|
|
5056
4634
|
}
|
|
5057
4635
|
/**
|
|
5058
4636
|
* Typed details for each error code
|
|
@@ -5112,30 +4690,6 @@ interface TransactionBuildingErrorDetails {
|
|
|
5112
4690
|
outputMint: string;
|
|
5113
4691
|
reason: string;
|
|
5114
4692
|
};
|
|
5115
|
-
[TransactionBuildingErrorCode.TRANSFER_POSITIONS_INVALID_SELECTION]: {
|
|
5116
|
-
reason: string;
|
|
5117
|
-
bankAddresses: string[];
|
|
5118
|
-
};
|
|
5119
|
-
[TransactionBuildingErrorCode.TRANSFER_POSITIONS_UNSUPPORTED_BANK]: {
|
|
5120
|
-
bankAddress: string;
|
|
5121
|
-
assetTag: number;
|
|
5122
|
-
bankSymbol?: string;
|
|
5123
|
-
};
|
|
5124
|
-
[TransactionBuildingErrorCode.TRANSFER_POSITIONS_UNSPLITTABLE]: {
|
|
5125
|
-
reason: string;
|
|
5126
|
-
sizeBytes?: number;
|
|
5127
|
-
accountCount?: number;
|
|
5128
|
-
};
|
|
5129
|
-
[TransactionBuildingErrorCode.BRIDGE_CONFLICT]: {
|
|
5130
|
-
/** Bridge-token candidate banks blocked by an existing opposite-side account position. */
|
|
5131
|
-
conflictingBanks: Array<{
|
|
5132
|
-
bankAddress: string;
|
|
5133
|
-
mint: string;
|
|
5134
|
-
symbol?: string;
|
|
5135
|
-
}>;
|
|
5136
|
-
/** Whether the bridge token would have been held as collateral ("deposit") or debt ("borrow"). */
|
|
5137
|
-
bridgeTokenSide: "deposit" | "borrow";
|
|
5138
|
-
};
|
|
5139
4693
|
}
|
|
5140
4694
|
/**
|
|
5141
4695
|
* Error thrown during transaction building in the SDK.
|
|
@@ -5183,32 +4737,6 @@ declare class TransactionBuildingError<T extends TransactionBuildingErrorCode =
|
|
|
5183
4737
|
* Failed to get a swap quote from any provider
|
|
5184
4738
|
*/
|
|
5185
4739
|
static swapQuoteFailed(provider: string, inputMint: string, outputMint: string, reason: string): TransactionBuildingError<TransactionBuildingErrorCode.SWAP_QUOTE_FAILED>;
|
|
5186
|
-
/**
|
|
5187
|
-
* The requested set of positions to transfer is invalid (inactive bank on the source,
|
|
5188
|
-
* destination overlap, capacity/slot conflict, group/authority mismatch, etc.).
|
|
5189
|
-
*/
|
|
5190
|
-
static transferPositionsInvalidSelection(reason: string, bankAddresses: string[]): TransactionBuildingError<TransactionBuildingErrorCode.TRANSFER_POSITIONS_INVALID_SELECTION>;
|
|
5191
|
-
/**
|
|
5192
|
-
* A selected position lives in a bank whose asset tag is not supported by transfer-positions
|
|
5193
|
-
* (v1 supports DEFAULT and STAKED only).
|
|
5194
|
-
*/
|
|
5195
|
-
static transferPositionsUnsupportedBank(bankAddress: string, assetTag: number, bankSymbol?: string): TransactionBuildingError<TransactionBuildingErrorCode.TRANSFER_POSITIONS_UNSUPPORTED_BANK>;
|
|
5196
|
-
/**
|
|
5197
|
-
* The built transfer transaction exceeds the v0 size / account-lock limits even at the position
|
|
5198
|
-
* cap (most likely several integration positions whose reserve accounts overflow the 64-lock cap).
|
|
5199
|
-
* Retry with fewer positions in the selection.
|
|
5200
|
-
*/
|
|
5201
|
-
static transferPositionsUnsplittable(reason: string, sizeBytes?: number, accountCount?: number): TransactionBuildingError<TransactionBuildingErrorCode.TRANSFER_POSITIONS_UNSPLITTABLE>;
|
|
5202
|
-
/**
|
|
5203
|
-
* A bridged (double-hop) swap could not route because every bridge-token candidate bank
|
|
5204
|
-
* conflicts with an existing opposite-side position on the account (marginfi forbids holding an
|
|
5205
|
-
* asset and a liability on the same bank).
|
|
5206
|
-
*/
|
|
5207
|
-
static bridgeConflict(conflictingBanks: Array<{
|
|
5208
|
-
bankAddress: string;
|
|
5209
|
-
mint: string;
|
|
5210
|
-
symbol?: string;
|
|
5211
|
-
}>, bridgeTokenSide: "deposit" | "borrow"): TransactionBuildingError<TransactionBuildingErrorCode.BRIDGE_CONFLICT>;
|
|
5212
4740
|
/**
|
|
5213
4741
|
* Generic escape hatch for custom errors
|
|
5214
4742
|
*/
|
|
@@ -5225,13 +4753,6 @@ declare class TransactionBuildingError<T extends TransactionBuildingErrorCode =
|
|
|
5225
4753
|
* (which would otherwise throw a raw serialization `RangeError`) as `SWAP_SIZE_EXCEEDED_LOOP`.
|
|
5226
4754
|
*/
|
|
5227
4755
|
declare function isDecomposableSwapError(e: unknown): e is TransactionBuildingError;
|
|
5228
|
-
/**
|
|
5229
|
-
* Whether a build failure is a bridged-swap conflict: the direct build failed AND every
|
|
5230
|
-
* bridge-token candidate was blocked by an existing opposite-side position on the account.
|
|
5231
|
-
* Narrows to the typed details (`conflictingBanks`, `bridgeTokenSide`) so callers can surface a
|
|
5232
|
-
* "close that position or pick a different pair" message.
|
|
5233
|
-
*/
|
|
5234
|
-
declare function isBridgeConflictError(e: unknown): e is TransactionBuildingError<TransactionBuildingErrorCode.BRIDGE_CONFLICT>;
|
|
5235
4756
|
|
|
5236
4757
|
declare const PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED: Buffer<ArrayBuffer>;
|
|
5237
4758
|
declare const PDA_BANK_INSURANCE_VAULT_AUTH_SEED: Buffer<ArrayBuffer>;
|
|
@@ -5415,7 +4936,6 @@ declare const PRIORITY_TX_SIZE: number;
|
|
|
5415
4936
|
declare const WSOL_MINT: PublicKey;
|
|
5416
4937
|
declare const LST_MINT: PublicKey;
|
|
5417
4938
|
declare const USDC_MINT: PublicKey;
|
|
5418
|
-
declare const USDT_MINT: PublicKey;
|
|
5419
4939
|
declare const USDC_DECIMALS = 6;
|
|
5420
4940
|
|
|
5421
4941
|
declare class Balance implements BalanceType {
|
|
@@ -5906,63 +5426,6 @@ declare class MarginfiAccount implements MarginfiAccountType {
|
|
|
5906
5426
|
actionTxIndex: number;
|
|
5907
5427
|
quoteResponse: SwapQuoteResult | undefined;
|
|
5908
5428
|
}>;
|
|
5909
|
-
/**
|
|
5910
|
-
* Atomically move a selected set of positions from this account to a destination account
|
|
5911
|
-
* (same authority, same group) using flashloans, auto-splitting across transactions as needed.
|
|
5912
|
-
*
|
|
5913
|
-
* @see {@link makeTransferPositionsTx} for detailed implementation
|
|
5914
|
-
*/
|
|
5915
|
-
makeTransferPositionsTx(params: Omit<MakeTransferPositionsTxParams, "marginfiAccount">): Promise<TransferPositionsResult>;
|
|
5916
|
-
/**
|
|
5917
|
-
* Creates a loop transaction with a transparent bridged (double-hop) fallback.
|
|
5918
|
-
*
|
|
5919
|
-
* One call: tries the direct {@link makeLoopTx} first; if its borrow→deposit swap can't fit one
|
|
5920
|
-
* transaction (size / account-locks) or has no route, it loops the deposit asset against a
|
|
5921
|
-
* value-equivalent borrow of a high-liquidity bridge token, then debt-swaps the bridge debt to
|
|
5922
|
-
* the requested borrow asset — both legs composed into ONE atomic Jito bundle.
|
|
5923
|
-
*
|
|
5924
|
-
* Bridge candidates default to USDC → wSOL → USDT and can be reordered/overridden via
|
|
5925
|
-
* `params.bridgeOpts.bridgeCandidateMints`; `bridgeOpts` also accepts known token programs (skips RPC
|
|
5926
|
-
* lookups), a bundle-size ceiling, and an abort signal. `result.bridgeMint` is set only when the
|
|
5927
|
-
* bridged path was used.
|
|
5928
|
-
*
|
|
5929
|
-
* Intended for existing accounts — a fresh account's loop fits the direct path, so flows that
|
|
5930
|
-
* create the account in the same action should call {@link makeLoopTx} directly.
|
|
5931
|
-
*
|
|
5932
|
-
* @param params - Loop transaction parameters plus optional `bridgeOpts`
|
|
5933
|
-
* @returns Object containing transactions, action index, merged swap quote, and the bridge mint
|
|
5934
|
-
*
|
|
5935
|
-
* @see {@link makeBridgedLoopTx} for detailed implementation
|
|
5936
|
-
*/
|
|
5937
|
-
makeBridgedLoopTx(params: Omit<MakeBridgedLoopTxParams, "marginfiAccount">): Promise<BridgedTxResult>;
|
|
5938
|
-
/**
|
|
5939
|
-
* Creates a collateral-swap transaction with a transparent bridged (double-hop) fallback.
|
|
5940
|
-
*
|
|
5941
|
-
* One call: tries the direct {@link makeSwapCollateralTx} first; if the swap `A → C` can't fit
|
|
5942
|
-
* one transaction or has no route, it decomposes into `A → bridge` + `bridge → C` through a
|
|
5943
|
-
* high-liquidity bridge collateral, both legs composed into ONE atomic Jito bundle. See
|
|
5944
|
-
* {@link makeBridgedLoopTx} for the `bridgeOpts` knobs.
|
|
5945
|
-
*
|
|
5946
|
-
* @param params - Swap collateral transaction parameters plus optional `bridgeOpts`
|
|
5947
|
-
* @returns Object containing transactions, action index, merged swap quote, and the bridge mint
|
|
5948
|
-
*
|
|
5949
|
-
* @see {@link makeBridgedSwapCollateralTx} for detailed implementation
|
|
5950
|
-
*/
|
|
5951
|
-
makeBridgedSwapCollateralTx(params: Omit<MakeBridgedSwapCollateralTxParams, "marginfiAccount">): Promise<BridgedTxResult>;
|
|
5952
|
-
/**
|
|
5953
|
-
* Creates a debt-swap transaction with a transparent bridged (double-hop) fallback.
|
|
5954
|
-
*
|
|
5955
|
-
* One call: tries the direct {@link makeSwapDebtTx} first; if the swap `A → C` can't fit one
|
|
5956
|
-
* transaction or has no route, the first leg repays A by borrowing a bridge token and the second
|
|
5957
|
-
* leg repays exactly that bridge debt while borrowing C — both legs composed into ONE atomic
|
|
5958
|
-
* Jito bundle. See {@link makeBridgedLoopTx} for the `bridgeOpts` knobs.
|
|
5959
|
-
*
|
|
5960
|
-
* @param params - Swap debt transaction parameters plus optional `bridgeOpts`
|
|
5961
|
-
* @returns Object containing transactions, action index, merged swap quote, and the bridge mint
|
|
5962
|
-
*
|
|
5963
|
-
* @see {@link makeBridgedSwapDebtTx} for detailed implementation
|
|
5964
|
-
*/
|
|
5965
|
-
makeBridgedSwapDebtTx(params: Omit<MakeBridgedSwapDebtTxParams, "marginfiAccount">): Promise<BridgedTxResult>;
|
|
5966
5429
|
/**
|
|
5967
5430
|
* Creates a transaction to repay debt using collateral.
|
|
5968
5431
|
*
|
|
@@ -6436,14 +5899,6 @@ declare class MarginfiAccountWrapper {
|
|
|
6436
5899
|
actionTxIndex: number;
|
|
6437
5900
|
quoteResponse: SwapQuoteResult | undefined;
|
|
6438
5901
|
}>;
|
|
6439
|
-
/**
|
|
6440
|
-
* Atomically move a selected set of positions from this account to a destination account with
|
|
6441
|
-
* auto-injected client data.
|
|
6442
|
-
*
|
|
6443
|
-
* Auto-injects: program, connection, marginfiAccount, bankMap, oraclePrices, bankMetadataMap,
|
|
6444
|
-
* assetShareValueMultiplierByBank, addressLookupTables, tokenProgramsByBank, groupRateLimiterEnabled.
|
|
6445
|
-
*/
|
|
6446
|
-
makeTransferPositionsTx(params: Omit<MakeTransferPositionsTxParams, "program" | "connection" | "marginfiAccount" | "bankMap" | "oraclePrices" | "bankMetadataMap" | "assetShareValueMultiplierByBank" | "addressLookupTableAccounts" | "tokenProgramsByBank" | "groupRateLimiterEnabled">): Promise<TransferPositionsResult>;
|
|
6447
5902
|
/**
|
|
6448
5903
|
* Creates a repay with collateral transaction with auto-injected client data.
|
|
6449
5904
|
*
|
|
@@ -6500,52 +5955,6 @@ declare class MarginfiAccountWrapper {
|
|
|
6500
5955
|
actionTxIndex: number;
|
|
6501
5956
|
quoteResponse: SwapQuoteResult | undefined;
|
|
6502
5957
|
}>;
|
|
6503
|
-
/**
|
|
6504
|
-
* Creates a loop (leverage) transaction with a transparent bridged (double-hop) fallback and
|
|
6505
|
-
* auto-injected client data.
|
|
6506
|
-
*
|
|
6507
|
-
* One call: tries the direct {@link makeLoopTx} first; if its borrow→deposit swap can't fit one
|
|
6508
|
-
* transaction or has no route, it loops the deposit asset against a value-equivalent borrow of a
|
|
6509
|
-
* bridge token (USDC/wSOL/USDT by default, override via `bridgeOpts.bridgeCandidateMints`) and
|
|
6510
|
-
* debt-swaps that bridge debt to the requested borrow asset — one atomic Jito bundle.
|
|
6511
|
-
* `result.bridgeMint` is set only when the bridged path was used.
|
|
6512
|
-
*
|
|
6513
|
-
* Auto-injects: program, marginfiAccount, bankMap, oraclePrices, bankMetadataMap,
|
|
6514
|
-
* addressLookupTables, assetShareValueMultiplierByBank
|
|
6515
|
-
*
|
|
6516
|
-
* @param params - Loop parameters (user provides: connection, depositOpts, borrowOpts, swapOpts, bridgeOpts?, etc.)
|
|
6517
|
-
*/
|
|
6518
|
-
makeBridgedLoopTx(params: Omit<MakeBridgedLoopTxParams, "program" | "marginfiAccount" | "bankMap" | "oraclePrices" | "bankMetadataMap" | "addressLookupTableAccounts" | "assetShareValueMultiplierByBank">): Promise<BridgedTxResult>;
|
|
6519
|
-
/**
|
|
6520
|
-
* Creates a collateral-swap transaction with a transparent bridged (double-hop) fallback and
|
|
6521
|
-
* auto-injected client data.
|
|
6522
|
-
*
|
|
6523
|
-
* One call: tries the direct {@link makeSwapCollateralTx} first; if the swap `A → C` can't fit
|
|
6524
|
-
* one transaction or has no route, it decomposes into `A → bridge` + `bridge → C` through a
|
|
6525
|
-
* bridge token, composed as one atomic Jito bundle. `result.bridgeMint` is set only when the
|
|
6526
|
-
* bridged path was used.
|
|
6527
|
-
*
|
|
6528
|
-
* Auto-injects: program, marginfiAccount, bankMap, oraclePrices, bankMetadataMap,
|
|
6529
|
-
* addressLookupTables, assetShareValueMultiplierByBank
|
|
6530
|
-
*
|
|
6531
|
-
* @param params - Swap collateral parameters (user provides: connection, withdrawOpts, depositOpts, swapOpts, bridgeOpts?, etc.)
|
|
6532
|
-
*/
|
|
6533
|
-
makeBridgedSwapCollateralTx(params: Omit<MakeBridgedSwapCollateralTxParams, "program" | "marginfiAccount" | "bankMap" | "oraclePrices" | "bankMetadataMap" | "addressLookupTableAccounts" | "assetShareValueMultiplierByBank">): Promise<BridgedTxResult>;
|
|
6534
|
-
/**
|
|
6535
|
-
* Creates a debt-swap transaction with a transparent bridged (double-hop) fallback and
|
|
6536
|
-
* auto-injected client data.
|
|
6537
|
-
*
|
|
6538
|
-
* One call: tries the direct {@link makeSwapDebtTx} first; if the swap `A → C` can't fit one
|
|
6539
|
-
* transaction or has no route, the first leg repays A by borrowing a bridge token and the second
|
|
6540
|
-
* leg repays exactly that bridge debt while borrowing C — one atomic Jito bundle.
|
|
6541
|
-
* `result.bridgeMint` is set only when the bridged path was used.
|
|
6542
|
-
*
|
|
6543
|
-
* Auto-injects: program, marginfiAccount, bankMap, oraclePrices, bankMetadataMap,
|
|
6544
|
-
* addressLookupTables, assetShareValueMultiplierByBank
|
|
6545
|
-
*
|
|
6546
|
-
* @param params - Swap debt parameters (user provides: connection, repayOpts, borrowOpts, swapOpts, bridgeOpts?, etc.)
|
|
6547
|
-
*/
|
|
6548
|
-
makeBridgedSwapDebtTx(params: Omit<MakeBridgedSwapDebtTxParams, "program" | "marginfiAccount" | "bankMap" | "oraclePrices" | "bankMetadataMap" | "addressLookupTableAccounts" | "assetShareValueMultiplierByBank">): Promise<BridgedTxResult>;
|
|
6549
5958
|
/**
|
|
6550
5959
|
* Creates a deposit transaction with auto-injected client data.
|
|
6551
5960
|
*
|
|
@@ -6750,4 +6159,4 @@ declare class MarginfiAccountWrapper {
|
|
|
6750
6159
|
getClient(): Project0Client;
|
|
6751
6160
|
}
|
|
6752
6161
|
|
|
6753
|
-
export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE, ADDRESS_LOOKUP_TABLE_FOR_SWAP, type AccountActiveBalanceForBank, AccountFlags, ActionEmodeImpact, ActiveEmodePair, type ActiveStakePoolMap, Amount, AssetTag, BUNDLE_TX_SIZE, Balance, type BalanceRaw, BalanceType, type BalanceTypeDto, Bank, type BankConfigDto, BankConfigFlag, BankConfigOpt, BankConfigOptRaw, BankConfigRaw, type BankConfigRawDto, BankConfigType, BankIntegrationMetadata, BankIntegrationMetadataDto, BankIntegrationMetadataMap, BankIntegrationMetadataMapDto, type BankMetrics, type BankRateLimiterDto, BankRateLimiterRaw, type BankRateLimiterRawDto, BankRateLimiterType, BankRaw, type BankRawDto, BankType, type BankTypeDto, BankVaultType, type BridgeOpts, type BridgeTokenSide, type BridgedSwapLeg, type BridgedTxResult, type BuildContext, type BulkLendTxsResult, type ClassifiedPosition, type ComposeBridgedSwapParams, type ComposeBridgedSwapResult, type ComputeAssetHealthComponentParams, type ComputeBalanceUsdValueParams, type ComputeBankMetricsParams, type ComputeFreeCollateralFromBalancesParams, type ComputeHealthCacheStatusParams, type ComputeHealthComponentsFromBalancesParams, type ComputeLiabilityHealthComponentParams, type ComputeLiquidationPriceForBankParams, type ComputeMaxBorrowForBankParams, type ComputeMaxWithdrawForBankParams, type ComputeNetApyParams, ConfigRaw, type CrankCombination, type CrankabilityResult, DEFAULT_BRIDGE_MINTS, DEFAULT_CROSSBAR_URL, DEFAULT_FALLBACK_CROSSBAR_URL, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, type DriftBankInput, type DriftMetadata, type DriftStateByBank, type DriftStateJsonByBank, EMPTY_HEALTH_CACHE, type EmodeConfigRawDto, type EmodeEntryDto, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodePair, type EmodeSettingsDto, EmodeSettingsRaw, type EmodeSettingsRawDto, EmodeSettingsType, EmodeTag, Environment, type ExactOutEstimateResult, type ExtendedTransaction, type ExtendedTransactionProperties, type ExtendedV0Transaction, FLASHLOAN_ENABLED_FLAG, type FeeStateCache, type FetchBankIntegrationMetadataOptions, type FetchDriftMetadataOptions, type FetchJupLendMetadataOptions, type FetchKaminoMetadataOptions, type FlashloanActionResult, type FlashloanBudgetIx, type FlashloanPrecheckResult, type FlashloanSwapConstraints, type GetBalanceUsdValueWithPriceBiasParams, type GetExactOutEstimateParams, type GetSwapIxsForFlashloanParams, type GetTitanExactOutEstimateParams, type GetTitanSwapIxsParams, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, type HealthCacheRaw, HealthCacheSimulationError, HealthCacheStatus, HealthCacheType, type HealthCacheTypeDto, type InstructionsWrapper, type IntegrationType, InterestRateConfig, type InterestRateConfigDto, InterestRateConfigRaw, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, type JupLendBankInput, type JupLendMetadata, type JupLendStateByBank, type JupLendStateJsonByBank, type KaminoBankInput, type KaminoMetadata, type KaminoStateByBank, type KaminoStateJsonByBank, LST_MINT, type LoopFlashloanDescriptor, MARGINFI_PROGRAM, MARGINFI_PROGRAM_STAGING, MARGINFI_PROGRAM_STAGING_ALT, MARGINFI_SPONSORED_SHARD_ID, MAX_ACCOUNT_LOCKS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, type MakeAccountTransferToNewAccountTxParams, type MakeBorrowIxOpts, type MakeBorrowIxParams, type MakeBorrowTxParams, type MakeBridgedLoopTxParams, type MakeBridgedSwapCollateralTxParams, type MakeBridgedSwapDebtTxParams, type MakeBulkRepayTxParams, type MakeBulkWithdrawTxParams, type MakeCloseAccountIxParams, type MakeCloseAccountTxParams, type MakeDepositIxOpts, type MakeDepositIxParams, type MakeDepositTxParams, type MakeDriftDepositIxParams, type MakeDriftDepositTxParams, type MakeDriftWithdrawIxParams, type MakeDriftWithdrawTxParams, type MakeFlashLoanTxParams, type MakeJuplendDepositIxParams, type MakeJuplendDepositTxParams, type MakeJuplendWithdrawIxParams, type MakeJuplendWithdrawTxParams, type MakeKaminoDepositIxParams, type MakeKaminoDepositTxParams, type MakeKaminoWithdrawIxParams, type MakeKaminoWithdrawTxParams, type MakeLoopTxParams, type MakeMergeStakeAccountsTxParams, type MakeMintStakedLstIxParams, type MakeMintStakedLstTxParams, type MakeRedeemStakedLstIxParams, type MakeRedeemStakedLstTxParams, type MakeRepayIxOpts, type MakeRepayIxParams, type MakeRepayTxParams, type MakeRepayWithCollatTxParams, type MakeRollPtTxParams, type MakeSetupIxParams, type MakeSwapCollateralTxParams, type MakeSwapDebtTxParams, type MakeTransferPositionsTxParams, type MakeWithdrawIxOpts, type MakeWithdrawIxParams, type MakeWithdrawTxParams, MarginRequirementType, type MarginRequirementTypeRaw, MarginfiAccount, type MarginfiAccountRaw, MarginfiAccountType, type MarginfiAccountTypeDto, MarginfiAccountWrapper, MarginfiGroup, type MarginfiGroupRaw, type MarginfiGroupType, type MarginfiGroupTypeDto, MarginfiIdlType, MarginfiProgram, type MintAuthorityBalance, MintData, OperationalState, OperationalStateRaw, OraclePrice, OraclePriceDto, OracleSetup, OracleSetupRaw, type OracleSourceKey, PDA_BANK_EMISSIONS_AUTH_SEED, PDA_BANK_EMISSIONS_VAULT_SEED, PDA_BANK_FEE_STATE_SEED, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PDA_MARGINFI_ACCOUNT_SEED, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, type PanicStateCache, PriceBias, PriceWithConfidence, Project0Client, Project0Config, Project0ConfigRaw, type ProviderSwapRoute, type PythOracleServiceOpts, type RateLimitWindowDto, type RateLimitWindowRawDto, type RatePointDto, type ResolveBridgeCandidateBanksParams, type ResolvedPinnedSwapRoute, RiskTier, RiskTierRaw, type RollPtOpts, SINGLE_POOL_PROGRAM_ID, STAKED_ORACLE_DISABLED_FLAG, STAKED_ORACLE_USES_ONRAMP_FLAG, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, type SerializedInstruction, type SerializedLut, type SerializedSwapEngineRequest, type SerializedSwapEngineResult, type SerializedTxFootprint, type SharedBridgeLegContext, type SimulateAccountHealthCacheWithFallbackParams, type SimulationResultRaw, type SmartCrankParams, type SmartCrankResult, type SolanaTransaction, type StakeAccount, type StakePoolMevMap, type StakedBankMetadata, type SwapAdapter, type SwapApiConfig, type SwapCandidate, type SwapEngineRequest, type SwapEngineResult, type SwapEngineRunner, type SwapIxsResult, type SwapOpts, SwapProvider, type SwapProviderConfig, type SwapProviderEntry, type SwapQuoteResult, type SwbOracleAiDataByKey, type SwbOracleServiceOpts, TRANSFER_ACCOUNT_AUTHORITY_FLAG, type TitanQuoteParams, TransactionArenaKeyMap, type TransactionBuilderResult, TransactionBuildingError, TransactionBuildingErrorCode, type TransactionBuildingErrorDetails, TransactionConfigMap, TransactionType, type TransferPositionSide, type TransferPositionsResult, type TxFootprint, TypedAmount, USDC_DECIMALS, USDC_MINT, USDT_MINT, type ValidatorRateData, type ValidatorStakeGroup, type ValidatorStakeGroupDto, WSOL_MINT, type WithdrawWindowCache, WrappedI80F48, ZERO_ORACLE_KEY, accountConflictsWithBridgeBank, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRateLimiterRawToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, buildCollateralLegIxs, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkJupiterFeeAccount, checkMultipleOraclesCrankability, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, classifyAndValidate, compileFlashloanPrecheck, composeBridgedSwap, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiquidationPriceForBank, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxWithdrawForBank, computeNetApy, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeSmartCrank, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeUtilizationRate, computeV0TxSize, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, deserializeInstruction, deserializeLut, deserializeSwapEngineRequest, deserializeSwapEngineResult, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRateLimiter, dtoToBankRateLimiterRaw, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchMarginfiAccountActiveBalancesForBank, fetchMarginfiAccountAddresses, fetchMarginfiAccountAddressesHoldingBank, fetchMarginfiAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleAccountsFromAPI, fetchSwbOracleAccountsFromChain, fetchSwbOracleData, fetchSwbOraclePricesFromAPI, fetchSwbOraclePricesFromCrossbar, findRandomAvailableAccountIndex, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEmodePairs, getExactOutEstimate, getFallbackPricesByFeedId, getFallbackPricesForMints, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isBridgeConflictError, isDecomposableSwapError, isDepositIx, isFlashloan, isGroupRateLimiterEnabled, isStandardBorrowable, isStandardDepositable, isV0Tx, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx, makeBorrowIx, makeBorrowTx, makeBridgedLoopTx, makeBridgedSwapCollateralTx, makeBridgedSwapDebtTx, makeBulkRepayTx, makeBulkWithdrawTx, makeBundleTipIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCrankSwbFeedIx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx, makeDepositTx, makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePoolAddBankIx, makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshIntegrationBanksIxs, makeRefreshKaminoBanksIxs, makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSmartCrankSwbFeedIx, makeSmartCrankSwbFeedIxForAccounts, makeSwapCollateralTx, makeSwapDebtTx, makeTransferPositionsTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, mergeBridgeQuotes, mergeBridgeQuotesDebt, mergeBridgeQuotesLoop, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, patchDepositAmount, requireBank, requireTokenProgram, resolveBridgeCandidateBanks, resolvePinnedSwapRoute, resolveTokenProgramForMint, runSwapEngine, selectLutsForAccountAction, selectLutsForBanks, selectSwapBridges, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, sharedBridgeLegContext, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBankRateLimiterDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, tryBridgeCandidates, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
|
|
6162
|
+
export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE, ADDRESS_LOOKUP_TABLE_FOR_SWAP, type AccountActiveBalanceForBank, AccountFlags, ActionEmodeImpact, ActiveEmodePair, type ActiveStakePoolMap, Amount, AssetTag, BUNDLE_TX_SIZE, Balance, type BalanceRaw, BalanceType, type BalanceTypeDto, Bank, type BankConfigDto, BankConfigFlag, BankConfigOpt, BankConfigOptRaw, BankConfigRaw, type BankConfigRawDto, BankConfigType, BankIntegrationMetadata, BankIntegrationMetadataDto, BankIntegrationMetadataMap, BankIntegrationMetadataMapDto, type BankMetrics, type BankRateLimiterDto, BankRateLimiterRaw, type BankRateLimiterRawDto, BankRateLimiterType, BankRaw, type BankRawDto, BankType, type BankTypeDto, BankVaultType, type BridgeSide, type BridgedSwapLeg, type ComposeBridgedSwapParams, type ComposeBridgedSwapResult, type ComputeAssetHealthComponentParams, type ComputeBalanceUsdValueParams, type ComputeBankMetricsParams, type ComputeFreeCollateralFromBalancesParams, type ComputeHealthCacheStatusParams, type ComputeHealthComponentsFromBalancesParams, type ComputeLiabilityHealthComponentParams, type ComputeLiquidationPriceForBankParams, type ComputeMaxBorrowForBankParams, type ComputeMaxWithdrawForBankParams, type ComputeNetApyParams, ConfigRaw, type CrankCombination, type CrankabilityResult, DEFAULT_CROSSBAR_URL, DEFAULT_FALLBACK_CROSSBAR_URL, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, type DriftBankInput, type DriftMetadata, type DriftStateByBank, type DriftStateJsonByBank, EMPTY_HEALTH_CACHE, type EmodeConfigRawDto, type EmodeEntryDto, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodePair, type EmodeSettingsDto, EmodeSettingsRaw, type EmodeSettingsRawDto, EmodeSettingsType, EmodeTag, Environment, type ExactOutEstimateResult, type ExtendedTransaction, type ExtendedTransactionProperties, type ExtendedV0Transaction, FLASHLOAN_ENABLED_FLAG, type FeeStateCache, type FetchBankIntegrationMetadataOptions, type FetchDriftMetadataOptions, type FetchJupLendMetadataOptions, type FetchKaminoMetadataOptions, type FlashloanActionResult, type FlashloanBudgetIx, type FlashloanPrecheckResult, type FlashloanSwapConstraints, type GetBalanceUsdValueWithPriceBiasParams, type GetExactOutEstimateParams, type GetSwapIxsForFlashloanParams, type GetTitanExactOutEstimateParams, type GetTitanSwapIxsParams, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, type HealthCacheRaw, HealthCacheSimulationError, HealthCacheStatus, HealthCacheType, type HealthCacheTypeDto, type InstructionsWrapper, type IntegrationType, InterestRateConfig, type InterestRateConfigDto, InterestRateConfigRaw, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, type JupLendBankInput, type JupLendMetadata, type JupLendStateByBank, type JupLendStateJsonByBank, type KaminoBankInput, type KaminoMetadata, type KaminoStateByBank, type KaminoStateJsonByBank, LST_MINT, type LoopFlashloanDescriptor, MARGINFI_PROGRAM, MARGINFI_PROGRAM_STAGING, MARGINFI_PROGRAM_STAGING_ALT, MARGINFI_SPONSORED_SHARD_ID, MAX_ACCOUNT_LOCKS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, type MakeAccountTransferToNewAccountTxParams, type MakeBorrowIxOpts, type MakeBorrowIxParams, type MakeBorrowTxParams, type MakeCloseAccountIxParams, type MakeCloseAccountTxParams, type MakeDepositIxOpts, type MakeDepositIxParams, type MakeDepositTxParams, type MakeDriftDepositIxParams, type MakeDriftDepositTxParams, type MakeDriftWithdrawIxParams, type MakeDriftWithdrawTxParams, type MakeFlashLoanTxParams, type MakeJuplendDepositIxParams, type MakeJuplendDepositTxParams, type MakeJuplendWithdrawIxParams, type MakeJuplendWithdrawTxParams, type MakeKaminoDepositIxParams, type MakeKaminoDepositTxParams, type MakeKaminoWithdrawIxParams, type MakeKaminoWithdrawTxParams, type MakeLoopTxParams, type MakeMergeStakeAccountsTxParams, type MakeMintStakedLstIxParams, type MakeMintStakedLstTxParams, type MakeRedeemStakedLstIxParams, type MakeRedeemStakedLstTxParams, type MakeRepayIxOpts, type MakeRepayIxParams, type MakeRepayTxParams, type MakeRepayWithCollatTxParams, type MakeRollPtTxParams, type MakeSetupIxParams, type MakeSwapCollateralTxParams, type MakeSwapDebtTxParams, type MakeWithdrawIxOpts, type MakeWithdrawIxParams, type MakeWithdrawTxParams, MarginRequirementType, type MarginRequirementTypeRaw, MarginfiAccount, type MarginfiAccountRaw, MarginfiAccountType, type MarginfiAccountTypeDto, MarginfiAccountWrapper, MarginfiGroup, type MarginfiGroupRaw, type MarginfiGroupType, type MarginfiGroupTypeDto, MarginfiIdlType, MarginfiProgram, type MintAuthorityBalance, MintData, OperationalState, OperationalStateRaw, OraclePrice, OraclePriceDto, OracleSetup, OracleSetupRaw, type OracleSourceKey, PDA_BANK_EMISSIONS_AUTH_SEED, PDA_BANK_EMISSIONS_VAULT_SEED, PDA_BANK_FEE_STATE_SEED, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PDA_MARGINFI_ACCOUNT_SEED, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, type PanicStateCache, PriceBias, PriceWithConfidence, Project0Client, Project0Config, Project0ConfigRaw, type ProviderSwapRoute, type PythOracleServiceOpts, type RateLimitWindowDto, type RateLimitWindowRawDto, type RatePointDto, type ResolveBridgeBanksParams, RiskTier, RiskTierRaw, type RollPtOpts, SINGLE_POOL_PROGRAM_ID, STAKED_ORACLE_DISABLED_FLAG, STAKED_ORACLE_USES_ONRAMP_FLAG, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, type SerializedInstruction, type SerializedLut, type SerializedSwapEngineRequest, type SerializedSwapEngineResult, type SerializedTxFootprint, type SimulateAccountHealthCacheWithFallbackParams, type SimulationResultRaw, type SmartCrankParams, type SmartCrankResult, type SolanaTransaction, type StakeAccount, type StakePoolMevMap, type StakedBankMetadata, type SwapAdapter, type SwapApiConfig, type SwapCandidate, type SwapEngineRequest, type SwapEngineResult, type SwapEngineRunner, type SwapIxsResult, type SwapOpts, SwapProvider, type SwapProviderConfig, type SwapProviderEntry, type SwapQuoteResult, type SwbOracleAiDataByKey, type SwbOracleServiceOpts, TRANSFER_ACCOUNT_AUTHORITY_FLAG, type TitanQuoteParams, TransactionArenaKeyMap, type TransactionBuilderResult, TransactionBuildingError, TransactionBuildingErrorCode, type TransactionBuildingErrorDetails, TransactionConfigMap, TransactionType, type TxFootprint, TypedAmount, USDC_DECIMALS, USDC_MINT, type ValidatorRateData, type ValidatorStakeGroup, type ValidatorStakeGroupDto, WSOL_MINT, type WithdrawWindowCache, WrappedI80F48, ZERO_ORACLE_KEY, accountConflictsWithBridge, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRateLimiterRawToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkJupiterFeeAccount, checkMultipleOraclesCrankability, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, compileFlashloanPrecheck, composeBridgedSwap, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiquidationPriceForBank, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxWithdrawForBank, computeNetApy, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeSmartCrank, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeUtilizationRate, computeV0TxSize, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, deserializeInstruction, deserializeLut, deserializeSwapEngineRequest, deserializeSwapEngineResult, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRateLimiter, dtoToBankRateLimiterRaw, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchMarginfiAccountActiveBalancesForBank, fetchMarginfiAccountAddresses, fetchMarginfiAccountAddressesHoldingBank, fetchMarginfiAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleAccountsFromAPI, fetchSwbOracleAccountsFromChain, fetchSwbOracleData, fetchSwbOraclePricesFromAPI, fetchSwbOraclePricesFromCrossbar, findRandomAvailableAccountIndex, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEmodePairs, getExactOutEstimate, getFallbackPricesByFeedId, getFallbackPricesForMints, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isDecomposableSwapError, isDepositIx, isFlashloan, isGroupRateLimiterEnabled, isStandardBorrowable, isStandardDepositable, isV0Tx, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx, makeBorrowIx, makeBorrowTx, makeBundleTipIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCrankSwbFeedIx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx, makeDepositTx, makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePoolAddBankIx, makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshKaminoBanksIxs, makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSmartCrankSwbFeedIx, makeSwapCollateralTx, makeSwapDebtTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, mergeBridgeQuotes, mergeBridgeQuotesDebt, mergeBridgeQuotesLoop, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, patchDepositAmount, resolveBridgeBanks, runSwapEngine, selectLutsForAccountAction, selectLutsForBanks, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBankRateLimiterDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
|