@solana/kora
v0.1.0
Published
TypeScript SDK for Kora RPC
Readme
Kora TypeScript SDK
A TypeScript SDK for interacting with the Kora RPC server. This SDK provides a type-safe interface to all Kora RPC methods.
Development
Building from Source
# Install dependencies
pnpm install
# Build the SDK
pnpm run buildRunning Tests
Start your local Kora RPC Server from the root project directory:
kora --config tests/src/common/fixtures/kora-test.toml rpc start --signers-config tests/src/common/fixtures/signers.tomlTests rely on Solana CLI's local test validator.
Run:
pnpm test:ci:integrationThis will start a local test validator and run all tests.
Quick Start
import { KoraClient } from '@solana/kora';
// Initialize the client with your RPC endpoint
const client = new KoraClient({ rpcUrl: 'http://localhost:8080' });
// Example: Transfer tokens
const result = await client.transferTransaction({
amount: 1000000, // 1 USDC (6 decimals)
token: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC mint
source: "sourceAddress",
destination: "destinationAddress"
});
// Access the base64 encoded transaction, base64 encoded message, and parsed instructions directly
console.log('Transaction:', result.transaction);
console.log('Message:', result.message);
console.log('Instructions:', result.instructions);