@sima-prime/agent-sdk
v0.2.0
Published
TypeScript SDK foundation for SIMA agent and bot integrations.
Maintainers
Readme
SIMA Agent SDK
TypeScript client for SIMA's production agent protection purchase API.
Package: @sima-prime/agent-sdk
OpenAPI: https://sima-prime.com/openapi.json
API base: https://api.sima-prime.com
Core principle:
For bots and AI agents, the API is the product.Install
npm install @sima-prime/agent-sdkpnpm add @sima-prime/agent-sdk
yarn add @sima-prime/agent-sdkProduction purchase flow
Aligned to OpenAPI x-sima-agent-protection-purchase-flow-path:
POST /agent/wallet/nonce
POST /agent/wallet/verify
POST /agent/protection/offer
POST /agent/protection/purchase
GET /agent/protection/certificates/{id}/payment-intent
→ caller sends SOL on-chain (outside SDK)
POST /agent/protection/certificates/{id}/confirm-payment
GET /agent/protection/certificates/{id}All commercial amounts are asset-denominated (contract asset / SOL). There are no USD commercial fields.
Quickstart
import { SimaAgentClient } from "@sima-prime/agent-sdk";
const client = new SimaAgentClient();
const nonce = await client.requestWalletNonce("YOUR_WALLET_ADDRESS");
// Sign nonce.message with your wallet outside this SDK.
const auth = await client.verifyWalletSignature({
chain: "SOLANA",
walletAddress: "YOUR_WALLET_ADDRESS",
message: nonce.message,
signature: "YOUR_SIGNATURE",
});
client.setAccessToken(auth.accessToken);
const offer = await client.getProtectionOffer({
chain: "SOLANA",
walletAddress: "YOUR_WALLET_ADDRESS",
assetAddress: "YOUR_ASSET_ADDRESS",
assetSymbol: "EXAMPLE",
assetType: "TOKEN",
protectedAmount: "1000",
});
const purchase = await client.purchaseProtection({
...offer,
chain: "SOLANA",
walletAddress: "YOUR_WALLET_ADDRESS",
assetAddress: "YOUR_ASSET_ADDRESS",
assetType: "TOKEN",
protectedAmount: offer.protectedAmount,
offerId: offer.offerId,
protectionDecision: "PURCHASE_PROTECTION",
});
if (purchase.protectionDecision !== "PURCHASE_PROTECTION") {
throw new Error("Protection declined");
}
const intent = await client.getPurchasePaymentIntent(purchase.certificateId);
// Send intent.amountDue SOL to intent.destinationTreasuryWalletAddress
// with your wallet / bot runtime. Keep the on-chain signature.
const active = await client.confirmPurchasePayment(purchase.certificateId, {
paymentReference: intent.paymentReference,
transactionSignature: "YOUR_ON_CHAIN_SIGNATURE",
});
console.log(active.certificateNumber, active.certificateStatus);Client methods
| Method | Endpoint |
| --- | --- |
| requestWalletNonce | POST /agent/wallet/nonce |
| verifyWalletSignature | POST /agent/wallet/verify |
| getProtectionOffer | POST /agent/protection/offer |
| purchaseProtection | POST /agent/protection/purchase |
| getPurchasePaymentIntent | GET /agent/protection/certificates/{id}/payment-intent |
| confirmPurchasePayment | POST /agent/protection/certificates/{id}/confirm-payment |
| getProtectionCertificate | GET /agent/protection/certificates/{id} |
SIMA V1 economics
Premium = 5% of protected amount
Coverage = 50% of protected amount
Deductible = 10% of protected amount
Maximum Net Payment = 40% of protected amountOfficial timing (BM-001)
| Concept | Duration | | --- | --- | | Quote Validity | 30 seconds | | Payment Window | 30 seconds after acceptance | | Protection Window | 5 minutes after premium payment | | Certificate Lifetime | 24 hours from issuance | | Claim Window | 24 hours from issuance | | Historical Record | Permanent |
Safety boundaries
The SDK does not:
- store private keys or seed phrases
- sign wallet messages
- execute blockchain transfers or collect premium on-chain
- approve claims or authorize payouts
- change SIMA V1 economics
A certificate is purchased coverage and the right to submit a claim for investigation. Claim decisions and treasury payout remain separate steps.
MCP
Read-only discovery MCP (does not call the API):
npx @sima-prime/mcp-serversima_get_quote_flow documents getProtectionOffer with protectedAmount (asset-denominated).
Examples
examples/basic-flow.ts
examples/purchase-flow.tsPlaceholders only: YOUR_WALLET_ADDRESS, YOUR_SIGNATURE, YOUR_ON_CHAIN_SIGNATURE, etc.
Documentation
https://sima-prime.com/developers/public
https://sima-prime.com/openapi.json
https://sima-prime.com/llms.txt
https://sima-prime.com/ai-catalog.jsonBuild
npm install
npm run buildOpen source boundary
This repository is the public SDK, examples, and discovery metadata.
Private core systems (treasury ops, claims investigation internals, production deployment) remain in the private SIMA monorepo.
