2021-07-20 21:34:32 +02:00
|
|
|
export const GAS_FORM_ERRORS = {
|
|
|
|
GAS_LIMIT_OUT_OF_BOUNDS: 'editGasLimitOutOfBounds',
|
|
|
|
MAX_PRIORITY_FEE_TOO_LOW: 'editGasMaxPriorityFeeLow',
|
|
|
|
MAX_FEE_TOO_LOW: 'editGasMaxFeeLow',
|
2021-08-05 00:07:17 +02:00
|
|
|
MAX_PRIORITY_FEE_BELOW_MINIMUM: 'editGasMaxPriorityFeeBelowMinimum',
|
2021-07-20 21:34:32 +02:00
|
|
|
MAX_PRIORITY_FEE_HIGH_WARNING: 'editGasMaxPriorityFeeHigh',
|
|
|
|
MAX_FEE_HIGH_WARNING: 'editGasMaxFeeHigh',
|
2021-08-02 16:07:29 +02:00
|
|
|
MAX_FEE_IMBALANCE: 'editGasMaxFeeImbalance',
|
2021-08-03 17:54:49 +02:00
|
|
|
GAS_PRICE_TOO_LOW: 'editGasPriceTooLow',
|
2021-07-20 21:34:32 +02:00
|
|
|
};
|
|
|
|
|
2021-07-30 13:35:30 +02:00
|
|
|
export function getGasFormErrorText(type, t, { minimumGasLimit } = {}) {
|
2021-07-20 21:34:32 +02:00
|
|
|
switch (type) {
|
|
|
|
case GAS_FORM_ERRORS.GAS_LIMIT_OUT_OF_BOUNDS:
|
2021-07-30 13:35:30 +02:00
|
|
|
return t('editGasLimitOutOfBounds', [minimumGasLimit]);
|
2021-07-20 21:34:32 +02:00
|
|
|
case GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW:
|
|
|
|
return t('editGasMaxPriorityFeeLow');
|
|
|
|
case GAS_FORM_ERRORS.MAX_FEE_TOO_LOW:
|
|
|
|
return t('editGasMaxFeeLow');
|
2021-08-04 15:23:52 +02:00
|
|
|
case GAS_FORM_ERRORS.MAX_PRIORITY_FEE_BELOW_MINIMUM:
|
|
|
|
return t('editGasMaxPriorityFeeBelowMinimum');
|
2021-07-20 21:34:32 +02:00
|
|
|
case GAS_FORM_ERRORS.MAX_PRIORITY_FEE_HIGH_WARNING:
|
|
|
|
return t('editGasMaxPriorityFeeHigh');
|
|
|
|
case GAS_FORM_ERRORS.MAX_FEE_HIGH_WARNING:
|
|
|
|
return t('editGasMaxFeeHigh');
|
2021-08-02 16:07:29 +02:00
|
|
|
case GAS_FORM_ERRORS.MAX_FEE_IMBALANCE:
|
|
|
|
return t('editGasMaxFeePriorityImbalance');
|
2021-08-03 17:54:49 +02:00
|
|
|
case GAS_FORM_ERRORS.GAS_PRICE_TOO_LOW:
|
|
|
|
return t('editGasPriceTooLow');
|
2021-07-20 21:34:32 +02:00
|
|
|
default:
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
}
|
2021-11-18 18:54:58 +01:00
|
|
|
|
|
|
|
export const PRIORITY_LEVEL_ICON_MAP = {
|
|
|
|
low: '🐢',
|
|
|
|
medium: '🦊',
|
|
|
|
high: '🦍',
|
|
|
|
dappSuggested: '🌐',
|
2023-06-08 12:26:18 +02:00
|
|
|
dappSuggestedHigh: '🌐',
|
2021-12-12 00:26:28 +01:00
|
|
|
swapSuggested: '🔄',
|
2022-01-06 23:40:31 +01:00
|
|
|
custom: '⚙️',
|
2021-11-18 18:54:58 +01:00
|
|
|
};
|