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,29 @@
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
const params = {
status: null, // Optional: filter by order status
beginTime: null, // Optional: filter by start time
endTime: null, // Optional: filter by end time
tokenId: null, // Optional: filter by token ID
side: null, // Optional: filter by side (0: Buy, 1: Sell)
page: 1, // Required: page number
size: 1, // Required: rows per page
};
// Call the function
client
.getP2POrders(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});