Skip to content

Commit

Permalink
Merge pull request #72 from JJ-Cro/Update151024
Browse files Browse the repository at this point in the history
feat(): added new endpoints, updated types, added examples
  • Loading branch information
tiagosiebler authored Oct 15, 2024
2 parents 8a261cf + b5f613f commit 2329292
Show file tree
Hide file tree
Showing 347 changed files with 6,848 additions and 342 deletions.
674 changes: 339 additions & 335 deletions docs/endpointFunctionList.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/activateOption.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/adjustGridInvestment.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/adjustGridMarginBalance.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/amendAlgoOrder.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/amendGridAlgoOrder.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/amendLendingOrder.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/amendMultipleOrders.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/amendOrder.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/amendRecurringBuyOrder.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/applyCopytradingLeadTrading.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/applyForMonthlyStatement.js
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 examples/apidoc/RestClient/applyTransactionDetailsArchive.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/borrowRepayVIPLoan.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/cancelAdvanceAlgoOrder.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/cancelAlgoOrder.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/cancelAllAfter.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/cancelAllBlockAfter.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/cancelAllBlockQuotes.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/cancelAllRFQs.js
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);
});
19 changes: 19 additions & 0 deletions examples/apidoc/RestClient/cancelAllSpreadOrders.js
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);
});
Loading

0 comments on commit 2329292

Please sign in to comment.