-
Notifications
You must be signed in to change notification settings - Fork 194
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
fix: Blink connector to use the API key from the Blink Dashboard #2887
fix: Blink connector to use the API key from the Blink Dashboard #2887
Conversation
d55ff92
to
1c7aa64
Compare
Hi @openoms I tried this out and managed to successfully pay and receive lightning invoices. But I seem to have no history: Also, what happens if the user's token is invalid (e.g. an old jwt token or a new API token that has expired, especially since the default is 90 days now). Do they just receive an error message and have to delete their extension account and add a new one? (This becomes more problematic as users have to migrate e.g. their master key / nostr key. For example, the Alby connector will allow you to re-login if your auth token has expired) |
e31b93d
to
6ed7201
Compare
Thank you for the feedback! Implemented and tested the transaction history now (returns the last 100 transactions max): In Blink there are two balances: BTC and Stablesats (synthetic USD) Agree that it is important to be able to relogin to the same account so I am testing the workflow of the token expiration next. Note: since the connector is also used for Bitcoin Jungle checked for compatibility. Bitcoin Jungle only has BTC denomination: https://github.com/Bitcoin-Jungle/galoy/blob/3c31dec0728b0ab3484ee5cecbdf2daadc5467a4/src/graphql/main/schema.graphql#L857 so the changes should not affect it. However I cannot test as the wallet does not expose the authentication token any more. edit: had an old connection with Bitcoin Jungle so could extract the key and testing. |
After discussing the various possibilities of dealing with the expired API key came to the conclusion of simply creating a longer (or non expiring) API key would be the best trade-off. If the user would have other services (like Nostr) connected to the account they should can still migrate with the Master Key. The Blink Dashboard will have the option to select a non-expiring key as well so added the relevant notes to the connector screen: Please let me know if there are more changes expected. |
@openoms I tried to test it again using the account I created before and I get this now: I am pretty sure I made the API key with the default expiry. Now I tried to login to my blink account again (I used phone number to sign up) but I cannot seem to login using that form any more. Can you help me out? |
@rolznz was your old account logged in with and API key ( You should be able to log in to the dashboard with the number again if you click on I have run a couple new rounds of tests manually and still working. |
@openoms I only created the API key when testing this PR, so it should still be valid. But I cannot login with my phone number (starts with +666) as the input at https://dashboard.blink.sv/ only seems to allows logging in with email. My phone number doesn't pass the regex validation. Without entering anything in the field, it asks me to fill it out before continuing. How do I login with phone number? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
Thanks for your PR @openoms! Just tested it and worked like a charm! I noticed one minor detail: Existing users that use the Blink with the current implementation will see errors after the upgrade: I don't see an easy path to migrate them. I guess it shouldn't be too many users though... |
+1 for tackling that in a separate PR, we already have the foundation to support fiat-denominated accounts (was introduced quite some time back for the Kollider connector). However, in Alby they would have 3 separate accounts for that (BTC, USD, EUR) as we don't have any hierarchy for wallets yet. (users select which currency they want to use at the time of connecting their account) If you want to get a first idea of how that could work take a look at the Kollider connector: Happy to collaborate and answer any questions you might have. 🙌 |
Thank you for the review @reneaaron! I also found an outstanding edge case where the The memo issue is known and needs a fix in the backend: GaloyMoney/blink#2449 which when done should show up correctly in Alby. Thank you for the clue about following the Kollider connector for Stablesats, will do that and will ask the related question separately. |
update link to the graphql endpoint remove deprecated link to web wallet
fix: use walletId to identify wallet docs: default no expiry API key
5356be0
to
dc7e961
Compare
Rebased on the latest master, awaiting the checks. |
@openoms Just did a final round of testing and the legacy accounts now work as well! Thanks for the PR! 💯 |
@openoms I didn't notice in this PR (these lines were not changed) but @bumi mentioned sendPayment in this connector does not return the preimage. Can this be added? Also I noticed there it also will return without a preimage if the payment is in "PENDING" state. But lightning payments should technically be instant in most cases, right? or is this for HODL invoices? CC @reneaaron |
Update: I saw Rene made an issue here: #2946 |
Fix the problem that the current method to connect the Blink wallet does not work.
Change the header to use the new method for the API key
Add instructions to the connector page about generating the API key.
Remove translations referencing the deprecated method of log in through the discontinued web wallet.
Use the staging endpoint of a
galoy_staging_
API key is used.Fix the checkPayment function
Fixes #2881
fix
: Bug fix (non-breaking change which fixes an issue)Screenshots:
How has this been tested?
Tested manually through building the extension, connected to the Galoy staging and Blink mainnet.
Generating an invoice, checking if received and sending to LN invoice functions are working.
Known remaining issues (to be addressed separately):
lntbs..
):Unknown coin bech32 prefix
Checklist