@eyettea/zeta-backend 0.0.1-rc.10
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 +1 -0
- package/dist/types/api/index.d.ts +11 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/api/types.d.ts +19 -0
- package/dist/types/api/types.d.ts.map +1 -0
- package/dist/types/app.d.ts +1160 -0
- package/dist/types/app.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/database/aggregates.d.ts +14 -0
- package/dist/types/database/aggregates.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/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 +37 -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 +114 -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/errors.d.ts +91 -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/compute.d.ts +124 -0
- package/dist/types/routes/compute.d.ts.map +1 -0
- package/dist/types/routes/ohlcv.d.ts +74 -0
- package/dist/types/routes/ohlcv.d.ts.map +1 -0
- package/dist/types/routes/pools.d.ts +413 -0
- package/dist/types/routes/pools.d.ts.map +1 -0
- package/dist/types/routes/response.d.ts +73 -0
- package/dist/types/routes/response.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 +21 -0
- package/dist/types/services/Services.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/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 +114 -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/priceService.d.ts +36 -0
- package/dist/types/services/priceService.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 +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAS9C,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,eAAe,EACf,mBAAmB,EAEpB,MAAM,cAAc,CAAC;AAStB,wBAAgB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAc,CAAC;AAC/B,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import postgres from 'postgres';
|
|
2
|
+
declare const sql: postgres.Sql<{}>;
|
|
3
|
+
export type SqlClient = typeof sql;
|
|
4
|
+
export declare function ensureDatabaseExists(): Promise<void>;
|
|
5
|
+
export declare function checkDatabaseConnection(): Promise<boolean>;
|
|
6
|
+
export declare function closeDatabaseConnection(): Promise<void>;
|
|
7
|
+
export declare function withTransaction<T>(fn: (tx: SqlClient) => T | Promise<T>, client?: SqlClient): Promise<Awaited<T>>;
|
|
8
|
+
export declare class DatabaseError extends Error {
|
|
9
|
+
readonly cause?: unknown;
|
|
10
|
+
readonly code?: string;
|
|
11
|
+
readonly detail?: string;
|
|
12
|
+
constructor(message: string, cause?: unknown);
|
|
13
|
+
}
|
|
14
|
+
export declare function wrapDatabaseError(message: string, error: unknown): DatabaseError;
|
|
15
|
+
export declare function isDatabaseError(error: unknown): error is DatabaseError;
|
|
16
|
+
export default sql;
|
|
17
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/config/database.ts"],"names":[],"mappings":"AAAA,OAAO,QAA6C,MAAM,UAAU,CAAC;AA+CrE,QAAA,MAAM,GAAG,kBAA+D,CAAC;AAEzE,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,CAAC;AAEnC,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CA2B1D;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC,CAahE;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAiB7D;AAED,wBAAsB,eAAe,CAAC,CAAC,EACrC,EAAE,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACrC,MAAM,GAAE,SAAe,GACtB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAErB;AAED,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChC,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEpB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAU7C;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,aAAa,CAKhF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AAkBD,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const env: Readonly<{
|
|
2
|
+
DB_NAME: string;
|
|
3
|
+
NODE_ENV: "development" | "test" | "production";
|
|
4
|
+
HOST: string;
|
|
5
|
+
PORT: number;
|
|
6
|
+
LOG_LEVEL: "error" | "warn" | "warning" | "info" | "debug";
|
|
7
|
+
DB_HOST: string;
|
|
8
|
+
DB_PORT: number;
|
|
9
|
+
DB_USER: string;
|
|
10
|
+
DB_PASSWORD: string;
|
|
11
|
+
DB_IDLE_TIMEOUT: number;
|
|
12
|
+
DB_CONNECT_TIMEOUT: number;
|
|
13
|
+
DB_MAX_CONNECTIONS: number;
|
|
14
|
+
DB_MAX_LIFETIME: number;
|
|
15
|
+
NETWORK_ID: "mainnet" | "testnet" | "devnet";
|
|
16
|
+
TOKEN_LIST_FILE: string;
|
|
17
|
+
PRICE_API_URL: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type Env = typeof env;
|
|
20
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/config/env.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;EAGd,CAAC;AACH,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AggregatedOHLCVRow, OHLCVRow } from './types';
|
|
2
|
+
export declare function getAggregatedOHLCV(poolId: string, startTime: number, endTime: number): Promise<AggregatedOHLCVRow[]>;
|
|
3
|
+
export declare function getOHLCVRows(poolId: string, interval: string, timeFrom: number, timeTo: number): Promise<OHLCVRow[]>;
|
|
4
|
+
export declare function getOHLCVRowsByTokenPair(tokenAId: string, tokenBId: string, interval: string, timeFrom: number, timeTo: number): Promise<OHLCVRow[]>;
|
|
5
|
+
export declare function refreshContinuousAggregate(viewName: string): Promise<void>;
|
|
6
|
+
export declare function getOHLCVCounts(): Promise<{
|
|
7
|
+
ohlcv_1m_count: number;
|
|
8
|
+
ohlcv_15m_count: number;
|
|
9
|
+
ohlcv_1h_count: number;
|
|
10
|
+
ohlcv_4h_count: number;
|
|
11
|
+
ohlcv_1d_count: number;
|
|
12
|
+
ohlcv_1w_count: number;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=aggregates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregates.d.ts","sourceRoot":"","sources":["../../../src/database/aggregates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA0D5D,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAa/B;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,QAAQ,EAAE,CAAC,CAkBrB;AAED,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,QAAQ,EAAE,CAAC,CAoBrB;AAED,wBAAsB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhF;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC,CA4BD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ClmmTickRow } from './types';
|
|
2
|
+
export interface ClmmTickDelta {
|
|
3
|
+
tick: bigint;
|
|
4
|
+
liquidityGrossDelta: bigint;
|
|
5
|
+
liquidityNetDelta: bigint;
|
|
6
|
+
}
|
|
7
|
+
export declare function applyTickDeltas(poolId: string, deltas: ClmmTickDelta[]): Promise<void>;
|
|
8
|
+
export declare function fetchClmmTicks(poolId: string): Promise<ClmmTickRow[]>;
|
|
9
|
+
//# sourceMappingURL=clmmTicks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clmmTicks.d.ts","sourceRoot":"","sources":["../../../src/database/clmmTicks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB5F;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAO3E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LiquidityTickInsert } from './types';
|
|
2
|
+
export declare function insertLiquidityTick(params: LiquidityTickInsert): Promise<void>;
|
|
3
|
+
export declare function getLiquidityTickStats(): Promise<{
|
|
4
|
+
total_liquidity_ticks: number;
|
|
5
|
+
pools_with_liquidity: number;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=liquidityTicks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquidityTicks.d.ts","sourceRoot":"","sources":["../../../src/database/liquidityTicks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpF;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC;IACrD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC,CAiBD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type SqlClient } from '../config/database';
|
|
2
|
+
import type { ClmmPoolTypes } from '@eyettea/typescript-sdk';
|
|
3
|
+
import type { ClmmPositionRow } from './types';
|
|
4
|
+
export declare function insertMints(params: {
|
|
5
|
+
id: string;
|
|
6
|
+
poolId: string;
|
|
7
|
+
configIndex: number;
|
|
8
|
+
createdAt?: Date;
|
|
9
|
+
mint: ClmmPoolTypes.MintEvent;
|
|
10
|
+
}, client?: SqlClient): Promise<void>;
|
|
11
|
+
export declare function insertBurns(params: {
|
|
12
|
+
id: string;
|
|
13
|
+
poolId: string;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
burn: ClmmPoolTypes.BurnEvent;
|
|
16
|
+
}, client?: SqlClient): Promise<void>;
|
|
17
|
+
export declare function getClmmPositions(candidates: string[], client?: SqlClient): Promise<ClmmPositionRow[]>;
|
|
18
|
+
//# sourceMappingURL=mints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mints.d.ts","sourceRoot":"","sources":["../../../src/database/mints.ts"],"names":[],"mappings":"AAAA,OAAY,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;CAC/B,EACD,MAAM,GAAE,SAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CA2Cf;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC;CAC/B,EACD,MAAM,GAAE,SAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAAE,EACpB,MAAM,GAAE,SAAe,GACtB,OAAO,CAAC,eAAe,EAAE,CAAC,CAwB5B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type SqlClient } from '../config/database';
|
|
2
|
+
import type { PoolEvent, PoolEventCounterRow, PoolFactoryEventCounterRow } from './types';
|
|
3
|
+
export declare function insertPoolEvent(params: {
|
|
4
|
+
poolId: string;
|
|
5
|
+
eventType: string;
|
|
6
|
+
txId: string;
|
|
7
|
+
blockHash: string;
|
|
8
|
+
eventData: unknown;
|
|
9
|
+
}, client?: SqlClient): Promise<void>;
|
|
10
|
+
export declare function insertPoolFactoryEvent(params: {
|
|
11
|
+
poolId: string;
|
|
12
|
+
eventType: string;
|
|
13
|
+
txId: string;
|
|
14
|
+
blockHash: string;
|
|
15
|
+
eventData: unknown;
|
|
16
|
+
}, client?: SqlClient): Promise<void>;
|
|
17
|
+
export declare function getPoolEventCounter(poolId: string, client?: SqlClient): Promise<PoolEventCounterRow | undefined>;
|
|
18
|
+
export declare function getPoolEvents(poolId: string, client?: SqlClient): Promise<PoolEvent[]>;
|
|
19
|
+
export declare function createPoolEventCounter(poolId: string, fromCount?: number, client?: SqlClient): Promise<void>;
|
|
20
|
+
export declare function updatePoolEventCounter(poolId: string, fromCount: number, client?: SqlClient): Promise<void>;
|
|
21
|
+
export declare function getPoolFactoryEventCounter(poolFactoryId: string, client?: SqlClient): Promise<PoolFactoryEventCounterRow | undefined>;
|
|
22
|
+
export declare function createPoolFactoryEventCounter(poolFactoryId: string, fromCount?: number, client?: SqlClient): Promise<void>;
|
|
23
|
+
export declare function updatePoolFactoryEventCounter(poolFactoryId: string, fromCount: number, client?: SqlClient): Promise<void>;
|
|
24
|
+
export declare function getPoolEventSummary(): Promise<{
|
|
25
|
+
total_events: number;
|
|
26
|
+
swaps: number;
|
|
27
|
+
mints: number;
|
|
28
|
+
burns: number;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function getFactoryEventCount(): Promise<number>;
|
|
31
|
+
export declare function getMostActivePools(limit: number): Promise<{
|
|
32
|
+
pool_id: string;
|
|
33
|
+
event_count: number;
|
|
34
|
+
last_event: Date | null;
|
|
35
|
+
}[]>;
|
|
36
|
+
export declare function countEventsForPool(poolId: string): Promise<number>;
|
|
37
|
+
//# sourceMappingURL=poolEvents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AAC,IAAI,CAAC,CAOf;AAED,wBAAsB,0BAA0B,CAC9C,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,SAAe,GACtB,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAajD;AAED,wBAAsB,6BAA6B,CACjD,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,MAAU,EACrB,MAAM,GAAE,SAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,6BAA6B,CACjD,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,SAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAuBD;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAM5D;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAC9D;IACE,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB,EAAE,CACJ,CAiBA;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type SqlClient } from '../config/database';
|
|
2
|
+
import type { PoolRow, PoolType } from './types';
|
|
3
|
+
export declare function getPoolById(id: string): Promise<PoolRow | undefined>;
|
|
4
|
+
export declare function upsertPool(params: {
|
|
5
|
+
id: string;
|
|
6
|
+
token0: string;
|
|
7
|
+
token1: string;
|
|
8
|
+
poolType: PoolType;
|
|
9
|
+
configIndex?: number;
|
|
10
|
+
}, client?: SqlClient): Promise<void>;
|
|
11
|
+
export declare function countAllPools(): Promise<number>;
|
|
12
|
+
export declare function countPoolsByType(poolType: PoolType): Promise<number>;
|
|
13
|
+
export declare function countActivePools(poolType?: PoolType | 'all'): Promise<number>;
|
|
14
|
+
export declare function fetchActivePools(params: {
|
|
15
|
+
poolType?: PoolType | 'all';
|
|
16
|
+
sortDirection?: 'asc' | 'desc';
|
|
17
|
+
limit?: number;
|
|
18
|
+
offset?: number;
|
|
19
|
+
}): Promise<PoolRow[]>;
|
|
20
|
+
export declare function countActivePoolsByExactPair(params: {
|
|
21
|
+
token0Id: string;
|
|
22
|
+
token1Id: string;
|
|
23
|
+
poolType?: PoolType | 'all';
|
|
24
|
+
}): Promise<number>;
|
|
25
|
+
export declare function fetchActivePoolsByExactPair(params: {
|
|
26
|
+
token0Id: string;
|
|
27
|
+
token1Id: string;
|
|
28
|
+
poolType?: PoolType | 'all';
|
|
29
|
+
sortDirection?: 'asc' | 'desc';
|
|
30
|
+
limit?: number;
|
|
31
|
+
offset?: number;
|
|
32
|
+
}): Promise<PoolRow[]>;
|
|
33
|
+
export declare function countActivePoolsByToken(params: {
|
|
34
|
+
tokenId: string;
|
|
35
|
+
poolType?: PoolType | 'all';
|
|
36
|
+
}): Promise<number>;
|
|
37
|
+
export declare function fetchActivePoolsByToken(params: {
|
|
38
|
+
tokenId: string;
|
|
39
|
+
poolType?: PoolType | 'all';
|
|
40
|
+
sortDirection?: 'asc' | 'desc';
|
|
41
|
+
limit?: number;
|
|
42
|
+
offset?: number;
|
|
43
|
+
}): Promise<PoolRow[]>;
|
|
44
|
+
export declare function fetchAllActivePools(): Promise<PoolRow[]>;
|
|
45
|
+
export declare function fetchRecentActivePools(limit: number): Promise<PoolRow[]>;
|
|
46
|
+
export declare function fetchActivePoolsByIds(poolIds: string[]): Promise<PoolRow[]>;
|
|
47
|
+
//# sourceMappingURL=pools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pools.d.ts","sourceRoot":"","sources":["../../../src/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,CAAC,MAAM,EAAE;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAoCrB;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CAC7B,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBlB;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CA2BrB;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAQ9D;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAS9E;AAED,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAUjF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PriceTickInsert } from './types';
|
|
2
|
+
export declare function insertPriceTick(params: PriceTickInsert): Promise<void>;
|
|
3
|
+
export declare function getPriceTickStats(): Promise<{
|
|
4
|
+
total_price_ticks: number;
|
|
5
|
+
pools_with_prices: number;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=priceTicks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priceTicks.d.ts","sourceRoot":"","sources":["../../../src/database/priceTicks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,wBAAsB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB5E;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAiBD"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ZPoolRow: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
token0_id: z.ZodString;
|
|
5
|
+
token1_id: z.ZodString;
|
|
6
|
+
config_index: z.ZodNullable<z.ZodNumber>;
|
|
7
|
+
pool_type: z.ZodEnum<["standard", "concentrated"]>;
|
|
8
|
+
is_active: z.ZodBoolean;
|
|
9
|
+
created_at: z.ZodDate;
|
|
10
|
+
updated_at: z.ZodDate;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
id: string;
|
|
13
|
+
token0_id: string;
|
|
14
|
+
token1_id: string;
|
|
15
|
+
config_index: number | null;
|
|
16
|
+
pool_type: "standard" | "concentrated";
|
|
17
|
+
is_active: boolean;
|
|
18
|
+
created_at: Date;
|
|
19
|
+
updated_at: Date;
|
|
20
|
+
}, {
|
|
21
|
+
id: string;
|
|
22
|
+
token0_id: string;
|
|
23
|
+
token1_id: string;
|
|
24
|
+
config_index: number | null;
|
|
25
|
+
pool_type: "standard" | "concentrated";
|
|
26
|
+
is_active: boolean;
|
|
27
|
+
created_at: Date;
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const ZPoolEventCounterRow: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
pool_id: z.ZodString;
|
|
33
|
+
from_count: z.ZodNumber;
|
|
34
|
+
is_active: z.ZodBoolean;
|
|
35
|
+
created_at: z.ZodDate;
|
|
36
|
+
updated_at: z.ZodDate;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
id: string;
|
|
39
|
+
is_active: boolean;
|
|
40
|
+
created_at: Date;
|
|
41
|
+
updated_at: Date;
|
|
42
|
+
pool_id: string;
|
|
43
|
+
from_count: number;
|
|
44
|
+
}, {
|
|
45
|
+
id: string;
|
|
46
|
+
is_active: boolean;
|
|
47
|
+
created_at: Date;
|
|
48
|
+
updated_at: Date;
|
|
49
|
+
pool_id: string;
|
|
50
|
+
from_count: number;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const ZPoolFactoryEventCounterRow: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
pool_factory_id: z.ZodString;
|
|
55
|
+
from_count: z.ZodNumber;
|
|
56
|
+
is_active: z.ZodBoolean;
|
|
57
|
+
created_at: z.ZodDate;
|
|
58
|
+
updated_at: z.ZodDate;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
id: string;
|
|
61
|
+
is_active: boolean;
|
|
62
|
+
created_at: Date;
|
|
63
|
+
updated_at: Date;
|
|
64
|
+
from_count: number;
|
|
65
|
+
pool_factory_id: string;
|
|
66
|
+
}, {
|
|
67
|
+
id: string;
|
|
68
|
+
is_active: boolean;
|
|
69
|
+
created_at: Date;
|
|
70
|
+
updated_at: Date;
|
|
71
|
+
from_count: number;
|
|
72
|
+
pool_factory_id: string;
|
|
73
|
+
}>;
|
|
74
|
+
export declare const ZAggregatedOHLCVRow: z.ZodObject<{
|
|
75
|
+
total_volume_base: z.ZodNullable<z.ZodString>;
|
|
76
|
+
total_volume_quote: z.ZodNullable<z.ZodString>;
|
|
77
|
+
price_min: z.ZodNullable<z.ZodString>;
|
|
78
|
+
price_max: z.ZodNullable<z.ZodString>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
total_volume_base: string | null;
|
|
81
|
+
total_volume_quote: string | null;
|
|
82
|
+
price_min: string | null;
|
|
83
|
+
price_max: string | null;
|
|
84
|
+
}, {
|
|
85
|
+
total_volume_base: string | null;
|
|
86
|
+
total_volume_quote: string | null;
|
|
87
|
+
price_min: string | null;
|
|
88
|
+
price_max: string | null;
|
|
89
|
+
}>;
|
|
90
|
+
export declare const ZOHLCVRow: z.ZodObject<{
|
|
91
|
+
unix_time: z.ZodString;
|
|
92
|
+
open_price: z.ZodString;
|
|
93
|
+
high_price: z.ZodString;
|
|
94
|
+
low_price: z.ZodString;
|
|
95
|
+
close_price: z.ZodString;
|
|
96
|
+
volume_base: z.ZodString;
|
|
97
|
+
volume_quote: z.ZodString;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
unix_time: string;
|
|
100
|
+
open_price: string;
|
|
101
|
+
high_price: string;
|
|
102
|
+
low_price: string;
|
|
103
|
+
close_price: string;
|
|
104
|
+
volume_base: string;
|
|
105
|
+
volume_quote: string;
|
|
106
|
+
}, {
|
|
107
|
+
unix_time: string;
|
|
108
|
+
open_price: string;
|
|
109
|
+
high_price: string;
|
|
110
|
+
low_price: string;
|
|
111
|
+
close_price: string;
|
|
112
|
+
volume_base: string;
|
|
113
|
+
volume_quote: string;
|
|
114
|
+
}>;
|
|
115
|
+
export declare const ZClmmTickRow: z.ZodObject<{
|
|
116
|
+
pool_id: z.ZodString;
|
|
117
|
+
tick: z.ZodString;
|
|
118
|
+
liquidity_gross: z.ZodString;
|
|
119
|
+
liquidity_net: z.ZodString;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
pool_id: string;
|
|
122
|
+
tick: string;
|
|
123
|
+
liquidity_gross: string;
|
|
124
|
+
liquidity_net: string;
|
|
125
|
+
}, {
|
|
126
|
+
pool_id: string;
|
|
127
|
+
tick: string;
|
|
128
|
+
liquidity_gross: string;
|
|
129
|
+
liquidity_net: string;
|
|
130
|
+
}>;
|
|
131
|
+
export declare function parseRow<Output, Schema extends z.ZodType<Output>>(schema: Schema, row: unknown, context: string): Output;
|
|
132
|
+
export declare function parseRows<Output, Schema extends z.ZodType<Output>>(schema: Schema, rows: unknown[], context: string): Output[];
|
|
133
|
+
export declare function parseFirstRow<Output, Schema extends z.ZodType<Output>>(schema: Schema, rows: unknown[], context: string): Output | undefined;
|
|
134
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/database/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;EAOtC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAK9B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;EAQpB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAKvB,CAAC;AAMH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAC/D,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,CAQR;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAChE,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAQV;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EACpE,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAKpB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export interface EventFields {
|
|
2
|
+
sender: string;
|
|
3
|
+
owner: string;
|
|
4
|
+
tickLower: string;
|
|
5
|
+
tickUpper: string;
|
|
6
|
+
liquidity: string;
|
|
7
|
+
amount0: string;
|
|
8
|
+
amount1: string;
|
|
9
|
+
totalLiquidity: string;
|
|
10
|
+
}
|
|
11
|
+
export interface EventData {
|
|
12
|
+
contractAddress: string;
|
|
13
|
+
blockHash: string;
|
|
14
|
+
txId: string;
|
|
15
|
+
eventIndex: number;
|
|
16
|
+
name: string;
|
|
17
|
+
fields: EventFields;
|
|
18
|
+
}
|
|
19
|
+
export type PoolType = 'standard' | 'concentrated';
|
|
20
|
+
export interface PoolRow {
|
|
21
|
+
id: string;
|
|
22
|
+
token0_id: string;
|
|
23
|
+
token1_id: string;
|
|
24
|
+
config_index: number | null;
|
|
25
|
+
pool_type: PoolType;
|
|
26
|
+
is_active: boolean;
|
|
27
|
+
created_at: Date;
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
}
|
|
30
|
+
export interface PoolEvent {
|
|
31
|
+
id: string;
|
|
32
|
+
pool_id: string;
|
|
33
|
+
event_type: string;
|
|
34
|
+
tx_id: string;
|
|
35
|
+
event_data: EventData;
|
|
36
|
+
created_at: Date;
|
|
37
|
+
block_hash: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface PoolEventCounterRow {
|
|
40
|
+
id: string;
|
|
41
|
+
pool_id: string;
|
|
42
|
+
from_count: number;
|
|
43
|
+
is_active: boolean;
|
|
44
|
+
created_at: Date;
|
|
45
|
+
updated_at: Date;
|
|
46
|
+
}
|
|
47
|
+
export interface PoolFactoryEventCounterRow {
|
|
48
|
+
id: string;
|
|
49
|
+
pool_factory_id: string;
|
|
50
|
+
from_count: number;
|
|
51
|
+
is_active: boolean;
|
|
52
|
+
created_at: Date;
|
|
53
|
+
updated_at: Date;
|
|
54
|
+
}
|
|
55
|
+
export interface OHLCVRow {
|
|
56
|
+
unix_time: string;
|
|
57
|
+
open_price: string;
|
|
58
|
+
high_price: string;
|
|
59
|
+
low_price: string;
|
|
60
|
+
close_price: string;
|
|
61
|
+
volume_base: string;
|
|
62
|
+
volume_quote: string;
|
|
63
|
+
}
|
|
64
|
+
export interface AggregatedOHLCVRow {
|
|
65
|
+
total_volume_base: string | null;
|
|
66
|
+
total_volume_quote: string | null;
|
|
67
|
+
price_min: string | null;
|
|
68
|
+
price_max: string | null;
|
|
69
|
+
}
|
|
70
|
+
export interface PriceTickInsert {
|
|
71
|
+
poolId: string;
|
|
72
|
+
token0Id: string;
|
|
73
|
+
token1Id: string;
|
|
74
|
+
price: string;
|
|
75
|
+
volumeBase: string;
|
|
76
|
+
volumeQuote: string;
|
|
77
|
+
timestamp: number;
|
|
78
|
+
txId: string;
|
|
79
|
+
}
|
|
80
|
+
export interface LiquidityTickInsert {
|
|
81
|
+
poolId: string;
|
|
82
|
+
liquidityChange: string;
|
|
83
|
+
amount0Change: string;
|
|
84
|
+
amount1Change: string;
|
|
85
|
+
totalLiquidity: string;
|
|
86
|
+
reserve0: string;
|
|
87
|
+
reserve1: string;
|
|
88
|
+
timestamp: number;
|
|
89
|
+
txId: string;
|
|
90
|
+
blockHash: string;
|
|
91
|
+
}
|
|
92
|
+
export interface ClmmTickRow {
|
|
93
|
+
pool_id: string;
|
|
94
|
+
tick: string;
|
|
95
|
+
liquidity_gross: string;
|
|
96
|
+
liquidity_net: string;
|
|
97
|
+
}
|
|
98
|
+
export interface ClmmPositionRow {
|
|
99
|
+
id: string;
|
|
100
|
+
pool_id: string;
|
|
101
|
+
config_index: number;
|
|
102
|
+
tx_id: string;
|
|
103
|
+
created_at: Date;
|
|
104
|
+
block_hash: string;
|
|
105
|
+
sender: string;
|
|
106
|
+
owner: string;
|
|
107
|
+
tick_lower: number;
|
|
108
|
+
tick_upper: number;
|
|
109
|
+
liquidity: string;
|
|
110
|
+
amount0: string;
|
|
111
|
+
amount1: string;
|
|
112
|
+
total_liquidity: string;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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;IACh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AAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare abstract class BaseError extends Error {
|
|
3
|
+
message: string;
|
|
4
|
+
details?: Record<string, unknown> | undefined;
|
|
5
|
+
abstract status: number;
|
|
6
|
+
abstract error: string;
|
|
7
|
+
constructor(message: string, details?: Record<string, unknown> | undefined);
|
|
8
|
+
toResponse(): Response;
|
|
9
|
+
}
|
|
10
|
+
export declare const BadRequestStatus = 400;
|
|
11
|
+
export declare class BadRequest extends BaseError {
|
|
12
|
+
status: number;
|
|
13
|
+
constructor(message: string);
|
|
14
|
+
error: "Bad request";
|
|
15
|
+
static getSchema(): z.ZodObject<{
|
|
16
|
+
message: z.ZodString;
|
|
17
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
18
|
+
} & {
|
|
19
|
+
error: z.ZodLiteral<"Bad request">;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
message: string;
|
|
22
|
+
error: "Bad request";
|
|
23
|
+
details?: Record<string, unknown> | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
message: string;
|
|
26
|
+
error: "Bad request";
|
|
27
|
+
details?: Record<string, unknown> | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
export declare const NotFoundStatus = 404;
|
|
31
|
+
export declare class NotFound extends BaseError {
|
|
32
|
+
status: number;
|
|
33
|
+
error: "Resource not found";
|
|
34
|
+
constructor(subject: string);
|
|
35
|
+
static getSchema(): z.ZodObject<{
|
|
36
|
+
message: z.ZodString;
|
|
37
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
} & {
|
|
39
|
+
error: z.ZodLiteral<"Resource not found">;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
message: string;
|
|
42
|
+
error: "Resource not found";
|
|
43
|
+
details?: Record<string, unknown> | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
message: string;
|
|
46
|
+
error: "Resource not found";
|
|
47
|
+
details?: Record<string, unknown> | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
}
|
|
50
|
+
export declare const ValidationErrorStatus = 422;
|
|
51
|
+
export declare class ValidationError extends BaseError {
|
|
52
|
+
status: number;
|
|
53
|
+
error: "Validation error";
|
|
54
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
55
|
+
static getSchema(): z.ZodObject<{
|
|
56
|
+
message: z.ZodString;
|
|
57
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
58
|
+
} & {
|
|
59
|
+
error: z.ZodLiteral<"Validation error">;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
message: string;
|
|
62
|
+
error: "Validation error";
|
|
63
|
+
details?: Record<string, unknown> | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
message: string;
|
|
66
|
+
error: "Validation error";
|
|
67
|
+
details?: Record<string, unknown> | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
export declare const InternalServerErrorStatus = 500;
|
|
71
|
+
export declare class InternalServerError extends BaseError {
|
|
72
|
+
status: number;
|
|
73
|
+
error: "Internal server error";
|
|
74
|
+
constructor(message: string);
|
|
75
|
+
static getSchema(): z.ZodObject<{
|
|
76
|
+
message: z.ZodString;
|
|
77
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
78
|
+
} & {
|
|
79
|
+
error: z.ZodLiteral<"Internal server error">;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
message: string;
|
|
82
|
+
error: "Internal server error";
|
|
83
|
+
details?: Record<string, unknown> | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
message: string;
|
|
86
|
+
error: "Internal server error";
|
|
87
|
+
details?: Record<string, unknown> | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
90
|
+
export declare function convertElysiaError(code: string | number, error: any): BaseError;
|
|
91
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../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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,0CAA4B,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"}
|