@nexus-cross/dapp-ui 1.3.4-beta.3 → 1.3.4-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -51,6 +51,11 @@ interface GlobalMenuItemUrl {
51
51
  }
52
52
  type GlobalMenuItemAssetUrl = string | GlobalMenuItemUrl;
53
53
  type GlobalMenuItemServiceStatus = "available" | "ending" | "comingSoon";
54
+ type GlobalMenuCategoryStatus = "all" | GlobalMenuItemServiceStatus;
55
+ interface GlobalMenuCategory {
56
+ status: GlobalMenuCategoryStatus;
57
+ label: string;
58
+ }
54
59
  interface GlobalMenuItem {
55
60
  id: string;
56
61
  label: string;
@@ -65,6 +70,7 @@ interface GlobalMenuItem {
65
70
  }
66
71
  interface GlobalMenu {
67
72
  version: string;
73
+ categories?: GlobalMenuCategory[];
68
74
  items: GlobalMenuItem[];
69
75
  }
70
76
 
@@ -147,13 +153,14 @@ interface TokenStatsResponse {
147
153
  /**
148
154
  * 포트폴리오 본문에 노출 가능한 섹션 종류.
149
155
  * - `"rewards"` : CROSS Rewards
156
+ * - `"points"` : CROSS Points (게임 토큰 예치 퀘스트, 내장 Withdraw)
150
157
  * - `"staking"` : CROSS Staking
151
158
  * - `"gameSwap"` : Gametoken LP
152
159
  * - `"forge"` : Forge
153
160
  *
154
161
  * `WalletPortfolioBody` / `WalletInfo`의 섹션 필터에 사용한다.
155
162
  */
156
- type PortfolioSection = "rewards" | "staking" | "gameSwap" | "forge";
163
+ type PortfolioSection = "rewards" | "points" | "staking" | "gameSwap" | "forge";
157
164
  /**
158
165
  * 섹션 필터를 지정하지 않았을 때(=전체 노출)의 기본 표시 순서.
159
166
  * 배열로 필터를 줄 때 어떤 키들이 유효한지에 대한 단일 출처(source of truth).
@@ -250,6 +257,24 @@ interface UserDepositInfo {
250
257
  last_updated_time: number;
251
258
  last_withdrawn_block: number;
252
259
  }
260
+ /**
261
+ * 사용자가 출금할 수 있는 예치 포지션 하나 (deposited > 0인 풀).
262
+ * `useWithdrawPositions`가 deposits API + pools API(+온체인 메타 폴백)를
263
+ * 합성해 만든다. 금액은 raw(wei) 문자열로 유지하고 표기 시에만 환산한다.
264
+ */
265
+ interface WithdrawPosition {
266
+ poolId: number;
267
+ poolAddress: string;
268
+ /** pools API가 모르는(비활성/quest) 풀은 "Unknown". */
269
+ poolType: RewardPool["pool_type"] | "Unknown";
270
+ tokenSymbol: string;
271
+ tokenAddress: string;
272
+ decimals: number;
273
+ /** USD 단가 (pools API 제공 시에만). */
274
+ price?: string;
275
+ /** 예치 잔액 (raw, wei 문자열) */
276
+ depositedRaw: string;
277
+ }
253
278
  /**
254
279
  * host(wagmi 보유 측)가 공급하는 LP 잔고 reader가 반환하는 단위 정보.
255
280
  * 금액은 모두 raw(wei) BigInt로 다루고, 표기 시에만 decimals로 환산한다.
@@ -415,6 +440,12 @@ type OutlinkContext = {
415
440
  pool: RewardPool;
416
441
  userDeposit?: UserDepositInfo;
417
442
  };
443
+ } | {
444
+ category: "portfolio";
445
+ origin: "portfolio-points";
446
+ payload: {
447
+ position: WithdrawPosition;
448
+ };
418
449
  } | {
419
450
  category: "portfolio";
420
451
  origin: "portfolio-stake";
@@ -1044,9 +1075,17 @@ interface WalletPortfolioProps {
1044
1075
  * host(wagmi 보유 측)로부터 주입받는 reader. 미주입 시 API 값으로 폴백한다.
1045
1076
  */
1046
1077
  stakingRewardsReader?: StakingRewardsReaderFn;
1078
+ /**
1079
+ * 내장 Withdraw(Rewards) 트랜잭션 서명/브로드캐스트 콜백.
1080
+ * wagmi의 `sendTransactionAsync`를 그대로 전달해도 호환된다.
1081
+ * 미주입 시 Withdraw는 기존 외부 링크로 폴백한다.
1082
+ */
1083
+ sendTransaction?: SendTransactionFn;
1084
+ /** 내장 Withdraw 확인 화면의 가스 추정 콜백. 미주입 시 지갑 추정에 위임. */
1085
+ estimateGas?: EstimateGasFn;
1047
1086
  children: React.ReactNode;
1048
1087
  }
1049
- declare function WalletPortfolioRoot({ env, theme, walletAddress, open: propOpen, onOpenChange, onOutlink, lpBalanceReader, stakingRewardsReader, children, }: WalletPortfolioProps): react_jsx_runtime.JSX.Element;
1088
+ declare function WalletPortfolioRoot({ env, theme, walletAddress, open: propOpen, onOpenChange, onOutlink, lpBalanceReader, stakingRewardsReader, sendTransaction, estimateGas, children, }: WalletPortfolioProps): react_jsx_runtime.JSX.Element;
1050
1089
  declare const WalletPortfolio: typeof WalletPortfolioRoot & {
1051
1090
  Trigger: typeof WalletPortfolioTrigger;
1052
1091
  Content: typeof WalletPortfolioContent;
@@ -1088,6 +1127,14 @@ interface WalletPortfolioBodyProps {
1088
1127
  * host(wagmi 보유 측)로부터 주입받는 reader. 미주입 시 API 값으로 폴백한다.
1089
1128
  */
1090
1129
  stakingRewardsReader?: StakingRewardsReaderFn;
1130
+ /**
1131
+ * 내장 Withdraw(Rewards) 트랜잭션 서명/브로드캐스트 콜백.
1132
+ * wagmi의 `sendTransactionAsync`를 그대로 전달해도 호환된다.
1133
+ * 미주입 시 Withdraw는 기존 외부 링크로 폴백한다.
1134
+ */
1135
+ sendTransaction?: SendTransactionFn;
1136
+ /** 내장 Withdraw 확인 화면의 가스 추정 콜백. 미주입 시 지갑 추정에 위임. */
1137
+ estimateGas?: EstimateGasFn;
1091
1138
  /**
1092
1139
  * 노출할 포트폴리오 섹션을 제한한다. 미지정(`undefined`)이면 모든 섹션을
1093
1140
  * 기본 순서대로 표시하고, 배열을 주면 포함된 섹션만 (기본 순서를 유지한 채)
@@ -1095,7 +1142,7 @@ interface WalletPortfolioBodyProps {
1095
1142
  */
1096
1143
  sections?: PortfolioSection[];
1097
1144
  }
1098
- declare function WalletPortfolioBody({ env, theme, walletAddress, walletName, onBack, showHeader, variant, className, onOutlink, lpBalanceReader, stakingRewardsReader, sections, }: WalletPortfolioBodyProps): react_jsx_runtime.JSX.Element;
1145
+ declare function WalletPortfolioBody({ env, theme, walletAddress, walletName, onBack, showHeader, variant, className, onOutlink, lpBalanceReader, stakingRewardsReader, sendTransaction, estimateGas, sections, }: WalletPortfolioBodyProps): react_jsx_runtime.JSX.Element;
1099
1146
 
1100
1147
  declare function CROSSxIcon(): react_jsx_runtime.JSX.Element;
1101
1148
  declare function MetaMaskIcon(): react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -51,6 +51,11 @@ interface GlobalMenuItemUrl {
51
51
  }
52
52
  type GlobalMenuItemAssetUrl = string | GlobalMenuItemUrl;
53
53
  type GlobalMenuItemServiceStatus = "available" | "ending" | "comingSoon";
54
+ type GlobalMenuCategoryStatus = "all" | GlobalMenuItemServiceStatus;
55
+ interface GlobalMenuCategory {
56
+ status: GlobalMenuCategoryStatus;
57
+ label: string;
58
+ }
54
59
  interface GlobalMenuItem {
55
60
  id: string;
56
61
  label: string;
@@ -65,6 +70,7 @@ interface GlobalMenuItem {
65
70
  }
66
71
  interface GlobalMenu {
67
72
  version: string;
73
+ categories?: GlobalMenuCategory[];
68
74
  items: GlobalMenuItem[];
69
75
  }
70
76
 
@@ -147,13 +153,14 @@ interface TokenStatsResponse {
147
153
  /**
148
154
  * 포트폴리오 본문에 노출 가능한 섹션 종류.
149
155
  * - `"rewards"` : CROSS Rewards
156
+ * - `"points"` : CROSS Points (게임 토큰 예치 퀘스트, 내장 Withdraw)
150
157
  * - `"staking"` : CROSS Staking
151
158
  * - `"gameSwap"` : Gametoken LP
152
159
  * - `"forge"` : Forge
153
160
  *
154
161
  * `WalletPortfolioBody` / `WalletInfo`의 섹션 필터에 사용한다.
155
162
  */
156
- type PortfolioSection = "rewards" | "staking" | "gameSwap" | "forge";
163
+ type PortfolioSection = "rewards" | "points" | "staking" | "gameSwap" | "forge";
157
164
  /**
158
165
  * 섹션 필터를 지정하지 않았을 때(=전체 노출)의 기본 표시 순서.
159
166
  * 배열로 필터를 줄 때 어떤 키들이 유효한지에 대한 단일 출처(source of truth).
@@ -250,6 +257,24 @@ interface UserDepositInfo {
250
257
  last_updated_time: number;
251
258
  last_withdrawn_block: number;
252
259
  }
260
+ /**
261
+ * 사용자가 출금할 수 있는 예치 포지션 하나 (deposited > 0인 풀).
262
+ * `useWithdrawPositions`가 deposits API + pools API(+온체인 메타 폴백)를
263
+ * 합성해 만든다. 금액은 raw(wei) 문자열로 유지하고 표기 시에만 환산한다.
264
+ */
265
+ interface WithdrawPosition {
266
+ poolId: number;
267
+ poolAddress: string;
268
+ /** pools API가 모르는(비활성/quest) 풀은 "Unknown". */
269
+ poolType: RewardPool["pool_type"] | "Unknown";
270
+ tokenSymbol: string;
271
+ tokenAddress: string;
272
+ decimals: number;
273
+ /** USD 단가 (pools API 제공 시에만). */
274
+ price?: string;
275
+ /** 예치 잔액 (raw, wei 문자열) */
276
+ depositedRaw: string;
277
+ }
253
278
  /**
254
279
  * host(wagmi 보유 측)가 공급하는 LP 잔고 reader가 반환하는 단위 정보.
255
280
  * 금액은 모두 raw(wei) BigInt로 다루고, 표기 시에만 decimals로 환산한다.
@@ -415,6 +440,12 @@ type OutlinkContext = {
415
440
  pool: RewardPool;
416
441
  userDeposit?: UserDepositInfo;
417
442
  };
443
+ } | {
444
+ category: "portfolio";
445
+ origin: "portfolio-points";
446
+ payload: {
447
+ position: WithdrawPosition;
448
+ };
418
449
  } | {
419
450
  category: "portfolio";
420
451
  origin: "portfolio-stake";
@@ -1044,9 +1075,17 @@ interface WalletPortfolioProps {
1044
1075
  * host(wagmi 보유 측)로부터 주입받는 reader. 미주입 시 API 값으로 폴백한다.
1045
1076
  */
1046
1077
  stakingRewardsReader?: StakingRewardsReaderFn;
1078
+ /**
1079
+ * 내장 Withdraw(Rewards) 트랜잭션 서명/브로드캐스트 콜백.
1080
+ * wagmi의 `sendTransactionAsync`를 그대로 전달해도 호환된다.
1081
+ * 미주입 시 Withdraw는 기존 외부 링크로 폴백한다.
1082
+ */
1083
+ sendTransaction?: SendTransactionFn;
1084
+ /** 내장 Withdraw 확인 화면의 가스 추정 콜백. 미주입 시 지갑 추정에 위임. */
1085
+ estimateGas?: EstimateGasFn;
1047
1086
  children: React.ReactNode;
1048
1087
  }
1049
- declare function WalletPortfolioRoot({ env, theme, walletAddress, open: propOpen, onOpenChange, onOutlink, lpBalanceReader, stakingRewardsReader, children, }: WalletPortfolioProps): react_jsx_runtime.JSX.Element;
1088
+ declare function WalletPortfolioRoot({ env, theme, walletAddress, open: propOpen, onOpenChange, onOutlink, lpBalanceReader, stakingRewardsReader, sendTransaction, estimateGas, children, }: WalletPortfolioProps): react_jsx_runtime.JSX.Element;
1050
1089
  declare const WalletPortfolio: typeof WalletPortfolioRoot & {
1051
1090
  Trigger: typeof WalletPortfolioTrigger;
1052
1091
  Content: typeof WalletPortfolioContent;
@@ -1088,6 +1127,14 @@ interface WalletPortfolioBodyProps {
1088
1127
  * host(wagmi 보유 측)로부터 주입받는 reader. 미주입 시 API 값으로 폴백한다.
1089
1128
  */
1090
1129
  stakingRewardsReader?: StakingRewardsReaderFn;
1130
+ /**
1131
+ * 내장 Withdraw(Rewards) 트랜잭션 서명/브로드캐스트 콜백.
1132
+ * wagmi의 `sendTransactionAsync`를 그대로 전달해도 호환된다.
1133
+ * 미주입 시 Withdraw는 기존 외부 링크로 폴백한다.
1134
+ */
1135
+ sendTransaction?: SendTransactionFn;
1136
+ /** 내장 Withdraw 확인 화면의 가스 추정 콜백. 미주입 시 지갑 추정에 위임. */
1137
+ estimateGas?: EstimateGasFn;
1091
1138
  /**
1092
1139
  * 노출할 포트폴리오 섹션을 제한한다. 미지정(`undefined`)이면 모든 섹션을
1093
1140
  * 기본 순서대로 표시하고, 배열을 주면 포함된 섹션만 (기본 순서를 유지한 채)
@@ -1095,7 +1142,7 @@ interface WalletPortfolioBodyProps {
1095
1142
  */
1096
1143
  sections?: PortfolioSection[];
1097
1144
  }
1098
- declare function WalletPortfolioBody({ env, theme, walletAddress, walletName, onBack, showHeader, variant, className, onOutlink, lpBalanceReader, stakingRewardsReader, sections, }: WalletPortfolioBodyProps): react_jsx_runtime.JSX.Element;
1145
+ declare function WalletPortfolioBody({ env, theme, walletAddress, walletName, onBack, showHeader, variant, className, onOutlink, lpBalanceReader, stakingRewardsReader, sendTransaction, estimateGas, sections, }: WalletPortfolioBodyProps): react_jsx_runtime.JSX.Element;
1099
1146
 
1100
1147
  declare function CROSSxIcon(): react_jsx_runtime.JSX.Element;
1101
1148
  declare function MetaMaskIcon(): react_jsx_runtime.JSX.Element;