"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateXChainAddAttestation = void 0;
const errors_1 = require("../../errors");
const common_1 = require("./common");
function validateXChainAddAttestation(tx) {
    (0, common_1.validateBaseTransaction)(tx);
    if (tx.XChainAttestationBatch == null) {
        throw new errors_1.ValidationError('XChainAddAttestation: missing field XChainAttestationBatch');
    }
    if (typeof tx.XChainAttestationBatch !== 'object') {
        throw new errors_1.ValidationError('XChainAddAttestation: XChainAttestationBatch must be an object');
    }
    const attestationBatch = tx.XChainAttestationBatch;
    if (attestationBatch.XChainBridge == null) {
        throw new errors_1.ValidationError('XChainAddAttestation: missing field XChainAttestationBatch.XChainBridge');
    }
    if (attestationBatch.XChainClaimAttestationBatch == null) {
        throw new errors_1.ValidationError('XChainAddAttestation: missing field XChainAttestationBatch.XChainClaimAttestationBatch');
    }
    if (attestationBatch.XChainCreateAccountAttestationBatch == null) {
        throw new errors_1.ValidationError('XChainAddAttestation: missing field XChainAttestationBatch.XChainCreateAccountAttestationBatch');
    }
}
exports.validateXChainAddAttestation = validateXChainAddAttestation;
//# sourceMappingURL=XChainAddAttestation.js.map