@alephium/powfi-backend 0.0.1-rc.2
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/README.md +22 -0
- package/dist/types/api/index.d.ts +14 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/api/schemas.d.ts +8 -0
- package/dist/types/api/schemas.d.ts.map +1 -0
- package/dist/types/api/serializers.d.ts +7 -0
- package/dist/types/api/serializers.d.ts.map +1 -0
- package/dist/types/api/types.d.ts +91 -0
- package/dist/types/api/types.d.ts.map +1 -0
- package/dist/types/api/utils.d.ts +7 -0
- package/dist/types/api/utils.d.ts.map +1 -0
- package/dist/types/app.d.ts +1350 -0
- package/dist/types/app.d.ts.map +1 -0
- package/dist/types/common/types.d.ts +12 -0
- package/dist/types/common/types.d.ts.map +1 -0
- package/dist/types/config/database.d.ts +17 -0
- package/dist/types/config/database.d.ts.map +1 -0
- package/dist/types/config/env.d.ts +20 -0
- package/dist/types/config/env.d.ts.map +1 -0
- package/dist/types/cron.d.ts +54 -0
- package/dist/types/cron.d.ts.map +1 -0
- package/dist/types/database/addressUtils.d.ts +4 -0
- package/dist/types/database/addressUtils.d.ts.map +1 -0
- package/dist/types/database/aggregates.d.ts +14 -0
- package/dist/types/database/aggregates.d.ts.map +1 -0
- package/dist/types/database/clmmPositions.d.ts +28 -0
- package/dist/types/database/clmmPositions.d.ts.map +1 -0
- package/dist/types/database/clmmTicks.d.ts +9 -0
- package/dist/types/database/clmmTicks.d.ts.map +1 -0
- package/dist/types/database/cpmmPositions.d.ts +16 -0
- package/dist/types/database/cpmmPositions.d.ts.map +1 -0
- package/dist/types/database/liquidityTicks.d.ts +7 -0
- package/dist/types/database/liquidityTicks.d.ts.map +1 -0
- package/dist/types/database/mints.d.ts +18 -0
- package/dist/types/database/mints.d.ts.map +1 -0
- package/dist/types/database/poolEvents.d.ts +38 -0
- package/dist/types/database/poolEvents.d.ts.map +1 -0
- package/dist/types/database/pools.d.ts +47 -0
- package/dist/types/database/pools.d.ts.map +1 -0
- package/dist/types/database/priceTicks.d.ts +7 -0
- package/dist/types/database/priceTicks.d.ts.map +1 -0
- package/dist/types/database/schemas.d.ts +134 -0
- package/dist/types/database/schemas.d.ts.map +1 -0
- package/dist/types/database/types.d.ts +134 -0
- package/dist/types/database/types.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/error-codes.d.ts +12 -0
- package/dist/types/lib/error-codes.d.ts.map +1 -0
- package/dist/types/lib/errors.d.ts +109 -0
- package/dist/types/lib/errors.d.ts.map +1 -0
- package/dist/types/lib/logger.d.ts +2 -0
- package/dist/types/lib/logger.d.ts.map +1 -0
- package/dist/types/lib/validation.d.ts +3 -0
- package/dist/types/lib/validation.d.ts.map +1 -0
- package/dist/types/routes/addresses.d.ts +115 -0
- package/dist/types/routes/addresses.d.ts.map +1 -0
- package/dist/types/routes/compute.d.ts +132 -0
- package/dist/types/routes/compute.d.ts.map +1 -0
- package/dist/types/routes/ohlcv.d.ts +76 -0
- package/dist/types/routes/ohlcv.d.ts.map +1 -0
- package/dist/types/routes/pools.d.ts +290 -0
- package/dist/types/routes/pools.d.ts.map +1 -0
- package/dist/types/routes/response.d.ts +83 -0
- package/dist/types/routes/response.d.ts.map +1 -0
- package/dist/types/routes/stats.d.ts +69 -0
- package/dist/types/routes/stats.d.ts.map +1 -0
- package/dist/types/routes/tokens.d.ts +71 -0
- package/dist/types/routes/tokens.d.ts.map +1 -0
- package/dist/types/routes/websocket.d.ts +42 -0
- package/dist/types/routes/websocket.d.ts.map +1 -0
- package/dist/types/services/Services.d.ts +23 -0
- package/dist/types/services/Services.d.ts.map +1 -0
- package/dist/types/services/compute/computeService.d.ts +80 -0
- package/dist/types/services/compute/computeService.d.ts.map +1 -0
- package/dist/types/services/compute/computeServiceTypes.d.ts +29 -0
- package/dist/types/services/compute/computeServiceTypes.d.ts.map +1 -0
- package/dist/types/services/computeService.d.ts +103 -0
- package/dist/types/services/computeService.d.ts.map +1 -0
- package/dist/types/services/pool/poolEventsHandler.d.ts +27 -0
- package/dist/types/services/pool/poolEventsHandler.d.ts.map +1 -0
- package/dist/types/services/pool/poolEventsSubscriptionService.d.ts +18 -0
- package/dist/types/services/pool/poolEventsSubscriptionService.d.ts.map +1 -0
- package/dist/types/services/pool/poolService.d.ts +99 -0
- package/dist/types/services/pool/poolService.d.ts.map +1 -0
- package/dist/types/services/pool/poolServiceTypes.d.ts +53 -0
- package/dist/types/services/pool/poolServiceTypes.d.ts.map +1 -0
- package/dist/types/services/pool/poolStateService.d.ts +11 -0
- package/dist/types/services/pool/poolStateService.d.ts.map +1 -0
- package/dist/types/services/pool/poolStateWebsocketService.d.ts +13 -0
- package/dist/types/services/pool/poolStateWebsocketService.d.ts.map +1 -0
- package/dist/types/services/poolEventsHandler.d.ts +26 -0
- package/dist/types/services/poolEventsHandler.d.ts.map +1 -0
- package/dist/types/services/poolEventsSubscriptionService.d.ts +16 -0
- package/dist/types/services/poolEventsSubscriptionService.d.ts.map +1 -0
- package/dist/types/services/poolService.d.ts +153 -0
- package/dist/types/services/poolService.d.ts.map +1 -0
- package/dist/types/services/poolStateWebsocketService.d.ts +13 -0
- package/dist/types/services/poolStateWebsocketService.d.ts.map +1 -0
- package/dist/types/services/poolStatsService.d.ts +66 -0
- package/dist/types/services/poolStatsService.d.ts.map +1 -0
- package/dist/types/services/price/priceService.d.ts +34 -0
- package/dist/types/services/price/priceService.d.ts.map +1 -0
- package/dist/types/services/price/priceServiceTypes.d.ts +8 -0
- package/dist/types/services/price/priceServiceTypes.d.ts.map +1 -0
- package/dist/types/services/priceService.d.ts +39 -0
- package/dist/types/services/priceService.d.ts.map +1 -0
- package/dist/types/services/stat/poolStatsService.d.ts +22 -0
- package/dist/types/services/stat/poolStatsService.d.ts.map +1 -0
- package/dist/types/services/stat/poolStatsServiceTypes.d.ts +35 -0
- package/dist/types/services/stat/poolStatsServiceTypes.d.ts.map +1 -0
- package/dist/types/utils/cacheUtil.d.ts +26 -0
- package/dist/types/utils/cacheUtil.d.ts.map +1 -0
- package/dist/types/utils/period.d.ts +8 -0
- package/dist/types/utils/period.d.ts.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/database/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,cAAc,CAAC;AAEnD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,QAAQ,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,CAAC;IACtB,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ACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BadRequestSchema: z.ZodEnum<["BAD_REQUEST", "INVALID_FILE_TYPE", "PARSE", "INVALID_COOKIE_SIGNATURE"]>;
|
|
3
|
+
export declare const NotFoundSchema: z.ZodEnum<["RESOURCE_NOT_FOUND"]>;
|
|
4
|
+
export declare const InternalErrorSchema: z.ZodEnum<["INTERNAL_SERVER_ERROR"]>;
|
|
5
|
+
export declare const ValidationErrorSchema: z.ZodEnum<["VALIDATION"]>;
|
|
6
|
+
export declare const ErrorCodeSchema: z.ZodUnion<[z.ZodEnum<["BAD_REQUEST", "INVALID_FILE_TYPE", "PARSE", "INVALID_COOKIE_SIGNATURE"]>, z.ZodEnum<["RESOURCE_NOT_FOUND"]>, z.ZodEnum<["INTERNAL_SERVER_ERROR"]>, z.ZodEnum<["VALIDATION"]>]>;
|
|
7
|
+
export type BadRequestErrorCode = z.infer<typeof BadRequestSchema>;
|
|
8
|
+
export type NotFoundErrorCode = z.infer<typeof NotFoundSchema>;
|
|
9
|
+
export type InternalErrorCode = z.infer<typeof InternalErrorSchema>;
|
|
10
|
+
export type ValidationErrorCode = z.infer<typeof ValidationErrorSchema>;
|
|
11
|
+
export type ErrorCode = z.infer<typeof ErrorCodeSchema>;
|
|
12
|
+
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/lib/error-codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,gBAAgB,sFAA2B,CAAC;AACzD,eAAO,MAAM,cAAc,mCAAyB,CAAC;AACrD,eAAO,MAAM,mBAAmB,sCAAyB,CAAC;AAC1D,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAG9D,eAAO,MAAM,eAAe,wMAK1B,CAAC;AAGH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC/D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGxE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ErrorCode, BadRequestErrorCode, NotFoundErrorCode, ValidationErrorCode, InternalErrorCode } from './error-codes';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare abstract class BaseError extends Error {
|
|
4
|
+
message: string;
|
|
5
|
+
details?: Record<string, unknown> | undefined;
|
|
6
|
+
abstract status: number;
|
|
7
|
+
abstract error: string;
|
|
8
|
+
abstract code: ErrorCode;
|
|
9
|
+
constructor(message: string, details?: Record<string, unknown> | undefined);
|
|
10
|
+
toResponse(): Response;
|
|
11
|
+
}
|
|
12
|
+
export declare const BadRequestStatus = 400;
|
|
13
|
+
export declare class BadRequest extends BaseError {
|
|
14
|
+
status: number;
|
|
15
|
+
code: BadRequestErrorCode;
|
|
16
|
+
constructor(message: string, code?: BadRequestErrorCode);
|
|
17
|
+
error: "Bad request";
|
|
18
|
+
static getSchema(): z.ZodObject<{
|
|
19
|
+
message: z.ZodString;
|
|
20
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
+
} & {
|
|
22
|
+
error: z.ZodLiteral<"Bad request">;
|
|
23
|
+
code: z.ZodEnum<["BAD_REQUEST", "INVALID_FILE_TYPE", "PARSE", "INVALID_COOKIE_SIGNATURE"]>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
code: "BAD_REQUEST" | "INVALID_FILE_TYPE" | "PARSE" | "INVALID_COOKIE_SIGNATURE";
|
|
26
|
+
message: string;
|
|
27
|
+
error: "Bad request";
|
|
28
|
+
details?: Record<string, unknown> | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
code: "BAD_REQUEST" | "INVALID_FILE_TYPE" | "PARSE" | "INVALID_COOKIE_SIGNATURE";
|
|
31
|
+
message: string;
|
|
32
|
+
error: "Bad request";
|
|
33
|
+
details?: Record<string, unknown> | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export declare const NotFoundStatus = 404;
|
|
37
|
+
export declare class NotFound extends BaseError {
|
|
38
|
+
status: number;
|
|
39
|
+
error: "Resource not found";
|
|
40
|
+
code: NotFoundErrorCode;
|
|
41
|
+
constructor(subject: string, code?: NotFoundErrorCode);
|
|
42
|
+
static getSchema(): z.ZodObject<{
|
|
43
|
+
message: z.ZodString;
|
|
44
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
45
|
+
} & {
|
|
46
|
+
error: z.ZodLiteral<"Resource not found">;
|
|
47
|
+
code: z.ZodEnum<["RESOURCE_NOT_FOUND"]>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
code: "RESOURCE_NOT_FOUND";
|
|
50
|
+
message: string;
|
|
51
|
+
error: "Resource not found";
|
|
52
|
+
details?: Record<string, unknown> | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
code: "RESOURCE_NOT_FOUND";
|
|
55
|
+
message: string;
|
|
56
|
+
error: "Resource not found";
|
|
57
|
+
details?: Record<string, unknown> | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
export declare const ValidationErrorStatus = 422;
|
|
61
|
+
export declare class ValidationError extends BaseError {
|
|
62
|
+
status: number;
|
|
63
|
+
error: "Validation error";
|
|
64
|
+
code: ValidationErrorCode;
|
|
65
|
+
constructor(message: string, details?: Record<string, unknown>, code?: ValidationErrorCode);
|
|
66
|
+
static getSchema(): z.ZodObject<{
|
|
67
|
+
message: z.ZodString;
|
|
68
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
69
|
+
} & {
|
|
70
|
+
error: z.ZodLiteral<"Validation error">;
|
|
71
|
+
code: z.ZodEnum<["VALIDATION"]>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
code: "VALIDATION";
|
|
74
|
+
message: string;
|
|
75
|
+
error: "Validation error";
|
|
76
|
+
details?: Record<string, unknown> | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
code: "VALIDATION";
|
|
79
|
+
message: string;
|
|
80
|
+
error: "Validation error";
|
|
81
|
+
details?: Record<string, unknown> | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
export declare const InternalServerErrorStatus = 500;
|
|
85
|
+
export declare class InternalServerError extends BaseError {
|
|
86
|
+
status: number;
|
|
87
|
+
error: "Internal server error";
|
|
88
|
+
code: InternalErrorCode;
|
|
89
|
+
constructor(message: string, code?: InternalErrorCode);
|
|
90
|
+
static getSchema(): z.ZodObject<{
|
|
91
|
+
message: z.ZodString;
|
|
92
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
93
|
+
} & {
|
|
94
|
+
error: z.ZodLiteral<"Internal server error">;
|
|
95
|
+
code: z.ZodEnum<["INTERNAL_SERVER_ERROR"]>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
98
|
+
message: string;
|
|
99
|
+
error: "Internal server error";
|
|
100
|
+
details?: Record<string, unknown> | undefined;
|
|
101
|
+
}, {
|
|
102
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
103
|
+
message: string;
|
|
104
|
+
error: "Internal server error";
|
|
105
|
+
details?: Record<string, unknown> | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
}
|
|
108
|
+
export declare function convertElysiaError(code: string | number, error: any): BaseError;
|
|
109
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,8BAAsB,SAAU,SAAQ,KAAK;IAMlC,OAAO,EAAE,MAAM;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAN1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;gBAGhB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;IAM1C,UAAU,IAAI,QAAQ;CAcvB;AAED,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,qBAAa,UAAW,SAAQ,SAAS;IACvC,MAAM,SAAoB;IAC1B,IAAI,EAAE,mBAAmB,CAAC;gBACd,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,mBAAmC;IAItE,KAAK,gBAAiD;IACtD,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;CAMjB;AAED,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,qBAAa,QAAS,SAAQ,SAAS;IACrC,MAAM,SAAkB;IACxB,KAAK,uBAA+C;IACpD,IAAI,EAAE,iBAAiB,CAAC;gBACZ,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAwC;IAI3E,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;CAMjB;AAED,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,MAAM,SAAyB;IAC/B,KAAK,qBAAsD;IAC3D,IAAI,EAAE,mBAAmB,CAAC;gBAExB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,IAAI,GAAE,mBAAkC;IAK1C,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;CAMjB;AAED,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,qBAAa,mBAAoB,SAAQ,SAAS;IAChD,MAAM,SAA6B;IACnC,KAAK,0BAA0D;IAC/D,IAAI,EAAE,iBAAiB,CAAC;gBACZ,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,iBAA2C;IAI9E,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;CAMjB;AAGD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,CAuB/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/logger.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,MAAM,2CAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/lib/validation.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkB,GAC5B,OAAO,CAAC,KAAK,IAAI,MAAM,CAMzB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAa5E"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { ApiClmmPosition, ApiCpmmPosition } from '../api/types';
|
|
3
|
+
export declare const addressesRouter: Elysia<"/addresses", {
|
|
4
|
+
decorator: {};
|
|
5
|
+
store: {};
|
|
6
|
+
derive: {};
|
|
7
|
+
resolve: {};
|
|
8
|
+
}, {
|
|
9
|
+
typebox: {};
|
|
10
|
+
error: {};
|
|
11
|
+
}, {
|
|
12
|
+
schema: {};
|
|
13
|
+
standaloneSchema: {};
|
|
14
|
+
macro: {};
|
|
15
|
+
macroFn: {};
|
|
16
|
+
parser: {};
|
|
17
|
+
response: {};
|
|
18
|
+
}, {
|
|
19
|
+
addresses: {
|
|
20
|
+
":address": {
|
|
21
|
+
"cpmm-positions": {
|
|
22
|
+
get: {
|
|
23
|
+
body: unknown;
|
|
24
|
+
params: {
|
|
25
|
+
address: string;
|
|
26
|
+
};
|
|
27
|
+
query: unknown;
|
|
28
|
+
headers: unknown;
|
|
29
|
+
response: {
|
|
30
|
+
400: {
|
|
31
|
+
code: "BAD_REQUEST" | "INVALID_FILE_TYPE" | "PARSE" | "INVALID_COOKIE_SIGNATURE";
|
|
32
|
+
message: string;
|
|
33
|
+
error: "Bad request";
|
|
34
|
+
details?: Record<string, unknown> | undefined;
|
|
35
|
+
};
|
|
36
|
+
404: {
|
|
37
|
+
code: "RESOURCE_NOT_FOUND";
|
|
38
|
+
message: string;
|
|
39
|
+
error: "Resource not found";
|
|
40
|
+
details?: Record<string, unknown> | undefined;
|
|
41
|
+
};
|
|
42
|
+
422: {
|
|
43
|
+
code: "VALIDATION";
|
|
44
|
+
message: string;
|
|
45
|
+
error: "Validation error";
|
|
46
|
+
details?: Record<string, unknown> | undefined;
|
|
47
|
+
};
|
|
48
|
+
500: {
|
|
49
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
50
|
+
message: string;
|
|
51
|
+
error: "Internal server error";
|
|
52
|
+
details?: Record<string, unknown> | undefined;
|
|
53
|
+
};
|
|
54
|
+
200: ApiCpmmPosition[];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
} & {
|
|
61
|
+
addresses: {
|
|
62
|
+
":address": {
|
|
63
|
+
"clmm-positions": {
|
|
64
|
+
get: {
|
|
65
|
+
body: unknown;
|
|
66
|
+
params: {
|
|
67
|
+
address: string;
|
|
68
|
+
};
|
|
69
|
+
query: unknown;
|
|
70
|
+
headers: unknown;
|
|
71
|
+
response: {
|
|
72
|
+
400: {
|
|
73
|
+
code: "BAD_REQUEST" | "INVALID_FILE_TYPE" | "PARSE" | "INVALID_COOKIE_SIGNATURE";
|
|
74
|
+
message: string;
|
|
75
|
+
error: "Bad request";
|
|
76
|
+
details?: Record<string, unknown> | undefined;
|
|
77
|
+
};
|
|
78
|
+
404: {
|
|
79
|
+
code: "RESOURCE_NOT_FOUND";
|
|
80
|
+
message: string;
|
|
81
|
+
error: "Resource not found";
|
|
82
|
+
details?: Record<string, unknown> | undefined;
|
|
83
|
+
};
|
|
84
|
+
422: {
|
|
85
|
+
code: "VALIDATION";
|
|
86
|
+
message: string;
|
|
87
|
+
error: "Validation error";
|
|
88
|
+
details?: Record<string, unknown> | undefined;
|
|
89
|
+
};
|
|
90
|
+
500: {
|
|
91
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
92
|
+
message: string;
|
|
93
|
+
error: "Internal server error";
|
|
94
|
+
details?: Record<string, unknown> | undefined;
|
|
95
|
+
};
|
|
96
|
+
200: ApiClmmPosition[];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
}, {
|
|
103
|
+
derive: {};
|
|
104
|
+
resolve: {};
|
|
105
|
+
schema: {};
|
|
106
|
+
standaloneSchema: {};
|
|
107
|
+
response: {};
|
|
108
|
+
}, {
|
|
109
|
+
derive: {};
|
|
110
|
+
resolve: {};
|
|
111
|
+
schema: {};
|
|
112
|
+
standaloneSchema: {};
|
|
113
|
+
response: {};
|
|
114
|
+
}>;
|
|
115
|
+
//# sourceMappingURL=addresses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/routes/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAK,MAAM,QAAQ,CAAC;AAMnC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AASnE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDzB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { SwapComputeResult } from '../services/compute/computeServiceTypes';
|
|
3
|
+
export interface SwapComputeError {
|
|
4
|
+
id: string;
|
|
5
|
+
success: false;
|
|
6
|
+
msg: string;
|
|
7
|
+
data: undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface SwapComputeSuccess {
|
|
10
|
+
id: string;
|
|
11
|
+
success: true;
|
|
12
|
+
msg?: undefined;
|
|
13
|
+
data: SwapComputeResult;
|
|
14
|
+
}
|
|
15
|
+
export type SwapComputeResponse = SwapComputeSuccess | SwapComputeError;
|
|
16
|
+
export declare const computeRouter: Elysia<"/compute", {
|
|
17
|
+
decorator: {};
|
|
18
|
+
store: {};
|
|
19
|
+
derive: {};
|
|
20
|
+
resolve: {};
|
|
21
|
+
}, {
|
|
22
|
+
typebox: {};
|
|
23
|
+
error: {};
|
|
24
|
+
}, {
|
|
25
|
+
schema: {};
|
|
26
|
+
standaloneSchema: {};
|
|
27
|
+
macro: {};
|
|
28
|
+
macroFn: {};
|
|
29
|
+
parser: {};
|
|
30
|
+
response: {};
|
|
31
|
+
}, {
|
|
32
|
+
compute: {
|
|
33
|
+
"swap-in": {
|
|
34
|
+
get: {
|
|
35
|
+
body: unknown;
|
|
36
|
+
params: {};
|
|
37
|
+
query: {
|
|
38
|
+
slippageBps?: string | undefined;
|
|
39
|
+
poolType: "standard" | "concentrated";
|
|
40
|
+
inputMint: string;
|
|
41
|
+
outputMint: string;
|
|
42
|
+
amount: string;
|
|
43
|
+
};
|
|
44
|
+
headers: unknown;
|
|
45
|
+
response: {
|
|
46
|
+
400: {
|
|
47
|
+
code: "BAD_REQUEST" | "INVALID_FILE_TYPE" | "PARSE" | "INVALID_COOKIE_SIGNATURE";
|
|
48
|
+
message: string;
|
|
49
|
+
error: "Bad request";
|
|
50
|
+
details?: Record<string, unknown> | undefined;
|
|
51
|
+
};
|
|
52
|
+
404: {
|
|
53
|
+
code: "RESOURCE_NOT_FOUND";
|
|
54
|
+
message: string;
|
|
55
|
+
error: "Resource not found";
|
|
56
|
+
details?: Record<string, unknown> | undefined;
|
|
57
|
+
};
|
|
58
|
+
422: {
|
|
59
|
+
code: "VALIDATION";
|
|
60
|
+
message: string;
|
|
61
|
+
error: "Validation error";
|
|
62
|
+
details?: Record<string, unknown> | undefined;
|
|
63
|
+
};
|
|
64
|
+
500: {
|
|
65
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
66
|
+
message: string;
|
|
67
|
+
error: "Internal server error";
|
|
68
|
+
details?: Record<string, unknown> | undefined;
|
|
69
|
+
};
|
|
70
|
+
200: SwapComputeResult;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
} & {
|
|
76
|
+
compute: {
|
|
77
|
+
"swap-out": {
|
|
78
|
+
get: {
|
|
79
|
+
body: unknown;
|
|
80
|
+
params: {};
|
|
81
|
+
query: {
|
|
82
|
+
slippageBps?: string | undefined;
|
|
83
|
+
poolType: "standard" | "concentrated";
|
|
84
|
+
inputMint: string;
|
|
85
|
+
outputMint: string;
|
|
86
|
+
amount: string;
|
|
87
|
+
};
|
|
88
|
+
headers: unknown;
|
|
89
|
+
response: {
|
|
90
|
+
400: {
|
|
91
|
+
code: "BAD_REQUEST" | "INVALID_FILE_TYPE" | "PARSE" | "INVALID_COOKIE_SIGNATURE";
|
|
92
|
+
message: string;
|
|
93
|
+
error: "Bad request";
|
|
94
|
+
details?: Record<string, unknown> | undefined;
|
|
95
|
+
};
|
|
96
|
+
404: {
|
|
97
|
+
code: "RESOURCE_NOT_FOUND";
|
|
98
|
+
message: string;
|
|
99
|
+
error: "Resource not found";
|
|
100
|
+
details?: Record<string, unknown> | undefined;
|
|
101
|
+
};
|
|
102
|
+
422: {
|
|
103
|
+
code: "VALIDATION";
|
|
104
|
+
message: string;
|
|
105
|
+
error: "Validation error";
|
|
106
|
+
details?: Record<string, unknown> | undefined;
|
|
107
|
+
};
|
|
108
|
+
500: {
|
|
109
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
110
|
+
message: string;
|
|
111
|
+
error: "Internal server error";
|
|
112
|
+
details?: Record<string, unknown> | undefined;
|
|
113
|
+
};
|
|
114
|
+
200: SwapComputeResult;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
}, {
|
|
120
|
+
derive: {};
|
|
121
|
+
resolve: {};
|
|
122
|
+
schema: {};
|
|
123
|
+
standaloneSchema: {};
|
|
124
|
+
response: {};
|
|
125
|
+
}, {
|
|
126
|
+
derive: {};
|
|
127
|
+
resolve: {};
|
|
128
|
+
schema: {};
|
|
129
|
+
standaloneSchema: {};
|
|
130
|
+
response: {};
|
|
131
|
+
}>;
|
|
132
|
+
//# sourceMappingURL=compute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../../src/routes/compute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAK,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAM/E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,IAAI,CAAC;IACd,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AAIxE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFvB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { OHLVCResult } from '../services/stat/poolStatsServiceTypes';
|
|
3
|
+
export declare const timeIntervals: readonly ["1m", "5m", "15m", "1h", "4h", "1d", "1w"];
|
|
4
|
+
export type TimeInterval = (typeof timeIntervals)[number];
|
|
5
|
+
export declare const ohlcvRouter: Elysia<"/ohlcv", {
|
|
6
|
+
decorator: {};
|
|
7
|
+
store: {};
|
|
8
|
+
derive: {};
|
|
9
|
+
resolve: {};
|
|
10
|
+
}, {
|
|
11
|
+
typebox: {};
|
|
12
|
+
error: {};
|
|
13
|
+
}, {
|
|
14
|
+
schema: {};
|
|
15
|
+
standaloneSchema: {};
|
|
16
|
+
macro: {};
|
|
17
|
+
macroFn: {};
|
|
18
|
+
parser: {};
|
|
19
|
+
response: {};
|
|
20
|
+
}, {
|
|
21
|
+
ohlcv: {
|
|
22
|
+
get: {
|
|
23
|
+
body: unknown;
|
|
24
|
+
params: {};
|
|
25
|
+
query: {
|
|
26
|
+
type?: "1m" | "5m" | "15m" | "1h" | "4h" | "1d" | "1w" | undefined;
|
|
27
|
+
token0?: string | undefined;
|
|
28
|
+
token1?: string | undefined;
|
|
29
|
+
poolId?: string | undefined;
|
|
30
|
+
time_from?: number | undefined;
|
|
31
|
+
time_to?: number | undefined;
|
|
32
|
+
};
|
|
33
|
+
headers: unknown;
|
|
34
|
+
response: {
|
|
35
|
+
400: {
|
|
36
|
+
code: "BAD_REQUEST" | "INVALID_FILE_TYPE" | "PARSE" | "INVALID_COOKIE_SIGNATURE";
|
|
37
|
+
message: string;
|
|
38
|
+
error: "Bad request";
|
|
39
|
+
details?: Record<string, unknown> | undefined;
|
|
40
|
+
};
|
|
41
|
+
404: {
|
|
42
|
+
code: "RESOURCE_NOT_FOUND";
|
|
43
|
+
message: string;
|
|
44
|
+
error: "Resource not found";
|
|
45
|
+
details?: Record<string, unknown> | undefined;
|
|
46
|
+
};
|
|
47
|
+
422: {
|
|
48
|
+
code: "VALIDATION";
|
|
49
|
+
message: string;
|
|
50
|
+
error: "Validation error";
|
|
51
|
+
details?: Record<string, unknown> | undefined;
|
|
52
|
+
};
|
|
53
|
+
500: {
|
|
54
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
55
|
+
message: string;
|
|
56
|
+
error: "Internal server error";
|
|
57
|
+
details?: Record<string, unknown> | undefined;
|
|
58
|
+
};
|
|
59
|
+
200: OHLVCResult;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}, {
|
|
64
|
+
derive: {};
|
|
65
|
+
resolve: {};
|
|
66
|
+
schema: {};
|
|
67
|
+
standaloneSchema: {};
|
|
68
|
+
response: {};
|
|
69
|
+
}, {
|
|
70
|
+
derive: {};
|
|
71
|
+
resolve: {};
|
|
72
|
+
schema: {};
|
|
73
|
+
standaloneSchema: {};
|
|
74
|
+
response: {};
|
|
75
|
+
}>;
|
|
76
|
+
//# sourceMappingURL=ohlcv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ohlcv.d.ts","sourceRoot":"","sources":["../../../src/routes/ohlcv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAK,MAAM,QAAQ,CAAC;AAInC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAKzE,eAAO,MAAM,aAAa,sDAAuD,CAAC;AAClF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFvB,CAAC"}
|