---
title: "Jogos instantâneos"
description: "Partidas, rolls, pendências e prêmios."
---
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

```ts
const matches = await sdk.instantGames.listPrizeMatchesHistory({
    page: 1
});
```

## Pendências

```ts
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

```ts
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

```ts
const result = await sdk.instantGames.rollMatchesAll();

console.log(result.pendingCount);
```

Com filtros:

```ts
await sdk.instantGames.rollMatchesAll({
    query: {
        payment: "payment-id",
        raffle: "raffle-uuid"
    }
});
```

## Estatísticas e prêmios

```ts
const stats = await sdk.raffles.getPrizesInstantStats("raffle-id");
const winners = await sdk.prizes.listInstantWinnersHomepageShowcase();
const globalStats = await sdk.prizes.listInstantStats();
```

:::tip[Combine com o carrinho]
Os itens `RAFFLE_NUMBERS` com `kind: "GAMBLING"` do carrinho alimentam as partidas instantâneas.
:::