UNPKG

@reservoir0x/relay-kit-ui

Version:

Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.

52 lines 4.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const Anchor_js_1 = tslib_1.__importDefault(require("../primitives/Anchor.js")); const RefundReason = ({ reasonCode }) => { if (reasonCode && reasonCode != 'N/A') { switch (reasonCode) { case 'TOO_LITTLE_RECEIVED': { return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.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 ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Your transaction has been refunded because network fees increased. Try adjusting the slippage or amount." })); } case 'NEGATIVE_NEW_AMOUNT_AFTER_FEES': { return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Your transaction has been refunded because the fees exceeded the expected amount. Try adjusting the slippage or amount." })); } case 'NO_QUOTES': { return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.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 ((0, jsx_runtime_1.jsx)(jsx_runtime_1.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 ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Your transaction has been refunded because something went wrong while setting up your swap. Please try again." })); } case 'SLIPPAGE': { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Your transaction has been refunded because the market price shifted more than the allowed slippage. Try adjusting your slippage settings or", ' ', (0, jsx_runtime_1.jsx)(Anchor_js_1.default, { 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 ((0, jsx_runtime_1.jsx)(jsx_runtime_1.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 ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Your transaction amount is insufficient to cover the gas cost for an automatic refund. Please", ' ', (0, jsx_runtime_1.jsx)(Anchor_js_1.default, { 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 ((0, jsx_runtime_1.jsx)(jsx_runtime_1.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': case 'INSUFFICIENT_BALANCE_FOR_REFUND': case 'SOLVER_CAPACITY_EXCEEDED': case 'UNKNOWN': default: { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["It looks like an unknown issue occurred during the transaction. Please", ' ', (0, jsx_runtime_1.jsx)(Anchor_js_1.default, { href: "https://docs.relay.link/what-is-relay#intercom", target: "_blank", children: "contact support" }), ' ', "if you have any further questions.", ' '] })); } } } }; exports.default = RefundReason; //# sourceMappingURL=RefundReason.js.map