This API provides a wallet management system built with FastAPI. It allows users to create wallets, manage addresses, perform transactions, and access their transaction history. The API is designed to be secure, efficient, and easy to use.
http://localhost:8000
To access protected endpoints, users must authenticate and obtain a JWT token.
Endpoint: /token
Method: POST
Request Body:
{
"username": "your_username",
"password": "your_password"
}
Response:
{
"access_token": "your_jwt_token",
"token_type": "bearer"
}
Endpoint: /register
Method: POST
Request Body:
{
"username": "your_username",
"email": "your_email@example.com",
"full_name": "Your Full Name",
"password": "your_password"
}
Response:
{
"username": "your_username",
"email": "your_email@example.com",
"full_name": "Your Full Name"
}
Endpoint: /addresses
Method: GET
Headers:
Authorization: Bearer your_jwt_token
Response:
[
{
"address": "address_1",
"balance": 100.0
},
{
"address": "address_2",
"balance": 50.0
}
]
Endpoint: /addresses
Method: POST
Headers:
Authorization: Bearer your_jwt_token
Response:
{
"address": "new_address",
"balance": 0.0
}
Endpoint: /addresses/{address}
Method: DELETE
Headers:
Authorization: Bearer your_jwt_token
Response:
{
"success": true,
"message": "Address deleted successfully"
}
Endpoint: /transactions
Method: POST
Headers:
Authorization: Bearer your_jwt_token
Request Body:
{
"from_address": "source_address",
"to_address": "destination_address",
"amount": 10.0
}
Response:
{
"success": true,
"message": "Transaction successful"
}
Endpoint: /transactions
Method: GET
Headers:
Authorization: Bearer your_jwt_token
Response:
[
{
"transaction_id": "tx_1",
"from_address": "source_address",
"to_address": "destination_address",
"amount": 10.0,
"timestamp": "2023-10-01T12:00:00Z"
},
{
"transaction_id": "tx_2",
"from_address": "source_address",
"to_address": "another_address",
"amount": 5.0,
"timestamp": "2023-10-02T12:00:00Z"
}
]
Endpoint: /balance/{address}
Method: GET
Headers:
Authorization: Bearer your_jwt_token
Response:
{
"balance": 100.0
}
The API uses standard HTTP status codes to indicate the success or failure of requests. Common error responses include:
Error Response Format:
{
"detail": "Error message",
"status_code": 400
}
Endpoint: /health
Method: GET
Response:
{
"status": "healthy"
}
This API provides a robust and secure way to manage wallets and transactions. For further information or support, please refer to the project documentation or contact the development team.