// SPDX-License-Identifier: Apache-2.0
import { GenesisNetworkDataWrapper } from './genesis-network-data-wrapper.js';
import { Address } from '../../business/address/address.js';
export class GenesisNetworkNodeDataWrapper extends GenesisNetworkDataWrapper {
    nodeId;
    adminKey;
    description;
    accountId;
    serviceEndpoint = [];
    grpcCertificateHash;
    deleted = false;
    constructor(nodeId, adminKey, description) {
        super(nodeId);
        this.nodeId = nodeId;
        this.adminKey = adminKey;
        this.description = description;
    }
    /**
     * @param fqdnOrIpAddress - a fully qualified domain name or an IPv4 address
     * @param port
     */
    addServiceEndpoint(fqdnOrIpAddress, port) {
        const address = new Address(port, fqdnOrIpAddress);
        this.serviceEndpoint.push({
            domainName: address.domainName,
            port,
            ipAddressV4: address.ipAddressV4Base64,
        });
    }
    toObject() {
        return {
            nodeId: this.nodeId,
            accountId: {
                realmNum: `${this.accountId.realm}`,
                shardNum: `${this.accountId.shard}`,
                accountNum: `${this.accountId.num}`,
            },
            description: this.description,
            gossipEndpoint: this.gossipEndpoint,
            serviceEndpoint: this.serviceEndpoint,
            gossipCaCertificate: this.gossipCaCertificate,
            grpcCertificateHash: this.grpcCertificateHash,
            weight: this.weight,
            deleted: this.deleted,
            adminKey: this.adminKey,
        };
    }
}
//
//# sourceMappingURL=genesis-network-node-data-wrapper.js.map