My trades fetcher
Last updated
Last updated
[sdks/ccxt/private/My trades fetcher]
Loads historical trades. More: https://docs.ccxt.com/en/latest/manual.html#personal-trades YOU CANNOT GET ALL OBJECTS SINCE THE BEGINNING OF TIME TO THE PRESENT MOMENT IN JUST ONE CALL. Practically, very few exchanges will tolerate or allow that. Example:
Received via exchange
:
{<br>
"id":"coinbasepro",<br>
"credentials": {<br>
"apiKey": "API_KEY",<br>
"secret": "SECRET",<br>
"password": "PASSWORD"<br>
},<br>
"sandboxMode": true<br>
}@0<br>
```<br>
2. Received via `query`:<br>
```<br>
{ <br>
"symbol": "BTC/USDT"<br>
}@0<br>
```<br>
3. Sent via `data`:<br>
```<br>
[{<br>
"id": "4bba5198-9aac-4e3e-8e07-8c200daad567",<br>
"info": {<br>
"id": "4bba5198-9aac-4e3e-8e07-8c200daad567",<br>
"price": "100.00000000",<br>
"size": "1.00000000",<br>
"product_id": "BTC-USD",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"side": "buy",<br>
"type": "limit",<br>
"time_in_force": "GTC",<br>
"post_only": false,<br>
"created_at": "2022-08-08T09:30:41.374971Z",<br>
"fill_fees": "0.0000000000000000",<br>
"filled_size": "0.00000000",<br>
"executed_value": "0.0000000000000000",<br>
"status": "open",<br>
"settled": false<br>
},<br>
"timestamp": 1659951041374,<br>
"datetime": "2022-08-08T09:30:41.374Z",<br>
"status": "open",<br>
"symbol": "BTC/USD",<br>
"type": "limit",<br>
"timeInForce": "GTC",<br>
"postOnly": false,<br>
"side": "buy",<br>
"price": 100,<br>
"cost": 0,<br>
"amount": 1,<br>
"filled": 0,<br>
"remaining": 1,<br>
"fee": {<br>
"cost": 0,<br>
"currency": "USD"<br>
},<br>
"trades": [],<br>
"fees": [<br>
{<br>
"cost": 0,<br>
"currency": "USD"<br>
}<br>
]<br>
}]@0 <br>
```<br>
---
### Input ports
* __exchange__:
```
{
"id": string,
optional "credentials": {
"apiKey": string,
"secret": string,
optional "uid": string,
optional "password": string
},
optional "sandboxMode": boolean
}
```
Received the exchange to be used.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/exchange-markets.html<br>
<br>
Example:<br>
```<br>
{<br>
"id": "coinbasepro",<br>
"credentials": {<br>
"apiKey": "API_KEY",<br>
"secret": "SECRET",<br>
"password": "PASSWORD"<br>
},<br>
"sandboxMode": true<br>
}<br>
```<br>
* __query__:
```
{
"symbol": string,
optional "since": number,
optional "limit": number,
optional "params": {string: any}
}
```
Received the trades parameters to be fetched.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/manual.html#personal-trades<br>
<br>
Example:<br>
```<br>
{ <br>
"symbol": "BTC/USDT"<br>
}<br>
```<br>
### Output ports
* __data__:
```
{
"info": any,
"id": string,
optional "datetime": string,
optional "timestamp": number,
"symbol": string,
optional "order": string,
optional "type": ("limit" or "market"),
"side": ("buy" or "sell"),
"takerOrMaker": ("taker" or "maker"),
optional "price": number,
optional "amount": number,
"cost": number,
optional "fee": {"currency": string, "cost": number, "rate": number}
}[]
```
Sends historical trades.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/manual.html#trade-structure<br>
<br>
Example:<br>
```<br>
[<br>
{<br>
"info": {<br>
"symbol": "BTCUSDT",<br>
"id": "994046",<br>
"orderId": "3383621",<br>
"orderListId": "-1",<br>
"price": "24496.40000000",<br>
"qty": "0.06694900",<br>
"quoteQty": "1640.00948360",<br>
"commission": "0.00000000",<br>
"commissionAsset": "USDT",<br>
"time": "1660208141103",<br>
"isBuyer": false,<br>
"isMaker": false,<br>
"isBestMatch": true<br>
},<br>
"timestamp": 1660208141103,<br>
"datetime": "2022-08-11T08:55:41.103Z",<br>
"symbol": "BTC/USDT",<br>
"id": "994046",<br>
"order": "3383621",<br>
"side": "sell",<br>
"takerOrMaker": "taker",<br>
"price": 24496.4,<br>
"amount": 0.066949,<br>
"cost": 1640.0094836,<br>
"fee": {<br>
"cost": 0,<br>
"currency": "USDT"<br>
},<br>
"fees": [<br>
{<br>
"cost": 0,<br>
"currency": "USDT"<br>
}<br>
]<br>
}<br>
]<br>
```<br>
<br>
* __error__: ` {"error": string, optional "details": any} `