@reservoir0x/relay-kit-ui
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
49 lines • 3.66 kB
JavaScript
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import Anchor from '../primitives/Anchor.js';
const RefundReason = ({ reasonCode }) => {
if (reasonCode && reasonCode != 'N/A') {
switch (reasonCode) {
case 'TOO_LITTLE_RECEIVED': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because the received amount was too low. Try adjusting the slippage or amount." }));
}
case 'NEW_CALLDATA_INCLUDES_HIGHER_RENT_FEE': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because network fees increased. Try adjusting the slippage or amount." }));
}
case 'NEGATIVE_NEW_AMOUNT_AFTER_FEES': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because the fees exceeded the expected amount. Try adjusting the slippage or amount." }));
}
case 'NO_QUOTES': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because no swap routes were found for your request. Try a different token or amount." }));
}
case 'REVERSE_SWAP_FAILED': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because the reverse swap couldn\u2019t be completed. Try adjusting the slippage or amount." }));
}
case 'GENERATE_SWAP_FAILED': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because something went wrong while setting up your swap. Please try again." }));
}
case 'SLIPPAGE': {
return (_jsxs(_Fragment, { children: ["Your transaction has been refunded because the market price shifted more than the allowed slippage. Try adjusting your slippage settings or", ' ', _jsx(Anchor, { href: "https://docs.relay.link/what-is-relay#intercom", target: "_blank", children: "contact support" }), ' ', "if the issue persists.", ' '] }));
}
case 'DEPOSITED_AMOUNT_TOO_LOW_TO_FILL': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because the deposited amount was too low. Try adjusting the slippage or amount." }));
}
case 'AMOUNT_TOO_LOW_TO_REFUND': {
return (_jsxs(_Fragment, { children: ["Your transaction amount is insufficient to cover the gas cost for an automatic refund. Please", ' ', _jsx(Anchor, { href: "https://docs.relay.link/what-is-relay#intercom", target: "_blank", children: "contact support" }), ' ', "if you need assistance.", ' '] }));
}
case 'EXECUTION_REVERTED':
case 'MISSING_REVERT_DATA': {
return (_jsx(_Fragment, { children: "Your transaction has been refunded because there was an issue during execution. Try adjusting the slippage or amount." }));
}
case 'DEPOSIT_ADDRESS_MISMATCH':
case 'DEPOSIT_CHAIN_MISMATCH': //@ts-ignore: legacy reason code (insufficient balance)
case 'INSUFFICIENT_BALANCE_FOR_REFUND':
case 'SOLVER_CAPACITY_EXCEEDED':
case 'UNKNOWN':
default: {
return (_jsxs(_Fragment, { children: ["It looks like an unknown issue occurred during the transaction. Please", ' ', _jsx(Anchor, { href: "https://docs.relay.link/what-is-relay#intercom", target: "_blank", children: "contact support" }), ' ', "if you have any further questions.", ' '] }));
}
}
}
};
export default RefundReason;
//# sourceMappingURL=RefundReason.js.map