getApprovedMethods method

List<String>? getApprovedMethods()

Implementation

List<String>? getApprovedMethods() {
  if (sessionService.noSession) {
    return null;
  }
  if (sessionService.isCoinbase) {
    return CoinbaseService.supportedMethods;
  }
  if (sessionService.isMagic) {
    return MagicService.supportedMethods;
  }

  final sessionNamespaces = _sessionData!.namespaces;
  final namespace = sessionNamespaces[CoreConstants.namespace];
  final methodsList = namespace?.methods.toSet().toList();
  return methodsList ?? [];
}