openapi: 3.0.3
info:
  title: photon-indexer
  description: Solana indexer for general compression
  license:
    name: Apache-2.0
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
paths:
  /:
    summary: getValidityProof
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                id:
                  type: string
                  description: An ID to identify the request.
                  enum:
                    - test-account
                jsonrpc:
                  type: string
                  description: The version of the JSON-RPC protocol.
                  enum:
                    - '2.0'
                method:
                  type: string
                  description: The name of the method to invoke.
                  enum:
                    - getValidityProof
                params:
                  type: object
                  properties:
                    hashes:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                    newAddressesWithTrees:
                      type: array
                      items:
                        $ref: '#/components/schemas/AddressWithTree'
                  additionalProperties: false
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                required:
                  - value
                  - context
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/CompressedProofWithContext'
                additionalProperties: false
        '429':
          description: Exceeded rate limit.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '500':
          description: >-
            The server encountered an unexpected condition that prevented it
            from fulfilling the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    AddressWithTree:
      type: object
      required:
        - address
        - tree
      properties:
        address:
          $ref: '#/components/schemas/SerializablePubkey'
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
      additionalProperties: false
    CompressedProof:
      type: object
      required:
        - a
        - b
        - c
      properties:
        a:
          type: string
          format: binary
        b:
          type: string
          format: binary
        c:
          type: string
          format: binary
    CompressedProofWithContext:
      type: object
      required:
        - compressedProof
        - roots
        - rootIndices
        - leafIndices
        - leaves
        - merkleTrees
      properties:
        compressedProof:
          $ref: '#/components/schemas/CompressedProof'
        leafIndices:
          type: array
          items:
            type: integer
            format: int32
            minimum: 0
        leaves:
          type: array
          items:
            type: string
        merkleTrees:
          type: array
          items:
            type: string
        rootIndices:
          type: array
          items:
            type: integer
            format: int64
            minimum: 0
        roots:
          type: array
          items:
            type: string
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
    Hash:
      type: string
      description: A 32-byte hash represented as a base58 string.
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    SerializablePubkey:
      type: string
      description: A Solana public key represented as a base58 string.
      default: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
      example: 11111118eRTi4fUVRoeYEeeTyL4DPAwxatvWT5q1Z
