Show / Hide Table of Contents

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 Source

MaxCredentialTypeLengthHex

Maximum length of CredentialType in hex characters (64 bytes -> 128 hex chars).

Declaration
public const int MaxCredentialTypeLengthHex = 128
Field Value
Type Description
int
| Edit this page View Source

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 Source

ValidateCredentialsList(object, string, string, bool, int)

Validates a list of credentials. Two list shapes are supported:

  • When isStringID is true, the list must contain hex object-IDs (64 hex characters each). This is the format used by the CredentialIDs field on Payment, EscrowFinish, AccountDelete and PaymentChannelClaim.
  • When isStringID is false, the list must contain wrapped credential objects of the form { Credential: { Issuer, CredentialType } }. This is the format used by the AuthorizeCredentials / UnauthorizeCredentials fields 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.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX