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