UNPKG

zumokit

Version:

ZumoKit is a Wallet as a Service SDK

44 lines (43 loc) 1.55 kB
import { Decimal } from 'decimal.js'; import { ExchangeStatus, CurrencyCode, ExchangeSide, ExchangeJSON, Dictionary } from '../interfaces'; import { Quote } from './Quote'; /** Exchange details. */ export declare class Exchange { /** @internal */ json: ExchangeJSON; /** Identifier */ id: string; /** Exchange status. */ status: ExchangeStatus; /** Exchange pair, e.g. "ETH-GBP". */ pair: string; /** Exchange side, "BUY" or "SELL". */ side: ExchangeSide; /** Exchange quote price. */ price: Decimal; /** Amount in base currency. */ amount: Decimal; /** Debit {@link Account Account} identifier. */ debitAccountId: string; /** Debit {@link Transaction Transaction} identifier. */ debitTransactionId: string | null; /** Credit {@link Account Account} identifier. */ creditAccountId: string; /** Credit {@link Transaction Transaction} identifier. */ creditTransactionId: string | null; /** Exchange rate quote used. */ quote: Quote; /** * Exchange rates at the time exchange was made. * This can be used to display amounts in local currency to the user. */ rates: Dictionary<CurrencyCode, Dictionary<CurrencyCode, Decimal>>; /** Exchange nonce or null. Used to prevent double spend. */ nonce: string | null; /** Epoch timestamp when exchange was created. */ createdAt: number; /** Epoch timestamp when exchange was updated */ updatedAt: number; /** @internal */ constructor(json: ExchangeJSON); }