@merkl/api 0.20.168 → 0.20.170

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.
@@ -350,144 +350,41 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
350
350
  };
351
351
  headers: unknown;
352
352
  response: {
353
- 200: ({
354
- protocol?: {
355
- url: string;
356
- name: string;
357
- description: string;
358
- id: string;
359
- tags: string[];
360
- icon: string;
361
- } | null | undefined;
362
- distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | undefined;
363
- depositUrl?: string | undefined;
364
- explorerAddress?: string | undefined;
365
- aprRecord?: {
366
- timestamp: string | bigint;
353
+ 200: {
354
+ apr: number;
355
+ aprRecord: {
367
356
  cumulated: number;
368
- breakdowns: {
369
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
370
- id: string;
371
- identifier: string;
357
+ timestamp: bigint;
358
+ breakdowns: ({
372
359
  value: number;
373
- aprRecordId: string;
374
- }[];
375
- } | undefined;
376
- tvlRecord?: {
377
- total: number;
378
- timestamp: string | bigint;
379
- breakdowns: {
380
- type: "TOKEN" | "PROTOCOL";
381
- id: string;
360
+ distributionType: import("@db/api").$Enums.DistributionType;
382
361
  identifier: string;
362
+ type: "CAMPAIGN";
363
+ } | {
383
364
  value: number;
384
- tvlRecordId: string;
385
- }[];
386
- } | undefined;
387
- rewardsRecord?: {
388
- total: number;
389
- id: string;
390
- timestamp: string | bigint;
391
- breakdowns: {
392
- token: {
393
- price?: number | null | undefined;
394
- symbol: string;
395
- name: string | null;
396
- id: string;
397
- icon: string;
398
- address: string;
399
- chainId: number;
400
- decimals: number;
401
- verified: boolean;
402
- isTest: boolean;
403
- isPoint: boolean;
404
- isPreTGE: boolean;
405
- };
406
- id: string;
407
- value: number;
408
- campaignId: string;
409
- amount: string | bigint;
410
- dailyRewardsRecordId: string;
411
- }[];
412
- } | undefined;
413
- status: string;
414
- type: string;
415
- name: string;
416
- tokens: {
417
- price?: number | null | undefined;
418
- symbol: string;
419
- name: string | null;
420
- id: string;
421
- icon: string;
422
- address: string;
423
- chainId: number;
424
- decimals: number;
425
- verified: boolean;
426
- isTest: boolean;
427
- isPoint: boolean;
428
- isPreTGE: boolean;
429
- }[];
430
- description: string;
431
- id: string;
432
- tags: string[];
433
- identifier: string;
434
- chain: {
435
- name: string;
436
- id: number;
437
- icon: string;
365
+ identifier: string;
366
+ type: import("@db/api").$Enums.AprType;
367
+ })[];
438
368
  };
439
- action: string;
440
- chainId: number;
441
- howToSteps: string[];
442
- tvl: number;
443
- apr: number;
444
- dailyRewards: number;
445
- lastCampaignCreatedAt: string;
446
- } | null)[];
447
- } | {
448
- 200: never;
449
- } | {
450
- 200: (Response | ({
451
- protocol?: {
452
- url: string;
453
- name: string;
454
- description: string;
369
+ tvlRecord: {
455
370
  id: string;
456
- tags: string[];
457
- icon: string;
458
- } | null | undefined;
459
- distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | undefined;
460
- depositUrl?: string | undefined;
461
- explorerAddress?: string | undefined;
462
- aprRecord?: {
463
- timestamp: string | bigint;
464
- cumulated: number;
465
- breakdowns: {
466
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
467
- id: string;
468
- identifier: string;
469
- value: number;
470
- aprRecordId: string;
471
- }[];
472
- } | undefined;
473
- tvlRecord?: {
474
371
  total: number;
475
- timestamp: string | bigint;
372
+ timestamp: bigint;
476
373
  breakdowns: {
477
- type: "TOKEN" | "PROTOCOL";
478
- id: string;
374
+ type: import("@db/api").$Enums.TvlType;
479
375
  identifier: string;
480
376
  value: number;
481
- tvlRecordId: string;
482
377
  }[];
483
- } | undefined;
484
- rewardsRecord?: {
485
- total: number;
378
+ };
379
+ rewardsRecord: {
486
380
  id: string;
487
- timestamp: string | bigint;
381
+ total: number;
382
+ timestamp: bigint;
488
383
  breakdowns: {
384
+ id: string;
385
+ campaignId: string;
386
+ dailyRewardsRecordId: string;
489
387
  token: {
490
- price?: number | null | undefined;
491
388
  symbol: string;
492
389
  name: string | null;
493
390
  id: string;
@@ -495,117 +392,29 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
495
392
  address: string;
496
393
  chainId: number;
497
394
  decimals: number;
395
+ displaySymbol: string;
498
396
  verified: boolean;
499
397
  isTest: boolean;
500
398
  isPoint: boolean;
501
399
  isPreTGE: boolean;
400
+ isNative: boolean;
401
+ price: number | null;
502
402
  };
503
- id: string;
403
+ amount: any;
504
404
  value: number;
505
- campaignId: string;
506
- amount: string | bigint;
507
- dailyRewardsRecordId: string;
405
+ distributionType: import("@db/api").$Enums.DistributionType;
508
406
  }[];
509
- } | undefined;
510
- status: string;
511
- type: string;
512
- name: string;
513
- tokens: {
514
- price?: number | null | undefined;
515
- symbol: string;
516
- name: string | null;
517
- id: string;
518
- icon: string;
519
- address: string;
520
- chainId: number;
521
- decimals: number;
522
- verified: boolean;
523
- isTest: boolean;
524
- isPoint: boolean;
525
- isPreTGE: boolean;
526
- }[];
527
- description: string;
528
- id: string;
529
- tags: string[];
530
- identifier: string;
531
- chain: {
532
- name: string;
533
- id: number;
534
- icon: string;
535
407
  };
536
- action: string;
537
- chainId: number;
538
- howToSteps: string[];
539
- tvl: number;
540
- apr: number;
541
- dailyRewards: number;
542
- lastCampaignCreatedAt: string;
543
- } | null)[] | {
544
- 200: ({
545
- protocol?: {
546
- url: string;
408
+ campaigns: {
409
+ params: any;
410
+ chain: {
547
411
  name: string;
548
- description: string;
549
- id: string;
550
- tags: string[];
412
+ id: number;
551
413
  icon: string;
552
- } | null | undefined;
553
- distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | undefined;
554
- depositUrl?: string | undefined;
555
- explorerAddress?: string | undefined;
556
- aprRecord?: {
557
- timestamp: string | bigint;
558
- cumulated: number;
559
- breakdowns: {
560
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
561
- id: string;
562
- identifier: string;
563
- value: number;
564
- aprRecordId: string;
565
- }[];
566
- } | undefined;
567
- tvlRecord?: {
568
- total: number;
569
- timestamp: string | bigint;
570
- breakdowns: {
571
- type: "TOKEN" | "PROTOCOL";
572
- id: string;
573
- identifier: string;
574
- value: number;
575
- tvlRecordId: string;
576
- }[];
577
- } | undefined;
578
- rewardsRecord?: {
579
- total: number;
580
- id: string;
581
- timestamp: string | bigint;
582
- breakdowns: {
583
- token: {
584
- price?: number | null | undefined;
585
- symbol: string;
586
- name: string | null;
587
- id: string;
588
- icon: string;
589
- address: string;
590
- chainId: number;
591
- decimals: number;
592
- verified: boolean;
593
- isTest: boolean;
594
- isPoint: boolean;
595
- isPreTGE: boolean;
596
- };
597
- id: string;
598
- value: number;
599
- campaignId: string;
600
- amount: string | bigint;
601
- dailyRewardsRecordId: string;
602
- }[];
603
- } | undefined;
604
- status: string;
605
- type: string;
606
- name: string;
607
- tokens: {
608
- price?: number | null | undefined;
414
+ };
415
+ endTimestamp: number;
416
+ startTimestamp: number;
417
+ rewardToken: {
609
418
  symbol: string;
610
419
  name: string | null;
611
420
  id: string;
@@ -617,89 +426,67 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
617
426
  isTest: boolean;
618
427
  isPoint: boolean;
619
428
  isPreTGE: boolean;
620
- }[];
621
- description: string;
622
- id: string;
623
- tags: string[];
624
- identifier: string;
625
- chain: {
429
+ isNative: boolean;
430
+ } & {
431
+ price?: number | null | undefined;
432
+ };
433
+ distributionChain: {
626
434
  name: string;
627
435
  id: number;
628
436
  icon: string;
437
+ } | undefined;
438
+ campaignStatus: {
439
+ computedUntil: number;
440
+ processingStarted: number;
441
+ status: import("@db/api").$Enums.RunStatus;
442
+ error: string;
443
+ details: import("database/api/.generated/runtime/library").JsonValue;
444
+ campaignId: string;
445
+ } | undefined;
446
+ creatorAddress: string;
447
+ creator: {
448
+ tags: string[];
449
+ address: string;
450
+ creatorId: string | null;
629
451
  };
630
- action: string;
631
- chainId: number;
632
- howToSteps: string[];
633
- tvl: number;
634
- apr: number;
635
- dailyRewards: number;
636
- lastCampaignCreatedAt: string;
637
- } | null)[];
638
- }) & ({
639
- protocol?: {
640
- url: string;
641
- name: string;
642
- description: string;
643
- id: string;
644
- tags: string[];
645
- icon: string;
646
- } | null | undefined;
647
- distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | undefined;
648
- depositUrl?: string | undefined;
649
- explorerAddress?: string | undefined;
650
- aprRecord?: {
651
- timestamp: string | bigint;
652
- cumulated: number;
653
- breakdowns: {
654
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
655
- id: string;
656
- identifier: string;
657
- value: number;
658
- aprRecordId: string;
659
- }[];
660
- } | undefined;
661
- tvlRecord?: {
662
- total: number;
663
- timestamp: string | bigint;
664
- breakdowns: {
665
- type: "TOKEN" | "PROTOCOL";
452
+ createdAt: string;
453
+ description: string | undefined;
454
+ Opportunity: {
455
+ status: import("@db/api").$Enums.Status;
456
+ type: string;
457
+ name: string;
458
+ description: string;
666
459
  id: string;
460
+ tags: string[];
667
461
  identifier: string;
668
- value: number;
669
- tvlRecordId: string;
670
- }[];
671
- } | undefined;
672
- rewardsRecord?: {
673
- total: number;
462
+ action: import("@db/api").$Enums.OpportunityAction;
463
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
464
+ chainId: number;
465
+ howToSteps: string[];
466
+ depositUrl: string | null;
467
+ explorerAddress: string | null;
468
+ mainProtocolId: string | null;
469
+ tvl: number;
470
+ apr: number;
471
+ dailyRewards: number;
472
+ lastCampaignCreatedAt: Date;
473
+ };
474
+ type: string;
674
475
  id: string;
675
- timestamp: string | bigint;
676
- breakdowns: {
677
- token: {
678
- price?: number | null | undefined;
679
- symbol: string;
680
- name: string | null;
681
- id: string;
682
- icon: string;
683
- address: string;
684
- chainId: number;
685
- decimals: number;
686
- verified: boolean;
687
- isTest: boolean;
688
- isPoint: boolean;
689
- isPreTGE: boolean;
690
- };
691
- id: string;
692
- value: number;
693
- campaignId: string;
694
- amount: string | bigint;
695
- dailyRewardsRecordId: string;
696
- }[];
697
- } | undefined;
698
- status: string;
699
- type: string;
700
- name: string;
701
- tokens: {
702
- price?: number | null | undefined;
476
+ subType: number | null;
477
+ computeChainId: number;
478
+ distributionChainId: number;
479
+ campaignId: string;
480
+ distributionType: import("@db/api").$Enums.DistributionType;
481
+ rewardTokenId: string;
482
+ amount: string;
483
+ opportunityId: string;
484
+ }[] | undefined;
485
+ id: string;
486
+ depositUrl: string | undefined;
487
+ explorerAddress: string | undefined;
488
+ lastCampaignCreatedAt: string;
489
+ tokens: ({
703
490
  symbol: string;
704
491
  name: string | null;
705
492
  id: string;
@@ -711,121 +498,35 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
711
498
  isTest: boolean;
712
499
  isPoint: boolean;
713
500
  isPreTGE: boolean;
714
- }[];
715
- description: string;
716
- id: string;
717
- tags: string[];
718
- identifier: string;
501
+ isNative: boolean;
502
+ } & {
503
+ price?: number | null | undefined;
504
+ })[];
719
505
  chain: {
720
506
  name: string;
721
507
  id: number;
722
508
  icon: string;
723
509
  };
724
- action: string;
725
- chainId: number;
726
- howToSteps: string[];
727
- tvl: number;
728
- apr: number;
729
- dailyRewards: number;
730
- lastCampaignCreatedAt: string;
731
- } | null)[];
732
- } | {
733
- 200: {
734
- 200: ({
735
- protocol?: {
736
- url: string;
737
- name: string;
738
- description: string;
739
- id: string;
740
- tags: string[];
741
- icon: string;
742
- } | null | undefined;
743
- distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | undefined;
744
- depositUrl?: string | undefined;
745
- explorerAddress?: string | undefined;
746
- aprRecord?: {
747
- timestamp: string | bigint;
748
- cumulated: number;
749
- breakdowns: {
750
- type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
751
- id: string;
752
- identifier: string;
753
- value: number;
754
- aprRecordId: string;
755
- }[];
756
- } | undefined;
757
- tvlRecord?: {
758
- total: number;
759
- timestamp: string | bigint;
760
- breakdowns: {
761
- type: "TOKEN" | "PROTOCOL";
762
- id: string;
763
- identifier: string;
764
- value: number;
765
- tvlRecordId: string;
766
- }[];
767
- } | undefined;
768
- rewardsRecord?: {
769
- total: number;
770
- id: string;
771
- timestamp: string | bigint;
772
- breakdowns: {
773
- token: {
774
- price?: number | null | undefined;
775
- symbol: string;
776
- name: string | null;
777
- id: string;
778
- icon: string;
779
- address: string;
780
- chainId: number;
781
- decimals: number;
782
- verified: boolean;
783
- isTest: boolean;
784
- isPoint: boolean;
785
- isPreTGE: boolean;
786
- };
787
- id: string;
788
- value: number;
789
- campaignId: string;
790
- amount: string | bigint;
791
- dailyRewardsRecordId: string;
792
- }[];
793
- } | undefined;
794
- status: string;
795
- type: string;
510
+ protocol: {
511
+ url: string;
796
512
  name: string;
797
- tokens: {
798
- price?: number | null | undefined;
799
- symbol: string;
800
- name: string | null;
801
- id: string;
802
- icon: string;
803
- address: string;
804
- chainId: number;
805
- decimals: number;
806
- verified: boolean;
807
- isTest: boolean;
808
- isPoint: boolean;
809
- isPreTGE: boolean;
810
- }[];
811
513
  description: string;
812
514
  id: string;
813
515
  tags: string[];
814
- identifier: string;
815
- chain: {
816
- name: string;
817
- id: number;
818
- icon: string;
819
- };
820
- action: string;
821
- chainId: number;
822
- howToSteps: string[];
823
- tvl: number;
824
- apr: number;
825
- dailyRewards: number;
826
- lastCampaignCreatedAt: string;
827
- } | null)[];
828
- };
516
+ icon: string;
517
+ } | undefined;
518
+ status: import("@db/api").$Enums.Status;
519
+ type: string;
520
+ name: string;
521
+ description: string;
522
+ tags: string[];
523
+ identifier: string;
524
+ action: import("@db/api").$Enums.OpportunityAction;
525
+ chainId: number;
526
+ howToSteps: string[];
527
+ tvl: number;
528
+ dailyRewards: number;
529
+ }[];
829
530
  };
830
531
  };
831
532
  };
@@ -984,10 +685,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
984
685
  cumulated: number;
985
686
  breakdowns: {
986
687
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
987
- id: string;
988
688
  identifier: string;
989
689
  value: number;
990
- aprRecordId: string;
991
690
  }[];
992
691
  } | undefined;
