Pular para o conteúdo

Jogos instantâneos

Jogos instantâneos vivem no namespace instantGames. A SDK cobre o histórico, as pendências e a ação de girar.

const matches = await sdk.instantGames.listPrizeMatchesHistory({
page: 1
});
const pending = await sdk.instantGames.getPendingPrizeRolls();
const byGameMode = await sdk.instantGames.getPendingPrizeRollsByGamemode({
page: 1
});
const byRaffle = await sdk.instantGames.getPendingPrizeRollsByRaffle({
page: 1
});
const result = await sdk.instantGames.rollMatch("uuid-da-partida");
if (result.winner) {
console.log(result.title, result.monetaryValue);
}

O retorno é um union discriminado por winner.

const result = await sdk.instantGames.rollMatchesAll();
console.log(result.pendingCount);

Com filtros:

await sdk.instantGames.rollMatchesAll({
query: {
payment: "payment-id",
raffle: "raffle-uuid"
}
});
const stats = await sdk.raffles.getPrizesInstantStats("raffle-id");
const winners = await sdk.prizes.listInstantWinnersHomepageShowcase();
const globalStats = await sdk.prizes.listInstantStats();