-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
86 lines (76 loc) · 1.74 KB
/
index.ts
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
export type FormattedName = `${string} - ${string}`; // <artist> — <title>
export type ISO8601Date = `${number}-${number}-${number}`; // YYYY-MM-DD
export type MetadataVersions = "catalog-20220222";
export type Attributes = {
artist: string;
project?: string;
bpm?: number;
key?: string;
genre?: string;
recordLabel?: string;
license?: string;
};
export type Artwork = {
uri: string; // ipfs://<CID>
mimeType: string;
nft?: string; // caip19 (ref)
};
export type Project = {
title: string;
artwork: Artwork;
description?: string;
type?: string;
originalReleaseDate?: ISO8601Date;
recordLabel?: string;
publisher?: string;
upc?: string;
};
export type Visualizer = {
uri: string; // ipfs://<CID>
mimeType: string;
nft?: string; // caip19 (ref)
};
export type Lyrics = {
text: string;
nft?: string; // caip19 (ref)
};
export type Credit = {
name: string;
collaboratorType?: string;
};
export type OpenSeaStandardValues = {
image: string;
name: FormattedName;
external_url: string;
animation_url: string;
attributes: Attributes;
};
export type RequiredValues = {
version: MetadataVersions;
title: string;
artist: string;
duration: number;
mimeType: string;
trackNumber: number;
losslessAudio: string;
artwork: Artwork;
};
export type OptionalValues = {
description?: string;
genre?: string;
tags?: string[];
bpm?: number;
key?: string; // open key notation (e.g. 6a)
isrc?: string;
locationCreated?: string;
originalReleaseDate?: ISO8601Date;
recordLabel?: string;
publisher?: string;
lyrics?: Lyrics;
credits?: Credit[];
project?: Project;
visualizer?: Visualizer;
};
export type MusicNftMetadataSchema = RequiredValues &
OptionalValues &
OpenSeaStandardValues;