@merkl/api 0.10.281 → 0.10.282
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 +6 -65
- package/dist/src/index.d.ts +6 -25
- package/dist/src/modules/v4/chain/chain.controller.d.ts +6 -25
- package/dist/src/modules/v4/chain/chain.controller.js +1 -12
- package/dist/src/modules/v4/chain/chain.model.d.ts +0 -8
- package/dist/src/modules/v4/chain/chain.model.js +0 -6
- package/dist/src/modules/v4/explorer/explorer.controller.d.ts +45 -0
- package/dist/src/modules/v4/explorer/explorer.controller.js +13 -0
- package/dist/src/modules/v4/explorer/explorer.model.d.ts +9 -0
- package/dist/src/modules/v4/explorer/explorer.model.js +7 -1
- package/dist/src/modules/v4/explorer/explorer.service.d.ts +2 -2
- package/dist/src/modules/v4/explorer/explorer.service.js +2 -2
- package/dist/src/modules/v4/router.d.ts +6 -25
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -1265,26 +1265,6 @@ declare const eden: {
|
|
1265
1265
|
200: number;
|
1266
1266
|
}>>;
|
1267
1267
|
};
|
1268
|
-
explorers: {
|
1269
|
-
post: (body: {
|
1270
|
-
type: "ETHERSCAN" | "BLOCKSCOUT";
|
1271
|
-
url: string;
|
1272
|
-
chainId: number;
|
1273
|
-
}, options: {
|
1274
|
-
headers: {
|
1275
|
-
authorization: string;
|
1276
|
-
};
|
1277
|
-
query?: Record<string, unknown> | undefined;
|
1278
|
-
fetch?: RequestInit | undefined;
|
1279
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1280
|
-
200: {
|
1281
|
-
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
1282
|
-
url: string;
|
1283
|
-
id: string;
|
1284
|
-
chainId: number;
|
1285
|
-
};
|
1286
|
-
}>>;
|
1287
|
-
};
|
1288
1268
|
};
|
1289
1269
|
prices: {
|
1290
1270
|
index: {
|
@@ -4271,7 +4251,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4271
4251
|
};
|
4272
4252
|
};
|
4273
4253
|
};
|
4274
|
-
}
|
4254
|
+
};
|
4255
|
+
} & {
|
4256
|
+
chains: {
|
4275
4257
|
index: {
|
4276
4258
|
get: {
|
4277
4259
|
body: unknown;
|
@@ -4295,7 +4277,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4295
4277
|
};
|
4296
4278
|
};
|
4297
4279
|
};
|
4298
|
-
}
|
4280
|
+
};
|
4281
|
+
} & {
|
4282
|
+
chains: {
|
4299
4283
|
count: {
|
4300
4284
|
get: {
|
4301
4285
|
body: unknown;
|
@@ -4309,29 +4293,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4309
4293
|
};
|
4310
4294
|
};
|
4311
4295
|
};
|
4312
|
-
} & {
|
4313
|
-
explorers: {
|
4314
|
-
post: {
|
4315
|
-
body: {
|
4316
|
-
type: "ETHERSCAN" | "BLOCKSCOUT";
|
4317
|
-
url: string;
|
4318
|
-
chainId: number;
|
4319
|
-
};
|
4320
|
-
params: {};
|
4321
|
-
query: unknown;
|
4322
|
-
headers: {
|
4323
|
-
authorization: string;
|
4324
|
-
};
|
4325
|
-
response: {
|
4326
|
-
200: {
|
4327
|
-
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
4328
|
-
url: string;
|
4329
|
-
id: string;
|
4330
|
-
chainId: number;
|
4331
|
-
};
|
4332
|
-
};
|
4333
|
-
};
|
4334
|
-
};
|
4335
4296
|
};
|
4336
4297
|
} & {
|
4337
4298
|
chains: {
|
@@ -7613,26 +7574,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7613
7574
|
200: number;
|
7614
7575
|
}>>;
|
7615
7576
|
};
|
7616
|
-
explorers: {
|
7617
|
-
post: (body: {
|
7618
|
-
type: "ETHERSCAN" | "BLOCKSCOUT";
|
7619
|
-
url: string;
|
7620
|
-
chainId: number;
|
7621
|
-
}, options: {
|
7622
|
-
headers: {
|
7623
|
-
authorization: string;
|
7624
|
-
};
|
7625
|
-
query?: Record<string, unknown> | undefined;
|
7626
|
-
fetch?: RequestInit | undefined;
|
7627
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7628
|
-
200: {
|
7629
|
-
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
7630
|
-
url: string;
|
7631
|
-
id: string;
|
7632
|
-
chainId: number;
|
7633
|
-
};
|
7634
|
-
}>>;
|
7635
|
-
};
|
7636
7577
|
};
|
7637
7578
|
prices: {
|
7638
7579
|
index: {
|
package/dist/src/index.d.ts
CHANGED
@@ -1457,7 +1457,9 @@ declare const app: Elysia<"", false, {
|
|
1457
1457
|
};
|
1458
1458
|
};
|
1459
1459
|
};
|
1460
|
-
}
|
1460
|
+
};
|
1461
|
+
} & {
|
1462
|
+
chains: {
|
1461
1463
|
index: {
|
1462
1464
|
get: {
|
1463
1465
|
body: unknown;
|
@@ -1481,7 +1483,9 @@ declare const app: Elysia<"", false, {
|
|
1481
1483
|
};
|
1482
1484
|
};
|
1483
1485
|
};
|
1484
|
-
}
|
1486
|
+
};
|
1487
|
+
} & {
|
1488
|
+
chains: {
|
1485
1489
|
count: {
|
1486
1490
|
get: {
|
1487
1491
|
body: unknown;
|
@@ -1495,29 +1499,6 @@ declare const app: Elysia<"", false, {
|
|
1495
1499
|
};
|
1496
1500
|
};
|
1497
1501
|
};
|
1498
|
-
} & {
|
1499
|
-
explorers: {
|
1500
|
-
post: {
|
1501
|
-
body: {
|
1502
|
-
type: "ETHERSCAN" | "BLOCKSCOUT";
|
1503
|
-
url: string;
|
1504
|
-
chainId: number;
|
1505
|
-
};
|
1506
|
-
params: {};
|
1507
|
-
query: unknown;
|
1508
|
-
headers: {
|
1509
|
-
authorization: string;
|
1510
|
-
};
|
1511
|
-
response: {
|
1512
|
-
200: {
|
1513
|
-
type: import("../database/api/.generated").$Enums.ExplorerType;
|
1514
|
-
url: string;
|
1515
|
-
id: string;
|
1516
|
-
chainId: number;
|
1517
|
-
};
|
1518
|
-
};
|
1519
|
-
};
|
1520
|
-
};
|
1521
1502
|
};
|
1522
1503
|
} & {
|
1523
1504
|
chains: {
|
@@ -36,7 +36,9 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
36
36
|
};
|
37
37
|
};
|
38
38
|
};
|
39
|
-
}
|
39
|
+
};
|
40
|
+
} & {
|
41
|
+
chains: {
|
40
42
|
index: {
|
41
43
|
get: {
|
42
44
|
body: unknown;
|
@@ -60,7 +62,9 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
60
62
|
};
|
61
63
|
};
|
62
64
|
};
|
63
|
-
}
|
65
|
+
};
|
66
|
+
} & {
|
67
|
+
chains: {
|
64
68
|
count: {
|
65
69
|
get: {
|
66
70
|
body: unknown;
|
@@ -74,29 +78,6 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
74
78
|
};
|
75
79
|
};
|
76
80
|
};
|
77
|
-
} & {
|
78
|
-
explorers: {
|
79
|
-
post: {
|
80
|
-
body: {
|
81
|
-
type: "ETHERSCAN" | "BLOCKSCOUT";
|
82
|
-
url: string;
|
83
|
-
chainId: number;
|
84
|
-
};
|
85
|
-
params: {};
|
86
|
-
query: unknown;
|
87
|
-
headers: {
|
88
|
-
authorization: string;
|
89
|
-
};
|
90
|
-
response: {
|
91
|
-
200: {
|
92
|
-
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
93
|
-
url: string;
|
94
|
-
id: string;
|
95
|
-
chainId: number;
|
96
|
-
};
|
97
|
-
};
|
98
|
-
};
|
99
|
-
};
|
100
81
|
};
|
101
82
|
} & {
|
102
83
|
chains: {
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
|
-
import { TokenAuthGuard } from "../../../guards/TokenAuth.guard";
|
3
2
|
import Elysia, { t } from "elysia";
|
4
|
-
import {
|
5
|
-
import { ChainResourceDto, ChainUniqueDto, CreateChainExplorerDto, GetChainQueryDto, UpdateChainDto, } from "./chain.model";
|
3
|
+
import { ChainResourceDto, ChainUniqueDto, GetChainQueryDto, UpdateChainDto } from "./chain.model";
|
6
4
|
import { ChainService } from "./chain.service";
|
7
5
|
// ─── Chains Controller ───────────────────────────────────────────────────────
|
8
6
|
export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: ["Chains"] } })
|
@@ -30,15 +28,6 @@ export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: [
|
|
30
28
|
.get("/count", async ({ query }) => await ChainService.countMany(query), {
|
31
29
|
query: GetChainQueryDto,
|
32
30
|
detail: { hide: true },
|
33
|
-
})
|
34
|
-
.group("/explorers", app => {
|
35
|
-
// ─── Create An Explorer ──────────────────────────────────────
|
36
|
-
return app.post("", async ({ body: { chainId, type, url } }) => await ExplorerService.create(chainId, type, url), {
|
37
|
-
beforeHandle: TokenAuthGuard,
|
38
|
-
headers: AuthorizationHeadersDto,
|
39
|
-
body: CreateChainExplorerDto,
|
40
|
-
detail: { hide: true },
|
41
|
-
});
|
42
31
|
})
|
43
32
|
.patch("/:chainId", async ({ params, body }) => await ChainService.update(params.chainId, body), {
|
44
33
|
params: ChainUniqueDto,
|
@@ -22,14 +22,6 @@ export declare const ChainUniqueOptionalDto: import("@sinclair/typebox").TObject
|
|
22
22
|
export declare const ChainArrayOptionalDto: import("@sinclair/typebox").TObject<{
|
23
23
|
chainIds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>]>, number[]>>;
|
24
24
|
}>;
|
25
|
-
export declare const CreateChainExplorerDto: import("@sinclair/typebox").TObject<{
|
26
|
-
type: import("@sinclair/typebox").TEnum<{
|
27
|
-
ETHERSCAN: "ETHERSCAN";
|
28
|
-
BLOCKSCOUT: "BLOCKSCOUT";
|
29
|
-
}>;
|
30
|
-
chainId: import("@sinclair/typebox").TNumber;
|
31
|
-
url: import("@sinclair/typebox").TString;
|
32
|
-
}>;
|
33
25
|
export declare const UpdateChainDto: import("@sinclair/typebox").TObject<{
|
34
26
|
icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
35
27
|
}>;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { ExplorerType } from "../../../../database/api/.generated";
|
2
1
|
import { t } from "elysia";
|
3
2
|
// ─── DTOs ────────────────────────────────────────────────────────────────────
|
4
3
|
export const ChainResourceDto = t.Object({
|
@@ -23,11 +22,6 @@ export const ChainArrayOptionalDto = t.Object({
|
|
23
22
|
}, {
|
24
23
|
description: "A required comma separated list of chain ids.<br>You can get the list of all supported chains by calling [GET /v4/chains](#tag/chains/GET/v4/chains/)",
|
25
24
|
});
|
26
|
-
export const CreateChainExplorerDto = t.Object({
|
27
|
-
type: t.Enum(ExplorerType),
|
28
|
-
chainId: t.Number(),
|
29
|
-
url: t.String(),
|
30
|
-
});
|
31
25
|
export const UpdateChainDto = t.Object({
|
32
26
|
icon: t.Optional(t.String({ format: "uri" })),
|
33
27
|
// iconFile: t.Optional(t.File()),
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import Elysia from "elysia";
|
2
|
+
export declare const ExplorerController: Elysia<"/explorers", false, {
|
3
|
+
decorator: {};
|
4
|
+
store: {};
|
5
|
+
derive: {};
|
6
|
+
resolve: {};
|
7
|
+
}, {
|
8
|
+
type: {};
|
9
|
+
error: {};
|
10
|
+
}, {
|
11
|
+
schema: {};
|
12
|
+
macro: {};
|
13
|
+
macroFn: {};
|
14
|
+
}, {
|
15
|
+
explorers: {
|
16
|
+
post: {
|
17
|
+
body: {
|
18
|
+
type: "ETHERSCAN" | "BLOCKSCOUT";
|
19
|
+
url: string;
|
20
|
+
chainId: number;
|
21
|
+
};
|
22
|
+
params: {};
|
23
|
+
query: unknown;
|
24
|
+
headers: {
|
25
|
+
authorization: string;
|
26
|
+
};
|
27
|
+
response: {
|
28
|
+
200: {
|
29
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
30
|
+
url: string;
|
31
|
+
id: string;
|
32
|
+
chainId: number;
|
33
|
+
};
|
34
|
+
};
|
35
|
+
};
|
36
|
+
};
|
37
|
+
}, {
|
38
|
+
derive: {};
|
39
|
+
resolve: {};
|
40
|
+
schema: {};
|
41
|
+
}, {
|
42
|
+
derive: {};
|
43
|
+
resolve: {};
|
44
|
+
schema: {};
|
45
|
+
}>;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
|
+
import Elysia from "elysia";
|
3
|
+
import { ExplorerService } from ".";
|
4
|
+
import { CreateExplorerDto } from "./explorer.model";
|
5
|
+
// ─── Explorer Controller ───────────────────────────────────────────────────────
|
6
|
+
export const ExplorerController = new Elysia({ prefix: "/explorers", detail: { tags: ["Explorers"] } })
|
7
|
+
// ─── Create An Explorer ──────────────────────────────────────
|
8
|
+
.post("", async ({ body }) => await ExplorerService.create(body), {
|
9
|
+
beforeHandle: BackOfficeGuard,
|
10
|
+
headers: AuthorizationHeadersDto,
|
11
|
+
body: CreateExplorerDto,
|
12
|
+
detail: { hide: true },
|
13
|
+
});
|
@@ -5,3 +5,12 @@ import type { Resource } from "../prisma";
|
|
5
5
|
* @see {@link Resource}
|
6
6
|
*/
|
7
7
|
export type Explorer = Resource<"Explorer", "id">;
|
8
|
+
export declare const CreateExplorerDto: import("@sinclair/typebox").TObject<{
|
9
|
+
chainId: import("@sinclair/typebox").TNumber;
|
10
|
+
type: import("@sinclair/typebox").TEnum<{
|
11
|
+
ETHERSCAN: "ETHERSCAN";
|
12
|
+
BLOCKSCOUT: "BLOCKSCOUT";
|
13
|
+
}>;
|
14
|
+
url: import("@sinclair/typebox").TString;
|
15
|
+
}>;
|
16
|
+
export type CreateExplorerDto = typeof CreateExplorerDto.static;
|
@@ -1,2 +1,8 @@
|
|
1
1
|
// ─── Schemas ─────────────────────────────────────────────────────────────────
|
2
|
-
|
2
|
+
import { ExplorerType } from "../../../../database/api/.generated";
|
3
|
+
import { t } from "elysia";
|
4
|
+
export const CreateExplorerDto = t.Object({
|
5
|
+
chainId: t.Numeric(),
|
6
|
+
type: t.Enum(ExplorerType),
|
7
|
+
url: t.String(),
|
8
|
+
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ExplorerType } from "../../../../database/api/.generated";
|
2
|
-
import type { Explorer } from "./explorer.model";
|
2
|
+
import type { CreateExplorerDto, Explorer } from "./explorer.model";
|
3
3
|
export declare abstract class ExplorerService {
|
4
4
|
static hashId(type: ExplorerType, chainId: number): string;
|
5
5
|
static getByChainId(chainId: number): Promise<{
|
@@ -19,7 +19,7 @@ export declare abstract class ExplorerService {
|
|
19
19
|
* @param type that defines the subsequents links for transactions, addresses...
|
20
20
|
* @param url base url without / suffix
|
21
21
|
*/
|
22
|
-
static create(
|
22
|
+
static create(data: CreateExplorerDto): Promise<{
|
23
23
|
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
24
24
|
url: string;
|
25
25
|
id: string;
|
@@ -18,7 +18,7 @@ export class ExplorerService {
|
|
18
18
|
* @param type that defines the subsequents links for transactions, addresses...
|
19
19
|
* @param url base url without / suffix
|
20
20
|
*/
|
21
|
-
static async create(
|
22
|
-
return
|
21
|
+
static async create(data) {
|
22
|
+
return ExplorerRepository.create(data.chainId, data.type, data.url);
|
23
23
|
}
|
24
24
|
}
|
@@ -1335,7 +1335,9 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1335
1335
|
};
|
1336
1336
|
};
|
1337
1337
|
};
|
1338
|
-
}
|
1338
|
+
};
|
1339
|
+
} & {
|
1340
|
+
chains: {
|
1339
1341
|
index: {
|
1340
1342
|
get: {
|
1341
1343
|
body: unknown;
|
@@ -1359,7 +1361,9 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1359
1361
|
};
|
1360
1362
|
};
|
1361
1363
|
};
|
1362
|
-
}
|
1364
|
+
};
|
1365
|
+
} & {
|
1366
|
+
chains: {
|
1363
1367
|
count: {
|
1364
1368
|
get: {
|
1365
1369
|
body: unknown;
|
@@ -1373,29 +1377,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1373
1377
|
};
|
1374
1378
|
};
|
1375
1379
|
};
|
1376
|
-
} & {
|
1377
|
-
explorers: {
|
1378
|
-
post: {
|
1379
|
-
body: {
|
1380
|
-
type: "ETHERSCAN" | "BLOCKSCOUT";
|
1381
|
-
url: string;
|
1382
|
-
chainId: number;
|
1383
|
-
};
|
1384
|
-
params: {};
|
1385
|
-
query: unknown;
|
1386
|
-
headers: {
|
1387
|
-
authorization: string;
|
1388
|
-
};
|
1389
|
-
response: {
|
1390
|
-
200: {
|
1391
|
-
type: import("../../../database/api/.generated").$Enums.ExplorerType;
|
1392
|
-
url: string;
|
1393
|
-
id: string;
|
1394
|
-
chainId: number;
|
1395
|
-
};
|
1396
|
-
};
|
1397
|
-
};
|
1398
|
-
};
|
1399
1380
|
};
|
1400
1381
|
} & {
|
1401
1382
|
chains: {
|