sendTransferTx method
Future<String>
sendTransferTx(
- String senderAddress,
- String targetAddress,
- int amountInFlake,
- HydraPrivate hydraPrivate, {
- int? nonce,
Implementation
Future<String> sendTransferTx(
String senderAddress,
String targetAddress,
int amountInFlake,
HydraPrivate hydraPrivate, {
int? nonce,
}) async {
final senderBip44PubKey = hydraPrivate.public.keyByAddress(senderAddress);
nonce ??= (await getWalletNonce(senderAddress)) + 1;
final builder = HydraTxBuilder(_networkConfig.network);
final transferTx = builder.transfer(
senderBip44PubKey.publicKey(),
targetAddress,
amountInFlake,
nonce,
);
final signedTx = hydraPrivate.signHydraTransaction(
senderAddress,
transferTx,
);
final resp = await sendTx(signedTx.toString());
return resp;
}