TypeScript
Comments without added value

by Benny Neugebauer

/**
 * Buy resource
 */
export class Buy implements Resource {
  /**
   * Amount in bitcoin, litecoin or ethereum
   */
  amount: MoneyHash;

  /**
   * Completes a buy that is created in commit: false state.
   * If the exchange rate has changed since the buy was created, this call will fail with the error “The exchange rate
   * updated while you were waiting. The new total is shown below”. The buy’s total will also be updated. You can
   * repeat the `commit` call to accept the new values and start the buy at the new rates. Scope: wallet:buys:create
   */
  commit(cb: (error: Error, transaction: Buy) => void): void;

  /**
   * Has this buy been committed?
   */
  committed: boolean;

  /**
   * Fee associated to this buy
   */
  fees: Fee[];

  /**
   * Hold period for transfer.
   */
  hold_business_days: number;

  /**
   * Was this buy executed instantly?
   */
  instant: boolean;

  /**
   * Is it the first buy for this symbol?
   */
  is_first_buy: boolean;

  /**
   * Associated payment method (e.g. a bank, fiat account)
   */
  payment_method: ResourceRef

  /**
   * When a buy isn’t executed instantly, it will receive a payout date for the time it will be executed. ISO timestamp
   */
  payout_at?: string;

  /**
   * Is there another action required to make the transfer pass?
   */
  requires_completion_step: boolean;

  /**
   * Constant "buy"
   */
  resource: "buy";

  /**
   * Status
   */
  status: BuyStatus;

  /**
   * Fiat amount without fees
   */
  subtotal: MoneyHash;

  /**
   * Fiat amount with fees
   */
  total: MoneyHash;

  /**
   * Associated transaction (e.g. a bank, fiat account)
   */
  transaction: ResourceRef;

  /**
   * Unit price of the base currency.
   */
  unit_price: UnitPrice;
}

export class Buy implements Resource {
  amount: MoneyHash;
  commit(cb: (error: Error, transaction: Buy) => void): void;
  committed: boolean;
  fees: Fee[];
  hold_business_days: number;
  instant: boolean;
  is_first_buy: boolean;
  payment_method: ResourceRef;
  payout_at?: string;
  requires_completion_step: boolean;
  resource: "buy";
  status: BuyStatus;
  subtotal: MoneyHash;
  total: MoneyHash;
  transaction: ResourceRef;
  unit_price: UnitPrice;
}