@turtleclub/opportunities 0.1.0-beta.20 → 0.1.0-beta.22

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 CHANGED
@@ -3,6 +3,16 @@
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.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)
7
+
8
+ ### Features
9
+
10
+ - 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))
11
+
12
+ # [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)
13
+
14
+ **Note:** Version bump only for package @turtleclub/opportunities
15
+
6
16
  # [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)
7
17
 
8
18
  **Note:** Version bump only for package @turtleclub/opportunities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turtleclub/opportunities",
3
- "version": "0.1.0-beta.20",
3
+ "version": "0.1.0-beta.22",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -10,8 +10,11 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@nexusmutual/sdk": "^1.26.0",
13
- "@turtleclub/hooks": "0.5.0-beta.12",
14
- "@turtleclub/ui": "0.7.0-beta.9",
13
+ "@tanstack/react-form": "^1.27.6",
14
+ "@tanstack/react-query": "^5.62.3",
15
+ "@turtleclub/hooks": "0.5.0-beta.14",
16
+ "@turtleclub/multichain": "0.4.0",
17
+ "@turtleclub/ui": "0.7.0-beta.10",
15
18
  "@turtleclub/utils": "0.4.0-beta.0",
16
19
  "jotai": "^2.10.3",
17
20
  "lucide-react": "^0.542.0",
@@ -27,5 +30,5 @@
27
30
  "@types/react-dom": "^18.3.5",
28
31
  "typescript": "^5.7.2"
29
32
  },
30
- "gitHead": "aa9845b493cc2633e82bb9f94d76a9bc117af7fb"
33
+ "gitHead": "1c079d74e9530d05b212ee03ee221e668ae3ce96"
31
34
  }
@@ -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`