@ledgerhq/coin-stellar
Version:
Ledger Stellar Coin integration
41 lines • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
async function getDeviceTransactionConfig({ status: { amount, estimatedFees }, transaction, }) {
const { assetReference, assetOwner } = transaction;
const fields = [
{
type: "stellar.network",
label: "Network",
},
];
if (!amount.isZero()) {
fields.push({
type: "amount",
label: "Amount",
});
}
if (assetReference && assetOwner) {
fields.push({
type: "stellar.assetCode",
label: "Asset",
});
fields.push({
type: "stellar.assetIssuer",
label: "Asset issuer",
});
}
fields.push({
type: "stellar.memo",
label: "Memo",
});
//NB device displays [none] for an empty memo
if (estimatedFees && !estimatedFees.isZero()) {
fields.push({
type: "fees",
label: "Fees",
});
}
return fields;
}
exports.default = getDeviceTransactionConfig;
//# sourceMappingURL=deviceTransactionConfig.js.map