getApprovedEvents method
Implementation
List<String>? getApprovedEvents({String? namespace}) {
final eventsList = <String>[];
if (sessionService.noSession) {
return null;
}
if (sessionService.isCoinbase) {
return eventsList;
}
if (sessionService.isMagic) {
return eventsList;
}
final sessionNamespaces = _sessionData!.namespaces;
if ((namespace ?? '').isEmpty) {
for (var namespace in sessionNamespaces.keys) {
final events = sessionNamespaces[namespace]?.events ?? [];
eventsList.addAll(events);
}
return eventsList;
}
return sessionNamespaces[namespace]?.events ?? [];
}