transfer method

  1. @override
Future<String> transfer({
  1. required String networkUrl,
  2. required String privateKey,
  3. required String destinationB256Address,
  4. required int fractionalAmount,
  5. required String assetId,
  6. required int gasPrice,
  7. required int gasLimit,
  8. required int maturity,
})
override

Implementation

@override
Future<String> transfer({
  required String networkUrl,
  required String privateKey,
  required String destinationB256Address,
  required int fractionalAmount,
  required String assetId,
  required int gasPrice,
  required int gasLimit,
  required int maturity,
}) async {
  final provider = await Provider.connect(bridge: _bridge, url: networkUrl);
  final w = await WalletUnlocked.newFromPrivateKey(
    bridge: _bridge,
    provider: provider,
    privateKey: privateKey,
  );

  final response = await w.transfer(
    to: await Bech32Address.fromB256String(
      bridge: _bridge,
      s: destinationB256Address,
    ),
    amount: fractionalAmount,
    asset: assetId,
    txParameters: TxParameters(
      gasPrice: gasPrice,
      gasLimit: gasLimit,
      maturity: maturity,
    ),
  );

  return response.txId;
}