JSON-RPC API Overview

Kora implements a JSON-RPC 2.0 interface for gasless transaction processing on Solana.

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:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "methodName",
  "params": {}
}

Response Format

Successful responses:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}

Error responses:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32600,
    "message": "Invalid request"
  }
}