buildNamespacesFromAuth static method
Implementation
static Map<String, Namespace> buildNamespacesFromAuth({
required Set<String> methods,
required Set<String> accounts,
}) {
final parsedAccounts = accounts.map(
(account) => account.replaceAll('did:pkh:', ''),
);
final namespaces = getNamespacesFromAccounts(parsedAccounts.toList());
final entries = namespaces.entries.map((e) {
return MapEntry(
e.key,
Namespace.fromJson(e.value.toJson()).copyWith(
methods: methods.toList(),
events: EventsConstants.allEvents,
),
);
});
return Map<String, Namespace>.fromEntries(entries);
}