feat(): added new endpoints

This commit is contained in:
Jerko J
2024-10-03 13:34:36 +02:00
parent 409127039e
commit 4cd58406c6
8 changed files with 141 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.issueBrokerVoucher({
accountId: '2846381',
awardId: '123456',
specCode: 'award-001',
amount: '100',
brokerId: 'v-28478',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,21 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getBrokerVoucherSpec({
accountId: '5714139',
awardId: '189528',
specCode: 'demo000',
withUsedAmount: false,
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,18 @@
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getBrokerIssuedVoucher({
id: '80209',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});