@turtleclub/opportunities 0.1.0-beta.6 → 0.1.0-beta.61

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +230 -0
  2. package/README.md +179 -0
  3. package/package.json +13 -6
  4. package/src/components/index.ts +1 -1
  5. package/src/cover-offer/README.md +46 -0
  6. package/src/cover-offer/components/CoverOfferCard.tsx +445 -0
  7. package/src/cover-offer/components/CoverRequestForm.tsx +342 -0
  8. package/src/cover-offer/components/CoveredEventsInfo.tsx +120 -0
  9. package/src/cover-offer/components/ExistingCoverInfo.tsx +74 -0
  10. package/src/cover-offer/components/NexusCoverSection.tsx +49 -0
  11. package/src/cover-offer/components/PurchaseButtonSection.tsx +106 -0
  12. package/src/cover-offer/constants.ts +32 -0
  13. package/src/cover-offer/hooks/useCheckNexusMembership.ts +32 -0
  14. package/src/cover-offer/hooks/useCoverQuote.ts +126 -0
  15. package/src/cover-offer/hooks/useCoverTokenSelection.ts +84 -0
  16. package/src/cover-offer/hooks/useDebouncedValue.ts +12 -0
  17. package/src/cover-offer/hooks/useExistingCovers.ts +101 -0
  18. package/src/cover-offer/hooks/useNexusProduct.ts +79 -0
  19. package/src/cover-offer/hooks/useNexusPurchase.ts +67 -0
  20. package/src/cover-offer/hooks/useTokenApproval.ts +118 -0
  21. package/src/cover-offer/hooks/useUserCoverNfts.ts +26 -0
  22. package/src/cover-offer/index.ts +4 -0
  23. package/src/cover-offer/types/index.ts +41 -0
  24. package/src/cover-offer/utils/index.ts +90 -0
  25. package/src/deposit/NativeDepositSection.tsx +220 -0
  26. package/src/deposit/TemporalWrapper.tsx +82 -0
  27. package/src/{components → deposit/components}/balances-data-table.tsx +6 -0
  28. package/src/deposit/components/index.ts +3 -0
  29. package/src/deposit/components/swap-input-v3.tsx +194 -0
  30. package/src/deposit/components/token-selector-v3.tsx +122 -0
  31. package/src/deposit/index.ts +4 -0
  32. package/src/index.ts +9 -0
  33. package/src/opportunity-actions/OpportunityActions.tsx +191 -0
  34. package/src/opportunity-actions/index.ts +1 -0
  35. package/src/opportunity-table/components/opportunities-table.tsx +6 -5
  36. package/src/route-details/index.ts +6 -0
  37. package/src/route-details/route-details-v2.tsx +137 -0
  38. package/src/route-details/route-details.tsx +5 -4
  39. package/src/route-details/types.ts +7 -0
  40. package/src/transaction-status/hooks/useTransactionQueue.ts +1 -1
  41. package/src/withdraw/NativeWithdrawSection.tsx +45 -0
  42. package/src/withdraw/index.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,236 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.1.0-beta.61](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.60...@turtleclub/opportunities@0.1.0-beta.61) (2026-01-28)
