diff --git a/package.json b/package.json index ba47a426..bbb2666c 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "clean": "rm -rf node_modules dist .output .wrangler" }, "dependencies": { + "@across-protocol/app-sdk": "0.5.0", "@fontsource-variable/ibm-plex-sans": "5.2.8", "@lingui/core": "5.7.0", "@lingui/react": "5.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5acf36e8..8f499e74 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,9 @@ importers: .: dependencies: + '@across-protocol/app-sdk': + specifier: 0.5.0 + version: 0.5.0(viem@2.42.1(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)(zod@4.3.4)) '@fontsource-variable/ibm-plex-sans': specifier: 5.2.8 version: 5.2.8 @@ -194,6 +197,12 @@ importers: packages: + '@across-protocol/app-sdk@0.5.0': + resolution: {integrity: sha512-UGDihGXbLZvIata9KMGK7Ik50DLn489bE/P64RztrfrHy9jXsmiKuwKz9q0hCI83YsUlk+quoxjiT2e7P+iZYA==} + engines: {node: '>=18.0.0'} + peerDependencies: + viem: ^2.31.2 + '@adraffy/ens-normalize@1.11.1': resolution: {integrity: sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==} @@ -7452,6 +7461,10 @@ packages: snapshots: + '@across-protocol/app-sdk@0.5.0(viem@2.42.1(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)(zod@4.3.4))': + dependencies: + viem: 2.42.1(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)(zod@4.3.4) + '@adraffy/ens-normalize@1.11.1': {} '@antfu/ni@25.0.0': diff --git a/src/components/trade/components/global-modals.tsx b/src/components/trade/components/global-modals.tsx index 421a3225..51982df9 100644 --- a/src/components/trade/components/global-modals.tsx +++ b/src/components/trade/components/global-modals.tsx @@ -7,6 +7,7 @@ const GlobalSettingsDialog = createLazyComponent(() => import("./global-settings const SpotSwapModal = createLazyComponent(() => import("./spot-swap-modal"), "SpotSwapModal"); const CommandMenu = createLazyComponent(() => import("./command-menu"), "CommandMenu"); const PointsModal = createLazyComponent(() => import("../tradebox/points-modal"), "PointsModal"); +const AcrossBridgeModal = createLazyComponent(() => import("../tradebox/across-bridge-modal"), "AcrossBridgeModal"); export function GlobalModals() { return ( @@ -17,6 +18,7 @@ export function GlobalModals() { + ); } diff --git a/src/components/trade/header/top-nav.tsx b/src/components/trade/header/top-nav.tsx index c7409ffa..4de592eb 100644 --- a/src/components/trade/header/top-nav.tsx +++ b/src/components/trade/header/top-nav.tsx @@ -1,11 +1,12 @@ import { t } from "@lingui/core/macro"; import { Trans } from "@lingui/react/macro"; -import { DownloadSimpleIcon, DropIcon, GearIcon, TrophyIcon } from "@phosphor-icons/react"; +import { ArrowsLeftRightIcon, DownloadSimpleIcon, DropIcon, GearIcon, TrophyIcon } from "@phosphor-icons/react"; import { useConnection } from "wagmi"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/cn"; import { useExchangeScope } from "@/providers/exchange-scope"; import { + useAcrossBridgeModalActions, useDepositModalActions, useFaucetModalActions, usePointsModalActions, @@ -35,6 +36,7 @@ export function TopNav() { const { open: openFaucetModal } = useFaucetModalActions(); const { open: openPointsModal } = usePointsModalActions(); const { open: openSettingsDialog } = useSettingsDialogActions(); + const { open: openAcrossBridge } = useAcrossBridgeModalActions(); const { isConnected } = useConnection(); const { scope } = useExchangeScope(); @@ -69,7 +71,7 @@ export function TopNav() { Points - {isTestnet ? ( + {isTestnet && ( - ) : ( + )} + {!isTestnet && ( )} + {!isTestnet && ( + + )} )} diff --git a/src/components/trade/tradebox/across-bridge-modal.tsx b/src/components/trade/tradebox/across-bridge-modal.tsx new file mode 100644 index 00000000..d89cf6be --- /dev/null +++ b/src/components/trade/tradebox/across-bridge-modal.tsx @@ -0,0 +1,478 @@ +import type { AcrossClient } from "@across-protocol/app-sdk"; +import type { SwapApiToken } from "@across-protocol/app-sdk/dist/actions/index.js"; +import { t } from "@lingui/core/macro"; +import { Trans } from "@lingui/react/macro"; +import { CheckIcon, CopyIcon, SpinnerGapIcon, WarningCircleIcon } from "@phosphor-icons/react"; +import { useEffect, useMemo, useState } from "react"; +import type { Address } from "viem"; +import { formatUnits, parseUnits } from "viem"; +import { useConnection } from "wagmi"; +import { arbitrum, base, mainnet } from "wagmi/chains"; +import { Button } from "@/components/ui/button"; +import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"; +import { InfoRow, InfoRowGroup } from "@/components/ui/info-row"; +import { NumberInput } from "@/components/ui/number-input"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { cn } from "@/lib/cn"; +import { useAcrossBridgeModalActions, useAcrossBridgeModalOpen } from "@/stores/use-global-modal-store"; + +const HYPER_CORE_CHAIN_ID = 1337; + +const USDC_PERPS = { + address: "0x2100000000000000000000000000000000000000" as Address, + symbol: "USDC", + decimals: 8, +}; + +const COUNTERFACTUAL_CHAINS = [ + { id: mainnet.id, name: "Ethereum", shortName: "ETH" }, + { id: arbitrum.id, name: "Arbitrum", shortName: "ARB" }, + { id: base.id, name: "Base", shortName: "BASE" }, +] as const; + +const POPULAR_SYMBOLS = new Set(["USDC", "USDT", "USDT0", "ETH", "WETH", "WBTC", "DAI", "cbBTC"]); + +const INTEGRATOR_ID = (import.meta.env.VITE_ACROSS_INTEGRATOR_ID ?? "0xdead") as `0x${string}`; +const ACROSS_API_KEY = import.meta.env.VITE_ACROSS_API_KEY as string | undefined; +const ACROSS_API_BASE = "https://app.across.to/api"; + +type ModalView = "loading" | "form" | "generating" | "address" | "error"; + +interface CounterfactualResponse { + depositAddress: `0x${string}`; + expectedOutputAmount: string; + minOutputAmount?: string; + fees?: { total?: { pct?: string } }; + expiresAt?: number; + expectedFillTime?: number; +} + +async function fetchCounterfactual(params: { + inputToken: string; + outputToken: string; + originChainId: number; + destinationChainId: number; + amount: bigint; + recipient: string; + refundAddress: string; +}): Promise { + if (!ACROSS_API_KEY) throw new Error("Across API key not configured"); + + const search = new URLSearchParams({ + useDepositAddress: "true", + inputToken: params.inputToken, + outputToken: params.outputToken, + originChainId: String(params.originChainId), + destinationChainId: String(params.destinationChainId), + amount: params.amount.toString(), + recipient: params.recipient, + refundAddress: params.refundAddress, + integratorId: INTEGRATOR_ID, + }); + + const res = await fetch(`${ACROSS_API_BASE}/swap/counterfactual?${search.toString()}`, { + headers: { Authorization: `Bearer ${ACROSS_API_KEY}` }, + }); + if (!res.ok) { + const body = await res.json().catch(() => null); + throw new Error(body?.message ?? `Across API error (${res.status})`); + } + return res.json(); +} + +export function AcrossBridgeModal() { + const isOpen = useAcrossBridgeModalOpen(); + if (!isOpen) return null; + return ; +} + +function AcrossBridgeModalContent() { + const { close } = useAcrossBridgeModalActions(); + const { address: recipientAddress } = useConnection(); + + const [acrossClient, setAcrossClient] = useState(null); + const [sourceTokens, setSourceTokens] = useState([]); + const [isLoadingTokens, setIsLoadingTokens] = useState(false); + + const [selectedChainId, setSelectedChainId] = useState(arbitrum.id); + const [selectedTokenAddress, setSelectedTokenAddress] = useState(""); + const [amount, setAmount] = useState(""); + const [recipientOverride, setRecipientOverride] = useState(""); + + const [view, setView] = useState("loading"); + const [error, setError] = useState(null); + const [deposit, setDeposit] = useState(null); + const [copied, setCopied] = useState(false); + + const finalRecipient = (recipientOverride || recipientAddress || "") as `0x${string}` | ""; + + useEffect(() => { + let cancelled = false; + import("@across-protocol/app-sdk") + .then(async ({ createAcrossClient }) => { + const client = createAcrossClient({ + integratorId: INTEGRATOR_ID, + chains: [mainnet, arbitrum, base], + }); + if (cancelled) return; + setAcrossClient(client); + try { + const tokens = await client.getSwapTokens({ chainId: arbitrum.id }); + if (cancelled) return; + const popular = tokens.filter((tok) => POPULAR_SYMBOLS.has(tok.symbol)); + setSourceTokens(popular); + if (popular.length > 0) setSelectedTokenAddress(popular[0].address); + setView("form"); + } catch { + if (cancelled) return; + setError(t`Unable to load bridge routes. Please try again.`); + setView("error"); + } + }) + .catch(() => { + if (cancelled) return; + setError(t`Unable to load bridge module. Please try again.`); + setView("error"); + }); + return () => { + cancelled = true; + }; + }, []); + + async function handleChainChange(chainId: number) { + if (!acrossClient) return; + setSelectedChainId(chainId); + setSelectedTokenAddress(""); + setIsLoadingTokens(true); + try { + const tokens = await acrossClient.getSwapTokens({ chainId }); + const popular = tokens.filter((tok) => POPULAR_SYMBOLS.has(tok.symbol)); + setSourceTokens(popular); + if (popular.length > 0) setSelectedTokenAddress(popular[0].address); + } catch { + setSourceTokens([]); + } finally { + setIsLoadingTokens(false); + } + } + + const selectedToken = sourceTokens.find((tok) => tok.address === selectedTokenAddress); + const tokenDecimals = selectedToken?.decimals ?? 6; + const amountValue = parseFloat(amount) || 0; + const isValidRecipient = /^0x[0-9a-fA-F]{40}$/.test(finalRecipient); + const canGenerate = !!selectedTokenAddress && amountValue > 0 && isValidRecipient && !!ACROSS_API_KEY; + + async function handleGenerate() { + if (!selectedTokenAddress || !isValidRecipient) return; + setView("generating"); + setError(null); + + try { + const response = await fetchCounterfactual({ + inputToken: selectedTokenAddress, + outputToken: USDC_PERPS.address, + originChainId: selectedChainId, + destinationChainId: HYPER_CORE_CHAIN_ID, + amount: parseUnits(amount, tokenDecimals), + recipient: finalRecipient, + refundAddress: recipientAddress || finalRecipient, + }); + setDeposit(response); + setView("address"); + } catch (err) { + setError(err instanceof Error ? err.message : t`Failed to generate deposit address`); + setView("error"); + } + } + + function handleReset() { + setDeposit(null); + setError(null); + setView("form"); + } + + async function handleCopy() { + if (!deposit) return; + await navigator.clipboard.writeText(deposit.depositAddress); + setCopied(true); + setTimeout(() => setCopied(false), 1500); + } + + const expectedOutput = deposit ? formatUnits(BigInt(deposit.expectedOutputAmount), USDC_PERPS.decimals) : ""; + const feePct = deposit?.fees?.total?.pct !== undefined ? Number(deposit.fees.total.pct) / 1e16 : null; + const selectedChainName = COUNTERFACTUAL_CHAINS.find((c) => c.id === selectedChainId)?.name ?? ""; + + return ( + + + + + Deposit via Across + + + +
+ {!ACROSS_API_KEY && ( +
+ +

+ Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment. +

+
+ )} + + {view === "loading" && ( +
+ +

+ Loading bridge routes... +

+
+ )} + + {view === "generating" && ( +
+ +

+ Generating deposit address... +

+
+ )} + + {view === "error" && ( +
+
+ +
+

{error}

+
+ + +
+
+ )} + + {view === "address" && deposit && ( + + )} + + {view === "form" && ( +
+
+
+ + From + + +
+
+ + setAmount(e.target.value)} + className="flex-1 h-9 text-base font-medium bg-transparent border-border-200/40 focus:border-primary-default/60 tabular-nums text-right" + /> +
+
+ +
+ + Hyperliquid account + + setRecipientOverride(e.target.value)} + className={cn( + "w-full h-9 px-2 text-xs bg-transparent border rounded-xs tabular-nums outline-none transition-colors", + isValidRecipient + ? "border-border-200/40 focus:border-primary-default/60" + : "border-market-down-600/40 focus:border-market-down-600", + )} + /> +

+ Funds will arrive directly in this account's trading balance. +

+
+ + + +

+ + You'll get an address to send {selectedToken?.symbol || "tokens"} from any wallet — no signing + required. + +

+
+ )} +
+
+
+ ); +} + +interface AddressViewProps { + deposit: CounterfactualResponse; + expectedOutput: string; + sourceSymbol: string; + sourceChainName: string; + amount: string; + feePct: number | null; + copied: boolean; + onCopy: () => void; + onNew: () => void; + onClose: () => void; +} + +function AddressView({ + deposit, + expectedOutput, + sourceSymbol, + sourceChainName, + amount, + feePct, + copied, + onCopy, + onNew, + onClose, +}: AddressViewProps) { + const expiresAt = deposit.expiresAt ? deposit.expiresAt * 1000 : null; + const [now, setNow] = useState(() => Date.now()); + + useEffect(() => { + const timer = setInterval(() => setNow(Date.now()), 1000); + return () => clearInterval(timer); + }, []); + + const timeLeft = useMemo(() => { + if (!expiresAt) return null; + const diff = Math.max(0, expiresAt - now); + const mins = Math.floor(diff / 60000); + const secs = Math.floor((diff % 60000) / 1000); + return { diff, label: `${mins}:${secs.toString().padStart(2, "0")}` }; + }, [expiresAt, now]); + + const expired = timeLeft?.diff === 0; + + return ( +
+
+
+ + Deposit address + + + on {sourceChainName} + +
+
+ {deposit.depositAddress} + +
+
+ + + Send exactly} value={`${amount} ${sourceSymbol}`} /> + You receive} + value={expectedOutput ? `~${parseFloat(expectedOutput).toFixed(4)} ${USDC_PERPS.symbol}` : "—"} + /> + {feePct !== null && Fee} value={`${feePct.toFixed(3)}%`} />} + {deposit.expectedFillTime !== undefined && ( + Est. fill time} value={`~${deposit.expectedFillTime}s`} /> + )} + {timeLeft && ( + Address expires in} + value={expired ? t`Expired` : timeLeft.label} + valueClassName={cn("tabular-nums", expired && "text-market-down-600")} + /> + )} + + +
+ +

+ + Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause + loss of funds. + +

+
+ +
+ + +
+ +

+ Your {USDC_PERPS.symbol} will arrive directly in your Hyperliquid trading balance once confirmed. +

+
+ ); +} + +export default AcrossBridgeModal; diff --git a/src/locales/ar/messages.po b/src/locales/ar/messages.po index d25d01b0..8f9c4216 100644 --- a/src/locales/ar/messages.po +++ b/src/locales/ar/messages.po @@ -53,6 +53,10 @@ msgstr "الحساب" msgid "Account Balances" msgstr "أرصدة الحساب" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment." +msgstr "" + #: src/components/trade/positions/balances-tab.tsx #: src/components/trade/positions/orders-tab.tsx #: src/components/trade/positions/positions-tab.tsx @@ -88,6 +92,10 @@ msgstr "إضافة إلى المفضلة" msgid "Add TP/SL" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Address expires in" +msgstr "" + #: src/components/trade/tradebox/advanced-order-dropdown.tsx msgid "Advanced order types" msgstr "" @@ -185,6 +193,10 @@ msgstr "الرصيد" #~ msgid "Breadcrumb" #~ msgstr "مسار التنقل" +#: src/components/trade/header/top-nav.tsx +msgid "Bridge" +msgstr "" + #: src/components/trade/order-entry/deposit-modal.tsx #~ msgid "Bridge USDC from Arbitrum or other chains to your Hyperliquid account." #~ msgstr "قم بتحويل USDC من Arbitrum أو سلاسل أخرى إلى حساب Hyperliquid الخاص بك." @@ -312,6 +324,7 @@ msgid "Claiming USDH..." msgstr "" #: src/components/trade/positions/position-actions-dropdown.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/ui/dialog.tsx #: src/components/ui/sheet.tsx @@ -492,6 +505,10 @@ msgstr "" msgid "Deposit" msgstr "إيداع" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit address" +msgstr "" + #: src/components/trade/tradebox/deposit-modal.tsx msgid "Deposit complete" msgstr "" @@ -512,6 +529,10 @@ msgstr "" msgid "Deposit USDH or use Faucet" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit via Across" +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Destination" msgstr "" @@ -554,6 +575,10 @@ msgstr "يعرض الشريط الجانبي للجوال." msgid "Done" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Done — I've sent funds" +msgstr "" + #: src/components/trade/tradebox/trade-form-fields.tsx msgid "Duration (Minutes)" msgstr "" @@ -629,6 +654,10 @@ msgstr "حقوق الملكية" msgid "Est. Fee" msgstr "الرسوم المقدرة" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Est. fill time" +msgstr "" + #: src/components/trade/order-entry/tp-sl-section.tsx #: src/components/trade/order-entry/tp-sl-section.tsx #~ msgid "Est. P&L" @@ -655,6 +684,10 @@ msgstr "" #~ msgid "Expand account panel" #~ msgstr "توسيع لوحة الحساب" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Expired" +msgstr "" + #: src/components/trade/tradebox/order-toast.tsx msgid "failed" msgstr "فشل" @@ -671,6 +704,10 @@ msgstr "" msgid "Failed to enable trading" msgstr "فشل تفعيل التداول" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Failed to generate deposit address" +msgstr "" + #: src/components/trade/positions/balances-tab.tsx msgid "Failed to load balances." msgstr "فشل في تحميل الأرصدة." @@ -730,6 +767,7 @@ msgid "Faucet" msgstr "" #: src/components/trade/positions/history-tab.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx msgid "Fee" msgstr "الرسوم" @@ -755,6 +793,7 @@ msgid "Format for numbers and dates" msgstr "" #: src/components/trade/components/spot-swap-modal.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx msgid "From" msgstr "" @@ -776,10 +815,26 @@ msgstr "" #~ msgid "Funding Payments" #~ msgstr "مدفوعات التمويل" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Funds will arrive directly in this account's trading balance." +msgstr "" + #: src/components/trade/footer/footer-bar.tsx #~ msgid "Gas:" #~ msgstr "الغاز:" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate deposit address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate new address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generating deposit address..." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx msgid "Get Started" msgstr "" @@ -805,6 +860,10 @@ msgstr "" msgid "How to earn" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Hyperliquid account" +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx @@ -940,6 +999,10 @@ msgstr "جارٍ التحميل" msgid "Loading balances..." msgstr "جارٍ تحميل الأرصدة..." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Loading bridge routes..." +msgstr "" + #: src/components/trade/positions/funding-tab.tsx msgid "Loading funding history..." msgstr "جارٍ تحميل سجل التمويل..." @@ -1149,6 +1212,10 @@ msgstr "" msgid "NEW" msgstr "جديد" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "New deposit" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "New to wallets?" #~ msgstr "" @@ -1264,6 +1331,10 @@ msgstr "" msgid "OI" msgstr "العقود المفتوحة" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "on" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "Only you control your funds. No email or password required." #~ msgstr "" @@ -1500,6 +1571,7 @@ msgstr "إزالة من المفضلة" #~ msgid "Requirements:" #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/faucet-modal.tsx @@ -1601,6 +1673,14 @@ msgstr "بيع" msgid "Send" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause loss of funds." +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Send failed" msgstr "" @@ -2130,6 +2210,14 @@ msgstr "النوع" #~ msgid "Unable to close position." #~ msgstr "تعذر إغلاق المركز." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge module. Please try again." +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge routes. Please try again." +msgstr "" + #: src/lib/errors/format.ts msgid "Unknown error" msgstr "" @@ -2270,6 +2358,20 @@ msgstr "" #~ msgid "You can revoke permissions at any time by registering a new approval with 0% fee rate. Builder codes are processed entirely onchain as part of the fee logic." #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You receive" +msgstr "" + +#. placeholder {0}: selectedToken?.symbol || "tokens" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You'll get an address to send {0} from any wallet — no signing required." +msgstr "" + +#. placeholder {0}: USDC_PERPS.symbol +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Your {0} will arrive directly in your Hyperliquid trading balance once confirmed." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #~ msgid "Your Referral Code" #~ msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index 6c76bf10..0081deb9 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -53,6 +53,10 @@ msgstr "Account" msgid "Account Balances" msgstr "Account Balances" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment." +msgstr "Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment." + #: src/components/trade/positions/balances-tab.tsx #: src/components/trade/positions/orders-tab.tsx #: src/components/trade/positions/positions-tab.tsx @@ -88,6 +92,10 @@ msgstr "Add to favorites" msgid "Add TP/SL" msgstr "Add TP/SL" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Address expires in" +msgstr "Address expires in" + #: src/components/trade/tradebox/advanced-order-dropdown.tsx msgid "Advanced order types" msgstr "Advanced order types" @@ -185,6 +193,10 @@ msgstr "Balance" #~ msgid "Breadcrumb" #~ msgstr "Breadcrumb" +#: src/components/trade/header/top-nav.tsx +msgid "Bridge" +msgstr "Bridge" + #: src/components/trade/order-entry/deposit-modal.tsx #~ msgid "Bridge USDC from Arbitrum or other chains to your Hyperliquid account." #~ msgstr "Bridge USDC from Arbitrum or other chains to your Hyperliquid account." @@ -312,6 +324,7 @@ msgid "Claiming USDH..." msgstr "Claiming USDH..." #: src/components/trade/positions/position-actions-dropdown.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/ui/dialog.tsx #: src/components/ui/sheet.tsx @@ -493,6 +506,10 @@ msgstr "Current" msgid "Deposit" msgstr "Deposit" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit address" +msgstr "Deposit address" + #: src/components/trade/tradebox/deposit-modal.tsx msgid "Deposit complete" msgstr "Deposit complete" @@ -513,6 +530,10 @@ msgstr "Deposit failed" msgid "Deposit USDH or use Faucet" msgstr "Deposit USDH or use Faucet" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit via Across" +msgstr "Deposit via Across" + #: src/components/trade/positions/send-dialog.tsx msgid "Destination" msgstr "Destination" @@ -555,6 +576,10 @@ msgstr "Displays the mobile sidebar." msgid "Done" msgstr "Done" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Done — I've sent funds" +msgstr "Done — I've sent funds" + #: src/components/trade/tradebox/trade-form-fields.tsx msgid "Duration (Minutes)" msgstr "Duration (Minutes)" @@ -630,6 +655,10 @@ msgstr "Equity" msgid "Est. Fee" msgstr "Est. Fee" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Est. fill time" +msgstr "Est. fill time" + #: src/components/trade/order-entry/tp-sl-section.tsx #: src/components/trade/order-entry/tp-sl-section.tsx #~ msgid "Est. P&L" @@ -656,6 +685,10 @@ msgstr "Execution" #~ msgid "Expand account panel" #~ msgstr "Expand account panel" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Expired" +msgstr "Expired" + #: src/components/trade/tradebox/order-toast.tsx msgid "failed" msgstr "failed" @@ -672,6 +705,10 @@ msgstr "Failed to copy" msgid "Failed to enable trading" msgstr "Failed to enable trading" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Failed to generate deposit address" +msgstr "Failed to generate deposit address" + #: src/components/trade/positions/balances-tab.tsx msgid "Failed to load balances." msgstr "Failed to load balances." @@ -731,6 +768,7 @@ msgid "Faucet" msgstr "Faucet" #: src/components/trade/positions/history-tab.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx msgid "Fee" msgstr "Fee" @@ -756,6 +794,7 @@ msgid "Format for numbers and dates" msgstr "Format for numbers and dates" #: src/components/trade/components/spot-swap-modal.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx msgid "From" msgstr "From" @@ -777,10 +816,26 @@ msgstr "Funding History" #~ msgid "Funding Payments" #~ msgstr "Funding Payments" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Funds will arrive directly in this account's trading balance." +msgstr "Funds will arrive directly in this account's trading balance." + #: src/components/trade/footer/footer-bar.tsx #~ msgid "Gas:" #~ msgstr "Gas:" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate deposit address" +msgstr "Generate deposit address" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate new address" +msgstr "Generate new address" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generating deposit address..." +msgstr "Generating deposit address..." + #: src/components/trade/tradebox/points-modal.tsx msgid "Get Started" msgstr "Get Started" @@ -806,6 +861,10 @@ msgstr "Hide small" msgid "How to earn" msgstr "How to earn" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Hyperliquid account" +msgstr "Hyperliquid account" + #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx @@ -946,6 +1005,10 @@ msgstr "Loading" msgid "Loading balances..." msgstr "Loading balances..." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Loading bridge routes..." +msgstr "Loading bridge routes..." + #: src/components/trade/positions/funding-tab.tsx msgid "Loading funding history..." msgstr "Loading funding history..." @@ -1156,6 +1219,10 @@ msgstr "Network fee" msgid "NEW" msgstr "NEW" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "New deposit" +msgstr "New deposit" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "New to wallets?" #~ msgstr "New to wallets?" @@ -1273,6 +1340,10 @@ msgstr "Offline" msgid "OI" msgstr "OI" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "on" +msgstr "on" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "Only you control your funds. No email or password required." #~ msgstr "Only you control your funds. No email or password required." @@ -1509,6 +1580,7 @@ msgstr "Remove from favorites" #~ msgid "Requirements:" #~ msgstr "Requirements:" +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/faucet-modal.tsx @@ -1610,6 +1682,14 @@ msgstr "Sell" msgid "Send" msgstr "Send" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly" +msgstr "Send exactly" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause loss of funds." +msgstr "Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause loss of funds." + #: src/components/trade/positions/send-dialog.tsx msgid "Send failed" msgstr "Send failed" @@ -2143,6 +2223,14 @@ msgstr "Type" #~ msgid "Unable to close position." #~ msgstr "Unable to close position." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge module. Please try again." +msgstr "Unable to load bridge module. Please try again." + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge routes. Please try again." +msgstr "Unable to load bridge routes. Please try again." + #: src/lib/errors/format.ts msgid "Unknown error" msgstr "Unknown error" @@ -2283,6 +2371,20 @@ msgstr "Yes" #~ msgid "You can revoke permissions at any time by registering a new approval with 0% fee rate. Builder codes are processed entirely onchain as part of the fee logic." #~ msgstr "You can revoke permissions at any time by registering a new approval with 0% fee rate. Builder codes are processed entirely onchain as part of the fee logic." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You receive" +msgstr "You receive" + +#. placeholder {0}: selectedToken?.symbol || "tokens" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You'll get an address to send {0} from any wallet — no signing required." +msgstr "You'll get an address to send {0} from any wallet — no signing required." + +#. placeholder {0}: USDC_PERPS.symbol +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Your {0} will arrive directly in your Hyperliquid trading balance once confirmed." +msgstr "Your {0} will arrive directly in your Hyperliquid trading balance once confirmed." + #: src/components/trade/tradebox/points-modal.tsx #~ msgid "Your Referral Code" #~ msgstr "Your Referral Code" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 7cd4202a..fa77821c 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -53,6 +53,10 @@ msgstr "Cuenta" msgid "Account Balances" msgstr "Saldos de cuenta" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment." +msgstr "" + #: src/components/trade/positions/balances-tab.tsx #: src/components/trade/positions/orders-tab.tsx #: src/components/trade/positions/positions-tab.tsx @@ -88,6 +92,10 @@ msgstr "Agregar a favoritos" msgid "Add TP/SL" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Address expires in" +msgstr "" + #: src/components/trade/tradebox/advanced-order-dropdown.tsx msgid "Advanced order types" msgstr "" @@ -185,6 +193,10 @@ msgstr "Saldo" #~ msgid "Breadcrumb" #~ msgstr "Ruta de navegación" +#: src/components/trade/header/top-nav.tsx +msgid "Bridge" +msgstr "" + #: src/components/trade/order-entry/deposit-modal.tsx #~ msgid "Bridge USDC from Arbitrum or other chains to your Hyperliquid account." #~ msgstr "Transfiere USDC desde Arbitrum u otras cadenas a tu cuenta Hyperliquid." @@ -312,6 +324,7 @@ msgid "Claiming USDH..." msgstr "" #: src/components/trade/positions/position-actions-dropdown.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/ui/dialog.tsx #: src/components/ui/sheet.tsx @@ -492,6 +505,10 @@ msgstr "" msgid "Deposit" msgstr "Depositar" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit address" +msgstr "" + #: src/components/trade/tradebox/deposit-modal.tsx msgid "Deposit complete" msgstr "" @@ -512,6 +529,10 @@ msgstr "" msgid "Deposit USDH or use Faucet" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit via Across" +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Destination" msgstr "" @@ -554,6 +575,10 @@ msgstr "Muestra la barra lateral móvil." msgid "Done" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Done — I've sent funds" +msgstr "" + #: src/components/trade/tradebox/trade-form-fields.tsx msgid "Duration (Minutes)" msgstr "" @@ -629,6 +654,10 @@ msgstr "Patrimonio" msgid "Est. Fee" msgstr "Comisión est." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Est. fill time" +msgstr "" + #: src/components/trade/order-entry/tp-sl-section.tsx #: src/components/trade/order-entry/tp-sl-section.tsx #~ msgid "Est. P&L" @@ -655,6 +684,10 @@ msgstr "" #~ msgid "Expand account panel" #~ msgstr "Expandir panel de cuenta" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Expired" +msgstr "" + #: src/components/trade/tradebox/order-toast.tsx msgid "failed" msgstr "fallido" @@ -671,6 +704,10 @@ msgstr "" msgid "Failed to enable trading" msgstr "Error al habilitar trading" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Failed to generate deposit address" +msgstr "" + #: src/components/trade/positions/balances-tab.tsx msgid "Failed to load balances." msgstr "Error al cargar saldos." @@ -730,6 +767,7 @@ msgid "Faucet" msgstr "" #: src/components/trade/positions/history-tab.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx msgid "Fee" msgstr "Comisión" @@ -755,6 +793,7 @@ msgid "Format for numbers and dates" msgstr "" #: src/components/trade/components/spot-swap-modal.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx msgid "From" msgstr "" @@ -776,10 +815,26 @@ msgstr "" #~ msgid "Funding Payments" #~ msgstr "Pagos de financiamiento" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Funds will arrive directly in this account's trading balance." +msgstr "" + #: src/components/trade/footer/footer-bar.tsx #~ msgid "Gas:" #~ msgstr "Gas:" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate deposit address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate new address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generating deposit address..." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx msgid "Get Started" msgstr "" @@ -805,6 +860,10 @@ msgstr "" msgid "How to earn" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Hyperliquid account" +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx @@ -940,6 +999,10 @@ msgstr "Cargando" msgid "Loading balances..." msgstr "Cargando saldos..." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Loading bridge routes..." +msgstr "" + #: src/components/trade/positions/funding-tab.tsx msgid "Loading funding history..." msgstr "Cargando historial de financiamiento..." @@ -1149,6 +1212,10 @@ msgstr "" msgid "NEW" msgstr "NUEVO" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "New deposit" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "New to wallets?" #~ msgstr "" @@ -1264,6 +1331,10 @@ msgstr "" msgid "OI" msgstr "IA" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "on" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "Only you control your funds. No email or password required." #~ msgstr "" @@ -1500,6 +1571,7 @@ msgstr "Quitar de favoritos" #~ msgid "Requirements:" #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/faucet-modal.tsx @@ -1601,6 +1673,14 @@ msgstr "Vender" msgid "Send" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause loss of funds." +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Send failed" msgstr "" @@ -2130,6 +2210,14 @@ msgstr "Tipo" #~ msgid "Unable to close position." #~ msgstr "No se puede cerrar la posición." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge module. Please try again." +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge routes. Please try again." +msgstr "" + #: src/lib/errors/format.ts msgid "Unknown error" msgstr "" @@ -2270,6 +2358,20 @@ msgstr "" #~ msgid "You can revoke permissions at any time by registering a new approval with 0% fee rate. Builder codes are processed entirely onchain as part of the fee logic." #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You receive" +msgstr "" + +#. placeholder {0}: selectedToken?.symbol || "tokens" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You'll get an address to send {0} from any wallet — no signing required." +msgstr "" + +#. placeholder {0}: USDC_PERPS.symbol +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Your {0} will arrive directly in your Hyperliquid trading balance once confirmed." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #~ msgid "Your Referral Code" #~ msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 9ecfc91b..4510c997 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -53,6 +53,10 @@ msgstr "Compte" msgid "Account Balances" msgstr "Soldes du compte" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment." +msgstr "" + #: src/components/trade/positions/balances-tab.tsx #: src/components/trade/positions/orders-tab.tsx #: src/components/trade/positions/positions-tab.tsx @@ -88,6 +92,10 @@ msgstr "Ajouter aux favoris" msgid "Add TP/SL" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Address expires in" +msgstr "" + #: src/components/trade/tradebox/advanced-order-dropdown.tsx msgid "Advanced order types" msgstr "" @@ -185,6 +193,10 @@ msgstr "Solde" #~ msgid "Breadcrumb" #~ msgstr "Fil d'Ariane" +#: src/components/trade/header/top-nav.tsx +msgid "Bridge" +msgstr "" + #: src/components/trade/order-entry/deposit-modal.tsx #~ msgid "Bridge USDC from Arbitrum or other chains to your Hyperliquid account." #~ msgstr "Transférez des USDC depuis Arbitrum ou d'autres chaînes vers votre compte Hyperliquid." @@ -312,6 +324,7 @@ msgid "Claiming USDH..." msgstr "" #: src/components/trade/positions/position-actions-dropdown.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/ui/dialog.tsx #: src/components/ui/sheet.tsx @@ -492,6 +505,10 @@ msgstr "" msgid "Deposit" msgstr "Déposer" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit address" +msgstr "" + #: src/components/trade/tradebox/deposit-modal.tsx msgid "Deposit complete" msgstr "" @@ -512,6 +529,10 @@ msgstr "" msgid "Deposit USDH or use Faucet" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit via Across" +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Destination" msgstr "" @@ -554,6 +575,10 @@ msgstr "Affiche la barre latérale mobile." msgid "Done" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Done — I've sent funds" +msgstr "" + #: src/components/trade/tradebox/trade-form-fields.tsx msgid "Duration (Minutes)" msgstr "" @@ -629,6 +654,10 @@ msgstr "Capitaux propres" msgid "Est. Fee" msgstr "Frais est." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Est. fill time" +msgstr "" + #: src/components/trade/order-entry/tp-sl-section.tsx #: src/components/trade/order-entry/tp-sl-section.tsx #~ msgid "Est. P&L" @@ -655,6 +684,10 @@ msgstr "" #~ msgid "Expand account panel" #~ msgstr "Développer le panneau du compte" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Expired" +msgstr "" + #: src/components/trade/tradebox/order-toast.tsx msgid "failed" msgstr "échoué" @@ -671,6 +704,10 @@ msgstr "" msgid "Failed to enable trading" msgstr "Échec de l'activation du trading" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Failed to generate deposit address" +msgstr "" + #: src/components/trade/positions/balances-tab.tsx msgid "Failed to load balances." msgstr "Échec du chargement des soldes." @@ -730,6 +767,7 @@ msgid "Faucet" msgstr "" #: src/components/trade/positions/history-tab.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx msgid "Fee" msgstr "Frais" @@ -755,6 +793,7 @@ msgid "Format for numbers and dates" msgstr "" #: src/components/trade/components/spot-swap-modal.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx msgid "From" msgstr "" @@ -776,10 +815,26 @@ msgstr "" #~ msgid "Funding Payments" #~ msgstr "Paiements de financement" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Funds will arrive directly in this account's trading balance." +msgstr "" + #: src/components/trade/footer/footer-bar.tsx #~ msgid "Gas:" #~ msgstr "Gas :" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate deposit address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate new address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generating deposit address..." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx msgid "Get Started" msgstr "" @@ -805,6 +860,10 @@ msgstr "" msgid "How to earn" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Hyperliquid account" +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx @@ -940,6 +999,10 @@ msgstr "Chargement" msgid "Loading balances..." msgstr "Chargement des soldes..." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Loading bridge routes..." +msgstr "" + #: src/components/trade/positions/funding-tab.tsx msgid "Loading funding history..." msgstr "Chargement de l'historique de financement..." @@ -1149,6 +1212,10 @@ msgstr "" msgid "NEW" msgstr "NOUVEAU" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "New deposit" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "New to wallets?" #~ msgstr "" @@ -1264,6 +1331,10 @@ msgstr "" msgid "OI" msgstr "OI" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "on" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "Only you control your funds. No email or password required." #~ msgstr "" @@ -1500,6 +1571,7 @@ msgstr "Retirer des favoris" #~ msgid "Requirements:" #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/faucet-modal.tsx @@ -1601,6 +1673,14 @@ msgstr "Vendre" msgid "Send" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause loss of funds." +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Send failed" msgstr "" @@ -2130,6 +2210,14 @@ msgstr "Type" #~ msgid "Unable to close position." #~ msgstr "Impossible de fermer la position." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge module. Please try again." +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge routes. Please try again." +msgstr "" + #: src/lib/errors/format.ts msgid "Unknown error" msgstr "" @@ -2270,6 +2358,20 @@ msgstr "" #~ msgid "You can revoke permissions at any time by registering a new approval with 0% fee rate. Builder codes are processed entirely onchain as part of the fee logic." #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You receive" +msgstr "" + +#. placeholder {0}: selectedToken?.symbol || "tokens" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You'll get an address to send {0} from any wallet — no signing required." +msgstr "" + +#. placeholder {0}: USDC_PERPS.symbol +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Your {0} will arrive directly in your Hyperliquid trading balance once confirmed." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #~ msgid "Your Referral Code" #~ msgstr "" diff --git a/src/locales/hi/messages.po b/src/locales/hi/messages.po index 9deac9ae..90e7b8c3 100644 --- a/src/locales/hi/messages.po +++ b/src/locales/hi/messages.po @@ -53,6 +53,10 @@ msgstr "खाता" msgid "Account Balances" msgstr "खाता शेष" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment." +msgstr "" + #: src/components/trade/positions/balances-tab.tsx #: src/components/trade/positions/orders-tab.tsx #: src/components/trade/positions/positions-tab.tsx @@ -88,6 +92,10 @@ msgstr "पसंदीदा में जोड़ें" msgid "Add TP/SL" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Address expires in" +msgstr "" + #: src/components/trade/tradebox/advanced-order-dropdown.tsx msgid "Advanced order types" msgstr "" @@ -185,6 +193,10 @@ msgstr "शेष" #~ msgid "Breadcrumb" #~ msgstr "ब्रेडक्रम्ब" +#: src/components/trade/header/top-nav.tsx +msgid "Bridge" +msgstr "" + #: src/components/trade/order-entry/deposit-modal.tsx #~ msgid "Bridge USDC from Arbitrum or other chains to your Hyperliquid account." #~ msgstr "Arbitrum या अन्य चेन से अपने Hyperliquid खाते में USDC ब्रिज करें।" @@ -312,6 +324,7 @@ msgid "Claiming USDH..." msgstr "" #: src/components/trade/positions/position-actions-dropdown.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/ui/dialog.tsx #: src/components/ui/sheet.tsx @@ -492,6 +505,10 @@ msgstr "" msgid "Deposit" msgstr "जमा करें" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit address" +msgstr "" + #: src/components/trade/tradebox/deposit-modal.tsx msgid "Deposit complete" msgstr "" @@ -512,6 +529,10 @@ msgstr "" msgid "Deposit USDH or use Faucet" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit via Across" +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Destination" msgstr "" @@ -554,6 +575,10 @@ msgstr "मोबाइल साइडबार दिखाता है।" msgid "Done" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Done — I've sent funds" +msgstr "" + #: src/components/trade/tradebox/trade-form-fields.tsx msgid "Duration (Minutes)" msgstr "" @@ -629,6 +654,10 @@ msgstr "इक्विटी" msgid "Est. Fee" msgstr "अनु. शुल्क" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Est. fill time" +msgstr "" + #: src/components/trade/order-entry/tp-sl-section.tsx #: src/components/trade/order-entry/tp-sl-section.tsx #~ msgid "Est. P&L" @@ -655,6 +684,10 @@ msgstr "" #~ msgid "Expand account panel" #~ msgstr "खाता पैनल विस्तृत करें" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Expired" +msgstr "" + #: src/components/trade/tradebox/order-toast.tsx msgid "failed" msgstr "विफल" @@ -671,6 +704,10 @@ msgstr "" msgid "Failed to enable trading" msgstr "ट्रेडिंग सक्षम करने में विफल" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Failed to generate deposit address" +msgstr "" + #: src/components/trade/positions/balances-tab.tsx msgid "Failed to load balances." msgstr "शेष लोड करने में विफल।" @@ -730,6 +767,7 @@ msgid "Faucet" msgstr "" #: src/components/trade/positions/history-tab.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx msgid "Fee" msgstr "शुल्क" @@ -755,6 +793,7 @@ msgid "Format for numbers and dates" msgstr "" #: src/components/trade/components/spot-swap-modal.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx msgid "From" msgstr "" @@ -776,10 +815,26 @@ msgstr "" #~ msgid "Funding Payments" #~ msgstr "फंडिंग भुगतान" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Funds will arrive directly in this account's trading balance." +msgstr "" + #: src/components/trade/footer/footer-bar.tsx #~ msgid "Gas:" #~ msgstr "गैस:" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate deposit address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate new address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generating deposit address..." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx msgid "Get Started" msgstr "" @@ -805,6 +860,10 @@ msgstr "" msgid "How to earn" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Hyperliquid account" +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx @@ -940,6 +999,10 @@ msgstr "लोड हो रहा है" msgid "Loading balances..." msgstr "शेष लोड हो रहा है..." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Loading bridge routes..." +msgstr "" + #: src/components/trade/positions/funding-tab.tsx msgid "Loading funding history..." msgstr "फंडिंग इतिहास लोड हो रहा है..." @@ -1149,6 +1212,10 @@ msgstr "" msgid "NEW" msgstr "नया" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "New deposit" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "New to wallets?" #~ msgstr "" @@ -1264,6 +1331,10 @@ msgstr "" msgid "OI" msgstr "OI" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "on" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "Only you control your funds. No email or password required." #~ msgstr "" @@ -1500,6 +1571,7 @@ msgstr "पसंदीदा से हटाएं" #~ msgid "Requirements:" #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/faucet-modal.tsx @@ -1601,6 +1673,14 @@ msgstr "बेचें" msgid "Send" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause loss of funds." +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Send failed" msgstr "" @@ -2130,6 +2210,14 @@ msgstr "प्रकार" #~ msgid "Unable to close position." #~ msgstr "पोजीशन बंद करने में असमर्थ।" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge module. Please try again." +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge routes. Please try again." +msgstr "" + #: src/lib/errors/format.ts msgid "Unknown error" msgstr "" @@ -2270,6 +2358,20 @@ msgstr "" #~ msgid "You can revoke permissions at any time by registering a new approval with 0% fee rate. Builder codes are processed entirely onchain as part of the fee logic." #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You receive" +msgstr "" + +#. placeholder {0}: selectedToken?.symbol || "tokens" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You'll get an address to send {0} from any wallet — no signing required." +msgstr "" + +#. placeholder {0}: USDC_PERPS.symbol +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Your {0} will arrive directly in your Hyperliquid trading balance once confirmed." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #~ msgid "Your Referral Code" #~ msgstr "" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index b905a968..74a7f630 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -53,6 +53,10 @@ msgstr "账户" msgid "Account Balances" msgstr "账户余额" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Across API key is not configured. Set VITE_ACROSS_API_KEY in your environment." +msgstr "" + #: src/components/trade/positions/balances-tab.tsx #: src/components/trade/positions/orders-tab.tsx #: src/components/trade/positions/positions-tab.tsx @@ -88,6 +92,10 @@ msgstr "添加到收藏" msgid "Add TP/SL" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Address expires in" +msgstr "" + #: src/components/trade/tradebox/advanced-order-dropdown.tsx msgid "Advanced order types" msgstr "" @@ -185,6 +193,10 @@ msgstr "余额" #~ msgid "Breadcrumb" #~ msgstr "面包屑导航" +#: src/components/trade/header/top-nav.tsx +msgid "Bridge" +msgstr "" + #: src/components/trade/order-entry/deposit-modal.tsx #~ msgid "Bridge USDC from Arbitrum or other chains to your Hyperliquid account." #~ msgstr "从 Arbitrum 或其他链桥接 USDC 到您的 Hyperliquid 账户。" @@ -312,6 +324,7 @@ msgid "Claiming USDH..." msgstr "" #: src/components/trade/positions/position-actions-dropdown.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/ui/dialog.tsx #: src/components/ui/sheet.tsx @@ -492,6 +505,10 @@ msgstr "" msgid "Deposit" msgstr "存款" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit address" +msgstr "" + #: src/components/trade/tradebox/deposit-modal.tsx msgid "Deposit complete" msgstr "" @@ -512,6 +529,10 @@ msgstr "" msgid "Deposit USDH or use Faucet" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Deposit via Across" +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Destination" msgstr "" @@ -554,6 +575,10 @@ msgstr "显示移动端侧边栏。" msgid "Done" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Done — I've sent funds" +msgstr "" + #: src/components/trade/tradebox/trade-form-fields.tsx msgid "Duration (Minutes)" msgstr "" @@ -629,6 +654,10 @@ msgstr "净值" msgid "Est. Fee" msgstr "预估费用" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Est. fill time" +msgstr "" + #: src/components/trade/order-entry/tp-sl-section.tsx #: src/components/trade/order-entry/tp-sl-section.tsx #~ msgid "Est. P&L" @@ -655,6 +684,10 @@ msgstr "" #~ msgid "Expand account panel" #~ msgstr "展开账户面板" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Expired" +msgstr "" + #: src/components/trade/tradebox/order-toast.tsx msgid "failed" msgstr "失败" @@ -671,6 +704,10 @@ msgstr "" msgid "Failed to enable trading" msgstr "启用交易失败" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Failed to generate deposit address" +msgstr "" + #: src/components/trade/positions/balances-tab.tsx msgid "Failed to load balances." msgstr "加载余额失败。" @@ -730,6 +767,7 @@ msgid "Faucet" msgstr "" #: src/components/trade/positions/history-tab.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx msgid "Fee" msgstr "手续费" @@ -755,6 +793,7 @@ msgid "Format for numbers and dates" msgstr "" #: src/components/trade/components/spot-swap-modal.tsx +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx msgid "From" msgstr "" @@ -776,10 +815,26 @@ msgstr "" #~ msgid "Funding Payments" #~ msgstr "资金费用" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Funds will arrive directly in this account's trading balance." +msgstr "" + #: src/components/trade/footer/footer-bar.tsx #~ msgid "Gas:" #~ msgstr "Gas:" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate deposit address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generate new address" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Generating deposit address..." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx msgid "Get Started" msgstr "" @@ -805,6 +860,10 @@ msgstr "" msgid "How to earn" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Hyperliquid account" +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx #: src/components/trade/tradebox/points-modal.tsx @@ -940,6 +999,10 @@ msgstr "加载中" msgid "Loading balances..." msgstr "加载余额中..." +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Loading bridge routes..." +msgstr "" + #: src/components/trade/positions/funding-tab.tsx msgid "Loading funding history..." msgstr "加载资金费用历史中..." @@ -1149,6 +1212,10 @@ msgstr "" msgid "NEW" msgstr "新" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "New deposit" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "New to wallets?" #~ msgstr "" @@ -1264,6 +1331,10 @@ msgstr "" msgid "OI" msgstr "持仓量" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "on" +msgstr "" + #: src/components/trade/components/wallet-dialog.tsx #~ msgid "Only you control your funds. No email or password required." #~ msgstr "" @@ -1500,6 +1571,7 @@ msgstr "从收藏中移除" #~ msgid "Requirements:" #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/deposit-modal.tsx #: src/components/trade/tradebox/faucet-modal.tsx @@ -1601,6 +1673,14 @@ msgstr "卖出" msgid "Send" msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly" +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Send exactly {amount} {sourceSymbol} on {sourceChainName} to this address. Other amounts or chains may cause loss of funds." +msgstr "" + #: src/components/trade/positions/send-dialog.tsx msgid "Send failed" msgstr "" @@ -2130,6 +2210,14 @@ msgstr "类型" #~ msgid "Unable to close position." #~ msgstr "无法平仓。" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge module. Please try again." +msgstr "" + +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Unable to load bridge routes. Please try again." +msgstr "" + #: src/lib/errors/format.ts msgid "Unknown error" msgstr "" @@ -2270,6 +2358,20 @@ msgstr "" #~ msgid "You can revoke permissions at any time by registering a new approval with 0% fee rate. Builder codes are processed entirely onchain as part of the fee logic." #~ msgstr "" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You receive" +msgstr "" + +#. placeholder {0}: selectedToken?.symbol || "tokens" +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "You'll get an address to send {0} from any wallet — no signing required." +msgstr "" + +#. placeholder {0}: USDC_PERPS.symbol +#: src/components/trade/tradebox/across-bridge-modal.tsx +msgid "Your {0} will arrive directly in your Hyperliquid trading balance once confirmed." +msgstr "" + #: src/components/trade/tradebox/points-modal.tsx #~ msgid "Your Referral Code" #~ msgstr "" diff --git a/src/stores/use-global-modal-store.ts b/src/stores/use-global-modal-store.ts index cd7f01a1..7b26d392 100644 --- a/src/stores/use-global-modal-store.ts +++ b/src/stores/use-global-modal-store.ts @@ -10,6 +10,7 @@ type GlobalModal = | { type: "commandMenu" } | { type: "faucet" } | { type: "points" } + | { type: "acrossBridge" } | null; interface DepositActions { @@ -43,6 +44,11 @@ interface PointsActions { close: () => void; } +interface AcrossBridgeActions { + open: () => void; + close: () => void; +} + interface GlobalModalState { modal: GlobalModal; depositActions: DepositActions; @@ -51,6 +57,7 @@ interface GlobalModalState { commandMenuActions: CommandMenuActions; faucetActions: FaucetActions; pointsActions: PointsActions; + acrossBridgeActions: AcrossBridgeActions; } const useGlobalModalStore = create((set) => { @@ -83,6 +90,10 @@ const useGlobalModalStore = create((set) => { open: () => set({ modal: { type: "points" } }), close, }, + acrossBridgeActions: { + open: () => set({ modal: { type: "acrossBridge" } }), + close, + }, }; }); @@ -109,3 +120,6 @@ export const useFaucetModalActions = () => useGlobalModalStore((s) => s.faucetAc export const usePointsModalOpen = () => useGlobalModalStore((s) => s.modal?.type === "points"); export const usePointsModalActions = () => useGlobalModalStore((s) => s.pointsActions); + +export const useAcrossBridgeModalOpen = () => useGlobalModalStore((s) => s.modal?.type === "acrossBridge"); +export const useAcrossBridgeModalActions = () => useGlobalModalStore((s) => s.acrossBridgeActions);