Airstack · Schema

Airstack Farcaster Hub API Schemas

JSON Schema definitions extracted from the Airstack Farcaster Hub REST API OpenAPI specification.

Web3BlockchainGraphQLNFTTokensOn-Chain DataEthereumPolygonBaseENSPOAPSocial GraphWalletIdentity
View JSON Schema on GitHub

JSON Schema

farcaster-hub-api-schemas.json Raw ↑
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/airstack/main/json-schema/farcaster-hub-api-schemas.json",
  "title": "Airstack Farcaster Hub API Schemas",
  "description": "JSON Schema definitions extracted from the Airstack Farcaster Hub REST API OpenAPI specification.",
  "definitions": {
    "CastAdd": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageCommon"
        },
        {
          "type": "object",
          "properties": {
            "data": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/MessageDataCastAdd"
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "$ref": "#/components/schemas/MessageType"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      ]
    },
    "CastAddBody": {
      "description": "Adds a new Cast",
      "type": "object",
      "properties": {
        "embedsDeprecated": {
          "title": "URLs to be embedded in the cast",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mentions": {
          "title": "Fids mentioned in the cast",
          "type": "array",
          "items": {
            "type": "integer",
            "format": "uint64",
            "example": 2
          }
        },
        "parentCastId": {
          "$ref": "#/components/schemas/CastId"
        },
        "parentUrl": {
          "title": "Parent URL",
          "type": "string",
          "example": "chain://eip155:1/erc721:0x39d89b649ffa044383333d297e325d42d31329b2"
        },
        "text": {
          "title": "Text of the cast",
          "type": "string"
        },
        "mentionsPositions": {
          "title": "Positions of the mentions in the text",
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        },
        "embeds": {
          "title": "URLs or cast ids to be embedded in the cast",
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/Embed"
          }
        }
      },
      "required": [
        "embedsDeprecated",
        "mentions",
        "text",
        "mentionsPositions",
        "embeds"
      ]
    },
    "CastEmbed": {
      "type": "object",
      "properties": {
        "castId": {
          "$ref": "#/components/schemas/CastId"
        }
      },
      "required": [
        "castId"
      ]
    },
    "CastRemove": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageCommon"
        },
        {
          "type": "object",
          "properties": {
            "data": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/MessageDataCastRemove"
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "$ref": "#/components/schemas/MessageType"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      ]
    },
    "CastId": {
      "description": "Identifier used to look up a Cast",
      "required": [
        "fid",
        "hash"
      ],
      "type": "object",
      "properties": {
        "fid": {
          "title": "Fid of the user who created the cast",
          "type": "integer",
          "format": "uint64"
        },
        "hash": {
          "$ref": "#/components/schemas/CastHash"
        }
      }
    },
    "CastHash": {
      "pattern": "^0x[0-9a-fA-F]{40}$",
      "type": "string"
    },
    "CastRemoveBody": {
      "description": "Removes an existing Cast",
      "type": "object",
      "properties": {
        "targetHash": {
          "title": "Hash of the cast to remove",
          "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
          "type": "string",
          "format": "byte"
        }
      },
      "required": [
        "targetHash"
      ]
    },
    "DbStats": {
      "required": [
        "numFidEvents",
        "numFnameEvents",
        "numMessages"
      ],
      "type": "object",
      "properties": {
        "numMessages": {
          "type": "integer",
          "format": "uint64"
        },
        "numFidEvents": {
          "type": "integer",
          "format": "uint64"
        },
        "numFnameEvents": {
          "type": "integer",
          "format": "uint64"
        }
      }
    },
    "Embed": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/CastEmbed"
        },
        {
          "$ref": "#/components/schemas/UrlEmbed"
        }
      ]
    },
    "ErrorResponse": {
      "required": [
        "code",
        "details",
        "errCode",
        "metadata",
        "name",
        "presentable"
      ],
      "type": "object",
      "properties": {
        "errCode": {
          "type": "string"
        },
        "presentable": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "code": {
          "type": "integer"
        },
        "details": {
          "type": "string"
        },
        "metadata": {
          "required": [
            "errcode"
          ],
          "type": "object",
          "properties": {
            "errcode": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "FarcasterNetwork": {
      "type": "string",
      "description": "Farcaster network the message is intended for.\n- FARCASTER_NETWORK_MAINNET: Public primary network\n - FARCASTER_NETWORK_TESTNET: Public test network\n - FARCASTER_NETWORK_DEVNET: Private test network",
      "default": "FARCASTER_NETWORK_MAINNET",
      "enum": [
        "FARCASTER_NETWORK_MAINNET",
        "FARCASTER_NETWORK_TESTNET",
        "FARCASTER_NETWORK_DEVNET"
      ]
    },
    "FidsResponse": {
      "type": "object",
      "properties": {
        "fids": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "uint64"
          }
        },
        "nextPageToken": {
          "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
          "type": "string",
          "format": "byte"
        }
      },
      "required": [
        "fids",
        "nextPageToken"
      ]
    },
    "FrameActionBody": {
      "description": "A Farcaster Frame action",
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "buttonIndex": {
          "title": "The index of the button pressed (1-4)",
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "maximum": 4
        },
        "castId": {
          "$ref": "#/components/schemas/CastId"
        }
      },
      "required": [
        "url",
        "buttonIndex",
        "castId"
      ]
    },
    "HashScheme": {
      "type": "string",
      "description": "Type of hashing scheme used to produce a digest of MessageData. - HASH_SCHEME_BLAKE3: Default scheme for hashing MessageData\n",
      "default": "HASH_SCHEME_BLAKE3",
      "enum": [
        "HASH_SCHEME_BLAKE3"
      ]
    },
    "HubEvent": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/HubEventMergeMessage"
        },
        {
          "$ref": "#/components/schemas/HubEventPruneMessage"
        },
        {
          "$ref": "#/components/schemas/HubEventRevokeMessage"
        },
        {
          "$ref": "#/components/schemas/HubEventMergeUsernameProof"
        },
        {
          "$ref": "#/components/schemas/HubEventMergeOnChainEvent"
        }
      ],
      "discriminator": {
        "propertyName": "type",
        "mapping": {
          "HUB_EVENT_TYPE_MERGE_MESSAGE": "#/components/schemas/HubEventMergeMessage",
          "HUB_EVENT_TYPE_PRUNE_MESSAGE": "#/components/schemas/HubEventPruneMessage",
          "HUB_EVENT_TYPE_REVOKE_MESSAGE": "#/components/schemas/HubEventRevokeMessage",
          "HUB_EVENT_TYPE_MERGE_USERNAME_PROOF": "#/components/schemas/HubEventMergeUsernameProof",
          "HUB_EVENT_TYPE_MERGE_ON_CHAIN_EVENT": "#/components/schemas/HubEventMergeOnChainEvent"
        }
      }
    },
    "HubEventMergeMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "example": "HUB_EVENT_TYPE_MERGE_MESSAGE"
        },
        "id": {
          "type": "integer",
          "format": "uint64"
        },
        "mergeMessageBody": {
          "$ref": "#/components/schemas/MergeMessageBody"
        }
      },
      "required": [
        "type",
        "id",
        "mergeMessageBody"
      ]
    },
    "HubEventPruneMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "example": "HUB_EVENT_TYPE_PRUNE_MESSAGE"
        },
        "id": {
          "type": "integer",
          "format": "uint64"
        },
        "pruneMessageBody": {
          "$ref": "#/components/schemas/PruneMessageBody"
        }
      },
      "required": [
        "type",
        "id",
        "pruneMessageBody"
      ]
    },
    "HubEventRevokeMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "example": "HUB_EVENT_TYPE_REVOKE_MESSAGE"
        },
        "id": {
          "type": "integer",
          "format": "uint64"
        },
        "revokeMessageBody": {
          "$ref": "#/components/schemas/RevokeMessageBody"
        }
      },
      "required": [
        "type",
        "id",
        "revokeMessageBody"
      ]
    },
    "HubEventMergeUsernameProof": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "example": "HUB_EVENT_TYPE_MERGE_USERNAME_PROOF"
        },
        "id": {
          "type": "integer",
          "format": "uint64"
        },
        "mergeUsernameProofBody": {
          "$ref": "#/components/schemas/MergeUserNameProofBody"
        }
      },
      "required": [
        "type",
        "id",
        "mergeUsernameProofBody"
      ]
    },
    "HubEventMergeOnChainEvent": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "example": "HUB_EVENT_TYPE_MERGE_ON_CHAIN_EVENT"
        },
        "id": {
          "type": "integer",
          "format": "uint64"
        },
        "mergeOnChainEventBody": {
          "$ref": "#/components/schemas/MergeOnChainEventBody"
        }
      },
      "required": [
        "type",
        "id",
        "mergeOnChainEventBody"
      ]
    },
    "HubInfoResponse": {
      "title": "Response Types for the Sync RPC Methods",
      "required": [
        "hubOperatorFid",
        "isSyncing",
        "nickname",
        "peerId",
        "rootHash",
        "version"
      ],
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "isSyncing": {
          "type": "boolean"
        },
        "nickname": {
          "type": "string"
        },
        "rootHash": {
          "type": "string"
        },
        "dbStats": {
          "$ref": "#/components/schemas/DbStats"
        },
        "peerId": {
          "type": "string"
        },
        "hubOperatorFid": {
          "type": "integer",
          "format": "uint64"
        }
      }
    },
    "IdRegisterEventBody": {
      "type": "object",
      "properties": {
        "to": {
          "pattern": "^0x[a-fA-F0-9]*$",
          "type": "string",
          "example": "0x00000000fcd5a8e45785c8a4b9a718c9348e4f18"
        },
        "eventType": {
          "$ref": "#/components/schemas/IdRegisterEventType"
        },
        "from": {
          "pattern": "^0x[a-fA-F0-9]*$",
          "type": "string",
          "example": "0x00000000fcd5a8e45785c8a4b9a718c9348e4f18"
        },
        "recoveryAddress": {
          "pattern": "^0x[a-fA-F0-9]*$",
          "type": "string",
          "example": "0x00000000fcd5a8e45785c8a4b9a718c9348e4f18"
        }
      },
      "required": [
        "to",
        "from",
        "eventType",
        "recoveryAddress"
      ]
    },
    "IdRegisterEventType": {
      "type": "string",
      "default": "ID_REGISTER_EVENT_TYPE_REGISTER",
      "enum": [
        "ID_REGISTER_EVENT_TYPE_REGISTER",
        "ID_REGISTER_EVENT_TYPE_TRANSFER",
        "ID_REGISTER_EVENT_TYPE_CHANGE_RECOVERY"
      ]
    },
    "LinkAdd": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageCommon"
        },
        {
          "type": "object",
          "properties": {
            "data": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/MessageDataLink"
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "$ref": "#/components/schemas/MessageType"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      ]
    },
    "LinkBody": {
      "description": "Adds or removes a Link",
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/components/schemas/LinkType"
        },
        "displayTimestamp": {
          "title": "User-defined timestamp that preserves original timestamp when message.data.timestamp needs to be updated for compaction",
          "type": "integer",
          "format": "int64"
        },
        "targetFid": {
          "title": "The fid the link relates to",
          "type": "integer",
          "format": "uint64"
        }
      },
      "required": [
        "type",
        "targetFid"
      ]
    },
    "LinkRemove": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageCommon"
        },
        {
          "type": "object",
          "properties": {
            "data": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/MessageDataLink"
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "$ref": "#/components/schemas/MessageType"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      ]
    },
    "LinkType": {
      "type": "string",
      "description": "Type of Link.\n- follow: Follow another user",
      "default": "follow",
      "enum": [
        "follow"
      ]
    },
    "MergeMessageBody": {
      "type": "object",
      "properties": {
        "message": {
          "$ref": "#/components/schemas/Message"
        },
        "deletedMessages": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/Message"
          }
        }
      },
      "required": [
        "message",
        "deletedMessages"
      ]
    },
    "MergeOnChainEventBody": {
      "type": "object",
      "properties": {
        "onChainEvent": {
          "$ref": "#/components/schemas/OnChainEvent"
        }
      },
      "required": [
        "onChainEvent"
      ]
    },
    "MergeUserNameProofBody": {
      "type": "object",
      "properties": {
        "usernameProof": {
          "$ref": "#/components/schemas/UserNameProof"
        },
        "deletedUsernameProof": {
          "$ref": "#/components/schemas/UserNameProof"
        },
        "usernameProofMessage": {
          "$ref": "#/components/schemas/Message"
        },
        "deletedUsernameProofMessage": {
          "$ref": "#/components/schemas/Message"
        }
      }
    },
    "Message": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "data": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/MessageDataCastAdd"
                },
                {
                  "$ref": "#/components/schemas/MessageDataCastRemove"
                },
                {
                  "$ref": "#/components/schemas/MessageDataReaction"
                },
                {
                  "$ref": "#/components/schemas/MessageDataLink"
                },
                {
                  "$ref": "#/components/schemas/MessageDataVerificationAdd"
                },
                {
                  "$ref": "#/components/schemas/MessageDataVerificationRemove"
                },
                {
                  "$ref": "#/components/schemas/MessageDataUserDataAdd"
                },
                {
                  "$ref": "#/components/schemas/MessageDataUsernameProof"
                },
                {
                  "$ref": "#/components/schemas/MessageDataFrameAction"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "MESSAGE_TYPE_CAST_ADD": "#/components/schemas/MessageDataCastAdd",
                  "MESSAGE_TYPE_CAST_REMOVE": "#/components/schemas/MessageDataCastRemove",
                  "MESSAGE_TYPE_REACTION_ADD": "#/components/schemas/MessageDataReaction",
                  "MESSAGE_TYPE_REACTION_REMOVE": "#/components/schemas/MessageDataReaction",
                  "MESSAGE_TYPE_LINK_ADD": "#/components/schemas/MessageDataLink",
                  "MESSAGE_TYPE_LINK_REMOVE": "#/components/schemas/MessageDataLink",
                  "MESSAGE_TYPE_VERIFICATION_ADD_ETH_ADDRESS": "#/components/schemas/MessageDataVerificationAdd",
                  "MESSAGE_TYPE_VERIFICATION_REMOVE": "#/components/schemas/MessageDataVerificationRemove",
                  "MESSAGE_TYPE_USER_DATA_ADD": "#/components/schemas/MessageDataUserDataAdd",
                  "MESSAGE_TYPE_USERNAME_PROOF": "#/components/schemas/MessageDataUsernameProof",
                  "MESSAGE_TYPE_FRAME_ACTION": "#/components/schemas/MessageDataFrameAction"
                }
              }
            }
          },
          "required": [
            "data"
          ]
        },
        {
          "$ref": "#/components/schemas/MessageCommon"
        }
      ],
      "description": "* \nA Message is a delta operation on the Farcaster network. The message protobuf is an envelope \nthat wraps a MessageData object and contains a hash and signature which can verify its authenticity."
    },
    "MessageCommon": {
      "type": "object",
      "properties": {
        "hash": {
          "title": "Hash digest of data",
          "pattern": "^0x[0-9a-fA-F]{40}$",
          "type": "string",
          "example": "0xd2b1ddc6c88e865a33cb1a565e0058d757042974"
        },
        "hashScheme": {
          "$ref": "#/components/schemas/HashScheme"
        },
        "signature": {
          "title": "Signature of the hash digest",
          "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
          "type": "string",
          "format": "byte"
        },
        "signatureScheme": {
          "$ref": "#/components/schemas/SignatureScheme"
        },
        "signer": {
          "title": "Public key or address of the key pair that produced the signature",
          "pattern": "^0x[0-9a-fA-F]+$",
          "type": "string"
        }
      },
      "required": [
        "hash",
        "hashScheme",
        "signature",
        "signatureScheme",
        "signer"
      ]
    },
    "MessageDataCommon": {
      "required": [
        "fid",
        "network",
        "timestamp"
      ],
      "type": "object",
      "properties": {
        "fid": {
          "title": "Farcaster ID of the user producing the message",
          "type": "integer",
          "format": "uint64",
          "example": 2
        },
        "timestamp": {
          "title": "Farcaster epoch timestamp in seconds",
          "type": "integer",
          "format": "int64",
          "example": 48994466
        },
        "network": {
          "$ref": "#/components/schemas/FarcasterNetwork"
        }
      }
    },
    "MessageDataCastAdd": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "castAddBody"
          ],
          "properties": {
            "castAddBody": {
              "$ref": "#/components/schemas/CastAddBody"
            }
          }
        }
      ]
    },
    "MessageDataCastRemove": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "castRemoveBody"
          ],
          "properties": {
            "castRemoveBody": {
              "$ref": "#/components/schemas/CastRemoveBody"
            }
          }
        }
      ]
    },
    "MessageDataFrameAction": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "frameActionBody"
          ],
          "properties": {
            "frameActionBody": {
              "$ref": "#/components/schemas/FrameActionBody"
            }
          }
        }
      ]
    },
    "MessageDataLink": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "linkBody"
          ],
          "properties": {
            "linkBody": {
              "$ref": "#/components/schemas/LinkBody"
            }
          }
        }
      ]
    },
    "MessageDataReaction": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "reactionBody"
          ],
          "properties": {
            "reactionBody": {
              "$ref": "#/components/schemas/ReactionBody"
            }
          }
        }
      ]
    },
    "MessageDataUserDataAdd": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "userDataBody"
          ],
          "properties": {
            "userDataBody": {
              "$ref": "#/components/schemas/UserDataBody"
            }
          }
        }
      ]
    },
    "MessageDataUsernameProof": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "usernameProofBody"
          ],
          "properties": {
            "usernameProofBody": {
              "$ref": "#/components/schemas/UserNameProof"
            }
          }
        }
      ]
    },
    "MessageDataVerificationAdd": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "verificationAddEthAddressBody"
          ],
          "properties": {
            "verificationAddEthAddressBody": {
              "$ref": "#/components/schemas/VerificationAddEthAddressBody"
            }
          }
        }
      ]
    },
    "MessageDataVerificationRemove": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageDataCommon"
        },
        {
          "type": "object",
          "required": [
            "verificationRemoveBody"
          ],
          "properties": {
            "verificationRemoveBody": {
              "$ref": "#/components/schemas/VerificationRemoveBody"
            }
          }
        }
      ]
    },
    "MessageType": {
      "type": "string",
      "description": "Type of the MessageBody.\n - MESSAGE_TYPE_CAST_ADD: Add a new Cast\n - MESSAGE_TYPE_CAST_REMOVE: Remove an existing Cast\n - MESSAGE_TYPE_REACTION_ADD: Add a Reaction to a Cast\n - MESSAGE_TYPE_REACTION_REMOVE: Remove a Reaction from a Cast\n - MESSAGE_TYPE_LINK_ADD: Add a new Link\n - MESSAGE_TYPE_LINK_REMOVE: Remove an existing Link\n - MESSAGE_TYPE_VERIFICATION_ADD_ETH_ADDRESS: Add a Verification of an Ethereum Address\n - MESSAGE_TYPE_VERIFICATION_REMOVE: Remove a Verification\n - MESSAGE_TYPE_USER_DATA_ADD: Add metadata about a user\n - MESSAGE_TYPE_USERNAME_PROOF: Add or replace a username proof\n - MESSAGE_TYPE_FRAME_ACTION: A Farcaster Frame action",
      "default": "MESSAGE_TYPE_CAST_ADD",
      "enum": [
        "MESSAGE_TYPE_CAST_ADD",
        "MESSAGE_TYPE_CAST_REMOVE",
        "MESSAGE_TYPE_REACTION_ADD",
        "MESSAGE_TYPE_REACTION_REMOVE",
        "MESSAGE_TYPE_LINK_ADD",
        "MESSAGE_TYPE_LINK_REMOVE",
        "MESSAGE_TYPE_VERIFICATION_ADD_ETH_ADDRESS",
        "MESSAGE_TYPE_VERIFICATION_REMOVE",
        "MESSAGE_TYPE_USER_DATA_ADD",
        "MESSAGE_TYPE_USERNAME_PROOF",
        "MESSAGE_TYPE_FRAME_ACTION"
      ]
    },
    "OnChainEvent": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/OnChainEventSigner"
        },
        {
          "$ref": "#/components/schemas/OnChainEventSignerMigrated"
        },
        {
          "$ref": "#/components/schemas/OnChainEventIdRegister"
        },
        {
          "$ref": "#/components/schemas/OnChainEventStorageRent"
        }
      ],
      "discriminator": {
        "propertyName": "type",
        "mapping": {
          "EVENT_TYPE_SIGNER": "#/components/schemas/OnChainEventSigner",
          "EVENT_TYPE_SIGNER_MIGRATED": "#/components/schemas/OnChainEventSignerMigrated",
          "EVENT_TYPE_ID_REGISTER": "#/components/schemas/OnChainEventIdRegister",
          "EVENT_TYPE_STORAGE_RENT": "#/components/schemas/OnChainEventStorageRent"
        }
      }
    },
    "OnChainEventCommon": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "example": "EVENT_TYPE_SIGNER"
        },
        "chainId": {
          "type": "integer"
        },
        "blockNumber": {
          "type": "integer"
        },
        "blockHash": {
          "type": "string",
          "example": "0x75fbbb8b2a4ede67ac350e1b0503c6a152c0091bd8e3ef4a6927d58e088eae28"
        },
        "blockTimestamp": {
          "type": "integer"
        },
        "transactionHash": {
          "type": "string",
          "example": "0x36ef79e6c460e6ae251908be13116ff0065960adb1ae032b4cc65a8352f28952"
        },
        "logIndex": {
          "type": "integer"
        },
        "txIndex": {
          "type": "integer"
        },
        "fid": {
          "type": "integer"
        }
      },
      "required": [
        "type",
        "chainId",
        "blockNumber",
        "blockHash",
        "blockTimestamp",
        "transactionHash",
        "logIndex",
        "txIndex",
        "fid"
      ]
    },
    "OnChainEventSigner": {
      "allOf": [
        {
          "$ref": "#/components/schemas/OnChainEventCommon"
        },
        {
          "type": "object",
          "properties": {
            "signerEventBody": {
              "$ref": "#/components/schemas/SignerEventBody"
            }
          },
          "required": [
            "signerEventBody"
          ]
        }
      ]
    },
    "OnChainEventSignerMigrated": {
      "allOf": [
        {
          "$ref": "#/components/schemas/OnChainEventCommon"
        },
        {
          "type": "object",
          "properties": {
            "signerMigratedEventBody": {
              "$ref": "#/components/schemas/SignerMigratedEventBody"
            }
          },
          "required": [
            "signerMigratedEventBody"
          ]
        }
      ]
    },
    "OnChainEventIdRegister": {
      "allOf": [
        {
          "$ref": "#/components/schemas/OnChainEventCommon"
        },
        {
          "type": "object",
          "properties": {
            "idRegisterEventBody": {
              "$ref": "#/components/schemas/IdRegisterEventBody"
            }
          },
          "required": [
            "idRegisterEventBody"
          ]
        }
      ]
    },
    "OnChainEventStorageRent": {
      "allOf": [
        {
          "$ref": "#/components/schemas/OnChainEventCommon"
        },
        {
          "type": "object",
          "properties": {
            "storageRentEventBody": {
              "$ref": "#/components/schemas/StorageRentEventBody"
            }
          },
          "required": [
            "storageRentEventBody"
          ]
        }
      ]
    },
    "OnChainEventType": {
      "type": "string",
      "default": "EVENT_TYPE_SIGNER",
      "enum": [
        "EVENT_TYPE_SIGNER",
        "EVENT_TYPE_SIGNER_MIGRATED",
        "EVENT_TYPE_ID_REGISTER",
        "EVENT_TYPE_STORAGE_RENT"
      ]
    },
    "PruneMessageBody": {
      "type": "object",
      "properties": {
        "message": {
          "$ref": "#/components/schemas/Message"
        }
      },
      "required": [
        "message"
      ]
    },
    "Reaction": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageCommon"
        },
        {
          "type": "object",
          "properties": {
            "data": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/MessageDataReaction"
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "$ref": "#/components/schemas/MessageType"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            }
          },
          "required": [
            "data"
          ]
        }
      ]
    },
    "ReactionBody": {
      "description": "Adds or removes a Reaction from a Cast",
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/components/schemas/ReactionType"
        },
        "targetCastId": {
          "$ref": "#/components/schemas/CastId"
        },
        "targetUrl": {
          "title": "URL to react to",
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "ReactionRemove": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageCommon"
        },
        {
          "type": "object",
          "properties": {
            "data": {
              "$ref": "#/components/schemas/MessageDataReaction"
            }
          },
          "required": [
            "data"
          ]
        }
      ]
    },
    "ReactionType": {
      "type": "string",
      "description": "Type of Reaction.\n- REACTION_TYPE_LIKE: Like the target cast\n - REACTION_TYPE_RECAST: Share target cast to the user's audience",
      "default": "REACTION_TYPE_LIKE",
      "enum": [
        "REACTION_TYPE_LIKE",
        "REACTION_TYPE_RECAST"
      ]
    },
    "RevokeMessageBody": {
      "type": "object",
      "properties": {
        "message": {
          "$ref": "#/components/schemas/Message"
        }
      },
      "required": [
        "message"
      ]
    },
    "SignatureScheme": {
      "type": "string",
      "description": "Type of signature scheme used to sign the Message hash\n- SIGNATURE_SCHEME_ED25519: Ed25519 signature (default)\n - SIGNATURE_SCHEME_EIP712: ECDSA signature using EIP-712 scheme",
      "default": "SIGNATURE_SCHEME_ED25519",
      "enum": [
        "SIGNATURE_SCHEME_ED25519",
        "SIGNATURE_SCHEME_EIP712"
      ]
    },
    "SignerEventBody": {
      "type": "object",
      "properties": {
        "key": {
          "pattern": "^0x[a-fA-F0-9]{64}$",
          "type": "string"
        },
        "keyType": {
          "type": "integer",
          "format": "int64"
        },
        "eventType": {
          "$ref": "#/components/schemas/SignerEventType"
        },
        "metadata":

# --- truncated at 32 KB (40 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/airstack/refs/heads/main/json-schema/farcaster-hub-api-schemas.json