Usage & Examples

Schemas

Querying Schemas

async function querySchemaList(query: {
  id?: string;
  registrant?: string;
  mode?: "offchain" | "onchain";
  page: number;
  size?: number;
}): Promise<
  PageInfo & {
    rows: SchemaInfo[];
  }
>;

Parameters

Name
Type / Value
Description

id?

string

The schema ID you are querying for.

registrant?

string

Find schemas that were created by a specific registrant address.

mode?

offchain, onchain

The schema's location.

page

number

The page to fetch.

size?

number

The number of results to return.

Example

Getting a Schema By ID

Parameters

Name
Type
Description

schemaId

string

The ID of the schema to retrieve.

Example

Attestations

Querying Attestations

Parameters

Name
Type / Value
Description

id?

string

The attestation ID you are querying for.

schemaId?

string

Find attestations that belong to a specific schema ID.

attester?

string

Find attestations that a specific attester created.

page

number

The page to fetch.

mode?

offchain, onchain

The attestation's location.

indexingValue?

string

Find attestations with a specific indexing value.

Example

Getting an Attestation By ID

Parameters

Name
Type
Description

attestationId

string

The ID of the schema to retrieve.

Example

Utils

Decoding Attestation Data

Parameters

Name
Type / Value
Description

data

string

The hex string retrieved from an onchain attestation object.

DataLocationOnChain

DataLocationOnChain

Location of the data. Either ONCHAIN, ARWEAVE, or IPFS.

schemaData

string

The data string of the schema that this attestation belongs to.

Example

Last updated

Was this helpful?