@0dotxyz/p0-ts-sdk 2.2.0-alpha.2 → 2.2.0-alpha.4
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 +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +4 -0
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.js +4 -0
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -7
package/dist/index.d.cts
CHANGED
|
@@ -15737,6 +15737,12 @@ interface MakeBorrowIxOpts {
|
|
|
15737
15737
|
group?: PublicKey;
|
|
15738
15738
|
authority?: PublicKey;
|
|
15739
15739
|
};
|
|
15740
|
+
/**
|
|
15741
|
+
* Additional banks to include in the health check calculation.
|
|
15742
|
+
* Useful for combined operations where a deposit precedes the borrow
|
|
15743
|
+
* and the deposited bank needs to be considered for health calculation.
|
|
15744
|
+
*/
|
|
15745
|
+
additionalHealthCheckBanks?: PublicKey[];
|
|
15740
15746
|
}
|
|
15741
15747
|
interface MakeBorrowIxParams {
|
|
15742
15748
|
program: MarginfiProgram;
|
package/dist/index.d.ts
CHANGED
|
@@ -15737,6 +15737,12 @@ interface MakeBorrowIxOpts {
|
|
|
15737
15737
|
group?: PublicKey;
|
|
15738
15738
|
authority?: PublicKey;
|
|
15739
15739
|
};
|
|
15740
|
+
/**
|
|
15741
|
+
* Additional banks to include in the health check calculation.
|
|
15742
|
+
* Useful for combined operations where a deposit precedes the borrow
|
|
15743
|
+
* and the deposited bank needs to be considered for health calculation.
|
|
15744
|
+
*/
|
|
15745
|
+
additionalHealthCheckBanks?: PublicKey[];
|
|
15740
15746
|
}
|
|
15741
15747
|
interface MakeBorrowIxParams {
|
|
15742
15748
|
program: MarginfiProgram;
|
package/dist/index.js
CHANGED
|
@@ -43313,6 +43313,7 @@ var SinglePoolInstruction = {
|
|
|
43313
43313
|
},
|
|
43314
43314
|
depositStake: async (pool, userStakeAccount, userTokenAccount, userLamportAccount) => {
|
|
43315
43315
|
const stake = findPoolStakeAddress(pool);
|
|
43316
|
+
const onRamp = findPoolOnRampAddress(pool);
|
|
43316
43317
|
const mint = findPoolMintAddress(pool);
|
|
43317
43318
|
const stakeAuthority = findPoolStakeAuthorityAddress(pool);
|
|
43318
43319
|
const mintAuthority = findPoolMintAuthorityAddress(pool);
|
|
@@ -43321,6 +43322,7 @@ var SinglePoolInstruction = {
|
|
|
43321
43322
|
[
|
|
43322
43323
|
{ pubkey: pool, isSigner: false, isWritable: false },
|
|
43323
43324
|
{ pubkey: stake, isSigner: false, isWritable: true },
|
|
43325
|
+
{ pubkey: onRamp, isSigner: false, isWritable: false },
|
|
43324
43326
|
{ pubkey: mint, isSigner: false, isWritable: true },
|
|
43325
43327
|
{ pubkey: stakeAuthority, isSigner: false, isWritable: false },
|
|
43326
43328
|
{ pubkey: mintAuthority, isSigner: false, isWritable: false },
|
|
@@ -43337,6 +43339,7 @@ var SinglePoolInstruction = {
|
|
|
43337
43339
|
},
|
|
43338
43340
|
withdrawStake: async (pool, userStakeAccount, userStakeAuthority, userTokenAccount, tokenAmount) => {
|
|
43339
43341
|
const stake = findPoolStakeAddress(pool);
|
|
43342
|
+
const onRamp = findPoolOnRampAddress(pool);
|
|
43340
43343
|
const mint = findPoolMintAddress(pool);
|
|
43341
43344
|
const stakeAuthority = findPoolStakeAuthorityAddress(pool);
|
|
43342
43345
|
const mintAuthority = findPoolMintAuthorityAddress(pool);
|
|
@@ -43351,6 +43354,7 @@ var SinglePoolInstruction = {
|
|
|
43351
43354
|
[
|
|
43352
43355
|
{ pubkey: pool, isSigner: false, isWritable: false },
|
|
43353
43356
|
{ pubkey: stake, isSigner: false, isWritable: true },
|
|
43357
|
+
{ pubkey: onRamp, isSigner: false, isWritable: false },
|
|
43354
43358
|
{ pubkey: mint, isSigner: false, isWritable: true },
|
|
43355
43359
|
{ pubkey: stakeAuthority, isSigner: false, isWritable: false },
|
|
43356
43360
|
{ pubkey: mintAuthority, isSigner: false, isWritable: false },
|
|
@@ -45914,10 +45918,11 @@ async function makeBorrowIx3({
|
|
|
45914
45918
|
);
|
|
45915
45919
|
borrowIxs.push(createAtaIdempotentIx);
|
|
45916
45920
|
}
|
|
45921
|
+
const mandatoryBanks = [bank.address, ...opts.additionalHealthCheckBanks ?? []];
|
|
45917
45922
|
const healthAccounts = computeHealthCheckAccounts(
|
|
45918
45923
|
marginfiAccount.balances,
|
|
45919
45924
|
bankMap,
|
|
45920
|
-
|
|
45925
|
+
mandatoryBanks,
|
|
45921
45926
|
[]
|
|
45922
45927
|
);
|
|
45923
45928
|
const remainingAccounts = [];
|