A Rust-based HTTP server exposing Solana-related endpoints for keypair generation, SPL token operations, message signing/verification, and transaction instruction creation.
- Generate Solana keypairs
- Create SPL token mint instructions
- Create SPL token mint-to instructions
- Sign and verify messages using Ed25519
- Create SOL transfer instructions
- Create SPL token transfer instructions
cargo run
The server will start on http://0.0.0.0:3000
All endpoints return JSON responses with the following format:
{
"success": true,
"data": { /* endpoint-specific result */ }
}
{
"success": false,
"error": "Description of error"
}
POST /keypair
Generates a new Solana keypair.
Response:
{
"success": true,
"data": {
"pubkey": "base58-encoded-public-key",
"secret": "base58-encoded-secret-key"
}
}
POST /token/create
Creates a new SPL token initialize mint instruction.
Request:
{
"mintAuthority": "base58-encoded-public-key",
"mint": "base58-encoded-public-key",
"decimals": 6
}
Response:
{
"success": true,
"data": {
"program_id": "string",
"accounts": [
{
"pubkey": "pubkey",
"is_signer": false,
"is_writable": true
}
],
"instruction_data": "base64-encoded-data"
}
}
POST /token/mint
Creates a mint-to instruction for SPL tokens.
Request:
{
"mint": "mint-address",
"destination": "destination-user-address",
"authority": "authority-address",
"amount": 1000000
}
Response:
{
"success": true,
"data": {
"program_id": "string",
"accounts": [
{
"pubkey": "pubkey",
"is_signer": false,
"is_writable": true
}
],
"instruction_data": "base64-encoded-data"
}
}
POST /message/sign
Signs a message using a private key.
Request:
{
"message": "Hello, Solana!",
"secret": "base58-encoded-secret-key"
}
Response:
{
"success": true,
"data": {
"signature": "base64-encoded-signature",
"public_key": "base58-encoded-public-key",
"message": "Hello, Solana!"
}
}
POST /message/verify
Verifies a signed message.
Request:
{
"message": "Hello, Solana!",
"signature": "base64-encoded-signature",
"pubkey": "base58-encoded-public-key"
}
Response:
{
"success": true,
"data": {
"valid": true,
"message": "Hello, Solana!",
"pubkey": "base58-encoded-public-key"
}
}
POST /send/sol
Creates a SOL transfer instruction.
Request:
{
"from": "sender-address",
"to": "recipient-address",
"lamports": 100000
}
Response:
{
"success": true,
"data": {
"program_id": "system-program-id",
"accounts": [
"address-of-first-account",
"address-of-second-account"
],
"instruction_data": "base64-encoded-instruction-data"
}
}
POST /send/token
Creates an SPL token transfer instruction.
Request:
{
"destination": "destination-user-address",
"mint": "mint-address",
"owner": "owner-address",
"amount": 100000
}
Response:
{
"success": true,
"data": {
"program_id": "token-program-id",
"accounts": [
{
"pubkey": "pubkey",
"isSigner": false
}
],
"instruction_data": "base64-encoded-instruction-data"
}
}
- Uses Ed25519 for signing/verification
- Base58 encoding for public/private keys
- Base64 encoding for signatures and instruction data
- All endpoints include proper input validation
- CORS enabled for cross-origin requests
tokio
- Async runtimeaxum
- Web frameworkserde
- Serializationsolana-sdk
- Solana functionalityspl-token
- SPL token operationsbs58
- Base58 encodingbase64
- Base64 encodingtower-http
- HTTP middleware