getNamespacesEventsForChain static method
Gets the methods from a namespace map for the given chain id
Implementation
static List<String> getNamespacesEventsForChain({
required String chainId,
required Map<String, Namespace> namespaces,
}) {
List<String> events = [];
namespaces.forEach((String nsOrChain, Namespace namespace) {
if (nsOrChain == chainId) {
events.addAll(namespace.events);
} else {
List<String> chains = getChainsFromAccounts(namespace.accounts);
if (chains.contains(chainId)) {
events.addAll(namespace.events);
}
}
});
return events;
}