transfer method

Future<String?> transfer(
  1. String address,
  2. String amount, {
  3. String fee = '0',
  4. int? nonce,
  5. Uint8List? attributes,
})

transfer sends asset to a wallet address with a transaction fee. Amount is the string representation of the amount in unit of NKN to avoid precision loss. For example, "0.1" will be parsed as 0.1 NKN. The signerRPCClient can be a client, multiclient or wallet.

Implementation

Future<String?> transfer(String address, String amount,
    {String fee = '0', int? nonce, Uint8List? attributes}) async {
  try {
    return await _methodChannel.invokeMethod('transfer', {
      'seed': this.seed,
      'address': address,
      'amount': amount,
      'fee': fee,
      'nonce': nonce,
      'attributes': attributes,
      'seedRpc':
          this.walletConfig.seedRPCServerAddr ?? [DEFAULT_SEED_RPC_SERVER],
    });
  } catch (e) {
    rethrow;
  }
}