@nexus-cross/dapp-ui 1.3.11 → 1.3.12-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_INTEGRATION.md +55 -0
- package/README.md +10 -1
- package/dist/index.cjs +26 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1403 -1224
- package/dist/index.d.ts +1403 -1224
- package/dist/index.js +26 -25
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# AI Integration Contract
|
|
2
|
+
|
|
3
|
+
Use this file when an AI coding agent is asked to add `@nexus-cross/dapp-ui` to a React DApp.
|
|
4
|
+
|
|
5
|
+
## Get ONEUSD
|
|
6
|
+
|
|
7
|
+
Prefer the turn-key wagmi wrapper when the app already uses CROSSx Connect Kit:
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import type { ReactNode } from "react";
|
|
11
|
+
import { CrossGetOneUsd } from "@nexus-cross/connect-kit-react";
|
|
12
|
+
|
|
13
|
+
export function AppLayout({ children }: { children: ReactNode }) {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
{children}
|
|
17
|
+
<CrossGetOneUsd env="production" mode="floating" theme="dark" />
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Mount `CrossGetOneUsd` once in the persistent app/root layout, below
|
|
24
|
+
`CrossConnectKitProvider` and outside route pages. This keeps the floating
|
|
25
|
+
transaction status visible during same-site client-side route changes. A full
|
|
26
|
+
page reload or navigation to another site does not preserve an in-memory status.
|
|
27
|
+
|
|
28
|
+
Rules:
|
|
29
|
+
|
|
30
|
+
- Do not recreate the chooser, Swap, Bridge, Relay, History, Recover, APR, or transaction-status UI.
|
|
31
|
+
- Use `mode="floating"` for the fixed FAB and `mode="button"` for an inline trigger.
|
|
32
|
+
- In both modes, a submitted Swap/Bridge status is always rendered as a floating status surface.
|
|
33
|
+
- Use `buttonComponent` only when the host must supply a styled button component.
|
|
34
|
+
- Keep the component mounted while a transaction is pending; do not conditionally render it per route.
|
|
35
|
+
- `GetOneUsd` reads the S3 `getOneUsd.modes` flags. Missing flags default to Swap `true`, Bridge `true`, Transfer Crypto `false`.
|
|
36
|
+
- The Transfer Crypto modal owns the `Deposit`, `History`, and `Recover` tabs. It shares one live orders subscription across them.
|
|
37
|
+
- `CrossGetOneUsd` supplies wagmi Bridge and Relay adapters. Do not duplicate those adapters in DApp code.
|
|
38
|
+
- Use the low-level `GetOneUsd` export only when the host already owns every `bridge` and `relay` function port required by its TypeScript props.
|
|
39
|
+
|
|
40
|
+
For an inline host-styled trigger:
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
const GetOneUsdButton = styled.button`
|
|
44
|
+
border-radius: 12px;
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
<CrossGetOneUsd
|
|
48
|
+
env="production"
|
|
49
|
+
mode="button"
|
|
50
|
+
buttonComponent={GetOneUsdButton}
|
|
51
|
+
/>;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Keep all visible user-facing copy in English. Let the package own its modal
|
|
55
|
+
copy, colors, mobile keyboard behavior, safe-area handling, and transaction lock.
|
package/README.md
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
CROSS 생태계 DApp 공통 UI 컴포넌트 패키지.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
공통 DApp 기능을 제공한다. 주요 진입점:
|
|
6
6
|
|
|
7
7
|
- **AppLauncher**: 글로벌 서비스 메뉴
|
|
8
8
|
- **WalletInfo**: 지갑 잔액·가격·등락률 조회 UI
|
|
9
9
|
- **WalletConnectModal**: 지갑 연결 모달/드로어 UI
|
|
10
10
|
- **WalletPortfolio**: 리워드·DEX 포지션 포트폴리오 UI
|
|
11
|
+
- **GetOneUsd**: Swap·Bridge·Relay를 묶은 ONEUSD 획득 플로팅/버튼 위젯
|
|
11
12
|
|
|
12
13
|
> 이전 패키지 이름: `cross-app-launcher` (`@nexus-cross/dapp-ui@0.0.1+` 부터 rename).
|
|
13
14
|
|
|
@@ -39,9 +40,17 @@ import {
|
|
|
39
40
|
WalletInfo,
|
|
40
41
|
WalletConnectModal,
|
|
41
42
|
WalletPortfolio,
|
|
43
|
+
GetOneUsd,
|
|
42
44
|
} from "@nexus-cross/dapp-ui";
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
## AI-assisted integration
|
|
48
|
+
|
|
49
|
+
Give an AI coding agent [`AI_INTEGRATION.md`](./AI_INTEGRATION.md) as the
|
|
50
|
+
implementation contract. It contains the canonical Get ONEUSD mount location,
|
|
51
|
+
route-persistent floating transaction status rule, mode behavior, and the
|
|
52
|
+
boundary between `CrossGetOneUsd` and the low-level `GetOneUsd` ports.
|
|
53
|
+
|
|
45
54
|
---
|
|
46
55
|
|
|
47
56
|
## AppLauncher
|