Skip to content

Commit 93d6241

Browse files
authored
Merge pull request #525 from JJ-Cro/update210126
feat(v4.5.1): add new API endpoints for crypto loans and fiat trading, enhance existing functionality with new examples and documentation updates
2 parents 4d718ac + 186625a commit 93d6241

26 files changed

+7598
-6680
lines changed

docs/endpointFunctionList.md

Lines changed: 264 additions & 257 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// https://api.bybit.com/v5/fiat/query-coin-list
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.getFiatTradingPairList({
13+
side: 0,
14+
})
15+
.then((response) => {
16+
console.log(response);
17+
})
18+
.catch((error) => {
19+
console.error(error);
20+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// https://api.bybit.com/v5/asset/covert/small-balance-list
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.getSmallBalanceList({
13+
accountType: 'eb_convert_uta',
14+
fromCoin: 'XRP',
15+
})
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// https://api.bybit.com/v5/crypto-loan-common/max-loan
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.getMaxLoanAmount({
13+
currency: 'BTC',
14+
collateralList: [
15+
{
16+
ccy: 'XRP',
17+
amount: '1000',
18+
},
19+
{
20+
ccy: 'USDT',
21+
amount: '1000',
22+
},
23+
],
24+
})
25+
.then((response) => {
26+
console.log(response);
27+
})
28+
.catch((error) => {
29+
console.error(error);
30+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// https://api.bybit.com/v5/ins-loan/repay-loan
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.repayInstitutionalLoan({
13+
token: 'USDT',
14+
quantity: '500000',
15+
})
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// https://api.bybit.com/v5/rfq/accept-other-quote
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.acceptNonLPQuote({
13+
rfqId: '1754364447601610516653123084412812',
14+
})
15+
.then((response) => {
16+
console.log(response);
17+
})
18+
.catch((error) => {
19+
console.error(error);
20+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// https://api.bybit.com/v5/rfq/rfq-list
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.getRFQHistory({
13+
rfqId: '1756885055799241492396882271696580',
14+
traderType: 'quote',
15+
status: 'Active',
16+
limit: 50,
17+
})
18+
.then((response) => {
19+
console.log(response);
20+
})
21+
.catch((error) => {
22+
console.error(error);
23+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// https://api.bybit.com/v5/rfq/rfq-realtime
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.getRFQRealtimeInfo({
13+
rfqId: '1756885055799241492396882271696580',
14+
traderType: 'request',
15+
})
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// https://api.bybit.com/v5/spot-margin-trade/get-auto-repay-mode
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.getAutoRepayMode({
13+
currency: 'ETH', // optional
14+
})
15+
.then((response) => {
16+
console.log(response);
17+
})
18+
.catch((error) => {
19+
console.error(error);
20+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// https://api.bybit.com/v5/spot-margin-trade/set-auto-repay-mode
2+
3+
const { RestClientV5 } = require('bybit-api');
4+
5+
const client = new RestClientV5({
6+
testnet: true,
7+
key: 'apikey',
8+
secret: 'apisecret',
9+
});
10+
11+
client
12+
.setAutoRepayMode({
13+
currency: 'ETH', // optional: if not passed, applies to all currencies
14+
autoRepayMode: '1', // 0: Off, 1: On
15+
})
16+
.then((response) => {
17+
console.log(response);
18+
})
19+
.catch((error) => {
20+
console.error(error);
21+
});

0 commit comments

Comments
 (0)