-
Notifications
You must be signed in to change notification settings - Fork 0
/
seed.mts
101 lines (92 loc) · 2.56 KB
/
seed.mts
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
import { createSeedClient } from "@snaplet/seed";
console.log('🍂 seeding initializing');
const seed = await createSeedClient({
dryRun: false,
});
console.log('⚠️ clearing database');
await seed.$resetDatabase();
const myAddress = "0x59266D85D94666D037C1e32dAa8FaC9E95CdaFEf".toLowerCase();
const sepoliaChainId = 11155111;
const optimismChainId = 10;
console.log('🍃 seeding users');
await seed.public_users([
{
address: myAddress.toLowerCase(),
},
]);
console.log('🍃 seeding boards');
await seed.hyperboards([
{
admin_id: myAddress,
name: "Sepolia board 1",
tile_border_color: "black",
background_image: "test.png",
chain_id: sepoliaChainId,
hyperboard_registries: () => [
{
label: "Sepolia registry 1",
registries: () => ({
name: "Test registry",
chain_id: sepoliaChainId,
admin_id: myAddress,
claims: () => [
{
admin_id: myAddress,
display_size: 1,
hypercert_id:
"11155111-0xa16dfb32eb140a6f3f2ac68f41dad8c7e83c4941-119439110789249400675644487208550642221056",
owner_id: myAddress,
chain_id: sepoliaChainId,
},
{
admin_id: myAddress,
display_size: 2,
hypercert_id:
"11155111-0xa16dfb32eb140a6f3f2ac68f41dad8c7e83c4941-1020847100762815390390123822295304634368",
owner_id: myAddress,
chain_id: sepoliaChainId,
}
],
}),
},
],
},
{
admin_id: myAddress,
name: "Optimism board 1",
tile_border_color: "black",
background_image: "test.png",
chain_id: optimismChainId,
hyperboard_registries: () => [
{
label: "Optimism registry 1",
registries: () => ({
name: "Test registry",
chain_id: optimismChainId,
claims: () => [
{
admin_id: myAddress,
display_size: 1,
hypercert_id:
"10-0x822f17a9a5eecfd66dbaff7946a8071c265d1d07-14549453162438565882303508089960113417224192",
owner_id: myAddress,
chain_id: sepoliaChainId,
},
],
}),
},
],
}
]);
console.log('🌱 seeding default sponsor metadata');
await seed.default_sponsor_metadata([
{
address: myAddress,
firstName: "Testy",
lastName: "McTestface",
image: "test.png",
type: 'company',
companyName: 'Testy McTestface Inc',
},
]);
console.log('✅ seeding complete');