forked from MergeFi/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmock-data.ts
More file actions
306 lines (288 loc) · 8.59 KB
/
Copy pathmock-data.ts
File metadata and controls
306 lines (288 loc) · 8.59 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
import type {
Bounty,
Milestone,
ReputationProfile,
SponsorSummary,
MaintenancePool,
} from "@/types";
export const mockBounties: Bounty[] = [
{
id: "b1",
repo: "stellar-wallet-kit",
org: "stellar-labs",
issueNumber: 482,
title: "Fix wallet reconnect race condition on network switch",
description:
"Switching between testnet and mainnet while a Freighter session is active can leave the app in a stale connection state. Needs a fix in the wallet provider's effect cleanup.",
reward: 150,
asset: "USDC",
difficulty: "intermediate",
status: "open",
deadline: new Date(Date.now() + 6 * 86400000).toISOString(),
labels: ["bug", "wallet", "good-first-issue"],
},
{
id: "b2",
repo: "soroban-escrow-sdk",
org: "mergefi",
issueNumber: 17,
title: "Add milestone allocation validation to escrow client",
description:
"Client-side helper should reject milestone allocations that exceed the remaining pool budget before submitting the transaction.",
reward: 220,
asset: "USDC",
difficulty: "intermediate",
status: "claimed",
deadline: new Date(Date.now() + 3 * 86400000).toISOString(),
labels: ["sdk", "enhancement"],
claimedBy: "0xkoda",
},
{
id: "b3",
repo: "docs-site",
org: "mergefi",
issueNumber: 9,
title: "Document Soroban escrow contract API reference",
description:
"Write reference docs for fund/release/refund functions including auth requirements and error codes.",
reward: 60,
asset: "USDC",
difficulty: "beginner",
status: "open",
deadline: new Date(Date.now() + 10 * 86400000).toISOString(),
labels: ["docs", "good-first-issue"],
},
{
id: "b4",
repo: "core-indexer",
org: "stellar-labs",
issueNumber: 301,
title: "Optimize ledger ingestion batch size for large repos",
description:
"Current batching causes memory spikes on repos with >50k merged PRs. Needs profiling and a streaming rewrite.",
reward: 480,
asset: "USDC",
difficulty: "advanced",
status: "in_review",
deadline: new Date(Date.now() + 1 * 86400000).toISOString(),
labels: ["performance", "backend"],
claimedBy: "priyaeth",
teamSplits: [
{ role: "Backend", percentage: 70, contributor: "priyaeth" },
{ role: "Testing", percentage: 30, contributor: "qa_marcus" },
],
},
{
id: "b5",
repo: "core-indexer",
org: "stellar-labs",
issueNumber: 288,
title: "Upgrade dependency set for Node 22 compatibility",
description: "Routine maintenance bounty funded from the recurring pool.",
reward: 40,
asset: "USDC",
difficulty: "beginner",
status: "paid",
deadline: new Date(Date.now() - 2 * 86400000).toISOString(),
labels: ["maintenance"],
claimedBy: "devrel_ana",
},
];
export const mockMilestones: Milestone[] = [
{
id: "m1",
name: "v2.0: Multi-asset escrow",
repo: "soroban-escrow-sdk",
budget: 12000,
distributed: 4300,
asset: "USDC",
issueCount: 12,
completedCount: 4,
},
{
id: "m2",
name: "v1.4: Indexer performance pass",
repo: "core-indexer",
budget: 6000,
distributed: 2100,
asset: "USDC",
issueCount: 8,
completedCount: 3,
},
];
export const mockMaintenancePools: MaintenancePool[] = [
{
id: "p1",
repo: "core-indexer",
monthlyDeposit: 500,
balance: 1240,
asset: "USDC",
},
];
export const mockReputationProfiles: Record<string, ReputationProfile> = {
priyaeth: {
handle: "priyaeth",
avatarUrl: "https://avatars.githubusercontent.com/u/1?v=4",
lifetimeEarnings: 8420,
mergedPRs: 61,
completionRate: 0.94,
avgReviewTimeHours: 14,
onTimeDeliveryRate: 0.88,
languages: ["Rust", "TypeScript", "Go"],
organizations: ["stellar-labs", "mergefi"],
topClients: ["stellar-labs", "openzeppelin"],
},
"0xkoda": {
handle: "0xkoda",
avatarUrl: "https://avatars.githubusercontent.com/u/2?v=4",
lifetimeEarnings: 3210,
mergedPRs: 27,
completionRate: 0.9,
avgReviewTimeHours: 20,
onTimeDeliveryRate: 0.81,
languages: ["Rust", "Solidity"],
organizations: ["mergefi"],
topClients: ["mergefi"],
},
};
export const mockSponsorSummary: SponsorSummary = {
name: "Stellar Development Foundation",
totalFunded: 42500,
activeBounties: 9,
budgetRemaining: 15800,
repos: ["stellar-wallet-kit", "core-indexer", "soroban-escrow-sdk"],
};
export const platformStats = {
totalPaidOut: 184230,
bountiesCompleted: 612,
activeContributors: 341,
avgPayoutTimeMinutes: 4,
};
export const trustedOrgs = [
"stellar-labs",
"mergefi",
"openzeppelin",
"soroban-foundation",
"wallet-kit",
"core-indexer",
];
export interface LeaderboardEntry {
handle: string;
earnings: number;
mergedPRs: number;
topLanguage: string;
}
export const topContributors: LeaderboardEntry[] = [
{ handle: "priyaeth", earnings: 8420, mergedPRs: 61, topLanguage: "Rust" },
{ handle: "0xkoda", earnings: 3210, mergedPRs: 27, topLanguage: "Rust" },
{ handle: "devrel_ana", earnings: 2890, mergedPRs: 24, topLanguage: "TypeScript" },
{ handle: "qa_marcus", earnings: 2140, mergedPRs: 19, topLanguage: "Go" },
{ handle: "linh_dev", earnings: 1780, mergedPRs: 15, topLanguage: "TypeScript" },
];
export interface ActivityEvent {
id: string;
handle: string;
action: string;
target: string;
amount?: number;
asset?: "USDC" | "XLM";
minutesAgo: number;
}
export const recentActivity: ActivityEvent[] = [
{
id: "a1",
handle: "devrel_ana",
action: "was paid",
target: "core-indexer#288",
amount: 40,
asset: "USDC",
minutesAgo: 6,
},
{
id: "a2",
handle: "0xkoda",
action: "claimed",
target: "soroban-escrow-sdk#17",
minutesAgo: 22,
},
{
id: "a3",
handle: "linh_dev",
action: "opened a pull request for",
target: "stellar-wallet-kit#475",
minutesAgo: 48,
},
{
id: "a4",
handle: "Stellar Development Foundation",
action: "funded",
target: "v2.0: Multi-asset escrow",
amount: 2500,
asset: "USDC",
minutesAgo: 71,
},
{
id: "a5",
handle: "priyaeth",
action: "was paid",
target: "core-indexer#301",
amount: 480,
asset: "USDC",
minutesAgo: 130,
},
{
id: "a6",
handle: "qa_marcus",
action: "joined as a",
target: "contributor",
minutesAgo: 210,
},
];
// Weekly earnings/spend series (8 weeks) for dashboard charts.
export const contributorEarningsHistory = [420, 560, 310, 780, 640, 890, 720, 1050];
export const sponsorSpendHistory = [1800, 2400, 2100, 3200, 2800, 3600, 3100, 4200];
export const contributorSparkline = [12, 18, 14, 22, 19, 27, 24, 31];
export const bountiesCompletedSparkline = [40, 44, 42, 51, 55, 58, 60, 64];
export const escrowLockedSparkline = [8, 12, 10, 15, 13, 18, 16, 14];
export const budgetSparkline = [30, 28, 32, 27, 24, 26, 22, 20];
export interface RepoSpend {
repo: string;
amount: number;
}
export const sponsorSpendByRepo: RepoSpend[] = [
{ repo: "stellar-wallet-kit", amount: 6200 },
{ repo: "core-indexer", amount: 4800 },
{ repo: "soroban-escrow-sdk", amount: 3100 },
{ repo: "docs-site", amount: 900 },
];
export interface Faq {
question: string;
answer: string;
}
export const faqs: Faq[] = [
{
question: "How does MergeFi decide when to release payment?",
answer:
"MergeFi listens for GitHub webhooks. When a pull request that references a funded issue is merged, the backend verifies the event and calls the escrow contract's release function automatically. There's no manual approval step once a PR is merged.",
},
{
question: "What happens if an issue never gets resolved?",
answer:
"Sponsors can refund an unresolved bounty at any time before it's claimed, or after its deadline passes. The escrow contract returns the full amount to the sponsor's wallet.",
},
{
question: "Can a bounty be split between multiple contributors?",
answer:
"Yes. Maintainers can define a team split by percentage (for example 40% frontend, 40% backend, 20% testing), and the contract distributes the payout accordingly the moment the work is merged.",
},
{
question: "Which assets can I fund a bounty with?",
answer:
"MergeFi currently supports USDC and XLM. Funds are held in a Soroban smart contract on Stellar until release conditions are met.",
},
{
question: "Do I need a Stellar wallet to participate?",
answer:
"Contributors need a Stellar wallet (Freighter is supported today) to receive payouts. Sponsors need one to fund escrow. Browsing bounties and building your GitHub reputation doesn't require a wallet.",
},
];