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

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

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

  downpaymentAmount: BigNumber;
  monthlyAmount: BigNumber;
};

IItem & IItemWithPrice

type IItem = {
	address: string;
	tokenId: string;
	itemType: ItemType;
	amount: number;
};
type IItemWithPrice = IItem & {
	price: BigNumber;
};

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;
}