[Cashtab] [Alias] pt 10 - Enable alias inputs for one to one Send XEC txs
Summary:
T2551
This is a standalone diff that enables the use of aliases for one to one XEC txs. When the address input is parsed to be an alias (ends in .xec) it will override the existing ecash address validation logic and check whether this alias exists in cashtabCache. If it exists, the corresponding ecash address is retrieved.
[Cashtab] [Alias] pt 1 - Create scaffold for new Alias component
[Cashtab] [Alias] pt 2 - Upgrade sendXec() to handle alias registration
[Cashtab] [Alias] pt 3 - Implement isAliasAvailable function
[Cashtab] [Alias] pt 4 - Implement isAddressRegistered function
[Cashtab] [Alias] pt 5 - Implement getAddressFromAlias function
[Cashtab] [Alias] pt 6.1 - Get latest alias tx count from payment address
[Cashtab] [Alias] pt 6.1.1 - Apply Promise.All approach for alias history retrieval
[Cashtab] [Alias] pt 6.2 - Implement getAliasesFromLocalForage
[Cashtab] [Alias] pt 6.3 - Implement updateAliases
[Cashtab] [Alias] pt 6.4 - Update getAliases() to extract both alias and address
[Cashtab] [Alias] pt 6.5 - Optimize getAllTxHistory to only make API calls for uncached tx history pages
[Cashtab] [Alias] pt 6.6 - Render list of Aliases owned by active wallet in Alias.js
[Cashtab] [Alias] pt 7 - Mitigate edge cases for registration records
[Cashtab] [Alias] pt 8 - Activation flag in prod
[Cashtab] [Alias] pt 9 - Retain tokenInfoById upon alias validation
--stacked diff cutoff--
[Cashtab] [Alias] pt 10 - Enable alias inputs for one to one Send XEC txs
[Cashtab] [Alias] pt 11 - Enable alias lookup for Send Token txs
[Cashtab] [Alias] pt 12 - Upgrade tx history to recognize alias registration txs
[Cashtab] [Alias] pt 13 - Port Alias feature to Cashtab extension
[Cashtab] [Alias] pt 14 - Pre-prod update (Set final registration fees, remove residual dev logs and enable prod flag)
Test Plan:
- npm test
- npm start
- if your aliasCache is empty, update currency.aliasSettings.aliasEnabled to true in Ticker.js and navigate to Alias.js
- navigate to Send component, input an alias address (with .xec) that is registered onchain, then verify validation passes and parsed address is displayed in the console log. Send an Xec amount with this input and verify successful broadcast via explorer
- repeat with a send XEC tx along with an unencrypted message
- repeat with a send XEC tx along with an encrypted message
- input a valid alias address (with .xec) that has yet to be registered onchain, then verify validation fails with the eCash Alias does not exist message displayed in the address input field UI.
- input foo.xec (already registered), then immediately change it to an invalid alias format and ensure it fails validation
- input foo.xec, then immediately change it to an unregistered alias format and ensure it fails validation
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D13154