@sip-protocol/react 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -56,28 +56,68 @@ Access the SIP client instance directly.
56
56
  const sip = useSIP()
57
57
  ```
58
58
 
59
- ### `useStealthAddress()` (stub)
59
+ ### `useStealthAddress(chain)`
60
60
 
61
- Generate and manage stealth addresses. Full implementation coming soon.
61
+ Generate and manage stealth addresses for privacy-preserving transactions.
62
62
 
63
63
  ```tsx
64
- const { generate, parse, isValid } = useStealthAddress()
64
+ const {
65
+ metaAddress,
66
+ stealthAddress,
67
+ isGenerating,
68
+ regenerate,
69
+ copyToClipboard,
70
+ } = useStealthAddress('ethereum')
71
+
72
+ return (
73
+ <div>
74
+ <p>Share this: {metaAddress}</p>
75
+ <p>One-time address: {stealthAddress}</p>
76
+ <button onClick={regenerate}>Generate New</button>
77
+ <button onClick={copyToClipboard}>Copy</button>
78
+ </div>
79
+ )
65
80
  ```
66
81
 
67
- ### `usePrivateSwap()` (stub)
82
+ ### `usePrivateSwap()`
68
83
 
69
- Execute private swaps with shielded intents. Full implementation coming soon.
84
+ Execute private swaps with shielded intents.
70
85
 
71
86
  ```tsx
72
- const { execute, status, error } = usePrivateSwap()
87
+ const { quote, fetchQuote, swap, status, isLoading, error, reset } = usePrivateSwap()
88
+
89
+ // Fetch a quote
90
+ await fetchQuote({
91
+ inputChain: 'solana',
92
+ outputChain: 'ethereum',
93
+ inputToken: 'SOL',
94
+ outputToken: 'ETH',
95
+ inputAmount: '1000000000',
96
+ })
97
+
98
+ // Execute swap
99
+ const result = await swap({
100
+ input: { chain: 'solana', token: 'SOL', amount: 1000000000n },
101
+ output: { chain: 'ethereum', token: 'ETH', minAmount: 0n },
102
+ privacyLevel: PrivacyLevel.SHIELDED,
103
+ })
73
104
  ```
74
105
 
75
- ### `useViewingKey()` (stub)
106
+ ### `useViewingKey()`
76
107
 
77
- Generate and manage viewing keys for compliance. Full implementation coming soon.
108
+ Generate and manage viewing keys for compliance.
78
109
 
79
110
  ```tsx
80
- const { generate, decrypt, share } = useViewingKey()
111
+ const { viewingKey, sharedWith, generate, decrypt, share } = useViewingKey()
112
+
113
+ // Generate a viewing key
114
+ const key = generate()
115
+
116
+ // Share with auditor
117
+ await share('auditor-123')
118
+
119
+ // Decrypt transaction for auditing
120
+ const decrypted = await decrypt(encryptedTransaction)
81
121
  ```
82
122
 
83
123
  ## Configuration
@@ -104,14 +144,14 @@ See [@sip-protocol/sdk](https://github.com/sip-protocol/sip-protocol/tree/main/p
104
144
 
105
145
  ## Development Status
106
146
 
107
- This package is under active development:
147
+ This package is production-ready with full hook implementations:
108
148
 
109
149
  - [x] Provider setup
110
150
  - [x] `useSIP()` hook
111
- - [ ] `useStealthAddress()` implementation
112
- - [ ] `usePrivateSwap()` implementation
113
- - [ ] `useViewingKey()` implementation
114
- - [ ] Additional utility hooks
151
+ - [x] `useStealthAddress()` hook (secp256k1 & ed25519 support)
152
+ - [x] `usePrivateSwap()` hook (full swap lifecycle)
153
+ - [x] `useViewingKey()` hook (compliance-ready)
154
+ - [x] Comprehensive test suite (57 tests)
115
155
 
116
156
  ## Documentation
117
157