diff --git a/packages/xrpl/src/models/transactions/XChainAddAccountCreateAttestation.ts b/packages/xrpl/src/models/transactions/XChainAddAccountCreateAttestation.ts index 207eaafa..99cee911 100644 --- a/packages/xrpl/src/models/transactions/XChainAddAccountCreateAttestation.ts +++ b/packages/xrpl/src/models/transactions/XChainAddAccountCreateAttestation.ts @@ -42,6 +42,60 @@ export function validateXChainAddAccountCreateAttestation( ): void { validateBaseTransaction(tx) + if (tx.Amount == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.Amount', + ) + } + + if (tx.AttestationRewardAccount == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.AttestationRewardAccount', + ) + } + + if (tx.Destination == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.Destination', + ) + } + + if (tx.OtherChainSource == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.OtherChainSource', + ) + } + + if (tx.PublicKey == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.PublicKey', + ) + } + + if (tx.Signature == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.Signature', + ) + } + + if (tx.SignatureReward == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.SignatureReward', + ) + } + + if (tx.WasLockingChainSend == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.WasLockingChainSend', + ) + } + + if (tx.XChainAccountCreateCount == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.XChainAccountCreateCount', + ) + } + if (tx.XChainBridge == null) { throw new ValidationError( 'XChainAddAccountCreateAttestation: missing field tx.XChainBridge', diff --git a/packages/xrpl/src/models/transactions/XChainAddClaimAttestation.ts b/packages/xrpl/src/models/transactions/XChainAddClaimAttestation.ts index b2e2deb3..f59222fc 100644 --- a/packages/xrpl/src/models/transactions/XChainAddClaimAttestation.ts +++ b/packages/xrpl/src/models/transactions/XChainAddClaimAttestation.ts @@ -40,9 +40,63 @@ export function validateXChainAddClaimAttestation( ): void { validateBaseTransaction(tx) + if (tx.Amount == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.Amount', + ) + } + + if (tx.AttestationRewardAccount == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.AttestationRewardAccount', + ) + } + + if (tx.Destination != null && typeof tx.Destination !== 'string') { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: invalid field tx.Destination', + ) + } + + if (tx.OtherChainSource == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.OtherChainSource', + ) + } + + if (tx.PublicKey == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.PublicKey', + ) + } + + if (tx.Signature == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.Signature', + ) + } + + if (tx.WasLockingChainSend == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.WasLockingChainSend', + ) + } + + if (tx.XChainAccountCreateCount == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.XChainAccountCreateCount', + ) + } + if (tx.XChainBridge == null) { throw new ValidationError( - 'XChainAddClaimAttestation: missing field tx.XChainBridge', + 'XChainAddAccountCreateAttestation: missing field tx.XChainBridge', + ) + } + + if (tx.XChainClaimID == null) { + throw new ValidationError( + 'XChainAddAccountCreateAttestation: missing field tx.XChainClaimID', ) } }