signers method

Implementation

Future<List<CrossmintWalletSigner>> signers() async {
  final CrossmintWallet walletSnapshot = await walletSnapshotForSigners();
  final List<CrossmintJsonMap> configSigners =
      crossmintConfigSignersFromWallet(walletSnapshot);
  final List<CrossmintWalletSigner> resolved = <CrossmintWalletSigner>[];
  for (final CrossmintJsonMap configSigner in configSigners) {
    final String? signerLocator = crossmintReadSignerLocator(configSigner);
    if (signerLocator == null) {
      continue;
    }
    try {
      final CrossmintWalletSigner? signerState = await client.wallets
          .readSigner(
            walletId: locator,
            signerLocator: signerLocator,
            chain: chain,
          );
      if (signerState != null) {
        resolved.add(signerState);
      }
    } on CrossmintWalletException {
      // Match the JS wallet behavior by dropping failed signer lookups.
    }
  }
  return resolved;
}