Spielcrypto API is the API to set the percentages of price coin increment for after Spielcrypto Worker add stop loss when the price coin achieve this increment.
- Rustup
- RabbitMQ
- Postgresql
- Diesel client
- Account in Mailgun
-
git clone https://github.com/dancespiele/dancespiele_api.git -
cd dancespiele_api -
create a database in Postgresql
-
create the .env file of the root project:
SLED_URL=[PATH WHERE YOU WANT THE SLED DB FILE]
DATABASE_URL=[YOUR POSTGRESS DATABASE]
DB_SCHEMA=[YOUR SCHEMA]
SERVER_URL=[API URL]
AMPQ_ADDR=[YOUR AMPQ ADDRESS]
MAILGUN_DOMAIN=[YOUR EMAIL DOMAIN]
MAILGUN_SECRET=[YOUR MAILGUN SECRET]
MAILGUN_ENDPOINT=[YOUR MAILGUN ENDPOINT FOR EXAMPLE api.eu.mailgun.net]
MAIL_FROM=[EMAIL SENDER]
SECRET=[API SECRET]
LANGUAGE=en //for now only support en (English) or es (Spanish)
- create a .env file inside of
refinery_migrationsfolder
URL_DB=[YOUR POSTGRESS DATABASE]
SCHEMA=[YOUR SCHEMA]
- run the migrations inside of
refinery_migrations
cargo run
-
Create the file
schema.rsin root folder -
Print the schema of your database
diesel print-schema --schema [YOUR DATABASE NAME] [YOUR SCHEMA]
-
Copy everything inside of
pub mod [YOUR DATABASE NAME]and paste inschema.rs. It should looks similar toschema.rs.example -
Execute:
cargo run or with logs mode RUST_LOG=spielcrypto_api cargo=trace cargo run
- Enjoy!
Note: Before to execute Spielcrypto API you need to run the RabbitMQ server first
Endpoint: POST /user
Body Example:
{
"email": "[EMAIL]",
"username": "[USERNAME]",
"password": "[PASSWORD]",
"status": "ACTIVE"
}Note: You need to create the token for the first user, you can generate it installing this create
Endpoint POST /login
Body Example:
{
"username": "[USERNAME]",
"password": "[PASSWORD]"
}Endpoint: GET /user
Note: The api will response with the user owner of the token that is sent in the Authorization header
Endpoint: POST /percentages
Body Example:
[
{
"pair": "ETHEUR",
"new_stop_loss": "30.0",
"next_stop_loss": "10.0"
},
{
"pair": "KAVAEUR",
"new_stop_loss": "20.0",
"next_stop_loss": "10.0"
}
]Note: You need to login first to get the token to set the Authorization header
Endpoint: GET /percentages
Note: You need to login first to get the token to set the Authorization header
Spielcrypto API doesn't shutdown with Ctrl-C: For now you need to kill the process to shutdown the API. I'm trying to figure out how to fix this issue
If you like Dancespiele apps, help me supporting the projects:
- Sending coins to the address 0x619d3FA3bD7CF497d9899Ccd4d7b5663Ff318e52
- BAT rewards in case that you use Brave Browser
- Github Sponsors
- Burst coins to the address BURST-DPN6-2AT3-FCRL-9BBKG
Dancespiele API is LICENSE PARITY and LICENSE PATRON licensed. If you need a comercial license sponsor to Dancespiele in the right tier or contact to spielcrypto@gmail.com
Warning: Each functionality is tested before to avoid bugs however the author of this app is not responsible for all the issues and losses that can happen using it. Please, read the licenses.