Skip to content

Commit

Permalink
Merge pull request #73 from JJ-Cro/Update151024
Browse files Browse the repository at this point in the history
feat(): updated Readme, examples
  • Loading branch information
tiagosiebler authored Oct 16, 2024
2 parents 2329292 + 097ca1c commit 6c0c341
Show file tree
Hide file tree
Showing 345 changed files with 2,114 additions and 1,353 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ npm install okx-api

- Issues? Check the [issues tab](https://github.com/tiagosiebler/okx-api/issues).
- Discuss & collaborate with other node devs? Join our [Node.js Algo Traders](https://t.me/nodetraders) engineering community on telegram.
- Follow our announcement channel for real-time updates on [X/Twitter](https://x.com/QuantSDKs)

<!-- template_related_projects -->

Expand Down
680 changes: 341 additions & 339 deletions docs/endpointFunctionList.md

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/activateOption.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/account/activate-option
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L709
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L736

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.activateOption(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/adjustGridInvestment.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/tradingBot/grid/adjust-investment
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1109
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1115

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.adjustGridInvestment(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/adjustGridMarginBalance.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/tradingBot/grid/margin-balance
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1097
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1103

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.adjustGridMarginBalance(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/amendAlgoOrder.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/trade/amend-algos
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L940
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L946

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.amendAlgoOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/amendGridAlgoOrder.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/tradingBot/grid/amend-order-algo
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L980
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L986

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.amendGridAlgoOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/amendLendingOrder.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/finance/fixed-loan/lending-order
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L2787
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L2793

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.amendLendingOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/amendMultipleOrders.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/trade/amend-batch-orders
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L771
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L798

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.amendMultipleOrders(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/amendOrder.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/trade/amend-order
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L767
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L794

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.amendOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/amendRecurringBuyOrder.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/tradingBot/recurring/amend-order-algo
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1294
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1300

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.amendRecurringBuyOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/applyCopytradingLeadTrading.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/copytrading/apply-lead-trading
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1435
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1441

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.applyCopytradingLeadTrading(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/applyForMonthlyStatement.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/asset/monthly-statement
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L2448
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L2454

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.applyForMonthlyStatement(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/borrowRepayVIPLoan.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/account/borrow-repay
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L526
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L527

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.borrowRepayVIPLoan(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/cancelAdvanceAlgoOrder.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/trade/cancel-advance-algos
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L946
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L952

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.cancelAdvanceAlgoOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/cancelAlgoOrder.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/trade/cancel-algos
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L934
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L940

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.cancelAlgoOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
8 changes: 5 additions & 3 deletions examples/apidoc/RestClient/cancelAllAfter.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const { RestClient } = require('okx-api');

// 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
// This OKX API SDK is available on npm via "npm install okx-api"
// ENDPOINT: /api/v5/trade/cancel-all-after
// METHOD: POST
// PUBLIC: NO
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L909
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L915

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.cancelAllAfter(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
Loading

0 comments on commit 6c0c341

Please sign in to comment.