API Example Scripts
Here are a few examples of some useful real-life scripts that could be implemented using the HollaEx API
Here are some more complex scripts that following the process on the previous page could be implemented and make your life easier.
Get Sign Ups
Retrieve the number of user sign-ups per month
const hollaex = require("hollaex-node-lib");
const client = new hollaex({
apiURL: "<YOUR_EXCHANGES_URL>",
apiKey: "<USER_API_KEY>",
apiSecret: "<USER_API_KEY_SECRET>",
});
//Get the number of exchange user signups by each month.
const getSignups = async () => {
try {
const months= ["January","February","March","April","May","June",
"July", "August","September","October","November","December"];
const signups = {};
for(let i = 0; i < months.length; i++) {
const date = new Date();
const month = date.setMonth(date.getMonth() - i);
code
const res = await client.getExchangeUsers({ startDate: new Date(month) });
signups[`${months[date.getMonth()]}- ${date.getFullYear()}`] = res.data.length;
}
return signups;
} catch (error) {
return error.message;
}
}
getSignups().then(res => console.log(res);Reward New Users with USDT
Once users verify their account, deposit 5 USDT into their USDT wallet
Alert Admin to Large Deposits
Notify the admin by email if a deposit of over $10,000 worth is made, and give the details of the deposit
Send Custom HTML Email to New Users
With the HTML of an email contained in a variable, send this HTML as an email to all new users
Find the Most Active Trader
Find the user who has traded the highest volume over all assets in the past month
Last updated