Package tbdex.sdk.protocol.models
Object Order.Companion
-
- All Implemented Interfaces:
public class Order.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static Order.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final Ordercreate(String to, String from, String exchangeId, String protocol, String externalId)Creates a new Ordermessage, autopopulating the id, creation time, and message kind.final Orderparse(String payload)Takes an existing Order in the form of a json string and parses it into an Order object. -
-
Method Detail
-
create
final Order create(String to, String from, String exchangeId, String protocol, String externalId)
Creates a new
Ordermessage, autopopulating the id, creation time, and message kind.- Parameters:
to- DID that the message is being sent to.from- DID of the sender.exchangeId- ID of the exchange.protocol- version of the tbdex protocol.externalId- external reference for the order.- Returns:
Order instance.
-
parse
final Order parse(String payload)
Takes an existing Order in the form of a json string and parses it into an Order object. Validates object structure and performs an integrity check using the message signature.
- Parameters:
payload- The Order as a json string.- Returns:
The json string parsed into an Order
-
-
-
-