Skip to content
Using Kora v2.2.0-beta? See the Beta docs for new bundle methods (signBundle, signAndSendBundle, estimateBundleFee) and getVersion.

​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)

Use KoraClient for standalone usage.

​koraPlugin (Kit Composable)

Use koraPlugin() to compose Kora methods into an existing Kit client built with createEmptyClient().use().
The plugin provides Kit-typed responses (Address, Blockhash, Base64EncodedWireTransaction) and exports the KoraPlugin type for composition with other plugins.

​createKitKoraClient (Kit Client)

Use createKitKoraClient() 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.
Configuration options:
OptionRequiredDescription
endpointYesKora RPC endpoint URL
rpcUrlYesSolana RPC URL for compute unit estimation and program plugin compatibility
feeTokenYesSPL mint address for fee payment
feePayerWalletYesTransactionSigner that authorizes the SPL fee payment
apiKeyNoAPI key for authentication
hmacSecretNoHMAC secret for signature-based authentication
computeUnitLimitNoFixed compute unit limit (uses simulation-based estimation if not set)
computeUnitPriceNoPriority fee in micro-lamports
tokenProgramIdNoToken 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

MethodDescription
estimateTransactionFeeEstimates the transaction fee in both lamports and the specified token.
getBlockhashGets the latest blockhash from the Solana RPC that the Kora server is connected to.
getConfigRetrieves the current Kora server configuration.
getPayerSignerRetrieves the payer signer and payment destination from the Kora server.
getPaymentInstructionCreates a payment instruction to append to a transaction for fee payment to the Kora paymaster.
getSupportedTokensRetrieves the list of tokens supported for fee payment.
signAndSendTransactionSigns a transaction and immediately broadcasts it to the Solana network.
signTransactionSigns a transaction with the Kora fee payer if the transaction includes necessary payment to the fee payer without broadcasting it.
transferTransactionCreates 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:
Errors depend on where the request fails. Validation errors for a known method (for example a missing parameter) are returned with HTTP 200 and a JSON-RPC error object:
Application errors (for example a rejected transaction) are also returned with HTTP 200, usually with code -32000. Some errors include data.error_type identifying the error category:
Unknown methods, malformed JSON, and requests without a 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.