feat(): added new rest EARN endpoints

This commit is contained in:
JJ-Cro
2025-02-20 11:48:54 +01:00
parent 355756723f
commit 3ff903012a
7 changed files with 211 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getEarnProduct({
category: 'FlexibleSaving',
coin: 'BTC',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getEarnOrderHistory({
category: 'FlexibleSaving',
orderId: '0572b030-6a0b-423f-88c4-b6ce31c0c82d',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,19 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getEarnPosition({
category: 'FlexibleSaving',
coin: 'USDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,24 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.submitStakeRedeem({
category: 'FlexibleSaving',
orderType: 'Stake',
accountType: 'FUND',
amount: '0.35',
coin: 'BTC',
productId: '430',
orderLinkId: 'btc-earn-001',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});