-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from JJ-Cro/Update151024
feat(): updated Readme, examples
- Loading branch information
Showing
345 changed files
with
2,114 additions
and
1,353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
Oops, something went wrong.