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

Remove Ethereum account from wallet context #379

Merged
merged 5 commits into from
May 15, 2024

Conversation

r-czajkowski
Copy link
Contributor

@r-czajkowski r-czajkowski commented Apr 24, 2024

Depends on: #371

This PR removes the Ethereum account from the dapp context to implement Bitcoin native experience. Since the signing Bitcoin messages doesn't work in the Ledger Live Wallet API we temporarily removed this step from the deposit flow.

dapp/src/web3/ledger-live-signer.ts Outdated Show resolved Hide resolved
dapp/src/acre-react/contexts/AcreSdkContext.tsx Outdated Show resolved Hide resolved
We do not need to connect Ethereum account with the dapp since we want
to operate only on the Bitcoin wallet. The Acre SDK will generate the
Ethereum address based on the Bitcoin address under the hood and the
user's identifier should always be bitcoin address and the SDK will take
a care of converting it to Ethereum address under the hood.

Still, some features in the Acre SDK expect the Ethereum address eg. to
get the estimated bitcoin balance. Hence as a temporary solution we set
the ethereum account to zero address to not break the dapp. In the
future we want to completely get rid of the ethereum account from the
dapp wallet context and we will only pass the bitcoin address to the
Acre SDK.
Create the Bitcoin Provider based on the selected bitcoin account id
providede by the Ledger Live Wallet API.
Use `initializeMainnet` or `initializeTestnet` fn to init the Acre SDK.
Now the Acre SDK requires the bitcoin provider not ethereum singer.
@r-czajkowski r-czajkowski marked this pull request as ready for review May 15, 2024 15:11
@nkuba nkuba merged commit c90a92d into bitcoin-native-experience May 15, 2024
20 of 21 checks passed
@nkuba nkuba deleted the remove-eth-account branch May 15, 2024 15:13
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