Skip to content

credential.retrieve()

[Source]

Retrieve a single credential by type and issuer (point-in-time).

Signature

credential.retrieve(
  params: CredentialRetrieveParams,
): Promise<CredentialRetrieveResult>

Parameters

ParameterTypeRequiredDescription
credTypestringYesThe credential type.
issuerstringYesThe issuer r-address.
accountstringNoThe holder (subject). Defaults to the primary signer's account.

Returns

Resolves to a CredentialRetrieveResult:

FieldTypeDescription
credTypestringThe credential type.
issuerstringThe issuer r-address.
holderstringThe holder (subject) r-address.
dataCredentialData | undefinedThe credential snapshot, or undefined if none exists.

CredentialData

FieldTypeDescription
credTypestringThe credential type.
issuerstringThe issuer r-address.
holderstringThe holder (subject) r-address.
acceptedbooleanWhether the holder has accepted the credential.
uristring (optional)The optional URI (decoded from hex).
expirationnumber (optional)Expiration (seconds since the Ripple epoch), if set.

Underlying XRPL request

Read-only — no signer is required and nothing is submitted. Queries the ledger with ledger_entry.

Example

const { data } = await client.credential.retrieve({
  credType: 'KYC',
  issuer: 'rIssuer...',
})

console.log(data?.accepted)