internet-court/internet-court-skill / vendored/jupiter/integrating-jupiter
integrating-jupiter
VerifiedComprehensive guidance for integrating Jupiter APIs (Swap, Lend, Perps, Trigger, Recurring, Tokens, Price, Portfolio, Prediction Markets, Send, Studio, Lock, Routing). Use for endpoint selection, integration flows, error handling, and production hardening.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.0 KB |
| README.md | markdown | 1.6 KB |
| SKILL.md | skill md | 29.6 KB |
| examples/lend.md | markdown | 1.8 KB |
| examples/price.md | markdown | 1.8 KB |
| examples/swap.md | markdown | 2.9 KB |
| examples/trigger.md | markdown | 7.1 KB |
examples/lend.md
View on GitHub# Lend: USDC Deposit Example
> **Prerequisites:** This example uses the `jupiterFetch` and `signAndSend` helpers
> defined in the **Developer Quickstart** section of the main `SKILL.md`.
> `jupiterFetch` prepends `https://api.jup.ag` to every path and attaches the
> `x-api-key` header automatically. `signAndSend` deserializes, signs, and submits
> a base64-encoded `VersionedTransaction`.
```typescript
import { Connection, Keypair } from '@solana/web3.js';
import bs58 from 'bs58';
// jupiterFetch<T>(path, init?) is defined in Developer Quickstart (SKILL.md).
// signAndSend(txBase64, wallet, connection, additionalSigners?) is defined there too.
const RPC_URL = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
const connection = new Connection(RPC_URL);
const wallet = Keypair.fromSecretKey(bs58.decode(process.env.WALLET_PRIVATE_KEY!));
const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
async function depositToLend(amount: number, asset: string) {
// 1. Get deposit transaction
const data = await jupiterFetch<{ transaction: string }>('/lend/v1/earn/deposit', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
asset,
signer: wallet.publicKey.toBase58(),
amount: amount.toString(),
}),
});
// 2. Sign and send the returned transaction
const signature = await signAndSend(data.transaction, wallet, connection);
// 3. Confirm
const confirmation = await connection.confirmTransaction(signature, 'confirmed');
if (confirmation.value.err) {
throw new Error(`Transaction failed: ${JSON.stringify(confirmation.value.err)}`);
}
return { signature, explorerUrl: `https://solscan.io/tx/${signature}` };
}
// Usage: depositToLend(1_000_000_000, USDC_MINT) → deposits 1000 USDC (6 decimals)
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |