Package tbdex.sdk.messages
Class Cancel
-
- All Implemented Interfaces:
-
tbdex.sdk.http.WalletUpdateMessage,tbdex.sdk.messages.Message
public final class Cancel implements Message, WalletUpdateMessage
Represents a Cancel message in the tbDEX protocol.
A Cancel message is sent by Alice to a PFI to terminate an exchange that has not been completed, typically when Alice decides to back out of the transaction or request a refund.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classCancel.Companion
-
Field Summary
Fields Modifier and Type Field Description private final MessageMetadatametadataprivate final CancelDatadataprivate final Stringsignaturepublic final static Cancel.CompanionCompanion
-
Method Summary
Modifier and Type Method Description final MessageMetadatagetMetadata()Metadata about the message, including sender, recipient, and protocol information. final CancelDatagetData()The data part of the Cancel message, which includes the reason for cancellation. final StringgetSignature()The signature verifying the authenticity and integrity of the Cancel message. final StringtoJsonString()Serializes the Cancel message to a JSON string. final Unitsign(BearerDid bearerDid)Signs the Cancel message using the provided Bearer DID. final Unitverify()Verifies the Cancel message's signature and validity. -
-
Method Detail
-
getMetadata
final MessageMetadata getMetadata()
Metadata about the message, including sender, recipient, and protocol information.
-
getData
final CancelData getData()
The data part of the Cancel message, which includes the reason for cancellation.
-
getSignature
final String getSignature()
The signature verifying the authenticity and integrity of the Cancel message.
-
toJsonString
final String toJsonString()
Serializes the Cancel message to a JSON string.
- Returns:
The serialized JSON string of the Cancel message.
-
sign
final Unit sign(BearerDid bearerDid)
Signs the Cancel message using the provided Bearer DID.
- Parameters:
bearerDid- The Bearer DID used to sign the Cancel message.
-
-
-
-