Skip to main content

Mortgage

Overview

Mortgage class is a class with private constructor. You can only get it as a return value of a Rain SDK function, but you cannot initialize it yourself.

Mortgage class represents one mortgage taken by a particular borrower in the Rain protocol.

Structure

{
accountAddress: string; // Mortgage account on-chain address.
status: "ongoing" | "repaid" | "liquidated" | "sold"; // Current status of the mortgage.
borrower: string; // Address of the borrower who took the mortgage.
pool: string; // Address of the pool which gave the mortgage.
mint: string; // Mint address of the NFT purchased using the mortgage.
marketplace: "auctionhouse" | "solanart" | "hyperspace" | "yaww"; // Marketplace, where the NFT was purchased from.
isForSale: boolean; // Boolean specifying if mortgage is listed for sale.
salePrice: number; // If `isForSale` is true, this field will specify listing price.
isFrozen: boolean; // Boolean specifying if mortgage is frozen.
interest: number; // Interest received by the pool.
repaid: number; // Repaid amount.
amount: number; // Mortgage amount.
price: number; // Price of the NFT purchased using the mortgage.
duration: number; // Mortgage duration.
collection: number; // Unique ID of the collection, which purchased NFT belongs to.
liquidation: number; // Collection floor price, which will result in mortgage liquidation.
createdAt: number; // UNIX timestamp when mortgage was created.
expiredAt: number; // UNIX timestamp when mortgage expires.
soldAt: number; // UNIX timestamp when mortgage was sold. Default to 0 (if wasn't sold)
repaidAt: number; // UNIX timestamp when mortgage was repaid. Default to 0 (if wasn't repaid)
liquidatedAt: number; // UNIX timestamp when mortgage was liquidated. Default to 0 (if wasn't liquidated)
};