Smart Contract
StarlyMetadataViews
A.5b82f21c0edf76e3.StarlyMetadataViews
1access(all) contract StarlyMetadataViews {
2
3 access(all) struct Creator {
4 access(all) let id: String
5 access(all) let name: String
6 access(all) let username: String
7 access(all) let address: Address?
8 access(all) let url: String
9
10 init(
11 id: String,
12 name: String,
13 username: String,
14 address: Address?,
15 url: String) {
16
17 self.id = id
18 self.name = name
19 self.username = username
20 self.address = address
21 self.url = url
22 }
23 }
24
25 access(all) struct Collection {
26 access(all) let id: String
27 access(all) let creator: Creator
28 access(all) let title: String
29 access(all) let description: String
30 access(all) let priceCoefficient: UFix64
31 access(all) let url: String
32
33 init(
34 id: String,
35 creator: Creator,
36 title: String,
37 description: String,
38 priceCoefficient: UFix64,
39 url: String) {
40
41 self.id = id
42 self.creator = creator
43 self.title = title
44 self.description = description
45 self.priceCoefficient = priceCoefficient
46 self.url = url
47 }
48 }
49
50 access(all) struct Card {
51 access(all) let id: UInt32
52 access(all) let title: String
53 access(all) let description: String
54 access(all) let editions: UInt32
55 access(all) let rarity: String
56 access(all) let mediaType: String
57 access(all) let mediaSizes: [MediaSize]
58 access(all) let url: String
59 access(all) let previewUrl: String
60
61 init(
62 id: UInt32,
63 title: String,
64 description: String,
65 editions: UInt32,
66 rarity: String,
67 mediaType: String,
68 mediaSizes: [MediaSize],
69 url: String,
70 previewUrl: String) {
71
72 self.id = id
73 self.title = title
74 self.description = description
75 self.editions = editions
76 self.rarity = rarity
77 self.mediaType = mediaType
78 self.mediaSizes = mediaSizes
79 self.url = url
80 self.previewUrl = previewUrl
81 }
82 }
83
84 access(all) struct MediaSize {
85 access(all) let width: UInt16
86 access(all) let height: UInt16
87 access(all) let url: String
88 access(all) let screenshot: String?
89
90 init(
91 width: UInt16,
92 height: UInt16,
93 url: String,
94 screenshot: String?) {
95
96 self.width = width
97 self.height = height
98 self.url = url
99 self.screenshot = screenshot
100 }
101 }
102
103 access(all) struct CardEdition {
104 access(all) let collection: Collection
105 access(all) let card: Card
106 access(all) let edition: UInt32
107 access(all) let score: UFix64?
108 access(all) let url: String
109 access(all) let previewUrl: String
110
111 init(
112 collection: Collection,
113 card: Card,
114 edition: UInt32,
115 score: UFix64?,
116 url: String,
117 previewUrl: String) {
118
119 self.collection = collection
120 self.card = card
121 self.edition = edition
122 self.score = score
123 self.url = url
124 self.previewUrl = previewUrl
125 }
126 }
127}
128