UNPKG

@ledgerhq/live-common

Version:
38 lines 1.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_SEND_UI_CONFIG = void 0; exports.getSendUiConfig = getSendUiConfig; const registry_1 = require("../../bridge/descriptor/registry"); const features_1 = require("../../bridge/descriptor/send/features"); exports.DEFAULT_SEND_UI_CONFIG = { hasMemo: false, memoType: undefined, memoMaxLength: undefined, memoMaxValue: undefined, memoOptions: undefined, recipientSupportsDomain: false, hasFeePresets: false, hasCustomFees: false, hasCoinControl: false, }; function getSendUiConfig(currency) { if (!currency) return exports.DEFAULT_SEND_UI_CONFIG; const descriptor = (0, registry_1.getSendDescriptor)(currency); if (!descriptor) { return exports.DEFAULT_SEND_UI_CONFIG; } const memoDescriptor = descriptor.inputs.memo; return { hasMemo: features_1.sendFeatures.hasMemo(currency), memoType: memoDescriptor?.type, memoMaxLength: features_1.sendFeatures.getMemoMaxLength(currency), memoMaxValue: features_1.sendFeatures.getMemoMaxValue(currency), memoOptions: features_1.sendFeatures.getMemoOptions(currency), recipientSupportsDomain: features_1.sendFeatures.supportsDomain(currency), hasFeePresets: features_1.sendFeatures.hasFeePresets(currency), hasCustomFees: features_1.sendFeatures.hasCustomFees(currency), hasCoinControl: features_1.sendFeatures.hasCoinControl(currency), }; } //# sourceMappingURL=uiConfig.js.map