estimateUserOperationGas method
- Map<
String, dynamic> userOp, - EthereumAddress entrypoint
override
Estimates the gas cost for a user operation.
userOp
: The user operation.entrypoint
: The entrypoint address through which the operation should pass.
Returns a Future that completes with a UserOperationGas
object.
Implementation
@override
Future<UserOperationGas> estimateUserOperationGas(
Map<String, dynamic> userOp, EthereumAddress entrypoint) async {
require(_initialized, "estimateUserOpGas: Wallet Provider not initialized");
final opGas = await _bundlerRpc.send<Map<String, dynamic>>(
'eth_estimateUserOperationGas', [userOp, entrypoint.hex]);
return UserOperationGas.fromMap(opGas);
}