|
1 | 1 | # Kora TypeScript SDK |
2 | 2 |
|
3 | | -A TypeScript SDK for interacting with the Kora RPC server. This SDK provides a type-safe interface to all Kora RPC methods. |
| 3 | +A TypeScript SDK for interacting with the Kora RPC server. This SDK provides a type-safe interface to all Kora RPC methods (requires a Kora RPC server to be running). |
4 | 4 |
|
5 | | -## Development |
| 5 | + |
| 6 | +## Installation |
| 7 | + |
| 8 | +```bash |
| 9 | +pnpm install @solana/kora |
| 10 | +``` |
| 11 | + |
| 12 | +## Quick Start |
| 13 | + |
| 14 | +```typescript |
| 15 | +import { KoraClient } from '@solana/kora'; |
| 16 | + |
| 17 | +// Initialize the client with your RPC endpoint |
| 18 | +const client = new KoraClient({ rpcUrl: 'http://localhost:8080' }); |
| 19 | + |
| 20 | +// Example: Get Kora to sign a transaction |
| 21 | +const result = await client.signTransaction({ |
| 22 | + transaction: 'myBase64EncodedTransaction' |
| 23 | +}); |
| 24 | + |
| 25 | +// Access the signed transaction (base64 encoded) |
| 26 | +console.log('Signed transaction:', result.signed_transaction); |
| 27 | +``` |
| 28 | + |
| 29 | +**[→ API Reference](https://launch.solana.com/docs/kora/json-rpc-api)** |
| 30 | +**[→ Quick Start](https://launch.solana.com/docs/kora/getting-started/quick-start)** |
| 31 | + |
| 32 | +## Local Development |
6 | 33 |
|
7 | 34 | ### Building from Source |
8 | 35 |
|
@@ -33,28 +60,3 @@ pnpm test:ci:integration |
33 | 60 |
|
34 | 61 | This will start a local test validator and run all tests. |
35 | 62 |
|
36 | | - |
37 | | -## Quick Start |
38 | | - |
39 | | -```typescript |
40 | | -import { KoraClient } from '@solana/kora'; |
41 | | - |
42 | | -// Initialize the client with your RPC endpoint |
43 | | -const client = new KoraClient({ rpcUrl: 'http://localhost:8080' }); |
44 | | - |
45 | | -// Example: Transfer tokens |
46 | | -const result = await client.transferTransaction({ |
47 | | - amount: 1000000, // 1 USDC (6 decimals) |
48 | | - token: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC mint |
49 | | - source: "sourceAddress", |
50 | | - destination: "destinationAddress" |
51 | | -}); |
52 | | - |
53 | | -// Access the base64 encoded transaction, base64 encoded message, and parsed instructions directly |
54 | | -console.log('Transaction:', result.transaction); |
55 | | -console.log('Message:', result.message); |
56 | | -console.log('Instructions:', result.instructions); |
57 | | -``` |
58 | | - |
59 | | -**[→ API Reference](https://launch.solana.com/docs/kora/json-rpc-api)** |
60 | | -**[→ Quick Start](https://launch.solana.com/docs/kora/getting-started/quick-start)** |
|
0 commit comments