Skip to content

Commit f66f94e

Browse files
committed
feat(v3.1.6): add move positions functionality and update event contract endpoints
- Introduced new methods in RestClient for moving positions between accounts and retrieving move positions history. - Updated event contract methods to be publicly accessible without authentication. - Added new request and response types for move positions functionality. - Enhanced documentation and examples to reflect the new API capabilities.
1 parent 55a0508 commit f66f94e

18 files changed

Lines changed: 3185 additions & 2807 deletions

docs/endpointFunctionList.md

Lines changed: 376 additions & 374 deletions
Large diffs are not rendered by default.

examples/apidoc/RestClient/getEventContractEvents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RestClient } from 'okx-api';
66
// This OKX API SDK is available on npm via "npm install okx-api"
77
// ENDPOINT: /api/v5/public/event-contract/events
88
// METHOD: GET
9-
// PUBLIC: NO
9+
// PUBLIC: YES
1010

1111
const client = new RestClient({
1212
apiKey: 'apiKeyHere',

examples/apidoc/RestClient/getEventContractMarkets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RestClient } from 'okx-api';
66
// This OKX API SDK is available on npm via "npm install okx-api"
77
// ENDPOINT: /api/v5/public/event-contract/markets
88
// METHOD: GET
9-
// PUBLIC: NO
9+
// PUBLIC: YES
1010

1111
const client = new RestClient({
1212
apiKey: 'apiKeyHere',

examples/apidoc/RestClient/getEventContractSeries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RestClient } from 'okx-api';
66
// This OKX API SDK is available on npm via "npm install okx-api"
77
// ENDPOINT: /api/v5/public/event-contract/series
88
// METHOD: GET
9-
// PUBLIC: NO
9+
// PUBLIC: YES
1010

1111
const client = new RestClient({
1212
apiKey: 'apiKeyHere',
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { RestClient } from 'okx-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('okx-api');
4+
5+
// 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
6+
// This OKX API SDK is available on npm via "npm install okx-api"
7+
// ENDPOINT: /api/v5/account/move-positions-history
8+
// METHOD: GET
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'apiKeyHere',
13+
apiSecret: 'apiSecretHere',
14+
apiPass: 'apiPassHere',
15+
});
16+
17+
client.getMovePositionsHistory(params)
18+
.then((response) => {
19+
console.log(response);
20+
})
21+
.catch((error) => {
22+
console.error(error);
23+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { RestClient } from 'okx-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('okx-api');
4+
5+
// 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
6+
// This OKX API SDK is available on npm via "npm install okx-api"
7+
// ENDPOINT: /api/v5/account/move-positions
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'apiKeyHere',
13+
apiSecret: 'apiSecretHere',
14+
apiPass: 'apiPassHere',
15+
});
16+
17+
client.movePositions(params)
18+
.then((response) => {
19+
console.log(response);
20+
})
21+
.catch((error) => {
22+
console.error(error);
23+
});

0 commit comments

Comments
 (0)