-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmetaplex_schema.ex
67 lines (61 loc) · 1.31 KB
/
metaplex_schema.ex
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
defmodule Creator do
@moduledoc false
defstruct address: nil,
share: 0,
verified: 0
def borsh_schema do
[
{:address, {:base58, 32}},
{:verified, :u8},
{:share, :u8}
]
end
end
defmodule Data do
@moduledoc false
defstruct name: "",
symbol: "",
uri: "",
seller_fee_basis_points: 0,
creators: []
def borsh_schema do
[
{:name, :string},
{:symbol, :string},
{:uri, :string},
{:seller_fee_basis_points, :u16},
{:creators, {:option, {:array, {:struct, Creator}}}}
]
end
end
defmodule Metadata do
@keys [
"Uninitialized",
"EditionV1",
"MasterEditionV1",
"ReservationListV1",
"MetadataV1",
"ReservationListV2",
"MasterEditionV2",
"EditionMarker"
]
@moduledoc false
defstruct key: "Uninitialized",
update_authority: [],
mint: [],
data: %Data{},
primary_sale_happened: 0,
is_mutable: 0,
edition_nonce: nil
def borsh_schema do
[
{:key, {:enum, @keys}},
{:update_authority, {:base58, 32}},
{:mint, {:base58, 32}},
{:data, {:struct, Data}},
{:primary_sale_happened, :u8},
{:is_mutable, :u8},
{:edition_nonce, {:option, :u8}}
]
end
end