Skip to content

Commit aff9102

Browse files
authored
Merge pull request #155 from JJ-Cro/update17112025
feat(v3.0.11): add new API endpoints for trading configuration and delta neutral strategy
2 parents 6f2edb9 + 43198d4 commit aff9102

23 files changed

+6687
-6107
lines changed

docs/endpointFunctionList.md

Lines changed: 347 additions & 345 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { RestClient } = require('okx-api');
2+
3+
// This example shows how to call this OKX API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "okx-api" for OKX exchange
4+
// This OKX API SDK is available on npm via "npm install okx-api"
5+
// ENDPOINT: /api/v5/account/precheck-set-delta-neutral
6+
// METHOD: GET
7+
// PUBLIC: NO
8+
9+
const client = new RestClient({
10+
apiKey: 'apiKeyHere',
11+
apiSecret: 'apiSecretHere',
12+
apiPass: 'apiPassHere',
13+
});
14+
15+
client.precheckSetDeltaNeutral(params)
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { RestClient } = require('okx-api');
2+
3+
// This example shows how to call this OKX API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "okx-api" for OKX exchange
4+
// This OKX API SDK is available on npm via "npm install okx-api"
5+
// ENDPOINT: /api/v5/account/set-trading-config
6+
// METHOD: POST
7+
// PUBLIC: NO
8+
9+
const client = new RestClient({
10+
apiKey: 'apiKeyHere',
11+
apiSecret: 'apiSecretHere',
12+
apiPass: 'apiPassHere',
13+
});
14+
15+
client.setTradingConfig(params)
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});

examples/apidoc/WebsocketAPIClient/amendMultipleOrders.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const { WebsocketAPIClient } = require('okx-api');
44
// This OKX API SDK is available on npm via "npm install okx-api"
55
// WS API ENDPOINT: batch-amend-orders
66
// METHOD: WebSocket API
7-
// PUBLIC: 'NO'
7+
// PUBLIC: NO
88

99
// Create a WebSocket API client instance
1010
const client = new WebsocketAPIClient({
11-
apiKey: 'apiKeyHere',
12-
apiSecret: 'apiSecretHere',
13-
apiPass: 'apiPassHere',
11+
apiKey: 'apiKeyHere',
12+
apiSecret: 'apiSecretHere',
13+
apiPass: 'apiPassHere',
1414
});
1515

1616
// The WebSocket connection is established automatically when needed

examples/apidoc/WebsocketAPIClient/amendOrder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const { WebsocketAPIClient } = require('okx-api');
44
// This OKX API SDK is available on npm via "npm install okx-api"
55
// WS API ENDPOINT: amend-order
66
// METHOD: WebSocket API
7-
// PUBLIC: 'NO'
7+
// PUBLIC: NO
88

99
// Create a WebSocket API client instance
1010
const client = new WebsocketAPIClient({
11-
apiKey: 'apiKeyHere',
12-
apiSecret: 'apiSecretHere',
13-
apiPass: 'apiPassHere',
11+
apiKey: 'apiKeyHere',
12+
apiSecret: 'apiSecretHere',
13+
apiPass: 'apiPassHere',
1414
});
1515

1616
// The WebSocket connection is established automatically when needed

examples/apidoc/WebsocketAPIClient/amendSpreadOrder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const { WebsocketAPIClient } = require('okx-api');
44
// This OKX API SDK is available on npm via "npm install okx-api"
55
// WS API ENDPOINT: sprd-amend-order
66
// METHOD: WebSocket API
7-
// PUBLIC: 'NO'
7+
// PUBLIC: NO
88

99
// Create a WebSocket API client instance
1010
const client = new WebsocketAPIClient({
11-
apiKey: 'apiKeyHere',
12-
apiSecret: 'apiSecretHere',
13-
apiPass: 'apiPassHere',
11+
apiKey: 'apiKeyHere',
12+
apiSecret: 'apiSecretHere',
13+
apiPass: 'apiPassHere',
1414
});
1515

1616
// The WebSocket connection is established automatically when needed

examples/apidoc/WebsocketAPIClient/cancelMultipleOrders.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const { WebsocketAPIClient } = require('okx-api');
44
// This OKX API SDK is available on npm via "npm install okx-api"
55
// WS API ENDPOINT: batch-cancel-orders
66
// METHOD: WebSocket API
7-
// PUBLIC: 'NO'
7+
// PUBLIC: NO
88

99
// Create a WebSocket API client instance
1010
const client = new WebsocketAPIClient({
11-
apiKey: 'apiKeyHere',
12-
apiSecret: 'apiSecretHere',
13-
apiPass: 'apiPassHere',
11+
apiKey: 'apiKeyHere',
12+
apiSecret: 'apiSecretHere',
13+
apiPass: 'apiPassHere',
1414
});
1515

1616
// The WebSocket connection is established automatically when needed

examples/apidoc/WebsocketAPIClient/cancelOrder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const { WebsocketAPIClient } = require('okx-api');
44
// This OKX API SDK is available on npm via "npm install okx-api"
55
// WS API ENDPOINT: cancel-order
66
// METHOD: WebSocket API
7-
// PUBLIC: 'NO'
7+
// PUBLIC: NO
88

99
// Create a WebSocket API client instance
1010
const client = new WebsocketAPIClient({
11-
apiKey: 'apiKeyHere',
12-
apiSecret: 'apiSecretHere',
13-
apiPass: 'apiPassHere',
11+
apiKey: 'apiKeyHere',
12+
apiSecret: 'apiSecretHere',
13+
apiPass: 'apiPassHere',
1414
});
1515

1616
// The WebSocket connection is established automatically when needed

examples/apidoc/WebsocketAPIClient/cancelSpreadOrder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const { WebsocketAPIClient } = require('okx-api');
44
// This OKX API SDK is available on npm via "npm install okx-api"
55
// WS API ENDPOINT: sprd-cancel-order
66
// METHOD: WebSocket API
7-
// PUBLIC: 'NO'
7+
// PUBLIC: NO
88

99
// Create a WebSocket API client instance
1010
const client = new WebsocketAPIClient({
11-
apiKey: 'apiKeyHere',
12-
apiSecret: 'apiSecretHere',
13-
apiPass: 'apiPassHere',
11+
apiKey: 'apiKeyHere',
12+
apiSecret: 'apiSecretHere',
13+
apiPass: 'apiPassHere',
1414
});
1515

1616
// The WebSocket connection is established automatically when needed

examples/apidoc/WebsocketAPIClient/massCancelOrders.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const { WebsocketAPIClient } = require('okx-api');
44
// This OKX API SDK is available on npm via "npm install okx-api"
55
// WS API ENDPOINT: mass-cancel
66
// METHOD: WebSocket API
7-
// PUBLIC: 'NO'
7+
// PUBLIC: NO
88

99
// Create a WebSocket API client instance
1010
const client = new WebsocketAPIClient({
11-
apiKey: 'apiKeyHere',
12-
apiSecret: 'apiSecretHere',
13-
apiPass: 'apiPassHere',
11+
apiKey: 'apiKeyHere',
12+
apiSecret: 'apiSecretHere',
13+
apiPass: 'apiPassHere',
1414
});
1515

1616
// The WebSocket connection is established automatically when needed

0 commit comments

Comments
 (0)