@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
24 lines • 690 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatMemo = void 0;
/**
* Format stellar memo value for display.
*/
const formatMemo = (extra) => {
const memo = extra.memo;
// for backward compatibility for previous operation structure, as there is no
// data migration system in place
// noinspection SuspiciousTypeOfGuard
if (typeof memo == "string")
return memo;
switch (memo?.type) {
case "MEMO_ID":
case "MEMO_TEXT":
case "MEMO_HASH":
case "MEMO_RETURN":
return memo?.value;
}
return undefined;
};
exports.formatMemo = formatMemo;
//# sourceMappingURL=ui.js.map