"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 || "https://xrplcluster.com",
    username: process.env.XRP_USERNAME || "",
    password: process.env.XRP_PASSWORD || "",
    apiTokenKey: process.env.FLARE_API_PORTAL_KEY || "",
};
// Find offerCreate where offer is actually accepted.
describe(`createOffer type (${(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);
    });
    describe("Offer not accepted at the time", function () {
        let transaction;
        before(async function () {
            transaction = await MccClient.getTransaction("0CD69FD1F0A890CC57CDA430213FD294F7D65FF4A0F379A0D09D07A222D324E6");
        });
        const sourceAddress = "rJkg989h7fPaJLm9CEyAsdvwgZYtKs2zzz";
        it("should correctly parse sourceAddresses", async function () {
            (0, chai_1.expect)(transaction.sourceAddresses).to.deep.equal([sourceAddress]);
        });
        it("should correctly parse receivingAddresses", async function () {
            (0, chai_1.expect)(transaction.receivingAddresses).to.deep.equal([]);
        });
        it("should correctly parse spentAmounts", async function () {
            const expected = [{ address: sourceAddress, amount: (0, src_1.toBN)("12") }];
            (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(transaction.spentAmounts, expected)).to.be.true;
        });
        it("should correctly parse receivedAmounts", async function () {
            const expected = [];
            (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(transaction.receivedAmounts, expected)).to.be.true;
        });
        it("should get balanceDecreasingSummary", async function () {
            const summary = await transaction.balanceDecreasingSummary({ sourceAddressIndicator: (0, src_1.standardAddressHash)("rJkg989h7fPaJLm9CEyAsdvwgZYtKs2zzz") });
            (0, chai_1.expect)(summary.status).to.eq(src_1.BalanceDecreasingSummaryStatus.Success);
            (0, chai_1.expect)(summary.response.spentAmount.toString()).to.eq("12");
        });
        // // Token transfers
        // it.skip("should correctly parse assetSourceAddresses", async function () {
        //    expect(transaction.assetSourceAddresses).to.deep.equal([]);
        // });
        // it.skip("should correctly parse assetReceivingAddresses", async function () {
        //    expect(transaction.assetReceivingAddresses).to.deep.equal([]);
        // });
        // it.skip("should correctly parse assetSpentAmounts", async function () {
        //    expect(transaction.assetSpentAmounts).to.deep.equal([]);
        // });
        // it.skip("should correctly parse assetReceivedAmounts", async function () {
        //    expect(transaction.assetReceivedAmounts).to.deep.equal([]);
        // });
    });
});
//# sourceMappingURL=createOffer.test.js.map