Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.0.0: WebSocket API, WebsocketClient upgrades, decommission deprecated v1-v3 API groups #398

Draft
wants to merge 54 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b897826
chore(): bump build version to LTS
Nov 27, 2024
d508655
chore(): refactor ws events into organised dir
Dec 18, 2024
b613fd9
feat(): upgrade WsStore to latest iteration
Dec 18, 2024
8a7c8ea
feat(): upgrade WebSocket layer to extend BaseWS abstraction. feat():…
Jan 16, 2025
3931c5e
Merge branch 'master' into wsapi
tiagosiebler Jan 16, 2025
56e945f
feat(): include flag for parsed WS API responses
Jan 16, 2025
10b2af1
fix(): wsapi response mapping
Jan 17, 2025
d0eba98
feat(): improve wiring on promise-subscribe workflows, fixes #399 (wi…
Jan 20, 2025
fcffd85
feat(): improve e2e WS API workflow
Jan 21, 2025
39ce4c4
chore(): misc cleaning
Jan 21, 2025
50bae8b
chore(): bump typescript and types/node versions
Jan 21, 2025
13cc5dd
chore(): tidier types for pending subs, bump axios to latest
Jan 21, 2025
13cd799
feat(): use web crypto API by default for sign, expose param to injec…
Jan 21, 2025
98d2331
feat(): add example for REST-like WS API usage for Bybit in Node.js/J…
Jan 22, 2025
82611aa
feat(): add event-driven example for WS API commands
Jan 22, 2025
cd37a1b
chore(): update event-driven ws api example
Jan 22, 2025
d8bd68e
chore(): update readme with WS API examples
Jan 23, 2025
e786391
chore(): improve readme
Jan 23, 2025
d6cd453
chore(): update readme
Jan 23, 2025
1327f1c
chore(): rearrange sections
Jan 23, 2025
44839f6
chore(): readme update
Jan 23, 2025
df35725
chore(): update readme
Jan 23, 2025
9524c99
chore(): readme updates
Jan 23, 2025
592ab00
chore(): readme updates
Jan 23, 2025
76b3130
chore(): readme tweaks
Jan 23, 2025
7ebad90
chore(): update readme
Jan 23, 2025
9c12727
chore(): add table of contents
Jan 23, 2025
ee23e13
chore(): ws client tidying and misc improvements
Jan 24, 2025
e4957b0
chore(): remove decommissioned REST and WS clients
Jan 24, 2025
03169b3
chore(): deprecate pre-V5 authentication workflows
Jan 24, 2025
a4945d1
chore(): updates for pre-V5 deprecations
Jan 24, 2025
0d20822
chore(): update default logger examples
Jan 24, 2025
86fc739
feat(v4.0.0-beta.0): bump version to public beta. WS API integration.…
Jan 24, 2025
8a69214
fix(4.0.0-beta.1): fix backwards compatibility with req_id usage for …
Jan 24, 2025
1d358e0
fix(v4.0.0-beta.2): separator for req_id topic list
Jan 24, 2025
753100c
Merge branch 'master' into wsapi
tiagosiebler Jan 25, 2025
be81aa1
Merge branch 'master' into wsapi (#409)
Jan 25, 2025
d051142
chore(): misc cleaning & note around exception emitter, fix(#411): on…
Feb 1, 2025
a8f8d6b
fix(v4.0.0-beta.4): demo trading wss should only be used for private …
Feb 6, 2025
57b1a72
feat(v4.0.0-beta.5): BREAKING CHANGE: rename "error" event to "except…
Feb 6, 2025
2f18ede
chore(): add logger injection to example
Feb 6, 2025
6d69380
Merge branch 'master' into wsapi
tiagosiebler Feb 17, 2025
9120932
feat(): optional promisified subscribe requests
Feb 17, 2025
0952e5f
feat(v4.0.0-beta.6): sync with master. Promisified subscribe requests…
Feb 17, 2025
a521338
feat(): updated types for Market and Trade categories
JJ-Cro Feb 17, 2025
d2f3e25
feat(): pushed all account types
JJ-Cro Feb 17, 2025
50a01d1
feat(): finished asset category types
JJ-Cro Feb 17, 2025
2ba75d6
feat(): updated all remaining categories for response and request types
JJ-Cro Feb 17, 2025
b8007f7
Merge branch 'wsapi' into wsapi
tiagosiebler Feb 17, 2025
91eedd0
Merge pull request #419 from JJ-Cro/wsapi
tiagosiebler Feb 17, 2025
9cbb1da
feat(v4.0.0-beta.7, #419): add/update REST types matching latest chan…
Feb 17, 2025
3557567
chore(): update examples for exception event
Feb 18, 2025
3ff9030
feat(): added new rest EARN endpoints
JJ-Cro Feb 20, 2025
568d451
Merge pull request #420 from JJ-Cro/updateRestEarn
tiagosiebler Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.11.0
v22.11.0
483 changes: 303 additions & 180 deletions README.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions examples/apidoc/V5/Earn/get-product-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');

const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});

client
.getEarnProduct({
category: 'FlexibleSaving',
coin: 'BTC',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
19 changes: 19 additions & 0 deletions examples/apidoc/V5/Earn/get-stake-redeem-order-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');

const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});

client
.getEarnOrderHistory({
category: 'FlexibleSaving',
orderId: '0572b030-6a0b-423f-88c4-b6ce31c0c82d',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
19 changes: 19 additions & 0 deletions examples/apidoc/V5/Earn/get-staked-position.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');

const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});

client
.getEarnPosition({
category: 'FlexibleSaving',
coin: 'USDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
24 changes: 24 additions & 0 deletions examples/apidoc/V5/Earn/stake-redeem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { RestClientV5 } = require('bybit-api');

const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});

client
.submitStakeRedeem({
category: 'FlexibleSaving',
orderType: 'Stake',
accountType: 'FUND',
amount: '0.35',
coin: 'BTC',
productId: '430',
orderLinkId: 'btc-earn-001',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
6 changes: 3 additions & 3 deletions examples/demo-trading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ const restClient = new RestClientV5({
// Optional, uncomment the "silly" override to log a lot more info about what the WS client is doing
const customLogger = {
...DefaultLogger,
// silly: (...params) => console.log('trace', ...params),
// trace: (...params) => console.log('trace', ...params),
};

const wsClient = new WebsocketClient(
{
key: key,
secret: secret,
market: 'v5',

/**
* Set this to true to enable demo trading for the private account data WS
* Topics: order,execution,position,wallet,greeks
Expand Down Expand Up @@ -91,7 +91,7 @@ function setWsClientEventListeners(
websocketClient.on('reconnected', (data) => {
console.log(new Date(), accountRef, 'ws has reconnected ', data?.wsKey);
});
websocketClient.on('error', (data) => {
websocketClient.on('exception', (data) => {
console.error(new Date(), accountRef, 'ws exception: ', data);
});
});
Expand Down
24 changes: 0 additions & 24 deletions examples/deprecated/rest-contract-private.ts

This file was deleted.

21 changes: 0 additions & 21 deletions examples/deprecated/rest-contract-public.js

This file was deleted.

20 changes: 0 additions & 20 deletions examples/deprecated/rest-contract-public.ts

This file was deleted.

25 changes: 0 additions & 25 deletions examples/deprecated/rest-copy-private.ts

This file was deleted.

23 changes: 0 additions & 23 deletions examples/deprecated/rest-linear-public.ts

This file was deleted.

33 changes: 0 additions & 33 deletions examples/deprecated/rest-raw-v3sign.ts

This file was deleted.

18 changes: 0 additions & 18 deletions examples/deprecated/rest-spot-public.ts

This file was deleted.

42 changes: 0 additions & 42 deletions examples/deprecated/rest-spot-tpsl.ts

This file was deleted.

44 changes: 0 additions & 44 deletions examples/deprecated/rest-unified-margin-private-cursor.ts

This file was deleted.

Loading