@lifi/perps-sdk 31.1.0 → 31.1.1
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 +23 -0
- package/dist/cjs/services/getMeta.d.ts.map +1 -1
- package/dist/cjs/services/getMeta.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/services/getMeta.d.ts +5 -2
- package/dist/esm/services/getMeta.d.ts.map +1 -1
- package/dist/esm/services/getMeta.js +5 -2
- package/dist/esm/services/getMeta.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/services/getMeta.d.ts +5 -2
- package/dist/types/services/getMeta.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/services/getMeta.ts +5 -2
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -88,6 +88,29 @@ so either disables registry-level reuse and request coalescing. Such hooks still
|
|
|
88
88
|
run on every `sync()`. This cache applies only to reference registries, not account,
|
|
89
89
|
price, or authenticated trading responses.
|
|
90
90
|
|
|
91
|
+
## Platform notices
|
|
92
|
+
|
|
93
|
+
`getMeta(client)` returns the API `version` and the `notices` that the backend
|
|
94
|
+
serves. The scope of a `Notice` comes from `providerKeys`:
|
|
95
|
+
|
|
96
|
+
- A notice without `providerKeys` is global. It applies to all users.
|
|
97
|
+
- A notice with `providerKeys` applies only to the listed providers. An
|
|
98
|
+
imported provider notice always lists one or more providers.
|
|
99
|
+
|
|
100
|
+
All `Notice` times are Unix epoch milliseconds. The visibility interval is
|
|
101
|
+
`[validFrom, validTo)`: it includes `validFrom` and excludes `validTo`. An
|
|
102
|
+
absent bound has no limit. The visibility bounds do not describe a maintenance
|
|
103
|
+
window. `startsAt`, `endsAt`, and `resolvedAt` describe the event. An absent
|
|
104
|
+
`endsAt` means that the end is not known, and a scheduled `endsAt` does not
|
|
105
|
+
prove recovery.
|
|
106
|
+
|
|
107
|
+
`id` identifies a notice across polls. `revision` is an opaque value that
|
|
108
|
+
changes when the user-facing content changes. `lastCheckedAt` is the last
|
|
109
|
+
successful observation of the source, not the last poll attempt.
|
|
110
|
+
|
|
111
|
+
The SDK returns the notices as the backend serves them. It does not filter
|
|
112
|
+
them by visibility, scope, or acknowledgement. The caller does that work.
|
|
113
|
+
|
|
91
114
|
## High-level client
|
|
92
115
|
|
|
93
116
|
`PerpsClient` owns the end-to-end action pipeline. Its trade wrappers include
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAmB1D,wBAAsB,OAAO,CAC3B,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMeta.js","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getMeta.js","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":";;AAsBA,0BAUC;AA/BD,wDAAiD;AAqB1C,KAAK,UAAU,OAAO,CAC3B,MAAsB,EACtB,OAA2B;IAE3B,OAAO,IAAA,oBAAO,EACZ,MAAM,CAAC,MAAM,EACb,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,EAC9B,EAAE,EACF,OAAO,CACR,CAAA;AACH,CAAC"}
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -2,9 +2,12 @@ import type { Meta } from '@lifi/perps-types';
|
|
|
2
2
|
import type { SDKRequestOptions } from '../types/config.js';
|
|
3
3
|
import type { PerpsSDKClient } from '../types/provider.js';
|
|
4
4
|
/**
|
|
5
|
-
* Get platform metadata: the API version and
|
|
5
|
+
* Get platform metadata: the API version and the notices the backend serves.
|
|
6
|
+
* A notice without `providerKeys` is global; a notice with `providerKeys` is
|
|
7
|
+
* scoped to those providers. The SDK returns notices as served and does not
|
|
8
|
+
* filter them by `validFrom` / `validTo`.
|
|
6
9
|
*
|
|
7
|
-
* @returns Platform version and the
|
|
10
|
+
* @returns Platform version and the global and provider-scoped notices
|
|
8
11
|
* @throws {PerpsError} On API error responses
|
|
9
12
|
* @throws {PerpsError} On network or parsing errors
|
|
10
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D
|
|
1
|
+
{"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,OAAO,CAC3B,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { request } from '../transport/request.js';
|
|
2
2
|
/**
|
|
3
|
-
* Get platform metadata: the API version and
|
|
3
|
+
* Get platform metadata: the API version and the notices the backend serves.
|
|
4
|
+
* A notice without `providerKeys` is global; a notice with `providerKeys` is
|
|
5
|
+
* scoped to those providers. The SDK returns notices as served and does not
|
|
6
|
+
* filter them by `validFrom` / `validTo`.
|
|
4
7
|
*
|
|
5
|
-
* @returns Platform version and the
|
|
8
|
+
* @returns Platform version and the global and provider-scoped notices
|
|
6
9
|
* @throws {PerpsError} On API error responses
|
|
7
10
|
* @throws {PerpsError} On network or parsing errors
|
|
8
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMeta.js","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAIjD
|
|
1
|
+
{"version":3,"file":"getMeta.js","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAIjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,MAAsB,EACtB,OAA2B;IAE3B,OAAO,OAAO,CACZ,MAAM,CAAC,MAAM,EACb,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,EAC9B,EAAE,EACF,OAAO,CACR,CAAA;AACH,CAAC"}
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED
|
@@ -2,9 +2,12 @@ import type { Meta } from '@lifi/perps-types';
|
|
|
2
2
|
import type { SDKRequestOptions } from '../types/config.js';
|
|
3
3
|
import type { PerpsSDKClient } from '../types/provider.js';
|
|
4
4
|
/**
|
|
5
|
-
* Get platform metadata: the API version and
|
|
5
|
+
* Get platform metadata: the API version and the notices the backend serves.
|
|
6
|
+
* A notice without `providerKeys` is global; a notice with `providerKeys` is
|
|
7
|
+
* scoped to those providers. The SDK returns notices as served and does not
|
|
8
|
+
* filter them by `validFrom` / `validTo`.
|
|
6
9
|
*
|
|
7
|
-
* @returns Platform version and the
|
|
10
|
+
* @returns Platform version and the global and provider-scoped notices
|
|
8
11
|
* @throws {PerpsError} On API error responses
|
|
9
12
|
* @throws {PerpsError} On network or parsing errors
|
|
10
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D
|
|
1
|
+
{"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../src/services/getMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,OAAO,CAC3B,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
package/dist/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/perps-sdk",
|
|
3
|
-
"version": "31.1.
|
|
3
|
+
"version": "31.1.1",
|
|
4
4
|
"description": "LI.FI Perps SDK for perpetuals trading",
|
|
5
5
|
"homepage": "https://github.com/lifinance/perps-sdk",
|
|
6
6
|
"bugs": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@lifi/types": "^18.3.0",
|
|
46
46
|
"big.js": "^7.0.1",
|
|
47
47
|
"partysocket": "^1.1.19",
|
|
48
|
-
"@lifi/perps-types": "^27.
|
|
48
|
+
"@lifi/perps-types": "^27.2.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"viem": ">=2.57.11 <2.57.12"
|
package/src/services/getMeta.ts
CHANGED
|
@@ -4,9 +4,12 @@ import type { SDKRequestOptions } from '../types/config.js'
|
|
|
4
4
|
import type { PerpsSDKClient } from '../types/provider.js'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Get platform metadata: the API version and
|
|
7
|
+
* Get platform metadata: the API version and the notices the backend serves.
|
|
8
|
+
* A notice without `providerKeys` is global; a notice with `providerKeys` is
|
|
9
|
+
* scoped to those providers. The SDK returns notices as served and does not
|
|
10
|
+
* filter them by `validFrom` / `validTo`.
|
|
8
11
|
*
|
|
9
|
-
* @returns Platform version and the
|
|
12
|
+
* @returns Platform version and the global and provider-scoped notices
|
|
10
13
|
* @throws {PerpsError} On API error responses
|
|
11
14
|
* @throws {PerpsError} On network or parsing errors
|
|
12
15
|
*
|
package/src/version.ts
CHANGED