-
Notifications
You must be signed in to change notification settings - Fork 1
/
ccxt.d.ts
231 lines (213 loc) · 8.46 KB
/
ccxt.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
declare module 'ccxt' {
export const version: string;
export const exchanges: string[];
export interface Market {
id: string;
symbol: string;
base: string;
quote: string;
info: any;
lot: number;
}
export interface OrderBook {
bids: number[][];
asks: number[][];
timestamp: number;
datetime: string;
}
export interface Trade {
info: {}; // the original decoded JSON as is
id: string; // string trade id
timestamp: number; // Unix timestamp in milliseconds
datetime: string; // ISO8601 datetime with milliseconds;
symbol: string; // symbol in CCXT format
order?: string; // string order id or undefined/None/null
type?: 'market' | 'limit'; // order type, 'market', 'limit' or undefined/None/null
side: 'buy' | 'sell';
price: number; // float price in quote currency
amount: number; // amount of base currency
}
export interface Ticker {
symbol: string,
timestamp: number,
datetime: string,
high: number,
low: number,
bid: number,
ask: number,
vwap?: number,
open?: number,
close?: number,
first?: number,
last?: number,
change?: number,
percentage?: number,
average?: number,
baseVolume?: number,
quoteVolume?: number,
info: {}
}
export class Tickers {
info: any;
[symbol: string]: Ticker;
}
export interface Order {
id: string,
info: {},
timestamp: number,
datetime: string,
status: 'open' | 'closed' | 'canceled',
symbol: string,
type: 'market' | 'limit',
side: 'buy' | 'sell',
price: number,
cost: number,
amount: number,
filled: number,
remaining: number,
fee: number
}
export interface Balance {
free: number,
used: number,
total: number
}
export class Balances {
info: any;
[key: string]: Balance;
}
// timestamp, open, high, low, close, volume
export type OHLCV = [number, number, number, number, number, number];
export class Exchange {
constructor(userConfig?: {});
readonly rateLimit: number;
readonly hasFetchOHLCV: boolean;
public verbose: boolean;
public substituteCommonCurrencyCodes: boolean;
public hasFetchTickers: boolean;
fetch (url: string, method: string, headers?: any, body?: any): Promise<any>;
handleResponse (url: string, method: string, headers?: any, body?: any): any;
loadMarkets (reload?: boolean): Promise<Market[]>;
fetchOrderStatus (id: string, market: string): Promise<string>;
account (): any;
commonCurrencyCode (currency: string): string;
market (symbol: string): Market;
marketId (symbol: string): string;
marketIds (symbols: string): string[];
symbol (symbol: string): string;
createOrder (market: string, type: string, side: string, amount: string, price?: string, params?: any): Promise<any>;
fetchBalance (params?: any): Promise<Balances>;
fetchOrderBook (market: string, params?: any): Promise<OrderBook>;
fetchTicker (market: string): Promise<Ticker>;
fetchTickers (): Promise<Tickers>;
fetchCurrencies (): Promise<any>;
fetchTrades (symbol: string, params?: {}): Promise<Trade[]>;
fetchOHLCV? (symbol: string, params?: {}): Promise<OHLCV[]>;
fetchOrders (symbol?: string, params?: {}): Promise<Order[]>;
fetchOpenOrders (symbol?: string, params?: {}): Promise<Order[]>;
cancelOrder (id: string): Promise<any>;
deposit (currency: string, amount: string, address: string, params?: any): Promise<any>;
withdraw (currency: string, amount: string, address: string, params?: any): Promise<any>;
request (path: string, api?: string, method?: string, params?: any, headers?: any, body?: any): Promise<any>;
}
/* tslint:disable */
export class _1broker extends Exchange {}
export class _1btcxe extends Exchange {}
export class acx extends Exchange {}
export class allcoin extends okcoinusd {}
export class anxpro extends Exchange {}
export class bibox extends Exchange {}
export class binance extends Exchange {}
export class bit2c extends Exchange {}
export class bitbay extends Exchange {}
export class bitcoincoid extends Exchange {}
export class bitfinex extends Exchange {}
export class bitfinex2 extends bitfinex {}
export class bitflyer extends Exchange {}
export class bithumb extends Exchange {}
export class bitlish extends Exchange {}
export class bitmarket extends Exchange {}
export class bitmex extends Exchange {}
export class bitso extends Exchange {}
export class bitstamp extends Exchange {}
export class bitstamp1 extends Exchange {}
export class bittrex extends Exchange {}
export class bl3p extends Exchange {}
export class bleutrade extends bittrex {}
export class braziliex extends Exchange {}
export class btcbox extends Exchange {}
export class btcchina extends Exchange {}
export class btcexchange extends btcturk {}
export class btcmarkets extends Exchange {}
export class btctradeua extends Exchange {}
export class btcturk extends Exchange {}
export class btcx extends Exchange {}
export class bter extends Exchange {}
export class bxinth extends Exchange {}
export class ccex extends Exchange {}
export class cex extends Exchange {}
export class chbtc extends zb {}
export class chilebit extends foxbit {}
export class coincheck extends Exchange {}
export class coinexchange extends Exchange {}
export class coinfloor extends Exchange {}
export class coingi extends Exchange {}
export class coinmarketcap extends Exchange {}
export class coinmate extends Exchange {}
export class coinsecure extends Exchange {}
export class coinspot extends Exchange {}
export class cryptopia extends Exchange {}
export class dsx extends liqui {}
export class exmo extends Exchange {}
export class flowbtc extends Exchange {}
export class foxbit extends Exchange {}
export class fybse extends Exchange {}
export class fybsg extends fybse {}
export class gatecoin extends Exchange {}
export class gateio extends bter {}
export class gdax extends Exchange {}
export class gemini extends Exchange {}
export class getbtc extends _1btcxe {}
export class hitbtc extends Exchange {}
export class hitbtc2 extends hitbtc {}
export class huobi extends Exchange {}
export class huobicny extends huobipro {}
export class huobipro extends Exchange {}
export class independentreserve extends Exchange {}
export class itbit extends Exchange {}
export class jubi extends btcbox {}
export class kraken extends Exchange {}
export class kucoin extends Exchange {}
export class kuna extends acx {}
export class lakebtc extends Exchange {}
export class liqui extends Exchange {}
export class livecoin extends Exchange {}
export class luno extends Exchange {}
export class lykke extends Exchange {}
export class mercado extends Exchange {}
export class mixcoins extends Exchange {}
export class nova extends Exchange {}
export class okcoincny extends okcoinusd {}
export class okcoinusd extends Exchange {}
export class okex extends okcoinusd {}
export class paymium extends Exchange {}
export class poloniex extends Exchange {}
export class qryptos extends Exchange {}
export class quadrigacx extends Exchange {}
export class quoine extends qryptos {}
export class southxchange extends Exchange {}
export class surbitcoin extends foxbit {}
export class therock extends Exchange {}
export class tidex extends liqui {}
export class urdubit extends foxbit {}
export class vaultoro extends Exchange {}
export class vbtc extends foxbit {}
export class virwox extends Exchange {}
export class wex extends liqui {}
export class xbtce extends Exchange {}
export class yobit extends liqui {}
export class yunbi extends acx {}
export class zaif extends Exchange {}
export class zb extends Exchange {}
/* tslint:enable */
}