Skip to main content

kora-client

Kora TypeScript SDK and JSON-RPC API integration for Solana gasless transactions, fee abstraction, and Jito bundles. Use when the user asks about: (1) @solana/kora SDK - KoraClient, koraPlugin, gasless transactions, fee estimation, payment instructions, Jito bundles, (2) Kora RPC methods - estimateTransactionFee, estimateBundleFee, signTransaction, signAndSendTransaction, signBundle, signAndSendBundle, getPaymentInstruction, getConfig, getBlockhash, getSupportedTokens, getPayerSigner, getVersion, (3) integrating with a Kora paymaster node from a client application, (4) building gasless transaction flows on Solana, (5) paying Solana fees in SPL tokens like USDC, (6) reCAPTCHA bot protection for Kora. Do NOT use for running/configuring a Kora node (use kora-operator instead).

설치로 이동

소스 정보

저장소
solana-foundation/kora
최근 소스 활동
2026년 8월 27일 12:31
감지된 SKILL.md 언어
영어
스타
198
포크
277

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
3 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
kora-client
description
Kora TypeScript SDK and JSON-RPC API integration for Solana gasless transactions, fee abstraction, and Jito bundles. Use when the user asks about: (1) @solana/kora SDK - KoraClient, koraPlugin, gasless transactions, fee estimation, payment instructions, Jito bundles, (2) Kora RPC methods - estimateTransactionFee, estimateBundleFee, signTransaction, signAndSendTransaction, signBundle, signAndSendBundle, getPaymentInstruction, getConfig, getBlockhash, getSupportedTokens, getPayerSigner, getVersion, (3) integrating with a Kora paymaster node from a client application, (4) building gasless transaction flows on Solana, (5) paying Solana fees in SPL tokens like USDC, (6) reCAPTCHA bot protection for Kora. Do NOT use for running/configuring a Kora node (use kora-operator instead).
# Kora Client Integration Kora is a Solana paymaster: users pay fees in SPL tokens (e.g. USDC) instead of SOL. **Docs**: https://launch.solana.com/docs/kora/ · **SDK**: `@solana/kora` (npm) **Peer deps**: `@solana/kit` v6+, `@solana-program/token` v0.10+ ## Where things are | Topic | Reference | |---|---| | Per-method params, responses, TS types, error format | [references/rpc-api.md](references/rpc-api.md) | | Complete worked gasless flow, Jito bundles, x402, troubleshooting | [references/guides.md](references/guides.md) | ## Two client shapes `KoraClient` is standalone; `koraPlugin` composes into a Kit client and returns Kit types (`Address`, `Blockhash`) rather than raw strings. ```ts import { KoraClient } from '@solana/kora'; const client = new KoraClient({ rpcUrl, apiKey, hmacSecret, getRecaptchaToken }); // or import { createEmptyClient } from '@solana/kit'; import { koraPlugin } from '@solana/kora'; const client = createEmptyClient().use(koraPlugin({ endpoint, apiKey, getRecaptchaToken })); await client.kora.getConfig(); ``` ## The transaction flow Build instructions → build an estimate transaction with a **noop signer** as fee payer → `getPaymentInstruction()` → rebuild the final transaction with a **fresh blockhash** including the payment instruction → user partially signs → Kora co-signs via `signTransaction` or `signAndSendTransaction`. Worked end-to-end code is in [references/guides.md](references/guides.md). The parts that trip people up: - **The estimate transaction is thrown away.** It exists only so Kora can price the transaction. The final transaction needs a new blockhash, not the estimate's. - **Noop signer**: `createNoopSigner(address(signerAddress))` reserves the fee payer slot before Kora has signed. Get the address from `getPayerSigner()`. - **Signing order**: the user signs their own instructions *and* the payment transfer. Kora only adds the fee payer signature; it will not fix a missing user signature. - **`signer_key`**: optional, but pass it when the node runs a multi-signer pool so estimate and signature come from the same signer. - **`user_id`**: required on signing methods when the operator runs `free` pricing with usage tracking enabled. ## Lighthouse invalidates your signatures If the operator enables Lighthouse, `signTransaction` and `signBundle` may return a transaction with an extra balance-assertion instruction. That changes the message, so any signature already applied is void: re-sign the returned transaction client-side and submit it yourself. Lighthouse never applies to `signAndSendTransaction` / `signAndSendBundle` — Kora broadcasts those itself, so there is no opportunity to re-sign and the assertion is skipped. ## Bundles `signBundle` / `signAndSendBundle` take up to 5 transactions and execute atomically via Jito. `sign_only_indices` restricts which ones Kora signs. `estimateBundleFee` prices the set. ## Authentication | Method | Header | Constructor option | |---|---|---| | API key | `x-api-key` | `apiKey` | | HMAC | `x-timestamp` + `x-hmac-signature` | `hmacSecret` | | reCAPTCHA v3 | `x-recaptcha-token` | `getRecaptchaToken` callback | All three can be active together, and the SDK builds the HMAC (SHA256 of `timestamp + JSON body`) for you. reCAPTCHA is checked only on the methods the operator marked protected, and only after API key / HMAC pass. `/liveness` always bypasses auth.
GitHub에서 보기