import BigNumber from "bignumber.js";
import dot from "./walletApiAdapter";
describe("getWalletAPITransactionSignFlowInfos", () => {
    describe("should properly get infos for DOT platform tx", () => {
        it("with most basic tx", () => {
            const dotPlatformTx = {
                family: "polkadot",
                amount: new BigNumber(100000),
                recipient: "0xABCDEF",
                mode: "send",
            };
            const { canEditFees, hasFeesProvided, liveTx } = dot.getWalletAPITransactionSignFlowInfos({
                walletApiTransaction: dotPlatformTx,
                account: {},
            });
            expect(canEditFees).toBe(true);
            expect(hasFeesProvided).toBe(false);
            expect(liveTx).toMatchInlineSnapshot(`
{
  "amount": "100000",
  "era": null,
  "family": "polkadot",
  "fees": null,
  "mode": "send",
  "numSlashingSpans": 0,
  "recipient": "0xABCDEF",
  "rewardDestination": null,
  "useAllAmount": false,
  "validators": [],
}
`);
        });
        it("with era provided", () => {
            const dotPlatformTx = {
                family: "polkadot",
                amount: new BigNumber(100000),
                recipient: "0xABCDEF",
                mode: "send",
                era: 1,
            };
            const { canEditFees, hasFeesProvided, liveTx } = dot.getWalletAPITransactionSignFlowInfos({
                walletApiTransaction: dotPlatformTx,
                account: {},
            });
            expect(canEditFees).toBe(true);
            expect(hasFeesProvided).toBe(false);
            expect(liveTx).toMatchInlineSnapshot(`
{
  "amount": "100000",
  "era": "1",
  "family": "polkadot",
  "fees": null,
  "mode": "send",
  "numSlashingSpans": 0,
  "recipient": "0xABCDEF",
  "rewardDestination": null,
  "useAllAmount": false,
  "validators": [],
}
`);
        });
        it("with mode provided", () => {
            const dotPlatformTx = {
                family: "polkadot",
                amount: new BigNumber(100000),
                recipient: "0xABCDEF",
                mode: "bond",
            };
            const { canEditFees, hasFeesProvided, liveTx } = dot.getWalletAPITransactionSignFlowInfos({
                walletApiTransaction: dotPlatformTx,
                account: {},
            });
            expect(canEditFees).toBe(true);
            expect(hasFeesProvided).toBe(false);
            expect(liveTx).toMatchInlineSnapshot(`
{
  "amount": "100000",
  "era": null,
  "family": "polkadot",
  "fees": null,
  "mode": "bond",
  "numSlashingSpans": 0,
  "recipient": "0xABCDEF",
  "rewardDestination": null,
  "useAllAmount": false,
  "validators": [],
}
`);
        });
        it("with fees provided", () => {
            const dotPlatformTx = {
                family: "polkadot",
                amount: new BigNumber(100000),
                recipient: "0xABCDEF",
                mode: "send",
                fee: new BigNumber(300),
            };
            const { canEditFees, hasFeesProvided, liveTx } = dot.getWalletAPITransactionSignFlowInfos({
                walletApiTransaction: dotPlatformTx,
                account: {},
            });
            expect(canEditFees).toBe(true);
            expect(hasFeesProvided).toBe(true);
            expect(liveTx).toMatchInlineSnapshot(`
{
  "amount": "100000",
  "era": null,
  "family": "polkadot",
  "fees": "300",
  "feesStrategy": null,
  "mode": "send",
  "numSlashingSpans": 0,
  "recipient": "0xABCDEF",
  "rewardDestination": null,
  "useAllAmount": false,
  "validators": [],
}
`);
        });
    });
});
//# sourceMappingURL=walletApiAdapter.test.js.map