exchange.GetAssets
Requests the asset information of the exchange account.
exchange.GetAssets()Examples
Get the asset information of the exchange account. The exchange.GetAssets() function returns an array with Asset structures as elements.
javascript
function main() {
// exchange.SetCurrency("BTC_USDT") // You can set the trading pair
// exchange.SetContractType("swap") // You can set the contract
var assets = exchange.GetAssets()
Log(assets)
}
python
def main():
# exchange.SetCurrency("BTC_USDT") # You can set the trading pair
# exchange.SetContractType("swap") # You can set the contract
assets = exchange.GetAssets()
Log(assets)
rust
fn main() {
// exchange.SetCurrency("BTC_USDT"); // You can set the trading pair
// exchange.SetContractType("swap").unwrap(); // You can set the contract
let assets = exchange.GetAssets().unwrap();
Log!(assets);
}Returns
| Type | Description |
|
|
See Also
Remarks
The GetAssets() function of a futures exchange object queries the margin assets according to the currently set contract: on exchanges that keep separate margin accounts by contract type (for example Futures_GateIO, where perpetual and delivery contracts, and USDT-margined and coin-margined contracts, belong to different accounts), it returns all assets of the account that holds the current contract; on exchanges without separate margin accounts it returns all assets of the account.