@lifi/perps-sdk-provider-lighter 11.1.0 → 12.0.0

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.
@@ -1,2 +1,3 @@
1
- export declare const mapInterval: (interval: string) => string;
1
+ import type { OhlcvInterval } from '@lifi/perps-types';
2
+ export declare const mapInterval: (interval: OhlcvInterval) => string;
2
3
  //# sourceMappingURL=ohlcvInterval.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MAU9C,CAAA"}
1
+ {"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AA4BtD,eAAO,MAAM,WAAW,GAAI,UAAU,aAAa,KAAG,MAUrD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ohlcvInterval.js","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,mDAAkD;AASlD,MAAM,2BAA2B,GAA2B;IAC1D,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACX,CAAA;AAQM,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE;IACtD,MAAM,UAAU,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAA;IACxD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,sBAAU,CAClB,4BAAc,CAAC,eAAe,EAC9B,4CAA4C,QAAQ,KAAK;YACvD,cAAc,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvE,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAVY,QAAA,WAAW,eAUvB"}
1
+ {"version":3,"file":"ohlcvInterval.js","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAE5C,mDAAkD;AASlD,MAAM,2BAA2B,GAA2C;IAC1E,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACX,CAAA;AAQM,MAAM,WAAW,GAAG,CAAC,QAAuB,EAAU,EAAE;IAC7D,MAAM,UAAU,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAA;IACxD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,sBAAU,CAClB,4BAAc,CAAC,eAAe,EAC9B,4CAA4C,QAAQ,KAAK;YACvD,cAAc,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvE,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAVY,QAAA,WAAW,eAUvB"}
@@ -1,8 +1,9 @@
1
+ import type { OhlcvInterval } from '@lifi/perps-types';
1
2
  /**
2
3
  * Validate and map an SDK OHLCV interval to Lighter's resolution string.
3
4
  * Unsupported intervals raise a validation error instead of being rounded.
4
5
  *
5
6
  * @public
6
7
  */
7
- export declare const mapInterval: (interval: string) => string;
8
+ export declare const mapInterval: (interval: OhlcvInterval) => string;
8
9
  //# sourceMappingURL=ohlcvInterval.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MAU9C,CAAA"}
1
+ {"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAsBtD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,aAAa,KAAG,MAUrD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ohlcvInterval.js","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;;;GAMG;AACH,MAAM,2BAA2B,GAA2B;IAC1D,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACX,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE;IACtD,MAAM,UAAU,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAA;IACxD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAClB,cAAc,CAAC,eAAe,EAC9B,4CAA4C,QAAQ,KAAK;YACvD,cAAc,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvE,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
1
+ {"version":3,"file":"ohlcvInterval.js","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;;;GAMG;AACH,MAAM,2BAA2B,GAA2C;IAC1E,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACX,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAuB,EAAU,EAAE;IAC7D,MAAM,UAAU,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAA;IACxD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,UAAU,CAClB,cAAc,CAAC,eAAe,EAC9B,4CAA4C,QAAQ,KAAK;YACvD,cAAc,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvE,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
@@ -1,8 +1,9 @@
1
+ import type { OhlcvInterval } from '@lifi/perps-types';
1
2
  /**
2
3
  * Validate and map an SDK OHLCV interval to Lighter's resolution string.
3
4
  * Unsupported intervals raise a validation error instead of being rounded.
4
5
  *
5
6
  * @public
6
7
  */
7
- export declare const mapInterval: (interval: string) => string;
8
+ export declare const mapInterval: (interval: OhlcvInterval) => string;
8
9
  //# sourceMappingURL=ohlcvInterval.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MAU9C,CAAA"}
1
+ {"version":3,"file":"ohlcvInterval.d.ts","sourceRoot":"","sources":["../../../src/utils/ohlcvInterval.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAsBtD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,aAAa,KAAG,MAUrD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/perps-sdk-provider-lighter",
3
- "version": "11.1.0",
3
+ "version": "12.0.0",
4
4
  "description": "Lighter provider plugin for @lifi/perps-sdk",
5
5
  "homepage": "https://github.com/lifinance/perps-sdk",
6
6
  "bugs": {
@@ -44,10 +44,10 @@
44
44
  "dependencies": {
45
45
  "big.js": "^7.0.1",
46
46
  "viem": "^2.48.8",
47
- "@lifi/perps-types": "^5.3.0"
47
+ "@lifi/perps-types": "^6.0.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@lifi/perps-sdk": "^6.5.0"
50
+ "@lifi/perps-sdk": "^6.5.1"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public"
@@ -1,4 +1,5 @@
1
1
  import { PerpsError } from '@lifi/perps-sdk'
2
+ import type { OhlcvInterval } from '@lifi/perps-types'
2
3
  import { PerpsErrorCode } from '@lifi/perps-types'
3
4
 
4
5
  /**
@@ -8,7 +9,7 @@ import { PerpsErrorCode } from '@lifi/perps-types'
8
9
  * direct match (3m, 2h, 8h, 3d, 1M) raise a validation error rather than
9
10
  * silently rounding — the caller picks a supported timeframe.
10
11
  */
11
- const LIGHTER_SUPPORTED_INTERVALS: Record<string, string> = {
12
+ const LIGHTER_SUPPORTED_INTERVALS: Partial<Record<OhlcvInterval, string>> = {
12
13
  '1m': '1m',
13
14
  '5m': '5m',
14
15
  '15m': '15m',
@@ -26,7 +27,7 @@ const LIGHTER_SUPPORTED_INTERVALS: Record<string, string> = {
26
27
  *
27
28
  * @public
28
29
  */
29
- export const mapInterval = (interval: string): string => {
30
+ export const mapInterval = (interval: OhlcvInterval): string => {
30
31
  const resolution = LIGHTER_SUPPORTED_INTERVALS[interval]
31
32
  if (!resolution) {
32
33
  throw new PerpsError(