@jerydam/lumina-sdk 0.1.0

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 (152) hide show
  1. package/BUTTON_FIXES.md +59 -0
  2. package/DOCS_INDEX.md +332 -0
  3. package/DOCUMENTATION.md +252 -0
  4. package/DOCUMENTATION_BUILD_SUMMARY.md +376 -0
  5. package/DOCUMENTATION_COMPLETE.md +311 -0
  6. package/FEATURES.md +333 -0
  7. package/Lumina-sdk/src/components/lumina-provider.tsx +46 -0
  8. package/Lumina-sdk/src/components/transaction-confirm.tsx +242 -0
  9. package/Lumina-sdk/src/components/wallet-display.tsx +157 -0
  10. package/Lumina-sdk/src/components/wallet-login.tsx +163 -0
  11. package/Lumina-sdk/src/hooks/use-mobile.ts +19 -0
  12. package/Lumina-sdk/src/hooks/use-toast.ts +191 -0
  13. package/Lumina-sdk/src/index.ts +0 -0
  14. package/Lumina-sdk/src/lib/api.ts +66 -0
  15. package/Lumina-sdk/src/lib/utils.ts +6 -0
  16. package/Lumina-sdk/src/package.json +42 -0
  17. package/Lumina-sdk/src/tsconfig.json +19 -0
  18. package/NEW_FILES_MANIFEST.txt +146 -0
  19. package/README.md +298 -0
  20. package/app/dashboard/analytics/page.tsx +218 -0
  21. package/app/dashboard/api-keys/page.tsx +260 -0
  22. package/app/dashboard/billing/page.tsx +412 -0
  23. package/app/dashboard/integration/page.tsx +185 -0
  24. package/app/dashboard/layout.tsx +18 -0
  25. package/app/dashboard/page.tsx +244 -0
  26. package/app/dashboard/settings/page.tsx +285 -0
  27. package/app/dashboard/users/page.tsx +148 -0
  28. package/app/docs/api/authentication/page.tsx +246 -0
  29. package/app/docs/api/endpoints/page.tsx +397 -0
  30. package/app/docs/api/errors/page.tsx +305 -0
  31. package/app/docs/api/overview/page.tsx +306 -0
  32. package/app/docs/examples/basic-setup/page.tsx +256 -0
  33. package/app/docs/examples/multi-chain/page.tsx +331 -0
  34. package/app/docs/examples/nextjs-full-stack/page.tsx +332 -0
  35. package/app/docs/getting-started/environment-setup/page.tsx +243 -0
  36. package/app/docs/getting-started/installation/page.tsx +187 -0
  37. package/app/docs/getting-started/introduction/page.tsx +178 -0
  38. package/app/docs/getting-started/quick-start/page.tsx +199 -0
  39. package/app/docs/guides/nextjs/page.tsx +358 -0
  40. package/app/docs/guides/react/page.tsx +230 -0
  41. package/app/docs/guides/security/page.tsx +284 -0
  42. package/app/docs/layout.tsx +32 -0
  43. package/app/docs/page.tsx +180 -0
  44. package/app/docs/sdk/lumina-provider/page.tsx +186 -0
  45. package/app/docs/sdk/transaction-confirm/page.tsx +331 -0
  46. package/app/docs/sdk/wallet-display/page.tsx +224 -0
  47. package/app/docs/sdk/wallet-login/page.tsx +207 -0
  48. package/app/docs/troubleshooting/common-issues/page.tsx +301 -0
  49. package/app/docs/troubleshooting/faq/page.tsx +105 -0
  50. package/app/globals.css +125 -0
  51. package/app/invite/[token]/page.tsx +78 -0
  52. package/app/layout.tsx +36 -0
  53. package/app/login/page.tsx +175 -0
  54. package/app/page.tsx +336 -0
  55. package/app/sdk-demo/page.tsx +239 -0
  56. package/components/dashboard-sidebar.tsx +113 -0
  57. package/components/docs/breadcrumb.tsx +51 -0
  58. package/components/docs/callout.tsx +53 -0
  59. package/components/docs/code-block.tsx +77 -0
  60. package/components/docs/docs-sidebar.tsx +214 -0
  61. package/components/docs/table-of-contents.tsx +83 -0
  62. package/components/sdk/lumina-provider.tsx +46 -0
  63. package/components/sdk/transaction-confirm.tsx +242 -0
  64. package/components/sdk/wallet-display.tsx +157 -0
  65. package/components/sdk/wallet-login.tsx +163 -0
  66. package/components/theme-provider.tsx +11 -0
  67. package/components/ui/accordion.tsx +66 -0
  68. package/components/ui/alert-dialog.tsx +157 -0
  69. package/components/ui/alert.tsx +66 -0
  70. package/components/ui/aspect-ratio.tsx +11 -0
  71. package/components/ui/avatar.tsx +53 -0
  72. package/components/ui/badge.tsx +46 -0
  73. package/components/ui/breadcrumb.tsx +109 -0
  74. package/components/ui/button-group.tsx +83 -0
  75. package/components/ui/button.tsx +60 -0
  76. package/components/ui/calendar.tsx +213 -0
  77. package/components/ui/card.tsx +92 -0
  78. package/components/ui/carousel.tsx +241 -0
  79. package/components/ui/chart.tsx +351 -0
  80. package/components/ui/checkbox.tsx +32 -0
  81. package/components/ui/collapsible.tsx +33 -0
  82. package/components/ui/command.tsx +184 -0
  83. package/components/ui/context-menu.tsx +252 -0
  84. package/components/ui/dialog.tsx +143 -0
  85. package/components/ui/drawer.tsx +135 -0
  86. package/components/ui/dropdown-menu.tsx +257 -0
  87. package/components/ui/empty.tsx +104 -0
  88. package/components/ui/field.tsx +244 -0
  89. package/components/ui/form.tsx +167 -0
  90. package/components/ui/hover-card.tsx +44 -0
  91. package/components/ui/input-group.tsx +169 -0
  92. package/components/ui/input-otp.tsx +77 -0
  93. package/components/ui/input.tsx +21 -0
  94. package/components/ui/item.tsx +193 -0
  95. package/components/ui/kbd.tsx +28 -0
  96. package/components/ui/label.tsx +24 -0
  97. package/components/ui/menubar.tsx +276 -0
  98. package/components/ui/navigation-menu.tsx +166 -0
  99. package/components/ui/pagination.tsx +127 -0
  100. package/components/ui/popover.tsx +48 -0
  101. package/components/ui/progress.tsx +31 -0
  102. package/components/ui/radio-group.tsx +45 -0
  103. package/components/ui/resizable.tsx +56 -0
  104. package/components/ui/scroll-area.tsx +58 -0
  105. package/components/ui/select.tsx +185 -0
  106. package/components/ui/separator.tsx +28 -0
  107. package/components/ui/sheet.tsx +139 -0
  108. package/components/ui/sidebar.tsx +726 -0
  109. package/components/ui/skeleton.tsx +13 -0
  110. package/components/ui/slider.tsx +59 -0
  111. package/components/ui/sonner.tsx +25 -0
  112. package/components/ui/spinner.tsx +16 -0
  113. package/components/ui/switch.tsx +29 -0
  114. package/components/ui/table.tsx +116 -0
  115. package/components/ui/tabs.tsx +66 -0
  116. package/components/ui/textarea.tsx +18 -0
  117. package/components/ui/toast.tsx +129 -0
  118. package/components/ui/toaster.tsx +35 -0
  119. package/components/ui/toggle-group.tsx +73 -0
  120. package/components/ui/toggle.tsx +47 -0
  121. package/components/ui/tooltip.tsx +61 -0
  122. package/components/ui/use-mobile.tsx +19 -0
  123. package/components/ui/use-toast.ts +191 -0
  124. package/components.json +21 -0
  125. package/hooks/use-mobile.ts +19 -0
  126. package/hooks/use-toast.ts +191 -0
  127. package/lib/api.ts +66 -0
  128. package/lib/utils.ts +6 -0
  129. package/next-env.d.ts +6 -0
  130. package/next.config.mjs +11 -0
  131. package/package.json +73 -0
  132. package/pnpm-workspace.yaml +5 -0
  133. package/postcss.config.mjs +8 -0
  134. package/public/apple-icon.png +0 -0
  135. package/public/fav.jpeg +0 -0
  136. package/public/fav.png +0 -0
  137. package/public/icon-dark-32x32.png +0 -0
  138. package/public/icon-light-32x32.png +0 -0
  139. package/public/icon.png +0 -0
  140. package/public/icon.svg +26 -0
  141. package/public/logo.jpeg +0 -0
  142. package/public/logo.png +0 -0
  143. package/public/logo2.jpeg +0 -0
  144. package/public/logo2.png +0 -0
  145. package/public/placeholder-logo.png +0 -0
  146. package/public/placeholder-logo.svg +1 -0
  147. package/public/placeholder-user.jpg +0 -0
  148. package/public/placeholder.jpg +0 -0
  149. package/public/placeholder.svg +1 -0
  150. package/styles/globals.css +209 -0
  151. package/tailwind.config.ts +15 -0
  152. package/tsconfig.json +41 -0
