@merkl/api 0.10.91 → 0.10.93

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.
@@ -685,18 +685,17 @@ declare const eden: {
685
685
  query?: Record<string, unknown> | undefined;
686
686
  fetch?: RequestInit | undefined;
687
687
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
688
- 200: ({
689
- Explorer: {
688
+ 200: {
689
+ id: number;
690
+ name: string;
691
+ icon: string;
692
+ explorers: {
690
693
  id: string;
691
694
  type: import("../../database/api/.generated").$Enums.ExplorerType;
692
695
  url: string;
693
696
  chainId: number;
694
697
  }[];
695
- } & {
696
- id: number;
697
- name: string;
698
- icon: string;
699
- }) | null;
698
+ } | null;
700
699
  }>>;
701
700
  }) & {
702
701
  index: {
@@ -707,18 +706,17 @@ declare const eden: {
707
706
  };
708
707
  fetch?: RequestInit | undefined;
709
708
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
710
- 200: ({
711
- Explorer: {
709
+ 200: {
710
+ id: number;
711
+ name: string;
712
+ icon: string;
713
+ explorers: {
712
714
  id: string;
713
715
  type: import("../../database/api/.generated").$Enums.ExplorerType;
714
716
  url: string;
715
717
  chainId: number;
716
718
  }[];
717
- } & {
718
- id: number;
719
- name: string;
720
- icon: string;
721
- })[];
719
+ }[];
722
720
  }>>;
723
721
  };
724
722
  count: {
@@ -732,6 +730,26 @@ declare const eden: {
732
730
  200: number;
733
731
  }>>;
734
732
  };
733
+ explorers: {
734
+ post: (body: {
735
+ type: "ETHERSCAN" | "BLOCKSCOUT";
736
+ url: string;
737
+ chainId: number;
738
+ }, options: {
739
+ headers: {
740
+ authorization: string;
741
+ };
742
+ query?: Record<string, unknown> | undefined;
743
+ fetch?: RequestInit | undefined;
744
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
745
+ 200: {
746
+ id: string;
747
+ type: import("../../database/api/.generated").$Enums.ExplorerType;
748
+ url: string;
749
+ chainId: number;
750
+ };
751
+ }>>;
752
+ };
735
753
  };
736
754
  prices: {
737
755
  index: {
@@ -1466,6 +1484,40 @@ declare const eden: {
1466
1484
  }[];
1467
1485
  }>>;
1468
1486
  };
1487
+ status: {
1488
+ get: (options: {
1489
+ headers?: Record<string, unknown> | undefined;
1490
+ query: {
1491
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
1492
+ };
1493
+ fetch?: RequestInit | undefined;
1494
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1495
+ 200: ({
1496
+ Campaign: {
1497
+ id: string;
1498
+ computeChainId: number;
1499
+ distributionChainId: number;
1500
+ campaignId: string;
1501
+ type: import("../../database/api/.generated").$Enums.CampaignType;
1502
+ subType: number | null;
1503
+ rewardTokenId: string;
1504
+ amount: string;
1505
+ opportunityId: string;
1506
+ startTimestamp: bigint;
1507
+ endTimestamp: bigint;
1508
+ params: import("../../database/api/.generated").Prisma.JsonValue;
1509
+ creatorAddress: string;
1510
+ };
1511
+ } & {
1512
+ campaignId: string;
1513
+ computedUntil: bigint;
1514
+ processingStarted: bigint;
1515
+ status: import("../../database/api/.generated").$Enums.RunStatus;
1516
+ error: string;
1517
+ details: import("../../database/api/.generated").Prisma.JsonValue;
1518
+ })[];
1519
+ }>>;
1520
+ };
1469
1521
  unique: {
1470
1522
  get: (options: {
1471
1523
  headers?: Record<string, unknown> | undefined;
@@ -2353,24 +2405,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2353
2405
  query: unknown;
2354
2406
  headers: unknown;
2355
2407
  response: {
2356
- 200: ({
2357
- Explorer: {
2408
+ 200: {
2409
+ id: number;
2410
+ name: string;
2411
+ icon: string;
2412
+ explorers: {
2358
2413
  id: string;
2359
2414
  type: import("../../database/api/.generated").$Enums.ExplorerType;
2360
2415
  url: string;
2361
2416
  chainId: number;
2362
2417
  }[];
2363
- } & {
2364
- id: number;
2365
- name: string;
2366
- icon: string;
2367
- }) | null;
2418
+ } | null;
2368
2419
  };
2369
2420
  };
2370
2421
  };
2371
- };
2372
- } & {
2373
- chains: {
2422
+ } & {
2374
2423
  index: {
2375
2424
  get: {
2376
2425
  body: unknown;
@@ -2380,24 +2429,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2380
2429
  };
2381
2430
  headers: unknown;
2382
2431
  response: {
2383
- 200: ({
2384
- Explorer: {
2432
+ 200: {
2433
+ id: number;
2434
+ name: string;
2435
+ icon: string;
2436
+ explorers: {
2385
2437
  id: string;
2386
2438
  type: import("../../database/api/.generated").$Enums.ExplorerType;
2387
2439
  url: string;
2388
2440
  chainId: number;
2389
2441
  }[];
2390
- } & {
2391
- id: number;
2392
- name: string;
2393
- icon: string;
2394
- })[];
2442
+ }[];
2395
2443
  };
2396
2444
  };
2397
2445
  };
2398
- };
2399
- } & {
2400
- chains: {
2446
+ } & {
2401
2447
  count: {
2402
2448
  get: {
2403
2449
  body: unknown;
@@ -2411,6 +2457,29 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2411
2457
  };
2412
2458
  };
2413
2459
  };
2460
+ } & {
2461
+ explorers: {
2462
+ post: {
2463
+ body: {
2464
+ type: "ETHERSCAN" | "BLOCKSCOUT";
2465
+ url: string;
2466
+ chainId: number;
2467
+ };
2468
+ params: Record<never, string>;
2469
+ query: unknown;
2470
+ headers: {
2471
+ authorization: string;
2472
+ };
2473
+ response: {
2474
+ 200: {
2475
+ id: string;
2476
+ type: import("../../database/api/.generated").$Enums.ExplorerType;
2477
+ url: string;
2478
+ chainId: number;
2479
+ };
2480
+ };
2481
+ };
2482
+ };
2414
2483
  };
2415
2484
  };
2416
2485
  } & {
@@ -3370,6 +3439,45 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3370
3439
  };
