@ledgerhq/coin-tezos
Version:
44 lines • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("@ledgerhq/coin-framework/account/index");
function getDeviceTransactionConfig({ account, parentAccount, transaction: { mode, recipient }, status: { amount, estimatedFees }, }) {
const mainAccount = (0, index_1.getMainAccount)(account, parentAccount);
const source = mainAccount.freshAddress;
const isDelegateOperation = mode === "delegate";
const fields = [
{
type: "address",
label: "Source",
address: source,
},
];
if (isDelegateOperation) {
fields.push({
type: "tezos.delegateValidator",
label: "Validator",
}, {
type: "address",
label: "Delegate",
address: recipient,
});
}
if (!amount.isZero()) {
fields.push({
type: "amount",
label: "Amount",
});
}
if (!estimatedFees.isZero()) {
fields.push({
type: "fees",
label: "Fees",
});
}
fields.push({
type: "tezos.storageLimit",
label: "Storage Limit",
});
return fields;
}
exports.default = getDeviceTransactionConfig;
//# sourceMappingURL=deviceTransactionConfig.js.map