Balance fetcher
Last updated
Last updated
[sdks/ccxt/private/Balance fetcher]
Fetches account balance. More: https://docs.ccxt.com/en/latest/manual.html#account-balance 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. {}@0 received via `query`<br>
3. Sent via `data`:<br>
```<br>
{<br>
"info": [<br>
{<br>
"id": "b4a8e61c-5a17-4f13-b9eb-c55ce83b09bd",<br>
"currency": "BAT",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "6f52651c-8857-4aa7-a95f-462d2775e430",<br>
"currency": "BTC",<br>
"balance": "0.0044732000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0.0044732",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "1787661d-e3a0-46a5-91a2-6c26fb5b45f0",<br>
"currency": "ETH",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "5b3129ec-4797-4829-9d2a-d7d3a271d07c",<br>
"currency": "EUR",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "db4af18b-2880-4a67-9708-58305222acc7",<br>
"currency": "GBP",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "729535e7-f396-4ff6-9cf9-483ff19576c4",<br>
"currency": "LINK",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "899132f0-77a4-405b-9c19-e7919e48f141",<br>
"currency": "USD",<br>
"balance": "9900.0001288976000000",<br>
"hold": "1609.6000000000000000",<br>
"available": "8290.4001288976",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "4292f4e4-9888-44a9-8688-9f3d298858e4",<br>
"currency": "USDC",<br>
"balance": "10000.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "10000",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
}<br>
],<br>
"BAT": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"BTC": {<br>
"free": 0.0044732,<br>
"used": 0,<br>
"total": 0.0044732<br>
},<br>
"ETH": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"EUR": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"GBP": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"LINK": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"USD": {<br>
"free": 8290.4001288976,<br>
"used": 1609.6,<br>
"total": 9900.0001288976<br>
},<br>
"USDC": {<br>
"free": 10000,<br>
"used": 0,<br>
"total": 10000<br>
},<br>
"free": {<br>
"BAT": 0,<br>
"BTC": 0.0044732,<br>
"ETH": 0,<br>
"EUR": 0,<br>
"GBP": 0,<br>
"LINK": 0,<br>
"USD": 8290.4001288976,<br>
"USDC": 10000<br>
},<br>
"used": {<br>
"BAT": 0,<br>
"BTC": 0,<br>
"ETH": 0,<br>
"EUR": 0,<br>
"GBP": 0,<br>
"LINK": 0,<br>
"USD": 1609.6,<br>
"USDC": 0<br>
},<br>
"total": {<br>
"BAT": 0,<br>
"BTC": 0.0044732,<br>
"ETH": 0,<br>
"EUR": 0,<br>
"GBP": 0,<br>
"LINK": 0,<br>
"USD": 9900.0001288976,<br>
"USDC": 10000<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__: ` {optional "params": {string: any}} `
Received the account balance parameters to be fetched.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/manual.html#account-balance<br>
<br>
Example:<br>
```<br>
{ <br>
}<br>
```<br>
### Output ports
* __data__: ` {string: any} `
Sends information about the account balance.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/manual.html#balance-structure<br>
<br>
Example:<br>
```<br>
{<br>
"info": [<br>
{<br>
"id": "b4a8e61c-5a17-4f13-b9eb-c55ce83b09bd",<br>
"currency": "BAT",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "6f52651c-8857-4aa7-a95f-462d2775e430",<br>
"currency": "BTC",<br>
"balance": "0.0044732000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0.0044732",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "1787661d-e3a0-46a5-91a2-6c26fb5b45f0",<br>
"currency": "ETH",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "5b3129ec-4797-4829-9d2a-d7d3a271d07c",<br>
"currency": "EUR",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "db4af18b-2880-4a67-9708-58305222acc7",<br>
"currency": "GBP",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "729535e7-f396-4ff6-9cf9-483ff19576c4",<br>
"currency": "LINK",<br>
"balance": "0.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "0",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "899132f0-77a4-405b-9c19-e7919e48f141",<br>
"currency": "USD",<br>
"balance": "9900.0001288976000000",<br>
"hold": "1609.6000000000000000",<br>
"available": "8290.4001288976",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
},<br>
{<br>
"id": "4292f4e4-9888-44a9-8688-9f3d298858e4",<br>
"currency": "USDC",<br>
"balance": "10000.0000000000000000",<br>
"hold": "0.0000000000000000",<br>
"available": "10000",<br>
"profile_id": "c6d9dc69-1a9a-4439-92e2-1996392ea3be",<br>
"trading_enabled": true<br>
}<br>
],<br>
"BAT": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"BTC": {<br>
"free": 0.0044732,<br>
"used": 0,<br>
"total": 0.0044732<br>
},<br>
"ETH": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"EUR": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"GBP": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"LINK": {<br>
"free": 0,<br>
"used": 0,<br>
"total": 0<br>
},<br>
"USD": {<br>
"free": 8290.4001288976,<br>
"used": 1609.6,<br>
"total": 9900.0001288976<br>
},<br>
"USDC": {<br>
"free": 10000,<br>
"used": 0,<br>
"total": 10000<br>
},<br>
"free": {<br>
"BAT": 0,<br>
"BTC": 0.0044732,<br>
"ETH": 0,<br>
"EUR": 0,<br>
"GBP": 0,<br>
"LINK": 0,<br>
"USD": 8290.4001288976,<br>
"USDC": 10000<br>
},<br>
"used": {<br>
"BAT": 0,<br>
"BTC": 0,<br>
"ETH": 0,<br>
"EUR": 0,<br>
"GBP": 0,<br>
"LINK": 0,<br>
"USD": 1609.6,<br>
"USDC": 0<br>
},<br>
"total": {<br>
"BAT": 0,<br>
"BTC": 0.0044732,<br>
"ETH": 0,<br>
"EUR": 0,<br>
"GBP": 0,<br>
"LINK": 0,<br>
"USD": 9900.0001288976,<br>
"USDC": 10000<br>
}<br>
}<br>
```<br>
<br>
<br>
* __error__: ` {"error": string, optional "details": any} `