993
692
  tvlRecord?: {
@@ -995,10 +694,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
995
694
  timestamp: string | bigint;
996
695
  breakdowns: {
997
696
  type: "TOKEN" | "PROTOCOL";
998
- id: string;
999
697
  identifier: string;
1000
698
  value: number;
1001
- tvlRecordId: string;
1002
699
  }[];
1003
700
  } | undefined;
1004
701
  rewardsRecord?: {
@@ -1123,10 +820,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1123
820
  cumulated: number;
1124
821
  breakdowns: {
1125
822
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
1126
- id: string;
1127
823
  identifier: string;
1128
824
  value: number;
1129
- aprRecordId: string;
1130
825
  }[];
1131
826
  } | undefined;
1132
827
  tvlRecord?: {
@@ -1134,10 +829,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1134
829
  timestamp: string | bigint;
1135
830
  breakdowns: {
1136
831
  type: "TOKEN" | "PROTOCOL";
1137
- id: string;
1138
832
  identifier: string;
1139
833
  value: number;
1140
- tvlRecordId: string;
1141
834
  }[];
1142
835
  } | undefined;
1143
836
  rewardsRecord?: {
@@ -1299,10 +992,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1299
992
  cumulated: number;
1300
993
  breakdowns: {
1301
994
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
1302
- id: string;
1303
995
  identifier: string;
1304
996
  value: number;
1305
- aprRecordId: string;
1306
997
  }[];
1307
998
  } | undefined;
1308
999
  tvlRecord?: {
@@ -1310,10 +1001,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1310
1001
  timestamp: string | bigint;
1311
1002
  breakdowns: {
1312
1003
  type: "TOKEN" | "PROTOCOL";
1313
- id: string;
1314
1004
  identifier: string;
1315
1005
  value: number;
1316
- tvlRecordId: string;
1317
1006
  }[];
1318
1007
  } | undefined;
1319
1008
  rewardsRecord?: {
@@ -95,9 +95,9 @@ export const OpportunityController = new Elysia({
95
95
  .get("/:id", async ({ params, query }) => {
96
96
  try {
97
97
  if (!params.id.includes("-"))
98
- return await OpportunityService.getUniqueOrThrow(params.id, query.test ?? false);
98
+ return await OpportunityService.findUniqueOrThrow(params.id, query.test ?? false);
99
99
  const [chainId, type, identifier] = params.id.split("-");
100
- return await OpportunityService.getUniqueOrThrow({
100
+ return await OpportunityService.findUniqueOrThrow({
101
101
  chainId: +chainId,
102
102
  type: type,
103
103
  identifier,