@h0ngcha0/zeta-backend 0.0.1-rc.15 → 0.0.1-rc.18

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.
Files changed (44) hide show
  1. package/dist/types/api/index.d.ts +4 -3
  2. package/dist/types/api/index.d.ts.map +1 -1
  3. package/dist/types/api/serializers.d.ts +9 -0
  4. package/dist/types/api/serializers.d.ts.map +1 -0
  5. package/dist/types/api/types.d.ts +39 -11
  6. package/dist/types/api/types.d.ts.map +1 -1
  7. package/dist/types/api/utils.d.ts +6 -0
  8. package/dist/types/api/utils.d.ts.map +1 -0
  9. package/dist/types/app.d.ts +258 -14
  10. package/dist/types/app.d.ts.map +1 -1
  11. package/dist/types/cron.d.ts +54 -0
  12. package/dist/types/cron.d.ts.map +1 -0
  13. package/dist/types/database/clmmPositions.d.ts +28 -0
  14. package/dist/types/database/clmmPositions.d.ts.map +1 -0
  15. package/dist/types/database/cpmmPositions.d.ts +16 -0
  16. package/dist/types/database/cpmmPositions.d.ts.map +1 -0
  17. package/dist/types/database/mints.d.ts.map +1 -1
  18. package/dist/types/database/schemas.d.ts +8 -8
  19. package/dist/types/database/types.d.ts +17 -0
  20. package/dist/types/database/types.d.ts.map +1 -1
  21. package/dist/types/lib/error-codes.d.ts +12 -0
  22. package/dist/types/lib/error-codes.d.ts.map +1 -0
  23. package/dist/types/lib/errors.d.ts +22 -4
  24. package/dist/types/lib/errors.d.ts.map +1 -1
  25. package/dist/types/routes/addresses.d.ts +73 -0
  26. package/dist/types/routes/addresses.d.ts.map +1 -0
  27. package/dist/types/routes/compute.d.ts +8 -0
  28. package/dist/types/routes/compute.d.ts.map +1 -1
  29. package/dist/types/routes/ohlcv.d.ts +4 -0
  30. package/dist/types/routes/ohlcv.d.ts.map +1 -1
  31. package/dist/types/routes/pools.d.ts +55 -19
  32. package/dist/types/routes/pools.d.ts.map +1 -1
  33. package/dist/types/routes/response.d.ts +14 -4
  34. package/dist/types/routes/response.d.ts.map +1 -1
  35. package/dist/types/routes/stats.d.ts +45 -0
  36. package/dist/types/routes/stats.d.ts.map +1 -0
  37. package/dist/types/services/poolEventsSubscriptionService.d.ts.map +1 -1
  38. package/dist/types/services/poolService.d.ts +39 -8
  39. package/dist/types/services/poolService.d.ts.map +1 -1
  40. package/dist/types/services/priceService.d.ts +4 -1
  41. package/dist/types/services/priceService.d.ts.map +1 -1
  42. package/dist/types/utils/cacheUtil.d.ts +26 -0
  43. package/dist/types/utils/cacheUtil.d.ts.map +1 -0
  44. package/package.json +3 -2
@@ -1,10 +1,11 @@
1
1
  export type { App } from '../app';
2
- export type { PoolType, PoolSortType, PoolWithStats, CpmmPoolWithStats, ClmmPoolWithStats, ClmmLiquidityRow, } from '../services/poolService';
2
+ export type { PoolType, PoolSortType, PoolWithStats, CpmmPoolWithStats, ClmmPoolWithStats, ClmmLiquidityRow, ApiClmmPoolWithStats, ApiCpmmPoolWithStats, ApiPoolWithStats, ApiGlobalStats, } from '../services/poolService';
3
3
  export type { TokenPrice } from '../services/priceService';
4
4
  export type { LiquidityLineData, OHLVCResult, PeriodicalPoolStats, } from '../services/poolStatsService';
5
5
  export type { SwapComputeResult } from '../services/computeService';
6
6
  export type { PaginatedApiResponse } from '../routes/response';
7
7
  export type { BadRequest, NotFound, ValidationError, InternalServerError } from '../lib/errors';