@@ -0,0 +1,331 @@
1
+ 'use client'
2
+
3
+ import { Breadcrumb } from '@/components/docs/breadcrumb'
4
+ import { TableOfContents } from '@/components/docs/table-of-contents'
5
+ import { CodeBlock } from '@/components/docs/code-block'
6
+ import { Callout } from '@/components/docs/callout'
7
+
8
+ export default function TransactionConfirmPage() {
9
+ const headings = [
10
+ { id: 'overview', level: 2, text: 'Overview' },
11
+ { id: 'props', level: 2, text: 'Props & Configuration' },
12
+ { id: 'callbacks', level: 2, text: 'Callbacks' },
13
+ { id: 'transaction-flow', level: 2, text: 'Transaction Flow' },
14
+ { id: 'examples', level: 2, text: 'Examples' },
15
+ { id: 'error-handling', level: 2, text: 'Error Handling' },
16
+ ]
17
+
18
+ return (
19
+ <div className="flex gap-8 max-w-7xl mx-auto px-4 py-8">
20
+ <main className="flex-1 min-w-0">
21
+ <Breadcrumb
22
+ items={[
23
+ { label: 'Docs', href: '/docs' },
24
+ { label: 'SDK', href: '/docs/sdk/lumina-provider' },
25
+ { label: 'TransactionConfirm' },
26
+ ]}
27
+ />
28
+
29
+ <div className="mt-8 prose prose-invert max-w-none">
30
+ <h1>TransactionConfirm Component</h1>
31
+
32
+ <p className="text-lg text-foreground/80">
33
+ A secure transaction confirmation component that handles user review and approval of blockchain transactions before execution.
34
+ </p>
35
+
36
+ <h2 id="overview">Overview</h2>
37
+ <p>
38
+ The <code>TransactionConfirm</code> component provides a modal interface for users to review transaction details before confirmation. It handles gas estimates, fee calculations, and secure confirmation workflows.
39
+ </p>
40
+
41
+ <CodeBlock
42
+ code={`import { TransactionConfirm } from '@lumina/react'
43
+
44
+ export default function MyComponent() {
45
+ return (
46
+ <TransactionConfirm
47
+ transactionId="txn_123abc"
48
+ amount="1.5"
49
+ recipient="0x742d35Cc6634C0532925a3b844Bc9e7595f42e0d"
50
+ onConfirm={() => console.log('Confirmed')}
51
+ onCancel={() => console.log('Cancelled')}
52
+ />
53
+ )
54
+ }`}
55
+ language="typescript"
56
+ title="Basic Usage"
57
+ />
58
+
59
+ <h2 id="props">Props & Configuration</h2>
60
+
61
+ <h3>Required Props</h3>
62
+ <CodeBlock
63
+ code={`interface TransactionConfirmProps {
64
+ // Transaction identifier
65
+ transactionId: string
66
+
67
+ // Amount to send (in token units)
68
+ amount: string
69
+
70
+ // Recipient wallet address
71
+ recipient: string
72
+
73
+ // Token symbol (e.g., 'ETH', 'USDC')
74
+ tokenSymbol?: string
75
+
76
+ // Transaction type
77
+ type?: 'send' | 'swap' | 'stake' | 'contract'
78
+ }`}
79
+ language="typescript"
80
+ title="Required Props"
81
+ />
82
+
83
+ <h3>Optional Props</h3>
84
+ <CodeBlock
85
+ code={`interface TransactionConfirmProps {
86
+ // Gas settings
87
+ gasLimit?: string
88
+ gasPrice?: string
89
+ maxFeePerGas?: string
90
+ maxPriorityFeePerGas?: string
91
+
92
+ // Network
93
+ chainId?: number
94
+ networkName?: string
95
+
96
+ // Display options
97
+ showGasDetails?: boolean
98
+ showEstimatedTime?: boolean
99
+ theme?: 'light' | 'dark'
100
+
101
+ // Validation
102
+ maxSlippage?: number
103
+ skipValidation?: boolean
104
+
105
+ // Metadata
106
+ metadata?: Record<string, any>
107
+ }`}
108
+ language="typescript"
109
+ title="Optional Props"
110
+ />
111
+
112
+ <h2 id="callbacks">Callbacks</h2>
113
+
114
+ <CodeBlock
115
+ code={`interface TransactionConfirmProps {
116
+ // Called when user confirms transaction
117
+ onConfirm: (confirmationData: {
118
+ transactionId: string
119
+ hash: string
120
+ signature: string
121
+ timestamp: number
122
+ }) => void | Promise<void>
123
+
124
+ // Called when user cancels
125
+ onCancel: () => void
126
+
127
+ // Called on error
128
+ onError?: (error: {
129
+ code: string
130
+ message: string
131
+ }) => void
132
+
133
+ // Called when transaction completes
134
+ onComplete?: (receipt: {
135
+ hash: string
136
+ blockNumber: number
137
+ gasUsed: string
138
+ status: 'success' | 'failed'
139
+ }) => void
140
+ }`}
141
+ language="typescript"
142
+ title="Callback Functions"
143
+ />
144
+
145
+ <h2 id="transaction-flow">Transaction Flow</h2>
146
+
147
+ <p>
148
+ The TransactionConfirm component follows a specific flow:
149
+ </p>
150
+
151
+ <CodeBlock
152
+ code={`1. User initiates transaction
153
+
154
+ 2. TransactionConfirm modal opens
155
+
156
+ 3. Display transaction details:
157
+ - From/To addresses
158
+ - Amount and token
159
+ - Network info
160
+ - Gas fees
161
+ - Estimated time
162
+
163
+ 4. User reviews and clicks "Confirm"
164
+
165
+ 5. Component signs transaction
166
+
167
+ 6. onConfirm callback invoked
168
+
169
+ 7. Transaction submitted to network
170
+
171
+ 8. onComplete callback invoked`}
172
+ language="text"
173
+ title="Transaction Lifecycle"
174
+ />
175
+
176
+ <h2 id="examples">Examples</h2>
177
+
178
+ <h3>Basic ETH Transfer</h3>
179
+ <CodeBlock
180
+ code={`'use client'
181
+
182
+ import { useState } from 'react'
183
+ import { TransactionConfirm } from '@lumina/react'
184
+
185
+ export default function TransferETH() {
186
+ const [txId, setTxId] = useState(null)
187
+ const [status, setStatus] = useState('idle')
188
+
189
+ const handleConfirm = async (confirmationData) => {
190
+ setStatus('confirming')
191
+ try {
192
+ const response = await fetch('/api/confirm-transaction', {
193
+ method: 'POST',
194
+ body: JSON.stringify(confirmationData),
195
+ })
196
+ setStatus('success')
197
+ } catch (error) {
198
+ setStatus('error')
199
+ }
200
+ }
201
+
202
+ return (
203
+ <TransactionConfirm
204
+ transactionId={txId}
205
+ amount="2.5"
206
+ recipient="0x742d35Cc6634C0532925a3b844Bc9e7595f42e0d"
207
+ tokenSymbol="ETH"
208
+ chainId={1}
209
+ onConfirm={handleConfirm}
210
+ onCancel={() => setTxId(null)}
211
+ />
212
+ )
213
+ }`}
214
+ language="typescript"
215
+ title="ETH Transfer Example"
216
+ />
217
+
218
+ <h3>Token Swap with Gas Details</h3>
219
+ <CodeBlock
220
+ code={`<TransactionConfirm
221
+ transactionId="txn_swap_123"
222
+ amount="100"
223
+ recipient="0x1111111254fb6c44bac0bed2854e76f90643097d"
224
+ tokenSymbol="USDC"
225
+ type="swap"
226
+ chainId={1}
227
+ showGasDetails={true}
228
+ showEstimatedTime={true}
229
+ maxSlippage={0.5}
230
+ onConfirm={async (data) => {
231
+ console.log('Swap confirmed:', data)
232
+ const tx = await submitSwap(data)
233
+ console.log('Swap hash:', tx.hash)
234
+ }}
235
+ onError={(error) => {
236
+ console.error('Swap error:', error.message)
237
+ }}
238
+ onComplete={(receipt) => {
239
+ console.log('Swap complete:', receipt.status)
240
+ }}
241
+ />`}
242
+ language="typescript"
243
+ title="Swap with Gas Details"
244
+ />
245
+
246
+ <h3>Staking with Contract Interaction</h3>
247
+ <CodeBlock
248
+ code={`<TransactionConfirm
249
+ transactionId="txn_stake_456"
250
+ amount="10"
251
+ recipient="0x1234567890123456789012345678901234567890"
252
+ type="contract"
253
+ chainId={1}
254
+ metadata={{
255
+ contractMethod: 'stake',
256
+ stakingPeriod: '30days',
257
+ expectedYield: '12.5%',
258
+ }}
259
+ onConfirm={async (confirmationData) => {
260
+ // Handle stake confirmation
261
+ const stakeTx = await stakeTokens(confirmationData)
262
+ console.log('Staking initiated:', stakeTx.hash)
263
+ }}
264
+ />`}
265
+ language="typescript"
266
+ title="Contract Interaction"
267
+ />
268
+
269
+ <h2 id="error-handling">Error Handling</h2>
270
+
271
+ <p>
272
+ Handle various error scenarios:
273
+ </p>
274
+
275
+ <CodeBlock
276
+ code={`<TransactionConfirm
277
+ transactionId={txId}
278
+ amount="1.0"
279
+ recipient={recipientAddress}
280
+ onConfirm={handleConfirm}
281
+ onError={(error) => {
282
+ switch (error.code) {
283
+ case 'INSUFFICIENT_BALANCE':
284
+ console.error('User has insufficient balance')
285
+ break
286
+ case 'INVALID_RECIPIENT':
287
+ console.error('Invalid recipient address')
288
+ break
289
+ case 'GAS_ESTIMATION_FAILED':
290
+ console.error('Failed to estimate gas')
291
+ break
292
+ case 'SIGNATURE_REJECTED':
293
+ console.error('User rejected signature request')
294
+ break
295
+ case 'NETWORK_ERROR':
296
+ console.error('Network connectivity issue')
297
+ break
298
+ default:
299
+ console.error('Unknown error:', error.message)
300
+ }
301
+ }}
302
+ />`}
303
+ language="typescript"
304
+ title="Error Handling"
305
+ />
306
+
307
+ <Callout type="info">
308
+ TransactionConfirm automatically handles gas estimation and fee calculation for the selected network.
309
+ </Callout>
310
+
311
+ <Callout type="warning">
312
+ Always wait for the onConfirm callback before submitting the transaction. Never bypass the confirmation step.
313
+ </Callout>
314
+ </div>
315
+
316
+ <div className="flex justify-between mt-12 pt-8 border-t border-white/10">
317
+ <a href="/docs/sdk/wallet-display" className="text-emerald-400 hover:text-emerald-300">
318
+ ← Wallet Display
319
+ </a>
320
+ <a href="/docs/api/overview" className="text-emerald-400 hover:text-emerald-300">
321
+ API Overview →
322
+ </a>
323
+ </div>
324
+ </main>
325
+
326
+ <aside className="hidden lg:block w-64 flex-shrink-0">
327
+ <TableOfContents headings={headings} />
328
+ </aside>
329
+ </div>
330
+ )
331
+ }
@@ -0,0 +1,224 @@
1
+ import { Breadcrumb } from '@/components/docs/breadcrumb'
2
+ import { CodeBlock } from '@/components/docs/code-block'
3
+ import { Callout } from '@/components/docs/callout'
4
+
5
+ export const metadata = {
6
+ title: 'WalletDisplay - SDK Reference',
7
+ description: 'Show wallet details and enable send/receive with WalletDisplay.',
8
+ }
9
+
10
+ export default function WalletDisplayPage() {
11
+ return (
12
+ <>
13
+ <Breadcrumb />
14
+
15
+ <div className="space-y-8">
16
+ <div className="space-y-4">
17
+ <h1 className="text-4xl font-bold text-white">WalletDisplay</h1>
18
+ <p className="text-lg text-foreground/80">
19
+ Display wallet information including balance, address, and allow users to send or receive funds. Includes copy-to-clipboard and address explorer links.
20
+ </p>
21
+ </div>
22
+
23
+ <div className="space-y-4">
24
+ <h2 className="text-2xl font-bold">Basic Usage</h2>
25
+ <CodeBlock
26
+ code={`'use client'
27
+
28
+ import { WalletDisplay } from '@lumina/sdk'
29
+
30
+ export default function WalletPage() {
31
+ return (
32
+ <WalletDisplay
33
+ address="0x742d35Cc6634C0532925a3b844Bc1e8181f42f9f"
34
+ balance="5.234"
35
+ network="ethereum"
36
+ />
37
+ )
38
+ }`}
39
+ language="tsx"
40
+ />
41
+ </div>
42
+
43
+ <div className="space-y-4">
44
+ <h2 className="text-2xl font-bold">Props</h2>
45
+ <div className="space-y-4">
46
+ <div className="p-4 rounded-lg bg-white/5 border border-white/10">
47
+ <p className="font-semibold text-emerald-400 mb-2">address</p>
48
+ <p className="text-sm text-foreground/80 mb-2">
49
+ <span className="text-red-400">Required</span> • <span className="text-blue-400">string</span>
50
+ </p>
51
+ <p className="text-sm text-foreground/80">
52
+ The wallet address to display. Should be a valid Ethereum address.
53
+ </p>
54
+ </div>
55
+
56
+ <div className="p-4 rounded-lg bg-white/5 border border-white/10">
57
+ <p className="font-semibold text-emerald-400 mb-2">balance</p>
58
+ <p className="text-sm text-foreground/80 mb-2">
59
+ <span className="text-red-400">Required</span> • <span className="text-blue-400">string | number</span>
60
+ </p>
61
+ <p className="text-sm text-foreground/80">
62
+ The account balance in native currency (ETH, MATIC, etc).
63
+ </p>
64
+ </div>
65
+
66
+ <div className="p-4 rounded-lg bg-white/5 border border-white/10">
67
+ <p className="font-semibold text-emerald-400 mb-2">network</p>
68
+ <p className="text-sm text-foreground/80 mb-2">
69
+ <span className="text-red-400">Required</span> • <span className="text-blue-400">'ethereum' | 'polygon' | 'arbitrum' | 'optimism'</span>
70
+ </p>
71
+ <p className="text-sm text-foreground/80">
72
+ The blockchain network. Used for explorer links and asset prices.
73
+ </p>
74
+ </div>
75
+
76
+ <div className="p-4 rounded-lg bg-white/5 border border-white/10">
77
+ <p className="font-semibold text-emerald-400 mb-2">onSend</p>
78
+ <p className="text-sm text-foreground/80 mb-2">
79
+ <span className="text-green-400">Optional</span> • <span className="text-blue-400">() =&gt; void</span>
80
+ </p>
81
+ <p className="text-sm text-foreground/80">
82
+ Callback when the "Send" button is clicked.
83
+ </p>
84
+ </div>
85
+
86
+ <div className="p-4 rounded-lg bg-white/5 border border-white/10">
87
+ <p className="font-semibold text-emerald-400 mb-2">onReceive</p>
88
+ <p className="text-sm text-foreground/80 mb-2">
89
+ <span className="text-green-400">Optional</span> • <span className="text-blue-400">() =&gt; void</span>
90
+ </p>
91
+ <p className="text-sm text-foreground/80">
92
+ Callback when the "Receive" button is clicked.
93
+ </p>
94
+ </div>
95
+
96
+ <div className="p-4 rounded-lg bg-white/5 border border-white/10">
97
+ <p className="font-semibold text-emerald-400 mb-2">showTokens</p>
98
+ <p className="text-sm text-foreground/80 mb-2">
99
+ <span className="text-green-400">Optional</span> • <span className="text-blue-400">boolean</span>
100
+ </p>
101
+ <p className="text-sm text-foreground/80">
102
+ Show list of ERC-20 tokens. Defaults to true.
103
+ </p>
104
+ </div>
105
+ </div>
106
+ </div>
107
+
108
+ <div className="space-y-4">
109
+ <h2 className="text-2xl font-bold">With Callbacks</h2>
110
+ <CodeBlock
111
+ code={`<WalletDisplay
112
+ address="0x742d35Cc6634C0532925a3b844Bc1e8181f42f9f"
113
+ balance="5.234"
114
+ network="ethereum"
115
+ showTokens={true}
116
+ onSend={() => {
117
+ console.log('Send button clicked')
118
+ // Open send modal or navigate
119
+ }}
120
+ onReceive={() => {
121
+ console.log('Receive button clicked')
122
+ // Show QR code or copy address
123
+ }}
124
+ />`}
125
+ language="tsx"
126
+ />
127
+ </div>
128
+
129
+ <div className="space-y-4">
130
+ <h2 className="text-2xl font-bold">Full Example with Sending</h2>
131
+ <CodeBlock
132
+ code={`'use client'
133
+
134
+ import { useState } from 'react'
135
+ import { WalletDisplay, TransactionConfirm } from '@lumina/sdk'
136
+
137
+ export default function WalletPage() {
138
+ const [showSendModal, setShowSendModal] = useState(false)
139
+ const [recipient, setRecipient] = useState('')
140
+
141
+ return (
142
+ <div className="p-8 space-y-6">
143
+ <WalletDisplay
144
+ address="0x742d35Cc6634C0532925a3b844Bc1e8181f42f9f"
145
+ balance="5.234"
146
+ network="ethereum"
147
+ onSend={() => setShowSendModal(true)}
148
+ />
149
+
150
+ {showSendModal && (
151
+ <div className="fixed inset-0 bg-black/50 flex items-center justify-center">
152
+ <div className="bg-card p-6 rounded-lg max-w-md">
153
+ <h2 className="text-xl font-bold mb-4">Send ETH</h2>
154
+ <input
155
+ type="text"
156
+ placeholder="Recipient address"
157
+ value={recipient}
158
+ onChange={(e) => setRecipient(e.target.value)}
159
+ className="w-full px-4 py-2 rounded-lg bg-white/10 border border-white/20 mb-4"
160
+ />
161
+ <button
162
+ onClick={() => setShowSendModal(false)}
163
+ className="w-full px-4 py-2 bg-emerald-600 rounded-lg hover:bg-emerald-700"
164
+ >
165
+ Proceed
166
+ </button>
167
+ </div>
168
+ </div>
169
+ )}
170
+ </div>
171
+ )
172
+ }`}
173
+ language="tsx"
174
+ />
175
+ </div>
176
+
177
+ <div className="space-y-4">
178
+ <h2 className="text-2xl font-bold">Supported Networks</h2>
179
+ <div className="grid grid-cols-2 gap-4">
180
+ {[
181
+ { name: 'Ethereum', id: 'ethereum' },
182
+ { name: 'Polygon', id: 'polygon' },
183
+ { name: 'Arbitrum', id: 'arbitrum' },
184
+ { name: 'Optimism', id: 'optimism' },
185
+ { name: 'Base', id: 'base' },
186
+ { name: 'Avalanche', id: 'avalanche' },
187
+ ].map((network) => (
188
+ <div key={network.id} className="p-3 rounded-lg bg-white/5 border border-white/10">
189
+ <p className="font-semibold text-emerald-400">{network.name}</p>
190
+ <p className="text-xs text-foreground/60">{network.id}</p>
191
+ </div>
192
+ ))}
193
+ </div>
194
+ </div>
195
+
196
+ <Callout type="info" title="Token List Updates">
197
+ The token list is automatically updated every 24 hours. For a fresh list, call the <code className="bg-black/40 px-2 py-1 rounded text-xs">refreshTokens()</code> method.
198
+ </Callout>
199
+
200
+ <div className="space-y-4">
201
+ <h2 className="text-2xl font-bold">Customizing Display</h2>
202
+ <CodeBlock
203
+ code={`// Hide tokens for a minimal display
204
+ <WalletDisplay
205
+ address={address}
206
+ balance={balance}
207
+ network="ethereum"
208
+ showTokens={false}
209
+ />
210
+
211
+ // Always show all tokens
212
+ <WalletDisplay
213
+ address={address}
214
+ balance={balance}
215
+ network="ethereum"
216
+ showTokens={true}
217
+ />`}
218
+ language="tsx"
219
+ />
220
+ </div>
221
+ </div>
222
+ </>
223
+ )
224
+ }