Mobile Integration
Rivellum mobile integration can use dedicated game SDKs, TypeScript SDK flows, or direct REST RPC depending on architecture.
Architecture
Mobile clients interact with Rivellum nodes via HTTP/JSON. SDK selection depends on app stack:
Mobile Client (Unity/Godot/React Native/Native) -> SDK or HTTP layer -> Rivellum Node RPC
Integration Approach
SDK-First Options
- Unity mobile builds: use
sdk/unity/(C#). - Godot mobile builds: use
sdk/godot/(GDScript/C# bridge). - React Native or TypeScript mobile apps: use
@rivellum/sdkand/or@rivellum/ai-sdkaccording to workload.
See /docs/dev/sdk-surface for the full SDK matrix.
REST API
All node functionality is accessible through the JSON REST API. Use your platform's HTTP client:
Swift (iOS):
import Foundation
struct RivellumClient {
let nodeUrl: String
func getBalance(address: String) async throws -> Data {
let url = URL(string: "\(nodeUrl)/v1/balance/\(address)")!
let (data, _) = try await URLSession.shared.data(from: url)
return data
}
func submitEnvelope(payload: Data) async throws -> Data {
var request = URLRequest(url: URL(string: "\(nodeUrl)/v1/submit_envelope")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = payload
let (data, _) = try await URLSession.shared.data(for: request)
return data
}
}
Java (Android):
import okhttp3.*;
import okhttp3.MediaType;
import java.io.IOException;
public class RivellumClient {
private final String nodeUrl;
private final OkHttpClient client = new OkHttpClient();
private final MediaType json = MediaType.get("application/json");
public RivellumClient(String nodeUrl) {
this.nodeUrl = nodeUrl;
}
public String getBalance(String address) throws IOException {
Request request = new Request.Builder()
.url(nodeUrl + "/v1/balance/" + address)
.build();
try (Response response = client.newCall(request).execute()) {
return response.body().string();
}
}
public String submitEnvelope(String payload) throws IOException {
RequestBody body = RequestBody.create(payload, json);
Request request = new Request.Builder()
.url(nodeUrl + "/v1/submit_envelope")
.post(body)
.build();
try (Response response = client.newCall(request).execute()) {
return response.body().string();
}
}
}
Key Endpoints
| Endpoint | Use Case |
|---|---|
GET /v1/balance/:address | Wallet balance display |
GET /v1/nonce/:address | Nonce for intent signing |
POST /v1/submit_envelope | Submit encrypted envelope payloads |
POST /v1/faucet/mint | Fund wallets (testnet only) |
GET /events/stream | Real-time event notifications (SSE) |
Considerations
- Signing: Rivellum uses Dilithium3 (post-quantum, 3,309-byte signatures). Mobile clients need a Dilithium signing library, or can delegate signing to a trusted backend.
- Key storage: Use platform secure enclaves (iOS Keychain, Android Keystore) for private key material.
- Network: Always use HTTPS in production. The node itself serves HTTP; place a TLS-terminating reverse proxy in front.
- Offline signing: Build and sign intents offline, then submit when connectivity is available.
TypeScript SDK (React Native)
For React Native apps, TypeScript SDK tracks are:
npm install @rivellum/sdk
npm install @rivellum/ai-sdk
import { RivellumClient } from '@rivellum/sdk';
import { RivellumAgent } from '@rivellum/ai-sdk';
const chainClient = new RivellumClient({ nodeUrl: 'https://node.example.com' });
const agent = new RivellumAgent({ nodeUrl: 'https://node.example.com' });
const balance = await chainClient.getBalance('0x1234...');
// For AI-economy operations (payments, escrow, market queries):
const result = await agent.pay({ ... });
console.log(balance.balance, result.status);
See:
/docs/dev/sdk-guide/docs/dev/sdk-surface/docs/dev/unity-integration/docs/dev/godot-integration