-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 #72 from JJ-Cro/Update151024
feat(): added new endpoints, updated types, added examples
- Loading branch information
Showing
347 changed files
with
6,848 additions
and
342 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.activateOption(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.adjustGridInvestment(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.adjustGridMarginBalance(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.amendAlgoOrder(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.amendGridAlgoOrder(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.amendLendingOrder(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.amendMultipleOrders(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.amendOrder(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.amendRecurringBuyOrder(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.applyCopytradingLeadTrading(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.applyForMonthlyStatement(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.catch(error => { | ||
console.error(error); | ||
}); |
19 changes: 19 additions & 0 deletions
19
examples/apidoc/RestClient/applyTransactionDetailsArchive.js
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('okx-api'); | ||
|
||
// ENDPOINT: /api/v5/trade/fills-archive | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L820 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.applyTransactionDetailsArchive(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.borrowRepayVIPLoan(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAdvanceAlgoOrder(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAlgoOrder(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('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 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllAfter(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('okx-api'); | ||
|
||
// ENDPOINT: /api/v5/rfq/cancel-all-after | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1838 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllBlockAfter(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('okx-api'); | ||
|
||
// ENDPOINT: /api/v5/rfq/cancel-all-quotes | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1834 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllBlockQuotes(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('okx-api'); | ||
|
||
// ENDPOINT: /api/v5/rfq/cancel-all-rfqs | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1777 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllRFQs(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { RestClient } = require('okx-api'); | ||
|
||
// ENDPOINT: /api/v5/sprd/mass-cancel | ||
// METHOD: POST | ||
// PUBLIC: NO | ||
// Link to function: https://github.com/tiagosiebler/okx-api/blob/master/src/rest-client.ts#L1896 | ||
|
||
const client = new RestClient({ | ||
apiKey: 'insert_api_key_here', | ||
apiSecret: 'insert_api_secret_here', | ||
}); | ||
|
||
client.cancelAllSpreadOrders(params) | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.catch(error => { | ||
console.error(error); | ||
}); |
Oops, something went wrong.