UNPKG

@ledgerhq/live-common

Version:
22 lines 710 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStatusError = getStatusError; exports.pickBlockingError = pickBlockingError; function getStatusError(errors, key) { if (!errors) return undefined; return errors[key]; } function pickBlockingError(errors) { if (!errors) return undefined; // Prefer errors that are commonly tied to amount validity on UTXO chains. const priorityKeys = ["dustLimit", "recipient", "fees", "transaction"]; for (const key of priorityKeys) { const err = errors[key]; if (err) return err; } return Object.values(errors).find(Boolean); } //# sourceMappingURL=errors.js.map