@@ -59,7 +59,7 @@ Contract AwesomeNFT(
59
59
The NFT metadata pointed to by the token URI should return a json file
60
60
with the following schema:
61
61
62
- ``` json
62
+ ``` typescript
63
63
{
64
64
" title" : " NFT Metadata" ,
65
65
" type" : " object" ,
@@ -70,15 +70,58 @@ with the following schema:
70
70
},
71
71
" description" : {
72
72
" type" : " string" ,
73
- "description" : " General description of the NFT"
73
+ " description" : " General description of the NFT" ,
74
+ " nullable" : true
74
75
},
75
76
" image" : {
76
77
" type" : " string" ,
77
78
" description" : " A URI to the image that represents the NFT"
79
+ },
80
+ " attributes" : {
81
+ " type" : " array" ,
82
+ " description" : " An array of attributes for the NFT" ,
83
+ " items" : {
84
+ " type" : " object" ,
85
+ " properties" : {
86
+ " trait_type" : {
87
+ " type" : " string" ,
88
+ " description" : " The type of trait"
89
+ },
90
+ " value" : {
91
+ " type" : [" string" , " number" , " boolean" ],
92
+ " description" : " The value of the trait"
93
+ }
94
+ }
95
+ },
96
+ " nullable" : true
78
97
}
79
98
}
80
99
}
81
100
```
101
+
102
+ Here is a concrete example of the NFT metadata:
103
+
104
+ ``` typescript
105
+ {
106
+ " name" : " #0001" ,
107
+ " image" : " https://ipfs.io/ipfs/QmaEdvjx5gRBU3m6jxJT4DDc4DDZsbcKLqgS6rmeqHH9pq/0002.png" ,
108
+ " attributes" : [
109
+ {
110
+ " trait_type" : " Background" ,
111
+ " value" : " Aged leather"
112
+ },
113
+ {
114
+ " trait_type" : " Intricate Processes" ,
115
+ " value" : " deep texture"
116
+ },
117
+ {
118
+ " trait_type" : " Behavioral Patterns" ,
119
+ " value" : " worn patina"
120
+ }
121
+ ]
122
+ }
123
+ ```
124
+
82
125
That is all for creating a NFT contract!
83
126
84
127
## Create NFT collection contract
@@ -162,7 +205,7 @@ The `INFTCollection` interface defines four methods:
162
205
The metadata of the NFT collection pointed to by collection URI should
163
206
return a json file with the following schema:
164
207
165
- ``` json
208
+ ``` typescript
166
209
{
167
210
" title" : " NFT Collection Metadata" ,
168
211
" type" : " object" ,
@@ -183,6 +226,16 @@ return a json file with the following schema:
183
226
}
184
227
```
185
228
229
+ Here is a concrete example of the NFT collection metadata:
230
+
231
+ ``` typescript
232
+ {
233
+ " name" : " ALEPHIUM EVERYWHERE" ,
234
+ " description" : " ALPH is everywhere,\n Will you know how to find its trace?\n In your heart, it’s there." ,
235
+ " image" : " https://alephium-nft.infura-ipfs.io/ipfs/Qmb8kEPPW4E17nzyZ691bgQAMbMEgRcNZxuH3wXgByfzvt"
236
+ }
237
+ ```
238
+
186
239
The ` mint ` function is responsible for minting an NFT in this
187
240
collection. It takes the metadata URI for the new NFT as parameter and
188
241
creates a
0 commit comments