Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.45 KB

File metadata and controls

60 lines (40 loc) · 1.45 KB

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 build

Running 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.toml

Tests rely on Solana CLI's local test validator.

Run:

pnpm test:ci:integration

This will start a local test validator and run all tests.

Quick Start

import { KoraClient } from '@kora/sdk';

// 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);

→ API Reference → Quick Start