-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtypes.ts
More file actions
80 lines (69 loc) · 1.45 KB
/
types.ts
File metadata and controls
80 lines (69 loc) · 1.45 KB
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
interface Contract {
address: string;
}
interface Id {
tokenId: string;
}
export interface Uri {
raw: string;
gateway: string;
}
interface Metadata {
image: string;
}
interface Asset {
contract: Contract;
id: Id;
title: string;
description: string;
tokenUri: Uri;
media: Uri[];
metadata: Metadata;
timeLastUpdated: string;
}
export interface AssetResponse {
ownedNfts: Asset[];
totalCount: number;
pageKey?: string;
}
export interface AxiosAssetResponse {
data: AssetResponse;
}
interface Collection {
contract: Contract;
verified: boolean; // true if the contract is verified on OpenSea, false otherwise
name?: string;
nfts: Asset[];
}
export interface CollectionResponse {
collections: Collection[];
}
export interface AxiosCollectionResponse {
data: CollectionResponse;
}
/*
Example asset (NFT)
{
"contract":{
"address":"0x60e4d786628fea6478f785a6d7e704777c86a7c6"
},
"id":{
"tokenId":"0x00000000000000000000000000000000000000000000000000000000000029c6",
},
"title":"",
"description":"",
"externalDomainViewUrl":"https://boredapeyachtclub.com/api/mutants/10694",
"media":{
"uri":"ipfs://QmaiJ4sVVqBH4fbG6wYTsGXzGyvRTmnZauf68d4ygFuELF"
},
"alternateMedia":[
{
"uri":"https://ipfs.io/ipfs/QmaiJ4sVVqBH4fbG6wYTsGXzGyvRTmnZauf68d4ygFuELF"
}
],
"metadata":{
"image":"ipfs://QmaiJ4sVVqBH4fbG6wYTsGXzGyvRTmnZauf68d4ygFuELF"
},
"timeLastUpdated":"2022-01-23T23:59:55.919Z"
}
*/