@merkl/api 0.10.361 → 0.10.362
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 +232 -0
- package/dist/src/index.d.ts +96 -0
- package/dist/src/jobs/etl/pendings.js +2 -1
- package/dist/src/jobs/etl/reward-breakdowns.js +2 -1
- package/dist/src/jobs/etl/rewards.js +2 -1
- package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +1 -1
- package/dist/src/modules/v4/computedValue/computedValue.controller.js +1 -1
- package/dist/src/modules/v4/router.d.ts +96 -0
- package/dist/src/modules/v4/router.js +3 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/jobs/breakdowns.d.ts +0 -1
- package/dist/src/jobs/breakdowns.js +0 -55
- package/dist/src/jobs/rewards.d.ts +0 -1
- package/dist/src/jobs/rewards.js +0 -74
package/dist/src/eden/index.d.ts
CHANGED
@@ -2684,6 +2684,74 @@ declare const eden: {
|
|
2684
2684
|
}>>;
|
2685
2685
|
};
|
2686
2686
|
};
|
2687
|
+
value: {
|
2688
|
+
campaign: ((params: {
|
2689
|
+
campaignId: string | number;
|
2690
|
+
}) => {} & ((params: {
|
2691
|
+
field: string | number;
|
2692
|
+
}) => {
|
2693
|
+
get: (options?: {
|
2694
|
+
headers?: Record<string, unknown> | undefined;
|
2695
|
+
query?: Record<string, unknown> | undefined;
|
2696
|
+
fetch?: RequestInit | undefined;
|
2697
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2698
|
+
200: {
|
2699
|
+
[x: string]: File;
|
2700
|
+
[x: number]: File;
|
2701
|
+
} | null;
|
2702
|
+
}>>;
|
2703
|
+
})) & {};
|
2704
|
+
user: ((params: {
|
2705
|
+
address: string | number;
|
2706
|
+
}) => {} & ((params: {
|
2707
|
+
field: string | number;
|
2708
|
+
}) => {
|
2709
|
+
get: (options?: {
|
2710
|
+
headers?: Record<string, unknown> | undefined;
|
2711
|
+
query?: Record<string, unknown> | undefined;
|
2712
|
+
fetch?: RequestInit | undefined;
|
2713
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2714
|
+
200: {
|
2715
|
+
[x: string]: never;
|
2716
|
+
[x: number]: never;
|
2717
|
+
}[];
|
2718
|
+
}>>;
|
2719
|
+
})) & {};
|
2720
|
+
engine: {
|
2721
|
+
campaign: {
|
2722
|
+
post: (body: {
|
2723
|
+
value: number;
|
2724
|
+
campaignId: string;
|
2725
|
+
field: string;
|
2726
|
+
}, options: {
|
2727
|
+
headers: {
|
2728
|
+
authorization: string;
|
2729
|
+
};
|
2730
|
+
query?: Record<string, unknown> | undefined;
|
2731
|
+
fetch?: RequestInit | undefined;
|
2732
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2733
|
+
200: void;
|
2734
|
+
}>>;
|
2735
|
+
};
|
2736
|
+
user: {
|
2737
|
+
post: (body: {
|
2738
|
+
reason: string;
|
2739
|
+
value: number;
|
2740
|
+
address: string;
|
2741
|
+
campaignId: string;
|
2742
|
+
field: string;
|
2743
|
+
}[], options: {
|
2744
|
+
headers: {
|
2745
|
+
authorization: string;
|
2746
|
+
};
|
2747
|
+
query?: Record<string, unknown> | undefined;
|
2748
|
+
fetch?: RequestInit | undefined;
|
2749
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2750
|
+
200: void;
|
2751
|
+
}>>;
|
2752
|
+
};
|
2753
|
+
};
|
2754
|
+
};
|
2687
2755
|
};
|
2688
2756
|
v3: {
|
2689
2757
|
app: {
|
@@ -6609,6 +6677,102 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6609
6677
|
};
|
6610
6678
|
};
|
6611
6679
|
};
|
6680
|
+
} & {
|
6681
|
+
v4: {
|
6682
|
+
value: {
|
6683
|
+
campaign: {
|
6684
|
+
":campaignId": {
|
6685
|
+
":field": {
|
6686
|
+
get: {
|
6687
|
+
body: unknown;
|
6688
|
+
params: {
|
6689
|
+
campaignId: string;
|
6690
|
+
field: string;
|
6691
|
+
};
|
6692
|
+
query: unknown;
|
6693
|
+
headers: unknown;
|
6694
|
+
response: {
|
6695
|
+
200: {
|
6696
|
+
[x: string]: File;
|
6697
|
+
[x: number]: File;
|
6698
|
+
} | null;
|
6699
|
+
};
|
6700
|
+
};
|
6701
|
+
};
|
6702
|
+
};
|
6703
|
+
};
|
6704
|
+
};
|
6705
|
+
} & {
|
6706
|
+
value: {
|
6707
|
+
user: {
|
6708
|
+
":address": {
|
6709
|
+
":field": {
|
6710
|
+
get: {
|
6711
|
+
body: unknown;
|
6712
|
+
params: {
|
6713
|
+
address: string;
|
6714
|
+
field: string;
|
6715
|
+
};
|
6716
|
+
query: unknown;
|
6717
|
+
headers: unknown;
|
6718
|
+
response: {
|
6719
|
+
200: {
|
6720
|
+
[x: string]: never;
|
6721
|
+
[x: number]: never;
|
6722
|
+
}[];
|
6723
|
+
};
|
6724
|
+
};
|
6725
|
+
};
|
6726
|
+
};
|
6727
|
+
};
|
6728
|
+
};
|
6729
|
+
} & {
|
6730
|
+
value: {
|
6731
|
+
engine: {
|
6732
|
+
campaign: {
|
6733
|
+
post: {
|
6734
|
+
body: {
|
6735
|
+
value: number;
|
6736
|
+
campaignId: string;
|
6737
|
+
field: string;
|
6738
|
+
};
|
6739
|
+
params: {};
|
6740
|
+
query: unknown;
|
6741
|
+
headers: {
|
6742
|
+
authorization: string;
|
6743
|
+
};
|
6744
|
+
response: {
|
6745
|
+
200: void;
|
6746
|
+
};
|
6747
|
+
};
|
6748
|
+
};
|
6749
|
+
};
|
6750
|
+
};
|
6751
|
+
} & {
|
6752
|
+
value: {
|
6753
|
+
engine: {
|
6754
|
+
user: {
|
6755
|
+
post: {
|
6756
|
+
body: {
|
6757
|
+
reason: string;
|
6758
|
+
value: number;
|
6759
|
+
address: string;
|
6760
|
+
campaignId: string;
|
6761
|
+
field: string;
|
6762
|
+
}[];
|
6763
|
+
params: {};
|
6764
|
+
query: unknown;
|
6765
|
+
headers: {
|
6766
|
+
authorization: string;
|
6767
|
+
};
|
6768
|
+
response: {
|
6769
|
+
200: void;
|
6770
|
+
};
|
6771
|
+
};
|
6772
|
+
};
|
6773
|
+
};
|
6774
|
+
};
|
6775
|
+
};
|
6612
6776
|
} & {
|
6613
6777
|
v3: {
|
6614
6778
|
app: {
|
@@ -10071,6 +10235,74 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
10071
10235
|
}>>;
|
10072
10236
|
};
|
10073
10237
|
};
|
10238
|
+
value: {
|
10239
|
+
campaign: ((params: {
|
10240
|
+
campaignId: string | number;
|
10241
|
+
}) => {} & ((params: {
|
10242
|
+
field: string | number;
|
10243
|
+
}) => {
|
10244
|
+
get: (options?: {
|
10245
|
+
headers?: Record<string, unknown> | undefined;
|
10246
|
+
query?: Record<string, unknown> | undefined;
|
10247
|
+
fetch?: RequestInit | undefined;
|
10248
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
10249
|
+
200: {
|
10250
|
+
[x: string]: File;
|
10251
|
+
[x: number]: File;
|
10252
|
+
} | null;
|
10253
|
+
}>>;
|
10254
|
+
})) & {};
|
10255
|
+
user: ((params: {
|
10256
|
+
address: string | number;
|
10257
|
+
}) => {} & ((params: {
|
10258
|
+
field: string | number;
|
10259
|
+
}) => {
|
10260
|
+
get: (options?: {
|
10261
|
+
headers?: Record<string, unknown> | undefined;
|
10262
|
+
query?: Record<string, unknown> | undefined;
|
10263
|
+
fetch?: RequestInit | undefined;
|
10264
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
10265
|
+
200: {
|
10266
|
+
[x: string]: never;
|
10267
|
+
[x: number]: never;
|
10268
|
+
}[];
|
10269
|
+
}>>;
|
10270
|
+
})) & {};
|
10271
|
+
engine: {
|
10272
|
+
campaign: {
|
10273
|
+
post: (body: {
|
10274
|
+
value: number;
|
10275
|
+
campaignId: string;
|
10276
|
+
field: string;
|
10277
|
+
}, options: {
|
10278
|
+
headers: {
|
10279
|
+
authorization: string;
|
10280
|
+
};
|
10281
|
+
query?: Record<string, unknown> | undefined;
|
10282
|
+
fetch?: RequestInit | undefined;
|
10283
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
10284
|
+
200: void;
|
10285
|
+
}>>;
|
10286
|
+
};
|
10287
|
+
user: {
|
10288
|
+
post: (body: {
|
10289
|
+
reason: string;
|
10290
|
+
value: number;
|
10291
|
+
address: string;
|
10292
|
+
campaignId: string;
|
10293
|
+
field: string;
|
10294
|
+
}[], options: {
|
10295
|
+
headers: {
|
10296
|
+
authorization: string;
|
10297
|
+
};
|
10298
|
+
query?: Record<string, unknown> | undefined;
|
10299
|
+
fetch?: RequestInit | undefined;
|
10300
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
10301
|
+
200: void;
|
10302
|
+
}>>;
|
10303
|
+
};
|
10304
|
+
};
|
10305
|
+
};
|
10074
10306
|
};
|
10075
10307
|
v3: {
|
10076
10308
|
app: {
|
package/dist/src/index.d.ts
CHANGED
@@ -3327,6 +3327,102 @@ declare const app: Elysia<"", false, {
|
|
3327
3327
|
};
|
3328
3328
|
};
|
3329
3329
|
};
|
3330
|
+
} & {
|
3331
|
+
v4: {
|
3332
|
+
value: {
|
3333
|
+
campaign: {
|
3334
|
+
":campaignId": {
|
3335
|
+
":field": {
|
3336
|
+
get: {
|
3337
|
+
body: unknown;
|
3338
|
+
params: {
|
3339
|
+
campaignId: string;
|
3340
|
+
field: string;
|
3341
|
+
};
|
3342
|
+
query: unknown;
|
3343
|
+
headers: unknown;
|
3344
|
+
response: {
|
3345
|
+
200: {
|
3346
|
+
[x: string]: File;
|
3347
|
+
[x: number]: File;
|
3348
|
+
} | null;
|
3349
|
+
};
|
3350
|
+
};
|
3351
|
+
};
|
3352
|
+
};
|
3353
|
+
};
|
3354
|
+
};
|
3355
|
+
} & {
|
3356
|
+
value: {
|
3357
|
+
user: {
|
3358
|
+
":address": {
|
3359
|
+
":field": {
|
3360
|
+
get: {
|
3361
|
+
body: unknown;
|
3362
|
+
params: {
|
3363
|
+
address: string;
|
3364
|
+
field: string;
|
3365
|
+
};
|
3366
|
+
query: unknown;
|
3367
|
+
headers: unknown;
|
3368
|
+
response: {
|
3369
|
+
200: {
|
3370
|
+
[x: string]: never;
|
3371
|
+
[x: number]: never;
|
3372
|
+
}[];
|
3373
|
+
};
|
3374
|
+
};
|
3375
|
+
};
|
3376
|
+
};
|
3377
|
+
};
|
3378
|
+
};
|
3379
|
+
} & {
|
3380
|
+
value: {
|
3381
|
+
engine: {
|
3382
|
+
campaign: {
|
3383
|
+
post: {
|
3384
|
+
body: {
|
3385
|
+
value: number;
|
3386
|
+
campaignId: string;
|
3387
|
+
field: string;
|
3388
|
+
};
|
3389
|
+
params: {};
|
3390
|
+
query: unknown;
|
3391
|
+
headers: {
|
3392
|
+
authorization: string;
|
3393
|
+
};
|
3394
|
+
response: {
|
3395
|
+
200: void;
|
3396
|
+
};
|
3397
|
+
};
|
3398
|
+
};
|
3399
|
+
};
|
3400
|
+
};
|
3401
|
+
} & {
|
3402
|
+
value: {
|
3403
|
+
engine: {
|
3404
|
+
user: {
|
3405
|
+
post: {
|
3406
|
+
body: {
|
3407
|
+
reason: string;
|
3408
|
+
value: number;
|
3409
|
+
address: string;
|
3410
|
+
campaignId: string;
|
3411
|
+
field: string;
|
3412
|
+
}[];
|
3413
|
+
params: {};
|
3414
|
+
query: unknown;
|
3415
|
+
headers: {
|
3416
|
+
authorization: string;
|
3417
|
+
};
|
3418
|
+
response: {
|
3419
|
+
200: void;
|
3420
|
+
};
|
3421
|
+
};
|
3422
|
+
};
|
3423
|
+
};
|
3424
|
+
};
|
3425
|
+
};
|
3330
3426
|
} & {
|
3331
3427
|
v3: {
|
3332
3428
|
app: {
|
@@ -3,6 +3,7 @@ if (!process.env.ENV || !process.env.FILENAME)
|
|
3
3
|
throw new Error("[ENV]: missing variable");
|
4
4
|
import { BucketService } from "../../modules/v4/bucket/bucket.service";
|
5
5
|
import { RewardService } from "../../modules/v4/reward";
|
6
|
+
import { withRetry } from "@sdk";
|
6
7
|
import moment from "moment";
|
7
8
|
import { log } from "../../utils/logger";
|
8
9
|
// ─── Constants ───────────────────────────────────────────────
|
@@ -20,7 +21,7 @@ const extract = async () => {
|
|
20
21
|
pendingsToCreate[currentBatchIndex].push(transform(JSON.parse(x)));
|
21
22
|
if (pendingsToCreate[currentBatchIndex].length >= BATCH_SIZE) {
|
22
23
|
try {
|
23
|
-
count += await load
|
24
|
+
count += await withRetry(load, [pendingsToCreate[currentBatchIndex]], 5, 10_000);
|
24
25
|
log.info(`Successfully inserted a batch of ${count} rewards`);
|
25
26
|
}
|
26
27
|
catch (err) {
|
@@ -4,6 +4,7 @@ if (!process.env.ENV || !process.env.CHAIN_ID || !process.env.ROOT)
|
|
4
4
|
import { BucketService } from "../../modules/v4/bucket/bucket.service";
|
5
5
|
import { log } from "../../utils/logger";
|
6
6
|
import { apiDbClient } from "../../utils/prisma";
|
7
|
+
import { withRetry } from "@sdk";
|
7
8
|
import moment from "moment";
|
8
9
|
// ─── Constants ───────────────────────────────────────────────
|
9
10
|
const BATCH_SIZE = 30_000;
|
@@ -20,7 +21,7 @@ const extract = async () => {
|
|
20
21
|
rewardBreakdownsToCreate[currentBatchIndex].push(transform(breakdown));
|
21
22
|
if (rewardBreakdownsToCreate[currentBatchIndex].length >= BATCH_SIZE) {
|
22
23
|
try {
|
23
|
-
count += await load
|
24
|
+
count += await withRetry(load, [rewardBreakdownsToCreate[currentBatchIndex]], 5, 10_000);
|
24
25
|
}
|
25
26
|
catch (err) {
|
26
27
|
console.error(`Failed to insert a batch, adding it to the fail queue.\n${err}`);
|
@@ -4,6 +4,7 @@ if (!process.env.ENV || !process.env.CHAIN_ID || !process.env.ROOT)
|
|
4
4
|
import { BucketService } from "../../modules/v4/bucket/bucket.service";
|
5
5
|
import { log } from "../../utils/logger";
|
6
6
|
import { apiDbClient } from "../../utils/prisma";
|
7
|
+
import { withRetry } from "@sdk";
|
7
8
|
import moment from "moment";
|
8
9
|
// ─── Constants ───────────────────────────────────────────────
|
9
10
|
const BATCH_SIZE = 20_000;
|
@@ -18,7 +19,7 @@ const extract = async () => {
|
|
18
19
|
rewardsToCreate[currentBatchIndex].push(transform(JSON.parse(x)));
|
19
20
|
if (rewardsToCreate[currentBatchIndex].length >= BATCH_SIZE) {
|
20
21
|
try {
|
21
|
-
count += await load
|
22
|
+
count += await withRetry(load, [rewardsToCreate[currentBatchIndex]], 5, 10_000);
|
22
23
|
log.info(`Successfully inserted a batch of ${count} rewards`);
|
23
24
|
}
|
24
25
|
catch (err) {
|
@@ -3,7 +3,7 @@ import { throwOnInvalidRequiredAddress } from "../../../utils/throw";
|
|
3
3
|
import Elysia from "elysia";
|
4
4
|
import { GetCampaignComputedValue, GetUserComputedValues, UpsertCampaignComputedValue, UpsertUserComputedValues, } from "./computedValue.model";
|
5
5
|
import { ComputedValueService } from "./computedValue.service";
|
6
|
-
export const
|
6
|
+
export const ComputedValueController = new Elysia({
|
7
7
|
prefix: "/value",
|
8
8
|
detail: { tags: ["Engine"], hide: true },
|
9
9
|
})
|
@@ -3205,6 +3205,102 @@ export declare const v4: Elysia<"/v4", false, {
|
|
3205
3205
|
};
|
3206
3206
|
};
|
3207
3207
|
};
|
3208
|
+
} & {
|
3209
|
+
v4: {
|
3210
|
+
value: {
|
3211
|
+
campaign: {
|
3212
|
+
":campaignId": {
|
3213
|
+
":field": {
|
3214
|
+
get: {
|
3215
|
+
body: unknown;
|
3216
|
+
params: {
|
3217
|
+
campaignId: string;
|
3218
|
+
field: string;
|
3219
|
+
};
|
3220
|
+
query: unknown;
|
3221
|
+
headers: unknown;
|
3222
|
+
response: {
|
3223
|
+
200: {
|
3224
|
+
[x: string]: File;
|
3225
|
+
[x: number]: File;
|
3226
|
+
} | null;
|
3227
|
+
};
|
3228
|
+
};
|
3229
|
+
};
|
3230
|
+
};
|
3231
|
+
};
|
3232
|
+
};
|
3233
|
+
} & {
|
3234
|
+
value: {
|
3235
|
+
user: {
|
3236
|
+
":address": {
|
3237
|
+
":field": {
|
3238
|
+
get: {
|
3239
|
+
body: unknown;
|
3240
|
+
params: {
|
3241
|
+
address: string;
|
3242
|
+
field: string;
|
3243
|
+
};
|
3244
|
+
query: unknown;
|
3245
|
+
headers: unknown;
|
3246
|
+
response: {
|
3247
|
+
200: {
|
3248
|
+
[x: string]: never;
|
3249
|
+
[x: number]: never;
|
3250
|
+
}[];
|
3251
|
+
};
|
3252
|
+
};
|
3253
|
+
};
|
3254
|
+
};
|
3255
|
+
};
|
3256
|
+
};
|
3257
|
+
} & {
|
3258
|
+
value: {
|
3259
|
+
engine: {
|
3260
|
+
campaign: {
|
3261
|
+
post: {
|
3262
|
+
body: {
|
3263
|
+
value: number;
|
3264
|
+
campaignId: string;
|
3265
|
+
field: string;
|
3266
|
+
};
|
3267
|
+
params: {};
|
3268
|
+
query: unknown;
|
3269
|
+
headers: {
|
3270
|
+
authorization: string;
|
3271
|
+
};
|
3272
|
+
response: {
|
3273
|
+
200: void;
|
3274
|
+
};
|
3275
|
+
};
|
3276
|
+
};
|
3277
|
+
};
|
3278
|
+
};
|
3279
|
+
} & {
|
3280
|
+
value: {
|
3281
|
+
engine: {
|
3282
|
+
user: {
|
3283
|
+
post: {
|
3284
|
+
body: {
|
3285
|
+
reason: string;
|
3286
|
+
value: number;
|
3287
|
+
address: string;
|
3288
|
+
campaignId: string;
|
3289
|
+
field: string;
|
3290
|
+
}[];
|
3291
|
+
params: {};
|
3292
|
+
query: unknown;
|
3293
|
+
headers: {
|
3294
|
+
authorization: string;
|
3295
|
+
};
|
3296
|
+
response: {
|
3297
|
+
200: void;
|
3298
|
+
};
|
3299
|
+
};
|
3300
|
+
};
|
3301
|
+
};
|
3302
|
+
};
|
3303
|
+
};
|
3208
3304
|
}, {
|
3209
3305
|
derive: {};
|
3210
3306
|
resolve: {};
|
@@ -17,6 +17,7 @@ import { PrismaInstrumentation } from "@prisma/instrumentation";
|
|
17
17
|
import Elysia from "elysia";
|
18
18
|
import { BoostController } from "./boost";
|
19
19
|
import { ClaimController } from "./claims";
|
20
|
+
import { ComputedValueController } from "./computedValue";
|
20
21
|
import { DynamicDataController } from "./dynamicData";
|
21
22
|
import { ExplorerController } from "./explorer/explorer.controller";
|
22
23
|
import { InteractionController } from "./interaction/interaction.controller";
|
@@ -67,4 +68,5 @@ export const v4 = new Elysia({ tags: ["v4"], prefix: "/v4" })
|
|
67
68
|
.use(LiquidityController)
|
68
69
|
.use(ClaimController)
|
69
70
|
.use(ProgramPayloadController)
|
70
|
-
.use(BoostController)
|
71
|
+
.use(BoostController)
|
72
|
+
.use(ComputedValueController);
|