Hypercerts API
The hypercerts API provides endpoints for storing, updating and querying hypercerts metadata, allowlist data, marketplace listings and user profiles. For a current overview of the implentation please review the OpenAPI specification on the staging or production endpoints.
The API also includes a GraphQL endpoint and playground on the staging or production endpoints. The schemas can be introspected by grapqhl clients like urql
.
Code can be found in our Github repository.
REST API
The API provides endpoints for storing and verifying hypercert metadata, allowlists, marketplace listings, user profiles and more.
Storing data
When user submits a POST request for storing hypercert metadata or allowlist data, the API:
- Validates the data
- Stores the data in the database
- Parses the data and fetches relevant data for storage
- Stores the data on IPFS
- Returns a response to the user containing the CID
If the request contains references to allowlist data from an external source, the service will try to fetch and validate the remote allowlist data.
Validating data
When a user submits a POST request for validation of a hypercert metadata or allowlist data, the API:
- Validates the data
- Returns the validation result
If the request contains references to allowlist data from an external source, the service will try to fetch and validate the remote allowlist data.
Storing marketplace listings
When a user submits a POST request for storing a marketplace listing, the API:
- Validates the data
- Stores the data in the database
GraphQL
Our GraphQL API is powered by type-graphql
and graphql-yoga
.
The Yoga server is deployed on Railway and the schema can be introspected on the staging or production endpoints. It exposes the schema as defined in the hypercerts-api repository. To build the schema we leverage type-graphql
to define the types and resolvers.
Data is read from both our caching and storage databases and composed by the resolvers. Caching in our context implies all data that we store based on on-chain events. The storage database contains data like blueprints, user metadata and marketplace listings.