@merkl/api 0.10.311 → 0.10.313
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 +126 -21
- package/dist/src/index.d.ts +46 -13
- package/dist/src/modules/v4/explorer/explorer.controller.js +1 -1
- package/dist/src/modules/v4/reward/reward.controller.d.ts +6 -4
- package/dist/src/modules/v4/reward/reward.controller.js +7 -2
- package/dist/src/modules/v4/reward/reward.repository.d.ts +4 -10
- package/dist/src/modules/v4/reward/reward.repository.js +18 -9
- package/dist/src/modules/v4/reward/reward.service.d.ts +6 -4
- package/dist/src/modules/v4/reward/reward.service.js +26 -32
- package/dist/src/modules/v4/router.d.ts +46 -13
- package/dist/src/modules/v4/status/status.controller.d.ts +40 -9
- package/dist/src/modules/v4/status/status.controller.js +17 -4
- package/dist/src/modules/v4/status/status.model.d.ts +6 -0
- package/dist/src/modules/v4/status/status.model.js +5 -0
- package/dist/src/modules/v4/status/status.repository.d.ts +19 -1
- package/dist/src/modules/v4/status/status.repository.js +25 -0
- package/dist/src/modules/v4/status/status.service.d.ts +21 -1
- package/dist/src/modules/v4/status/status.service.js +16 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +3 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -1097,18 +1097,20 @@ declare const eden: {
|
|
1097
1097
|
count: number;
|
1098
1098
|
};
|
1099
1099
|
}>>;
|
1100
|
-
|
1100
|
+
chain: {
|
1101
1101
|
get: (options: {
|
1102
1102
|
headers: {
|
1103
1103
|
authorization: string;
|
1104
1104
|
};
|
1105
|
-
query
|
1105
|
+
query: {
|
1106
|
+
chainId: number;
|
1107
|
+
};
|
1106
1108
|
fetch?: RequestInit | undefined;
|
1107
1109
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1108
1110
|
200: {
|
1109
1111
|
[x: string]: {
|
1110
|
-
|
1111
|
-
|
1112
|
+
rewardCount: number;
|
1113
|
+
breakdownCount: number;
|
1112
1114
|
};
|
1113
1115
|
};
|
1114
1116
|
}>>;
|
@@ -2181,6 +2183,40 @@ declare const eden: {
|
|
2181
2183
|
}[];
|
2182
2184
|
}>>;
|
2183
2185
|
};
|
2186
|
+
delay: {
|
2187
|
+
index: {
|
2188
|
+
get: (options: {
|
2189
|
+
headers?: Record<string, unknown> | undefined;
|
2190
|
+
query: {
|
2191
|
+
chainId?: number | undefined;
|
2192
|
+
endTimestampLowerBound?: number | undefined;
|
2193
|
+
delayLowerBound?: number | undefined;
|
2194
|
+
};
|
2195
|
+
fetch?: RequestInit | undefined;
|
2196
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2197
|
+
200: {
|
2198
|
+
delay: number;
|
2199
|
+
delayFormatted: string;
|
2200
|
+
startTimestamp: bigint;
|
2201
|
+
endTimestamp: bigint;
|
2202
|
+
computeChainId: number;
|
2203
|
+
distributionChainId: number;
|
2204
|
+
campaignId: string;
|
2205
|
+
Opportunity: {
|
2206
|
+
name: string;
|
2207
|
+
};
|
2208
|
+
CampaignStatus: {
|
2209
|
+
error: string;
|
2210
|
+
details: import("database/api/.generated/runtime/library").JsonValue;
|
2211
|
+
status: import("../../database/api/.generated").$Enums.RunStatus;
|
2212
|
+
campaignId: string;
|
2213
|
+
computedUntil: bigint;
|
2214
|
+
processingStarted: bigint;
|
2215
|
+
}[];
|
2216
|
+
}[];
|
2217
|
+
}>>;
|
2218
|
+
};
|
2219
|
+
};
|
2184
2220
|
};
|
2185
2221
|
liquidity: {
|
2186
2222
|
index: {
|
@@ -4399,19 +4435,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4399
4435
|
};
|
4400
4436
|
} & {
|
4401
4437
|
count: {
|
4402
|
-
|
4438
|
+
chain: {
|
4403
4439
|
get: {
|
4404
4440
|
body: unknown;
|
4405
4441
|
params: {};
|
4406
|
-
query:
|
4442
|
+
query: {
|
4443
|
+
chainId: number;
|
4444
|
+
};
|
4407
4445
|
headers: {
|
4408
4446
|
authorization: string;
|
4409
4447
|
};
|
4410
4448
|
response: {
|
4411
4449
|
200: {
|
4412
4450
|
[x: string]: {
|
4413
|
-
|
4414
|
-
|
4451
|
+
rewardCount: number;
|
4452
|
+
breakdownCount: number;
|
4415
4453
|
};
|
4416
4454
|
};
|
4417
4455
|
};
|
@@ -5550,9 +5588,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5550
5588
|
};
|
5551
5589
|
};
|
5552
5590
|
};
|
5553
|
-
}
|
5554
|
-
} & {
|
5555
|
-
"campaign-status": {
|
5591
|
+
} & {
|
5556
5592
|
engine: {
|
5557
5593
|
overlaps: {
|
5558
5594
|
get: {
|
@@ -5571,9 +5607,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5571
5607
|
};
|
5572
5608
|
};
|
5573
5609
|
};
|
5574
|
-
}
|
5575
|
-
} & {
|
5576
|
-
"campaign-status": {
|
5610
|
+
} & {
|
5577
5611
|
index: {
|
5578
5612
|
get: {
|
5579
5613
|
body: unknown;
|
@@ -5595,9 +5629,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5595
5629
|
};
|
5596
5630
|
};
|
5597
5631
|
};
|
5598
|
-
}
|
5599
|
-
} & {
|
5600
|
-
"campaign-status": {
|
5632
|
+
} & {
|
5601
5633
|
":campaignId": {
|
5602
5634
|
get: {
|
5603
5635
|
body: unknown;
|
@@ -5625,6 +5657,43 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5625
5657
|
};
|
5626
5658
|
};
|
5627
5659
|
};
|
5660
|
+
} & {
|
5661
|
+
delay: {
|
5662
|
+
index: {
|
5663
|
+
get: {
|
5664
|
+
body: unknown;
|
5665
|
+
params: {};
|
5666
|
+
query: {
|
5667
|
+
chainId?: number | undefined;
|
5668
|
+
endTimestampLowerBound?: number | undefined;
|
5669
|
+
delayLowerBound?: number | undefined;
|
5670
|
+
};
|
5671
|
+
headers: unknown;
|
5672
|
+
response: {
|
5673
|
+
200: {
|
5674
|
+
delay: number;
|
5675
|
+
delayFormatted: string;
|
5676
|
+
startTimestamp: bigint;
|
5677
|
+
endTimestamp: bigint;
|
5678
|
+
computeChainId: number;
|
5679
|
+
distributionChainId: number;
|
5680
|
+
campaignId: string;
|
5681
|
+
Opportunity: {
|
5682
|
+
name: string;
|
5683
|
+
};
|
5684
|
+
CampaignStatus: {
|
5685
|
+
error: string;
|
5686
|
+
details: import("database/api/.generated/runtime/library").JsonValue;
|
5687
|
+
status: import("../../database/api/.generated").$Enums.RunStatus;
|
5688
|
+
campaignId: string;
|
5689
|
+
computedUntil: bigint;
|
5690
|
+
processingStarted: bigint;
|
5691
|
+
}[];
|
5692
|
+
}[];
|
5693
|
+
};
|
5694
|
+
};
|
5695
|
+
};
|
5696
|
+
};
|
5628
5697
|
};
|
5629
5698
|
};
|
5630
5699
|
} & {
|
@@ -7674,18 +7743,20 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7674
7743
|
count: number;
|
7675
7744
|
};
|
7676
7745
|
}>>;
|
7677
|
-
|
7746
|
+
chain: {
|
7678
7747
|
get: (options: {
|
7679
7748
|
headers: {
|
7680
7749
|
authorization: string;
|
7681
7750
|
};
|
7682
|
-
query
|
7751
|
+
query: {
|
7752
|
+
chainId: number;
|
7753
|
+
};
|
7683
7754
|
fetch?: RequestInit | undefined;
|
7684
7755
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7685
7756
|
200: {
|
7686
7757
|
[x: string]: {
|
7687
|
-
|
7688
|
-
|
7758
|
+
rewardCount: number;
|
7759
|
+
breakdownCount: number;
|
7689
7760
|
};
|
7690
7761
|
};
|
7691
7762
|
}>>;
|
@@ -8758,6 +8829,40 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8758
8829
|
}[];
|
8759
8830
|
}>>;
|
8760
8831
|
};
|
8832
|
+
delay: {
|
8833
|
+
index: {
|
8834
|
+
get: (options: {
|
8835
|
+
headers?: Record<string, unknown> | undefined;
|
8836
|
+
query: {
|
8837
|
+
chainId?: number | undefined;
|
8838
|
+
endTimestampLowerBound?: number | undefined;
|
8839
|
+
delayLowerBound?: number | undefined;
|
8840
|
+
};
|
8841
|
+
fetch?: RequestInit | undefined;
|
8842
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8843
|
+
200: {
|
8844
|
+
delay: number;
|
8845
|
+
delayFormatted: string;
|
8846
|
+
startTimestamp: bigint;
|
8847
|
+
endTimestamp: bigint;
|
8848
|
+
computeChainId: number;
|
8849
|
+
distributionChainId: number;
|
8850
|
+
campaignId: string;
|
8851
|
+
Opportunity: {
|
8852
|
+
name: string;
|
8853
|
+
};
|
8854
|
+
CampaignStatus: {
|
8855
|
+
error: string;
|
8856
|
+
details: import("database/api/.generated/runtime/library").JsonValue;
|
8857
|
+
status: import("../../database/api/.generated").$Enums.RunStatus;
|
8858
|
+
campaignId: string;
|
8859
|
+
computedUntil: bigint;
|
8860
|
+
processingStarted: bigint;
|
8861
|
+
}[];
|
8862
|
+
}[];
|
8863
|
+
}>>;
|
8864
|
+
};
|
8865
|
+
};
|
8761
8866
|
};
|
8762
8867
|
liquidity: {
|
8763
8868
|
index: {
|
package/dist/src/index.d.ts
CHANGED
@@ -1486,19 +1486,21 @@ declare const app: Elysia<"", false, {
|
|
1486
1486
|
};
|
1487
1487
|
} & {
|
1488
1488
|
count: {
|
1489
|
-
|
1489
|
+
chain: {
|
1490
1490
|
get: {
|
1491
1491
|
body: unknown;
|
1492
1492
|
params: {};
|
1493
|
-
query:
|
1493
|
+
query: {
|
1494
|
+
chainId: number;
|
1495
|
+
};
|
1494
1496
|
headers: {
|
1495
1497
|
authorization: string;
|
1496
1498
|
};
|
1497
1499
|
response: {
|
1498
1500
|
200: {
|
1499
1501
|
[x: string]: {
|
1500
|
-
|
1501
|
-
|
1502
|
+
rewardCount: number;
|
1503
|
+
breakdownCount: number;
|
1502
1504
|
};
|
1503
1505
|
};
|
1504
1506
|
};
|
@@ -2637,9 +2639,7 @@ declare const app: Elysia<"", false, {
|
|
2637
2639
|
};
|
2638
2640
|
};
|
2639
2641
|
};
|
2640
|
-
}
|
2641
|
-
} & {
|
2642
|
-
"campaign-status": {
|
2642
|
+
} & {
|
2643
2643
|
engine: {
|
2644
2644
|
overlaps: {
|
2645
2645
|
get: {
|
@@ -2658,9 +2658,7 @@ declare const app: Elysia<"", false, {
|
|
2658
2658
|
};
|
2659
2659
|
};
|
2660
2660
|
};
|
2661
|
-
}
|
2662
|
-
} & {
|
2663
|
-
"campaign-status": {
|
2661
|
+
} & {
|
2664
2662
|
index: {
|
2665
2663
|
get: {
|
2666
2664
|
body: unknown;
|
@@ -2682,9 +2680,7 @@ declare const app: Elysia<"", false, {
|
|
2682
2680
|
};
|
2683
2681
|
};
|
2684
2682
|
};
|
2685
|
-
}
|
2686
|
-
} & {
|
2687
|
-
"campaign-status": {
|
2683
|
+
} & {
|
2688
2684
|
":campaignId": {
|
2689
2685
|
get: {
|
2690
2686
|
body: unknown;
|
@@ -2712,6 +2708,43 @@ declare const app: Elysia<"", false, {
|
|
2712
2708
|
};
|
2713
2709
|
};
|
2714
2710
|
};
|
2711
|
+
} & {
|
2712
|
+
delay: {
|
2713
|
+
index: {
|
2714
|
+
get: {
|
2715
|
+
body: unknown;
|
2716
|
+
params: {};
|
2717
|
+
query: {
|
2718
|
+
chainId?: number | undefined;
|
2719
|
+
endTimestampLowerBound?: number | undefined;
|
2720
|
+
delayLowerBound?: number | undefined;
|
2721
|
+
};
|
2722
|
+
headers: unknown;
|
2723
|
+
response: {
|
2724
|
+
200: {
|
2725
|
+
delay: number;
|
2726
|
+
delayFormatted: string;
|
2727
|
+
startTimestamp: bigint;
|
2728
|
+
endTimestamp: bigint;
|
2729
|
+
computeChainId: number;
|
2730
|
+
distributionChainId: number;
|
2731
|
+
campaignId: string;
|
2732
|
+
Opportunity: {
|
2733
|
+
name: string;
|
2734
|
+
};
|
2735
|
+
CampaignStatus: {
|
2736
|
+
error: string;
|
2737
|
+
details: import("database/api/.generated/runtime/library").JsonValue;
|
2738
|
+
status: import("../database/api/.generated").$Enums.RunStatus;
|
2739
|
+
campaignId: string;
|
2740
|
+
computedUntil: bigint;
|
2741
|
+
processingStarted: bigint;
|
2742
|
+
}[];
|
2743
|
+
}[];
|
2744
|
+
};
|
2745
|
+
};
|
2746
|
+
};
|
2747
|
+
};
|
2715
2748
|
};
|
2716
2749
|
};
|
2717
2750
|
} & {
|
@@ -4,7 +4,7 @@ import { ExplorerService } from ".";
|
|
4
4
|
import { CreateExplorerDto } from "./explorer.model";
|
5
5
|
// ─── Explorer Controller ───────────────────────────────────────────────────────
|
6
6
|
export const ExplorerController = new Elysia({ prefix: "/explorers", detail: { tags: ["Explorers"] } })
|
7
|
-
// ─── Create An Explorer
|
7
|
+
// ─── Create An Explorer ──────────────────────────────────────────────────────
|
8
8
|
.post("", async ({ body }) => await ExplorerService.create(body), {
|
9
9
|
beforeHandle: BackOfficeGuard,
|
10
10
|
headers: AuthorizationHeadersDto,
|
@@ -244,19 +244,21 @@ export declare const RewardController: Elysia<"/rewards", false, {
|
|
244
244
|
};
|
245
245
|
} & {
|
246
246
|
count: {
|
247
|
-
|
247
|
+
chain: {
|
248
248
|
get: {
|
249
249
|
body: unknown;
|
250
250
|
params: {};
|
251
|
-
query:
|
251
|
+
query: {
|
252
|
+
chainId: number;
|
253
|
+
};
|
252
254
|
headers: {
|
253
255
|
authorization: string;
|
254
256
|
};
|
255
257
|
response: {
|
256
258
|
200: {
|
257
259
|
[x: string]: {
|
258
|
-
|
259
|
-
|
260
|
+
rewardCount: number;
|
261
|
+
breakdownCount: number;
|
260
262
|
};
|
261
263
|
};
|
262
264
|
};
|
@@ -2,6 +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 { ChainDto } from "../accounting";
|
5
6
|
import { CampaignIdDto, CampaignIdWithoutPageDto, CreateManyBreakdownDto, CreateManyRewardDto, RegisterClaimsDto, TokenIdDto, UpdatePendingDto, } from "./reward.model";
|
6
7
|
import { RewardService } from "./reward.service";
|
7
8
|
// ─── Rewards Controller ──────────────────────────────────────────────────────
|
@@ -101,9 +102,13 @@ export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags:
|
|
101
102
|
}));
|
102
103
|
})
|
103
104
|
// ─── Get Reward Count By Chain And Root ──────────────────────────────
|
104
|
-
.get("/count/
|
105
|
+
.get("/count/chain", async ({ query }) => await RewardService.countOnChain(query.chainId), {
|
106
|
+
query: ChainDto,
|
105
107
|
headers: AuthorizationHeadersDto,
|
106
|
-
beforeHandle:
|
108
|
+
beforeHandle: ({ headers, query }) => {
|
109
|
+
BackOfficeGuard({ headers });
|
110
|
+
throwOnUnsupportedChainId(query.chainId);
|
111
|
+
},
|
107
112
|
detail: { hide: true },
|
108
113
|
})
|
109
114
|
// ─── Unclaimed Data routes ───────────────────────────────────────────
|
@@ -121,16 +121,10 @@ export declare abstract class RewardRepository {
|
|
121
121
|
claimed: string;
|
122
122
|
proofs: string[];
|
123
123
|
}) | null>;
|
124
|
-
static
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
})[]>;
|
129
|
-
static countRewardBreakdownPerCampaignId(): Promise<(Prisma.PickEnumerable<Prisma.RewardBreakdownGroupByOutputType, "campaignId"[]> & {
|
130
|
-
_count: {
|
131
|
-
_all: number;
|
132
|
-
};
|
133
|
-
})[]>;
|
124
|
+
static countRewardAndBreakdownOnChain(chainId: number, root: string): Promise<{
|
125
|
+
rewardCount: number;
|
126
|
+
breakdownCount: number;
|
127
|
+
}>;
|
134
128
|
static updateClaimed(recipient: string, rewardTokenId: string, campaignId: string, reason: string, amount: string): Promise<Prisma.BatchPayload>;
|
135
129
|
static findManyBreakdownUniques(uniques: {
|
136
130
|
rewardId: string;
|
@@ -115,17 +115,26 @@ export class RewardRepository {
|
|
115
115
|
},
|
116
116
|
});
|
117
117
|
}
|
118
|
-
static async
|
119
|
-
|
120
|
-
|
121
|
-
|
118
|
+
static async countRewardAndBreakdownOnChain(chainId, root) {
|
119
|
+
const rewardCount = await apiDbClient.reward.count({
|
120
|
+
where: {
|
121
|
+
root,
|
122
|
+
RewardToken: {
|
123
|
+
chainId,
|
124
|
+
},
|
125
|
+
},
|
122
126
|
});
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
127
|
+
const breakdownCount = await apiDbClient.rewardBreakdown.count({
|
128
|
+
where: {
|
129
|
+
Reward: {
|
130
|
+
root,
|
131
|
+
RewardToken: {
|
132
|
+
chainId,
|
133
|
+
},
|
134
|
+
},
|
135
|
+
},
|
128
136
|
});
|
137
|
+
return { rewardCount, breakdownCount };
|
129
138
|
}
|
130
139
|
static async updateClaimed(recipient, rewardTokenId, campaignId, reason, amount) {
|
131
140
|
return await apiDbClient.rewardBreakdown.updateMany({
|
@@ -558,10 +558,12 @@ export declare abstract class RewardService {
|
|
558
558
|
created: number;
|
559
559
|
updated: number;
|
560
560
|
}>;
|
561
|
-
static
|
562
|
-
|
563
|
-
|
564
|
-
|
561
|
+
static countOnChain(chainId: number): Promise<{
|
562
|
+
[x: string]: {
|
563
|
+
rewardCount: number;
|
564
|
+
breakdownCount: number;
|
565
|
+
};
|
566
|
+
}>;
|
565
567
|
static breakdownForCampaign(query: CampaignIdModel): Promise<import("./reward.model").BreakdownForCampaignsRaw[]>;
|
566
568
|
static countForCampaign(query: CampaignIdModel): Promise<{
|
567
569
|
count: number;
|
@@ -287,29 +287,17 @@ export class RewardService {
|
|
287
287
|
await RewardRepository.createBreakdownPendings(rewardTokenId, data.root, campaignId, breakdownToCreate);
|
288
288
|
return { created: breakdownToCreate.length, updated: breakdownToUpdate.length };
|
289
289
|
}
|
290
|
-
static async
|
291
|
-
const
|
292
|
-
const
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
res[NETWORK_LABELS[chainId]] = { rewards: {}, breakdown: 0 };
|
302
|
-
if (!res[NETWORK_LABELS[chainId]].rewards[root])
|
303
|
-
res[NETWORK_LABELS[chainId]].rewards[root] = 0;
|
304
|
-
res[NETWORK_LABELS[chainId]].rewards[root] += _count._all;
|
305
|
-
}
|
306
|
-
for (const { _count, campaignId } of rewardBreakdownPerCampaignId) {
|
307
|
-
const chainId = campaignIdToChain[campaignId];
|
308
|
-
if (!chainId)
|
309
|
-
continue;
|
310
|
-
res[NETWORK_LABELS[chainId]].breakdown += _count._all;
|
311
|
-
}
|
312
|
-
return res;
|
290
|
+
static async countOnChain(chainId) {
|
291
|
+
const roots = await MerklRootService.fetch(chainId);
|
292
|
+
const promises = [
|
293
|
+
RewardRepository.countRewardAndBreakdownOnChain(chainId, roots.tree),
|
294
|
+
RewardRepository.countRewardAndBreakdownOnChain(chainId, roots.lastTree),
|
295
|
+
];
|
296
|
+
await Promise.all(promises);
|
297
|
+
return {
|
298
|
+
[roots.tree]: await promises[0],
|
299
|
+
[roots.lastTree]: await promises[1],
|
300
|
+
};
|
313
301
|
}
|
314
302
|
static async breakdownForCampaign(query) {
|
315
303
|
const root = await MerklRootService.fetch(query.chainId);
|
@@ -326,19 +314,25 @@ export class RewardService {
|
|
326
314
|
return RewardRepository.totalForCampaign(CampaignService.hashId({ distributionChain: query.chainId, campaignId: query.campaignId }), root.live);
|
327
315
|
}
|
328
316
|
static async breakdownForToken(query) {
|
329
|
-
|
330
|
-
|
331
|
-
|
317
|
+
return CacheService.wrap(TTLPresets.MIN_10, async (query) => {
|
318
|
+
const root = await MerklRootService.fetch(query.chainId);
|
319
|
+
const id = TokenService.hashId({ chainId: query.chainId, address: query.address });
|
320
|
+
return RewardRepository.breakdownForToken(root.live, id, query);
|
321
|
+
}, query);
|
332
322
|
}
|
333
323
|
static async countForToken(query) {
|
334
|
-
|
335
|
-
|
336
|
-
|
324
|
+
return CacheService.wrap(TTLPresets.MIN_10, async (query) => {
|
325
|
+
const root = await MerklRootService.fetch(query.chainId);
|
326
|
+
const id = TokenService.hashId({ chainId: query.chainId, address: query.address });
|
327
|
+
return RewardRepository.countForToken(id, root.live);
|
328
|
+
}, query);
|
337
329
|
}
|
338
330
|
static async totalForToken(query) {
|
339
|
-
|
340
|
-
|
341
|
-
|
331
|
+
return CacheService.wrap(TTLPresets.MIN_10, async (query) => {
|
332
|
+
const root = await MerklRootService.fetch(query.chainId);
|
333
|
+
const id = TokenService.hashId({ chainId: query.chainId, address: query.address });
|
334
|
+
return RewardRepository.totalForToken(id, root.live);
|
335
|
+
}, query);
|
342
336
|
}
|
343
337
|
static async getAmountAndClaimedForCampaigns(x) {
|
344
338
|
const currentRoot = await MerklRootService.fetch(x.chainId);
|
@@ -1364,19 +1364,21 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1364
1364
|
};
|
1365
1365
|
} & {
|
1366
1366
|
count: {
|
1367
|
-
|
1367
|
+
chain: {
|
1368
1368
|
get: {
|
1369
1369
|
body: unknown;
|
1370
1370
|
params: {};
|
1371
|
-
query:
|
1371
|
+
query: {
|
1372
|
+
chainId: number;
|
1373
|
+
};
|
1372
1374
|
headers: {
|
1373
1375
|
authorization: string;
|
1374
1376
|
};
|
1375
1377
|
response: {
|
1376
1378
|
200: {
|
1377
1379
|
[x: string]: {
|
1378
|
-
|
1379
|
-
|
1380
|
+
rewardCount: number;
|
1381
|
+
breakdownCount: number;
|
1380
1382
|
};
|
1381
1383
|
};
|
1382
1384
|
};
|
@@ -2515,9 +2517,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2515
2517
|
};
|
2516
2518
|
};
|
2517
2519
|
};
|
2518
|
-
}
|
2519
|
-
} & {
|
2520
|
-
"campaign-status": {
|
2520
|
+
} & {
|
2521
2521
|
engine: {
|
2522
2522
|
overlaps: {
|
2523
2523
|
get: {
|
@@ -2536,9 +2536,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2536
2536
|
};
|
2537
2537
|
};
|
2538
2538
|
};
|
2539
|
-
}
|
2540
|
-
} & {
|
2541
|
-
"campaign-status": {
|
2539
|
+
} & {
|
2542
2540
|
index: {
|
2543
2541
|
get: {
|
2544
2542
|
body: unknown;
|
@@ -2560,9 +2558,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2560
2558
|
};
|
2561
2559
|
};
|
2562
2560
|
};
|
2563
|
-
}
|
2564
|
-
} & {
|
2565
|
-
"campaign-status": {
|
2561
|
+
} & {
|
2566
2562
|
":campaignId": {
|
2567
2563
|
get: {
|
2568
2564
|
body: unknown;
|
@@ -2590,6 +2586,43 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2590
2586
|
};
|
2591
2587
|
};
|
2592
2588
|
};
|
2589
|
+
} & {
|
2590
|
+
delay: {
|
2591
|
+
index: {
|
2592
|
+
get: {
|
2593
|
+
body: unknown;
|
2594
|
+
params: {};
|
2595
|
+
query: {
|
2596
|
+
chainId?: number | undefined;
|
2597
|
+
endTimestampLowerBound?: number | undefined;
|
2598
|
+
delayLowerBound?: number | undefined;
|
2599
|
+
};
|
2600
|
+
headers: unknown;
|
2601
|
+
response: {
|
2602
|
+
200: {
|
2603
|
+
delay: number;
|
2604
|
+
delayFormatted: string;
|
2605
|
+
startTimestamp: bigint;
|
2606
|
+
endTimestamp: bigint;
|
2607
|
+
computeChainId: number;
|
2608
|
+
distributionChainId: number;
|
2609
|
+
campaignId: string;
|
2610
|
+
Opportunity: {
|
2611
|
+
name: string;
|
2612
|
+
};
|
2613
|
+
CampaignStatus: {
|
2614
|
+
error: string;
|
2615
|
+
details: import("database/api/.generated/runtime/library").JsonValue;
|
2616
|
+
status: import("../../../database/api/.generated").$Enums.RunStatus;
|
2617
|
+
campaignId: string;
|
2618
|
+
computedUntil: bigint;
|
2619
|
+
processingStarted: bigint;
|
2620
|
+
}[];
|
2621
|
+
}[];
|
2622
|
+
};
|
2623
|
+
};
|
2624
|
+
};
|
2625
|
+
};
|
2593
2626
|
};
|
2594
2627
|
};
|
2595
2628
|
} & {
|