Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moving attributes' type definition into its own element #79

Merged
merged 1 commit into from
May 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions examples/ENS/ENS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,18 @@
<ts:string xml:lang="en">Records</ts:string>
</ts:label>

<ts:attribute-type name="newRecordValue" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="newRecordValue">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="en">new record value</ts:string>
</ts:label>
<ts:origins>
<ts:user-entry as="utf8"/>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="emailRecord" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="emailRecord">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call as="utf8" contract="PublicResolver" function="text">
<ts:data>
Expand All @@ -85,7 +87,7 @@
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:transaction>
<ethereum:transaction function="setText" contract="PublicResolver" as="bool">
Expand All @@ -109,7 +111,8 @@
<ts:string xml:lang="en">Renew</ts:string>
</ts:label>

<ts:attribute-type name="renewalPricePerYear" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:attribute name="renewalPricePerYear">
<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">renewal price per year</ts:string>
</ts:label>
Expand All @@ -121,7 +124,7 @@
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:transaction>
<ethereum:transaction function="renew" contract="ETHRegistrarController" as="uint">
Expand All @@ -140,30 +143,33 @@

</ts:cards>

<ts:attribute-type name="ensName" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="ensName">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:event module="NameRegistered" filter="label=${tokenId}" select="name"/>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="nameExpires" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:attribute name="nameExpires">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="nameExpires" contract="ENS" as="uint">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="resolverAddress" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="resolverAddress">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="resolver" contract="registry" as="address">
<ts:data>
<ts:bytes32 local-ref="nodeHash"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

</ts:token>
30 changes: 18 additions & 12 deletions examples/EntryToken/EntryToken.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ts:view>
</ts:card>
</ts:cards>
<ts:attribute-type name="locality" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="locality">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getLocality" contract="EntryToken" as="utf8">
<ts:data>
Expand All @@ -84,50 +85,55 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ethereum:call>
</ts:origins>

</ts:attribute-type>
<ts:attribute-type name="time" syntax="1.3.6.1.4.1.1466.115.121.1.24">
</ts:attribute>
<ts:attribute name="time">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.24</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="en">Time</ts:string>
<ts:string xml:lang="zh">时间</ts:string>
</ts:label>
<ts:origins>
<ts:token-id bitmask="0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000" as="utf8"/>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="expired" syntax="1.3.6.1.4.1.1466.115.121.1.7"> <!-- boolean -->
</ts:attribute>
<ts:attribute name="expired"> <!-- boolean -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.7</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="isExpired" contract="EntryToken" as="bool">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="street" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
</ts:attribute>
<ts:attribute name="street"> <!-- string -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getStreet" contract="EntryToken" as="utf8">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="building" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
</ts:attribute>
<ts:attribute name="building"> <!-- string -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getBuildingName" contract="EntryToken" as="utf8">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="state" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
</ts:attribute>
<ts:attribute name="state"> <!-- string -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getState" contract="EntryToken" as="utf8">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
</ts:attribute>
</ts:token>
30 changes: 18 additions & 12 deletions examples/Karma/karma.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ts:view>
</ts:card>
</ts:cards>
<ts:attribute-type name="locality" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="locality">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getLocality" as="utf8" contract="CarToken">
<ts:data>
Expand All @@ -91,50 +92,55 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ethereum:call>
</ts:origins>

</ts:attribute-type>
<ts:attribute-type name="time" syntax="1.3.6.1.4.1.1466.115.121.1.24">
</ts:attribute>
<ts:attribute name="time">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.24</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="en">Time</ts:string>
<ts:string xml:lang="zh">时间</ts:string>
</ts:label>
<ts:origins>
<ts:token-id as="utf8" bitmask="00000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="expired" syntax="1.3.6.1.4.1.1466.115.121.1.7"> <!-- boolean -->
</ts:attribute>
<ts:attribute name="expired"> <!-- boolean -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.7</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="isExpired" as="bool" contract="CarToken">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="model" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
</ts:attribute>
<ts:attribute name="model"> <!-- string -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getStreet" as="utf8" contract="CarToken">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="VIN" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
</ts:attribute>
<ts:attribute name="VIN"> <!-- string -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getBuildingName" as="utf8" contract="CarToken">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type name="state" syntax="1.3.6.1.4.1.1466.115.121.1.15"> <!-- string -->
</ts:attribute>
<ts:attribute name="state"> <!-- string -->
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:origins>
<ethereum:call function="getState" as="utf8" contract="CarToken">
<ts:data>
<ts:uint256 ref="tokenId"/>
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
</ts:attribute>
</ts:token>
45 changes: 27 additions & 18 deletions examples/UEFA/UEFA.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ts:cards>


