Quick Start
- Install a wallet and request test tokens from the faucet (coming soon).
- Install CLI: npm i -g @sanaol/cli
- Scaffold a contract: sana init hello-world → sana build → sana deploy --network testnet
- Verify in Explorer: /explorer
Network & RPC
Mainnet (planned)
- Chain: sana-mainnet
- RPC (HTTPS): https://rpc.sanaol.net
- WS: wss://rpc.sanaol.net/ws
Testnet (public)
- Chain: sana-testnet
- RPC (HTTPS): https://test-rpc.sanaol.net
- WS: wss://test-rpc.sanaol.net/ws
Faucet
- https://faucet.sanaol.net (soon)
- CLI: sana faucet <address>
Tip: all examples below assume testnet.
SDK Examples
// JavaScript/TypeScript
import { Sanaol, Keypair } from "@sanaol/sdk";
const client = new Sanaol({ rpcUrl: "https://test-rpc.sanaol.net" });
async function demo() {
// Read: recent txns
const txns = await client.tx.list({ limit: 10 });
console.log(txns);
// Write: simple transfer
const from = Keypair.fromSecret(process.env.PRIVKEY!);
const sig = await client.tx.transfer({
from,
to: "Hk2f...9P8a",
amount: 100_000, // minor units
});
console.log("submitted:", sig);
}
demo();HTTP Endpoints
/api/budgetsGET
Sample budgets feed (demo)
/api/txnsGET
Sample transactions feed (demo)
/rpcPOST
JSON-RPC (submit Tx, get block, etc.)
cURL — list transactions
curl -s https://sanaol.net/api/txns | jq .[0]
JSON-RPC — submit transaction
curl -s https://test-rpc.sanaol.net/rpc \
-H 'content-type: application/json' \
-d '{
"jsonrpc":"2.0",
"id":"1",
"method":"tx_submit",
"params":{ "signedTx":"BASE64_OR_HEX" }
}'Pagination & Filtering
- limit — 1..200 (default 50)
- before — cursor or timestamp for backward paging
- since — ISO8601/epoch filter by time
- status — success|failed|pending
GET /api/txns?limit=50&status=success&since=2025-08-01T00:00:00Z
Errors
// HTTP JSON error shape
{
"error": {
"code": "INVALID_PARAM", // or UNAUTHORIZED, INTERNAL
"message": "Invalid input."
}
}JSON-RPC follows the spec: { jsonrpc, id, error: { code, message, data? } }
Webhooks (optional)
Subscribe to events like tx_confirmed or budget_updated.
POST /api/webhooks
{
"url": "https://your.app/hook",
"events": ["tx_confirmed", "tx_failed"]
}We sign webhook POSTs with X-Sanaol-Signature (HMAC-SHA256).
Contract Scaffold (Rust)
// examples/hello/src/lib.rs
use sana_sdk::{context::Context, prelude::*};
#[contract]
pub struct Hello;
#[derive(Serialize, Deserialize)]
pub struct HelloArgs {
pub name: String,
}
#[entrypoint]
impl Hello {
pub fn say(ctx: Context, args: HelloArgs) -> Result<()> {
let who = args.name;
log!("Hello, {}! tx={}", who, ctx.tx_sig());
Ok(())
}
}
// build: sana build
// deploy: sana deploy --program target/hello.so --network testnetDocs Security Notes
These docs are informational for developers. Examples may reference keys, tokens, or endpoints—never paste real secrets into the browser console, and store credentials securely in your own environment. The docs site itself does not collect personal data or keys.