UserOperation.update constructor

UserOperation.update(
  1. Map<String, dynamic> map,
  2. UserOperationGas opGas,
  3. {EthereumAddress? sender,
  4. BigInt? nonce,
  5. String? initCode}
)

Implementation

factory UserOperation.update(
  Map<String, dynamic> map,
  UserOperationGas opGas, {
  EthereumAddress? sender,
  BigInt? nonce,
  String? initCode,
}) {
  map['callGasLimit'] = opGas.callGasLimit;
  map['verificationGasLimit'] = opGas.verificationGasLimit;
  map['preVerificationGas'] = opGas.preVerificationGas;

  if (sender != null) map['sender'] = sender.hex;
  if (nonce != null) map['nonce'] = '0x${nonce.toRadixString(16)}';
  if (initCode != null) map['initCode'] = initCode;

  return UserOperation.fromMap(map);
}