TokenScript File
TokenScript file is an overlay of XML Mark-up and JavaScript.
The XML markup
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE token [
<!ENTITY style SYSTEM "shared.css">
<!ENTITY about.en SYSTEM "about.en.js">
]>
<ts:token
xmlns:ts="http://tokenscript.org/2020/06/tokenscript"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:asnx="urn:ietf:params:xml:ns:asnx"
xmlns:ethereum="urn:ethereum:constantinople" xsi:schemaLocation="http://tokenscript.org/2020/06/tokenscript http://tokenscript.org/2020/06/tokenscript.xsd" custodian="false">
<asnx:module name="Coin-event-Sent">
<namedType name="Sent">
<sequence>
<element name="from" ethereum:type="address" ethereum:indexed="false"></element>
<element name="to" ethereum:type="address" ethereum:indexed="false"></element>
<element name="amount" ethereum:type="uint256" ethereum:indexed="false"></element>
</sequence>
</namedType>
</asnx:module>
<ts:label>
<ts:string xml:lang="en">Coin</ts:string>
</ts:label>
<ts:contract interface="erc20" name="Coin">
<ts:address network="3">0xe35FE4A1B17d50A8022078d98162DB25bC860834</ts:address>
</ts:contract>
<ts:origins>
<ts:ethereum contract="Coin"/>
</ts:origins>
<ts:cards>
<ts:card type="action">
<ts:label>
<ts:string xml:lang="en">Approve</ts:string>
</ts:label>
<ts:attribute name="approvalAddress">
<ts:type>
<ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax>
</ts:type>
<ts:label>
<ts:string xml:lang="en">Approval Address</ts:string>
</ts:label>
<ts:origins>
<ts:user-entry as="address"/>
</ts:origins>
</ts:attribute>
<ts:transaction>
<ethereum:transaction function="approve" contract="Coin" as="uint">
<ts:data>
<ts:address ref="approvalAddress"/> <ts:uint256>115792089237316195423570985008687907853269984665640564039457584007913129639935</ts:uint256>
</ts:data>
</ethereum:transaction>
</ts:transaction>
<ts:view
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<style type="text/css">&style;</style>
<script type="text/javascript">&approve.en;</script>
</ts:view>
</ts:card>
</ts:cards>
<ts:attribute name="name">
<ts:type>
<ts:syntax>1.3.6.1.4.1.1466.115.121.1.26</ts:syntax>
</ts:type>
<ts:label>
<ts:string xml:lang="en">name</ts:string>
</ts:label>
<ts:origins>
<ethereum:call function="name" contract="Coin" as="utf8"></ethereum:call>
</ts:origins>
</ts:attribute>
</ts:token>JavaScript / WebAssembly
Merging and signing the files
Last updated