> 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/pinnagiveaways/features/currencies.md).

# Currencies

Rewards (`give-eco <currency> <amount>`) and sponsorships work with any currency listed under `currencies:`. `/giveaway currencies` shows which ones loaded and why the others didn't.

```yaml
currencies:
  <id>:                    # the id used in give-eco, sponsor.currency and menu items
    enabled: true
    provider: vault        # vault | playerpoints | pinnaprison | edprison | edtools | eddungeons | api
    currency: ''           # the provider's own currency id (default: the entry id)
    name: 'Money'          # {currency-name}; '' = the provider's own name
    format: '${amount}'    # {formatted}: {amount} {amount-short} {name}
    decimals: 2            # 0 = whole amounts
    icon: GOLD_INGOT
    sponsor:
      enabled: true        # players can sponsor giveaways with it
      min: 1000
      max: 0               # 0 = no maximum
      tax: 0               # percent of a sponsorship that is not given away
```

A provider whose plugin isn't installed is skipped with one warning. A currency id that **isn't listed** is looked up in PinnaPrison, EdPrison, EdTools and EdDungeons (in that order), so `give-eco tokens 5k` works on a prison server without a block of its own.

Every balance change runs on the main thread, and taking money is always check-and-take. A payment that can't be made at once (the player is offline and the plugin only keeps online players' balances, or its plugin is missing) is kept and paid as soon as the player is back.

## Vault

```yaml
  money:
    provider: vault
    name: 'Money'
    format: '${amount}'
    decimals: 2
```

Needs Vault and an economy plugin (EssentialsX, CMI...). Works for offline players too.

## PlayerPoints

```yaml
  points:
    provider: playerpoints
    name: 'Points'
    format: '{amount} Points'
```

Whole points; works for offline players.

## PinnaPrison

```yaml
  tokens:
    provider: pinnaprison
    currency: 'tokens'     # any PinnaPrison currency id: tokens, gems, credits...
    format: '{amount-short} {name}'
```

Balances are only changed while the player's PinnaPrison data is loaded (online); payouts to offline players wait.

## EdPrison

```yaml
  gems:
    provider: edprison
    currency: 'gems'
    name: 'Gems'
```

Online players only.

## EdTools (EdGens)

```yaml
  farmcoins:
    provider: edtools
    currency: 'farm-coins'
```

Online players only.

## EdDungeons

```yaml
  souls:
    provider: eddungeons
    currency: 'souls'
```

Online players only; taking uses EdDungeons' own check-and-take.

## Your own (API)

A plugin can register a currency with `PinnaGiveawaysAPI.registerCurrency(...)` (see [Developer API](/p/pinnagiveaways/reference/api.md)). It works by its id right away; list it with `provider: api` and `currency: <its id>` to give it a name, format and sponsor limits.
