@nexus-cross/dapp-ui 1.3.11 → 1.3.12-beta.2

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
+ * The S3 object also retains a legacy `trustedFactories` array for already
68
+ * deployed SDKs, but current code deliberately does not type or read it.
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,1352 +1390,1462 @@ 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;
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;
1458
1518
  }
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
1519
  /**
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 으로 분리되어 있다.
1520
+ * GET /v1/deposit-address response body -- a stable, reusable deposit
1521
+ * address for this (user, origin chain, origin token). The same request
1522
+ * always resolves to the same address; no order/deposit is created by
1523
+ * fetching it, and it accepts any number of deposits over time (see
1524
+ * internal/standing.Service.GetOrCreateDepositAddress).
1491
1525
  */
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;
1526
+ interface DepositAddressResult {
1527
+ user: string;
1528
+ forwarder: string;
1529
+ version: number;
1530
+ depositAddress: string;
1531
+ originChainId: number;
1532
+ originCurrency: string;
1531
1533
  }
1532
1534
  /**
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
1535
+ * One row of GET /v1/orders?user=...'s "orders" array. A single order can
1536
+ * aggregate several deposits made to the same reusable forwarder; `deposits[]`
1537
+ * is the per-arrival identity. Amount fields are smallest-unit base-10 integer
1538
+ * strings, "" when not yet known.
1540
1539
  */
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;
1540
+ interface OrderSummary {
1541
+ orderId: string;
1542
+ status: string;
1543
+ source: string;
1544
+ amountIn: string;
1545
+ expectedOut: string;
1546
+ bscBridgeTx: string;
1547
+ originChainId: number;
1548
+ originCurrency: string;
1549
+ /** CROSS delivery-token symbol this order pays out as (a Catalog.targets
1550
+ * symbol, e.g. "pONEUSD"); "" / omitted means the default target. Used to
1551
+ * label the "out" side with the actual delivered token. */
1552
+ target?: string;
1553
+ forwarderVersion: number;
1554
+ /** RFC3339 timestamp. */
1555
+ createdAt: string;
1556
+ /** What the user ACTUALLY received, observed from the CROSS delivery
1557
+ * transfer. Distinct from expectedOut, which is the pre-delivery projection
1558
+ * after fees -- the two differ by swap slippage and any executor fallback.
1559
+ * "" until delivery, and for orders delivered before the backend recorded it. */
1560
+ amountOut?: string;
1561
+ /** The CROSS-side transaction that delivered the funds. "" until delivery. */
1562
+ deliveryTxHash?: string;
1563
+ /** RFC3339 timestamp of the COMPLETED transition -- when the user received
1564
+ * the funds. Absent for orders that never completed. */
1565
+ completedAt?: string;
1566
+ /** The individual deposits this delivery paid out, oldest first. There can be
1567
+ * SEVERAL: a user may top up a little at a time and the sweeper aggregates
1568
+ * whatever has arrived into one order. Empty when the backend has not
1569
+ * attributed the deposits to this order yet. */
1570
+ deposits?: OrderDeposit[];
1648
1571
  }
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" 버튼
1572
+ /** One deposit inside an order, as GET /v1/orders reports it.
1657
1573
  *
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
-
1574
+ * originChainId/originCurrency are the chain and token the user ACTUALLY paid,
1575
+ * which the order itself cannot report (one reusable deposit address serves
1576
+ * every origin route, so the swept balance carries no memory of where it came
1577
+ * from). They are absent when the backend has not attributed the deposit --
1578
+ * for a DIRECT BSC deposit that is permanent and correct, since it has no
1579
+ * cross-chain leg. */
1580
+ interface OrderDeposit {
1581
+ /** Amount that arrived at the forwarder, in BSC USDT base units. NOT the
1582
+ * amount sent on the origin chain, which is larger by Relay's fees and
1583
+ * denominated in the origin token's own decimals. */
1584
+ amount: string;
1585
+ blockNumber: number;
1586
+ originChainId?: number;
1587
+ originCurrency?: string;
1588
+ /** The BSC-side arrival (transfer into the forwarder). */
1589
+ txHash: string;
1590
+ /** The user's own send on the ORIGIN chain -- what the "Deposit" step links
1591
+ * to. Absent when unattributed. */
1592
+ originTxHash?: string;
1593
+ }
1594
+ type StepStatus = 'done' | 'active' | 'pending';
1595
+ interface OrderStep {
1596
+ key: string;
1597
+ label: string;
1598
+ status: StepStatus;
1599
+ }
1664
1600
  /**
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
1601
+ * GET /v1/orders/{orderId} response body. "status" is the raw backend state
1602
+ * (e.g. "AWAITING_DEPOSIT", "COMPLETED", "FAILED", ...); "steps" is the
1603
+ * friendlier 3-stage deposit -> bridge -> deliver breakdown the UI renders.
1677
1604
  */
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
-
1605
+ interface Order {
1606
+ orderId: string;
1607
+ status: string;
1608
+ steps: OrderStep[];
1609
+ bridgeIndex: string;
1610
+ txs: {
1611
+ bscBridge: string;
1612
+ crossFinalize: string;
1613
+ crossExecute: string;
1614
+ };
1615
+ }
1684
1616
  /**
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
- * 하나만 바꿔도 텍스트·아이콘·스피너가 모두 같은 색을 따라간다.
1617
+ * GET /v1/recovery?user=... response body -- the permissionless self-recovery
1618
+ * status for a user's standing forwarder on BSC. Task 1's endpoint; consumed
1619
+ * by useRecovery (Task 2) to drive the settings-menu "Recover stuck funds"
1620
+ * panel. Every recovery tx (factory.deploy, forwarder.execute/sweepToUser)
1621
+ * takes no destination argument -- funds always route to `forwarder`'s
1622
+ * immutable recipient, so this info is advisory/orientation only, never a
1623
+ * capability check the UI should use to block the user.
1692
1624
  */
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;
1625
+ interface RecoveryInfo {
1626
+ user: string;
1627
+ /** The user's forwarder address on BSC for the requested target (CREATE2, deterministic from
1628
+ * user+version+target). */
1629
+ forwarder: string;
1630
+ /** Whether `forwarder` has been deployed on-chain yet. */
1631
+ isDeployed: boolean;
1632
+ /** BSC USDT token contract address -- always BSC USDT regardless of `target` (the forwarder
1633
+ * holds BSC USDT pre-bridge in every case). */
1634
+ token: string;
1635
+ decimals: number;
1636
+ /** Smallest-unit base-10 integer string -- the forwarder's current token balance. */
1637
+ balance: string;
1638
+ /** The factory that deploys/derives `forwarder` for the requested target: the
1639
+ * DepositorForwarderFactory for a depositor-kind target, the StandingForwarderFactory
1640
+ * otherwise (recovery follow-up, multi-target). */
1641
+ factory: string;
1642
+ version: number;
1643
+ /** Smallest-unit base-10 integer string -- the bridge's configured minimum. */
1644
+ bridgeMinWei: string;
1645
+ /** Server's best-effort recommendation: "execute" (balance clears the bridge minimum, so a
1646
+ * normal delivery can complete), "sweep" (below minimum -- recover directly instead), or
1647
+ * "none" (no balance to act on). Advisory only -- never used to disable an action. */
1648
+ suggestedAction: 'execute' | 'sweep' | 'none';
1649
+ /** True when the backend sees this balance as possibly mid-flight (e.g. a sweep/bridge job
1650
+ * already in progress) -- advisory caution only, must NOT disable either recovery action. */
1651
+ inFlight: boolean;
1652
+ inFlightReason?: string;
1653
+ /**
1654
+ * Task 6/7: every known BSC token held at `forwarder` (not just the primary `token`/`balance`
1655
+ * pair above, which only ever reports BSC USDT) -- lets the UI surface a MISDEPOSITED token
1656
+ * (e.g. someone sent BUSD to a USDT-swap forwarder) that the top-level fields alone can't
1657
+ * represent. Optional/omitted for an older backend that predates this field -- back-compat,
1658
+ * byte-identical to pre-Task-6 behavior when absent (the UI falls back to `token`/`balance`).
1659
+ * Each entry's `suggestedAction` mirrors the top-level one's semantics, per-token.
1660
+ */
1661
+ tokens?: {
1662
+ address: string;
1663
+ symbol: string;
1664
+ decimals: number;
1665
+ /** Smallest-unit base-10 integer string -- this token's current balance at `forwarder`. */
1666
+ balance: string;
1667
+ /** Server's advisory recoverable flag for this token -- never used to disable the sweep
1668
+ * action (see `recover`'s doc in useRecovery.ts), only to decide which tokens the UI lists. */
1669
+ recoverable: boolean;
1670
+ suggestedAction: 'execute' | 'sweep' | 'none';
1671
+ }[];
1719
1672
  }
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";
1673
+ /** GET /v1/recovery request query params. */
1674
+ interface RecoveryRequest {
1675
+ user: string;
1676
+ /** Selected CROSS delivery target symbol (mirrors DepositAddressRequest's `target`) -- omitted
1677
+ * (or empty) selects the configured default, preserving pre-multi-target behavior
1678
+ * byte-for-byte. Passed through verbatim as "?target=" when set. */
1679
+ target?: string;
1680
+ }
1681
+
1682
+ /** Thrown for any non-2xx API response. `status` is the HTTP status code. */
1683
+ declare class RelayApiError extends Error {
1684
+ status: number;
1685
+ /** Parsed JSON error body when the response was valid JSON, else undefined. */
1686
+ body?: unknown;
1687
+ constructor(status: number, message: string, body?: unknown);
1688
+ }
1689
+ interface RelayClientOptions {
1690
+ /** API origin, e.g. "https://orchestrator.example.com". Trailing slashes are stripped. */
1691
+ baseUrl: string;
1692
+ }
1693
+ interface RelayClient {
1694
+ /** GET /v1/config -- the curated origin catalog + fixed crossd destination. */
1695
+ getConfig(): Promise<Catalog>;
1696
+ /** POST /v1/quote -- a price-only preview, no order/deposit is created. */
1697
+ getQuote(req: QuoteRequest): Promise<QuoteResult>;
1698
+ /**
1699
+ * GET /v1/deposit-address -- resolves the stable, reusable deposit
1700
+ * address for (user, originChainId, originCurrency). No amount is
1701
+ * involved and no order is created; the same address can receive any
1702
+ * number of deposits of any size. Several deposits can be aggregated into
1703
+ * one order when they jointly fund the same reusable forwarder.
1704
+ *
1705
+ * `target` (Task 8) is the delivery asset's symbol from
1706
+ * `Catalog.targets` -- sent as `&target=<symbol>` only when it's a
1707
+ * non-empty string; omitted otherwise, in which case the backend
1708
+ * resolves the default target (byte-identical to pre-Task-6 behavior).
1709
+ */
1710
+ getDepositAddress(req: DepositAddressRequest, target?: string): Promise<DepositAddressResult>;
1711
+ /**
1712
+ * GET /v1/orders/{orderId} -- current status + stepper progress for one
1713
+ * order. Reads are public (unauthenticated).
1714
+ */
1715
+ getOrder(orderId: string): Promise<Order>;
1716
+ /**
1717
+ * GET /v1/orders?user=... -- every order swept from deposits to that
1718
+ * user's standing address(es) (newest-first, capped server-side).
1719
+ */
1720
+ listOrders(user: string): Promise<OrderSummary[]>;
1721
+ /** Absolute URL of the SSE order-change stream for `user`
1722
+ * (GET /v1/orders/stream?user=...). Emits `event: connected` on open,
1723
+ * `event: orders-changed` when that user's orders change, and `:
1724
+ * heartbeat` comments -- it carries no order data itself, so consumers
1725
+ * always follow up with `listOrders`. */
1726
+ ordersStreamUrl(user: string): string;
1727
+ /**
1728
+ * GET /v1/recovery?user=... -- permissionless self-recovery status for a
1729
+ * user's forwarder on BSC (Task 1). `req.target` (optional) selects which
1730
+ * per-target forwarder/factory to report -- omitted selects the
1731
+ * configured default, byte-identical to pre-multi-target behavior.
1732
+ * Purely informational -- fetching it never triggers or blocks any
1733
+ * on-chain action. The response's `tokens[]` (Task 6/7 -- every known BSC
1734
+ * token held at the forwarder) flows through as-is: it's plain JSON, so no
1735
+ * extra parsing/mapping is needed beyond RecoveryInfo's own typing, and
1736
+ * it's simply absent/undefined for an older backend that predates it.
1737
+ */
1738
+ getRecovery(req: RecoveryRequest): Promise<RecoveryInfo>;
1743
1739
  }
