Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Solana Pay transaction request error handling #150

Open
samheutmaker opened this issue Aug 28, 2022 · 0 comments
Open

Specify Solana Pay transaction request error handling #150

samheutmaker opened this issue Aug 28, 2022 · 0 comments

Comments

@samheutmaker
Copy link
Contributor

samheutmaker commented Aug 28, 2022

The current Solana Pay standard does not formally specify how dapps should pass error messages to a wallet during a transaction request. Each wallet handles errors differently, with most wallets simply informing the user the request failed but offering no other context. This results in degraded UX and unnecessary overhead for developers as they are forced to use work-arounds (like sending memo transactions along with a message in the response) that are far from perfect and not documented.

This is an attempt to standardize how error messages are sent from dapps and displayed in wallets by making two simple changes to the specification. The changes are:

  1. The transaction field in the response object should be nullable. The following response should be considered valid, and the message should be displayed in the wallet.
{
  "transaction": null,
  "message": "This QR Code is only available between 1-5pm UTC"
}
  1. Wallets should always display at least the first 80 characters of a non-null message field. The number of characters currently displayed varies from wallet to wallet making it difficult for dapps to respond with appropriately sized messaged. For example, Phantom iOS truncates the message field with an ellipsis depending on screen size. Solflare and Glow both display the entire message. While we generally don't want to be overly prescriptive in how wallets behave, adding this constraint will improve the developer experience and ultimately result in better Solana Pay applications.

PR for this work is #151.

All feedback is welcome. I am available on telegram @samhogan for questions or comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant