feat(v2.3.5): added missing affiliate endpoints in broker client, updated examples and endpoint map

This commit is contained in:
JJ-Cro
2025-02-28 09:51:19 +01:00
parent 503baf3107
commit 97012bc1ae
13 changed files with 531 additions and 255 deletions

View File

@@ -0,0 +1,22 @@
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/redeem
// METHOD: POST
// PUBLIC: NO
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.earnRedeemSavings(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,22 @@
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/market/discount-rate
// METHOD: GET
// PUBLIC: YES
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.getFuturesDiscountRate(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,22 @@
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/market/exchange-rate
// METHOD: GET
// PUBLIC: YES
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.getFuturesInterestExchangeRate(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,22 @@
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/account/interest-history
// METHOD: GET
// PUBLIC: NO
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.getFuturesInterestHistory(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,22 @@
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/market/union-interest-rate-history
// METHOD: GET
// PUBLIC: YES
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.getFuturesInterestRateHistory(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -4,7 +4,7 @@ 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/plan-sub-order
// METHOD: POST
// METHOD: GET
// PUBLIC: NO
const client = new RestClientV2({
@@ -13,7 +13,7 @@ const client = new RestClientV2({
apiPass: 'insert_api_pass_here',
});
client.futuresSubmitPlanSubOrder(params)
client.getFuturesTriggerSubOrder(params)
.then((response) => {
console.log(response);
})

View File

@@ -0,0 +1,22 @@
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/account/set-asset-mode
// METHOD: POST
// PUBLIC: NO
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.setFuturesAssetMode(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,22 @@
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/spot/trade/batch-cancel-replace-order
// METHOD: POST
// PUBLIC: NO
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.spotBatchCancelandSubmitOrder(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,22 @@
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/spot/trade/cancel-replace-order
// METHOD: POST
// PUBLIC: NO
const client = new RestClientV2({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});
client.spotCancelandSubmitOrder(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});