@ledgerhq/coin-casper
Version:
Ledger Casper integration
54 lines • 1.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.acceptTransaction = void 0;
const specs_1 = require("@ledgerhq/coin-framework/bot/specs");
const addresses_1 = require("../bridge/bridgeHelpers/addresses");
const consts_1 = require("../consts");
exports.acceptTransaction = (0, specs_1.deviceActionFlow)({
steps: [
{
title: "Please",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: () => "review",
},
{
title: "Txn hash",
button: specs_1.SpeculosButton.RIGHT,
},
{
title: "Type",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: () => "Token transfer",
},
{
title: "Chain ID",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: () => consts_1.CASPER_NETWORK,
},
{
title: "Account",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ account }) => (0, addresses_1.casperAccountHashFromPublicKey)(account.freshAddress),
},
{
title: "Fee",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ transaction }) => `${transaction.fees.toNumber().toLocaleString("en-US").replace(/,/g, " ")} motes`,
},
{
title: "Target",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ transaction }) => (0, addresses_1.casperAccountHashFromPublicKey)(transaction.recipient),
},
{
title: "Amount",
button: specs_1.SpeculosButton.RIGHT,
expectedValue: ({ status }) => `${status.amount.toNumber().toLocaleString("en-US").replace(/,/g, " ")} motes`,
},
{
title: "APPROVE",
button: specs_1.SpeculosButton.BOTH,
},
],
});
//# sourceMappingURL=speculos-deviceActions.js.map