rujira.ui 1.0.15 → 1.0.17
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/balance/OmniBalance.js +5 -2
- package/lib/cjs/components/bridges/DepositModal.js +2 -2
- package/lib/cjs/components/buttons/TxButton.js +8 -2
- package/lib/cjs/components/footer/Footer.js +1 -1
- package/lib/cjs/components/header/Accounts.js +11 -20
- package/lib/cjs/components/header/Header.js +21 -17
- package/lib/cjs/components/header/ResolveLink.js +1 -1
- package/lib/cjs/components/icons/ProviderIcon.js +0 -5
- package/lib/cjs/components/logos/RujiraLogo.js +2 -2
- package/lib/cjs/context/GlobalModal.js +1 -1
- package/lib/cjs/hooks/useWindowSize.js +12 -13
- package/lib/cjs/i18n/config.js +2 -0
- package/lib/cjs/i18n/locales/de/common.json +0 -1
- package/lib/cjs/i18n/locales/de/home.json +1 -1
- package/lib/cjs/i18n/locales/en/common.json +0 -1
- package/lib/cjs/i18n/locales/en/home.json +1 -1
- package/lib/cjs/wallets/providers/cosmos.js +12 -9
- package/lib/cjs/wallets/providers/eip1193.js +13 -4
- package/lib/cjs/wallets/providers/eip6963.js +4 -2
- package/lib/cjs/wallets/providers/eip712.js +4 -1
- package/lib/cjs/wallets/providers/index.js +18 -3
- package/lib/cjs/wallets/providers/keplr.js +8 -4
- package/lib/cjs/wallets/providers/ledger.js +1 -1
- package/lib/cjs/wallets/providers/okx.js +8 -4
- package/lib/cjs/wallets/providers/ton.js +15 -6
- package/lib/cjs/wallets/providers/tronlink.js +1 -1
- package/lib/cjs/wallets/providers/utils.js +28 -29
- package/lib/cjs/wallets/providers/vulticonnect.js +20 -9
- package/lib/cjs/wallets/providers/vultisig/sol.js +25 -0
- package/lib/cjs/wallets/providers/vultisig.js +71 -30
- package/lib/cjs/wallets/providers/xaman.js +25 -7
- package/lib/cjs/wallets/storage.js +23 -20
- package/lib/esm/components/balance/OmniBalance.d.ts.map +1 -1
- package/lib/esm/components/balance/OmniBalance.js +5 -2
- package/lib/esm/components/bridges/DepositModal.js +2 -2
- package/lib/esm/components/buttons/TxButton.d.ts.map +1 -1
- package/lib/esm/components/buttons/TxButton.js +8 -2
- package/lib/esm/components/footer/Footer.js +1 -1
- package/lib/esm/components/header/Accounts.d.ts +1 -1
- package/lib/esm/components/header/Accounts.d.ts.map +1 -1
- package/lib/esm/components/header/Accounts.js +12 -21
- package/lib/esm/components/header/Header.d.ts.map +1 -1
- package/lib/esm/components/header/Header.js +21 -17
- package/lib/esm/components/header/ResolveLink.js +1 -1
- package/lib/esm/components/icons/ProviderIcon.d.ts.map +1 -1
- package/lib/esm/components/icons/ProviderIcon.js +0 -5
- package/lib/esm/components/logos/RujiraLogo.js +2 -2
- package/lib/esm/context/GlobalModal.d.ts.map +1 -1
- package/lib/esm/context/GlobalModal.js +1 -1
- package/lib/esm/hooks/useWindowSize.d.ts.map +1 -1
- package/lib/esm/hooks/useWindowSize.js +13 -14
- package/lib/esm/i18n/config.d.ts.map +1 -1
- package/lib/esm/i18n/config.js +2 -0
- package/lib/esm/i18n/locales/de/common.json +0 -1
- package/lib/esm/i18n/locales/de/home.json +1 -1
- package/lib/esm/i18n/locales/en/common.json +0 -1
- package/lib/esm/i18n/locales/en/home.json +1 -1
- package/lib/esm/wallets/providers/cosmos.d.ts.map +1 -1
- package/lib/esm/wallets/providers/cosmos.js +13 -10
- package/lib/esm/wallets/providers/eip1193.d.ts +1 -0
- package/lib/esm/wallets/providers/eip1193.d.ts.map +1 -1
- package/lib/esm/wallets/providers/eip1193.js +14 -5
- package/lib/esm/wallets/providers/eip6963.d.ts.map +1 -1
- package/lib/esm/wallets/providers/eip6963.js +4 -2
- package/lib/esm/wallets/providers/eip712.d.ts.map +1 -1
- package/lib/esm/wallets/providers/eip712.js +4 -1
- package/lib/esm/wallets/providers/index.d.ts +2 -1
- package/lib/esm/wallets/providers/index.d.ts.map +1 -1
- package/lib/esm/wallets/providers/index.js +18 -3
- package/lib/esm/wallets/providers/keplr.d.ts.map +1 -1
- package/lib/esm/wallets/providers/keplr.js +8 -4
- package/lib/esm/wallets/providers/ledger.js +1 -1
- package/lib/esm/wallets/providers/okx.d.ts.map +1 -1
- package/lib/esm/wallets/providers/okx.js +8 -4
- package/lib/esm/wallets/providers/ton.d.ts +2 -1
- package/lib/esm/wallets/providers/ton.d.ts.map +1 -1
- package/lib/esm/wallets/providers/ton.js +15 -6
- package/lib/esm/wallets/providers/tronlink.d.ts +1 -1
- package/lib/esm/wallets/providers/tronlink.d.ts.map +1 -1
- package/lib/esm/wallets/providers/tronlink.js +1 -1
- package/lib/esm/wallets/providers/utils.d.ts +2 -2
- package/lib/esm/wallets/providers/utils.d.ts.map +1 -1
- package/lib/esm/wallets/providers/utils.js +28 -29
- package/lib/esm/wallets/providers/vulticonnect.d.ts +1 -1
- package/lib/esm/wallets/providers/vulticonnect.d.ts.map +1 -1
- package/lib/esm/wallets/providers/vulticonnect.js +21 -10
- package/lib/esm/wallets/providers/vultisig/sol.d.ts +9 -0
- package/lib/esm/wallets/providers/vultisig/sol.d.ts.map +1 -0
- package/lib/esm/wallets/providers/vultisig/sol.js +20 -0
- package/lib/esm/wallets/providers/vultisig/tron.d.ts +2 -2
- package/lib/esm/wallets/providers/vultisig/tron.d.ts.map +1 -1
- package/lib/esm/wallets/providers/vultisig/utxo.d.ts +2 -2
- package/lib/esm/wallets/providers/vultisig/utxo.d.ts.map +1 -1
- package/lib/esm/wallets/providers/vultisig/utxo.js +1 -1
- package/lib/esm/wallets/providers/vultisig.d.ts +3 -0
- package/lib/esm/wallets/providers/vultisig.d.ts.map +1 -1
- package/lib/esm/wallets/providers/vultisig.js +72 -31
- package/lib/esm/wallets/providers/xaman.d.ts +4 -1
- package/lib/esm/wallets/providers/xaman.d.ts.map +1 -1
- package/lib/esm/wallets/providers/xaman.js +25 -7
- package/lib/esm/wallets/storage.d.ts +0 -9
- package/lib/esm/wallets/storage.d.ts.map +1 -1
- package/lib/esm/wallets/storage.js +23 -20
- package/package.json +2 -2
- package/src/components/balance/OmniBalance.tsx +6 -3
- package/src/components/bridges/DepositModal.tsx +6 -3
- package/src/components/buttons/TxButton.tsx +8 -2
- package/src/components/footer/Footer.tsx +5 -5
- package/src/components/header/Accounts.tsx +21 -28
- package/src/components/header/Header.tsx +21 -22
- package/src/components/header/ResolveLink.tsx +1 -1
- package/src/components/icons/ProviderIcon.tsx +0 -9
- package/src/components/logos/RujiraLogo.tsx +2 -2
- package/src/context/GlobalModal.tsx +2 -1
- package/src/hooks/useWindowSize.ts +15 -14
- package/src/i18n/config.ts +1 -0
- package/src/i18n/locales/de/common.json +0 -1
- package/src/i18n/locales/de/home.json +1 -1
- package/src/i18n/locales/en/common.json +0 -1
- package/src/i18n/locales/en/home.json +1 -1
- package/src/wallets/providers/cosmos.ts +15 -9
- package/src/wallets/providers/eip1193.ts +27 -7
- package/src/wallets/providers/eip6963.ts +7 -6
- package/src/wallets/providers/eip712.ts +4 -1
- package/src/wallets/providers/index.ts +19 -4
- package/src/wallets/providers/keplr.ts +8 -4
- package/src/wallets/providers/ledger.ts +1 -1
- package/src/wallets/providers/okx.ts +8 -4
- package/src/wallets/providers/ton.ts +15 -6
- package/src/wallets/providers/tronlink.ts +2 -2
- package/src/wallets/providers/utils.ts +30 -20
- package/src/wallets/providers/vulticonnect.ts +28 -9
- package/src/wallets/providers/vultisig/sol.ts +26 -0
- package/src/wallets/providers/vultisig/tron.ts +2 -2
- package/src/wallets/providers/vultisig/utxo.ts +2 -11
- package/src/wallets/providers/vultisig.ts +91 -31
- package/src/wallets/providers/xaman.ts +25 -9
- package/src/wallets/storage.ts +24 -20
- package/src/wallets/providers/ctrl.ts +0 -166
|
@@ -6,8 +6,8 @@ const react_1 = require("react");
|
|
|
6
6
|
const react_tooltip_1 = require("react-tooltip");
|
|
7
7
|
const rujira_js_1 = require("rujira.js");
|
|
8
8
|
const helpers_1 = require("../../helpers");
|
|
9
|
-
const ProviderIcon_1 = require("../icons/ProviderIcon");
|
|
10
9
|
const NetworkIcon_1 = require("../icons/NetworkIcon");
|
|
10
|
+
const ProviderIcon_1 = require("../icons/ProviderIcon");
|
|
11
11
|
const Decimal_1 = require("../numbers/Decimal");
|
|
12
12
|
const accountSorter = (a, b) => {
|
|
13
13
|
const aIsSecured = a.asset.type === "SECURED";
|
|
@@ -20,7 +20,10 @@ const accountSorter = (a, b) => {
|
|
|
20
20
|
};
|
|
21
21
|
const OmniBalance = ({ balance, onClick, className, accountProviders, }) => {
|
|
22
22
|
const tooltipId = (0, react_1.useId)();
|
|
23
|
-
const providerLookup = (0, react_1.useMemo)(() => new Map(accountProviders?.map(({ address, provider }) => [
|
|
23
|
+
const providerLookup = (0, react_1.useMemo)(() => new Map(accountProviders?.map(({ address, provider }) => [
|
|
24
|
+
address.address,
|
|
25
|
+
provider,
|
|
26
|
+
])), [accountProviders]);
|
|
24
27
|
const sortedAccounts = balance?.accounts
|
|
25
28
|
? [...balance.accounts].sort(accountSorter)
|
|
26
29
|
: [];
|
|
@@ -52,7 +52,7 @@ const Confirm = ({ asset, balance, targets, target: target_, Submit, onSuccess,
|
|
|
52
52
|
const { t } = (0, i18n_1.useTranslation)("common");
|
|
53
53
|
const ref = (0, react_1.useRef)(null);
|
|
54
54
|
const [amount, setAmount] = (0, react_1.useState)(requestAmount || 0n);
|
|
55
|
-
const [target, setTarget] = (0, react_1.useState)(target_ || "");
|
|
55
|
+
const [target, setTarget] = (0, react_1.useState)(target_?.address || "");
|
|
56
56
|
const [custom, setCustom] = (0, react_1.useState)("");
|
|
57
57
|
const [direct, setDirect] = (0, react_1.useState)(false);
|
|
58
58
|
const [advanced, setAdvanced] = (0, react_1.useState)(false);
|
|
@@ -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 === 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 })] }));
|
|
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.address, className: "bg-darkGrey", children: x.address }, x.address))), (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");
|
|
@@ -194,13 +194,19 @@ const TxButton = (props) => {
|
|
|
194
194
|
"button--grey": disabled &&
|
|
195
195
|
!isSimulating &&
|
|
196
196
|
!stylingClasses.includes("transparent"),
|
|
197
|
-
"button--waiting": (isSigning ||
|
|
197
|
+
"button--waiting": (isSigning ||
|
|
198
|
+
isRejected ||
|
|
199
|
+
isSuccess ||
|
|
200
|
+
(isSimulating && animateSimulation)) &&
|
|
198
201
|
!className?.includes("transparent"),
|
|
199
202
|
"button--success": isSuccess,
|
|
200
203
|
"button--rejected": isRejected,
|
|
201
204
|
"button--simulating": isSimulating && animateSimulation,
|
|
202
205
|
}), style: {
|
|
203
|
-
cursor: isSigning ||
|
|
206
|
+
cursor: isSigning ||
|
|
207
|
+
isSuccess ||
|
|
208
|
+
isRejected ||
|
|
209
|
+
(isSimulating && animateSimulation)
|
|
204
210
|
? "default"
|
|
205
211
|
: undefined,
|
|
206
212
|
...rest.style,
|
|
@@ -6,7 +6,6 @@ const clsx_1 = require("clsx");
|
|
|
6
6
|
const react_1 = require("motion/react");
|
|
7
7
|
const react_2 = require("react");
|
|
8
8
|
const react_hot_toast_1 = require("react-hot-toast");
|
|
9
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
10
9
|
const react_tooltip_1 = require("react-tooltip");
|
|
11
10
|
const rujira_js_1 = require("rujira.js");
|
|
12
11
|
const __1 = require("../..");
|
|
@@ -19,7 +18,7 @@ const Icons_1 = require("../icons/Icons");
|
|
|
19
18
|
const NetworkIcon_1 = require("../icons/NetworkIcon");
|
|
20
19
|
const Fiat_1 = require("../numbers/Fiat");
|
|
21
20
|
const ResolveLink_1 = require("./ResolveLink");
|
|
22
|
-
let referral = localStorage.getItem("referral");
|
|
21
|
+
let referral = typeof window !== "undefined" ? localStorage.getItem("referral") : null;
|
|
23
22
|
const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, customActions, }) => {
|
|
24
23
|
const { t } = (0, i18n_1.useTranslation)("header");
|
|
25
24
|
const { accounts: allAccounts, disconnectAll, selected } = provider;
|
|
@@ -37,15 +36,7 @@ const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, c
|
|
|
37
36
|
}, children: (0, jsx_runtime_1.jsx)(__1.Input, { value: `https://rujira.network/?ref=${referral}`, readOnly: true, label: t("clickToCopy") }) }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 color-grey mt-2", children: t("referralValidUntil") }), (0, jsx_runtime_1.jsx)("div", { className: "modal__footer mt-4 px-3 py-2 text-right", children: (0, jsx_runtime_1.jsx)(__1.Button, { label: t("close"), onClick: hideModal }) })] })),
|
|
38
37
|
});
|
|
39
38
|
};
|
|
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
|
-
? getValue({
|
|
42
|
-
address: selected.address,
|
|
43
|
-
network: rujira_js_1.THOR,
|
|
44
|
-
})
|
|
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
|
-
address: selected.address,
|
|
47
|
-
network: rujira_js_1.THOR,
|
|
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) => {
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !accounts || accounts.length === 0 ? ((0, jsx_runtime_1.jsx)(ConnectAnimation, { routingElement: routingElement, children: (0, jsx_runtime_1.jsx)(exports.Wallets, { provider: provider, wallets: wallets, routingElement: routingElement }) })) : ((0, jsx_runtime_1.jsxs)(MyAccount, { routingElement: routingElement, provider: provider, value: selected ? getValue(rujira_js_1.Account.fromAddress(selected.address)) : 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(rujira_js_1.Account.fromAddress(selected.address)), 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
40
|
e.stopPropagation();
|
|
50
41
|
e.preventDefault();
|
|
51
42
|
setShowBalance("false");
|
|
@@ -55,20 +46,20 @@ const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, c
|
|
|
55
46
|
e.preventDefault();
|
|
56
47
|
setShowBalance("true");
|
|
57
48
|
return false;
|
|
58
|
-
}, style: { marginRight: "-1rem" }, children: (0, jsx_runtime_1.jsx)(Icons_1.EyeSlash, { className: "w-2 h-2" }) })] })) }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 condensed color-grey mt-0.5", children: t("viewPortfolio") })] })) : null, accounts.map((account) => ((0, jsx_runtime_1.jsx)(AddressC, { provider: provider, ProviderIcon: ProviderIcon, account: account, selected: selected?.address === account.address &&
|
|
59
|
-
selected.provider === account.provider }, account.address
|
|
49
|
+
}, style: { marginRight: "-1rem" }, children: (0, jsx_runtime_1.jsx)(Icons_1.EyeSlash, { className: "w-2 h-2" }) })] })) }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 condensed color-grey mt-0.5", children: t("viewPortfolio") })] })) : null, accounts.map((account) => ((0, jsx_runtime_1.jsx)(AddressC, { provider: provider, ProviderIcon: ProviderIcon, account: account, selected: selected?.address.address === account.address.address &&
|
|
50
|
+
selected.provider === account.provider }, `${account.address.address}:${account.provider}`))), (0, jsx_runtime_1.jsxs)("nav", { className: "actions", children: [referral && ((0, jsx_runtime_1.jsxs)("button", { className: "action transparent", onClick: ReferralModal, children: [(0, jsx_runtime_1.jsx)(Icons_1.Users, {}), (0, jsx_runtime_1.jsx)("span", { children: t("referralLink") })] })), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, className: "action transparent", to: "connect", children: [(0, jsx_runtime_1.jsx)(Icons_1.Plus, {}), (0, jsx_runtime_1.jsx)("span", { children: t("connectAnotherWallet") })] }), customActions &&
|
|
60
51
|
customActions.map((e, index) => (0, react_2.cloneElement)(e, { key: index })), (0, jsx_runtime_1.jsxs)("button", { className: "action transparent", onClick: disconnectAll, children: [(0, jsx_runtime_1.jsx)(Icons_1.LinkDisconnect, {}), (0, jsx_runtime_1.jsx)("span", { children: t("disconnectAll") })] })] }), showBlur && (0, jsx_runtime_1.jsx)("div", { className: "blur" })] })) }));
|
|
61
52
|
};
|
|
62
53
|
exports.Accounts = Accounts;
|
|
63
54
|
/* const Component = forwardRef<HTMLAnchorElement, ComponentProps<typeof Link>>((props, ref) => {
|
|
64
55
|
return <Link {...props} ref={ref} />;
|
|
65
56
|
}); */
|
|
66
|
-
const ConnectAnimation = ({ children }) => {
|
|
57
|
+
const ConnectAnimation = ({ children, routingElement }) => {
|
|
67
58
|
const { t } = (0, i18n_1.useTranslation)("header");
|
|
68
59
|
const [show, setShow] = (0, react_2.useState)(false);
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1 no-underline", onMouseOver: () => setShow(true), onMouseOut: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)("div", { className: "rujira-header__connect", children: [(0, jsx_runtime_1.jsx)("div", { className: "fs-14 fw-500 fs-15 condensed", children: t("connect") }), (0, jsx_runtime_1.jsx)("img", { className: "w-3 h-3 filter-white", src: show ? connect_gif_1.default : connect_png_1.default, alt: "Connect" })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: "rujira-header__popup right condensed w-32 text-center p-2", initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 4 }, exit: { opacity: 0, marginTop: -4 }, children: [(0, jsx_runtime_1.jsxs)(
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1 no-underline", onMouseOver: () => setShow(true), onMouseOut: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)("div", { className: "rujira-header__connect", children: [(0, jsx_runtime_1.jsx)("div", { className: "fs-14 fw-500 fs-15 condensed", children: t("connect") }), (0, jsx_runtime_1.jsx)("img", { className: "w-3 h-3 filter-white", src: show ? connect_gif_1.default : connect_png_1.default, alt: "Connect" })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: "rujira-header__popup right condensed w-32 text-center p-2", initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 4 }, exit: { opacity: 0, marginTop: -4 }, children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, className: "flex dir-c action transparent", to: "connect", children: [(0, jsx_runtime_1.jsx)("p", { className: "color-white", children: t("connectYourWallet") }), (0, jsx_runtime_1.jsx)("small", { className: "color-grey mb-1", children: t("createOrConnectWallet") })] }), children] })) })] }));
|
|
70
61
|
};
|
|
71
|
-
const Wallets = ({ modalLayout = false, provider, wallets, }) => {
|
|
62
|
+
const Wallets = ({ modalLayout = false, provider, wallets, routingElement, }) => {
|
|
72
63
|
const { t } = (0, i18n_1.useTranslation)("header");
|
|
73
64
|
const { connect, isAvailable } = provider;
|
|
74
65
|
const { hideModal } = (0, GlobalModal_1.useGlobalModalContext)();
|
|
@@ -94,11 +85,11 @@ const Wallets = ({ modalLayout = false, provider, wallets, }) => {
|
|
|
94
85
|
}
|
|
95
86
|
x.provider && connect(x.provider).then(hideModal);
|
|
96
87
|
}, children: x.icon }, x.label));
|
|
97
|
-
}) }), (0, jsx_runtime_1.jsx)(
|
|
88
|
+
}) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routingElement, to: "/tou", className: "terms mb-1", children: "By connecting a wallet, you agree to Rujira's Terms of Use." }), (0, jsx_runtime_1.jsx)("hr", { className: (0, clsx_1.default)({
|
|
98
89
|
hr: true,
|
|
99
90
|
"mt-0 mb-1": !modalLayout,
|
|
100
91
|
"my-2": modalLayout,
|
|
101
|
-
}) }), (0, jsx_runtime_1.jsx)(
|
|
92
|
+
}) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routingElement, to: "ecosystem/wallets", onClick: hideModal, children: t("needHelpDeciding") })] }), (0, jsx_runtime_1.jsx)(react_tooltip_1.Tooltip, { id: "wallet-tip", className: "tooltip" })] }));
|
|
102
93
|
};
|
|
103
94
|
exports.Wallets = Wallets;
|
|
104
95
|
const MyAccount = ({ provider, children, onHide, routingElement, value, }) => {
|
|
@@ -120,10 +111,10 @@ const AddressC = ({ account, selected, provider, ProviderIcon, }) => {
|
|
|
120
111
|
}), 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
112
|
if (selected) {
|
|
122
113
|
react_hot_toast_1.default.success(t("addressCopied"));
|
|
123
|
-
navigator.clipboard.writeText(account.address);
|
|
114
|
+
navigator.clipboard.writeText(account.address.address);
|
|
124
115
|
}
|
|
125
116
|
else {
|
|
126
117
|
select(account);
|
|
127
118
|
}
|
|
128
|
-
}, children: hover && selected ? (t("copyAddress")) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.address.substring(0, 8), " ... ", account.address.slice(-8)] })) }), hover ? ((0, jsx_runtime_1.jsx)(Icons_1.LinkDisconnect, { className: "address__disconnect", onClick: () => disconnect(account.provider) })) : ((0, jsx_runtime_1.jsx)(ProviderIcon, { className: "address__disconnect", provider: account.provider, selected: selected }))] }));
|
|
119
|
+
}, children: hover && selected ? (t("copyAddress")) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.address.address.substring(0, 8), " ...", " ", account.address.address.slice(-8)] })) }), hover ? ((0, jsx_runtime_1.jsx)(Icons_1.LinkDisconnect, { className: "address__disconnect", onClick: () => disconnect(account.provider) })) : ((0, jsx_runtime_1.jsx)(ProviderIcon, { className: "address__disconnect", provider: account.provider, selected: selected }))] }));
|
|
129
120
|
};
|
|
@@ -39,6 +39,13 @@ const Header = ({ accountProvider, className, domain = "", routingElement, walle
|
|
|
39
39
|
const [scrollY, setScrollY] = (0, react_2.useState)(0);
|
|
40
40
|
const { accounts } = accountProvider;
|
|
41
41
|
const { showModal } = (0, GlobalModal_1.useGlobalModalContext)();
|
|
42
|
+
const ConnectModal = () => {
|
|
43
|
+
showModal({
|
|
44
|
+
title: t("connectYourAccount"),
|
|
45
|
+
backgroundClose: true,
|
|
46
|
+
children: ((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "header", children: (0, jsx_runtime_1.jsx)(Accounts_1.Wallets, { modalLayout: true, provider: accountProvider, wallets: wallets, routingElement: routingElement }) })),
|
|
47
|
+
});
|
|
48
|
+
};
|
|
42
49
|
(0, react_2.useEffect)(() => {
|
|
43
50
|
const handleScroll = () => {
|
|
44
51
|
setIsScrolled(window.scrollY > 56);
|
|
@@ -49,13 +56,6 @@ const Header = ({ accountProvider, className, domain = "", routingElement, walle
|
|
|
49
56
|
window.removeEventListener("scroll", handleScroll);
|
|
50
57
|
};
|
|
51
58
|
}, []);
|
|
52
|
-
const ConnectModal = () => {
|
|
53
|
-
showModal({
|
|
54
|
-
title: t("connectYourAccount"),
|
|
55
|
-
backgroundClose: true,
|
|
56
|
-
children: ((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "header", children: (0, jsx_runtime_1.jsx)(Accounts_1.Wallets, { modalLayout: true, provider: accountProvider, wallets: wallets }) })),
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
59
|
return ((0, jsx_runtime_1.jsxs)(exports.Container, { style: { backgroundColor: `rgba(15, 17, 23, ${(scrollY / 56) * 0.9})` }, className: (0, clsx_1.default)({
|
|
60
60
|
[`${className}`]: className,
|
|
61
61
|
"rujira-header--scrolled": isScrolled,
|
|
@@ -158,15 +158,19 @@ const MobileNav = ({ domain, routingElement, accountProvider, staticRoutes, }) =
|
|
|
158
158
|
document.body.style.overflow = "auto";
|
|
159
159
|
}
|
|
160
160
|
}, [showMobile]);*/
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
161
|
+
(0, react_2.useEffect)(() => {
|
|
162
|
+
let url = location.href;
|
|
163
|
+
const handler = () => {
|
|
164
|
+
requestAnimationFrame(() => {
|
|
165
|
+
if (url !== location.href) {
|
|
166
|
+
setShowDrawer(false);
|
|
167
|
+
url = location.href;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
document.body.addEventListener("click", handler, true);
|
|
172
|
+
return () => document.body.removeEventListener("click", handler, true);
|
|
173
|
+
}, []);
|
|
170
174
|
return ((0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Root, { direction: "left", open: showDrawer, onOpenChange: (open) => setShowDrawer(open), children: [(0, jsx_runtime_1.jsx)("button", { className: "rujira-header__hamburger", onClick: () => setShowDrawer(true), children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 64H448v48H0V64zM0 224H448v48H0V224zM448 384v48H0V384H448z", fill: "currentColor" }) }) }), (0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Portal, { children: [(0, jsx_runtime_1.jsx)(vaul_1.Drawer.Overlay, { className: "drawer__overlay" }), (0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Content, { className: "drawer__content drawer__content--left", children: [(0, jsx_runtime_1.jsx)(vaul_1.Drawer.Description, { className: "visually-hidden", children: "Main navigation menu" }), (0, jsx_runtime_1.jsx)(vaul_1.Drawer.Title, { className: "visually-hidden", children: "Main Menu" }), (0, jsx_runtime_1.jsxs)("div", { className: "drawer__card mobile-drawer", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: ".", className: "flex ai-c", children: [(0, jsx_runtime_1.jsx)(Icons_1.Home, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("home") }) })] }), accounts && accounts.length > 0 && ((0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "portfolio", className: "flex ai-c mt-2", children: [(0, jsx_runtime_1.jsx)(Icons_1.Coins, { className: "color-grey h-3.5 w-a block mr-2 no-shrink" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("portfolio") }) })] })), (0, jsx_runtime_1.jsx)("h4", { children: t("trade") }), (0, jsx_runtime_1.jsx)(SubTrade, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("earn") }), (0, jsx_runtime_1.jsx)(SubEarn, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("borrow") }), (0, jsx_runtime_1.jsx)(SubBorrow, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("utilities") }), (0, jsx_runtime_1.jsx)(SubUtilities, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("entertainment") }), (0, jsx_runtime_1.jsx)(SubEntertainment, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("learnAndHelp") }), (0, jsx_runtime_1.jsx)(SubLearn, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes })] })] })] })] }));
|
|
171
175
|
};
|
|
172
176
|
exports.MobileNav = MobileNav;
|
|
@@ -193,5 +197,5 @@ const SubEntertainment = ({ domain, routingElement, useRef, className, staticRou
|
|
|
193
197
|
};
|
|
194
198
|
const SubLearn = ({ domain, routingElement, useRef, className, staticRoutes, }) => {
|
|
195
199
|
const { t } = (0, i18n_1.useTranslation)("header");
|
|
196
|
-
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("get-started"), domain: domain, to: "get-started", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Graduate, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("getStarted") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("getStartedDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("support"), domain: domain, to: "support", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Support, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("support") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("educationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Code, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("documentation"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("documentationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/developers/getting-started", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("developers"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("developersDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("faq"), domain: domain, to: "faq", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.Info, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("commonQuestions") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("supportDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("articles"), domain: domain, to: "articles", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.History, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("articles") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("articlesDesc") })] })] })] }) }));
|
|
200
|
+
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("get-started"), domain: domain, to: "get-started", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Graduate, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("getStarted") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("getStartedDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("support"), domain: domain, to: "/support", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Support, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("support") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("educationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Code, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("documentation"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("documentationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/developers/getting-started", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("developers"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("developersDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("faq"), domain: domain, to: "faq", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.Info, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("commonQuestions") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("supportDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("articles"), domain: domain, to: "articles", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.History, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("articles") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("articlesDesc") })] })] })] }) }));
|
|
197
201
|
};
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const fixedForwardRef = react_1.forwardRef;
|
|
7
7
|
const UnwrappedAnyComponent = (props, ref) => {
|
|
8
8
|
const { as: Comp = "a", children, domain, isStatic, ...rest } = props;
|
|
9
|
-
if (!isStatic && props.as !== "a") {
|
|
9
|
+
if (!isStatic && props.as && props.as !== "a") {
|
|
10
10
|
return ((0, jsx_runtime_1.jsx)(Comp, { ...rest, ref: ref, children: children }));
|
|
11
11
|
}
|
|
12
12
|
return ((0, jsx_runtime_1.jsx)("a", { href: props.to || props.href, ...rest, children: children }));
|
|
@@ -24,11 +24,6 @@ const ProviderIcon = ({ provider, selected, className }) => {
|
|
|
24
24
|
case "Vulticonnect":
|
|
25
25
|
case "Vultisig":
|
|
26
26
|
return selected ? ((0, jsx_runtime_1.jsx)(WalletIcons.Vultisig, { className: (0, clsx_1.default)({ [`${className}`]: className }) })) : ((0, jsx_runtime_1.jsx)(WalletIcons.VultisigSimple, { className: (0, clsx_1.default)({ [`${className}`]: className }) }));
|
|
27
|
-
case "Ctrl":
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(WalletIcons.Ctrl, { className: (0, clsx_1.default)({
|
|
29
|
-
[`${className}`]: className,
|
|
30
|
-
"color-white": selected,
|
|
31
|
-
}) }));
|
|
32
27
|
case "DaoDao":
|
|
33
28
|
return ((0, jsx_runtime_1.jsx)(WalletIcons.Daodao, { className: (0, clsx_1.default)({
|
|
34
29
|
[`${className}`]: className,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RujiraLogo = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const react_1 = require("react");
|
|
6
6
|
const RujiraLogo = ({ textColor = "#fff", showText = true, animate = false, className, }) => {
|
|
7
|
-
const id = (0,
|
|
7
|
+
const id = (0, react_1.useId)();
|
|
8
8
|
return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${showText ? 3710 : 1000} 1000`, xmlns: "http://www.w3.org/2000/svg", className: className, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { x1: "97.12%", y1: "12.295%", x2: "15.952%", y2: "88.858%", id: id, children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#D615EB", offset: "0%" }), (0, jsx_runtime_1.jsx)("stop", { stopColor: "#8436F5", offset: "100%" })] }) }), (0, jsx_runtime_1.jsxs)("g", { fill: "none", fillRule: "nonzero", children: [!animate ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M109.713 718.57c64.466 183.188 203.797 276.949 417.99 281.283 214.195 4.334 357.082-87.26 428.663-274.782 71.581-187.522 55.091-346.445-49.47-476.768C802.337 117.981 666.289 37.628 498.753 7.246 331.216-23.136 208.376 42.026 130.23 202.73c-78.145 160.705-84.984 332.652-20.517 515.84Z", fillOpacity: ".45", fill: "#CE18EC" }), (0, jsx_runtime_1.jsx)("path", { d: "M938.285 742.674c-81.778 172.834-217.066 249.65-405.863 230.445C343.625 953.916 193.193 867.5 81.127 713.868-30.94 560.238-26.902 413.177 93.242 272.686c120.143-140.491 271.08-228.424 452.81-263.8C727.782-26.489 859.03 43.756 939.8 219.623c80.768 175.866 80.264 350.216-1.515 523.05Z", fillOpacity: ".45", fill: "#8535F4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { fill: "#CE18EC", fillOpacity: ".45", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "3897ms", repeatCount: "indefinite", values: "M908.65 772.515c-119.423 173.188-259.837 247.488-421.243 222.9C326 970.826 191.184 884.232 82.957 735.633-25.268 587.033-27.6 434.158 75.96 277.006 179.522 119.854 316.67 28.984 487.407 4.396c170.736-24.59 313.482 53.987 428.24 235.727 114.757 181.74 112.424 359.205-6.998 532.392Z;\n M905.657 701.408C781.589 850.992 630.329 930.883 451.876 941.082c-178.453 10.199-308.47-64.593-390.048-224.376-81.579-159.782-82.428-320.415-2.55-481.897C139.159 73.326 270.874-4.865 454.426.234c183.552 5.1 335.662 85.84 456.33 242.224 120.67 156.383 118.97 309.366-5.098 458.95Z;\n M938.285 742.674c-81.778 172.834-217.066 249.65-405.863 230.445C343.625 953.916 193.193 867.5 81.127 713.868-30.94 560.238-26.902 413.177 93.242 272.686c120.143-140.491 271.08-228.424 452.81-263.8C727.782-26.489 859.03 43.756 939.8 219.623c80.768 175.866 80.264 350.216-1.515 523.05Z;\n M909.194 698.092C791.124 849.094 646.258 945.89 474.596 988.48c-171.662 42.59-307.317-32.91-406.964-226.503-99.648-193.591-89.18-365.888 31.401-516.89C219.615 94.086 358.201 12.777 514.79 1.162c156.589-11.616 290.988 63.885 403.196 226.502 112.208 162.617 109.277 319.426-8.792 470.428Z;\n M908.65 772.515c-119.423 173.188-259.837 247.488-421.243 222.9C326 970.826 191.184 884.232 82.957 735.633-25.268 587.033-27.6 434.158 75.96 277.006 179.522 119.854 316.67 28.984 487.407 4.396c170.736-24.59 313.482 53.987 428.24 235.727 114.757 181.74 112.424 359.205-6.998 532.392Z;" }) }), (0, jsx_runtime_1.jsx)("path", { fill: "#8535F4", fillOpacity: ".45", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "2975ms", repeatCount: "indefinite", values: "M932.532 715.172C854.38 889.747 710.761 984.14 501.676 998.35 292.591 1012.56 146.943 925.27 64.73 736.486c-82.213-188.785-68.51-353.718 41.106-494.8C215.453 100.607 357.042 20.93 530.603 2.66c173.56-18.27 303.477 52.271 389.75 211.622 86.273 159.351 90.332 326.314 12.18 500.89Z;\n M885.654 705.273C746.066 828.795 579.708 919.904 386.58 978.599c-193.128 58.695-311.204-3.066-354.228-185.284-43.024-182.217-43.502-364.873-1.434-547.967C72.984 62.255 202.534-18.342 419.564 3.56c217.03 21.9 383.867 113.448 500.51 274.64 116.641 161.193 105.168 303.55-34.42 427.073Z;\n M962.274 793.5c-49.124 177.855-169.888 240.71-362.29 188.563-192.402-52.145-355.126-141.072-488.17-266.78C-21.23 589.572-36.069 440.585 67.296 268.318 170.66 96.052 333.896 6.659 557 .141c223.104-6.518 358.707 79.615 406.808 258.4 48.1 178.786 47.589 357.106-1.535 534.96Z;\n M897.318 638.271C761.297 778.402 603.636 888.36 424.336 968.141c-179.3 79.783-306.047 9.718-380.24-210.196-74.193-219.913-54.762-400.958 58.295-543.135C215.447 72.633 343.077 1.034 485.28.01c142.203-1.022 280.432 70.066 414.686 213.266 134.255 143.2 133.371 284.864-2.65 424.995Z;\n M932.532 715.172C854.38 889.747 710.761 984.14 501.676 998.35 292.591 1012.56 146.943 925.27 64.73 736.486c-82.213-188.785-68.51-353.718 41.106-494.8C215.453 100.607 357.042 20.93 530.603 2.66c173.56-18.27 303.477 52.271 389.75 211.622 86.273 159.351 90.332 326.314 12.18 500.89Z;" }) })] })), (0, jsx_runtime_1.jsxs)("g", { transform: "translate(49 24)", children: [(0, jsx_runtime_1.jsx)("circle", { fill: `url(#${id})`, cx: "475.5", cy: "475.5", r: "475.5" }), (0, jsx_runtime_1.jsx)("path", { d: "M475.5 57.011c-231.125 0-418.489 187.364-418.489 418.489 0 231.125 187.364 418.489 418.489 418.489 231.125 0 418.489-187.364 418.489-418.489 0-231.125-187.364-418.489-418.489-418.489Z", fill: "#1B1821" }), (0, jsx_runtime_1.jsx)("path", { d: "M460.284 232.995v159.944h-58.52l58.52 67.345h-68.973l-60.794-67.345h-45.61v67.345h-51.912V341.027h50.66l-50.66-56.12v-51.912h227.289Zm-152.396 51.912 48.766 56.12h51.718v-56.12H307.888Zm182.828 433.098v-51.912h88.39V542.628h-88.39v-51.912h227.289v51.912h-86.987v123.465h86.987v51.912H490.716Zm-257.721 0V598.748h51.912v67.345h93.716l29.75-29.155v-94.31H346.64v-51.912h113.644v166.96l-60.33 60.329H232.995Zm318.05-257.721-60.329-60.33V232.995h51.912v146.222l29.748 29.155h93.717V232.995h51.912v227.289h-166.96Z", fill: `url(#${id})` })] }), showText && ((0, jsx_runtime_1.jsx)("path", { d: "M1466.453 256.11c96.524 0 159.415 63.144 159.415 153.455 0 87.374-57.043 134.366-115.543 143.91l119.196 192.37h-98.719l-108.22-182.824h-84.827v182.825H1252.2V256.11h214.254Zm-11.697 75.626h-117v155.658h117c48.262 0 83.36-30.838 83.36-77.83 0-46.99-35.098-77.828-83.36-77.828ZM1926.077 751.71c141.25 0 210.775-80.446 210.775-201.848v-294.73h-86.357v292.535c0 77.522-43.178 127.985-124.418 127.985-81.969 0-125.155-50.463-125.155-127.985V255.132h-86.357v295.46c0 119.94 69.524 201.119 211.512 201.119ZM2209.279 937.439c94.103 0 164.133-52.144 164.133-163.783V255.132h-85.346v517.055c0 53.612-32.832 88.866-85.352 88.866-37.205 0-63.465-19.092-83.16-40.395l-39.398 65.366c34.29 36.727 78.788 51.415 129.123 51.415ZM2610.948 745.846V256.11h-84.067v489.736zM2977.695 256.11c96.523 0 159.414 63.144 159.414 153.455 0 87.374-57.042 134.366-115.535 143.91l119.188 192.37h-98.718l-108.22-182.824h-84.827v182.825h-85.556V256.11h214.254Zm-11.697 75.626h-117.001v155.658h117c48.262 0 83.361-30.838 83.361-77.83 0-46.99-35.099-77.828-83.36-77.828ZM3518.168 256.11l191.51 489.736h-97.216l-35.818-93.983h-223.67l-35.817 93.983h-97.216l191.51-489.736h106.717Zm-53.355 86.64-87.715 233.487h175.43l-87.715-233.487Z", fill: textColor }))] })] }));
|
|
9
9
|
};
|
|
10
10
|
exports.RujiraLogo = RujiraLogo;
|
|
@@ -37,7 +37,7 @@ const GlobalModal = ({ children, }) => {
|
|
|
37
37
|
document.body.style.overflow = "";
|
|
38
38
|
setModalProps({});
|
|
39
39
|
};
|
|
40
|
-
const dest = document.getElementById("modal");
|
|
40
|
+
const dest = typeof document !== "undefined" ? document.getElementById("modal") : null;
|
|
41
41
|
const renderComponent = () => {
|
|
42
42
|
return dest
|
|
43
43
|
? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "common", children: (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: !(0, helpers_1.isEmpty)(modalProps) && ((0, jsx_runtime_1.jsx)(ModalContent, { modalProps: modalProps, hideModal: hideModal })) }) }), dest)
|
|
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useWindowDimensions = exports.BreakPoints = void 0;
|
|
4
4
|
exports.useWindowSize = useWindowSize;
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
// useLayoutEffect fires synchronously before browser paint, eliminating the
|
|
7
|
+
// flash where size-dependent layout hasn't updated yet. On the server it
|
|
8
|
+
// would warn, so we fall back to useEffect there.
|
|
9
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? react_1.useLayoutEffect : react_1.useEffect;
|
|
6
10
|
exports.BreakPoints = {
|
|
7
11
|
xsmall: 420,
|
|
8
12
|
small: 576,
|
|
@@ -15,10 +19,10 @@ exports.BreakPoints = {
|
|
|
15
19
|
};
|
|
16
20
|
function useWindowSize() {
|
|
17
21
|
const [windowSize, setWindowSize] = (0, react_1.useState)({
|
|
18
|
-
width:
|
|
19
|
-
height:
|
|
22
|
+
width: 0,
|
|
23
|
+
height: 0,
|
|
20
24
|
});
|
|
21
|
-
(
|
|
25
|
+
useIsomorphicLayoutEffect(() => {
|
|
22
26
|
function handleResize() {
|
|
23
27
|
setWindowSize({
|
|
24
28
|
width: window.innerWidth,
|
|
@@ -32,20 +36,15 @@ function useWindowSize() {
|
|
|
32
36
|
return windowSize;
|
|
33
37
|
}
|
|
34
38
|
const useWindowDimensions = (innerWidth) => {
|
|
35
|
-
const [isMobileSize, setIsMobileSize] = (0, react_1.useState)(
|
|
36
|
-
(
|
|
39
|
+
const [isMobileSize, setIsMobileSize] = (0, react_1.useState)(false);
|
|
40
|
+
useIsomorphicLayoutEffect(() => {
|
|
37
41
|
const windowResizeHandler = () => {
|
|
38
|
-
|
|
39
|
-
if (matchMedia(matchMediaString).matches) {
|
|
40
|
-
setIsMobileSize(true);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
setIsMobileSize(false);
|
|
44
|
-
}
|
|
42
|
+
setIsMobileSize(matchMedia(`(max-width: ${innerWidth}px)`).matches);
|
|
45
43
|
};
|
|
46
44
|
window.addEventListener('resize', windowResizeHandler);
|
|
45
|
+
windowResizeHandler();
|
|
47
46
|
return () => window.removeEventListener('resize', windowResizeHandler);
|
|
48
|
-
}, []);
|
|
47
|
+
}, [innerWidth]);
|
|
49
48
|
return isMobileSize;
|
|
50
49
|
};
|
|
51
50
|
exports.useWindowDimensions = useWindowDimensions;
|
package/lib/cjs/i18n/config.js
CHANGED
|
@@ -33,6 +33,8 @@ const SUPPORTED_LANGUAGES = ["en", "de"];
|
|
|
33
33
|
exports.SUPPORTED_LANGUAGES = SUPPORTED_LANGUAGES;
|
|
34
34
|
exports.SUPPORTED_LANGUAGE_PATTERN = SUPPORTED_LANGUAGES.join("|");
|
|
35
35
|
const detectLanguage = () => {
|
|
36
|
+
if (typeof window === "undefined")
|
|
37
|
+
return "en";
|
|
36
38
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
37
39
|
if (stored && SUPPORTED_LANGUAGES.includes(stored)) {
|
|
38
40
|
return stored;
|
|
@@ -114,7 +114,6 @@
|
|
|
114
114
|
"vultisigEmailLabel": "E-Mail",
|
|
115
115
|
"vultisigVerifyCodeLabel": "Bestätige den Fast Vault Code, der an {{email}} gesendet wurde",
|
|
116
116
|
"vultisigVerify": "Bestätigen",
|
|
117
|
-
"vultisigReadOnlyWarning": "Das Signieren mit Vultisig Vaults ist vorübergehend nur für Rujira und andere Cosmos-Chains aktiviert. Vaults können erstellt, gesichert und in jede andere Vultisig-kompatible Wallet importiert werden.",
|
|
118
117
|
"vultisigConnectProviderError": "useConnect muss innerhalb von ConnectProvider verwendet werden",
|
|
119
118
|
"mergeNow": "Jetzt Mergen",
|
|
120
119
|
"iUnderstandContinue": "Ich verstehe, Fortfahren",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"builtCardScaleMobileLine2": "um neue Services zu bauen und zu skalieren,",
|
|
80
80
|
"builtCardScaleMobileLine3": "sorgfältig geprüft für sichere, zuverlässige",
|
|
81
81
|
"builtCardScaleMobileLine4": "und hochwertige Produkte für dich.",
|
|
82
|
-
"productsPill": "
|
|
82
|
+
"productsPill": "Produkte",
|
|
83
83
|
"productsTitle": "Ein System, das zusammenarbeitet",
|
|
84
84
|
"productsCopy1": "Rujira bringt alle Produkte, die du brauchst, an einen Ort, an dem alles für dich zusammenspielt.",
|
|
85
85
|
"productsCopy2": "Kein Springen mehr zwischen Apps oder Chains, nur ein einfacher Weg, damit DeFi leicht wirkt.",
|
|
@@ -114,7 +114,6 @@
|
|
|
114
114
|
"vultisigEmailLabel": "Email",
|
|
115
115
|
"vultisigVerifyCodeLabel": "Verify the Fast Vault code sent to {{email}}",
|
|
116
116
|
"vultisigVerify": "Verify",
|
|
117
|
-
"vultisigReadOnlyWarning": "Vultisig Vault signing is temporarily only enabled for Rujira and other Cosmos chains. Vaults can be created, backed up, and imported into any other Vultisig compatible wallet.",
|
|
118
117
|
"vultisigConnectProviderError": "useConnect must be used within ConnectProvider",
|
|
119
118
|
"depositInOrderTo": "Deposit {{symbol}} in order to {{action}}, and use other Rujira products",
|
|
120
119
|
"depositSymbolTo": "Deposit {{symbol}} to {{action}}",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"builtCardScaleMobileLine2": "build and scale new services, carefully",
|
|
80
80
|
"builtCardScaleMobileLine3": "reviewed to ensure safe, reliable,",
|
|
81
81
|
"builtCardScaleMobileLine4": "and high-quality products for you.",
|
|
82
|
-
"productsPill": "
|
|
82
|
+
"productsPill": "Products",
|
|
83
83
|
"productsTitle": "A System Built to Work in Harmony",
|
|
84
84
|
"productsCopy1": "Rujira brings all the products you need into one place where everything works together for you.",
|
|
85
85
|
"productsCopy2": "No more jumping between apps or chains, just a simple way to make DeFi feel easy.",
|
|
@@ -31,7 +31,10 @@ class CosmosAdapter {
|
|
|
31
31
|
await k.enable(chain.chainId);
|
|
32
32
|
const signer = await k.getOfflineSignerAuto(chain.chainId);
|
|
33
33
|
const accounts = await signer.getAccounts();
|
|
34
|
-
return accounts.map((a) =>
|
|
34
|
+
return accounts.map((a) => ({
|
|
35
|
+
address: a.address,
|
|
36
|
+
networks: [(0, exports.getNetwork)(chain)],
|
|
37
|
+
}));
|
|
35
38
|
})).then((res) => {
|
|
36
39
|
return res.reduce((a, v) => v.status === "fulfilled" ? [...v.value, ...a] : a, []);
|
|
37
40
|
});
|
|
@@ -53,13 +56,13 @@ class CosmosAdapter {
|
|
|
53
56
|
}
|
|
54
57
|
networks() {
|
|
55
58
|
return [
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
rujira_js_1.GAIA,
|
|
60
|
+
rujira_js_1.KUJI,
|
|
58
61
|
// "NOBLE",
|
|
59
|
-
|
|
62
|
+
rujira_js_1.OSMO,
|
|
60
63
|
// "TERRA",
|
|
61
64
|
// "TERRA2",
|
|
62
|
-
|
|
65
|
+
rujira_js_1.THOR,
|
|
63
66
|
];
|
|
64
67
|
}
|
|
65
68
|
}
|
|
@@ -72,17 +75,17 @@ exports.getGasPrice = getGasPrice;
|
|
|
72
75
|
const getNetwork = (c) => {
|
|
73
76
|
switch (c.chainName) {
|
|
74
77
|
case "Kujira":
|
|
75
|
-
return
|
|
78
|
+
return rujira_js_1.KUJI;
|
|
76
79
|
case "Cosmos Hub":
|
|
77
|
-
return
|
|
80
|
+
return rujira_js_1.GAIA;
|
|
78
81
|
case "Noble":
|
|
79
82
|
return "NOBLE";
|
|
80
83
|
case "Osmosis":
|
|
81
|
-
return
|
|
84
|
+
return rujira_js_1.OSMO;
|
|
82
85
|
case "THORChain":
|
|
83
86
|
case "THORChain Stagenet":
|
|
84
87
|
case "THORChain Devnet":
|
|
85
|
-
return
|
|
88
|
+
return rujira_js_1.THOR;
|
|
86
89
|
default:
|
|
87
90
|
throw new Error(`No Network for chain ${c.chainName}`);
|
|
88
91
|
}
|
|
@@ -25,9 +25,15 @@ class Eip1193Adapter {
|
|
|
25
25
|
? authorizedAccounts
|
|
26
26
|
: await e.request({ method: "eth_requestAccounts" });
|
|
27
27
|
const eip712 = this.eip712 ? await this.eip712.connect() : [];
|
|
28
|
-
this.map = eip1193.reduce((a, v) => ({ ...a, [v]: "1193" }), this.map);
|
|
29
|
-
this.map = eip712.reduce((a, v) => ({ ...a, [v]: "712" }), this.map);
|
|
30
|
-
return [
|
|
28
|
+
this.map = eip1193.reduce((a, v) => ({ ...a, [ethers_1.ethers.getAddress(v)]: "1193" }), this.map);
|
|
29
|
+
this.map = eip712.reduce((a, v) => ({ ...a, [v.address]: "712" }), this.map);
|
|
30
|
+
return [
|
|
31
|
+
...eip712,
|
|
32
|
+
...eip1193.map((x) => ({
|
|
33
|
+
address: ethers_1.ethers.getAddress(x),
|
|
34
|
+
networks: this.eip1193Networks(),
|
|
35
|
+
})),
|
|
36
|
+
];
|
|
31
37
|
}
|
|
32
38
|
async simulate(msg) {
|
|
33
39
|
if (this.map[msg.account.address] === "712") {
|
|
@@ -70,7 +76,10 @@ class Eip1193Adapter {
|
|
|
70
76
|
return new ethers_1.JsonRpcSigner(provider, account.address);
|
|
71
77
|
}
|
|
72
78
|
networks() {
|
|
73
|
-
return [...(this.eip712?.networks() || []),
|
|
79
|
+
return [...(this.eip712?.networks() || []), ...this.eip1193Networks()];
|
|
80
|
+
}
|
|
81
|
+
eip1193Networks() {
|
|
82
|
+
return [rujira_js_1.AVAX, rujira_js_1.BASE, rujira_js_1.BSC, rujira_js_1.ETH];
|
|
74
83
|
}
|
|
75
84
|
}
|
|
76
85
|
exports.Eip1193Adapter = Eip1193Adapter;
|
|
@@ -8,8 +8,10 @@ class Eip6963Adapter extends eip1193_1.Eip1193Adapter {
|
|
|
8
8
|
constructor(rdns, eip712 = false) {
|
|
9
9
|
super(() => this.provider, eip712);
|
|
10
10
|
this.rdns = rdns;
|
|
11
|
-
window
|
|
12
|
-
|
|
11
|
+
if (typeof window !== "undefined") {
|
|
12
|
+
window.addEventListener("eip6963:announceProvider", this.handleAnnounce.bind(this));
|
|
13
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
16
|
handleAnnounce(res) {
|
|
15
17
|
if (res.detail.info.rdns.includes(this.rdns)) {
|
|
@@ -19,7 +19,10 @@ class Eip712Adapter {
|
|
|
19
19
|
throw new Error(`No bech32 prefix provided for ${this.chainInfo.chainId}`);
|
|
20
20
|
const signer = new rujira_js_1.signers.cosmos.Eip712Signer(e, prefix, this.chainInfo.rpc);
|
|
21
21
|
const accounts = await signer.getAccounts();
|
|
22
|
-
return accounts.map((a) =>
|
|
22
|
+
return accounts.map((a) => ({
|
|
23
|
+
address: a.address,
|
|
24
|
+
networks: this.networks(),
|
|
25
|
+
}));
|
|
23
26
|
}
|
|
24
27
|
async simulate(msg) {
|
|
25
28
|
await this.e()?.request({
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Provider = exports.vultisig = void 0;
|
|
4
4
|
const brave_1 = require("./brave");
|
|
5
5
|
const coinbase_1 = require("./coinbase");
|
|
6
|
-
const ctrl_1 = require("./ctrl");
|
|
7
6
|
const keplr_1 = require("./keplr");
|
|
8
7
|
const leap_1 = require("./leap");
|
|
9
8
|
// import { default as ledger } from "./ledger";
|
|
@@ -21,14 +20,30 @@ Object.defineProperty(exports, "vultisig", { enumerable: true, get: function ()
|
|
|
21
20
|
const xaman_1 = require("./xaman");
|
|
22
21
|
var Provider;
|
|
23
22
|
(function (Provider) {
|
|
23
|
+
Provider.keys = [
|
|
24
|
+
"Brave",
|
|
25
|
+
"Coinbase",
|
|
26
|
+
"DaoDao",
|
|
27
|
+
"Keplr",
|
|
28
|
+
"Leap",
|
|
29
|
+
"Ledger",
|
|
30
|
+
"Metamask",
|
|
31
|
+
"Okx",
|
|
32
|
+
"Rabby",
|
|
33
|
+
"Station",
|
|
34
|
+
"Ton",
|
|
35
|
+
"Tronlink",
|
|
36
|
+
"Trust",
|
|
37
|
+
"Vulticonnect",
|
|
38
|
+
"Vultisig",
|
|
39
|
+
"Xaman",
|
|
40
|
+
];
|
|
24
41
|
Provider.signer = (p) => {
|
|
25
42
|
switch (p) {
|
|
26
43
|
case "Brave":
|
|
27
44
|
return brave_1.default;
|
|
28
45
|
case "Coinbase":
|
|
29
46
|
return coinbase_1.default;
|
|
30
|
-
case "Ctrl":
|
|
31
|
-
return ctrl_1.default;
|
|
32
47
|
case "DaoDao":
|
|
33
48
|
return daodao_1.default;
|
|
34
49
|
case "Keplr":
|