> ## Documentation Index
> Fetch the complete documentation index at: https://docs.playtolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallets

> Virtual currency balances with PlaytoliaWallet

`PlaytoliaWallet` tracks balances for all virtual currencies. Balances update automatically after purchases.

### Getting balances

```c# theme={null}
var wallets  = PlaytoliaWallet.GetWallets();     // all wallets
var wallet   = PlaytoliaWallet.GetWalletForCurrencyWithCode("GOLD");
var wallet   = PlaytoliaWallet.GetWalletForCurrencyWithId(currencyId);

Debug.Log(wallet.Balance);           // string — supports large numbers
Debug.Log(wallet.Currency.Name);
```

### Getting currencies

```c# theme={null}
var currencies = PlaytoliaWallet.GetCurrencies();
var currency   = PlaytoliaWallet.GetCurrencyByCode("GOLD");
var currency   = PlaytoliaWallet.GetCurrencyById(id);
```

<Info>Balance is a `string` to support arbitrarily large values. Parse to `long` if you need arithmetic.</Info>

### Listening to changes

```c# theme={null}
void Start()
{
    PlaytoliaWallet.AddListener(UpdateUI);
}

void UpdateUI()
{
    var w = PlaytoliaWallet.GetWalletForCurrencyWithCode("GOLD");
    goldText.text = w?.Balance ?? "0";
}

void OnDestroy() => PlaytoliaWallet.RemoveListener(UpdateUI);
```

<Card title="In-game Stores" icon="store" href="/for-unity/billing/in-game-stores">
  Trigger purchases that update wallet balances
</Card>
