"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUidProof = void 0;
const util_1 = require("@polkadot/util");
const uuid_1 = require("uuid");
const formatters_1 = require("./formatters");
exports.getUidProof = ({ did, uID, ticker, confidentialIdentity, }) => {
    const u8InvestorDid = util_1.hexToU8a(did);
    const u8InvestorUId = uuid_1.parse(uID);
    const u8ScopeDid = util_1.stringToU8a(formatters_1.stringToPadded(ticker));
    const cddClaim = JSON.stringify({
        investor_did: Array.from(u8InvestorDid),
        investor_unique_id: Array.from(u8InvestorUId),
    });
    const scopedClaim = JSON.stringify({
        scope_did: Array.from(u8ScopeDid),
        investor_unique_id: Array.from(u8InvestorUId),
    });
    const claimProofString = confidentialIdentity.process_create_claim_proof(cddClaim, scopedClaim);
    const claimProof = JSON.parse(claimProofString);
    Object.keys(claimProof).forEach((key) => {
        claimProof[key] = util_1.u8aToHex(claimProof[key]);
    });
    return claimProof;
};
//# sourceMappingURL=getUidProof.js.map