@0dotxyz/p0-ts-sdk 2.5.5-alpha.7 → 2.5.5-alpha.9

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.d.cts CHANGED
@@ -3267,6 +3267,10 @@ interface BridgedTxResult {
3267
3267
  quoteResponse: SwapQuoteResult | undefined;
3268
3268
  /** The bridge token's mint — set only when the bridged double-hop path was used. */
3269
3269
  bridgeMint?: PublicKey;
3270
+ /** true → send as ONE atomic Jito bundle (bridged legs are one operation / integration
3271
+ * refreshes go stale within a slot); false → sequential sends are safe (cranked oracles
3272
+ * allow ≥ ~1 min staleness). */
3273
+ mustBeAtomicBundle: boolean;
3270
3274
  }
3271
3275
  /** A mint's token program: the cache (seedable by the caller), else the mint account's owner. */
3272
3276
  declare function resolveTokenProgramForMint(mint: PublicKey, connection: Connection, tokenProgramCacheByMint: Map<string, PublicKey>): Promise<PublicKey>;
@@ -3663,6 +3667,9 @@ declare function makeLoopTx(params: MakeLoopTxParams): Promise<{
3663
3667
  transactions: ExtendedV0Transaction[];
3664
3668
  actionTxIndex: number;
3665
3669
  quoteResponse: SwapQuoteResult | undefined;
3670
+ /** true → send as ONE atomic Jito bundle (integration refreshes go stale within a slot);
3671
+ * false → sequential sends are safe (cranked oracles allow ≥ ~1 min staleness). */
3672
+ mustBeAtomicBundle: boolean;
3666
3673
  }>;
3667
3674
  interface MakeBridgedLoopTxParams extends MakeLoopTxParams {
3668
3675
  bridgeOpts?: BridgeOpts;
@@ -3736,6 +3743,7 @@ declare function makeRepayWithCollatTx(params: MakeRepayWithCollatTxParams): Pro
3736
3743
  transactions: ExtendedV0Transaction[];
3737
3744
  swapQuote: SwapQuoteResult | undefined;
3738
3745
  amountToRepay: number;
3746
+ mustBeAtomicBundle: boolean;
3739
3747
  }>;
3740
3748
 
3741
3749
  declare function makeBeginFlashLoanIx(program: MarginfiProgram, marginfiAccountPk: PublicKey, endIndex: number, authority?: PublicKey, isSync?: boolean): Promise<InstructionsWrapper>;
@@ -3765,6 +3773,9 @@ declare function makeSwapCollateralTx(params: MakeSwapCollateralTxParams): Promi
3765
3773
  transactions: ExtendedV0Transaction[];
3766
3774
  actionTxIndex: number;
3767
3775
  quoteResponse: SwapQuoteResult | undefined;
3776
+ /** true → send as ONE atomic Jito bundle (integration refreshes go stale within a slot);
3777
+ * false → sequential sends are safe (cranked oracles allow ≥ ~1 min staleness). */
3778
+ mustBeAtomicBundle: boolean;
3768
3779
  }>;
3769
3780
  interface MakeBridgedSwapCollateralTxParams extends MakeSwapCollateralTxParams {
3770
3781
  bridgeOpts?: BridgeOpts;
@@ -3799,6 +3810,9 @@ declare function makeSwapDebtTx(params: MakeSwapDebtTxParams): Promise<{
3799
3810
  transactions: ExtendedV0Transaction[];
3800
3811
  actionTxIndex: number;
3801
3812
  quoteResponse: SwapQuoteResult | undefined;
3813
+ /** true → send as ONE atomic Jito bundle (integration refreshes go stale within a slot);
3814
+ * false → sequential sends are safe (cranked oracles allow ≥ ~1 min staleness). */
3815
+ mustBeAtomicBundle: boolean;
3802
3816
  }>;
3803
3817
  interface MakeBridgedSwapDebtTxParams extends MakeSwapDebtTxParams {
3804
3818
  bridgeOpts?: BridgeOpts;
@@ -5905,6 +5919,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
5905
5919
  transactions: ExtendedV0Transaction[];
5906
5920
  actionTxIndex: number;
5907
5921
  quoteResponse: SwapQuoteResult | undefined;
5922
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
5923
+ * false → sequential sends are safe. */
5924
+ mustBeAtomicBundle: boolean;
5908
5925
  }>;
5909
5926
  /**
5910
5927
  * Atomically move a selected set of positions from this account to a destination account
@@ -5995,6 +6012,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
5995
6012
  transactions: ExtendedV0Transaction[];
5996
6013
  swapQuote: SwapQuoteResult | undefined;
5997
6014
  amountToRepay: number;
6015
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6016
+ * false → sequential sends are safe. */
6017
+ mustBeAtomicBundle: boolean;
5998
6018
  }>;
