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

Connect to account with direct navigation parameters #902

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

r-czajkowski
Copy link
Contributor

@r-czajkowski r-czajkowski commented Nov 27, 2024

Closes: AENG-51

To ensure users are directed to the correct LiveApp page for specific actions (such as staking/unstaking) triggered from Ledger Live, the Acre dapp must implement URL parameters to support direct navigation.

We want to connect to the account passed via URL. The Ledger Live App passes the accountId parameter in URL when redirecting to Acre dapp. This parameter has the following pattern js:2:bitcoin_testnet:<xpub>:<address_type>. To connect to a given account we need to get the extended public key from this parameter.

To connect to a given account by xpub we define the new option in the provider: tryConnectToAccountByXpub. The Ledger Live Bitcoin provider will try to find this account and connect.

To ensure users are directed to the correct LiveApp page for specific
actions (such as staking/unstaking) triggered from Ledger Live, the Acre
dapp must implement URL parameters to support direct navigation.

We want to connect to the account passed via URL. The Ledger Live App
passes the `accountId` parameter in URL when redirecting to Acre dapp.
This parameter has the following pattern
`js:2:bitcoin_testnet:<xpub>:<address_type>`. To connect to a given
account we need to get the extended public key from this parameter.

To connect to a given account by xpub we define the new option in the
provider: `tryConnectToAccountByXpub`. The Ledger Live Bitcoin provider
will try to find this account and connect.
Add the `bitcoin.getXpub` method to the `permissions` list. We use this
method to connect to an account by `xpub`.
Copy link

netlify bot commented Nov 27, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit 34a33d5
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/67473d48551554000826ce51
😎 Deploy Preview https://deploy-preview-902--acre-dapp-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 27, 2024

Deploy Preview for acre-dapp ready!

Name Link
🔨 Latest commit 34a33d5
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp/deploys/67473d48a81b4400081303c7
😎 Deploy Preview https://deploy-preview-902--acre-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

linear bot commented Nov 27, 2024

@nkuba nkuba enabled auto-merge November 27, 2024 17:26
@nkuba nkuba merged commit 254e90b into main Nov 27, 2024
28 checks passed
@nkuba nkuba deleted the ledger-live-connect-to-account-from-url branch November 27, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants