[Cashtab] [Alias] pt 2 - Implement registerNewAlias() to handle alias registration
Summary:
T2551
Depends on D12852
Creates a new registerNewAlias functionto take in alias registration parameters (alias, alias flag & payment fee) and generateOpReturnScript to append the appropriate alias prefix hex.
[Cashtab] [Alias] pt 1 - Create scaffold for new Identity component
[Cashtab] [Alias] pt 2 - Implement registerNewAlias() 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 - Implement isLocalAliasStateLatest function
[Cashtab] [Alias] pt 7 - Enable alias lookup for Send XEC component
[Cashtab] [Alias] pt 8 - Enable alias lookup for Send Token component
[Cashtab] [Alias] pt 9 - Implement pricing mechanism
[Cashtab] [Alias] pt 10 - Server cron job
[Cashtab] [Alias] pt 11 - Upgrade tx history to recognize alias registration txs
Test Plan:
- npm test
- npm start
- attempt to register with no input or empty string / spaces only input and verify the Register Alias button is disabled
- enter a valid inupt and click Register Alias
- verify console log displays the correct registration fee based on the number of chars in the alias input
- verify the successful transaction notification is displayed
- verify the registration transaction shows up on explorer
https://explorer.e.cash/address/ecash:qp3c268rd5946l2f5m5es4x25f7ewu4sjvpy52pqa8
- verify the OP_RETURN output for the registration transaction follows the expected standard below:
[OP_RETURN] [.xec] [the alias]
e.g. 6a042e786563036e6673
6a (OP_RETURN)04
2e786563 (.xec prefix)03
6e6673 ('nfs')
- attempt to register an alias longer than 21 characters and ensure frontend input does not allow this
- test sending and receiving of encrypted and unencrypted cashtab messages + external electrum messages
Reviewers: bytesofman, kieran709, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D12898