5999
6019
  /**
6000
6020
  * Creates a transaction to swap one collateral position to another using a flash loan.
@@ -6029,6 +6049,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
6029
6049
  transactions: ExtendedV0Transaction[];
6030
6050
  actionTxIndex: number;
6031
6051
  quoteResponse: SwapQuoteResult | undefined;
6052
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6053
+ * false → sequential sends are safe. */
6054
+ mustBeAtomicBundle: boolean;
6032
6055
  }>;
6033
6056
  /**
6034
6057
  * Creates a transaction to roll a matured Exponent PT collateral position into its
@@ -6075,6 +6098,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
6075
6098
  transactions: ExtendedV0Transaction[];
6076
6099
  actionTxIndex: number;
6077
6100
  quoteResponse: SwapQuoteResult | undefined;
6101
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6102
+ * false → sequential sends are safe. */
6103
+ mustBeAtomicBundle: boolean;
6078
6104
  }>;
6079
6105
  /**
6080
6106
  * Creates a deposit transaction.
@@ -6435,6 +6461,9 @@ declare class MarginfiAccountWrapper {
6435
6461
  transactions: ExtendedV0Transaction[];
6436
6462
  actionTxIndex: number;
6437
6463
  quoteResponse: SwapQuoteResult | undefined;
6464
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6465
+ * false → sequential sends are safe. */
6466
+ mustBeAtomicBundle: boolean;
6438
6467
  }>;
6439
6468
  /**
6440
6469
  * Atomically move a selected set of positions from this account to a destination account with
@@ -6455,6 +6484,9 @@ declare class MarginfiAccountWrapper {
6455
6484
  transactions: ExtendedV0Transaction[];
6456
6485
  swapQuote: SwapQuoteResult | undefined;
6457
6486
  amountToRepay: number;
6487
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6488
+ * false → sequential sends are safe. */
6489
+ mustBeAtomicBundle: boolean;
6458
6490
  }>;
6459
6491
  /**
6460
6492
  * Creates a swap collateral transaction with auto-injected client data.
@@ -6470,6 +6502,9 @@ declare class MarginfiAccountWrapper {
6470
6502
  transactions: ExtendedV0Transaction[];
6471
6503
  actionTxIndex: number;
6472
6504
  quoteResponse: SwapQuoteResult | undefined;
6505
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6506
+ * false → sequential sends are safe. */
6507
+ mustBeAtomicBundle: boolean;
6473
6508
  }>;
6474
6509
  /**
6475
6510
  * Rolls a matured Exponent PT collateral position into its next-maturity PT, with
@@ -6499,6 +6534,9 @@ declare class MarginfiAccountWrapper {
6499
6534
  transactions: ExtendedV0Transaction[];
6500
6535
  actionTxIndex: number;
6501
6536
  quoteResponse: SwapQuoteResult | undefined;
6537
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6538
+ * false → sequential sends are safe. */
6539
+ mustBeAtomicBundle: boolean;
6502
6540
  }>;
6503
6541
  /**
6504
6542
  * Creates a loop (leverage) transaction with a transparent bridged (double-hop) fallback and
package/dist/index.d.ts CHANGED
@@ -3267,6 +3267,10 @@ interface BridgedTxResult {
3267
3267
  quoteResponse: SwapQuoteResult | undefined;
3268
3268
  /** The bridge token's mint — set only when the bridged double-hop path was used. */
3269
3269
  bridgeMint?: PublicKey;
3270
+ /** true → send as ONE atomic Jito bundle (bridged legs are one operation / integration
3271
+ * refreshes go stale within a slot); false → sequential sends are safe (cranked oracles
3272
+ * allow ≥ ~1 min staleness). */
3273
+ mustBeAtomicBundle: boolean;
3270
3274
  }
