forked from reservoirprotocol/metadata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
135 lines (112 loc) · 4.97 KB
/
index.js
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import * as artblocks from "./artblocks";
import * as artblocksEngine from "./artblocks-engine";
import * as cryptokicksIrl from "./cryptokicks-irl";
import * as forgottenPonies from "./forgotten-ponies";
import * as forgottenRunes from "./forgotten-runes";
import * as forgottenRunesAthenaeum from "./forgotten-runes-athenaeum";
import * as forgottenRunesWarriors from "./forgotten-runes-warriors";
import * as forgottenSouls from "./forgotten-souls";
import * as goldfinch from "./goldfinch";
import * as loot from "./loot";
import * as soundxyz from "./soundxyz";
export const hasCustomCollectionHandler = (chainId, contract) =>
Boolean(customCollection[`${chainId},${contract}`]);
export const hasCustomHandler = (chainId, contract) =>
Boolean(custom[`${chainId},${contract}`]);
// All of the below methods assume the caller ensured that a custom
// handler exists (eg. via calling the above check methods)
export const customHandleCollection = async (chainId, token) =>
customCollection[`${chainId},${token.contract}`].fetchCollection(
chainId,
token
);
export const customHandleToken = async (chainId, token) =>
custom[`${chainId},${token.contract}`].fetchToken(chainId, token);
export const customHandleContractTokens = async (
chainId,
contract,
continuation
) =>
custom[`${chainId},${contract}`].fetchContractTokens(
null,
chainId,
continuation
);
/////////////////////
// Custom Collections
/////////////////////
const customCollection = {};
// ArtBlocks
customCollection["1,0x059edd72cd353df5106d2b9cc5ab83a52287ac3a"] = artblocks;
customCollection["1,0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270"] = artblocks;
customCollection["1,0x99a9b7c1116f9ceeb1652de04d5969cce509b069"] = artblocks;
customCollection["5,0xda62f67be7194775a75be91cbf9feedcc5776d4b"] = artblocks;
customCollection["5,0xb614c578062a62714c927cd8193f0b8bfb90055c"] = artblocks;
// ArtBlocks Engine
customCollection["1,0xbdde08bd57e5c9fd563ee7ac61618cb2ecdc0ce0"] =
artblocksEngine;
customCollection["1,0x28f2d3805652fb5d359486dffb7d08320d403240"] =
artblocksEngine;
customCollection["1,0x64780ce53f6e966e18a22af13a2f97369580ec11"] =
artblocksEngine;
customCollection["1,0x010be6545e14f1dc50256286d9920e833f809c6a"] =
artblocksEngine;
customCollection["1,0x13aae6f9599880edbb7d144bb13f1212cee99533"] =
artblocksEngine;
customCollection["1,0xa319c382a702682129fcbf55d514e61a16f97f9c"] =
artblocksEngine;
customCollection["1,0xd10e3dee203579fcee90ed7d0bdd8086f7e53beb"] =
artblocksEngine;
customCollection["1,0x62e37f664b5945629b6549a87f8e10ed0b6d923b"] =
artblocksEngine;
customCollection["1,0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676"] =
artblocksEngine;
customCollection["1,0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a"] =
artblocksEngine;
// Sound XYZ
soundxyz.SoundxyzArtistContracts.forEach(
(address) => (customCollection[`1,${address}`] = soundxyz)
);
soundxyz.SoundxyzReleaseContracts.forEach(
(address) => (customCollection[`1,${address}`] = soundxyz)
);
customCollection["5,0xbe8f3dfce2fcbb6dd08a7e8109958355785c968b"] = soundxyz;
////////////////
// Custom Tokens
////////////////
const custom = {};
// ArtBlocks
custom["1,0x059edd72cd353df5106d2b9cc5ab83a52287ac3a"] = artblocks;
custom["1,0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270"] = artblocks;
custom["1,0x99a9b7c1116f9ceeb1652de04d5969cce509b069"] = artblocks;
custom["5,0xda62f67be7194775a75be91cbf9feedcc5776d4b"] = artblocks;
custom["5,0xb614c578062a62714c927cd8193f0b8bfb90055c"] = artblocks;
// ArtBlocks Engine
custom["1,0xbdde08bd57e5c9fd563ee7ac61618cb2ecdc0ce0"] = artblocksEngine;
custom["1,0x28f2d3805652fb5d359486dffb7d08320d403240"] = artblocksEngine;
custom["1,0x64780ce53f6e966e18a22af13a2f97369580ec11"] = artblocksEngine;
custom["1,0x010be6545e14f1dc50256286d9920e833f809c6a"] = artblocksEngine;
custom["1,0x13aae6f9599880edbb7d144bb13f1212cee99533"] = artblocksEngine;
custom["1,0xa319c382a702682129fcbf55d514e61a16f97f9c"] = artblocksEngine;
custom["1,0xd10e3dee203579fcee90ed7d0bdd8086f7e53beb"] = artblocksEngine;
custom["1,0x62e37f664b5945629b6549a87f8e10ed0b6d923b"] = artblocksEngine;
custom["1,0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676"] = artblocksEngine;
custom["1,0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a"] = artblocksEngine;
// Cryptokicks IRL
custom["1,0x11708dc8a3ea69020f520c81250abb191b190110"] = cryptokicksIrl;
// Forgotten Ponies
custom["1,0xf55b615b479482440135ebf1b907fd4c37ed9420"] = forgottenPonies;
// Forgotten Runes
custom["1,0x521f9c7505005cfa19a8e5786a9c3c9c9f5e6f42"] = forgottenRunes;
// Forgotten Runes Warriors
custom["1,0x9690b63eb85467be5267a3603f770589ab12dc95"] = forgottenRunesWarriors;
// Forgotten Runes Athenaeum
custom["1,0x7c104b4db94494688027cced1e2ebfb89642c80f"] =
forgottenRunesAthenaeum;
// Forgotten Souls
custom["1,0x251b5f14a825c537ff788604ea1b58e49b70726f"] = forgottenSouls;
// Goldfinch
custom["1,0x57686612c601cb5213b01aa8e80afeb24bbd01df"] = goldfinch;
// Loot
custom["1,0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7"] = loot;
custom["4,0x79e2d470f950f2cf78eef41720e8ff2cf4b3cd78"] = loot;