{
  "openapi": "3.1.0",
  "info": {
    "title": "Equities Submit API",
    "description": "Solana RPC endpoint for submitting equity direct fills",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://TODO-equities-host.dflow.net"
    }
  ],
  "paths": {
    "/submit-transaction": {
      "post": {
        "summary": "Submits a signed transaction, like the Solana RPC sendTransaction method.",
        "operationId": "submit_transaction",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A JSON-RPC response. Transaction errors arrive as a JSON-RPC `error` object in the HTTP 200, as on a Solana RPC.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendTransactionResponse"
                }
              }
            }
          },
          "403": {
            "description": "The API key is missing, invalid, or not enabled for this endpoint, or access is denied."
          },
          "429": {
            "description": "The request exceeds a rate limit. The `retry-after` header gives the seconds to wait."
          },
          "503": {
            "description": "The endpoint is overloaded. The `retry-after` header gives the seconds to wait."
          },
          "504": {
            "description": "The outcome is unknown. Handle it as a `-32000` error."
          }
        },
        "description": "Accepts the JSON-RPC `sendTransaction` method for a transaction missing exactly one signature, and returns its signature once the transaction is completed and submitted to Solana. See [Submitting Equity Transactions](/equities/orders#direct-fill-submission)."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "SendTransactionRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method",
          "params"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "description": "Any JSON value. Echoed in the response."
          },
          "method": {
            "type": "string",
            "enum": [
              "sendTransaction"
            ]
          },
          "params": {
            "type": "array",
            "description": "The encoded transaction, then an optional configuration object",
            "minItems": 1,
            "maxItems": 2,
            "prefixItems": [
              {
                "type": "string",
                "description": "The v0 or v1 transaction, signed by the user and encoded per `encoding`"
              },
              {
                "$ref": "#/components/schemas/SendTransactionConfig"
              }
            ]
          }
        }
      },
      "SendTransactionConfig": {
        "type": "object",
        "properties": {
          "encoding": {
            "type": "string",
            "enum": [
              "base58",
              "base64"
            ],
            "description": "Encoding of the transaction. Default is base58."
          }
        },
        "description": "Accepted fields other than `encoding` (such as `skipPreflight`, `preflightCommitment`, `maxRetries`, and `minContextSlot`) are ignored."
      },
      "SendTransactionResponse": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "description": "The request id, or null when the request id could not be read"
          },
          "result": {
            "type": "string",
            "description": "Base58-encoded signature of the transaction. Not yet confirmed; track it onchain."
          },
          "error": {
            "$ref": "#/components/schemas/RpcError"
          }
        }
      },
      "RpcError": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/RpcErrorData"
          }
        },
        "description": "`code` is `-32602`, `-32003`, `-32002`, or `-32000`. [Submit Transaction Errors](/resources/error-codes#submit-transaction-errors) gives each meaning."
      },
      "RpcErrorData": {
        "type": "object",
        "description": "Present only on a `-32002` `Transaction rejected` error",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "quote_expired",
              "quote_unknown",
              "quote_already_used",
              "terms_mismatch",
              "transaction_not_allowed",
              "simulation_failed",
              "declined"
            ]
          }
        }
      }
    }
  }
}
