Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = 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/v3/loan/repay
// METHOD: POST
// PUBLIC: NO

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client.loanRepay(params)
client
.adjustAccountMode({
mode: 'basic',
})
.then((response) => {
console.log(response);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = 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/v3/p2p/my-ads
// METHOD: GET
// PUBLIC: NO

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client.getP2pMyAds(params)
client
.getBalances()
.then((response) => {
console.log(response);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@ import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = 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/v3/market/fills
// METHOD: GET
// PUBLIC: YES

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client.getFills(params)
client
.getFeeRate({
category: 'SPOT',
symbol: 'BTCUSDT',
})
.then((response) => {
console.log(response);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = 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/v3/loan/debts
// METHOD: GET
// PUBLIC: NO

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client.getLoanDebts(params)
client
.getFundingAssets({
coin: 'USDT',
})
.then((response) => {
console.log(response);
})
Expand Down
18 changes: 18 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-account-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getAccountInfo()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
18 changes: 18 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-account-setting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getAccountSettings()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
20 changes: 20 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-all-symbol-fee-rates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getAllFeeRates({
category: 'SPOT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
18 changes: 18 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-collateral-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getCollateralType()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-convert-records.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getConvertRecords({
fromCoin: 'BTC',
toCoin: 'USDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3();

client
.getCustomCollateralCoins()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
18 changes: 18 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-deduct-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getDeductInfo()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
18 changes: 18 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-delta-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getDeltaInfo()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-financial-records.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getFinancialRecords({
category: 'USDT-FUTURES',
coin: 'BGB',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
23 changes: 23 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-max-open-available.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getMaxOpenAvailable({
category: 'SPOT',
symbol: 'BTCUSDT',
orderType: 'market',
side: 'sell',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
20 changes: 20 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-max-transferable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getMaxTransferable({
coin: 'USDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
20 changes: 20 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-max-withdrawal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getMaxWithdrawal({
coin: 'USDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
20 changes: 20 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-move-position-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getMovePositionHistory({
category: 'USDT-FUTURES',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
21 changes: 21 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-oi-limit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

client
.getOpenInterestLimit({
category: 'USDT-FUTURES',
symbol: 'BTCUSDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
18 changes: 18 additions & 0 deletions examples/apidoc/RestClientV3/Account/get-payment-coins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RestClientV3 } from 'bitget-api';
// or, if require is preferred:
// const { RestClientV3 } = require('bitget-api');

const client = new RestClientV3({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
apiPass: 'insert_api_pass_here',
});

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