getChainIdsFromNamespace static method

List<String> getChainIdsFromNamespace({
  1. required String nsOrChainId,
  2. required Namespace namespace,
})

Gets the chains from the namespace. If the namespace is a chain, then it returns the chain. Otherwise it gets the chains from the accounts in the namespace.

Implementation

static List<String> getChainIdsFromNamespace({
  required String nsOrChainId,
  required Namespace namespace,
}) {
  if (isValidChainId(nsOrChainId)) {
    return [nsOrChainId];
  }

  return getChainsFromAccounts(namespace.accounts);
}