Use this file to discover all available pages before exploring further.
Users deposit assets into Earn vaults or supply them to Kamino’s lending markets as collateral to borrow against. Developers can integrate the same flows using the SDK’s composable methods for deposits, borrows, repayments, and withdrawals.
Using AI tools or building with LLMs? Use our llms.txt for a structured index of the docs, and skill.md for Kamino’s full API and SDK capability reference.
Install the Klend Typescript SDK and Solana Kit packages.
npm i @kamino-finance/klend-sdk @solana/kit
2
Setup the RPC (optional)
Use a private RPC for reliability. Public RPCs are often rate-limited and can cause transaction failures.
Multiple RPC providers are available. Helius is one option. @solana/kit is used for standardized RPC interactions with improved type safety and better handling of Solana transactions.
import { createSolanaRpc } from '@solana/kit';const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
3
Create or Import Wallet (optional)
Choose a method to create or import a wallet for signing transactions.
Alternatively, create a wallet using a browser wallet provider like Phantom.
Show Create with CLI
Use the Solana CLI to generate a new keypair file.
solana-keygen new -o wallet.json
Show Create with Solana Kit
Generate a new keypair programmatically using the Solana Kit.
import { createKeyPairSignerFromBytes } from '@solana/kit';import fs from 'fs';import path from 'path';import os from 'os';const resolvedPath = path.resolve( filePath.startsWith("~") ? filePath.replace("~", os.homedir()) : filePath);const loadedKeyBytes = Uint8Array.from( JSON.parse(fs.readFileSync(resolvedPath, "utf8")));const signer = await createKeyPairSignerFromBytes(loadedKeyBytes);console.log(signer.address);
Show Import Private Key
Import a private key from an existing browser wallet.
import { createKeyPairSignerFromBytes } from '@solana/kit';// Get your private key from browser wallet (as Uint8Array or number array)const privateKey = new Uint8Array([/* your private key bytes */]);const signer = await createKeyPairSignerFromBytes(privateKey);