sendSignedOp method

Future<String> sendSignedOp(
  1. String signature,
  2. UserOperation userOp
)

Implementation

Future<String> sendSignedOp(String signature, UserOperation userOp) async {
  //signature is personal sign (Ethereum signed message signature)
  try {
    userOp.setNonce = "0x" + (userOp.nonce as BigInt).toRadixString(16);
    userOp.setSignature = signature;
    RPCModel response = await _makeRpcRequest(
      'eth_sendUserOperation',
      bundlerURL,
      [userOp.toJson(), entryPointContract.contract.address],
    );
    return response.userOperationHashResult!.userOperationHash!;
  } catch (e) {
    print(e);
    return e.toString();
  }
}