zklighter-perps 1.0.286 → 1.0.287

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.
@@ -156,11 +156,80 @@ jobs:
156
156
  - run:
157
157
  name: Publish npm package
158
158
  command: |
159
+ VERSION=$(jq -r .version package.json)
160
+ if npm view "zklighter-perps@${VERSION}" version > /dev/null 2>&1; then
161
+ echo "zklighter-perps@${VERSION} is already published; skipping"
162
+ exit 0
163
+ fi
159
164
  git config --global user.email "hasan@lighter.xyz"
160
165
  git config --global user.name "CircleCI Hasan"
161
166
  npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
162
167
  npm publish
163
168
 
169
+ publish_prerelease:
170
+ docker:
171
+ - image: cimg/node:22.4.1
172
+
173
+ steps:
174
+ - checkout
175
+ - run:
176
+ name: Find open PR for branch
177
+ command: |
178
+ PR_NUMBER=$(curl -s -H "Authorization: Bearer ${GITHUB_TOKEN}" \
179
+ "https://api.github.com/repos/elliottech/zklighter-perps-ts/pulls?head=elliottech:${CIRCLE_BRANCH}&state=open" \
180
+ | jq -r '.[0].number // empty')
181
+ if [ -z "$PR_NUMBER" ]; then
182
+ echo "No open PR for branch ${CIRCLE_BRANCH}; skipping prerelease publish"
183
+ circleci-agent step halt
184
+ else
185
+ echo "Found PR #${PR_NUMBER}"
186
+ echo "export PR_NUMBER=${PR_NUMBER}" >> "$BASH_ENV"
187
+ fi
188
+ - run:
189
+ name: Generate prerelease version
190
+ command: |
191
+ CLEAN_BRANCH_NAME=$(echo "$CIRCLE_BRANCH" | sed 's/[^a-zA-Z0-9-]/-/g' | sed 's/--*/-/g' | sed 's/^-\|-$//g')
192
+ CLEAN_ACTOR=$(echo "${CIRCLE_USERNAME:-circleci}" | sed 's/[^a-zA-Z0-9-]/-/g' | sed 's/--*/-/g' | sed 's/^-\|-$//g')
193
+ COMMIT_SHA=$(echo "$CIRCLE_SHA1" | cut -c1-7)
194
+
195
+ # Semver-compatible version: 0.PR_NUMBER.0-ACTOR.COMMIT_SHA.BRANCH_NAME
196
+ # Always < 1.0.0 so it can never shadow a real release.
197
+ PRERELEASE_VERSION="0.${PR_NUMBER}.0-${CLEAN_ACTOR}.${COMMIT_SHA}.${CLEAN_BRANCH_NAME}"
198
+ echo "Prerelease version: $PRERELEASE_VERSION"
199
+
200
+ echo "export CLEAN_BRANCH_NAME=${CLEAN_BRANCH_NAME}" >> "$BASH_ENV"
201
+ echo "export PRERELEASE_VERSION=${PRERELEASE_VERSION}" >> "$BASH_ENV"
202
+ - run:
203
+ name: Remove binaries
204
+ command: |
205
+ rm -rf goctl-swagger-amd
206
+ rm -rf openapi-generator-cli.jar
207
+ - run:
208
+ name: Publish prerelease npm package
209
+ command: |
210
+ jq --arg v "$PRERELEASE_VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
211
+ npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
212
+ npm publish --tag "$CLEAN_BRANCH_NAME"
213
+ - run:
214
+ name: Comment on PR
215
+ command: |
216
+ COMMENT_BODY=$(jq -n --arg version "$PRERELEASE_VERSION" --arg tag "$CLEAN_BRANCH_NAME" \
217
+ '{body: ("## 🚀 Prerelease Published\n\n**Version:** `" + $version + "`\n**Tag:** `" + $tag + "`\n\n### Update package.json:\n```json\n\"zklighter-perps\": \"" + $version + "\"\n```")}')
218
+
219
+ EXISTING_COMMENT_ID=$(curl -s -H "Authorization: Bearer ${GITHUB_TOKEN}" \
220
+ "https://api.github.com/repos/elliottech/zklighter-perps-ts/issues/${PR_NUMBER}/comments?per_page=100" \
221
+ | jq -r '[.[] | select(.body | contains("🚀 Prerelease Published"))][0].id // empty')
222
+
223
+ if [ -n "$EXISTING_COMMENT_ID" ]; then
224
+ curl -s -X PATCH -H "Authorization: Bearer ${GITHUB_TOKEN}" \
225
+ -d "$COMMENT_BODY" \
226
+ "https://api.github.com/repos/elliottech/zklighter-perps-ts/issues/comments/${EXISTING_COMMENT_ID}" > /dev/null
227
+ else
228
+ curl -s -X POST -H "Authorization: Bearer ${GITHUB_TOKEN}" \
229
+ -d "$COMMENT_BODY" \
230
+ "https://api.github.com/repos/elliottech/zklighter-perps-ts/issues/${PR_NUMBER}/comments" > /dev/null
231
+ fi
232
+
164
233
  parameters:
165
234
  update_ts_sdk:
166
235
  default: false
@@ -205,4 +274,13 @@ workflows:
205
274
  only: main
206
275
  requires:
207
276
  - typecheck
277
+ # Publishes a PR prerelease (version 0.PR.0-actor.sha.branch, dist-tag =
278
+ # branch name) and posts/updates a PR comment with the version to use,
279
+ # mirroring the prerelease flow in zklighter-react-store.
280
+ - publish_prerelease:
281
+ filters:
282
+ branches:
283
+ ignore: main
284
+ requires:
285
+ - typecheck
208
286
 
@@ -9,7 +9,6 @@ apis/FundingApi.ts
9
9
  apis/GeckoApi.ts
10
10
  apis/GeoApi.ts
11
11
  apis/InfoApi.ts
12
- apis/LivepointsApi.ts
13
12
  apis/MarketnewsApi.ts
14
13
  apis/NotificationApi.ts
15
14
  apis/OrderApi.ts
@@ -93,7 +92,6 @@ models/LiqTrade.ts
93
92
  models/Liquidation.ts
94
93
  models/LiquidationInfo.ts
95
94
  models/LiquidationInfos.ts
96
- models/LivePointsTotal.ts
97
95
  models/MarkPriceCandle.ts
98
96
  models/MarkPriceCandles.ts
99
97
  models/MarketConfig.ts
@@ -170,7 +168,6 @@ models/ReqGetLatestDeposit.ts
170
168
  models/ReqGetLeaderboard.ts
171
169
  models/ReqGetLeases.ts
172
170
  models/ReqGetLiquidationInfos.ts
173
- models/ReqGetLivePointsTotal.ts
174
171
  models/ReqGetMakerOnlyApiKeys.ts
175
172
  models/ReqGetMarkPriceCandles.ts
176
173
  models/ReqGetMarketMetrics.ts
package/README.md CHANGED
@@ -29,7 +29,13 @@ The `update_npm_package` workflow runs on `main`:
29
29
  [`tsconfig.json`](tsconfig.json)). Runs on every branch, including the
30
30
  timestamped branches opened by `update_ts_sdk`, so a regenerated SDK that
31
31
  would fail to compile in a consumer (e.g. `perps-fe`) is caught on its PR.
32
- - **`update_npm_package`** — publishes to npm (requires `typecheck` to pass).
32
+ - **`update_npm_package`** — publishes to npm (requires `typecheck` to pass;
33
+ `main` only).
34
+ - **`publish_prerelease`** — on non-`main` branches with an open PR, publishes
35
+ a prerelease version (`0.<PR>.0-<actor>.<sha>.<branch>`, npm dist-tag =
36
+ branch name) and posts/updates a PR comment with the exact version to drop
37
+ into a consumer's `package.json`, mirroring the prerelease flow in
38
+ `zklighter-react-store`.
33
39
 
34
40
  ## OpenAPI post-processing
35
41
 
package/apis/index.ts CHANGED
@@ -11,7 +11,6 @@ export * from './FundingApi';
11
11
  export * from './GeckoApi';
12
12
  export * from './GeoApi';
13
13
  export * from './InfoApi';
14
- export * from './LivepointsApi';
15
14
  export * from './MarketnewsApi';
16
15
  export * from './NotificationApi';
17
16
  export * from './OrderApi';
@@ -68,6 +68,12 @@ export interface AccountMetadata {
68
68
  * @memberof AccountMetadata
69
69
  */
70
70
  can_rfq_market_ids: Array<string>;
71
+ /**
72
+ *
73
+ * @type {boolean}
74
+ * @memberof AccountMetadata
75
+ */
76
+ agent_enabled: boolean;
71
77
  /**
72
78
  *
73
79
  * @type {number}
@@ -93,6 +99,7 @@ export function instanceOfAccountMetadata(value: object): value is AccountMetada
93
99
  if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
94
100
  if (!('can_rfq' in value) || value['can_rfq'] === undefined) return false;
95
101
  if (!('can_rfq_market_ids' in value) || value['can_rfq_market_ids'] === undefined) return false;
102
+ if (!('agent_enabled' in value) || value['agent_enabled'] === undefined) return false;
96
103
  if (!('created_at' in value) || value['created_at'] === undefined) return false;
97
104
  if (!('metadata' in value) || value['metadata'] === undefined) return false;
98
105
  return true;
@@ -115,6 +122,7 @@ export function AccountMetadataFromJSONTyped(json: any, ignoreDiscriminator: boo
115
122
  'referral_points_percentage': json['referral_points_percentage'],
116
123
  'can_rfq': json['can_rfq'],
117
124
  'can_rfq_market_ids': json['can_rfq_market_ids'],
125
+ 'agent_enabled': json['agent_enabled'],
118
126
  'created_at': json['created_at'],
119
127
  'metadata': SubAccountMetadataFromJSON(json['metadata']),
120
128
  };
@@ -133,6 +141,7 @@ export function AccountMetadataToJSON(value?: AccountMetadata | null): any {
133
141
  'referral_points_percentage': value['referral_points_percentage'],
134
142
  'can_rfq': value['can_rfq'],
135
143
  'can_rfq_market_ids': value['can_rfq_market_ids'],
144
+ 'agent_enabled': value['agent_enabled'],
136
145
  'created_at': value['created_at'],
137
146
  'metadata': SubAccountMetadataToJSON(value['metadata']),
138
147
  };
@@ -188,6 +188,12 @@ export interface DetailedAccount {
188
188
  * @memberof DetailedAccount
189
189
  */
190
190
  can_rfq_market_ids: Array<string>;
191
+ /**
192
+ *
193
+ * @type {boolean}
194
+ * @memberof DetailedAccount
195
+ */
196
+ agent_enabled: boolean;
191
197
  /**
192
198
  *
193
199
  * @type {number}
@@ -285,6 +291,7 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
285
291
  if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
286
292
  if (!('can_rfq' in value) || value['can_rfq'] === undefined) return false;
287
293
  if (!('can_rfq_market_ids' in value) || value['can_rfq_market_ids'] === undefined) return false;
294
+ if (!('agent_enabled' in value) || value['agent_enabled'] === undefined) return false;
288
295
  if (!('created_at' in value) || value['created_at'] === undefined) return false;
289
296
  if (!('metadata' in value) || value['metadata'] === undefined) return false;
290
297
  if (!('positions' in value) || value['positions'] === undefined) return false;
@@ -329,6 +336,7 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
329
336
  'referral_points_percentage': json['referral_points_percentage'],
330
337
  'can_rfq': json['can_rfq'],
331
338
  'can_rfq_market_ids': json['can_rfq_market_ids'],
339
+ 'agent_enabled': json['agent_enabled'],
332
340
  'created_at': json['created_at'],
333
341
  'metadata': SubAccountMetadataFromJSON(json['metadata']),
334
342
  'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
@@ -371,6 +379,7 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
371
379
  'referral_points_percentage': value['referral_points_percentage'],
372
380
  'can_rfq': value['can_rfq'],
373
381
  'can_rfq_market_ids': value['can_rfq_market_ids'],
382
+ 'agent_enabled': value['agent_enabled'],
374
383
  'created_at': value['created_at'],
375
384
  'metadata': SubAccountMetadataToJSON(value['metadata']),
376
385
  'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
package/models/index.ts CHANGED
@@ -71,7 +71,6 @@ export * from './LiqTrade';
71
71
  export * from './Liquidation';
72
72
  export * from './LiquidationInfo';
73
73
  export * from './LiquidationInfos';
74
- export * from './LivePointsTotal';
75
74
  export * from './MarkPriceCandle';
76
75
  export * from './MarkPriceCandles';
77
76
  export * from './MarketConfig';
@@ -148,7 +147,6 @@ export * from './ReqGetLatestDeposit';
148
147
  export * from './ReqGetLeaderboard';
149
148
  export * from './ReqGetLeases';
150
149
  export * from './ReqGetLiquidationInfos';
151
- export * from './ReqGetLivePointsTotal';
152
150
  export * from './ReqGetMakerOnlyApiKeys';
153
151
  export * from './ReqGetMarkPriceCandles';
154
152
  export * from './ReqGetMarketMetrics';
package/openapi.json CHANGED
@@ -2696,56 +2696,6 @@
2696
2696
  "description": "Submit LIT lease transfer"
2697
2697
  }
2698
2698
  },
2699
- "/api/v1/livePoints/total": {
2700
- "get": {
2701
- "summary": "livePoints_total",
2702
- "operationId": "livePoints_total",
2703
- "responses": {
2704
- "200": {
2705
- "description": "A successful response.",
2706
- "schema": {
2707
- "$ref": "#/definitions/LivePointsTotal"
2708
- }
2709
- },
2710
- "400": {
2711
- "description": "Bad request",
2712
- "schema": {
2713
- "$ref": "#/definitions/ResultCode"
2714
- }
2715
- }
2716
- },
2717
- "parameters": [
2718
- {
2719
- "name": "authorization",
2720
- "description": " make required after integ is done",
2721
- "in": "query",
2722
- "required": false,
2723
- "type": "string"
2724
- },
2725
- {
2726
- "name": "auth",
2727
- "description": " made optional to support header auth clients",
2728
- "in": "query",
2729
- "required": false,
2730
- "type": "string"
2731
- },
2732
- {
2733
- "name": "account_index",
2734
- "in": "query",
2735
- "required": true,
2736
- "type": "integer",
2737
- "format": "int64"
2738
- }
2739
- ],
2740
- "tags": [
2741
- "livepoints"
2742
- ],
2743
- "consumes": [
2744
- "multipart/form-data"
2745
- ],
2746
- "description": "Get RH live points total for an account"
2747
- }
2748
- },
2749
2699
  "/api/v1/markPriceCandles": {
2750
2700
  "get": {
2751
2701
  "summary": "markPriceCandles",
@@ -5950,6 +5900,10 @@
5950
5900
  "type": "string"
5951
5901
  }
5952
5902
  },
5903
+ "agent_enabled": {
5904
+ "type": "boolean",
5905
+ "format": "boolean"
5906
+ },
5953
5907
  "created_at": {
5954
5908
  "type": "integer",
5955
5909
  "format": "int64"
@@ -5967,6 +5921,7 @@
5967
5921
  "referral_points_percentage",
5968
5922
  "can_rfq",
5969
5923
  "can_rfq_market_ids",
5924
+ "agent_enabled",
5970
5925
  "created_at",
5971
5926
  "metadata"
5972
5927
  ]
@@ -7548,6 +7503,10 @@
7548
7503
  "type": "string"
7549
7504
  }
7550
7505
  },
7506
+ "agent_enabled": {
7507
+ "type": "boolean",
7508
+ "format": "boolean"
7509
+ },
7551
7510
  "created_at": {
7552
7511
  "type": "integer",
7553
7512
  "format": "int64"
@@ -7626,6 +7585,7 @@
7626
7585
  "referral_points_percentage",
7627
7586
  "can_rfq",
7628
7587
  "can_rfq_market_ids",
7588
+ "agent_enabled",
7629
7589
  "created_at",
7630
7590
  "metadata",
7631
7591
  "positions",
@@ -8672,28 +8632,6 @@
8672
8632
  "liquidations"
8673
8633
  ]
8674
8634
  },
8675
- "LivePointsTotal": {
8676
- "type": "object",
8677
- "properties": {
8678
- "code": {
8679
- "type": "integer",
8680
- "format": "int32",
8681
- "example": "200"
8682
- },
8683
- "message": {
8684
- "type": "string"
8685
- },
8686
- "total_live_points": {
8687
- "type": "number",
8688
- "format": "double"
8689
- }
8690
- },
8691
- "title": "LivePointsTotal",
8692
- "required": [
8693
- "code",
8694
- "total_live_points"
8695
- ]
8696
- },
8697
8635
  "MarkPriceCandle": {
8698
8636
  "type": "object",
8699
8637
  "properties": {
@@ -12082,23 +12020,6 @@
12082
12020
  "limit"
12083
12021
  ]
12084
12022
  },
12085
- "ReqGetLivePointsTotal": {
12086
- "type": "object",
12087
- "properties": {
12088
- "auth": {
12089
- "type": "string",
12090
- "description": " made optional to support header auth clients"
12091
- },
12092
- "account_index": {
12093
- "type": "integer",
12094
- "format": "int64"
12095
- }
12096
- },
12097
- "title": "ReqGetLivePointsTotal",
12098
- "required": [
12099
- "account_index"
12100
- ]
12101
- },
12102
12023
  "ReqGetMakerOnlyApiKeys": {
12103
12024
  "type": "object",
12104
12025
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.286",
3
+ "version": "1.0.287",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {