Hierarchy

  • HoneyUser

Implements

  • User

Constructors

Properties

_deposits: TokenAmount[] = []
_loans: TokenAmount[] = []
address: PublicKey
client: HoneyClient
conn: Connection
market: HoneyMarket
reserves: HoneyReserve[]

Methods

  • Get all the deposits held by the user, excluding those amounts being used as collateral for a loan.

    Returns TokenAmount[]

  • fetch the user specfic allowance and debt

    Returns

    Parameters

    • index: number

      index of the reserve to use for the calculation

    • cluster: "mainnet-beta" | "devnet" | "localnet" | "testnet" = 'mainnet-beta'

      which cluster to connect to

    Returns Promise<{ allowance: number; debt: number; exponent: number; liquidationThreshold: number; ltv: number; ratio: BN }>

  • Returns

    totalDeposits / decimals

    Parameters

    • index: number

    Returns Promise<number>

  • Find collateral account for the reserve, obligation and wallet.

    Parameters

    • program: Program<Idl>
    • reserve: PublicKey
    • obligation: PublicKey
    • wallet: PublicKey

    Returns Promise<[collateralPubkey: PublicKey, collateralBump: number]>

  • Find reserve deposit note account for wallet

    Parameters

    • program: Program<Idl>
    • reserve: PublicKey
    • wallet: PublicKey

    Returns Promise<[depositNotePubkey: PublicKey, depositAccountBump: number]>

  • Find loan note token account for the reserve, obligation and wallet.

    Parameters

    • program: Program<Idl>
    • reserve: PublicKey
    • obligation: PublicKey
    • wallet: PublicKey

    Returns Promise<[loanNotePubkey: PublicKey, loanNoteBump: number]>

  • Find a program derived address

    Returns

    The address found and the bump seed required

    Parameters

    • programId: PublicKey

      The program the address is being derived for

    • seeds: (string | Uint8Array | HasPublicKey | ToBytes)[]

      The seeds to find the address

    Returns Promise<[PublicKey, number]>

  • Get the loans held by the user

    Returns TokenAmount[]

  • Parameters

    • tokenAccount: PublicKey
    • tokenMint: PublicKey
    • updateAuthority: PublicKey

    Returns Promise<Transaction>

  • Parameters

    • tokenAccount: PublicKey
    • tokenMint: PublicKey
    • depositor: PublicKey
    • nftCollectionCreator: PublicKey

    Returns Promise<Transaction>

  • Parameters

    • tokenAccount: PublicKey
    • tokenMint: PublicKey
    • nftCollectionCreator: PublicKey

    Returns Promise<Transaction>

  • Parameters

    • tokenAccount: PublicKey
    • tokenMint: PublicKey
    • depositor: PublicKey
    • updateAuthority: PublicKey

    Returns Promise<actions.TxResponse>

Generated using TypeDoc