Documentation Index
Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
Use this file to discover all available pages before exploring further.
Function Signature
Future<PortalClientInfo> getClient()
Description
Retrieves client information from the Portal backend, including the client ID and list of wallets.
Parameters
This method takes no parameters.
Returns
PortalClientInfo - An object containing:
| Property | Type | Description |
|---|
id | String | The client ID |
wallets | List<PortalWallet?> | List of wallets |
PortalWallet
| Property | Type | Description |
|---|
id | String | Wallet ID |
curve | String | The cryptographic curve used (e.g., “secp256k1”, “ed25519”) |
ejectableUntil | String? | ISO timestamp until which private keys can be ejected (null if not ejectable) |
Example
import 'package:portal_flutter/portal_flutter.dart';
final portal = Portal();
final clientInfo = await portal.getClient();
print('Client ID: ${clientInfo.id}');
for (final wallet in clientInfo.wallets) {
if (wallet != null) {
print('Wallet ID: ${wallet.id}');
print('Curve: ${wallet.curve}');
if (wallet.ejectableUntil != null) {
print('Ejectable until: ${wallet.ejectableUntil}');
}
}
}
Use Cases
Check Eject Availability
final clientInfo = await portal.getClient();
for (final wallet in clientInfo.wallets) {
if (wallet != null && wallet.ejectableUntil != null) {
final ejectableUntil = DateTime.parse(wallet.ejectableUntil!);
if (DateTime.now().isBefore(ejectableUntil)) {
print('Wallet ${wallet.id} can be ejected until ${wallet.ejectableUntil}');
}
}
}
Errors
| Code | Description |
|---|
NOT_INITIALIZED | Portal was not initialized |
FETCH_FAILED | Failed to fetch client information |