I will guide you how to claim sps airdrop by running this code:
exports.claim_sps = async (account) => {
try {
let ts = Date.now();
const tx = 'hive' + account.username + ts;
const sig = ecc.sign(tx, account.posting_key);
let url = `https://ec-api.splinterlands.com/players/claim_sps_airdrop?platform=hive&address=${account.username}&sig=${sig}&ts=${ts}&username=${account.username}`;
const {
data
} = await axios(url);
if (data.success) {
console.log(`${account.username.replace(' ', '').toLowerCase()} claimed ${data.data.qty} SPS`);
} else {
console.log(`${account.username.replace(' ', '').toLowerCase()}: No sps airdrop`);
}
return;
} catch (error) {
console.log(error.message);
await new Promise((resolve) => setTimeout(resolve, 3000));
return await this.claim_sps(account);
}
};