LedgerHQ / app-near

Ledger repo for Near app
MIT License
11 stars 9 forks source link

Enable "auto-verify" when generating the public key #11

Closed JesseKuntz closed 2 years ago

JesseKuntz commented 2 years ago

Objective

In order to complete the NEAR Ledger Live integration, we need a way to "get the public key" without requiring user interaction.

Issue

The docs in this repo seem to be incorrect - the GET ADDRESS section of the docs mentions that we can use the P1 to either just return the address, or display and then return the address. However, it looks like the p1 is marked as unused here: https://github.com/LedgerHQ/app-near/blob/master/workdir/app-near/src/get_public_key.c#L47

This should instead be used to determine whether or not to display something to the user before returning the public key.

Additional Notes

Some other Nano apps have this functionality, and might be used for reference, for example the Celo app: https://github.com/LedgerHQ/app-celo-spender/blob/master/src/main.c#L182

JesseKuntz commented 2 years ago

@firatNEAR as discussed 👆🏻

JesseKuntz commented 2 years ago

@sgliner-ledger thanks for adding this! Wondering if you can help me with something - the "auto-verification" part works great, but I think I'm missing something with the get_wallet_id part.

When that method is called, I only see this on the screen:

IMG_4698

I think I am passing the correct arguments (same ones as getting the public key, except for the instruction) because the output is the correct address - I just can't seem to get it to show on the screen. Any ideas?