Examples
Examples
Real integration patterns you can copy directly into your project.
E-commerce checkout
A standalone Next.js store demonstrating the full payment flow: product listing → Phantom connect → USDC quote → on-chain transfer → Solscan confirmation. Live demo at auron-mocha.vercel.app.
Project layout
ecommerce-checkout/
├── lib/
│ ├── auron.ts # AuronClient + submitPayment() helper
│ ├── solana.ts # connectPhantom(), sendUSDC(), solscanUrl()
│ └── products.ts # product catalog type + data
├── components/
│ └── AuronCheckout.tsx # 8-state payment machine
└── app/
├── page.tsx # store listing (editorial grid)
└── checkout/page.tsx # split checkout layoutPayment state machine
The checkout component cycles through 8 states — each renders a different UI with no loading spinners layered over content.
type Step =
| C8F135">"idle" C8F135">"color:#3F3F46">// amount + Pay button
| C8F135">"connecting" C8F135">"color:#3F3F46">// Phantom connection pending
| C8F135">"quoting" C8F135">"color:#3F3F46">// fetching live USDC rate
| C8F135">"confirming" C8F135">"color:#3F3F46">// user reviews invoice (60 s countdown)
| C8F135">"sending" C8F135">"color:#3F3F46">// waiting for wallet signature
| C8F135">"settling" C8F135">"color:#3F3F46">// Auron verifying on-chain
| C8F135">"done" C8F135">"color:#3F3F46">// receipt + Solscan link
| C8F135">"error"; C8F135">"color:#3F3F46">// error message + retry buttonHuman wallet flow — no API key
The demo submits payments without an x-api-key header, which triggers Auron's human wallet mode.
export async function submitPayment(body: PaymentBody) {
const res = await fetch(C8F135">"color:#C8F135">`${BASE_URL}/api/v1/pay`, {
method: C8F135">"POST",
headers: { C8F135">"Content-Type": C8F135">"application/json" },
C8F135">"color:#3F3F46">// No x-api-key → human wallet flow
body: JSON.stringify(body),
});
if (!res.ok) throw new Error(await res.text());
return res.json() as F5A623">Promise<{ paymentId: F5A623">string; status: F5A623">string }>;
}dailyLimitInr on the key row to cap exposure.AI agent integration
Auron is designed for AI agents to initiate payments programmatically. The SDK works in server-side Node.js — an agent can get a quote, confirm intent with the user, and submit the transaction signature with no browser interaction.
Claude tool use example
import Anthropic from C8F135">"@anthropic-ai/sdk";
import { AuronClient } from C8F135">"@auron-solana/sdk";
const claude = new Anthropic();
const auron = new AuronClient({
apiKey: process.env.AURON_API_KEY!,
baseUrl: C8F135">"https:C8F135">">//auron-mocha.vercel.app",
});
const tools = [
{
name: C8F135">"get_payment_quote",
description: C8F135">"Get the USDC cost for an INR payment",
input_schema: {
type: C8F135">"object" as const,
properties: {
inrAmount: { type: C8F135">"F5A623">number", description: C8F135">"INR amount to pay" },
},
required: [C8F135">"inrAmount"],
},
},
];
async function paymentAgent(userMessage: F5A623">string) {
const response = await claude.messages.create({
model: C8F135">"claude-sonnet-4-6",
max_tokens: 1024,
tools,
messages: [{ role: C8F135">"user", content: userMessage }],
});
for (const block of response.content) {
if (block.type === C8F135">"tool_use" && block.name === C8F135">"get_payment_quote") {
const { inrAmount } = block.input as { inrAmount: F5A623">number };
return await auron.getQuote(inrAmount);
}
}
}Daily spend limits
Each API key has a dailyLimitInr field in the api_keys table. Agents that exceed their limit receive 402 with remaining allowance details.
{
"error": "Daily spend limit exceeded",
"limit": 50000,
"spent": 50120,
"remaining": 0,
"resets": "2026-06-19T00: 00: 00Z"
}dailyLimitInr values. This gives you per-agent spend visibility and lets you kill a runaway agent by revoking just its key.Next.js server action
Use a Next.js Server Action to keep your API key server-side and submit payments in one step from a form.
C8F135">"use server";
import { AuronClient } from C8F135">"@auron-solana/sdk";
const auron = new AuronClient({
apiKey: process.env.AURON_API_KEY!,
baseUrl: C8F135">"https:C8F135">">//auron-mocha.vercel.app",
});
export async function createQuote(inrAmount: F5A623">number) {
return auron.getQuote(inrAmount);
}
export async function processPayment(formData: FormData) {
const txSignature = formData.get(C8F135">"txSignature") as F5A623">string;
const inrAmount = Number(formData.get(C8F135">"inrAmount"));
const quote = await auron.getQuote(inrAmount);
const res = await fetch(C8F135">"https:C8F135">">//auron-mocha.vercel.app/api/v1/pay", {
method: C8F135">"POST",
headers: { C8F135">"Content-Type": C8F135">"application/json", C8F135">"x-api-key": process.env.AURON_API_KEY! },
body: JSON.stringify({
txSignature,
inrAmount,
usdcAmount: quote.usdcAmount,
quoteFxRate: quote.auronRate,
merchantUpiId: process.env.MERCHANT_UPI!,
merchantName: C8F135">"My Store",
paymentId: crypto.randomUUID().replace(/-/g, C8F135">""),
idempotencyKey: crypto.randomUUID().replace(/-/g, C8F135">""),
}),
});
if (!res.ok) throw new Error(await res.text());
return res.json();
}