Parameters
| Parameter | Type | Description |
|---|---|---|
payer | TransactionSigner | The account that will pay for the transaction |
authority | TransactionSigner | The authority of the credential |
credential | Address | The credential account this schema will be associated with |
schema | Address | The schema account to create |
systemProgram | Address | The System Program account (defaults to ‘11111111111111111111111111111111’) |
name | string | The name of the schema |
description | string | A detailed description of the schema’s purpose |
layout | Uint8Array | The binary layout definition of the schema |
fieldNames | string[] | The names of fields in the schema |
Returns
Returns anInstruction ({ accounts, data, programAddress }). Add it to a
transaction and send it with your client, for example
client.sendTransaction(instruction). There is no sendAndConfirm() method.
Create a Client sets up client, payerSigner, and authoritySigner.
Example
Important Notes
- The payer must be a signer of the transaction
- The authority must be a signer of the transaction and must be the authority of the credential
- The schema account must be writable
- The credential account must be readable
- This operation requires the System Program for rent exemption calculations
- The schema name should be descriptive and unique within the credential
- The description should provide clear information about the schema’s purpose and usage
- The layout must be a valid binary format that defines the structure of attestation data
- The fieldNames array must match the fields defined in the layout
- The schema can be paused later if needed
- The schema can be versioned to support evolution of the data structure
- All attestations created under this schema must conform to its structure