@nexus-cross/dapp-ui 1.3.12-beta.1 → 1.3.12

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/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Scope } from '@sentry/react';
2
2
  import * as React from 'react';
3
- import { Component, ReactNode, ErrorInfo, CSSProperties } from 'react';
3
+ import { Component, ReactNode, ErrorInfo, CSSProperties, ElementType, ButtonHTMLAttributes } from 'react';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { UseQueryOptions } from '@tanstack/react-query';
@@ -11,6 +11,68 @@ type DrawerDirection$1 = "right" | "bottom" | "left";
11
11
 
12
12
  declare function resolveEnvironment(env?: Environment | "staging" | "prd" | "prod" | "stg"): Environment;
13
13
 
14
+ /** env별로 다르면 객체, 모든 env 동일하면 T 단일 값. */
15
+ type RemoteEnvValue<T> = T | Record<Environment, T>;
16
+ type AppsConfig = {
17
+ skills?: RemoteEnvValue<string>;
18
+ gametokenBridge?: RemoteEnvValue<string>;
19
+ /** 브릿지 버튼을 새창 대신 같은 창으로 여는 gametoken 사이트 URL prefix 목록. */
20
+ gametokenSites?: string[];
21
+ bridgePoweredBy?: {
22
+ url?: RemoteEnvValue<string>;
23
+ };
24
+ /**
25
+ * Get ONEUSD chooser action visibility. Swap/Bridge default to enabled;
26
+ * Transfer Crypto defaults to disabled when remote config is unavailable.
27
+ */
28
+ getOneUsd?: {
29
+ modes?: {
30
+ swap?: boolean;
31
+ bridge?: boolean;
32
+ transferCrypto?: boolean;
33
+ };
34
+ };
35
+ /**
36
+ * 토큰 상세화면 섹션별 노출 여부. 값이 없으면 기본값(history·balance만 노출).
37
+ * 섹션 키: chart / balance(=My Balance + Send) / overview / social / history.
38
+ * env별 값은 apps.json 파일 자체가 환경마다 분리돼 있으므로 단순 boolean만 받는다.
39
+ */
40
+ tokenDetail?: {
41
+ sections?: {
42
+ chart?: boolean;
43
+ balance?: boolean;
44
+ overview?: boolean;
45
+ social?: boolean;
46
+ history?: boolean;
47
+ };
48
+ };
49
+ /**
50
+ * Relay(외부체인 → CROSS 입금) 운영 설정.
51
+ * `minDepositAmount`: 입금 위저드 Continue를 막는 최소 수량(사람 단위,
52
+ * 토큰 공통). CDN 값이 없거나 fetch 실패 시 호출부 폴백(6)이 적용된다 —
53
+ * endpoints.json과 달리 UI 게이트라 폴백을 허용한다.
54
+ */
55
+ relay?: {
56
+ minDepositAmount?: RemoteEnvValue<number | string>;
57
+ /**
58
+ * `maxDepositAmount`: Continue를 막는 최대 수량(사람 단위, 토큰 공통).
59
+ * 브릿지/DEX 유동성 한도를 운영이 수동 반영하는 값 — 미설정 시 상한 없음.
60
+ */
61
+ maxDepositAmount?: RemoteEnvValue<number | string>;
62
+ /**
63
+ * Role-labelled Relay factory addresses. New SDKs prefer this field so
64
+ * operators can tell the StandingForwarderFactory and
65
+ * DepositorForwarderFactory apart without relying on array order.
66
+ *
67
+ * A legacy `trustedFactories` field, if encountered, is deliberately not
68
+ * typed or read by current code.
69
+ */
70
+ forwarderFactories?: RemoteEnvValue<{
71
+ standingForwarderFactory?: string;
72
+ depositorForwarderFactory?: string;
73
+ }>;
74
+ };
75
+ };
14
76
  declare const CHAINS_CONFIG_FILE = "chains.json";
15
77
  /** 체인 하나의 표시 메타. 지정 안 된 필드는 호출부 폴백(온체인/하드코딩)으로. */
16
78
  type ChainDisplayMeta = {
@@ -92,7 +154,7 @@ declare class DappUiErrorBoundary extends Component<DappUiErrorBoundaryProps, Da
92
154
  render(): ReactNode;
93
155
  }
94
156
 
95
- type DappUiFeature = "app_launcher" | "bridge" | "connect_button" | "relay" | "send" | "skills" | "wallet_connect" | "wallet_info" | "wallet_portfolio";
157
+ type DappUiFeature = "app_launcher" | "bridge" | "connect_button" | "get_one_usd" | "relay" | "send" | "skills" | "wallet_connect" | "wallet_info" | "wallet_portfolio";
96
158
  type DappUiFlow = "connect" | "send" | "bridge" | "withdraw" | "relay";
97
159
  type DappUiFailureReason = "user-rejected" | "insufficient-gas" | "timeout" | "contract-reverted" | "network" | "unknown";
