Checking APIโฆ
First time here? Buy your first policy in 3 steps.
- Generate an API key โ go to /app/agent/api-keys and sign with your wallet. You'll receive an
lk_โฆkey once. - Approve USDC for CoverRouter โ the buyer wallet must allow CoverRouter to pull premium. The SDK helper
lumina.policies.ensureAllowance(buyer)does this in one call (idempotent). - POST a policy โ minimum cover is
100000000base units ($100). Premium is computed on-chain; relayer pays gas.
// npm i @lumina-org/sdk@^0.6.0 ethers
import { LuminaClient } from '@lumina-org/sdk'
import { Wallet, JsonRpcProvider } from 'ethers'
const lumina = new LuminaClient({ apiKey: process.env.LUMINA_API_KEY! })
// Honor the dedicated RPC env var (matches web3-provider.tsx) so this path is
// not stuck on a rate-limited public endpoint; fall back to public when unset.
const provider = new JsonRpcProvider(
process.env.NEXT_PUBLIC_RPC_URL_ALCHEMY ??
process.env.NEXT_PUBLIC_RPC_URL ??
'https://base-mainnet-rpc.publicnode.com',
)
const buyer = new Wallet(process.env.BUYER_PRIVATE_KEY!, provider)
// One-time: approve CoverRouter to spend USDC
await lumina.policies.ensureAllowance(buyer)
// Buy a $100 FLASHBTC1H policy.
// SDK 0.6.0 (V5.3) resolves productId hash + per-shield asset from productName,
// and pulls contract addresses at runtime via GET /health.
const receipt = await lumina.policies.purchase({
productName: 'FLASHBTC1H-001',
buyer: await buyer.getAddress(),
coverageAmount: '100000000', // $100, the on-chain minimum
})
console.log('policyId =', receipt.policyId)Lifecycle
What happens next?
A quick map of the full Lumina lifecycle โ from premium to payout.
- Buy policy in USDC โ 100% of premium burns $LUMINA.
- Trigger fires inside the policy window (oracle-observed).
- ClaimBond minted to the wallet (ERC-1155, $1 face, 730d).
- Choose: hold to maturity for $LUMINA, or sell now for USDC.
- Wait 730d โ redeemBond() mints $LUMINA at oracle price.
- Or list on the secondary marketplace today (1.5% maker + 1.5% taker, 100% burned).
/APP/AGENT/DASHBOARD ยท NO WALLET ยท LIVE
Your agent's pulse, in real time.
NO WALLET CONNECTED
โ Connect the wallet your agent uses to start monitoring.