"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 || "",
    rateLimitOptions: {
        timeoutMs: 15000,
    },
};
describe("Xrp bottom block ", function () {
    let MccClient;
    let transaction;
    before(async function () {
        MccClient = new src_1.MCC.XRP(XRPMccConnection);
        transaction = await MccClient.getTransaction("B918C0796F0C31CD0B201A775C47FDFC479C1CAF48AC152BA9264062034BFBD5");
    });
    it("Should get intended spend amounts", async function () {
        const intendedSpendAmounts = transaction.intendedSpentAmounts;
        const expected = [
            {
                address: "rJF9FcJbVuq79FSjqHuM9rBSxXSQFtRLu2",
                amount: (0, src_1.toBN)(85),
            },
        ];
        (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(intendedSpendAmounts, expected)).to.be.true;
    });
    it("Should get actual spend amounts", async function () {
        const spendAmount = transaction.spentAmounts;
        const expected = [
            {
                address: "rJF9FcJbVuq79FSjqHuM9rBSxXSQFtRLu2",
                amount: (0, src_1.toBN)(10),
            },
        ];
        (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(spendAmount, expected)).to.be.true;
    });
    it("Should get intended received amounts", async function () {
        const intendedSpendAmounts = transaction.intendedReceivedAmounts;
        const expected = [
            {
                address: "rLCq1KvoCYeMj4H8hsRFrfPYHCRLLYDHdU",
                amount: (0, src_1.toBN)(75),
            },
        ];
        (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(intendedSpendAmounts, expected)).to.be.true;
    });
    it("Should get actual received amounts", async function () {
        const receivedAmount = transaction.receivedAmounts;
        const expected = [];
        (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(receivedAmount, expected)).to.be.true;
    });
    it("Should be failed transaction due to receiver", async function () {
        (0, chai_1.expect)(transaction.successStatus).to.eq(src_1.TransactionSuccessStatus.RECEIVER_FAILURE);
    });
});
//# sourceMappingURL=intededAmounts.test.js.map