3271
3275
  /** A mint's token program: the cache (seedable by the caller), else the mint account's owner. */
3272
3276
  declare function resolveTokenProgramForMint(mint: PublicKey, connection: Connection, tokenProgramCacheByMint: Map<string, PublicKey>): Promise<PublicKey>;
@@ -3663,6 +3667,9 @@ declare function makeLoopTx(params: MakeLoopTxParams): Promise<{
3663
3667
  transactions: ExtendedV0Transaction[];
3664
3668
  actionTxIndex: number;
3665
3669
  quoteResponse: SwapQuoteResult | undefined;
3670
+ /** true → send as ONE atomic Jito bundle (integration refreshes go stale within a slot);
3671
+ * false → sequential sends are safe (cranked oracles allow ≥ ~1 min staleness). */
3672
+ mustBeAtomicBundle: boolean;
3666
3673
  }>;
3667
3674
  interface MakeBridgedLoopTxParams extends MakeLoopTxParams {
3668
3675
  bridgeOpts?: BridgeOpts;
@@ -3736,6 +3743,7 @@ declare function makeRepayWithCollatTx(params: MakeRepayWithCollatTxParams): Pro
3736
3743
  transactions: ExtendedV0Transaction[];
3737
3744
  swapQuote: SwapQuoteResult | undefined;
3738
3745
  amountToRepay: number;
3746
+ mustBeAtomicBundle: boolean;
3739
3747
  }>;
3740
3748
 
3741
3749
  declare function makeBeginFlashLoanIx(program: MarginfiProgram, marginfiAccountPk: PublicKey, endIndex: number, authority?: PublicKey, isSync?: boolean): Promise<InstructionsWrapper>;
@@ -3765,6 +3773,9 @@ declare function makeSwapCollateralTx(params: MakeSwapCollateralTxParams): Promi
3765
3773
  transactions: ExtendedV0Transaction[];
3766
3774
  actionTxIndex: number;
3767
3775
  quoteResponse: SwapQuoteResult | undefined;
3776
+ /** true → send as ONE atomic Jito bundle (integration refreshes go stale within a slot);
3777
+ * false → sequential sends are safe (cranked oracles allow ≥ ~1 min staleness). */
3778
+ mustBeAtomicBundle: boolean;
3768
3779
  }>;
3769
3780
  interface MakeBridgedSwapCollateralTxParams extends MakeSwapCollateralTxParams {
3770
3781
  bridgeOpts?: BridgeOpts;
@@ -3799,6 +3810,9 @@ declare function makeSwapDebtTx(params: MakeSwapDebtTxParams): Promise<{
3799
3810
  transactions: ExtendedV0Transaction[];
3800
3811
  actionTxIndex: number;
3801
3812
  quoteResponse: SwapQuoteResult | undefined;
3813
+ /** true → send as ONE atomic Jito bundle (integration refreshes go stale within a slot);
3814
+ * false → sequential sends are safe (cranked oracles allow ≥ ~1 min staleness). */
3815
+ mustBeAtomicBundle: boolean;
3802
3816
  }>;
3803
3817
  interface MakeBridgedSwapDebtTxParams extends MakeSwapDebtTxParams {
3804
3818
  bridgeOpts?: BridgeOpts;
@@ -5905,6 +5919,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
5905
5919
  transactions: ExtendedV0Transaction[];
5906
5920
  actionTxIndex: number;
5907
5921
  quoteResponse: SwapQuoteResult | undefined;
5922
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
5923
+ * false → sequential sends are safe. */
5924
+ mustBeAtomicBundle: boolean;
5908
5925
  }>;
5909
5926
  /**
5910
5927
  * Atomically move a selected set of positions from this account to a destination account
@@ -5995,6 +6012,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
5995
6012
  transactions: ExtendedV0Transaction[];
5996
6013
  swapQuote: SwapQuoteResult | undefined;
5997
6014
  amountToRepay: number;
6015
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6016
+ * false → sequential sends are safe. */
6017
+ mustBeAtomicBundle: boolean;
5998
6018
  }>;
