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

ValidateTransferError: invalid memo keys #230

Open
Luchanso opened this issue Mar 6, 2024 · 3 comments
Open

ValidateTransferError: invalid memo keys #230

Luchanso opened this issue Mar 6, 2024 · 3 comments

Comments

@Luchanso
Copy link

Luchanso commented Mar 6, 2024

Tryed call validateTransfer(...) and got some error for valid transaction:

ValidateTransferError: invalid memo keys
    at validateMemo (D:\dev\ssr\node_modules\@solana\pay\src\validateTransfer.ts:97:40)
    at D:\dev\ssr\node_modules\@solana\pay\src\validateTransfer.ts:88:9
    at Generator.next (<anonymous>)
    at fulfilled (D:\dev\ssr\node_modules\@solana\pay\lib\cjs\validateTransfer.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Simple playground: https://codesandbox.io/p/devbox/hardcore-mclaren-qtz7zg?file=%2Findex.js%3A28%2C7

function validateTransfer(...) not correct work when pass memo string, I think it's can be bug on: https://github.com/anza-xyz/solana-pay/blame/master/core/src/validateTransfer.ts#L97 because "instruction.keys" must contain single key about Signer
image

@moulin-louis
Copy link

Hey 👋 I’m facing the same issue, did you manage to solve this ? Or the bug is still around ?
Thanks a lot !

@rinkaaan
Copy link

I am also facing same issue... this is serious, I am trying to use memo to authenticate Solana Pay payments on server side.
I was going to use reference field but apparently many Solana mobile wallets don't even include the reference in the transfer transaction!

@Luchanso
Copy link
Author

Luchanso commented Jun 14, 2024

Workaround: create this file with commented this line in your local project, and use this function from it:

https://gist.github.com/Luchanso/2b3e7c4f7d9ce8a6128ebe7ed004cec8#file-validate-ts-L98

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

3 participants