buildSignedTransfer function

Map<String, Object?> buildSignedTransfer({
  1. String networkId = kNetworkId,
  2. required int timestamp,
  3. required Object fee,
  4. required int nonce,
  5. required String senderAddress,
  6. required String publicKey,
  7. required String recipientAddress,
  8. required Object amount,
  9. String? data,
  10. required String privHex,
})

Build a fully-signed transfer body (ready to POST).

Implementation

Map<String, Object?> buildSignedTransfer({
  String networkId = kNetworkId,
  required int timestamp,
  required Object fee,
  required int nonce,
  required String senderAddress,
  required String publicKey,
  required String recipientAddress,
  required Object amount,
  String? data,
  required String privHex,
}) {
  final s = _sign(
      networkId,
      timestamp,
      fee,
      nonce,
      senderAddress,
      privHex,
      p.transferPayload(
          amount: amount, recipientAddress: recipientAddress, data: data));
  return {
    'timestamp': timestamp,
    'fee': normalizeAmount(fee),
    'nonce': nonce,
    'hash': s['hash'],
    'senderAddress': senderAddress,
    'senderSignature': s['signature'],
    'senderPublicKey': publicKey,
    'amount': normalizeAmount(amount),
    'recipientAddress': recipientAddress,
    'data': data,
  };
}