@nexus-cross/dapp-ui 2.3.4-beta.1 → 2.4.0-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/AI_INTEGRATION.md +55 -0
- package/README.md +52 -1
- package/dist/index.cjs +28 -21
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1528 -24
- package/dist/index.d.ts +1528 -24
- package/dist/index.js +28 -21
- package/dist/index.js.map +1 -0
- package/package.json +7 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Scope } from '@sentry/react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Component, ReactNode, ErrorInfo, CSSProperties, ElementType, ButtonHTMLAttributes } from 'react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
5
7
|
|
|
6
8
|
type Environment = "dev" | "stage" | "production";
|
|
7
9
|
type Theme = "dark" | "light";
|
|
@@ -9,12 +11,184 @@ type DrawerDirection$1 = "right" | "bottom" | "left";
|
|
|
9
11
|
|
|
10
12
|
declare function resolveEnvironment(env?: Environment | "staging" | "prd" | "prod" | "stg"): Environment;
|
|
11
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
|
+
* 약관 문서 링크. 브릿지 약관 동의 모달의 Terms of Service 링크가 읽는다 —
|
|
26
|
+
* cross-game-swap의 legal.json과 같은 운영 방식(무배포 교체). 호출부가
|
|
27
|
+
* `termsUrl` prop을 넘기면 그 값이 우선, 값이 없으면 DEFAULT_TERMS_URL 폴백.
|
|
28
|
+
*/
|
|
29
|
+
legal?: {
|
|
30
|
+
termsUrl?: RemoteEnvValue<string>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Get ONEUSD chooser action visibility. Swap/Bridge default to enabled;
|
|
34
|
+
* Transfer Crypto defaults to disabled when remote config is unavailable.
|
|
35
|
+
*/
|
|
36
|
+
getOneUsd?: {
|
|
37
|
+
modes?: {
|
|
38
|
+
swap?: boolean;
|
|
39
|
+
bridge?: boolean;
|
|
40
|
+
transferCrypto?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* 액션별 최소 dapp-ui 버전. 호스트가 설치한 dapp-ui 가 이 값보다 낮으면
|
|
44
|
+
* `modes`가 true여도 해당 액션을 숨긴다 — 구버전에서 깨지는 기능을 호스트
|
|
45
|
+
* 재배포 없이 끄기 위한 장치. 값이 없으면 버전 제한 없음, 형식이 깨져
|
|
46
|
+
* 있으면 통과(설정 오타로 전체가 사라지지 않게).
|
|
47
|
+
*/
|
|
48
|
+
minVersions?: {
|
|
49
|
+
swap?: string;
|
|
50
|
+
bridge?: string;
|
|
51
|
+
transferCrypto?: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 토큰 상세화면 섹션별 노출 여부. 값이 없으면 기본값(history·balance만 노출).
|
|
56
|
+
* 섹션 키: chart / balance(=My Balance + Send) / overview / social / history.
|
|
57
|
+
* env별 값은 apps.json 파일 자체가 환경마다 분리돼 있으므로 단순 boolean만 받는다.
|
|
58
|
+
*/
|
|
59
|
+
tokenDetail?: {
|
|
60
|
+
sections?: {
|
|
61
|
+
chart?: boolean;
|
|
62
|
+
balance?: boolean;
|
|
63
|
+
overview?: boolean;
|
|
64
|
+
social?: boolean;
|
|
65
|
+
history?: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Relay(외부체인 → CROSS 입금) 운영 설정.
|
|
70
|
+
* `minDepositAmount`: 입금 위저드 Continue를 막는 최소 수량(사람 단위,
|
|
71
|
+
* 토큰 공통). CDN 값이 없거나 fetch 실패 시 호출부 폴백(6)이 적용된다 —
|
|
72
|
+
* endpoints.json과 달리 UI 게이트라 폴백을 허용한다.
|
|
73
|
+
*/
|
|
74
|
+
relay?: {
|
|
75
|
+
minDepositAmount?: RemoteEnvValue<number | string>;
|
|
76
|
+
/**
|
|
77
|
+
* `maxDepositAmount`: Continue를 막는 최대 수량(사람 단위, 토큰 공통).
|
|
78
|
+
* 브릿지/DEX 유동성 한도를 운영이 수동 반영하는 값 — 미설정 시 상한 없음.
|
|
79
|
+
*/
|
|
80
|
+
maxDepositAmount?: RemoteEnvValue<number | string>;
|
|
81
|
+
/**
|
|
82
|
+
* Role-labelled Relay factory addresses. New SDKs prefer this field so
|
|
83
|
+
* operators can tell the StandingForwarderFactory and
|
|
84
|
+
* DepositorForwarderFactory apart without relying on array order.
|
|
85
|
+
*
|
|
86
|
+
* A legacy `trustedFactories` field, if encountered, is deliberately not
|
|
87
|
+
* typed or read by current code.
|
|
88
|
+
*/
|
|
89
|
+
forwarderFactories?: RemoteEnvValue<{
|
|
90
|
+
standingForwarderFactory?: string;
|
|
91
|
+
depositorForwarderFactory?: string;
|
|
92
|
+
}>;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
declare const CHAINS_CONFIG_FILE = "chains.json";
|
|
96
|
+
/** 체인 하나의 표시 메타. 지정 안 된 필드는 호출부 폴백(온체인/하드코딩)으로. */
|
|
97
|
+
type ChainDisplayMeta = {
|
|
98
|
+
/** 체인 표시명 (예: 'One Mainnet'). */
|
|
99
|
+
name?: string;
|
|
100
|
+
/** 네이티브 통화 표시 심볼 (예: 'ONE' / 'tONE'). DISPLAY 전용. */
|
|
101
|
+
nativeSymbol?: string;
|
|
102
|
+
};
|
|
103
|
+
/** chains.json 스키마 — chainId(10진 문자열) → 표시 메타. */
|
|
104
|
+
type ChainsConfig = {
|
|
105
|
+
chains?: Record<string, ChainDisplayMeta>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* chains.json에서 특정 chainId의 표시 메타를 비동기로 반환한다.
|
|
109
|
+
* fetch 실패·미정의면 `{}` — 호출부에서 `?? 폴백`으로 처리.
|
|
110
|
+
* React 밖(설정 생성·유틸)에서 사용.
|
|
111
|
+
*/
|
|
112
|
+
declare function getChainDisplay(chainId: number, env: Environment): Promise<ChainDisplayMeta>;
|
|
113
|
+
/**
|
|
114
|
+
* 컴포넌트에서 chainId의 표시명·네이티브 심볼을 구독하는 훅.
|
|
115
|
+
* chainId 변경(네트워크 전환) 시 재조회한다. 로딩 중/미정의면 각 필드
|
|
116
|
+
* undefined — 호출부에서 `?? 온체인/하드코딩 폴백`으로 처리한다.
|
|
117
|
+
*/
|
|
118
|
+
declare function useChainDisplay(chainId: number | undefined, env: Environment): ChainDisplayMeta;
|
|
119
|
+
/**
|
|
120
|
+
* chains.json의 전체 chainId→표시 메타 맵을 구독한다. 여러 체인의 표시명을
|
|
121
|
+
* 한 번에 매핑해야 하는 곳(네트워크 스위처 등)에서 사용한다. 로딩 전/실패 시
|
|
122
|
+
* 빈 객체 — 호출부에서 `map[String(id)]?.name ?? 폴백`으로 처리한다.
|
|
123
|
+
*/
|
|
124
|
+
declare function useChainsConfig(env: Environment): Record<string, ChainDisplayMeta>;
|
|
125
|
+
|
|
12
126
|
type AppLauncherUsageMode = "dapp-ui" | "connect-kit-react";
|
|
13
127
|
declare function announceAppLauncherUsage(options?: {
|
|
14
128
|
mode?: AppLauncherUsageMode;
|
|
15
129
|
connectKitVersion?: string;
|
|
16
130
|
}): void;
|
|
17
131
|
|
|
132
|
+
interface InitDappUiSentryOptions {
|
|
133
|
+
/** Falls back to VITE_CROSSX_ENVIRONMENT / NEXT_PUBLIC_CROSSX_ENVIRONMENT detection. */
|
|
134
|
+
environment?: Environment | "dev" | "stg" | "staging" | "prod" | "prd";
|
|
135
|
+
/** Defaults to true only on prod; dev/stg init but do not send. */
|
|
136
|
+
enabled?: boolean;
|
|
137
|
+
/** Override DSN (tests / self-hosted relay). */
|
|
138
|
+
dsn?: string;
|
|
139
|
+
/** 0–1 sample rate for ui:/funnel: analytics events (default 0.1). Errors are never sampled. */
|
|
140
|
+
analyticsSampleRate?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* dapp-ui is embedded in host apps that may run their own Sentry, so we never
|
|
144
|
+
* call `Sentry.init()`: it claims the global hub and either clobbers the host
|
|
145
|
+
* client or gets clobbered by it. Instead we keep a dedicated BrowserClient on
|
|
146
|
+
* an isolated Scope, with no global integrations (no window.onerror, no
|
|
147
|
+
* fetch/XHR patching) — errors reach the dapp-ui project only through explicit
|
|
148
|
+
* captureDappUiException calls, and the host's Sentry is never touched.
|
|
149
|
+
*/
|
|
150
|
+
declare function initDappUiSentry(options?: InitDappUiSentryOptions): Scope | null;
|
|
151
|
+
declare function getDappUiSentryScope(): Scope | null;
|
|
152
|
+
/** Lazily initializes with defaults so error boundaries work without host setup. */
|
|
153
|
+
declare function captureDappUiException(error: unknown, extra?: Record<string, unknown>): string | undefined;
|
|
154
|
+
|
|
155
|
+
interface DappUiErrorBoundaryProps {
|
|
156
|
+
children: ReactNode;
|
|
157
|
+
/** Rendered when a child throws; defaults to rendering nothing. */
|
|
158
|
+
fallback?: ReactNode;
|
|
159
|
+
/** Identifies which popup/root failed, e.g. "app-launcher". */
|
|
160
|
+
name?: string;
|
|
161
|
+
}
|
|
162
|
+
interface DappUiErrorBoundaryState {
|
|
163
|
+
hasError: boolean;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Reports to the isolated dapp-ui Sentry client instead of the global hub —
|
|
167
|
+
* Sentry.ErrorBoundary would send to whichever client the host app installed.
|
|
168
|
+
*/
|
|
169
|
+
declare class DappUiErrorBoundary extends Component<DappUiErrorBoundaryProps, DappUiErrorBoundaryState> {
|
|
170
|
+
state: DappUiErrorBoundaryState;
|
|
171
|
+
static getDerivedStateFromError(): DappUiErrorBoundaryState;
|
|
172
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
173
|
+
render(): ReactNode;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
type DappUiFeature = "app_launcher" | "bridge" | "connect_button" | "get_one_usd" | "relay" | "send" | "skills" | "wallet_connect" | "wallet_info" | "wallet_portfolio";
|
|
177
|
+
type DappUiFlow = "connect" | "send" | "bridge" | "withdraw" | "relay";
|
|
178
|
+
type DappUiFailureReason = "user-rejected" | "insufficient-gas" | "timeout" | "contract-reverted" | "network" | "unknown";
|
|
179
|
+
interface TrackDappUiFunnelOptions {
|
|
180
|
+
status?: "success" | "failure";
|
|
181
|
+
reason?: DappUiFailureReason;
|
|
182
|
+
tags?: Record<string, string>;
|
|
183
|
+
}
|
|
184
|
+
declare function setDappUiAnalyticsUser(address?: string): void;
|
|
185
|
+
/** Button/UI usage event: message `ui: <feature>_<action>` on the isolated client. */
|
|
186
|
+
declare function trackDappUiEvent(feature: DappUiFeature, action: string, tags?: Record<string, string>): void;
|
|
187
|
+
/** Funnel step event: message `funnel: <flow>_<step>` with funnel_status/failure_reason tags. */
|
|
188
|
+
declare function trackDappUiFunnel(flow: DappUiFlow, step: string, options?: TrackDappUiFunnelOptions): void;
|
|
189
|
+
/** Maps arbitrary wallet/RPC errors onto the fixed failure_reason vocabulary. */
|
|
190
|
+
declare function normalizeFailureReason(error: unknown): DappUiFailureReason;
|
|
191
|
+
|
|
18
192
|
interface AppLauncherProps {
|
|
19
193
|
env?: Environment;
|
|
20
194
|
theme?: Theme;
|
|
@@ -49,19 +223,28 @@ interface GlobalMenuItemUrl {
|
|
|
49
223
|
stage: string;
|
|
50
224
|
production: string;
|
|
51
225
|
}
|
|
226
|
+
type GlobalMenuItemAssetUrl = string | GlobalMenuItemUrl;
|
|
227
|
+
type GlobalMenuItemServiceStatus = "available" | "ending" | "comingSoon";
|
|
228
|
+
type GlobalMenuCategoryStatus = "all" | GlobalMenuItemServiceStatus;
|
|
229
|
+
interface GlobalMenuCategory {
|
|
230
|
+
status: GlobalMenuCategoryStatus;
|
|
231
|
+
label: string;
|
|
232
|
+
}
|
|
52
233
|
interface GlobalMenuItem {
|
|
53
234
|
id: string;
|
|
54
235
|
label: string;
|
|
55
236
|
description: string;
|
|
56
237
|
url: GlobalMenuItemUrl;
|
|
57
|
-
iconUrl:
|
|
238
|
+
iconUrl: GlobalMenuItemAssetUrl;
|
|
58
239
|
order: number;
|
|
59
240
|
type: string;
|
|
60
241
|
badge: string | null;
|
|
61
242
|
isNew: boolean;
|
|
243
|
+
serviceStatus?: GlobalMenuItemServiceStatus;
|
|
62
244
|
}
|
|
63
245
|
interface GlobalMenu {
|
|
64
246
|
version: string;
|
|
247
|
+
categories?: GlobalMenuCategory[];
|
|
65
248
|
items: GlobalMenuItem[];
|
|
66
249
|
}
|
|
67
250
|
|
|
@@ -134,6 +317,10 @@ interface TokenStats {
|
|
|
134
317
|
address: string;
|
|
135
318
|
price: string;
|
|
136
319
|
percent_change_24h: string;
|
|
320
|
+
/** 시장 유통량. `/v1/public/token/stats`가 제공(문자열). 상세화면 Total Supply 표기용. */
|
|
321
|
+
circulating_supply?: string;
|
|
322
|
+
market_cap?: string;
|
|
323
|
+
volume_24h?: string;
|
|
137
324
|
}
|
|
138
325
|
interface TokenStatsResponse {
|
|
139
326
|
code: number;
|
|
@@ -144,13 +331,15 @@ interface TokenStatsResponse {
|
|
|
144
331
|
/**
|
|
145
332
|
* 포트폴리오 본문에 노출 가능한 섹션 종류.
|
|
146
333
|
* - `"rewards"` : CROSS Rewards
|
|
334
|
+
* - `"points"` : CROSS Points (게임 토큰 예치 퀘스트, 내장 Withdraw)
|
|
147
335
|
* - `"staking"` : CROSS Staking
|
|
148
336
|
* - `"gameSwap"` : Gametoken LP
|
|
149
337
|
* - `"forge"` : Forge
|
|
338
|
+
* - `"crossdPool"` : CROSSD v3 pool 포지션, 내장 Withdraw
|
|
150
339
|
*
|
|
151
340
|
* `WalletPortfolioBody` / `WalletInfo`의 섹션 필터에 사용한다.
|
|
152
341
|
*/
|
|
153
|
-
type PortfolioSection = "rewards" | "staking" | "gameSwap" | "forge";
|
|
342
|
+
type PortfolioSection = "rewards" | "points" | "staking" | "gameSwap" | "forge" | "crossdPool";
|
|
154
343
|
/**
|
|
155
344
|
* 섹션 필터를 지정하지 않았을 때(=전체 노출)의 기본 표시 순서.
|
|
156
345
|
* 배열로 필터를 줄 때 어떤 키들이 유효한지에 대한 단일 출처(source of truth).
|
|
@@ -173,7 +362,7 @@ interface SendTransactionArgs {
|
|
|
173
362
|
maxFeePerGas?: bigint;
|
|
174
363
|
maxPriorityFeePerGas?: bigint;
|
|
175
364
|
}
|
|
176
|
-
type SendTransactionFn = (args: SendTransactionArgs) => Promise<`0x${string}`>;
|
|
365
|
+
type SendTransactionFn$1 = (args: SendTransactionArgs) => Promise<`0x${string}`>;
|
|
177
366
|
interface GetTransactionReceiptArgs {
|
|
178
367
|
hash: `0x${string}`;
|
|
179
368
|
chainId?: number;
|
|
@@ -247,6 +436,24 @@ interface UserDepositInfo {
|
|
|
247
436
|
last_updated_time: number;
|
|
248
437
|
last_withdrawn_block: number;
|
|
249
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* 사용자가 출금할 수 있는 예치 포지션 하나 (deposited > 0인 풀).
|
|
441
|
+
* `useWithdrawPositions`가 deposits API + pools API(+온체인 메타 폴백)를
|
|
442
|
+
* 합성해 만든다. 금액은 raw(wei) 문자열로 유지하고 표기 시에만 환산한다.
|
|
443
|
+
*/
|
|
444
|
+
interface WithdrawPosition {
|
|
445
|
+
poolId: number;
|
|
446
|
+
poolAddress: string;
|
|
447
|
+
/** pools API가 모르는(비활성/quest) 풀은 "Unknown". */
|
|
448
|
+
poolType: RewardPool["pool_type"] | "Unknown";
|
|
449
|
+
tokenSymbol: string;
|
|
450
|
+
tokenAddress: string;
|
|
451
|
+
decimals: number;
|
|
452
|
+
/** USD 단가 (pools API 제공 시에만). */
|
|
453
|
+
price?: string;
|
|
454
|
+
/** 예치 잔액 (raw, wei 문자열) */
|
|
455
|
+
depositedRaw: string;
|
|
456
|
+
}
|
|
250
457
|
/**
|
|
251
458
|
* host(wagmi 보유 측)가 공급하는 LP 잔고 reader가 반환하는 단위 정보.
|
|
252
459
|
* 금액은 모두 raw(wei) BigInt로 다루고, 표기 시에만 decimals로 환산한다.
|
|
@@ -273,7 +480,7 @@ type LpBalanceReaderFn = (pairAddresses: string[]) => Promise<Record<string, LpB
|
|
|
273
480
|
* game-swap `/portfolio` pool 항목의 토큰 참조.
|
|
274
481
|
* NOTE: CROSS 쪽(token_b)은 백엔드가 메타데이터 없이 내려준다 —
|
|
275
482
|
* `symbol: ""`, `name: ""`, `decimals: 0`, `logo_url` 누락. 소비 측에서
|
|
276
|
-
* symbol은 "
|
|
483
|
+
* symbol은 "ONE"으로, decimals는 18로 간주해야 한다 (실응답 확인 기준).
|
|
277
484
|
*/
|
|
278
485
|
interface GameSwapTokenRef {
|
|
279
486
|
address: string;
|
|
@@ -385,12 +592,61 @@ interface ForgeTokenDetail {
|
|
|
385
592
|
total_supply: string;
|
|
386
593
|
available_supply: string;
|
|
387
594
|
}
|
|
595
|
+
/** cross-defi API 토큰 참조 (detail 응답의 pool.token0/token1). */
|
|
596
|
+
interface CrossdPositionTokenRef {
|
|
597
|
+
address?: string;
|
|
598
|
+
symbol?: string;
|
|
599
|
+
name?: string;
|
|
600
|
+
decimals?: number;
|
|
601
|
+
logo_url?: string;
|
|
602
|
+
}
|
|
603
|
+
/** positions list 항목의 pool 요약 — 심볼만 있고 토큰 주소는 없다(detail에서 보강). */
|
|
604
|
+
interface CrossdPositionPoolRef {
|
|
605
|
+
pool_address?: string;
|
|
606
|
+
fee_tier?: number;
|
|
607
|
+
fee_tier_percentage?: string;
|
|
608
|
+
token0_symbol?: string;
|
|
609
|
+
token1_symbol?: string;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* cross-defi `GET /api/v1/positions?owner=` 목록 항목 중 포트폴리오가 쓰는 필드.
|
|
613
|
+
* 수량류(liquidity, *_amount, uncollected_*)는 십진 문자열로 내려온다 —
|
|
614
|
+
* 계산에 쓰는 것은 liquidity(BigInt 변환)뿐이고 나머지는 표시 전용.
|
|
615
|
+
*/
|
|
616
|
+
interface CrossdPosition {
|
|
617
|
+
token_id?: string;
|
|
618
|
+
/** 0이면 전량 출금된(closed) 포지션 — 섹션에서 제외. */
|
|
619
|
+
liquidity?: string;
|
|
620
|
+
in_range?: boolean;
|
|
621
|
+
is_full_range?: boolean;
|
|
622
|
+
token0_amount?: string;
|
|
623
|
+
token1_amount?: string;
|
|
624
|
+
uncollected_fees_token0?: string;
|
|
625
|
+
uncollected_fees_token1?: string;
|
|
626
|
+
uncollected_fees_usd?: string;
|
|
627
|
+
position_value_usd?: string;
|
|
628
|
+
pool?: CrossdPositionPoolRef;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* `GET /api/v1/positions/{token_id}` detail 중 출금에 필요한 부분.
|
|
632
|
+
* list에는 없는 token0/token1의 주소·decimals를 여기서 얻는다
|
|
633
|
+
* (WCROSS 판별 + sweepToken 인자 + 수량 표기).
|
|
634
|
+
*/
|
|
635
|
+
interface CrossdPositionDetail {
|
|
636
|
+
token_id?: string;
|
|
637
|
+
liquidity?: string;
|
|
638
|
+
pool?: {
|
|
639
|
+
pool_address?: string;
|
|
640
|
+
token0?: CrossdPositionTokenRef;
|
|
641
|
+
token1?: CrossdPositionTokenRef;
|
|
642
|
+
};
|
|
643
|
+
}
|
|
388
644
|
|
|
389
645
|
/**
|
|
390
646
|
* dapp-ui가 렌더하는 outlink의 대분류.
|
|
391
647
|
* `portfolio`는 세부적으로 `origin`으로 더 나뉜다.
|
|
392
648
|
*/
|
|
393
|
-
type OutlinkCategory = "terms" | "privacy" | "portfolio" | "send";
|
|
649
|
+
type OutlinkCategory = "terms" | "privacy" | "portfolio" | "send" | "token-detail";
|
|
394
650
|
/**
|
|
395
651
|
* `onOutlink` 콜백에 전달되는 호출 컨텍스트. `category` + `origin`으로
|
|
396
652
|
* 호출측이 목적지별 분기를 할 수 있고, `portfolio-*`의 경우 해당 섹션의
|
|
@@ -412,6 +668,12 @@ type OutlinkContext = {
|
|
|
412
668
|
pool: RewardPool;
|
|
413
669
|
userDeposit?: UserDepositInfo;
|
|
414
670
|
};
|
|
671
|
+
} | {
|
|
672
|
+
category: "portfolio";
|
|
673
|
+
origin: "portfolio-points";
|
|
674
|
+
payload: {
|
|
675
|
+
position: WithdrawPosition;
|
|
676
|
+
};
|
|
415
677
|
} | {
|
|
416
678
|
category: "portfolio";
|
|
417
679
|
origin: "portfolio-stake";
|
|
@@ -432,6 +694,13 @@ type OutlinkContext = {
|
|
|
432
694
|
pool: ForgePool;
|
|
433
695
|
tokenDetail?: ForgeTokenDetail;
|
|
434
696
|
};
|
|
697
|
+
} | {
|
|
698
|
+
category: "portfolio";
|
|
699
|
+
origin: "portfolio-crossd-pool";
|
|
700
|
+
payload: {
|
|
701
|
+
position: CrossdPosition;
|
|
702
|
+
detail?: CrossdPositionDetail;
|
|
703
|
+
};
|
|
435
704
|
} | {
|
|
436
705
|
category: "send";
|
|
437
706
|
origin: "send-transaction";
|
|
@@ -439,6 +708,13 @@ type OutlinkContext = {
|
|
|
439
708
|
chainId: number;
|
|
440
709
|
txHash: `0x${string}`;
|
|
441
710
|
};
|
|
711
|
+
} | {
|
|
712
|
+
category: "token-detail";
|
|
713
|
+
origin: "token-network" | "token-social" | "token-tx";
|
|
714
|
+
payload: {
|
|
715
|
+
address: string;
|
|
716
|
+
txHash?: string;
|
|
717
|
+
};
|
|
442
718
|
};
|
|
443
719
|
type OutlinkOrigin = OutlinkContext["origin"];
|
|
444
720
|
/**
|
|
@@ -485,7 +761,7 @@ interface SendPageProps {
|
|
|
485
761
|
token: SendAsset;
|
|
486
762
|
tokens?: SendAsset[];
|
|
487
763
|
onTokenChange?: (token: SendAsset) => void;
|
|
488
|
-
sendTransaction?: SendTransactionFn;
|
|
764
|
+
sendTransaction?: SendTransactionFn$1;
|
|
489
765
|
getTransactionReceipt?: GetTransactionReceiptFn;
|
|
490
766
|
/**
|
|
491
767
|
* 확인 단계에서 표시할 가스/수수료 추정 함수. 주입되지 않으면 Gas/Est.Time/Max.Gas 행은 "—"로 표시된다.
|
|
@@ -521,7 +797,7 @@ interface SendFlowProps {
|
|
|
521
797
|
token: SendAsset;
|
|
522
798
|
tokens?: SendAsset[];
|
|
523
799
|
onTokenChange?: (token: SendAsset) => void;
|
|
524
|
-
sendTransaction?: SendTransactionFn;
|
|
800
|
+
sendTransaction?: SendTransactionFn$1;
|
|
525
801
|
getTransactionReceipt?: GetTransactionReceiptFn;
|
|
526
802
|
estimateGas?: EstimateGasFn;
|
|
527
803
|
getTokenPriceUsd?: (token: SendAsset) => number | undefined;
|
|
@@ -560,7 +836,7 @@ interface BridgeInfoTokenRef {
|
|
|
560
836
|
interface BridgeInfoRow {
|
|
561
837
|
label: string;
|
|
562
838
|
value: string;
|
|
563
|
-
tone?: "default" | "accent" | "warning";
|
|
839
|
+
tone?: "default" | "accent" | "warning" | "danger";
|
|
564
840
|
routeTokens?: BridgeInfoTokenRef[];
|
|
565
841
|
valueToken?: BridgeInfoTokenRef;
|
|
566
842
|
}
|
|
@@ -653,9 +929,121 @@ interface BridgeFlowProps {
|
|
|
653
929
|
onFailed?: (info: BridgeFailedInfo) => void;
|
|
654
930
|
onClose?: () => void;
|
|
655
931
|
onBackToWallet?: () => void;
|
|
932
|
+
/**
|
|
933
|
+
* 이 거래의 수수료를 서비스가 대납하는지. 견적(`BridgeTxSummary.txFeeInfo`)의
|
|
934
|
+
* `isDelegateFee` 는 가스만 가리키므로, 스왑/브릿지 수수료 대납은 호출부가
|
|
935
|
+
* 알려줘야 한다(Get ONEUSD 는 `pairs.swap/bridge.feeDelegated` 로 안다).
|
|
936
|
+
*/
|
|
937
|
+
feeDelegated?: boolean;
|
|
938
|
+
/** Compact modal mode: fixed direction, no history entry, host-provided title. */
|
|
939
|
+
variant?: "default" | "embedded";
|
|
940
|
+
title?: string;
|
|
941
|
+
/** Embedded mode only. Defaults to whether `walletAddress` is present. */
|
|
942
|
+
isConnected?: boolean;
|
|
943
|
+
/** Opens the host wallet connection flow from the embedded CTA. */
|
|
944
|
+
onRequestConnect?: () => void;
|
|
656
945
|
className?: string;
|
|
657
946
|
}
|
|
658
|
-
declare function BridgeFlow({ onClose, onBackToWallet, env, className, ...rest }: BridgeFlowProps): react_jsx_runtime.JSX.Element;
|
|
947
|
+
declare function BridgeFlow({ onClose, onBackToWallet, feeDelegated, env, variant, title: titleProp, isConnected: isConnectedProp, onRequestConnect, className, ...rest }: BridgeFlowProps): react_jsx_runtime.JSX.Element;
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* ONEpop (소셜 핸들 드롭) 진입 화면의 표시 계약.
|
|
951
|
+
*
|
|
952
|
+
* dapp-ui는 순수 UI 레이어라 `@nexus-cross/pop`(viem 필수)에 의존할 수 없다
|
|
953
|
+
* (CLAUDE.md §3, docs/pop/03-integration.md). 따라서 이 화면은 **랜딩/진입
|
|
954
|
+
* UI만** 담당하고, 조회(one-pop-api `/drops`·`/histories` — SIWE JWT + X 연결
|
|
955
|
+
* 필요)와 실제 deposit/withdraw는 호스트가 `@nexus-cross/pop`으로 수행해
|
|
956
|
+
* 결과만 `OnePopSummary`로 주입한다. on-ramp(`@nexus-cross/onramp` → `onBuy`)와
|
|
957
|
+
* 동일한 주입 구조다.
|
|
958
|
+
*/
|
|
959
|
+
/** 활동 행 우측 배지. 디자인의 Claimed / Waiting / Refunded / Ready. */
|
|
960
|
+
type OnePopActivityStatus = "claimed" | "waiting" | "refunded" | "ready";
|
|
961
|
+
/** 활동 행의 자금 방향. `sent`="Sent to @x", `received`="Claimed from @x". */
|
|
962
|
+
type OnePopActivityDirection = "sent" | "received";
|
|
963
|
+
interface OnePopActivityItem {
|
|
964
|
+
/** React key 및 중복 제거용 고유 값. 보통 `${txHash}-${logIndex}`. */
|
|
965
|
+
id: string;
|
|
966
|
+
direction: OnePopActivityDirection;
|
|
967
|
+
/** 상대 소셜 핸들. `@` 없이 넘기면 UI가 붙인다. */
|
|
968
|
+
handle: string;
|
|
969
|
+
/** 상대 프로필 이미지. 없으면 이니셜 아바타로 대체된다. */
|
|
970
|
+
avatarUrl?: string;
|
|
971
|
+
/**
|
|
972
|
+
* 금액 (raw wei-scale 10진 문자열). `decimals`와 함께 UI에서 소수점 2자리
|
|
973
|
+
* **버림**으로 표기한다 — Number 변환 없이 BigInt로만 다룬다 (CLAUDE.md §4).
|
|
974
|
+
*/
|
|
975
|
+
amountRaw: string;
|
|
976
|
+
/** `amountRaw`의 소수 자릿수. */
|
|
977
|
+
decimals: number;
|
|
978
|
+
/** 이벤트 시각 (unix epoch, 초 또는 밀리초). 상대시간 표기에 쓴다. */
|
|
979
|
+
timestamp: number;
|
|
980
|
+
status: OnePopActivityStatus;
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* ONEpop 화면이 그리는 상태 전부. 미주입(`undefined`)이면 "내역 없음" 화면을
|
|
984
|
+
* 그린다 — 조회 실패/미연동 상태에서도 진입 UI는 항상 동작한다.
|
|
985
|
+
*/
|
|
986
|
+
interface OnePopSummary {
|
|
987
|
+
/** 수령 대기 중인 드롭 수. 0이면 클레임 배너를 그리지 않는다. */
|
|
988
|
+
claimableCount: number;
|
|
989
|
+
/** 수령 대기 합계 (raw wei-scale). `claimableDecimals`와 함께 쓴다. */
|
|
990
|
+
claimableTotalRaw: string;
|
|
991
|
+
/** `claimableTotalRaw`의 소수 자릿수. 기본 18. */
|
|
992
|
+
claimableDecimals: number;
|
|
993
|
+
/**
|
|
994
|
+
* "N replies waiting" 배너의 카운트. 백엔드 계약(one-pop-api)에 대응 개념이
|
|
995
|
+
* 아직 없어 **숫자만** 받는다 — 의미 해석과 조회는 주입측 책임이다.
|
|
996
|
+
* 0이면 배너를 그리지 않는다.
|
|
997
|
+
*/
|
|
998
|
+
repliesWaitingCount: number;
|
|
999
|
+
/** 최근 활동. 비어 있으면 3개 소개 항목(빈 상태)을 대신 그린다. */
|
|
1000
|
+
activity: OnePopActivityItem[];
|
|
1001
|
+
/**
|
|
1002
|
+
* 활성 X 연결 여부 (one-pop-api `/x-connections`). Activity 버튼은 X 연결이
|
|
1003
|
+
* 있어야 의미가 있으므로(수신 내역이 핸들 기준) true일 때만 렌더한다.
|
|
1004
|
+
* 미주입(undefined)이면 미연결로 취급해 숨긴다.
|
|
1005
|
+
*/
|
|
1006
|
+
xConnected?: boolean;
|
|
1007
|
+
/** 조회 진행 중이면 배너/리스트 자리에 스켈레톤을 그린다. */
|
|
1008
|
+
isLoading?: boolean;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
interface OnePopBodyProps {
|
|
1012
|
+
/** ONEpop 서비스 웹 딥링크의 환경. 미지정 시 production. */
|
|
1013
|
+
env?: Environment;
|
|
1014
|
+
/** Available 카드에 표시할 ONEUSD 잔액 (표시용 포맷 완료 문자열). */
|
|
1015
|
+
balanceDisplay?: string;
|
|
1016
|
+
/** Available 카드의 토큰 아이콘. 미지정 시 아이콘 자리를 비운다. */
|
|
1017
|
+
balanceIconUrl?: string;
|
|
1018
|
+
/** 잔액 조회 중이면 스켈레톤. */
|
|
1019
|
+
isBalanceLoading?: boolean;
|
|
1020
|
+
/** 호스트가 `@nexus-cross/pop`으로 조회해 주입하는 상태. 미주입 = 빈 상태. */
|
|
1021
|
+
summary?: OnePopSummary;
|
|
1022
|
+
/** 브랜드 워드마크 이미지. 미지정 시 인라인 SVG 재현본. */
|
|
1023
|
+
logoSrc?: string;
|
|
1024
|
+
/** 히어로 일러스트 이미지. 미지정 시 인라인 SVG 재현본. */
|
|
1025
|
+
heroSrc?: string;
|
|
1026
|
+
onBack: () => void;
|
|
1027
|
+
onClose: () => void;
|
|
1028
|
+
/**
|
|
1029
|
+
* Send POP 카드 + "Send your first POP!" CTA override. 미주입 시 ONEpop 웹
|
|
1030
|
+
* 센드 페이지(`/pop`)를 새 탭으로 연다. 다른 액션도 같은 규칙 — 전부 서비스
|
|
1031
|
+
* 페이지 이동이라 disabled 상태가 없다.
|
|
1032
|
+
*/
|
|
1033
|
+
onSend?: () => void;
|
|
1034
|
+
/** Claim POPs 카드 + 클레임 배너 override. 기본 `/pop/claim`. */
|
|
1035
|
+
onClaim?: () => void;
|
|
1036
|
+
/**
|
|
1037
|
+
* Activity 카드 + "See all activity" override. 기본 `/pop/activity`.
|
|
1038
|
+
* Activity 카드는 `summary.xConnected` 가 true 일 때만 렌더된다.
|
|
1039
|
+
*/
|
|
1040
|
+
onActivity?: () => void;
|
|
1041
|
+
/** "You might have POPs waiting" 배너 override. 기본 `/pop/board`. */
|
|
1042
|
+
onBoard?: () => void;
|
|
1043
|
+
/** "Get ONEUSD ›" override. 기본 게임토큰 브리지(`/gametoken/bridge`). */
|
|
1044
|
+
onGetToken?: () => void;
|
|
1045
|
+
}
|
|
1046
|
+
declare function OnePopBody({ env, balanceDisplay, balanceIconUrl, isBalanceLoading, summary, logoSrc, heroSrc, onBack, onClose, onSend, onClaim, onActivity, onBoard, onGetToken, }: OnePopBodyProps): react_jsx_runtime.JSX.Element;
|
|
659
1047
|
|
|
660
1048
|
interface WalletInfoTriggerProps {
|
|
661
1049
|
asChild?: boolean;
|
|
@@ -766,6 +1154,41 @@ interface WalletInfoProps {
|
|
|
766
1154
|
* true면 기본 액션 row에 Portfolio 버튼이 표시되며, 클릭 시 내부 Portfolio 뷰로 전환됩니다.
|
|
767
1155
|
*/
|
|
768
1156
|
showPortfolio?: boolean;
|
|
1157
|
+
/**
|
|
1158
|
+
* ONEpop 사용 여부 (기본 **false** — 서비스 오픈 전 딥링크가 죽은 링크가
|
|
1159
|
+
* 되지 않도록 opt-in). true면 기본 액션 row에 ONEpop 버튼이 표시되며,
|
|
1160
|
+
* 클릭 시 내부 ONEpop 뷰로 전환된다. 뷰는 순수 UI라 아래 데이터/콜백이
|
|
1161
|
+
* 없어도 렌더된다 — 액션 버튼은 전부 ONEpop 서비스 딥링크가 기본 동작이다.
|
|
1162
|
+
* connect-kit-react 경유라면 config `onePopEnabled: true` 하나로 노출과
|
|
1163
|
+
* 조회가 함께 켜진다.
|
|
1164
|
+
*/
|
|
1165
|
+
showOnePop?: boolean;
|
|
1166
|
+
/**
|
|
1167
|
+
* ONEpop 뷰가 표시할 상태(수령 대기 수/합계, replies 카운트, 최근 활동).
|
|
1168
|
+
*
|
|
1169
|
+
* dapp-ui는 `@nexus-cross/pop`(viem 필수)에 의존할 수 없으므로 one-pop-api를
|
|
1170
|
+
* 직접 조회하지 않는다 — `/drops`·`/histories`는 SIWE JWT + X 연결이 필요해
|
|
1171
|
+
* 서명 가능한 호스트가 조회한 뒤 이 prop 으로 주입한다.
|
|
1172
|
+
* `@nexus-cross/connect-kit-react`를 쓰면 자동 주입된다.
|
|
1173
|
+
* 미주입 시 "내역 없음" 온보딩 화면을 그린다.
|
|
1174
|
+
*/
|
|
1175
|
+
onePopSummary?: OnePopSummary;
|
|
1176
|
+
/**
|
|
1177
|
+
* ONEpop 뷰 진입 시 1회 호출. `onePopSummary` 조회는 SIWE 서명(지갑 팝업)을
|
|
1178
|
+
* 요구하므로, 주입측이 사용자가 실제로 ONEpop을 열 때까지 조회를 미루는
|
|
1179
|
+
* 트리거로 쓴다.
|
|
1180
|
+
*/
|
|
1181
|
+
onOnePopOpen?: () => void;
|
|
1182
|
+
/** Send POP 카드 + "Send your first POP!" CTA. 미주입 시 비활성. */
|
|
1183
|
+
onOnePopSend?: () => void;
|
|
1184
|
+
/** Claim POPs 카드 + 수령 대기 배너. 미주입 시 비활성. */
|
|
1185
|
+
onOnePopClaim?: () => void;
|
|
1186
|
+
/** Activity 카드 + "See all activity" + replies 배너. 미주입 시 비활성. */
|
|
1187
|
+
onOnePopActivity?: () => void;
|
|
1188
|
+
/** ONEpop 워드마크 이미지 URL. 미지정 시 내장 SVG 재현본. */
|
|
1189
|
+
onePopLogoSrc?: string;
|
|
1190
|
+
/** ONEpop 히어로 일러스트 URL. 미지정 시 내장 SVG 재현본. */
|
|
1191
|
+
onePopHeroSrc?: string;
|
|
769
1192
|
/** Portfolio 뷰의 헤더 타이틀 (기본 "My Portfolio"). */
|
|
770
1193
|
portfolioTitle?: string;
|
|
771
1194
|
/**
|
|
@@ -782,7 +1205,7 @@ interface WalletInfoProps {
|
|
|
782
1205
|
* Send 페이지의 일반 토큰 전송에 사용할 외부 트랜잭션 전송 함수.
|
|
783
1206
|
* wagmi의 `sendTransactionAsync`를 그대로 전달해도 호환된다.
|
|
784
1207
|
*/
|
|
785
|
-
sendTransaction?: SendTransactionFn;
|
|
1208
|
+
sendTransaction?: SendTransactionFn$1;
|
|
786
1209
|
getTransactionReceipt?: GetTransactionReceiptFn;
|
|
787
1210
|
/**
|
|
788
1211
|
* Send 확인 단계에서 표시할 가스/수수료 추정 함수.
|
|
@@ -819,16 +1242,20 @@ interface WalletInfoProps {
|
|
|
819
1242
|
approveBridge?: BridgeApproveFn;
|
|
820
1243
|
submitBridge?: BridgeSubmitFn;
|
|
821
1244
|
/**
|
|
822
|
-
* 상단 QR 버튼 / 기본 액션 row의
|
|
823
|
-
* prop으로 이미 정의됨.)
|
|
1245
|
+
* 상단 QR 버튼 / 기본 액션 row의 Receive / Send 콜백. (Buy는 위 onBuy
|
|
1246
|
+
* prop으로 이미 정의됨.)
|
|
824
1247
|
*/
|
|
825
1248
|
onReceive?: () => void;
|
|
1249
|
+
/**
|
|
1250
|
+
* @deprecated Bridge 버튼은 항상 apps.json(gametokenBridge) 웹으로
|
|
1251
|
+
* 이동한다. 이 콜백은 더 이상 호출되지 않는다.
|
|
1252
|
+
*/
|
|
826
1253
|
onBridge?: () => void;
|
|
827
1254
|
onSend?: () => void;
|
|
828
1255
|
style?: WalletInfoStyle;
|
|
829
1256
|
children: React.ReactNode;
|
|
830
1257
|
}
|
|
831
|
-
declare function WalletInfoRoot({ env, theme, mobileBreakpoint, drawerDirection, modal, showBalance, showForgeToken, showGameToken, showQR, showBridge, qrLogoSrc, walletAddress, accountName, sendAccounts, profileImageUrl, connectorId, connectorName: connectorNameProp, connectorIconUrl: connectorIconUrlProp, preferredTokens, onSelectWallet, onCopyAddress, onBuy, onBuyDisabledMessage, onBridgeDisabledMessage, onSendDisabledMessage, onDisconnect, disconnectLabel, termsUrl, termsLabel, privacyUrl, privacyLabel, open: propOpen, onOpenChange, showPortfolio, portfolioTitle, portfolioSections, showTotalAssets, totalAssetsLabel, sendTransaction, getTransactionReceipt, estimateGas, onOutlink, lpBalanceReader, stakingRewardsReader, bridgeTokens, bridgeHistory, getBridgeQuote, getBridgeToTokens, getBridgeApproval, approveBridge, submitBridge, onReceive, onBridge, onSend, style, children, }: WalletInfoProps): react_jsx_runtime.JSX.Element;
|
|
1258
|
+
declare function WalletInfoRoot({ env, theme, mobileBreakpoint, drawerDirection, modal, showBalance, showForgeToken, showGameToken, showQR, showBridge, qrLogoSrc, walletAddress, accountName, sendAccounts, profileImageUrl, connectorId, connectorName: connectorNameProp, connectorIconUrl: connectorIconUrlProp, preferredTokens, onSelectWallet, onCopyAddress, onBuy, onBuyDisabledMessage, onBridgeDisabledMessage, onSendDisabledMessage, onDisconnect, disconnectLabel, termsUrl, termsLabel, privacyUrl, privacyLabel, open: propOpen, onOpenChange, showPortfolio, showOnePop, onePopSummary, onOnePopOpen, onOnePopSend, onOnePopClaim, onOnePopActivity, onePopLogoSrc, onePopHeroSrc, portfolioTitle, portfolioSections, showTotalAssets, totalAssetsLabel, sendTransaction, getTransactionReceipt, estimateGas, onOutlink, lpBalanceReader, stakingRewardsReader, bridgeTokens, bridgeHistory, getBridgeQuote, getBridgeToTokens, getBridgeApproval, approveBridge, submitBridge, onReceive, onBridge, onSend, style, children, }: WalletInfoProps): react_jsx_runtime.JSX.Element;
|
|
832
1259
|
declare const WalletInfo: typeof WalletInfoRoot & {
|
|
833
1260
|
Trigger: typeof WalletInfoTrigger;
|
|
834
1261
|
Content: typeof WalletInfoContent;
|
|
@@ -1041,9 +1468,23 @@ interface WalletPortfolioProps {
|
|
|
1041
1468
|
* host(wagmi 보유 측)로부터 주입받는 reader. 미주입 시 API 값으로 폴백한다.
|
|
1042
1469
|
*/
|
|
1043
1470
|
stakingRewardsReader?: StakingRewardsReaderFn;
|
|
1471
|
+
/**
|
|
1472
|
+
* 내장 Withdraw(Rewards) 트랜잭션 서명/브로드캐스트 콜백.
|
|
1473
|
+
* wagmi의 `sendTransactionAsync`를 그대로 전달해도 호환된다.
|
|
1474
|
+
* 미주입 시 Withdraw는 기존 외부 링크로 폴백한다.
|
|
1475
|
+
*/
|
|
1476
|
+
sendTransaction?: SendTransactionFn$1;
|
|
1477
|
+
/** 내장 Withdraw 확인 화면의 가스 추정 콜백. 미주입 시 지갑 추정에 위임. */
|
|
1478
|
+
estimateGas?: EstimateGasFn;
|
|
1479
|
+
/**
|
|
1480
|
+
* 포트폴리오 금액 표시 통화의 USD 환산 비율(USD 기준). 미주입 시 1(=USD).
|
|
1481
|
+
*/
|
|
1482
|
+
conversionRatio?: number;
|
|
1483
|
+
/** 포트폴리오 금액 표시 통화 기호. 미주입 시 `"$"`. */
|
|
1484
|
+
currencySymbol?: string;
|
|
1044
1485
|
children: React.ReactNode;
|
|
1045
1486
|
}
|
|
1046
|
-
declare function WalletPortfolioRoot({ env, theme, walletAddress, open: propOpen, onOpenChange, onOutlink, lpBalanceReader, stakingRewardsReader, children, }: WalletPortfolioProps): react_jsx_runtime.JSX.Element;
|
|
1487
|
+
declare function WalletPortfolioRoot({ env, theme, walletAddress, open: propOpen, onOpenChange, onOutlink, lpBalanceReader, stakingRewardsReader, sendTransaction, estimateGas, conversionRatio, currencySymbol, children, }: WalletPortfolioProps): react_jsx_runtime.JSX.Element;
|
|
1047
1488
|
declare const WalletPortfolio: typeof WalletPortfolioRoot & {
|
|
1048
1489
|
Trigger: typeof WalletPortfolioTrigger;
|
|
1049
1490
|
Content: typeof WalletPortfolioContent;
|
|
@@ -1085,6 +1526,20 @@ interface WalletPortfolioBodyProps {
|
|
|
1085
1526
|
* host(wagmi 보유 측)로부터 주입받는 reader. 미주입 시 API 값으로 폴백한다.
|
|
1086
1527
|
*/
|
|
1087
1528
|
stakingRewardsReader?: StakingRewardsReaderFn;
|
|
1529
|
+
/**
|
|
1530
|
+
* 내장 Withdraw(Rewards) 트랜잭션 서명/브로드캐스트 콜백.
|
|
1531
|
+
* wagmi의 `sendTransactionAsync`를 그대로 전달해도 호환된다.
|
|
1532
|
+
* 미주입 시 Withdraw는 기존 외부 링크로 폴백한다.
|
|
1533
|
+
*/
|
|
1534
|
+
sendTransaction?: SendTransactionFn$1;
|
|
1535
|
+
/** 내장 Withdraw 확인 화면의 가스 추정 콜백. 미주입 시 지갑 추정에 위임. */
|
|
1536
|
+
estimateGas?: EstimateGasFn;
|
|
1537
|
+
/**
|
|
1538
|
+
* 포트폴리오 금액 표시 통화의 USD 환산 비율(USD 기준). 미주입 시 1(=USD).
|
|
1539
|
+
*/
|
|
1540
|
+
conversionRatio?: number;
|
|
1541
|
+
/** 포트폴리오 금액 표시 통화 기호. 미주입 시 `"$"`. */
|
|
1542
|
+
currencySymbol?: string;
|
|
1088
1543
|
/**
|
|
1089
1544
|
* 노출할 포트폴리오 섹션을 제한한다. 미지정(`undefined`)이면 모든 섹션을
|
|
1090
1545
|
* 기본 순서대로 표시하고, 배열을 주면 포함된 섹션만 (기본 순서를 유지한 채)
|
|
@@ -1092,7 +1547,1048 @@ interface WalletPortfolioBodyProps {
|
|
|
1092
1547
|
*/
|
|
1093
1548
|
sections?: PortfolioSection[];
|
|
1094
1549
|
}
|
|
1095
|
-
declare function WalletPortfolioBody({ env, theme, walletAddress, walletName, onBack, showHeader, variant, className, onOutlink, lpBalanceReader, stakingRewardsReader, sections, }: WalletPortfolioBodyProps): react_jsx_runtime.JSX.Element;
|
|
1550
|
+
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;
|
|
1551
|
+
|
|
1552
|
+
/** One origin-side ERC-20 (or native, address = zero) token the UI may offer. */
|
|
1553
|
+
interface Token {
|
|
1554
|
+
symbol: string;
|
|
1555
|
+
address: string;
|
|
1556
|
+
decimals: number;
|
|
1557
|
+
logoUrl?: string;
|
|
1558
|
+
}
|
|
1559
|
+
/** The fixed destination asset every order delivers: crossd on CROSS. */
|
|
1560
|
+
interface Destination {
|
|
1561
|
+
symbol: string;
|
|
1562
|
+
chainId: number;
|
|
1563
|
+
address: string;
|
|
1564
|
+
decimals: number;
|
|
1565
|
+
note?: string;
|
|
1566
|
+
}
|
|
1567
|
+
/** Origin chain VM family: "evm" (default) or "svm" (Solana). */
|
|
1568
|
+
type ChainKind = 'evm' | 'svm';
|
|
1569
|
+
/**
|
|
1570
|
+
* One delivery-side asset an order's crossd-equivalent output may be paid
|
|
1571
|
+
* out as -- the default target (isDefault: true) is crossd itself
|
|
1572
|
+
* (byte-identical to Catalog.destination); non-default targets are
|
|
1573
|
+
* alternate payout assets the user may opt into (see GET /v1/deposit-address's
|
|
1574
|
+
* `target` query param). `external: true` marks a target delivered via an
|
|
1575
|
+
* external adapter (e.g. pONEUSD) rather than natively minted -- the UI
|
|
1576
|
+
* shows an extra trust note for these (Task 9).
|
|
1577
|
+
*/
|
|
1578
|
+
type Target = {
|
|
1579
|
+
symbol: string;
|
|
1580
|
+
address: string;
|
|
1581
|
+
decimals: number;
|
|
1582
|
+
isDefault: boolean;
|
|
1583
|
+
external: boolean;
|
|
1584
|
+
};
|
|
1585
|
+
/** One supported (chain, token) pair the UI can offer as an order's source. */
|
|
1586
|
+
interface OriginOption {
|
|
1587
|
+
chainId: number;
|
|
1588
|
+
chainName: string;
|
|
1589
|
+
/**
|
|
1590
|
+
* VM family of the origin chain. "svm" (Solana) origins are display-only:
|
|
1591
|
+
* the connected EVM wallet cannot sign them, so no one-click deposit or
|
|
1592
|
+
* balance read is offered -- the user pays out-of-band from a Solana wallet.
|
|
1593
|
+
*/
|
|
1594
|
+
kind: ChainKind;
|
|
1595
|
+
token: Token;
|
|
1596
|
+
/** Smallest-unit base-10 integer string (matches Token.decimals). */
|
|
1597
|
+
minAmount: string;
|
|
1598
|
+
/** Smallest-unit base-10 integer string; absent = no configured cap. */
|
|
1599
|
+
maxAmount?: string;
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Which order-creation flow is live: "standing" (GET /v1/deposit-address
|
|
1603
|
+
* returns a stable, reusable per-user address) or "per_order" (the legacy
|
|
1604
|
+
* flow, a fresh forwarder minted per POST /v1/orders). See
|
|
1605
|
+
* internal/catalog.Catalog.AddressMode's doc comment.
|
|
1606
|
+
*/
|
|
1607
|
+
type AddressMode = 'standing' | 'per_order';
|
|
1608
|
+
/** GET /v1/config response: the curated catalog of origins + fixed destination. */
|
|
1609
|
+
interface Catalog {
|
|
1610
|
+
destination: Destination;
|
|
1611
|
+
origins: OriginOption[];
|
|
1612
|
+
addressMode: AddressMode;
|
|
1613
|
+
/**
|
|
1614
|
+
* The user-selectable delivery targets an order may pay out as (Task 4).
|
|
1615
|
+
* Always includes the default target (crossd, byte-identical to
|
|
1616
|
+
* `destination`). Defaults to `[]` when the backend response omits this
|
|
1617
|
+
* field entirely -- back-compat with an older backend that predates
|
|
1618
|
+
* per-target delivery (see createRelayClient's getConfig).
|
|
1619
|
+
*/
|
|
1620
|
+
targets: Target[];
|
|
1621
|
+
}
|
|
1622
|
+
/** POST /v1/quote request body. */
|
|
1623
|
+
interface QuoteRequest {
|
|
1624
|
+
originChainId: number;
|
|
1625
|
+
originCurrency: string;
|
|
1626
|
+
/** Smallest-unit base-10 integer string. */
|
|
1627
|
+
amount: string;
|
|
1628
|
+
}
|
|
1629
|
+
/** POST /v1/quote response body. */
|
|
1630
|
+
interface QuoteResult {
|
|
1631
|
+
/** Smallest-unit (BSC USDT, 18 decimals) base-10 integer string. */
|
|
1632
|
+
expectedBscUsdt: string;
|
|
1633
|
+
belowMin: boolean;
|
|
1634
|
+
/**
|
|
1635
|
+
* Smallest-unit (crossd, catalog.destination.decimals) base-10 integer
|
|
1636
|
+
* string. Currently assumed at 1:1 parity with BSC USDT -- see
|
|
1637
|
+
* assumesParity.
|
|
1638
|
+
*/
|
|
1639
|
+
expectedCrossd: string;
|
|
1640
|
+
assumesParity: boolean;
|
|
1641
|
+
/**
|
|
1642
|
+
* The fee DEDUCTED FROM the bridged amount, in USD, as a decimal string --
|
|
1643
|
+
* Relay's relayer fee plus any app surcharge (upstream af35dd5). It is
|
|
1644
|
+
* exactly what accounts for the gap between what the user sends and
|
|
1645
|
+
* `expectedBscUsdt`.
|
|
1646
|
+
*
|
|
1647
|
+
* It deliberately EXCLUDES the user's own origin-chain gas: that is paid from
|
|
1648
|
+
* their wallet in the origin chain's native token, the wallet already quotes
|
|
1649
|
+
* it at signing time, and none of it comes out of the bridged amount.
|
|
1650
|
+
*
|
|
1651
|
+
* Absent means UNKNOWN, never free -- render absence as absence. "$0.00" for
|
|
1652
|
+
* a fee nobody could compute is the one wrong reading. (A genuine zero, e.g.
|
|
1653
|
+
* the direct BSC-USDT route with no Relay leg, is also absent rather than
|
|
1654
|
+
* "0": no Relay leg means no relayer fee to report.)
|
|
1655
|
+
*/
|
|
1656
|
+
feeUsd?: string;
|
|
1657
|
+
/**
|
|
1658
|
+
* How many seconds this quote stays valid. Drives the refresh cadence in
|
|
1659
|
+
* useDepositAddress -- the widget previously hardcoded 30s with no
|
|
1660
|
+
* relationship to the quote's real lifetime. Absent when the backend has no
|
|
1661
|
+
* TTL configured, in which case the client keeps its own default interval.
|
|
1662
|
+
*
|
|
1663
|
+
* There is deliberately no eta/duration field here. An earlier version of
|
|
1664
|
+
* this type carried `etaSeconds` on the assumption that Relay's quote
|
|
1665
|
+
* reports timing; it does not -- the response has no ETA field of any kind
|
|
1666
|
+
* -- so it was removed rather than left permanently undefined.
|
|
1667
|
+
*/
|
|
1668
|
+
ttl?: number;
|
|
1669
|
+
}
|
|
1670
|
+
/** GET /v1/deposit-address request query params -- no amount: a standing
|
|
1671
|
+
* address is resolved purely from (user, originChainId, originCurrency),
|
|
1672
|
+
* independent of any deposit size. */
|
|
1673
|
+
interface DepositAddressRequest {
|
|
1674
|
+
user: string;
|
|
1675
|
+
originChainId: number;
|
|
1676
|
+
originCurrency: string;
|
|
1677
|
+
}
|
|
1678
|
+
/**
|
|
1679
|
+
* GET /v1/deposit-address response body -- a stable, reusable deposit
|
|
1680
|
+
* address for this (user, origin chain, origin token). The same request
|
|
1681
|
+
* always resolves to the same address; no order/deposit is created by
|
|
1682
|
+
* fetching it, and it accepts any number of deposits over time (see
|
|
1683
|
+
* internal/standing.Service.GetOrCreateDepositAddress).
|
|
1684
|
+
*/
|
|
1685
|
+
interface DepositAddressResult {
|
|
1686
|
+
user: string;
|
|
1687
|
+
forwarder: string;
|
|
1688
|
+
version: number;
|
|
1689
|
+
depositAddress: string;
|
|
1690
|
+
originChainId: number;
|
|
1691
|
+
originCurrency: string;
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* One row of GET /v1/orders?user=...'s "orders" array. A single order can
|
|
1695
|
+
* aggregate several deposits made to the same reusable forwarder; `deposits[]`
|
|
1696
|
+
* is the per-arrival identity. Amount fields are smallest-unit base-10 integer
|
|
1697
|
+
* strings, "" when not yet known.
|
|
1698
|
+
*/
|
|
1699
|
+
interface OrderSummary {
|
|
1700
|
+
orderId: string;
|
|
1701
|
+
status: string;
|
|
1702
|
+
source: string;
|
|
1703
|
+
amountIn: string;
|
|
1704
|
+
expectedOut: string;
|
|
1705
|
+
bscBridgeTx: string;
|
|
1706
|
+
originChainId: number;
|
|
1707
|
+
originCurrency: string;
|
|
1708
|
+
/** CROSS delivery-token symbol this order pays out as (a Catalog.targets
|
|
1709
|
+
* symbol, e.g. "pONEUSD"); "" / omitted means the default target. Used to
|
|
1710
|
+
* label the "out" side with the actual delivered token. */
|
|
1711
|
+
target?: string;
|
|
1712
|
+
forwarderVersion: number;
|
|
1713
|
+
/** RFC3339 timestamp. */
|
|
1714
|
+
createdAt: string;
|
|
1715
|
+
/** What the user ACTUALLY received, observed from the CROSS delivery
|
|
1716
|
+
* transfer. Distinct from expectedOut, which is the pre-delivery projection
|
|
1717
|
+
* after fees -- the two differ by swap slippage and any executor fallback.
|
|
1718
|
+
* "" until delivery, and for orders delivered before the backend recorded it. */
|
|
1719
|
+
amountOut?: string;
|
|
1720
|
+
/** The CROSS-side transaction that delivered the funds. "" until delivery. */
|
|
1721
|
+
deliveryTxHash?: string;
|
|
1722
|
+
/** RFC3339 timestamp of the COMPLETED transition -- when the user received
|
|
1723
|
+
* the funds. Absent for orders that never completed. */
|
|
1724
|
+
completedAt?: string;
|
|
1725
|
+
/** The individual deposits this delivery paid out, oldest first. There can be
|
|
1726
|
+
* SEVERAL: a user may top up a little at a time and the sweeper aggregates
|
|
1727
|
+
* whatever has arrived into one order. Empty when the backend has not
|
|
1728
|
+
* attributed the deposits to this order yet. */
|
|
1729
|
+
deposits?: OrderDeposit[];
|
|
1730
|
+
}
|
|
1731
|
+
/** One deposit inside an order, as GET /v1/orders reports it.
|
|
1732
|
+
*
|
|
1733
|
+
* originChainId/originCurrency are the chain and token the user ACTUALLY paid,
|
|
1734
|
+
* which the order itself cannot report (one reusable deposit address serves
|
|
1735
|
+
* every origin route, so the swept balance carries no memory of where it came
|
|
1736
|
+
* from). They are absent when the backend has not attributed the deposit --
|
|
1737
|
+
* for a DIRECT BSC deposit that is permanent and correct, since it has no
|
|
1738
|
+
* cross-chain leg. */
|
|
1739
|
+
interface OrderDeposit {
|
|
1740
|
+
/** Amount that arrived at the forwarder, in BSC USDT base units. NOT the
|
|
1741
|
+
* amount sent on the origin chain, which is larger by Relay's fees and
|
|
1742
|
+
* denominated in the origin token's own decimals. */
|
|
1743
|
+
amount: string;
|
|
1744
|
+
blockNumber: number;
|
|
1745
|
+
originChainId?: number;
|
|
1746
|
+
originCurrency?: string;
|
|
1747
|
+
/** The BSC-side arrival (transfer into the forwarder). */
|
|
1748
|
+
txHash: string;
|
|
1749
|
+
/** The user's own send on the ORIGIN chain -- what the "Deposit" step links
|
|
1750
|
+
* to. Absent when unattributed. */
|
|
1751
|
+
originTxHash?: string;
|
|
1752
|
+
}
|
|
1753
|
+
type StepStatus = 'done' | 'active' | 'pending';
|
|
1754
|
+
interface OrderStep {
|
|
1755
|
+
key: string;
|
|
1756
|
+
label: string;
|
|
1757
|
+
status: StepStatus;
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* GET /v1/orders/{orderId} response body. "status" is the raw backend state
|
|
1761
|
+
* (e.g. "AWAITING_DEPOSIT", "COMPLETED", "FAILED", ...); "steps" is the
|
|
1762
|
+
* friendlier 3-stage deposit -> bridge -> deliver breakdown the UI renders.
|
|
1763
|
+
*/
|
|
1764
|
+
interface Order {
|
|
1765
|
+
orderId: string;
|
|
1766
|
+
status: string;
|
|
1767
|
+
steps: OrderStep[];
|
|
1768
|
+
bridgeIndex: string;
|
|
1769
|
+
txs: {
|
|
1770
|
+
bscBridge: string;
|
|
1771
|
+
crossFinalize: string;
|
|
1772
|
+
crossExecute: string;
|
|
1773
|
+
};
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* GET /v1/recovery?user=... response body -- the permissionless self-recovery
|
|
1777
|
+
* status for a user's standing forwarder on BSC. Task 1's endpoint; consumed
|
|
1778
|
+
* by useRecovery (Task 2) to drive the settings-menu "Recover stuck funds"
|
|
1779
|
+
* panel. Every recovery tx (factory.deploy, forwarder.execute/sweepToUser)
|
|
1780
|
+
* takes no destination argument -- funds always route to `forwarder`'s
|
|
1781
|
+
* immutable recipient, so this info is advisory/orientation only, never a
|
|
1782
|
+
* capability check the UI should use to block the user.
|
|
1783
|
+
*/
|
|
1784
|
+
interface RecoveryInfo {
|
|
1785
|
+
user: string;
|
|
1786
|
+
/** The user's forwarder address on BSC for the requested target (CREATE2, deterministic from
|
|
1787
|
+
* user+version+target). */
|
|
1788
|
+
forwarder: string;
|
|
1789
|
+
/** Whether `forwarder` has been deployed on-chain yet. */
|
|
1790
|
+
isDeployed: boolean;
|
|
1791
|
+
/** BSC USDT token contract address -- always BSC USDT regardless of `target` (the forwarder
|
|
1792
|
+
* holds BSC USDT pre-bridge in every case). */
|
|
1793
|
+
token: string;
|
|
1794
|
+
decimals: number;
|
|
1795
|
+
/** Smallest-unit base-10 integer string -- the forwarder's current token balance. */
|
|
1796
|
+
balance: string;
|
|
1797
|
+
/** The factory that deploys/derives `forwarder` for the requested target: the
|
|
1798
|
+
* DepositorForwarderFactory for a depositor-kind target, the StandingForwarderFactory
|
|
1799
|
+
* otherwise (recovery follow-up, multi-target). */
|
|
1800
|
+
factory: string;
|
|
1801
|
+
version: number;
|
|
1802
|
+
/** Smallest-unit base-10 integer string -- the bridge's configured minimum. */
|
|
1803
|
+
bridgeMinWei: string;
|
|
1804
|
+
/** Server's best-effort recommendation: "execute" (balance clears the bridge minimum, so a
|
|
1805
|
+
* normal delivery can complete), "sweep" (below minimum -- recover directly instead), or
|
|
1806
|
+
* "none" (no balance to act on). Advisory only -- never used to disable an action. */
|
|
1807
|
+
suggestedAction: 'execute' | 'sweep' | 'none';
|
|
1808
|
+
/** True when the backend sees this balance as possibly mid-flight (e.g. a sweep/bridge job
|
|
1809
|
+
* already in progress) -- advisory caution only, must NOT disable either recovery action. */
|
|
1810
|
+
inFlight: boolean;
|
|
1811
|
+
inFlightReason?: string;
|
|
1812
|
+
/**
|
|
1813
|
+
* Task 6/7: every known BSC token held at `forwarder` (not just the primary `token`/`balance`
|
|
1814
|
+
* pair above, which only ever reports BSC USDT) -- lets the UI surface a MISDEPOSITED token
|
|
1815
|
+
* (e.g. someone sent BUSD to a USDT-swap forwarder) that the top-level fields alone can't
|
|
1816
|
+
* represent. Optional/omitted for an older backend that predates this field -- back-compat,
|
|
1817
|
+
* byte-identical to pre-Task-6 behavior when absent (the UI falls back to `token`/`balance`).
|
|
1818
|
+
* Each entry's `suggestedAction` mirrors the top-level one's semantics, per-token.
|
|
1819
|
+
*/
|
|
1820
|
+
tokens?: {
|
|
1821
|
+
address: string;
|
|
1822
|
+
symbol: string;
|
|
1823
|
+
decimals: number;
|
|
1824
|
+
/** Smallest-unit base-10 integer string -- this token's current balance at `forwarder`. */
|
|
1825
|
+
balance: string;
|
|
1826
|
+
/** Server's advisory recoverable flag for this token -- never used to disable the sweep
|
|
1827
|
+
* action (see `recover`'s doc in useRecovery.ts), only to decide which tokens the UI lists. */
|
|
1828
|
+
recoverable: boolean;
|
|
1829
|
+
suggestedAction: 'execute' | 'sweep' | 'none';
|
|
1830
|
+
}[];
|
|
1831
|
+
}
|
|
1832
|
+
/** GET /v1/recovery request query params. */
|
|
1833
|
+
interface RecoveryRequest {
|
|
1834
|
+
user: string;
|
|
1835
|
+
/** Selected CROSS delivery target symbol (mirrors DepositAddressRequest's `target`) -- omitted
|
|
1836
|
+
* (or empty) selects the configured default, preserving pre-multi-target behavior
|
|
1837
|
+
* byte-for-byte. Passed through verbatim as "?target=" when set. */
|
|
1838
|
+
target?: string;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
/** Thrown for any non-2xx API response. `status` is the HTTP status code. */
|
|
1842
|
+
declare class RelayApiError extends Error {
|
|
1843
|
+
status: number;
|
|
1844
|
+
/** Parsed JSON error body when the response was valid JSON, else undefined. */
|
|
1845
|
+
body?: unknown;
|
|
1846
|
+
constructor(status: number, message: string, body?: unknown);
|
|
1847
|
+
}
|
|
1848
|
+
interface RelayClientOptions {
|
|
1849
|
+
/** API origin, e.g. "https://orchestrator.example.com". Trailing slashes are stripped. */
|
|
1850
|
+
baseUrl: string;
|
|
1851
|
+
}
|
|
1852
|
+
interface RelayClient {
|
|
1853
|
+
/** GET /v1/config -- the curated origin catalog + fixed crossd destination. */
|
|
1854
|
+
getConfig(): Promise<Catalog>;
|
|
1855
|
+
/** POST /v1/quote -- a price-only preview, no order/deposit is created. */
|
|
1856
|
+
getQuote(req: QuoteRequest): Promise<QuoteResult>;
|
|
1857
|
+
/**
|
|
1858
|
+
* GET /v1/deposit-address -- resolves the stable, reusable deposit
|
|
1859
|
+
* address for (user, originChainId, originCurrency). No amount is
|
|
1860
|
+
* involved and no order is created; the same address can receive any
|
|
1861
|
+
* number of deposits of any size. Several deposits can be aggregated into
|
|
1862
|
+
* one order when they jointly fund the same reusable forwarder.
|
|
1863
|
+
*
|
|
1864
|
+
* `target` (Task 8) is the delivery asset's symbol from
|
|
1865
|
+
* `Catalog.targets` -- sent as `&target=<symbol>` only when it's a
|
|
1866
|
+
* non-empty string; omitted otherwise, in which case the backend
|
|
1867
|
+
* resolves the default target (byte-identical to pre-Task-6 behavior).
|
|
1868
|
+
*/
|
|
1869
|
+
getDepositAddress(req: DepositAddressRequest, target?: string): Promise<DepositAddressResult>;
|
|
1870
|
+
/**
|
|
1871
|
+
* GET /v1/orders/{orderId} -- current status + stepper progress for one
|
|
1872
|
+
* order. Reads are public (unauthenticated).
|
|
1873
|
+
*/
|
|
1874
|
+
getOrder(orderId: string): Promise<Order>;
|
|
1875
|
+
/**
|
|
1876
|
+
* GET /v1/orders?user=... -- every order swept from deposits to that
|
|
1877
|
+
* user's standing address(es) (newest-first, capped server-side).
|
|
1878
|
+
*/
|
|
1879
|
+
listOrders(user: string): Promise<OrderSummary[]>;
|
|
1880
|
+
/** Absolute URL of the SSE order-change stream for `user`
|
|
1881
|
+
* (GET /v1/orders/stream?user=...). Emits `event: connected` on open,
|
|
1882
|
+
* `event: orders-changed` when that user's orders change, and `:
|
|
1883
|
+
* heartbeat` comments -- it carries no order data itself, so consumers
|
|
1884
|
+
* always follow up with `listOrders`. */
|
|
1885
|
+
ordersStreamUrl(user: string): string;
|
|
1886
|
+
/**
|
|
1887
|
+
* GET /v1/recovery?user=... -- permissionless self-recovery status for a
|
|
1888
|
+
* user's forwarder on BSC (Task 1). `req.target` (optional) selects which
|
|
1889
|
+
* per-target forwarder/factory to report -- omitted selects the
|
|
1890
|
+
* configured default, byte-identical to pre-multi-target behavior.
|
|
1891
|
+
* Purely informational -- fetching it never triggers or blocks any
|
|
1892
|
+
* on-chain action. The response's `tokens[]` (Task 6/7 -- every known BSC
|
|
1893
|
+
* token held at the forwarder) flows through as-is: it's plain JSON, so no
|
|
1894
|
+
* extra parsing/mapping is needed beyond RecoveryInfo's own typing, and
|
|
1895
|
+
* it's simply absent/undefined for an older backend that predates it.
|
|
1896
|
+
*/
|
|
1897
|
+
getRecovery(req: RecoveryRequest): Promise<RecoveryInfo>;
|
|
1898
|
+
}
|
|
1899
|
+
/**
|
|
1900
|
+
* Builds a framework-agnostic Relay API client. Uses plain `fetch` only --
|
|
1901
|
+
* no react-query, no RainbowKit/wagmi. `baseUrl` is passed in explicitly (no
|
|
1902
|
+
* `import.meta.env` coupling) so the widget can be embedded in any host app's
|
|
1903
|
+
* own config/env story.
|
|
1904
|
+
*
|
|
1905
|
+
* No API key: the backend has no inbound key gate (upstream 83845fb removed
|
|
1906
|
+
* the dead `apiKey`/X-API-Key plumbing -- a security control that does not
|
|
1907
|
+
* exist must not appear in a public type).
|
|
1908
|
+
*/
|
|
1909
|
+
declare function createRelayClient(options: RelayClientOptions): RelayClient;
|
|
1910
|
+
|
|
1911
|
+
interface DefaultToken {
|
|
1912
|
+
chainId: number;
|
|
1913
|
+
/** Token contract address, or the zero address for the chain's native asset. */
|
|
1914
|
+
address: string;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
type Hex = `0x${string}`;
|
|
1918
|
+
interface RelayTxRequest {
|
|
1919
|
+
chainId: number;
|
|
1920
|
+
to: Hex;
|
|
1921
|
+
value?: bigint;
|
|
1922
|
+
data?: Hex;
|
|
1923
|
+
}
|
|
1924
|
+
interface RelayContractCall {
|
|
1925
|
+
chainId: number;
|
|
1926
|
+
address: Hex;
|
|
1927
|
+
abi: readonly unknown[];
|
|
1928
|
+
functionName: string;
|
|
1929
|
+
args: readonly unknown[];
|
|
1930
|
+
}
|
|
1931
|
+
interface RelayBalance {
|
|
1932
|
+
value: bigint;
|
|
1933
|
+
decimals: number;
|
|
1934
|
+
symbol: string;
|
|
1935
|
+
}
|
|
1936
|
+
type SendTransactionFn = (req: RelayTxRequest) => Promise<Hex>;
|
|
1937
|
+
type WriteContractFn = (call: RelayContractCall) => Promise<Hex>;
|
|
1938
|
+
type ReadContractFn = (call: RelayContractCall) => Promise<unknown>;
|
|
1939
|
+
type SwitchChainFn = (chainId: number) => Promise<void>;
|
|
1940
|
+
type WaitForReceiptFn = (p: {
|
|
1941
|
+
chainId: number;
|
|
1942
|
+
hash: Hex;
|
|
1943
|
+
}) => Promise<{
|
|
1944
|
+
status: "success" | "reverted";
|
|
1945
|
+
}>;
|
|
1946
|
+
type GetBalanceFn = (p: {
|
|
1947
|
+
chainId: number;
|
|
1948
|
+
address: Hex;
|
|
1949
|
+
token?: Hex;
|
|
1950
|
+
}) => Promise<RelayBalance>;
|
|
1951
|
+
/** 지갑 주입 props — 전부 optional, 미주입 시 graceful degradation. */
|
|
1952
|
+
interface RelayWalletProps {
|
|
1953
|
+
walletAddress?: string;
|
|
1954
|
+
walletChainId?: number;
|
|
1955
|
+
sendTransaction?: SendTransactionFn;
|
|
1956
|
+
writeContract?: WriteContractFn;
|
|
1957
|
+
readContract?: ReadContractFn;
|
|
1958
|
+
switchChain?: SwitchChainFn;
|
|
1959
|
+
waitForReceipt?: WaitForReceiptFn;
|
|
1960
|
+
getBalance?: GetBalanceFn;
|
|
1961
|
+
}
|
|
1962
|
+
/** A recovery transaction confirmed successfully on BNB Smart Chain. */
|
|
1963
|
+
interface RecoverySuccessResult {
|
|
1964
|
+
action: "execute" | "sweep";
|
|
1965
|
+
forwarder: string;
|
|
1966
|
+
actionTxHash: string;
|
|
1967
|
+
/** Present only when this attempt first had to deploy the forwarder. */
|
|
1968
|
+
deployTxHash?: string;
|
|
1969
|
+
}
|
|
1970
|
+
type RelayTheme = "dark" | "light";
|
|
1971
|
+
type RelayDrawerDirection = "bottom" | "left" | "right" | "top";
|
|
1972
|
+
/**
|
|
1973
|
+
* Props of the `<RelayDeposit>` compound root (Task 11) — the union of
|
|
1974
|
+
*
|
|
1975
|
+
* * `RelayWalletProps` (injected wallet capabilities, all optional),
|
|
1976
|
+
* * the source widget's own configuration props (relay-protocol
|
|
1977
|
+
* `packages/relay-widget/src/components/RelayDeposit.tsx`), minus its
|
|
1978
|
+
* `theme: 'auto'` option, which the shared modal shell doesn't have, and
|
|
1979
|
+
* * `ResponsiveShellProps`' modal/drawer knobs (theme/breakpoint/size/open),
|
|
1980
|
+
* re-declared here rather than extended so the public surface reads as one
|
|
1981
|
+
* flat prop list.
|
|
1982
|
+
*
|
|
1983
|
+
* `children` holds `<RelayDeposit.Trigger>` / `<RelayDeposit.Content>`.
|
|
1984
|
+
*/
|
|
1985
|
+
interface RelayDepositProps extends RelayWalletProps {
|
|
1986
|
+
/** Pre-built client. Takes precedence over apiBaseUrl. */
|
|
1987
|
+
client?: RelayClient;
|
|
1988
|
+
/** Used to build a client via createRelayClient when `client` isn't passed. */
|
|
1989
|
+
apiBaseUrl?: string;
|
|
1990
|
+
/**
|
|
1991
|
+
* Selects a built-in default relay API base URL (dev/stage/production) when
|
|
1992
|
+
* `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
|
|
1993
|
+
* this is only consulted when neither is provided. Omitted falls back to
|
|
1994
|
+
* the same global environment resolution every other dapp-ui feature uses
|
|
1995
|
+
* (see `resolveEnvironment`), defaulting to production.
|
|
1996
|
+
*/
|
|
1997
|
+
environment?: Environment;
|
|
1998
|
+
/** Restrict the catalog's origins to these chain ids. */
|
|
1999
|
+
chains?: number[];
|
|
2000
|
+
/** Controlled recipient; when provided the recipient input is hidden and no wallet
|
|
2001
|
+
* connection is required to fetch a deposit address. Defaults to `walletAddress`. */
|
|
2002
|
+
recipient?: string;
|
|
2003
|
+
/** Require a valid connected wallet before the deposit flow can issue an
|
|
2004
|
+
* address, quote an amount, or start live order/recovery reads. When enabled,
|
|
2005
|
+
* the recipient is pinned to `walletAddress`; a controlled `recipient` cannot
|
|
2006
|
+
* redirect the connected user's deposit. Defaults to `true` when
|
|
2007
|
+
* `showRecipientInput` is explicitly `false`, otherwise `false` for the
|
|
2008
|
+
* low-level public-address integration. `CrossRelayDeposit` always enables
|
|
2009
|
+
* this guard. */
|
|
2010
|
+
requireWalletConnection?: boolean;
|
|
2011
|
+
/** Hide the editable recipient input even when `recipient` is NOT controlled
|
|
2012
|
+
* (default `true` = original behavior). Hosts that lock the recipient to the
|
|
2013
|
+
* connected wallet set this `false` so a disconnected user sees a connect
|
|
2014
|
+
* prompt instead of a free-form address field — the deposit address can then
|
|
2015
|
+
* only ever resolve to the logged-in wallet. */
|
|
2016
|
+
showRecipientInput?: boolean;
|
|
2017
|
+
/** Controlled human-decimal amount; when provided the amount input is hidden. Optional —
|
|
2018
|
+
* it only drives the quote preview, and never blocks the deposit address. */
|
|
2019
|
+
amount?: string;
|
|
2020
|
+
/** Hide the amount input entirely (address-only, send-any-amount). Independent of `amount`. */
|
|
2021
|
+
hideAmount?: boolean;
|
|
2022
|
+
/** Render the EVM one-click deposit button (default `false`: the modal only
|
|
2023
|
+
* offers the QR / copy-address manual deposit path). Opt in with `true` for
|
|
2024
|
+
* hosts whose users connect external wallets that can sign on the origin
|
|
2025
|
+
* chains — CROSS embedded-wallet users never can, hence the off default. */
|
|
2026
|
+
showOneClickDeposit?: boolean;
|
|
2027
|
+
/** Enable recovery actions (default `false` for low-level RelayDeposit).
|
|
2028
|
+
* The Recover tab remains visible so the Deposit navigation always has the
|
|
2029
|
+
* same three entries; when disabled it shows an unavailable-state message.
|
|
2030
|
+
* Recovery signs on BSC with the connected wallet, which CROSS embedded-wallet
|
|
2031
|
+
* users can never do — so actions stay unavailable unless a host serving
|
|
2032
|
+
* external wallets opts in. Even opted in, it still requires the injected
|
|
2033
|
+
* `writeContract`/`readContract`/`waitForReceipt` capability trio. */
|
|
2034
|
+
showRecovery?: boolean;
|
|
2035
|
+
/** Which (chainId, token address) to default-select once the catalog loads. */
|
|
2036
|
+
defaultToken?: DefaultToken;
|
|
2037
|
+
/** Restricts the delivery-token picker to these symbols from `Catalog.targets`. */
|
|
2038
|
+
targetTokens?: string[];
|
|
2039
|
+
/** Which delivery-token symbol to select initially, instead of the catalog's own default. */
|
|
2040
|
+
defaultTarget?: string;
|
|
2041
|
+
/** Whether to render the delivery-token picker at all. Default `true`; the picker only
|
|
2042
|
+
* ever renders when there is more than one target to choose from either way. */
|
|
2043
|
+
showTargetSelector?: boolean;
|
|
2044
|
+
/** Overrides the pinned factory set the one-click deposit verifies the forwarder against. */
|
|
2045
|
+
trustedFactories?: readonly string[];
|
|
2046
|
+
onDepositAddress?: (result: DepositAddressResult) => void;
|
|
2047
|
+
/** Fired once per one-click deposit that CONFIRMED successfully, with the tx
|
|
2048
|
+
* hash. NOT fired on submission, and NOT fired for a tx that reverted --
|
|
2049
|
+
* watch `depositState` (phase/txHash/reverted) for those. Safe to treat as
|
|
2050
|
+
* "the funds moved" (upstream 83845fb). */
|
|
2051
|
+
onDeposited?: (txHash: string) => void;
|
|
2052
|
+
/** Fired once after a recovery action receipt confirms successfully. */
|
|
2053
|
+
onRecoverySuccess?: (result: RecoverySuccessResult) => void;
|
|
2054
|
+
onError?: (error: Error) => void;
|
|
2055
|
+
/** Called by the `Connect Wallet` CTA under the locked card that stands in for the QR
|
|
2056
|
+
* while the required connected wallet (or, in low-level public-address mode,
|
|
2057
|
+
* a usable recipient) is absent. Omitted — the locked card renders as text
|
|
2058
|
+
* only, with no button. */
|
|
2059
|
+
onRequestConnect?: () => void;
|
|
2060
|
+
/** @deprecated The Deposit footer entry was removed. Retained as a no-op
|
|
2061
|
+
* compatibility prop so existing hosts do not need an immediate migration. */
|
|
2062
|
+
onOpenHistory?: () => void;
|
|
2063
|
+
/** Extra class name(s) for the modal/drawer content element. */
|
|
2064
|
+
className?: string;
|
|
2065
|
+
theme?: RelayTheme;
|
|
2066
|
+
mobileBreakpoint?: number;
|
|
2067
|
+
drawerDirection?: RelayDrawerDirection;
|
|
2068
|
+
dialogWidth?: string;
|
|
2069
|
+
drawerMaxWidth?: string;
|
|
2070
|
+
drawerMinWidth?: string;
|
|
2071
|
+
style?: CSSProperties;
|
|
2072
|
+
open?: boolean;
|
|
2073
|
+
onOpenChange?: (open: boolean) => void;
|
|
2074
|
+
children?: ReactNode;
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Props of the `<RelayRecovery>` compound root — the standalone
|
|
2078
|
+
* "Recover stuck funds" modal, i.e. the deposit wizard's gear panel lifted out
|
|
2079
|
+
* into a modal of its own so a host can offer recovery WITHOUT the deposit
|
|
2080
|
+
* flow (the gear inside `<RelayDeposit>` is unaffected and still opt-in via
|
|
2081
|
+
* `showRecovery`).
|
|
2082
|
+
*
|
|
2083
|
+
* Extends `RelayWalletProps` because recovery is signing-first: unlike
|
|
2084
|
+
* `<RelayHistory>` (read-only, no wallet capabilities at all), the whole point
|
|
2085
|
+
* of this modal is that the USER signs the permissionless recovery tx on BSC.
|
|
2086
|
+
* A wallet missing the `writeContract`/`readContract`/`waitForReceipt` trio
|
|
2087
|
+
* gets a short note instead of a dead panel.
|
|
2088
|
+
*
|
|
2089
|
+
* `children` holds `<RelayRecovery.Trigger>` / `<RelayRecovery.Content>`.
|
|
2090
|
+
*/
|
|
2091
|
+
interface RelayRecoveryProps extends RelayWalletProps {
|
|
2092
|
+
/** Pre-built client. Takes precedence over apiBaseUrl. */
|
|
2093
|
+
client?: RelayClient;
|
|
2094
|
+
/** Used to build a client via createRelayClient when `client` isn't passed. */
|
|
2095
|
+
apiBaseUrl?: string;
|
|
2096
|
+
/**
|
|
2097
|
+
* Selects a built-in default relay API base URL (dev/stage/production) when
|
|
2098
|
+
* `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
|
|
2099
|
+
* this is only consulted when neither is provided. Omitted falls back to
|
|
2100
|
+
* the same global environment resolution every other dapp-ui feature uses
|
|
2101
|
+
* (see `resolveEnvironment`), defaulting to production.
|
|
2102
|
+
*/
|
|
2103
|
+
environment?: Environment;
|
|
2104
|
+
/**
|
|
2105
|
+
* Optional assertion of whose forwarder to check/recover. Recovery is always
|
|
2106
|
+
* pinned to the valid connected `walletAddress`; when this value is supplied
|
|
2107
|
+
* it must match that wallet. A missing/invalid wallet or mismatch renders a
|
|
2108
|
+
* short note and makes ZERO requests (no catalog, no recovery lookup).
|
|
2109
|
+
*/
|
|
2110
|
+
recipient?: string;
|
|
2111
|
+
/**
|
|
2112
|
+
* Overrides the pinned factory allowlist recovery verifies against before
|
|
2113
|
+
* signing -- only needed by a self-hosted deployment running its own
|
|
2114
|
+
* factories. Same meaning (and the same fail-closed reasoning) as
|
|
2115
|
+
* `RelayDepositProps.trustedFactories`.
|
|
2116
|
+
*/
|
|
2117
|
+
trustedFactories?: readonly string[];
|
|
2118
|
+
/** Fired once after a recovery action receipt confirms successfully. */
|
|
2119
|
+
onRecoverySuccess?: (result: RecoverySuccessResult) => void;
|
|
2120
|
+
onError?: (e: Error) => void;
|
|
2121
|
+
/** Extra class name(s) for the modal/drawer content element. */
|
|
2122
|
+
className?: string;
|
|
2123
|
+
theme?: RelayTheme;
|
|
2124
|
+
mobileBreakpoint?: number;
|
|
2125
|
+
drawerDirection?: RelayDrawerDirection;
|
|
2126
|
+
dialogWidth?: string;
|
|
2127
|
+
drawerMaxWidth?: string;
|
|
2128
|
+
drawerMinWidth?: string;
|
|
2129
|
+
style?: CSSProperties;
|
|
2130
|
+
open?: boolean;
|
|
2131
|
+
onOpenChange?: (open: boolean) => void;
|
|
2132
|
+
children?: ReactNode;
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Props of the `<RelayHistory>` compound root (Task 12) — the standalone
|
|
2136
|
+
* transfer-history modal built on the shared `ResponsiveShell` +
|
|
2137
|
+
* `useRelayOrders`. `RelayDepositProps`'s simpler sibling: no wizard step,
|
|
2138
|
+
* no catalog/target picking, no wallet-injected send/write capabilities —
|
|
2139
|
+
* just an address to look up orders for and a list to render.
|
|
2140
|
+
*
|
|
2141
|
+
* `children` holds `<RelayHistory.Trigger>` / `<RelayHistory.Content>`.
|
|
2142
|
+
*/
|
|
2143
|
+
interface RelayHistoryProps {
|
|
2144
|
+
/** Pre-built client. Takes precedence over apiBaseUrl. */
|
|
2145
|
+
client?: RelayClient;
|
|
2146
|
+
/** Used to build a client via createRelayClient when `client` isn't passed. */
|
|
2147
|
+
apiBaseUrl?: string;
|
|
2148
|
+
/**
|
|
2149
|
+
* Selects a built-in default relay API base URL (dev/stage/production) when
|
|
2150
|
+
* `apiBaseUrl` isn't passed. `client`/`apiBaseUrl` still take precedence --
|
|
2151
|
+
* this is only consulted when neither is provided. Omitted falls back to
|
|
2152
|
+
* the same global environment resolution every other dapp-ui feature uses
|
|
2153
|
+
* (see `resolveEnvironment`), defaulting to production.
|
|
2154
|
+
*/
|
|
2155
|
+
environment?: Environment;
|
|
2156
|
+
/** History subject. Falls back to `walletAddress`; empty-state UI when
|
|
2157
|
+
* neither resolves to a valid address. */
|
|
2158
|
+
recipient?: string;
|
|
2159
|
+
walletAddress?: string;
|
|
2160
|
+
onError?: (e: Error) => void;
|
|
2161
|
+
/** Notified with the resolved explorer URL when a history row's tx link is
|
|
2162
|
+
* clicked. Fire-and-forget -- unlike `OnOutlink` elsewhere in dapp-ui, it
|
|
2163
|
+
* does not intercept navigation; the link still opens in a new tab as normal. */
|
|
2164
|
+
onOutlink?: (url: string) => void;
|
|
2165
|
+
/** Extra class name(s) for the modal/drawer content element. */
|
|
2166
|
+
className?: string;
|
|
2167
|
+
theme?: RelayTheme;
|
|
2168
|
+
mobileBreakpoint?: number;
|
|
2169
|
+
drawerDirection?: RelayDrawerDirection;
|
|
2170
|
+
dialogWidth?: string;
|
|
2171
|
+
drawerMaxWidth?: string;
|
|
2172
|
+
drawerMinWidth?: string;
|
|
2173
|
+
style?: CSSProperties;
|
|
2174
|
+
open?: boolean;
|
|
2175
|
+
onOpenChange?: (open: boolean) => void;
|
|
2176
|
+
children?: ReactNode;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
interface RelayDepositContentProps {
|
|
2180
|
+
/** Extra class name(s) for the dialog/drawer content element. Falls back to
|
|
2181
|
+
* `<RelayDeposit>`'s own `className`. */
|
|
2182
|
+
className?: string;
|
|
2183
|
+
}
|
|
2184
|
+
/**
|
|
2185
|
+
* `<RelayDeposit.Content>` — the modal/drawer surface. The deposit body is a
|
|
2186
|
+
* child of `ShellContent`, i.e. of radix's `Dialog.Portal` / vaul's
|
|
2187
|
+
* `Drawer.Portal`, which render nothing while closed. The state it renders is
|
|
2188
|
+
* NOT its own any more: `<RelayDeposit>` mounts the wizard engine above the
|
|
2189
|
+
* shell for exactly as long as the modal is open, so "no request before open"
|
|
2190
|
+
* and "everything resets on close" still hold -- while a breakpoint crossing
|
|
2191
|
+
* mid-flow now only rebuilds this DOM, not the flow.
|
|
2192
|
+
*/
|
|
2193
|
+
declare function RelayDepositContent({ className }: RelayDepositContentProps): react_jsx_runtime.JSX.Element;
|
|
2194
|
+
|
|
2195
|
+
interface RelayDepositTriggerProps {
|
|
2196
|
+
/** Render the child as the trigger instead of wrapping it. Defaults to
|
|
2197
|
+
* `true` whenever a child is supplied, matching
|
|
2198
|
+
* `WalletConnectModalTrigger`'s `asChild ?? children != null`. */
|
|
2199
|
+
asChild?: boolean;
|
|
2200
|
+
children?: ReactNode;
|
|
2201
|
+
}
|
|
2202
|
+
/**
|
|
2203
|
+
* Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
|
|
2204
|
+
* vaul `Drawer.Trigger` on mobile) so hosts write
|
|
2205
|
+
* `<RelayDeposit.Trigger><button>…</button></RelayDeposit.Trigger>` without
|
|
2206
|
+
* knowing which primitive is active. Falls back to a plain default button when
|
|
2207
|
+
* no child is given, same as `WalletConnectModalTrigger`.
|
|
2208
|
+
*
|
|
2209
|
+
* Wrapped in `<TrackingBoundary feature="relay">` for the same reason
|
|
2210
|
+
* `WalletConnectModalTrigger` is: the `data-track="open"` attribute below (and
|
|
2211
|
+
* on any host-supplied child that carries one) is only picked up by the
|
|
2212
|
+
* analytics delegate a boundary installs. Without it the open click is silently
|
|
2213
|
+
* untracked, since the trigger lives OUTSIDE the portaled `<Content>` boundary.
|
|
2214
|
+
*/
|
|
2215
|
+
declare function RelayDepositTrigger({ asChild, children }: RelayDepositTriggerProps): react_jsx_runtime.JSX.Element;
|
|
2216
|
+
|
|
2217
|
+
declare function RelayDepositRoot(props: RelayDepositProps): react_jsx_runtime.JSX.Element;
|
|
2218
|
+
declare const RelayDeposit: typeof RelayDepositRoot & {
|
|
2219
|
+
Trigger: typeof RelayDepositTrigger;
|
|
2220
|
+
Content: typeof RelayDepositContent;
|
|
2221
|
+
};
|
|
2222
|
+
|
|
2223
|
+
interface RelayHistoryContentProps {
|
|
2224
|
+
/** Extra class name(s) for the dialog/drawer content element. Falls back to
|
|
2225
|
+
* `<RelayHistory>`'s own `className`. */
|
|
2226
|
+
className?: string;
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* `<RelayHistory.Content>` — the modal/drawer surface. Like
|
|
2230
|
+
* `RelayDepositContent`, this is a child of `ShellContent`, i.e. of radix's
|
|
2231
|
+
* `Dialog.Portal` / vaul's `Drawer.Portal`, which render nothing while
|
|
2232
|
+
* closed: no `listOrders` request happens before the modal is opened, and the
|
|
2233
|
+
* subtree unmounts on close -- there is no per-open state here to reset
|
|
2234
|
+
* explicitly (unlike `RelayDepositBody`'s step/panel state), so
|
|
2235
|
+
* unmount-by-portal is the whole story.
|
|
2236
|
+
*/
|
|
2237
|
+
declare function RelayHistoryContent({ className }: RelayHistoryContentProps): react_jsx_runtime.JSX.Element;
|
|
2238
|
+
|
|
2239
|
+
interface RelayHistoryTriggerProps {
|
|
2240
|
+
/** Render the child as the trigger instead of wrapping it. Defaults to
|
|
2241
|
+
* `true` whenever a child is supplied, matching `RelayDepositTrigger`'s
|
|
2242
|
+
* (and `WalletConnectModalTrigger`'s) `asChild ?? children != null` rule. */
|
|
2243
|
+
asChild?: boolean;
|
|
2244
|
+
children?: ReactNode;
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
|
|
2248
|
+
* vaul `Drawer.Trigger` on mobile), mirroring `RelayDepositTrigger` so hosts
|
|
2249
|
+
* write `<RelayHistory.Trigger><button>…</button></RelayHistory.Trigger>`
|
|
2250
|
+
* without knowing which primitive is active. Falls back to a plain default
|
|
2251
|
+
* button when no child is given.
|
|
2252
|
+
*
|
|
2253
|
+
* Wrapped in `<TrackingBoundary feature="relay">` for the same reason
|
|
2254
|
+
* `RelayDepositTrigger`/`WalletConnectModalTrigger` are: `data-track="open"` is
|
|
2255
|
+
* only read by the delegate a boundary installs, and this trigger sits OUTSIDE
|
|
2256
|
+
* the portaled `<Content>`'s own boundary.
|
|
2257
|
+
*/
|
|
2258
|
+
declare function RelayHistoryTrigger({ asChild, children }: RelayHistoryTriggerProps): react_jsx_runtime.JSX.Element;
|
|
2259
|
+
|
|
2260
|
+
declare function RelayHistoryRoot(props: RelayHistoryProps): react_jsx_runtime.JSX.Element;
|
|
2261
|
+
declare const RelayHistory: typeof RelayHistoryRoot & {
|
|
2262
|
+
Trigger: typeof RelayHistoryTrigger;
|
|
2263
|
+
Content: typeof RelayHistoryContent;
|
|
2264
|
+
};
|
|
2265
|
+
|
|
2266
|
+
interface RelayRecoveryContentProps {
|
|
2267
|
+
/** Extra class name(s) for the dialog/drawer content element. Falls back to
|
|
2268
|
+
* `<RelayRecovery>`'s own `className`. */
|
|
2269
|
+
className?: string;
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* `<RelayRecovery.Content>` — the modal/drawer surface. Same portal-scoped
|
|
2273
|
+
* lifecycle as `<RelayHistory.Content>`: nothing is requested before the modal
|
|
2274
|
+
* is opened, and the whole subtree (including `useRecovery`'s state and any
|
|
2275
|
+
* in-flight recovery tracking) unmounts on close, so there is no per-open state
|
|
2276
|
+
* to reset explicitly.
|
|
2277
|
+
*/
|
|
2278
|
+
declare function RelayRecoveryContent({ className }: RelayRecoveryContentProps): react_jsx_runtime.JSX.Element;
|
|
2279
|
+
|
|
2280
|
+
interface RelayRecoveryTriggerProps {
|
|
2281
|
+
/** Render the child as the trigger instead of wrapping it. Defaults to
|
|
2282
|
+
* `true` whenever a child is supplied, matching `RelayHistoryTrigger`'s
|
|
2283
|
+
* (and `RelayDepositTrigger`'s) `asChild ?? children != null` rule. */
|
|
2284
|
+
asChild?: boolean;
|
|
2285
|
+
children?: ReactNode;
|
|
2286
|
+
}
|
|
2287
|
+
/**
|
|
2288
|
+
* Thin pass-through to `ShellTrigger` (radix `Dialog.Trigger` on desktop /
|
|
2289
|
+
* vaul `Drawer.Trigger` on mobile), mirroring `RelayHistoryTrigger` so hosts
|
|
2290
|
+
* write `<RelayRecovery.Trigger><button>…</button></RelayRecovery.Trigger>`
|
|
2291
|
+
* without knowing which primitive is active. Falls back to a plain-text
|
|
2292
|
+
* "Recover" button when no child is given -- unstyled like the sibling
|
|
2293
|
+
* `RelayDepositTrigger`/`RelayHistoryTrigger` defaults, so it inherits the
|
|
2294
|
+
* host's own button chrome instead of shipping a look of its own.
|
|
2295
|
+
*
|
|
2296
|
+
* The default button renders NO count badge (2026-07-30: removed on request --
|
|
2297
|
+
* the number read as an unread-notification alarm). The root's cross-target
|
|
2298
|
+
* recoverable count still reaches the trigger element as
|
|
2299
|
+
* `data-rd-recovery-count` (radix/vaul merge Trigger props onto the `asChild`
|
|
2300
|
+
* child too), so a host that WANTS a badge can opt in with its own CSS -- e.g.
|
|
2301
|
+
* `button[data-rd-recovery-count]:not([data-rd-recovery-count="0"])::after` --
|
|
2302
|
+
* without refetching anything.
|
|
2303
|
+
*
|
|
2304
|
+
* Wrapped in `<TrackingBoundary feature="relay">` for the same reason
|
|
2305
|
+
* `RelayHistoryTrigger` is: `data-track="open"` is only read by the delegate a
|
|
2306
|
+
* boundary installs, and this trigger sits OUTSIDE the portaled `<Content>`'s
|
|
2307
|
+
* own boundary.
|
|
2308
|
+
*/
|
|
2309
|
+
declare function RelayRecoveryTrigger({ asChild, children }: RelayRecoveryTriggerProps): react_jsx_runtime.JSX.Element;
|
|
2310
|
+
|
|
2311
|
+
declare function RelayRecoveryRoot(props: RelayRecoveryProps): react_jsx_runtime.JSX.Element;
|
|
2312
|
+
declare const RelayRecovery: typeof RelayRecoveryRoot & {
|
|
2313
|
+
Trigger: typeof RelayRecoveryTrigger;
|
|
2314
|
+
Content: typeof RelayRecoveryContent;
|
|
2315
|
+
};
|
|
2316
|
+
|
|
2317
|
+
interface UseRelayOrdersOptions {
|
|
2318
|
+
client: RelayClient;
|
|
2319
|
+
/** Valid EVM address, or undefined -- undefined clears the list and stops polling. */
|
|
2320
|
+
recipient?: string;
|
|
2321
|
+
/** Gate: wait for truthy before the first fetch (RelayDeposit passes rawCatalog). Default true. */
|
|
2322
|
+
enabled?: boolean;
|
|
2323
|
+
/** Keep the snapshot live with SSE + fallback polling. Default true. */
|
|
2324
|
+
live?: boolean;
|
|
2325
|
+
/** REST safety-net cadence in milliseconds. Defaults to 30s; the open Deposit popup uses 1s
|
|
2326
|
+
* so completion still appears promptly when the SSE event is absent. */
|
|
2327
|
+
refetchInterval?: number;
|
|
2328
|
+
/** @deprecated Use `refetchInterval`. Retained for compatibility. */
|
|
2329
|
+
fallbackPollMs?: number;
|
|
2330
|
+
onError?: (e: Error) => void;
|
|
2331
|
+
}
|
|
2332
|
+
interface UseRelayOrdersResult {
|
|
2333
|
+
/** Every order swept from deposits to this recipient so far, newest-first
|
|
2334
|
+
* as served by the API. Kept live unless `live: false` requests one snapshot. */
|
|
2335
|
+
orders: OrderSummary[];
|
|
2336
|
+
ordersLoading: boolean;
|
|
2337
|
+
ordersError?: Error;
|
|
2338
|
+
/** Recipient the current snapshot belongs to. Undefined while a new
|
|
2339
|
+
* subscription is waiting for its first accepted fetch, so consumers never
|
|
2340
|
+
* baseline a previous recipient's rows as fresh deposits. */
|
|
2341
|
+
ordersForRecipient?: string;
|
|
2342
|
+
/** Increments after every accepted fetch, even when the client returns the
|
|
2343
|
+
* same array reference or the request fails. Consumers use this as a
|
|
2344
|
+
* low-frequency refresh signal for related read models such as /recovery. */
|
|
2345
|
+
ordersRevision: number;
|
|
2346
|
+
/** True once at least one fetch has COMPLETED (success or failure) for the
|
|
2347
|
+
* current (recipient, enabled) subscription; false again when it resets.
|
|
2348
|
+
* Distinct from `!ordersLoading`, which is also true BEFORE the first fetch
|
|
2349
|
+
* has even started -- consumers that snapshot the list (e.g. the deposit
|
|
2350
|
+
* wizard's new-order watch) must wait for this, or they baseline against
|
|
2351
|
+
* the initial empty state and misread every existing order as new. */
|
|
2352
|
+
ordersInitialized: boolean;
|
|
2353
|
+
}
|
|
2354
|
+
declare function useRelayOrders(opts: UseRelayOrdersOptions): UseRelayOrdersResult;
|
|
2355
|
+
|
|
2356
|
+
interface UseRelayConfigOptions {
|
|
2357
|
+
/** Pre-built client. Takes precedence over apiBaseUrl. */
|
|
2358
|
+
client?: RelayClient;
|
|
2359
|
+
/** Used to build a client when `client` is not supplied. */
|
|
2360
|
+
apiBaseUrl?: string;
|
|
2361
|
+
/** Stops the request and clears the current snapshot. Defaults to true. */
|
|
2362
|
+
enabled?: boolean;
|
|
2363
|
+
/** Optional automatic REST refresh cadence in milliseconds. Disabled when omitted or <= 0. */
|
|
2364
|
+
refetchInterval?: number;
|
|
2365
|
+
onError?: (error: Error) => void;
|
|
2366
|
+
}
|
|
2367
|
+
interface UseRelayConfigResult {
|
|
2368
|
+
/** Latest GET /v1/config response. */
|
|
2369
|
+
config?: Catalog;
|
|
2370
|
+
loading: boolean;
|
|
2371
|
+
error?: Error;
|
|
2372
|
+
/** Re-fetches GET /v1/config using the current client. */
|
|
2373
|
+
refresh: () => void;
|
|
2374
|
+
}
|
|
2375
|
+
/**
|
|
2376
|
+
* Public read-only hook for Relay's origin/destination/target catalog.
|
|
2377
|
+
*
|
|
2378
|
+
* The response is a normal REST snapshot, not an SSE stream. Use
|
|
2379
|
+
* `refetchInterval` for periodic refreshes or call `refresh` for an immediate
|
|
2380
|
+
* read without replacing the client or remounting the component.
|
|
2381
|
+
*/
|
|
2382
|
+
declare function useRelayConfig(opts?: UseRelayConfigOptions): UseRelayConfigResult;
|
|
2383
|
+
|
|
2384
|
+
type RecoveryAction = "execute" | "sweep";
|
|
2385
|
+
/** Per-attempt progress for `recover()`. "switching" = prompting a chain switch to BSC;
|
|
2386
|
+
* "deploying" = the factory.deploy() write is in flight/confirming (only needed when the
|
|
2387
|
+
* forwarder wasn't deployed yet); "recovering" = the execute()/sweepToUser() write is in
|
|
2388
|
+
* flight/confirming; "done"/"error" are terminal for this attempt. */
|
|
2389
|
+
type RecoveryStep = "idle" | "switching" | "deploying" | "recovering" | "done" | "error";
|
|
2390
|
+
interface RecoveryState {
|
|
2391
|
+
step: RecoveryStep;
|
|
2392
|
+
/** Tx hash of the factory.deploy() write -- only set when this attempt needed one. */
|
|
2393
|
+
deployTxHash?: string;
|
|
2394
|
+
/** Tx hash of the execute()/sweepToUser() write. */
|
|
2395
|
+
actionTxHash?: string;
|
|
2396
|
+
error?: string;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
type RelayRecoveryQueryKey = readonly [
|
|
2400
|
+
"relay",
|
|
2401
|
+
"recovery",
|
|
2402
|
+
number,
|
|
2403
|
+
string | null,
|
|
2404
|
+
string | null
|
|
2405
|
+
];
|
|
2406
|
+
/**
|
|
2407
|
+
* React Query policies accepted by useRelayRecovery. The SDK owns the request
|
|
2408
|
+
* identity and response shape, so callers cannot replace queryKey/queryFn or
|
|
2409
|
+
* inject/select recovery balances.
|
|
2410
|
+
*/
|
|
2411
|
+
type RelayRecoveryQueryOptions = Omit<UseQueryOptions<RecoveryInfo, Error, RecoveryInfo, RelayRecoveryQueryKey>, "queryKey" | "queryFn" | "select" | "initialData" | "initialDataUpdatedAt" | "placeholderData">;
|
|
2412
|
+
interface UseRelayRecoveryOptions {
|
|
2413
|
+
/** Pre-built client. Takes precedence over apiBaseUrl. */
|
|
2414
|
+
client?: RelayClient;
|
|
2415
|
+
/** Used to build a client via createRelayClient when client isn't passed. */
|
|
2416
|
+
apiBaseUrl?: string;
|
|
2417
|
+
/** Connected EVM wallet whose recoverable forwarder balances are queried. */
|
|
2418
|
+
recipient?: string;
|
|
2419
|
+
/** Optional CROSS delivery target passed to GET /v1/recovery. */
|
|
2420
|
+
target?: string;
|
|
2421
|
+
/** React Query lifecycle, cache, retry, and refetch policies. */
|
|
2422
|
+
query?: RelayRecoveryQueryOptions;
|
|
2423
|
+
/** Optional wallet capabilities. Read-only consumers may omit this. */
|
|
2424
|
+
wallet?: RelayWalletProps;
|
|
2425
|
+
/** Called when GET /v1/recovery returns 401. */
|
|
2426
|
+
onUnauthorized?: () => void;
|
|
2427
|
+
/** Called after a terminal query or recovery-action error. */
|
|
2428
|
+
onError?: (error: Error) => void;
|
|
2429
|
+
/** Called once after a recovery transaction confirms successfully. */
|
|
2430
|
+
onRecoverySuccess?: (result: RecoverySuccessResult) => void;
|
|
2431
|
+
/** Trusted factory override for a self-hosted deployment. */
|
|
2432
|
+
trustedFactories?: readonly string[];
|
|
2433
|
+
}
|
|
2434
|
+
interface UseRelayRecoveryResult {
|
|
2435
|
+
info?: RecoveryInfo;
|
|
2436
|
+
loading: boolean;
|
|
2437
|
+
error?: Error;
|
|
2438
|
+
/** True for background refetches as well as the first request. */
|
|
2439
|
+
isFetching: boolean;
|
|
2440
|
+
/** Invalidates no identities; immediately refetches this hook's fixed query. */
|
|
2441
|
+
refresh: () => void;
|
|
2442
|
+
/** Signs a recovery transaction for the currently fetched info. */
|
|
2443
|
+
recover: (action: RecoveryAction, tokenAddress?: string) => Promise<void>;
|
|
2444
|
+
recoveryState: RecoveryState;
|
|
2445
|
+
}
|
|
2446
|
+
/**
|
|
2447
|
+
* Public Recovery API hook. Unlike the widget-internal useRecovery fetch, this
|
|
2448
|
+
* hook uses the host QueryClient and accepts React Query policies through
|
|
2449
|
+
* `query`. queryKey/queryFn and balance-shaping options remain SDK-owned.
|
|
2450
|
+
*/
|
|
2451
|
+
declare function useRelayRecovery(opts?: UseRelayRecoveryOptions): UseRelayRecoveryResult;
|
|
2452
|
+
|
|
2453
|
+
interface StatusTrackerProps {
|
|
2454
|
+
orderId: string;
|
|
2455
|
+
/** Latest polled order (steps/txs) from GET /v1/orders/{orderId}, owned by the caller. */
|
|
2456
|
+
order?: Order;
|
|
2457
|
+
/** Latest poll error, owned by the caller. */
|
|
2458
|
+
error?: Error;
|
|
2459
|
+
}
|
|
2460
|
+
declare function StatusTracker({ orderId, order, error }: StatusTrackerProps): react_jsx_runtime.JSX.Element;
|
|
2461
|
+
|
|
2462
|
+
/** Every StandingForwarderFactory / DepositorForwarderFactory this deployment
|
|
2463
|
+
* has issued deposit addresses from, on BSC.
|
|
2464
|
+
*
|
|
2465
|
+
* Superseded factories stay listed on purpose. A forwarder's factory is pinned
|
|
2466
|
+
* per address at issuance time (`standing_addresses.factory`, copied onto each
|
|
2467
|
+
* order), so a user recovering an address minted before a rotation legitimately
|
|
2468
|
+
* gets an older factory back from the API -- dropping it here would block that
|
|
2469
|
+
* user from recovering their own funds, which is a worse outcome than the
|
|
2470
|
+
* narrow trust gain. Every entry is one of ours either way.
|
|
2471
|
+
*
|
|
2472
|
+
* Rotation (see backends/deploy/RUNBOOK-canary.md): ADD the new factory, keep
|
|
2473
|
+
* the old ones. */
|
|
2474
|
+
declare const DEFAULT_TRUSTED_FACTORIES: readonly string[];
|
|
2475
|
+
|
|
2476
|
+
type GetOneUsdActionId = "swap" | "bridge" | "transfer";
|
|
2477
|
+
type GetOneUsdMode = "floating" | "button";
|
|
2478
|
+
type GetOneUsdButtonComponent = ElementType<ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
2479
|
+
type GetOneUsdWaitForTransaction = (info: BridgeSubmittedInfo) => Promise<void>;
|
|
2480
|
+
interface GetOneUsdTokenRef {
|
|
2481
|
+
chainId: number;
|
|
2482
|
+
address: string;
|
|
2483
|
+
}
|
|
2484
|
+
interface GetOneUsdPairs {
|
|
2485
|
+
target: GetOneUsdTokenRef;
|
|
2486
|
+
swap: {
|
|
2487
|
+
from: GetOneUsdTokenRef;
|
|
2488
|
+
feeDelegated?: boolean;
|
|
2489
|
+
};
|
|
2490
|
+
bridge: {
|
|
2491
|
+
from: GetOneUsdTokenRef[];
|
|
2492
|
+
feeDelegated?: boolean;
|
|
2493
|
+
};
|
|
2494
|
+
}
|
|
2495
|
+
type GetOneUsdBridgeProps = Omit<BridgeFlowProps, "walletAddress" | "tokens" | "initialFromToken" | "initialToToken" | "env" | "onClose" | "onBackToWallet" | "className" | "title" | "variant" | "isConnected" | "onRequestConnect">;
|
|
2496
|
+
type GetOneUsdRelayProps = Omit<RelayDepositProps, "walletAddress" | "children" | "open" | "onOpenChange" | "requireWalletConnection" | "showRecipientInput" | "hideAmount" | "targetTokens" | "defaultTarget" | "onRequestConnect">;
|
|
2497
|
+
type GetOneUsdEvent = {
|
|
2498
|
+
name: "fab_click";
|
|
2499
|
+
state: "expanded" | "icon_only";
|
|
2500
|
+
} | {
|
|
2501
|
+
name: "action_select";
|
|
2502
|
+
action: GetOneUsdActionId;
|
|
2503
|
+
} | {
|
|
2504
|
+
name: "connect_click";
|
|
2505
|
+
action: GetOneUsdActionId;
|
|
2506
|
+
} | {
|
|
2507
|
+
name: "success";
|
|
2508
|
+
action: GetOneUsdActionId;
|
|
2509
|
+
txHash: string;
|
|
2510
|
+
} | {
|
|
2511
|
+
name: "failure";
|
|
2512
|
+
action: GetOneUsdActionId;
|
|
2513
|
+
message: string;
|
|
2514
|
+
};
|
|
2515
|
+
interface GetOneUsdProps {
|
|
2516
|
+
/** Connected wallet. A missing address renders a connect CTA in execution views. */
|
|
2517
|
+
walletAddress?: string;
|
|
2518
|
+
/** Full token list supplied by a bridge adapter. It is never mutated. */
|
|
2519
|
+
tokens: BridgeToken[];
|
|
2520
|
+
/** Exact source/target token allowlist. May arrive after remote config loads. */
|
|
2521
|
+
pairs?: GetOneUsdPairs;
|
|
2522
|
+
/** True while the bridge adapter is resolving contracts/tokens. */
|
|
2523
|
+
loading?: boolean;
|
|
2524
|
+
/** View-only BridgeFlow transaction ports. */
|
|
2525
|
+
bridge: GetOneUsdBridgeProps;
|
|
2526
|
+
/** Relay configuration and low-level wallet ports. Built-in env URL is used when omitted. */
|
|
2527
|
+
relay?: GetOneUsdRelayProps;
|
|
2528
|
+
env?: Environment;
|
|
2529
|
+
targetSymbol?: string;
|
|
2530
|
+
/** Relay catalog delivery symbol. Defaults to the canonical `ONEUSD`. */
|
|
2531
|
+
relayTargetSymbol?: string;
|
|
2532
|
+
targetIconUrl?: string;
|
|
2533
|
+
/** Trigger layout. Transaction status always renders as a floating pill. */
|
|
2534
|
+
mode?: GetOneUsdMode;
|
|
2535
|
+
/** Custom styled trigger element used only in button mode. Must forward button props. */
|
|
2536
|
+
buttonComponent?: GetOneUsdButtonComponent;
|
|
2537
|
+
theme?: RelayTheme;
|
|
2538
|
+
mobileBreakpoint?: number;
|
|
2539
|
+
drawerDirection?: RelayDrawerDirection;
|
|
2540
|
+
dialogWidth?: string;
|
|
2541
|
+
drawerMaxWidth?: string;
|
|
2542
|
+
drawerMinWidth?: string;
|
|
2543
|
+
/** CSS variables/styles applied to the selected trigger. */
|
|
2544
|
+
style?: CSSProperties;
|
|
2545
|
+
className?: string;
|
|
2546
|
+
contentClassName?: string;
|
|
2547
|
+
hidden?: boolean;
|
|
2548
|
+
/** Force the floating trigger to icon-only. Ignored in button mode. */
|
|
2549
|
+
compactTrigger?: boolean;
|
|
2550
|
+
collapseOnScroll?: boolean;
|
|
2551
|
+
scrollThreshold?: number;
|
|
2552
|
+
/**
|
|
2553
|
+
* Waits for an already-submitted Swap/Bridge transaction to confirm.
|
|
2554
|
+
* While pending, a non-interactive floating status pill is shown.
|
|
2555
|
+
* Omit only when submission itself is the final confirmation boundary.
|
|
2556
|
+
*/
|
|
2557
|
+
waitForTransaction?: GetOneUsdWaitForTransaction;
|
|
2558
|
+
/** How long a confirmed/failed result stays on the floating button. Default 4000ms. */
|
|
2559
|
+
transactionResultDurationMs?: number;
|
|
2560
|
+
onRequestConnect?: () => void | Promise<void>;
|
|
2561
|
+
onEvent?: (event: GetOneUsdEvent) => void;
|
|
2562
|
+
}
|
|
2563
|
+
interface ResolvedGetOneUsdRoute {
|
|
2564
|
+
fromTokens: BridgeToken[];
|
|
2565
|
+
targetToken?: BridgeToken;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
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;
|
|
2569
|
+
|
|
2570
|
+
type GetOneUsdRemoteModes = NonNullable<NonNullable<AppsConfig["getOneUsd"]>["modes"]>;
|
|
2571
|
+
type GetOneUsdRemoteMinVersions = NonNullable<NonNullable<AppsConfig["getOneUsd"]>["minVersions"]>;
|
|
2572
|
+
/**
|
|
2573
|
+
* 목록에 보일지 여부. Swap/Bridge stay enabled when config is unavailable.
|
|
2574
|
+
* Transfer Crypto is opt-in and stays hidden until S3 explicitly enables it.
|
|
2575
|
+
*/
|
|
2576
|
+
declare function isGetOneUsdActionVisible(action: GetOneUsdActionId, modes?: GetOneUsdRemoteModes): boolean;
|
|
2577
|
+
/**
|
|
2578
|
+
* 이 dapp-ui 버전에서 실행 가능한지. 미달이면 **숨기지 않고 비활성**으로 둔다 —
|
|
2579
|
+
* 항목이 조용히 사라지면 사용자는 기능이 없어진 줄 알지만, 비활성 + 안내면
|
|
2580
|
+
* "업데이트하면 쓸 수 있다"가 전달된다.
|
|
2581
|
+
*/
|
|
2582
|
+
declare function isGetOneUsdActionSupported(action: GetOneUsdActionId, minVersions?: GetOneUsdRemoteMinVersions): boolean;
|
|
2583
|
+
/** 노출 + 실행 가능(= 실제로 선택할 수 있는지). */
|
|
2584
|
+
declare function isGetOneUsdActionEnabled(action: GetOneUsdActionId, modes?: GetOneUsdRemoteModes, minVersions?: GetOneUsdRemoteMinVersions): boolean;
|
|
2585
|
+
|
|
2586
|
+
declare function getOneUsdTokenKey(token: GetOneUsdTokenRef): string;
|
|
2587
|
+
declare function matchesGetOneUsdToken(token: BridgeToken, ref: GetOneUsdTokenRef): boolean;
|
|
2588
|
+
declare function findGetOneUsdToken(tokens: BridgeToken[], ref?: GetOneUsdTokenRef): BridgeToken | undefined;
|
|
2589
|
+
/** Resolve an action's exact token allowlist without mutating adapter data. */
|
|
2590
|
+
declare function resolveGetOneUsdRoute(tokens: BridgeToken[], pairs: GetOneUsdPairs | undefined, action: Exclude<GetOneUsdActionId, "transfer">): ResolvedGetOneUsdRoute;
|
|
2591
|
+
declare function isGetOneUsdTargetAvailable(available: BridgeToken[], target: BridgeToken): boolean;
|
|
1096
2592
|
|
|
1097
2593
|
declare function CROSSxIcon(): react_jsx_runtime.JSX.Element;
|
|
1098
2594
|
declare function MetaMaskIcon(): react_jsx_runtime.JSX.Element;
|
|
@@ -1105,20 +2601,20 @@ declare function AppleIcon(): react_jsx_runtime.JSX.Element;
|
|
|
1105
2601
|
declare const WALLET_REGISTRY: {
|
|
1106
2602
|
cross_embedded: {
|
|
1107
2603
|
id: string;
|
|
1108
|
-
name:
|
|
2604
|
+
name: "ONEpocket with Social";
|
|
1109
2605
|
description: string;
|
|
1110
2606
|
icon: typeof CROSSxIcon;
|
|
1111
2607
|
};
|
|
1112
2608
|
cross_wallet: {
|
|
1113
2609
|
id: string;
|
|
1114
|
-
name:
|
|
2610
|
+
name: "ONEpocket";
|
|
1115
2611
|
description: string;
|
|
1116
2612
|
icon: typeof CROSSxIcon;
|
|
1117
2613
|
featured: true;
|
|
1118
2614
|
};
|
|
1119
2615
|
cross_extension: {
|
|
1120
2616
|
id: string;
|
|
1121
|
-
name:
|
|
2617
|
+
name: "ONEpocket Extension";
|
|
1122
2618
|
description: string;
|
|
1123
2619
|
icon: typeof CROSSxIcon;
|
|
1124
2620
|
rdns: string;
|
|
@@ -1393,7 +2889,7 @@ interface ConnectButtonProps {
|
|
|
1393
2889
|
modal?: boolean;
|
|
1394
2890
|
connectorId?: ConnectorId;
|
|
1395
2891
|
/** Send 페이지의 일반 토큰 전송에 사용할 외부 트랜잭션 전송 함수. */
|
|
1396
|
-
sendTransaction?: SendTransactionFn;
|
|
2892
|
+
sendTransaction?: SendTransactionFn$1;
|
|
1397
2893
|
getTransactionReceipt?: GetTransactionReceiptFn;
|
|
1398
2894
|
/**
|
|
1399
2895
|
* Send 확인 단계의 가스/수수료 추정 함수. 미주입 시 SendPage Confirm 화면의
|
|
@@ -1401,10 +2897,14 @@ interface ConnectButtonProps {
|
|
|
1401
2897
|
*/
|
|
1402
2898
|
estimateGas?: EstimateGasFn;
|
|
1403
2899
|
/**
|
|
1404
|
-
* 상단 QR 버튼 / 기본 액션 row의
|
|
1405
|
-
* 정의됨.)
|
|
2900
|
+
* 상단 QR 버튼 / 기본 액션 row의 Receive / Send 콜백. (Buy는 위 onBuy로
|
|
2901
|
+
* 정의됨.)
|
|
1406
2902
|
*/
|
|
1407
2903
|
onReceive?: () => void;
|
|
2904
|
+
/**
|
|
2905
|
+
* @deprecated Bridge 버튼은 항상 apps.json(gametokenBridge) 웹으로
|
|
2906
|
+
* 이동한다. 이 콜백은 더 이상 호출되지 않는다.
|
|
2907
|
+
*/
|
|
1408
2908
|
onBridge?: () => void;
|
|
1409
2909
|
onSend?: () => void;
|
|
1410
2910
|
bridgeTokens?: BridgeToken[];
|
|
@@ -1511,7 +3011,11 @@ interface SkillsButtonProps {
|
|
|
1511
3011
|
type?: "button" | "submit" | "reset";
|
|
1512
3012
|
}
|
|
1513
3013
|
|
|
3014
|
+
/**
|
|
3015
|
+
* @deprecated 이동 대상은 apps.json(skills)이 단일 소스다. 이 상수는 더 이상
|
|
3016
|
+
* 폴백으로 쓰이지 않으며 하위 호환(공개 export)용으로만 남아 있다.
|
|
3017
|
+
*/
|
|
1514
3018
|
declare const DEFAULT_SKILLS_HREF = "https://www.onechain.nexus/skills";
|
|
1515
3019
|
declare function SkillsButton({ label, href, onClick, className, style, theme, disabled, isLoading, loadingLabel, openInNewTab, type, }: SkillsButtonProps): react_jsx_runtime.JSX.Element;
|
|
1516
3020
|
|
|
1517
|
-
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, CONNECTOR_REGISTRY, CROSSX_ICON, type ChainId, ConnectButton, type ConnectButtonProps, type ConnectButtonStyle, ConnectorId, type ConnectorMeta, DEFAULT_SKILLS_HREF, type DrawerDirection$1 as DrawerDirection, type Environment, type EstimateGasArgs, type EstimateGasFn, GOOGLE_ICON, type GameSwapPool, type GameSwapTokenRef, type GasEstimate, type GetTransactionReceiptArgs, type GetTransactionReceiptFn, type GlobalMenu, type GlobalMenuItem, type GlobalMenuItemUrl, type LpBalanceInfo, type LpBalanceReaderFn, METAMASK_ICON, type OnOutlink, type OutlinkCategory, type OutlinkContext, type OutlinkOrigin, PORTFOLIO_SECTIONS, type PortfolioSection, type PreferredToken, type RecentSendAddress, SOCIAL_REGISTRY, type SendAccount, type SendAsset, SendFlow, type SendFlowProps, type SendPageProps, type SendStatus, type SendTransactionArgs, type SendTransactionFn, SkillsButton, type SkillsButtonProps, type SkillsButtonStyle, type SocialConfig, type SocialHandlers, type SocialId, type StakingRewardsInfo, type StakingRewardsReaderFn, TOKEN_STATS_QUERY_KEY, type Theme, type TokenBalance, type TokenBalanceResponse, type TokenStats, type TokenStatsResponse, type TransactionReceiptResult, USER_BALANCE_QUERY_KEY, WALLET_REGISTRY, 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, announceAppLauncherUsage, resolveEnvironment, useGlobalMenu, useTokenBalance, useTokenStats, useWalletDetect };
|
|
3021
|
+
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 OnePopActivityDirection, type OnePopActivityItem, type OnePopActivityStatus, OnePopBody, type OnePopBodyProps, type OnePopSummary, 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, isGetOneUsdActionSupported, isGetOneUsdActionVisible, isGetOneUsdTargetAvailable, matchesGetOneUsdToken, normalizeFailureReason, resolveEnvironment, resolveGetOneUsdRoute, setDappUiAnalyticsUser, trackDappUiEvent, trackDappUiFunnel, useChainDisplay, useChainsConfig, useGlobalMenu, useRelayConfig, useRelayOrders, useRelayRecovery, useTokenBalance, useTokenStats, useWalletDetect };
|