@ledgerhq/coin-tron
Version:
Ledger Tron Coin integration
45 lines • 1.78 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const estimateFees_1 = require("./estimateFees");
const constants_1 = require("./constants");
describe("estimateFees", () => {
it("should calculate fees for native trx transactionIntent", async () => {
const transactionIntent = {
type: "send",
sender: "sender1",
recipient: "recipient1",
amount: BigInt(1000),
};
const result = await (0, estimateFees_1.estimateFees)(transactionIntent);
expect(result).toEqual(BigInt(constants_1.STANDARD_FEES_NATIVE.toString()));
});
it("should calculate fees for trc10 transactionIntent", async () => {
const transactionIntent = {
type: "send",
sender: "sender1",
recipient: "recipient1",
amount: BigInt(1000),
asset: {
standard: "trc10",
tokenId: "1002000",
},
};
const result = await (0, estimateFees_1.estimateFees)(transactionIntent);
expect(result).toEqual(BigInt(constants_1.STANDARD_FEES_NATIVE.toString()));
});
it("should calculate fees for trc20 transactionIntent", async () => {
const transactionIntent = {
type: "send",
sender: "sender1",
recipient: "recipient1",
amount: BigInt(1000),
asset: {
standard: "trc20",
contractAddress: "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",
},
};
const result = await (0, estimateFees_1.estimateFees)(transactionIntent);
expect(result).toEqual(BigInt(constants_1.ACTIVATION_FEES_TRC_20.toString()));
});
});
//# sourceMappingURL=estimateFees.test.js.map