@0dotxyz/p0-ts-sdk 2.10.0-alpha.0 → 2.10.0
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/{dto-farm.types-BAA9xrey.d.cts → dto-farm.types-6lrPBcZr.d.cts} +4 -0
- package/dist/{dto-farm.types-BAA9xrey.d.ts → dto-farm.types-6lrPBcZr.d.ts} +4 -0
- package/dist/index.cjs +1035 -626
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +508 -37
- package/dist/index.d.ts +508 -37
- package/dist/index.js +1008 -625
- package/dist/index.js.map +1 -1
- package/dist/instructions.cjs +27 -2
- package/dist/instructions.cjs.map +1 -1
- package/dist/instructions.d.cts +67 -11
- package/dist/instructions.d.ts +67 -11
- package/dist/instructions.js +27 -2
- package/dist/instructions.js.map +1 -1
- package/dist/{types-Cj6aaTuh.d.ts → types--m9sTr2x.d.ts} +60 -4
- package/dist/{types-SQxOiZGm.d.cts → types-DQD0k0pr.d.cts} +60 -4
- package/dist/vendor.cjs +2 -0
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +2 -2
- package/dist/vendor.d.ts +2 -2
- package/dist/vendor.js +2 -0
- package/dist/vendor.js.map +1 -1
- package/package.json +2 -1
package/dist/instructions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vendor/spl/constants.ts","../src/instructions.ts"],"names":[],"mappings":";;;;AAE0C,IAAI,SAAA;AAAA,EAC5C;AACF;AAGsD,IAAI,SAAA;AAAA,EACxD;AACF;AAEO,IAAM,gBAAA,GAAmB,IAAI,SAAA,CAAU,6CAA6C,CAAA;AACtD,IAAI,SAAA,CAAU,6CAA6C;;;ACLhG,eAAe,yBAAA,CACb,WACA,QAAA,EAMA;AACA,EAAA,OAAO,UAAU,OAAA,CAAQ,yBAAA,GAA4B,QAAA,CAAS,QAAQ,EAAE,WAAA,EAAY;AACtF;AAEA,eAAe,4BAAA,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ACA,mBAAA;AAAA,EACA,oBAAA;AAAA,EACA,YAAA;AAAA,EACA,yBAAA;AAAA,EACA,4BAAA;AAAA,EACA,6BAAA;AAAA,EACA,iBAAA;AAAA,EACA,uBAAA;AAAA,EACA,oBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iCAAA;AAAA,EACA,eAAA;AAAA,EACA,kBAAA;AAAA,EACA,qCAAA;AAAA,EACA,oCAAA;AAAA,EACA,yCAAA;AAAA,EACA,+BAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAO,oBAAA,GAAQ","file":"instructions.js","sourcesContent":["import { PublicKey } from \"@solana/web3.js\";\n\nexport const MEMO_PROGRAM_ID: PublicKey = new PublicKey(\n \"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr\"\n);\n\n/** Address of the SPL Associated Token Account program */\nexport const ASSOCIATED_TOKEN_PROGRAM_ID: PublicKey = new PublicKey(\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\"\n);\n\nexport const TOKEN_PROGRAM_ID = new PublicKey(\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\");\nexport const TOKEN_2022_PROGRAM_ID = new PublicKey(\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\");\n","import { AccountMeta, PublicKey } from \"@solana/web3.js\";\nimport BN from \"bn.js\";\n\nimport type { BankConfigCompactRaw, BankConfigOptRaw } from \"./services\";\nimport { MarginfiProgram, WrappedI80F48 } from \"./types\";\nimport { TOKEN_PROGRAM_ID } from \"./vendor/spl\";\n\nasync function makeInitMarginfiAccountIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiGroup: PublicKey;\n marginfiAccount: PublicKey;\n authority: PublicKey;\n feePayer: PublicKey;\n }\n) {\n return mfProgram.methods.marginfiAccountInitialize().accounts(accounts).instruction();\n}\n\nasync function makeInitMarginfiAccountPdaIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiGroup: PublicKey;\n marginfiAccount: PublicKey;\n authority: PublicKey;\n feePayer: PublicKey;\n },\n args: {\n accountIndex: number;\n thirdPartyId?: number;\n }\n) {\n return mfProgram.methods\n .marginfiAccountInitializePda(args.accountIndex, args.thirdPartyId ?? null)\n .accountsPartial({\n marginfiGroup: accounts.marginfiGroup,\n marginfiAccount: accounts.marginfiAccount,\n authority: accounts.authority,\n feePayer: accounts.feePayer,\n })\n .instruction();\n}\n\nasync function makeJuplendDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n signerTokenAccount: PublicKey;\n\n lendingAdmin: PublicKey;\n supplyTokenReservesLiquidity: PublicKey;\n lendingSupplyPositionOnLiquidity: PublicKey;\n rateModel: PublicKey;\n vault: PublicKey;\n liquidity: PublicKey;\n liquidityProgram: PublicKey;\n rewardsRateModel: PublicKey;\n tokenProgram: PublicKey;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n fTokenMint?: PublicKey;\n integrationAcc1?: PublicKey;\n integrationAcc2?: PublicKey;\n mint?: PublicKey;\n },\n args: {\n amount: BN;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n signerTokenAccount,\n lendingAdmin,\n supplyTokenReservesLiquidity,\n lendingSupplyPositionOnLiquidity,\n rateModel,\n vault,\n liquidity,\n liquidityProgram,\n rewardsRateModel,\n tokenProgram,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .juplendDeposit(args.amount)\n .accounts(accounts)\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeJuplendWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n lendingAdmin: PublicKey;\n supplyTokenReservesLiquidity: PublicKey;\n lendingSupplyPositionOnLiquidity: PublicKey;\n rateModel: PublicKey;\n vault: PublicKey;\n claimAccount: PublicKey;\n liquidity: PublicKey;\n liquidityProgram: PublicKey;\n rewardsRateModel: PublicKey;\n tokenProgram: PublicKey;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n mint?: PublicKey;\n integrationAcc1?: PublicKey;\n fTokenMint?: PublicKey;\n integrationAcc2?: PublicKey;\n integrationAcc3?: PublicKey;\n },\n args: {\n amount: BN;\n withdrawAll?: boolean | null;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n destinationTokenAccount,\n lendingAdmin,\n supplyTokenReservesLiquidity,\n lendingSupplyPositionOnLiquidity,\n rateModel,\n vault,\n claimAccount,\n liquidity,\n liquidityProgram,\n rewardsRateModel,\n tokenProgram,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .juplendWithdraw(args.amount, args.withdrawAll ?? null)\n .accounts(accounts)\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeKaminoDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n signerTokenAccount: PublicKey;\n lendingMarket: PublicKey;\n\n lendingMarketAuthority: PublicKey;\n reserveLiquiditySupply: PublicKey;\n reserveCollateralMint: PublicKey;\n reserveDestinationDepositCollateral: PublicKey;\n liquidityTokenProgram: PublicKey;\n\n obligationFarmUserState: PublicKey | null;\n reserveFarmState: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n integrationAcc1?: PublicKey;\n integrationAcc2?: PublicKey;\n mint?: PublicKey;\n },\n args: {\n amount: BN;\n /** 0.1.9-only: refresh the reserve in-instruction. Ignored by the 1.8 program. */\n refreshReserve?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n signerTokenAccount,\n lendingMarket,\n lendingMarketAuthority,\n reserveLiquiditySupply,\n reserveCollateralMint,\n reserveDestinationDepositCollateral,\n liquidityTokenProgram,\n obligationFarmUserState,\n reserveFarmState,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .kaminoDeposit(args.amount, args.refreshReserve ?? null)\n .accounts(accounts)\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Create a Drift deposit instruction\n * Deposits tokens into a Drift spot market through a marginfi bank account\n *\n * @param mfProgram - The marginfi program instance\n * @param accounts - Required and optional accounts for the instruction\n * @param accounts.marginfiAccount - The marginfi account depositing funds\n * @param accounts.bank - The marginfi bank account for the asset\n * @param accounts.signerTokenAccount - The signer's token account (source of funds)\n * @param accounts.driftState - The Drift program state account\n * @param accounts.driftSpotMarketVault - The Drift spot market vault receiving tokens\n * @param accounts.tokenProgram - The SPL token program\n * @param accounts.driftOracle - (Optional) Oracle account for the asset\n * @param args - Instruction arguments\n * @param args.amount - Amount to deposit in native token decimals\n */\nasync function makeDriftDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n signerTokenAccount: PublicKey;\n driftState: PublicKey;\n driftSpotMarketVault: PublicKey;\n tokenProgram: PublicKey;\n driftOracle: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n integrationAcc2?: PublicKey;\n integrationAcc3?: PublicKey;\n integrationAcc1?: PublicKey;\n mint?: PublicKey;\n driftProgram?: PublicKey;\n systemProgram?: PublicKey;\n },\n args: {\n amount: BN;\n }\n) {\n const {\n marginfiAccount,\n bank,\n signerTokenAccount,\n driftState,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .driftDeposit(args.amount)\n .accounts({\n marginfiAccount,\n bank,\n signerTokenAccount,\n driftState,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n signerTokenAccount: PublicKey;\n bank: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n },\n args: {\n amount: BN;\n depositUpToLimit?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, signerTokenAccount, bank, tokenProgram, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingAccountDeposit(args.amount, args.depositUpToLimit ?? null)\n .accounts({\n marginfiAccount,\n signerTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeRepayIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n signerTokenAccount: PublicKey;\n bank: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n },\n args: {\n amount: BN;\n repayAll?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, signerTokenAccount, bank, tokenProgram, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingAccountRepay(args.amount, args.repayAll ?? null)\n .accounts({\n marginfiAccount,\n signerTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeDriftWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n\n driftState: PublicKey;\n driftSigner: PublicKey;\n driftSpotMarketVault: PublicKey;\n tokenProgram: PublicKey;\n\n driftOracle: PublicKey | null;\n driftRewardOracle: PublicKey | null;\n driftRewardSpotMarket: PublicKey | null;\n driftRewardMint: PublicKey | null;\n driftRewardOracle2: PublicKey | null;\n driftRewardSpotMarket2: PublicKey | null;\n driftRewardMint2: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n withdrawAll: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n destinationTokenAccount,\n driftState,\n driftSigner,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n driftRewardOracle,\n driftRewardSpotMarket,\n driftRewardMint,\n driftRewardOracle2,\n driftRewardSpotMarket2,\n driftRewardMint2,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .driftWithdraw(args.amount, args.withdrawAll)\n .accounts({\n marginfiAccount,\n bank,\n destinationTokenAccount,\n driftState,\n driftSigner,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n driftRewardOracle,\n driftRewardSpotMarket,\n driftRewardMint,\n driftRewardOracle2,\n driftRewardSpotMarket2,\n driftRewardMint2,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeKaminoWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n lendingMarket: PublicKey;\n mint: PublicKey;\n\n lendingMarketAuthority: PublicKey;\n reserveLiquiditySupply: PublicKey;\n reserveCollateralMint: PublicKey;\n reserveSourceCollateral: PublicKey;\n liquidityTokenProgram: PublicKey;\n\n obligationFarmUserState: PublicKey | null;\n reserveFarmState: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n isFinalWithdrawal: boolean;\n /**\n * 0.1.9-only: refresh the reserve via batch refresh (flags bit 1). Do NOT set while the\n * 1.8 program is deployed — its `Option<bool>` decoder rejects flag bytes above 1.\n */\n refreshReserve?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n destinationTokenAccount,\n lendingMarket,\n lendingMarketAuthority,\n reserveLiquiditySupply,\n reserveCollateralMint,\n reserveSourceCollateral,\n liquidityTokenProgram,\n obligationFarmUserState,\n reserveFarmState,\n ...optionalAccounts\n } = accounts;\n\n // flags bit 0 = withdraw all, bit 1 = batch refresh. `isFinalWithdrawal ? 1 : null` is\n // byte-identical to the pre-0.1.9 `withdrawAll: Option<bool>` encoding, so it lands on\n // both the 1.8 and 1.9 programs.\n const flags = (args.isFinalWithdrawal ? 1 : 0) | (args.refreshReserve ? 2 : 0);\n\n return mfProgram.methods\n .kaminoWithdraw(args.amount, flags === 0 ? null : flags)\n .accounts({\n marginfiAccount,\n bank,\n destinationTokenAccount,\n lendingMarket,\n lendingMarketAuthority,\n reserveLiquiditySupply,\n reserveCollateralMint,\n reserveSourceCollateral,\n liquidityTokenProgram,\n obligationFarmUserState,\n reserveFarmState,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n withdrawAll?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, bank, destinationTokenAccount, tokenProgram, ...optionalAccounts } =\n accounts;\n\n return mfProgram.methods\n .lendingAccountWithdraw(args.amount, args.withdrawAll ?? null)\n .accounts({\n marginfiAccount,\n destinationTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeBorrowIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, bank, destinationTokenAccount, tokenProgram, ...optionalAccounts } =\n accounts;\n\n return mfProgram.methods\n .lendingAccountBorrow(args.amount)\n .accounts({\n marginfiAccount,\n destinationTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nfunction makeLendingAccountLiquidateIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n assetBank: PublicKey;\n liabBank: PublicKey;\n liquidatorMarginfiAccount: PublicKey;\n liquidateeMarginfiAccount: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n assetAmount: BN;\n liquidateeAccounts: number;\n liquidatorAccounts: number;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n assetBank,\n liabBank,\n liquidatorMarginfiAccount,\n liquidateeMarginfiAccount,\n tokenProgram,\n ...optionalAccounts\n } = accounts;\n\n return mfiProgram.methods\n .lendingAccountLiquidate(args.assetAmount, args.liquidateeAccounts, args.liquidatorAccounts)\n .accounts({\n assetBank,\n liabBank,\n liquidatorMarginfiAccount,\n liquidateeMarginfiAccount,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nfunction makePoolConfigureBankIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n bank: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n admin?: PublicKey;\n },\n args: {\n bankConfigOpt: BankConfigOptRaw;\n }\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfiProgram.methods\n .lendingPoolConfigureBank(args.bankConfigOpt)\n .accounts({\n bank,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nfunction makeBeginFlashLoanIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n // Optional accounts - to override inference\n authority?: PublicKey;\n ixsSysvar?: PublicKey;\n },\n args: {\n endIndex: BN;\n }\n) {\n const { marginfiAccount, ...optionalAccounts } = accounts;\n\n return mfiProgram.methods\n .lendingAccountStartFlashloan(args.endIndex)\n .accounts({\n marginfiAccount,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeEndFlashLoanIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n // Optional accounts - to override inference\n authority?: PublicKey;\n // Pass explicitly when the account isn't on-chain yet (fresh-account flash loans)\n group?: PublicKey;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, ...optionalAccounts } = accounts;\n\n return mfiProgram.methods\n .lendingAccountEndFlashloan()\n .accounts({\n marginfiAccount,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeAccountTransferToNewAccountIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n oldMarginfiAccount: PublicKey;\n newMarginfiAccount: PublicKey;\n newAuthority: PublicKey;\n globalFeeWallet: PublicKey;\n feePayer: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n }\n) {\n const {\n oldMarginfiAccount,\n newMarginfiAccount,\n newAuthority,\n globalFeeWallet,\n feePayer,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .transferToNewAccount()\n .accounts({\n oldMarginfiAccount,\n newMarginfiAccount,\n newAuthority,\n globalFeeWallet,\n feePayer,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeGroupInitIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiGroup: PublicKey;\n admin: PublicKey;\n }\n) {\n return mfProgram.methods\n .marginfiGroupInitialize()\n .accounts({\n marginfiGroup: accounts.marginfiGroup,\n admin: accounts.admin,\n })\n .instruction();\n}\n\n/**\n * Configure the oracle for a bank\n * @param mfProgram The marginfi program\n * @param accounts The accounts required for this instruction\n * @param args The oracle setup index and feed id\n * @param remainingAccounts The remaining accounts required for this instruction, should include the feed oracle key\n */\nasync function makeLendingPoolConfigureBankOracleIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n bank: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n admin?: PublicKey;\n },\n args: {\n /**\n * The oracle setup index, see {@link serializeOracleSetupToIndex}\n */\n setup: number;\n /**\n * The oracle feed id\n */\n feedId: PublicKey;\n },\n /**\n * The remaining accounts required for this instruction, should include the feed oracle key (non writable & signable)\n */\n remainingAccounts: AccountMeta[] = []\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolConfigureBankOracle(args.setup, args.feedId)\n .accounts({\n bank,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Configure a bank to use an entry in a Scope OraclePrices account.\n * @param mfProgram The marginfi program\n * @param accounts The group, admin, and bank accounts required by the instruction\n * @param args The Scope OraclePrices account and its entry index\n */\nasync function makeLendingPoolConfigureBankOracleScopeIx(\n mfProgram: MarginfiProgram,\n accounts: {\n bank: PublicKey;\n group?: PublicKey;\n admin?: PublicKey;\n },\n args: {\n oracle: PublicKey;\n entryIndex: number;\n }\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolConfigureBankOracleScope(args.oracle, args.entryIndex)\n .accounts({ bank })\n .accountsPartial(optionalAccounts)\n .remainingAccounts([{ pubkey: args.oracle, isSigner: false, isWritable: false }])\n .instruction();\n}\n\n/** Configure a fixed or Exponent PT oracle through the 0.1.11 set-oracle-price instruction. */\nasync function makeLendingPoolSetOraclePriceIx(\n mfProgram: MarginfiProgram,\n accounts: {\n bank: PublicKey;\n group?: PublicKey;\n admin?: PublicKey;\n },\n args: {\n price: WrappedI80F48;\n setup: number;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolSetOraclePrice(args.price, args.setup)\n .accounts({ bank })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Creates an instruction to add a permissionless staked bank to a lending pool.\n * @param mfProgram - The marginfi program instance\n * @param accounts - The accounts required for this instruction\n * @param remainingAccounts - The remaining accounts required for this instruction, including pythOracle, solPool and bankMint\n * @param args - Optional arguments for this instruction\n */\nasync function makePoolAddPermissionlessStakedBankIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n stakedSettings: PublicKey;\n feePayer: PublicKey;\n bankMint: PublicKey;\n solPool: PublicKey;\n /** The SVSP on-ramp account, derived from the stake pool (0.1.9+ program only) */\n poolOnramp: PublicKey;\n stakePool: PublicKey;\n /** The validator vote account backing the stake pool (0.1.9+ program only) */\n validatorVoteAccount: PublicKey;\n // Optional accounts - to override inference\n marginfiGroup?: PublicKey;\n /**\n * The token program to use for this instruction, defaults to the SPL token program\n */\n tokenProgram?: PublicKey;\n },\n /**\n * The remaining accounts required for this instruction. Should include:\n * - pythOracle: The pyth oracle key (non writable & non signer)\n * - solPool: The sol pool key (non writable & non signer)\n * - bankMint: The bank mint key (non writable & non signer)\n */\n remainingAccounts: AccountMeta[] = [],\n args: {\n /**\n * The seed to use for the bank account. Defaults to 0 (new BN(0)).\n * If the seed is not specified, the seed is set to 0, and the bank account\n * will be created at the address {@link findPoolAddress} with the default\n * bump.\n */\n seed?: BN;\n }\n) {\n const {\n stakedSettings,\n feePayer,\n bankMint,\n solPool,\n poolOnramp,\n stakePool,\n validatorVoteAccount,\n tokenProgram = TOKEN_PROGRAM_ID,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .lendingPoolAddBankPermissionless(args.seed ?? new BN(0))\n .accounts({\n stakedSettings,\n feePayer,\n bankMint,\n solPool,\n poolOnramp,\n stakePool,\n validatorVoteAccount,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makePoolAddBankIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiGroup: PublicKey;\n feePayer: PublicKey;\n bankMint: PublicKey;\n bank: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n admin?: PublicKey;\n globalFeeWallet?: PublicKey;\n },\n args: {\n bankConfig: BankConfigCompactRaw;\n }\n) {\n const { marginfiGroup, feePayer, bankMint, bank, tokenProgram, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolAddBank({\n ...args.bankConfig,\n configFlags: 0,\n pad0: [0, 0, 0, 0, 0, 0, 0, 0],\n })\n .accounts({\n marginfiGroup,\n feePayer,\n bankMint,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeCloseAccountIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n feePayer: PublicKey;\n // Optional accounts - to override inference\n authority?: PublicKey;\n }\n) {\n const { marginfiAccount, feePayer, ...optionalAccounts } = accounts;\n return mfProgram.methods\n .marginfiAccountClose()\n .accounts({\n marginfiAccount,\n feePayer,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\n// Deprecated\n// async function makeLendingAccountSortBalancesIx(\n// mfProgram: MarginfiProgram,\n// accounts: {\n// marginfiAccount: PublicKey;\n// }\n// ) {\n// return mfProgram.methods\n// .lendingAccountSortBalances()\n// .accounts({\n// marginfiAccount: accounts.marginfiAccount,\n// })\n// .instruction();\n// }\n\nasync function makePulseHealthIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n group: PublicKey;\n },\n /**\n * The remaining accounts required for this instruction. Should include:\n * - For each balance the user has, pass bank and oracle: <bank1, oracle1, bank2, oracle2>\n */\n remainingAccounts: AccountMeta[] = []\n) {\n return mfProgram.methods\n .lendingAccountPulseHealth()\n .accountsPartial({\n marginfiAccount: accounts.marginfiAccount,\n group: accounts.group,\n })\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nconst instructions = {\n makeDepositIx,\n makeJuplendDepositIx,\n makeDriftDepositIx,\n makeKaminoDepositIx,\n makeRepayIx,\n makeWithdrawIx,\n makeJuplendWithdrawIx,\n makeDriftWithdrawIx,\n makeKaminoWithdrawIx,\n makeBorrowIx,\n makeInitMarginfiAccountIx,\n makeInitMarginfiAccountPdaIx,\n makeLendingAccountLiquidateIx,\n makePoolAddBankIx,\n makePoolConfigureBankIx,\n makeBeginFlashLoanIx,\n makeEndFlashLoanIx,\n makeAccountTransferToNewAccountIx,\n makeGroupInitIx,\n makeCloseAccountIx,\n makePoolAddPermissionlessStakedBankIx,\n makeLendingPoolConfigureBankOracleIx,\n makeLendingPoolConfigureBankOracleScopeIx,\n makeLendingPoolSetOraclePriceIx,\n makePulseHealthIx,\n};\n\nexport default instructions;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/vendor/spl/constants.ts","../src/instructions.ts"],"names":[],"mappings":";;;;AAE0C,IAAI,SAAA;AAAA,EAC5C;AACF;AAGsD,IAAI,SAAA;AAAA,EACxD;AACF;AAEO,IAAM,gBAAA,GAAmB,IAAI,SAAA,CAAU,6CAA6C,CAAA;AACtD,IAAI,SAAA,CAAU,6CAA6C;;;ACLhG,eAAe,yBAAA,CACb,WACA,QAAA,EAMA;AACA,EAAA,OAAO,UAAU,OAAA,CAAQ,yBAAA,GAA4B,QAAA,CAAS,QAAQ,EAAE,WAAA,EAAY;AACtF;AAEA,eAAe,4BAAA,CACb,SAAA,EACA,QAAA,EAMA,IAAA,EAIA;AACA,EAAA,OAAO,SAAA,CAAU,QACd,4BAAA,CAA6B,IAAA,CAAK,cAAc,IAAA,CAAK,YAAA,IAAgB,IAAI,CAAA,CACzE,eAAA,CAAgB;AAAA,IACf,eAAe,QAAA,CAA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A,EACA,iBAAA;AAAA,EACA,uBAAA;AAAA,EACA,0BAAA;AAAA,EACA,oBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iCAAA;AAAA,EACA,eAAA;AAAA,EACA,kBAAA;AAAA,EACA,qCAAA;AAAA,EACA,oCAAA;AAAA,EACA,yCAAA;AAAA,EACA,+BAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAO,oBAAA,GAAQ","file":"instructions.js","sourcesContent":["import { PublicKey } from \"@solana/web3.js\";\n\nexport const MEMO_PROGRAM_ID: PublicKey = new PublicKey(\n \"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr\"\n);\n\n/** Address of the SPL Associated Token Account program */\nexport const ASSOCIATED_TOKEN_PROGRAM_ID: PublicKey = new PublicKey(\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\"\n);\n\nexport const TOKEN_PROGRAM_ID = new PublicKey(\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\");\nexport const TOKEN_2022_PROGRAM_ID = new PublicKey(\"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb\");\n","import { AccountMeta, PublicKey } from \"@solana/web3.js\";\nimport BN from \"bn.js\";\n\nimport type { BankConfigCompactRaw, BankConfigFastRaw, BankConfigGovRaw } from \"./services\";\nimport { MarginfiProgram, OrderTrigger, WrappedI80F48 } from \"./types\";\nimport { TOKEN_PROGRAM_ID } from \"./vendor/spl\";\n\nasync function makeInitMarginfiAccountIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiGroup: PublicKey;\n marginfiAccount: PublicKey;\n authority: PublicKey;\n feePayer: PublicKey;\n }\n) {\n return mfProgram.methods.marginfiAccountInitialize().accounts(accounts).instruction();\n}\n\nasync function makeInitMarginfiAccountPdaIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiGroup: PublicKey;\n marginfiAccount: PublicKey;\n authority: PublicKey;\n feePayer: PublicKey;\n },\n args: {\n accountIndex: number;\n thirdPartyId?: number;\n }\n) {\n return mfProgram.methods\n .marginfiAccountInitializePda(args.accountIndex, args.thirdPartyId ?? null)\n .accountsPartial({\n marginfiGroup: accounts.marginfiGroup,\n marginfiAccount: accounts.marginfiAccount,\n authority: accounts.authority,\n feePayer: accounts.feePayer,\n })\n .instruction();\n}\n\nasync function makeJuplendDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n signerTokenAccount: PublicKey;\n\n lendingAdmin: PublicKey;\n supplyTokenReservesLiquidity: PublicKey;\n lendingSupplyPositionOnLiquidity: PublicKey;\n rateModel: PublicKey;\n vault: PublicKey;\n liquidity: PublicKey;\n liquidityProgram: PublicKey;\n rewardsRateModel: PublicKey;\n tokenProgram: PublicKey;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n fTokenMint?: PublicKey;\n integrationAcc1?: PublicKey;\n integrationAcc2?: PublicKey;\n mint?: PublicKey;\n },\n args: {\n amount: BN;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n signerTokenAccount,\n lendingAdmin,\n supplyTokenReservesLiquidity,\n lendingSupplyPositionOnLiquidity,\n rateModel,\n vault,\n liquidity,\n liquidityProgram,\n rewardsRateModel,\n tokenProgram,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .juplendDeposit(args.amount)\n .accounts(accounts)\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeJuplendWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n lendingAdmin: PublicKey;\n supplyTokenReservesLiquidity: PublicKey;\n lendingSupplyPositionOnLiquidity: PublicKey;\n rateModel: PublicKey;\n vault: PublicKey;\n claimAccount: PublicKey;\n liquidity: PublicKey;\n liquidityProgram: PublicKey;\n rewardsRateModel: PublicKey;\n tokenProgram: PublicKey;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n mint?: PublicKey;\n integrationAcc1?: PublicKey;\n fTokenMint?: PublicKey;\n integrationAcc2?: PublicKey;\n integrationAcc3?: PublicKey;\n },\n args: {\n amount: BN;\n withdrawAll?: boolean | null;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n destinationTokenAccount,\n lendingAdmin,\n supplyTokenReservesLiquidity,\n lendingSupplyPositionOnLiquidity,\n rateModel,\n vault,\n claimAccount,\n liquidity,\n liquidityProgram,\n rewardsRateModel,\n tokenProgram,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .juplendWithdraw(args.amount, args.withdrawAll ?? null)\n .accounts(accounts)\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeKaminoDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n signerTokenAccount: PublicKey;\n lendingMarket: PublicKey;\n\n lendingMarketAuthority: PublicKey;\n reserveLiquiditySupply: PublicKey;\n reserveCollateralMint: PublicKey;\n reserveDestinationDepositCollateral: PublicKey;\n liquidityTokenProgram: PublicKey;\n\n obligationFarmUserState: PublicKey | null;\n reserveFarmState: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n integrationAcc1?: PublicKey;\n integrationAcc2?: PublicKey;\n mint?: PublicKey;\n },\n args: {\n amount: BN;\n /** 0.1.9-only: refresh the reserve in-instruction. Ignored by the 1.8 program. */\n refreshReserve?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n signerTokenAccount,\n lendingMarket,\n lendingMarketAuthority,\n reserveLiquiditySupply,\n reserveCollateralMint,\n reserveDestinationDepositCollateral,\n liquidityTokenProgram,\n obligationFarmUserState,\n reserveFarmState,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .kaminoDeposit(args.amount, args.refreshReserve ?? null)\n .accounts(accounts)\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Create a Drift deposit instruction\n * Deposits tokens into a Drift spot market through a marginfi bank account\n *\n * @param mfProgram - The marginfi program instance\n * @param accounts - Required and optional accounts for the instruction\n * @param accounts.marginfiAccount - The marginfi account depositing funds\n * @param accounts.bank - The marginfi bank account for the asset\n * @param accounts.signerTokenAccount - The signer's token account (source of funds)\n * @param accounts.driftState - The Drift program state account\n * @param accounts.driftSpotMarketVault - The Drift spot market vault receiving tokens\n * @param accounts.tokenProgram - The SPL token program\n * @param accounts.driftOracle - (Optional) Oracle account for the asset\n * @param args - Instruction arguments\n * @param args.amount - Amount to deposit in native token decimals\n */\nasync function makeDriftDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n signerTokenAccount: PublicKey;\n driftState: PublicKey;\n driftSpotMarketVault: PublicKey;\n tokenProgram: PublicKey;\n driftOracle: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n integrationAcc2?: PublicKey;\n integrationAcc3?: PublicKey;\n integrationAcc1?: PublicKey;\n mint?: PublicKey;\n driftProgram?: PublicKey;\n systemProgram?: PublicKey;\n },\n args: {\n amount: BN;\n }\n) {\n const {\n marginfiAccount,\n bank,\n signerTokenAccount,\n driftState,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .driftDeposit(args.amount)\n .accounts({\n marginfiAccount,\n bank,\n signerTokenAccount,\n driftState,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeDepositIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n signerTokenAccount: PublicKey;\n bank: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n },\n args: {\n amount: BN;\n depositUpToLimit?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, signerTokenAccount, bank, tokenProgram, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingAccountDeposit(args.amount, args.depositUpToLimit ?? null)\n .accounts({\n marginfiAccount,\n signerTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeRepayIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n signerTokenAccount: PublicKey;\n bank: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n liquidityVault?: PublicKey;\n },\n args: {\n amount: BN;\n repayAll?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, signerTokenAccount, bank, tokenProgram, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingAccountRepay(args.amount, args.repayAll ?? null)\n .accounts({\n marginfiAccount,\n signerTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeDriftWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n\n driftState: PublicKey;\n driftSigner: PublicKey;\n driftSpotMarketVault: PublicKey;\n tokenProgram: PublicKey;\n\n driftOracle: PublicKey | null;\n driftRewardOracle: PublicKey | null;\n driftRewardSpotMarket: PublicKey | null;\n driftRewardMint: PublicKey | null;\n driftRewardOracle2: PublicKey | null;\n driftRewardSpotMarket2: PublicKey | null;\n driftRewardMint2: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n withdrawAll: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n destinationTokenAccount,\n driftState,\n driftSigner,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n driftRewardOracle,\n driftRewardSpotMarket,\n driftRewardMint,\n driftRewardOracle2,\n driftRewardSpotMarket2,\n driftRewardMint2,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .driftWithdraw(args.amount, args.withdrawAll)\n .accounts({\n marginfiAccount,\n bank,\n destinationTokenAccount,\n driftState,\n driftSigner,\n driftSpotMarketVault,\n tokenProgram,\n driftOracle,\n driftRewardOracle,\n driftRewardSpotMarket,\n driftRewardMint,\n driftRewardOracle2,\n driftRewardSpotMarket2,\n driftRewardMint2,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeKaminoWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n lendingMarket: PublicKey;\n mint: PublicKey;\n\n lendingMarketAuthority: PublicKey;\n reserveLiquiditySupply: PublicKey;\n reserveCollateralMint: PublicKey;\n reserveSourceCollateral: PublicKey;\n liquidityTokenProgram: PublicKey;\n\n obligationFarmUserState: PublicKey | null;\n reserveFarmState: PublicKey | null;\n\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n isFinalWithdrawal: boolean;\n /**\n * 0.1.9-only: refresh the reserve via batch refresh (flags bit 1). Do NOT set while the\n * 1.8 program is deployed — its `Option<bool>` decoder rejects flag bytes above 1.\n */\n refreshReserve?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n marginfiAccount,\n bank,\n destinationTokenAccount,\n lendingMarket,\n lendingMarketAuthority,\n reserveLiquiditySupply,\n reserveCollateralMint,\n reserveSourceCollateral,\n liquidityTokenProgram,\n obligationFarmUserState,\n reserveFarmState,\n ...optionalAccounts\n } = accounts;\n\n // flags bit 0 = withdraw all, bit 1 = batch refresh. `isFinalWithdrawal ? 1 : null` is\n // byte-identical to the pre-0.1.9 `withdrawAll: Option<bool>` encoding, so it lands on\n // both the 1.8 and 1.9 programs.\n const flags = (args.isFinalWithdrawal ? 1 : 0) | (args.refreshReserve ? 2 : 0);\n\n return mfProgram.methods\n .kaminoWithdraw(args.amount, flags === 0 ? null : flags)\n .accounts({\n marginfiAccount,\n bank,\n destinationTokenAccount,\n lendingMarket,\n lendingMarketAuthority,\n reserveLiquiditySupply,\n reserveCollateralMint,\n reserveSourceCollateral,\n liquidityTokenProgram,\n obligationFarmUserState,\n reserveFarmState,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeWithdrawIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n withdrawAll?: boolean;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, bank, destinationTokenAccount, tokenProgram, ...optionalAccounts } =\n accounts;\n\n return mfProgram.methods\n .lendingAccountWithdraw(args.amount, args.withdrawAll ?? null)\n .accounts({\n marginfiAccount,\n destinationTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeBorrowIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n bank: PublicKey;\n destinationTokenAccount: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n amount: BN;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, bank, destinationTokenAccount, tokenProgram, ...optionalAccounts } =\n accounts;\n\n return mfProgram.methods\n .lendingAccountBorrow(args.amount)\n .accounts({\n marginfiAccount,\n destinationTokenAccount,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nfunction makeLendingAccountLiquidateIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n assetBank: PublicKey;\n liabBank: PublicKey;\n liquidatorMarginfiAccount: PublicKey;\n liquidateeMarginfiAccount: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n },\n args: {\n assetAmount: BN;\n liquidateeAccounts: number;\n liquidatorAccounts: number;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const {\n assetBank,\n liabBank,\n liquidatorMarginfiAccount,\n liquidateeMarginfiAccount,\n tokenProgram,\n ...optionalAccounts\n } = accounts;\n\n return mfiProgram.methods\n .lendingAccountLiquidate(args.assetAmount, args.liquidateeAccounts, args.liquidatorAccounts)\n .accounts({\n assetBank,\n liabBank,\n liquidatorMarginfiAccount,\n liquidateeMarginfiAccount,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Configure a bank's risk-reducing settings (limits, interest rates, fees, circuit breaker,\n * operational state toward paused/reduce-only), signed by the group admin. Weights, risk tier,\n * oracle limits and freezing go through {@link makePoolConfigureBankGovIx}.\n * @param mfiProgram The marginfi program\n * @param accounts The bank, plus optional group/admin overrides\n * @param args The settings to change; `null` leaves a setting unchanged\n */\nfunction makePoolConfigureBankIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n bank: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n admin?: PublicKey;\n },\n args: {\n bankConfigOpt: BankConfigFastRaw;\n }\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfiProgram.methods\n .lendingPoolConfigureBank(args.bankConfigOpt)\n .accounts({\n bank,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\n/**\n * Configure a bank's risk-increasing settings (weights, risk tier, asset tag, oracle limits,\n * tokenless repayments, freezing, returning to operational), signed by the group's governance\n * admin.\n * @param mfiProgram The marginfi program\n * @param accounts The bank, plus optional group/governance admin overrides\n * @param args The settings to change; `null` leaves a setting unchanged\n */\nfunction makePoolConfigureBankGovIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n bank: PublicKey;\n group?: PublicKey;\n governanceAdmin?: PublicKey;\n },\n args: {\n bankConfigOpt: BankConfigGovRaw;\n }\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfiProgram.methods\n .lendingPoolConfigureBankGov(args.bankConfigOpt)\n .accounts({ bank })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nfunction makeBeginFlashLoanIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n // Optional accounts - to override inference\n authority?: PublicKey;\n ixsSysvar?: PublicKey;\n },\n args: {\n endIndex: BN;\n }\n) {\n const { marginfiAccount, ...optionalAccounts } = accounts;\n\n return mfiProgram.methods\n .lendingAccountStartFlashloan(args.endIndex)\n .accounts({\n marginfiAccount,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeEndFlashLoanIx(\n mfiProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n // Optional accounts - to override inference\n authority?: PublicKey;\n // Pass explicitly when the account isn't on-chain yet (fresh-account flash loans)\n group?: PublicKey;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, ...optionalAccounts } = accounts;\n\n return mfiProgram.methods\n .lendingAccountEndFlashloan()\n .accounts({\n marginfiAccount,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makeAccountTransferToNewAccountIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n oldMarginfiAccount: PublicKey;\n newMarginfiAccount: PublicKey;\n newAuthority: PublicKey;\n globalFeeWallet: PublicKey;\n feePayer: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n authority?: PublicKey;\n }\n) {\n const {\n oldMarginfiAccount,\n newMarginfiAccount,\n newAuthority,\n globalFeeWallet,\n feePayer,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .transferToNewAccount()\n .accounts({\n oldMarginfiAccount,\n newMarginfiAccount,\n newAuthority,\n globalFeeWallet,\n feePayer,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeGroupInitIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiGroup: PublicKey;\n admin: PublicKey;\n }\n) {\n return mfProgram.methods\n .marginfiGroupInitialize()\n .accounts({\n marginfiGroup: accounts.marginfiGroup,\n admin: accounts.admin,\n })\n .instruction();\n}\n\n/**\n * Configure the oracle for a bank\n * @param mfProgram The marginfi program\n * @param accounts The accounts required for this instruction\n * @param args The oracle setup index and feed id\n * @param remainingAccounts The remaining accounts required for this instruction, should include the feed oracle key\n */\nasync function makeLendingPoolConfigureBankOracleIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n bank: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n governanceAdmin?: PublicKey;\n },\n args: {\n /**\n * The oracle setup index, see {@link serializeOracleSetupToIndex}\n */\n setup: number;\n /**\n * The oracle feed id\n */\n feedId: PublicKey;\n },\n /**\n * The remaining accounts required for this instruction, should include the feed oracle key (non writable & signable)\n */\n remainingAccounts: AccountMeta[] = []\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolConfigureBankOracle(args.setup, args.feedId)\n .accounts({\n bank,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Configure a bank to use an entry in a Scope OraclePrices account. The program picks Scope,\n * ScopeKamino or ScopeJuplend from the bank's asset tag.\n * @param mfProgram The marginfi program\n * @param accounts The bank, plus optional group/governance admin overrides\n * @param args The Scope OraclePrices account, its entry index, and for Kamino/JupLend banks the\n * bank's Kamino reserve or JupLend lending account (its `oracleKeys[1]`)\n */\nasync function makeLendingPoolConfigureBankOracleScopeIx(\n mfProgram: MarginfiProgram,\n accounts: {\n bank: PublicKey;\n group?: PublicKey;\n governanceAdmin?: PublicKey;\n },\n args: {\n oracle: PublicKey;\n entryIndex: number;\n integrationAccount?: PublicKey;\n }\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolConfigureBankOracleScope(args.oracle, args.entryIndex)\n .accounts({ bank })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(\n [args.oracle, args.integrationAccount]\n .filter((pubkey) => pubkey !== undefined)\n .map((pubkey) => ({ pubkey, isSigner: false, isWritable: false }))\n )\n .instruction();\n}\n\n/** Configure a fixed or Exponent PT oracle through the set-oracle-price instruction. */\nasync function makeLendingPoolSetOraclePriceIx(\n mfProgram: MarginfiProgram,\n accounts: {\n bank: PublicKey;\n group?: PublicKey;\n governanceAdmin?: PublicKey;\n },\n args: {\n price: WrappedI80F48;\n setup: number;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { bank, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolSetOraclePrice(args.price, args.setup)\n .accounts({ bank })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Creates an instruction to add a permissionless staked bank to a lending pool.\n * @param mfProgram - The marginfi program instance\n * @param accounts - The accounts required for this instruction\n * @param remainingAccounts - The remaining accounts required for this instruction, including pythOracle, solPool and bankMint\n * @param args - Optional arguments for this instruction\n */\nasync function makePoolAddPermissionlessStakedBankIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n stakedSettings: PublicKey;\n feePayer: PublicKey;\n bankMint: PublicKey;\n solPool: PublicKey;\n /** The SVSP on-ramp account, derived from the stake pool (0.1.9+ program only) */\n poolOnramp: PublicKey;\n stakePool: PublicKey;\n /** The validator vote account backing the stake pool (0.1.9+ program only) */\n validatorVoteAccount: PublicKey;\n // Optional accounts - to override inference\n marginfiGroup?: PublicKey;\n /**\n * The token program to use for this instruction, defaults to the SPL token program\n */\n tokenProgram?: PublicKey;\n },\n /**\n * The remaining accounts required for this instruction. Should include:\n * - pythOracle: The pyth oracle key (non writable & non signer)\n * - solPool: The sol pool key (non writable & non signer)\n * - bankMint: The bank mint key (non writable & non signer)\n */\n remainingAccounts: AccountMeta[] = [],\n args: {\n /**\n * The seed to use for the bank account. Defaults to 0 (new BN(0)).\n * If the seed is not specified, the seed is set to 0, and the bank account\n * will be created at the address {@link findPoolAddress} with the default\n * bump.\n */\n seed?: BN;\n }\n) {\n const {\n stakedSettings,\n feePayer,\n bankMint,\n solPool,\n poolOnramp,\n stakePool,\n validatorVoteAccount,\n tokenProgram = TOKEN_PROGRAM_ID,\n ...optionalAccounts\n } = accounts;\n\n return mfProgram.methods\n .lendingPoolAddBankPermissionless(args.seed ?? new BN(0))\n .accounts({\n stakedSettings,\n feePayer,\n bankMint,\n solPool,\n poolOnramp,\n stakePool,\n validatorVoteAccount,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\nasync function makePoolAddBankIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiGroup: PublicKey;\n feePayer: PublicKey;\n bankMint: PublicKey;\n bank: PublicKey;\n tokenProgram: PublicKey;\n // Optional accounts - to override inference\n governanceAdmin?: PublicKey;\n globalFeeWallet?: PublicKey;\n },\n args: {\n bankConfig: BankConfigCompactRaw;\n }\n) {\n const { marginfiGroup, feePayer, bankMint, bank, tokenProgram, ...optionalAccounts } = accounts;\n\n return mfProgram.methods\n .lendingPoolAddBank({\n ...args.bankConfig,\n configFlags: 0,\n pad0: [0, 0, 0, 0, 0, 0, 0, 0],\n })\n .accounts({\n marginfiGroup,\n feePayer,\n bankMint,\n bank,\n tokenProgram,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\nasync function makeCloseAccountIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n feePayer: PublicKey;\n // Optional accounts - to override inference\n authority?: PublicKey;\n }\n) {\n const { marginfiAccount, feePayer, ...optionalAccounts } = accounts;\n return mfProgram.methods\n .marginfiAccountClose()\n .accounts({\n marginfiAccount,\n feePayer,\n })\n .accountsPartial(optionalAccounts)\n .instruction();\n}\n\n// Deprecated\n// async function makeLendingAccountSortBalancesIx(\n// mfProgram: MarginfiProgram,\n// accounts: {\n// marginfiAccount: PublicKey;\n// }\n// ) {\n// return mfProgram.methods\n// .lendingAccountSortBalances()\n// .accounts({\n// marginfiAccount: accounts.marginfiAccount,\n// })\n// .instruction();\n// }\n\nasync function makePulseHealthIx(\n mfProgram: MarginfiProgram,\n accounts: {\n marginfiAccount: PublicKey;\n group: PublicKey;\n },\n /**\n * The remaining accounts required for this instruction. Should include:\n * - For each balance the user has, pass bank and oracle: <bank1, oracle1, bank2, oracle2>\n */\n remainingAccounts: AccountMeta[] = []\n) {\n return mfProgram.methods\n .lendingAccountPulseHealth()\n .accountsPartial({\n marginfiAccount: accounts.marginfiAccount,\n group: accounts.group,\n })\n .remainingAccounts(remainingAccounts)\n .instruction();\n}\n\n/**\n * Creates an instruction to place a take-profit/stop-loss order on a collateral/debt bank pair.\n * The `order` account must be derived by the caller (see `deriveOrderPda`) — the IDL has no\n * pda block for it.\n */\nasync function makePlaceOrderIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n feePayer: PublicKey;\n authority: PublicKey;\n order: PublicKey;\n globalFeeWallet: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n },\n args: {\n /** Exactly two keys: one asset-side (collateral) bank and one liability-side (debt) bank. */\n bankKeys: PublicKey[];\n trigger: OrderTrigger;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, feePayer, authority, order, globalFeeWallet, ...optionalAccounts } =\n accounts;\n\n return (\n mfProgram.methods\n .marginfiAccountPlaceOrder(args.bankKeys, args.trigger)\n .accounts({\n marginfiAccount,\n feePayer,\n order,\n })\n // has_one relations are only accepted via accountsPartial; passing them skips resolver fetches\n .accountsPartial({ authority, globalFeeWallet, ...optionalAccounts })\n .remainingAccounts(remainingAccounts)\n .instruction()\n );\n}\n\n/**\n * Creates an instruction to close an existing order, returning rent to the fee recipient.\n */\nasync function makeCloseOrderIx(\n mfProgram: MarginfiProgram,\n accounts: {\n // Required accounts\n marginfiAccount: PublicKey;\n authority: PublicKey;\n order: PublicKey;\n feeRecipient: PublicKey;\n // Optional accounts - to override inference\n group?: PublicKey;\n },\n remainingAccounts: AccountMeta[] = []\n) {\n const { marginfiAccount, authority, order, feeRecipient, ...optionalAccounts } = accounts;\n\n return (\n mfProgram.methods\n .marginfiAccountCloseOrder()\n .accounts({\n authority,\n order,\n feeRecipient,\n })\n // has_one relation from `order`, only accepted via accountsPartial\n .accountsPartial({ marginfiAccount, ...optionalAccounts })\n .remainingAccounts(remainingAccounts)\n .instruction()\n );\n}\n\nconst instructions = {\n makeDepositIx,\n makeJuplendDepositIx,\n makeDriftDepositIx,\n makeKaminoDepositIx,\n makeRepayIx,\n makeWithdrawIx,\n makeJuplendWithdrawIx,\n makeDriftWithdrawIx,\n makeKaminoWithdrawIx,\n makeBorrowIx,\n makeInitMarginfiAccountIx,\n makeInitMarginfiAccountPdaIx,\n makeLendingAccountLiquidateIx,\n makePoolAddBankIx,\n makePoolConfigureBankIx,\n makePoolConfigureBankGovIx,\n makeBeginFlashLoanIx,\n makeEndFlashLoanIx,\n makeAccountTransferToNewAccountIx,\n makeGroupInitIx,\n makeCloseAccountIx,\n makePoolAddPermissionlessStakedBankIx,\n makeLendingPoolConfigureBankOracleIx,\n makeLendingPoolConfigureBankOracleScopeIx,\n makeLendingPoolSetOraclePriceIx,\n makePulseHealthIx,\n makePlaceOrderIx,\n makeCloseOrderIx,\n};\n\nexport default instructions;\n"]}
|
|
@@ -2,7 +2,7 @@ import { Idl, Program as Program$1, AnchorProvider } from '@coral-xyz/anchor';
|
|
|
2
2
|
import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
4
|
import BigNumber$1 from 'bignumber.js';
|
|
5
|
-
import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-farm.types-
|
|
5
|
+
import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-farm.types-6lrPBcZr.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -24058,6 +24058,12 @@ interface BankType {
|
|
|
24058
24058
|
premiumActive: boolean;
|
|
24059
24059
|
/** Unix seconds of the last premium activation; accrual never starts before it */
|
|
24060
24060
|
premiumActivatedAt: number;
|
|
24061
|
+
/**
|
|
24062
|
+
* The Kamino market (flags bit 14) or reserve is in emergency mode, so the bank's collateral
|
|
24063
|
+
* counts zero toward initial health. Decoding sets the market part;
|
|
24064
|
+
* {@link withKaminoReserveEmergency} ORs in the reserve's `emergencyMode`.
|
|
24065
|
+
*/
|
|
24066
|
+
kaminoEmergency: boolean;
|
|
24061
24067
|
rateLimiter?: BankRateLimiterType;
|
|
24062
24068
|
feesDestinationAccount?: PublicKey;
|
|
24063
24069
|
lendingPositionCount?: BigNumber$1;
|
|
@@ -24348,6 +24354,10 @@ interface BankConfigOptRaw {
|
|
|
24348
24354
|
cbWindowMaxUpBps: number | null;
|
|
24349
24355
|
cbWindowMaxDownBps: number | null;
|
|
24350
24356
|
}
|
|
24357
|
+
/** `lending_pool_configure_bank` args: the admin's risk-reducing settings */
|
|
24358
|
+
type BankConfigFastRaw = Pick<BankConfigOptRaw, "depositLimit" | "borrowLimit" | "operationalState" | "interestRateConfig" | "totalAssetValueInitLimit" | "permissionlessBadDebtSettlement" | "liquidationLiquidatorFee" | "liquidationInsuranceFee" | "circuitBreakerEnabled" | "cbDeviationBpsTiers" | "cbTierDurationsSeconds" | "cbEscalationWindowMult" | "cbEmaAlphaBps" | "cbWindowSeconds" | "cbWindowMaxUpBps" | "cbWindowMaxDownBps">;
|
|
24359
|
+
/** `lending_pool_configure_bank_gov` args: the governance admin's risk-increasing settings */
|
|
24360
|
+
type BankConfigGovRaw = Pick<BankConfigOptRaw, "assetWeightInit" | "assetWeightMaint" | "liabilityWeightInit" | "liabilityWeightMaint" | "operationalState" | "riskTier" | "assetTag" | "oracleMaxConfidence" | "oracleMaxAge" | "tokenlessRepaymentsAllowed" | "freezeSettings">;
|
|
24351
24361
|
interface BankConfigCompactRaw extends Omit<BankConfigRaw, "oracleKeys" | "oracleSetup" | "fixedPrice" | "interestRateConfig"> {
|
|
24352
24362
|
interestRateConfig: InterestRateConfigCompactRaw;
|
|
24353
24363
|
}
|
|
@@ -24487,6 +24497,11 @@ interface EmodeConfigRaw {
|
|
|
24487
24497
|
interface BalanceType {
|
|
24488
24498
|
active: boolean;
|
|
24489
24499
|
bankPk: PublicKey;
|
|
24500
|
+
/**
|
|
24501
|
+
* Tag used by orders to reference this balance (0 means unused/unassigned).
|
|
24502
|
+
* A tag may be non-zero even when no order currently references it.
|
|
24503
|
+
*/
|
|
24504
|
+
tag: number;
|
|
24490
24505
|
assetShares: BigNumber$1;
|
|
24491
24506
|
liabilityShares: BigNumber$1;
|
|
24492
24507
|
/** Stored premium APR snapshot (0.05 = 5%): the rate premium accrues at until the next refresh. */
|
|
@@ -24542,18 +24557,41 @@ interface MarginfiAccountType {
|
|
|
24542
24557
|
accountFlags: AccountFlags[];
|
|
24543
24558
|
emissionsDestinationAccount: PublicKey;
|
|
24544
24559
|
healthCache: HealthCacheType;
|
|
24560
|
+
/** Orders that point at this account, including orphaned ones. Transfer requires 0. */
|
|
24561
|
+
activeOrders: number;
|
|
24545
24562
|
}
|
|
24546
24563
|
declare enum AccountFlags {
|
|
24547
24564
|
ACCOUNT_DISABLED = 1,// 1
|
|
24548
24565
|
ACCOUNT_IN_FLASHLOAN = 2,// 2
|
|
24549
24566
|
ACCOUNT_FLAG_DEPRECATED = 4,// 4
|
|
24550
|
-
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8
|
|
24567
|
+
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8,// 8
|
|
24568
|
+
ACCOUNT_IN_RECEIVERSHIP = 16,// 16
|
|
24569
|
+
ACCOUNT_IN_DELEVERAGE = 32,// 32
|
|
24570
|
+
ACCOUNT_FROZEN = 64,// 64
|
|
24571
|
+
ACCOUNT_IN_ORDER_EXECUTION = 128
|
|
24551
24572
|
}
|
|
24552
24573
|
declare enum MarginRequirementType {
|
|
24553
24574
|
Initial = 0,
|
|
24554
24575
|
Maintenance = 1,
|
|
24555
24576
|
Equity = 2
|
|
24556
24577
|
}
|
|
24578
|
+
type OrderTriggerKind = "stopLoss" | "takeProfit" | "both";
|
|
24579
|
+
interface OrderType {
|
|
24580
|
+
address: PublicKey;
|
|
24581
|
+
marginfiAccount: PublicKey;
|
|
24582
|
+
/** Which trigger(s) this order fires on. */
|
|
24583
|
+
trigger: OrderTriggerKind;
|
|
24584
|
+
/** Pair net-equity stop-loss threshold in USD, null when the order has no stop-loss leg. */
|
|
24585
|
+
stopLoss: BigNumber$1 | null;
|
|
24586
|
+
/** Pair net-equity take-profit threshold in USD, null when the order has no take-profit leg. */
|
|
24587
|
+
takeProfit: BigNumber$1 | null;
|
|
24588
|
+
/** Tags linking this order to its two balances (see {@link BalanceType.tag}). */
|
|
24589
|
+
tags: [number, number];
|
|
24590
|
+
/** Unix timestamp (seconds) when the order was created. */
|
|
24591
|
+
createdAt: number;
|
|
24592
|
+
/** Max slippage the keeper may impose on execution, in percent. */
|
|
24593
|
+
maxSlippagePercent: number;
|
|
24594
|
+
}
|
|
24557
24595
|
|
|
24558
24596
|
interface PriceWithConfidence {
|
|
24559
24597
|
price: BigNumber$1;
|
|
@@ -24937,6 +24975,7 @@ declare class Bank implements BankType {
|
|
|
24937
24975
|
readonly premiumTag: number;
|
|
24938
24976
|
readonly premiumActive: boolean;
|
|
24939
24977
|
readonly premiumActivatedAt: number;
|
|
24978
|
+
readonly kaminoEmergency: boolean;
|
|
24940
24979
|
readonly rateLimiter?: BankRateLimiterType | undefined;
|
|
24941
24980
|
readonly kaminoIntegrationAccounts?: {
|
|
24942
24981
|
kaminoReserve: PublicKey;
|
|
@@ -24960,7 +24999,7 @@ declare class Bank implements BankType {
|
|
|
24960
24999
|
readonly lendingPositionCount?: BigNumber$1 | undefined;
|
|
24961
25000
|
readonly borrowingPositionCount?: BigNumber$1 | undefined;
|
|
24962
25001
|
readonly tokenSymbol?: string | undefined;
|
|
24963
|
-
constructor(address: PublicKey, mint: PublicKey, mintDecimals: number, group: PublicKey, assetShareValue: BigNumber$1, liabilityShareValue: BigNumber$1, liquidityVault: PublicKey, liquidityVaultBump: number, liquidityVaultAuthorityBump: number, insuranceVault: PublicKey, insuranceVaultBump: number, insuranceVaultAuthorityBump: number, collectedInsuranceFeesOutstanding: BigNumber$1, feeVault: PublicKey, feeVaultBump: number, feeVaultAuthorityBump: number, collectedGroupFeesOutstanding: BigNumber$1, lastUpdate: number, config: BankConfig, totalAssetShares: BigNumber$1, totalLiabilityShares: BigNumber$1, emissionsActiveBorrowing: boolean, emissionsActiveLending: boolean, emissionsRate: number, emissionsMint: PublicKey, emissionsRemaining: BigNumber$1, collectedProgramFeesOutstanding: BigNumber$1, oracleKey: PublicKey, emode: EmodeSettings, premiumTag: number, premiumActive: boolean, premiumActivatedAt: number, rateLimiter?: BankRateLimiterType | undefined, kaminoIntegrationAccounts?: {
|
|
25002
|
+
constructor(address: PublicKey, mint: PublicKey, mintDecimals: number, group: PublicKey, assetShareValue: BigNumber$1, liabilityShareValue: BigNumber$1, liquidityVault: PublicKey, liquidityVaultBump: number, liquidityVaultAuthorityBump: number, insuranceVault: PublicKey, insuranceVaultBump: number, insuranceVaultAuthorityBump: number, collectedInsuranceFeesOutstanding: BigNumber$1, feeVault: PublicKey, feeVaultBump: number, feeVaultAuthorityBump: number, collectedGroupFeesOutstanding: BigNumber$1, lastUpdate: number, config: BankConfig, totalAssetShares: BigNumber$1, totalLiabilityShares: BigNumber$1, emissionsActiveBorrowing: boolean, emissionsActiveLending: boolean, emissionsRate: number, emissionsMint: PublicKey, emissionsRemaining: BigNumber$1, collectedProgramFeesOutstanding: BigNumber$1, oracleKey: PublicKey, emode: EmodeSettings, premiumTag: number, premiumActive: boolean, premiumActivatedAt: number, kaminoEmergency: boolean, rateLimiter?: BankRateLimiterType | undefined, kaminoIntegrationAccounts?: {
|
|
24964
25003
|
kaminoReserve: PublicKey;
|
|
24965
25004
|
kaminoObligation: PublicKey;
|
|
24966
25005
|
} | undefined, driftIntegrationAccounts?: {
|
|
@@ -25128,6 +25167,23 @@ type MintDataMap = Map<string, MintData>;
|
|
|
25128
25167
|
interface WrappedI80F48 {
|
|
25129
25168
|
value: number[];
|
|
25130
25169
|
}
|
|
25170
|
+
type OrderTrigger = {
|
|
25171
|
+
stopLoss: {
|
|
25172
|
+
threshold: WrappedI80F48;
|
|
25173
|
+
maxSlippage: number;
|
|
25174
|
+
};
|
|
25175
|
+
} | {
|
|
25176
|
+
takeProfit: {
|
|
25177
|
+
threshold: WrappedI80F48;
|
|
25178
|
+
maxSlippage: number;
|
|
25179
|
+
};
|
|
25180
|
+
} | {
|
|
25181
|
+
both: {
|
|
25182
|
+
stopLoss: WrappedI80F48;
|
|
25183
|
+
takeProfit: WrappedI80F48;
|
|
25184
|
+
maxSlippage: number;
|
|
25185
|
+
};
|
|
25186
|
+
};
|
|
25131
25187
|
type Amount = BigNumber | number | string;
|
|
25132
25188
|
type AmountType = "uiToken" | "cToken";
|
|
25133
25189
|
type TypedAmount = {
|
|
@@ -25139,4 +25195,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
25139
25195
|
type: AmountType;
|
|
25140
25196
|
};
|
|
25141
25197
|
|
|
25142
|
-
export { type
|
|
25198
|
+
export { type BankIntegrationMetadata as $, AssetTag as A, type BankConfigCompactRaw as B, PriceBias as C, type OraclePriceDto as D, EmodeTag as E, type BankIntegrationMetadataMap as F, type OrderType as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, type BalanceType as J, type HealthCacheType as K, type EmodePair as L, type MarginfiProgram as M, type ActiveEmodePair as N, type OrderTrigger as O, type PriceWithConfidence as P, type ActionEmodeImpact as Q, RiskTier as R, MarginRequirementType as S, type Amount as T, EmodeImpactStatus as U, type TypedAmount as V, type WrappedI80F48 as W, BankVaultType as X, type RateLimitWindowType as Y, type BankIntegrationMetadataMapDto as Z, type BankIntegrationMetadataDto as _, type BankConfigFastRaw as a, Bank as a0, type Environment as a1, type Project0Config as a2, type MintData as a3, BankConfig as a4, EmodeSettings as a5, type RateLimitWindowRaw as a6, type BankMetadataRaw as a7, type RatePointRaw as a8, type InterestRateConfigCompactRaw as a9, type BankMetadata as aA, type BankAddress as aB, AccountType as aC, type KaminoStates as aD, type BankMap as aE, type OraclePriceMap as aF, type MintDataMap as aG, type AmountType as aH, resolveAmount as aI, type InterestRateConfigOptRaw as aa, type OracleConfigOptRaw as ab, type EmodeConfigRaw as ac, type RatePoint as ad, type InterestRateConfigOpt as ae, type EmodeEntry as af, type OracleConfigOpt as ag, type EmodeImpact as ah, isWeightedPrice as ai, type GetAssetWeightParams as aj, getAssetWeight as ak, getLiabilityWeight as al, computeMaxLeverage as am, computeLoopingParams as an, type ComputeUsdValueParams as ao, computeUsdValue as ap, type ComputeLiabilityUsdValueParams as aq, computeLiabilityUsdValue as ar, type ComputeAssetUsdValueParams as as, computeAssetUsdValue as at, computeTvl as au, type OrderTriggerKind as av, type PriceWithConfidenceDto as aw, MARGINFI_IDL as ax, type Program as ay, type Wallet as az, type BankConfigGovRaw as b, type BankType as c, BankConfigFlag as d, OperationalState as e, OracleSetup as f, EmodeEntryFlags as g, EmodeFlags as h, type OperationalStateRaw as i, type OracleSetupRaw as j, type RiskTierRaw as k, type InterestRateConfig as l, type BankConfigType as m, type BankConfigRaw as n, type BankConfigOpt as o, type BankConfigOptRaw as p, type EmodeSettingsType as q, type BankRateLimiterType as r, type BankRaw as s, type BankRateLimiterRaw as t, type EmodeSettingsRaw as u, type MarginfiIdlType as v, HealthCacheStatus as w, AccountFlags as x, type MarginfiAccountType as y, type OraclePrice as z };
|
|
@@ -2,7 +2,7 @@ import { Idl, Program as Program$1, AnchorProvider } from '@coral-xyz/anchor';
|
|
|
2
2
|
import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
4
|
import BigNumber$1 from 'bignumber.js';
|
|
5
|
-
import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-farm.types-
|
|
5
|
+
import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-farm.types-6lrPBcZr.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -24058,6 +24058,12 @@ interface BankType {
|
|
|
24058
24058
|
premiumActive: boolean;
|
|
24059
24059
|
/** Unix seconds of the last premium activation; accrual never starts before it */
|
|
24060
24060
|
premiumActivatedAt: number;
|
|
24061
|
+
/**
|
|
24062
|
+
* The Kamino market (flags bit 14) or reserve is in emergency mode, so the bank's collateral
|
|
24063
|
+
* counts zero toward initial health. Decoding sets the market part;
|
|
24064
|
+
* {@link withKaminoReserveEmergency} ORs in the reserve's `emergencyMode`.
|
|
24065
|
+
*/
|
|
24066
|
+
kaminoEmergency: boolean;
|
|
24061
24067
|
rateLimiter?: BankRateLimiterType;
|
|
24062
24068
|
feesDestinationAccount?: PublicKey;
|
|
24063
24069
|
lendingPositionCount?: BigNumber$1;
|
|
@@ -24348,6 +24354,10 @@ interface BankConfigOptRaw {
|
|
|
24348
24354
|
cbWindowMaxUpBps: number | null;
|
|
24349
24355
|
cbWindowMaxDownBps: number | null;
|
|
24350
24356
|
}
|
|
24357
|
+
/** `lending_pool_configure_bank` args: the admin's risk-reducing settings */
|
|
24358
|
+
type BankConfigFastRaw = Pick<BankConfigOptRaw, "depositLimit" | "borrowLimit" | "operationalState" | "interestRateConfig" | "totalAssetValueInitLimit" | "permissionlessBadDebtSettlement" | "liquidationLiquidatorFee" | "liquidationInsuranceFee" | "circuitBreakerEnabled" | "cbDeviationBpsTiers" | "cbTierDurationsSeconds" | "cbEscalationWindowMult" | "cbEmaAlphaBps" | "cbWindowSeconds" | "cbWindowMaxUpBps" | "cbWindowMaxDownBps">;
|
|
24359
|
+
/** `lending_pool_configure_bank_gov` args: the governance admin's risk-increasing settings */
|
|
24360
|
+
type BankConfigGovRaw = Pick<BankConfigOptRaw, "assetWeightInit" | "assetWeightMaint" | "liabilityWeightInit" | "liabilityWeightMaint" | "operationalState" | "riskTier" | "assetTag" | "oracleMaxConfidence" | "oracleMaxAge" | "tokenlessRepaymentsAllowed" | "freezeSettings">;
|
|
24351
24361
|
interface BankConfigCompactRaw extends Omit<BankConfigRaw, "oracleKeys" | "oracleSetup" | "fixedPrice" | "interestRateConfig"> {
|
|
24352
24362
|
interestRateConfig: InterestRateConfigCompactRaw;
|
|
24353
24363
|
}
|
|
@@ -24487,6 +24497,11 @@ interface EmodeConfigRaw {
|
|
|
24487
24497
|
interface BalanceType {
|
|
24488
24498
|
active: boolean;
|
|
24489
24499
|
bankPk: PublicKey;
|
|
24500
|
+
/**
|
|
24501
|
+
* Tag used by orders to reference this balance (0 means unused/unassigned).
|
|
24502
|
+
* A tag may be non-zero even when no order currently references it.
|
|
24503
|
+
*/
|
|
24504
|
+
tag: number;
|
|
24490
24505
|
assetShares: BigNumber$1;
|
|
24491
24506
|
liabilityShares: BigNumber$1;
|
|
24492
24507
|
/** Stored premium APR snapshot (0.05 = 5%): the rate premium accrues at until the next refresh. */
|
|
@@ -24542,18 +24557,41 @@ interface MarginfiAccountType {
|
|
|
24542
24557
|
accountFlags: AccountFlags[];
|
|
24543
24558
|
emissionsDestinationAccount: PublicKey;
|
|
24544
24559
|
healthCache: HealthCacheType;
|
|
24560
|
+
/** Orders that point at this account, including orphaned ones. Transfer requires 0. */
|
|
24561
|
+
activeOrders: number;
|
|
24545
24562
|
}
|
|
24546
24563
|
declare enum AccountFlags {
|
|
24547
24564
|
ACCOUNT_DISABLED = 1,// 1
|
|
24548
24565
|
ACCOUNT_IN_FLASHLOAN = 2,// 2
|
|
24549
24566
|
ACCOUNT_FLAG_DEPRECATED = 4,// 4
|
|
24550
|
-
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8
|
|
24567
|
+
ACCOUNT_TRANSFER_AUTHORITY_ALLOWED = 8,// 8
|
|
24568
|
+
ACCOUNT_IN_RECEIVERSHIP = 16,// 16
|
|
24569
|
+
ACCOUNT_IN_DELEVERAGE = 32,// 32
|
|
24570
|
+
ACCOUNT_FROZEN = 64,// 64
|
|
24571
|
+
ACCOUNT_IN_ORDER_EXECUTION = 128
|
|
24551
24572
|
}
|
|
24552
24573
|
declare enum MarginRequirementType {
|
|
24553
24574
|
Initial = 0,
|
|
24554
24575
|
Maintenance = 1,
|
|
24555
24576
|
Equity = 2
|
|
24556
24577
|
}
|
|
24578
|
+
type OrderTriggerKind = "stopLoss" | "takeProfit" | "both";
|
|
24579
|
+
interface OrderType {
|
|
24580
|
+
address: PublicKey;
|
|
24581
|
+
marginfiAccount: PublicKey;
|
|
24582
|
+
/** Which trigger(s) this order fires on. */
|
|
24583
|
+
trigger: OrderTriggerKind;
|
|
24584
|
+
/** Pair net-equity stop-loss threshold in USD, null when the order has no stop-loss leg. */
|
|
24585
|
+
stopLoss: BigNumber$1 | null;
|
|
24586
|
+
/** Pair net-equity take-profit threshold in USD, null when the order has no take-profit leg. */
|
|
24587
|
+
takeProfit: BigNumber$1 | null;
|
|
24588
|
+
/** Tags linking this order to its two balances (see {@link BalanceType.tag}). */
|
|
24589
|
+
tags: [number, number];
|
|
24590
|
+
/** Unix timestamp (seconds) when the order was created. */
|
|
24591
|
+
createdAt: number;
|
|
24592
|
+
/** Max slippage the keeper may impose on execution, in percent. */
|
|
24593
|
+
maxSlippagePercent: number;
|
|
24594
|
+
}
|
|
24557
24595
|
|
|
24558
24596
|
interface PriceWithConfidence {
|
|
24559
24597
|
price: BigNumber$1;
|
|
@@ -24937,6 +24975,7 @@ declare class Bank implements BankType {
|
|
|
24937
24975
|
readonly premiumTag: number;
|
|
24938
24976
|
readonly premiumActive: boolean;
|
|
24939
24977
|
readonly premiumActivatedAt: number;
|
|
24978
|
+
readonly kaminoEmergency: boolean;
|
|
24940
24979
|
readonly rateLimiter?: BankRateLimiterType | undefined;
|
|
24941
24980
|
readonly kaminoIntegrationAccounts?: {
|
|
24942
24981
|
kaminoReserve: PublicKey;
|
|
@@ -24960,7 +24999,7 @@ declare class Bank implements BankType {
|
|
|
24960
24999
|
readonly lendingPositionCount?: BigNumber$1 | undefined;
|
|
24961
25000
|
readonly borrowingPositionCount?: BigNumber$1 | undefined;
|
|
24962
25001
|
readonly tokenSymbol?: string | undefined;
|
|
24963
|
-
constructor(address: PublicKey, mint: PublicKey, mintDecimals: number, group: PublicKey, assetShareValue: BigNumber$1, liabilityShareValue: BigNumber$1, liquidityVault: PublicKey, liquidityVaultBump: number, liquidityVaultAuthorityBump: number, insuranceVault: PublicKey, insuranceVaultBump: number, insuranceVaultAuthorityBump: number, collectedInsuranceFeesOutstanding: BigNumber$1, feeVault: PublicKey, feeVaultBump: number, feeVaultAuthorityBump: number, collectedGroupFeesOutstanding: BigNumber$1, lastUpdate: number, config: BankConfig, totalAssetShares: BigNumber$1, totalLiabilityShares: BigNumber$1, emissionsActiveBorrowing: boolean, emissionsActiveLending: boolean, emissionsRate: number, emissionsMint: PublicKey, emissionsRemaining: BigNumber$1, collectedProgramFeesOutstanding: BigNumber$1, oracleKey: PublicKey, emode: EmodeSettings, premiumTag: number, premiumActive: boolean, premiumActivatedAt: number, rateLimiter?: BankRateLimiterType | undefined, kaminoIntegrationAccounts?: {
|
|
25002
|
+
constructor(address: PublicKey, mint: PublicKey, mintDecimals: number, group: PublicKey, assetShareValue: BigNumber$1, liabilityShareValue: BigNumber$1, liquidityVault: PublicKey, liquidityVaultBump: number, liquidityVaultAuthorityBump: number, insuranceVault: PublicKey, insuranceVaultBump: number, insuranceVaultAuthorityBump: number, collectedInsuranceFeesOutstanding: BigNumber$1, feeVault: PublicKey, feeVaultBump: number, feeVaultAuthorityBump: number, collectedGroupFeesOutstanding: BigNumber$1, lastUpdate: number, config: BankConfig, totalAssetShares: BigNumber$1, totalLiabilityShares: BigNumber$1, emissionsActiveBorrowing: boolean, emissionsActiveLending: boolean, emissionsRate: number, emissionsMint: PublicKey, emissionsRemaining: BigNumber$1, collectedProgramFeesOutstanding: BigNumber$1, oracleKey: PublicKey, emode: EmodeSettings, premiumTag: number, premiumActive: boolean, premiumActivatedAt: number, kaminoEmergency: boolean, rateLimiter?: BankRateLimiterType | undefined, kaminoIntegrationAccounts?: {
|
|
24964
25003
|
kaminoReserve: PublicKey;
|
|
24965
25004
|
kaminoObligation: PublicKey;
|
|
24966
25005
|
} | undefined, driftIntegrationAccounts?: {
|
|
@@ -25128,6 +25167,23 @@ type MintDataMap = Map<string, MintData>;
|
|
|
25128
25167
|
interface WrappedI80F48 {
|
|
25129
25168
|
value: number[];
|
|
25130
25169
|
}
|
|
25170
|
+
type OrderTrigger = {
|
|
25171
|
+
stopLoss: {
|
|
25172
|
+
threshold: WrappedI80F48;
|
|
25173
|
+
maxSlippage: number;
|
|
25174
|
+
};
|
|
25175
|
+
} | {
|
|
25176
|
+
takeProfit: {
|
|
25177
|
+
threshold: WrappedI80F48;
|
|
25178
|
+
maxSlippage: number;
|
|
25179
|
+
};
|
|
25180
|
+
} | {
|
|
25181
|
+
both: {
|
|
25182
|
+
stopLoss: WrappedI80F48;
|
|
25183
|
+
takeProfit: WrappedI80F48;
|
|
25184
|
+
maxSlippage: number;
|
|
25185
|
+
};
|
|
25186
|
+
};
|
|
25131
25187
|
type Amount = BigNumber | number | string;
|
|
25132
25188
|
type AmountType = "uiToken" | "cToken";
|
|
25133
25189
|
type TypedAmount = {
|
|
@@ -25139,4 +25195,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
25139
25195
|
type: AmountType;
|
|
25140
25196
|
};
|
|
25141
25197
|
|
|
25142
|
-
export { type
|
|
25198
|
+
export { type BankIntegrationMetadata as $, AssetTag as A, type BankConfigCompactRaw as B, PriceBias as C, type OraclePriceDto as D, EmodeTag as E, type BankIntegrationMetadataMap as F, type OrderType as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, type BalanceType as J, type HealthCacheType as K, type EmodePair as L, type MarginfiProgram as M, type ActiveEmodePair as N, type OrderTrigger as O, type PriceWithConfidence as P, type ActionEmodeImpact as Q, RiskTier as R, MarginRequirementType as S, type Amount as T, EmodeImpactStatus as U, type TypedAmount as V, type WrappedI80F48 as W, BankVaultType as X, type RateLimitWindowType as Y, type BankIntegrationMetadataMapDto as Z, type BankIntegrationMetadataDto as _, type BankConfigFastRaw as a, Bank as a0, type Environment as a1, type Project0Config as a2, type MintData as a3, BankConfig as a4, EmodeSettings as a5, type RateLimitWindowRaw as a6, type BankMetadataRaw as a7, type RatePointRaw as a8, type InterestRateConfigCompactRaw as a9, type BankMetadata as aA, type BankAddress as aB, AccountType as aC, type KaminoStates as aD, type BankMap as aE, type OraclePriceMap as aF, type MintDataMap as aG, type AmountType as aH, resolveAmount as aI, type InterestRateConfigOptRaw as aa, type OracleConfigOptRaw as ab, type EmodeConfigRaw as ac, type RatePoint as ad, type InterestRateConfigOpt as ae, type EmodeEntry as af, type OracleConfigOpt as ag, type EmodeImpact as ah, isWeightedPrice as ai, type GetAssetWeightParams as aj, getAssetWeight as ak, getLiabilityWeight as al, computeMaxLeverage as am, computeLoopingParams as an, type ComputeUsdValueParams as ao, computeUsdValue as ap, type ComputeLiabilityUsdValueParams as aq, computeLiabilityUsdValue as ar, type ComputeAssetUsdValueParams as as, computeAssetUsdValue as at, computeTvl as au, type OrderTriggerKind as av, type PriceWithConfidenceDto as aw, MARGINFI_IDL as ax, type Program as ay, type Wallet as az, type BankConfigGovRaw as b, type BankType as c, BankConfigFlag as d, OperationalState as e, OracleSetup as f, EmodeEntryFlags as g, EmodeFlags as h, type OperationalStateRaw as i, type OracleSetupRaw as j, type RiskTierRaw as k, type InterestRateConfig as l, type BankConfigType as m, type BankConfigRaw as n, type BankConfigOpt as o, type BankConfigOptRaw as p, type EmodeSettingsType as q, type BankRateLimiterType as r, type BankRaw as s, type BankRateLimiterRaw as t, type EmodeSettingsRaw as u, type MarginfiIdlType as v, HealthCacheStatus as w, AccountFlags as x, type MarginfiAccountType as y, type OraclePrice as z };
|
package/dist/vendor.cjs
CHANGED
|
@@ -1275,6 +1275,7 @@ function kaminoReserveToDto(reserve) {
|
|
|
1275
1275
|
protocolTakeRatePct: reserve.config.protocolTakeRatePct,
|
|
1276
1276
|
hostFixedInterestRateBps: reserve.config.hostFixedInterestRateBps,
|
|
1277
1277
|
interestRateBasis: reserve.config.interestRateBasis ?? 0 /* Legacy */,
|
|
1278
|
+
emergencyMode: reserve.config.emergencyMode,
|
|
1278
1279
|
depositLimit: reserve.config.depositLimit.toString(),
|
|
1279
1280
|
borrowLimit: reserve.config.borrowLimit.toString(),
|
|
1280
1281
|
borrowRateCurve: {
|
|
@@ -9595,6 +9596,7 @@ function dtoToKaminoReserve(reserveDto) {
|
|
|
9595
9596
|
protocolTakeRatePct: reserveDto.config.protocolTakeRatePct,
|
|
9596
9597
|
hostFixedInterestRateBps: reserveDto.config.hostFixedInterestRateBps,
|
|
9597
9598
|
interestRateBasis: reserveDto.config.interestRateBasis ?? 0 /* Legacy */,
|
|
9599
|
+
emergencyMode: reserveDto.config.emergencyMode ?? 0,
|
|
9598
9600
|
depositLimit: new BN5__default.default(reserveDto.config.depositLimit),
|
|
9599
9601
|
borrowLimit: new BN5__default.default(reserveDto.config.borrowLimit),
|
|
9600
9602
|
borrowRateCurve: {
|