TokenScript icon indicating copy to clipboard operation
TokenScript copied to clipboard

default ERC20 tokenscript for activity only

Open SmartLayer opened this issue 5 years ago • 0 comments
trafficstars

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 '' in the HTML they generated (e.g. through JSX), and apply a default stylesheet to locate it to the upper-right corner. This way if we wish to change the look of it we just need to replace the default stylesheet.

SmartLayer avatar Jan 31 '20 04:01 SmartLayer