Energy #

Read more about the Energy system in Hiro here.

Get all energies #

Get the energies and their current timers for the player.

1
2
const energyList = await hiroClient.energyGet(session);
console.log(energyList);

Spend one or more energies #

Spend one or more energies for the player.

1
2
3
4
5
6
7
8
const request = new EnergySpendRequest();
request.amounts = {
    "power": 10,
    "tickets": 1
};

const energySpendRewards = await hiroClient.energySpend(session, request);
console.log(energySpendRewards);

Granting energy #

While energy can be granted as part of a reward, you can also grant it directly.

1
2
3
4
5
6
7
8
const request = new EnergyGrantRequest();
request.amounts = {
    "power": 10,
    "tickets": 1
};

const energyList = await hiroClient.energyGrant(session, request);
console.log(energyList);