@turtleclub/opportunities 0.1.0-beta.6 → 0.1.0-beta.60
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/CHANGELOG.md +224 -0
- package/README.md +179 -0
- package/package.json +13 -6
- package/src/components/index.ts +1 -1
- package/src/cover-offer/README.md +46 -0
- package/src/cover-offer/components/CoverOfferCard.tsx +445 -0
- package/src/cover-offer/components/CoverRequestForm.tsx +342 -0
- package/src/cover-offer/components/CoveredEventsInfo.tsx +120 -0
- package/src/cover-offer/components/ExistingCoverInfo.tsx +74 -0
- package/src/cover-offer/components/NexusCoverSection.tsx +49 -0
- package/src/cover-offer/components/PurchaseButtonSection.tsx +106 -0
- package/src/cover-offer/constants.ts +32 -0
- package/src/cover-offer/hooks/useCheckNexusMembership.ts +32 -0
- package/src/cover-offer/hooks/useCoverQuote.ts +126 -0
- package/src/cover-offer/hooks/useCoverTokenSelection.ts +84 -0
- package/src/cover-offer/hooks/useDebouncedValue.ts +12 -0
- package/src/cover-offer/hooks/useExistingCovers.ts +101 -0
- package/src/cover-offer/hooks/useNexusProduct.ts +79 -0
- package/src/cover-offer/hooks/useNexusPurchase.ts +67 -0
- package/src/cover-offer/hooks/useTokenApproval.ts +118 -0
- package/src/cover-offer/hooks/useUserCoverNfts.ts +26 -0
- package/src/cover-offer/index.ts +4 -0
- package/src/cover-offer/types/index.ts +41 -0
- package/src/cover-offer/utils/index.ts +90 -0
- package/src/deposit/NativeDepositSection.tsx +199 -0
- package/src/deposit/TemporalWrapper.tsx +155 -0
- package/src/{components → deposit/components}/balances-data-table.tsx +6 -0
- package/src/deposit/components/index.ts +3 -0
- package/src/deposit/components/swap-input-v3.tsx +194 -0
- package/src/deposit/components/token-selector-v3.tsx +122 -0
- package/src/deposit/index.ts +4 -0
- package/src/index.ts +9 -0
- package/src/opportunity-actions/OpportunityActions.tsx +182 -0
- package/src/opportunity-actions/index.ts +1 -0
- package/src/opportunity-table/components/opportunities-table.tsx +6 -5
- package/src/route-details/index.ts +6 -0
- package/src/route-details/route-details-v2.tsx +137 -0
- package/src/route-details/route-details.tsx +5 -4
- package/src/route-details/types.ts +7 -0
- package/src/transaction-status/hooks/useTransactionQueue.ts +1 -1
- package/src/withdraw/NativeWithdrawSection.tsx +45 -0
- package/src/withdraw/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,230 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
9
|
+
|
|
10
|
+
# [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)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
13
|
+
|
|
14
|
+
# [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)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- native deposit section ([#231](https://github.com/turtle-dao/turtle-tools/issues/231)) ([b05278e](https://github.com/turtle-dao/turtle-tools/commit/b05278ee2eb7b77429e50140e08ca00eb6d2745d))
|
|
19
|
+
|
|
20
|
+
# [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)
|
|
21
|
+
|
|
22
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
23
|
+
|
|
24
|
+
# [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)
|
|
25
|
+
|
|
26
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
27
|
+
|
|
28
|
+
# [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)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
31
|
+
|
|
32
|
+
# [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)
|
|
33
|
+
|
|
34
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
35
|
+
|
|
36
|
+
# [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)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
39
|
+
|
|
40
|
+
# [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)
|
|
41
|
+
|
|
42
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
43
|
+
|
|
44
|
+
# [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)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
47
|
+
|
|
48
|
+
# [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)
|
|
49
|
+
|
|
50
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
51
|
+
|
|
52
|
+
# [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)
|
|
53
|
+
|
|
54
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
55
|
+
|
|
56
|
+
# [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)
|
|
57
|
+
|
|
58
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
59
|
+
|
|
60
|
+
# [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)
|
|
61
|
+
|
|
62
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
63
|
+
|
|
64
|
+
# [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)
|
|
65
|
+
|
|
66
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
67
|
+
|
|
68
|
+
# [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)
|
|
69
|
+
|
|
70
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
71
|
+
|
|
72
|
+
# [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)
|
|
73
|
+
|
|
74
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
75
|
+
|
|
76
|
+
# [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)
|
|
77
|
+
|
|
78
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
79
|
+
|
|
80
|
+
# [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)
|
|
81
|
+
|
|
82
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
83
|
+
|
|
84
|
+
# [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)
|
|
85
|
+
|
|
86
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
87
|
+
|
|
88
|
+
# [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)
|
|
89
|
+
|
|
90
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
91
|
+
|
|
92
|
+
# [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)
|
|
93
|
+
|
|
94
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
95
|
+
|
|
96
|
+
# [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)
|
|
97
|
+
|
|
98
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
99
|
+
|
|
100
|
+
# [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)
|
|
101
|
+
|
|
102
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
103
|
+
|
|
104
|
+
# [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)
|
|
105
|
+
|
|
106
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
107
|
+
|
|
108
|
+
# [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)
|
|
109
|
+
|
|
110
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
111
|
+
|
|
112
|
+
# [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)
|
|
113
|
+
|
|
114
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
115
|
+
|
|
116
|
+
# [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)
|
|
117
|
+
|
|
118
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
119
|
+
|
|
120
|
+
# [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)
|
|
121
|
+
|
|
122
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
123
|
+
|
|
124
|
+
# [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)
|
|
125
|
+
|
|
126
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
127
|
+
|
|
128
|
+
# [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)
|
|
129
|
+
|
|
130
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
131
|
+
|
|
132
|
+
# [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)
|
|
133
|
+
|
|
134
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
135
|
+
|
|
136
|
+
# [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)
|
|
137
|
+
|
|
138
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
139
|
+
|
|
140
|
+
# [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)
|
|
141
|
+
|
|
142
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
143
|
+
|
|
144
|
+
# [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)
|
|
145
|
+
|
|
146
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
147
|
+
|
|
148
|
+
# [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)
|
|
149
|
+
|
|
150
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
151
|
+
|
|
152
|
+
# [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)
|
|
153
|
+
|
|
154
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
155
|
+
|
|
156
|
+
# [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)
|
|
157
|
+
|
|
158
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
159
|
+
|
|
160
|
+
# [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)
|
|
161
|
+
|
|
162
|
+
### Features
|
|
163
|
+
|
|
164
|
+
- 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))
|
|
165
|
+
|
|
166
|
+
# [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)
|
|
167
|
+
|
|
168
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
169
|
+
|
|
170
|
+
# [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)
|
|
171
|
+
|
|
172
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
173
|
+
|
|
174
|
+
# [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)
|
|
175
|
+
|
|
176
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
177
|
+
|
|
178
|
+
# [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)
|
|
179
|
+
|
|
180
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
181
|
+
|
|
182
|
+
# [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)
|
|
183
|
+
|
|
184
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
185
|
+
|
|
186
|
+
# [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)
|
|
187
|
+
|
|
188
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
189
|
+
|
|
190
|
+
# [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)
|
|
191
|
+
|
|
192
|
+
### Features
|
|
193
|
+
|
|
194
|
+
- 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))
|
|
195
|
+
|
|
196
|
+
# [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)
|
|
197
|
+
|
|
198
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
199
|
+
|
|
200
|
+
# [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)
|
|
201
|
+
|
|
202
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
203
|
+
|
|
204
|
+
# [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)
|
|
205
|
+
|
|
206
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
207
|
+
|
|
208
|
+
# [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)
|
|
209
|
+
|
|
210
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
211
|
+
|
|
212
|
+
# [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)
|
|
213
|
+
|
|
214
|
+
### Features
|
|
215
|
+
|
|
216
|
+
- 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))
|
|
217
|
+
|
|
218
|
+
# [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)
|
|
219
|
+
|
|
220
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
221
|
+
|
|
222
|
+
# [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)
|
|
223
|
+
|
|
224
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
225
|
+
|
|
226
|
+
# [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)
|
|
227
|
+
|
|
228
|
+
**Note:** Version bump only for package @turtleclub/opportunities
|
|
229
|
+
|
|
6
230
|
# [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
231
|
|
|
8
232
|
**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.
|
|
3
|
+
"version": "0.1.0-beta.60",
|
|
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
|
-
"@
|
|
13
|
-
"@
|
|
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.43",
|
|
17
|
+
"@turtleclub/multichain": "0.5.0-beta.0",
|
|
18
|
+
"@turtleclub/ui": "0.7.0-beta.23",
|
|
14
19
|
"@turtleclub/utils": "0.4.0-beta.0",
|
|
15
20
|
"jotai": "^2.10.3",
|
|
16
|
-
"
|
|
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": "^
|
|
30
|
+
"@types/react": "^19.1.1",
|
|
24
31
|
"@types/react-dom": "^18.3.5",
|
|
25
32
|
"typescript": "^5.7.2"
|
|
26
33
|
},
|
|
27
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "ae345f4c4390594e945a1d39c719324620f981bc"
|
|
28
35
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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`
|