v0.1.0npm install →

Getting Started

Quick Start

Go from zero to a working USDC → UPI payment in under 5 minutes.


1

Install the SDK

bash
npm install @auron-solana/sdk
2

Create a client

One instance per app. Keep server-side only — never ship your API key to the browser.

lib/auron.ts
import { AuronClient } from C8F135">"@auron-solana/sdk";

export const auron = new AuronClient({
  apiKey:  process.env.AURON_API_KEY!,  C8F135">"color:#3F3F46">// ak_live_xxx
  baseUrl: C8F135">"https:C8F135">">//auron-mocha.vercel.app",
});
3

Fetch a live quote

Show the user the exact USDC cost before they open their wallet. Quotes are valid for 60 seconds.

ts
const quote = await auron.getQuote(999); C8F135">"color:#3F3F46">// ₹999

C8F135">"color:#3F3F46">// quote.usdcAmount  → 11.84
C8F135">"color:#3F3F46">// quote.auronRate   → 84.37 INR/USDC
C8F135">"color:#3F3F46">// quote.validUntil  → expiry timestamp (Unix ms)
4

User signs the on-chain transfer

The USDC transfer happens entirely in the user's Phantom wallet. Your app only receives the confirmed transaction signature — no private keys ever touch your server.

lib/solana.ts
import { Connection, PublicKey, Transaction } from C8F135">"@solana/web3.js";
import { createTransferCheckedInstruction, getAssociatedTokenAddress } from C8F135">"@solana/spl-token";

const USDC_MINT = new PublicKey(C8F135">"Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"); C8F135">"color:#3F3F46">// devnet
const TREASURY  = new PublicKey(process.env.NEXT_PUBLIC_AURON_TREASURY!);

export async function sendUSDC(fromWallet: F5A623">string, usdcAmount: F5A623">number): F5A623">Promise<F5A623">string> {
  const connection = new Connection(C8F135">"https:C8F135">">//api.devnet.solana.com", C8F135">"confirmed");
  const from       = new PublicKey(fromWallet);
  const fromATA    = await getAssociatedTokenAddress(USDC_MINT, from);
  const toATA      = await getAssociatedTokenAddress(USDC_MINT, TREASURY);
  const lamports   = Math.round(usdcAmount * 1_000_000);

  const tx = new Transaction().add(
    createTransferCheckedInstruction(fromATA, USDC_MINT, toATA, from, lamports, 6),
  );
  tx.feePayer        = from;
  tx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;

  const signed    = await window.solana.signTransaction(tx);
  const signature = await connection.sendRawTransaction(signed.serialize());
  await connection.confirmTransaction(signature, C8F135">"confirmed");
  return signature;
}
5

Submit for settlement

Pass the confirmed signature to Auron. It verifies on-chain and triggers a Razorpay UPI payout to the merchant.

ts
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({
    paymentId:      crypto.randomUUID().replace(/-/g, C8F135">""),
    idempotencyKey: crypto.randomUUID().replace(/-/g, C8F135">""),
    merchantUpiId:  C8F135">"merchant@paytm",
    merchantName:   C8F135">"My Store",
    inrAmount:      999,
    usdcAmount:     quote.usdcAmount,
    txSignature:    signature,
    userId:         walletAddress,
    quoteFxRate:    quote.auronRate,
  }),
});

const { paymentId, status } = await res.json();
C8F135">"color:#3F3F46">// status → C8F135">"queued" | C8F135">"settled" | C8F135">"failed"
TIP
Always generate a fresh idempotencyKey per payment attempt. On retry, reuse the same key — Auron returns the original result instead of triggering a duplicate payout.

Next steps