Creates a new schema with automatic validation and IPFS upload.
Schema creation parameters including name, type, and definition
Promise resolving to creation results with schema ID and transaction hash
This is the primary method for creating schemas on the Vana network. It handles the complete workflow including schema validation, IPFS upload, and blockchain registration. The schema definition is stored unencrypted on IPFS to enable public access and reusability.
The method automatically:
// Create a JSON schema for user profiles
const result = await vana.schemas.create({
name: "User Profile",
type: "personal",
definition: {
type: "object",
properties: {
name: { type: "string" },
age: { type: "number", minimum: 0 }
},
required: ["name"]
}
});
console.log(`Schema created with ID: ${result.schemaId}`);
Retrieves a schema by its ID.
The ID of the schema to retrieve
Promise resolving to the schema object
Lists all schemas with pagination.
Optional parameters for listing schemas
Optional
limit?: numberMaximum number of schemas to return
Optional
offset?: numberNumber of schemas to skip
Promise resolving to an array of schemas
Adds a schema using the legacy method (low-level API).
Schema parameters including pre-generated definition URL
Promise resolving to the add schema result
Manages data schemas and refiners on the Vana network.
Remarks
This controller handles the complete lifecycle of data schemas including creation, validation, IPFS upload, and blockchain registration. It provides methods for managing both schemas (data structure definitions) and refiners (data processing definitions).
Schemas are public protocol entities that define data structures and validation rules. Unlike private user data, schemas are stored unencrypted on IPFS to enable public access and reusability across the network.
Example