Install SDK
npm install @sima-prime/agent-sdk
# https://github.com/Mustafashehab/SIMA-Agent-SDK
SIMASDK Examples
OpenAPI-aligned examples using @sima-prime/agent-sdk 0.2.0 — offer → purchase → payment-intent → confirm-payment.
npm install @sima-prime/agent-sdk
# https://github.com/Mustafashehab/SIMA-Agent-SDKimport { SimaAgentClient } from "@sima-prime/agent-sdk";
const client = new SimaAgentClient({
apiBaseUrl: "https://api.sima-prime.com",
});const nonce = await client.requestWalletNonce("YOUR_WALLET_ADDRESS");
// Sign nonce.message outside SIMA, then:
const session = await client.verifyWalletSignature({
chain: "SOLANA",
walletAddress: "YOUR_WALLET_ADDRESS",
message: nonce.message,
signature: "YOUR_SIGNATURE",
});
client.setAccessToken(session.accessToken);const offer = await client.getProtectionOffer({
chain: "SOLANA",
walletAddress: "YOUR_WALLET_ADDRESS",
assetAddress: "TOKEN_ADDRESS",
assetSymbol: "TOKEN",
assetType: "TOKEN",
protectedAmount: "1000",
});const purchase = await client.purchaseProtection({
...offer,
offerId: offer.offerId,
protectionDecision: "PURCHASE_PROTECTION",
});
const intent = await client.getPurchasePaymentIntent(purchase.certificateId);
// Send SOL on-chain, then:
await client.confirmPurchasePayment(purchase.certificateId, {
paymentReference: intent.paymentReference,
transactionSignature: "YOUR_ON_CHAIN_SIGNATURE",
});