feat(v4.0.2): Add full support for P2P trading
This commit is contained in:
24
examples/apidoc/V5/P2P/upload-chat-file.js
Normal file
24
examples/apidoc/V5/P2P/upload-chat-file.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const { RestClientV5 } = require('bybit-api');
|
||||
const fs = require('fs');
|
||||
const FormData = require('form-data');
|
||||
|
||||
// Initialize the client with testnet mode
|
||||
const client = new RestClientV5({
|
||||
testnet: true,
|
||||
key: 'YOUR_API_KEY',
|
||||
secret: 'YOUR_API_SECRET',
|
||||
});
|
||||
|
||||
// Create form data
|
||||
const formData = new FormData();
|
||||
formData.append('upload_file', fs.createReadStream('path/to/your/file.jpg')); // Replace with your file path
|
||||
|
||||
// Call the function
|
||||
client
|
||||
.uploadP2PChatFile(formData)
|
||||
.then((response) => {
|
||||
console.log('Response:', response);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
Reference in New Issue
Block a user