<ts:attribute-type name="time" syntax="1.3.6.1.4.1.1466.115.121.1.24">
<ts:attribute name="time">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.24</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="en">Time</ts:string>
<ts:string xml:lang="zh">时间</ts:string>
Expand All @@ -65,9 +66,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<ts:token-id bitmask="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000" as="utf8">
</ts:token-id>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="locality" oid="2.5.4.7" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="locality" oid="2.5.4.7">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="en">City</ts:string>
<ts:string xml:lang="zh">城市</ts:string>
Expand Down Expand Up @@ -126,9 +128,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ts:mapping>
</ts:token-id>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="venue" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="venue">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="en">Venue</ts:string>
</ts:label>
Expand Down Expand Up @@ -186,9 +189,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ts:mapping>
</ts:token-id>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="countryA" syntax="1.3.6.1.4.1.1466.115.121.1.26">
<ts:attribute name="countryA">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.26</ts:syntax></ts:type>
<!-- Intentionally avoid using countryName
(SYNTAX 1.3.6.1.4.1.1466.115.121.1.11) per RFC 4519
CountryName is two-characters long, not 3-characters.
Expand All @@ -200,29 +204,32 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<ts:origins>
<ts:token-id bitmask="0000000000000000000000000000000000000000FFFFFF000000000000000000" as="utf8"/>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="countryB" syntax="1.3.6.1.4.1.1466.115.121.1.26">
<ts:attribute name="countryB">
<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="zh">球队 B</ts:string>
<ts:string xml:lang="en">Team B</ts:string>
</ts:label>
<ts:origins>
<ts:token-id bitmask="0000000000000000000000000000000000000000000000FFFFFF000000000000" as="utf8"/>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="match" syntax="1.3.6.1.4.1.1466.115.121.1.27">
<ts:attribute name="match">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.27</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="zh">比赛</ts:string>
<ts:string xml:lang="en">Match</ts:string>
</ts:label>
<ts:origins>
<ts:token-id bitmask="0000000000000000000000000000000000000000000000000000FF0000000000" as="utf8"/>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="category" syntax="1.3.6.1.4.1.1466.115.121.1.15">
<ts:attribute name="category">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.15</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="zh">等级</ts:string>
<ts:string xml:lang="en">Cat</ts:string>
Expand All @@ -249,18 +256,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ts:mapping>
</ts:token-id>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="numero" syntax="1.3.6.1.4.1.1466.115.121.1.27">
<ts:attribute name="numero">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.27</ts:syntax></ts:type>
<ts:label>
<ts:string>№</ts:string>
</ts:label>
<ts:origins>
<ts:token-id bitmask="00000000000000000000000000000000000000000000000000000000FFFF00" as="uint"/>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

<ts:attribute-type name="redeemed" syntax="1.3.6.1.4.1.1466.115.121.1.27">
<ts:attribute name="redeemed">
<ts:type><ts:syntax>1.3.6.1.4.1.1466.115.121.1.27</ts:syntax></ts:type>
<ts:label>
<ts:string xml:lang="zh">已兑换</ts:string>
<ts:string xml:lang="en">Redeemed</ts:string>
Expand All @@ -272,6 +281,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
</ts:data>
</ethereum:call>
</ts:origins>
</ts:attribute-type>
</ts:attribute>

</ts:token>
5 changes: 3 additions & 2 deletions examples/action/XDAI-bridge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<ts:string xml:lang="en">Convert to DAI</ts:string>
<ts:string xml:lang="zh">將xDAI轉爲DAI</ts:string>
</ts:label>
<ts:attribute-type name="amount" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:attribute name="amount">
<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">Amount</ts:string>
<ts:string xml:lang="zh">代幣金額</ts:string>
Expand All @@ -24,7 +25,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
rationale for hardcoding: avoiding over-design -->
<ts:user-entry as="e18"/>
</ts:origins>
</ts:attribute-type>
</ts:attribute>
<!-- because this action has xdai as input, it should be listed as
an action under XDAI's token view. -->
<ts:input>
Expand Down
Loading