@merkl/api 0.10.297 → 0.10.298
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/eden/index.d.ts +237 -83
- package/dist/src/index.d.ts +79 -19
- package/dist/src/modules/v4/reward/reward.controller.d.ts +79 -19
- package/dist/src/modules/v4/reward/reward.controller.js +39 -10
- package/dist/src/modules/v4/reward/reward.model.d.ts +7 -0
- package/dist/src/modules/v4/reward/reward.model.js +10 -0
- package/dist/src/modules/v4/reward/reward.repository.d.ts +13 -5
- package/dist/src/modules/v4/reward/reward.repository.js +67 -11
- package/dist/src/modules/v4/reward/reward.service.d.ts +11 -3
- package/dist/src/modules/v4/reward/reward.service.js +19 -4
- package/dist/src/modules/v4/router.d.ts +79 -19
- package/dist/src/modules/v4/status/status.repository.js +0 -3
- package/dist/src/modules/v4/status/status.service.js +2 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -1082,6 +1082,85 @@ declare const eden: {
|
|
1082
1082
|
};
|
1083
1083
|
}>>;
|
1084
1084
|
};
|
1085
|
+
count: {
|
1086
|
+
get: (options: {
|
1087
|
+
headers?: Record<string, unknown> | undefined;
|
1088
|
+
query: {
|
1089
|
+
items?: number | undefined;
|
1090
|
+
page?: number | undefined;
|
1091
|
+
chainId: number;
|
1092
|
+
campaignId: string;
|
1093
|
+
};
|
1094
|
+
fetch?: RequestInit | undefined;
|
1095
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1096
|
+
200: {
|
1097
|
+
count: number;
|
1098
|
+
};
|
1099
|
+
}>>;
|
1100
|
+
chains: {
|
1101
|
+
get: (options: {
|
1102
|
+
headers: {
|
1103
|
+
authorization: string;
|
1104
|
+
};
|
1105
|
+
query?: Record<string, unknown> | undefined;
|
1106
|
+
fetch?: RequestInit | undefined;
|
1107
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1108
|
+
200: {
|
1109
|
+
[x: string]: {
|
1110
|
+
breakdown: number;
|
1111
|
+
rewards: Record<string, number>;
|
1112
|
+
};
|
1113
|
+
};
|
1114
|
+
}>>;
|
1115
|
+
};
|
1116
|
+
};
|
1117
|
+
token: {
|
1118
|
+
get: (options: {
|
1119
|
+
headers?: Record<string, unknown> | undefined;
|
1120
|
+
query: {
|
1121
|
+
items?: number | undefined;
|
1122
|
+
page?: number | undefined;
|
1123
|
+
chainId: number;
|
1124
|
+
address: string;
|
1125
|
+
};
|
1126
|
+
fetch?: RequestInit | undefined;
|
1127
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1128
|
+
200: import("../modules/v4/reward").BreakdownForCampaignsRaw[];
|
1129
|
+
}>>;
|
1130
|
+
total: {
|
1131
|
+
get: (options: {
|
1132
|
+
headers?: Record<string, unknown> | undefined;
|
1133
|
+
query: {
|
1134
|
+
items?: number | undefined;
|
1135
|
+
page?: number | undefined;
|
1136
|
+
chainId: number;
|
1137
|
+
address: string;
|
1138
|
+
};
|
1139
|
+
fetch?: RequestInit | undefined;
|
1140
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1141
|
+
200: {
|
1142
|
+
tokenId: string;
|
1143
|
+
amount: bigint;
|
1144
|
+
};
|
1145
|
+
}>>;
|
1146
|
+
};
|
1147
|
+
count: {
|
1148
|
+
get: (options: {
|
1149
|
+
headers?: Record<string, unknown> | undefined;
|
1150
|
+
query: {
|
1151
|
+
items?: number | undefined;
|
1152
|
+
page?: number | undefined;
|
1153
|
+
chainId: number;
|
1154
|
+
address: string;
|
1155
|
+
};
|
1156
|
+
fetch?: RequestInit | undefined;
|
1157
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1158
|
+
200: {
|
1159
|
+
count: number;
|
1160
|
+
};
|
1161
|
+
}>>;
|
1162
|
+
};
|
1163
|
+
};
|
1085
1164
|
engine: {
|
1086
1165
|
post: (body: {
|
1087
1166
|
recipient: string;
|
@@ -1171,38 +1250,6 @@ declare const eden: {
|
|
1171
1250
|
}>>;
|
1172
1251
|
};
|
1173
1252
|
};
|
1174
|
-
count: {
|
1175
|
-
get: (options: {
|
1176
|
-
headers?: Record<string, unknown> | undefined;
|
1177
|
-
query: {
|
1178
|
-
items?: number | undefined;
|
1179
|
-
page?: number | undefined;
|
1180
|
-
chainId: number;
|
1181
|
-
campaignId: string;
|
1182
|
-
};
|
1183
|
-
fetch?: RequestInit | undefined;
|
1184
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1185
|
-
200: {
|
1186
|
-
count: number;
|
1187
|
-
};
|
1188
|
-
}>>;
|
1189
|
-
chains: {
|
1190
|
-
get: (options: {
|
1191
|
-
headers: {
|
1192
|
-
authorization: string;
|
1193
|
-
};
|
1194
|
-
query?: Record<string, unknown> | undefined;
|
1195
|
-
fetch?: RequestInit | undefined;
|
1196
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1197
|
-
200: {
|
1198
|
-
[x: string]: {
|
1199
|
-
breakdown: number;
|
1200
|
-
rewards: Record<string, number>;
|
1201
|
-
};
|
1202
|
-
};
|
1203
|
-
}>>;
|
1204
|
-
};
|
1205
|
-
};
|
1206
1253
|
unclaim: {
|
1207
1254
|
index: {
|
1208
1255
|
get: (options: {
|
@@ -4112,6 +4159,85 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4112
4159
|
};
|
4113
4160
|
};
|
4114
4161
|
};
|
4162
|
+
} & {
|
4163
|
+
count: {
|
4164
|
+
get: {
|
4165
|
+
body: unknown;
|
4166
|
+
params: {};
|
4167
|
+
query: {
|
4168
|
+
items?: number | undefined;
|
4169
|
+
page?: number | undefined;
|
4170
|
+
chainId: number;
|
4171
|
+
campaignId: string;
|
4172
|
+
};
|
4173
|
+
headers: unknown;
|
4174
|
+
response: {
|
4175
|
+
200: {
|
4176
|
+
count: number;
|
4177
|
+
};
|
4178
|
+
};
|
4179
|
+
};
|
4180
|
+
};
|
4181
|
+
} & {
|
4182
|
+
token: {
|
4183
|
+
get: {
|
4184
|
+
body: unknown;
|
4185
|
+
params: {};
|
4186
|
+
query: {
|
4187
|
+
items?: number | undefined;
|
4188
|
+
page?: number | undefined;
|
4189
|
+
chainId: number;
|
4190
|
+
address: string;
|
4191
|
+
};
|
4192
|
+
headers: unknown;
|
4193
|
+
response: {
|
4194
|
+
200: import("../modules/v4/reward").BreakdownForCampaignsRaw[];
|
4195
|
+
};
|
4196
|
+
};
|
4197
|
+
};
|
4198
|
+
} & {
|
4199
|
+
token: {
|
4200
|
+
total: {
|
4201
|
+
get: {
|
4202
|
+
body: unknown;
|
4203
|
+
params: {};
|
4204
|
+
query: {
|
4205
|
+
items?: number | undefined;
|
4206
|
+
page?: number | undefined;
|
4207
|
+
chainId: number;
|
4208
|
+
address: string;
|
4209
|
+
};
|
4210
|
+
headers: unknown;
|
4211
|
+
response: {
|
4212
|
+
200: {
|
4213
|
+
tokenId: string;
|
4214
|
+
amount: bigint;
|
4215
|
+
};
|
4216
|
+
};
|
4217
|
+
};
|
4218
|
+
};
|
4219
|
+
};
|
4220
|
+
} & {
|
4221
|
+
token: {
|
4222
|
+
count: {
|
4223
|
+
get: {
|
4224
|
+
body: unknown;
|
4225
|
+
params: {};
|
4226
|
+
query: {
|
4227
|
+
items?: number | undefined;
|
4228
|
+
page?: number | undefined;
|
4229
|
+
chainId: number;
|
4230
|
+
address: string;
|
4231
|
+
};
|
4232
|
+
headers: unknown;
|
4233
|
+
response: {
|
4234
|
+
200: {
|
4235
|
+
count: number;
|
4236
|
+
};
|
4237
|
+
};
|
4238
|
+
};
|
4239
|
+
};
|
4240
|
+
};
|
4115
4241
|
} & {
|
4116
4242
|
engine: {
|
4117
4243
|
post: {
|
@@ -4219,25 +4345,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4219
4345
|
};
|
4220
4346
|
};
|
4221
4347
|
};
|
4222
|
-
} & {
|
4223
|
-
count: {
|
4224
|
-
get: {
|
4225
|
-
body: unknown;
|
4226
|
-
params: {};
|
4227
|
-
query: {
|
4228
|
-
items?: number | undefined;
|
4229
|
-
page?: number | undefined;
|
4230
|
-
chainId: number;
|
4231
|
-
campaignId: string;
|
4232
|
-
};
|
4233
|
-
headers: unknown;
|
4234
|
-
response: {
|
4235
|
-
200: {
|
4236
|
-
count: number;
|
4237
|
-
};
|
4238
|
-
};
|
4239
|
-
};
|
4240
|
-
};
|
4241
4348
|
} & {
|
4242
4349
|
count: {
|
4243
4350
|
chains: {
|
@@ -7450,6 +7557,85 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7450
7557
|
};
|
7451
7558
|
}>>;
|
7452
7559
|
};
|
7560
|
+
count: {
|
7561
|
+
get: (options: {
|
7562
|
+
headers?: Record<string, unknown> | undefined;
|
7563
|
+
query: {
|
7564
|
+
items?: number | undefined;
|
7565
|
+
page?: number | undefined;
|
7566
|
+
chainId: number;
|
7567
|
+
campaignId: string;
|
7568
|
+
};
|
7569
|
+
fetch?: RequestInit | undefined;
|
7570
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7571
|
+
200: {
|
7572
|
+
count: number;
|
7573
|
+
};
|
7574
|
+
}>>;
|
7575
|
+
chains: {
|
7576
|
+
get: (options: {
|
7577
|
+
headers: {
|
7578
|
+
authorization: string;
|
7579
|
+
};
|
7580
|
+
query?: Record<string, unknown> | undefined;
|
7581
|
+
fetch?: RequestInit | undefined;
|
7582
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7583
|
+
200: {
|
7584
|
+
[x: string]: {
|
7585
|
+
breakdown: number;
|
7586
|
+
rewards: Record<string, number>;
|
7587
|
+
};
|
7588
|
+
};
|
7589
|
+
}>>;
|
7590
|
+
};
|
7591
|
+
};
|
7592
|
+
token: {
|
7593
|
+
get: (options: {
|
7594
|
+
headers?: Record<string, unknown> | undefined;
|
7595
|
+
query: {
|
7596
|
+
items?: number | undefined;
|
7597
|
+
page?: number | undefined;
|
7598
|
+
chainId: number;
|
7599
|
+
address: string;
|
7600
|
+
};
|
7601
|
+
fetch?: RequestInit | undefined;
|
7602
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7603
|
+
200: import("../modules/v4/reward").BreakdownForCampaignsRaw[];
|
7604
|
+
}>>;
|
7605
|
+
total: {
|
7606
|
+
get: (options: {
|
7607
|
+
headers?: Record<string, unknown> | undefined;
|
7608
|
+
query: {
|
7609
|
+
items?: number | undefined;
|
7610
|
+
page?: number | undefined;
|
7611
|
+
chainId: number;
|
7612
|
+
address: string;
|
7613
|
+
};
|
7614
|
+
fetch?: RequestInit | undefined;
|
7615
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7616
|
+
200: {
|
7617
|
+
tokenId: string;
|
7618
|
+
amount: bigint;
|
7619
|
+
};
|
7620
|
+
}>>;
|
7621
|
+
};
|
7622
|
+
count: {
|
7623
|
+
get: (options: {
|
7624
|
+
headers?: Record<string, unknown> | undefined;
|
7625
|
+
query: {
|
7626
|
+
items?: number | undefined;
|
7627
|
+
page?: number | undefined;
|
7628
|
+
chainId: number;
|
7629
|
+
address: string;
|
7630
|
+
};
|
7631
|
+
fetch?: RequestInit | undefined;
|
7632
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7633
|
+
200: {
|
7634
|
+
count: number;
|
7635
|
+
};
|
7636
|
+
}>>;
|
7637
|
+
};
|
7638
|
+
};
|
7453
7639
|
engine: {
|
7454
7640
|
post: (body: {
|
7455
7641
|
recipient: string;
|
@@ -7539,38 +7725,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7539
7725
|
}>>;
|
7540
7726
|
};
|
7541
7727
|
};
|
7542
|
-
count: {
|
7543
|
-
get: (options: {
|
7544
|
-
headers?: Record<string, unknown> | undefined;
|
7545
|
-
query: {
|
7546
|
-
items?: number | undefined;
|
7547
|
-
page?: number | undefined;
|
7548
|
-
chainId: number;
|
7549
|
-
campaignId: string;
|
7550
|
-
};
|
7551
|
-
fetch?: RequestInit | undefined;
|
7552
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7553
|
-
200: {
|
7554
|
-
count: number;
|
7555
|
-
};
|
7556
|
-
}>>;
|
7557
|
-
chains: {
|
7558
|
-
get: (options: {
|
7559
|
-
headers: {
|
7560
|
-
authorization: string;
|
7561
|
-
};
|
7562
|
-
query?: Record<string, unknown> | undefined;
|
7563
|
-
fetch?: RequestInit | undefined;
|
7564
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7565
|
-
200: {
|
7566
|
-
[x: string]: {
|
7567
|
-
breakdown: number;
|
7568
|
-
rewards: Record<string, number>;
|
7569
|
-
};
|
7570
|
-
};
|
7571
|
-
}>>;
|
7572
|
-
};
|
7573
|
-
};
|
7574
7728
|
unclaim: {
|
7575
7729
|
index: {
|
7576
7730
|
get: (options: {
|
package/dist/src/index.d.ts
CHANGED
@@ -1291,6 +1291,85 @@ declare const app: Elysia<"", false, {
|
|
1291
1291
|
};
|
1292
1292
|
};
|
1293
1293
|
};
|
1294
|
+
} & {
|
1295
|
+
count: {
|
1296
|
+
get: {
|
1297
|
+
body: unknown;
|
1298
|
+
params: {};
|
1299
|
+
query: {
|
1300
|
+
items?: number | undefined;
|
1301
|
+
page?: number | undefined;
|
1302
|
+
chainId: number;
|
1303
|
+
campaignId: string;
|
1304
|
+
};
|
1305
|
+
headers: unknown;
|
1306
|
+
response: {
|
1307
|
+
200: {
|
1308
|
+
count: number;
|
1309
|
+
};
|
1310
|
+
};
|
1311
|
+
};
|
1312
|
+
};
|
1313
|
+
} & {
|
1314
|
+
token: {
|
1315
|
+
get: {
|
1316
|
+
body: unknown;
|
1317
|
+
params: {};
|
1318
|
+
query: {
|
1319
|
+
items?: number | undefined;
|
1320
|
+
page?: number | undefined;
|
1321
|
+
chainId: number;
|
1322
|
+
address: string;
|
1323
|
+
};
|
1324
|
+
headers: unknown;
|
1325
|
+
response: {
|
1326
|
+
200: import("./modules/v4/reward").BreakdownForCampaignsRaw[];
|
1327
|
+
};
|
1328
|
+
};
|
1329
|
+
};
|
1330
|
+
} & {
|
1331
|
+
token: {
|
1332
|
+
total: {
|
1333
|
+
get: {
|
1334
|
+
body: unknown;
|
1335
|
+
params: {};
|
1336
|
+
query: {
|
1337
|
+
items?: number | undefined;
|
1338
|
+
page?: number | undefined;
|
1339
|
+
chainId: number;
|
1340
|
+
address: string;
|
1341
|
+
};
|
1342
|
+
headers: unknown;
|
1343
|
+
response: {
|
1344
|
+
200: {
|
1345
|
+
tokenId: string;
|
1346
|
+
amount: bigint;
|
1347
|
+
};
|
1348
|
+
};
|
1349
|
+
};
|
1350
|
+
};
|
1351
|
+
};
|
1352
|
+
} & {
|
1353
|
+
token: {
|
1354
|
+
count: {
|
1355
|
+
get: {
|
1356
|
+
body: unknown;
|
1357
|
+
params: {};
|
1358
|
+
query: {
|
1359
|
+
items?: number | undefined;
|
1360
|
+
page?: number | undefined;
|
1361
|
+
chainId: number;
|
1362
|
+
address: string;
|
1363
|
+
};
|
1364
|
+
headers: unknown;
|
1365
|
+
response: {
|
1366
|
+
200: {
|
1367
|
+
count: number;
|
1368
|
+
};
|
1369
|
+
};
|
1370
|
+
};
|
1371
|
+
};
|
1372
|
+
};
|
1294
1373
|
} & {
|
1295
1374
|
engine: {
|
1296
1375
|
post: {
|
@@ -1398,25 +1477,6 @@ declare const app: Elysia<"", false, {
|
|
1398
1477
|
};
|
1399
1478
|
};
|
1400
1479
|
};
|
1401
|
-
} & {
|
1402
|
-
count: {
|
1403
|
-
get: {
|
1404
|
-
body: unknown;
|
1405
|
-
params: {};
|
1406
|
-
query: {
|
1407
|
-
items?: number | undefined;
|
1408
|
-
page?: number | undefined;
|
1409
|
-
chainId: number;
|
1410
|
-
campaignId: string;
|
1411
|
-
};
|
1412
|
-
headers: unknown;
|
1413
|
-
response: {
|
1414
|
-
200: {
|
1415
|
-
count: number;
|
1416
|
-
};
|
1417
|
-
};
|
1418
|
-
};
|
1419
|
-
};
|
1420
1480
|
} & {
|
1421
1481
|
count: {
|
1422
1482
|
chains: {
|
@@ -49,6 +49,85 @@ export declare const RewardController: Elysia<"/rewards", false, {
|
|
49
49
|
};
|
50
50
|
};
|
51
51
|
};
|
52
|
+
} & {
|
53
|
+
count: {
|
54
|
+
get: {
|
55
|
+
body: unknown;
|
56
|
+
params: {};
|
57
|
+
query: {
|
58
|
+
items?: number | undefined;
|
59
|
+
page?: number | undefined;
|
60
|
+
chainId: number;
|
61
|
+
campaignId: string;
|
62
|
+
};
|
63
|
+
headers: unknown;
|
64
|
+
response: {
|
65
|
+
200: {
|
66
|
+
count: number;
|
67
|
+
};
|
68
|
+
};
|
69
|
+
};
|
70
|
+
};
|
71
|
+
} & {
|
72
|
+
token: {
|
73
|
+
get: {
|
74
|
+
body: unknown;
|
75
|
+
params: {};
|
76
|
+
query: {
|
77
|
+
items?: number | undefined;
|
78
|
+
page?: number | undefined;
|
79
|
+
chainId: number;
|
80
|
+
address: string;
|
81
|
+
};
|
82
|
+
headers: unknown;
|
83
|
+
response: {
|
84
|
+
200: import("./reward.model").BreakdownForCampaignsRaw[];
|
85
|
+
};
|
86
|
+
};
|
87
|
+
};
|
88
|
+
} & {
|
89
|
+
token: {
|
90
|
+
total: {
|
91
|
+
get: {
|
92
|
+
body: unknown;
|
93
|
+
params: {};
|
94
|
+
query: {
|
95
|
+
items?: number | undefined;
|
96
|
+
page?: number | undefined;
|
97
|
+
chainId: number;
|
98
|
+
address: string;
|
99
|
+
};
|
100
|
+
headers: unknown;
|
101
|
+
response: {
|
102
|
+
200: {
|
103
|
+
tokenId: string;
|
104
|
+
amount: bigint;
|
105
|
+
};
|
106
|
+
};
|
107
|
+
};
|
108
|
+
};
|
109
|
+
};
|
110
|
+
} & {
|
111
|
+
token: {
|
112
|
+
count: {
|
113
|
+
get: {
|
114
|
+
body: unknown;
|
115
|
+
params: {};
|
116
|
+
query: {
|
117
|
+
items?: number | undefined;
|
118
|
+
page?: number | undefined;
|
119
|
+
chainId: number;
|
120
|
+
address: string;
|
121
|
+
};
|
122
|
+
headers: unknown;
|
123
|
+
response: {
|
124
|
+
200: {
|
125
|
+
count: number;
|
126
|
+
};
|
127
|
+
};
|
128
|
+
};
|
129
|
+
};
|
130
|
+
};
|
52
131
|
} & {
|
53
132
|
engine: {
|
54
133
|
post: {
|
@@ -156,25 +235,6 @@ export declare const RewardController: Elysia<"/rewards", false, {
|
|
156
235
|
};
|
157
236
|
};
|
158
237
|
};
|
159
|
-
} & {
|
160
|
-
count: {
|
161
|
-
get: {
|
162
|
-
body: unknown;
|
163
|
-
params: {};
|
164
|
-
query: {
|
165
|
-
items?: number | undefined;
|
166
|
-
page?: number | undefined;
|
167
|
-
chainId: number;
|
168
|
-
campaignId: string;
|
169
|
-
};
|
170
|
-
headers: unknown;
|
171
|
-
response: {
|
172
|
-
200: {
|
173
|
-
count: number;
|
174
|
-
};
|
175
|
-
};
|
176
|
-
};
|
177
|
-
};
|
178
238
|
} & {
|
179
239
|
count: {
|
180
240
|
chains: {
|
@@ -2,7 +2,7 @@ import { BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
|
2
2
|
import { AuthorizationHeadersDto, EngineGuard } from "../../../guards/Engine.guard";
|
3
3
|
import { throwOnInvalidRequiredAddress, throwOnUnsupportedChainId } from "../../../utils/throw";
|
4
4
|
import Elysia from "elysia";
|
5
|
-
import { CampaignIdDto, CampaignIdWithoutPageDto, CreateManyBreakdownDto, CreateManyRewardDto, RegisterClaimsDto, UpdatePendingDto, } from "./reward.model";
|
5
|
+
import { CampaignIdDto, CampaignIdWithoutPageDto, CreateManyBreakdownDto, CreateManyRewardDto, RegisterClaimsDto, TokenIdDto, UpdatePendingDto, } from "./reward.model";
|
6
6
|
import { RewardService } from "./reward.service";
|
7
7
|
// ─── Rewards Controller ──────────────────────────────────────────────────────
|
8
8
|
export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags: ["Rewards"] } })
|
@@ -17,12 +17,49 @@ export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags:
|
|
17
17
|
},
|
18
18
|
})
|
19
19
|
// ─── Get Total Amount Rewarded For Campaign Id ──────────────────────
|
20
|
-
.get("/total", async ({ query }) => await RewardService.
|
20
|
+
.get("/total", async ({ query }) => await RewardService.totalForCampaign(query), {
|
21
21
|
query: CampaignIdDto,
|
22
22
|
beforeHandle: ({ query }) => {
|
23
23
|
throwOnUnsupportedChainId(query.chainId);
|
24
24
|
},
|
25
25
|
detail: { description: "Returns the total amount distributed for a given campaign" },
|
26
|
+
})
|
27
|
+
// ─── Get Reward Count By Chain And Root For Campaign Id ─────────────
|
28
|
+
.get("/count", async ({ query }) => await RewardService.countForCampaign(query), {
|
29
|
+
query: CampaignIdDto,
|
30
|
+
beforeHandle: ({ query }) => {
|
31
|
+
throwOnUnsupportedChainId(query.chainId);
|
32
|
+
},
|
33
|
+
detail: { hide: true },
|
34
|
+
})
|
35
|
+
// ─── Get Reward Breakdowns For Token ───────────────────────────────
|
36
|
+
.get("/token", async ({ query }) => await RewardService.breakdownForToken(query), {
|
37
|
+
query: TokenIdDto,
|
38
|
+
beforeHandle: ({ query }) => {
|
39
|
+
query.address = throwOnInvalidRequiredAddress(query.address);
|
40
|
+
throwOnUnsupportedChainId(query.chainId);
|
41
|
+
},
|
42
|
+
detail: {
|
43
|
+
description: "Returns the all the address that received rewards for a given token, sorted by descending amounts",
|
44
|
+
},
|
45
|
+
})
|
46
|
+
// ─── Get Total Amount Rewarded For Token ───────────────────────────
|
47
|
+
.get("/token/total", async ({ query }) => await RewardService.totalForToken(query), {
|
48
|
+
query: TokenIdDto,
|
49
|
+
beforeHandle: ({ query }) => {
|
50
|
+
query.address = throwOnInvalidRequiredAddress(query.address);
|
51
|
+
throwOnUnsupportedChainId(query.chainId);
|
52
|
+
},
|
53
|
+
detail: { description: "Returns the total amount distributed for a given token" },
|
54
|
+
})
|
55
|
+
// ─── Get Reward Count By Chain And Root For Token ───────────────────
|
56
|
+
.get("/token/count", async ({ query }) => await RewardService.countForToken(query), {
|
57
|
+
query: TokenIdDto,
|
58
|
+
beforeHandle: ({ query }) => {
|
59
|
+
query.address = throwOnInvalidRequiredAddress(query.address);
|
60
|
+
throwOnUnsupportedChainId(query.chainId);
|
61
|
+
},
|
62
|
+
detail: { hide: true },
|
26
63
|
})
|
27
64
|
// ─── Create Many Rewards ─────────────────────────────────────────────
|
28
65
|
.post("/engine", async ({ body }) => await RewardService.createManyReward(body), {
|
@@ -58,14 +95,6 @@ export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags:
|
|
58
95
|
body: UpdatePendingDto,
|
59
96
|
beforeHandle: EngineGuard,
|
60
97
|
detail: { hide: true },
|
61
|
-
})
|
62
|
-
// ─── Get Reward Count By Chain And Root ──────────────────────────────
|
63
|
-
.get("/count", async ({ query }) => await RewardService.count(query), {
|
64
|
-
query: CampaignIdDto,
|
65
|
-
beforeHandle: ({ query }) => {
|
66
|
-
throwOnUnsupportedChainId(query.chainId);
|
67
|
-
},
|
68
|
-
detail: { hide: true },
|
69
98
|
})
|
70
99
|
// ─── Get Reward Count By Chain And Root ──────────────────────────────
|
71
100
|
.get("/count/chains", async () => await RewardService.countAllchains(), {
|
@@ -167,6 +167,12 @@ export declare const CampaignIdDto: import("@sinclair/typebox").TObject<{
|
|
167
167
|
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
168
168
|
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
169
169
|
}>;
|
170
|
+
export declare const TokenIdDto: import("@sinclair/typebox").TObject<{
|
171
|
+
chainId: import("@sinclair/typebox").TNumber;
|
172
|
+
address: import("@sinclair/typebox").TString;
|
173
|
+
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
174
|
+
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
175
|
+
}>;
|
170
176
|
export declare const UserRewardV3Dto: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
171
177
|
symbol: import("@sinclair/typebox").TString;
|
172
178
|
decimals: import("@sinclair/typebox").TNumber;
|
@@ -214,6 +220,7 @@ export type CampaignIdWithoutPageModel = {
|
|
214
220
|
};
|
215
221
|
export type CampaignIdListModel = typeof CampaignIdListDto.static;
|
216
222
|
export type CampaignIdModel = typeof CampaignIdDto.static;
|
223
|
+
export type TokenIdModel = typeof TokenIdDto.static;
|
217
224
|
export type UserRewardV3Model = typeof UserRewardV3Dto.static;
|
218
225
|
export type RewardV3Model = typeof RewardV3Dto.static;
|
219
226
|
export type BreakdownForCampaignsRaw = {
|
@@ -112,6 +112,16 @@ export const CampaignIdDto = t.Object({
|
|
112
112
|
page: t.Optional(t.Numeric({ description: "Page number", default: 0 })), // 0-indexed
|
113
113
|
items: t.Optional(t.Numeric({ description: "Number of returned rows", default: 20 })), // items per page
|
114
114
|
});
|
115
|
+
export const TokenIdDto = t.Object({
|
116
|
+
chainId: t.Numeric({
|
117
|
+
description: "Chain ID",
|
118
|
+
}),
|
119
|
+
address: t.String({
|
120
|
+
description: "Token Address",
|
121
|
+
}),
|
122
|
+
page: t.Optional(t.Numeric({ description: "Page number", default: 0 })), // 0-indexed
|
123
|
+
items: t.Optional(t.Numeric({ description: "Number of returned rows", default: 20 })), // items per page
|
124
|
+
});
|
115
125
|
export const UserRewardV3Dto = t.Record(t.String({ title: "TokenAddress" }), t.Object({
|
116
126
|
symbol: t.String(),
|
117
127
|
decimals: t.Number(),
|