Comment on page
Metadata
Metadata is stored as a string within the Schema Registry. Once you parse that information it complies with the following structure.
type Metadata = {
name: string;
badge: string;
video?: string;
description: string;
verifier: Verifier;
requirements: Requirement[];
};
name:
Name of the Certificate this Schema resolves.badge:
URL to Certificate badge image (.png).video:
URL to Certificate badge video (.mp4). Optional.description:
Description of the Certificate this Schema resolves.verifier:
Details of the entity that verifies the Certificate this Schema resolves.requirements:
List of requirements to claim the Certificate this Schema resolves. This resolves into the UI displayed on the dynamic form within Vault+.type Verifier = {
name: string;
verificationMethod: string;
description?: string;
};
name:
Name of the entity that verifies the Crendential this Schema resolves.verificationMethod:
Verification method used to verify the Crendential this Schema resolves.description:
Brief description of the entity that verifies the Crendential this Schema resolves. Optional.Requirements can be of different kinds depending on the information we want to gather from the user but, all of them share information.
type DataType = "String" | "Number" | "Date" | "Signature";
type Requirement = (
| RequirementText
| RequirementEmail
| RequirementDate
| RequirementSelect
| RequirementImage
) & {
name: string;
dataType: DataType;
label: string;
question: string;
placeholder?: string;
required: boolean;
};
name:
Name of the field.dataType:
Type of data used in the Relayer yo verify and transform values.label:
Label to be shown on screen.question:
Question of action label to be shown on screen.placeholder:
Placeholder to set in dynamic input. Optional.required:
Boolean value that determines if the field id required or optional.type RequirementText = {
inputType: "text";
};
type RequirementEmail = {
inputType: "email";
};
type RequirementDate = {
inputType: "date";
};
type RequirementSelect = {
inputType: "select";
options: { value: string; label: string }[];
};
options:
Array of objects containing value
and label
to be used as options.type RequirementImage = {
inputType: "image";
exts: string[];
};
exts:
Array os string containing the accepted extension for the file input.const Example: Metadata = {
name: "Army",
badge: "https://serv-assets.s3.amazonaws.com/badges/us_army.png",
video: "https://serv-assets.s3.amazonaws.com/badges/us_army.mp4",
description:
"To join elevateDAO, you can self verify yourself. this data is private.... same as now",
verifier: {
name: "ElevateDAO",
description:
"ElevateDAO is owned entirely by its members (any active or retired military and law enforcement can join). We are building technology and programs to promote a free, safe society.",
verificationMethod: "selfAttestation",
},
requirements: [
{
inputType: "text",
dataType: "String",
name: "first_name",
label: "First name",
placeholder: "First name",
question: "What is your first name?",
required: true,
},
{
inputType: "text",
dataType: "String",
name: "last_name",
label: "Last name",
placeholder: "Last name",
question: "What is your last name?",
required: true,
},
{
inputType: "text",
dataType: "String",
name: "unit",
label: "Unit",
placeholder: "Unit",
question: "What is your unit?",
required: true,
},
{
inputType: "text",
dataType: "String",
name: "start_year",
label: "Start year",
placeholder: "Start year",
question: "What is your start year?",
required: true,
},
{
inputType: "text",
dataType: "String",
name: "end_year",
label: "End year",
placeholder: "End year",
question: "What is your end year?",
required: false,
},
],
};
Last modified 8mo ago