@merkl/api 0.20.160 → 0.20.162

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.
@@ -721,7 +721,6 @@ declare const eden: {
721
721
  timestamp: bigint;
722
722
  breakdowns: {
723
723
  id: string;
724
- value: number;
725
724
  campaignId: string;
726
725
  dailyRewardsRecordId: string;
727
726
  token: {
@@ -740,7 +739,8 @@ declare const eden: {
740
739
  isNative: boolean;
741
740
  price: number | null;
742
741
  };
743
- amount: bigint;
742
+ amount: any;
743
+ value: number;
744
744
  distributionType: import("@db/api").$Enums.DistributionType;
745
745
  }[];
746
746
  };
@@ -2665,9 +2665,7 @@ declare const eden: {
2665
2665
  }>>;
2666
2666
  distributed: {
2667
2667
  get: (options: {
2668
- headers: {
2669
- authorization: string;
2670
- };
2668
+ headers?: Record<string, unknown> | undefined;
2671
2669
  query: {
2672
2670
  since: Date;
2673
2671
  };
@@ -2677,9 +2675,7 @@ declare const eden: {
2677
2675
  }>>;
2678
2676
  "by-chains": {
2679
2677
  get: (options: {
2680
- headers: {
2681
- authorization: string;
2682
- };
2678
+ headers?: Record<string, unknown> | undefined;
2683
2679
  query: {
2684
2680
  since: Date;
2685
2681
  };
@@ -2691,9 +2687,7 @@ declare const eden: {
2691
2687
  };
2692
2688
  "by-types": {
2693
2689
  get: (options: {
2694
- headers: {
2695
- authorization: string;
2696
- };
2690
+ headers?: Record<string, unknown> | undefined;
2697
2691
  query: {
2698
2692
  since: Date;
2699
2693
  };
@@ -2705,9 +2699,7 @@ declare const eden: {
2705
2699
  };
2706
2700
  "by-protocols": {
2707
2701
  get: (options: {
2708
- headers: {
2709
- authorization: string;
2710
- };
2702
+ headers?: Record<string, unknown> | undefined;
2711
2703
  query: {
2712
2704
  since: Date;
2713
2705
  };
@@ -5821,7 +5813,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5821
5813
  timestamp: bigint;
5822
5814
  breakdowns: {
5823
5815
  id: string;
5824
- value: number;
5825
5816
  campaignId: string;
5826
5817
  dailyRewardsRecordId: string;
5827
5818
  token: {
@@ -5840,7 +5831,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5840
5831
  isNative: boolean;
5841
5832
  price: number | null;
5842
5833
  };
5843
- amount: bigint;
5834
+ amount: any;
5835
+ value: number;
5844
5836
  distributionType: import("@db/api").$Enums.DistributionType;
5845
5837
  }[];
5846
5838
  };
@@ -8702,9 +8694,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8702
8694
  query: {
8703
8695
  since: Date;
8704
8696
  };
8705
- headers: {
8706
- authorization: string;
8707
- };
8697
+ headers: unknown;
8708
8698
  response: {
8709
8699
  200: number;
8710
8700
  };
@@ -8723,9 +8713,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8723
8713
  query: {
8724
8714
  since: Date;
8725
8715
  };
8726
- headers: {
8727
- authorization: string;
8728
- };
8716
+ headers: unknown;
8729
8717
  response: {
8730
8718
  [x: string]: any;
8731
8719
  200: any;
@@ -8746,9 +8734,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8746
8734
  query: {
8747
8735
  since: Date;
8748
8736
  };
8749
- headers: {
8750
- authorization: string;
8751
- };
8737
+ headers: unknown;
8752
8738
  response: {
8753
8739
  [x: string]: any;
8754
8740
  200: any;
@@ -8769,9 +8755,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8769
8755
  query: {
8770
8756
  since: Date;
8771
8757
  };
8772
- headers: {
8773
- authorization: string;
8774
- };
8758
+ headers: unknown;
8775
8759
  response: {
8776
8760
  [x: string]: any;
8777
8761
  200: any;
@@ -12537,7 +12521,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12537
12521
  timestamp: bigint;
12538
12522
  breakdowns: {
12539
12523
  id: string;
12540
- value: number;
12541
12524
  campaignId: string;
12542
12525
  dailyRewardsRecordId: string;
12543
12526
  token: {
@@ -12556,7 +12539,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12556
12539
  isNative: boolean;
12557
12540
  price: number | null;
12558
12541
  };
12559
- amount: bigint;
12542
+ amount: any;
12543
+ value: number;
12560
12544
  distributionType: import("@db/api").$Enums.DistributionType;
12561
12545
  }[];
12562
12546
  };
@@ -14481,9 +14465,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
14481
14465
  }>>;
14482
14466
  distributed: {
14483
14467
  get: (options: {
14484
- headers: {
14485
- authorization: string;
14486
- };
14468
+ headers?: Record<string, unknown> | undefined;
14487
14469
  query: {
14488
14470
  since: Date;
14489
14471
  };
@@ -14493,9 +14475,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
14493
14475
  }>>;
14494
14476
  "by-chains": {
14495
14477
  get: (options: {
14496
- headers: {
14497
- authorization: string;
14498
- };
14478
+ headers?: Record<string, unknown> | undefined;
14499
14479
  query: {
14500
14480
  since: Date;
14501
14481
  };
@@ -14507,9 +14487,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
14507
14487
  };
14508
14488
  "by-types": {
14509
14489
  get: (options: {
14510
- headers: {
14511
- authorization: string;
14512
- };
14490
+ headers?: Record<string, unknown> | undefined;
14513
14491
  query: {
14514
14492
  since: Date;
14515
14493
  };
@@ -14521,9 +14499,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
14521
14499
  };
14522
14500
  "by-protocols": {
14523
14501
  get: (options: {
14524
- headers: {
14525
- authorization: string;
14526
- };
14502
+ headers?: Record<string, unknown> | undefined;
14527
14503
  query: {
14528
14504
  since: Date;
14529
14505
  };
@@ -533,7 +533,6 @@ declare const app: Elysia<"", false, {
533
533
  timestamp: bigint;
534
534
  breakdowns: {
535
535
  id: string;
536
- value: number;
537
536
  campaignId: string;
538
537
  dailyRewardsRecordId: string;
539
538
  token: {
@@ -552,7 +551,8 @@ declare const app: Elysia<"", false, {
552
551
  isNative: boolean;
553
552
  price: number | null;
554
553
  };
555
- amount: bigint;
554
+ amount: any;
555
+ value: number;
556
556
  distributionType: import("@db/api").$Enums.DistributionType;
557
557
  }[];
558
558
  };
@@ -3414,9 +3414,7 @@ declare const app: Elysia<"", false, {
3414
3414
  query: {
3415
3415
  since: Date;
3416
3416
  };
3417
- headers: {
3418
- authorization: string;
3419
- };
3417
+ headers: unknown;
3420
3418
  response: {
3421
3419
  200: number;
3422
3420
  };
@@ -3435,9 +3433,7 @@ declare const app: Elysia<"", false, {
3435
3433
  query: {
3436
3434
  since: Date;
3437
3435
  };
3438
- headers: {
3439
- authorization: string;
3440
- };
3436
+ headers: unknown;
3441
3437
  response: {
3442
3438
  [x: string]: any;
3443
3439
  200: any;
@@ -3458,9 +3454,7 @@ declare const app: Elysia<"", false, {
3458
3454
  query: {
3459
3455
  since: Date;
3460
3456
  };
3461
- headers: {
3462
- authorization: string;
3463
- };
3457
+ headers: unknown;
3464
3458
  response: {
3465
3459
  [x: string]: any;
3466
3460
  200: any;
@@ -3481,9 +3475,7 @@ declare const app: Elysia<"", false, {
3481
3475
  query: {
3482
3476
  since: Date;
3483
3477
  };
3484
- headers: {
3485
- authorization: string;
3486
- };
3478
+ headers: unknown;
3487
3479
  response: {
3488
3480
  [x: string]: any;
3489
3481
  200: any;
@@ -388,7 +388,6 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
388
388
  timestamp: bigint;
389
389
  breakdowns: {
390
390
  id: string;
391
- value: number;
392
391
  campaignId: string;
393
392
  dailyRewardsRecordId: string;
394
393
  token: {
@@ -407,7 +406,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
407
406
  isNative: boolean;
408
407
  price: number | null;
409
408
  };
410
- amount: bigint;
409
+ amount: any;
410
+ value: number;
411
411
  distributionType: import("@db/api").$Enums.DistributionType;
412
412
  }[];
413
413
  };
@@ -3,7 +3,7 @@ import type { Campaign } from "@/modules/v4/campaign/campaign.model";
3
3
  import type { DailyRewardsRecord } from "@/modules/v4/reward/reward.model";
4
4
  import type { TvlRecord } from "@/modules/v4/tvl/tvl.model";
5
5
  import { type Prisma, Status } from "@db/api";
6
- import type { MerklChainId } from "@sdk";
6
+ import { type MerklChainId } from "@sdk";
7
7
  import type { CreateOpportunityModel, GetOpportunitiesQueryModel, Opportunity } from "./opportunity.model";
8
8
  export declare abstract class OpportunityRepository {
9
9
  #private;
@@ -5,6 +5,7 @@ import { TvlService } from "@/modules/v4/tvl/tvl.service";
5
5
  import { log } from "@/utils/logger";
6
6
  import { apiDbClient } from "@db";
7
7
  import { Status } from "@db/api";
8
+ import { bigIntToNumber } from "@sdk";
8
9
  import moment from "moment";
9
10
  export class OpportunityRepository {
10
11
  // ─── Utils ───────────────────────────────────────────────────────────
@@ -428,7 +429,7 @@ export class OpportunityRepository {
428
429
  createMany: {
429
430
  data: dailyRewards.breakdowns.map(breakdown => ({
430
431
  campaignId: breakdown.campaignId,
431
- value: breakdown.value,
432
+ value: bigIntToNumber(breakdown.amount, breakdown.token.decimals),
432
433
  })),
433
434
  },
434
435
  },
@@ -657,7 +657,6 @@ export declare abstract class OpportunityService {
657
657
  timestamp: bigint;
658
658
  breakdowns: {
659
659
  id: string;
660
- value: number;
661
660
  campaignId: string;
662
661
  dailyRewardsRecordId: string;
663
662
  token: {
@@ -676,7 +675,8 @@ export declare abstract class OpportunityService {
676
675
  isNative: boolean;
677
676
  price: number | null;
678
677
  };
679
- amount: bigint;
678
+ amount: any;
679
+ value: number;
680
680
  distributionType: import("@db/api").$Enums.DistributionType;
681
681
  }[];
682
682
  };
@@ -847,7 +847,6 @@ export declare abstract class OpportunityService {
847
847
  timestamp: bigint;
848
848
  breakdowns: {
849
849
  id: string;
850
- value: number;
851
850
  campaignId: string;
852
851
  dailyRewardsRecordId: string;
853
852
  token: {
@@ -866,7 +865,8 @@ export declare abstract class OpportunityService {
866
865
  isNative: boolean;
867
866
  price: number | null;
868
867
  };
869
- amount: bigint;
868
+ amount: any;
869
+ value: number;
870
870
  distributionType: import("@db/api").$Enums.DistributionType;
871
871
  }[];
872
872
  };
@@ -1030,7 +1030,6 @@ export declare abstract class OpportunityService {
1030
1030
  timestamp: bigint;
1031
1031
  breakdowns: {
1032
1032
  id: string;
1033
- value: number;
1034
1033
  campaignId: string;
1035
1034
  dailyRewardsRecordId: string;
1036
1035
  token: {
@@ -1049,7 +1048,8 @@ export declare abstract class OpportunityService {
1049
1048
  isNative: boolean;
1050
1049
  price: number | null;
1051
1050
  };
1052
- amount: bigint;
1051
+ amount: any;
1052
+ value: number;
1053
1053
  distributionType: import("@db/api").$Enums.DistributionType;
1054
1054
  }[];
1055
1055
  };
@@ -7,7 +7,7 @@ import { TokenService } from "@/modules/v4/token/token.service";
7
7
  import { UserService } from "@/modules/v4/user/user.service";
8
8
  import { log } from "@/utils/logger";
9
9
  import { AprType, Status } from "@db/api";
10
- import { Campaign as CampaignType } from "@sdk";
10
+ import { Campaign as CampaignType, numberToBigInt } from "@sdk";
11
11
  import moment from "moment";
12
12
  import { metadataBuilderFactory } from "../../../engine/metadata/factory";
13
13
  import { ChainService } from "../chain/chain.service";
@@ -179,10 +179,11 @@ export class OpportunityService {
179
179
  id,
180
180
  total,
181
181
  timestamp,
182
- breakdowns: breakdowns.map(({ Campaign, ...breakdown }) => {
182
+ breakdowns: breakdowns.map(({ Campaign, value, ...breakdown }) => {
183
183
  return {
184
184
  token: Campaign.RewardToken,
185
- amount: CampaignService.getDailyAmount(Campaign.startTimestamp, Campaign.endTimestamp, BigInt(Campaign.amount)),
185
+ amount: numberToBigInt(value, Campaign.RewardToken.decimals),
186
+ value: (Campaign.RewardToken.price ?? 1) * value,
186
187
  distributionType: Campaign.distributionType,
187
188
  ...breakdown,
188
189
  };
@@ -532,9 +532,9 @@ const RoninInterfaceCampaigns = {
532
532
  url: "https://app.roninchain.com/liquidity/v3/0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
533
533
  forwarders: [],
534
534
  isOutOfRangeIncentivized: false,
535
- weightFees: 1500,
536
- weightToken0: 5500,
537
- weightToken1: 3000,
535
+ weightFees: 3000,
536
+ weightToken0: 4500,
537
+ weightToken1: 2500,
538
538
  },
539
539
  [roninCampaigns.Katana_AXS_RON_Ronin]: {
540
540
  campaignType: Campaign.CLAMM,
@@ -546,9 +546,9 @@ const RoninInterfaceCampaigns = {
546
546
  url: "https://app.roninchain.com/liquidity/v3/0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
547
547
  forwarders: [],
548
548
  isOutOfRangeIncentivized: false,
549
- weightFees: 2000,
550
- weightToken0: 500,
551
- weightToken1: 7500,
549
+ weightFees: 3000,
550
+ weightToken0: 2500,
551
+ weightToken1: 4500,
552
552
  },
553
553
  [roninCampaigns.Katana_USDC_RON_Ronin]: {
554
554
  campaignType: Campaign.CLAMM,
@@ -574,9 +574,9 @@ const RoninInterfaceCampaigns = {
574
574
  url: "https://app.roninchain.com/liquidity/v3/0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8",
575
575
  forwarders: [],
576
576
  isOutOfRangeIncentivized: false,
577
- weightFees: 1000,
578
- weightToken0: 6500,
579
- weightToken1: 2500,
577
+ weightFees: 8500,
578
+ weightToken0: 500,
579
+ weightToken1: 1000,
580
580
  },
581
581
  [roninCampaigns.Supply_WETH_Compound_Ronin]: {
582
582
  campaignType: Campaign.COMPOUND_V3,
@@ -337,9 +337,7 @@ export declare const RewardController: Elysia<"/rewards", false, {
337
337
  query: {
338
338
  since: Date;
339
339
  };
340
- headers: {
341
- authorization: string;
342
- };
340
+ headers: unknown;
343
341
  response: {
344
342
  200: number;
345
343
  };
@@ -358,9 +356,7 @@ export declare const RewardController: Elysia<"/rewards", false, {
358
356
  query: {
359
357
  since: Date;
360
358
  };
361
- headers: {
362
- authorization: string;
363
- };
359
+ headers: unknown;
364
360
  response: {
365
361
  [x: string]: any;
366
362
  200: any;
@@ -381,9 +377,7 @@ export declare const RewardController: Elysia<"/rewards", false, {
381
377
  query: {
382
378
  since: Date;
383
379
  };
384
- headers: {
385
- authorization: string;
386
- };
380
+ headers: unknown;
387
381
  response: {
388
382
  [x: string]: any;
389
383
  200: any;
@@ -404,9 +398,7 @@ export declare const RewardController: Elysia<"/rewards", false, {
404
398
  query: {
405
399
  since: Date;
406
400
  };
407
- headers: {
408
- authorization: string;
409
- };
401
+ headers: unknown;
410
402
  response: {
411
403
  [x: string]: any;
412
404
  200: any;
@@ -425,9 +417,7 @@ export declare const RewardController: Elysia<"/rewards", false, {
425
417
  resolve: {};
426
418
  schema: {
427
419
  body: unknown;
428
- headers: {
429
- authorization: string;
430
- };
420
+ headers: unknown;
431
421
  query: {
432
422
  since: Date;
433
423
  };
@@ -126,7 +126,6 @@ export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags:
126
126
  })
127
127
  .guard({
128
128
  query: t.Object({ since: t.Date() }),
129
- headers: AuthorizationHeadersDto,
130
129
  detail: { hide: true },
131
130
  })
132
131
  .get("/total/distributed", async ({ query }) => await RewardService.getTotalDistributed(query.since.getTime() / 1000))
@@ -46,7 +46,6 @@ export declare abstract class RewardService {
46
46
  timestamp: bigint;
47
47
  breakdowns: {
48
48
  id: string;
49
- value: number;
50
49
  campaignId: string;
51
50
  dailyRewardsRecordId: string;
52
51
  token: {
@@ -65,7 +64,8 @@ export declare abstract class RewardService {
65
64
  isNative: boolean;
66
65
  price: number | null;
67
66
  };
68
- amount: bigint;
67
+ amount: any;
68
+ value: number;
69
69
  distributionType: import("@db/api").$Enums.DistributionType;
70
70
  }[];
71
71
  };
@@ -403,7 +403,6 @@ export declare const v4: Elysia<"/v4", false, {
403
403
  timestamp: bigint;
404
404
  breakdowns: {
405
405
  id: string;
406
- value: number;
407
406
  campaignId: string;
408
407
  dailyRewardsRecordId: string;
409
408
  token: {
@@ -422,7 +421,8 @@ export declare const v4: Elysia<"/v4", false, {
422
421
  isNative: boolean;
423
422
  price: number | null;
424
423
  };
425
- amount: bigint;
424
+ amount: any;
425
+ value: number;
426
426
  distributionType: import("@db/api").$Enums.DistributionType;
427
427
  }[];
428
428
  };
@@ -3284,9 +3284,7 @@ export declare const v4: Elysia<"/v4", false, {
3284
3284
  query: {
3285
3285
  since: Date;
3286
3286
  };
3287
- headers: {
3288
- authorization: string;
3289
- };
3287
+ headers: unknown;
3290
3288
  response: {
3291
3289
  200: number;
3292
3290
  };
@@ -3305,9 +3303,7 @@ export declare const v4: Elysia<"/v4", false, {
3305
3303
  query: {
3306
3304
  since: Date;
3307
3305
  };
3308
- headers: {
3309
- authorization: string;
3310
- };
3306
+ headers: unknown;
3311
3307
  response: {
3312
3308
  [x: string]: any;
3313
3309
  200: any;
@@ -3328,9 +3324,7 @@ export declare const v4: Elysia<"/v4", false, {
3328
3324
  query: {
3329
3325
  since: Date;
3330
3326
  };
3331
- headers: {
3332
- authorization: string;
3333
- };
3327
+ headers: unknown;
3334
3328
  response: {
3335
3329
  [x: string]: any;
3336
3330
  200: any;
@@ -3351,9 +3345,7 @@ export declare const v4: Elysia<"/v4", false, {
3351
3345
  query: {
3352
3346
  since: Date;
3353
3347
  };
3354
- headers: {
3355
- authorization: string;
3356
- };
3348
+ headers: unknown;
3357
3349
  response: {
3358
3350
  [x: string]: any;
3359
3351
  200: any;