Retrieve a single credential by type and issuer (point-in-time).
credential.retrieve(
params: CredentialRetrieveParams,
): Promise<CredentialRetrieveResult>| Parameter | Type | Required | Description |
|---|---|---|---|
credType | string | Yes | The credential type. |
issuer | string | Yes | The issuer r-address. |
account | string | No | The holder (subject). Defaults to the primary signer's account. |
Resolves to a CredentialRetrieveResult:
| Field | Type | Description |
|---|---|---|
credType | string | The credential type. |
issuer | string | The issuer r-address. |
holder | string | The holder (subject) r-address. |
data | CredentialData | undefined | The credential snapshot, or undefined if none exists. |
| Field | Type | Description |
|---|---|---|
credType | string | The credential type. |
issuer | string | The issuer r-address. |
holder | string | The holder (subject) r-address. |
accepted | boolean | Whether the holder has accepted the credential. |
uri | string (optional) | The optional URI (decoded from hex). |
expiration | number (optional) | Expiration (seconds since the Ripple epoch), if set. |
Read-only — no signer is required and nothing is submitted. Queries the ledger with ledger_entry.
const { data } = await client.credential.retrieve({
credType: 'KYC',
issuer: 'rIssuer...',
})
console.log(data?.accepted)