@merkl/api 0.20.121 → 0.20.123
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 +153 -0
- package/dist/src/index.d.ts +51 -0
- package/dist/src/libs/tokens/balances.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +17 -0
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +18 -1
- package/dist/src/modules/v4/campaign/campaign.service.js +2 -1
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +34 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.js +35 -19
- package/dist/src/modules/v4/router.d.ts +51 -0
- package/dist/src/modules/v4/token/token.repository.js +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -1279,6 +1279,23 @@ declare const eden: {
|
|
1279
1279
|
fetch?: RequestInit | undefined;
|
1280
1280
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1281
1281
|
200: {
|
1282
|
+
id: string;
|
1283
|
+
type: string;
|
1284
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
1285
|
+
subType: number | null;
|
1286
|
+
computeChainId: number;
|
1287
|
+
distributionChainId: number;
|
1288
|
+
campaignId: string;
|
1289
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
1290
|
+
rewardTokenId: string;
|
1291
|
+
amount: string;
|
1292
|
+
opportunityId: string;
|
1293
|
+
startTimestamp: bigint;
|
1294
|
+
endTimestamp: bigint;
|
1295
|
+
creatorAddress: string;
|
1296
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
1297
|
+
createdAt: Date;
|
1298
|
+
} | {
|
1282
1299
|
Tokens: {
|
1283
1300
|
symbol: string;
|
1284
1301
|
id: string;
|
@@ -1804,6 +1821,23 @@ declare const eden: {
|
|
1804
1821
|
fetch?: RequestInit | undefined;
|
1805
1822
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1806
1823
|
200: {
|
1824
|
+
id: string;
|
1825
|
+
type: string;
|
1826
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
1827
|
+
subType: number | null;
|
1828
|
+
computeChainId: number;
|
1829
|
+
distributionChainId: number;
|
1830
|
+
campaignId: string;
|
1831
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
1832
|
+
rewardTokenId: string;
|
1833
|
+
amount: string;
|
1834
|
+
opportunityId: string;
|
1835
|
+
startTimestamp: bigint;
|
1836
|
+
endTimestamp: bigint;
|
1837
|
+
creatorAddress: string;
|
1838
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
1839
|
+
createdAt: Date;
|
1840
|
+
} | {
|
1807
1841
|
Tokens: {
|
1808
1842
|
symbol: string;
|
1809
1843
|
id: string;
|
@@ -1885,6 +1919,23 @@ declare const eden: {
|
|
1885
1919
|
fetch?: RequestInit | undefined;
|
1886
1920
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1887
1921
|
200: {
|
1922
|
+
id: string;
|
1923
|
+
type: string;
|
1924
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
1925
|
+
subType: number | null;
|
1926
|
+
computeChainId: number;
|
1927
|
+
distributionChainId: number;
|
1928
|
+
campaignId: string;
|
1929
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
1930
|
+
rewardTokenId: string;
|
1931
|
+
amount: string;
|
1932
|
+
opportunityId: string;
|
1933
|
+
startTimestamp: bigint;
|
1934
|
+
endTimestamp: bigint;
|
1935
|
+
creatorAddress: string;
|
1936
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
1937
|
+
createdAt: Date;
|
1938
|
+
} | {
|
1888
1939
|
Tokens: {
|
1889
1940
|
symbol: string;
|
1890
1941
|
id: string;
|
@@ -6507,6 +6558,23 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6507
6558
|
};
|
6508
6559
|
response: {
|
6509
6560
|
200: {
|
6561
|
+
id: string;
|
6562
|
+
type: string;
|
6563
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
6564
|
+
subType: number | null;
|
6565
|
+
computeChainId: number;
|
6566
|
+
distributionChainId: number;
|
6567
|
+
campaignId: string;
|
6568
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
6569
|
+
rewardTokenId: string;
|
6570
|
+
amount: string;
|
6571
|
+
opportunityId: string;
|
6572
|
+
startTimestamp: bigint;
|
6573
|
+
endTimestamp: bigint;
|
6574
|
+
creatorAddress: string;
|
6575
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
6576
|
+
createdAt: Date;
|
6577
|
+
} | {
|
6510
6578
|
Tokens: {
|
6511
6579
|
symbol: string;
|
6512
6580
|
id: string;
|
@@ -7374,6 +7442,23 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7374
7442
|
};
|
7375
7443
|
response: {
|
7376
7444
|
200: {
|
7445
|
+
id: string;
|
7446
|
+
type: string;
|
7447
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
7448
|
+
subType: number | null;
|
7449
|
+
computeChainId: number;
|
7450
|
+
distributionChainId: number;
|
7451
|
+
campaignId: string;
|
7452
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
7453
|
+
rewardTokenId: string;
|
7454
|
+
amount: string;
|
7455
|
+
opportunityId: string;
|
7456
|
+
startTimestamp: bigint;
|
7457
|
+
endTimestamp: bigint;
|
7458
|
+
creatorAddress: string;
|
7459
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
7460
|
+
createdAt: Date;
|
7461
|
+
} | {
|
7377
7462
|
Tokens: {
|
7378
7463
|
symbol: string;
|
7379
7464
|
id: string;
|
@@ -7462,6 +7547,23 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7462
7547
|
};
|
7463
7548
|
response: {
|
7464
7549
|
200: {
|
7550
|
+
id: string;
|
7551
|
+
type: string;
|
7552
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
7553
|
+
subType: number | null;
|
7554
|
+
computeChainId: number;
|
7555
|
+
distributionChainId: number;
|
7556
|
+
campaignId: string;
|
7557
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
7558
|
+
rewardTokenId: string;
|
7559
|
+
amount: string;
|
7560
|
+
opportunityId: string;
|
7561
|
+
startTimestamp: bigint;
|
7562
|
+
endTimestamp: bigint;
|
7563
|
+
creatorAddress: string;
|
7564
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
7565
|
+
createdAt: Date;
|
7566
|
+
} | {
|
7465
7567
|
Tokens: {
|
7466
7568
|
symbol: string;
|
7467
7569
|
id: string;
|
@@ -12860,6 +12962,23 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12860
12962
|
fetch?: RequestInit | undefined;
|
12861
12963
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
12862
12964
|
200: {
|
12965
|
+
id: string;
|
12966
|
+
type: string;
|
12967
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
12968
|
+
subType: number | null;
|
12969
|
+
computeChainId: number;
|
12970
|
+
distributionChainId: number;
|
12971
|
+
campaignId: string;
|
12972
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
12973
|
+
rewardTokenId: string;
|
12974
|
+
amount: string;
|
12975
|
+
opportunityId: string;
|
12976
|
+
startTimestamp: bigint;
|
12977
|
+
endTimestamp: bigint;
|
12978
|
+
creatorAddress: string;
|
12979
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
12980
|
+
createdAt: Date;
|
12981
|
+
} | {
|
12863
12982
|
Tokens: {
|
12864
12983
|
symbol: string;
|
12865
12984
|
id: string;
|
@@ -13385,6 +13504,23 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13385
13504
|
fetch?: RequestInit | undefined;
|
13386
13505
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
13387
13506
|
200: {
|
13507
|
+
id: string;
|
13508
|
+
type: string;
|
13509
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
13510
|
+
subType: number | null;
|
13511
|
+
computeChainId: number;
|
13512
|
+
distributionChainId: number;
|
13513
|
+
campaignId: string;
|
13514
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
13515
|
+
rewardTokenId: string;
|
13516
|
+
amount: string;
|
13517
|
+
opportunityId: string;
|
13518
|
+
startTimestamp: bigint;
|
13519
|
+
endTimestamp: bigint;
|
13520
|
+
creatorAddress: string;
|
13521
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
13522
|
+
createdAt: Date;
|
13523
|
+
} | {
|
13388
13524
|
Tokens: {
|
13389
13525
|
symbol: string;
|
13390
13526
|
id: string;
|
@@ -13466,6 +13602,23 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13466
13602
|
fetch?: RequestInit | undefined;
|
13467
13603
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
13468
13604
|
200: {
|
13605
|
+
id: string;
|
13606
|
+
type: string;
|
13607
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
13608
|
+
subType: number | null;
|
13609
|
+
computeChainId: number;
|
13610
|
+
distributionChainId: number;
|
13611
|
+
campaignId: string;
|
13612
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
13613
|
+
rewardTokenId: string;
|
13614
|
+
amount: string;
|
13615
|
+
opportunityId: string;
|
13616
|
+
startTimestamp: bigint;
|
13617
|
+
endTimestamp: bigint;
|
13618
|
+
creatorAddress: string;
|
13619
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
13620
|
+
createdAt: Date;
|
13621
|
+
} | {
|
13469
13622
|
Tokens: {
|
13470
13623
|
symbol: string;
|
13471
13624
|
id: string;
|
package/dist/src/index.d.ts
CHANGED
@@ -1332,6 +1332,23 @@ declare const app: Elysia<"", false, {
|
|
1332
1332
|
};
|
1333
1333
|
response: {
|
1334
1334
|
200: {
|
1335
|
+
id: string;
|
1336
|
+
type: string;
|
1337
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
1338
|
+
subType: number | null;
|
1339
|
+
computeChainId: number;
|
1340
|
+
distributionChainId: number;
|
1341
|
+
campaignId: string;
|
1342
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
1343
|
+
rewardTokenId: string;
|
1344
|
+
amount: string;
|
1345
|
+
opportunityId: string;
|
1346
|
+
startTimestamp: bigint;
|
1347
|
+
endTimestamp: bigint;
|
1348
|
+
creatorAddress: string;
|
1349
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
1350
|
+
createdAt: Date;
|
1351
|
+
} | {
|
1335
1352
|
Tokens: {
|
1336
1353
|
symbol: string;
|
1337
1354
|
id: string;
|
@@ -2199,6 +2216,23 @@ declare const app: Elysia<"", false, {
|
|
2199
2216
|
};
|
2200
2217
|
response: {
|
2201
2218
|
200: {
|
2219
|
+
id: string;
|
2220
|
+
type: string;
|
2221
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
2222
|
+
subType: number | null;
|
2223
|
+
computeChainId: number;
|
2224
|
+
distributionChainId: number;
|
2225
|
+
campaignId: string;
|
2226
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
2227
|
+
rewardTokenId: string;
|
2228
|
+
amount: string;
|
2229
|
+
opportunityId: string;
|
2230
|
+
startTimestamp: bigint;
|
2231
|
+
endTimestamp: bigint;
|
2232
|
+
creatorAddress: string;
|
2233
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
2234
|
+
createdAt: Date;
|
2235
|
+
} | {
|
2202
2236
|
Tokens: {
|
2203
2237
|
symbol: string;
|
2204
2238
|
id: string;
|
@@ -2287,6 +2321,23 @@ declare const app: Elysia<"", false, {
|
|
2287
2321
|
};
|
2288
2322
|
response: {
|
2289
2323
|
200: {
|
2324
|
+
id: string;
|
2325
|
+
type: string;
|
2326
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
2327
|
+
subType: number | null;
|
2328
|
+
computeChainId: number;
|
2329
|
+
distributionChainId: number;
|
2330
|
+
campaignId: string;
|
2331
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
2332
|
+
rewardTokenId: string;
|
2333
|
+
amount: string;
|
2334
|
+
opportunityId: string;
|
2335
|
+
startTimestamp: bigint;
|
2336
|
+
endTimestamp: bigint;
|
2337
|
+
creatorAddress: string;
|
2338
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
2339
|
+
createdAt: Date;
|
2340
|
+
} | {
|
2290
2341
|
Tokens: {
|
2291
2342
|
symbol: string;
|
2292
2343
|
id: string;
|
@@ -41,7 +41,7 @@ export async function getOnlyUserBalance(chainId, userAddress, tokenAddresses) {
|
|
41
41
|
return res;
|
42
42
|
}
|
43
43
|
export async function getUserBalances(user, chainId, tokenAddresses) {
|
44
|
-
const tokens = await TokenService.findManyObjectPerAddress({ chainId, verified: true });
|
44
|
+
const tokens = await TokenService.findManyObjectPerAddress({ chainId, verified: true, items: 0 });
|
45
45
|
if (!tokens) {
|
46
46
|
log.debug("❌ Chain not supported");
|
47
47
|
return {
|
@@ -38,6 +38,23 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
38
38
|
};
|
39
39
|
response: {
|
40
40
|
200: {
|
41
|
+
id: string;
|
42
|
+
type: string;
|
43
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
44
|
+
subType: number | null;
|
45
|
+
computeChainId: number;
|
46
|
+
distributionChainId: number;
|
47
|
+
campaignId: string;
|
48
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
49
|
+
rewardTokenId: string;
|
50
|
+
amount: string;
|
51
|
+
opportunityId: string;
|
52
|
+
startTimestamp: bigint;
|
53
|
+
endTimestamp: bigint;
|
54
|
+
creatorAddress: string;
|
55
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
56
|
+
createdAt: Date;
|
57
|
+
} | {
|
41
58
|
Tokens: {
|
42
59
|
symbol: string;
|
43
60
|
id: string;
|
@@ -148,7 +148,24 @@ export declare abstract class CampaignService {
|
|
148
148
|
computeChainId?: number;
|
149
149
|
type?: string;
|
150
150
|
}): Promise<number>;
|
151
|
-
static create(body: Omit<CreateCampaignModel, "id">, dryRun?: boolean): Promise<
|
151
|
+
static create(body: Omit<CreateCampaignModel, "id">, dryRun?: boolean): Promise<{
|
152
|
+
id: string;
|
153
|
+
type: string;
|
154
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
155
|
+
subType: number | null;
|
156
|
+
computeChainId: number;
|
157
|
+
distributionChainId: number;
|
158
|
+
campaignId: string;
|
159
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
160
|
+
rewardTokenId: string;
|
161
|
+
amount: string;
|
162
|
+
opportunityId: string;
|
163
|
+
startTimestamp: bigint;
|
164
|
+
endTimestamp: bigint;
|
165
|
+
creatorAddress: string;
|
166
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
167
|
+
createdAt: Date;
|
168
|
+
} | ({
|
152
169
|
Tokens: {
|
153
170
|
symbol: string;
|
154
171
|
id: string;
|
@@ -34,6 +34,7 @@ export class CampaignService {
|
|
34
34
|
return await CampaignRepository.countLives(query);
|
35
35
|
}
|
36
36
|
static async create(body, dryRun = false) {
|
37
|
+
log.info(`creating campaign ${body.campaignId} on ${NETWORK_LABELS[body.chainId]}`);
|
37
38
|
const campaignType = CampaignService.getTypeFromV3(body.type);
|
38
39
|
const id = CampaignService.hashId({ distributionChain: body.chainId, campaignId: body.campaignId });
|
39
40
|
const [rewardToken] = await TokenService.findManyOrCreate([
|
@@ -70,7 +71,7 @@ export class CampaignService {
|
|
70
71
|
console.error(e);
|
71
72
|
throw new CannotParseOpportunity(campaign.campaignId, campaign.distributionChainId, campaign.type);
|
72
73
|
}
|
73
|
-
await CampaignRepository.upsert(campaign, body.opportunityIdentifier);
|
74
|
+
return await CampaignRepository.upsert(campaign, body.opportunityIdentifier);
|
74
75
|
}
|
75
76
|
/**
|
76
77
|
* @dev back-office function
|
@@ -149,6 +149,23 @@ export declare const CampaignTestController: Elysia<"/campaigns", false, {
|
|
149
149
|
};
|
150
150
|
response: {
|
151
151
|
200: {
|
152
|
+
id: string;
|
153
|
+
type: string;
|
154
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
155
|
+
subType: number | null;
|
156
|
+
computeChainId: number;
|
157
|
+
distributionChainId: number;
|
158
|
+
campaignId: string;
|
159
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
160
|
+
rewardTokenId: string;
|
161
|
+
amount: string;
|
162
|
+
opportunityId: string;
|
163
|
+
startTimestamp: bigint;
|
164
|
+
endTimestamp: bigint;
|
165
|
+
creatorAddress: string;
|
166
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
167
|
+
createdAt: Date;
|
168
|
+
} | {
|
152
169
|
Tokens: {
|
153
170
|
symbol: string;
|
154
171
|
id: string;
|
@@ -237,6 +254,23 @@ export declare const CampaignTestController: Elysia<"/campaigns", false, {
|
|
237
254
|
};
|
238
255
|
response: {
|
239
256
|
200: {
|
257
|
+
id: string;
|
258
|
+
type: string;
|
259
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
260
|
+
subType: number | null;
|
261
|
+
computeChainId: number;
|
262
|
+
distributionChainId: number;
|
263
|
+
campaignId: string;
|
264
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
265
|
+
rewardTokenId: string;
|
266
|
+
amount: string;
|
267
|
+
opportunityId: string;
|
268
|
+
startTimestamp: bigint;
|
269
|
+
endTimestamp: bigint;
|
270
|
+
creatorAddress: string;
|
271
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
272
|
+
createdAt: Date;
|
273
|
+
} | {
|
240
274
|
Tokens: {
|
241
275
|
symbol: string;
|
242
276
|
id: string;
|
@@ -165,6 +165,39 @@ export class OpportunityService {
|
|
165
165
|
}
|
166
166
|
static formatResponse(opportunity) {
|
167
167
|
const { DailyRewardsRecords, AprRecords, TvlRecords, Campaigns, ...opp } = opportunity;
|
168
|
+
const rewardsRecord = DailyRewardsRecords.length === 0
|
169
|
+
? {
|
170
|
+
id: "",
|
171
|
+
total: 0,
|
172
|
+
timestamp: 0n,
|
173
|
+
breakdowns: [],
|
174
|
+
}
|
175
|
+
: (DailyRewardsRecords?.map(({ id, total, timestamp, DailyRewardsBreakdown: breakdowns }) => ({
|
176
|
+
id,
|
177
|
+
total,
|
178
|
+
timestamp,
|
179
|
+
breakdowns: breakdowns.map(({ Campaign, ...breakdown }) => {
|
180
|
+
return {
|
181
|
+
token: Campaign.RewardToken,
|
182
|
+
amount: CampaignService.getDailyAmount(Campaign.startTimestamp, Campaign.endTimestamp, BigInt(Campaign.amount)),
|
183
|
+
distributionType: Campaign.distributionType,
|
184
|
+
...breakdown,
|
185
|
+
};
|
186
|
+
}),
|
187
|
+
}))?.[0] ?? undefined);
|
188
|
+
const tvlRecord = TvlRecords.length === 0
|
189
|
+
? {
|
190
|
+
id: "",
|
191
|
+
total: 0,
|
192
|
+
timestamp: 0n,
|
193
|
+
breakdowns: [],
|
194
|
+
}
|
195
|
+
: (TvlRecords?.map(({ id, total, timestamp, TvlBreakdown: breakdowns }) => ({
|
196
|
+
id,
|
197
|
+
total,
|
198
|
+
timestamp,
|
199
|
+
breakdowns,
|
200
|
+
}))?.[0] ?? undefined);
|
168
201
|
const aprRecord = opp.status === "LIVE"
|
169
202
|
? (AprRecords?.map(({ cumulated, timestamp, AprBreakdown: breakdowns }) => ({
|
170
203
|
cumulated,
|
@@ -180,25 +213,8 @@ export class OpportunityService {
|
|
180
213
|
...OpportunityService.formatResponseBase(opp),
|
181
214
|
apr: opp.apr,
|
182
215
|
aprRecord,
|
183
|
-
tvlRecord
|
184
|
-
|
185
|
-
total,
|
186
|
-
timestamp,
|
187
|
-
breakdowns,
|
188
|
-
}))?.[0] ?? undefined,
|
189
|
-
rewardsRecord: DailyRewardsRecords?.map(({ id, total, timestamp, DailyRewardsBreakdown: breakdowns }) => ({
|
190
|
-
id,
|
191
|
-
total,
|
192
|
-
timestamp,
|
193
|
-
breakdowns: breakdowns.map(({ Campaign, ...breakdown }) => {
|
194
|
-
return {
|
195
|
-
token: Campaign.RewardToken,
|
196
|
-
amount: CampaignService.getDailyAmount(Campaign.startTimestamp, Campaign.endTimestamp, BigInt(Campaign.amount)),
|
197
|
-
distributionType: Campaign.distributionType,
|
198
|
-
...breakdown,
|
199
|
-
};
|
200
|
-
}),
|
201
|
-
}))?.[0] ?? undefined,
|
216
|
+
tvlRecord,
|
217
|
+
rewardsRecord,
|
202
218
|
campaigns: !!Campaigns ? Campaigns?.map(c => CampaignService.format(c)) : undefined,
|
203
219
|
//TODO: change this to accomodate all return types
|
204
220
|
};
|
@@ -1202,6 +1202,23 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1202
1202
|
};
|
1203
1203
|
response: {
|
1204
1204
|
200: {
|
1205
|
+
id: string;
|
1206
|
+
type: string;
|
1207
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
1208
|
+
subType: number | null;
|
1209
|
+
computeChainId: number;
|
1210
|
+
distributionChainId: number;
|
1211
|
+
campaignId: string;
|
1212
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
1213
|
+
rewardTokenId: string;
|
1214
|
+
amount: string;
|
1215
|
+
opportunityId: string;
|
1216
|
+
startTimestamp: bigint;
|
1217
|
+
endTimestamp: bigint;
|
1218
|
+
creatorAddress: string;
|
1219
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
1220
|
+
createdAt: Date;
|
1221
|
+
} | {
|
1205
1222
|
Tokens: {
|
1206
1223
|
symbol: string;
|
1207
1224
|
id: string;
|
@@ -2069,6 +2086,23 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2069
2086
|
};
|
2070
2087
|
response: {
|
2071
2088
|
200: {
|
2089
|
+
id: string;
|
2090
|
+
type: string;
|
2091
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
2092
|
+
subType: number | null;
|
2093
|
+
computeChainId: number;
|
2094
|
+
distributionChainId: number;
|
2095
|
+
campaignId: string;
|
2096
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
2097
|
+
rewardTokenId: string;
|
2098
|
+
amount: string;
|
2099
|
+
opportunityId: string;
|
2100
|
+
startTimestamp: bigint;
|
2101
|
+
endTimestamp: bigint;
|
2102
|
+
creatorAddress: string;
|
2103
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
2104
|
+
createdAt: Date;
|
2105
|
+
} | {
|
2072
2106
|
Tokens: {
|
2073
2107
|
symbol: string;
|
2074
2108
|
id: string;
|
@@ -2157,6 +2191,23 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2157
2191
|
};
|
2158
2192
|
response: {
|
2159
2193
|
200: {
|
2194
|
+
id: string;
|
2195
|
+
type: string;
|
2196
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
2197
|
+
subType: number | null;
|
2198
|
+
computeChainId: number;
|
2199
|
+
distributionChainId: number;
|
2200
|
+
campaignId: string;
|
2201
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
2202
|
+
rewardTokenId: string;
|
2203
|
+
amount: string;
|
2204
|
+
opportunityId: string;
|
2205
|
+
startTimestamp: bigint;
|
2206
|
+
endTimestamp: bigint;
|
2207
|
+
creatorAddress: string;
|
2208
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
2209
|
+
createdAt: Date;
|
2210
|
+
} | {
|
2160
2211
|
Tokens: {
|
2161
2212
|
symbol: string;
|
2162
2213
|
id: string;
|
@@ -6,7 +6,7 @@ export class TokenRepository {
|
|
6
6
|
const ids = query.id ? query.id.map(id => ({ id })) : [];
|
7
7
|
const { page: _page, items: _items } = query;
|
8
8
|
const page = _page ? _page : 0;
|
9
|
-
const items = _items !== undefined ? _items : 100;
|
9
|
+
const items = _items === 0 ? 10_000 : _items !== undefined ? _items : 100;
|
10
10
|
return {
|
11
11
|
take: items === 0 ? undefined : items,
|
12
12
|
skip: page * items,
|