UserOperation.fromJson constructor

UserOperation.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory UserOperation.fromJson(Map<String, dynamic> json) {
  // print(json);
  // int x = json['preVerificationGas'];
  // print(x);
  // print(x.runtimeType);
  return UserOperation(
    sender: json['sender'],
    nonce: json['nonce'],
    initCode: json['initCode'],
    callData: json['callData'],
    callGasLimit: json['callGasLimit'],
    verificationGasLimit: json['verificationGasLimit'],
    preVerificationGas: BigInt.from(json['preVerificationGas']).toInt(),
    maxFeePerGas: json['maxFeePerGas'],
    maxPriorityFeePerGas: json['maxPriorityFeePerGas'],
    paymasterAndData: json['paymasterAndData'],
    signature: json['signature'],
  );
}