mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
- [Kraken Fetch Order Trades](./examples/js/)
|
||||
|
||||
|
||||
```javascript
|
||||
import ccxt from '../../js/ccxt.js';
|
||||
|
||||
(async () => {
|
||||
|
||||
const exchange = new ccxt.kraken ({
|
||||
'apiKey': 'YOUR_API_KEY',
|
||||
'secret': 'YOUR_SECRET',
|
||||
// 'verbose': true,
|
||||
})
|
||||
|
||||
const orders = await exchange.fetchClosedOrders ();
|
||||
|
||||
for (let i = 0; i < orders.length; i++) {
|
||||
const order = await exchange.fetchOrder (orders[i]['id']);
|
||||
const trades = await exchange.fetchOrderTrades (order['id'], undefined, undefined, undefined, order);
|
||||
console.log (trades);
|
||||
}
|
||||
|
||||
//
|
||||
// alternatively:
|
||||
//
|
||||
// const params = {
|
||||
// 'trades': [
|
||||
// 'TT5UC3-GOIRW-6AZZ6R',
|
||||
// 'TIY6G4-LKLAI-Y3GD4A',
|
||||
// 'T57FVC-OB4LN-Z55WUL',
|
||||
// 'TIMIRG-WUNNE-RRJ6GT',
|
||||
// ]
|
||||
// }
|
||||
//
|
||||
// const trades = await exchange.fetchOrderTrades (order['id'], undefined, undefined, undefined, params);
|
||||
|
||||
}) ()
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user