feat(v4.0.2): Add full support for P2P trading

This commit is contained in:
JJ-Cro
2025-03-25 11:11:18 +01:00
parent b47cfc62b8
commit 855c90dc4b
25 changed files with 1431 additions and 30 deletions

View File

@@ -0,0 +1,34 @@
const { RestClientV5 } = require('bybit-api');
// Create a client
const client = new RestClientV5({
testnet: true,
key: 'XXXXX',
secret: 'XXXXX',
});
// Update P2P advertisement
client
.updateP2PAd({
id: '1898988222063644672',
priceType: '0',
premium: '',
price: '0.914',
minAmount: '25',
maxAmount: '5000',
remark: '',
paymentIds: ['-1'],
tradingPreferenceSet: {},
actionType: 'ACTIVE',
quantity: '1000',
paymentPeriod: '15',
itemType: 'ORIGIN',
subsidyAd: false,
securityRiskToken: '',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});