@0dotxyz/p0-ts-sdk 2.7.0-alpha.0 → 2.7.0-alpha.1
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 +26 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +25 -5
- package/dist/index.js.map +1 -1
- package/dist/instructions.cjs +22 -4
- package/dist/instructions.cjs.map +1 -1
- package/dist/instructions.js +22 -4
- package/dist/instructions.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21345,6 +21345,20 @@ var TransactionArenaKeyMap = {
|
|
|
21345
21345
|
["CLOSE_POSITION" /* CLOSE_POSITION */]: new web3_js.PublicKey("ArenaC1ose111111111111111111111111111111111")
|
|
21346
21346
|
// Add more mappings if needed
|
|
21347
21347
|
};
|
|
21348
|
+
|
|
21349
|
+
// src/dialect.ts
|
|
21350
|
+
var NOT_YET_SCHEDULED = Number.MAX_SAFE_INTEGER;
|
|
21351
|
+
var MARGINFI_V0_1_10_ACTIVATION = {
|
|
21352
|
+
// mainnet — 0.1.9 until the protocol flips the switch
|
|
21353
|
+
MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA: NOT_YET_SCHEDULED,
|
|
21354
|
+
// staging — running 0.1.10 since 2026-08-03
|
|
21355
|
+
stag8sTKds2h4KzjUw3zKTsxbqvT4XKHdaR9X9E6Rct: 0
|
|
21356
|
+
};
|
|
21357
|
+
function isMarginfiV0110Live(programId, atUnixSeconds = Math.floor(Date.now() / 1e3)) {
|
|
21358
|
+
return atUnixSeconds >= (MARGINFI_V0_1_10_ACTIVATION[programId.toBase58()] ?? 0);
|
|
21359
|
+
}
|
|
21360
|
+
|
|
21361
|
+
// src/instructions.ts
|
|
21348
21362
|
async function makeInitMarginfiAccountIx(mfProgram, accounts) {
|
|
21349
21363
|
return mfProgram.methods.marginfiAccountInitialize().accounts(accounts).instruction();
|
|
21350
21364
|
}
|
|
@@ -21561,11 +21575,13 @@ function makeBeginFlashLoanIx(mfiProgram, accounts, args) {
|
|
|
21561
21575
|
marginfiAccount
|
|
21562
21576
|
}).accountsPartial(optionalAccounts).instruction();
|
|
21563
21577
|
}
|
|
21564
|
-
function makeEndFlashLoanIx(mfiProgram, accounts, remainingAccounts = []) {
|
|
21578
|
+
async function makeEndFlashLoanIx(mfiProgram, accounts, remainingAccounts = []) {
|
|
21565
21579
|
const { marginfiAccount, ...optionalAccounts } = accounts;
|
|
21566
|
-
|
|
21580
|
+
const ix = await mfiProgram.methods.lendingAccountEndFlashloan().accounts({
|
|
21567
21581
|
marginfiAccount
|
|
21568
21582
|
}).accountsPartial(optionalAccounts).remainingAccounts(remainingAccounts).instruction();
|
|
21583
|
+
if (!isMarginfiV0110Live(mfiProgram.programId)) ix.keys.splice(1, 1);
|
|
21584
|
+
return ix;
|
|
21569
21585
|
}
|
|
21570
21586
|
async function makeAccountTransferToNewAccountIx(mfProgram, accounts) {
|
|
21571
21587
|
const {
|
|
@@ -21576,13 +21592,15 @@ async function makeAccountTransferToNewAccountIx(mfProgram, accounts) {
|
|
|
21576
21592
|
feePayer,
|
|
21577
21593
|
...optionalAccounts
|
|
21578
21594
|
} = accounts;
|
|
21579
|
-
|
|
21595
|
+
const ix = await mfProgram.methods.transferToNewAccount().accounts({
|
|
21580
21596
|
oldMarginfiAccount,
|
|
21581
21597
|
newMarginfiAccount,
|
|
21582
21598
|
newAuthority,
|
|
21583
21599
|
globalFeeWallet,
|
|
21584
21600
|
feePayer
|
|
21585
21601
|
}).accountsPartial(optionalAccounts).instruction();
|
|
21602
|
+
if (!isMarginfiV0110Live(mfProgram.programId)) ix.keys.splice(7, 1);
|
|
21603
|
+
return ix;
|
|
21586
21604
|
}
|
|
21587
21605
|
async function makeGroupInitIx(mfProgram, accounts) {
|
|
21588
21606
|
return mfProgram.methods.marginfiGroupInitialize().accounts({
|
|
@@ -21641,9 +21659,11 @@ async function makeCloseAccountIx(mfProgram, accounts) {
|
|
|
21641
21659
|
}).accountsPartial(optionalAccounts).instruction();
|
|
21642
21660
|
}
|
|
21643
21661
|
async function makePulseHealthIx(mfProgram, accounts, remainingAccounts = []) {
|
|
21644
|
-
|
|
21662
|
+
const ix = await mfProgram.methods.lendingAccountPulseHealth().accounts({
|
|
21645
21663
|
marginfiAccount: accounts.marginfiAccount
|
|
21646
21664
|
}).remainingAccounts(remainingAccounts).instruction();
|
|
21665
|
+
if (!isMarginfiV0110Live(mfProgram.programId)) ix.keys.splice(1, 1);
|
|
21666
|
+
return ix;
|
|
21647
21667
|
}
|
|
21648
21668
|
var instructions = {
|
|
21649
21669
|
makeDepositIx,
|
|
@@ -83062,6 +83082,7 @@ exports.MARGINFI_PROGRAM = MARGINFI_PROGRAM;
|
|
|
83062
83082
|
exports.MARGINFI_PROGRAM_STAGING = MARGINFI_PROGRAM_STAGING;
|
|
83063
83083
|
exports.MARGINFI_PROGRAM_STAGING_ALT = MARGINFI_PROGRAM_STAGING_ALT;
|
|
83064
83084
|
exports.MARGINFI_SPONSORED_SHARD_ID = MARGINFI_SPONSORED_SHARD_ID;
|
|
83085
|
+
exports.MARGINFI_V0_1_10_ACTIVATION = MARGINFI_V0_1_10_ACTIVATION;
|
|
83065
83086
|
exports.MAX_ACCOUNT_LOCKS = MAX_ACCOUNT_LOCKS;
|
|
83066
83087
|
exports.MAX_CONFIDENCE_INTERVAL_RATIO = MAX_CONFIDENCE_INTERVAL_RATIO;
|
|
83067
83088
|
exports.MAX_TX_SIZE = MAX_TX_SIZE;
|
|
@@ -83325,6 +83346,7 @@ exports.isDecomposableSwapError = isDecomposableSwapError;
|
|
|
83325
83346
|
exports.isDepositIx = isDepositIx;
|
|
83326
83347
|
exports.isFlashloan = isFlashloan;
|
|
83327
83348
|
exports.isGroupRateLimiterEnabled = isGroupRateLimiterEnabled;
|
|
83349
|
+
exports.isMarginfiV0110Live = isMarginfiV0110Live;
|
|
83328
83350
|
exports.isStandardBorrowable = isStandardBorrowable;
|
|
83329
83351
|
exports.isStandardDepositable = isStandardDepositable;
|
|
83330
83352
|
exports.isV0Tx = isV0Tx;
|