Skip to content

Commit acf2cb6

Browse files
authored
Merge pull request sieblyio#185 from JJ-Cro/update23042026
feat(v3.1.4): add dual investment API support and update examples
2 parents 384b834 + 33f920c commit acf2cb6

37 files changed

Lines changed: 9403 additions & 7634 deletions

docs/endpointFunctionList.md

Lines changed: 363 additions & 349 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/subtypes
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.getAccountBillSubtypes(params)
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});

examples/apidoc/RestClient/getConvertCurrencyPair.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
const { RestClient } = require('okx-api');
1+
import { RestClient } from 'okx-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('okx-api');
24

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/asset/convert/currency-pair
6-
// METHOD: GET
7-
// PUBLIC: NO
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/asset/convert/currency-pair
8+
// METHOD: GET
9+
// PUBLIC: NO
810

911
const client = new RestClient({
1012
apiKey: 'apiKeyHere',
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/currency-pair
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.getDcdCurrencyPairs(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-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+
});

0 commit comments

Comments
 (0)