Rivellum

Rivellum Portal

Download Wallet (Chrome)
Checking...
testnet

Developer Reference: Core Flows

This page is a direct execution reference for building against Rivellum.

Runtime Endpoints

OperationEndpoint
Chain infoGET /v1/chain
BalanceGET /v1/balance/:address
NonceGET /v1/nonce/:address
Submit intentPOST /v1/submit
Submit encrypted envelopePOST /v1/submit_envelope
Recent eventsGET /v1/events/recent
Query eventsGET /v1/events/query
Stream eventsGET /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