Developer Questions

Ask a Question
Back to All

UI workflow while waiting for the wallet user to scan the QR code

I'm working on something like an NFT marketplace. Say a user with Xumm wallet is on an NFT buy page. They click Buy Now and my backend shoots a request to Xumm API and get the below.

{
uuid: '77f7cde5-54a0-405b-afa6-864f1464693b',
next: {
always: 'https://xumm.app/sign/77f7cde5-54a0-404693b',
no_push_msg_received: 'https://xumm.app/sign/77f7cde5-5464693b/qr'
},
refs: {
qr_png: 'https://xumm.app/sign/77f7cde5-54a0-44693b_q.png',
qr_matrix: 'https://xumm.app/sign/77f7cde5-54a0464693b_q.json',
qr_uri_quality_opts: [ 'm', 'q', 'h' ],
websocket_status: 'wss://xumm.app/sign/77f7cd864f1464693b'
},
pushed: true
}

So, my site will pop-up the QR code at https://xumm.app/sign/77f7cde5-8464693b_q.png and wait for the user to sign using their wallet.

But how should I listen to know when the user has signed the request? Should my frontend listen to the websocket at wss://xumm.app/sign/77f7cde5-5464693b?

Or is there a better way?