7
+
8
+ ### Features
9
+
10
+ - deposit improvements ([#234](https://github.com/turtle-dao/turtle-tools/issues/234)) ([aef8505](https://github.com/turtle-dao/turtle-tools/commit/aef8505b0768f9aeea65b7499dcb090553dd69df))
11
+
12
+ # [0.1.0-beta.60](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.59...@turtleclub/opportunities@0.1.0-beta.60) (2026-01-27)
13
+
14
+ **Note:** Version bump only for package @turtleclub/opportunities
15
+
16
+ # [0.1.0-beta.59](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.58...@turtleclub/opportunities@0.1.0-beta.59) (2026-01-23)
17
+
18
+ **Note:** Version bump only for package @turtleclub/opportunities
19
+
20
+ # [0.1.0-beta.58](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.57...@turtleclub/opportunities@0.1.0-beta.58) (2026-01-23)
21
+
22
+ ### Features
23
+
24
+ - native deposit section ([#231](https://github.com/turtle-dao/turtle-tools/issues/231)) ([b05278e](https://github.com/turtle-dao/turtle-tools/commit/b05278ee2eb7b77429e50140e08ca00eb6d2745d))
25
+
26
+ # [0.1.0-beta.57](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.56...@turtleclub/opportunities@0.1.0-beta.57) (2026-01-21)
27
+
28
+ **Note:** Version bump only for package @turtleclub/opportunities
29
+
30
+ # [0.1.0-beta.56](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.55...@turtleclub/opportunities@0.1.0-beta.56) (2026-01-20)
31
+
32
+ **Note:** Version bump only for package @turtleclub/opportunities
33
+
34
+ # [0.1.0-beta.55](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.54...@turtleclub/opportunities@0.1.0-beta.55) (2026-01-20)
35
+
36
+ **Note:** Version bump only for package @turtleclub/opportunities
37
+
38
+ # [0.1.0-beta.54](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.53...@turtleclub/opportunities@0.1.0-beta.54) (2026-01-19)
39
+
40
+ **Note:** Version bump only for package @turtleclub/opportunities
41
+
42
+ # [0.1.0-beta.53](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.52...@turtleclub/opportunities@0.1.0-beta.53) (2026-01-19)
43
+
44
+ **Note:** Version bump only for package @turtleclub/opportunities
45
+
46
+ # [0.1.0-beta.52](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.51...@turtleclub/opportunities@0.1.0-beta.52) (2026-01-19)
47
+
48
+ **Note:** Version bump only for package @turtleclub/opportunities
49
+
50
+ # [0.1.0-beta.51](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.50...@turtleclub/opportunities@0.1.0-beta.51) (2026-01-16)
51
+
52
+ **Note:** Version bump only for package @turtleclub/opportunities
53
+
54
+ # [0.1.0-beta.50](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.49...@turtleclub/opportunities@0.1.0-beta.50) (2026-01-16)
55
+
56
+ **Note:** Version bump only for package @turtleclub/opportunities
57
+
58
+ # [0.1.0-beta.49](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.48...@turtleclub/opportunities@0.1.0-beta.49) (2026-01-16)
59
+
60
+ **Note:** Version bump only for package @turtleclub/opportunities
61
+
62
+ # [0.1.0-beta.48](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.47...@turtleclub/opportunities@0.1.0-beta.48) (2026-01-14)
63
+
64
+ **Note:** Version bump only for package @turtleclub/opportunities
65
+
66
+ # [0.1.0-beta.47](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.46...@turtleclub/opportunities@0.1.0-beta.47) (2026-01-14)
67
+
68
+ **Note:** Version bump only for package @turtleclub/opportunities
69
+
70
+ # [0.1.0-beta.46](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.45...@turtleclub/opportunities@0.1.0-beta.46) (2026-01-14)
71
+
72
+ **Note:** Version bump only for package @turtleclub/opportunities
73
+
74
+ # [0.1.0-beta.45](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.44...@turtleclub/opportunities@0.1.0-beta.45) (2026-01-13)
75
+
76
+ **Note:** Version bump only for package @turtleclub/opportunities
77
+
78
+ # [0.1.0-beta.44](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.43...@turtleclub/opportunities@0.1.0-beta.44) (2026-01-13)
79
+
80
+ **Note:** Version bump only for package @turtleclub/opportunities
81
+
82
+ # [0.1.0-beta.43](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.42...@turtleclub/opportunities@0.1.0-beta.43) (2026-01-13)
83
+
84
+ **Note:** Version bump only for package @turtleclub/opportunities
85
+
86
+ # [0.1.0-beta.42](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.41...@turtleclub/opportunities@0.1.0-beta.42) (2026-01-13)
87
+
88
+ **Note:** Version bump only for package @turtleclub/opportunities
89
+
90
+ # [0.1.0-beta.41](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.40...@turtleclub/opportunities@0.1.0-beta.41) (2026-01-13)
91
+
92
+ **Note:** Version bump only for package @turtleclub/opportunities
93
+
94
+ # [0.1.0-beta.40](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.39...@turtleclub/opportunities@0.1.0-beta.40) (2026-01-13)
95
+
96
+ **Note:** Version bump only for package @turtleclub/opportunities
97
+
98
+ # [0.1.0-beta.39](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.38...@turtleclub/opportunities@0.1.0-beta.39) (2026-01-12)
99
+
100
+ **Note:** Version bump only for package @turtleclub/opportunities
101
+
102
+ # [0.1.0-beta.38](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.37...@turtleclub/opportunities@0.1.0-beta.38) (2026-01-12)
103
+
104
+ **Note:** Version bump only for package @turtleclub/opportunities
105
+
106
+ # [0.1.0-beta.37](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.36...@turtleclub/opportunities@0.1.0-beta.37) (2026-01-09)
107
+
108
+ **Note:** Version bump only for package @turtleclub/opportunities
109
+
110
+ # [0.1.0-beta.36](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.35...@turtleclub/opportunities@0.1.0-beta.36) (2026-01-09)
111
+
112
+ **Note:** Version bump only for package @turtleclub/opportunities
113
+
114
+ # [0.1.0-beta.35](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.34...@turtleclub/opportunities@0.1.0-beta.35) (2026-01-09)
115
+
116
+ **Note:** Version bump only for package @turtleclub/opportunities
117
+
118
+ # [0.1.0-beta.34](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.33...@turtleclub/opportunities@0.1.0-beta.34) (2026-01-08)
119
+
120
+ **Note:** Version bump only for package @turtleclub/opportunities
121
+
122
+ # [0.1.0-beta.33](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.32...@turtleclub/opportunities@0.1.0-beta.33) (2026-01-08)
123
+
124
+ **Note:** Version bump only for package @turtleclub/opportunities
125
+
126
+ # [0.1.0-beta.32](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.31...@turtleclub/opportunities@0.1.0-beta.32) (2026-01-07)
127
+
128
+ **Note:** Version bump only for package @turtleclub/opportunities
129
+
130
+ # [0.1.0-beta.31](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.30...@turtleclub/opportunities@0.1.0-beta.31) (2026-01-07)
131
+
132
+ **Note:** Version bump only for package @turtleclub/opportunities
133
+
134
+ # [0.1.0-beta.30](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.29...@turtleclub/opportunities@0.1.0-beta.30) (2026-01-07)
135
+
136
+ **Note:** Version bump only for package @turtleclub/opportunities
137
+
138
+ # [0.1.0-beta.29](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.28...@turtleclub/opportunities@0.1.0-beta.29) (2026-01-07)
139
+
140
+ **Note:** Version bump only for package @turtleclub/opportunities
141
+
142
+ # [0.1.0-beta.28](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.27...@turtleclub/opportunities@0.1.0-beta.28) (2026-01-07)
143
+
144
+ **Note:** Version bump only for package @turtleclub/opportunities
145
+
146
+ # [0.1.0-beta.27](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.26...@turtleclub/opportunities@0.1.0-beta.27) (2026-01-07)
147
+
148
+ **Note:** Version bump only for package @turtleclub/opportunities
149
+
150
+ # [0.1.0-beta.26](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.25...@turtleclub/opportunities@0.1.0-beta.26) (2026-01-07)
151
+
152
+ **Note:** Version bump only for package @turtleclub/opportunities
153
+
154
+ # [0.1.0-beta.25](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.24...@turtleclub/opportunities@0.1.0-beta.25) (2026-01-06)
155
+
156
+ **Note:** Version bump only for package @turtleclub/opportunities
157
+
158
+ # [0.1.0-beta.24](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.23...@turtleclub/opportunities@0.1.0-beta.24) (2026-01-05)
159
+
160
+ **Note:** Version bump only for package @turtleclub/opportunities
161
+
162
+ # [0.1.0-beta.23](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.22...@turtleclub/opportunities@0.1.0-beta.23) (2026-01-02)
163
+
164
+ **Note:** Version bump only for package @turtleclub/opportunities
165
+
166
+ # [0.1.0-beta.22](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.21...@turtleclub/opportunities@0.1.0-beta.22) (2025-12-31)
167
+
168
+ ### Features
169
+
170
+ - support USDC and cbBTC cover tokens, persist cover requests, migrate to React Query ([#209](https://github.com/turtle-dao/turtle-tools/issues/209)) ([c225999](https://github.com/turtle-dao/turtle-tools/commit/c225999f1b913e15af6fd7956242097897d5d8ce))
171
+
172
+ # [0.1.0-beta.21](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.20...@turtleclub/opportunities@0.1.0-beta.21) (2025-12-31)
173
+
174
+ **Note:** Version bump only for package @turtleclub/opportunities
175
+
176
+ # [0.1.0-beta.20](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.19...@turtleclub/opportunities@0.1.0-beta.20) (2025-12-30)
177
+
178
+ **Note:** Version bump only for package @turtleclub/opportunities
179
+
180
+ # [0.1.0-beta.19](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.18...@turtleclub/opportunities@0.1.0-beta.19) (2025-12-23)
181
+
182
+ **Note:** Version bump only for package @turtleclub/opportunities
183
+
184
+ # [0.1.0-beta.18](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.17...@turtleclub/opportunities@0.1.0-beta.18) (2025-12-23)
185
+
186
+ **Note:** Version bump only for package @turtleclub/opportunities
187
+
188
+ # [0.1.0-beta.17](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.16...@turtleclub/opportunities@0.1.0-beta.17) (2025-12-23)
189
+
190
+ **Note:** Version bump only for package @turtleclub/opportunities
191
+
192
+ # [0.1.0-beta.16](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.15...@turtleclub/opportunities@0.1.0-beta.16) (2025-12-23)
193
+
194
+ **Note:** Version bump only for package @turtleclub/opportunities
195
+
196
+ # [0.1.0-beta.15](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.14...@turtleclub/opportunities@0.1.0-beta.15) (2025-12-19)
197
+
198
+ ### Features
199
+
200
+ - fix Nexus Cover Purchase. Detect if LP is a nexus member ([#203](https://github.com/turtle-dao/turtle-tools/issues/203)) ([9e05425](https://github.com/turtle-dao/turtle-tools/commit/9e05425f0315f93f27e4d6b01b72faeb15783163))
201
+
202
+ # [0.1.0-beta.14](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.13...@turtleclub/opportunities@0.1.0-beta.14) (2025-12-17)
203
+
204
+ **Note:** Version bump only for package @turtleclub/opportunities
205
+
206
+ # [0.1.0-beta.13](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.12...@turtleclub/opportunities@0.1.0-beta.13) (2025-12-17)
207
+
208
+ **Note:** Version bump only for package @turtleclub/opportunities
209
+
210
+ # [0.1.0-beta.12](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.11...@turtleclub/opportunities@0.1.0-beta.12) (2025-12-16)
211
+
212
+ **Note:** Version bump only for package @turtleclub/opportunities
213
+
214
+ # [0.1.0-beta.11](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.10...@turtleclub/opportunities@0.1.0-beta.11) (2025-12-16)
215
+
216
+ **Note:** Version bump only for package @turtleclub/opportunities
217
+
218
+ # [0.1.0-beta.10](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.9...@turtleclub/opportunities@0.1.0-beta.10) (2025-12-12)
219
+
220
+ ### Features
221
+
222
+ - rony/tur 588 create a reusable cover component ([#196](https://github.com/turtle-dao/turtle-tools/issues/196)) ([34a77b3](https://github.com/turtle-dao/turtle-tools/commit/34a77b3e4befc4bc5a4923f8e75694f7c980c280))
223
+
224
+ # [0.1.0-beta.9](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.8...@turtleclub/opportunities@0.1.0-beta.9) (2025-12-10)
225
+
226
+ **Note:** Version bump only for package @turtleclub/opportunities
227
+
228
+ # [0.1.0-beta.8](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.7...@turtleclub/opportunities@0.1.0-beta.8) (2025-12-10)
229
+
230
+ **Note:** Version bump only for package @turtleclub/opportunities
231
+
232
+ # [0.1.0-beta.7](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.6...@turtleclub/opportunities@0.1.0-beta.7) (2025-12-09)
233
+
234
+ **Note:** Version bump only for package @turtleclub/opportunities
235
+
6
236
  # [0.1.0-beta.6](https://github.com/turtle-dao/turtle-tools/compare/@turtleclub/opportunities@0.1.0-beta.5...@turtleclub/opportunities@0.1.0-beta.6) (2025-12-04)
7
237
 
8
238
  **Note:** Version bump only for package @turtleclub/opportunities
package/README.md ADDED
@@ -0,0 +1,179 @@
1
+ # @turtleclub/opportunities
2
+
3
+ React components for interacting with Turtle Club opportunities, including deposits, withdrawals, and transaction status tracking.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @turtleclub/opportunities
9
+ ```
10
+
11
+ ## Components
12
+
13
+ ### NativeDepositSection
14
+
15
+ A complete deposit interface component for opportunities that handles token selection, balance fetching, and deposit execution.
16
+
17
+ #### Props
18
+
19
+ ```typescript
20
+ interface NativeDepositSectionProps {
21
+ // Required
22
+ opportunity: Opportunity; // The opportunity to deposit into
23
+ address: string | undefined; // User's wallet address
24
+ distributorId: string; // Distributor ID for attribution
25
+ executeTransaction: (tx: TransactionRequest) => Promise<string | undefined>;
26
+
27
+ // Optional
28
+ onDepositSuccess?: () => void; // Callback after successful deposit
29
+ tokenDisplayMode?: 'deposit-tokens' | 'all-chain-tokens'; // Default: 'deposit-tokens'
30
+ showZeroBalances?: boolean; // Show tokens with 0 balance. Default: false
31
+ showExcludedTokens?: boolean; // Show excluded/blacklisted tokens. Default: false
32
+ renderAssetSelector?: (props: AssetSelectorProps) => ReactNode; // Custom token selector
33
+ }
34
+ ```
35
+
36
+ #### Token Display Modes
37
+
38
+ - **`deposit-tokens`** (default): Only shows tokens from `opportunity.depositTokens`
39
+ - **`all-chain-tokens`**: Shows all tokens on the chain that the user has balance for
40
+
41
+ #### Basic Usage
42
+
43
+ ```tsx
44
+ import { NativeDepositSection } from '@turtleclub/opportunities';
45
+ import { useMultichainSendTransaction } from '@turtleclub/multichain';
46
+
47
+ function DepositPage({ opportunity, address }) {
48
+ const { sendTransaction, waitForReceipt } = useMultichainSendTransaction();
49
+
50
+ const executeTransaction = async (tx) => {
51
+ const hash = await sendTransaction({
52
+ to: tx.to,
53
+ data: tx.data,
54
+ value: tx.value ? BigInt(tx.value) : undefined,
55
+ });
56
+ if (hash) await waitForReceipt(hash);
57
+ return hash;
58
+ };
59
+
60
+ return (
61
+ <NativeDepositSection
62
+ opportunity={opportunity}
63
+ address={address}
64
+ distributorId="your-distributor-id"
65
+ executeTransaction={executeTransaction}
66
+ onDepositSuccess={() => console.log('Deposit completed!')}
67
+ />
68
+ );
69
+ }
70
+ ```
71
+
72
+ #### With Custom Asset Selector
73
+
74
+ ```tsx
75
+ import { NativeDepositSection, type AssetSelectorProps } from '@turtleclub/opportunities';
76
+
77
+ function CustomAssetSelector({ tokens, selectedToken, onTokenChange, isLoading }: AssetSelectorProps) {
78
+ return (
79
+ <div className="custom-selector">
80
+ {tokens.map((token) => (
81
+ <button
82
+ key={token.address}
83
+ onClick={() => onTokenChange(token.address)}
84
+ className={selectedToken === token.address ? 'selected' : ''}
85
+ >
86
+ {token.symbol} - {token.balance}
87
+ </button>
88
+ ))}
89
+ </div>
90
+ );
91
+ }
92
+
93
+ function DepositPage({ opportunity, address }) {
94
+ return (
95
+ <NativeDepositSection
96
+ opportunity={opportunity}
97
+ address={address}
98
+ distributorId="your-distributor-id"
99
+ executeTransaction={executeTransaction}
100
+ renderAssetSelector={(props) => <CustomAssetSelector {...props} />}
101
+ />
102
+ );
103
+ }
104
+ ```
105
+
106
+ #### Show All Chain Tokens
107
+
108
+ ```tsx
109
+ <NativeDepositSection
110
+ opportunity={opportunity}
111
+ address={address}
112
+ distributorId="your-distributor-id"
113
+ executeTransaction={executeTransaction}
114
+ tokenDisplayMode="all-chain-tokens"
115
+ showZeroBalances={true}
116
+ />
117
+ ```
118
+
119
+ ### Features
120
+
121
+ - **Auto-selection**: Automatically selects the token with the highest balance
122
+ - **Native token support**: Handles both ERC20 and native tokens (ETH, MATIC, etc.)
123
+ - **USD value display**: Shows real-time USD equivalent of the amount
124
+ - **Insufficient balance detection**: Validates balance before allowing deposit
125
+ - **Max button**: Quick-fill maximum available balance
126
+ - **Geo-blocking**: Integrates with GeoCheckBlocker for geographic restrictions
127
+ - **Loading states**: Shows loading indicators while fetching balances
128
+
129
+ ### Dependencies
130
+
131
+ This component uses the following hooks from `@turtleclub/hooks`:
132
+
133
+ - `useGetOnChainBalance` - Fetches on-chain token balances
134
+ - `useBalance` - Fetches consolidated balances from multiple sources
135
+ - `useTokenBalance` - Calculates USD value and validates amounts
136
+ - `useEarnDeposit` - Handles the deposit transaction flow
137
+
138
+ ## Other Components
139
+
140
+ ### GeoCheckBlocker
141
+
142
+ Wraps content that should be blocked in certain geographic regions.
143
+
144
+ ### ConfirmButton
145
+
146
+ Button component with confirmation state for critical actions.
147
+
148
+ ## Types
149
+
150
+ ```typescript
151
+ // Re-exported from @turtleclub/hooks
152
+ export type { Opportunity, TransactionRequest } from '@turtleclub/hooks';
153
+
154
+ // Component-specific types
155
+ export interface AssetSelectorProps {
156
+ tokens: SwapInputToken[];
157
+ selectedToken: string | undefined;
158
+ onTokenChange: (address: string) => void;
159
+ isLoading: boolean;
160
+ }
161
+ ```
162
+
163
+ ## Testing
164
+
165
+ The showcase app includes a testing page at `/actions` where you can:
166
+
167
+ 1. Connect a wallet (EVM, Solana, or TON)
168
+ 2. Test NativeDepositSection with different configurations
169
+ 3. Toggle between token display modes
170
+ 4. Test with zero balance visibility
171
+
172
+ Run the showcase:
173
+
174
+ ```bash
175
+ cd apps/showcase
176
+ pnpm dev
177
+ ```
178
+
179
+ Navigate to `http://localhost:3000/actions` to test the component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turtleclub/opportunities",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.61",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -9,20 +9,27 @@
9
9
  "typecheck": "tsc --noEmit"
10
10
  },
11
11
  "dependencies": {
12
- "@turtleclub/hooks": "0.5.0-beta.2",
13
- "@turtleclub/ui": "0.7.0-beta.5",
12
+ "@nexusmutual/sdk": "^1.26.0",
13
+ "@tanstack/react-form": "^1.27.6",
14
+ "@tanstack/react-query": "^5.62.3",
15
+ "@tanstack/react-table": "^8.21.3",
16
+ "@turtleclub/hooks": "0.5.0-beta.44",
17
+ "@turtleclub/multichain": "0.5.0-beta.1",
18
+ "@turtleclub/ui": "0.7.0-beta.23",
14
19
  "@turtleclub/utils": "0.4.0-beta.0",
15
20
  "jotai": "^2.10.3",
16
- "viem": "^2.21.54"
21
+ "lucide-react": "^0.542.0",
22
+ "viem": "^2.21.54",
23
+ "wagmi": "^2.15.6"
17
24
  },
18
25
  "peerDependencies": {
19
26
  "react": "^18.3.1",
20
27
  "react-dom": "^18.3.1"
21
28
  },
22
29
  "devDependencies": {
23
- "@types/react": "^18.3.18",
30
+ "@types/react": "^19.1.1",
24
31
  "@types/react-dom": "^18.3.5",
25
32
  "typescript": "^5.7.2"
26
33
  },
27
- "gitHead": "09d5d186b6253d8315b6e69aae3921d6850cddb2"
34
+ "gitHead": "4a93ec9e58cff4424e003cabe74da0892dadcc95"
28
35
  }
@@ -1 +1 @@
1
- export * from "./balances-data-table";
1
+ // No exports - BalancesDataTable is now exported from ./deposit/components
@@ -0,0 +1,46 @@
1
+ # Cover Offer Module
2
+
3
+ Provides Nexus Mutual protocol cover integration for DeFi opportunities.
4
+
5
+ ## Component Structure
6
+
7
+ ```
8
+ NexusCoverSection (entry point)
9
+ ├── CoverOfferCard → Protocol is coverable (handles membership inline)
10
+ │ ├── CoveredEventsInfo → Displays covered events and exclusions
11
+ │ ├── ExistingCoverInfo → Shows existing cover details
12
+ │ └── PurchaseButtonSection → Handles network switch, membership, approval, and purchase
13
+ └── CoverRequestForm → Protocol not yet coverable (interest form)
14
+ ```
15
+
16
+ ### Display Logic
17
+
18
+ | Condition | Component Shown |
19
+ | ---------------------------- | ------------------ |
20
+ | Protocol coverable | `CoverOfferCard` |
21
+ | Protocol NOT coverable | `CoverRequestForm` |
22
+ | Protocol unknown / no wallet | Nothing |
23
+
24
+ If the user is not a Nexus member, `CoverOfferCard` displays a "Become a Member" prompt via `PurchaseButtonSection`.
25
+
26
+ ## Hooks
27
+
28
+ | Hook | Description | Data Source |
29
+ | ------------------------- | ---------------------------------------- | --------------------------------------------- |
30
+ | `useNexusProduct` | Maps opportunity to Nexus product ID | `@nexusmutual/sdk` products list |
31
+ | `useCheckNexusMembership` | Checks if user is Nexus member | `NXMaster.isMember()` contract call |
32
+ | `useCoverQuote` | Fetches cover quote for given params | Nexus SDK `quote.getQuoteAndBuyCoverInputs()` |
33
+ | `useNexusPurchase` | Handles cover purchase transaction | `Cover.buyCover()` contract call |
34
+ | `useExistingCovers` | Gets user's active covers | `CoverViewer.getCovers()` contract call |
35
+ | `useUserCoverNfts` | Fetches user's cover NFTs | Turtle API `/nfts` endpoint |
36
+ | `useCoverTokenSelection` | Manages token selection for cover payment| User portfolio balance |
37
+ | `useTokenApproval` | Handles ERC20 token approval flow | ERC20 `allowance()` / `approve()` calls |
38
+ | `useDebouncedValue` | Debounces input values | Local state |
39
+
40
+ ## Testing
41
+
42
+ The `apps/turtle-cover` MVP is designed for testing this package.
43
+
44
+ You can run it with
45
+
46
+ `bun run dev --filter=@turtle/cover`