IItem

type IItem = {
   address: string;
   tokenId: string;
   itemType: ItemType;
   amount: number;
   isAutoLiquidated: boolean;
   existingPlanId?: number;
   privateSaleId?: number;
};
FieldDescription
addressThe collection address of the item
tokenIdThe token ID of the item
amountThe number of items (must be 0 if the item is ERC721 or CryptoPunks)
itemType1 -> ERC721, 2 -> ERC1155, 3 -> CryptoPunks
isAutoLiquidatedIndicates if the item will use funds from the auto-liquidation (AL) vault or non-AL vault
existingPlanIdIf the item has an existing loan, this field holds the ID of the loan being refinanced
privateSaleIdIndicates if the item is listed for private sale (holds the ID of the private listing)

IItemWithPrice

/** 
The `IItemWithPrice` type extends the `IItem` type by including additional field for item price.
*/

type IItemWithPrice = IItem & {
   price: {
       amount: BigNumber;
       currency: string;
   };
};
FieldDescription
priceThe price of the item. The price object includes a BigNumber string assigned to amount and a currency address assigned to currency

IItemWithSelectedLoanOption

/** 
The `IItemWithSelectedLoanOption` type extends the `IItem` type by including additional fields for pricing,
a loan option, and optional fields for existing plan ID and private sale ID.
*/

type IItemWithLoanOption = IItem & {
    price: BigNumber;
    option: IOption;
    existingPlanId?: number;
    privateSaleId?: number;
}
FieldDescription
priceA BigNumber representing the price or appraisal of the item.
optionAn IOption object representing the loan option associated with the item.
existingPlanIdAn optional number indicating if the item has an existing loan that is being refinanced.
privateSaleIdAn optional number indicating if the item is listed for a private sale.

ISdkPricerStep1Result

type ISdkPricerStep1Result = {
    items: Array<IItem & { 
        price: BigNumber; 
        interestRate: number; 
        options: IOption[] 
    }>;
}
FieldDescription
itemsAn array of items, where each item includes the base IItem fields along with the following properties:
- priceA BigNumber representing the price or appraisal of the item.
-interestRateA number representing the base interest rate for the item.
- optionsAn array of IOption objects, representing various loan plans available for the item.

IPricedItemWithPlan

/** 
The `IPricedItemWithPlan` type extends the `ICreatePlanParams` type by including additional fields 
to indicate changes and optional market information.
*/

type IPricedItemWithPlan = Errored<ICreatePlanParams & { isChanged: boolean; marketName?: string }>
FieldDescription
isChangedA boolean indicating if the item has been modified.
marketNameAn optional string representing the name of the market related to the item.
errorAn optional string that provides an error message if any issues occurred while pricing the item
...ICreatePlanParamsThe fields of ICreatePlanParams

ICreatePlanParams

type ICreatePlanParams = {
  item: {
        amount: number;
        tokenId: string;
        contractAddress: string;
        cyanVaultAddress: string;
        itemType: ItemType;
    };
    plan: {
        amount: BigNumber;
        downPaymentPercent: number;
        interestRate: number;
        serviceFeeRate: number;
        term: number;
        totalNumberOfPayments: number;
        counterPaidPayments: number;
        autoRepayStatus: AutoRepayStatus;
    };
    planId: number;
    blockNum: number;
    signature: string;
}

IOption

type IOption = {
  term: number;
  loanRate: number;

  totalNumberOfPayments: number;
  interestRate: number;
  serviceFeeRate: number;
  downpaymentRate: number;
  counterPaidPayments: number;

  downpaymentAmount: BigNumber;
  monthlyAmount: BigNumber;
}
FieldDescription
termThe loan term in seconds.
loanRateThe loan rate applied for the loan plan.
totalNumberOfPaymentsThe total number of payments required to repay the loan.
interestRateThe interest rate applied to the loan.
serviceFeeRateThe rate of the service fee associated with the loan.
downpaymentRateThe percentage of the total price that must be paid as a downpayment.
counterPaidPaymentsA counter tracking the number of payments already made by the user.
downpaymentAmountA BigNumber representing the amount that needs to be paid upfront as a downpayment.
monthlyAmountA BigNumber representing the amount to be paid each term during the loan's duration.

AutoRepayStatus

enum AutoRepayStatus {
    Disabled = 0,
    FromCyanWallet = 1,
    FromMainWallet = 2,
}
ValueDescription
Disabled (0)Automatic repayments are disabled.
FromCyanWallet (1)Automatic repayments are made from the Cyan Wallet.
FromMainWallet (2)Automatic repayments are made from the Main Wallet.

IPlanType

const PlanTypes = {
    bnpl: 0,
    pawn: 1,
} as const;
type IPlanType = typeof PlanTypes[keyof typeof PlanTypes];
ValueDescription
0Buy Now, Pay Later (BNPL) plan type.
1Pawn plan type.

IPlan

const statusType = {
  Pending: 0,
  Funded: 1,
  Activated: 2,
};
export interface IPlanStatus = typeof statusType[keyof typeof statusType];

interface IPlan {
  planId: number;
  owner: string;
  totalNumOfPayments: number;
  currentNumOfPayments: number;
  status: IPlanStatus;
  type: 'bnpl' | 'pawn';
  paymentPlanContractAddress: string;
  collectionAddress: string;
  autoRepayStatus: AutoRepayStatus;
  tokenId: string;
}
FieldDescription
planIdThe unique identifier for the plan.
ownerThe address of the owner of the plan.
totalNumOfPaymentsThe total number of payments required for the plan.
currentNumOfPaymentsThe number of payments that have been made so far.
statusThe current status of the plan (e.g., Pending, Funded, Activated).
typeThe type of the plan (e.g., 'bnpl' for Buy Now, Pay Later or 'pawn' for Pawn).
collectionAddressThe address of the collection associated with the plan.
tokenIdThe token ID associated with the plan.
paymentPlanContractAddressThe address of the contract managing the payment plan.
autoRepayStatusThe status of automatic repayment.

IOffer

export type IOffer = {
    hash: string;
    contract: string;
    price: {
        currency: {
            contract: string;
            decimals: number;
            symbol: string;
            name: string;
        };
        amount: {
            raw: string;
            decimal: number;
        };
        netAmount: {
            raw: string;
            decimal: number;
        };
    };
    validUntil: number;
}

ICollectionsWithMaxLtvs

/** The `ICollectionsWithMaxLtvs` type represents an array of collection objects, each containing 
    information about the maximum loan-to-value (LTV) ratios for different currencies.
*/

type ICollectionsWithMaxLtvs = {
    address: string;
    maxLtvs: {
        currencyAddress: string;
        maxLtv: number;
    }[];
}[];
FieldDescription
addressThe address of the collection.
maxLtvsAn array of objects, each specifying the maximum loan-to-value (LTV) ratio for a given currency.
currencyAddressThe address of the currency for which the maximum LTV is specified.
maxLtvThe maximum loan-to-value ratio for the given currency, expressed as a percentage.