Skip to content
A credential represents an attestation authority in the Solana Attestation System. Credentials define who can issue attestations and what types of attestations they can issue. Each credential has a set of authorized signers who can create attestations under its authority.

​Structure

The Credential struct represents a credential in the Solana Attestation System. Each credential defines an authority that can issue attestations and the signers authorized to do so.

​Type Definitions

​Credential

​Methods

​Fetching Credentials

MethodDescriptionParametersReturns
fetchCredentialFetches a single credential by its addressrpc: RPC context, address: Credential’s address, config?: Fetch configPromise<Account<Credential>>
fetchMaybeCredentialSafely fetches a credential, returns null if not foundrpc: RPC context, address: Credential’s address, config?: Fetch configPromise<MaybeAccount<Credential>>
fetchAllCredentialFetches multiple credentials by their addressesrpc: RPC context, addresses: Array of credential addresses, config?: Fetch configPromise<Account<Credential>[]>
fetchAllMaybeCredentialSafely fetches multiple credentials, skips not foundrpc: RPC context, addresses: Array of credential addresses, config?: Fetch configPromise<MaybeAccount<Credential>[]>

​Serialization

MethodDescriptionParametersReturns
getCredentialEncoderGets the encoder for credential dataNoneEncoder<CredentialArgs>
getCredentialDecoderGets the decoder for credential dataNoneDecoder<Credential>
getCredentialCodecGets the codec for credential dataNoneCodec<CredentialArgs, Credential>

​Usage Examples

The examples use the rpc from Create a Client.

​Fetching a Single Credential

​Fetching Multiple Credentials

​Safe Fetching

​Important Notes

  • The discriminator field is used internally and should not be modified
  • The authority field determines who has control over the credential
  • authorizedSigners is an array of addresses that are allowed to create attestations under this credential
  • The name field is stored as a byte array and should be properly encoded/decoded according to your application’s needs
  • Only authorized signers can create attestations under a credential
  • The authority can modify the list of authorized signers