TokenScript
TokenScript copied to clipboard
default ERC20 tokenscript for activity only
In the "Activities" section there is a list of items where each item is an activity. Such an item is rendered based on an blockchain event (before we support attestation and anticipated future events), using item-view defined in TokenScript.
There are two exceptions: ether transfer and ERC20 balance transfer. The TokenScript authors don't specify how such activities are rendered unless they need to override the default behaviour.
The default behaviour is defined per implementation (e.g. αWallet)
(work in progress from here).
The TokenScript engine should be aware of the balance transfer in each token in order to apply a uniformed display of such values. e.g. if debit is in red and credit is in blue, it should be so across all tokens.
One way to do that is to highlight the value of balance transfer in an event:
<cards>
<activity ref="NameRegistered" balance-transfer="$(balance)"/>
<cards>
But, some events might not have the balance value directly and rather instead JavaScript has to be employed to calculate that value.
Alternatively, we can ask politely that the TokenScript author uses a special '