Class CredentialsValidator
Shared validator for XLS-70 credential collections used across transactions.
Mirrors the behavior of validateCredentialsList from xrpl.js.
Inheritance
object
CredentialsValidator
Namespace: Xrpl.Models.Transactions
Assembly: Xrpl.dll
Syntax
public static class CredentialsValidator
Fields
| Edit this page View SourceMaxCredentialTypeLengthHex
Maximum length of CredentialType in hex characters (64 bytes -> 128 hex chars).
Declaration
public const int MaxCredentialTypeLengthHex = 128
Field Value
| Type | Description |
|---|---|
| int |
MaxCredentialsListLength
Maximum number of credentials allowed in a single XLS-70 list.
Declaration
public const int MaxCredentialsListLength = 8
Field Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceValidateCredentialsList(object, string, string, bool, int)
Validates a list of credentials. Two list shapes are supported:
- When
isStringIDistrue, the list must contain hex object-IDs (64 hex characters each). This is the format used by theCredentialIDsfield on Payment, EscrowFinish, AccountDelete and PaymentChannelClaim. - When
isStringIDisfalse, the list must contain wrapped credential objects of the form{ Credential: { Issuer, CredentialType } }. This is the format used by theAuthorizeCredentials/UnauthorizeCredentialsfields on the DepositPreauth transaction.
Declaration
public static void ValidateCredentialsList(object credentials, string txType, string fieldName, bool isStringID, int maxLength = 8)
Parameters
| Type | Name | Description |
|---|---|---|
| object | credentials | The raw list value extracted from the transaction dictionary. |
| string | txType | The transaction type name used for error messages (e.g. "Payment"). |
| string | fieldName | The field name used for error messages (e.g. "CredentialIDs"). |
| bool | isStringID | Determines the expected element shape (see above). |
| int | maxLength | Maximum allowed list length. Defaults to MaxCredentialsListLength. |
Exceptions
| Type | Condition |
|---|---|
| ValidationException | Thrown when the list is malformed. |