@hydro-protocol/hydro-client-js
Version:
Javascript SDK for the Hydro API
102 lines (101 loc) • 3.07 kB
TypeScript
import { BigNumber } from 'bignumber.js';
import { OrderData } from './OrderData';
/**
* Data used to represent an order on the exchange. The values in this class
* may not be set to useful values depending on the source, for example if
* you are looking at data of an order made by someone else it will only contain
* a minimal amount of data, and orders that come through from websocket events
* will also be more stripped down. You can expect the class to contain full
* data whenever creating or querying for your own orders.
*/
export declare class Order {
/**
* The id of the order on the exchange
*/
readonly id: string;
/**
* Which version of hydro was used to construct this order
*/
readonly version: string;
/**
* Which market this order exists on, e.g. "HOT-WETH"
*/
readonly marketId: string;
/**
* The type of order being made, market or limit
*/
readonly type: OrderType;
/**
* Current status of the order
*/
readonly status: string;
/**
* Whether this is a "buy" or a "sell" order
*/
readonly side: Side;
/**
* The account that made this order
*/
readonly account: string;
/**
* Data used by 0x to construct an order.
*
* See https://0xproject.com/wiki#Create,-Validate,-Fill-Order
*/
readonly data?: OrderData;
/**
* The amount of token specified in this order
*/
readonly amount: BigNumber;
/**
* The price of the order
*/
readonly price: BigNumber;
/**
* The average price used for the order so far. This can differ from price when taking into
* account things like price improvement or market orders.
*/
readonly averagePrice: BigNumber;
/**
* The fee rate that will be used for the order maker
*/
readonly makerFeeRate: BigNumber;
/**
* The fee rate that will be used for the order maker
*/
readonly takerFeeRate: BigNumber;
/**
* The rebate rate that will be applied for the order maker
*/
readonly makerRebateRate: BigNumber;
/**
* The amount of gas that will be charged for this order
*/
readonly gasFeeAmount: BigNumber;
/**
* The amount of the the order that is still available to be filled
*/
readonly availableAmount: BigNumber;
/**
* The amount of the order that is currently being filled by a trade,
* but has not been verified on the blockchain yet
*/
readonly pendingAmount: BigNumber;
/**
* The amount of the order that was remaining when the order was
* cancelled
*/
readonly canceledAmount: BigNumber;
/**
* The amount of the order that has been filled by a trade
*/
readonly confirmedAmount: BigNumber;
/**
* Time the order was created
*/
readonly createdAt?: Date;
constructor(json: any);
}
export declare type OrderType = 'limit' | 'market';
export declare type Side = 'buy' | 'sell';
export declare type Status = 'pending' | 'all';