Solana Transactions API

Methods for sending, simulating, and querying transactions

OpenAPI Specification

solana-transactions-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Solana JSON-RPC Accounts Transactions API
  description: Solana exposes a JSON-RPC 2.0 API over HTTP and WebSocket for querying accounts, transactions, programs, token balances, blocks, and cluster state, as well as submitting and simulating transactions. Three public clusters are available — Mainnet (https://api.mainnet.solana.com), Devnet (https://api.devnet.solana.com), and Testnet (https://api.testnet.solana.com) — with dedicated API nodes for each environment. All requests use HTTP POST with a JSON-RPC 2.0 request body.
  version: '2.0'
  contact:
    name: Solana Developer Resources
    url: https://solana.com/developers
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  termsOfService: https://solana.com/tos
servers:
- url: https://api.mainnet.solana.com
  description: Solana Mainnet
- url: https://api.devnet.solana.com
  description: Solana Devnet
- url: https://api.testnet.solana.com
  description: Solana Testnet
tags:
- name: Transactions
  description: Methods for sending, simulating, and querying transactions
paths:
  /sendTransaction:
    post:
      operationId: sendTransaction
      summary: sendTransaction
      description: Submits a signed transaction to the cluster for processing. This method does not alter the transaction in any way; it relays the transaction created by clients to the node as-is.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              sendTransaction:
                summary: Send a signed transaction
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: sendTransaction
                  params:
                  - 4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFqseSr4sQs3GT
                  - encoding: base58
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionSignatureResponse'
      x-solana-method: sendTransaction
      x-solana-docs: https://solana.com/docs/rpc/http/sendtransaction
  /simulateTransaction:
    post:
      operationId: simulateTransaction
      summary: simulateTransaction
      description: Simulate sending a transaction. Returns simulated transaction results including logs and account state changes without broadcasting to the network.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              simulateTransaction:
                summary: Simulate a transaction without broadcasting
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: simulateTransaction
                  params:
                  - 4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFqseSr4sQs3GT
                  - sigVerify: true
                    commitment: finalized
                    encoding: base64
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateTransactionResponse'
      x-solana-method: simulateTransaction
      x-solana-docs: https://solana.com/docs/rpc/http/simulatetransaction
  /getTransaction:
    post:
      operationId: getTransaction
      summary: getTransaction
      description: Returns transaction details for a confirmed transaction.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              getTransaction:
                summary: Get a transaction by its signature
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getTransaction
                  params:
                  - 2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyzdqDT8yCJAKNUFGJMfmv
                  - encoding: jsonParsed
                    commitment: finalized
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetailResponse'
      x-solana-method: getTransaction
      x-solana-docs: https://solana.com/docs/rpc/http/gettransaction
  /getSignaturesForAddress:
    post:
      operationId: getSignaturesForAddress
      summary: getSignaturesForAddress
      description: Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              getSignaturesForAddress:
                summary: Get transaction signatures for an address
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getSignaturesForAddress
                  params:
                  - Vote111111111111111111111111111111111111111p8bN
                  - limit: 10
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignaturesForAddressResponse'
      x-solana-method: getSignaturesForAddress
      x-solana-docs: https://solana.com/docs/rpc/http/getsignaturesforaddress
  /getSignatureStatuses:
    post:
      operationId: getSignatureStatuses
      summary: getSignatureStatuses
      description: Returns the statuses of a list of signatures. Unless the searchTransactionHistory configuration parameter is included, this method only searches the recent status cache of signatures, which retains statuses for all active slots plus MAX_RECENT_BLOCKHASHES rooted slots.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              getSignatureStatuses:
                summary: Get confirmation statuses for multiple signatures
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getSignatureStatuses
                  params:
                  - - 5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW
                    - 5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7
                  - searchTransactionHistory: true
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignatureStatusesResponse'
      x-solana-method: getSignatureStatuses
      x-solana-docs: https://solana.com/docs/rpc/http/getsignaturestatuses
  /getFeeForMessage:
    post:
      operationId: getFeeForMessage
      summary: getFeeForMessage
      description: Get the fee the network will charge for a particular Message.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              getFeeForMessage:
                summary: Get network fee for a message
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getFeeForMessage
                  params:
                  - AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA
                  - commitment: confirmed
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeForMessageResponse'
      x-solana-method: getFeeForMessage
      x-solana-docs: https://solana.com/docs/rpc/http/getfeeformessage
  /getLatestBlockhash:
    post:
      operationId: getLatestBlockhash
      summary: getLatestBlockhash
      description: Returns the latest blockhash and last valid block height for a transaction.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              getLatestBlockhash:
                summary: Get the most recent blockhash
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getLatestBlockhash
                  params:
                  - commitment: processed
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestBlockhashResponse'
      x-solana-method: getLatestBlockhash
      x-solana-docs: https://solana.com/docs/rpc/http/getlatestblockhash
  /isBlockhashValid:
    post:
      operationId: isBlockhashValid
      summary: isBlockhashValid
      description: Returns whether a blockhash is still valid or has expired.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              isBlockhashValid:
                summary: Check if a blockhash is still valid
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: isBlockhashValid
                  params:
                  - J7rBdtiSetEfpFike1CT9hXP3icWT9QKe8BKA7qJt6eZ
                  - commitment: processed
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
      x-solana-method: isBlockhashValid
      x-solana-docs: https://solana.com/docs/rpc/http/isblockhashvalid
  /getRecentPrioritizationFees:
    post:
      operationId: getRecentPrioritizationFees
      summary: getRecentPrioritizationFees
      description: Returns a list of prioritization fees from recent blocks. Currently, a node's prioritization-fee cache stores data from up to 150 blocks.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              getRecentPrioritizationFees:
                summary: Get recent prioritization fees
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getRecentPrioritizationFees
                  params:
                  - - CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrioritizationFeesResponse'
      x-solana-method: getRecentPrioritizationFees
      x-solana-docs: https://solana.com/docs/rpc/http/getrecentprioritizationfees
  /getTransactionCount:
    post:
      operationId: getTransactionCount
      summary: getTransactionCount
      description: Returns the current Transaction count from the ledger.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              getTransactionCount:
                summary: Get total processed transaction count
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getTransactionCount
                  params: []
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountResponse'
      x-solana-method: getTransactionCount
      x-solana-docs: https://solana.com/docs/rpc/http/gettransactioncount
  /requestAirdrop:
    post:
      operationId: requestAirdrop
      summary: requestAirdrop
      description: Requests an airdrop of lamports to a public key. Only available on Devnet and Testnet.
      tags:
      - Transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              requestAirdrop:
                summary: Request 1 SOL airdrop on Devnet
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: requestAirdrop
                  params:
                  - 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                  - 1000000000
      responses:
        '200':
          description: Successful JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionSignatureResponse'
      x-solana-method: requestAirdrop
      x-solana-docs: https://solana.com/docs/rpc/http/requestairdrop
components:
  schemas:
    BooleanResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: object
          properties:
            context:
              $ref: '#/components/schemas/RpcContext'
            value:
              type: boolean
        error:
          $ref: '#/components/schemas/JsonRpcError'
    TransactionSignatureResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: string
          description: Transaction signature (base58-encoded)
        error:
          $ref: '#/components/schemas/JsonRpcError'
    TransactionDetailResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          nullable: true
          type: object
          properties:
            slot:
              type: integer
              format: int64
              description: The slot this transaction was processed in
            transaction:
              type: object
              description: Transaction object in requested encoding
            blockTime:
              type: integer
              format: int64
              nullable: true
              description: Estimated production time as Unix timestamp
            meta:
              type: object
              nullable: true
              properties:
                err:
                  nullable: true
                fee:
                  type: integer
                  format: int64
                  description: Fee this transaction was charged, in lamports
                preBalances:
                  type: array
                  items:
                    type: integer
                    format: int64
                postBalances:
                  type: array
                  items:
                    type: integer
                    format: int64
                logMessages:
                  type: array
                  nullable: true
                  items:
                    type: string
        error:
          $ref: '#/components/schemas/JsonRpcError'
    SignatureStatusesResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: object
          properties:
            context:
              $ref: '#/components/schemas/RpcContext'
            value:
              type: array
              items:
                nullable: true
                type: object
                properties:
                  slot:
                    type: integer
                    format: int64
                  confirmations:
                    type: integer
                    nullable: true
                    description: Number of blocks since signature confirmation, null if rooted
                  err:
                    nullable: true
                    description: Error if transaction failed
                  confirmationStatus:
                    type: string
                    nullable: true
                    enum:
                    - processed
                    - confirmed
                    - finalized
        error:
          $ref: '#/components/schemas/JsonRpcError'
    CountResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: integer
          format: int64
          description: Numeric count or slot value
        error:
          $ref: '#/components/schemas/JsonRpcError'
    SimulateTransactionResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: object
          properties:
            context:
              $ref: '#/components/schemas/RpcContext'
            value:
              type: object
              properties:
                err:
                  nullable: true
                  description: Error if transaction failed
                logs:
                  type: array
                  nullable: true
                  items:
                    type: string
                  description: Array of log messages the transaction instructions output
                accounts:
                  type: array
                  nullable: true
                  items:
                    nullable: true
                    $ref: '#/components/schemas/AccountInfo'
                unitsConsumed:
                  type: integer
                  format: int64
                  description: Number of compute budget units consumed during processing
        error:
          $ref: '#/components/schemas/JsonRpcError'
    RpcContext:
      type: object
      properties:
        slot:
          type: integer
          format: int64
          description: The slot at which the operation was evaluated
    SignaturesForAddressResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: array
          items:
            type: object
            properties:
              signature:
                type: string
                description: Base58-encoded transaction signature
              slot:
                type: integer
                format: int64
                description: The slot that contains the block with the transaction
              err:
                nullable: true
                description: Error if transaction failed
              memo:
                type: string
                nullable: true
                description: Memo associated with the transaction
              blockTime:
                type: integer
                format: int64
                nullable: true
                description: Estimated production time as Unix timestamp
              confirmationStatus:
                type: string
                nullable: true
                description: The transaction's cluster confirmation status
        error:
          $ref: '#/components/schemas/JsonRpcError'
    PrioritizationFeesResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: array
          items:
            type: object
            properties:
              slot:
                type: integer
                format: int64
                description: The slot in which the fee was observed
              prioritizationFee:
                type: integer
                format: int64
                description: The per-compute-unit fee paid by at least one successfully landed transaction
        error:
          $ref: '#/components/schemas/JsonRpcError'
    LatestBlockhashResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: object
          properties:
            context:
              $ref: '#/components/schemas/RpcContext'
            value:
              type: object
              properties:
                blockhash:
                  type: string
                  description: Base58-encoded hash of the block
                lastValidBlockHeight:
                  type: integer
                  format: int64
                  description: Last block height at which blockhash will be valid
        error:
          $ref: '#/components/schemas/JsonRpcError'
    AccountInfo:
      type: object
      properties:
        lamports:
          type: integer
          format: int64
          description: Number of lamports assigned to this account
        owner:
          type: string
          description: Base58-encoded public key of the program that owns this account
        data:
          description: Data associated with the account (encoded or parsed)
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          - type: object
        executable:
          type: boolean
          description: Whether this account contains a program and is strictly read-only
        rentEpoch:
          type: integer
          format: int64
          description: The epoch at which this account will next owe rent
        space:
          type: integer
          description: The data size of the account
    FeeForMessageResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
        result:
          type: object
          properties:
            context:
              $ref: '#/components/schemas/RpcContext'
            value:
              type: integer
              format: int64
              nullable: true
              description: Fee in lamports (null if blockhash has expired)
        error:
          $ref: '#/components/schemas/JsonRpcError'
    JsonRpcError:
      type: object
      properties:
        code:
          type: integer
          description: Error code
        message:
          type: string
          description: Human-readable error message
        data:
          description: Additional error data
    JsonRpcRequest:
      type: object
      required:
      - jsonrpc
      - id
      - method
      properties:
        jsonrpc:
          type: string
          enum:
          - '2.0'
          description: JSON-RPC protocol version
          example: '2.0'
        id:
          oneOf:
          - type: integer
          - type: string
          description: Client-provided identifier for the request
          example: 1
        method:
          type: string
          description: The JSON-RPC method name
          example: getBalance
        params:
          type: array
          description: Method-specific parameters
          items:
            oneOf:
            - type: string
            - type: integer
            - type: boolean
            - type: object
            - type: array
              items: {}
externalDocs:
  description: Solana RPC HTTP Methods Documentation
  url: https://solana.com/docs/rpc/http