1744
-
1745
1740
  /**
1746
- * @deprecated 이동 대상은 apps.json(skills)이 단일 소스다. 상수는 더 이상
1747
- * 폴백으로 쓰이지 않으며 하위 호환(공개 export)용으로만 남아 있다.
1741
+ * Builds a framework-agnostic Relay API client. Uses plain `fetch` only --
1742
+ * no react-query, no RainbowKit/wagmi. `baseUrl` is passed in explicitly (no
1743
+ * `import.meta.env` coupling) so the widget can be embedded in any host app's
1744
+ * own config/env story.
1745
+ *
1746
+ * No API key: the backend has no inbound key gate (upstream 83845fb removed
1747
+ * the dead `apiKey`/X-API-Key plumbing -- a security control that does not
1748
+ * exist must not appear in a public type).
1748
1749
  */
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;
1750
+ declare function createRelayClient(options: RelayClientOptions): RelayClient;
1751
1751
 
1752
- /** One origin-side ERC-20 (or native, address = zero) token the UI may offer. */
1753
- interface Token {
1754
- symbol: string;
1752
+ interface DefaultToken {
1753
+ chainId: number;
1754
+ /** Token contract address, or the zero address for the chain's native asset. */
1755
1755
  address: string;
1756
- decimals: number;
1757
- logoUrl?: string;
1758
1756
  }
1759
- /** The fixed destination asset every order delivers: crossd on CROSS. */
1760
- interface Destination {
1761
- symbol: string;
1757
+
1758
+ type Hex = `0x${string}`;
1759
+ interface RelayTxRequest {
1762
1760
  chainId: number;
1763
- address: string;
1761
+ to: Hex;
1762
+ value?: bigint;
1763
+ data?: Hex;
1764
+ }
1765
+ interface RelayContractCall {
1766
+ chainId: number;
1767
+ address: Hex;
1768
+ abi: readonly unknown[];
1769
+ functionName: string;
1770
+ args: readonly unknown[];
1771
+ }
1772
+ interface RelayBalance {
1773
+ value: bigint;
1764
1774
  decimals: number;
1765
- note?: string;
1775
+ symbol: string;
1766
1776
  }
1767
- /** Origin chain VM family: "evm" (default) or "svm" (Solana). */
1768
- type ChainKind = 'evm' | 'svm';
1777
+ type SendTransactionFn = (req: RelayTxRequest) => Promise<Hex>;
1778
+ type WriteContractFn = (call: RelayContractCall) => Promise<Hex>;
1779
+ type ReadContractFn = (call: RelayContractCall) => Promise<unknown>;
1780
+ type SwitchChainFn = (chainId: number) => Promise<void>;
1781
+ type WaitForReceiptFn = (p: {
1782
+ chainId: number;
1783
+ hash: Hex;
1784
+ }) => Promise<{
1785
+ status: "success" | "reverted";
1786
+ }>;
1787
+ type GetBalanceFn = (p: {
1788
+ chainId: number;
1789
+ address: Hex;
1790
+ token?: Hex;
1791
+ }) => Promise<RelayBalance>;
1792
+ /** 지갑 주입 props — 전부 optional, 미주입 시 graceful degradation. */
1793
+ interface RelayWalletProps {
1794
+ walletAddress?: string;
1795
+ walletChainId?: number;
1796
+ sendTransaction?: SendTransactionFn;
1797
+ writeContract?: WriteContractFn;
1798
+ readContract?: ReadContractFn;
1799
+ switchChain?: SwitchChainFn;
1800
+ waitForReceipt?: WaitForReceiptFn;
1801
+ getBalance?: GetBalanceFn;
1802
+ }
1803
+ /** A recovery transaction confirmed successfully on BNB Smart Chain. */
1804
+ interface RecoverySuccessResult {
1805
+ action: "execute" | "sweep";
1806
+ forwarder: string;
1807
+ actionTxHash: string;
1808
+ /** Present only when this attempt first had to deploy the forwarder. */
1809
+ deployTxHash?: string;
1810
+ }
1811
+ type RelayTheme = "dark" | "light";
1812
+ type RelayDrawerDirection = "bottom" | "left" | "right" | "top";
1769
1813
  /**
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).
1814
+ * Props of the `<RelayDeposit>` compound root (Task 11) the union of
1815
+ *
1816
+ * * `RelayWalletProps` (injected wallet capabilities, all optional),
1817
+ * * the source widget's own configuration props (relay-protocol
1818
+ * `packages/relay-widget/src/components/RelayDeposit.tsx`), minus its
1819
+ * `theme: 'auto'` option, which the shared modal shell doesn't have, and
1820
+ * * `ResponsiveShellProps`' modal/drawer knobs (theme/breakpoint/size/open),
1821
+ * re-declared here rather than extended so the public surface reads as one
1822
+ * flat prop list.
1823
+ *
1824
+ * `children` holds `<RelayDeposit.Trigger>` / `<RelayDeposit.Content>`.
1777
1825
  */
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;
1826
+ interface RelayDepositProps extends RelayWalletProps {
1827
+ /** Pre-built client. Takes precedence over apiBaseUrl. */
1828
+ client?: RelayClient;
1829
+ /** Used to build a client via createRelayClient when `client` isn't passed. */
1830
+ apiBaseUrl?: string;
1789
1831
  /**
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.
1832
+ * Selects a built-in default relay API base URL (dev/stage/production) when
1833
+ * `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
1834
+ * this is only consulted when neither is provided. Omitted falls back to
1835
+ * the same global environment resolution every other dapp-ui feature uses
1836
+ * (see `resolveEnvironment`), defaulting to production.
1793
1837
  */
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.
1838
+ environment?: Environment;
1839
+ /** Restrict the catalog's origins to these chain ids. */
1840
+ chains?: number[];
1841
+ /** Controlled recipient; when provided the recipient input is hidden and no wallet
1842
+ * connection is required to fetch a deposit address. Defaults to `walletAddress`. */
1843
+ recipient?: string;
1844
+ /** Require a valid connected wallet before the deposit flow can issue an
1845
+ * address, quote an amount, or start live order/recovery reads. When enabled,
1846
+ * the recipient is pinned to `walletAddress`; a controlled `recipient` cannot
1847
+ * redirect the connected user's deposit. Defaults to `true` when
1848
+ * `showRecipientInput` is explicitly `false`, otherwise `false` for the
1849
+ * low-level public-address integration. `CrossRelayDeposit` always enables
1850
+ * this guard. */
1851
+ requireWalletConnection?: boolean;
1852
+ /** Hide the editable recipient input even when `recipient` is NOT controlled
1853
+ * (default `true` = original behavior). Hosts that lock the recipient to the
1854
+ * connected wallet set this `false` so a disconnected user sees a connect
1855
+ * prompt instead of a free-form address field — the deposit address can then
1856
+ * only ever resolve to the logged-in wallet. */
1857
+ showRecipientInput?: boolean;
1858
+ /** Controlled human-decimal amount; when provided the amount input is hidden. Optional —
1859
+ * it only drives the quote preview, and never blocks the deposit address. */
1860
+ amount?: string;
1861
+ /** Hide the amount input entirely (address-only, send-any-amount). Independent of `amount`. */
1862
+ hideAmount?: boolean;
1863
+ /** Render the EVM one-click deposit button (default `false`: the modal only
1864
+ * offers the QR / copy-address manual deposit path). Opt in with `true` for
1865
+ * hosts whose users connect external wallets that can sign on the origin
1866
+ * chains — CROSS embedded-wallet users never can, hence the off default. */
1867
+ showOneClickDeposit?: boolean;
1868
+ /** Render the Recover tab (default `false` for low-level RelayDeposit).
1869
+ * Recovery signs on BSC with the connected wallet, which CROSS embedded-wallet
1870
+ * users can never do — so the tab is hidden unless a host serving external
1871
+ * wallets opts in. Even opted in, it still requires the injected
1872
+ * `writeContract`/`readContract`/`waitForReceipt` capability trio. */
1873
+ showRecovery?: boolean;
1874
+ /** Which (chainId, token address) to default-select once the catalog loads. */
1875
+ defaultToken?: DefaultToken;
1876
+ /** Restricts the delivery-token picker to these symbols from `Catalog.targets`. */
1877
+ targetTokens?: string[];
1878
+ /** Which delivery-token symbol to select initially, instead of the catalog's own default. */
1879
+ defaultTarget?: string;
1880
+ /** Whether to render the delivery-token picker at all. Default `true`; the picker only
1881
+ * ever renders when there is more than one target to choose from either way. */
1882
+ showTargetSelector?: boolean;
1883
+ /** Overrides the pinned factory set the one-click deposit verifies the forwarder against. */
1884
+ trustedFactories?: readonly string[];
1885
+ onDepositAddress?: (result: DepositAddressResult) => void;
1886
+ /** Fired once per one-click deposit that CONFIRMED successfully, with the tx
1887
+ * hash. NOT fired on submission, and NOT fired for a tx that reverted --
1888
+ * watch `depositState` (phase/txHash/reverted) for those. Safe to treat as
1889
+ * "the funds moved" (upstream 83845fb). */
1890
+ onDeposited?: (txHash: string) => void;
1891
+ /** Fired once after a recovery action receipt confirms successfully. */
1892
+ onRecoverySuccess?: (result: RecoverySuccessResult) => void;
1893
+ onError?: (error: Error) => void;
1894
+ /** Called by the `Connect Wallet` CTA under the locked card that stands in for the QR
1895
+ * while the required connected wallet (or, in low-level public-address mode,
1896
+ * a usable recipient) is absent. Omitted — the locked card renders as text
1897
+ * only, with no button. */
1898
+ onRequestConnect?: () => void;
1899
+ /** @deprecated The Deposit footer entry was removed. Retained as a no-op
1900
+ * compatibility prop so existing hosts do not need an immediate migration. */
1901
+ onOpenHistory?: () => void;
1902
+ /** Extra class name(s) for the modal/drawer content element. */
1903
+ className?: string;
1904
+ theme?: RelayTheme;
1905
+ mobileBreakpoint?: number;
1906
+ drawerDirection?: RelayDrawerDirection;
1907
+ dialogWidth?: string;
1908
+ drawerMaxWidth?: string;
1909
+ drawerMinWidth?: string;
1910
+ style?: CSSProperties;
1911
+ open?: boolean;
1912
+ onOpenChange?: (open: boolean) => void;
1913
+ children?: ReactNode;
1914
+ }
1915
+ /**
1916
+ * Props of the `<RelayRecovery>` compound root — the standalone
1917
+ * "Recover stuck funds" modal, i.e. the deposit wizard's gear panel lifted out
1918
+ * into a modal of its own so a host can offer recovery WITHOUT the deposit
1919
+ * flow (the gear inside `<RelayDeposit>` is unaffected and still opt-in via
1920
+ * `showRecovery`).
1921
+ *
1922
+ * Extends `RelayWalletProps` because recovery is signing-first: unlike
1923
+ * `<RelayHistory>` (read-only, no wallet capabilities at all), the whole point
1924
+ * of this modal is that the USER signs the permissionless recovery tx on BSC.
1925
+ * A wallet missing the `writeContract`/`readContract`/`waitForReceipt` trio
1926
+ * gets a short note instead of a dead panel.
1927
+ *
1928
+ * `children` holds `<RelayRecovery.Trigger>` / `<RelayRecovery.Content>`.
1806
1929
  */
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;
1930
+ interface RelayRecoveryProps extends RelayWalletProps {
1931
+ /** Pre-built client. Takes precedence over apiBaseUrl. */
1932
+ client?: RelayClient;
1933
+ /** Used to build a client via createRelayClient when `client` isn't passed. */
1934
+ apiBaseUrl?: string;
1813
1935
  /**
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).
1936
+ * Selects a built-in default relay API base URL (dev/stage/production) when
1937
+ * `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
1938
+ * this is only consulted when neither is provided. Omitted falls back to
1939
+ * the same global environment resolution every other dapp-ui feature uses
1940
+ * (see `resolveEnvironment`), defaulting to production.
1819
1941
  */
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;
1942
+ environment?: Environment;
1834
1943
  /**
1835
- * Smallest-unit (crossd, catalog.destination.decimals) base-10 integer
1836
- * string. Currently assumed at 1:1 parity with BSC USDT -- see
1837
- * assumesParity.
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).
1838
1948
  */
1839
- expectedCrossd: string;
1840
- assumesParity: boolean;
1949
+ recipient?: string;
1841
1950
  /**
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.)
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`.
1855
1955
  */
1856
- feeUsd?: string;
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;
1857
1987
  /**
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.
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.
1867
1993
  */
1868
- ttl?: number;
1994
+ environment?: Environment;
1995
+ /** History subject. Falls back to `walletAddress`; empty-state UI when
1996
+ * neither resolves to a valid address. */
1997
+ recipient?: string;
1998
+ walletAddress?: string;
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;
2004
+ /** Extra class name(s) for the modal/drawer content element. */
2005
+ className?: string;
2006
+ theme?: RelayTheme;
2007
+ mobileBreakpoint?: number;
2008
+ drawerDirection?: RelayDrawerDirection;
2009
+ dialogWidth?: string;
2010
+ drawerMaxWidth?: string;
2011
+ drawerMinWidth?: string;
2012
+ style?: CSSProperties;
2013
+ open?: boolean;
2014
+ onOpenChange?: (open: boolean) => void;
2015
+ children?: ReactNode;
1869
2016
  }
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;
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;
1877
2022
  }
1878
2023
  /**
1879
- * GET /v1/deposit-address response body -- a stable, reusable deposit
1880
- * address for this (user, origin chain, origin token). The same request
1881
- * always resolves to the same address; no order/deposit is created by
1882
- * fetching it, and it accepts any number of deposits over time (see
1883
- * internal/standing.Service.GetOrCreateDepositAddress).
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.
1884
2031
  */
1885
- interface DepositAddressResult {
1886
- user: string;
1887
- forwarder: string;
1888
- version: number;
1889
- depositAddress: string;
1890
- originChainId: number;
1891
- originCurrency: string;
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;
1892
2040
  }
1893
2041
  /**
1894
- * One row of GET /v1/orders?user=...'s "orders" array. A single order can
1895
- * aggregate several deposits made to the same reusable forwarder; `deposits[]`
1896
- * is the per-arrival identity. Amount fields are smallest-unit base-10 integer
1897
- * strings, "" when not yet known.
1898
- */
1899
- interface OrderSummary {
1900
- orderId: string;
1901
- status: string;
1902
- source: string;
1903
- amountIn: string;
1904
- expectedOut: string;
1905
- bscBridgeTx: string;
1906
- originChainId: number;
1907
- originCurrency: string;
1908
- /** CROSS delivery-token symbol this order pays out as (a Catalog.targets
1909
- * symbol, e.g. "pONEUSD"); "" / omitted means the default target. Used to
1910
- * label the "out" side with the actual delivered token. */
1911
- target?: string;
1912
- forwarderVersion: number;
1913
- /** RFC3339 timestamp. */
1914
- createdAt: string;
1915
- /** What the user ACTUALLY received, observed from the CROSS delivery
1916
- * transfer. Distinct from expectedOut, which is the pre-delivery projection
1917
- * after fees -- the two differ by swap slippage and any executor fallback.
1918
- * "" until delivery, and for orders delivered before the backend recorded it. */
1919
- amountOut?: string;
1920
- /** The CROSS-side transaction that delivered the funds. "" until delivery. */
1921
- deliveryTxHash?: string;
1922
- /** RFC3339 timestamp of the COMPLETED transition -- when the user received
1923
- * the funds. Absent for orders that never completed. */
1924
- completedAt?: string;
1925
- /** The individual deposits this delivery paid out, oldest first. There can be
1926
- * SEVERAL: a user may top up a little at a time and the sweeper aggregates
1927
- * whatever has arrived into one order. Empty when the backend has not
1928
- * attributed the deposits to this order yet. */
1929
- deposits?: OrderDeposit[];
1930
- }
1931
- /** One deposit inside an order, as GET /v1/orders reports it.
1932
- *
1933
- * originChainId/originCurrency are the chain and token the user ACTUALLY paid,
1934
- * which the order itself cannot report (one reusable deposit address serves
1935
- * every origin route, so the swept balance carries no memory of where it came
1936
- * from). They are absent when the backend has not attributed the deposit --
1937
- * for a DIRECT BSC deposit that is permanent and correct, since it has no
1938
- * cross-chain leg. */
1939
- interface OrderDeposit {
1940
- /** Amount that arrived at the forwarder, in BSC USDT base units. NOT the
1941
- * amount sent on the origin chain, which is larger by Relay's fees and
1942
- * denominated in the origin token's own decimals. */
1943
- amount: string;
1944
- blockNumber: number;
1945
- originChainId?: number;
1946
- originCurrency?: string;
1947
- /** The BSC-side arrival (transfer into the forwarder). */
1948
- txHash: string;
1949
- /** The user's own send on the ORIGIN chain -- what the "Deposit" step links
1950
- * to. Absent when unattributed. */
1951
- originTxHash?: string;
1952
- }
1953
- type StepStatus = 'done' | 'active' | 'pending';
1954
- interface OrderStep {
1955
- key: string;
1956
- label: string;
1957
- status: StepStatus;
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`.
2047
+ *
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;
1958
2066
  }
1959
2067
  /**
1960
- * GET /v1/orders/{orderId} response body. "status" is the raw backend state
1961
- * (e.g. "AWAITING_DEPOSIT", "COMPLETED", "FAILED", ...); "steps" is the
1962
- * friendlier 3-stage deposit -> bridge -> deliver breakdown the UI renders.
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.
1963
2075
  */
1964
- interface Order {
1965
- orderId: string;
1966
- status: string;
1967
- steps: OrderStep[];
1968
- bridgeIndex: string;
1969
- txs: {
1970
- bscBridge: string;
1971
- crossFinalize: string;
1972
- crossExecute: string;
1973
- };
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;
1974
2084
  }
1975
2085
  /**
1976
- * GET /v1/recovery?user=... response body -- the permissionless self-recovery
1977
- * status for a user's standing forwarder on BSC. Task 1's endpoint; consumed
1978
- * by useRecovery (Task 2) to drive the settings-menu "Recover stuck funds"
1979
- * panel. Every recovery tx (factory.deploy, forwarder.execute/sweepToUser)
1980
- * takes no destination argument -- funds always route to `forwarder`'s
1981
- * immutable recipient, so this info is advisory/orientation only, never a
1982
- * capability check the UI should use to block the user.
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.
1983
2096
  */
1984
- interface RecoveryInfo {
1985
- user: string;
1986
- /** The user's forwarder address on BSC for the requested target (CREATE2, deterministic from
1987
- * user+version+target). */
1988
- forwarder: string;
1989
- /** Whether `forwarder` has been deployed on-chain yet. */
1990
- isDeployed: boolean;
1991
- /** BSC USDT token contract address -- always BSC USDT regardless of `target` (the forwarder
1992
- * holds BSC USDT pre-bridge in every case). */
1993
- token: string;
1994
- decimals: number;
1995
- /** Smallest-unit base-10 integer string -- the forwarder's current token balance. */
1996
- balance: string;
1997
- /** The factory that deploys/derives `forwarder` for the requested target: the
1998
- * DepositorForwarderFactory for a depositor-kind target, the StandingForwarderFactory
1999
- * otherwise (recovery follow-up, multi-target). */
2000
- factory: string;
2001
- version: number;
2002
- /** Smallest-unit base-10 integer string -- the bridge's configured minimum. */
2003
- bridgeMinWei: string;
2004
- /** Server's best-effort recommendation: "execute" (balance clears the bridge minimum, so a
2005
- * normal delivery can complete), "sweep" (below minimum -- recover directly instead), or
2006
- * "none" (no balance to act on). Advisory only -- never used to disable an action. */
2007
- suggestedAction: 'execute' | 'sweep' | 'none';
2008
- /** True when the backend sees this balance as possibly mid-flight (e.g. a sweep/bridge job
2009
- * already in progress) -- advisory caution only, must NOT disable either recovery action. */
2010
- inFlight: boolean;
2011
- inFlightReason?: string;
2012
- /**
2013
- * Task 6/7: every known BSC token held at `forwarder` (not just the primary `token`/`balance`
2014
- * pair above, which only ever reports BSC USDT) -- lets the UI surface a MISDEPOSITED token
2015
- * (e.g. someone sent BUSD to a USDT-swap forwarder) that the top-level fields alone can't
2016
- * represent. Optional/omitted for an older backend that predates this field -- back-compat,
2017
- * byte-identical to pre-Task-6 behavior when absent (the UI falls back to `token`/`balance`).
2018
- * Each entry's `suggestedAction` mirrors the top-level one's semantics, per-token.
2019
- */
2020
- tokens?: {
2021
- address: string;
2022
- symbol: string;
2023
- decimals: number;
2024
- /** Smallest-unit base-10 integer string -- this token's current balance at `forwarder`. */
2025
- balance: string;
2026
- /** Server's advisory recoverable flag for this token -- never used to disable the sweep
2027
- * action (see `recover`'s doc in useRecovery.ts), only to decide which tokens the UI lists. */
2028
- recoverable: boolean;
2029
- suggestedAction: 'execute' | 'sweep' | 'none';
2030
- }[];
2031
- }
2032
- /** GET /v1/recovery request query params. */
2033
- interface RecoveryRequest {
2034
- user: string;
2035
- /** Selected CROSS delivery target symbol (mirrors DepositAddressRequest's `target`) -- omitted
2036
- * (or empty) selects the configured default, preserving pre-multi-target behavior
2037
- * byte-for-byte. Passed through verbatim as "?target=" when set. */
2038
- target?: string;
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;
2039
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;
2040
2118
 
2041
- /** Thrown for any non-2xx API response. `status` is the HTTP status code. */
2042
- declare class RelayApiError extends Error {
2043
- status: number;
2044
- /** Parsed JSON error body when the response was valid JSON, else undefined. */
2045
- body?: unknown;
2046
- constructor(status: number, message: string, body?: unknown);
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;
2047
2125
  }
2048
- interface RelayClientOptions {
2049
- /** API origin, e.g. "https://orchestrator.example.com". Trailing slashes are stripped. */
2050
- baseUrl: string;
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;
2051
2170
  }
2052
- interface RelayClient {
2053
- /** GET /v1/config -- the curated origin catalog + fixed crossd destination. */
2054
- getConfig(): Promise<Catalog>;
2055
- /** POST /v1/quote -- a price-only preview, no order/deposit is created. */
2056
- getQuote(req: QuoteRequest): Promise<QuoteResult>;
2057
- /**
2058
- * GET /v1/deposit-address -- resolves the stable, reusable deposit
2059
- * address for (user, originChainId, originCurrency). No amount is
2060
- * involved and no order is created; the same address can receive any
2061
- * number of deposits of any size. Several deposits can be aggregated into
2062
- * one order when they jointly fund the same reusable forwarder.
2063
- *
2064
- * `target` (Task 8) is the delivery asset's symbol from
2065
- * `Catalog.targets` -- sent as `&target=<symbol>` only when it's a
2066
- * non-empty string; omitted otherwise, in which case the backend
2067
- * resolves the default target (byte-identical to pre-Task-6 behavior).
2068
- */
2069
- getDepositAddress(req: DepositAddressRequest, target?: string): Promise<DepositAddressResult>;
2070
- /**
2071
- * GET /v1/orders/{orderId} -- current status + stepper progress for one
2072
- * order. Reads are public (unauthenticated).
2073
- */
2074
- getOrder(orderId: string): Promise<Order>;
2075
- /**
2076
- * GET /v1/orders?user=... -- every order swept from deposits to that
2077
- * user's standing address(es) (newest-first, capped server-side).
2078
- */
2079
- listOrders(user: string): Promise<OrderSummary[]>;
2080
- /** Absolute URL of the SSE order-change stream for `user`
2081
- * (GET /v1/orders/stream?user=...). Emits `event: connected` on open,
2082
- * `event: orders-changed` when that user's orders change, and `:
2083
- * heartbeat` comments -- it carries no order data itself, so consumers
2084
- * always follow up with `listOrders`. */
2085
- ordersStreamUrl(user: string): string;
2086
- /**
2087
- * GET /v1/recovery?user=... -- permissionless self-recovery status for a
2088
- * user's forwarder on BSC (Task 1). `req.target` (optional) selects which
2089
- * per-target forwarder/factory to report -- omitted selects the
2090
- * configured default, byte-identical to pre-multi-target behavior.
2091
- * Purely informational -- fetching it never triggers or blocks any
2092
- * on-chain action. The response's `tokens[]` (Task 6/7 -- every known BSC
2093
- * token held at the forwarder) flows through as-is: it's plain JSON, so no
2094
- * extra parsing/mapping is needed beyond RecoveryInfo's own typing, and
2095
- * it's simply absent/undefined for an older backend that predates it.
2096
- */
2097
- getRecovery(req: RecoveryRequest): Promise<RecoveryInfo>;
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;
2098
2213
  }
2099
2214
  /**
2100
- * Builds a framework-agnostic Relay API client. Uses plain `fetch` only --
2101
- * no react-query, no RainbowKit/wagmi. `baseUrl` is passed in explicitly (no
2102
- * `import.meta.env` coupling) so the widget can be embedded in any host app's
2103
- * own config/env story.
2215
+ * Public read-only hook for Relay's origin/destination/target catalog.
2104
2216
  *
2105
- * No API key: the backend has no inbound key gate (upstream 83845fb removed
2106
- * the dead `apiKey`/X-API-Key plumbing -- a security control that does not
2107
- * exist must not appear in a public type).
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.
2108
2220
  */
2109
- declare function createRelayClient(options: RelayClientOptions): RelayClient;
2110
-
2111
- interface DefaultToken {
2112
- chainId: number;
2113
- /** Token contract address, or the zero address for the chain's native asset. */
2114
- address: string;
2115
- }
2221
+ declare function useRelayConfig(opts?: UseRelayConfigOptions): UseRelayConfigResult;
2116
2222
 
2117
- type Hex = `0x${string}`;
2118
- interface RelayTxRequest {
2119
- chainId: number;
2120
- to: Hex;
2121
- value?: bigint;
2122
- data?: Hex;
2123
- }
2124
- interface RelayContractCall {
2125
- chainId: number;
2126
- address: Hex;
2127
- abi: readonly unknown[];
2128
- functionName: string;
2129
- args: readonly unknown[];
2130
- }
2131
- interface RelayBalance {
2132
- value: bigint;
2133
- decimals: number;
2134
- symbol: string;
2135
- }
2136
- type SendTransactionFn = (req: RelayTxRequest) => Promise<Hex>;
2137
- type WriteContractFn = (call: RelayContractCall) => Promise<Hex>;
2138
- type ReadContractFn = (call: RelayContractCall) => Promise<unknown>;
2139
- type SwitchChainFn = (chainId: number) => Promise<void>;
2140
- type WaitForReceiptFn = (p: {
2141
- chainId: number;
2142
- hash: Hex;
2143
- }) => Promise<{
2144
- status: "success" | "reverted";
2145
- }>;
2146
- type GetBalanceFn = (p: {
2147
- chainId: number;
2148
- address: Hex;
2149
- token?: Hex;
2150
- }) => Promise<RelayBalance>;
2151
- /** 지갑 주입 props — 전부 optional, 미주입 시 graceful degradation. */
2152
- interface RelayWalletProps {
2153
- walletAddress?: string;
2154
- walletChainId?: number;
2155
- sendTransaction?: SendTransactionFn;
2156
- writeContract?: WriteContractFn;
2157
- readContract?: ReadContractFn;
2158
- switchChain?: SwitchChainFn;
2159
- waitForReceipt?: WaitForReceiptFn;
2160
- getBalance?: GetBalanceFn;
2161
- }
2162
- /** A recovery transaction confirmed successfully on BNB Smart Chain. */
2163
- interface RecoverySuccessResult {
2164
- action: "execute" | "sweep";
2165
- forwarder: string;
2166
- actionTxHash: string;
2167
- /** Present only when this attempt first had to deploy the forwarder. */
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. */
2168
2232
  deployTxHash?: string;
2233
+ /** Tx hash of the execute()/sweepToUser() write. */
2234
+ actionTxHash?: string;
2235
+ error?: string;
2169
2236
  }
2170
- type RelayTheme = "dark" | "light";
2171
- type RelayDrawerDirection = "bottom" | "left" | "right" | "top";
2237
+
2238
+ type RelayRecoveryQueryKey = readonly [
2239
+ "relay",
2240
+ "recovery",
2241
+ number,
2242
+ string | null,
2243
+ string | null
2244
+ ];
2172
2245
  /**
2173
- * Props of the `<RelayDeposit>` compound root (Task 11) the union of
2174
- *
2175
- * * `RelayWalletProps` (injected wallet capabilities, all optional),
2176
- * * the source widget's own configuration props (relay-protocol
2177
- * `packages/relay-widget/src/components/RelayDeposit.tsx`), minus its
2178
- * `theme: 'auto'` option, which the shared modal shell doesn't have, and
2179
- * * `ResponsiveShellProps`' modal/drawer knobs (theme/breakpoint/size/open),
2180
- * re-declared here rather than extended so the public surface reads as one
2181
- * flat prop list.
2182
- *
2183
- * `children` holds `<RelayDeposit.Trigger>` / `<RelayDeposit.Content>`.
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.
2184
2249
  */
2185
- interface RelayDepositProps extends RelayWalletProps {
2250
+ type RelayRecoveryQueryOptions = Omit<UseQueryOptions<RecoveryInfo, Error, RecoveryInfo, RelayRecoveryQueryKey>, "queryKey" | "queryFn" | "select" | "initialData" | "initialDataUpdatedAt" | "placeholderData">;
2251
+ interface UseRelayRecoveryOptions {
2186
2252
  /** Pre-built client. Takes precedence over apiBaseUrl. */
2187
2253
  client?: RelayClient;
2188
- /** 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. */
2189
2255
  apiBaseUrl?: string;
2190
- /**
2191
- * Selects a built-in default relay API base URL (dev/stage/production) when
2192
- * `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
2193
- * this is only consulted when neither is provided. Omitted falls back to
2194
- * the same global environment resolution every other dapp-ui feature uses
2195
- * (see `resolveEnvironment`), defaulting to production.
2196
- */
2197
- environment?: Environment;
2198
- /** Restrict the catalog's origins to these chain ids. */
2199
- chains?: number[];
2200
- /** Controlled recipient; when provided the recipient input is hidden and no wallet
2201
- * connection is required to fetch a deposit address. Defaults to `walletAddress`. */
2256
+ /** Connected EVM wallet whose recoverable forwarder balances are queried. */
2202
2257
  recipient?: string;
2203
- /** Require a valid connected wallet before the deposit flow can issue an
2204
- * address, quote an amount, or start live order/recovery reads. When enabled,
2205
- * the recipient is pinned to `walletAddress`; a controlled `recipient` cannot
2206
- * redirect the connected user's deposit. Defaults to `true` when
2207
- * `showRecipientInput` is explicitly `false`, otherwise `false` for the
2208
- * low-level public-address integration. `CrossRelayDeposit` always enables
2209
- * this guard. */
2210
- requireWalletConnection?: boolean;
2211
- /** Hide the editable recipient input even when `recipient` is NOT controlled
2212
- * (default `true` = original behavior). Hosts that lock the recipient to the
2213
- * connected wallet set this `false` so a disconnected user sees a connect
2214
- * prompt instead of a free-form address field — the deposit address can then
2215
- * only ever resolve to the logged-in wallet. */
2216
- showRecipientInput?: boolean;
2217
- /** Controlled human-decimal amount; when provided the amount input is hidden. Optional —
2218
- * it only drives the quote preview, and never blocks the deposit address. */
2219
- amount?: string;
2220
- /** Hide the amount input entirely (address-only, send-any-amount). Independent of `amount`. */
2221
- hideAmount?: boolean;
2222
- /** Render the EVM one-click deposit button (default `false`: the modal only
2223
- * offers the QR / copy-address manual deposit path). Opt in with `true` for
2224
- * hosts whose users connect external wallets that can sign on the origin
2225
- * chains — CROSS embedded-wallet users never can, hence the off default. */
2226
- showOneClickDeposit?: boolean;
2227
- /** Render the recovery gear menu ("Recover stuck funds", default `false`).
2228
- * 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
2230
- * wallets opts in. Even opted in, it still requires the injected
2231
- * `writeContract`/`readContract`/`waitForReceipt` capability trio. */
2232
- showRecovery?: boolean;
2233
- /** Which (chainId, token address) to default-select once the catalog loads. */
2234
- defaultToken?: DefaultToken;
2235
- /** Restricts the delivery-token picker to these symbols from `Catalog.targets`. */
2236
- targetTokens?: string[];
2237
- /** Which delivery-token symbol to select initially, instead of the catalog's own default. */
2238
- defaultTarget?: string;
2239
- /** Whether to render the delivery-token picker at all. Default `true`; the picker only
2240
- * ever renders when there is more than one target to choose from either way. */
2241
- showTargetSelector?: boolean;
2242
- /** Overrides the pinned factory set the one-click deposit verifies the forwarder against. */
2243
- trustedFactories?: readonly string[];
2244
- onDepositAddress?: (result: DepositAddressResult) => void;
2245
- /** Fired once per one-click deposit that CONFIRMED successfully, with the tx
2246
- * hash. NOT fired on submission, and NOT fired for a tx that reverted --
2247
- * watch `depositState` (phase/txHash/reverted) for those. Safe to treat as
2248
- * "the funds moved" (upstream 83845fb). */
2249
- onDeposited?: (txHash: string) => void;
2250
- /** Fired once after a recovery action receipt confirms successfully. */
2251
- onRecoverySuccess?: (result: RecoverySuccessResult) => void;
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. */
2252
2267
  onError?: (error: Error) => void;
2253
- /** Called by the `Connect Wallet` CTA under the locked card that stands in for the QR
2254
- * while the required connected wallet (or, in low-level public-address mode,
2255
- * a usable recipient) is absent. Omitted the locked card renders as text
2256
- * only, with no button. */
2257
- onRequestConnect?: () => void;
2258
- /** @deprecated The Deposit footer entry was removed. Retained as a no-op
2259
- * compatibility prop so existing hosts do not need an immediate migration. */
2260
- onOpenHistory?: () => void;
2261
- /** Extra class name(s) for the modal/drawer content element. */
2262
- className?: string;
2263
- theme?: RelayTheme;
2264
- mobileBreakpoint?: number;
2265
- drawerDirection?: RelayDrawerDirection;
2266
- dialogWidth?: string;
2267
- drawerMaxWidth?: string;
2268
- drawerMinWidth?: string;
2269
- style?: CSSProperties;
2270
- open?: boolean;
2271
- onOpenChange?: (open: boolean) => void;
2272
- children?: ReactNode;
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;
2273
2284
  }
2274
2285
  /**
2275
- * Props of the `<RelayRecovery>` compound root the standalone
2276
- * "Recover stuck funds" modal, i.e. the deposit wizard's gear panel lifted out
2277
- * into a modal of its own so a host can offer recovery WITHOUT the deposit
2278
- * flow (the gear inside `<RelayDeposit>` is unaffected and still opt-in via
2279
- * `showRecovery`).
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.
2280
2303
  *
2281
- * Extends `RelayWalletProps` because recovery is signing-first: unlike
2282
- * `<RelayHistory>` (read-only, no wallet capabilities at all), the whole point
2283
- * of this modal is that the USER signs the permissionless recovery tx on BSC.
2284
- * A wallet missing the `writeContract`/`readContract`/`waitForReceipt` trio
2285
- * gets a short note instead of a dead panel.
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.
2286
2310
  *
2287
- * `children` holds `<RelayRecovery.Trigger>` / `<RelayRecovery.Content>`.
2288
- */
2289
- interface RelayRecoveryProps extends RelayWalletProps {
2290
- /** Pre-built client. Takes precedence over apiBaseUrl. */
2291
- client?: RelayClient;
2292
- /** Used to build a client via createRelayClient when `client` isn't passed. */
2293
- apiBaseUrl?: string;
2294
- /**
2295
- * Selects a built-in default relay API base URL (dev/stage/production) when
2296
- * `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
2297
- * this is only consulted when neither is provided. Omitted falls back to
2298
- * the same global environment resolution every other dapp-ui feature uses
2299
- * (see `resolveEnvironment`), defaulting to production.
2300
- */
2301
- 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
- */
2308
- 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;
2318
- onError?: (e: Error) => void;
2319
- /** Extra class name(s) for the modal/drawer content element. */
2320
- className?: string;
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. */
2356
+ walletAddress?: 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;
2321
2376
  theme?: RelayTheme;
2322
2377
  mobileBreakpoint?: number;
2323
2378
  drawerDirection?: RelayDrawerDirection;
2324
2379
  dialogWidth?: string;
2325
2380
  drawerMaxWidth?: string;
2326
2381
  drawerMinWidth?: string;
2382
+ /** CSS variables/styles applied to the selected trigger. */
2327
2383
  style?: CSSProperties;
2328
- open?: boolean;
2329
- onOpenChange?: (open: boolean) => void;
2330
- children?: ReactNode;
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;
2331
2401
  }
2402
+ interface ResolvedGetOneUsdRoute {
2403
+ fromTokens: BridgeToken[];
2404
+ targetToken?: BridgeToken;
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"]>;
2332
2410
  /**
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.
2411
+ * Swap/Bridge stay enabled when config is unavailable. Transfer Crypto is
2412
+ * opt-in and stays hidden until S3 explicitly enables it.
2413
+ */
2414
+ declare function isGetOneUsdActionEnabled(action: GetOneUsdActionId, modes?: GetOneUsdRemoteModes): boolean;
2415
+
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
+ };
2494
+ };
2495
+ type SocialId = keyof typeof SOCIAL_REGISTRY;
2496
+
2497
+ /**
2498
+ * Per-instance layout overrides applied as inline CSS variables.
2338
2499
  *
2339
- * `children` holds `<RelayHistory.Trigger>` / `<RelayHistory.Content>`.
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.
2340
2503
  */
