@neutral-trade/sdk 0.4.10 → 0.4.12
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.mts +16 -3
- package/dist/index.mjs +13 -1
- package/dist/internal.d.mts +1 -1
- package/dist/internal.mjs +1 -1
- package/dist/{neutral-trade-core-B_KCeEMm.d.mts → neutral-trade-core-7Ob7XfF4.d.mts} +3 -2
- package/dist/{neutral-trade-core-DCc6Dvgi.mjs → neutral-trade-core-CWk75xRT.mjs} +101 -22
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as UserBundleTempData, B as BundleProgram, C as VaultCategory, D as BundleAccount, E as VaultType, F as getSolanaTokenMint, G as createAllowlistedBundleProgram, H as DEFAULT_BUNDLE_PROGRAM_ID_DEVNET, I as tokens, J as isAllowlistedBundleProgramId, K as createBundleProgramById, L as ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, M as SupportedToken, N as Token, O as OracleData, P as getSolanaTokenDecimals, R as BUNDLE_PROGRAM_ID_V2_MAINNET, S as VaultBalanceData, T as VaultRegistryEntry, U as DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, V as BundleProvider, W as assertAllowlistedBundleProgramId, _ as getVaultRegistry, b as vaultsDevnet, f as NeutralTrade, g as getVaultById, h as getVaultByAddress, j as SupportedChain, k as UserBundleAccount, m as getBundleProgramId, p as NeutralTradeConfig, q as getDefaultBundleProgramIdByCluster, t as NeutralTradeCoreContext, v as isValidVaultAddress, w as VaultRegistry, x as UserBalanceResult, y as vaults$1, z as BundleCluster } from "./neutral-trade-core-
|
|
1
|
+
import { A as UserBundleTempData, B as BundleProgram, C as VaultCategory, D as BundleAccount, E as VaultType, F as getSolanaTokenMint, G as createAllowlistedBundleProgram, H as DEFAULT_BUNDLE_PROGRAM_ID_DEVNET, I as tokens, J as isAllowlistedBundleProgramId, K as createBundleProgramById, L as ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, M as SupportedToken, N as Token, O as OracleData, P as getSolanaTokenDecimals, R as BUNDLE_PROGRAM_ID_V2_MAINNET, S as VaultBalanceData, T as VaultRegistryEntry, U as DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, V as BundleProvider, W as assertAllowlistedBundleProgramId, _ as getVaultRegistry, b as vaultsDevnet, f as NeutralTrade, g as getVaultById, h as getVaultByAddress, j as SupportedChain, k as UserBundleAccount, m as getBundleProgramId, p as NeutralTradeConfig, q as getDefaultBundleProgramIdByCluster, t as NeutralTradeCoreContext, v as isValidVaultAddress, w as VaultRegistry, x as UserBalanceResult, y as vaults$1, z as BundleCluster } from "./neutral-trade-core-7Ob7XfF4.mjs";
|
|
2
2
|
import { AnchorProvider, Program, Wallet } from "@coral-xyz/anchor";
|
|
3
3
|
import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
4
4
|
import BN from "bn.js";
|
|
@@ -186,6 +186,18 @@ declare enum DevnetVaultId {
|
|
|
186
186
|
bundle_1_100000002 = 100000002,
|
|
187
187
|
/** bundle-2 */
|
|
188
188
|
bundle_2_100000003 = 100000003,
|
|
189
|
+
/** bundle-4 */
|
|
190
|
+
bundle_4_100000004 = 100000004,
|
|
191
|
+
/** bundle-5 */
|
|
192
|
+
bundle_5_100000005 = 100000005,
|
|
193
|
+
/** bundle-6 */
|
|
194
|
+
bundle_6_100000006 = 100000006,
|
|
195
|
+
/** bundle-7 */
|
|
196
|
+
bundle_7_100000007 = 100000007,
|
|
197
|
+
/** bundle-8 */
|
|
198
|
+
bundle_8_100000008 = 100000008,
|
|
199
|
+
/** bundle-9 */
|
|
200
|
+
bundle_9_100000009 = 100000009,
|
|
189
201
|
}
|
|
190
202
|
//#endregion
|
|
191
203
|
//#region src/utils/amount-raw.d.ts
|
|
@@ -352,7 +364,8 @@ declare function buildBundleRequestWithdrawInstruction({
|
|
|
352
364
|
amountRaw
|
|
353
365
|
}: BuildBundleRequestWithdrawInstructionParams): Promise<TransactionInstruction>;
|
|
354
366
|
/**
|
|
355
|
-
* `
|
|
367
|
+
* `initializeBundleDepositor` on target (when needed) + `requestBundleSwitch`
|
|
368
|
+
* for built-in registry vaults (source → target, same deposit token).
|
|
356
369
|
*/
|
|
357
370
|
declare function buildBundleRequestSwitchInstruction({
|
|
358
371
|
connection,
|
|
@@ -361,7 +374,7 @@ declare function buildBundleRequestSwitchInstruction({
|
|
|
361
374
|
targetVaultId,
|
|
362
375
|
user,
|
|
363
376
|
amountRaw
|
|
364
|
-
}: BuildBundleRequestSwitchInstructionParams): Promise<TransactionInstruction>;
|
|
377
|
+
}: BuildBundleRequestSwitchInstructionParams): Promise<TransactionInstruction[]>;
|
|
365
378
|
//#endregion
|
|
366
379
|
//#region src/utils/pda.d.ts
|
|
367
380
|
declare const SEED_ORACLE: NodeJS.NonSharedUint8Array;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as VaultCategory, B as DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, C as getBundleProgramId, D as isValidVaultAddress, E as getVaultRegistry, F as getSolanaTokenMint, G as isAllowlistedBundleProgramId, H as createAllowlistedBundleProgram, I as tokens, K as createDummyWallet, L as ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, M as SupportedChain, N as SupportedToken, O as vaults, P as getSolanaTokenDecimals, R as BUNDLE_PROGRAM_ID_V2_MAINNET, S as parseAmountRawToBigInt, T as getVaultById, U as createBundleProgramById, V as assertAllowlistedBundleProgramId, W as getDefaultBundleProgramIdByCluster, _ as derivePendingAuthPDA, a as buildBundleDepositInstructions, b as getVaultDepositorAddressSync, d as computeRequestWithdrawalSharesFromAmountRaw, f as SEED_ORACLE, g as deriveOraclePDA, h as SEED_USER, i as initNeutralTradeCore, j as VaultType, k as vaultsDevnet, m as SEED_TEMP, n as buildRequestWithdrawInstructionForVaultId, o as buildBundleRequestSwitchInstruction, p as SEED_PENDING_AUTH, s as buildBundleRequestWithdrawInstruction, t as buildDepositInstructionsForVaultId, v as deriveTempDataPDA, w as getVaultByAddress, x as humanFloatToAmountRawString, y as deriveUserPDA, z as DEFAULT_BUNDLE_PROGRAM_ID_DEVNET } from "./neutral-trade-core-
|
|
1
|
+
import { A as VaultCategory, B as DEFAULT_BUNDLE_PROGRAM_ID_MAINNET, C as getBundleProgramId, D as isValidVaultAddress, E as getVaultRegistry, F as getSolanaTokenMint, G as isAllowlistedBundleProgramId, H as createAllowlistedBundleProgram, I as tokens, K as createDummyWallet, L as ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER, M as SupportedChain, N as SupportedToken, O as vaults, P as getSolanaTokenDecimals, R as BUNDLE_PROGRAM_ID_V2_MAINNET, S as parseAmountRawToBigInt, T as getVaultById, U as createBundleProgramById, V as assertAllowlistedBundleProgramId, W as getDefaultBundleProgramIdByCluster, _ as derivePendingAuthPDA, a as buildBundleDepositInstructions, b as getVaultDepositorAddressSync, d as computeRequestWithdrawalSharesFromAmountRaw, f as SEED_ORACLE, g as deriveOraclePDA, h as SEED_USER, i as initNeutralTradeCore, j as VaultType, k as vaultsDevnet, m as SEED_TEMP, n as buildRequestWithdrawInstructionForVaultId, o as buildBundleRequestSwitchInstruction, p as SEED_PENDING_AUTH, s as buildBundleRequestWithdrawInstruction, t as buildDepositInstructionsForVaultId, v as deriveTempDataPDA, w as getVaultByAddress, x as humanFloatToAmountRawString, y as deriveUserPDA, z as DEFAULT_BUNDLE_PROGRAM_ID_DEVNET } from "./neutral-trade-core-CWk75xRT.mjs";
|
|
2
2
|
import { PublicKey } from "@solana/web3.js";
|
|
3
3
|
|
|
4
4
|
//#region src/constants/vault-ids.ts
|
|
@@ -183,6 +183,18 @@ let DevnetVaultId = /* @__PURE__ */ function(DevnetVaultId$1) {
|
|
|
183
183
|
DevnetVaultId$1[DevnetVaultId$1["bundle_1_100000002"] = 100000002] = "bundle_1_100000002";
|
|
184
184
|
/** bundle-2 */
|
|
185
185
|
DevnetVaultId$1[DevnetVaultId$1["bundle_2_100000003"] = 100000003] = "bundle_2_100000003";
|
|
186
|
+
/** bundle-4 */
|
|
187
|
+
DevnetVaultId$1[DevnetVaultId$1["bundle_4_100000004"] = 100000004] = "bundle_4_100000004";
|
|
188
|
+
/** bundle-5 */
|
|
189
|
+
DevnetVaultId$1[DevnetVaultId$1["bundle_5_100000005"] = 100000005] = "bundle_5_100000005";
|
|
190
|
+
/** bundle-6 */
|
|
191
|
+
DevnetVaultId$1[DevnetVaultId$1["bundle_6_100000006"] = 100000006] = "bundle_6_100000006";
|
|
192
|
+
/** bundle-7 */
|
|
193
|
+
DevnetVaultId$1[DevnetVaultId$1["bundle_7_100000007"] = 100000007] = "bundle_7_100000007";
|
|
194
|
+
/** bundle-8 */
|
|
195
|
+
DevnetVaultId$1[DevnetVaultId$1["bundle_8_100000008"] = 100000008] = "bundle_8_100000008";
|
|
196
|
+
/** bundle-9 */
|
|
197
|
+
DevnetVaultId$1[DevnetVaultId$1["bundle_9_100000009"] = 100000009] = "bundle_9_100000009";
|
|
186
198
|
return DevnetVaultId$1;
|
|
187
199
|
}({});
|
|
188
200
|
|
package/dist/internal.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as initNeutralTradeCore, c as BuildBundleRequestWithdrawInstructionCoreParams, d as buildBundleRequestWithdrawInstructionWithVault, i as getBundleProgramForVault, l as buildBundleDepositInstructionsWithVault, n as buildDepositInstructionsForVaultId, o as BuildBundleDepositInstructionsCoreParams, r as buildRequestWithdrawInstructionForVaultId, s as BuildBundleRequestSwitchInstructionCoreParams, t as NeutralTradeCoreContext, u as buildBundleRequestSwitchInstructionWithVault } from "./neutral-trade-core-
|
|
1
|
+
import { a as initNeutralTradeCore, c as BuildBundleRequestWithdrawInstructionCoreParams, d as buildBundleRequestWithdrawInstructionWithVault, i as getBundleProgramForVault, l as buildBundleDepositInstructionsWithVault, n as buildDepositInstructionsForVaultId, o as BuildBundleDepositInstructionsCoreParams, r as buildRequestWithdrawInstructionForVaultId, s as BuildBundleRequestSwitchInstructionCoreParams, t as NeutralTradeCoreContext, u as buildBundleRequestSwitchInstructionWithVault } from "./neutral-trade-core-7Ob7XfF4.mjs";
|
|
2
2
|
export { type BuildBundleDepositInstructionsCoreParams, type BuildBundleRequestSwitchInstructionCoreParams, type BuildBundleRequestWithdrawInstructionCoreParams, type NeutralTradeCoreContext, buildBundleDepositInstructionsWithVault, buildBundleRequestSwitchInstructionWithVault, buildBundleRequestWithdrawInstructionWithVault, buildDepositInstructionsForVaultId, buildRequestWithdrawInstructionForVaultId, getBundleProgramForVault, initNeutralTradeCore };
|
package/dist/internal.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as buildBundleDepositInstructionsWithVault, i as initNeutralTradeCore, l as buildBundleRequestSwitchInstructionWithVault, n as buildRequestWithdrawInstructionForVaultId, r as getBundleProgramForVault, t as buildDepositInstructionsForVaultId, u as buildBundleRequestWithdrawInstructionWithVault } from "./neutral-trade-core-
|
|
1
|
+
import { c as buildBundleDepositInstructionsWithVault, i as initNeutralTradeCore, l as buildBundleRequestSwitchInstructionWithVault, n as buildRequestWithdrawInstructionForVaultId, r as getBundleProgramForVault, t as buildDepositInstructionsForVaultId, u as buildBundleRequestWithdrawInstructionWithVault } from "./neutral-trade-core-CWk75xRT.mjs";
|
|
2
2
|
|
|
3
3
|
export { buildBundleDepositInstructionsWithVault, buildBundleRequestSwitchInstructionWithVault, buildBundleRequestWithdrawInstructionWithVault, buildDepositInstructionsForVaultId, buildRequestWithdrawInstructionForVaultId, getBundleProgramForVault, initNeutralTradeCore };
|
|
@@ -4021,7 +4021,8 @@ declare function buildBundleRequestWithdrawInstructionWithVault({
|
|
|
4021
4021
|
amountRaw
|
|
4022
4022
|
}: BuildBundleRequestWithdrawInstructionCoreParams): Promise<TransactionInstruction>;
|
|
4023
4023
|
/**
|
|
4024
|
-
* `
|
|
4024
|
+
* `initializeBundleDepositor` on target (when missing) + `requestBundleSwitch`.
|
|
4025
|
+
* Fetches source bundle, oracle, user bundle, and target bundle internally.
|
|
4025
4026
|
* @internal
|
|
4026
4027
|
*/
|
|
4027
4028
|
declare function buildBundleRequestSwitchInstructionWithVault({
|
|
@@ -4031,7 +4032,7 @@ declare function buildBundleRequestSwitchInstructionWithVault({
|
|
|
4031
4032
|
targetVault,
|
|
4032
4033
|
user,
|
|
4033
4034
|
amountRaw
|
|
4034
|
-
}: BuildBundleRequestSwitchInstructionCoreParams): Promise<TransactionInstruction>;
|
|
4035
|
+
}: BuildBundleRequestSwitchInstructionCoreParams): Promise<TransactionInstruction[]>;
|
|
4035
4036
|
//#endregion
|
|
4036
4037
|
//#region src/neutral-trade-core.d.ts
|
|
4037
4038
|
interface NeutralTradeCoreContext {
|
|
@@ -13037,25 +13037,88 @@ function createBundleProgramById(provider, programId) {
|
|
|
13037
13037
|
|
|
13038
13038
|
//#endregion
|
|
13039
13039
|
//#region src/registry/vaults.devnet.json
|
|
13040
|
-
var vaults_devnet_default = [
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13040
|
+
var vaults_devnet_default = [
|
|
13041
|
+
{
|
|
13042
|
+
"vaultId": 100000002,
|
|
13043
|
+
"name": "bundle-1",
|
|
13044
|
+
"type": "Bundle",
|
|
13045
|
+
"category": "Market Neutral",
|
|
13046
|
+
"vaultAddress": "HXvKAH4QyYMe7MsxC88pb19MhhYCEDHai87E8tZkmXmB",
|
|
13047
|
+
"depositToken": "USDC",
|
|
13048
|
+
"pointsMultiplier": 1,
|
|
13049
|
+
"pointsEnabled": true
|
|
13050
|
+
},
|
|
13051
|
+
{
|
|
13052
|
+
"vaultId": 100000003,
|
|
13053
|
+
"name": "bundle-2",
|
|
13054
|
+
"type": "Bundle",
|
|
13055
|
+
"category": "Market Neutral",
|
|
13056
|
+
"vaultAddress": "6nRRXv7GzreuE1PUgHySf9u6wwzXq61eiQbBpik1fbjy",
|
|
13057
|
+
"depositToken": "USDC",
|
|
13058
|
+
"pointsMultiplier": 1,
|
|
13059
|
+
"pointsEnabled": true
|
|
13060
|
+
},
|
|
13061
|
+
{
|
|
13062
|
+
"vaultId": 100000004,
|
|
13063
|
+
"name": "bundle-4",
|
|
13064
|
+
"type": "Bundle",
|
|
13065
|
+
"category": "Market Neutral",
|
|
13066
|
+
"vaultAddress": "8TqrZmyiWQ3F3WysiBaBQC1Nzj1LDn5AR7JjXBYzFxxQ",
|
|
13067
|
+
"depositToken": "USDC",
|
|
13068
|
+
"pointsMultiplier": 1,
|
|
13069
|
+
"pointsEnabled": true
|
|
13070
|
+
},
|
|
13071
|
+
{
|
|
13072
|
+
"vaultId": 100000005,
|
|
13073
|
+
"name": "bundle-5",
|
|
13074
|
+
"type": "Bundle",
|
|
13075
|
+
"category": "Market Neutral",
|
|
13076
|
+
"vaultAddress": "J17FgERPmZ9JQNjpaCKb3ZsYseeyrpw3PXFPUrK7zLVa",
|
|
13077
|
+
"depositToken": "USDC",
|
|
13078
|
+
"pointsMultiplier": 1,
|
|
13079
|
+
"pointsEnabled": true
|
|
13080
|
+
},
|
|
13081
|
+
{
|
|
13082
|
+
"vaultId": 100000006,
|
|
13083
|
+
"name": "bundle-6",
|
|
13084
|
+
"type": "Bundle",
|
|
13085
|
+
"category": "Market Neutral",
|
|
13086
|
+
"vaultAddress": "3VUBZk5V1KiPBdAj1Zkrnm3w8zriAg8UJ8Z155Ja8xdS",
|
|
13087
|
+
"depositToken": "USDC",
|
|
13088
|
+
"pointsMultiplier": 1,
|
|
13089
|
+
"pointsEnabled": true
|
|
13090
|
+
},
|
|
13091
|
+
{
|
|
13092
|
+
"vaultId": 100000007,
|
|
13093
|
+
"name": "bundle-7",
|
|
13094
|
+
"type": "Bundle",
|
|
13095
|
+
"category": "Market Neutral",
|
|
13096
|
+
"vaultAddress": "C2SGzvgoZu754yVNEL8ChAyxePo54CPpuyY3qMkmBSJA",
|
|
13097
|
+
"depositToken": "USDC",
|
|
13098
|
+
"pointsMultiplier": 1,
|
|
13099
|
+
"pointsEnabled": true
|
|
13100
|
+
},
|
|
13101
|
+
{
|
|
13102
|
+
"vaultId": 100000008,
|
|
13103
|
+
"name": "bundle-8",
|
|
13104
|
+
"type": "Bundle",
|
|
13105
|
+
"category": "Directional",
|
|
13106
|
+
"vaultAddress": "H3jCQZWkMD3tPjLyzJiVq4unjX45YcN7J45zVPQXaegy",
|
|
13107
|
+
"depositToken": "USDC",
|
|
13108
|
+
"pointsMultiplier": 1,
|
|
13109
|
+
"pointsEnabled": true
|
|
13110
|
+
},
|
|
13111
|
+
{
|
|
13112
|
+
"vaultId": 100000009,
|
|
13113
|
+
"name": "bundle-9",
|
|
13114
|
+
"type": "Bundle",
|
|
13115
|
+
"category": "Directional",
|
|
13116
|
+
"vaultAddress": "4kdm7AHWVfXUDE4qErojXDdLGnU7taZN7rcJ11uaLkH1",
|
|
13117
|
+
"depositToken": "USDC",
|
|
13118
|
+
"pointsMultiplier": 1,
|
|
13119
|
+
"pointsEnabled": true
|
|
13120
|
+
}
|
|
13121
|
+
];
|
|
13059
13122
|
|
|
13060
13123
|
//#endregion
|
|
13061
13124
|
//#region src/registry/vaults.json
|
|
@@ -14309,7 +14372,8 @@ function assertSwitchVaultPair(sourceVault, targetVault, bundleCluster) {
|
|
|
14309
14372
|
if (bundleProgramIdForVault(sourceVault, bundleCluster) !== bundleProgramIdForVault(targetVault, bundleCluster)) throw new Error("Source and target vault must use the same bundle program");
|
|
14310
14373
|
}
|
|
14311
14374
|
/**
|
|
14312
|
-
* `
|
|
14375
|
+
* `initializeBundleDepositor` on target (when missing) + `requestBundleSwitch`.
|
|
14376
|
+
* Fetches source bundle, oracle, user bundle, and target bundle internally.
|
|
14313
14377
|
* @internal
|
|
14314
14378
|
*/
|
|
14315
14379
|
async function buildBundleRequestSwitchInstructionWithVault({ bundleProgram, bundleCluster = "mainnet", sourceVault, targetVault, user, amountRaw }) {
|
|
@@ -14323,6 +14387,7 @@ async function buildBundleRequestSwitchInstructionWithVault({ bundleProgram, bun
|
|
|
14323
14387
|
const userPDA = deriveUserPDA(user, sourceBundlePDA, programPk);
|
|
14324
14388
|
const tempDataPDA = deriveTempDataPDA(sourceBundlePDA, programPk);
|
|
14325
14389
|
const targetUserPDA = deriveUserPDA(user, targetBundlePDA, programPk);
|
|
14390
|
+
const needsTargetInit = !(await bundleProgram.provider.connection.getAccountInfo(targetUserPDA))?.data?.length;
|
|
14326
14391
|
const [sourceBundleAccount, oracleData, userBundle, targetBundleAccount] = await Promise.all([
|
|
14327
14392
|
bundleProgram.account.bundle.fetch(sourceBundlePDA),
|
|
14328
14393
|
bundleProgram.account.oracleData.fetch(oraclePDA),
|
|
@@ -14338,7 +14403,18 @@ async function buildBundleRequestSwitchInstructionWithVault({ bundleProgram, bun
|
|
|
14338
14403
|
totalEquity,
|
|
14339
14404
|
totalShares
|
|
14340
14405
|
});
|
|
14341
|
-
|
|
14406
|
+
const instructions$2 = [];
|
|
14407
|
+
if (needsTargetInit) {
|
|
14408
|
+
const initIx = await bundleProgram.methods.initializeBundleDepositor().accounts({
|
|
14409
|
+
payer: user,
|
|
14410
|
+
authority: user,
|
|
14411
|
+
systemProgram: SystemProgram.programId,
|
|
14412
|
+
bundleAccount: targetBundlePDA,
|
|
14413
|
+
userBundleAccount: targetUserPDA
|
|
14414
|
+
}).instruction();
|
|
14415
|
+
instructions$2.push(initIx);
|
|
14416
|
+
}
|
|
14417
|
+
const switchIx = await bundleProgram.methods.requestBundleSwitch(sharesAmount).accounts({
|
|
14342
14418
|
withdrawalRequest: {
|
|
14343
14419
|
user,
|
|
14344
14420
|
userBundleAccount: userPDA,
|
|
@@ -14352,6 +14428,8 @@ async function buildBundleRequestSwitchInstructionWithVault({ bundleProgram, bun
|
|
|
14352
14428
|
targetBundleAccount: targetBundlePDA,
|
|
14353
14429
|
targetUserBundleAccount: targetUserPDA
|
|
14354
14430
|
}).instruction();
|
|
14431
|
+
instructions$2.push(switchIx);
|
|
14432
|
+
return instructions$2;
|
|
14355
14433
|
}
|
|
14356
14434
|
|
|
14357
14435
|
//#endregion
|
|
@@ -14395,7 +14473,8 @@ async function buildBundleRequestWithdrawInstruction({ connection, bundleCluster
|
|
|
14395
14473
|
});
|
|
14396
14474
|
}
|
|
14397
14475
|
/**
|
|
14398
|
-
* `
|
|
14476
|
+
* `initializeBundleDepositor` on target (when needed) + `requestBundleSwitch`
|
|
14477
|
+
* for built-in registry vaults (source → target, same deposit token).
|
|
14399
14478
|
*/
|
|
14400
14479
|
async function buildBundleRequestSwitchInstruction({ connection, bundleCluster = "mainnet", sourceVaultId, targetVaultId, user, amountRaw }) {
|
|
14401
14480
|
const { vault: sourceVault, programId } = resolveTrustedBundleVault(sourceVaultId, bundleCluster);
|