Closed KendallWeihe closed 8 months ago
After having a read through this and the other issue, it seems that there is not an existing pain point that this will address. The DX confusion mentioned is possible even with the proposed solutions. A PFI could send a OrderStatus.SUCCESSFUL
followed by an OrderStatus.FAILED
, which is an application level error, not something that can be controlled by the protocol. In fact, keeping Close
as well as OrderStatus
at least allows us to put guard rails in by not allowing subsequent OrderStatuses
after a Close
has been sent.
Also echoing @mistermoe's sentiment that tbdex should not attempt to solve state machines for a bunch of different payment rails, which are PFI dependent.
Originally ideated upon here https://github.com/TBD54566975/tbdex/issues/255#issuecomment-1979684456
Requirement
We need a way for wallet GUI applications to map order execution states (whatever those may be) to given GUI visualizations
Problem
The problem being faced here is one of potential DX confusion cause by duplicate concepts.
The story of a PFI coming to tbdex for the first time may go as such:
OrderStatus
status'"OrderStatus
status' will be something likeCOMPLETED
or maybeEXECUTED
orSUCCESSFULLY_EXECUTED
"Close
thing? Oh I need to also include aClose
message at the end of my order execution even though I already have defined myOrderStatus
for that state"It's entirely possible the above is acceptable in that there does not exist any undoubtedly better alternatives, but nevertheless I think it would be a benefit to explore alternatives if only to rule out the alternatives.
Proposals
Well-defined
OrderStatus
status enumsOne such proposal is in the ticket here https://github.com/TBD54566975/tbdex/issues/256. Which is, we define a set of well-known
OrderStatus
status values which all PFIs must implement, with the expectation PFIs may also implement additionalOrderStatus
statue values (unique to their given situation). Those status' may be, for example, as simple asPENDING
,SUCCESSFUL
andFAILED
. In this proposal, we may no longer have a need for theClose
message, in which case we would remove the duplication.Application-specific
OrderStatus
specificationsWe may choose to rollup (so-to-speak) the responsibility of defining
OrderStatus
state machines into application-specific use cases. For example, one could imagine a tbdex-application specification for blockchain exchanges wherein the order execution is the identical state machine across all blockchain exchanges, and then a different specification for credit cards.