A Rust-based HTTP server providing Solana blockchain functionality through RESTful endpoints
- Generate Solana keypairs
- Create SPL token mint instructions
- Create token minting instructions
- Sign and verify messages using Ed25519
- Create SOL transfer instructions
- Create SPL token transfer instructions
Install Rust and Cargo
Clone this repository
Install dependencies:
cargo build
Run the server:
cargo run
The server will start on http://localhost:3000
curl http://localhost:3000/curl -X POST http://localhost:3000/keypaircurl -X POST http://localhost:3000/token/create \
-H "Content-Type: application/json" \
-d '{ "mintAuthority": "11111111111111111111111111111112", "mint": "11111111111111111111111111111113", "decimals": 6 }'curl -X POST http://localhost:3000/token/mint \
-H "Content-Type: application/json" \
-d '{ "mint": "mint-address", "destination": "destination-address", "authority": "authority-address", "amount": 1000000 }'curl -X POST http://localhost:3000/message/sign \
-H "Content-Type: application/json" \
-d '{ "message": "Hello, Solana!", "secret": "base58-encoded-secret-key" }'curl -X POST http://localhost:3000/message/verify \
-H "Content-Type: application/json" \
-d '{ "message": "Hello, Solana!", "signature": "base64-encoded-signature", "pubkey": "base58-encoded-public-key" }'curl -X POST http://localhost:3000/send/sol \
-H "Content-Type: application/json" \
-d '{ "from": "sender-address", "to": "recipient-address", "lamports": 100000 }'curl -X POST http://localhost:3000/send/token \
-H "Content-Type: application/json" \
-d '{ "destination": "destination-address", "mint": "mint-address", "owner": "owner-address", "amount": 100000 }'All endpoints return JSON responses with this structure:
Success (200):
{
"success": true,
"data": { /* endpoint-specific data */ }
}Error (400):
{
"success": false,
"error": "Error description"
}- Private keys are never stored on the server
- All cryptographic operations use standard, audited libraries
- Input validation is performed on all endpoints
- Ed25519 signatures are used for message signing/verification
axum- Web frameworksolana-sdk- Solana blockchain SDKspl-token- SPL Token program bindingsed25519-dalek- Ed25519 cryptographic signaturestokio- Async runtimeserde- Serialization framework