-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuploadAttributes.ts
42 lines (41 loc) · 2.08 KB
/
uploadAttributes.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
import DSCMateAttributesContract from "./src/DSCMateAttributesContract";
import database from "./database.json";
(async () => {
for (const [i, token] of database.collection.entries()) {
if (
i === 38 ||
i === 39 ||
i === 3238 ||
i === 3239 ||
i === 5805
) {
await DSCMateAttributesContract.setLevel(i, token.levels.Attributes);
for (const [trait_type, value] of Object.entries(token.properties)) {
if (trait_type === "Face") {
await DSCMateAttributesContract.setFace(i, value as string);
} else if (trait_type === "Face Detail A") {
await DSCMateAttributesContract.setFaceDetailA(i, value as string);
} else if (trait_type === "Face Detail B") {
await DSCMateAttributesContract.setFaceDetailB(i, value as string);
} else if (trait_type === "Neck") {
await DSCMateAttributesContract.setNeck(i, value as string);
} else if (trait_type === "Mouth") {
await DSCMateAttributesContract.setMouth(i, value as string);
} else if (trait_type === "Eyes") {
await DSCMateAttributesContract.setEyes(i, value as string);
} else if (trait_type === "Forehead") {
await DSCMateAttributesContract.setForehead(i, value as string);
} else if (trait_type === "Headwear") {
await DSCMateAttributesContract.setHeadwear(i, value as string);
} else if (trait_type === "Headwear Detail") {
await DSCMateAttributesContract.setHeadwearDetail(i, value as string);
} else if (trait_type === "Ears") {
await DSCMateAttributesContract.setEars(i, value as string);
} else if (trait_type === "Items") {
await DSCMateAttributesContract.setItems(i, value as string);
}
}
console.log(`Mate #${i} Uploaded.`);
}
}
})();