EscrowCreate constructor

EscrowCreate({
  1. required String account,
  2. required BigInt amount,
  3. required String destination,
  4. List<XRPLMemo>? memos = const [],
  5. int? ticketSequance,
  6. DateTime? cancelAfterTime,
  7. DateTime? finishAfterTime,
  8. String? condition,
  9. String? destinationTag,
  10. String signingPubKey = "",
  11. int? sequence,
  12. String? fee,
  13. int? lastLedgerSequence,
})

amount Amount of XRP, in drops, to deduct from the sender's balance and set aside in escrow destination The address that should receive the escrowed XRP when the time or condition is met cancelAfter when this escrow expires. This value is immutable; the funds can only be returned the sender after this time.

finishAfter when the escrowed XRP can be released to the recipient. This value is immutable; the funds cannot move until this time is reached.

condition Hex value representing a PREIMAGE-SHA-256 crypto-condition The funds can only be delivered to the recipient if this condition is fulfilled.

Implementation

EscrowCreate({
  required super.account,
  required this.amount,
  required this.destination,
  super.memos,
  super.ticketSequance,
  DateTime? cancelAfterTime,
  DateTime? finishAfterTime,
  this.condition,
  this.destinationTag,

  /// required super.transactionType,
  super.signingPubKey,
  super.sequence,
  super.fee,
  super.lastLedgerSequence,
})  : assert(() {
        if (cancelAfterTime != null &&
            finishAfterTime != null &&
            finishAfterTime.millisecondsSinceEpoch >=
                cancelAfterTime.millisecondsSinceEpoch) {
          return false;
        }
        return true;
      }(), "The finish_after time must be before the cancel_after time."),
      super(transactionType: XRPLTransactionType.ESCROW_CREATE) {
  if (cancelAfterTime != null) {
    cancelAfter = datetimeToRippleTime(cancelAfterTime);
  } else {
    cancelAfter = null;
  }
  if (finishAfterTime != null) {
    finishAfter = datetimeToRippleTime(finishAfterTime);
  } else {
    finishAfter = null;
  }
}