fbonds-core
Version:
Banx protocol sdk
739 lines (738 loc) • 20.1 kB
TypeScript
import { BN, web3 } from '@coral-xyz/anchor';
export interface FraktBond {
fraktBondState: FraktBondState;
bondTradeTransactionsCounter: number;
borrowedAmount: BN;
banxStake: web3.PublicKey;
fraktMarket: web3.PublicKey;
leverageBasePoints: BN;
actualReturnedAmount: BN;
terminatedCounter: number;
fbondTokenMint: web3.PublicKey;
fbondTokenSupply: BN;
activatedAt: BN;
liquidatingAt: BN;
fbondIssuer: web3.PublicKey;
repaidOrLiquidatedAt: BN;
currentPerpetualBorrowed: BN;
lastTransactedAt: BN;
refinanceAuctionStartedAt: BN;
publicKey: web3.PublicKey;
}
export interface BondCartOrder {
orderSize: BN;
spotPrice: BN;
pairPubkey: web3.PublicKey;
assetReceiver: web3.PublicKey;
durationFilter: BN;
bondFeature: BondFeatures;
}
export interface InstructionsAndSigners {
instructions: web3.TransactionInstruction[];
signers?: web3.Signer[];
lookupTablePublicKeys: {
tablePubkey: web3.PublicKey;
addresses: web3.PublicKey[];
}[];
}
export interface TxnsAndSigners {
transaction: web3.Transaction;
signers?: web3.Signer[];
}
export declare enum FraktBondState {
Initialized = "initialized",
Active = "active",
Repaid = "repaid",
Liquidating = "liquidating",
Liquidated = "liquidated",
PerpetualActive = "perpetualActive",
PerpetualRepaid = "perpetualRepaid",
PerpetualLiquidatedByAuction = "perpetualLiquidatedByAuction",
PerpetualLiquidatedByClaim = "perpetualLiquidatedByClaim"
}
export declare enum BondTradeTransactionV2State {
NotActive = "notActive",
Active = "active",
PerpetualActive = "perpetualActive",
PerpetualRepaid = "perpetualRepaid",
PerpetualLiquidatedByAuction = "perpetualLiquidatedByAuction",
PerpetualLiquidatedByClaim = "perpetualLiquidatedByClaim",
PerpetualManualTerminating = "perpetualManualTerminating",
PerpetualPartialRepaid = "perpetualPartialRepaid",
PerpetualRefinanceRepaid = "perpetualRefinanceRepaid",
PerpetualRefinancedActive = "perpetualRefinancedActive",
Migrated = "migrated",
PerpetualBorrowerListing = "perpetualBorrowerListing",
PerpetualLenderListing = "perpetualLenderListing",
PerpetualSellingLoan = "perpetualSellingLoan",
PerpetualSellingListing = "perpetualSellingListing",
PerpetualSellingListingClosed = "perpetualSellingListingClosed",
PerpetualAddCollateralClosed = "perpetualAddCollateralClosed",
PerpetualAutoTerminating = "perpetualAutoTerminating"
}
export interface CollateralBox {
fbond: web3.PublicKey;
collateralBoxType: CollateralBoxType;
collateralTokenMint: web3.PublicKey;
collateralTokenAccount: web3.PublicKey;
collateralAmount: BN;
publicKey: web3.PublicKey;
}
export declare enum CollateralBoxType {
Escrow = "escrow",
Escrowless = "escrowless"
}
export interface Validation {
pair: web3.PublicKey;
user: web3.PublicKey;
loanToValueFilter: BN;
durationFilter: BN;
maxReturnAmountFilter: BN;
bondFeatures: BondFeatures;
}
export declare enum BondFeatures {
None = "none",
Autocompound = "autocompound",
ReceiveNftOnLiquidation = "receiveNftOnLiquidation",
AutoreceiveSol = "autoreceiveSol",
AutoCompoundAndReceiveNft = "autoCompoundAndReceiveNft",
AutoReceiveAndReceiveNft = "autoReceiveAndReceiveNft",
AutoReceiveAndReceiveSpl = "autoReceiveAndReceiveSpl"
}
export interface HadoMarketRegistry {
hadoMarket: web3.PublicKey;
fraktMarket: web3.PublicKey;
}
export declare enum BondingCurveType {
Linear = "linear",
Exponential = "exponential",
LinearUsdc = "linearUsdc",
ExponentialUsdc = "exponentialUsdc",
LinearBanxSol = "linearBanxSol",
ExponentialBanxSol = "exponentialBanxSol"
}
export declare enum PairType {
TokenForNFT = "tokenForNft",
NftForToken = "nftForToken",
LiquidityProvision = "liquidityProvision"
}
export declare enum NftValidationWhitelistType {
Creator = "creator",
Nft = "nft",
MerkleTree = "merkleTree",
CollectionId = "collectionId",
SplMint = "splMint",
CoreCollection = "coreCollection"
}
export declare enum OrderType {
Buy = "buy",
Sell = "sell"
}
export interface HadoMarket {
marketAuthority: web3.PublicKey;
marketState: MarketState;
marketTrustType: MarketTrustType;
pairValidationType: PairValidationType;
fraktMarket: web3.PublicKey;
upfrontFee: BN;
interestFee: BN;
whitelistType: NftValidationWhitelistType;
whitelistedAddress: web3.PublicKey;
priceFeedSolana: Buffer;
priceFeedUsdc: Buffer;
splTokenDecimals: BN;
solanaOracleFeedType: OraclePriceFeedType;
usdcOracleFeedType: OraclePriceFeedType;
publicKey: web3.PublicKey;
}
export declare enum OraclePriceFeedType {
None = "none",
Pyth = "pyth",
Switchboard = "switchboard"
}
export declare enum MarketState {
Initializing = "initializing",
Available = "available",
InitializingPerpetual = "initializingPerpetual",
AvailablePerpetual = "availablePerpetual",
PrivateAvailablePerpetual = "privateAvailablePerpetual"
}
export declare enum MarketTrustType {
Unverified = "unverified",
Verified = "verified"
}
export declare enum PairValidationType {
ClassicValidation = "classicValidation",
CustomValidation = "customValidation"
}
export declare enum PairTokenType {
NativeSol = "nativeSol",
Spl = "spl"
}
export declare enum WhitelistType {
Nft = "nft",
Creator = "creator"
}
export interface BondOfferV2 {
hadoMarket: web3.PublicKey;
pairState: PairState;
bondingCurve: BondingCurve;
baseSpotPrice: BN;
mathCounter: BN;
currentSpotPrice: BN;
concentrationIndex: BN;
bidCap: BN;
bidSettlement: BN;
edgeSettlement: BN;
fundsSolOrTokenBalance: BN;
buyOrdersQuantity: BN;
lastTransactedAt: BN;
assetReceiver: web3.PublicKey;
validation: {
loanToValueFilter: BN;
collateralsPerToken: BN;
maxReturnAmountFilter: BN;
bondFeatures: BondFeatures;
};
publicKey: web3.PublicKey;
}
export interface BondTradeTransactionV2 {
bondTradeTransactionState: BondTradeTransactionV2State;
bondOffer: web3.PublicKey;
user: web3.PublicKey;
amountOfBonds: BN;
solAmount: BN;
feeAmount: BN;
bondTradeTransactionType: BondTradeTransactionV2Type;
fbondTokenMint: web3.PublicKey;
soldAt: BN;
redeemedAt: BN;
redeemResult: RedeemResult;
seller: web3.PublicKey;
isDirectSell: boolean;
publicKey: web3.PublicKey;
}
export interface BondTradeTransactionV3 extends BondTradeTransactionV2 {
lendingToken: LendingTokenType;
currentRemainingLent: BN;
interestSnapshot: BN;
partialRepaySnapshot: BN;
terminationStartedAt: BN;
lenderOriginalLent: BN;
lenderFullRepaidAmount: BN;
borrowerOriginalLent: BN;
borrowerFullRepaidAmount: BN;
repayDestination: RepayDestination;
repaymentCallAmount: BN;
terminationFreeze: BN;
redeemResultNext: RedeemResult;
protocolInterestFee: BN;
collateralAmountSnapshot: BN;
}
export declare enum RepayDestination {
None = "none",
Offer = "offer",
Wallet = "wallet",
Vault = "vault"
}
export interface BondTradeTransactionV3OnChain extends BondTradeTransactionV3 {
placeholder1: BN;
placeholder2: BN;
placeholder3: BN;
placeholder4: BN;
placeholder5: web3.PublicKey;
placeholder6: web3.PublicKey;
}
export declare enum LendingTokenType {
NativeSol = "nativeSol",
Usdc = "usdc",
BanxSol = "banxSol"
}
export declare enum RedeemResult {
None = "none",
DirectBorrow = "directBorrow",
Reborrow = "reborrow",
InstantRefinanced = "instantRefinanced",
RefinancedByAuction = "refinancedByAuction",
PartialRepay = "partialRepay",
DirectRepaid = "directRepaid",
Claimed = "claimed",
AddCollateral = "addCollateral"
}
export type RedeemResultDecodeEnum = {
none: {};
} | {
directBorrow: {};
} | {
reborrow: {};
} | {
instantRefinanced: {};
} | {
refinancedByAuction: {};
} | {
partialRepay: {};
} | {
directRepaid: {};
} | {
claimed: {};
};
export interface NftSwapPair {
hadoMarket: web3.PublicKey;
pairType: PairType;
pairState: PairState;
pairAuthorityType: PairAuthorityType;
pairAuthorityAdapterProgram: web3.PublicKey;
lpTokensMint: web3.PublicKey;
lpTokensInCirculation: BN;
bondingCurve: BondingCurve;
baseSpotPrice: BN;
fee: BN;
mathCounter: BN;
currentSpotPrice: BN;
bidCap: BN;
bidSettlement: BN;
edgeSettlement: BN;
feeTokenAccount: web3.PublicKey;
feeVaultSeed: BN;
solOrTokenFeeAmount: BN;
fundsTokenAccount: web3.PublicKey;
fundsSolVaultSeed: BN;
fundsSolOrTokenBalance: BN;
initialFundsSolOrTokenBalance: BN;
buyOrdersQuantity: BN;
nftsSeed: BN;
sellOrdersCount: BN;
lastTransactedAt: BN;
concentrationIndex: BN;
assetReceiver: web3.PublicKey;
publicKey: web3.PublicKey;
}
export declare enum PairState {
Initializing = "initializing",
OnMarketVirtual = "onMarketVirtual",
OnMarketTokenized = "onMarketTokenized",
Frozen = "frozen",
Closed = "closed",
PerpetualOnMarket = "perpetualOnMarket",
PerpetualClosed = "perpetualClosed",
PerpetualBondingCurveOnMarket = "perpetualBondingCurveOnMarket",
PerpetualMigrated = "perpetualMigrated",
PerpetualBondingCurveClosed = "perpetualBondingCurveClosed",
PerpetualListing = "perpetualListing"
}
export declare enum PairAuthorityType {
ClassicAuthority = "classicAuthority",
CustomAuthority = "customAuthority"
}
export interface BondingCurve {
delta: BN;
bondingType: BondingCurveType;
}
export interface AuthorityAdapter {
pair: web3.PublicKey;
authorityAdapterProgram: web3.PublicKey;
authorityOwner: web3.PublicKey;
authorityType: AuthorityType;
expiringAt: BN;
authorityState: AuthorityState;
publicKey: web3.PublicKey;
}
export declare enum AuthorityType {
Persistent = "persistent",
OneTime = "oneTime"
}
export declare enum AuthorityState {
Active = "active",
Used = "used",
Expired = "expired",
Revoked = "revoked"
}
export declare enum ScopeType {
Market = "market",
Pair = "pair"
}
export interface NftValidationAdapter {
hadoMarket: web3.PublicKey;
scopeType: ScopeType;
pair: web3.PublicKey;
nftValidationProgram: web3.PublicKey;
nftValidationWhitelistType: WhitelistType;
whitelistedAddress: web3.PublicKey;
nftValidationDurationType: NftValidationDurationType;
validUntil: BN;
root: Buffer;
publicKey: web3.PublicKey;
}
export declare enum NftValidationDurationType {
Finite = "finite",
Infinite = "infinite"
}
export interface NftPairBox {
pair: web3.PublicKey;
nftMint: web3.PublicKey;
nftMetadata: web3.PublicKey;
nftBoxType: NftBoxType;
vault_token_account: web3.PublicKey;
active_tokens_amount: BN;
status: NftBoxState;
}
export declare enum NftBoxType {
Escrow = "escrow",
Escrowless = "escrowless"
}
export declare enum NftBoxState {
NotActive = "notActive",
Active = "active"
}
export interface AutocompoundDeposit {
fraktBondState: AutocompoundDepositState;
pair: web3.PublicKey;
user: web3.PublicKey;
amountOfBonds: BN;
depositedAt: BN;
autocompoundType: AutocompoundType;
fbondTokenMint: web3.PublicKey;
collateralTokenMint: web3.PublicKey;
solAmount: BN;
redeemedAt: BN;
publicKey: web3.PublicKey;
}
export declare enum AutocompoundDepositState {
NotActive = "notActive",
Active = "active",
Removed = "removed"
}
export declare enum BondTradeTransactionV2Type {
None = "none",
Autocompound = "autocompound",
ReceiveNftOnLiquidation = "receiveNftOnLiquidation",
AutoreceiveSol = "autoreceiveSol",
AutoCompoundAndReceiveNft = "autoCompoundAndReceiveNft",
AutoReceiveAndReceiveNft = "autoReceiveAndReceiveNft",
AutoReceiveAndReceiveSpl = "autoReceiveAndReceiveSpl"
}
export declare enum AutocompoundType {
Autocompound = "autocompound",
AutoreceiveSol = "autoreceiveSol",
AutocompoundAndReceiveNft = "autocompoundAndReceiveNft"
}
export declare enum BondEventType {
Creation = "creation",
Repay = "repay",
Liquidating = "liquidating",
Liquidated = "liquidated",
Redeem = "redeem",
Refinance = "refinance"
}
export interface BanxStake {
banxStakeState: BanxStakeState;
adventureSubscriptionsQuantity: BN;
nftMint: web3.PublicKey;
collateralTokenAccount: web3.PublicKey;
user: web3.PublicKey;
stakedAt: BN;
unstakedOrLiquidatedAt: BN;
isLoaned: boolean;
bond: web3.PublicKey;
playerPoints: BN;
partnerPoints: BN;
farmedAmount: BN;
placeholderOne: web3.PublicKey;
publicKey: web3.PublicKey;
}
export declare enum BanxStakeState {
Staked = "staked",
Unstaked = "unstaked",
Liquidated = "liquidated"
}
export interface BanxUser {
user: web3.PublicKey;
stakedPlayerPoints: BN;
stakedPartnerPoints: BN;
stakedBanx: BN;
totalHarvestedRewards: BN;
freeLiquidityCurrent: BN;
placeholderOne: web3.PublicKey;
publicKey: web3.PublicKey;
}
export interface Adventure {
adventureState: AdventureState;
periodStartedAt: BN;
periodEndingAt: BN;
rewardsUpperLimit: BN;
rewardsLowerLimit: BN;
totalPeriodRevenue: BN;
rewardsToBeDistributed: BN;
totalBanxSubscribed: BN;
totalPartnerPoints: BN;
totalPlayerPoints: BN;
banxSubscribedLeft: BN;
partnerPointsLeft: BN;
playerPointsLeft: BN;
rewardsLeft: BN;
publicKey: web3.PublicKey;
}
export declare enum AdventureState {
Uninitialized = "uninitialized",
Initialized = "initialized",
DistributingInitialized = "distributingInitialized"
}
export interface AdventureSubscription {
user: web3.PublicKey;
stake: web3.PublicKey;
adventure: web3.PublicKey;
subscribedAt: BN;
unsubscribedAt: BN;
harvestedAt: BN;
amountOfSolHarvested: BN;
placeholderOne: web3.PublicKey;
publicKey: web3.PublicKey;
}
export interface StakingSettings {
mainVaultBalance: BN;
reserveVaultBalance: BN;
upperRewardsLimit: BN;
lowerRewardsLimit: BN;
placeholderOne: web3.PublicKey;
publicKey: web3.PublicKey;
}
export interface BanxPointsMap {
banxMint: web3.PublicKey;
playerPoints: BN;
partnerPoints: BN;
publicKey: web3.PublicKey;
}
export interface HadoMarketValidation {
hadoMarket: web3.PublicKey;
creatorHash: string;
publicKey: web3.PublicKey;
}
export interface BanxAdventureSubscription {
adventureSubscriptionState: BanxAdventureSubscriptionState;
user: web3.PublicKey;
banxTokenStake: web3.PublicKey;
stakeTokensAmount: BN;
stakeNftAmount: BN;
stakePartnerPointsAmount: BN;
stakePlayerPointsAmount: BN;
subscribedAt: BN;
unsubscribedAt: BN;
harvestedAt: BN;
amountOfTokensHarvested: BN;
amountOfHadesTokensHarvested: BN;
lastClaimedWeek: BN;
nextEpochPlayerPoints: BN;
nextEpochPartnerPoints: BN;
nextEpochNfts: BN;
nextEpochTokens: BN;
publicKey: web3.PublicKey;
}
export declare enum BanxAdventureSubscriptionState {
None = "none",
Active = "active",
Claimed = "claimed"
}
export interface BanxAdventureSubscriptionSnapshot {
adventureSubscriptionState: BanxAdventureSubscriptionState;
user: web3.PublicKey;
week: BN;
stakeTokensAmount: BN;
stakeNftAmount: BN;
stakePartnerPointsAmount: BN;
stakePlayerPointsAmount: BN;
claimedRewards: BN;
lastTransactedAt: BN;
tokensPerPartnerPoints: BN;
publicKey: web3.PublicKey;
}
export interface BanxAdventure {
adventureState: BanxAdventureState;
tokensPerPoints: BN;
week: BN;
periodStartedAt: BN;
periodEndingAt: BN;
rewardsToBeDistributed: BN;
totalPartnerPoints: BN;
totalPlayerPoints: BN;
totalTokensStaked: BN;
totalBanxSubscribed: BN;
amountOfTokensHarvested: BN;
publicKey: web3.PublicKey;
}
export declare enum BanxAdventureState {
None = "none",
Active = "active"
}
export interface BanxStakingSettings {
banxStakingSettingsState: BanxStakingSettingsState;
maxTokenStakeAmount: BN;
tokensPerPartnerPoints: BN;
tokensStaked: BN;
banxStaked: BN;
tokensPerWeek: BN;
rewardsHarvested: BN;
hadesPerWeek: BN;
partnerPointsStaked: BN;
playerPointsStaked: BN;
publicKey: web3.PublicKey;
}
export declare enum BanxStakingSettingsState {
None = "none",
Active = "active"
}
export interface BanxTokenStake {
banxStakeState: BanxTokenStakeState;
user: web3.PublicKey;
adventureSubscriptionsQuantity: BN;
tokensStaked: BN;
partnerPointsStaked: BN;
playerPointsStaked: BN;
banxNftsStakedQuantity: BN;
stakedAt: BN;
unstakedAt: BN;
farmedAmount: BN;
nftsStakedAt: BN;
nftsUnstakedAt: BN;
publicKey: web3.PublicKey;
}
export declare enum BanxTokenStakeState {
None = "none",
Staked = "staked",
Unstaked = "unstaked"
}
export interface SubscribeBanxAdventureParams {
week: BN;
adventureBump: number;
subscriptionBump: number;
}
export declare enum ProposalState {
None = "none",
Initialized = "initialized"
}
export interface Proposal {
state: ProposalState;
nameHash: string;
week: BN;
duration: BN;
pointsQuorum: BN;
participants: BN;
pointsTotal: BN;
creator: web3.PublicKey;
lastTransactedAt: BN;
initializedAt: BN;
publicKey: web3.PublicKey;
}
export interface ProposalVariant {
proposal: web3.PublicKey;
name: string;
state: ProposalState;
participants: BN;
pointsTotal: BN;
lastTransactedAt: BN;
publicKey: web3.PublicKey;
}
export interface ProposalVote {
state: ProposalState;
proposalVariant: web3.PublicKey;
adventureSubscription: web3.PublicKey;
user: web3.PublicKey;
points: BN;
lastTransactedAt: BN;
publicKey: web3.PublicKey;
}
export interface BondOfferV3 extends BondOfferV2 {
liquidationLtvBp: BN;
offerLtvBp: BN;
loanApr: BN;
}
export interface ChangedAccount {
name: string;
publicKey: web3.PublicKey;
}
export type BondingCurveDecodeEnum = {
linear: {};
} | {
exponential: {};
} | {
linearUsdc: {};
} | {
exponentialUsdc: {};
} | {
linearBanxSol: {};
} | {
exponentialBanxSol: {};
};
export type LendingTokenTypeDecodeEnum = {
nativeSol: {};
} | {
usdc: {};
} | {
banxSol: {};
};
export type NftValidationWhitelistTypeDecodeEnum = {
creator: {};
} | {
nft: {};
} | {
merkleTree: {};
} | {
collectionId: {};
} | {
splMint: {};
} | {
coreCollection: {};
};
export type MarketStateDecodeEnum = {
initializing: {};
} | {
available: {};
} | {
initializingPerpetual: {};
} | {
availablePerpetual: {};
} | {
privateAvailablePerpetual: {};
};
export interface ProposalVariant {
proposal: web3.PublicKey;
name: string;
state: ProposalState;
participants: BN;
pointsTotal: BN;
lastTransactedAt: BN;
publicKey: web3.PublicKey;
}
export interface UserVault {
userVaultState: UserVaultState;
user: web3.PublicKey;
lendingTokenType: LendingTokenType;
offerLiquidityAmount: BN;
liquidityInLoansAmount: BN;
repaymentsAmount: BN;
interestRewardsAmount: BN;
rentRewards: BN;
fundsInCurrentEpoch: BN;
fundsInNextEpoch: BN;
lastCalculatedSlot: BN;
lastCalculatedTimestamp: BN;
rewardsToHarvest: BN;
rewardsHarvested: BN;
lastTransactedAt: BN;
publicKey: web3.PublicKey;
}
export declare enum UserVaultState {
None = "none",
Active = "active"
}
export type NFTTypeDecodeEnum = {
pnft: {};
} | {
cnft: {};
};
export type OraclePriceFeedTypeDecodeEnum = {
none: {};
} | {
pyth: {};
} | {
switchboard: {};
};