The Sponge Economy API has a few basic components that developers should be familiar with:
The EconomyService is the basis of the Economy API. It is used to interact via the Economy API, stores an economy’s currencies and provides methods for account management.
Sponge does not provide a default implementation for the
EconomyService. It’s completely up to plugins to
implement the Economy API. This means that you have to rely on another plugin which implements the service or you’ll
have to implement it yourself, if you want to make use of it.
The Currency object represents a form of Currency.
Currency stores a display name (plural and singular),
a symbol, the number of fractional digits, and whether the currency is the default currency for the economy. If the
economy plugin chooses, it can support multiple currencies.
Accounts are used to store economy information about a specific player or other object (i.e. bank, business, entity). There are two account types in the Sponge Economy API:
Virtual accounts are tied to an identifier, which is stored as a string. Virtual accounts can be tied to almost
anything, but are commonly used for things such as banks, or non-players. To get the id of a virtual account, use
Unique accounts are tied to a UUID, usually a player. To get the UUID of an unique account, use
Transactions represent an account’s change in balance. There are currently three types of transactions:
Deposit: Occurs when an account has funds added to it
Withdraw: Occurs when an account has funds removed from it
Transfer: Occurs when an account exchanges funds with another account
Amount of currency involved
Result of the transaction
You can view all possible transaction results on the ResultType JavaDocs page.