Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function airdropHandler(request, h) {
const client = getClient();
const nomenclate = getNomenclate();
let info;
try {
info = await client.getInfo();
} catch (e) {
console.log(e);
}
let network = Network.get(info.network);
let airdropKey = network.keys.airdrop;
const airdropAddr = Address.fromHash(airdropKey, 0);
let balance;
let history;
try {
balance = await nomenclate.getAddressBalance(
airdropAddr.toString(info.network)
);
history = await nomenclate.getAddressHistory(
airdropAddr.toString(info.network)
);
} catch (e) {
console.log(e);
}
const config = require("config");
const { WalletClient, NodeClient } = require("hs-client");
const NomenclateClient = require("nomenclate-js");
const { Network } = require("hsd");
const network = Network.get(config.get("node-network"));
const walletOptions = {
network: network.type,
host: config.get("node-host"),
port: network.walletPort,
apiKey: config.get("node-api-key")
};
const clientOptions = {
host: config.get("node-host"),
network: network.type,
port: network.rpcPort,
apiKey: config.get("node-api-key")
};
const nomenclateOptions = {