Beta Access: RINNAI is currently in beta on Solana Devnet. View Roadmap →

Build with RINNAI

Everything you need to integrate intent-based automation into your application.

Quickstart

1

Install SDK

npm install @rinnai/sdk
# or
pnpm add @rinnai/sdk
2

Initialize Client

import { RinnaiClient } from '@rinnai/sdk';

const client = new RinnaiClient({
  cluster: 'devnet',
  commitment: 'confirmed'
});
3

Define Intent

const intent = defineIntent({
  goal: 'Swap 10 SOL to USDC',
  constraints: {
    maxSlippage: 0.5,
    timeout: '1h'
  }
});
4

Execute

const policy = attachPolicy(intent, {
  maxSpend: 10,
  allowedPrograms: ['Jupiter']
});

const result = await client.submitExecution(policy);

API Reference

Core SDK methods and utilities

defineIntent(config)

Create structured intent from user goals and constraints

Returns: Intent
attachPolicy(intent, rules)

Attach policy constraints to an intent for validation

Returns: PolicyIntent
simulatePlan(policy)

Simulate execution plan without submitting to blockchain

Returns: Promise<Plan>
submitExecution(policy)

Submit signed execution request to on-chain program

Returns: Promise<Result>
createAutomation(policy)

Create recurring automation with specified schedule

Returns: Promise<Automation>
getExecutionHistory()

Retrieve complete execution history with audit trail

Returns: Promise<History[]>

Example Integrations

Jupiter Swap Automation

Automated token swaps with price conditions

const swapIntent = defineIntent({
  action: 'swap',
  from: { token: 'SOL', amount: 10 },
  to: { token: 'USDC' },
  condition: { price: { gte: 150 } }
});

const policy = attachPolicy(swapIntent, {
  maxSlippage: 0.5,
  allowedPrograms: ['Jupiter']
});

await client.submitExecution(policy);

Architecture for Builders

Understand how RINNAI components work together

Policy DSL

Domain-specific language for defining execution constraints. Supports spending limits, program allowlists, time windows, and custom validation rules.

policy {
  maxSpend: 100 SOL
  programs: [Jupiter, Raydium]
  slippage: 0.5%
  timeWindow: 1h
}

Webhooks & Events

Subscribe to execution events for real-time notifications. Supports success, failure, and policy violation events.

client.on('execution:success', (event) => {
  console.log('Executed:', event);
});