2341
- interface RelayHistoryProps {
2342
- /** Pre-built client. Takes precedence over apiBaseUrl. */
2343
- client?: RelayClient;
2344
- /** Used to build a client via createRelayClient when `client` isn't passed. */
2345
- apiBaseUrl?: string;
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;
2346
2532
  /**
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.
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).
2352
2536
  */
2353
- environment?: Environment;
2354
- /** History subject. Falls back to `walletAddress`; empty-state UI when
2355
- * neither resolves to a valid address. */
2356
- recipient?: string;
2357
- 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;
2365
- theme?: RelayTheme;
2537
+ termsUrl?: string;
2538
+ /** URL the "Privacy Policy" link in the footer points to. */
2539
+ privacyUrl?: string;
2540
+ theme?: "dark" | "light";
2366
2541
  mobileBreakpoint?: number;
2367
- drawerDirection?: RelayDrawerDirection;
2542
+ drawerDirection?: DrawerDirection;
2368
2543
  dialogWidth?: string;
2369
2544
  drawerMaxWidth?: string;
2370
2545
  drawerMinWidth?: string;
2371
- style?: CSSProperties;
2546
+ style?: WalletConnectModalStyle;
2372
2547
  open?: boolean;
2373
2548
  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
- className?: string;
2381
- }
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`. */
2549
+ children: ReactNode;
2550
+ }
2551
+ interface WalletConnectModalTriggerProps {
2397
2552
  asChild?: boolean;
2398
2553
  children?: ReactNode;
2399
2554
  }
2400
- /**
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.
2412
- */
2413
- declare function RelayDepositTrigger({ asChild, children }: RelayDepositTriggerProps): react_jsx_runtime.JSX.Element;
2555
+ interface WalletConnectModalContentProps {
2556
+ className?: string;
2557
+ }
2414
2558
 
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;
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;
2419
2567
  };
2420
2568
 
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;
2569
+ interface DetectedWallet {
2570
+ rdns: string;
2571
+ name: string;
2572
+ icon?: string;
2425
2573
  }
2574
+ interface WalletDetectResult {
2575
+ wallets: DetectedWallet[];
2576
+ isDetected: (rdns: string) => boolean;
2577
+ isLoading: boolean;
2578
+ }
2579
+ declare function useWalletDetect(): WalletDetectResult;
2580
+
2426
2581
  /**
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.
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 으로 분리되어 있다.
2434
2590
  */
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. */
2441
- asChild?: boolean;
2442
- 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;
2443
2630
  }
2444
2631
  /**
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.
2632
+ * Resolved wallet provider determines which icon + display name appears
2633
+ * in the connected pill.
2450
2634
  *
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.
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
2455
2639
  */
2456
- declare function RelayHistoryTrigger({ asChild, children }: RelayHistoryTriggerProps): react_jsx_runtime.JSX.Element;
2457
-
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;
2462
- };
2463
-
2464
- interface RelayRecoveryContentProps {
2465
- /** Extra class name(s) for the dialog/drawer content element. Falls back to
2466
- * `<RelayRecovery>`'s own `className`. */
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
+ */
2467
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;
2468
2747
  }
2469
- /**
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.
2475
- */
2476
- declare function RelayRecoveryContent({ className }: RelayRecoveryContentProps): react_jsx_runtime.JSX.Element;
2477
2748
 
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;
2484
- }
2485
2749
  /**
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.
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
- /** REST safety-net cadence in milliseconds. Defaults to 30s; the open Deposit popup uses 1s
2522
- * so completion still appears promptly when the SSE event is absent. */
2523
- refetchInterval?: number;
2524
- /** @deprecated Use `refetchInterval`. Retained for compatibility. */
2525
- fallbackPollMs?: number;
2526
- onError?: (e: Error) => void;
2527
- }
2528
- interface UseRelayOrdersResult {
2529
- /** Every order swept from deposits to this recipient so far, newest-first
2530
- * as served by the API. Polled continuously once `recipient` is a valid address. */
2531
- orders: OrderSummary[];
2532
- ordersLoading: boolean;
2533
- ordersError?: Error;
2534
- /** Recipient the current snapshot belongs to. Undefined while a new
2535
- * subscription is waiting for its first accepted fetch, so consumers never
2536
- * baseline a previous recipient's rows as fresh deposits. */
2537
- ordersForRecipient?: string;
2538
- /** Increments after every accepted fetch, even when the client returns the
2539
- * same array reference or the request fails. Consumers use this as a
2540
- * low-frequency refresh signal for related read models such as /recovery. */
2541
- ordersRevision: number;
2542
- /** True once at least one fetch has COMPLETED (success or failure) for the
2543
- * current (recipient, enabled) subscription; false again when it resets.
2544
- * Distinct from `!ordersLoading`, which is also true BEFORE the first fetch
2545
- * has even started -- consumers that snapshot the list (e.g. the deposit
2546
- * wizard's new-order watch) must wait for this, or they baseline against
2547
- * the initial empty state and misread every existing order as new. */
2548
- ordersInitialized: boolean;
2549
- }
2550
- 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;
2551
2762
 
2552
- interface UseRelayConfigOptions {
2553
- /** Pre-built client. Takes precedence over apiBaseUrl. */
2554
- client?: RelayClient;
2555
- /** Used to build a client when `client` is not supplied. */
2556
- apiBaseUrl?: string;
2557
- /** Stops the request and clears the current snapshot. Defaults to true. */
2558
- enabled?: boolean;
2559
- /** Optional automatic REST refresh cadence in milliseconds. Disabled when omitted or <= 0. */
2560
- refetchInterval?: number;
2561
- onError?: (error: Error) => void;
2562
- }
2563
- interface UseRelayConfigResult {
2564
- /** Latest GET /v1/config response. */
2565
- config?: Catalog;
2566
- loading: boolean;
2567
- error?: Error;
2568
- /** Re-fetches GET /v1/config using the current client. */
2569
- refresh: () => void;
2570
- }
2571
2763
  /**
2572
- * 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.
2573
2768
  *
2574
- * The response is a normal REST snapshot, not an SSE stream. Use
2575
- * `refetchInterval` for periodic refreshes or call `refresh` for an immediate
2576
- * 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
2577
2776
  */
2578
- declare function useRelayConfig(opts?: UseRelayConfigOptions): UseRelayConfigResult;
2579
-
2580
- type RecoveryAction = "execute" | "sweep";
2581
- /** Per-attempt progress for `recover()`. "switching" = prompting a chain switch to BSC;
2582
- * "deploying" = the factory.deploy() write is in flight/confirming (only needed when the
2583
- * forwarder wasn't deployed yet); "recovering" = the execute()/sweepToUser() write is in
2584
- * flight/confirming; "done"/"error" are terminal for this attempt. */
2585
- type RecoveryStep = "idle" | "switching" | "deploying" | "recovering" | "done" | "error";
2586
- interface RecoveryState {
2587
- step: RecoveryStep;
2588
- /** Tx hash of the factory.deploy() write -- only set when this attempt needed one. */
2589
- deployTxHash?: string;
2590
- /** Tx hash of the execute()/sweepToUser() write. */
2591
- actionTxHash?: string;
2592
- error?: string;
2593
- }
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;
2594
2782
 
2595
- type RelayRecoveryQueryKey = readonly [
2596
- "relay",
2597
- "recovery",
2598
- number,
2599
- string | null,
2600
- string | null
2601
- ];
2602
2783
  /**
2603
- * React Query policies accepted by useRelayRecovery. The SDK owns the request
2604
- * identity and response shape, so callers cannot replace queryKey/queryFn or
2605
- * 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
+ * 하나만 바꿔도 텍스트·아이콘·스피너가 모두 같은 색을 따라간다.
2606
2791
  */
2607
- type RelayRecoveryQueryOptions = Omit<UseQueryOptions<RecoveryInfo, Error, RecoveryInfo, RelayRecoveryQueryKey>, "queryKey" | "queryFn" | "select" | "initialData" | "initialDataUpdatedAt" | "placeholderData">;
2608
- interface UseRelayRecoveryOptions {
2609
- /** Pre-built client. Takes precedence over apiBaseUrl. */
2610
- client?: RelayClient;
2611
- /** Used to build a client via createRelayClient when client isn't passed. */
2612
- apiBaseUrl?: string;
2613
- /** Connected EVM wallet whose recoverable forwarder balances are queried. */
2614
- recipient?: string;
2615
- /** Optional CROSS delivery target passed to GET /v1/recovery. */
2616
- target?: string;
2617
- /** React Query lifecycle, cache, retry, and refetch policies. */
2618
- query?: RelayRecoveryQueryOptions;
2619
- /** Optional wallet capabilities. Read-only consumers may omit this. */
2620
- wallet?: RelayWalletProps;
2621
- /** Called when GET /v1/recovery returns 401. */
2622
- onUnauthorized?: () => void;
2623
- /** Called after a terminal query or recovery-action error. */
2624
- onError?: (error: Error) => void;
2625
- /** Called once after a recovery transaction confirms successfully. */
2626
- onRecoverySuccess?: (result: RecoverySuccessResult) => void;
2627
- /** Trusted factory override for a self-hosted deployment. */
2628
- 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;
2629
2818
  }
2630
- interface UseRelayRecoveryResult {
2631
- info?: RecoveryInfo;
2632
- loading: boolean;
2633
- error?: Error;
2634
- /** True for background refetches as well as the first request. */
2635
- isFetching: boolean;
2636
- /** Invalidates no identities; immediately refetches this hook's fixed query. */
2637
- refresh: () => void;
2638
- /** Signs a recovery transaction for the currently fetched info. */
2639
- recover: (action: RecoveryAction, tokenAddress?: string) => Promise<void>;
2640
- 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";
2641
2842
  }
2843
+
2642
2844
  /**
2643
- * Public Recovery API hook. Unlike the widget-internal useRecovery fetch, this
2644
- * hook uses the host QueryClient and accepts React Query policies through
2645
- * `query`. queryKey/queryFn and balance-shaping options remain SDK-owned.
2845
+ * @deprecated 이동 대상은 apps.json(skills)이 단일 소스다. 상수는 이상
2846
+ * 폴백으로 쓰이지 않으며 하위 호환(공개 export)용으로만 남아 있다.
2646
2847
  */
2647
- declare function useRelayRecovery(opts?: UseRelayRecoveryOptions): UseRelayRecoveryResult;
2648
-
2649
- interface StatusTrackerProps {
2650
- orderId: string;
2651
- /** Latest polled order (steps/txs) from GET /v1/orders/{orderId}, owned by the caller. */
2652
- order?: Order;
2653
- /** Latest poll error, owned by the caller. */
2654
- error?: Error;
2655
- }
2656
- declare function StatusTracker({ orderId, order, error }: StatusTrackerProps): react_jsx_runtime.JSX.Element;
2657
-
2658
- /** Every StandingForwarderFactory / DepositorForwarderFactory this deployment
2659
- * has issued deposit addresses from, on BSC.
2660
- *
2661
- * Superseded factories stay listed on purpose. A forwarder's factory is pinned
2662
- * per address at issuance time (`standing_addresses.factory`, copied onto each
2663
- * order), so a user recovering an address minted before a rotation legitimately
2664
- * gets an older factory back from the API -- dropping it here would block that
2665
- * user from recovering their own funds, which is a worse outcome than the
2666
- * narrow trust gain. Every entry is one of ours either way.
2667
- *
2668
- * Rotation (see backends/deploy/RUNBOOK-canary.md): ADD the new factory, keep
2669
- * the old ones. */
2670
- 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;
2671
2850
 
2672
- 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 };