{
  "openapi": "3.0.3",
  "info": {
    "title": "Launchpad.meme Robinhood Token API",
    "version": "1.0.0",
    "description": "Non-custodial Robinhood Chain token launch and canonical market-data API."
  },
  "servers": [
    {
      "url": "https://launchpad.meme"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "lp_live_..."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Transaction": {
        "type": "object",
        "required": [
          "chainId",
          "from",
          "to",
          "value",
          "data"
        ],
        "properties": {
          "chainId": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/robinhood/launches/intent": {
      "post": {
        "summary": "Prepare a creator-signable launch intent",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "creator",
                  "name",
                  "symbol"
                ],
                "properties": {
                  "creator": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "image_url": {
                    "type": "string"
                  },
                  "first_buy_wei": {
                    "type": "string"
                  },
                  "slippage_bps": {
                    "type": "integer"
                  },
                  "website_url": {
                    "type": "string"
                  },
                  "twitter_url": {
                    "type": "string"
                  },
                  "telegram_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Intent prepared"
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/robinhood/launches/build": {
      "post": {
        "summary": "Verify creator intent and build unsigned launch transaction",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "launch_id",
                  "intent_signature"
                ],
                "properties": {
                  "launch_id": {
                    "type": "string"
                  },
                  "intent_signature": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unsigned transaction built"
          }
        }
      }
    },
    "/api/v1/robinhood/launches/confirm": {
      "post": {
        "summary": "Verify and persist a confirmed launch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "launch_id",
                  "tx_hash"
                ],
                "properties": {
                  "launch_id": {
                    "type": "string"
                  },
                  "tx_hash": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Launch verified and persisted"
          }
        }
      }
    },
    "/api/v1/robinhood/launches/status": {
      "get": {
        "summary": "Read launch status",
        "parameters": [
          {
            "in": "query",
            "name": "launch_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tx_hash",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Launch state"
          }
        }
      }
    },
    "/api/v1/robinhood/tokens/{address}": {
      "get": {
        "summary": "Read canonical token data",
        "parameters": [
          {
            "in": "path",
            "name": "address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token"
          }
        }
      }
    },
    "/api/v1/robinhood/tokens/{address}/trades": {
      "get": {
        "summary": "Read canonical swaps mirrored as trades",
        "parameters": [
          {
            "in": "path",
            "name": "address",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trades"
          }
        }
      }
    },
    "/api/v1/robinhood/tokens/{address}/candles": {
      "get": {
        "summary": "Read canonical candles",
        "parameters": [
          {
            "in": "path",
            "name": "address",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resolution",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Candles"
          }
        }
      }
    },
    "/api/v1/robinhood/media/upload": {
      "post": {
        "summary": "Upload and host a Robinhood token logo",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Validated image uploaded"
          },
          "400": {
            "description": "Invalid image"
          }
        }
      }
    }
  }
}
