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.
Histórico de partidas
Seção intitulada “Histórico de partidas”const matches = await sdk.instantGames.listPrizeMatchesHistory({ page: 1});Pendências
Seção intitulada “Pendências”const pending = await sdk.instantGames.getPendingPrizeRolls();const byGameMode = await sdk.instantGames.getPendingPrizeRollsByGamemode({ page: 1});const byRaffle = await sdk.instantGames.getPendingPrizeRollsByRaffle({ page: 1});Girar uma partida
Seção intitulada “Girar uma partida”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.
Girar todas
Seção intitulada “Girar todas”const result = await sdk.instantGames.rollMatchesAll();
console.log(result.pendingCount);Com filtros:
await sdk.instantGames.rollMatchesAll({ query: { payment: "payment-id", raffle: "raffle-uuid" }});Estatísticas e prêmios
Seção intitulada “Estatísticas e prêmios”const stats = await sdk.raffles.getPrizesInstantStats("raffle-id");const winners = await sdk.prizes.listInstantWinnersHomepageShowcase();const globalStats = await sdk.prizes.listInstantStats();