@@ -9,72 +9,68 @@ const registerContract = async () => {
99
1010 const contractDocuments = {
1111 card : {
12- type : " object" ,
12+ type : ' object' ,
1313 documentsMutable : false , // true = documents can be modified (replaced)
1414 canBeDeleted : true , // true = documents can be deleted (current bug prevents deletion when true if mutable is false)
1515 transferable : 1 , // 0 = transfers disabled; 1 = transfers enabled
1616 tradeMode : 1 , // 0 = no trading; 1 = direct purchases
1717 creationRestrictionMode : 1 , // 0 = anyone can mint; 1 = only contract owner can mint
1818 properties : {
1919 name : {
20- type : " string" ,
21- description : " Name of the card" ,
20+ type : ' string' ,
21+ description : ' Name of the card' ,
2222 minLength : 0 ,
2323 maxLength : 63 ,
24- position : 0
24+ position : 0 ,
2525 } ,
2626 description : {
27- type : " string" ,
28- description : " Description of the card" ,
27+ type : ' string' ,
28+ description : ' Description of the card' ,
2929 minLength : 0 ,
3030 maxLength : 256 ,
31- position : 1
31+ position : 1 ,
3232 } ,
3333 attack : {
34- type : " integer" ,
35- description : " Attack power of the card" ,
36- position : 2
34+ type : ' integer' ,
35+ description : ' Attack power of the card' ,
36+ position : 2 ,
3737 } ,
3838 defense : {
39- type : " integer" ,
40- description : " Defense level of the card" ,
41- position : 3
42- }
39+ type : ' integer' ,
40+ description : ' Defense level of the card' ,
41+ position : 3 ,
42+ } ,
4343 } ,
4444 indices : [
4545 {
46- name : " owner" ,
46+ name : ' owner' ,
4747 properties : [
4848 {
49- $ownerId : " asc"
50- }
51- ]
49+ $ownerId : ' asc' ,
50+ } ,
51+ ] ,
5252 } ,
5353 {
54- name : " attack" ,
54+ name : ' attack' ,
5555 properties : [
5656 {
57- attack : " asc"
58- }
59- ]
57+ attack : ' asc' ,
58+ } ,
59+ ] ,
6060 } ,
6161 {
62- name : " defense" ,
62+ name : ' defense' ,
6363 properties : [
6464 {
65- defense : "asc"
66- }
67- ]
68- }
69- ] ,
70- required : [
71- "name" ,
72- "attack" ,
73- "defense"
65+ defense : 'asc' ,
66+ } ,
67+ ] ,
68+ } ,
7469 ] ,
75- additionalProperties : false
76- }
77- }
70+ required : [ 'name' , 'attack' , 'defense' ] ,
71+ additionalProperties : false ,
72+ } ,
73+ } ;
7874
7975 const contract = await platform . contracts . create ( contractDocuments , identity ) ;
8076 console . dir ( { contract : contract . toJSON ( ) } ) ;
0 commit comments