"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CurrentIdentity = void 0;
const internal_1 = require("./internal");
const types_1 = require("./types");
const internal_2 = require("./utils/internal");
/**
 * Handles functionality related to the Current Identity
 */
class CurrentIdentity {
    /**
     * @hidden
     */
    constructor(context) {
        this.context = context;
        this.removeSecondaryKeys = internal_2.createProcedureMethod({
            getProcedureAndArgs: args => [internal_1.removeSecondaryKeys, Object.assign({}, args)],
        }, context);
        this.revokePermissions = internal_2.createProcedureMethod({
            getProcedureAndArgs: args => {
                const { secondaryKeys } = args;
                const signers = secondaryKeys.map(signer => {
                    return {
                        signer,
                        permissions: {
                            tokens: { type: types_1.PermissionType.Include, values: [] },
                            transactions: { type: types_1.PermissionType.Include, values: [] },
                            portfolios: { type: types_1.PermissionType.Include, values: [] },
                        },
                    };
                });
                return [internal_1.modifySignerPermissions, { secondaryKeys: signers }];
            },
        }, context);
        this.modifyPermissions = internal_2.createProcedureMethod({ getProcedureAndArgs: args => [internal_1.modifySignerPermissions, Object.assign({}, args)] }, context);
        this.inviteAccount = internal_2.createProcedureMethod({ getProcedureAndArgs: args => [internal_1.inviteAccount, Object.assign({}, args)] }, context);
        this.createVenue = internal_2.createProcedureMethod({ getProcedureAndArgs: args => [internal_1.createVenue, args] }, context);
        this.freezeSecondaryKeys = internal_2.createProcedureMethod({ getProcedureAndArgs: () => [internal_1.toggleFreezeSecondaryKeys, { freeze: true }], voidArgs: true }, context);
        this.unfreezeSecondaryKeys = internal_2.createProcedureMethod({ getProcedureAndArgs: () => [internal_1.toggleFreezeSecondaryKeys, { freeze: false }], voidArgs: true }, context);
        this.reserveTicker = internal_2.createProcedureMethod({
            getProcedureAndArgs: args => [internal_1.reserveTicker, args],
        }, context);
        this.createToken = internal_2.createProcedureMethod({
            getProcedureAndArgs: args => [internal_1.createSecurityToken, Object.assign({ reservationRequired: false }, args)],
        }, context);
    }
}
exports.CurrentIdentity = CurrentIdentity;
//# sourceMappingURL=CurrentIdentity.js.map