Developer Reference: Core Flows
This page is a direct execution reference for building against Rivellum.
Runtime Endpoints
| Operation | Endpoint |
|---|---|
| Chain info | GET /v1/chain |
| Balance | GET /v1/balance/:address |
| Nonce | GET /v1/nonce/:address |
| Submit intent | POST /v1/submit |
| Submit encrypted envelope | POST /v1/submit_envelope |
| Recent events | GET /v1/events/recent |
| Query events | GET /v1/events/query |
| Stream events | GET /events/stream (WebSocket) |
Mist Contract Flows
Compile and inspect
mistc check contracts/counter.mist
mistc lint contracts/counter.mist
mistc fees contracts/counter.mist
Deploy
mistc deploy build/counter.bundle.json --rpc https://rpc.rivellum.network
Call
mistc call CONTRACT_ID increment '{"delta":1}' --rpc https://rpc.rivellum.network
Receipt + replay
mistc receipt RECEIPT_ID --rpc https://rpc.rivellum.network
mistc replay RECEIPT_ID --rpc https://rpc.rivellum.network
curl https://rpc.rivellum.network/v1/mist/replay_inputs/RECEIPT_ID
RPC Examples
Balance + nonce
curl https://rpc.rivellum.network/v1/balance/0xYOUR_ADDRESS
curl https://rpc.rivellum.network/v1/nonce/0xYOUR_ADDRESS
Submit intent payload
curl -X POST https://rpc.rivellum.network/v1/submit \
-H "Content-Type: application/json" \
-d '{
"sender": "0xSENDER...",
"nonce": 42,
"max_fee": 1000000,
"payload": {
"type": "Transfer",
"to": "0xRECIPIENT...",
"amount": "1000000000"
},
"signature": "0x..."
}'
Event query
curl "https://rpc.rivellum.network/v1/events/query?topic=native.transfer&from_batch=100&limit=50"
TypeScript SDK (AI Economy)
@rivellum/ai-sdk exposes RivellumAgent for AI-economy operations.
import { RivellumAgent } from '@rivellum/ai-sdk';
const agent = new RivellumAgent({
nodeUrl: 'https://rpc.rivellum.network',
timeoutMs: 30_000,
});
const payment = await agent.pay({ to: '0xabc...', amount: 250_000 });
const escrow = await agent.escrow({
provider: '0xprovider...',
amount: 1_000_000,
description: 'inference-job',
ttlSecs: 3600,
});
console.log({ payment, escrow });
WebSocket Stream
const ws = new WebSocket('wss://rpc.rivellum.network/events/stream?topic=native.transfer');
ws.onmessage = (msg) => {
const event = JSON.parse(msg.data);
console.log(event.topic, event.data);
};
ws.onerror = (err) => console.error('stream error', err);
ws.onclose = () => console.log('stream closed');
State Queries
Query account balances and nonces via the RPC API:
curl https://rpc.rivellum.network/v1/nonce/0xADDRESS
curl https://rpc.rivellum.network/v1/balance/0xADDRESS
Related References
/docs/dev/mist-toolchain/docs/dev/debugging-replay/docs/dev/sdk-guide/api-explorer