-
Notifications
You must be signed in to change notification settings - Fork 17
Support multiple address types in wallet handling #21
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
base: main
Are you sure you want to change the base?
Conversation
Extended wallet logic to manage both receive and change address types. Updated address generation, display, and callbacks to distinguish between the two types. Improved error handling and adjusted state updates accordingly.
f7cd377 to
34492e3
Compare
|
Someone is attempting to deploy a commit to the coderofstuff's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
coderofstuff
left a comment
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.
Thanks for this. I have some feedback.
|
|
||
| callbackSetRawAddresses(rawAddresses); | ||
| callback(rawAddresses.filter(addressFilter(lastReceiveIndex))); | ||
| for (let addressType = 0; addressType <= 1; addressType++) { |
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.
The change here makes it so that there is a change address shown for every pair receive address. This is a large change in the UI since if you had 20 receive addresses, you'd now see 40 addresses show up, 20 of which are blank.
lastReceiveAddress is a value stored in the settings to mark the last receive address used. A different one lastChangeAddress can be used for change addresses.
A simpler change to apply for now is:
- On initial scan, scan for:
- Change Addresses, show them first
- Receive Addresses, show them after
- On follow-up loads, scan up to the
lastChangeAddressandlastReceiveAddress
| <Center> | ||
| <Button onClick={generateNewAddress} disabled={!enableGenerate}> | ||
| Generate New Address | ||
| Generate New Addresses |
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.
After applying the fix for maintaining the lastChangeAddress setting too, revert this back. It's simpler for now to just keep generating the Receive address in this legacy UX.
Change addresses in BIP44 compliant wallets (like in LL) are only ever generated through txs anyway.
| <Stack className={styles.small} justify='space-between'> | ||
| <Text className={styles.address} w={width - 40}> | ||
| <AddressText address={row.address} /> | ||
| {row.addressType === 1 ? ' ↩ ' : null} |
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.
Hmm, if we're using icons please use IconArrowBack and also add a tooltip saying it's a Change Address
Extended wallet logic to manage both receive and change address types. Updated address generation, display, and callbacks to distinguish between the two types. Improved error handling and adjusted state updates accordingly.