removeSigner method

  1. @override
Future<CrossmintTransactionDetails> removeSigner({
  1. required String walletId,
  2. required String signerLocator,
  3. String? chain,
  4. String? approver,
})
override

Creates the removal transaction. The signer stays on the wallet until a recovery method approves it; the runtime wallet's removeSigner does.

chain is the wallet's concrete chain. EVM locators carry only the family, so without it EVM falls back to base-sepolia.

approver names which recovery method authorizes this operation. It is required by the backend when the wallet holds more than one recovery method, and must be omitted otherwise.

Implementation

@override
Future<CrossmintTransactionDetails> removeSigner({
  required String walletId,
  required String signerLocator,
  String? chain,
  String? approver,
}) async {
  final String resolvedChain = chain != null && chain.trim().isNotEmpty
      ? chain
      : await _resolveWalletChainForSignerRegistration(walletId);
  final CrossmintJsonMap response = await _service.unregisterSigner(
    walletId,
    signerLocator,
    // Only EVM needs the concrete network; Solana and Stellar reject it.
    chain: _chainResolver.chainTypeForChain(resolvedChain) == 'evm'
        ? resolvedChain
        : null,
    approver: approver,
  );
  return WalletResponseParser.transactionFromMap(response);
}