sendTransferTxWithPassphrase method

  1. @Deprecated('Not red carpet methods are not used anymore. Use sendTransferTx')
Future<String> sendTransferTxWithPassphrase(
  1. String passphrase,
  2. String targetAddress,
  3. int amountInFlake, {
  4. int? nonce,
})

Implementation

@Deprecated('Not red carpet methods are not used anymore. Use sendTransferTx')
Future<String> sendTransferTxWithPassphrase(
  String passphrase,
  String targetAddress,
  int amountInFlake, {
  int? nonce,
}) async {
  final secpPrivKey = SecpPrivateKey.fromArkPassphrase(passphrase);
  final senderPubKey = secpPrivKey.publicKey();
  nonce ??= (await getWalletNonce(senderPubKey.toString())) + 1;

  final builder = HydraTxBuilder(_networkConfig.network);
  final transferTx = builder.transfer(
    senderPubKey,
    targetAddress,
    amountInFlake,
    nonce,
  );

  final signedTx = secpPrivKey.signHydraTransaction(transferTx);

  final resp = await sendTx(signedTx.toString());
  return resp;
}