@merkl/api 0.19.28 → 0.19.30
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/database/api/.generated/drizzle/schema.d.ts +5 -5
- package/dist/database/api/.generated/drizzle/schema.js +1 -1
- package/dist/database/api/.generated/drizzle/schema.ts +1 -1
- package/dist/database/api/.generated/edge.js +3 -3
- package/dist/database/api/.generated/index.d.ts +35 -26
- package/dist/database/api/.generated/index.js +3 -3
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +5 -5
- package/dist/src/modules/v4/merklRoot/merklRoot.service.d.ts +2 -8
- package/dist/src/modules/v4/merklRoot/merklRoot.service.js +13 -1
- package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -2
- package/dist/src/modules/v4/reward/reward.service.d.ts +2 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -73,7 +73,7 @@ model CampaignComputedValue {
|
|
73
73
|
}
|
74
74
|
|
75
75
|
model UserComputedValue {
|
76
|
-
id Int @id @default(autoincrement())
|
76
|
+
id Int @id @default(autoincrement()) // TODO Migrate to something smarter than Int ids
|
77
77
|
campaignId String
|
78
78
|
Campaign Campaign @relation(fields: [campaignId], references: [id])
|
79
79
|
address String @db.Char(42)
|
@@ -193,7 +193,7 @@ model AprRecord {
|
|
193
193
|
}
|
194
194
|
|
195
195
|
model AprBreakdown {
|
196
|
-
id Int @id @default(autoincrement())
|
196
|
+
id Int @id @default(autoincrement()) // TODO Migrate to something smarter than Int ids
|
197
197
|
identifier String
|
198
198
|
type AprType
|
199
199
|
value Float
|
@@ -217,7 +217,7 @@ model TVLRecord {
|
|
217
217
|
}
|
218
218
|
|
219
219
|
model TVLBreakdown {
|
220
|
-
id Int @id @default(autoincrement())
|
220
|
+
id Int @id @default(autoincrement()) // TODO Migrate to something smarter than Int ids
|
221
221
|
identifier String
|
222
222
|
type TvlType
|
223
223
|
value Float
|
@@ -242,7 +242,7 @@ model DailyRewardsRecord {
|
|
242
242
|
}
|
243
243
|
|
244
244
|
model DailyRewardsBreakdown {
|
245
|
-
id Int @id @default(autoincrement())
|
245
|
+
id Int @id @default(autoincrement()) // TODO Migrate to something smarter than Int ids
|
246
246
|
value Float
|
247
247
|
campaignId String
|
248
248
|
Campaign Campaign @relation(fields: [campaignId], references: [id])
|
@@ -292,7 +292,7 @@ model Reward {
|
|
292
292
|
}
|
293
293
|
|
294
294
|
model RewardBreakdown {
|
295
|
-
id
|
295
|
+
id BigInt @id @default(autoincrement())
|
296
296
|
Protocol Protocol? @relation(fields: [protocolId], references: [id])
|
297
297
|
protocolId String?
|
298
298
|
reason String
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type
|
1
|
+
import { type ChainId } from "@sdk";
|
2
2
|
import type { CreateRootModel, RootByTimestampModel } from "./merklRoot.model";
|
3
3
|
export declare class MerklRootService {
|
4
4
|
static firstRoot(chainId: ChainId): Promise<{
|
@@ -18,13 +18,7 @@ export declare class MerklRootService {
|
|
18
18
|
* @param chainId to fetch roots for
|
19
19
|
* @returns object with live and last tree roots
|
20
20
|
*/
|
21
|
-
static fetch(chainId: ChainId): Promise<
|
22
|
-
live: any;
|
23
|
-
tree: any;
|
24
|
-
lastTree: any;
|
25
|
-
endOfDisputePeriod: any;
|
26
|
-
disputer: any;
|
27
|
-
}>;
|
21
|
+
static fetch(chainId: ChainId): Promise<any>;
|
28
22
|
/**
|
29
23
|
* Fetch all roots for the provided chains
|
30
24
|
* @param chainIds to fetch roots for
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { log } from "@/utils/logger";
|
2
|
+
import { NETWORK_LABELS, withTimeout } from "@sdk";
|
1
3
|
import { CacheService } from "../cache";
|
2
4
|
import { TTLPresets } from "../cache/cache.model";
|
3
5
|
import { ChainService } from "../chain/chain.service";
|
@@ -15,7 +17,17 @@ export class MerklRootService {
|
|
15
17
|
* @returns object with live and last tree roots
|
16
18
|
*/
|
17
19
|
static async fetch(chainId) {
|
18
|
-
|
20
|
+
try {
|
21
|
+
return await withTimeout(CacheService.wrap(TTLPresets.MIN_1, MerklRootRepository.fetch, chainId), 5_000);
|
22
|
+
}
|
23
|
+
catch (e) {
|
24
|
+
if (e.message === "Timed out after 3000ms") {
|
25
|
+
const errorMessage = `fetching Merkle Root for chain ${NETWORK_LABELS[chainId]} timed out`;
|
26
|
+
log.warn(errorMessage);
|
27
|
+
throw new Error(errorMessage);
|
28
|
+
}
|
29
|
+
throw e;
|
30
|
+
}
|
19
31
|
}
|
20
32
|
/**
|
21
33
|
* Fetch all roots for the provided chains
|
@@ -77,7 +77,7 @@ export declare abstract class RewardRepository {
|
|
77
77
|
};
|
78
78
|
} & {
|
79
79
|
pending: string;
|
80
|
-
id:
|
80
|
+
id: bigint;
|
81
81
|
reason: string;
|
82
82
|
campaignId: string;
|
83
83
|
amount: string;
|
@@ -102,7 +102,7 @@ export declare abstract class RewardRepository {
|
|
102
102
|
};
|
103
103
|
} & {
|
104
104
|
pending: string;
|
105
|
-
id:
|
105
|
+
id: bigint;
|
106
106
|
reason: string;
|
107
107
|
campaignId: string;
|
108
108
|
amount: string;
|
@@ -234,7 +234,7 @@ export declare abstract class RewardService {
|
|
234
234
|
};
|
235
235
|
} & {
|
236
236
|
pending: string;
|
237
|
-
id:
|
237
|
+
id: bigint;
|
238
238
|
reason: string;
|
239
239
|
campaignId: string;
|
240
240
|
amount: string;
|
@@ -535,7 +535,7 @@ export declare abstract class RewardService {
|
|
535
535
|
};
|
536
536
|
} & {
|
537
537
|
pending: string;
|
538
|
-
id:
|
538
|
+
id: bigint;
|
539
539
|
reason: string;
|
540
540
|
campaignId: string;
|
541
541
|
amount: string;
|