3371
3440
  };
3372
3441
  };
3442
+ } & {
3443
+ campaignStatus: {
3444
+ status: {
3445
+ get: {
3446
+ body: unknown;
3447
+ params: Record<never, string>;
3448
+ query: {
3449
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
3450
+ };
3451
+ headers: unknown;
3452
+ response: {
3453
+ 200: ({
3454
+ Campaign: {
3455
+ id: string;
3456
+ computeChainId: number;
3457
+ distributionChainId: number;
3458
+ campaignId: string;
3459
+ type: import("../../database/api/.generated").$Enums.CampaignType;
3460
+ subType: number | null;
3461
+ rewardTokenId: string;
3462
+ amount: string;
3463
+ opportunityId: string;
3464
+ startTimestamp: bigint;
3465
+ endTimestamp: bigint;
3466
+ params: import("../../database/api/.generated").Prisma.JsonValue;
3467
+ creatorAddress: string;
3468
+ };
3469
+ } & {
3470
+ campaignId: string;
3471
+ computedUntil: bigint;
3472
+ processingStarted: bigint;
3473
+ status: import("../../database/api/.generated").$Enums.RunStatus;
3474
+ error: string;
3475
+ details: import("../../database/api/.generated").Prisma.JsonValue;
3476
+ })[];
3477
+ };
3478
+ };
3479
+ };
3480
+ };
3373
3481
  } & {
3374
3482
  campaignStatus: {
3375
3483
  unique: {
@@ -4136,18 +4244,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4136
4244
  query?: Record<string, unknown> | undefined;
4137
4245
  fetch?: RequestInit | undefined;
4138
4246
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4139
- 200: ({
4140
- Explorer: {
4247
+ 200: {
4248
+ id: number;
4249
+ name: string;
4250
+ icon: string;
4251
+ explorers: {
4141
4252
  id: string;
4142
4253
  type: import("../../database/api/.generated").$Enums.ExplorerType;
4143
4254
  url: string;
4144
4255
  chainId: number;
4145
4256
  }[];
4146
- } & {
4147
- id: number;
4148
- name: string;
4149
- icon: string;
4150
- }) | null;
4257
+ } | null;
4151
4258
  }>>;
4152
4259
  }) & {
4153
4260
  index: {
@@ -4158,18 +4265,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4158
4265
  };
4159
4266
  fetch?: RequestInit | undefined;
4160
4267
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4161
- 200: ({
4162
- Explorer: {
4268
+ 200: {
4269
+ id: number;
4270
+ name: string;
4271
+ icon: string;
4272
+ explorers: {
4163
4273
  id: string;
4164
4274
  type: import("../../database/api/.generated").$Enums.ExplorerType;
4165
4275
  url: string;
4166
4276
  chainId: number;
4167
4277
  }[];
4168
- } & {
4169
- id: number;
4170
- name: string;
4171
- icon: string;
4172
- })[];
4278
+ }[];
4173
4279
  }>>;
4174
4280
  };
4175
4281
  count: {
@@ -4183,6 +4289,26 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4183
4289
  200: number;
4184
4290
  }>>;
4185
4291
  };
