XRPL-Labs / Xaman-Issue-Tracker

Bugs, improvements, suggestions & release progress (Project boards)
https://xumm.app
14 stars 9 forks source link

[Discuss] Payload websocket updates: return signed TX results (?) #396

Open KoenPaas opened 2 years ago

KoenPaas commented 2 years ago

Now the flow goes as follows:

new WebSocket(url)

1st message = 'welcome'
continues message = { expires_in_seconds: 86400 }
2nd  message = { opened: true }
3rd message = { payload_uuidv4... }

Requested

1st message = 'welcome'
continues message = { expires_in_seconds: 86400 }
2nd  message = { opened: true }
3rd message = { signed: true, txid: 'abcde12345', engine_result: 'tesSUCCESS' } || { rejected: true }
4th message = { payload_uuidv4... }

There is no websocket message when the user has signed the transaction only when it has submitted and included in the XRP ledger.

Request to have a message when the user has signed the transaction with the transaction id to verify the result on the client side when that transaction comes in trough the account subscription.

WietseWind commented 2 years ago

The payload websockets are publicly accessible (as not all WebSocket clients support custom headers and/or auth).

txid is already present in the current response, but not to be trusted without verifying using an API/SDK call:

image

I guess that leaves engine result, network, things like that to be considered, but for that, please specify fields you'd like to be returned currently returned by payload GET.

We can easily add data to the pubsub method, in a scope that already knows the data about to be patched to the payload: https://github.com/XRPL-Labs/xumm-api/blob/master/src/api/v1/app/payload.js#L546

It is a design decision to return not too much information over the (public) websocket, as there's always the easy (and more secure) way to verify information by performing an authorized API/SDK call to GET the payload.

WietseWind commented 2 years ago

@KoenPaas Can you update info based on what we discussed, and close or leave open with updated roadmap suggstion?