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