"use strict";
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
const ethers_1 = require("ethers");
const ecdsa_vc_1 = require("@terminal3/ecdsa_vc");
const vc_core_1 = require("@terminal3/vc_core");
const config_1 = require("../config");
async function createVcT3(address) {
    const issuerPrivateKey = config_1.CLIENT_ACCOUNT_ECDSA.privateKey;
    const issuer = new ecdsa_vc_1.EthrDID(issuerPrivateKey.key, "polygon");
    const holderDid = new vc_core_1.DID("ethr", address);
    // Creating a credential with BBS+ signature
    const claims = { kyc: "passed" };
    const revocationRegistryAddress = "0x77Fb69B24e4C659CE03fB129c19Ad591374C349e";
    const didRegistryAddress = "0x312C15922c22B60f5557bAa1A85F2CdA4891C39a";
    const provider = new ethers_1.ethers.JsonRpcProvider("https://testnet.hashio.io/api");
    const options = {
        revocationRegistryAddress,
        provider,
        didRegistryAddress,
    };
    const vc = await (0, ecdsa_vc_1.createEcdsaCredential)(issuer, holderDid, claims, ["KycCredential"], undefined, undefined, options);
    const vcString = JSON.stringify(vc);
    const vcBase64 = Buffer.from(vcString).toString("base64");
    return vcBase64;
}
exports.default = createVcT3;
