getPrincipal method

  1. @override
Future<Principal> getPrincipal()
override

Returns the principal ID associated with this agent (by default). It only shows the principal of the default identity in the agent, which is the principal used when calls don't specify it.

Implementation

@override
Future<Principal> getPrincipal() async {
  try {
    return (await _identity)!.getPrincipal();
  } catch (e) {
    throw "Cannot fetch identity or principal: $e";
  }
}