feat(): updated examples
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/user/batch-create-subaccount-and-apikey
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L171
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.batchCreateVirtualSubaccountAndAPIKey(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/borrowLoan.js
Normal file
19
examples/apidoc/RestClientV2/borrowLoan.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/loan/borrow
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1565
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.borrowLoan(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/cancelSpotFollowerOrder.js
Normal file
19
examples/apidoc/RestClientV2/cancelSpotFollowerOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/spot-follower/stop-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1407
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.cancelSpotFollowerOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-follower/close-positions
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1271
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.closeFuturesFollowerPositions(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/closeFuturesTraderOrder.js
Normal file
19
examples/apidoc/RestClientV2/closeFuturesTraderOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/order-close-positions
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1184
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.closeFuturesTraderOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/convert.js
Normal file
19
examples/apidoc/RestClientV2/convert.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/convert/trade
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L237
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.convert(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/convertBGB.js
Normal file
19
examples/apidoc/RestClientV2/convertBGB.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/convert/bgb-convert
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L255
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.convertBGB(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/createSubaccount.js
Normal file
19
examples/apidoc/RestClientV2/createSubaccount.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/broker/account/create-subaccount
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L773
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.createSubaccount(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/createSubaccountApiKey.js
Normal file
19
examples/apidoc/RestClientV2/createSubaccountApiKey.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/broker/manage/create-subaccount-apikey
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L838
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.createSubaccountApiKey(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/broker/account/subaccount-address
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L803
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.createSubaccountDepositAddress(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/createVirtualSubaccount.js
Normal file
19
examples/apidoc/RestClientV2/createVirtualSubaccount.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/user/create-virtual-subaccount
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L163
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.createVirtualSubaccount(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/user/create-virtual-subaccount-apikey
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L184
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.createVirtualSubaccountAPIKey(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/earnSubscribeSavings.js
Normal file
19
examples/apidoc/RestClientV2/earnSubscribeSavings.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/subscribe
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1489
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.earnSubscribeSavings(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresBatchCancelOrders.js
Normal file
19
examples/apidoc/RestClientV2/futuresBatchCancelOrders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/batch-cancel-orders
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L678
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresBatchCancelOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresBatchSubmitOrders.js
Normal file
19
examples/apidoc/RestClientV2/futuresBatchSubmitOrders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/batch-place-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L670
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresBatchSubmitOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresCancelAllOrders.js
Normal file
19
examples/apidoc/RestClientV2/futuresCancelAllOrders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/cancel-all-orders
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L706
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresCancelAllOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresCancelOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresCancelOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/cancel-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L662
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresCancelOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresCancelPlanOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresCancelPlanOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/cancel-plan-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L736
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresCancelPlanOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresFlashClosePositions.js
Normal file
19
examples/apidoc/RestClientV2/futuresFlashClosePositions.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/close-positions
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L682
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresFlashClosePositions(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresModifyOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresModifyOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/modify-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L674
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresModifyOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresModifyPlanOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresModifyPlanOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/modify-plan-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L732
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresModifyPlanOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresModifyTPSLPOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresModifyTPSLPOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/modify-tpsl-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L728
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresModifyTPSLPOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresSubmitOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresSubmitOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/place-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L658
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresSubmitOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresSubmitPlanOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresSubmitPlanOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/place-plan-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L724
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresSubmitPlanOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresSubmitPlanSubOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresSubmitPlanSubOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/plan-sub-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L716
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresSubmitPlanSubOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresSubmitReversal.js
Normal file
19
examples/apidoc/RestClientV2/futuresSubmitReversal.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/click-backhand
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L666
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresSubmitReversal(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/futuresSubmitTPSLOrder.js
Normal file
19
examples/apidoc/RestClientV2/futuresSubmitTPSLOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/place-tpsl-order
|
||||
// METHOD: POST
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L720
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.futuresSubmitTPSLOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getAnnouncements.js
Normal file
19
examples/apidoc/RestClientV2/getAnnouncements.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/public/annoucements
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L39
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getAnnouncements(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getBalances.js
Normal file
19
examples/apidoc/RestClientV2/getBalances.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/account/all-account-balance
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L219
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getBalances(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getBotAccount.js
Normal file
19
examples/apidoc/RestClientV2/getBotAccount.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/account/bot-assets
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L214
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getBotAccount(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getBrokerInfo.js
Normal file
19
examples/apidoc/RestClientV2/getBrokerInfo.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/broker/account/info
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L769
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getBrokerInfo(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getBrokerTraders.js
Normal file
19
examples/apidoc/RestClientV2/getBrokerTraders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-broker/query-traders
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1301
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getBrokerTraders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-broker/query-history-traces
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1305
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getBrokerTradersHistoricalOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-broker/query-current-traces
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1312
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getBrokerTradersPendingOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getConvertBGBCoins.js
Normal file
19
examples/apidoc/RestClientV2/getConvertBGBCoins.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/convert/bgb-convert-coin-list
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L251
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getConvertBGBCoins(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getConvertBGBHistory.js
Normal file
19
examples/apidoc/RestClientV2/getConvertBGBHistory.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/convert/bgb-convert-records
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L259
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getConvertBGBHistory(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getConvertCoins.js
Normal file
19
examples/apidoc/RestClientV2/getConvertCoins.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/convert/currencies
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L229
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getConvertCoins(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getConvertHistory.js
Normal file
19
examples/apidoc/RestClientV2/getConvertHistory.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/convert/convert-record
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L241
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getConvertHistory(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getConvertQuotedPrice.js
Normal file
19
examples/apidoc/RestClientV2/getConvertQuotedPrice.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/convert/quoted-price
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L233
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getConvertQuotedPrice(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getEarnAccount.js
Normal file
19
examples/apidoc/RestClientV2/getEarnAccount.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/account/assets
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1509
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnAccount(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getEarnSavingsAccount.js
Normal file
19
examples/apidoc/RestClientV2/getEarnSavingsAccount.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/account
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1473
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnSavingsAccount(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getEarnSavingsAssets.js
Normal file
19
examples/apidoc/RestClientV2/getEarnSavingsAssets.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/assets
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1477
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnSavingsAssets(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getEarnSavingsProducts.js
Normal file
19
examples/apidoc/RestClientV2/getEarnSavingsProducts.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/product
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1469
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnSavingsProducts(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getEarnSavingsRecords.js
Normal file
19
examples/apidoc/RestClientV2/getEarnSavingsRecords.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/records
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1481
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnSavingsRecords(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/redeem-result
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1497
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnSavingsRedemptionResult(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getEarnSavingsSubscription.js
Normal file
19
examples/apidoc/RestClientV2/getEarnSavingsSubscription.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/subscribe-info
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1485
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnSavingsSubscription(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/earn/savings/subscribe-result
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1493
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getEarnSavingsSubscriptionResult(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFundingAssets.js
Normal file
19
examples/apidoc/RestClientV2/getFundingAssets.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/account/funding-assets
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L210
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFundingAssets(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesAccountAsset.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesAccountAsset.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/account/account
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L588
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesAccountAsset(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesAccountAssets.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesAccountAssets.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/account/accounts
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L592
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesAccountAssets(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesAccountBills.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesAccountBills.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/account/bill
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L624
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesAccountBills(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/long-short
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L135
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesActiveBuySellVolumeData(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/account-long-short
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L151
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesActiveLongShortAccountData(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/position-long-short
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L117
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesActiveLongShortPositionData(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/taker-buy-sell
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L111
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesActiveTakerBuySellVolumeData(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesAllTickers.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesAllTickers.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/tickers
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L520
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesAllTickers(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesCandles.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesCandles.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/candles
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L528
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesCandles(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesContractConfig.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesContractConfig.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/contracts
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L578
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesContractConfig(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesCurrentFundingRate.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesCurrentFundingRate.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/current-fund-rate
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L574
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesCurrentFundingRate(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesFills.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesFills.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/fills
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L690
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesFills(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-follower/query-current-orders
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1245
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesFollowerCurrentOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-follower/query-quantity-limit
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1282
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesFollowerFollowLimit(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-follower/query-history-orders
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1252
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesFollowerHistoryOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesFollowerSettings.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesFollowerSettings.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-follower/query-settings
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1267
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesFollowerSettings(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesFollowerTraders.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesFollowerTraders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-follower/query-traders
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1278
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesFollowerTraders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesHistoricCandles.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesHistoricCandles.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/history-candles
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L534
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricCandles(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/history-fund-rate
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L570
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricFundingRates(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/history-index-candles
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L538
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricIndexPriceCandles(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/history-mark-candles
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L544
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricMarkPriceCandles(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesHistoricOrderFills.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesHistoricOrderFills.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/fill-history
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L694
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricOrderFills(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesHistoricOrders.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesHistoricOrders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/orders-history
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L702
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesHistoricPlanOrders.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesHistoricPlanOrders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/orders-plan-history
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L744
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricPlanOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesHistoricPositions.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesHistoricPositions.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/position/history-position
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L648
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricPositions(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesHistoricTrades.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesHistoricTrades.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/fills-history
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L554
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesHistoricTrades(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesLongShortRatio.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesLongShortRatio.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/long-short-ratio
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L123
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesLongShortRatio(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesMergeDepth.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesMergeDepth.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/merge-depth
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L524
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesMergeDepth(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesNextFundingTime.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesNextFundingTime.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/funding-time
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L562
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesNextFundingTime(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesOpenCount.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesOpenCount.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/account/open-count
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L600
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesOpenCount(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesOpenInterest.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesOpenInterest.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/open-interest
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L558
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesOpenInterest(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesOpenOrders.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesOpenOrders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/orders-pending
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L698
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesOpenOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesOrder.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/detail
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L686
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesPlanOrders.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesPlanOrders.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/order/orders-plan-pending
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L740
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesPlanOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesPosition.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesPosition.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/position/single-position
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L640
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesPosition(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesPositionTier.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesPositionTier.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/query-position-lever
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L636
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesPositionTier(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesPositions.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesPositions.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/position/all-position
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L644
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesPositions(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesRecentTrades.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesRecentTrades.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/fills
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L550
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesRecentTrades(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesSubAccountAssets.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesSubAccountAssets.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/account/sub-account-assets
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L596
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesSubAccountAssets(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesSymbolPrice.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesSymbolPrice.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/symbol-price
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L566
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesSymbolPrice(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesTicker.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesTicker.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/ticker
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L516
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTicker(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesTraderCurrentOrder.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesTraderCurrentOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/order-current-track
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1146
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderCurrentOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesTraderFollowers.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesTraderFollowers.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/config-query-followers
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1223
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderFollowers(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/order-history-track
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1153
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderHistoryOrders(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesTraderOrder.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesTraderOrder.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/order-total-detail
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1167
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderOrder(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/profit-history-summarys
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1171
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderProfitHistory(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesTraderProfitShare.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesTraderProfitShare.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/profit-details
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1191
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderProfitShare(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/profits-group-coin-date
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1195
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderProfitShareGroup(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/profit-history-details
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1175
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderProfitShareHistory(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/copy/mix-trader/config-query-symbols
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L1202
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTraderSymbolSettings(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesTransactionRecords.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesTransactionRecords.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/tax/future-record
|
||||
// METHOD: GET
|
||||
// PUBLIC: NO
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L67
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesTransactionRecords(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
19
examples/apidoc/RestClientV2/getFuturesVIPFeeRate.js
Normal file
19
examples/apidoc/RestClientV2/getFuturesVIPFeeRate.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { RestClientV2 } = require('bitget-api');
|
||||
|
||||
// ENDPOINT: /api/v2/mix/market/vip-fee-rate
|
||||
// METHOD: GET
|
||||
// PUBLIC: YES
|
||||
// Link to function: https://github.com/tiagosiebler/bitget-api/blob/master/src/rest-client-v2.ts#L512
|
||||
|
||||
const client = new RestClientV2({
|
||||
apiKey: 'insert_api_key_here',
|
||||
apiSecret: 'insert_api_secret_here',
|
||||
});
|
||||
|
||||
client.getFuturesVIPFeeRate(params)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user