Closed bogdan-manole closed 1 year ago
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.
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! 🎉🥕
I think I'm going to deploy first the BE and so we could be all able to test it
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
ConnectWallet
component.payFromWallet
function to accept aPaymentData
object, improving code readability and maintainability.initiatePrivateWalletSignature
function to use stake and change addresses instead of the wallet address, enhancing security.IUserProfile
interface, allowing users to store their address information.walletTransaction.slice.ts
, enhancing application stability.LocalStorageKeys
object for storing certification data.