@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
48 lines • 1.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("./index");
const feature_stake_programs_empty_json = {
enabled: true,
params: {
list: ["injective", "ethereum"],
redirects: {},
},
};
const feature_stake_programs_json = {
enabled: true,
params: {
list: ["injective"],
redirects: {
"ethereum/erc20/usd__coin": {
platform: "kiln-widget",
name: "",
},
"ethereum/erc20/usd_tether__erc20_": {
platform: "earn",
name: "",
},
tron: {
platform: "stakekit",
name: "",
queryParams: {
yieldId: "tron-native-staking",
},
},
},
},
};
describe("stakeProgramsToEarnParam", () => {
it("should return `undefined` when there are no redirects", () => {
const { stakeProgramsParam } = (0, index_1.stakeProgramsToEarnParam)(feature_stake_programs_empty_json);
expect(stakeProgramsParam).toEqual(undefined);
});
it("should return a record of stake earn params", () => {
const { stakeProgramsParam } = (0, index_1.stakeProgramsToEarnParam)(feature_stake_programs_json);
expect(stakeProgramsParam).toEqual({
"ethereum/erc20/usd__coin": "kiln-widget",
"ethereum/erc20/usd_tether__erc20_": "earn",
tron: "stakekit",
});
});
});
//# sourceMappingURL=index.test.js.map