# Virtual Currencies

**URL:** https://heroiclabs.com/docs/hiro/unity/economy/virtual-currencies/
**Keywords:** virtual currencies, hiro
**Categories:** hiro, unity, virtual-currencies

---


# Virtual Currencies

## Defining currencies

Currencies are defined in the [JSON configuration file](./#customization-parameters) for your game's economy system. You can define any number of currencies, and indicate the amounts (if any) of each currency that new players should start with.

This is done via the `currencies` property of the _[`initialize_user`](./#initialize_user)_ object, for example:

```json
{
  "initialize_user": {
    "currencies": {
      "Gold": 0,
      "Silver": 50,
      "Gems": 100
    },
  }
  ...
}
```

## Wallet

### Listing currencies

You can list the currencies in a user's wallet.

```csharp
foreach (var currencyKvp in economySystem.Wallet)
{
    Debug.Log($"{currencyKvp.Key}: {currencyKvp.Value}");
}
```

### Refreshing the wallet

You can refresh the economy system's wallet data.

```csharp
await economySystem.RefreshWalletAsync();
```

## Currency rewards

Players can receive currency in many ways, a few examples are by purchasing it via a [virtual store](../virtual-store/), by watching a [rewarded video](../rewarded-video/), or as a [donation](../donations/) from other players.
