-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathswap_api.py
605 lines (523 loc) · 30.9 KB
/
swap_api.py
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
class SwapApi:
"""
API definition for Perpetual Contract Trading
"""
async def fetch_markets(self, params=None):
"""
Fetch market information includes precision and limitations of amount, price, and cost
:param params: dict for non-specific parameters
:return: ccxt's market structure https://github.com/ccxt/ccxt/wiki/Manual#market-structure
example: [
{
'id': ' btcusd', // string literal for referencing within an exchange
'symbol': 'BTC/USD', // uppercase string literal of a pair of currencies
'base': 'BTC', // uppercase string, unified base currency code, 3 or more letters
'quote': 'USD', // uppercase string, unified quote currency code, 3 or more letters
'baseId': 'btc', // any string, exchange-specific base currency id
'quoteId': 'usd', // any string, exchange-specific quote currency id
'active': true, // boolean, market status
'taker': 0.002, // Optional, taker fee rate, 0.002 = 0.2%
'maker': 0.0016, // Optional, maker fee rate, 0.0016 = 0.16%
'percentage': true, // Optional, whether the taker and maker fee rate is a multiplier or a fixed flat amount
'tierBased': false, // Optional, whether the fee depends on your trading tier (your trading volume)
'precision': { // number of decimal digits "after the dot"
'price': 8, // Optional, integer or float for TICK_SIZE roundingMode, might be missing if not supplied by the exchange
'amount': 8, // Optional, integer, might be missing if not supplied by the exchange
'cost': 8, // Optional, integer, very few exchanges actually have it
},
'limits': { // value limits when placing orders on this market
'amount': { // Optional
'min': 0.01, // order amount should be > min
'max': 1000, // order amount should be < max
'stepSize': 0.01 // Optional, order amount step size
},
'price': { ... }, // Optional, same min/max limits for the price of the order
'cost': { ... }, // Optional, same limits for order cost = price * amount
},
'info': { ... }, // the original unparsed market info from the exchange
},
... # other pairs
]
"""
raise NotImplementedError()
async def fetch_order_book(self, symbol, params=None):
"""
Fetch current order book
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param params: dict for non-specific parameters
:return: ccxt's order book structure https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure
example:
{
'bids': [
[ price, amount ], // [ Decimal, Decimal ]
[ price, amount ],
...
],
'asks': [
[ price, amount ],
[ price, amount ],
...
],
'timestamp': 1499280391811, // Optional, Unix Timestamp in milliseconds (seconds * 1000)
'datetime': '2017-07-05T18:47:14.692Z', // Optional, ISO8601 datetime string with milliseconds
'nonce': 1499280391811, // Optional, an increasing unique identifier of the orderbook snapshot
}
"""
raise NotImplementedError()
async def create_order(self, symbol, type, side, amount=None, price=None, clientOrderId=None, positionSide=None,
reduceOnly=False, params=None):
"""
Place a new order
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param type: 'limit' or 'market', other types aren't unified yet
:param side: 'sell' or 'buy'
:param amount: amount of the order
:param price: price of the order, or None for market order
:param clientOrderId: unique id generated by client side, will be used to check order when the create_order
API didn't give back result clearly (eg. timeout when request)
:param positionSide: "long" or "short" for Hedge Mode, null or "both" for One-way mode
:param reduceOnly: mark order as close position in dual side mode, or limit order not to open opposite side in
single side mode.
:param params: dict for non-specific parameters
:return: ccxt order structure https://github.com/ccxt/ccxt/wiki/Manual#order-structure
example:
{
'id': '12345-67890:09876/54321', // string
'clientOrderId': 'abcdef-ghijklmnop-qrstuvwxyz', // a user-defined clientOrderId, if any
'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime of 'timestamp' with milliseconds
'timestamp': 1502962946216, // order placing/opening Unix timestamp in milliseconds
'lastTradeTimestamp': 1502962956216, // Unix timestamp of the most recent trade on this order
'status': 'open', // 'open', 'closed', 'canceled'
'symbol': 'ETH/BTC', // symbol
'type': 'limit', // 'market', 'limit'
'side': 'buy', // 'buy', 'sell'
'price': 0.06917684, // Decimal price in quote currency (may be empty for market orders)
'average': 0.06917684, // Decimal average filling price
'amount': 1.5, // ordered amount of base currency
'filled': 1.1, // filled amount of base currency
'remaining': 0.4, // remaining amount to fill
'cost': 0.076094524, // 'average' * 'price' (filling price used where available)
'positionSide':'long', // side of the position, 'long' or 'short' for dual side mode, 'both' for single side mode
'realizedPnl': 0.076094524, // realized profit
'trades': [ ... ], // a list of order trades/executions
'fee': { // fee info, if available
'currency': 'BTC', // which currency the fee is (usually quote)
'cost': 0.0009, // the fee amount in that currency
'rate': 0.002, // the fee rate (if available)
},
'info': { ... }, // the original unparsed order structure as is
}
"""
raise NotImplementedError()
async def fetch_order(self, id=None, symbol=None, clientOrderId=None, params=None):
"""
Fetch one single order with order id or client order id
:param id: order id
:param clientOrderId: unique id generated by client side, will be used to check order when the create_order
API didn't give back result clearly (eg. timeout when request)
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param params: dict for non-specific parameters
:return: ccxt order structure https://github.com/ccxt/ccxt/wiki/Manual#order-structure
example:
{
'id': '12345-67890:09876/54321', // string
'clientOrderId': 'abcdef-ghijklmnop-qrstuvwxyz', // a user-defined clientOrderId, if any
'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime of 'timestamp' with milliseconds
'timestamp': 1502962946216, // order placing/opening Unix timestamp in milliseconds
'lastTradeTimestamp': 1502962956216, // Unix timestamp of the most recent trade on this order
'status': 'open', // 'open', 'closed', 'canceled'
'symbol': 'ETH/BTC', // symbol
'type': 'limit', // 'market', 'limit'
'side': 'buy', // 'buy', 'sell'
'price': 0.06917684, // Decimal price in quote currency (may be empty for market orders)
'average': 0.06917684, // Decimal average filling price
'amount': 1.5, // ordered amount of base currency
'filled': 1.1, // filled amount of base currency
'remaining': 0.4, // remaining amount to fill
'cost': 0.076094524, // 'average' * 'price' (filling price used where available)
'positionSide':'long', // side of the position, 'long' or 'short' for dual side mode, 'both' for single side mode
'realizedPnl': 0.076094524, // realized profit
'trades': [ ... ], // a list of order trades/executions
'fee': { // fee info, if available
'currency': 'BTC', // which currency the fee is (usually quote)
'cost': 0.0009, // the fee amount in that currency
'rate': 0.002, // the fee rate (if available)
},
'info': { ... }, // the original unparsed order structure as is
}
"""
raise NotImplementedError()
async def cancel_order(self, id, symbol, clientOrderId=None, params=None):
"""
Cancel one single order by id or client order id
:param id: order id
:param clientOrderId: unique id generated by client side, will be used to check order when the create_order
API doesn't give back result clearly (eg. timeout when request)
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param params: dict for non-specific parameters
:return: info
example:
{
'info': { ... } // the original response
}
"""
raise NotImplementedError()
async def fetch_orders(self, symbol, since=None, limit=None, fromId=None, direct='next', params=None):
"""
Fetch all orders
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param since: start time of the orders, should be a Unix timestamp in milliseconds
:param limit: limit number of orders in response
:param fromId: start id of the orders
:param direct: "prev" or "next"
:param params: dict for non-specific parameters
:return: a list of ccxt order structures https://github.com/ccxt/ccxt/wiki/Manual#order-structure
example:
[
{
'id': '12345-67890:09876/54321', // string
'clientOrderId': 'abcdef-ghijklmnop-qrstuvwxyz', // a user-defined clientOrderId, if any
'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime of 'timestamp' with milliseconds
'timestamp': 1502962946216, // order placing/opening Unix timestamp in milliseconds
'lastTradeTimestamp': 1502962956216, // Unix timestamp of the most recent trade on this order
'status': 'open', // 'open', 'closed', 'canceled'
'symbol': 'ETH/BTC', // symbol
'type': 'limit', // 'market', 'limit'
'side': 'buy', // 'buy', 'sell'
'price': 0.06917684, // Decimal price in quote currency (may be empty for market orders)
'average': 0.06917684, // Decimal average filling price
'amount': 1.5, // ordered amount of base currency
'filled': 1.1, // filled amount of base currency
'remaining': 0.4, // remaining amount to fill
'cost': 0.076094524, // 'average' * 'price' (filling price used where available)
'positionSide':'long', // side of the position, 'long' or 'short' for dual side mode, 'both' for single side mode
'realizedPnl': 0.076094524, // realized profit
'trades': [ ... ], // a list of order trades/executions
'fee': { // fee info, if available
'currency': 'BTC', // which currency the fee is (usually quote)
'cost': 0.0009, // the fee amount in that currency
'rate': 0.002, // the fee rate (if available)
},
'info': { ... }, // the original unparsed order structure as is
},
...
]
"""
raise NotImplementedError()
async def fetch_open_orders(self, symbol=None, since=None, limit=None, fromId=None, direct='next', params=None):
"""
Fetch all orders in open status
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param since: start time of the orders, should be a Unix timestamp in milliseconds
:param limit: limit number of orders in response
:param fromId: start id of the orders
:param direct: "prev" or "next"
:param params: dict for non-specific parameters
:return: a list of ccxt order structures https://github.com/ccxt/ccxt/wiki/Manual#order-structure
example:
[
{
'id': '12345-67890:09876/54321', // string
'clientOrderId': 'abcdef-ghijklmnop-qrstuvwxyz', // a user-defined clientOrderId, if any
'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime of 'timestamp' with milliseconds
'timestamp': 1502962946216, // order placing/opening Unix timestamp in milliseconds
'lastTradeTimestamp': 1502962956216, // Unix timestamp of the most recent trade on this order
'status': 'open', // 'open', 'closed', 'canceled'
'symbol': 'ETH/BTC', // symbol
'type': 'limit', // 'market', 'limit'
'side': 'buy', // 'buy', 'sell'
'price': 0.06917684, // Decimal price in quote currency (may be empty for market orders)
'average': 0.06917684, // Decimal average filling price
'amount': 1.5, // ordered amount of base currency
'filled': 1.1, // filled amount of base currency
'remaining': 0.4, // remaining amount to fill
'cost': 0.076094524, // 'average' * 'price' (filling price used where available)
'positionSide':'long', // side of the position, 'long' or 'short' for dual side mode, 'both' for single side mode
'realizedPnl': 0.076094524, // realized profit
'trades': [ ... ], // a list of order trades/executions
'fee': { // fee info, if available
'currency': 'BTC', // which currency the fee is (usually quote)
'cost': 0.0009, // the fee amount in that currency
'rate': 0.002, // the fee rate (if available)
},
'info': { ... }, // the original unparsed order structure as is
},
...
]
"""
raise NotImplementedError()
async def fetch_closed_orders(self, symbol, since=None, limit=None, fromId=None, direct='next', params=None):
"""
Fetch all orders in closed and canceled status
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param since: start time of the orders, should be a Unix timestamp in milliseconds
:param limit: limit number of orders in response
:param fromId: start id of the orders
:param direct: "prev" or "next"
:param params: dict for non-specific parameters
:return: a list of ccxt order structures https://github.com/ccxt/ccxt/wiki/Manual#order-structure
example:
[
{
'id': '12345-67890:09876/54321', // string
'clientOrderId': 'abcdef-ghijklmnop-qrstuvwxyz', // a user-defined clientOrderId, if any
'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime of 'timestamp' with milliseconds
'timestamp': 1502962946216, // order placing/opening Unix timestamp in milliseconds
'lastTradeTimestamp': 1502962956216, // Unix timestamp of the most recent trade on this order
'status': 'open', // 'open', 'closed', 'canceled'
'symbol': 'ETH/BTC', // symbol
'type': 'limit', // 'market', 'limit'
'side': 'buy', // 'buy', 'sell'
'price': 0.06917684, // Decimal price in quote currency (may be empty for market orders)
'average': 0.06917684, // Decimal average filling price
'amount': 1.5, // ordered amount of base currency
'filled': 1.1, // filled amount of base currency
'remaining': 0.4, // remaining amount to fill
'cost': 0.076094524, // 'average' * 'price' (filling price used where available)
'positionSide':'long', // side of the position, 'long' or 'short' for dual side mode, 'both' for single side mode
'realizedPnl': 0.076094524, // realized profit
'trades': [ ... ], // a list of order trades/executions
'fee': { // fee info, if available
'currency': 'BTC', // which currency the fee is (usually quote)
'cost': 0.0009, // the fee amount in that currency
'rate': 0.002, // the fee rate (if available)
},
'info': { ... }, // the original unparsed order structure as is
},
...
]
"""
raise NotImplementedError()
async def fetch_my_trades(self, symbol, since=None, limit=None, fromId=None, direct='next', params=None):
"""
Fetch recent deals
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param since: start time of the trades, should be a Unix timestamp in milliseconds
:param limit: limit number of trades in response
:param fromId: start id of the trades
:param direct: "prev" or "next"
:param params: dict for non-specific parameters
:return: a list of ccxt trade structures https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
example:
[
{
'info': { ... }, // the original decoded JSON as is
'id': '12345-67890:09876/54321', // string trade id
'timestamp': 1502962946216, // Unix timestamp in milliseconds
'datetime': '2017-08-17 12:42:48.000', // ISO8601 datetime with milliseconds
'symbol': 'ETH/BTC', // symbol
'order': '12345-67890:09876/54321', // string order id or undefined/None/null
'type': 'limit', // order type, 'market', 'limit' or undefined/None/null
'side': 'buy', // direction of the trade, 'buy' or 'sell'
'takerOrMaker': 'taker', // string, 'taker' or 'maker'
'price': 0.06917684, // Decimal price in quote currency
'amount': 1.5, // amount of base currency
'cost': 0.10376526, // total cost (including fees), `price * amount`
'positionSide': 'long', // side of the position, 'long' or 'short' for dual side mode, 'both' for single side mode
'realizedPnl': 0.076094524, // realized profit
'fee': { // provided by exchange or calculated by ccxt
'cost': 0.0015, // Decimal
'currency': 'ETH', // usually base currency for buys, quote currency for sells
'rate': 0.002, // the fee rate (if available)
},
}
]
"""
raise NotImplementedError()
async def fetch_balance(self, params=None):
"""
Fetch balances in Perpetual Future Account
:param params: dict for non-specific parameters
:return: ccxt balance structure https://github.com/ccxt/ccxt/wiki/Manual#balance-structure
example:
{
'info': { ... }, // the original untouched non-parsed reply with details
//-------------------------------------------------------------------------
// indexed by availability of funds first, then by currency
'free': { // money, available for trading, by currency
'BTC': 321.00, // Decimals...
'USD': 123.00,
...
},
'used': { ... }, // money on hold, locked, frozen, or pending, by currency
'total': { ... }, // total (free + used), by currency
//-------------------------------------------------------------------------
// indexed by currency first, then by availability of funds
'BTC': { // string, three-letter currency code, uppercase
'free': 321.00 // Decimal, money available for trading
'used': 234.00, // Decimal, money on hold, locked, frozen or pending
'total': 555.00, // Decimal, total balance (free + used)
},
'USD': { // ...
'free': 123.00 // ...
'used': 456.00,
'total': 579.00,
},
...
}
"""
raise NotImplementedError()
async def fetch_trading_fee_rates(self, symbol=None, params=None):
"""
Fetch trading fee rates of the user. This is useful if the fee rates are tier-based
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param params: dict for non-specific parameters
:return: a list of fee rate structure
example:
[
{
'symbol': 'ETH/BTC', // symbol
'taker': 0.002, // taker fee rate, 0.002 = 0.2%
'maker': 0.0016, // maker fee rate, 0.0016 = 0.16%
},
...
]
"""
raise NotImplementedError()
async def fetch_positions(self, symbol=None, params=None):
"""
Fetch current position information
For dual side mode, the value of position should always be positive, and positionSide indicates the direction
For single side mode, the sign of the position indicates the current direction, positive for 'long' or negative for 'short
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param params: dict for non-specific parameters
:return: a list of position structure
example:
[
{
'symbol': 'BTC/USDT', // symbol
'position': 0.5, // position in Base amount, if contract_size is specified in exchange, position should be contract_amount * contract_size
'openPrice': 9291.2, // average open price
'markPrice': 9289.9, // current mark price if has
'unrealizedProfit': 224.2532, // unrealized profit with current market price or mark price
'liquidatePrice': 8824.33, // liquidation trigger price
'leverage': 20, // current leverage of the position
'marginType': 'isolated', // margin type of the position, 'isolated' or 'crossed'
'initMargin': 232.28, // initial margin
'positionSide': 'long', // side of the position, 'long' or 'short' for dual side mode, 'both' for single side mode
'info': { ... } // the original response
},
...
]
"""
raise NotImplementedError()
async def change_leverage(self, symbol, leverage, positionSide=None, params=None):
"""
Change leverage setting of the position
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param positionSide: 'long' or 'short' for dual side mode, 'both' for single side mode
:param leverage: leverage
:param params: dict for non-specific parameters
:return: info
example:
{
'info': { ... } // the original response
}
"""
raise NotImplementedError()
async def change_margin_type(self, symbol, marginType, positionSide=None, params=None):
"""
Change margin type of the position
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param positionSide: 'long' or 'short' for dual side mode, 'both' for single side mode
:param marginType: 'isolated' or 'crossed'
:param params: dict for non-specific parameters
:return: info
example:
{
'info': { ... } // the original response
}
"""
raise NotImplementedError()
async def fetch_position_side(self, symbol=None, params=None):
"""
Fetch current position side of the symbol
If the exchange doesn't support changing position side, just leave this to raise NotImplementedError()
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param params: dict for non-specific parameters
:return: position side structure
example: {
'symbol': 'BTC/USDT', // symbol
'positionSide': 'dual', // 'dual' or 'single'
'info': { ... }, // the original response
}
"""
raise NotImplementedError()
async def change_position_side(self, symbol, positionSide, params=None):
"""
Change current position side setting of the symbol
If the exchange doesn't support changing position side, just leave this to raise NotImplementedError()
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param positionSide: 'dual' or 'single'
:param params: dict for non-specific parameters
:return: info
example:
{
'info': { ... } // the original response
}
"""
raise NotImplementedError()
async def fetch_funding_records(self, symbol=None, since=None, limit=None, fromId=None, direct='next', params=None):
"""
Fetch funding fee records
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param since: start time of the records, should be a Unix timestamp in milliseconds
:param limit: limit number of trades in response
:param fromId: start id of the orders
:param direct: "prev" or "next"
:param params: dict for non-specific parameters
:return: a list of funding fee record structure
example:
[
{
'id': '12345-67890:09876/54321', // string trade id
'fundingFee': 0.0211432, // funding fee
'position': 0.5, // position when funding fee was produced
'positionValue': 4588.22315, // value of the position when funding fee was produced, (position * price)
'fundingRate': 0.0001, // funding fee rate
'timestamp': 1502962946216, // Unix timestamp in milliseconds
'info': { ... } // the original response
}
]
"""
raise NotImplementedError()
async def change_isolated_margin(self, symbol, positionSide, direction, amount, params=None):
"""
Change isolated margin
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param positionSide: position side for indicate position, 'long' or 'short' for dual side mode, 'both' for single side mode
:param direction: 'asc' or 'desc'
:param amount: amount
:param params: dict for non-specific parameters
:return: info
example:
{
'info': { ... } // the original response
}
"""
raise NotImplementedError()
async def fetch_incomes(self, symbol=None, since=None, limit=None, fromId=None, direct='next', params=None):
"""
Fetch incomes of the account. Like https://binance-docs.github.io/apidocs/futures/en/#get-income-history-user_data
:param symbol: symbol in ccxt standard format, example: 'BTC/USDT'
:param since: start time of the orders, should be a Unix timestamp in milliseconds
:param limit: limit number of orders in response
:param fromId: start id of the orders
:param direct: "prev" or "next"
:param params: dict for non-specific parameters
:return: income struct
example:
[
{
"symbol": "", // trade symbol, if existing
"incomeType": "TRANSFER", // income type
"income": "-0.37500000", // income amount
"asset": "USDT", // income asset
'time': 1502962946216, // Unix timestamp in milliseconds
"tranId":"9689322392", // transaction id
"tradeId":"" // trade id, if existing
"info": { ... } // the original response
}
]
"""
raise NotImplementedError()