-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update the dApp to work in Ledger Live #708
Conversation
Based on the template we want to build the ledger live manifest based on the `mainnet`, `testnet` and `development`config. In config we set the correct id, name and url.
✅ Deploy Preview for acre-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for acre-dapp-testnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This PR adds the Ledger Live connector from the orangekit lib.
This PR integrates the app with OrnageKit which delivers the provider for the Ledger Live App. The implementation of Ledger Live App support should not cause regression for previous solutions. The app should catch via the `embed` parameter in the URL if it works under the Ledger Live App. If such a parameter is found, in the wgami configuration we should specify only one right connector. ### Testing - [ ] Do the account connection (connection + signing the message) - [ ] Do the deposit flow. - [ ] Do the withdraw flow.
We configured netlify branch deployments for this feature branch, so we can use `https://ledger-live-updates--acre-dapp-testnet.netlify.app/?embed=ledger-live` here.
0c5345b
to
e32336e
Compare
The connection request should run right away when the user opens the modal window.
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.
I have a problem with the withdrawal flow. When I click the "Withdraw" button, the modal gets switched to Deposit form.
Screen_Recording_2024-11-05_at_12.14.34.mov
eip1193.didUserRejectRequest(error) || | ||
ledgerLive.didUserRejectRequest(error) |
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.
Can we combine these two with one common utils function?
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.
eip1193.didUserRejectRequest(error) || | ||
ledgerLive.didUserRejectRequest(error) |
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.
Can we combine these two with one common utils function?
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.
When the modal is open the buttons on the sidebar don't work. This commit fixes it.
The Ledger throws an error with `Signature interrupted by user` message when a user closes the transaction/sign message native window. We check if the error thrown by Ledger has this message and throw `UserRejectedRequestError` from `viem` to be consistent with orangekit package.
`LEDGER` -> `LEDGER_LIVE`.
Update the url to `bitcoin.acre.fi` and `bitcoin.test.acre.fi`.
This reverts commit 3ce27f4.
We need a single source of true for a connected Bitcoin address, so we store it in the redux store. Otherwise, the `useEffect` hook that fetches the Bitcoin address causes unnecessary updates of other hooks.
Set the full id in config instead of `acre-<id>` template. The `id` for the mainnet must be just `acre`.
Closes: #795 Closes: #799 Closes: #806 ### Changes <details> <summary>Added `AcrePointsCard` component's conditional tooltip (depends if wallet is connected) </summary> <img width="545" alt="image" src="https://github.com/user-attachments/assets/d85ce22d-5f15-40cd-96d1-4848e0bc73fe"> <img width="545" alt="image" src="https://github.com/user-attachments/assets/7d5b4d5f-a215-4e09-b6f1-ed42573bff0c"> </details> <details> <summary>Added `BeehiveCard` component's tooltip</summary> <img width="545" alt="image" src="https://github.com/user-attachments/assets/7097c3f9-9cc2-47c5-bd50-5d4d77a9df34"> </details> <details> <summary>Added `withToolip` prop to `CurrencyBalance` component which renders full (not truncated) amount of the activity</summary> <img width="651" alt="image" src="https://github.com/user-attachments/assets/493f7d1e-f1a7-41e9-b4d6-b32375833795"> </details> ### Note UI changes (colors, sizes) are not included. This PR includes content/functionality changes only.
@@ -101,7 +103,7 @@ export const walletSlice = createSlice({ | |||
const activityId = action.payload | |||
delete state.latestActivities[activityId] | |||
}, | |||
resetState: () => initialState, | |||
resetState: (state) => ({ ...initialState, address: state.address }), |
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.
Why don't we also reset the address state?
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.
It seems that there are no more blocking comments. This PR introduces many improvements to both Standalone and Ledger Live dApp and blocks other PRs.
I'll merge this PR, but @r-czajkowski please address all the unresolved comments in a follow-up PR and @kkosiorowska feel free to propose the improvements.
This is an integration PR that adds the necessary changes for the dapp to run on Ledger Live.
Refs: #730 #742 #763 #759, #760, #797, #780, https://github.com/thesis/orangekit/pull/143, https://github.com/thesis/orangekit/pull/144
Important note
Changes can only be tested in a Ledger Live app built from source. See the Ledger Live repo, how to build from source.