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,28 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET'
});
// Example parameters for getting personal P2P ads
const params = {
itemId: '123456789', // Optional: Specific advertisement ID
status: 1, // Optional: Advertisement status (1: active, 2: completed, 3: cancelled)
side: 1, // Optional: 0: buy; 1: sell
tokenId: 'USDT', // Optional: Token ID
page: 1, // Optional: Page number
size: 20, // Optional: Page size
currencyId: 'USD' // Optional: Currency ID
};
// Get personal P2P ads
client.getP2PPersonalAds(params)
.then(response => {
console.log('Response:', response);
})
.catch(error => {
console.error('Error:', error);
});