Function Signature
Description
Retrieve current balances across different yield positions for one or more wallet addresses.Parameters
YieldXyzGetBalancesQuery fields:
Returns
YieldXyzGetBalancesResponse - An object containing:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get yield balances for wallet addresses.
Future<YieldXyzGetBalancesResponse> getBalances({
required List<YieldXyzGetBalancesQuery> queries,
})
| Parameter | Type | Required | Description |
|---|---|---|---|
queries | List<YieldXyzGetBalancesQuery> | Yes | List of balance queries |
YieldXyzGetBalancesQuery fields:
| Field | Type | Description |
|---|---|---|
address | String | Wallet address to check |
network | String | Blockchain network |
yieldId | String? | Optional specific yield opportunity ID |
YieldXyzGetBalancesResponse - An object containing:
| Property | Type | Description |
|---|---|---|
items | List<YieldBalance?> | List of yield balances by yield opportunity |
errors | List<String?>? | Any errors encountered during balance queries |
metadata | YieldXyzGetBalancesMetadata? | Response metadata |
error | String? | Top-level error message, if any |
import 'package:portal_flutter/portal_flutter.dart';
final portal = Portal();
final response = await portal.yieldIntegrations.yieldxyz.getBalances(
queries: [
YieldXyzGetBalancesQuery(
address: '0x1234...',
network: 'ethereum',
),
],
);
for (final balance in response.items) {
if (balance != null) {
print('Balance: ${balance.amount}');
}
}
| Code | Description |
|---|---|
NOT_INITIALIZED | Portal was not initialized |
YIELD_FAILED | Failed to get yield balances |
Was this page helpful?