98
160
  interface TrackDappUiFunnelOptions {
@@ -848,9 +910,16 @@ interface BridgeFlowProps {
848
910
  onFailed?: (info: BridgeFailedInfo) => void;
849
911
  onClose?: () => void;
850
912
  onBackToWallet?: () => void;
913
+ /** Compact modal mode: fixed direction, no history entry, host-provided title. */
914
+ variant?: "default" | "embedded";
915
+ title?: string;
916
+ /** Embedded mode only. Defaults to whether `walletAddress` is present. */
917
+ isConnected?: boolean;
918
+ /** Opens the host wallet connection flow from the embedded CTA. */
919
+ onRequestConnect?: () => void;
851
920
  className?: string;
852
921
  }
853
- declare function BridgeFlow({ onClose, onBackToWallet, env, className, ...rest }: BridgeFlowProps): react_jsx_runtime.JSX.Element;
922
+ declare function BridgeFlow({ onClose, onBackToWallet, env, variant, title: titleProp, isConnected: isConnectedProp, onRequestConnect, className, ...rest }: BridgeFlowProps): react_jsx_runtime.JSX.Element;
854
923
 
855
924
  interface WalletInfoTriggerProps {
856
925
  asChild?: boolean;
@@ -1321,559 +1390,131 @@ interface WalletPortfolioBodyProps {
1321
1390
  }
1322
1391
  declare function WalletPortfolioBody({ env, theme, walletAddress, walletName, onBack, showHeader, variant, className, onOutlink, lpBalanceReader, stakingRewardsReader, sendTransaction, estimateGas, conversionRatio, currencySymbol, sections, }: WalletPortfolioBodyProps): react_jsx_runtime.JSX.Element;
1323
1392
 
1324
- declare function CROSSxIcon(): react_jsx_runtime.JSX.Element;
1325
- declare function MetaMaskIcon(): react_jsx_runtime.JSX.Element;
1326
- declare function BinanceIcon(): react_jsx_runtime.JSX.Element;
1327
- declare function Verse8Icon(): react_jsx_runtime.JSX.Element;
1328
- declare function TronIcon(): react_jsx_runtime.JSX.Element;
1329
- declare function GoogleIcon(): react_jsx_runtime.JSX.Element;
1330
- declare function AppleIcon(): react_jsx_runtime.JSX.Element;
1331
-
1332
- declare const WALLET_REGISTRY: {
1333
- cross_embedded: {
1334
- id: string;
1335
- name: "ONEpocket with Social";
1336
- description: string;
1337
- icon: typeof CROSSxIcon;
1338
- };
1339
- cross_wallet: {
1340
- id: string;
1341
- name: "ONEpocket";
1342
- description: string;
1343
- icon: typeof CROSSxIcon;
1344
- featured: true;
1345
- };
1346
- cross_extension: {
1347
- id: string;
1348
- name: "ONEpocket Extension";
1349
- description: string;
1350
- icon: typeof CROSSxIcon;
1351
- rdns: string;
1352
- installUrl: string;
1353
- visibility: "desktop-only";
1354
- };
1355
- metamask: {
1356
- id: string;
1357
- name: string;
1358
- description: string;
1359
- icon: typeof MetaMaskIcon;
1360
- rdns: string;
1361
- };
1362
- binance: {
1363
- id: string;
1364
- name: string;
1365
- description: string;
1366
- icon: typeof BinanceIcon;
1367
- };
1368
- verse8: {
1369
- id: string;
1370
- name: string;
1371
- description: string;
1372
- icon: typeof Verse8Icon;
1373
- badge: string;
1374
- };
1375
- tron: {
1376
- id: string;
1377
- name: string;
1378
- description: string;
1379
- icon: typeof TronIcon;
1380
- badge: string;
1381
- };
1382
- };
1383
- type WalletId = keyof typeof WALLET_REGISTRY;
1384
- declare const SOCIAL_REGISTRY: {
1385
- google: {
1386
- id: string;
1387
- name: string;
1388
- icon: typeof GoogleIcon;
1389
- };
1390
- apple: {
1391
- id: string;
1392
- name: string;
1393
- icon: typeof AppleIcon;
1394
- };
1395
- };
1396
- type SocialId = keyof typeof SOCIAL_REGISTRY;
1397
-
1393
+ /** One origin-side ERC-20 (or native, address = zero) token the UI may offer. */
1394
+ interface Token {
1395
+ symbol: string;
1396
+ address: string;
1397
+ decimals: number;
1398
+ logoUrl?: string;
1399
+ }
1400
+ /** The fixed destination asset every order delivers: crossd on CROSS. */
1401
+ interface Destination {
1402
+ symbol: string;
1403
+ chainId: number;
1404
+ address: string;
1405
+ decimals: number;
1406
+ note?: string;
1407
+ }
1408
+ /** Origin chain VM family: "evm" (default) or "svm" (Solana). */
1409
+ type ChainKind = 'evm' | 'svm';
1398
1410
  /**
1399
- * Per-instance layout overrides applied as inline CSS variables.
1400
- *
1401
- * Colors / typography are driven by the design system (`--ds-*`, published
1402
- * by `CrossConnectKitProvider` from `@nexus-cross/crossx-design-system`) —
1403
- * retheme there, not per modal. Only layout knobs remain here.
1411
+ * One delivery-side asset an order's crossd-equivalent output may be paid
1412
+ * out as -- the default target (isDefault: true) is crossd itself
1413
+ * (byte-identical to Catalog.destination); non-default targets are
1414
+ * alternate payout assets the user may opt into (see GET /v1/deposit-address's
1415
+ * `target` query param). `external: true` marks a target delivered via an
1416
+ * external adapter (e.g. pONEUSD) rather than natively minted -- the UI
1417
+ * shows an extra trust note for these (Task 9).
1404
1418
  */
1405
- interface WalletConnectModalStyle extends CSSProperties {
1406
- "--wcm-dialog-width"?: string;
1407
- "--wcm-drawer-max-width"?: string;
1408
- "--wcm-drawer-min-width"?: string;
1419
+ type Target = {
1420
+ symbol: string;
1421
+ address: string;
1422
+ decimals: number;
1423
+ isDefault: boolean;
1424
+ external: boolean;
1425
+ };
1426
+ /** One supported (chain, token) pair the UI can offer as an order's source. */
1427
+ interface OriginOption {
1428
+ chainId: number;
1429
+ chainName: string;
1430
+ /**
1431
+ * VM family of the origin chain. "svm" (Solana) origins are display-only:
1432
+ * the connected EVM wallet cannot sign them, so no one-click deposit or
1433
+ * balance read is offered -- the user pays out-of-band from a Solana wallet.
1434
+ */
1435
+ kind: ChainKind;
1436
+ token: Token;
1437
+ /** Smallest-unit base-10 integer string (matches Token.decimals). */
1438
+ minAmount: string;
1439
+ /** Smallest-unit base-10 integer string; absent = no configured cap. */
1440
+ maxAmount?: string;
1409
1441
  }
1410
- type WalletVisibility = "always" | "mobile-only" | "desktop-only";
1411
- interface WalletConfig {
1412
- id: string;
1413
- name: string;
1414
- description: string;
1415
- icon: () => ReactNode;
1416
- rdns?: string;
1417
- featured?: boolean;
1418
- badge?: string;
1419
- installUrl?: string;
1420
- visibility?: WalletVisibility;
1442
+ /**
1443
+ * Which order-creation flow is live: "standing" (GET /v1/deposit-address
1444
+ * returns a stable, reusable per-user address) or "per_order" (the legacy
1445
+ * flow, a fresh forwarder minted per POST /v1/orders). See
1446
+ * internal/catalog.Catalog.AddressMode's doc comment.
1447
+ */
1448
+ type AddressMode = 'standing' | 'per_order';
1449
+ /** GET /v1/config response: the curated catalog of origins + fixed destination. */
1450
+ interface Catalog {
1451
+ destination: Destination;
1452
+ origins: OriginOption[];
1453
+ addressMode: AddressMode;
1454
+ /**
1455
+ * The user-selectable delivery targets an order may pay out as (Task 4).
1456
+ * Always includes the default target (crossd, byte-identical to
1457
+ * `destination`). Defaults to `[]` when the backend response omits this
1458
+ * field entirely -- back-compat with an older backend that predates
1459
+ * per-target delivery (see createRelayClient's getConfig).
1460
+ */
1461
+ targets: Target[];
1421
1462
  }
1422
- type WalletHandlers = Partial<Record<WalletId, () => void | Promise<void>>>;
1423
- interface SocialConfig {
1424
- id: string;
1425
- name: string;
1426
- icon: () => ReactNode;
1463
+ /** POST /v1/quote request body. */
1464
+ interface QuoteRequest {
1465
+ originChainId: number;
1466
+ originCurrency: string;
1467
+ /** Smallest-unit base-10 integer string. */
1468
+ amount: string;
1427
1469
  }
1428
- type SocialHandlers = Partial<Record<SocialId, () => void | Promise<void>>>;
1429
- type DrawerDirection = "bottom" | "left" | "right" | "top";
1430
- interface WalletConnectModalProps {
1431
- wallets: WalletHandlers;
1432
- socialProviders?: SocialHandlers;
1470
+ /** POST /v1/quote response body. */
1471
+ interface QuoteResult {
1472
+ /** Smallest-unit (BSC USDT, 18 decimals) base-10 integer string. */
1473
+ expectedBscUsdt: string;
1474
+ belowMin: boolean;
1433
1475
  /**
1434
- * URL the "Terms of Service" link in the footer points to. When
1435
- * omitted the text is rendered without an anchor (still styled in the
1436
- * primary color to match the design).
1476
+ * Smallest-unit (crossd, catalog.destination.decimals) base-10 integer
1477
+ * string. Currently assumed at 1:1 parity with BSC USDT -- see
1478
+ * assumesParity.
1437
1479
  */
1438
- termsUrl?: string;
1439
- /** URL the "Privacy Policy" link in the footer points to. */
1440
- privacyUrl?: string;
1441
- theme?: "dark" | "light";
1442
- mobileBreakpoint?: number;
1443
- drawerDirection?: DrawerDirection;
1444
- dialogWidth?: string;
1445
- drawerMaxWidth?: string;
1446
- drawerMinWidth?: string;
1447
- style?: WalletConnectModalStyle;
1448
- open?: boolean;
1449
- onOpenChange?: (open: boolean) => void;
1450
- children: ReactNode;
1451
- }
1452
- interface WalletConnectModalTriggerProps {
1453
- asChild?: boolean;
1454
- children?: ReactNode;
1480
+ expectedCrossd: string;
1481
+ assumesParity: boolean;
1482
+ /**
1483
+ * The fee DEDUCTED FROM the bridged amount, in USD, as a decimal string --
1484
+ * Relay's relayer fee plus any app surcharge (upstream af35dd5). It is
1485
+ * exactly what accounts for the gap between what the user sends and
1486
+ * `expectedBscUsdt`.
1487
+ *
1488
+ * It deliberately EXCLUDES the user's own origin-chain gas: that is paid from
1489
+ * their wallet in the origin chain's native token, the wallet already quotes
1490
+ * it at signing time, and none of it comes out of the bridged amount.
1491
+ *
1492
+ * Absent means UNKNOWN, never free -- render absence as absence. "$0.00" for
1493
+ * a fee nobody could compute is the one wrong reading. (A genuine zero, e.g.
1494
+ * the direct BSC-USDT route with no Relay leg, is also absent rather than
1495
+ * "0": no Relay leg means no relayer fee to report.)
1496
+ */
1497
+ feeUsd?: string;
1498
+ /**
1499
+ * How many seconds this quote stays valid. Drives the refresh cadence in
1500
+ * useDepositAddress -- the widget previously hardcoded 30s with no
1501
+ * relationship to the quote's real lifetime. Absent when the backend has no
1502
+ * TTL configured, in which case the client keeps its own default interval.
1503
+ *
1504
+ * There is deliberately no eta/duration field here. An earlier version of
1505
+ * this type carried `etaSeconds` on the assumption that Relay's quote
1506
+ * reports timing; it does not -- the response has no ETA field of any kind
1507
+ * -- so it was removed rather than left permanently undefined.
1508
+ */
1509
+ ttl?: number;
1455
1510
  }
1456
- interface WalletConnectModalContentProps {
1457
- className?: string;
1458
- }
1459
-
1460
- declare function WalletConnectModalTrigger({ asChild, children, }: WalletConnectModalTriggerProps): react_jsx_runtime.JSX.Element;
1461
-
1462
- declare function WalletConnectModalContent({ className, }: WalletConnectModalContentProps): react_jsx_runtime.JSX.Element;
1463
-
1464
- declare function WalletConnectModalRoot({ wallets, socialProviders, termsUrl, privacyUrl, theme, mobileBreakpoint, drawerDirection, dialogWidth, drawerMaxWidth, drawerMinWidth, style, open: openProp, onOpenChange, children, }: WalletConnectModalProps): react_jsx_runtime.JSX.Element;
1465
- declare const WalletConnectModal: typeof WalletConnectModalRoot & {
1466
- Trigger: typeof WalletConnectModalTrigger;
1467
- Content: typeof WalletConnectModalContent;
1468
- };
1469
-
1470
- interface DetectedWallet {
1471
- rdns: string;
1472
- name: string;
1473
- icon?: string;
1474
- }
1475
- interface WalletDetectResult {
1476
- wallets: DetectedWallet[];
1477
- isDetected: (rdns: string) => boolean;
1478
- isLoading: boolean;
1479
- }
1480
- declare function useWalletDetect(): WalletDetectResult;
1481
-
1482
- /**
1483
- * `ConnectButton`의 `style` prop 타입. 표준 `CSSProperties` 위에
1484
- * `--cb-*` CSS 커스텀 변수 키를 추가해 자동완성을 지원한다.
1485
- *
1486
- * 사용 예: `style={{ "--cb-bg": "#7346f3", "--cb-pill-bg": "#1a1a2e" }}`
1487
- *
1488
- * 변수는 ConnectButton 의 모든 상태(disconnected / connecting / connected
1489
- * pill)에 cascading 된다. WalletInfo popover 의 스타일은 별도
1490
- * `walletInfoStyle` prop 으로 분리되어 있다.
1491
- */
1492
- interface ConnectButtonStyle extends CSSProperties {
1493
- "--cb-bg"?: string;
1494
- "--cb-bg-hover"?: string;
1495
- "--cb-color"?: string;
1496
- "--cb-border"?: string;
1497
- "--cb-radius"?: string;
1498
- "--cb-height"?: string;
1499
- "--cb-padding"?: string;
1500
- "--cb-font-family"?: string;
1501
- "--cb-font-size"?: string;
1502
- "--cb-font-weight"?: string | number;
1503
- "--cb-line-height"?: string | number;
1504
- "--cb-letter-spacing"?: string;
1505
- "--cb-gap"?: string;
1506
- "--cb-transition"?: string;
1507
- "--cb-loading-opacity"?: string | number;
1508
- "--cb-press-scale"?: string | number;
1509
- "--cb-icon-size"?: string;
1510
- "--cb-spinner-size"?: string;
1511
- "--cb-spinner-thumb"?: string;
1512
- "--cb-spinner-track"?: string;
1513
- "--cb-pill-bg"?: string;
1514
- "--cb-pill-bg-hover"?: string;
1515
- "--cb-pill-color"?: string;
1516
- "--cb-pill-border"?: string;
1517
- "--cb-pill-radius"?: string;
1518
- "--cb-pill-height"?: string;
1519
- "--cb-pill-padding"?: string;
1520
- "--cb-pill-press-scale"?: string | number;
1521
- "--cb-pill-font-family"?: string;
1522
- "--cb-pill-font-size"?: string;
1523
- "--cb-pill-font-weight"?: string | number;
1524
- "--cb-pill-line-height"?: string | number;
1525
- "--cb-pill-gap"?: string;
1526
- "--cb-pill-icon-size"?: string;
1527
- "--cb-pill-icon-placeholder-bg"?: string;
1528
- "--cb-pill-address-font"?: string;
1529
- "--cb-pill-address-font-size"?: string;
1530
- "--cb-pill-address-letter-spacing"?: string;
1531
- }
1532
- /**
1533
- * Resolved wallet provider — determines which icon + display name appears
1534
- * in the connected pill.
1535
- *
1536
- * - `google` / `apple`: crossy-sdk 2.0 OAuth login types (embedded wallet)
1537
- * - `cross`: generic CROSSx mark (covers CROSSx 1.0 extension/app + 2.0
1538
- * embedded when no OAuth provider is attached)
1539
- * - `metamask` / `binance`: external wallets
1540
- */
1541
- type WalletProvider = "google" | "apple" | "cross" | "metamask" | "binance";
1542
- interface ConnectButtonProps {
1543
- /** 사용자가 Connect 버튼을 눌러 연결이 진행 중. 스피너 버튼으로 전환된다. */
1544
- isConnecting?: boolean;
1545
- /**
1546
- * 0x… 지갑 주소. 지정되면 connected pill로 렌더링된다. 없으면
1547
- * disconnected 버튼("Connect Wallet")으로 떨어진다.
1548
- */
1549
- address?: string;
1550
- /**
1551
- * 트리거 pill에 표시될 provider 아이콘 키.
1552
- *
1553
- * `address`가 있는데 `provider`가 `undefined`면 SDK 조회 중인 전이
1554
- * 상태로 취급해 placeholder 원을 띄운다(`pending` 플래시 방지).
1555
- */
1556
- provider?: WalletProvider;
1557
- /**
1558
- * 트리거 버튼 aria-label에 포함될 provider 표시 이름. 미지정 시
1559
- * `provider`로부터 기본값이 유추된다 (예: 'Google', 'CROSSx').
1560
- */
1561
- providerName?: string;
1562
- /** WalletInfo 헤더에 노출될 계정 라벨 (예: "Account 1", 사용자 지정 이름). */
1563
- accountName?: string;
1564
- /** Send 주소록의 My Account 탭에 노출할 계정 목록. */
1565
- sendAccounts?: SendAccount[];
1566
- /** disconnected 상태에서 버튼 클릭 핸들러. */
1567
- onConnect?: () => void;
1568
- /** connected 상태에서 WalletInfo 하단 Disconnect 클릭 핸들러. */
1569
- onDisconnect?: () => void;
1570
- /**
1571
- * 주소 복사 성공 콜백. WalletInfo의 `onCopyAddress(address, success)` 에서
1572
- * `success === true`일 때만 호출된다.
1573
- */
1574
- onCopy?: () => void;
1575
- /** 지갑 변경 chevron 클릭 핸들러. 지정하지 않으면 chevron이 숨김 처리된다. */
1576
- onSelectWallet?: () => void;
1577
- /**
1578
- * WalletInfo 기본 액션 row의 Buy 클릭 핸들러. Promise를 반환하면 reject 시
1579
- * Buy 카드가 `onBuyDisabledMessage`와 동일한 토스트로 실패를 안내한다.
1580
- */
1581
- onBuy?: () => void | Promise<void>;
1582
- /**
1583
- * Buy 카드를 시각적으로 비활성 상태로 표시하고, 사용자가 클릭하면 이 메시지를
1584
- * 토스트로 띄운다. `onBuy`보다 우선. WalletInfoProps의 동일 prop으로 그대로
1585
- * 전달된다.
1586
- */
1587
- onBuyDisabledMessage?: string;
1588
- /**
1589
- * disconnected 버튼 라벨. 기본 'Connect Wallet'.
1590
- * 문자열 외에 ReactNode를 넘겨 아이콘-only / 커스텀 마크업을 렌더할 수 있다
1591
- * (모바일에서 아이콘만 보여주고 싶을 때 등).
1592
- */
1593
- label?: ReactNode;
1594
- /** isConnecting 상태 라벨. 기본 'Connecting...'. */
1595
- connectingLabel?: ReactNode;
1596
- /** WalletInfo 내장 Disconnect 버튼 라벨. 기본 'Disconnect'. */
1597
- disconnectLabel?: string;
1598
- /**
1599
- * 외부(호출부)에서 주입하는 className. disconnected / connecting /
1600
- * connected(트리거 pill)에 공통으로 추가된다 (기본 `cb-button` /
1601
- * `cb-pill` 클래스에 병합).
1602
- */
1603
- className?: string;
1604
- /**
1605
- * 버튼 자체(`disconnected` / `connecting` / `connected pill`)의
1606
- * CSS 커스텀 변수 오버라이드. WalletInfo popover 스타일은 별도
1607
- * `walletInfoStyle` 로 분리되어 있다.
1608
- */
1609
- style?: ConnectButtonStyle;
1610
- /**
1611
- * 트리거 pill 을 눌러 열리는 WalletInfo popover/drawer 의 CSS
1612
- * 커스텀 변수 오버라이드 (`WalletInfoStyle`).
1613
- */
1614
- walletInfoStyle?: WalletInfoStyle;
1615
- theme?: Theme;
1616
- env?: Environment;
1617
- showBalance?: boolean;
1618
- showPortfolio?: boolean;
1619
- drawerDirection?: DrawerDirection$1;
1620
- modal?: boolean;
1621
- connectorId?: ConnectorId;
1622
- /** Send 페이지의 일반 토큰 전송에 사용할 외부 트랜잭션 전송 함수. */
1623
- sendTransaction?: SendTransactionFn$1;
1624
- getTransactionReceipt?: GetTransactionReceiptFn;
1625
- /**
1626
- * Send 확인 단계의 가스/수수료 추정 함수. 미주입 시 SendPage Confirm 화면의
1627
- * Est. Tx Fee / Gas Limit / Max. Total Amount 행이 "—"로 표시된다.
1628
- */
1629
- estimateGas?: EstimateGasFn;
1630
- /**
1631
- * 상단 QR 버튼 / 기본 액션 row의 Receive / Send 콜백. (Buy는 위 onBuy로
1632
- * 정의됨.)
1633
- */
1634
- onReceive?: () => void;
1635
- /**
1636
- * @deprecated Bridge 버튼은 항상 apps.json(gametokenBridge) 웹으로
1637
- * 이동한다. 이 콜백은 더 이상 호출되지 않는다.
1638
- */
1639
- onBridge?: () => void;
1640
- onSend?: () => void;
1641
- bridgeTokens?: BridgeToken[];
1642
- bridgeHistory?: BridgeHistoryItem[];
1643
- getBridgeQuote?: BridgeQuoteFn;
1644
- getBridgeToTokens?: BridgeGetToTokensFn;
1645
- getBridgeApproval?: BridgeGetApprovalFn;
1646
- approveBridge?: BridgeApproveFn;
1647
- submitBridge?: BridgeSubmitFn;
1648
- }
1649
-
1650
- /**
1651
- * 3-state wallet connect button. Caller drives the visual state:
1652
- *
1653
- * - `isConnecting === true` → 스피너 disabled 버튼
1654
- * - `address` 있음 → WalletInfo + connected pill
1655
- * - `address`가 있는데 `provider` 없음 → SDK 조회 전이 상태, placeholder 원
1656
- * - 둘 다 없음 → "Connect Wallet" 버튼
1657
- *
1658
- * view-only: wagmi / connect-kit 같은 web3 의존성은 갖지 않으며 모든
1659
- * 상태/데이터/콜백은 props로 주입받는다. 실제 wagmi 연결 로직은
1660
- * `@nexus-cross/connect-kit-react`의 상위 래퍼에서 수행한다.
1661
- */
1662
- declare function ConnectButton({ isConnecting, address, provider, providerName, accountName, sendAccounts, onConnect, onDisconnect, onCopy, onSelectWallet, onBuy, onBuyDisabledMessage, label, connectingLabel, disconnectLabel, className, theme, env, showBalance, showPortfolio, drawerDirection, modal, connectorId, style, walletInfoStyle, sendTransaction, getTransactionReceipt, estimateGas, onReceive, onBridge, onSend, bridgeTokens, bridgeHistory, getBridgeQuote, getBridgeToTokens, getBridgeApproval, approveBridge, submitBridge, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
1663
-
1664
- /**
1665
- * Wallet provider icons used by `ConnectButton`. Ported from
1666
- * `@nexus-cross/connect-kit-wagmi` so dapp-ui stays a self-contained,
1667
- * bundler-agnostic module (no SVG loader required) and doesn't pull in a
1668
- * web3 dependency for icon assets.
1669
- *
1670
- * Each icon is an inline `data:image/svg+xml` URI so it can be consumed
1671
- * directly by `<img src={...}>`.
1672
- *
1673
- * Source references mirror the ones in `connect-kit-wagmi/src/wallets/icons.ts`:
1674
- * wallet-crossx.svg → CROSSX_ICON (cross / cross-extension / cross-embedded fallback)
1675
- * wallet-metamask.svg → METAMASK_ICON
1676
- * wallet-binance.svg → BINANCE_ICON
1677
- */
1678
- declare const CROSSX_ICON: string;
1679
- declare const METAMASK_ICON: string;
1680
- declare const BINANCE_ICON: string;
1681
- declare const GOOGLE_ICON: string;
1682
- declare const APPLE_ICON: string;
1683
-
1684
- /**
1685
- * `SkillsButton`의 `style` prop 타입. 표준 `CSSProperties` 위에
1686
- * `--sb-*` CSS 커스텀 변수 키를 추가해 자동완성을 지원한다.
1687
- *
1688
- * 사용 예: `style={{ "--sb-color": "white", "--sb-bg": "rgba(0,0,0,0.4)" }}`
1689
- *
1690
- * CSS 변수는 자식 요소(아이콘, 스피너)로 cascading 되므로, `--sb-color`
1691
- * 하나만 바꿔도 텍스트·아이콘·스피너가 모두 같은 색을 따라간다.
1692
- */
1693
- interface SkillsButtonStyle extends CSSProperties {
1694
- "--sb-bg"?: string;
1695
- "--sb-border"?: string;
1696
- "--sb-border-hover"?: string;
1697
- "--sb-color"?: string;
1698
- "--sb-color-hover"?: string;
1699
- "--sb-radius"?: string;
1700
- "--sb-height"?: string;
1701
- "--sb-padding"?: string;
1702
- "--sb-gap"?: string;
1703
- "--sb-font-size"?: string;
1704
- "--sb-font-weight"?: string | number;
1705
- "--sb-line-height"?: string | number;
1706
- "--sb-letter-spacing"?: string;
1707
- "--sb-blur"?: string;
1708
- "--sb-border-width"?: string;
1709
- "--sb-icon-size"?: string;
1710
- "--sb-icon-hover-rotation"?: string;
1711
- "--sb-spinner-size"?: string;
1712
- "--sb-spinner-thumb"?: string;
1713
- "--sb-spinner-track"?: string;
1714
- "--sb-disabled-opacity"?: string | number;
1715
- "--sb-press-scale"?: string | number;
1716
- "--sb-hover-duration"?: string;
1717
- "--sb-icon-duration"?: string;
1718
- "--sb-easing"?: string;
1719
- }
1720
- interface SkillsButtonProps {
1721
- /** Button text label */
1722
- label?: string;
1723
- /** Skills service URL or path to navigate to */
1724
- href?: string;
1725
- /** Called when button is clicked (instead of navigation if provided) */
1726
- onClick?: () => void | Promise<void>;
1727
- /** Optional CSS class name (merged with built-in `.sb-button`) */
1728
- className?: string;
1729
- /** Inline style + CSS custom property overrides (`SkillsButtonStyle`) */
1730
- style?: SkillsButtonStyle;
1731
- /** Light/dark surface preset (sets `data-theme`). Defaults to no preset. */
1732
- theme?: Theme;
1733
- /** Disable the button */
1734
- disabled?: boolean;
1735
- /** Whether button is in loading state */
1736
- isLoading?: boolean;
1737
- /** Label shown while loading */
1738
- loadingLabel?: string;
1739
- /** Open link in new tab */
1740
- openInNewTab?: boolean;
1741
- /** Button type attribute */
1742
- type?: "button" | "submit" | "reset";
1743
- }
1744
-
1745
- /**
1746
- * @deprecated 이동 대상은 apps.json(skills)이 단일 소스다. 이 상수는 더 이상
1747
- * 폴백으로 쓰이지 않으며 하위 호환(공개 export)용으로만 남아 있다.
1748
- */
1749
- declare const DEFAULT_SKILLS_HREF = "https://www.onechain.nexus/skills";
1750
- declare function SkillsButton({ label, href, onClick, className, style, theme, disabled, isLoading, loadingLabel, openInNewTab, type, }: SkillsButtonProps): react_jsx_runtime.JSX.Element;
1751
-
1752
- /** One origin-side ERC-20 (or native, address = zero) token the UI may offer. */
1753
- interface Token {
1754
- symbol: string;
1755
- address: string;
1756
- decimals: number;
1757
- logoUrl?: string;
1758
- }
1759
- /** The fixed destination asset every order delivers: crossd on CROSS. */
1760
- interface Destination {
1761
- symbol: string;
1762
- chainId: number;
1763
- address: string;
1764
- decimals: number;
1765
- note?: string;
1766
- }
1767
- /** Origin chain VM family: "evm" (default) or "svm" (Solana). */
1768
- type ChainKind = 'evm' | 'svm';
1769
- /**
1770
- * One delivery-side asset an order's crossd-equivalent output may be paid
1771
- * out as -- the default target (isDefault: true) is crossd itself
1772
- * (byte-identical to Catalog.destination); non-default targets are
1773
- * alternate payout assets the user may opt into (see GET /v1/deposit-address's
1774
- * `target` query param). `external: true` marks a target delivered via an
1775
- * external adapter (e.g. pONEUSD) rather than natively minted -- the UI
1776
- * shows an extra trust note for these (Task 9).
1777
- */
1778
- type Target = {
1779
- symbol: string;
1780
- address: string;
1781
- decimals: number;
1782
- isDefault: boolean;
1783
- external: boolean;
1784
- };
1785
- /** One supported (chain, token) pair the UI can offer as an order's source. */
1786
- interface OriginOption {
1787
- chainId: number;
1788
- chainName: string;
1789
- /**
1790
- * VM family of the origin chain. "svm" (Solana) origins are display-only:
1791
- * the connected EVM wallet cannot sign them, so no one-click deposit or
1792
- * balance read is offered -- the user pays out-of-band from a Solana wallet.
1793
- */
1794
- kind: ChainKind;
1795
- token: Token;
1796
- /** Smallest-unit base-10 integer string (matches Token.decimals). */
1797
- minAmount: string;
1798
- /** Smallest-unit base-10 integer string; absent = no configured cap. */
1799
- maxAmount?: string;
1800
- }
1801
- /**
1802
- * Which order-creation flow is live: "standing" (GET /v1/deposit-address
1803
- * returns a stable, reusable per-user address) or "per_order" (the legacy
1804
- * flow, a fresh forwarder minted per POST /v1/orders). See
1805
- * internal/catalog.Catalog.AddressMode's doc comment.
1806
- */
1807
- type AddressMode = 'standing' | 'per_order';
1808
- /** GET /v1/config response: the curated catalog of origins + fixed destination. */
1809
- interface Catalog {
1810
- destination: Destination;
1811
- origins: OriginOption[];
1812
- addressMode: AddressMode;
1813
- /**
1814
- * The user-selectable delivery targets an order may pay out as (Task 4).
1815
- * Always includes the default target (crossd, byte-identical to
1816
- * `destination`). Defaults to `[]` when the backend response omits this
1817
- * field entirely -- back-compat with an older backend that predates
1818
- * per-target delivery (see createRelayClient's getConfig).
1819
- */
1820
- targets: Target[];
1821
- }
1822
- /** POST /v1/quote request body. */
1823
- interface QuoteRequest {
1824
- originChainId: number;
1825
- originCurrency: string;
1826
- /** Smallest-unit base-10 integer string. */
1827
- amount: string;
1828
- }
1829
- /** POST /v1/quote response body. */
1830
- interface QuoteResult {
1831
- /** Smallest-unit (BSC USDT, 18 decimals) base-10 integer string. */
1832
- expectedBscUsdt: string;
1833
- belowMin: boolean;
1834
- /**
1835
- * Smallest-unit (crossd, catalog.destination.decimals) base-10 integer
1836
- * string. Currently assumed at 1:1 parity with BSC USDT -- see
1837
- * assumesParity.
1838
- */
1839
- expectedCrossd: string;
1840
- assumesParity: boolean;
1841
- /**
1842
- * The fee DEDUCTED FROM the bridged amount, in USD, as a decimal string --
1843
- * Relay's relayer fee plus any app surcharge (upstream af35dd5). It is
1844
- * exactly what accounts for the gap between what the user sends and
1845
- * `expectedBscUsdt`.
1846
- *
1847
- * It deliberately EXCLUDES the user's own origin-chain gas: that is paid from
1848
- * their wallet in the origin chain's native token, the wallet already quotes
1849
- * it at signing time, and none of it comes out of the bridged amount.
1850
- *
1851
- * Absent means UNKNOWN, never free -- render absence as absence. "$0.00" for
1852
- * a fee nobody could compute is the one wrong reading. (A genuine zero, e.g.
1853
- * the direct BSC-USDT route with no Relay leg, is also absent rather than
1854
- * "0": no Relay leg means no relayer fee to report.)
1855
- */
1856
- feeUsd?: string;
1857
- /**
1858
- * How many seconds this quote stays valid. Drives the refresh cadence in
1859
- * useDepositAddress -- the widget previously hardcoded 30s with no
1860
- * relationship to the quote's real lifetime. Absent when the backend has no
1861
- * TTL configured, in which case the client keeps its own default interval.
1862
- *
1863
- * There is deliberately no eta/duration field here. An earlier version of
1864
- * this type carried `etaSeconds` on the assumption that Relay's quote
1865
- * reports timing; it does not -- the response has no ETA field of any kind
1866
- * -- so it was removed rather than left permanently undefined.
1867
- */
1868
- ttl?: number;
1869
- }
1870
- /** GET /v1/deposit-address request query params -- no amount: a standing
1871
- * address is resolved purely from (user, originChainId, originCurrency),
1872
- * independent of any deposit size. */
1873
- interface DepositAddressRequest {
1874
- user: string;
1875
- originChainId: number;
1876
- originCurrency: string;
1511
+ /** GET /v1/deposit-address request query params -- no amount: a standing
1512
+ * address is resolved purely from (user, originChainId, originCurrency),
1513
+ * independent of any deposit size. */
1514
+ interface DepositAddressRequest {
1515
+ user: string;
1516
+ originChainId: number;
1517
+ originCurrency: string;
1877
1518
  }
1878
1519
  /**
1879
1520
  * GET /v1/deposit-address response body -- a stable, reusable deposit
@@ -2224,9 +1865,9 @@ interface RelayDepositProps extends RelayWalletProps {
2224
1865
  * hosts whose users connect external wallets that can sign on the origin
2225
1866
  * chains — CROSS embedded-wallet users never can, hence the off default. */
2226
1867
  showOneClickDeposit?: boolean;
2227
- /** Render the recovery gear menu ("Recover stuck funds", default `false`).
1868
+ /** Render the Recover tab (default `false` for low-level RelayDeposit).
2228
1869
  * Recovery signs on BSC with the connected wallet, which CROSS embedded-wallet
2229
- * users can never do — so the gear is hidden unless a host serving external
1870
+ * users can never do — so the tab is hidden unless a host serving external
2230
1871
  * wallets opts in. Even opted in, it still requires the injected
2231
1872
  * `writeContract`/`readContract`/`waitForReceipt` capability trio. */
2232
1873
  showRecovery?: boolean;
@@ -2299,23 +1940,67 @@ interface RelayRecoveryProps extends RelayWalletProps {
2299
1940
  * (see `resolveEnvironment`), defaulting to production.
2300
1941
  */
2301
1942
  environment?: Environment;
2302
- /**
2303
- * Optional assertion of whose forwarder to check/recover. Recovery is always
2304
- * pinned to the valid connected `walletAddress`; when this value is supplied
2305
- * it must match that wallet. A missing/invalid wallet or mismatch renders a
2306
- * short note and makes ZERO requests (no catalog, no recovery lookup).
2307
- */
1943
+ /**
1944
+ * Optional assertion of whose forwarder to check/recover. Recovery is always
1945
+ * pinned to the valid connected `walletAddress`; when this value is supplied
1946
+ * it must match that wallet. A missing/invalid wallet or mismatch renders a
1947
+ * short note and makes ZERO requests (no catalog, no recovery lookup).
1948
+ */
1949
+ recipient?: string;
1950
+ /**
1951
+ * Overrides the pinned factory allowlist recovery verifies against before
1952
+ * signing -- only needed by a self-hosted deployment running its own
1953
+ * factories. Same meaning (and the same fail-closed reasoning) as
1954
+ * `RelayDepositProps.trustedFactories`.
1955
+ */
1956
+ trustedFactories?: readonly string[];
1957
+ /** Fired once after a recovery action receipt confirms successfully. */
1958
+ onRecoverySuccess?: (result: RecoverySuccessResult) => void;
1959
+ onError?: (e: Error) => void;
1960
+ /** Extra class name(s) for the modal/drawer content element. */
1961
+ className?: string;
1962
+ theme?: RelayTheme;
1963
+ mobileBreakpoint?: number;
1964
+ drawerDirection?: RelayDrawerDirection;
1965
+ dialogWidth?: string;
1966
+ drawerMaxWidth?: string;
1967
+ drawerMinWidth?: string;
1968
+ style?: CSSProperties;
1969
+ open?: boolean;
1970
+ onOpenChange?: (open: boolean) => void;
1971
+ children?: ReactNode;
1972
+ }
1973
+ /**
1974
+ * Props of the `<RelayHistory>` compound root (Task 12) — the standalone
1975
+ * transfer-history modal built on the shared `ResponsiveShell` +
1976
+ * `useRelayOrders`. `RelayDepositProps`'s simpler sibling: no wizard step,
1977
+ * no catalog/target picking, no wallet-injected send/write capabilities —
1978
+ * just an address to look up orders for and a list to render.
1979
+ *
1980
+ * `children` holds `<RelayHistory.Trigger>` / `<RelayHistory.Content>`.
1981
+ */
1982
+ interface RelayHistoryProps {
1983
+ /** Pre-built client. Takes precedence over apiBaseUrl. */
1984
+ client?: RelayClient;
1985
+ /** Used to build a client via createRelayClient when `client` isn't passed. */
1986
+ apiBaseUrl?: string;
1987
+ /**
1988
+ * Selects a built-in default relay API base URL (dev/stage/production) when
1989
+ * `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
1990
+ * this is only consulted when neither is provided. Omitted falls back to
1991
+ * the same global environment resolution every other dapp-ui feature uses
1992
+ * (see `resolveEnvironment`), defaulting to production.
1993
+ */
1994
+ environment?: Environment;
1995
+ /** History subject. Falls back to `walletAddress`; empty-state UI when
1996
+ * neither resolves to a valid address. */
2308
1997
  recipient?: string;
2309
- /**
2310
- * Overrides the pinned factory allowlist recovery verifies against before
2311
- * signing -- only needed by a self-hosted deployment running its own
2312
- * factories. Same meaning (and the same fail-closed reasoning) as
2313
- * `RelayDepositProps.trustedFactories`.
2314
- */
2315
- trustedFactories?: readonly string[];
2316
- /** Fired once after a recovery action receipt confirms successfully. */
2317
- onRecoverySuccess?: (result: RecoverySuccessResult) => void;
1998
+ walletAddress?: string;
2318
1999
  onError?: (e: Error) => void;
2000
+ /** Notified with the resolved explorer URL when a history row's tx link is
2001
+ * clicked. Fire-and-forget -- unlike `OnOutlink` elsewhere in dapp-ui, it
2002
+ * does not intercept navigation; the link still opens in a new tab as normal. */
2003
+ onOutlink?: (url: string) => void;
2319
2004
  /** Extra class name(s) for the modal/drawer content element. */
2320
2005
  className?: string;
2321
2006
  theme?: RelayTheme;
@@ -2329,346 +2014,838 @@ interface RelayRecoveryProps extends RelayWalletProps {
2329
2014
  onOpenChange?: (open: boolean) => void;
2330
2015
  children?: ReactNode;
2331
2016
  }
2017
+
2018
+ interface RelayDepositContentProps {
2019
+ /** Extra class name(s) for the dialog/drawer content element. Falls back to
2020
+ * `<RelayDeposit>`'s own `className`. */
2021
+ className?: string;
2022
+ }
2332
2023
  /**
2333
- * Props of the `<RelayHistory>` compound root (Task 12) the standalone
2334
- * transfer-history modal built on the shared `ResponsiveShell` +
2335
- * `useRelayOrders`. `RelayDepositProps`'s simpler sibling: no wizard step,
2336
- * no catalog/target picking, no wallet-injected send/write capabilities
2337
- * just an address to look up orders for and a list to render.
2024
+ * `<RelayDeposit.Content>` the modal/drawer surface. The deposit body is a
2025
+ * child of `ShellContent`, i.e. of radix's `Dialog.Portal` / vaul's
2026
+ * `Drawer.Portal`, which render nothing while closed. The state it renders is
2027
+ * NOT its own any more: `<RelayDeposit>` mounts the wizard engine above the
2028
+ * shell for exactly as long as the modal is open, so "no request before open"
2029
+ * and "everything resets on close" still hold -- while a breakpoint crossing
2030
+ * mid-flow now only rebuilds this DOM, not the flow.
2031
+ */
2032
+ declare function RelayDepositContent({ className }: RelayDepositContentProps): react_jsx_runtime.JSX.Element;
2033
+
2034
+ interface RelayDepositTriggerProps {
2035
+ /** Render the child as the trigger instead of wrapping it. Defaults to
2036
+ * `true` whenever a child is supplied, matching
2037
+ * `WalletConnectModalTrigger`'s `asChild ?? children != null`. */
2038
+ asChild?: boolean;
2039
+ children?: ReactNode;
2040
+ }
2041
+ /**
2042
+ * Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
2043
+ * vaul `Drawer.Trigger` on mobile) so hosts write
2044
+ * `<RelayDeposit.Trigger><button>…</button></RelayDeposit.Trigger>` without
2045
+ * knowing which primitive is active. Falls back to a plain default button when
2046
+ * no child is given, same as `WalletConnectModalTrigger`.
2338
2047
  *
2339
- * `children` holds `<RelayHistory.Trigger>` / `<RelayHistory.Content>`.
2048
+ * Wrapped in `<TrackingBoundary feature="relay">` for the same reason
2049
+ * `WalletConnectModalTrigger` is: the `data-track="open"` attribute below (and
2050
+ * on any host-supplied child that carries one) is only picked up by the
2051
+ * analytics delegate a boundary installs. Without it the open click is silently
2052
+ * untracked, since the trigger lives OUTSIDE the portaled `<Content>` boundary.
2053
+ */
2054
+ declare function RelayDepositTrigger({ asChild, children }: RelayDepositTriggerProps): react_jsx_runtime.JSX.Element;
2055
+
2056
+ declare function RelayDepositRoot(props: RelayDepositProps): react_jsx_runtime.JSX.Element;
2057
+ declare const RelayDeposit: typeof RelayDepositRoot & {
2058
+ Trigger: typeof RelayDepositTrigger;
2059
+ Content: typeof RelayDepositContent;
2060
+ };
2061
+
2062
+ interface RelayHistoryContentProps {
2063
+ /** Extra class name(s) for the dialog/drawer content element. Falls back to
2064
+ * `<RelayHistory>`'s own `className`. */
2065
+ className?: string;
2066
+ }
2067
+ /**
2068
+ * `<RelayHistory.Content>` — the modal/drawer surface. Like
2069
+ * `RelayDepositContent`, this is a child of `ShellContent`, i.e. of radix's
2070
+ * `Dialog.Portal` / vaul's `Drawer.Portal`, which render nothing while
2071
+ * closed: no `listOrders` request happens before the modal is opened, and the
2072
+ * subtree unmounts on close -- there is no per-open state here to reset
2073
+ * explicitly (unlike `RelayDepositBody`'s step/panel state), so
2074
+ * unmount-by-portal is the whole story.
2075
+ */
2076
+ declare function RelayHistoryContent({ className }: RelayHistoryContentProps): react_jsx_runtime.JSX.Element;
2077
+
2078
+ interface RelayHistoryTriggerProps {
2079
+ /** Render the child as the trigger instead of wrapping it. Defaults to
2080
+ * `true` whenever a child is supplied, matching `RelayDepositTrigger`'s
2081
+ * (and `WalletConnectModalTrigger`'s) `asChild ?? children != null` rule. */
2082
+ asChild?: boolean;
2083
+ children?: ReactNode;
2084
+ }
2085
+ /**
2086
+ * Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
2087
+ * vaul `Drawer.Trigger` on mobile), mirroring `RelayDepositTrigger` so hosts
2088
+ * write `<RelayHistory.Trigger><button>…</button></RelayHistory.Trigger>`
2089
+ * without knowing which primitive is active. Falls back to a plain default
2090
+ * button when no child is given.
2091
+ *
2092
+ * Wrapped in `<TrackingBoundary feature="relay">` for the same reason
2093
+ * `RelayDepositTrigger`/`WalletConnectModalTrigger` are: `data-track="open"` is
2094
+ * only read by the delegate a boundary installs, and this trigger sits OUTSIDE
2095
+ * the portaled `<Content>`'s own boundary.
2096
+ */
2097
+ declare function RelayHistoryTrigger({ asChild, children }: RelayHistoryTriggerProps): react_jsx_runtime.JSX.Element;
2098
+
2099
+ declare function RelayHistoryRoot(props: RelayHistoryProps): react_jsx_runtime.JSX.Element;
2100
+ declare const RelayHistory: typeof RelayHistoryRoot & {
2101
+ Trigger: typeof RelayHistoryTrigger;
2102
+ Content: typeof RelayHistoryContent;
2103
+ };
2104
+
2105
+ interface RelayRecoveryContentProps {
2106
+ /** Extra class name(s) for the dialog/drawer content element. Falls back to
2107
+ * `<RelayRecovery>`'s own `className`. */
2108
+ className?: string;
2109
+ }
2110
+ /**
2111
+ * `<RelayRecovery.Content>` — the modal/drawer surface. Same portal-scoped
2112
+ * lifecycle as `<RelayHistory.Content>`: nothing is requested before the modal
2113
+ * is opened, and the whole subtree (including `useRecovery`'s state and any
2114
+ * in-flight recovery tracking) unmounts on close, so there is no per-open state
2115
+ * to reset explicitly.
2116
+ */
2117
+ declare function RelayRecoveryContent({ className }: RelayRecoveryContentProps): react_jsx_runtime.JSX.Element;
2118
+
2119
+ interface RelayRecoveryTriggerProps {
2120
+ /** Render the child as the trigger instead of wrapping it. Defaults to
2121
+ * `true` whenever a child is supplied, matching `RelayHistoryTrigger`'s
2122
+ * (and `RelayDepositTrigger`'s) `asChild ?? children != null` rule. */
2123
+ asChild?: boolean;
2124
+ children?: ReactNode;
2125
+ }
2126
+ /**
2127
+ * Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
2128
+ * vaul `Drawer.Trigger` on mobile), mirroring `RelayHistoryTrigger` so hosts
2129
+ * write `<RelayRecovery.Trigger><button>…</button></RelayRecovery.Trigger>`
2130
+ * without knowing which primitive is active. Falls back to a plain-text
2131
+ * "Recover" button when no child is given -- unstyled like the sibling
2132
+ * `RelayDepositTrigger`/`RelayHistoryTrigger` defaults, so it inherits the
2133
+ * host's own button chrome instead of shipping a look of its own.
2134
+ *
2135
+ * The default button renders NO count badge (2026-07-30: removed on request --
2136
+ * the number read as an unread-notification alarm). The root's cross-target
2137
+ * recoverable count still reaches the trigger element as
2138
+ * `data-rd-recovery-count` (radix/vaul merge Trigger props onto the `asChild`
2139
+ * child too), so a host that WANTS a badge can opt in with its own CSS -- e.g.
2140
+ * `button[data-rd-recovery-count]:not([data-rd-recovery-count="0"])::after` --
2141
+ * without refetching anything.
2142
+ *
2143
+ * Wrapped in `<TrackingBoundary feature="relay">` for the same reason
2144
+ * `RelayHistoryTrigger` is: `data-track="open"` is only read by the delegate a
2145
+ * boundary installs, and this trigger sits OUTSIDE the portaled `<Content>`'s
2146
+ * own boundary.
2147
+ */
2148
+ declare function RelayRecoveryTrigger({ asChild, children }: RelayRecoveryTriggerProps): react_jsx_runtime.JSX.Element;
2149
+
2150
+ declare function RelayRecoveryRoot(props: RelayRecoveryProps): react_jsx_runtime.JSX.Element;
2151
+ declare const RelayRecovery: typeof RelayRecoveryRoot & {
2152
+ Trigger: typeof RelayRecoveryTrigger;
2153
+ Content: typeof RelayRecoveryContent;
2154
+ };
2155
+
2156
+ interface UseRelayOrdersOptions {
2157
+ client: RelayClient;
2158
+ /** Valid EVM address, or undefined -- undefined clears the list and stops polling. */
2159
+ recipient?: string;
2160
+ /** Gate: wait for truthy before the first fetch (RelayDeposit passes rawCatalog). Default true. */
2161
+ enabled?: boolean;
2162
+ /** Keep the snapshot live with SSE + fallback polling. Default true. */
2163
+ live?: boolean;
2164
+ /** REST safety-net cadence in milliseconds. Defaults to 30s; the open Deposit popup uses 1s
2165
+ * so completion still appears promptly when the SSE event is absent. */
2166
+ refetchInterval?: number;
2167
+ /** @deprecated Use `refetchInterval`. Retained for compatibility. */
2168
+ fallbackPollMs?: number;
2169
+ onError?: (e: Error) => void;
2170
+ }
2171
+ interface UseRelayOrdersResult {
2172
+ /** Every order swept from deposits to this recipient so far, newest-first
2173
+ * as served by the API. Kept live unless `live: false` requests one snapshot. */
2174
+ orders: OrderSummary[];
2175
+ ordersLoading: boolean;
2176
+ ordersError?: Error;
2177
+ /** Recipient the current snapshot belongs to. Undefined while a new
2178
+ * subscription is waiting for its first accepted fetch, so consumers never
2179
+ * baseline a previous recipient's rows as fresh deposits. */
2180
+ ordersForRecipient?: string;
2181
+ /** Increments after every accepted fetch, even when the client returns the
2182
+ * same array reference or the request fails. Consumers use this as a
2183
+ * low-frequency refresh signal for related read models such as /recovery. */
2184
+ ordersRevision: number;
2185
+ /** True once at least one fetch has COMPLETED (success or failure) for the
2186
+ * current (recipient, enabled) subscription; false again when it resets.
2187
+ * Distinct from `!ordersLoading`, which is also true BEFORE the first fetch
2188
+ * has even started -- consumers that snapshot the list (e.g. the deposit
2189
+ * wizard's new-order watch) must wait for this, or they baseline against
2190
+ * the initial empty state and misread every existing order as new. */
2191
+ ordersInitialized: boolean;
2192
+ }
2193
+ declare function useRelayOrders(opts: UseRelayOrdersOptions): UseRelayOrdersResult;
2194
+
2195
+ interface UseRelayConfigOptions {
2196
+ /** Pre-built client. Takes precedence over apiBaseUrl. */
2197
+ client?: RelayClient;
2198
+ /** Used to build a client when `client` is not supplied. */
2199
+ apiBaseUrl?: string;
2200
+ /** Stops the request and clears the current snapshot. Defaults to true. */
2201
+ enabled?: boolean;
2202
+ /** Optional automatic REST refresh cadence in milliseconds. Disabled when omitted or <= 0. */
2203
+ refetchInterval?: number;
2204
+ onError?: (error: Error) => void;
2205
+ }
2206
+ interface UseRelayConfigResult {
2207
+ /** Latest GET /v1/config response. */
2208
+ config?: Catalog;
2209
+ loading: boolean;
2210
+ error?: Error;
2211
+ /** Re-fetches GET /v1/config using the current client. */
2212
+ refresh: () => void;
2213
+ }
2214
+ /**
2215
+ * Public read-only hook for Relay's origin/destination/target catalog.
2216
+ *
2217
+ * The response is a normal REST snapshot, not an SSE stream. Use
2218
+ * `refetchInterval` for periodic refreshes or call `refresh` for an immediate
2219
+ * read without replacing the client or remounting the component.
2220
+ */
2221
+ declare function useRelayConfig(opts?: UseRelayConfigOptions): UseRelayConfigResult;
2222
+
2223
+ type RecoveryAction = "execute" | "sweep";
2224
+ /** Per-attempt progress for `recover()`. "switching" = prompting a chain switch to BSC;
2225
+ * "deploying" = the factory.deploy() write is in flight/confirming (only needed when the
2226
+ * forwarder wasn't deployed yet); "recovering" = the execute()/sweepToUser() write is in
2227
+ * flight/confirming; "done"/"error" are terminal for this attempt. */
2228
+ type RecoveryStep = "idle" | "switching" | "deploying" | "recovering" | "done" | "error";
2229
+ interface RecoveryState {
2230
+ step: RecoveryStep;
2231
+ /** Tx hash of the factory.deploy() write -- only set when this attempt needed one. */
2232
+ deployTxHash?: string;
2233
+ /** Tx hash of the execute()/sweepToUser() write. */
2234
+ actionTxHash?: string;
2235
+ error?: string;
2236
+ }
2237
+
2238
+ type RelayRecoveryQueryKey = readonly [
2239
+ "relay",
2240
+ "recovery",
2241
+ number,
2242
+ string | null,
2243
+ string | null
2244
+ ];
2245
+ /**
2246
+ * React Query policies accepted by useRelayRecovery. The SDK owns the request
2247
+ * identity and response shape, so callers cannot replace queryKey/queryFn or
2248
+ * inject/select recovery balances.
2340
2249
  */
2341
- interface RelayHistoryProps {
2250
+ type RelayRecoveryQueryOptions = Omit<UseQueryOptions<RecoveryInfo, Error, RecoveryInfo, RelayRecoveryQueryKey>, "queryKey" | "queryFn" | "select" | "initialData" | "initialDataUpdatedAt" | "placeholderData">;
2251
+ interface UseRelayRecoveryOptions {
2342
2252
  /** Pre-built client. Takes precedence over apiBaseUrl. */
2343
2253
  client?: RelayClient;
2344
- /** Used to build a client via createRelayClient when `client` isn't passed. */
2254
+ /** Used to build a client via createRelayClient when client isn't passed. */
2345
2255
  apiBaseUrl?: string;
2346
- /**
2347
- * Selects a built-in default relay API base URL (dev/stage/production) when
2348
- * `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
2349
- * this is only consulted when neither is provided. Omitted falls back to
2350
- * the same global environment resolution every other dapp-ui feature uses
2351
- * (see `resolveEnvironment`), defaulting to production.
2352
- */
2353
- environment?: Environment;
2354
- /** History subject. Falls back to `walletAddress`; empty-state UI when
2355
- * neither resolves to a valid address. */
2256
+ /** Connected EVM wallet whose recoverable forwarder balances are queried. */
2356
2257
  recipient?: string;
2258
+ /** Optional CROSS delivery target passed to GET /v1/recovery. */
2259
+ target?: string;
2260
+ /** React Query lifecycle, cache, retry, and refetch policies. */
2261
+ query?: RelayRecoveryQueryOptions;
2262
+ /** Optional wallet capabilities. Read-only consumers may omit this. */
2263
+ wallet?: RelayWalletProps;
2264
+ /** Called when GET /v1/recovery returns 401. */
2265
+ onUnauthorized?: () => void;
2266
+ /** Called after a terminal query or recovery-action error. */
2267
+ onError?: (error: Error) => void;
2268
+ /** Called once after a recovery transaction confirms successfully. */
2269
+ onRecoverySuccess?: (result: RecoverySuccessResult) => void;
2270
+ /** Trusted factory override for a self-hosted deployment. */
2271
+ trustedFactories?: readonly string[];
2272
+ }
2273
+ interface UseRelayRecoveryResult {
2274
+ info?: RecoveryInfo;
2275
+ loading: boolean;
2276
+ error?: Error;
2277
+ /** True for background refetches as well as the first request. */
2278
+ isFetching: boolean;
2279
+ /** Invalidates no identities; immediately refetches this hook's fixed query. */
2280
+ refresh: () => void;
2281
+ /** Signs a recovery transaction for the currently fetched info. */
2282
+ recover: (action: RecoveryAction, tokenAddress?: string) => Promise<void>;
2283
+ recoveryState: RecoveryState;
2284
+ }
2285
+ /**
2286
+ * Public Recovery API hook. Unlike the widget-internal useRecovery fetch, this
2287
+ * hook uses the host QueryClient and accepts React Query policies through
2288
+ * `query`. queryKey/queryFn and balance-shaping options remain SDK-owned.
2289
+ */
2290
+ declare function useRelayRecovery(opts?: UseRelayRecoveryOptions): UseRelayRecoveryResult;
2291
+
2292
+ interface StatusTrackerProps {
2293
+ orderId: string;
2294
+ /** Latest polled order (steps/txs) from GET /v1/orders/{orderId}, owned by the caller. */
2295
+ order?: Order;
2296
+ /** Latest poll error, owned by the caller. */
2297
+ error?: Error;
2298
+ }
2299
+ declare function StatusTracker({ orderId, order, error }: StatusTrackerProps): react_jsx_runtime.JSX.Element;
2300
+
2301
+ /** Every StandingForwarderFactory / DepositorForwarderFactory this deployment
2302
+ * has issued deposit addresses from, on BSC.
2303
+ *
2304
+ * Superseded factories stay listed on purpose. A forwarder's factory is pinned
2305
+ * per address at issuance time (`standing_addresses.factory`, copied onto each
2306
+ * order), so a user recovering an address minted before a rotation legitimately
2307
+ * gets an older factory back from the API -- dropping it here would block that
2308
+ * user from recovering their own funds, which is a worse outcome than the
2309
+ * narrow trust gain. Every entry is one of ours either way.
2310
+ *
2311
+ * Rotation (see backends/deploy/RUNBOOK-canary.md): ADD the new factory, keep
2312
+ * the old ones. */
2313
+ declare const DEFAULT_TRUSTED_FACTORIES: readonly string[];
2314
+
2315
+ type GetOneUsdActionId = "swap" | "bridge" | "transfer";
2316
+ type GetOneUsdMode = "floating" | "button";
2317
+ type GetOneUsdButtonComponent = ElementType<ButtonHTMLAttributes<HTMLButtonElement>>;
2318
+ type GetOneUsdWaitForTransaction = (info: BridgeSubmittedInfo) => Promise<void>;
2319
+ interface GetOneUsdTokenRef {
2320
+ chainId: number;
2321
+ address: string;
2322
+ }
2323
+ interface GetOneUsdPairs {
2324
+ target: GetOneUsdTokenRef;
2325
+ swap: {
2326
+ from: GetOneUsdTokenRef;
2327
+ feeDelegated?: boolean;
2328
+ };
2329
+ bridge: {
2330
+ from: GetOneUsdTokenRef[];
2331
+ feeDelegated?: boolean;
2332
+ };
2333
+ }
2334
+ type GetOneUsdBridgeProps = Omit<BridgeFlowProps, "walletAddress" | "tokens" | "initialFromToken" | "initialToToken" | "env" | "onClose" | "onBackToWallet" | "className" | "title" | "variant" | "isConnected" | "onRequestConnect">;
2335
+ type GetOneUsdRelayProps = Omit<RelayDepositProps, "walletAddress" | "children" | "open" | "onOpenChange" | "requireWalletConnection" | "showRecipientInput" | "hideAmount" | "targetTokens" | "defaultTarget" | "onRequestConnect">;
2336
+ type GetOneUsdEvent = {
2337
+ name: "fab_click";
2338
+ state: "expanded" | "icon_only";
2339
+ } | {
2340
+ name: "action_select";
2341
+ action: GetOneUsdActionId;
2342
+ } | {
2343
+ name: "connect_click";
2344
+ action: GetOneUsdActionId;
2345
+ } | {
2346
+ name: "success";
2347
+ action: GetOneUsdActionId;
2348
+ txHash: string;
2349
+ } | {
2350
+ name: "failure";
2351
+ action: GetOneUsdActionId;
2352
+ message: string;
2353
+ };
2354
+ interface GetOneUsdProps {
2355
+ /** Connected wallet. A missing address renders a connect CTA in execution views. */
2357
2356
  walletAddress?: string;
2358
- onError?: (e: Error) => void;
2359
- /** Notified with the resolved explorer URL when a history row's tx link is
2360
- * clicked. Fire-and-forget -- unlike `OnOutlink` elsewhere in dapp-ui, it
2361
- * does not intercept navigation; the link still opens in a new tab as normal. */
2362
- onOutlink?: (url: string) => void;
2363
- /** Extra class name(s) for the modal/drawer content element. */
2364
- className?: string;
2357
+ /** Full token list supplied by a bridge adapter. It is never mutated. */
2358
+ tokens: BridgeToken[];
2359
+ /** Exact source/target token allowlist. May arrive after remote config loads. */
2360
+ pairs?: GetOneUsdPairs;
2361
+ /** True while the bridge adapter is resolving contracts/tokens. */
2362
+ loading?: boolean;
2363
+ /** View-only BridgeFlow transaction ports. */
2364
+ bridge: GetOneUsdBridgeProps;
2365
+ /** Relay configuration and low-level wallet ports. Built-in env URL is used when omitted. */
2366
+ relay?: GetOneUsdRelayProps;
2367
+ env?: Environment;
2368
+ targetSymbol?: string;
2369
+ /** Relay catalog delivery symbol. Defaults to the canonical `ONEUSD`. */
2370
+ relayTargetSymbol?: string;
2371
+ targetIconUrl?: string;
2372
+ /** Trigger layout. Transaction status always renders as a floating pill. */
2373
+ mode?: GetOneUsdMode;
2374
+ /** Custom styled trigger element used only in button mode. Must forward button props. */
2375
+ buttonComponent?: GetOneUsdButtonComponent;
2365
2376
  theme?: RelayTheme;
2366
2377
  mobileBreakpoint?: number;
2367
2378
  drawerDirection?: RelayDrawerDirection;
2368
2379
  dialogWidth?: string;
2369
2380
  drawerMaxWidth?: string;
2370
2381
  drawerMinWidth?: string;
2382
+ /** CSS variables/styles applied to the selected trigger. */
2371
2383
  style?: CSSProperties;
2372
- open?: boolean;
2373
- onOpenChange?: (open: boolean) => void;
2374
- children?: ReactNode;
2375
- }
2376
-
2377
- interface RelayDepositContentProps {
2378
- /** Extra class name(s) for the dialog/drawer content element. Falls back to
2379
- * `<RelayDeposit>`'s own `className`. */
2380
2384
  className?: string;
2385
+ contentClassName?: string;
2386
+ hidden?: boolean;
2387
+ /** Force the floating trigger to icon-only. Ignored in button mode. */
2388
+ compactTrigger?: boolean;
2389
+ collapseOnScroll?: boolean;
2390
+ scrollThreshold?: number;
2391
+ /**
2392
+ * Waits for an already-submitted Swap/Bridge transaction to confirm.
2393
+ * While pending, a non-interactive floating status pill is shown.
2394
+ * Omit only when submission itself is the final confirmation boundary.
2395
+ */
2396
+ waitForTransaction?: GetOneUsdWaitForTransaction;
2397
+ /** How long a confirmed/failed result stays on the floating button. Default 4000ms. */
2398
+ transactionResultDurationMs?: number;
2399
+ onRequestConnect?: () => void | Promise<void>;
2400
+ onEvent?: (event: GetOneUsdEvent) => void;
2381
2401
  }
2382
- /**
2383
- * `<RelayDeposit.Content>` — the modal/drawer surface. The deposit body is a
2384
- * child of `ShellContent`, i.e. of radix's `Dialog.Portal` / vaul's
2385
- * `Drawer.Portal`, which render nothing while closed. The state it renders is
2386
- * NOT its own any more: `<RelayDeposit>` mounts the wizard engine above the
2387
- * shell for exactly as long as the modal is open, so "no request before open"
2388
- * and "everything resets on close" still hold -- while a breakpoint crossing
2389
- * mid-flow now only rebuilds this DOM, not the flow.
2390
- */
2391
- declare function RelayDepositContent({ className }: RelayDepositContentProps): react_jsx_runtime.JSX.Element;
2392
-
2393
- interface RelayDepositTriggerProps {
2394
- /** Render the child as the trigger instead of wrapping it. Defaults to
2395
- * `true` whenever a child is supplied, matching
2396
- * `WalletConnectModalTrigger`'s `asChild ?? children != null`. */
2397
- asChild?: boolean;
2398
- children?: ReactNode;
2402
+ interface ResolvedGetOneUsdRoute {
2403
+ fromTokens: BridgeToken[];
2404
+ targetToken?: BridgeToken;
2399
2405
  }
2406
+
2407
+ declare function GetOneUsd({ walletAddress, tokens, pairs, loading, bridge, relay, env, targetSymbol: targetSymbolProp, relayTargetSymbol, targetIconUrl, mode, buttonComponent, theme, mobileBreakpoint, drawerDirection, dialogWidth, drawerMaxWidth, drawerMinWidth, style, className, contentClassName, hidden, compactTrigger, collapseOnScroll, scrollThreshold, waitForTransaction, transactionResultDurationMs, onRequestConnect, onEvent, }: GetOneUsdProps): react_jsx_runtime.JSX.Element;
2408
+
2409
+ type GetOneUsdRemoteModes = NonNullable<NonNullable<AppsConfig["getOneUsd"]>["modes"]>;
2400
2410
  /**
2401
- * Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
2402
- * vaul `Drawer.Trigger` on mobile) so hosts write
2403
- * `<RelayDeposit.Trigger><button>…</button></RelayDeposit.Trigger>` without
2404
- * knowing which primitive is active. Falls back to a plain default button when
2405
- * no child is given, same as `WalletConnectModalTrigger`.
2406
- *
2407
- * Wrapped in `<TrackingBoundary feature="relay">` for the same reason
2408
- * `WalletConnectModalTrigger` is: the `data-track="open"` attribute below (and
2409
- * on any host-supplied child that carries one) is only picked up by the
2410
- * analytics delegate a boundary installs. Without it the open click is silently
2411
- * untracked, since the trigger lives OUTSIDE the portaled `<Content>` boundary.
2411
+ * Swap/Bridge stay enabled when config is unavailable. Transfer Crypto is
2412
+ * opt-in and stays hidden until S3 explicitly enables it.
2412
2413
  */
2413
- declare function RelayDepositTrigger({ asChild, children }: RelayDepositTriggerProps): react_jsx_runtime.JSX.Element;
2414
+ declare function isGetOneUsdActionEnabled(action: GetOneUsdActionId, modes?: GetOneUsdRemoteModes): boolean;
2414
2415
 
2415
- declare function RelayDepositRoot(props: RelayDepositProps): react_jsx_runtime.JSX.Element;
2416
- declare const RelayDeposit: typeof RelayDepositRoot & {
2417
- Trigger: typeof RelayDepositTrigger;
2418
- Content: typeof RelayDepositContent;
2416
+ declare function getOneUsdTokenKey(token: GetOneUsdTokenRef): string;
2417
+ declare function matchesGetOneUsdToken(token: BridgeToken, ref: GetOneUsdTokenRef): boolean;
2418
+ declare function findGetOneUsdToken(tokens: BridgeToken[], ref?: GetOneUsdTokenRef): BridgeToken | undefined;
2419
+ /** Resolve an action's exact token allowlist without mutating adapter data. */
2420
+ declare function resolveGetOneUsdRoute(tokens: BridgeToken[], pairs: GetOneUsdPairs | undefined, action: Exclude<GetOneUsdActionId, "transfer">): ResolvedGetOneUsdRoute;
2421
+ declare function isGetOneUsdTargetAvailable(available: BridgeToken[], target: BridgeToken): boolean;
2422
+
2423
+ declare function CROSSxIcon(): react_jsx_runtime.JSX.Element;
2424
+ declare function MetaMaskIcon(): react_jsx_runtime.JSX.Element;
2425
+ declare function BinanceIcon(): react_jsx_runtime.JSX.Element;
2426
+ declare function Verse8Icon(): react_jsx_runtime.JSX.Element;
2427
+ declare function TronIcon(): react_jsx_runtime.JSX.Element;
2428
+ declare function GoogleIcon(): react_jsx_runtime.JSX.Element;
2429
+ declare function AppleIcon(): react_jsx_runtime.JSX.Element;
2430
+
2431
+ declare const WALLET_REGISTRY: {
2432
+ cross_embedded: {
2433
+ id: string;
2434
+ name: "ONEpocket with Social";
2435
+ description: string;
2436
+ icon: typeof CROSSxIcon;
2437
+ };
2438
+ cross_wallet: {
2439
+ id: string;
2440
+ name: "ONEpocket";
2441
+ description: string;
2442
+ icon: typeof CROSSxIcon;
2443
+ featured: true;
2444
+ };
2445
+ cross_extension: {
2446
+ id: string;
2447
+ name: "ONEpocket Extension";
2448
+ description: string;
2449
+ icon: typeof CROSSxIcon;
2450
+ rdns: string;
2451
+ installUrl: string;
2452
+ visibility: "desktop-only";
2453
+ };
2454
+ metamask: {
2455
+ id: string;
2456
+ name: string;
2457
+ description: string;
2458
+ icon: typeof MetaMaskIcon;
2459
+ rdns: string;
2460
+ };
2461
+ binance: {
2462
+ id: string;
2463
+ name: string;
2464
+ description: string;
2465
+ icon: typeof BinanceIcon;
2466
+ };
2467
+ verse8: {
2468
+ id: string;
2469
+ name: string;
2470
+ description: string;
2471
+ icon: typeof Verse8Icon;
2472
+ badge: string;
2473
+ };
2474
+ tron: {
2475
+ id: string;
2476
+ name: string;
2477
+ description: string;
2478
+ icon: typeof TronIcon;
2479
+ badge: string;
2480
+ };
2481
+ };
2482
+ type WalletId = keyof typeof WALLET_REGISTRY;
2483
+ declare const SOCIAL_REGISTRY: {
2484
+ google: {
2485
+ id: string;
2486
+ name: string;
2487
+ icon: typeof GoogleIcon;
2488
+ };
2489
+ apple: {
2490
+ id: string;
2491
+ name: string;
2492
+ icon: typeof AppleIcon;
2493
+ };
2419
2494
  };
2495
+ type SocialId = keyof typeof SOCIAL_REGISTRY;
2420
2496
 
2421
- interface RelayHistoryContentProps {
2422
- /** Extra class name(s) for the dialog/drawer content element. Falls back to
2423
- * `<RelayHistory>`'s own `className`. */
2424
- className?: string;
2497
+ /**
2498
+ * Per-instance layout overrides applied as inline CSS variables.
2499
+ *
2500
+ * Colors / typography are driven by the design system (`--ds-*`, published
2501
+ * by `CrossConnectKitProvider` from `@nexus-cross/crossx-design-system`) —
2502
+ * retheme there, not per modal. Only layout knobs remain here.
2503
+ */
2504
+ interface WalletConnectModalStyle extends CSSProperties {
2505
+ "--wcm-dialog-width"?: string;
2506
+ "--wcm-drawer-max-width"?: string;
2507
+ "--wcm-drawer-min-width"?: string;
2508
+ }
2509
+ type WalletVisibility = "always" | "mobile-only" | "desktop-only";
2510
+ interface WalletConfig {
2511
+ id: string;
2512
+ name: string;
2513
+ description: string;
2514
+ icon: () => ReactNode;
2515
+ rdns?: string;
2516
+ featured?: boolean;
2517
+ badge?: string;
2518
+ installUrl?: string;
2519
+ visibility?: WalletVisibility;
2520
+ }
2521
+ type WalletHandlers = Partial<Record<WalletId, () => void | Promise<void>>>;
2522
+ interface SocialConfig {
2523
+ id: string;
2524
+ name: string;
2525
+ icon: () => ReactNode;
2526
+ }
2527
+ type SocialHandlers = Partial<Record<SocialId, () => void | Promise<void>>>;
2528
+ type DrawerDirection = "bottom" | "left" | "right" | "top";
2529
+ interface WalletConnectModalProps {
2530
+ wallets: WalletHandlers;
2531
+ socialProviders?: SocialHandlers;
2532
+ /**
2533
+ * URL the "Terms of Service" link in the footer points to. When
2534
+ * omitted the text is rendered without an anchor (still styled in the
2535
+ * primary color to match the design).
2536
+ */
2537
+ termsUrl?: string;
2538
+ /** URL the "Privacy Policy" link in the footer points to. */
2539
+ privacyUrl?: string;
2540
+ theme?: "dark" | "light";
2541
+ mobileBreakpoint?: number;
2542
+ drawerDirection?: DrawerDirection;
2543
+ dialogWidth?: string;
2544
+ drawerMaxWidth?: string;
2545
+ drawerMinWidth?: string;
2546
+ style?: WalletConnectModalStyle;
2547
+ open?: boolean;
2548
+ onOpenChange?: (open: boolean) => void;
2549
+ children: ReactNode;
2425
2550
  }
2426
- /**
2427
- * `<RelayHistory.Content>` — the modal/drawer surface. Like
2428
- * `RelayDepositContent`, this is a child of `ShellContent`, i.e. of radix's
2429
- * `Dialog.Portal` / vaul's `Drawer.Portal`, which render nothing while
2430
- * closed: no `listOrders` request happens before the modal is opened, and the
2431
- * subtree unmounts on close -- there is no per-open state here to reset
2432
- * explicitly (unlike `RelayDepositBody`'s step/panel state), so
2433
- * unmount-by-portal is the whole story.
2434
- */
2435
- declare function RelayHistoryContent({ className }: RelayHistoryContentProps): react_jsx_runtime.JSX.Element;
2436
-
2437
- interface RelayHistoryTriggerProps {
2438
- /** Render the child as the trigger instead of wrapping it. Defaults to
2439
- * `true` whenever a child is supplied, matching `RelayDepositTrigger`'s
2440
- * (and `WalletConnectModalTrigger`'s) `asChild ?? children != null` rule. */
2551
+ interface WalletConnectModalTriggerProps {
2441
2552
  asChild?: boolean;
2442
2553
  children?: ReactNode;
2443
2554
  }
2444
- /**
2445
- * Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
2446
- * vaul `Drawer.Trigger` on mobile), mirroring `RelayDepositTrigger` so hosts
2447
- * write `<RelayHistory.Trigger><button>…</button></RelayHistory.Trigger>`
2448
- * without knowing which primitive is active. Falls back to a plain default
2449
- * button when no child is given.
2450
- *
2451
- * Wrapped in `<TrackingBoundary feature="relay">` for the same reason
2452
- * `RelayDepositTrigger`/`WalletConnectModalTrigger` are: `data-track="open"` is
2453
- * only read by the delegate a boundary installs, and this trigger sits OUTSIDE
2454
- * the portaled `<Content>`'s own boundary.
2455
- */
2456
- declare function RelayHistoryTrigger({ asChild, children }: RelayHistoryTriggerProps): react_jsx_runtime.JSX.Element;
2555
+ interface WalletConnectModalContentProps {
2556
+ className?: string;
2557
+ }
2457
2558
 
2458
- declare function RelayHistoryRoot(props: RelayHistoryProps): react_jsx_runtime.JSX.Element;
2459
- declare const RelayHistory: typeof RelayHistoryRoot & {
2460
- Trigger: typeof RelayHistoryTrigger;
2461
- Content: typeof RelayHistoryContent;
2559
+ declare function WalletConnectModalTrigger({ asChild, children, }: WalletConnectModalTriggerProps): react_jsx_runtime.JSX.Element;
2560
+
2561
+ declare function WalletConnectModalContent({ className, }: WalletConnectModalContentProps): react_jsx_runtime.JSX.Element;
2562
+
2563
+ declare function WalletConnectModalRoot({ wallets, socialProviders, termsUrl, privacyUrl, theme, mobileBreakpoint, drawerDirection, dialogWidth, drawerMaxWidth, drawerMinWidth, style, open: openProp, onOpenChange, children, }: WalletConnectModalProps): react_jsx_runtime.JSX.Element;
2564
+ declare const WalletConnectModal: typeof WalletConnectModalRoot & {
2565
+ Trigger: typeof WalletConnectModalTrigger;
2566
+ Content: typeof WalletConnectModalContent;
2462
2567
  };
2463
2568
 
2464
- interface RelayRecoveryContentProps {
2465
- /** Extra class name(s) for the dialog/drawer content element. Falls back to
2466
- * `<RelayRecovery>`'s own `className`. */
2467
- className?: string;
2569
+ interface DetectedWallet {
2570
+ rdns: string;
2571
+ name: string;
2572
+ icon?: string;
2573
+ }
2574
+ interface WalletDetectResult {
2575
+ wallets: DetectedWallet[];
2576
+ isDetected: (rdns: string) => boolean;
2577
+ isLoading: boolean;
2468
2578
  }
2579
+ declare function useWalletDetect(): WalletDetectResult;
2580
+
2469
2581
  /**
2470
- * `<RelayRecovery.Content>` the modal/drawer surface. Same portal-scoped
2471
- * lifecycle as `<RelayHistory.Content>`: nothing is requested before the modal
2472
- * is opened, and the whole subtree (including `useRecovery`'s state and any
2473
- * in-flight recovery tracking) unmounts on close, so there is no per-open state
2474
- * to reset explicitly.
2582
+ * `ConnectButton`의 `style` prop 타입. 표준 `CSSProperties` 위에
2583
+ * `--cb-*` CSS 커스텀 변수 키를 추가해 자동완성을 지원한다.
2584
+ *
2585
+ * 사용 예: `style={{ "--cb-bg": "#7346f3", "--cb-pill-bg": "#1a1a2e" }}`
2586
+ *
2587
+ * 변수는 ConnectButton 의 모든 상태(disconnected / connecting / connected
2588
+ * pill)에 cascading 된다. WalletInfo popover 의 스타일은 별도
2589
+ * `walletInfoStyle` prop 으로 분리되어 있다.
2475
2590
  */
2476
- declare function RelayRecoveryContent({ className }: RelayRecoveryContentProps): react_jsx_runtime.JSX.Element;
2477
-
2478
- interface RelayRecoveryTriggerProps {
2479
- /** Render the child as the trigger instead of wrapping it. Defaults to
2480
- * `true` whenever a child is supplied, matching `RelayHistoryTrigger`'s
2481
- * (and `RelayDepositTrigger`'s) `asChild ?? children != null` rule. */
2482
- asChild?: boolean;
2483
- children?: ReactNode;
2591
+ interface ConnectButtonStyle extends CSSProperties {
2592
+ "--cb-bg"?: string;
2593
+ "--cb-bg-hover"?: string;
2594
+ "--cb-color"?: string;
2595
+ "--cb-border"?: string;
2596
+ "--cb-radius"?: string;
2597
+ "--cb-height"?: string;
2598
+ "--cb-padding"?: string;
2599
+ "--cb-font-family"?: string;
2600
+ "--cb-font-size"?: string;
2601
+ "--cb-font-weight"?: string | number;
2602
+ "--cb-line-height"?: string | number;
2603
+ "--cb-letter-spacing"?: string;
2604
+ "--cb-gap"?: string;
2605
+ "--cb-transition"?: string;
2606
+ "--cb-loading-opacity"?: string | number;
2607
+ "--cb-press-scale"?: string | number;
2608
+ "--cb-icon-size"?: string;
2609
+ "--cb-spinner-size"?: string;
2610
+ "--cb-spinner-thumb"?: string;
2611
+ "--cb-spinner-track"?: string;
2612
+ "--cb-pill-bg"?: string;
2613
+ "--cb-pill-bg-hover"?: string;
2614
+ "--cb-pill-color"?: string;
2615
+ "--cb-pill-border"?: string;
2616
+ "--cb-pill-radius"?: string;
2617
+ "--cb-pill-height"?: string;
2618
+ "--cb-pill-padding"?: string;
2619
+ "--cb-pill-press-scale"?: string | number;
2620
+ "--cb-pill-font-family"?: string;
2621
+ "--cb-pill-font-size"?: string;
2622
+ "--cb-pill-font-weight"?: string | number;
2623
+ "--cb-pill-line-height"?: string | number;
2624
+ "--cb-pill-gap"?: string;
2625
+ "--cb-pill-icon-size"?: string;
2626
+ "--cb-pill-icon-placeholder-bg"?: string;
2627
+ "--cb-pill-address-font"?: string;
2628
+ "--cb-pill-address-font-size"?: string;
2629
+ "--cb-pill-address-letter-spacing"?: string;
2484
2630
  }
2485
2631
  /**
2486
- * Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
2487
- * vaul `Drawer.Trigger` on mobile), mirroring `RelayHistoryTrigger` so hosts
2488
- * write `<RelayRecovery.Trigger><button>…</button></RelayRecovery.Trigger>`
2489
- * without knowing which primitive is active. Falls back to a plain-text
2490
- * "Recover" button when no child is given -- unstyled like the sibling
2491
- * `RelayDepositTrigger`/`RelayHistoryTrigger` defaults, so it inherits the
2492
- * host's own button chrome instead of shipping a look of its own.
2632
+ * Resolved wallet provider determines which icon + display name appears
2633
+ * in the connected pill.
2634
+ *
2635
+ * - `google` / `apple`: crossy-sdk 2.0 OAuth login types (embedded wallet)
2636
+ * - `cross`: generic CROSSx mark (covers CROSSx 1.0 extension/app + 2.0
2637
+ * embedded when no OAuth provider is attached)
2638
+ * - `metamask` / `binance`: external wallets
2639
+ */
2640
+ type WalletProvider = "google" | "apple" | "cross" | "metamask" | "binance";
2641
+ interface ConnectButtonProps {
2642
+ /** 사용자가 Connect 버튼을 눌러 연결이 진행 중. 스피너 버튼으로 전환된다. */
2643
+ isConnecting?: boolean;
2644
+ /**
2645
+ * 0x… 지갑 주소. 지정되면 connected pill로 렌더링된다. 없으면
2646
+ * disconnected 버튼("Connect Wallet")으로 떨어진다.
2647
+ */
2648
+ address?: string;
2649
+ /**
2650
+ * 트리거 pill에 표시될 provider 아이콘 키.
2651
+ *
2652
+ * `address`가 있는데 `provider`가 `undefined`면 SDK 조회 중인 전이
2653
+ * 상태로 취급해 placeholder 원을 띄운다(`pending` 플래시 방지).
2654
+ */
2655
+ provider?: WalletProvider;
2656
+ /**
2657
+ * 트리거 버튼 aria-label에 포함될 provider 표시 이름. 미지정 시
2658
+ * `provider`로부터 기본값이 유추된다 (예: 'Google', 'CROSSx').
2659
+ */
2660
+ providerName?: string;
2661
+ /** WalletInfo 헤더에 노출될 계정 라벨 (예: "Account 1", 사용자 지정 이름). */
2662
+ accountName?: string;
2663
+ /** Send 주소록의 My Account 탭에 노출할 계정 목록. */
2664
+ sendAccounts?: SendAccount[];
2665
+ /** disconnected 상태에서 버튼 클릭 핸들러. */
2666
+ onConnect?: () => void;
2667
+ /** connected 상태에서 WalletInfo 하단 Disconnect 클릭 핸들러. */
2668
+ onDisconnect?: () => void;
2669
+ /**
2670
+ * 주소 복사 성공 콜백. WalletInfo의 `onCopyAddress(address, success)` 에서
2671
+ * `success === true`일 때만 호출된다.
2672
+ */
2673
+ onCopy?: () => void;
2674
+ /** 지갑 변경 chevron 클릭 핸들러. 지정하지 않으면 chevron이 숨김 처리된다. */
2675
+ onSelectWallet?: () => void;
2676
+ /**
2677
+ * WalletInfo 기본 액션 row의 Buy 클릭 핸들러. Promise를 반환하면 reject 시
2678
+ * Buy 카드가 `onBuyDisabledMessage`와 동일한 토스트로 실패를 안내한다.
2679
+ */
2680
+ onBuy?: () => void | Promise<void>;
2681
+ /**
2682
+ * Buy 카드를 시각적으로 비활성 상태로 표시하고, 사용자가 클릭하면 이 메시지를
2683
+ * 토스트로 띄운다. `onBuy`보다 우선. WalletInfoProps의 동일 prop으로 그대로
2684
+ * 전달된다.
2685
+ */
2686
+ onBuyDisabledMessage?: string;
2687
+ /**
2688
+ * disconnected 버튼 라벨. 기본 'Connect Wallet'.
2689
+ * 문자열 외에 ReactNode를 넘겨 아이콘-only / 커스텀 마크업을 렌더할 수 있다
2690
+ * (모바일에서 아이콘만 보여주고 싶을 때 등).
2691
+ */
2692
+ label?: ReactNode;
2693
+ /** isConnecting 상태 라벨. 기본 'Connecting...'. */
2694
+ connectingLabel?: ReactNode;
2695
+ /** WalletInfo 내장 Disconnect 버튼 라벨. 기본 'Disconnect'. */
2696
+ disconnectLabel?: string;
2697
+ /**
2698
+ * 외부(호출부)에서 주입하는 className. disconnected / connecting /
2699
+ * connected(트리거 pill)에 공통으로 추가된다 (기본 `cb-button` /
2700
+ * `cb-pill` 클래스에 병합).
2701
+ */
2702
+ className?: string;
2703
+ /**
2704
+ * 버튼 자체(`disconnected` / `connecting` / `connected pill`)의
2705
+ * CSS 커스텀 변수 오버라이드. WalletInfo popover 스타일은 별도
2706
+ * `walletInfoStyle` 로 분리되어 있다.
2707
+ */
2708
+ style?: ConnectButtonStyle;
2709
+ /**
2710
+ * 트리거 pill 을 눌러 열리는 WalletInfo popover/drawer 의 CSS
2711
+ * 커스텀 변수 오버라이드 (`WalletInfoStyle`).
2712
+ */
2713
+ walletInfoStyle?: WalletInfoStyle;
2714
+ theme?: Theme;
2715
+ env?: Environment;
2716
+ showBalance?: boolean;
2717
+ showPortfolio?: boolean;
2718
+ drawerDirection?: DrawerDirection$1;
2719
+ modal?: boolean;
2720
+ connectorId?: ConnectorId;
2721
+ /** Send 페이지의 일반 토큰 전송에 사용할 외부 트랜잭션 전송 함수. */
2722
+ sendTransaction?: SendTransactionFn$1;
2723
+ getTransactionReceipt?: GetTransactionReceiptFn;
2724
+ /**
2725
+ * Send 확인 단계의 가스/수수료 추정 함수. 미주입 시 SendPage Confirm 화면의
2726
+ * Est. Tx Fee / Gas Limit / Max. Total Amount 행이 "—"로 표시된다.
2727
+ */
2728
+ estimateGas?: EstimateGasFn;
2729
+ /**
2730
+ * 상단 QR 버튼 / 기본 액션 row의 Receive / Send 콜백. (Buy는 위 onBuy로
2731
+ * 정의됨.)
2732
+ */
2733
+ onReceive?: () => void;
2734
+ /**
2735
+ * @deprecated Bridge 버튼은 항상 apps.json(gametokenBridge) 웹으로
2736
+ * 이동한다. 이 콜백은 더 이상 호출되지 않는다.
2737
+ */
2738
+ onBridge?: () => void;
2739
+ onSend?: () => void;
2740
+ bridgeTokens?: BridgeToken[];
2741
+ bridgeHistory?: BridgeHistoryItem[];
2742
+ getBridgeQuote?: BridgeQuoteFn;
2743
+ getBridgeToTokens?: BridgeGetToTokensFn;
2744
+ getBridgeApproval?: BridgeGetApprovalFn;
2745
+ approveBridge?: BridgeApproveFn;
2746
+ submitBridge?: BridgeSubmitFn;
2747
+ }
2748
+
2749
+ /**
2750
+ * 3-state wallet connect button. Caller drives the visual state:
2493
2751
  *
2494
- * The default button renders NO count badge (2026-07-30: removed on request --
2495
- * the number read as an unread-notification alarm). The root's cross-target
2496
- * recoverable count still reaches the trigger element as
2497
- * `data-rd-recovery-count` (radix/vaul merge Trigger props onto the `asChild`
2498
- * child too), so a host that WANTS a badge can opt in with its own CSS -- e.g.
2499
- * `button[data-rd-recovery-count]:not([data-rd-recovery-count="0"])::after` --
2500
- * without refetching anything.
2752
+ * - `isConnecting === true` → 스피너 disabled 버튼
2753
+ * - `address` 있음 → WalletInfo + connected pill
2754
+ * - `address`가 있는데 `provider` 없음 SDK 조회 전이 상태, placeholder 원
2755
+ * - 없음 → "Connect Wallet" 버튼
2501
2756
  *
2502
- * Wrapped in `<TrackingBoundary feature="relay">` for the same reason
2503
- * `RelayHistoryTrigger` is: `data-track="open"` is only read by the delegate a
2504
- * boundary installs, and this trigger sits OUTSIDE the portaled `<Content>`'s
2505
- * own boundary.
2757
+ * view-only: wagmi / connect-kit 같은 web3 의존성은 갖지 않으며 모든
2758
+ * 상태/데이터/콜백은 props로 주입받는다. 실제 wagmi 연결 로직은
2759
+ * `@nexus-cross/connect-kit-react`의 상위 래퍼에서 수행한다.
2506
2760
  */
2507
- declare function RelayRecoveryTrigger({ asChild, children }: RelayRecoveryTriggerProps): react_jsx_runtime.JSX.Element;
2508
-
2509
- declare function RelayRecoveryRoot(props: RelayRecoveryProps): react_jsx_runtime.JSX.Element;
2510
- declare const RelayRecovery: typeof RelayRecoveryRoot & {
2511
- Trigger: typeof RelayRecoveryTrigger;
2512
- Content: typeof RelayRecoveryContent;
2513
- };
2514
-
2515
- interface UseRelayOrdersOptions {
2516
- client: RelayClient;
2517
- /** Valid EVM address, or undefined -- undefined clears the list and stops polling. */
2518
- recipient?: string;
2519
- /** Gate: wait for truthy before the first fetch (RelayDeposit passes rawCatalog). Default true. */
2520
- enabled?: boolean;
2521
- /** Keep the snapshot live with SSE + fallback polling. Default true. */
2522
- live?: boolean;
2523
- /** REST safety-net cadence in milliseconds. Defaults to 30s; the open Deposit popup uses 1s
2524
- * so completion still appears promptly when the SSE event is absent. */
2525
- refetchInterval?: number;
2526
- /** @deprecated Use `refetchInterval`. Retained for compatibility. */
2527
- fallbackPollMs?: number;
2528
- onError?: (e: Error) => void;
2529
- }
2530
- interface UseRelayOrdersResult {
2531
- /** Every order swept from deposits to this recipient so far, newest-first
2532
- * as served by the API. Kept live unless `live: false` requests one snapshot. */
2533
- orders: OrderSummary[];
2534
- ordersLoading: boolean;
2535
- ordersError?: Error;
2536
- /** Recipient the current snapshot belongs to. Undefined while a new
2537
- * subscription is waiting for its first accepted fetch, so consumers never
2538
- * baseline a previous recipient's rows as fresh deposits. */
2539
- ordersForRecipient?: string;
2540
- /** Increments after every accepted fetch, even when the client returns the
2541
- * same array reference or the request fails. Consumers use this as a
2542
- * low-frequency refresh signal for related read models such as /recovery. */
2543
- ordersRevision: number;
2544
- /** True once at least one fetch has COMPLETED (success or failure) for the
2545
- * current (recipient, enabled) subscription; false again when it resets.
2546
- * Distinct from `!ordersLoading`, which is also true BEFORE the first fetch
2547
- * has even started -- consumers that snapshot the list (e.g. the deposit
2548
- * wizard's new-order watch) must wait for this, or they baseline against
2549
- * the initial empty state and misread every existing order as new. */
2550
- ordersInitialized: boolean;
2551
- }
2552
- declare function useRelayOrders(opts: UseRelayOrdersOptions): UseRelayOrdersResult;
2761
+ declare function ConnectButton({ isConnecting, address, provider, providerName, accountName, sendAccounts, onConnect, onDisconnect, onCopy, onSelectWallet, onBuy, onBuyDisabledMessage, label, connectingLabel, disconnectLabel, className, theme, env, showBalance, showPortfolio, drawerDirection, modal, connectorId, style, walletInfoStyle, sendTransaction, getTransactionReceipt, estimateGas, onReceive, onBridge, onSend, bridgeTokens, bridgeHistory, getBridgeQuote, getBridgeToTokens, getBridgeApproval, approveBridge, submitBridge, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
2553
2762
 
2554
- interface UseRelayConfigOptions {
2555
- /** Pre-built client. Takes precedence over apiBaseUrl. */
2556
- client?: RelayClient;
2557
- /** Used to build a client when `client` is not supplied. */
2558
- apiBaseUrl?: string;
2559
- /** Stops the request and clears the current snapshot. Defaults to true. */
2560
- enabled?: boolean;
2561
- /** Optional automatic REST refresh cadence in milliseconds. Disabled when omitted or <= 0. */
2562
- refetchInterval?: number;
2563
- onError?: (error: Error) => void;
2564
- }
2565
- interface UseRelayConfigResult {
2566
- /** Latest GET /v1/config response. */
2567
- config?: Catalog;
2568
- loading: boolean;
2569
- error?: Error;
2570
- /** Re-fetches GET /v1/config using the current client. */
2571
- refresh: () => void;
2572
- }
2573
2763
  /**
2574
- * Public read-only hook for Relay's origin/destination/target catalog.
2764
+ * Wallet provider icons used by `ConnectButton`. Ported from
2765
+ * `@nexus-cross/connect-kit-wagmi` so dapp-ui stays a self-contained,
2766
+ * bundler-agnostic module (no SVG loader required) and doesn't pull in a
2767
+ * web3 dependency for icon assets.
2575
2768
  *
2576
- * The response is a normal REST snapshot, not an SSE stream. Use
2577
- * `refetchInterval` for periodic refreshes or call `refresh` for an immediate
2578
- * read without replacing the client or remounting the component.
2769
+ * Each icon is an inline `data:image/svg+xml` URI so it can be consumed
2770
+ * directly by `<img src={...}>`.
2771
+ *
2772
+ * Source references mirror the ones in `connect-kit-wagmi/src/wallets/icons.ts`:
2773
+ * wallet-crossx.svg → CROSSX_ICON (cross / cross-extension / cross-embedded fallback)
2774
+ * wallet-metamask.svg → METAMASK_ICON
2775
+ * wallet-binance.svg → BINANCE_ICON
2579
2776
  */
2580
- declare function useRelayConfig(opts?: UseRelayConfigOptions): UseRelayConfigResult;
2581
-
2582
- type RecoveryAction = "execute" | "sweep";
2583
- /** Per-attempt progress for `recover()`. "switching" = prompting a chain switch to BSC;
2584
- * "deploying" = the factory.deploy() write is in flight/confirming (only needed when the
2585
- * forwarder wasn't deployed yet); "recovering" = the execute()/sweepToUser() write is in
2586
- * flight/confirming; "done"/"error" are terminal for this attempt. */
2587
- type RecoveryStep = "idle" | "switching" | "deploying" | "recovering" | "done" | "error";
2588
- interface RecoveryState {
2589
- step: RecoveryStep;
2590
- /** Tx hash of the factory.deploy() write -- only set when this attempt needed one. */
2591
- deployTxHash?: string;
2592
- /** Tx hash of the execute()/sweepToUser() write. */
2593
- actionTxHash?: string;
2594
- error?: string;
2595
- }
2777
+ declare const CROSSX_ICON: string;
2778
+ declare const METAMASK_ICON: string;
2779
+ declare const BINANCE_ICON: string;
2780
+ declare const GOOGLE_ICON: string;
2781
+ declare const APPLE_ICON: string;
2596
2782
 
2597
- type RelayRecoveryQueryKey = readonly [
2598
- "relay",
2599
- "recovery",
2600
- number,
2601
- string | null,
2602
- string | null
2603
- ];
2604
2783
  /**
2605
- * React Query policies accepted by useRelayRecovery. The SDK owns the request
2606
- * identity and response shape, so callers cannot replace queryKey/queryFn or
2607
- * inject/select recovery balances.
2784
+ * `SkillsButton`의 `style` prop 타입. 표준 `CSSProperties` 위에
2785
+ * `--sb-*` CSS 커스텀 변수 키를 추가해 자동완성을 지원한다.
2786
+ *
2787
+ * 사용 예: `style={{ "--sb-color": "white", "--sb-bg": "rgba(0,0,0,0.4)" }}`
2788
+ *
2789
+ * CSS 변수는 자식 요소(아이콘, 스피너)로 cascading 되므로, `--sb-color`
2790
+ * 하나만 바꿔도 텍스트·아이콘·스피너가 모두 같은 색을 따라간다.
2608
2791
  */
2609
- type RelayRecoveryQueryOptions = Omit<UseQueryOptions<RecoveryInfo, Error, RecoveryInfo, RelayRecoveryQueryKey>, "queryKey" | "queryFn" | "select" | "initialData" | "initialDataUpdatedAt" | "placeholderData">;
2610
- interface UseRelayRecoveryOptions {
2611
- /** Pre-built client. Takes precedence over apiBaseUrl. */
2612
- client?: RelayClient;
2613
- /** Used to build a client via createRelayClient when client isn't passed. */
2614
- apiBaseUrl?: string;
2615
- /** Connected EVM wallet whose recoverable forwarder balances are queried. */
2616
- recipient?: string;
2617
- /** Optional CROSS delivery target passed to GET /v1/recovery. */
2618
- target?: string;
2619
- /** React Query lifecycle, cache, retry, and refetch policies. */
2620
- query?: RelayRecoveryQueryOptions;
2621
- /** Optional wallet capabilities. Read-only consumers may omit this. */
2622
- wallet?: RelayWalletProps;
2623
- /** Called when GET /v1/recovery returns 401. */
2624
- onUnauthorized?: () => void;
2625
- /** Called after a terminal query or recovery-action error. */
2626
- onError?: (error: Error) => void;
2627
- /** Called once after a recovery transaction confirms successfully. */
2628
- onRecoverySuccess?: (result: RecoverySuccessResult) => void;
2629
- /** Trusted factory override for a self-hosted deployment. */
2630
- trustedFactories?: readonly string[];
2792
+ interface SkillsButtonStyle extends CSSProperties {
2793
+ "--sb-bg"?: string;
2794
+ "--sb-border"?: string;
2795
+ "--sb-border-hover"?: string;
2796
+ "--sb-color"?: string;
2797
+ "--sb-color-hover"?: string;
2798
+ "--sb-radius"?: string;
2799
+ "--sb-height"?: string;
2800
+ "--sb-padding"?: string;
2801
+ "--sb-gap"?: string;
2802
+ "--sb-font-size"?: string;
2803
+ "--sb-font-weight"?: string | number;
2804
+ "--sb-line-height"?: string | number;
2805
+ "--sb-letter-spacing"?: string;
2806
+ "--sb-blur"?: string;
2807
+ "--sb-border-width"?: string;
2808
+ "--sb-icon-size"?: string;
2809
+ "--sb-icon-hover-rotation"?: string;
2810
+ "--sb-spinner-size"?: string;
2811
+ "--sb-spinner-thumb"?: string;
2812
+ "--sb-spinner-track"?: string;
2813
+ "--sb-disabled-opacity"?: string | number;
2814
+ "--sb-press-scale"?: string | number;
2815
+ "--sb-hover-duration"?: string;
2816
+ "--sb-icon-duration"?: string;
2817
+ "--sb-easing"?: string;
2631
2818
  }
2632
- interface UseRelayRecoveryResult {
2633
- info?: RecoveryInfo;
2634
- loading: boolean;
2635
- error?: Error;
2636
- /** True for background refetches as well as the first request. */
2637
- isFetching: boolean;
2638
- /** Invalidates no identities; immediately refetches this hook's fixed query. */
2639
- refresh: () => void;
2640
- /** Signs a recovery transaction for the currently fetched info. */
2641
- recover: (action: RecoveryAction, tokenAddress?: string) => Promise<void>;
2642
- recoveryState: RecoveryState;
2819
+ interface SkillsButtonProps {
2820
+ /** Button text label */
2821
+ label?: string;
2822
+ /** Skills service URL or path to navigate to */
2823
+ href?: string;
2824
+ /** Called when button is clicked (instead of navigation if provided) */
2825
+ onClick?: () => void | Promise<void>;
2826
+ /** Optional CSS class name (merged with built-in `.sb-button`) */
2827
+ className?: string;
2828
+ /** Inline style + CSS custom property overrides (`SkillsButtonStyle`) */
2829
+ style?: SkillsButtonStyle;
2830
+ /** Light/dark surface preset (sets `data-theme`). Defaults to no preset. */
2831
+ theme?: Theme;
2832
+ /** Disable the button */
2833
+ disabled?: boolean;
2834
+ /** Whether button is in loading state */
2835
+ isLoading?: boolean;
2836
+ /** Label shown while loading */
2837
+ loadingLabel?: string;
2838
+ /** Open link in new tab */
2839
+ openInNewTab?: boolean;
2840
+ /** Button type attribute */
2841
+ type?: "button" | "submit" | "reset";
2643
2842
  }
2843
+
2644
2844
  /**
2645
- * Public Recovery API hook. Unlike the widget-internal useRecovery fetch, this
2646
- * hook uses the host QueryClient and accepts React Query policies through
2647
- * `query`. queryKey/queryFn and balance-shaping options remain SDK-owned.
2845
+ * @deprecated 이동 대상은 apps.json(skills)이 단일 소스다. 상수는 이상
2846
+ * 폴백으로 쓰이지 않으며 하위 호환(공개 export)용으로만 남아 있다.
2648
2847
  */
2649
- declare function useRelayRecovery(opts?: UseRelayRecoveryOptions): UseRelayRecoveryResult;
2650
-
2651
- interface StatusTrackerProps {
2652
- orderId: string;
2653
- /** Latest polled order (steps/txs) from GET /v1/orders/{orderId}, owned by the caller. */
2654
- order?: Order;
2655
- /** Latest poll error, owned by the caller. */
2656
- error?: Error;
2657
- }
2658
- declare function StatusTracker({ orderId, order, error }: StatusTrackerProps): react_jsx_runtime.JSX.Element;
2659
-
2660
- /** Every StandingForwarderFactory / DepositorForwarderFactory this deployment
2661
- * has issued deposit addresses from, on BSC.
2662
- *
2663
- * Superseded factories stay listed on purpose. A forwarder's factory is pinned
2664
- * per address at issuance time (`standing_addresses.factory`, copied onto each
2665
- * order), so a user recovering an address minted before a rotation legitimately
2666
- * gets an older factory back from the API -- dropping it here would block that
2667
- * user from recovering their own funds, which is a worse outcome than the
2668
- * narrow trust gain. Every entry is one of ours either way.
2669
- *
2670
- * Rotation (see backends/deploy/RUNBOOK-canary.md): ADD the new factory, keep
2671
- * the old ones. */
2672
- declare const DEFAULT_TRUSTED_FACTORIES: readonly string[];
2848
+ declare const DEFAULT_SKILLS_HREF = "https://www.onechain.nexus/skills";
2849
+ declare function SkillsButton({ label, href, onClick, className, style, theme, disabled, isLoading, loadingLabel, openInNewTab, type, }: SkillsButtonProps): react_jsx_runtime.JSX.Element;
2673
2850
 
2674
- export { APPLE_ICON, AppLauncher, AppLauncherContent, type AppLauncherContentProps, type AppLauncherProps, AppLauncherTrigger, type AppLauncherTriggerProps, type AppLauncherTriggerStyle, type AppLauncherUsageMode, BINANCE_ICON, type BridgeAmountSource, type BridgeApprovalInfo, type BridgeApproveFn, type BridgeFailedInfo, BridgeFlow, type BridgeFlowProps, type BridgeGetApprovalFn, type BridgeGetToTokensFn, type BridgeHistoryItem, type BridgeInfoRow, type BridgeInfoTokenRef, type BridgeLiquidityInfo, type BridgePathType, type BridgeQuoteFn, type BridgeQuoteInput, type BridgeQuoteResult, type BridgeStatus, type BridgeStep, type BridgeSubmitFn, type BridgeSubmittedInfo, type BridgeToken, type BridgeTxSummary, CHAINS_CONFIG_FILE, CONNECTOR_REGISTRY, CROSSX_ICON, type Catalog, type ChainDisplayMeta, type ChainId, type ChainsConfig, ConnectButton, type ConnectButtonProps, type ConnectButtonStyle, ConnectorId, type ConnectorMeta, type CrossdPosition, type CrossdPositionDetail, type CrossdPositionPoolRef, type CrossdPositionTokenRef, DEFAULT_SKILLS_HREF, DEFAULT_TRUSTED_FACTORIES, DappUiErrorBoundary, type DappUiErrorBoundaryProps, type DappUiFailureReason, type DappUiFeature, type DappUiFlow, type DepositAddressResult, type DrawerDirection$1 as DrawerDirection, type Environment, type EstimateGasArgs, type EstimateGasFn, GOOGLE_ICON, type GameSwapPool, type GameSwapTokenRef, type GasEstimate, type GetBalanceFn, type GetTransactionReceiptArgs, type GetTransactionReceiptFn, type GlobalMenu, type GlobalMenuItem, type GlobalMenuItemAssetUrl, type GlobalMenuItemServiceStatus, type GlobalMenuItemUrl, type InitDappUiSentryOptions, type LpBalanceInfo, type LpBalanceReaderFn, METAMASK_ICON, type OnOutlink, type OrderSummary, type OriginOption, type OutlinkCategory, type OutlinkContext, type OutlinkOrigin, PORTFOLIO_SECTIONS, type PortfolioSection, type PreferredToken, type QuoteResult, type ReadContractFn, type RecentSendAddress, type RecoveryInfo, type RecoverySuccessResult, RelayApiError, type RelayBalance, type RelayClient, type RelayClientOptions, type RelayContractCall, RelayDeposit, type RelayDepositContentProps, type RelayDepositProps, type RelayDepositTriggerProps, type RelayDrawerDirection, type Hex as RelayHex, RelayHistory, type RelayHistoryContentProps, type RelayHistoryProps, type RelayHistoryTriggerProps, RelayRecovery, type RecoveryAction as RelayRecoveryAction, type RelayRecoveryContentProps, type RelayRecoveryProps, type RelayRecoveryQueryKey, type RelayRecoveryQueryOptions, type RecoveryState as RelayRecoveryState, type RecoveryStep as RelayRecoveryStep, type RelayRecoveryTriggerProps, type SendTransactionFn as RelaySendTransactionFn, type RelayTheme, type RelayTxRequest, type RelayWalletProps, SOCIAL_REGISTRY, type SendAccount, type SendAsset, SendFlow, type SendFlowProps, type SendPageProps, type SendStatus, type SendTransactionArgs, type SendTransactionFn$1 as SendTransactionFn, SkillsButton, type SkillsButtonProps, type SkillsButtonStyle, type SocialConfig, type SocialHandlers, type SocialId, type StakingRewardsInfo, type StakingRewardsReaderFn, StatusTracker, type StatusTrackerProps, type SwitchChainFn, TOKEN_STATS_QUERY_KEY, type Theme, type TokenBalance, type TokenBalanceResponse, type TokenStats, type TokenStatsResponse, type TrackDappUiFunnelOptions, type TransactionReceiptResult, USER_BALANCE_QUERY_KEY, type UseRelayConfigOptions, type UseRelayConfigResult, type UseRelayOrdersOptions, type UseRelayOrdersResult, type UseRelayRecoveryOptions, type UseRelayRecoveryResult, WALLET_REGISTRY, type WaitForReceiptFn, type WalletConfig, WalletConnectModal, type WalletConnectModalContentProps, type WalletConnectModalProps, type WalletConnectModalStyle, type WalletConnectModalTriggerProps, type WalletHandlers, type WalletId, WalletInfo, type WalletInfoContentProps, type WalletInfoFooterProps, type WalletInfoNavProps, type WalletInfoProps, type WalletInfoStyle, type WalletInfoTriggerProps, WalletPortfolio, WalletPortfolioBody, type WalletPortfolioBodyProps, type WalletPortfolioContentProps, type WalletPortfolioProps, type WalletPortfolioTriggerProps, type WalletProvider, type WriteContractFn, announceAppLauncherUsage, captureDappUiException, createRelayClient, getChainDisplay, getDappUiSentryScope, initDappUiSentry, normalizeFailureReason, resolveEnvironment, setDappUiAnalyticsUser, trackDappUiEvent, trackDappUiFunnel, useChainDisplay, useChainsConfig, useGlobalMenu, useRelayConfig, useRelayOrders, useRelayRecovery, useTokenBalance, useTokenStats, useWalletDetect };
2851
+ export { APPLE_ICON, AppLauncher, AppLauncherContent, type AppLauncherContentProps, type AppLauncherProps, AppLauncherTrigger, type AppLauncherTriggerProps, type AppLauncherTriggerStyle, type AppLauncherUsageMode, BINANCE_ICON, type BridgeAmountSource, type BridgeApprovalInfo, type BridgeApproveFn, type BridgeFailedInfo, BridgeFlow, type BridgeFlowProps, type BridgeGetApprovalFn, type BridgeGetToTokensFn, type BridgeHistoryItem, type BridgeInfoRow, type BridgeInfoTokenRef, type BridgeLiquidityInfo, type BridgePathType, type BridgeQuoteFn, type BridgeQuoteInput, type BridgeQuoteResult, type BridgeStatus, type BridgeStep, type BridgeSubmitFn, type BridgeSubmittedInfo, type BridgeToken, type BridgeTxSummary, CHAINS_CONFIG_FILE, CONNECTOR_REGISTRY, CROSSX_ICON, type Catalog, type ChainDisplayMeta, type ChainId, type ChainsConfig, ConnectButton, type ConnectButtonProps, type ConnectButtonStyle, ConnectorId, type ConnectorMeta, type CrossdPosition, type CrossdPositionDetail, type CrossdPositionPoolRef, type CrossdPositionTokenRef, DEFAULT_SKILLS_HREF, DEFAULT_TRUSTED_FACTORIES, DappUiErrorBoundary, type DappUiErrorBoundaryProps, type DappUiFailureReason, type DappUiFeature, type DappUiFlow, type DepositAddressResult, type DrawerDirection$1 as DrawerDirection, type Environment, type EstimateGasArgs, type EstimateGasFn, GOOGLE_ICON, type GameSwapPool, type GameSwapTokenRef, type GasEstimate, type GetBalanceFn, GetOneUsd, type GetOneUsdActionId, type GetOneUsdBridgeProps, type GetOneUsdButtonComponent, type GetOneUsdEvent, type GetOneUsdMode, type GetOneUsdPairs, type GetOneUsdProps, type GetOneUsdRelayProps, type GetOneUsdRemoteModes, type GetOneUsdTokenRef, type GetOneUsdWaitForTransaction, type GetTransactionReceiptArgs, type GetTransactionReceiptFn, type GlobalMenu, type GlobalMenuItem, type GlobalMenuItemAssetUrl, type GlobalMenuItemServiceStatus, type GlobalMenuItemUrl, type InitDappUiSentryOptions, type LpBalanceInfo, type LpBalanceReaderFn, METAMASK_ICON, type OnOutlink, type OrderSummary, type OriginOption, type OutlinkCategory, type OutlinkContext, type OutlinkOrigin, PORTFOLIO_SECTIONS, type PortfolioSection, type PreferredToken, type QuoteResult, type ReadContractFn, type RecentSendAddress, type RecoveryInfo, type RecoverySuccessResult, RelayApiError, type RelayBalance, type RelayClient, type RelayClientOptions, type RelayContractCall, RelayDeposit, type RelayDepositContentProps, type RelayDepositProps, type RelayDepositTriggerProps, type RelayDrawerDirection, type Hex as RelayHex, RelayHistory, type RelayHistoryContentProps, type RelayHistoryProps, type RelayHistoryTriggerProps, RelayRecovery, type RecoveryAction as RelayRecoveryAction, type RelayRecoveryContentProps, type RelayRecoveryProps, type RelayRecoveryQueryKey, type RelayRecoveryQueryOptions, type RecoveryState as RelayRecoveryState, type RecoveryStep as RelayRecoveryStep, type RelayRecoveryTriggerProps, type SendTransactionFn as RelaySendTransactionFn, type RelayTheme, type RelayTxRequest, type RelayWalletProps, type ResolvedGetOneUsdRoute, SOCIAL_REGISTRY, type SendAccount, type SendAsset, SendFlow, type SendFlowProps, type SendPageProps, type SendStatus, type SendTransactionArgs, type SendTransactionFn$1 as SendTransactionFn, SkillsButton, type SkillsButtonProps, type SkillsButtonStyle, type SocialConfig, type SocialHandlers, type SocialId, type StakingRewardsInfo, type StakingRewardsReaderFn, StatusTracker, type StatusTrackerProps, type SwitchChainFn, TOKEN_STATS_QUERY_KEY, type Theme, type TokenBalance, type TokenBalanceResponse, type TokenStats, type TokenStatsResponse, type TrackDappUiFunnelOptions, type TransactionReceiptResult, USER_BALANCE_QUERY_KEY, type UseRelayConfigOptions, type UseRelayConfigResult, type UseRelayOrdersOptions, type UseRelayOrdersResult, type UseRelayRecoveryOptions, type UseRelayRecoveryResult, WALLET_REGISTRY, type WaitForReceiptFn, type WalletConfig, WalletConnectModal, type WalletConnectModalContentProps, type WalletConnectModalProps, type WalletConnectModalStyle, type WalletConnectModalTriggerProps, type WalletHandlers, type WalletId, WalletInfo, type WalletInfoContentProps, type WalletInfoFooterProps, type WalletInfoNavProps, type WalletInfoProps, type WalletInfoStyle, type WalletInfoTriggerProps, WalletPortfolio, WalletPortfolioBody, type WalletPortfolioBodyProps, type WalletPortfolioContentProps, type WalletPortfolioProps, type WalletPortfolioTriggerProps, type WalletProvider, type WriteContractFn, announceAppLauncherUsage, captureDappUiException, createRelayClient, findGetOneUsdToken, getChainDisplay, getDappUiSentryScope, getOneUsdTokenKey, initDappUiSentry, isGetOneUsdActionEnabled, isGetOneUsdTargetAvailable, matchesGetOneUsdToken, normalizeFailureReason, resolveEnvironment, resolveGetOneUsdRoute, setDappUiAnalyticsUser, trackDappUiEvent, trackDappUiFunnel, useChainDisplay, useChainsConfig, useGlobalMenu, useRelayConfig, useRelayOrders, useRelayRecovery, useTokenBalance, useTokenStats, useWalletDetect };