getNamespacesMethodsForChainId function
Implementation
List<String> getNamespacesMethodsForChainId(
SessionNamespaces namespaces,
String chainId,
) {
final List<String> methods = [];
namespaces.values.forEach((namespace) {
final chains = getAccountsChains(namespace.accounts);
if (chains.contains(chainId)) methods.addAll(namespace.methods);
if (namespace.extension != null) {
namespace.extension!.forEach((extension) {
final extensionChains = getAccountsChains(extension.accounts);
if (extensionChains.contains(chainId)) {
methods.addAll(extension.methods);
}
});
}
});
return methods;
}