CryptoMarket
SpigotMCModrinthA plugin that brings the cryptocoins market experience to your server! REAL EXCHANGE RATES!
3.2k downloads 4.6 rating
latest v2.1.4-SNAPSHOT SpigotMC
NOTE: This plugin needs an internet connection to fetch the values of the coins.
CryptoMarket
A plugin that brings the cryptocoins market experience to your server!
Features
- Beautiful and easy-to-use GUI
- Real life exchange rates
- Ranking of richest players
- Allows trades on more than one coin
- Calendar showing the previous values
- Coin purchase via conversation
- PlaceholderAPI support
Main menu
This menu is accessed using the command /cryptomarket (or just /cm)
It contains buttons to access the other menus and some useful items, such as:
Price selling now: this one tells you how much of profit (or loss) you'll get if you sell now
Wallet: shows your current balance, server coin or cryptocoin
Coins / Values: the most important one, here is where the magic happens. It shows the current values of the coins and allows you to negotiate on them.
Clicking (left click = sell, right click = buy) on it will start a negotiation conversation, after that the player just have to answer some questions (coin, amount, etc). And that is it, negotiation completed!
Update: updates the exchange rates if an error ocurred
Ranking and Calendar: opens their respective menus
Ranking menu
Do you want to see who are the richest players on the server?
Check this menu out!
It also calculates the total value invested in the server!
Here the top 5 are displayed along with their total patrimony (amount invested converted to server coin):
Calendar menu
This menu contains the previous values of the coins, which may help players decide when it's the best time to buy!
How to install?
- Before anything, you must get a API KEY (don't worry, it's free):
- Access https://www.alphavantage.co/support/#api-key, fill the form and click on "GET FREE API KEY".
- Start the server with CryptoMarket.jar in the plugins folder.
- Open the config file and insert your API KEY on "api-key".
- Restart your server.
Configuration
The configuration file is well commented, but if you still have questions about something, send me a PM!
The configuration file is well commented, but if you still have questions about something, send me a PM!
Code (YAML):
#API KEY for accessing the cryptocoins values, USE THE DEFAULT KEY FOR TESTING ONLY[/COLOR]
[COLOR=rgb(51, 102, 0)]api-key : "99X0JFXBLX2YRZA7" [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ]
[COLOR= #336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600]#The interval to update the Exchange Rates (in minutes)
#(Please note that the API has a limit of 500 requests per day,
#so if you set an interval that trespasses this limit, the plugin will automatically choose one)
update-interval : 60
#The interval to save the investors data (in minutes)
saving-interval : 5
#The interval to update the richers list (in minutes)
richers-update-interval : 15
#MySQL Configuration
mysql :
#Do you want to use MySQL? If not, SQLite will be used
enabled : false
hostname : "localhost"
port : 3306
database : "cryptomarket"
user : "root"
password : "1234"
#Set here the currency to compare against the cryptocoin value
physical-currency : USD
#Coins that the plugin will work with (you can find a list of valid coin in the digital_currency_list.csv file inside the JAR)
coins :
- BTC
- LTC
- ETH
#The main menu of the plugin, accessed using /cryptomarket
menu :
#Name of the menu
name : "&7CryptoMarket"
#Items configuration
items :
#The item that shows the current Exchange Rates
coins:
name : "&7Coins / Values"
#The lore of Coins item
# {0} holds space for the coin line(s)
lore :
- " "
- "&f{0}"
- " "
- "&7Right Click - &aBuy"
- "&7Left Click - &cSell"
#For each coin you added to the coin list, a coin-line will be added to the lore
# {0} is the name of the coin
# {1} is the value
coin-line : "&f{0} &7{1}"
#Message showed instead of the value when there has been an error
error-no-data : "Error, update!"
#The item that shows the current balance of the investor
wallet:
name : "&3Wallet"
#The lore of the Wallet
# {0} is the investor's server balance (Vault)
# {1} is a placeholder for the coin line(s) (it works like the Coins item)
lore :
- " "
- "&f{0}"
- " "
- "&f{1}"
#Please refer to the Coins item, they work the same way
coin-line : "&f{0} &7{1}"
#The item that shows the profit if the investor sells all balance of one coin
profit:
name : "&fProfit selling now"
#The lore of the Profit item
# {0} is a placeholder for the coin line(s) (it works like the Coins item)
lore :
- " "
- "{0}"
- " "
#For each coin you added to the coin list, a coin-line will be added to the lore
# {0} is the name of the coin
# {1} is the color
# {2} is the percentage (it can be negative, meaning a loss)
coin-line : "&f{0} {1}{2}%"
# These are the colors that the "{1}" placeholder above will use according to the value
color:
positive : '&a'
neuter : '&f'
negative : '&c'
calendar : "&aCalendar"
update : "&aUpdate"
ranking : "&aRanking"
#The Calendar menu, accessed via main menu
#It shows the rates of previous days
calendar:
name : "&fCalendar"
items:
back : "&aBACK"
next-month : "&aNext Month"
previous-month : "&aPrevious Month"
#Configures a single day in the Calendar
day :
#Name of the Day item
# {0} is the day number
name : "&fDay {0}"
#This works like Coins' lore, please refer to it
lore :
- " "
- "{0}"
- " "
#Also works like Coins' coin line
coin-line : "{0} {1}"
#This is showed in days after today, where there is no rate yet
no-rates : "&c&oNo data"
#Message showed instead of the value when there has been an error
error-no-data : "Error, update!"
#The Ranking menu, also accessed via main menu
ranking:
name : "&fRanking"
items:
back : "&aBACK"
#Configures a richer item
richer :
#The name of the item
# {0} is the position in the rank
# {1} is the Investor's name
name : "#{0} {1}"
#The lore of the item
# {0} is the total invested converted to server coin
# {1} is the percentage compared to the server's total investments
lore :
- " "
- "{0} ({1}%)"
- " "
#If there is not investor in the rank
# {0} is the position in the rank
no-investor : "#{0} No investor"
total-investments :
# Name of the item
name : "&fTotal investments"
# {0} is the total invested in the server
lore :
- " "
- "{0}"
- " "
last-updated :
# Name of the item
name : "&fLast updated"
# {0} is the date and time
lore :
- " "
- "{0}"
- " "
#Configuration relative to the Negotiation Chat, started using the Coins item in the main menu
negotiation-chat :
#Prefix of the chat
prefix : "&7[CriptoMarket] "
#What word the user must type to end the negotiation
exit-word : "quit"
#First message of the conversation, {0} is the exit word
warning : "&fTo exit the negotiation, type &7{0}&f at any time."
choose-coin : "&fWhich coin do you want to negotiate?"
# {0} is a formated list of the coins
valid-coins : "&fValid coins: {0}"
how-much-buy : "&fHow much do you want to buy?"
how-much-sell : "&fHow much do you want to sell?"
error-insufficient-balance : "&fYou don't have enough balance!"
#If the user neither insert numbers nor a positive one
error-invalid-value : "&fPlease, insert a valid value!"
#If there had been an error fetching the rates
error-outdated-data : "&fThe negotiation failed: the data is outdated! Please use the Update button/command!"
#Everything is ready to finish the negotiation, all the user need is to confirm
# {0} is the action (sell-action or buy-action)
# {1} is the amount
# {2} is the cryptocoin
# {3} is the server coin amount
confirmation : "&fDo you want to &7{0} {1} {2} &ffor &7{3} &fcoins?"
#Used to confirm the negotiation
yes-word : "yes"
#Used to cancel it and restart
cancel-word : "cancel"
sell-action : "sell"
buy-action : "buy"
#Last message
success : "&fSuccessful negotiation!"
#Some messages the plugin will send
messages:
error-player-not-found : "&fThe inserted player was not found!"
error-invalid-amount : "&fThe inserted amount is not a valid number or is equal or less than zero!"
error-invalid-coin : "&fThe inserted coin is not valid!"
error-take-insufficient-balance : "&fThe player does not have enough balance!"
error-database : "&fThere has been an error connecting to the database, contact an admin, please!"
error-no-permission : "&fYou don't have permission to do this!"
saving-data : "&fSaving data..."
player-balance-updated : "&f{0}''s balance updated!"
# {0} is the approximated minutes to complete the update, considering the API limits
updating-content : "&fUpdating content, please, wait {0} minute(s)!"
already-uptodate : "&fThis is not necessary, the content is already up-to-date or an update is in progress!"
balance : "&fYour balance is:"
#This will be sent after balance
#One message per coin set in this config
# {0} is the coin name
# {1} is its value
balance-per-coin : "&a{0}: &f{1}"
current-rates : "The coins are worth:"
#This will be sent after the message above
#One message per coin set in this config
# {0} is the coin name
# {1} is its value
current-rates-per-coin : "&a{0}: &f{1}"
outdated-data : "Outdated data, please update!"
#If something is wrong when trying to open the Ranking menu
error-ranking-data : "&fThere has been an error accessing the Ranking data, contact an admin, please!"
new-balance : "&fYour new &7{0} balance &fis: &7{1}"
help-command :
- "&bCryptoMarket - Help"
- "&b/cm balance - shows your balance"
- "&b/cm today - shows today's exchange rates"
- "&b/cm update - updates the exchange rates"
- "&c/cm save - saves the data to the database"
- "&c/cm give <target> <amount> <coin> - gives the amount of the coin to the target player"
- "&c/cm take <target> <amount> <coin> - takes the amount of the coin from the target player"
- "&c/cm set <target> <amount> <coin> - sets the amount of the coin as the target's balance"
[COLOR=rgb(51, 102, 0)]api-key : "99X0JFXBLX2YRZA7" [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ] [/COLOR ]
[COLOR= #336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600][COLOR=#336600]#The interval to update the Exchange Rates (in minutes)
#(Please note that the API has a limit of 500 requests per day,
#so if you set an interval that trespasses this limit, the plugin will automatically choose one)
update-interval : 60
#The interval to save the investors data (in minutes)
saving-interval : 5
#The interval to update the richers list (in minutes)
richers-update-interval : 15
#MySQL Configuration
mysql :
#Do you want to use MySQL? If not, SQLite will be used
enabled : false
hostname : "localhost"
port : 3306
database : "cryptomarket"
user : "root"
password : "1234"
#Set here the currency to compare against the cryptocoin value
physical-currency : USD
#Coins that the plugin will work with (you can find a list of valid coin in the digital_currency_list.csv file inside the JAR)
coins :
- BTC
- LTC
- ETH
#The main menu of the plugin, accessed using /cryptomarket
menu :
#Name of the menu
name : "&7CryptoMarket"
#Items configuration
items :
#The item that shows the current Exchange Rates
coins:
name : "&7Coins / Values"
#The lore of Coins item
# {0} holds space for the coin line(s)
lore :
- " "
- "&f{0}"
- " "
- "&7Right Click - &aBuy"
- "&7Left Click - &cSell"
#For each coin you added to the coin list, a coin-line will be added to the lore
# {0} is the name of the coin
# {1} is the value
coin-line : "&f{0} &7{1}"
#Message showed instead of the value when there has been an error
error-no-data : "Error, update!"
#The item that shows the current balance of the investor
wallet:
name : "&3Wallet"
#The lore of the Wallet
# {0} is the investor's server balance (Vault)
# {1} is a placeholder for the coin line(s) (it works like the Coins item)
lore :
- " "
- "&f{0}"
- " "
- "&f{1}"
#Please refer to the Coins item, they work the same way
coin-line : "&f{0} &7{1}"
#The item that shows the profit if the investor sells all balance of one coin
profit:
name : "&fProfit selling now"
#The lore of the Profit item
# {0} is a placeholder for the coin line(s) (it works like the Coins item)
lore :
- " "
- "{0}"
- " "
#For each coin you added to the coin list, a coin-line will be added to the lore
# {0} is the name of the coin
# {1} is the color
# {2} is the percentage (it can be negative, meaning a loss)
coin-line : "&f{0} {1}{2}%"
# These are the colors that the "{1}" placeholder above will use according to the value
color:
positive : '&a'
neuter : '&f'
negative : '&c'
calendar : "&aCalendar"
update : "&aUpdate"
ranking : "&aRanking"
#The Calendar menu, accessed via main menu
#It shows the rates of previous days
calendar:
name : "&fCalendar"
items:
back : "&aBACK"
next-month : "&aNext Month"
previous-month : "&aPrevious Month"
#Configures a single day in the Calendar
day :
#Name of the Day item
# {0} is the day number
name : "&fDay {0}"
#This works like Coins' lore, please refer to it
lore :
- " "
- "{0}"
- " "
#Also works like Coins' coin line
coin-line : "{0} {1}"
#This is showed in days after today, where there is no rate yet
no-rates : "&c&oNo data"
#Message showed instead of the value when there has been an error
error-no-data : "Error, update!"
#The Ranking menu, also accessed via main menu
ranking:
name : "&fRanking"
items:
back : "&aBACK"
#Configures a richer item
richer :
#The name of the item
# {0} is the position in the rank
# {1} is the Investor's name
name : "#{0} {1}"
#The lore of the item
# {0} is the total invested converted to server coin
# {1} is the percentage compared to the server's total investments
lore :
- " "
- "{0} ({1}%)"
- " "
#If there is not investor in the rank
# {0} is the position in the rank
no-investor : "#{0} No investor"
total-investments :
# Name of the item
name : "&fTotal investments"
# {0} is the total invested in the server
lore :
- " "
- "{0}"
- " "
last-updated :
# Name of the item
name : "&fLast updated"
# {0} is the date and time
lore :
- " "
- "{0}"
- " "
#Configuration relative to the Negotiation Chat, started using the Coins item in the main menu
negotiation-chat :
#Prefix of the chat
prefix : "&7[CriptoMarket] "
#What word the user must type to end the negotiation
exit-word : "quit"
#First message of the conversation, {0} is the exit word
warning : "&fTo exit the negotiation, type &7{0}&f at any time."
choose-coin : "&fWhich coin do you want to negotiate?"
# {0} is a formated list of the coins
valid-coins : "&fValid coins: {0}"
how-much-buy : "&fHow much do you want to buy?"
how-much-sell : "&fHow much do you want to sell?"
error-insufficient-balance : "&fYou don't have enough balance!"
#If the user neither insert numbers nor a positive one
error-invalid-value : "&fPlease, insert a valid value!"
#If there had been an error fetching the rates
error-outdated-data : "&fThe negotiation failed: the data is outdated! Please use the Update button/command!"
#Everything is ready to finish the negotiation, all the user need is to confirm
# {0} is the action (sell-action or buy-action)
# {1} is the amount
# {2} is the cryptocoin
# {3} is the server coin amount
confirmation : "&fDo you want to &7{0} {1} {2} &ffor &7{3} &fcoins?"
#Used to confirm the negotiation
yes-word : "yes"
#Used to cancel it and restart
cancel-word : "cancel"
sell-action : "sell"
buy-action : "buy"
#Last message
success : "&fSuccessful negotiation!"
#Some messages the plugin will send
messages:
error-player-not-found : "&fThe inserted player was not found!"
error-invalid-amount : "&fThe inserted amount is not a valid number or is equal or less than zero!"
error-invalid-coin : "&fThe inserted coin is not valid!"
error-take-insufficient-balance : "&fThe player does not have enough balance!"
error-database : "&fThere has been an error connecting to the database, contact an admin, please!"
error-no-permission : "&fYou don't have permission to do this!"
saving-data : "&fSaving data..."
player-balance-updated : "&f{0}''s balance updated!"
# {0} is the approximated minutes to complete the update, considering the API limits
updating-content : "&fUpdating content, please, wait {0} minute(s)!"
already-uptodate : "&fThis is not necessary, the content is already up-to-date or an update is in progress!"
balance : "&fYour balance is:"
#This will be sent after balance
#One message per coin set in this config
# {0} is the coin name
# {1} is its value
balance-per-coin : "&a{0}: &f{1}"
current-rates : "The coins are worth:"
#This will be sent after the message above
#One message per coin set in this config
# {0} is the coin name
# {1} is its value
current-rates-per-coin : "&a{0}: &f{1}"
outdated-data : "Outdated data, please update!"
#If something is wrong when trying to open the Ranking menu
error-ranking-data : "&fThere has been an error accessing the Ranking data, contact an admin, please!"
new-balance : "&fYour new &7{0} balance &fis: &7{1}"
help-command :
- "&bCryptoMarket - Help"
- "&b/cm balance - shows your balance"
- "&b/cm today - shows today's exchange rates"
- "&b/cm update - updates the exchange rates"
- "&c/cm save - saves the data to the database"
- "&c/cm give <target> <amount> <coin> - gives the amount of the coin to the target player"
- "&c/cm take <target> <amount> <coin> - takes the amount of the coin from the target player"
- "&c/cm set <target> <amount> <coin> - sets the amount of the coin as the target's balance"
Permissions
-
cryptomarket.menu: allows the player to open the Main menu
-
cryptomarket.negotiate: allows the player to buy/sell coins
-
cryptomarket.ranking: allows the player to open the Ranking menu
-
cryptomarket.calendar: allows the player to open the Calendar menu
- cryptomarket.balance: allows the player to use /cm balance
- cryptomarket.today: allows the player to use /cm today
- cryptomarket.update: allows the player to use /cm update
-
cryptomarket.save: allows the player to use /cm save
-
cryptomarket.give: allows the player to use /cm give
-
cryptomarket.take: allows the player to use /cm take
-
cryptomarket.set: allows the player to use /cm set
Commands
API
Javadoc can be found at: https://roinujnosde.github.io/CryptoMarket/API
Dependencies
- Vault
- Economy plugin
![[IMG]](https://www.spigotmc.org/data/attachments/523/523024-1d3519d4b9b5be9931ebe93526a54d96.jpg)
Comments 0
No comments yet. Be the first to share your thoughts.