Skip to main content

Function Signature

Future<DelegationStatusResponse> getStatus({
  required String chain,
  required String token,
  required String delegateAddress,
})

Description

Query current delegation state, balances, and active delegations for a specific token and delegate address.

Parameters

ParameterTypeRequiredDescription
chainStringYesCAIP-2 chain ID (e.g., "eip155:11155111" for Sepolia)
tokenStringYesToken symbol or address (e.g., "USDC")
delegateAddressStringYesThe delegate address to query status for

Returns

DelegationStatusResponse - An object containing:
PropertyTypeDescription
chainIdStringChain identifier
tokenStringToken symbol
tokenAddressStringAddress of the token
tokenAccountString?Token account (Solana)
balanceString?Current balance
balanceRawString?Raw balance value
delegationsList<DelegationStatus?>Array of delegation status objects with address and delegate amounts

Example

import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

final status = await portal.delegations.getStatus(
  chain: 'eip155:11155111',
  token: 'USDC',
  delegateAddress: '0x1234...',
);

print('Delegations: ${status.delegations.length}');

Errors

CodeDescription
NOT_INITIALIZEDPortal was not initialized
DELEGATION_FAILEDFailed to get delegation status