5999
6019
  /**
6000
6020
  * Creates a transaction to swap one collateral position to another using a flash loan.
@@ -6029,6 +6049,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
6029
6049
  transactions: ExtendedV0Transaction[];
6030
6050
  actionTxIndex: number;
6031
6051
  quoteResponse: SwapQuoteResult | undefined;
6052
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6053
+ * false → sequential sends are safe. */
6054
+ mustBeAtomicBundle: boolean;
6032
6055
  }>;
6033
6056
  /**
6034
6057
  * Creates a transaction to roll a matured Exponent PT collateral position into its
@@ -6075,6 +6098,9 @@ declare class MarginfiAccount implements MarginfiAccountType {
6075
6098
  transactions: ExtendedV0Transaction[];
6076
6099
  actionTxIndex: number;
6077
6100
  quoteResponse: SwapQuoteResult | undefined;
6101
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6102
+ * false → sequential sends are safe. */
6103
+ mustBeAtomicBundle: boolean;
6078
6104
  }>;
6079
6105
  /**
6080
6106
  * Creates a deposit transaction.
@@ -6435,6 +6461,9 @@ declare class MarginfiAccountWrapper {
6435
6461
  transactions: ExtendedV0Transaction[];
6436
6462
  actionTxIndex: number;
6437
6463
  quoteResponse: SwapQuoteResult | undefined;
6464
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6465
+ * false → sequential sends are safe. */
6466
+ mustBeAtomicBundle: boolean;
6438
6467
  }>;
6439
6468
  /**
6440
6469
  * Atomically move a selected set of positions from this account to a destination account with
@@ -6455,6 +6484,9 @@ declare class MarginfiAccountWrapper {
6455
6484
  transactions: ExtendedV0Transaction[];
6456
6485
  swapQuote: SwapQuoteResult | undefined;
6457
6486
  amountToRepay: number;
6487
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6488
+ * false → sequential sends are safe. */
6489
+ mustBeAtomicBundle: boolean;
6458
6490
  }>;
6459
6491
  /**
6460
6492
  * Creates a swap collateral transaction with auto-injected client data.
@@ -6470,6 +6502,9 @@ declare class MarginfiAccountWrapper {
6470
6502
  transactions: ExtendedV0Transaction[];
6471
6503
  actionTxIndex: number;
6472
6504
  quoteResponse: SwapQuoteResult | undefined;
6505
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6506
+ * false → sequential sends are safe. */
6507
+ mustBeAtomicBundle: boolean;
6473
6508
  }>;
6474
6509
  /**
6475
6510
  * Rolls a matured Exponent PT collateral position into its next-maturity PT, with
@@ -6499,6 +6534,9 @@ declare class MarginfiAccountWrapper {
6499
6534
  transactions: ExtendedV0Transaction[];
6500
6535
  actionTxIndex: number;
6501
6536
  quoteResponse: SwapQuoteResult | undefined;
6537
+ /** true → send as ONE atomic Jito bundle (bridged legs / integration refreshes);
6538
+ * false → sequential sends are safe. */
6539
+ mustBeAtomicBundle: boolean;
6502
6540
  }>;
