getDidDocument static method

Future<DidDocument?> getDidDocument(
  1. String did,
  2. Wallet wallet, {
  3. Client? client,
})

Returns the Did Document associated with the given did, or null if no Did Document was found.

Implementation

static Future<DidDocument?> getDidDocument(
  String did,
  Wallet wallet, {
  http.Client? client,
}) async {
  final url = Uri.parse('${wallet.networkInfo.lcdUrl}/identities/$did');
  final response = await Network.queryChain(url, client: client);
  if (response == null) {
    return null;
  }

  return DidDocument.fromJson(response['did_document']);
}