* As per T1967, this diff upgrades the OP_RETURN message logic to propose a Cashtab prefix for messages sent from Cashtab, in addition to the existing prefix which differentiates message transactions from eToken transactions.
* The parsing logic is also updated to delineate between a Cashtab generated message vs an externally generated message (e.g. electrum) in transaction history.
When sending OP_RETURN messages from within Cashtab, the following script is proposed (see lines 960-964 in useBCH.js)
> OP_RETURN opcode
> [Transaction Type] - '6d02' hex (621 in text) indicates this is a message, rather than eToken or NFT tx
> [Protocol ID] - '313030' hex (100 in text) indicates this is a message sent via Cashtab.com
> [Message] - the message content
When parsing OP_RETURN messages, the parseTxData() logic in useBCH.js is now updated as follows:
* checks whether an output contains addresses, if not, assume its a message or eToken tx
* if 'OP_RETURN 5262419' (eToken) is not present in the asm property then assume this is a message
* strip out the 'OP_RETURN' opcode via removeOpReturnPrefixes()
* in the remaining string, if the '3158065' cashtab prefix exist then set isCashtabMessage boolean to true and extract the remaining substring as the message content.
* If no cashtab prefix just set the whole string as the message content.
In terms of Styling:
* props.theme.primary is used for cashtab generated messages via <CashtabMessageLabel>
* props.theme.secondary is used for externally generated messages <MessageLabel>
Unit tests:
* mockTxDataWithPassthrough.js updated with the additional cashtab prefix and mockParsedTxs.js updated with the new isCashtabMessage property to test OP_RETURN messages with and without the Cashtab prefix in the asm property.