revokeMultipleDelegations method

Future<String> revokeMultipleDelegations({
  1. required List<BigInt> nonces,
  2. BigInt? gasLimit,
  3. BigInt? maxFeePerGas,
  4. BigInt? maxPriorityFeePerGas,
})

Revokes multiple delegations in a single transaction.

Implementation

Future<String> revokeMultipleDelegations({
  required List<BigInt> nonces,
  BigInt? gasLimit,
  BigInt? maxFeePerGas,
  BigInt? maxPriorityFeePerGas,
}) async {
  final revocations = <Authorization>[];

  for (final nonce in nonces) {
    final revocation = await createRevocation(nonce: nonce);
    revocations.add(revocation);
  }

  return sendEip7702Transaction(
    authorizationList: revocations,
    gasLimit: gasLimit,
    maxFeePerGas: maxFeePerGas,
    maxPriorityFeePerGas: maxPriorityFeePerGas,
  );
}