Cryptocurrency exchange where users can buy and sell currency.
make venv
make test
make lint
make format
make init_db
make up
POST /currency/add
Adds a new cryptocurrency with the specified name if it doesn't exist.
{
"name": "your_currency"
}
GET /currency/<currency_name>
Returns extended information about the specified cryptocurrency if it exists.
Note that currency_name
parameter must be in lowercase.
GET /currency/all
Returns information about all cryptocurrencies.
POST /user/registration
{
"name": "your_name"
}
Adds a user to the exchange.
GET /user/<user_name>
Returns information about the specified user if it exists.
GET /user/<user_name>/operations?limit=10&page=1
Parameter | Type | Description |
---|---|---|
limit |
int |
Required. Number of operations per page. |
page |
int |
Required. Page number (starts with 0). |
Returns paginated list of user operations.
POST /trade
{
"currency_name": "currency_name",
"user_name": "user_name",
"operation": "buy/sell",
"currency_amount": 1.1,
"exchange_rate": 43.21
}
Performs the specified operation for the specified user.
- Python
- Poetry
- Flask
- SQLAlchemy
- Pydantic
- Pytest
- Git
- GitHub
- Docker
- Docker Compose