input-output-hk / dapps-certification-web

Certification as a service for the Cardano dApps platform
Apache License 2.0
5 stars 0 forks source link

feat: switch to stake-address & Yoroi support (PLT-7455) #11

Closed bogdan-manole closed 1 year ago

bogdan-manole commented 1 year ago

We found that Yoroi wallet is generating new addresses every-time one is used.

That will create new profiles for each of them

In fact that might become the case in other wallets as well, the solution would be to use the stake address instead the payment address for login/signing since that should remain unchanged between the same wallet accounts.

Refs: PLT-7455

Summary by CodeRabbit

coderabbitai[bot] commented 1 year ago

Walkthrough

This update introduces changes to the wallet connection and transaction process, including the addition of stake and change addresses. It also refactors the payment functionality, adds new local storage keys, and updates various components to accommodate these changes.

Changes

File(s) Summary
src/components/ConnectWallet/ConnectWallet.tsx
src/components/Header/Header.tsx
Introduced a function to retrieve stake and change addresses from a wallet and updated components to use these addresses.
src/components/CreateCertificate/CreateCertificate.tsx
src/pages/subscription/payment/Payment.tsx
Updated the payFromWallet function call to include the payer property.
src/constants/constants.ts Added new keys to the LocalStorageKeys object for storing certification data.
src/pages/userProfile/userProfile.interface.ts Added an optional "address" field to the IUserProfile interface.
src/store/slices/auth.slice.ts Minor formatting change in the localStorage.setItem line.
src/store/slices/walletTransaction.slice.ts Refactored the payFromWallet function to improve payment functionality and handle different scenarios.

🐇💻

Code hopping through the fields,

With every keystroke, power it wields.

New paths are forged, old ones refined,

In the realm of code, treasures we find! 🎉🥕

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
bogdan-manole commented 1 year ago

I think I'm going to deploy first the BE and so we could be all able to test it