Skip to content

Commit

Permalink
Merge pull request #49 from JJ-Cro/Update151024
Browse files Browse the repository at this point in the history
feat(): updated examples, readme
  • Loading branch information
tiagosiebler authored Oct 16, 2024
2 parents ca0eeb6 + a9cf69a commit e218b0e
Show file tree
Hide file tree
Showing 253 changed files with 1,254 additions and 504 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

[1]: https://www.npmjs.com/package/bitget-api


Updated & performant JavaScript & Node.js SDK for the Bitget V2 REST APIs and WebSockets:

- Complete integration with all Bitget APIs.
Expand All @@ -37,6 +36,7 @@ Updated & performant JavaScript & Node.js SDK for the Bitget V2 REST APIs and We

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

<!-- template_related_projects -->

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/user/batch-create-subaccount-and-apikey
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.batchCreateVirtualSubaccountAndAPIKey(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/borrowLoan.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/earn/loan/borrow
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.borrowLoan(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/cancelSpotFollowerOrder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/copy/spot-follower/stop-order
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.cancelSpotFollowerOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/closeFuturesFollowerPositions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/copy/mix-follower/close-positions
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.closeFuturesFollowerPositions(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/closeFuturesTraderOrder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/copy/mix-trader/order-close-positions
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.closeFuturesTraderOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/convert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/convert/trade
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.convert(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/convertBGB.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/convert/bgb-convert
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.convertBGB(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/createSubaccount.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/broker/account/create-subaccount
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.createSubaccount(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/createSubaccountApiKey.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/broker/manage/create-subaccount-apikey
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.createSubaccountApiKey(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/broker/account/subaccount-address
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.createSubaccountDepositAddress(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/createVirtualSubaccount.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/user/create-virtual-subaccount
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.createVirtualSubaccount(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/createVirtualSubaccountAPIKey.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/user/create-virtual-subaccount-apikey
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.createVirtualSubaccountAPIKey(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/earnSubscribeSavings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/earn/savings/subscribe
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.earnSubscribeSavings(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/futuresBatchCancelOrders.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/mix/order/batch-cancel-orders
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.futuresBatchCancelOrders(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/futuresBatchSubmitOrders.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/mix/order/batch-place-order
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.futuresBatchSubmitOrders(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/futuresCancelAllOrders.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/mix/order/cancel-all-orders
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.futuresCancelAllOrders(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/futuresCancelOrder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/mix/order/cancel-order
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

client.futuresCancelOrder(params)
.then(response => {
.then((response) => {
console.log(response);
})
.catch(error => {
.catch((error) => {
console.error(error);
});
7 changes: 5 additions & 2 deletions examples/apidoc/RestClientV2/futuresCancelPlanOrder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { RestClientV2 } = require('bitget-api');


// This example shows how to call this Bitget API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "bitget-api" for Bitget exchange
// This Bitget API SDK is available on npm via "npm install bitget-api"
// ENDPOINT: /api/v2/mix/order/cancel-plan-order
// METHOD: POST
// PUBLIC: NO
Expand All @@ -11,9 +14,9 @@ const client = new RestClientV2({
});

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

0 comments on commit e218b0e

Please sign in to comment.