initiateTransaction method
Implementation
Future<Status> initiateTransaction(
{required String gateway,
required String accessToken,
required RequestTransactionPayloadReq initiatePayload,
required String imagePath,
required String privateKeyString,
Duration idleTimeout = const Duration(minutes: 15)}) async {
RubixServiceClient stub = getConnection(
gateway: gateway, accessToken: accessToken, idleTimeout: idleTimeout);
RequestTransactionPayloadRes response =
await stub.initiateTransaction(RequestTransactionPayloadReq(
receiver: initiatePayload.receiver,
tokenCount: initiatePayload.tokenCount,
comment: initiatePayload.comment,
type: initiatePayload.type,
));
var privateKey = KeyPair().privateKeyFromPem(privateKeyString);
print("Initiate Transaction Response: ${response}");
var signResp = signResponse(
initiateTransactionResponse: response,
imagePath: imagePath,
privateKey: privateKey,
stub: stub,onlyPrivateKey: false);
return signResp;
}