Using Kora v2.2.0-beta? See the Beta docs for new bundle methods (signBundle,signAndSendBundle,estimateBundleFee) andgetVersion.
TypeScript SDK
The@solana/kora package provides three client options for interacting with a
Kora server. All three need @solana/kora 0.2.x with @solana/kit ^6.1
(Kit 7 and later are not supported) and TypeScript 5.4 or later. See
Installation
for the install command.
KoraClient (Standalone)
UseKoraClient for standalone usage.
koraPlugin (Kit Composable)
UsekoraPlugin() to compose Kora methods into an existing Kit client built with
createEmptyClient().use().
Address, Blockhash,
Base64EncodedWireTransaction) and exports the KoraPlugin type for
composition with other plugins.
createKitKoraClient (Kit Client)
UsecreateKitKoraClient() for full Kit integration with automatic transaction
planning, fee estimation, payment injection, and execution. This is the
recommended approach for most applications.
The Kit client composes Kora with Kit’s plugin architecture (planner, executor,
payer plugins) so you can use Kit program plugins like tokenProgram()
directly.
| Option | Required | Description |
|---|---|---|
endpoint | Yes | Kora RPC endpoint URL |
rpcUrl | Yes | Solana RPC URL for compute unit estimation and program plugin compatibility |
feeToken | Yes | SPL mint address for fee payment |
feePayerWallet | Yes | TransactionSigner that authorizes the SPL fee payment |
apiKey | No | API key for authentication |
hmacSecret | No | HMAC secret for signature-based authentication |
computeUnitLimit | No | Fixed compute unit limit (uses simulation-based estimation if not set) |
computeUnitPrice | No | Priority fee in micro-lamports |
tokenProgramId | No | Token program ID (defaults to Token Program; use Token-2022 address for Token-2022 tokens) |
Protocol
- Standard: JSON-RPC 2.0
- Transport: HTTP POST
- Content-Type: application/json
- Endpoint:
http://your-kora-instance/
Available Methods
| Method | Description |
|---|---|
| estimateTransactionFee | Estimates the transaction fee in both lamports and the specified token. |
| getBlockhash | Gets the latest blockhash from the Solana RPC that the Kora server is connected to. |
| getConfig | Retrieves the current Kora server configuration. |
| getPayerSigner | Retrieves the payer signer and payment destination from the Kora server. |
| getPaymentInstruction | Creates a payment instruction to append to a transaction for fee payment to the Kora paymaster. |
| getSupportedTokens | Retrieves the list of tokens supported for fee payment. |
| signAndSendTransaction | Signs a transaction and immediately broadcasts it to the Solana network. |
| signTransaction | Signs a transaction with the Kora fee payer if the transaction includes necessary payment to the fee payer without broadcasting it. |
| transferTransaction | Creates a token transfer transaction with Kora as the fee payer. |
Request Format
All requests follow the JSON-RPC 2.0 standard:Response Format
Successful responses:-32000. Some errors include
data.error_type identifying the error category:
method field do
not return a JSON-RPC error. Kora responds with HTTP 405 and an empty body, so
check the HTTP status before parsing the response.