QuasarFlow API provides a simple REST interface to the Stellar network, eliminating the need to learn complex blockchain protocols. Build blockchain-powered applications using familiar HTTP requests.
QuasarFlow is a blockchain abstraction API that simplifies Stellar network integration. Instead of learning cryptographic key management and blockchain-specific SDKs, developers can build blockchain features using simple REST API calls.
1# Clone and setup
2git clone https://github.com/QuasarAPI/quasarflow-api.git
3cd quasarflow-api
4
5# Setup environment
6cp .env.example .env
7nano .env # customize settings
8
9# Start all services
10docker-compose up -d
11
12# View logs
13docker-compose logs -f quasarflow-api
1# Prerequisites: Go 1.21+, PostgreSQL 12+
2git clone https://github.com/QuasarAPI/quasarflow-api.git
3cd quasarflow-api
4go mod download
5
6# Setup database
7createdb quasarflow
8./scripts/db-manage.sh migrate-up
9
10# Configure and run
11cp .env.example .env
12go run ./cmd/api/main.go
1# 1. Login and get token
2TOKEN=$(curl -s -X POST https://quasarflow.dev/api/auth/login \
3 -H "Content-Type: application/json" \
4 -d '{"username": "admin", "password": "admin123"}' | jq -r '.data.token')
5
6# 2. Create a wallet
7WALLET_ID=$(curl -s -X POST https://quasarflow.dev/api/v1/wallets \
8 -H "Content-Type: application/json" \
9 -H "Authorization: Bearer $TOKEN" \
10 -d '{"network": "testnet"}' | jq -r '.data.id')
11
12# 3. Fund wallet (development only)
13curl -X POST https://quasarflow.dev/api/v1/wallets/$WALLET_ID/fund \
14 -H "Authorization: Bearer $TOKEN"
15
16# 4. Check balance
17curl https://quasarflow.dev/api/v1/wallets/$WALLET_ID/balance \
18 -H "Authorization: Bearer $TOKEN"
Use admin/admin123
oruser/user123
for testing.
QuasarFlow API uses JWT (JSON Web Tokens) for authentication. All protected endpoints require a valid JWT token in the Authorization header.
Authorization: Bearer <token>
header1curl -X POST https://quasarflow.dev/api/auth/login \
2 -H "Content-Type: application/json" \
3 -d '{
4 "username": "admin",
5 "password": "admin123"
6 }'
7
8# Response
9{
10 "success": true,
11 "data": {
12 "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
13 "expires_at": "2024-01-01T12:00:00Z"
14 }
15}
QuasarFlow handles all the complexity of blockchain wallet management, including key generation, encryption, and secure storage.
1curl -X POST https://quasarflow.dev/api/v1/wallets \
2 -H "Authorization: Bearer YOUR_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "network": "testnet"
6 }'
7
8# Response
9{
10 "success": true,
11 "data": {
12 "id": "wallet_123",
13 "public_key": "GABC123...",
14 "network": "testnet",
15 "created_at": "2024-01-01T12:00:00Z"
16 }
17}
1curl https://quasarflow.dev/api/v1/wallets/wallet_123/balance \
2 -H "Authorization: Bearer YOUR_TOKEN"
3
4# Response
5{
6 "success": true,
7 "data": {
8 "balances": [
9 {
10 "asset": "XLM",
11 "amount": "1000.0000000"
12 }
13 ]
14 }
15}
curl -X POST https://quasarflow.dev/api/v1/wallets/wallet_123/payment \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "GDEF456...",
"amount": "10.5",
"asset": "XLM",
"memo": "Payment for services"
}'
# Response
{
"success": true,
"data": {
"transaction_hash": "abc123...",
"status": "pending"
}
}
QuasarFlow API supports users with existing Stellar wallets through ownership verification. Users can prove they own a wallet without registering with the platform.
# 1. Generate challenge for wallet
CHALLENGE=$(curl -s https://quasarflow.dev/api/v1/accounts/GABC123.../challenge | jq -r '.challenge')
# 2. Sign challenge with private key (client-side)
# This requires a Stellar SDK implementation in your application
SIGNATURE="base64_encoded_signature"
# 3. Verify ownership
curl -X POST https://quasarflow.dev/api/v1/accounts/GABC123.../verify-ownership \
-H "Content-Type: application/json" \
-d '{
"signature": "'$SIGNATURE'",
"message": "'$CHALLENGE'"
}'
# 4. Alternative: Verify via recent transaction
curl -X POST https://quasarflow.dev/api/v1/accounts/GABC123.../verify-transaction \
-H "Content-Type: application/json" \
-d '{
"transaction_hash": "transaction_hash_here"
}'
# Copy and customize environment file
cp .env.example .env
nano .env # Edit with your settings
Variable | Description | Example |
---|---|---|
ENV | Environment | development, production |
STELLAR_NETWORK | Stellar network | local, testnet, mainnet |
ENCRYPTION_KEY | AES key (32 bytes) | openssl rand -base64 32 |
JWT_SECRET | JWT secret (32+ chars) | SecureProductionSecret123! |
QuasarFlow API follows Clean Architecture principles for maintainability and testability.
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā HTTP Layer ā
ā (REST API, Middleware, Routing) ā
āāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāā
ā Use Case Layer ā
ā (Business Logic & Rules) ā
āāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāā
ā Domain Layer ā
ā (Entities & Interfaces) ā
āāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāā
ā Infrastructure Layer ā
ā (Database, Stellar Client, Crypto) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
quasarflow-api/
āāā .cursor/rules/ # Cursor IDE rules
āāā cmd/api/ # Application entry point
āāā docs/ # API documentation
āāā internal/ # Private application code
ā āāā config/ # Configuration management
ā āāā domain/ # Business entities & interfaces
ā āāā infrastructure/ # Database, Stellar, Crypto
ā āāā interface/http/ # REST API, Handlers, Middleware
ā āāā usecase/ # Business logic
āāā migrations/ # Database schema migrations
āāā pkg/ # Shared utilities
āāā scripts/ # Build and deployment scripts
āāā .dockerignore # Docker ignore file
āāā .env.example # Environment variables template
āāā .gitignore # Git ignore file
āāā Dockerfile # Docker container definition
āāā LICENSE # MIT License
āāā README.md # Project documentation
āāā api # API specification
āāā docker-compose.yml # Docker services configuration
āāā go.mod # Go module definition
āāā go.sum # Go module checksums