Skip to content

Commit

Permalink
merged with prev PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
robertohuertasm committed Dec 8, 2017
1 parent b3fdf31 commit 9a33334
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions ccxt.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module 'ccxt' {

// error.js -----------------------------------------
export class BaseError extends Error {
constructor(message: string);
Expand Down Expand Up @@ -64,7 +64,7 @@ declare module 'ccxt' {
min: number;
}

export interface IMarket {
export interface IMarketInfo {
[key: string]: any
base: string;
id: string;
Expand All @@ -76,6 +76,15 @@ declare module 'ccxt' {
symbol: string;
}

export interface IMarket {
exchange: Exchange;
symbol: string;
market: IMarketInfo;
amountToPrecision(amount: number): number;
createLimitBuyOrder(amount: number, price: number): any;
createLimitSellOrder(amount: number, price: number): any;
}

export interface IOrder {
id: string,
info: {},
Expand All @@ -93,12 +102,6 @@ declare module 'ccxt' {
fee: number
}

export interface IMarketInfo {
exchange: Exchange;
symbol: string;
market: IMarket;
}

export interface IOrderBook {
asks: [number, number][];
bids: [number, number][];
Expand Down Expand Up @@ -167,7 +170,6 @@ declare module 'ccxt' {
constructor(config?: {[key in keyof Exchange]?: Exchange[key]});
// allow dynamic keys
[key: string]: any;

// properties
hash: any;
hmac: any;
Expand Down Expand Up @@ -206,8 +208,8 @@ declare module 'ccxt' {
enableRateLimit: boolean;
countries: string;
// set by loadMarkets
markets: { [symbol: string]: IMarket };
marketsById: { [id: string]: IMarket };
markets: { [symbol: string]: IMarketInfo };
marketsById: { [id: string]: IMarketInfo };
currencies: { [symbol: string]: ICurrency };
ids: string[];
symbols: string[];
Expand Down Expand Up @@ -256,18 +258,18 @@ declare module 'ccxt' {
defineRestApi(api: any, methodName: any, options?: { [x: string]: any }): void;
fetch(url: string, method?: string, headers?: any, body?: any): Promise<any>;
fetch2(path: any, api?: string, method?: string, params?: { [x: string]: any }, headers?: any, body?: any): Promise<any>;
setMarkets(markets: IMarket[], currencies?: ICurrency[]): { [symbol: string]: IMarket };
loadMarkets(reload?: boolean): Promise<{ [symbol: string]: IMarket }>;
setMarkets(markets: IMarketInfo[], currencies?: ICurrency[]): { [symbol: string]: IMarketInfo };
loadMarkets(reload?: boolean): Promise<{ [symbol: string]: IMarketInfo }>;
fetchTicker(symbol: string, params?: { [x: string]: any }): Promise<ITicker>;
fetchTickers(symbols?: string[], params?: { [x: string]: any }): Promise<{ [x: string]: ITicker }>;
fetchMarkets(): Promise<IMarket[]>;
fetchMarkets(): Promise<IMarketInfo[]>;
fetchOrderBook(symbol: string): Promise<IOrderBook>;
fetchOrderStatus(id: string, market: string): Promise<string>;
encode(str: string): string;
decode(str: string): string;
account(): IBalance;
commonCurrencyCode(currency: string): string;
market(symbol: string): IMarket;
market(symbol: string): IMarketInfo;
marketId(symbol: string): string;
marketIds(symbols: string[]): string[];
symbol(symbol: string): string;
Expand Down

0 comments on commit 9a33334

Please sign in to comment.