"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const src_1 = require("../../src");
const testUtils_1 = require("../testUtils");
const XRPMccConnection = {
    url: process.env.XRP_URL || "",
    username: process.env.XRP_USERNAME || "",
    password: process.env.XRP_PASSWORD || "",
    apiTokenKey: process.env.FLARE_API_PORTAL_KEY || "",
};
describe(`Balance decreasing summary tests, ${(0, testUtils_1.getTestFile)(__filename)}`, function () {
    let MccClient;
    before(async function () {
        src_1.traceManager.displayRuntimeTrace = false;
        src_1.traceManager.displayStateOnException = false;
        MccClient = new src_1.MCC.XRP(XRPMccConnection);
    });
    it("Should be able to extract balance decreasing", async function () {
        const tx_id = "27D592539E1FB00E8E4C4B6022729CB5559DE94AA2285AE510664A7E0891B3DB";
        const transaction = await MccClient.getTransaction(tx_id);
        const dec = await transaction.balanceDecreasingSummary({ sourceAddressIndicator: (0, src_1.standardAddressHash)("r4s3spDTkS5xZoQujwEzbjgep3NUPTiHyq") });
        (0, chai_1.expect)(dec.status).to.eq("success");
        if (dec.response) {
            const decRes = dec.response;
            (0, chai_1.expect)(decRes.blockTimestamp).to.eq(1681890461);
            (0, chai_1.expect)(decRes.transactionHash).to.eq(tx_id);
            (0, chai_1.expect)(decRes.sourceAddressHash).to.eq((0, src_1.standardAddressHash)("r4s3spDTkS5xZoQujwEzbjgep3NUPTiHyq"));
            (0, chai_1.expect)(decRes.sourceAddress).to.eq("r4s3spDTkS5xZoQujwEzbjgep3NUPTiHyq");
            (0, chai_1.expect)(decRes.spentAmount.toString()).to.eq("3008927670");
            (0, chai_1.expect)(decRes.paymentReference).to.eq(src_1.ZERO_BYTES_32);
            (0, chai_1.expect)(decRes.sourceAddressIndicator).to.eq((0, src_1.standardAddressHash)("r4s3spDTkS5xZoQujwEzbjgep3NUPTiHyq"));
            (0, chai_1.expect)(decRes.isFull).to.eq(true);
        }
    });
    // TODO: explore how this should be handled
});
//# sourceMappingURL=balanceDecreasing.test.js.map