Skip to content

Commit ffe904e

Browse files
committed
feat(v3.1.4): add dual investment API support and update examples
- Introduced new dual investment request and response types. - Added new endpoints for dual investment operations in the RestClient. - Updated existing files to include dual investment functionality. - Incremented version to 3.1.4 in package.json and package-lock.json. - Added examples for dual investment API usage.
1 parent 384b834 commit ffe904e

35 files changed

Lines changed: 9347 additions & 7626 deletions

docs/endpointFunctionList.md

Lines changed: 361 additions & 349 deletions
Large diffs are not rendered by default.

examples/apidoc/RestClient/getMaxBuySellAmount.js renamed to examples/apidoc/RestClient/getAccountBillSubtypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { RestClient } = require('okx-api');
22

33
// 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
44
// This OKX API SDK is available on npm via "npm install okx-api"
5-
// ENDPOINT: /api/v5/account/max-size
5+
// ENDPOINT: /api/v5/account/subtypes
66
// METHOD: GET
77
// PUBLIC: NO
88

@@ -12,7 +12,7 @@ const client = new RestClient({
1212
apiPass: 'apiPassHere',
1313
});
1414

15-
client.getMaxBuySellAmount(params)
15+
client.getAccountBillSubtypes(params)
1616
.then((response) => {
1717
console.log(response);
1818
})

examples/apidoc/RestClient/getConvertCurrencyPair.js renamed to examples/apidoc/RestClient/getDcdCurrencyPairs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { RestClient } = require('okx-api');
22

33
// 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
44
// This OKX API SDK is available on npm via "npm install okx-api"
5-
// ENDPOINT: /api/v5/asset/convert/currency-pair
5+
// ENDPOINT: /api/v5/finance/sfp/dcd/currency-pair
66
// METHOD: GET
77
// PUBLIC: NO
88

@@ -12,7 +12,7 @@ const client = new RestClient({
1212
apiPass: 'apiPassHere',
1313
});
1414

15-
client.getConvertCurrencyPair(params)
15+
client.getDcdCurrencyPairs(params)
1616
.then((response) => {
1717
console.log(response);
1818
})
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/finance/sfp/dcd/order-history
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.getDcdOrderHistory(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/finance/sfp/dcd/order-status
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.getDcdOrderStatus(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/finance/sfp/dcd/products
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.getDcdProducts(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/public/event-contract/events
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.getEventContractEvents(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/public/event-contract/markets
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.getEventContractMarkets(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/public/event-contract/series
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.getEventContractSeries(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/public/market-data-history
6+
// METHOD: GET
7+
// PUBLIC: YES
8+
9+
const client = new RestClient({
10+
apiKey: 'apiKeyHere',
11+
apiSecret: 'apiSecretHere',
12+
apiPass: 'apiPassHere',
13+
});
14+
15+
client.getHistoricalMarketData(params)
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});

0 commit comments

Comments
 (0)