@ledgerhq/coin-tezos
Version:
42 lines • 1.22 kB
JavaScript
import { getMainAccount } from "@ledgerhq/coin-framework/account/index";
function getDeviceTransactionConfig({ account, parentAccount, transaction: { mode, recipient }, status: { amount, estimatedFees }, }) {
const mainAccount = 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;
}
export default getDeviceTransactionConfig;
//# sourceMappingURL=deviceTransactionConfig.js.map