new SchemaRegistryClient()
new SchemaRegistryClient(publicClient,walletClient,contractAddress):SchemaRegistryClient
Parameters
publicClient
walletClient
contractAddress
`0x${string}`
Returns
SchemaRegistryClient
Methods
register()
register(Register a new schemaschema,revocable):Promise<`0x${string}`>
Parameters
schema
string
The schema string to register
revocable
boolean
Whether attestations using this schema can be revoked
Returns
Promise<`0x${string}`>
The schema UID (hash)
getSchema()
getSchema(Get schema by UIDuid):Promise<{uid:`0x${string}`;revocable:boolean;schema:string; }>
Parameters
uid
`0x${string}`
The unique identifier (hash) of the schema
Returns
Promise<{ uid: `0x${string}`; revocable: boolean; schema: string; }>
The schema data including the schema string and revocable flag
isRevocable()
isRevocable(Check if a schema is revocableuid):Promise<boolean>
Parameters
uid
`0x${string}`
The unique identifier (hash) of the schema
Returns
Promise<boolean>
Boolean indicating if attestations using this schema can be revoked
getOrRegisterSchema()
getOrRegisterSchema(Register a new schema or get existing schema hashschema,revocable):Promise<`0x${string}`>
Parameters
schema
string
The schema string to register
revocable
boolean
Whether the schema is revocable
Returns
Promise<`0x${string}`>
The schema hash
Remarks
This function is fundamental to the attestation process as it:- Defines the data structure for digital asset attestations
- Ensures consistency in how digital asset data is stored and verified
- Controls whether attestations can be revoked
digitalAssetName: Name of the digital assetdigitalAssetDescription: Detailed description of the digital assetgrade: Numerical grade/rating of the digital asset