4292
+ explorers: {
4293
+ post: (body: {
4294
+ type: "ETHERSCAN" | "BLOCKSCOUT";
4295
+ url: string;
4296
+ chainId: number;
4297
+ }, options: {
4298
+ headers: {
4299
+ authorization: string;
4300
+ };
4301
+ query?: Record<string, unknown> | undefined;
4302
+ fetch?: RequestInit | undefined;
4303
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4304
+ 200: {
4305
+ id: string;
4306
+ type: import("../../database/api/.generated").$Enums.ExplorerType;
4307
+ url: string;
4308
+ chainId: number;
4309
+ };
4310
+ }>>;
4311
+ };
4186
4312
  };
4187
4313
  prices: {
4188
4314
  index: {
@@ -4917,6 +5043,40 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4917
5043
  }[];
4918
5044
  }>>;
4919
5045
  };
5046
+ status: {
5047
+ get: (options: {
5048
+ headers?: Record<string, unknown> | undefined;
5049
+ query: {
5050
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
5051
+ };
5052
+ fetch?: RequestInit | undefined;
5053
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
5054
+ 200: ({
5055
+ Campaign: {
5056
+ id: string;
5057
+ computeChainId: number;
5058
+ distributionChainId: number;
5059
+ campaignId: string;
5060
+ type: import("../../database/api/.generated").$Enums.CampaignType;
5061
+ subType: number | null;
5062
+ rewardTokenId: string;
5063
+ amount: string;
5064
+ opportunityId: string;
5065
+ startTimestamp: bigint;
5066
+ endTimestamp: bigint;
5067
+ params: import("../../database/api/.generated").Prisma.JsonValue;
5068
+ creatorAddress: string;
5069
+ };
5070
+ } & {
5071
+ campaignId: string;
5072
+ computedUntil: bigint;
5073
+ processingStarted: bigint;
5074
+ status: import("../../database/api/.generated").$Enums.RunStatus;
5075
+ error: string;
5076
+ details: import("../../database/api/.generated").Prisma.JsonValue;
5077
+ })[];
5078
+ }>>;
5079
+ };
4920
5080
  unique: {
4921
5081
  get: (options: {
4922
5082
  headers?: Record<string, unknown> | undefined;
@@ -4975,6 +5135,7 @@ export type Opportunity = FromPromise<Api["v4"]["opportunities"]["index"]["get"]
4975
5135
  export type Protocol = FromPromise<Api["v4"]["protocols"]["index"]["get"]>;
4976
5136
  export type Campaign<C extends CampaignType = CampaignType> = CampaignResource<C>["model"];
4977
5137
  export type Chain = FromPromise<Api["v4"]["chains"]["index"]["get"]>;
5138
+ export type Explorer = FromPromise<Api["v4"]["chains"]["index"]["get"]>["explorers"][number];
4978
5139
  export type Token = FromPromise<Api["v4"]["tokens"]["index"]["get"]>;
4979
5140
  export type Reward = NonNullable<Awaited<ReturnType<ReturnType<Api["v4"]["users"]>["rewards"]["full"]["get"]>>["data"]>[number];
4980
5141
  export {};
@@ -824,24 +824,21 @@ declare const app: Elysia<"", false, {
824
824
  query: unknown;
825
825
  headers: unknown;
826
826
  response: {
827
- 200: ({
828
- Explorer: {
827
+ 200: {
828
+ id: number;
829
+ name: string;
830
+ icon: string;
831
+ explorers: {
829
832
  id: string;
830
833
  type: import("../database/api/.generated").$Enums.ExplorerType;
831
834
  url: string;
832
835
  chainId: number;
833
836
  }[];
834
- } & {
835
- id: number;
836
- name: string;
837
- icon: string;
838
- }) | null;
837
+ } | null;
839
838
  };
840
839
  };
841
840
  };
842
- };
843
- } & {
844
- chains: {
841
+ } & {
845
842
  index: {
846
843
  get: {
847
844
  body: unknown;
@@ -851,24 +848,21 @@ declare const app: Elysia<"", false, {
851
848
  };
852
849
  headers: unknown;
853
850
  response: {
854
- 200: ({
855
- Explorer: {
851
+ 200: {
852
+ id: number;
853
+ name: string;
854
+ icon: string;
855
+ explorers: {
856
856
  id: string;
857
857
  type: import("../database/api/.generated").$Enums.ExplorerType;
858
858
  url: string;
859
859
  chainId: number;
860
860
  }[];
861
- } & {
862
- id: number;
863
- name: string;
864
- icon: string;
865
- })[];
861
+ }[];
866
862
  };
867
863
  };
868
864
  };
869
- };
870
- } & {
871
- chains: {
865
+ } & {
872
866
  count: {
873
867
  get: {
874
868
  body: unknown;
@@ -882,6 +876,29 @@ declare const app: Elysia<"", false, {
882
876
  };
883
877
  };
884
878
  };
879
+ } & {
880
+ explorers: {
881
+ post: {
882
+ body: {
883
+ type: "ETHERSCAN" | "BLOCKSCOUT";
884
+ url: string;
885
+ chainId: number;
886
+ };
887
+ params: Record<never, string>;
888
+ query: unknown;
889
+ headers: {
890
+ authorization: string;
891
+ };
892
+ response: {
893
+ 200: {
894
+ id: string;
895
+ type: import("../database/api/.generated").$Enums.ExplorerType;
896
+ url: string;
897
+ chainId: number;
898
+ };
899
+ };
900
+ };
901
+ };
885
902
  };
886
903
  };
887
904
  } & {
@@ -1841,6 +1858,45 @@ declare const app: Elysia<"", false, {
1841
1858
  };
1842
1859
  };
1843
1860
  };
1861
+ } & {
1862
+ campaignStatus: {
1863
+ status: {
1864
+ get: {
1865
+ body: unknown;
1866
+ params: Record<never, string>;
1867
+ query: {
1868
+ status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
1869
+ };
1870
+ headers: unknown;
1871
+ response: {
1872
+ 200: ({
1873
+ Campaign: {
1874
+ id: string;
1875
+ computeChainId: number;
1876
+ distributionChainId: number;
1877
+ campaignId: string;
1878
+ type: import("../database/api/.generated").$Enums.CampaignType;
1879
+ subType: number | null;
1880
+ rewardTokenId: string;
1881
+ amount: string;
1882
+ opportunityId: string;
1883
+ startTimestamp: bigint;
1884
+ endTimestamp: bigint;
1885
+ params: import("../database/api/.generated").Prisma.JsonValue;
1886
+ creatorAddress: string;
1887
+ };
1888
+ } & {
1889
+ campaignId: string;
1890
+ computedUntil: bigint;
1891
+ processingStarted: bigint;
1892
+ status: import("../database/api/.generated").$Enums.RunStatus;
1893
+ error: string;
1894
+ details: import("../database/api/.generated").Prisma.JsonValue;
1895
+ })[];
1896
+ };
1897
+ };
1898
+ };
1899
+ };
1844
1900
  } & {
1845
1901
  campaignStatus: {
1846
1902
  unique: {
@@ -21,24 +21,21 @@ export declare const ChainController: Elysia<"/chains", false, {
21
21
  query: unknown;
22
22
  headers: unknown;
23
23
  response: {
24
- 200: ({
25
- Explorer: {
24
+ 200: {
25
+ id: number;
26
+ name: string;
27
+ icon: string;
28
+ explorers: {
26
29
  id: string;
27
30
  type: import("../../../../database/api/.generated").$Enums.ExplorerType;
28
31
  url: string;
29
32
  chainId: number;
30
33
  }[];
31
- } & {
32
- id: number;
33
- name: string;
34
- icon: string;
35
- }) | null;
34
+ } | null;
36
35
  };
37
36
  };
38
37
  };
39
- };
40
- } & {
41
- chains: {
38
+ } & {
42
39
  index: {
43
40
  get: {
44
41
  body: unknown;
@@ -48,24 +45,21 @@ export declare const ChainController: Elysia<"/chains", false, {
48
45
  };
49
46
  headers: unknown;
50
47
  response: {
51
- 200: ({
52
- Explorer: {
48
+ 200: {
49
+ id: number;
50
+ name: string;
51
+ icon: string;
52
+ explorers: {
53
53
  id: string;
54
54
  type: import("../../../../database/api/.generated").$Enums.ExplorerType;
55
55
  url: string;
56
56
  chainId: number;
57
57
  }[];
58
- } & {
59
- id: number;
60
- name: string;
61
- icon: string;
62
- })[];
58
+ }[];
63
59
  };
64
60
  };
65
61
  };
66
- };
67
- } & {
68
- chains: {
62
+ } & {
69
63
  count: {
70
64
  get: {
71
65
  body: unknown;
@@ -79,6 +73,29 @@ export declare const ChainController: Elysia<"/chains", false, {
79
73
  };
80
74
  };
81
75
  };
76
+ } & {
77
+ explorers: {
78
+ post: {
79
+ body: {
80
+ type: "ETHERSCAN" | "BLOCKSCOUT";
81
+ url: string;
82
+ chainId: number;
83
+ };
84
+ params: Record<never, string>;
85
+ query: unknown;
86
+ headers: {
87
+ authorization: string;
88
+ };
89
+ response: {
90
+ 200: {
91
+ id: string;
92
+ type: import("../../../../database/api/.generated").$Enums.ExplorerType;
93
+ url: string;
94
+ chainId: number;
95
+ };
96
+ };
97
+ };
98
+ };
82
99
  };
83
100
  }, {
84
101
  derive: {};
@@ -14,6 +14,14 @@ export declare const ChainUniqueDto: import("@sinclair/typebox").TObject<{
14
14
  export declare const ChainArrayDto: import("@sinclair/typebox").TObject<{
15
15
  chainId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>]>;
16
16
  }>;
17
+ export declare const CreateChainExplorerDto: import("@sinclair/typebox").TObject<{
18
+ type: import("@sinclair/typebox").TEnum<{
19
+ ETHERSCAN: "ETHERSCAN";
20
+ BLOCKSCOUT: "BLOCKSCOUT";
21
+ }>;
22
+ chainId: import("@sinclair/typebox").TNumber;
23
+ url: import("@sinclair/typebox").TString;
24
+ }>;
17
25
  export type ChainUniqueModel = typeof ChainUniqueDto.static;
18
26
  export type ChainSearchDto = typeof GetChainQueryDto.static;
19
27
  export type ChainsArrayModel = typeof ChainArrayDto.static;
@@ -0,0 +1,7 @@
1
+ import type { Resource } from "../prisma";
2
+ /**
3
+ * Explorer
4
+ * @description A chain explorer
5
+ * @see {@link Resource}
6
+ */
7
+ export type Explorer = Resource<"Explorer", "id">;
@@ -1,3 +1,4 @@
1
+ import type { ExplorerType } from "../../../../database/api/.generated";
1
2
  export declare abstract class ExplorerRepository {
2
3
  static getByChainId(chainId: number): Promise<{
3
4
  id: string;
@@ -5,4 +6,16 @@ export declare abstract class ExplorerRepository {
5
6
  url: string;
6
7
  chainId: number;
7
8
  }>;
9
+ /**
10
+ * Creates an explorer
11
+ * @param chainId to attach explorer to
12
+ * @param type that defines the subsequents links for transactions, addresses...
13
+ * @param url base url without / suffix
14
+ */
15
+ static create(chainId: number, type: ExplorerType, url: string): Promise<{
16
+ id: string;
17
+ type: import("../../../../database/api/.generated").$Enums.ExplorerType;
18
+ url: string;
19
+ chainId: number;
20
+ }>;
8
21
  }