8
- export type { ClmmLiquidityRowPayload, ClmmLiquidityLinePayload, PoolListResponse, PoolListFromIdsResponse, Events as PoolEventsResponse, TokenListResponse, TokenPricesResponse, } from '../routes/pools';
9
- export type { ClmmPosition } from '../api/types';
8
+ export type { ErrorCode, BadRequestErrorCode, NotFoundErrorCode, ValidationErrorCode, InternalErrorCode, } from '../lib/error-codes';
9
+ export type { ClmmLiquidityRowPayload, ClmmLiquidityLinePayload, ApiPoolListResponse, ApiPoolListFromIdsResponse, ApiPoolEventsResponse, TokenListResponse, ApiTokenPricesResponse, } from '../routes/pools';
10
+ export type { ApiClmmPosition, ApiCpmmPosition, CpmmPosition } from '../api/types';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE/F,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,MAAM,IAAI,kBAAkB,EAC5B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE/F,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ApiCpmmPosition, CpmmPosition } from '../api/types';
2
+ import type { ApiPoolEvent, PoolEvent } from '../database/types';
3
+ import type { ApiPoolWithStats, PoolWithStats } from '../services/poolService';
4
+ import type { ApiTokenPrice, TokenPrice } from '../services/priceService';
5
+ export declare const serializeTokenPrice: (p: TokenPrice) => ApiTokenPrice;
6
+ export declare const serializePoolWithStats: (p: PoolWithStats) => ApiPoolWithStats;
7
+ export declare const serializePoolEvent: (e: PoolEvent) => ApiPoolEvent;
8
+ export declare const serializeCpmmPosition: (p: CpmmPosition) => ApiCpmmPosition;
9
+ //# sourceMappingURL=serializers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/api/serializers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEzE,eAAO,MAAM,mBAAmB,GAAI,GAAG,UAAU,KAAG,aAMnD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,GAAG,aAAa,KAAG,gBAoBzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,GAAG,SAAS,KAAG,YAKjD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,GAAG,YAAY,KAAG,eAYvD,CAAC"}
@@ -1,23 +1,51 @@
1
1
  import type { TokenInfo } from '@alephium/token-list';
2
- export interface ClmmPosition {
2
+ import type Decimal from 'decimal.js';
3
+ export interface ApiClmmPosition {
3
4
  id: string;
4
5
  poolId: string;
5
6
  configIndex: number;
6
- createdAt: Date;
7
+ createdAt: string;
7
8
  sender: string;
8
9
  owner: string;
9
10
  token0Info: TokenInfo;
10
11
  token1Info: TokenInfo;
11
12
  tickLower: number;
12
13
  tickUpper: number;
13
- liquidity: number;
14
- amount0: number;
15
- amount1: number;
16
- fee0: number;
17
- fee1: number;
18
- fee2: number;
19
- avgValue: number;
20
- avgFees: number;
21
- avgTime: number;
14
+ liquidity: string;
15
+ amount0: string;
16
+ amount1: string;
17
+ sqrtPriceX96: string;
18
+ fee0: string;
19
+ fee1: string;
20
+ fee2: string;
21
+ avgValue: string;
22
+ avgFees: string;
23
+ avgTime: string;
24
+ }
25
+ export type CpmmPosition = {
26
+ id: string;
27
+ poolId: string;
28
+ createdAt: Date;
29
+ contractAddress: string;
30
+ sender: string;
31
+ addedAmount0: Decimal;
32
+ addedAmount1: Decimal;
33
+ addedLiquidity: Decimal;
34
+ share: Decimal;
35
+ currentAmount0: Decimal;
36
+ currentAmount1: Decimal;
37
+ poolTotalSupply: bigint;
38
+ token0Info: TokenInfo;
39
+ token1Info: TokenInfo;
40
+ };
41
+ export interface ApiCpmmPosition extends Omit<CpmmPosition, 'createdAt' | 'addedAmount0' | 'addedAmount1' | 'addedLiquidity' | 'share' | 'currentAmount0' | 'currentAmount1' | 'poolTotalSupply'> {
42
+ createdAt: string;
43
+ addedAmount0: string;
44
+ addedAmount1: string;
45
+ addedLiquidity: string;
46
+ share: string;
47
+ currentAmount0: string;
48
+ currentAmount1: string;
49
+ poolTotalSupply: string;
22
50
  }
23
51
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAC,SAAS,CAAA;IACpB,UAAU,EAAC,SAAS,CAAA;IACpB,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,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAA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AAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,6 @@
1
+ import type { ApiClmmPosition, CpmmPosition } from '../api/types';
2
+ import type { ClmmPositionRow, CpmmPositionRow } from '../database/types';
3
+ import type { ClmmPoolContractState, ClmmPositionInfo, CpmmPoolContractState } from '@h0ngcha0/typescript-sdk';
4
+ export declare function buildApiClmmPosition(row: ClmmPositionRow, poolState: ClmmPoolContractState, positionInfo: ClmmPositionInfo): ApiClmmPosition;
5
+ export declare function buildCpmmPosition(row: CpmmPositionRow, poolState: CpmmPoolContractState): CpmmPosition;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/api/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,eAAe,EACpB,SAAS,EAAE,qBAAqB,EAChC,YAAY,EAAE,gBAAgB,GAC7B,eAAe,CAyBjB;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,EACpB,SAAS,EAAE,qBAAqB,GAC/B,YAAY,CA6Bd"}