-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathtokenscript.xsd
More file actions
324 lines (317 loc) · 12.6 KB
/
tokenscript.xsd
File metadata and controls
324 lines (317 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ts="http://tokenscript.org/2020/06/tokenscript"
targetNamespace="http://tokenscript.org/2020/06/tokenscript"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
xmlns:asnx="urn:ietf:params:xml:ns:asnx"
xmlns:ethereum="urn:ethereum:constantinople"
elementFormDefault="qualified">
<!-- Importing XML namespace for xml:lang and xml:id -->
<import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd"/>
<!-- Importing XML Signature namespace. Schema is from
http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd
-->
<import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="xmldsig-core-schema.xsd"/>
<!-- Importing XHTML namespace. use xhtml1-strict.xsd to get xhtml:Block -->
<import namespace="http://www.w3.org/1999/xhtml"
schemaLocation="xhtml1-strict.xsd"/>
<import namespace="urn:ietf:params:xml:ns:asnx"
schemaLocation="asnx.xsd"/>
<import namespace="urn:ethereum:constantinople"
schemaLocation="ethereum.xsd"/>
<include schemaLocation="data.xsd"/> <!-- soon to be replaced by data objects -->
<element name="token">
<complexType>
<sequence>
<element ref="asnx:module" minOccurs="0" maxOccurs="unbounded"/>
<element minOccurs="0" name="label" type="ts:text"/>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:contract"/>
<element name="origins" minOccurs="0">
<complexType>
<sequence>
<element ref="ts:ethereum"/>
</sequence>
</complexType>
</element>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:selection"/>
<element name="cards">
<complexType>
<sequence>
<element maxOccurs="unbounded" ref="ts:card"/>
</sequence>
</complexType>
</element>
<element minOccurs="0" ref="ts:grouping"/>
<element minOccurs="0" ref="ts:ordering"/>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:attribute"/>
<element minOccurs="0" maxOccurs="unbounded" ref="dsig:Signature"/>
</sequence>
<attribute name="custodian" type="boolean" default="false"/>
</complexType>
<key name="token-attributes">
<selector xpath="ts:attribute"></selector>
<field xpath="@name"></field>
</key>
</element>
<element name="card">
<complexType>
<sequence>
<element ref="asnx:module" minOccurs="0" maxOccurs="unbounded"/>
<element minOccurs="0" name="label" type="ts:text"/>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:attribute"/>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:selection"/>
<!-- consider putting input and output in transaction
declaration later when/if DvP Security is
implemented. At this stage, DvP security is not
implemented so whatever input and output here are
for the user interface only. One may argue that
this provides a false sense of security if we move
them to <transaction> too early -->
<element minOccurs="0" name="input" type="ts:tokens"/>
<element minOccurs="0" name="output" type="ts:tokens"/>
<element minOccurs="0" ref="ts:transaction"/>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:item-view"/>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:view"/>
</sequence>
<attribute name="type">
<simpleType>
<restriction base="string">
<enumeration value="token"/>
<enumeration value="action"/>
<enumeration value="activity"/>
</restriction>
</simpleType>
</attribute>
<attribute name="exclude" type="IDREFS"/>
<attribute name="name" type="NCName"/>
</complexType>
</element>
<complexType name="tokens">
<choice maxOccurs="unbounded" minOccurs="0">
<element name="token">
<complexType>
<choice>
<element name="ethereum">
<complexType>
<attribute name="network"/>
</complexType>
</element>
<element ref="ts:contract"/>
</choice>
<attribute name="name" type="ID"/>
</complexType>
</element>
</choice>
</complexType>
<complexType name="text">
<sequence>
<element minOccurs="0" maxOccurs="unbounded" name="plurals">
<complexType>
<sequence>
<element maxOccurs="unbounded" ref="ts:string"/>
</sequence>
<attribute use="required" ref="xml:lang"/>
</complexType>
</element>
<element minOccurs="0" maxOccurs="unbounded" ref="ts:string"/>
</sequence>
</complexType>
<element name="string">
<complexType>
<simpleContent>
<extension base="string">
<attribute ref="xml:lang"/>
<attribute name="quantity" type="ts:quantity"/>
</extension>
</simpleContent>
</complexType>
</element>
<simpleType name="quantity">
<restriction base="string">
<enumeration value="zero"/>
<enumeration value="one"/>
<enumeration value="two"/>
<enumeration value="few"/>
<enumeration value="many"/>
<enumeration value="other"/>
</restriction>
</simpleType>
<element name="contract">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="address">
<complexType mixed="true">
<attribute name="network" use="required" type="integer"/>
</complexType>
</element>
<element minOccurs="0" ref="ts:interface"/>
</sequence>
<attribute name="name" type="ID"/>
<attribute name="interface" type="NCName"/>
</complexType>
</element>
<element name="interface" type="NCName"/>
<element name="include" type="NCName"/>
<element name="view" type="ts:view"/>
<element name="item-view" type="ts:view">
</element>
<complexType name="view">
<sequence>
<element minOccurs="0" maxOccurs="unbounded" ref="xhtml:style"/>
<element minOccurs="0" maxOccurs="unbounded" ref="xhtml:script"/>
<element minOccurs="0" ref="xhtml:body"/>
</sequence>
<attribute ref="xml:lang"/>
</complexType>
<element name="redeem">
<complexType>
<attribute name="format" use="required" type="NCName"/>
</complexType>
</element>
<element name="exclude">
<complexType>
<attribute name="selection"/>
</complexType>
</element>
<element name="feemaster" type="anyURI"/>
<element name="gateway" type="anyURI"/>
<element name="prefix" type="anyURI"/>
<element name="selection">
<complexType>
<sequence>
<element minOccurs="0" name="label" type="ts:text"/>
<element minOccurs="0" name="denial" type="ts:text"/>
</sequence>
<attribute name="name" type="NCName"/>
<attribute name="filter" type="string" use="required"></attribute>
</complexType>
</element>
<element name="grouping">
<complexType>
<sequence>
<element ref="ts:group"/>
</sequence>
</complexType>
</element>
<element name="group">
<complexType>
<sequence>
<element ref="ts:consecutive_groups"/>
</sequence>
<attribute name="bitmask" use="required"/>
<attribute name="name" use="required" type="NCName"/>
</complexType>
</element>
<element name="consecutive_groups">
<complexType/>
</element>
<element name="ordering">
<complexType>
<sequence>
<element maxOccurs="unbounded" ref="ts:order"/>
</sequence>
</complexType>
</element>
<element name="order">
<complexType>
<sequence>
<element minOccurs="0" ref="ts:byName"/>
<element maxOccurs="unbounded" ref="ts:byValue"/>
</sequence>
<attribute name="bitmask" use="required"/>
<attribute name="name" use="required" type="NCName"/>
</complexType>
</element>
<element name="byName">
<complexType>
<attribute name="field" use="required" type="NCName"/>
</complexType>
</element>
<element name="byValue">
<complexType>
<attribute name="field" use="required" type="NCName"/>
</complexType>
</element>
<element name="attribute">
<complexType>
<sequence>
<element name="type">
<complexType>
<sequence>
<element name="syntax"/>
</sequence>
</complexType>
</element>
<!-- label is not needed if the attribute is only used for selection -->
<element minOccurs="0" name="label" type="ts:text"/>
<element minOccurs="0" ref="ts:origins"/>
</sequence>
<attribute name="name" use="required" type="NCName"/>
<attribute name="oid" type="NMTOKEN"/>
</complexType>
</element>
<simpleType name="syntax">
<restriction base="NMTOKEN">
<enumeration value="1.3.6.1.4.1.1466.115.121.1.7"/><!-- Boolean -->
<enumeration value="1.3.6.1.4.1.1466.115.121.1.15"/><!-- DirectoryString -->
<enumeration value="1.3.6.1.4.1.1466.115.121.1.24"/><!-- GeneralizedTime -->
<enumeration value="1.3.6.1.4.1.1466.115.121.1.27"/><!-- Integer -->
<enumeration value="1.3.6.1.4.1.1466.115.121.1.36"/><!-- NumericString -->
</restriction>
</simpleType>
<element name="transaction">
<complexType>
<choice>
<element ref="ethereum:transaction"/>
</choice>
</complexType>
</element>
<element name="origins">
<complexType>
<choice maxOccurs="unbounded">
<element ref="ethereum:event"/>
<element ref="ethereum:call"/>
<element ref="ts:user-entry"/>
<element ref="ts:token-id"/>
</choice>
</complexType>
</element>
<simpleType name="bitmask">
<restriction base="hexBinary"/>
</simpleType>
<element name="user-entry">
<complexType>
<sequence>
<element minOccurs="0" ref="ts:mapping"/>
</sequence>
<attribute name="as" type="ts:as" use="required"/>
</complexType>
</element>
<element name="token-id">
<complexType>
<sequence>
<element minOccurs="0" ref="ts:mapping"/>
</sequence>
<attribute name="as" type="ts:as" use="required"/>
<attribute name="bitmask" type="ts:bitmask"/>
</complexType>
</element>
<element name="ethereum">
<complexType>
<attribute name="as" type="ts:as"/>
<attribute name="bitmask" type="ts:bitmask"/>
<attribute name="contract" type="IDREF"/>
<attribute name="function" type="NCName"/>
<attribute name="event" type="NCName"/>
<attribute name="filter" type="string"/>
<!-- TODO: this should be whatever ASN.X allows as element name -->
<attribute name="select" type="NCName"/>
</complexType>
</element>
<complexType name="address" mixed="true">
<attribute name="ref" type="NCName"/>
</complexType>
</schema>