Parameters
| Parameter | Type | Description |
|---|---|---|
payer | TransactionSigner | The account that will pay for the transaction |
authority | TransactionSigner | The authorized signer of the credential |
credential | Address | The credential account associated with the schema |
schema | Address | The schema account that defines the attestation structure |
attestation | Address | The attestation account to create |
systemProgram | Address | The System Program account (defaults to ‘11111111111111111111111111111111’) |
nonce | Address | A unique identifier for the attestation |
data | Uint8Array | The attestation data that must conform to the schema |
expiry | number | bigint | The expiration timestamp for the attestation |
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
- Only authorized signers of the credential can create attestations
- The authority must be a signer of the transaction
- The payer must be a signer of the transaction
- The attestation account must be writable
- The credential and schema accounts must be readable
- This operation requires the System Program for rent exemption calculations
- The schema must not be paused
- The data must conform to the schema’s structure and validation rules
- The nonce must be unique for each attestation
- The expiry timestamp must be in the future
- The attestation will be invalid after the expiry timestamp
- The credential must be associated with the schema