6503
6541
  /**
6504
6542
  * Creates a loop (leverage) transaction with a transparent bridged (double-hop) fallback and
package/dist/index.js CHANGED
@@ -65915,6 +65915,7 @@ var getJupiterSwapIxsForFlashloan = async ({
65915
65915
  // src/services/account/services/swap-engine/adapters/jupiter.adapter.ts
65916
65916
  var JUPITER_MAX_ACCOUNTS_MARGIN = 4;
65917
65917
  var JUPITER_MIN_MAX_ACCOUNTS = 16;
65918
+ var BUNDLE_INCOMPATIBLE_DEXES = ["GoonFi V2"];
65918
65919
  function deserializeJupiterInstruction2(ix) {
65919
65920
  return new TransactionInstruction({
65920
65921
  programId: new PublicKey(ix.programId),
@@ -65980,6 +65981,7 @@ async function buildCandidates(req, apiConfig) {
65980
65981
  // the Router may route through DEXes whose swaps lock vote accounts,
65981
65982
  // which Jito rejects ("bundles cannot lock any vote accounts").
65982
65983
  forJitoBundle: true,
65984
+ excludeDexes: BUNDLE_INCOMPATIBLE_DEXES,
65983
65985
  destinationTokenAccount: req.destinationTokenAccount.toBase58(),
65984
65986
  platformFeeBps: useFee ? req.platformFeeBps : void 0,
65985
65987
  feeAccount: useFee ? feeAccount : void 0
@@ -66393,7 +66395,12 @@ async function makeRepayWithCollatTx(params) {
66393
66395
  );
66394
66396
  }
66395
66397
  const transactions = [...additionalTxs, flashloanTx];
66396
- return { transactions, swapQuote, amountToRepay };
66398
+ return {
66399
+ transactions,
66400
+ swapQuote,
66401
+ amountToRepay,
66402
+ mustBeAtomicBundle: refreshIntegrationIxs.instructions.length > 0
66403
+ };
66397
66404
  }
66398
66405
  async function buildRepayWithCollatFlashloanTx({
66399
66406
  program,
@@ -68578,7 +68585,8 @@ async function makeSwapDebtTx(params) {
68578
68585
  return {
68579
68586
  transactions,
68580
68587
  actionTxIndex: transactions.length - 1,
68581
- quoteResponse: swapQuote
68588
+ quoteResponse: swapQuote,
68589
+ mustBeAtomicBundle: refreshIntegrationIxs.instructions.length > 0
68582
68590
  };
68583
68591
  }
68584
68592
  async function buildSwapDebtFlashloanTx({
@@ -68845,7 +68853,8 @@ async function tryBridgedDebtSwap(params, bridgeOpts) {
68845
68853
  transactions: result.transactions,
68846
68854
  actionTxIndex: result.transactions.length - 1,
68847
68855
  quoteResponse: mergeBridgeQuotesDebt(result.firstLegQuote, result.secondLegQuote),
68848
- bridgeMint: bridgeBank.mint
68856
+ bridgeMint: bridgeBank.mint,
68857
+ mustBeAtomicBundle: true
68849
68858
  };
68850
68859
  }
68851
68860
  });
@@ -68954,7 +68963,8 @@ async function makeLoopTx(params) {
68954
68963
  return {
68955
68964
  transactions,
68956
68965
  actionTxIndex: transactions.length - 1,
68957
- quoteResponse: swapQuote
68966
+ quoteResponse: swapQuote,
68967
+ mustBeAtomicBundle: refreshIntegrationIxs.instructions.length > 0
68958
68968
  };
68959
68969
  }
68960
68970
  async function buildLoopFlashloanTx(params) {
@@ -69347,7 +69357,8 @@ async function tryBridgedLoop(params, bridgeOpts) {
69347
69357
  transactions: result.transactions,
69348
69358
  actionTxIndex: result.transactions.length - 1,
69349
69359
  quoteResponse: mergeBridgeQuotesLoop(result.firstLegQuote, result.secondLegQuote),
69350
- bridgeMint: bridgeBank.mint
69360
+ bridgeMint: bridgeBank.mint,
69361
+ mustBeAtomicBundle: true
69351
69362
  };
69352
69363
  }
69353
69364
  });
@@ -69443,7 +69454,8 @@ async function makeSwapCollateralTx(params) {
69443
69454
  return {
69444
69455
  transactions,
69445
69456
  actionTxIndex: transactions.length - 1,
69446
- quoteResponse: swapQuote
69457
+ quoteResponse: swapQuote,
69458
+ mustBeAtomicBundle: refreshIntegrationIxs.instructions.length > 0
69447
69459
  };
69448
69460
  }
69449
69461
  async function buildSwapCollateralFlashloanTx({
@@ -69857,7 +69869,8 @@ async function tryBridgedCollateralSwap(params, bridgeOpts) {
69857
69869
  transactions: result.transactions,
69858
69870
  actionTxIndex: result.transactions.length - 1,
69859
69871
  quoteResponse: mergeBridgeQuotes(result.firstLegQuote, result.secondLegQuote),
69860
- bridgeMint: bridgeBank.mint
69872
+ bridgeMint: bridgeBank.mint,
69873
+ mustBeAtomicBundle: true
69861
69874
  };
69862
69875
  }
69863
69876
  });