> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edcoinflip/getting-started/currencies.md).

# Currencies

Every entry of `config.yml` → `currencies` is one currency players can bet. The key is what they type: `/cf 1000 money`. Currencies are bound to their plugin one tick after the server started (so economy plugins have registered with Vault) and again on `/cf reload`. The console lists the usable ones: `Currencies: money, tokens`.

```yaml
currencies:
  money:
    enabled: true
    provider: vault          # vault | playerpoints | pinnaprison | edprison | edtools | eddungeons
    currency: ''             # the id inside the provider ('' = the key); not used by vault / playerpoints
    name: 'Money'            # '' = the provider's own name
    symbol: '$'              # {symbol}
    color: '&a'              # {color}
    icon: GOLD_INGOT         # {icon}, also what the mini players hold in the 3D flip
    decimals: 2              # 0 = whole amounts
    format: full             # full (1,250,000) or short (1.25M); default number-format.style
    min: 100
    max: 0                   # 0 = no limit
    tax-percent: -1          # -1 = the global tax-percent
    broadcast-min: 1000000   # announce coinflips this big when created and decided ('' = never)
    permission: ''           # needed to bet in this currency ('' = everyone)
```

A currency whose plugin is not installed, or that the plugin doesn't know, is logged once and can't be bet. Money already owed in it (a win, a refund) waits until it is back.

## Providers

### Vault

Any economy plugin that registers with Vault (EssentialsX, CMI, ...).

```yaml
  money: { provider: vault, name: 'Money', symbol: '$', color: '&a', icon: GOLD_INGOT, decimals: 2, min: 100 }
```

### PlayerPoints

Whole numbers only (amounts are rounded down).

```yaml
  points: { provider: playerpoints, name: 'Points', color: '&d', icon: AMETHYST_SHARD, decimals: 0, min: 10 }
```

### PinnaPrison

Any PinnaPrison currency id. Money only moves while the player's PinnaPrison data is loaded, and every change is saved at once.

```yaml
  tokens: { provider: pinnaprison, currency: tokens, name: 'Tokens', color: '&#9ddf9d', icon: SUNFLOWER, format: short, min: 1000 }
```

### EdPrison

Any EdPrison economy id. Wins are added without multipliers.

```yaml
  gems: { provider: edprison, currency: gems, name: 'Gems', color: '&#4FC3F7', icon: EMERALD, format: short, min: 10 }
```

### EdTools (EdGens)

Any EdTools currency id. Wins are added without boosters.

```yaml
  farmcoins: { provider: edtools, currency: farm-coins, name: 'Farm Coins', color: '&e', icon: WHEAT, format: short, min: 1000 }
```

### EdDungeons

Any EdDungeons currency id.

```yaml
  souls: { provider: eddungeons, currency: souls, name: 'Souls', color: '&5', icon: SOUL_LANTERN, format: short, min: 100 }
```

## How money moves

* A bet is taken when a coinflip is created or joined, with a check-and-take: a player can never bet money they spent a moment before.
* Every money call runs on the main thread.
* A win or refund is stored before it is paid. If the currency plugin refuses the deposit (or is gone), the amount stays owed and is paid on the player's next join.
