sendVoteOrUnvote method
Future<String>
sendVoteOrUnvote(
- String voterAddress,
- HydraPrivate hydraPrivate,
- String createTx(
- HydraTxBuilder builder,
- SecpPublicKey senderPubKey,
- int nonce
- int? nonce,
Implementation
Future<String> sendVoteOrUnvote(
String voterAddress,
HydraPrivate hydraPrivate,
String Function(
HydraTxBuilder builder,
SecpPublicKey senderPubKey,
int nonce,
)
createTx,
int? nonce,
) async {
final voterBip44PubKey = hydraPrivate.public.keyByAddress(voterAddress);
nonce ??= (await getWalletNonce(voterAddress)) + 1;
final builder = HydraTxBuilder(_networkConfig.network);
final transferTx = createTx(builder, voterBip44PubKey.publicKey(), nonce);
final signedTx = hydraPrivate.signHydraTransaction(
voterAddress,
transferTx,
);
final resp = await sendTx(signedTx.toString());
return resp;
}