fbonds-core
Version:
Banx protocol sdk
43 lines (42 loc) • 1.49 kB
TypeScript
import { LendingTokenType } from '../../../../types';
import { BN, web3 } from '@coral-xyz/anchor';
export interface RefinancePerpetualLoanFromOfferParamsAndAccounts {
bondOffer: web3.PublicKey;
newLender: web3.PublicKey;
oraclePriceFeed?: web3.PublicKey;
}
type RefinancePerpetualLoan = (params: {
programId: web3.PublicKey;
connection: web3.Connection;
args: {
lendingTokenType: LendingTokenType;
newApr: BN;
newLiqLtv?: BN;
refininFromOfferParams?: RefinancePerpetualLoanFromOfferParamsAndAccounts;
};
accounts: {
fbond: web3.PublicKey;
userPubkey: web3.PublicKey;
hadoMarket: web3.PublicKey;
protocolFeeReceiver: web3.PublicKey;
previousBondTradeTransaction: web3.PublicKey;
previousLender: web3.PublicKey;
oldBondOffer: web3.PublicKey;
refinanceFromOffer?: web3.PublicKey;
};
sendTxn: (transaction: web3.Transaction, signers: web3.Signer[]) => Promise<void>;
}) => Promise<{
instructions: web3.TransactionInstruction[];
signers: web3.Signer[];
accounts: {
fraktBond: web3.PublicKey;
bondOffer: web3.PublicKey;
bondTradeTransaction: web3.PublicKey;
oldBondOffer: web3.PublicKey;
previousBondTradeTransaction: web3.PublicKey;
lenderVault: web3.PublicKey;
oldLenderVault: web3.PublicKey;
};
}>;
export declare const refinancePerpetualLoan: RefinancePerpetualLoan;
export {};