rujira.ui 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/AssetLabel.js +4 -3
- package/lib/cjs/components/balance/OmniBalance.js +1 -1
- package/lib/cjs/components/bridges/DepositModal.js +7 -7
- package/lib/cjs/components/buttons/TxButton.js +23 -7
- package/lib/cjs/components/header/Accounts.js +4 -4
- package/lib/cjs/components/icons/NetworkIcon.js +18 -17
- package/lib/cjs/i18n/locales/de/trade.json +2 -1
- package/lib/cjs/i18n/locales/en/trade.json +2 -1
- package/lib/cjs/wallets/providers/cosmos.js +7 -3
- package/lib/cjs/wallets/providers/eip712.js +1 -1
- package/lib/cjs/wallets/providers/keplr.js +2 -1
- package/lib/cjs/wallets/providers/ledger.js +2 -1
- package/lib/cjs/wallets/providers/okx.js +2 -1
- package/lib/cjs/wallets/providers/ton.js +2 -1
- package/lib/cjs/wallets/providers/tronlink.js +3 -2
- package/lib/cjs/wallets/providers/utxo.js +6 -5
- package/lib/cjs/wallets/providers/xaman.js +3 -2
- package/lib/esm/components/AssetLabel.d.ts.map +1 -1
- package/lib/esm/components/AssetLabel.js +4 -3
- package/lib/esm/components/balance/OmniBalance.d.ts.map +1 -1
- package/lib/esm/components/balance/OmniBalance.js +2 -2
- package/lib/esm/components/bridges/DepositModal.d.ts.map +1 -1
- package/lib/esm/components/bridges/DepositModal.js +8 -8
- package/lib/esm/components/buttons/TxButton.d.ts.map +1 -1
- package/lib/esm/components/buttons/TxButton.js +24 -8
- package/lib/esm/components/header/Accounts.d.ts.map +1 -1
- package/lib/esm/components/header/Accounts.js +5 -5
- package/lib/esm/components/icons/NetworkIcon.d.ts.map +1 -1
- package/lib/esm/components/icons/NetworkIcon.js +18 -17
- package/lib/esm/i18n/locales/de/trade.json +2 -1
- package/lib/esm/i18n/locales/en/trade.json +2 -1
- package/lib/esm/wallets/providers/cosmos.d.ts +1 -1
- package/lib/esm/wallets/providers/cosmos.d.ts.map +1 -1
- package/lib/esm/wallets/providers/cosmos.js +8 -4
- package/lib/esm/wallets/providers/eip712.d.ts +1 -1
- package/lib/esm/wallets/providers/eip712.d.ts.map +1 -1
- package/lib/esm/wallets/providers/eip712.js +2 -2
- package/lib/esm/wallets/providers/keplr.d.ts.map +1 -1
- package/lib/esm/wallets/providers/keplr.js +2 -1
- package/lib/esm/wallets/providers/ledger.d.ts.map +1 -1
- package/lib/esm/wallets/providers/ledger.js +2 -1
- package/lib/esm/wallets/providers/okx.d.ts.map +1 -1
- package/lib/esm/wallets/providers/okx.js +2 -1
- package/lib/esm/wallets/providers/ton.d.ts.map +1 -1
- package/lib/esm/wallets/providers/ton.js +2 -1
- package/lib/esm/wallets/providers/tronlink.d.ts.map +1 -1
- package/lib/esm/wallets/providers/tronlink.js +3 -2
- package/lib/esm/wallets/providers/utxo.d.ts +1 -1
- package/lib/esm/wallets/providers/utxo.d.ts.map +1 -1
- package/lib/esm/wallets/providers/utxo.js +6 -5
- package/lib/esm/wallets/providers/xaman.d.ts.map +1 -1
- package/lib/esm/wallets/providers/xaman.js +3 -2
- package/package.json +1 -1
- package/src/components/AssetLabel.tsx +4 -3
- package/src/components/balance/OmniBalance.tsx +12 -3
- package/src/components/bridges/DepositModal.tsx +9 -8
- package/src/components/buttons/TxButton.tsx +32 -10
- package/src/components/header/Accounts.tsx +5 -5
- package/src/components/icons/NetworkIcon.tsx +37 -18
- package/src/i18n/locales/de/trade.json +2 -1
- package/src/i18n/locales/en/trade.json +2 -1
- package/src/scss/styledcomponents/_tabs.scss +4 -0
- package/src/wallets/providers/cosmos.ts +31 -21
- package/src/wallets/providers/eip712.ts +13 -5
- package/src/wallets/providers/keplr.ts +10 -2
- package/src/wallets/providers/ledger.ts +12 -9
- package/src/wallets/providers/okx.ts +10 -2
- package/src/wallets/providers/ton.ts +10 -2
- package/src/wallets/providers/tronlink.ts +11 -3
- package/src/wallets/providers/utxo.ts +6 -6
- package/src/wallets/providers/xaman.ts +11 -3
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AssetLabel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
(asset.metadata.symbol === "
|
|
5
|
+
const rujira_js_1 = require("rujira.js");
|
|
6
|
+
const AssetLabel = ({ asset, Container }) => asset ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [asset.metadata.symbol, ((asset.metadata.symbol === "USDT" && asset.chain !== rujira_js_1.ETH) ||
|
|
7
|
+
(asset.metadata.symbol === "ETH" && asset.chain !== rujira_js_1.ETH) ||
|
|
8
|
+
(asset.metadata.symbol === "USDC" && asset.chain !== rujira_js_1.ETH)) &&
|
|
8
9
|
asset.type === "SECURED" && (0, jsx_runtime_1.jsxs)(Container, { children: [".", asset.chain] })] })) : null;
|
|
9
10
|
exports.AssetLabel = AssetLabel;
|
|
@@ -25,7 +25,7 @@ const OmniBalance = ({ balance, onClick, className, accountProviders, }) => {
|
|
|
25
25
|
? [...balance.accounts].sort(accountSorter)
|
|
26
26
|
: [];
|
|
27
27
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "omni-balance", children: [(0, jsx_runtime_1.jsx)(Decimal_1.Decimal, { amount: balance?.balance || 0n, className: className, onClick: () => balance && onClick?.(balance) }), sortedAccounts.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "omni-balance__networks", children: sortedAccounts.map((x) => {
|
|
28
|
-
const n = x.asset.type === "SECURED" ?
|
|
28
|
+
const n = x.asset.type === "SECURED" ? rujira_js_1.THOR : x.asset.chain;
|
|
29
29
|
const provider = providerLookup.get(x.address);
|
|
30
30
|
const tipId = `${tooltipId}-${n}`;
|
|
31
31
|
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { "data-tooltip-id": tipId, className: `omni-balance__network-button omni-balance__network-button--${n.toLowerCase()}`, onClick: () => onClick?.(x), children: (0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network: n }) }), (0, jsx_runtime_1.jsx)(react_tooltip_1.Tooltip, { id: tipId, className: "tooltip", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex ai-c gap-1", children: [provider && ((0, jsx_runtime_1.jsx)(ProviderIcon_1.ProviderIcon, { provider: provider, selected: true, className: "w-3 h-3 block" })), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "condensed fs-16 fw-500", children: (0, helpers_1.nFormatter)(x.balance, 6) }), (0, jsx_runtime_1.jsxs)("div", { className: "fs-14 lh-16 color-grey", children: ["on ", (0, rujira_js_1.networkLabel)(n)] })] })] }) })] }, n));
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DepositModal = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const clsx_1 = require("clsx");
|
|
6
|
+
const date_fns_1 = require("date-fns");
|
|
5
7
|
const react_1 = require("react");
|
|
8
|
+
const react_hot_toast_1 = require("react-hot-toast");
|
|
6
9
|
const rujira_js_1 = require("rujira.js");
|
|
7
10
|
const i18n_1 = require("../../i18n");
|
|
8
|
-
const LoaderWithContent_1 = require("../loader/LoaderWithContent");
|
|
9
11
|
const IconDenom_1 = require("../icons/IconDenom");
|
|
10
12
|
const Icons_1 = require("../icons/Icons");
|
|
11
13
|
const Input_1 = require("../inputs/Input");
|
|
12
|
-
const
|
|
13
|
-
const date_fns_1 = require("date-fns");
|
|
14
|
-
const react_hot_toast_1 = require("react-hot-toast");
|
|
14
|
+
const LoaderWithContent_1 = require("../loader/LoaderWithContent");
|
|
15
15
|
const __1 = require("../..");
|
|
16
16
|
const deposited_gif_1 = require("../../assets/images/deposited.gif");
|
|
17
17
|
const filters_gif_1 = require("../../assets/images/filters.gif");
|
|
@@ -70,7 +70,7 @@ const Confirm = ({ asset, balance, targets, target: target_, Submit, onSuccess,
|
|
|
70
70
|
const shouldSwap = canSwap && !direct;
|
|
71
71
|
// Determine the actual destination address
|
|
72
72
|
const destination = target === "custom" ? custom : target;
|
|
73
|
-
const isCustomAddressInvalid = target === "custom" && custom !== "" && !(0, rujira_js_1.validateAddress)(
|
|
73
|
+
const isCustomAddressInvalid = target === "custom" && custom !== "" && !(0, rujira_js_1.validateAddress)(rujira_js_1.THOR, custom);
|
|
74
74
|
// Fetch swap quote when conditions are met
|
|
75
75
|
(0, react_1.useEffect)(() => {
|
|
76
76
|
setQuote(undefined);
|
|
@@ -130,7 +130,7 @@ const Confirm = ({ asset, balance, targets, target: target_, Submit, onSuccess,
|
|
|
130
130
|
"w-2 h-2": true,
|
|
131
131
|
"filter-grey": !hoverAd,
|
|
132
132
|
"filter-white": hoverAd,
|
|
133
|
-
}) }), advanced ? t("hideAdvancedOptions") : t("showAdvancedOptions")] })] }), advanced && ((0, jsx_runtime_1.jsxs)("div", { className: "br-1 p-2 bg-black mt-1 row wrap condensed fs-14 px-2 gap-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("destination") }), (0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: (0, jsx_runtime_1.jsxs)(Select_1.Select, { containerClassName: "fs-14", className: "select--inline text-right", value: target, onChange: (e) => setTarget(e.currentTarget.value), children: [targets.map((x) => ((0, jsx_runtime_1.jsx)("option", { value: x, className: "bg-darkGrey", children: x }, x))), (0, jsx_runtime_1.jsx)("option", { className: "bg-darkGrey", value: "custom", children: t("customAddress") })] }) }), target === "custom" && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("customDestination") }), (0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: (0, jsx_runtime_1.jsx)(Input_1.Input, { containerClassName: "fs-14", value: custom, onChange: (e) => setCustom(e.currentTarget.value), className: "input--inline text-right", innerRef: ref }) })] })), canSwap && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [asset.chain ===
|
|
133
|
+
}) }), advanced ? t("hideAdvancedOptions") : t("showAdvancedOptions")] })] }), advanced && ((0, jsx_runtime_1.jsxs)("div", { className: "br-1 p-2 bg-black mt-1 row wrap condensed fs-14 px-2 gap-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("destination") }), (0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: (0, jsx_runtime_1.jsxs)(Select_1.Select, { containerClassName: "fs-14", className: "select--inline text-right", value: target, onChange: (e) => setTarget(e.currentTarget.value), children: [targets.map((x) => ((0, jsx_runtime_1.jsx)("option", { value: x, className: "bg-darkGrey", children: x }, x))), (0, jsx_runtime_1.jsx)("option", { className: "bg-darkGrey", value: "custom", children: t("customAddress") })] }) }), target === "custom" && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("customDestination") }), (0, jsx_runtime_1.jsx)("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: (0, jsx_runtime_1.jsx)(Input_1.Input, { containerClassName: "fs-14", value: custom, onChange: (e) => setCustom(e.currentTarget.value), className: "input--inline text-right", innerRef: ref }) })] })), canSwap && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [asset.chain === rujira_js_1.THOR ? null : ((0, jsx_runtime_1.jsx)("div", { className: "col-12 text-center text-xs-right", children: (0, jsx_runtime_1.jsx)(__1.Toggle, { className: "toggle--xs", label: `Deposit ${account?.asset.chain}.${account?.asset.metadata.symbol} directly`, checked: direct, onChange: () => setDirect((prev) => !prev) }) })), direct && ((0, jsx_runtime_1.jsxs)(__1.Warning, { className: "warning--sm condensed flex ai-c mt-1", color: "orange", children: [(0, jsx_runtime_1.jsx)("img", { src: swap_gif_1.default, alt: "", className: "filter-orange block no-shrink", style: { width: "2.5rem", height: "2.5rem" } }), (0, jsx_runtime_1.jsxs)("small", { className: "text-left fs-14", children: ["You are depositing a version of", " ", (0, jsx_runtime_1.jsx)("span", { className: "color-white", children: asset.metadata.symbol }), " ", "that is not the standard on Rujira. Our products use the", " ", (0, jsx_runtime_1.jsx)("span", { className: "color-white", children: "Ethereum" }), " version of", " ", (0, jsx_runtime_1.jsx)("span", { className: "color-white", children: asset.metadata.symbol }), "."] })] }))] })), isCustomAddressInvalid && ((0, jsx_runtime_1.jsx)("div", { className: "flex dir-r jc-c grow mt-1", children: (0, jsx_runtime_1.jsxs)(__1.Warning, { color: "red", className: "condensed iflex grow", children: [(0, jsx_runtime_1.jsx)(__1.Icons.ExclamationTriangle, { className: "color-red" }), (0, jsx_runtime_1.jsx)("span", { className: "warning__msg", children: t("invalidThorAddress") })] }) }))] })), (0, jsx_runtime_1.jsx)(Submit, { selected: account, amount: amount, target: target !== "custom" ? target : custom, swapMemo: "memo", onSuccess: onSuccess, disabled: isCustomAddressInvalid, isDangerous: false, quote: quote, shouldSwap: shouldSwap })] }));
|
|
134
134
|
};
|
|
135
135
|
const Success = ({ tx, dismiss, }) => {
|
|
136
136
|
const { t } = (0, i18n_1.useTranslation)("common");
|
|
@@ -138,7 +138,7 @@ const Success = ({ tx, dismiss, }) => {
|
|
|
138
138
|
start: 0,
|
|
139
139
|
end: (0, rujira_js_1.networkConfirmationTime)(tx.network),
|
|
140
140
|
}), { format: ["hours", "minutes", "seconds"], zero: false }) })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { className: "color-grey", children: t("viewTx") }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("a", { href: (0, rujira_js_1.networkTxLink)(tx), target: "_blank", className: "color-white hover-primary1 no-underline", children: [(0, rujira_js_1.networkExplorerLabel)(tx.network), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "inline-block w-1.5 h-1.5 ml-0.5" })] }) })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { className: "color-grey", children: t("trackDeposit") }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsxs)("a", { href: (0, rujira_js_1.networkTxLink)({
|
|
141
|
-
network:
|
|
141
|
+
network: rujira_js_1.THOR,
|
|
142
142
|
txHash: tx.txHash.replace(/^0x/, "").toUpperCase(),
|
|
143
143
|
}), target: "_blank", className: "color-white hover-primary1 no-underline", children: ["THORChain.net", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "inline-block w-1.5 h-1.5 ml-0.5" })] }) })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "modal__footer p-3 text-right", children: (0, jsx_runtime_1.jsx)(__1.Button, { label: "Close", onClick: dismiss }) })] }));
|
|
144
144
|
};
|
|
@@ -8,8 +8,10 @@ const react_hot_toast_1 = require("react-hot-toast");
|
|
|
8
8
|
const react_i18next_1 = require("react-i18next");
|
|
9
9
|
const react_tooltip_1 = require("react-tooltip");
|
|
10
10
|
const rujira_js_1 = require("rujira.js");
|
|
11
|
+
const exclamation_gif_1 = require("../../assets/images/exclamation.gif");
|
|
11
12
|
const txfail_gif_1 = require("../../assets/images/txfail.gif");
|
|
12
13
|
const txsign_gif_1 = require("../../assets/images/txsign.gif");
|
|
14
|
+
const txsimulate_gif_1 = require("../../assets/images/txsimulate.gif");
|
|
13
15
|
const txsuccess_gif_1 = require("../../assets/images/txsuccess.gif");
|
|
14
16
|
const unlock_gif_1 = require("../../assets/images/unlock.gif");
|
|
15
17
|
const i18n_1 = require("../../i18n");
|
|
@@ -17,8 +19,6 @@ const Loader_1 = require("../loader/Loader");
|
|
|
17
19
|
const Warning_1 = require("../notices/Warning");
|
|
18
20
|
const Decimal_1 = require("../numbers/Decimal");
|
|
19
21
|
const Button_1 = require("./Button");
|
|
20
|
-
const txsimulate_gif_1 = require("../../assets/images/txsimulate.gif");
|
|
21
|
-
const exclamation_gif_1 = require("../../assets/images/exclamation.gif");
|
|
22
22
|
// Helper to identify spacing/layout classes
|
|
23
23
|
const SPACING_CLASS_REGEX = /^(m|p)(l|r|t|b|x|y)?-\d+$/;
|
|
24
24
|
const isSpacingClass = (className) => SPACING_CLASS_REGEX.test(className);
|
|
@@ -33,7 +33,7 @@ const separateClasses = (className) => {
|
|
|
33
33
|
// Add chains here that do not require the extra reset step, for USDT allowance approvals,
|
|
34
34
|
// when there is already a non-zero allowance approved. We default to the 3-step process
|
|
35
35
|
// to avoid failing deposits for future chain integrations.
|
|
36
|
-
const TWO_STEP_ALLOWANCE_CHAINS = new Set([
|
|
36
|
+
const TWO_STEP_ALLOWANCE_CHAINS = new Set([rujira_js_1.BSC, rujira_js_1.AVAX]);
|
|
37
37
|
const TxButton = (props) => {
|
|
38
38
|
const { t } = (0, i18n_1.useTranslation)("common");
|
|
39
39
|
const { accountProvider, msg, onSuccess, onError, SimulationComponent = DefaultSimulationComponent, children, toastOpts = {}, className, hideSimulation, onClick, ...rest } = props;
|
|
@@ -187,19 +187,35 @@ const TxButton = (props) => {
|
|
|
187
187
|
}),
|
|
188
188
|
};
|
|
189
189
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Button_1.Button, { ...modProps, onClick: handleSign, className: (0, clsx_1.default)(stylingClasses.length > 0 ? stylingClasses : "button", spacingClasses, {
|
|
190
|
-
"button--grey": disabled &&
|
|
190
|
+
"button--grey": disabled &&
|
|
191
|
+
!isSimulating &&
|
|
192
|
+
!stylingClasses.includes("transparent"),
|
|
191
193
|
"button--waiting": (isSigning || isRejected || isSuccess || isSimulating) &&
|
|
192
194
|
!className?.includes("transparent"),
|
|
193
195
|
"button--success": isSuccess,
|
|
194
196
|
"button--rejected": isRejected,
|
|
195
197
|
"button--simulating": isSimulating,
|
|
196
198
|
}), style: {
|
|
197
|
-
cursor: isSigning || isSuccess || isRejected || isSimulating
|
|
199
|
+
cursor: isSigning || isSuccess || isRejected || isSimulating
|
|
200
|
+
? "default"
|
|
201
|
+
: undefined,
|
|
198
202
|
...rest.style,
|
|
199
203
|
}, disabled: disabled, "data-tooltip-id": "tx-button-tip", "data-tooltip-html": showTooltip
|
|
200
204
|
? `<p class="fs-12 lh-16 fw-400 w-36 mb-0.5">${(0, rujira_js_1.translateError)(simulationError.message)}</p>`
|
|
201
|
-
: undefined, children: [(isSuccess ||
|
|
202
|
-
|
|
205
|
+
: undefined, children: [(isSuccess ||
|
|
206
|
+
isRejected ||
|
|
207
|
+
isSigning ||
|
|
208
|
+
isSimulating ||
|
|
209
|
+
!!simulationError) &&
|
|
210
|
+
!className?.includes("transparent") && ((0, jsx_runtime_1.jsx)("img", { className: "w-4 h-4 filter-white big", src: isSimulating
|
|
211
|
+
? txsimulate_gif_1.default
|
|
212
|
+
: !!simulationError
|
|
213
|
+
? exclamation_gif_1.default
|
|
214
|
+
: isSigning
|
|
215
|
+
? txsign_gif_1.default
|
|
216
|
+
: isSuccess
|
|
217
|
+
? txsuccess_gif_1.default
|
|
218
|
+
: txfail_gif_1.default, alt: "lock" })), (isSigning || isRejected || isSuccess) &&
|
|
203
219
|
className?.includes("transparent") ? ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { className: "w-full h-full" })) : (((!isSigning && !isRejected && !isSuccess) ||
|
|
204
220
|
className?.includes("transparent")) &&
|
|
205
221
|
children)] }), hideSimulation ? null : msg ? ((0, jsx_runtime_1.jsx)(SimulationComponent, { simulation: simulation, error: simulationError })) : null] }));
|
|
@@ -40,11 +40,11 @@ const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, c
|
|
|
40
40
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !accounts || accounts.length === 0 ? ((0, jsx_runtime_1.jsx)(ConnectAnimation, { children: (0, jsx_runtime_1.jsx)(exports.Wallets, { provider: provider, wallets: wallets }) })) : ((0, jsx_runtime_1.jsxs)(MyAccount, { routingElement: routingElement, provider: provider, value: selected
|
|
41
41
|
? getValue({
|
|
42
42
|
address: selected.address,
|
|
43
|
-
network:
|
|
43
|
+
network: rujira_js_1.THOR,
|
|
44
44
|
})
|
|
45
45
|
: false, onHide: () => setShowBlur(false), children: [selected ? ((0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, to: "portfolio", className: "balance", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex ai-b", children: showBalance === "true" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: getValue({
|
|
46
46
|
address: selected.address,
|
|
47
|
-
network:
|
|
47
|
+
network: rujira_js_1.THOR,
|
|
48
48
|
}), decimals: 12, symbol: "~$", padSymbol: false, className: "color-white fs-26 condensed" }), (0, jsx_runtime_1.jsx)("button", { className: "transparent ml-1 color-grey hover-white", onClick: (e) => {
|
|
49
49
|
e.stopPropagation();
|
|
50
50
|
e.preventDefault();
|
|
@@ -108,7 +108,7 @@ const MyAccount = ({ provider, children, onHide, routingElement, value, }) => {
|
|
|
108
108
|
(0, react_2.useEffect)(() => {
|
|
109
109
|
onHide();
|
|
110
110
|
}, [show]);
|
|
111
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1", onMouseEnter: () => setShow(true), onMouseLeave: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, to: "portfolio", className: "rujira-header__pfp", children: [value !== false && showBalance === "true" && ((0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: value, symbol: "~$", decimals: 12, padSymbol: false })), selected && (0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network:
|
|
111
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1", onMouseEnter: () => setShow(true), onMouseLeave: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, to: "portfolio", className: "rujira-header__pfp", children: [value !== false && showBalance === "true" && ((0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: value, symbol: "~$", decimals: 12, padSymbol: false })), selected && (0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network: rujira_js_1.THOR }), accounts?.length && !selected && (0, jsx_runtime_1.jsx)("img", { src: combined_png_1.default, alt: "combined" }), provider.isLoading && (0, jsx_runtime_1.jsx)(__1.Spinner, {})] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "rujira-header__popup right condensed p-1.5 br-2", initial: { opacity: 0, marginTop: -4, right: -8 }, animate: { opacity: 1, marginTop: 4, right: -8 }, exit: { opacity: 0, marginTop: -4, right: -8 }, children: children })) })] }));
|
|
112
112
|
};
|
|
113
113
|
const AddressC = ({ account, selected, provider, ProviderIcon, }) => {
|
|
114
114
|
const { t } = (0, i18n_1.useTranslation)("header");
|
|
@@ -117,7 +117,7 @@ const AddressC = ({ account, selected, provider, ProviderIcon, }) => {
|
|
|
117
117
|
return ((0, jsx_runtime_1.jsxs)("div", { onMouseOver: () => setHover(true), onMouseOut: () => setHover(false), className: (0, clsx_1.default)({
|
|
118
118
|
"flex ai-c px-1 address": true,
|
|
119
119
|
"address--selected": selected,
|
|
120
|
-
}), children: [(0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network:
|
|
120
|
+
}), children: [(0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network: rujira_js_1.THOR, className: "address__wallet", selected: selected || hover }), (0, jsx_runtime_1.jsx)("p", { className: "address__address pointer", onClick: () => {
|
|
121
121
|
if (selected) {
|
|
122
122
|
react_hot_toast_1.default.success(t("addressCopied"));
|
|
123
123
|
navigator.clipboard.writeText(account.address);
|
|
@@ -2,42 +2,43 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NetworkIcon = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const rujira_js_1 = require("rujira.js");
|
|
5
6
|
const __1 = require("../..");
|
|
6
7
|
const NetworkIcon = ({ network, className, selected = true }) => {
|
|
7
8
|
switch (network) {
|
|
8
|
-
case
|
|
9
|
+
case rujira_js_1.AVAX:
|
|
9
10
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Avalanche, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.AvalancheSimple, { className: className }));
|
|
10
|
-
case
|
|
11
|
+
case rujira_js_1.BASE:
|
|
11
12
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Base, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.BaseSimple, { className: className }));
|
|
12
|
-
case
|
|
13
|
+
case rujira_js_1.BTC:
|
|
13
14
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Bitcoin, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.BitcoinSimple, { className: className }));
|
|
14
|
-
case
|
|
15
|
+
case rujira_js_1.BCH:
|
|
15
16
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.BitcoinCash, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.BitcoinCashSimple, { className: className }));
|
|
16
|
-
case
|
|
17
|
+
case rujira_js_1.BSC:
|
|
17
18
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.BinanceSmartChain, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.BinanceSmartChainSimple, { className: className }));
|
|
18
|
-
case
|
|
19
|
+
case rujira_js_1.DOGE:
|
|
19
20
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Doge, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.DogeSimple, { className: className }));
|
|
20
|
-
case
|
|
21
|
+
case rujira_js_1.ETH:
|
|
21
22
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Ethereum, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.EthereumSimple, { className: className }));
|
|
22
|
-
case
|
|
23
|
+
case rujira_js_1.GAIA:
|
|
23
24
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Cosmos, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.CosmosSimple, { className: className }));
|
|
24
|
-
case
|
|
25
|
+
case rujira_js_1.KUJI:
|
|
25
26
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Kujira, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.KujiraSimple, { className: className }));
|
|
26
|
-
case
|
|
27
|
+
case rujira_js_1.LTC:
|
|
27
28
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Litecoin, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.LitecoinSimple, { className: className }));
|
|
28
|
-
case
|
|
29
|
+
case rujira_js_1.NOBLE:
|
|
29
30
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Noble, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.NobleSimple, { className: className }));
|
|
30
|
-
case
|
|
31
|
+
case rujira_js_1.OSMO:
|
|
31
32
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Osmosis, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.OsmosisSimple, { className: className }));
|
|
32
|
-
case
|
|
33
|
+
case rujira_js_1.THOR:
|
|
33
34
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Thorchain, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.ThorchainSimple, { className: className }));
|
|
34
|
-
case
|
|
35
|
+
case rujira_js_1.TON:
|
|
35
36
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Ton, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.TonSimple, { className: className }));
|
|
36
|
-
case
|
|
37
|
+
case rujira_js_1.TRON:
|
|
37
38
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Tron, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.TronSimple, { className: className }));
|
|
38
|
-
case
|
|
39
|
+
case rujira_js_1.SOL:
|
|
39
40
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.Solana, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.SolanaSimple, { className: className }));
|
|
40
|
-
case
|
|
41
|
+
case rujira_js_1.XRP:
|
|
41
42
|
return selected ? ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.XRP, { className: className })) : ((0, jsx_runtime_1.jsx)(__1.NetworkIcons.XRPSimple, { className: className }));
|
|
42
43
|
}
|
|
43
44
|
};
|
|
@@ -218,5 +218,6 @@
|
|
|
218
218
|
"depositRange": "Einzahlen",
|
|
219
219
|
"withdrawRange": "Abheben",
|
|
220
220
|
"closeRange": "Schließen",
|
|
221
|
-
"createPosition": "Position Erstellen"
|
|
221
|
+
"createPosition": "Position Erstellen",
|
|
222
|
+
"marketOrderWarning": "Market-Order kann nicht platziert werden. Bitte verwende stattdessen eine optimierte Order."
|
|
222
223
|
}
|
|
@@ -216,5 +216,6 @@
|
|
|
216
216
|
"depositRange": "Deposit",
|
|
217
217
|
"withdrawRange": "Withdraw",
|
|
218
218
|
"closeRange": "Close",
|
|
219
|
-
"createPosition": "Create Position"
|
|
219
|
+
"createPosition": "Create Position",
|
|
220
|
+
"marketOrderWarning": "Cannot place a Market order. Please use an Optimized order instead."
|
|
220
221
|
}
|
|
@@ -108,7 +108,8 @@ const getConfig = (prefix) => {
|
|
|
108
108
|
};
|
|
109
109
|
exports.getConfig = getConfig;
|
|
110
110
|
const buildClient = (config, signer, options) => {
|
|
111
|
-
const client = clientCache.get(config.chainId) ||
|
|
111
|
+
const client = clientCache.get(config.chainId) ||
|
|
112
|
+
new rujira_js_1.signers.cosmos.HttpBatchClient(config.rpc);
|
|
112
113
|
clientCache.set(config.chainId, client);
|
|
113
114
|
const gasPrice = (0, exports.getGasPrice)(config);
|
|
114
115
|
return rujira_js_1.signers.cosmos.CosmosClient.createWithSigner(rujira_js_1.signers.cosmos.Comet38Client.create(client), signer, {
|
|
@@ -127,13 +128,16 @@ const simulate = async (client, msg) => {
|
|
|
127
128
|
const sim = Math.ceil(simRaw * 1.5);
|
|
128
129
|
const fee = client.calculateFee(sim).amount[0];
|
|
129
130
|
const feeAmount = BigInt(fee.amount);
|
|
130
|
-
if (msg.account.network ===
|
|
131
|
+
if (msg.account.network === rujira_js_1.THOR) {
|
|
131
132
|
// Gas is only charged on thorchain if a signers.cosmos.MsgExecuteContract is in the tx
|
|
132
133
|
const gasCost = encoded.msgs.find((a) => a.typeUrl === rujira_js_1.signers.cosmos.MsgExecuteContract.typeUrl)
|
|
133
134
|
? feeAmount
|
|
134
135
|
: 0n;
|
|
135
136
|
// And all 0.02 RUNE fees still apply
|
|
136
|
-
const feeCost = BigInt(encoded.msgs.filter((a) => [
|
|
137
|
+
const feeCost = BigInt(encoded.msgs.filter((a) => [
|
|
138
|
+
rujira_js_1.signers.cosmos.MsgSend.typeUrl,
|
|
139
|
+
rujira_js_1.signers.cosmos.MsgDeposit.typeUrl,
|
|
140
|
+
].includes(a.typeUrl)).length) * 2000000n;
|
|
137
141
|
return {
|
|
138
142
|
symbol: "RUNE",
|
|
139
143
|
decimals: 8,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KeplrAdapter = void 0;
|
|
4
4
|
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
|
5
|
+
const rujira_js_1 = require("rujira.js");
|
|
5
6
|
const cosmos_1 = require("./cosmos");
|
|
6
7
|
const eip6963_1 = require("./eip6963");
|
|
7
8
|
const utils_1 = require("./utils");
|
|
@@ -74,7 +75,7 @@ class KeplrAdapter {
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
networks() {
|
|
77
|
-
return [
|
|
78
|
+
return [rujira_js_1.BTC, ...this.c.networks(), ...this.e.networks()];
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
exports.KeplrAdapter = KeplrAdapter;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const device_management_kit_1 = require("@ledgerhq/device-management-kit");
|
|
4
4
|
const device_signer_kit_bitcoin_1 = require("@ledgerhq/device-signer-kit-bitcoin");
|
|
5
5
|
const device_transport_kit_web_hid_1 = require("@ledgerhq/device-transport-kit-web-hid");
|
|
6
|
+
const rujira_js_1 = require("rujira.js");
|
|
6
7
|
const rxjs_1 = require("rxjs");
|
|
7
8
|
const Modal_1 = require("./ledger/Modal");
|
|
8
9
|
const PATH = "84'/0'/0'";
|
|
@@ -47,7 +48,7 @@ class LedgerAdapter {
|
|
|
47
48
|
return true;
|
|
48
49
|
}
|
|
49
50
|
networks() {
|
|
50
|
-
return [
|
|
51
|
+
return [rujira_js_1.BTC];
|
|
51
52
|
}
|
|
52
53
|
disconnect() {
|
|
53
54
|
this.sessionId && this.dmk.disconnect({ sessionId: this.sessionId });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OkxAdapter = void 0;
|
|
4
4
|
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
|
5
|
+
const rujira_js_1 = require("rujira.js");
|
|
5
6
|
const cosmos_1 = require("./cosmos");
|
|
6
7
|
const eip6963_1 = require("./eip6963");
|
|
7
8
|
const utils_1 = require("./utils");
|
|
@@ -71,7 +72,7 @@ class OkxAdapter {
|
|
|
71
72
|
return this.e.isAvailable();
|
|
72
73
|
}
|
|
73
74
|
networks() {
|
|
74
|
-
return [
|
|
75
|
+
return [rujira_js_1.BTC, ...this.c.networks(), ...this.e.networks()];
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
exports.OkxAdapter = OkxAdapter;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const sdk_1 = require("@tonconnect/sdk");
|
|
4
|
+
const rujira_js_1 = require("rujira.js");
|
|
4
5
|
const ton_core_1 = require("ton-core");
|
|
5
6
|
class TonKeeper {
|
|
6
7
|
connector = new sdk_1.default({
|
|
@@ -51,7 +52,7 @@ class TonKeeper {
|
|
|
51
52
|
this.connector.disconnect();
|
|
52
53
|
}
|
|
53
54
|
networks() {
|
|
54
|
-
return [
|
|
55
|
+
return [rujira_js_1.TON];
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
exports.default = new TonKeeper();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Tronlink = void 0;
|
|
4
|
+
const rujira_js_1 = require("rujira.js");
|
|
4
5
|
const BANDWIDTH_PRICE_SUN_PER_BYTE = 1;
|
|
5
6
|
class Tronlink {
|
|
6
7
|
tron;
|
|
@@ -40,7 +41,7 @@ class Tronlink {
|
|
|
40
41
|
const signed = await t.tronWeb.trx.sign(tx);
|
|
41
42
|
const res = await t.tronWeb.trx.sendRawTransaction(signed);
|
|
42
43
|
return {
|
|
43
|
-
network:
|
|
44
|
+
network: rujira_js_1.TRON,
|
|
44
45
|
address: msg.account.address,
|
|
45
46
|
txHash: res.txid,
|
|
46
47
|
deposited: msg.toDeposit?.(),
|
|
@@ -52,7 +53,7 @@ class Tronlink {
|
|
|
52
53
|
return !!tron?.isTronLink;
|
|
53
54
|
}
|
|
54
55
|
networks() {
|
|
55
|
-
return [
|
|
56
|
+
return [rujira_js_1.TRON];
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
exports.Tronlink = Tronlink;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.utxoNetworkTochain = exports.UtxoQueryClient = exports.UtxoContext = void 0;
|
|
4
|
+
const rujira_js_1 = require("rujira.js");
|
|
4
5
|
class UtxoContext {
|
|
5
6
|
address;
|
|
6
7
|
endpoints = [
|
|
@@ -32,7 +33,7 @@ class UtxoContext {
|
|
|
32
33
|
case 200:
|
|
33
34
|
const txHash = await res.text();
|
|
34
35
|
return {
|
|
35
|
-
network:
|
|
36
|
+
network: rujira_js_1.BTC,
|
|
36
37
|
address,
|
|
37
38
|
txHash,
|
|
38
39
|
deposited: deposit,
|
|
@@ -92,13 +93,13 @@ class UtxoQueryClient {
|
|
|
92
93
|
exports.UtxoQueryClient = UtxoQueryClient;
|
|
93
94
|
const utxoNetworkTochain = (network) => {
|
|
94
95
|
switch (network) {
|
|
95
|
-
case
|
|
96
|
+
case rujira_js_1.BTC:
|
|
96
97
|
return "bitcoin";
|
|
97
|
-
case
|
|
98
|
+
case rujira_js_1.BCH:
|
|
98
99
|
return "bitcoincash";
|
|
99
|
-
case
|
|
100
|
+
case rujira_js_1.DOGE:
|
|
100
101
|
return "dogecoin";
|
|
101
|
-
case
|
|
102
|
+
case rujira_js_1.LTC:
|
|
102
103
|
return "litecoin";
|
|
103
104
|
default:
|
|
104
105
|
throw new Error(`Unsupported UTXO network: ${network}`);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.XamanAdapter = void 0;
|
|
4
|
+
const rujira_js_1 = require("rujira.js");
|
|
4
5
|
const xumm_1 = require("xumm");
|
|
5
6
|
class XamanAdapter {
|
|
6
7
|
xumm;
|
|
@@ -41,7 +42,7 @@ class XamanAdapter {
|
|
|
41
42
|
if (!payload.response.txid)
|
|
42
43
|
throw new Error("No txid returned");
|
|
43
44
|
return {
|
|
44
|
-
network:
|
|
45
|
+
network: rujira_js_1.XRP,
|
|
45
46
|
address: msg.account.address,
|
|
46
47
|
txHash: payload.response.txid,
|
|
47
48
|
deposited: msg.toDeposit?.(),
|
|
@@ -60,7 +61,7 @@ class XamanAdapter {
|
|
|
60
61
|
this.xumm.on("success", cb);
|
|
61
62
|
}
|
|
62
63
|
networks() {
|
|
63
|
-
return [
|
|
64
|
+
return [rujira_js_1.XRP];
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
exports.XamanAdapter = XamanAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetLabel.d.ts","sourceRoot":"","sources":["../../../src/components/AssetLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssetLabel.d.ts","sourceRoot":"","sources":["../../../src/components/AssetLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG9C,eAAO,MAAM,UAAU,EAAE,EAAE,CACzB,iBAAiB,CAAC;IAChB,KAAK,CAAC,EACF;QAAE,QAAQ,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAC7D,IAAI,GACJ,SAAS,CAAC;IACd,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC;CAClC,CAAC,CAUM,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
(asset.metadata.symbol === "
|
|
2
|
+
import { ETH } from "rujira.js";
|
|
3
|
+
export const AssetLabel = ({ asset, Container }) => asset ? (_jsxs(_Fragment, { children: [asset.metadata.symbol, ((asset.metadata.symbol === "USDT" && asset.chain !== ETH) ||
|
|
4
|
+
(asset.metadata.symbol === "ETH" && asset.chain !== ETH) ||
|
|
5
|
+
(asset.metadata.symbol === "USDC" && asset.chain !== ETH)) &&
|
|
5
6
|
asset.type === "SECURED" && _jsxs(Container, { children: [".", asset.chain] })] })) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmniBalance.d.ts","sourceRoot":"","sources":["../../../../src/components/balance/OmniBalance.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"OmniBalance.d.ts","sourceRoot":"","sources":["../../../../src/components/balance/OmniBalance.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,OAAO,EACP,cAAc,EAGf,MAAM,WAAW,CAAC;AAKnB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,KAAK,gBAAgB,GAAG;IACtB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,GAAG,cAAc,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;CAC1E,CAAC;AAUF,eAAO,MAAM,WAAW,uDAKrB,gBAAgB,4CA8DlB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useId, useMemo } from "react";
|
|
3
3
|
import { Tooltip } from "react-tooltip";
|
|
4
|
-
import { networkLabel } from "rujira.js";
|
|
4
|
+
import { THOR, networkLabel, } from "rujira.js";
|
|
5
5
|
import { nFormatter } from "../../helpers";
|
|
6
6
|
import { ProviderIcon } from "../icons/ProviderIcon";
|
|
7
7
|
import { NetworkIcon } from "../icons/NetworkIcon";
|
|
@@ -22,7 +22,7 @@ export const OmniBalance = ({ balance, onClick, className, accountProviders, })
|
|
|
22
22
|
? [...balance.accounts].sort(accountSorter)
|
|
23
23
|
: [];
|
|
24
24
|
return (_jsxs("div", { className: "omni-balance", children: [_jsx(Decimal, { amount: balance?.balance || 0n, className: className, onClick: () => balance && onClick?.(balance) }), sortedAccounts.length > 1 && (_jsx("div", { className: "omni-balance__networks", children: sortedAccounts.map((x) => {
|
|
25
|
-
const n = x.asset.type === "SECURED" ?
|
|
25
|
+
const n = x.asset.type === "SECURED" ? THOR : x.asset.chain;
|
|
26
26
|
const provider = providerLookup.get(x.address);
|
|
27
27
|
const tipId = `${tooltipId}-${n}`;
|
|
28
28
|
return (_jsxs(Fragment, { children: [_jsx("button", { "data-tooltip-id": tipId, className: `omni-balance__network-button omni-balance__network-button--${n.toLowerCase()}`, onClick: () => onClick?.(x), children: _jsx(NetworkIcon, { network: n }) }), _jsx(Tooltip, { id: tipId, className: "tooltip", children: _jsxs("div", { className: "flex ai-c gap-1", children: [provider && (_jsx(ProviderIcon, { provider: provider, selected: true, className: "w-3 h-3 block" })), _jsxs("div", { children: [_jsx("div", { className: "condensed fs-16 fw-500", children: nFormatter(x.balance, 6) }), _jsxs("div", { className: "fs-14 lh-16 color-grey", children: ["on ", networkLabel(n)] })] })] }) })] }, n));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepositModal.d.ts","sourceRoot":"","sources":["../../../../src/components/bridges/DepositModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DepositModal.d.ts","sourceRoot":"","sources":["../../../../src/components/bridges/DepositModal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAEnE,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,cAAc,EAEd,QAAQ,EAKR,OAAO,EAER,MAAM,WAAW,CAAC;AAwBnB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC;IAChE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClE,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+E9C,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { formatDuration, intervalToDuration } from "date-fns";
|
|
2
4
|
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import
|
|
5
|
+
import toast from "react-hot-toast";
|
|
6
|
+
import { THOR, networkConfirmationTime, networkExplorerLabel, networkLabel, networkTxLink, validateAddress, } from "rujira.js";
|
|
4
7
|
import { useTranslation } from "../../i18n";
|
|
5
|
-
import { LoaderWithContent } from "../loader/LoaderWithContent";
|
|
6
8
|
import { IconDenom } from "../icons/IconDenom";
|
|
7
9
|
import { AngleLeft, External, MinusCircle } from "../icons/Icons";
|
|
8
10
|
import { Input } from "../inputs/Input";
|
|
9
|
-
import
|
|
10
|
-
import { formatDuration, intervalToDuration } from "date-fns";
|
|
11
|
-
import toast from "react-hot-toast";
|
|
11
|
+
import { LoaderWithContent } from "../loader/LoaderWithContent";
|
|
12
12
|
import { Button, Decimal, DenomInput, Fiat, Icons, NetworkIcon, Radio, Toggle, Warning, } from "../..";
|
|
13
13
|
import deposited from "../../assets/images/deposited.gif";
|
|
14
14
|
import filters from "../../assets/images/filters.gif";
|
|
@@ -66,7 +66,7 @@ const Confirm = ({ asset, balance, targets, target: target_, Submit, onSuccess,
|
|
|
66
66
|
const shouldSwap = canSwap && !direct;
|
|
67
67
|
// Determine the actual destination address
|
|
68
68
|
const destination = target === "custom" ? custom : target;
|
|
69
|
-
const isCustomAddressInvalid = target === "custom" && custom !== "" && !validateAddress(
|
|
69
|
+
const isCustomAddressInvalid = target === "custom" && custom !== "" && !validateAddress(THOR, custom);
|
|
70
70
|
// Fetch swap quote when conditions are met
|
|
71
71
|
useEffect(() => {
|
|
72
72
|
setQuote(undefined);
|
|
@@ -126,7 +126,7 @@ const Confirm = ({ asset, balance, targets, target: target_, Submit, onSuccess,
|
|
|
126
126
|
"w-2 h-2": true,
|
|
127
127
|
"filter-grey": !hoverAd,
|
|
128
128
|
"filter-white": hoverAd,
|
|
129
|
-
}) }), advanced ? t("hideAdvancedOptions") : t("showAdvancedOptions")] })] }), advanced && (_jsxs("div", { className: "br-1 p-2 bg-black mt-1 row wrap condensed fs-14 px-2 gap-y-1", children: [_jsx("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("destination") }), _jsx("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: _jsxs(Select, { containerClassName: "fs-14", className: "select--inline text-right", value: target, onChange: (e) => setTarget(e.currentTarget.value), children: [targets.map((x) => (_jsx("option", { value: x, className: "bg-darkGrey", children: x }, x))), _jsx("option", { className: "bg-darkGrey", value: "custom", children: t("customAddress") })] }) }), target === "custom" && (_jsxs(_Fragment, { children: [_jsx("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("customDestination") }), _jsx("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: _jsx(Input, { containerClassName: "fs-14", value: custom, onChange: (e) => setCustom(e.currentTarget.value), className: "input--inline text-right", innerRef: ref }) })] })), canSwap && (_jsxs(_Fragment, { children: [asset.chain ===
|
|
129
|
+
}) }), advanced ? t("hideAdvancedOptions") : t("showAdvancedOptions")] })] }), advanced && (_jsxs("div", { className: "br-1 p-2 bg-black mt-1 row wrap condensed fs-14 px-2 gap-y-1", children: [_jsx("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("destination") }), _jsx("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: _jsxs(Select, { containerClassName: "fs-14", className: "select--inline text-right", value: target, onChange: (e) => setTarget(e.currentTarget.value), children: [targets.map((x) => (_jsx("option", { value: x, className: "bg-darkGrey", children: x }, x))), _jsx("option", { className: "bg-darkGrey", value: "custom", children: t("customAddress") })] }) }), target === "custom" && (_jsxs(_Fragment, { children: [_jsx("div", { className: "col-12 col-xs-4 text-center text-xs-left color-grey fw-500", children: t("customDestination") }), _jsx("div", { className: "col-12 col-xs-8 text-center text-xs-right", children: _jsx(Input, { containerClassName: "fs-14", value: custom, onChange: (e) => setCustom(e.currentTarget.value), className: "input--inline text-right", innerRef: ref }) })] })), canSwap && (_jsxs(_Fragment, { children: [asset.chain === THOR ? null : (_jsx("div", { className: "col-12 text-center text-xs-right", children: _jsx(Toggle, { className: "toggle--xs", label: `Deposit ${account?.asset.chain}.${account?.asset.metadata.symbol} directly`, checked: direct, onChange: () => setDirect((prev) => !prev) }) })), direct && (_jsxs(Warning, { className: "warning--sm condensed flex ai-c mt-1", color: "orange", children: [_jsx("img", { src: swapImg, alt: "", className: "filter-orange block no-shrink", style: { width: "2.5rem", height: "2.5rem" } }), _jsxs("small", { className: "text-left fs-14", children: ["You are depositing a version of", " ", _jsx("span", { className: "color-white", children: asset.metadata.symbol }), " ", "that is not the standard on Rujira. Our products use the", " ", _jsx("span", { className: "color-white", children: "Ethereum" }), " version of", " ", _jsx("span", { className: "color-white", children: asset.metadata.symbol }), "."] })] }))] })), isCustomAddressInvalid && (_jsx("div", { className: "flex dir-r jc-c grow mt-1", children: _jsxs(Warning, { color: "red", className: "condensed iflex grow", children: [_jsx(Icons.ExclamationTriangle, { className: "color-red" }), _jsx("span", { className: "warning__msg", children: t("invalidThorAddress") })] }) }))] })), _jsx(Submit, { selected: account, amount: amount, target: target !== "custom" ? target : custom, swapMemo: "memo", onSuccess: onSuccess, disabled: isCustomAddressInvalid, isDangerous: false, quote: quote, shouldSwap: shouldSwap })] }));
|
|
130
130
|
};
|
|
131
131
|
const Success = ({ tx, dismiss, }) => {
|
|
132
132
|
const { t } = useTranslation("common");
|
|
@@ -134,7 +134,7 @@ const Success = ({ tx, dismiss, }) => {
|
|
|
134
134
|
start: 0,
|
|
135
135
|
end: networkConfirmationTime(tx.network),
|
|
136
136
|
}), { format: ["hours", "minutes", "seconds"], zero: false }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "color-grey", children: t("viewTx") }), _jsx("td", { children: _jsxs("a", { href: networkTxLink(tx), target: "_blank", className: "color-white hover-primary1 no-underline", children: [networkExplorerLabel(tx.network), _jsx(External, { className: "inline-block w-1.5 h-1.5 ml-0.5" })] }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "color-grey", children: t("trackDeposit") }), _jsx("td", { children: _jsxs("a", { href: networkTxLink({
|
|
137
|
-
network:
|
|
137
|
+
network: THOR,
|
|
138
138
|
txHash: tx.txHash.replace(/^0x/, "").toUpperCase(),
|
|
139
139
|
}), target: "_blank", className: "color-white hover-primary1 no-underline", children: ["THORChain.net", _jsx(External, { className: "inline-block w-1.5 h-1.5 ml-0.5" })] }) })] })] }) }), _jsx("div", { className: "modal__footer p-3 text-right", children: _jsx(Button, { label: "Close", onClick: dismiss }) })] }));
|
|
140
140
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxButton.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/TxButton.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,EAAE,EAMH,MAAM,OAAO,CAAC;AACf,OAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,
|
|
1
|
+
{"version":3,"file":"TxButton.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/TxButton.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,EAAE,EAMH,MAAM,OAAO,CAAC;AACf,OAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EAIL,GAAG,EAIH,UAAU,EAEV,QAAQ,EAGT,MAAM,WAAW,CAAC;AAQnB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,EAAU,WAAW,EAAE,MAAM,UAAU,CAAC;AAgB/C,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,GAAG,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG;IAC7E,eAAe,EAAE,eAAe,CAAC;IACjC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IAChB,mBAAmB,CAAC,EAAE,WAAW,CAAC;QAChC,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,UAAU,CAAC;QACrB,OAAO,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,UAAU,CAAC,CAAC;QACvD,KAAK,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,UAAU,CAAC,CAAC;KACjD,CAAC;CACH,CAAC;AAOF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA6QtC,CAAC;AAEF,eAAO,MAAM,WAAW,+CAOvB,CAAC;AACF,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
|