CompleteDeferredSpendCommand class
Completes the outstanding deferred payment txid, a transaction the wallet signed only in part: rawHex is the same transaction with the counterparty's signatures on the inputs the wallet does not hold. A sale in one transaction is the case: the buyer signs its coin, the seller its token, and the first to sign records a half that can never be broadcast.
The aggregate refuses unless rawHex is txid with only unlocking
scripts changed, and none of the inputs the payment holds: the same
version, lock time, input outpoints and sequences in order, and the
same outputs byte for byte. Because every input signs SIGHASH_ALL, that
is the transaction the wallet agreed to. The completed transaction is
recorded as an outgoing deferred payment that takes over the hold
(purpose completion:<txid>); txid becomes
DeferredPaymentState.completed and its own pending outputs are voided.
Refused for a payment that is not outstanding or is being reclaimed.
- Inheritance
-
- Object
- WalletCommand
- CompleteDeferredSpendCommand
Constructors
-
CompleteDeferredSpendCommand({required String walletId, required String txid, required String completedTxid, required String rawHex, required String halfRawHex, int fee = 0, List<
String> recipientAddresses = const [], BigInt? paymentAmount, String? commandId, DateTime? timestamp, Map<String, dynamic> ? metadata})
Properties
- commandId → String
-
Unique identifier for this command
Used for deduplication and tracing
no setterinherited
- commandType → String
-
Command type identifier for logging and debugging
no setteroverride
- completedTxid → String
-
Txid of rawHex; it must be the transaction's own id.
final
- correlationId → String
-
finalinherited
- fee → int
-
What the half was recorded with, carried over to the completed
transaction's record: its fee, payees and payment amount (the
coordinator reads them from the half's stored record).
final
- halfRawHex → String
-
The half the wallet recorded as txid (the aggregate keeps no raw
transactions; txid commits to these bytes, and the aggregate checks).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
metadata
→ Map<
String, dynamic> -
finalinherited
- payload → dynamic
-
Override payload to return the command itself for LocalMessage compatibility
no setterinherited
- paymentAmount → BigInt
-
final
-
persistableMetadata
→ Map<
String, dynamic> -
metadataas it is persisted: transientActorRefentries removed.no setterinherited - rawHex → String
-
The completed transaction.
final
-
recipientAddresses
→ List<
String> -
final
- replyTo → ActorRef?
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sender → ActorRef?
-
finalinherited
- timestamp → DateTime
-
finalinherited
- txid → String
-
The half-signed deferred payment.
final
- typeName → String
-
Stable identity of this command type in storage.
no setterinherited
- walletId → String
-
finalinherited
Methods
-
getValidationErrors(
) → List< String> -
Get validation errors
Override in subclasses to provide specific error messages
inherited
-
isValid(
) → bool -
Validate the command
Override in subclasses for custom validation
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCbor(
) → List< int> -
Serialize command to CBOR bytes
inherited
-
toMap(
) → Map< String, dynamic> -
Convert command to a map for serialization.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited