From c518a85524c24900f2a5241e7b48e0a0e9f14385 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 30 Jun 2022 16:27:34 +0100 Subject: [PATCH 1/2] readme updates --- .circleci/config.yml | 2 +- .github/workflows/npmpublish.yml | 4 ++-- README.md | 11 +++++++++++ package.json | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68c8584..b0a8e2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: - node-deps-v1-{{ .Branch }}-{{checksum "package-lock.json"}} - run: name: install packages - command: npm ci + command: npm ci --ignore-scripts - save_cache: key: node-deps-v1-{{ .Branch }}-{{checksum "package-lock.json"}} paths: diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index b0b36fc..4bf5267 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -40,13 +40,13 @@ jobs: node-version: 12 registry-url: https://registry.npmjs.org/ - - run: npm ci + - run: npm ci --ignore-scripts if: steps.version-updated.outputs.has-updated - run: npm run clean if: steps.version-updated.outputs.has-updated - run: npm run build if: steps.version-updated.outputs.has-updated - - run: npm publish + - run: npm publish --ignore-scripts if: steps.version-updated.outputs.has-updated env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/README.md b/README.md index 7866115..82c1eca 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,17 @@ Node.js connector for the Bybit APIs and WebSockets, with TypeScript & browser s - Issues? Check the [issues tab](https://github.com/tiagosiebler/bybit-api/issues). - Discuss & collaborate with other node devs? Join our [Node.js Algo Traders](https://t.me/nodetraders) engineering community on telegram. +## Related projects +Check out my related projects: +- Try my connectors: + - [ftx-api](https://www.npmjs.com/package/ftx-api) + - [bybit-api](https://www.npmjs.com/package/bybit-api) + - [binance](https://www.npmjs.com/package/binance) +- Try my misc utilities: + - [orderbooks](https://www.npmjs.com/package/orderbooks) +- Check out my examples: + - [awesome-crypto-examples](https://github.com/tiagosiebler/awesome-crypto-examples) + ## Documentation Most methods accept JS objects. These can be populated using parameters specified by Bybit's API documentation. - [Bybit API Inverse Documentation](https://bybit-exchange.github.io/docs/inverse/#t-introduction). diff --git a/package.json b/package.json index 04da11b..f50c778 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "2.2.1", + "version": "2.2.2", "description": "Node.js connector for Bybit's REST APIs and WebSockets, with TypeScript & integration tests.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -11,7 +11,7 @@ "scripts": { "test": "jest", "test:watch": "jest --watch", - "clean": "rm -rf lib dist", + "clean": "rimraf lib dist", "build": "tsc", "build:clean": "npm run clean && npm run build", "build:watch": "npm run clean && tsc --watch", From dac46b64fb4a54ad895c09c8d45224bdfe5df056 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 30 Jun 2022 16:32:56 +0100 Subject: [PATCH 2/2] fix(#155): remove abandoned endpoints --- src/inverse-client.ts | 15 --------------- src/inverse-futures-client.ts | 18 ------------------ test/inverse-futures/private.read.test.ts | 6 ------ test/inverse-futures/private.write.test.ts | 12 ------------ test/inverse/private.read.test.ts | 6 ------ test/inverse/private.write.test.ts | 12 ------------ 6 files changed, 69 deletions(-) diff --git a/src/inverse-client.ts b/src/inverse-client.ts index 9c8064b..b597c68 100644 --- a/src/inverse-client.ts +++ b/src/inverse-client.ts @@ -393,21 +393,6 @@ export class InverseClient extends BaseRestClient { return this.postPrivate('v2/private/position/switch-isolated', params); } - /** - * Risk Limit - */ - - getRiskLimitList(): Promise> { - return this.getPrivate('open-api/wallet/risk-limit/list'); - } - - setRiskLimit(params: { - symbol: string; - risk_id: string; - }): Promise> { - return this.postPrivate('open-api/wallet/risk-limit', params); - } - /** * Funding */ diff --git a/src/inverse-futures-client.ts b/src/inverse-futures-client.ts index afe16ef..9892dc7 100644 --- a/src/inverse-futures-client.ts +++ b/src/inverse-futures-client.ts @@ -401,24 +401,6 @@ export class InverseFuturesClient extends BaseRestClient { return this.getPrivate('futures/private/trade/closed-pnl/list', params); } - /** - **** The following are all the same as the inverse client **** - */ - - /** - * Risk Limit - */ - getRiskLimitList(): Promise> { - return this.getPrivate('open-api/wallet/risk-limit/list'); - } - - setRiskLimit(params: { - symbol: string; - risk_id: string; - }): Promise> { - return this.postPrivate('open-api/wallet/risk-limit', params); - } - /** * Funding */ diff --git a/test/inverse-futures/private.read.test.ts b/test/inverse-futures/private.read.test.ts index af52130..8fd5ec8 100644 --- a/test/inverse-futures/private.read.test.ts +++ b/test/inverse-futures/private.read.test.ts @@ -79,12 +79,6 @@ describe('Public Inverse-Futures REST API GET Endpoints', () => { ); }); - it('getRiskLimitList()', async () => { - expect(await api.getRiskLimitList()).toMatchObject( - successResponseList('ok') - ); - }); - it('getMyLastFundingFee()', async () => { expect(await api.getMyLastFundingFee({ symbol: symbol })).toMatchObject( successResponseObject() diff --git a/test/inverse-futures/private.write.test.ts b/test/inverse-futures/private.write.test.ts index a2b6965..bea07a6 100644 --- a/test/inverse-futures/private.write.test.ts +++ b/test/inverse-futures/private.write.test.ts @@ -183,16 +183,4 @@ describe('Private Inverse-Futures REST API POST Endpoints', () => { ret_msg: 'Isolated not modified', }); }); - - it('setRiskLimit()', async () => { - expect( - await api.setRiskLimit({ - symbol, - risk_id: 'myriskid', - }) - ).toMatchObject({ - ret_code: -1, - ret_msg: `Currently not support symbol[${symbol}]`, - }); - }); }); diff --git a/test/inverse/private.read.test.ts b/test/inverse/private.read.test.ts index 12301c1..42b4271 100644 --- a/test/inverse/private.read.test.ts +++ b/test/inverse/private.read.test.ts @@ -77,12 +77,6 @@ describe('Private Inverse REST API Endpoints', () => { ); }); - it('getRiskLimitList()', async () => { - expect(await api.getRiskLimitList()).toMatchObject( - successResponseList('ok') - ); - }); - it('getClosedPnl()', async () => { expect(await api.getClosedPnl({ symbol: symbol })).toMatchObject( successResponseObject() diff --git a/test/inverse/private.write.test.ts b/test/inverse/private.write.test.ts index 2153c33..7da7662 100644 --- a/test/inverse/private.write.test.ts +++ b/test/inverse/private.write.test.ts @@ -178,16 +178,4 @@ describe('Private Inverse REST API Endpoints', () => { }) ).toMatchObject(successResponseObject()); }); - - it('setRiskLimit()', async () => { - expect( - await api.setRiskLimit({ - symbol, - risk_id: 'myriskid', - }) - ).toMatchObject({ - ret_code: API_ERROR_CODE.RISK_LIMIT_NOT_EXISTS, - ret_msg: 'risk limit not exists', - }); - }); });