After verification of specific user, they still can set up or have filters on the premium page, so after confirmation of verification from our side we will send information about user preferences in specific format by different triggers. Below we will use the socket.io approach to reach these goals.
WATCH OUT! WE RECOMNED TO USE LATEST VERSION OF CLIENT PART OF SOCKET.IO LIBRARY, BUT IF IT'S NOT POSSIBLE PLEASE SEE
THE CLIENT COMPABILITY
To start receiving info about users need to connect by specific route, bellow we provide example on most popular Node.js librarysocket.io-client , how to do that:
CODE
copy
Copied!
const io = require('socket.io-client');
// API-KEYS
const LOTUSMARKET_API_KEY = 'YOUR_LOTUS_MARKET_API_KEY';
(() => {
const socket = io('wss://lotusmarket.io/api/v1/sniper-bots/users', {
extraHeaders: {
'Api-Key': LOTUSMARKET_API_KEY,
},
});
socket.on('connect', () => {
socket.on('TIER-1', (data) => {
// HERE PROCESS RECEIVING DATA
});
socket.on('TIER-2', (data) => {
// HERE PROCESS RECEIVING DATA
});
});
socket.on("reconnection_attempt", () => {
// HANDLE THIS EVENT
});
socket.on("reconnect", () => {
// HANDLE THIS EVENT
});
socket.on("disconnect", (reason) => {
// HANDLE THIS ONE
});
socket.on('error', () => {
// HERE PROCESS THE ERRORS WITH NETWORK
});
socket.on('reconnect_error', () => {
// HERE PROCESS THE ERRORS WITH NETWORK
});
})();
Here, as you can see, there is different events that sniper-bot need to handle, below is the detailed instruction how to use route that is shown in the example above. The {botName} it’s data replaced by you that was given from us (see 🔥 Premium -> 📢 Introduction )