"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Identities = void 0;
const internal_1 = require("../../internal");
const internal_2 = require("../../utils/internal");
/**
 * Handles all Identity related functionality
 */
class Identities {
    /**
     * @hidden
     */
    constructor(context) {
        this.context = context;
        this.registerIdentity = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.registerIdentity, args] }, context);
        this.createPortfolio = (0, internal_2.createProcedureMethod)({ getProcedureAndArgs: args => [internal_1.createPortfolio, args] }, context);
    }
    /**
     * Create an Identity instance from a DID
     *
     * @throws if there is no Identity with the passed DID
     */
    getIdentity(args) {
        return this.context.getIdentity(args.did);
    }
    /**
     * Return whether the supplied Identity/DID exists
     */
    isIdentityValid(args) {
        return (0, internal_2.asIdentity)(args.identity, this.context).exists();
    }
}
exports.Identities = Identities;
//# sourceMappingURL=Identities.js.map