genTransferTransactionRequest method

  1. @override
Future<(String, String)> genTransferTransactionRequest({
  1. required String destinationB256Address,
  2. required int fractionalAmount,
  3. required String assetId,
})
override

Returns hex string on mobile and json tx request on web

Implementation

@override
Future<(String, String)> genTransferTransactionRequest(
    {required String destinationB256Address,
    required int fractionalAmount,
    required String assetId}) async {
  final to = await fuels.Bech32Address.fromB256String(
      bridge: _rustWalletUnlocked.bridge,
      s: removeHexPrefix(destinationB256Address));
  final (bytes, txIdBytes) = await _rustWalletUnlocked.genTransferTxRequest(
      to: to, amount: fractionalAmount, asset: removeHexPrefix(assetId));
  return (
    addHexPrefix(hex.encode(bytes)),
    addHexPrefix(hex.encode(txIdBytes))
  );
}