@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.
- package/BUTTON_FIXES.md +59 -0
- package/DOCS_INDEX.md +332 -0
- package/DOCUMENTATION.md +252 -0
- package/DOCUMENTATION_BUILD_SUMMARY.md +376 -0
- package/DOCUMENTATION_COMPLETE.md +311 -0
- package/FEATURES.md +333 -0
- package/Lumina-sdk/src/components/lumina-provider.tsx +46 -0
- package/Lumina-sdk/src/components/transaction-confirm.tsx +242 -0
- package/Lumina-sdk/src/components/wallet-display.tsx +157 -0
- package/Lumina-sdk/src/components/wallet-login.tsx +163 -0
- package/Lumina-sdk/src/hooks/use-mobile.ts +19 -0
- package/Lumina-sdk/src/hooks/use-toast.ts +191 -0
- package/Lumina-sdk/src/index.ts +0 -0
- package/Lumina-sdk/src/lib/api.ts +66 -0
- package/Lumina-sdk/src/lib/utils.ts +6 -0
- package/Lumina-sdk/src/package.json +42 -0
- package/Lumina-sdk/src/tsconfig.json +19 -0
- package/NEW_FILES_MANIFEST.txt +146 -0
- package/README.md +298 -0
- package/app/dashboard/analytics/page.tsx +218 -0
- package/app/dashboard/api-keys/page.tsx +260 -0
- package/app/dashboard/billing/page.tsx +412 -0
- package/app/dashboard/integration/page.tsx +185 -0
- package/app/dashboard/layout.tsx +18 -0
- package/app/dashboard/page.tsx +244 -0
- package/app/dashboard/settings/page.tsx +285 -0
- package/app/dashboard/users/page.tsx +148 -0
- package/app/docs/api/authentication/page.tsx +246 -0
- package/app/docs/api/endpoints/page.tsx +397 -0
- package/app/docs/api/errors/page.tsx +305 -0
- package/app/docs/api/overview/page.tsx +306 -0
- package/app/docs/examples/basic-setup/page.tsx +256 -0
- package/app/docs/examples/multi-chain/page.tsx +331 -0
- package/app/docs/examples/nextjs-full-stack/page.tsx +332 -0
- package/app/docs/getting-started/environment-setup/page.tsx +243 -0
- package/app/docs/getting-started/installation/page.tsx +187 -0
- package/app/docs/getting-started/introduction/page.tsx +178 -0
- package/app/docs/getting-started/quick-start/page.tsx +199 -0
- package/app/docs/guides/nextjs/page.tsx +358 -0
- package/app/docs/guides/react/page.tsx +230 -0
- package/app/docs/guides/security/page.tsx +284 -0
- package/app/docs/layout.tsx +32 -0
- package/app/docs/page.tsx +180 -0
- package/app/docs/sdk/lumina-provider/page.tsx +186 -0
- package/app/docs/sdk/transaction-confirm/page.tsx +331 -0
- package/app/docs/sdk/wallet-display/page.tsx +224 -0
- package/app/docs/sdk/wallet-login/page.tsx +207 -0
- package/app/docs/troubleshooting/common-issues/page.tsx +301 -0
- package/app/docs/troubleshooting/faq/page.tsx +105 -0
- package/app/globals.css +125 -0
- package/app/invite/[token]/page.tsx +78 -0
- package/app/layout.tsx +36 -0
- package/app/login/page.tsx +175 -0
- package/app/page.tsx +336 -0
- package/app/sdk-demo/page.tsx +239 -0
- package/components/dashboard-sidebar.tsx +113 -0
- package/components/docs/breadcrumb.tsx +51 -0
- package/components/docs/callout.tsx +53 -0
- package/components/docs/code-block.tsx +77 -0
- package/components/docs/docs-sidebar.tsx +214 -0
- package/components/docs/table-of-contents.tsx +83 -0
- package/components/sdk/lumina-provider.tsx +46 -0
- package/components/sdk/transaction-confirm.tsx +242 -0
- package/components/sdk/wallet-display.tsx +157 -0
- package/components/sdk/wallet-login.tsx +163 -0
- package/components/theme-provider.tsx +11 -0
- package/components/ui/accordion.tsx +66 -0
- package/components/ui/alert-dialog.tsx +157 -0
- package/components/ui/alert.tsx +66 -0
- package/components/ui/aspect-ratio.tsx +11 -0
- package/components/ui/avatar.tsx +53 -0
- package/components/ui/badge.tsx +46 -0
- package/components/ui/breadcrumb.tsx +109 -0
- package/components/ui/button-group.tsx +83 -0
- package/components/ui/button.tsx +60 -0
- package/components/ui/calendar.tsx +213 -0
- package/components/ui/card.tsx +92 -0
- package/components/ui/carousel.tsx +241 -0
- package/components/ui/chart.tsx +351 -0
- package/components/ui/checkbox.tsx +32 -0
- package/components/ui/collapsible.tsx +33 -0
- package/components/ui/command.tsx +184 -0
- package/components/ui/context-menu.tsx +252 -0
- package/components/ui/dialog.tsx +143 -0
- package/components/ui/drawer.tsx +135 -0
- package/components/ui/dropdown-menu.tsx +257 -0
- package/components/ui/empty.tsx +104 -0
- package/components/ui/field.tsx +244 -0
- package/components/ui/form.tsx +167 -0
- package/components/ui/hover-card.tsx +44 -0
- package/components/ui/input-group.tsx +169 -0
- package/components/ui/input-otp.tsx +77 -0
- package/components/ui/input.tsx +21 -0
- package/components/ui/item.tsx +193 -0
- package/components/ui/kbd.tsx +28 -0
- package/components/ui/label.tsx +24 -0
- package/components/ui/menubar.tsx +276 -0
- package/components/ui/navigation-menu.tsx +166 -0
- package/components/ui/pagination.tsx +127 -0
- package/components/ui/popover.tsx +48 -0
- package/components/ui/progress.tsx +31 -0
- package/components/ui/radio-group.tsx +45 -0
- package/components/ui/resizable.tsx +56 -0
- package/components/ui/scroll-area.tsx +58 -0
- package/components/ui/select.tsx +185 -0
- package/components/ui/separator.tsx +28 -0
- package/components/ui/sheet.tsx +139 -0
- package/components/ui/sidebar.tsx +726 -0
- package/components/ui/skeleton.tsx +13 -0
- package/components/ui/slider.tsx +59 -0
- package/components/ui/sonner.tsx +25 -0
- package/components/ui/spinner.tsx +16 -0
- package/components/ui/switch.tsx +29 -0
- package/components/ui/table.tsx +116 -0
- package/components/ui/tabs.tsx +66 -0
- package/components/ui/textarea.tsx +18 -0
- package/components/ui/toast.tsx +129 -0
- package/components/ui/toaster.tsx +35 -0
- package/components/ui/toggle-group.tsx +73 -0
- package/components/ui/toggle.tsx +47 -0
- package/components/ui/tooltip.tsx +61 -0
- package/components/ui/use-mobile.tsx +19 -0
- package/components/ui/use-toast.ts +191 -0
- package/components.json +21 -0
- package/hooks/use-mobile.ts +19 -0
- package/hooks/use-toast.ts +191 -0
- package/lib/api.ts +66 -0
- package/lib/utils.ts +6 -0
- package/next-env.d.ts +6 -0
- package/next.config.mjs +11 -0
- package/package.json +73 -0
- package/pnpm-workspace.yaml +5 -0
- package/postcss.config.mjs +8 -0
- package/public/apple-icon.png +0 -0
- package/public/fav.jpeg +0 -0
- package/public/fav.png +0 -0
- package/public/icon-dark-32x32.png +0 -0
- package/public/icon-light-32x32.png +0 -0
- package/public/icon.png +0 -0
- package/public/icon.svg +26 -0
- package/public/logo.jpeg +0 -0
- package/public/logo.png +0 -0
- package/public/logo2.jpeg +0 -0
- package/public/logo2.png +0 -0
- package/public/placeholder-logo.png +0 -0
- package/public/placeholder-logo.svg +1 -0
- package/public/placeholder-user.jpg +0 -0
- package/public/placeholder.jpg +0 -0
- package/public/placeholder.svg +1 -0
- package/styles/globals.css +209 -0
- package/tailwind.config.ts +15 -0
- package/tsconfig.json +41 -0
|
@@ -0,0 +1,207 @@
|
|
|
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: 'WalletLogin - SDK Reference',
|
|
7
|
+
description: 'Add authentication to your app with the WalletLogin component.',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function WalletLoginPage() {
|
|
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">WalletLogin</h1>
|
|
18
|
+
<p className="text-lg text-foreground/80">
|
|
19
|
+
A complete authentication component supporting email, passkeys, and social login. Handles user registration and login flows automatically.
|
|
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 { WalletLogin } from '@lumina/sdk'
|
|
29
|
+
|
|
30
|
+
export default function LoginPage() {
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex items-center justify-center min-h-screen">
|
|
33
|
+
<WalletLogin
|
|
34
|
+
onSuccess={(user) => {
|
|
35
|
+
console.log('User logged in:', user)
|
|
36
|
+
// Redirect or update state
|
|
37
|
+
}}
|
|
38
|
+
onError={(error) => {
|
|
39
|
+
console.error('Login error:', error)
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}`}
|
|
45
|
+
language="tsx"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div className="space-y-4">
|
|
50
|
+
<h2 className="text-2xl font-bold">Props</h2>
|
|
51
|
+
<div className="space-y-4">
|
|
52
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
53
|
+
<p className="font-semibold text-emerald-400 mb-2">onSuccess</p>
|
|
54
|
+
<p className="text-sm text-foreground/80 mb-2">
|
|
55
|
+
<span className="text-red-400">Required</span> • <span className="text-blue-400">(user: User) => void</span>
|
|
56
|
+
</p>
|
|
57
|
+
<p className="text-sm text-foreground/80">
|
|
58
|
+
Callback when authentication is successful.
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
63
|
+
<p className="font-semibold text-emerald-400 mb-2">onError</p>
|
|
64
|
+
<p className="text-sm text-foreground/80 mb-2">
|
|
65
|
+
<span className="text-green-400">Optional</span> • <span className="text-blue-400">(error: Error) => void</span>
|
|
66
|
+
</p>
|
|
67
|
+
<p className="text-sm text-foreground/80">
|
|
68
|
+
Callback when authentication fails.
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
73
|
+
<p className="font-semibold text-emerald-400 mb-2">authMethods</p>
|
|
74
|
+
<p className="text-sm text-foreground/80 mb-2">
|
|
75
|
+
<span className="text-green-400">Optional</span> • <span className="text-blue-400">('email' | 'passkey' | 'google' | 'discord')[]</span>
|
|
76
|
+
</p>
|
|
77
|
+
<p className="text-sm text-foreground/80 mb-3">
|
|
78
|
+
Authentication methods to display. All supported by default.
|
|
79
|
+
</p>
|
|
80
|
+
<CodeBlock
|
|
81
|
+
code={`<WalletLogin
|
|
82
|
+
authMethods={['email', 'passkey']}
|
|
83
|
+
onSuccess={handleSuccess}
|
|
84
|
+
/>`}
|
|
85
|
+
language="tsx"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
90
|
+
<p className="font-semibold text-emerald-400 mb-2">redirectUrl</p>
|
|
91
|
+
<p className="text-sm text-foreground/80 mb-2">
|
|
92
|
+
<span className="text-green-400">Optional</span> • <span className="text-blue-400">string</span>
|
|
93
|
+
</p>
|
|
94
|
+
<p className="text-sm text-foreground/80">
|
|
95
|
+
URL to redirect to after successful login. If not provided, uses onSuccess callback only.
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
100
|
+
<p className="font-semibold text-emerald-400 mb-2">className</p>
|
|
101
|
+
<p className="text-sm text-foreground/80 mb-2">
|
|
102
|
+
<span className="text-green-400">Optional</span> • <span className="text-blue-400">string</span>
|
|
103
|
+
</p>
|
|
104
|
+
<p className="text-sm text-foreground/80">
|
|
105
|
+
Custom CSS classes to style the component.
|
|
106
|
+
</p>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div className="space-y-4">
|
|
112
|
+
<h2 className="text-2xl font-bold">With Redirect</h2>
|
|
113
|
+
<CodeBlock
|
|
114
|
+
code={`<WalletLogin
|
|
115
|
+
authMethods={['email', 'passkey', 'google']}
|
|
116
|
+
redirectUrl="/dashboard"
|
|
117
|
+
onError={(error) => {
|
|
118
|
+
console.error('Login failed:', error.message)
|
|
119
|
+
}}
|
|
120
|
+
/>`}
|
|
121
|
+
language="tsx"
|
|
122
|
+
/>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div className="space-y-4">
|
|
126
|
+
<h2 className="text-2xl font-bold">Authentication Methods</h2>
|
|
127
|
+
<p className="text-foreground/80 mb-4">
|
|
128
|
+
WalletLogin supports multiple authentication methods:
|
|
129
|
+
</p>
|
|
130
|
+
<div className="space-y-3">
|
|
131
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
132
|
+
<p className="font-semibold text-foreground mb-2">Email</p>
|
|
133
|
+
<p className="text-sm text-foreground/80">
|
|
134
|
+
Magic link or password-based authentication. Users receive a verification email.
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
139
|
+
<p className="font-semibold text-foreground mb-2">Passkey</p>
|
|
140
|
+
<p className="text-sm text-foreground/80">
|
|
141
|
+
WebAuthn-based passwordless authentication using biometrics or security keys.
|
|
142
|
+
</p>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div className="p-4 rounded-lg bg-white/5 border border-white/10">
|
|
146
|
+
<p className="font-semibold text-foreground mb-2">Social (Google, Discord)</p>
|
|
147
|
+
<p className="text-sm text-foreground/80">
|
|
148
|
+
One-click login using existing social accounts. Requires OAuth configuration.
|
|
149
|
+
</p>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<Callout type="info" title="User Object Structure">
|
|
155
|
+
<CodeBlock
|
|
156
|
+
code={`interface User {
|
|
157
|
+
id: string
|
|
158
|
+
email: string
|
|
159
|
+
walletAddress: string
|
|
160
|
+
balance: string
|
|
161
|
+
authMethod: 'email' | 'passkey' | 'google' | 'discord'
|
|
162
|
+
createdAt: Date
|
|
163
|
+
}`}
|
|
164
|
+
language="typescript"
|
|
165
|
+
/>
|
|
166
|
+
</Callout>
|
|
167
|
+
|
|
168
|
+
<div className="space-y-4">
|
|
169
|
+
<h2 className="text-2xl font-bold">Error Handling</h2>
|
|
170
|
+
<CodeBlock
|
|
171
|
+
code={`<WalletLogin
|
|
172
|
+
onSuccess={(user) => {
|
|
173
|
+
// Handle successful login
|
|
174
|
+
}}
|
|
175
|
+
onError={(error) => {
|
|
176
|
+
if (error.code === 'EMAIL_ALREADY_EXISTS') {
|
|
177
|
+
// Show "Please use login instead" message
|
|
178
|
+
} else if (error.code === 'INVALID_EMAIL') {
|
|
179
|
+
// Show "Invalid email address" message
|
|
180
|
+
} else {
|
|
181
|
+
// Show generic error
|
|
182
|
+
console.error(error)
|
|
183
|
+
}
|
|
184
|
+
}}
|
|
185
|
+
/>`}
|
|
186
|
+
language="tsx"
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div className="space-y-4">
|
|
191
|
+
<h2 className="text-2xl font-bold">Custom Styling</h2>
|
|
192
|
+
<CodeBlock
|
|
193
|
+
code={`<WalletLogin
|
|
194
|
+
onSuccess={handleSuccess}
|
|
195
|
+
className="bg-emerald-900/50 border-2 border-emerald-500"
|
|
196
|
+
/>`}
|
|
197
|
+
language="tsx"
|
|
198
|
+
/>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<Callout type="warning" title="OAuth Setup Required">
|
|
202
|
+
To enable Google and Discord login, you need to configure OAuth credentials in the Lumina dashboard. See the <a href="/docs/guides/security" className="text-emerald-400 hover:underline">Security Guide</a> for details.
|
|
203
|
+
</Callout>
|
|
204
|
+
</div>
|
|
205
|
+
</>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Breadcrumb } from '@/components/docs/breadcrumb'
|
|
4
|
+
import { CodeBlock } from '@/components/docs/code-block'
|
|
5
|
+
import { Callout } from '@/components/docs/callout'
|
|
6
|
+
|
|
7
|
+
export default function CommonIssuesPage() {
|
|
8
|
+
return (
|
|
9
|
+
<div className="flex gap-8 max-w-7xl mx-auto px-4 py-8">
|
|
10
|
+
<main className="flex-1 min-w-0">
|
|
11
|
+
<Breadcrumb
|
|
12
|
+
items={[
|
|
13
|
+
{ label: 'Docs', href: '/docs' },
|
|
14
|
+
{ label: 'Troubleshooting', href: '/docs/troubleshooting/faq' },
|
|
15
|
+
{ label: 'Common Issues' },
|
|
16
|
+
]}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<div className="mt-8 prose prose-invert max-w-none">
|
|
20
|
+
<h1>Common Issues & Solutions</h1>
|
|
21
|
+
|
|
22
|
+
<p className="text-lg text-foreground/80">
|
|
23
|
+
Solutions to frequently encountered problems when using Lumina.
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<h2>Authentication Issues</h2>
|
|
27
|
+
|
|
28
|
+
<h3>Error: "Invalid API Key"</h3>
|
|
29
|
+
<Callout type="error">
|
|
30
|
+
The API key provided is invalid or has expired.
|
|
31
|
+
</Callout>
|
|
32
|
+
|
|
33
|
+
<p>
|
|
34
|
+
<strong>Causes:</strong>
|
|
35
|
+
</p>
|
|
36
|
+
<ul>
|
|
37
|
+
<li>API key is malformed or incomplete</li>
|
|
38
|
+
<li>API key has been revoked</li>
|
|
39
|
+
<li>Using test key in production (or vice versa)</li>
|
|
40
|
+
<li>API key is missing the <code>Bearer</code> prefix</li>
|
|
41
|
+
</ul>
|
|
42
|
+
|
|
43
|
+
<p>
|
|
44
|
+
<strong>Solution:</strong>
|
|
45
|
+
</p>
|
|
46
|
+
<CodeBlock
|
|
47
|
+
code={`// ❌ Wrong
|
|
48
|
+
Authorization: sk_live_abc123...
|
|
49
|
+
|
|
50
|
+
// ✓ Correct
|
|
51
|
+
Authorization: Bearer sk_live_abc123...
|
|
52
|
+
|
|
53
|
+
// Verify your API key
|
|
54
|
+
curl -X GET https://api.lumina.dev/v1/wallets \\
|
|
55
|
+
-H "Authorization: Bearer sk_live_abc123..."`}
|
|
56
|
+
language="bash"
|
|
57
|
+
title="Authorization Format"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<h3>Error: "NEXT_PUBLIC_LUMINA_PUBLIC_KEY is undefined"</h3>
|
|
61
|
+
<p>
|
|
62
|
+
<strong>Cause:</strong> Environment variable not set in your application.
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
<p>
|
|
66
|
+
<strong>Solution:</strong>
|
|
67
|
+
</p>
|
|
68
|
+
<CodeBlock
|
|
69
|
+
code={`# .env.local
|
|
70
|
+
NEXT_PUBLIC_LUMINA_PUBLIC_KEY=pk_live_abc123def456...
|
|
71
|
+
|
|
72
|
+
# After adding, restart your dev server:
|
|
73
|
+
# npm run dev
|
|
74
|
+
|
|
75
|
+
# Verify it's loaded:
|
|
76
|
+
console.log(process.env.NEXT_PUBLIC_LUMINA_PUBLIC_KEY)`}
|
|
77
|
+
language="bash"
|
|
78
|
+
title="Environment Setup"
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
<h2>Wallet Issues</h2>
|
|
82
|
+
|
|
83
|
+
<h3>Error: "INSUFFICIENT_BALANCE"</h3>
|
|
84
|
+
<p>
|
|
85
|
+
<strong>Cause:</strong> Wallet doesn't have enough funds for the transaction.
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
<p>
|
|
89
|
+
<strong>Solution:</strong>
|
|
90
|
+
</p>
|
|
91
|
+
<CodeBlock
|
|
92
|
+
code={`// Check balance before transaction
|
|
93
|
+
const wallet = await fetch(\`/api/wallets/\${walletId}\`)
|
|
94
|
+
const { balance } = wallet.data
|
|
95
|
+
|
|
96
|
+
// Verify sufficient balance
|
|
97
|
+
const required = '1.5'
|
|
98
|
+
if (parseFloat(balance) < parseFloat(required)) {
|
|
99
|
+
console.error('Insufficient balance')
|
|
100
|
+
// Fund the wallet or show error to user
|
|
101
|
+
}`}
|
|
102
|
+
language="typescript"
|
|
103
|
+
title="Balance Check"
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
<h3>Error: "Wallet Not Found"</h3>
|
|
107
|
+
<p>
|
|
108
|
+
<strong>Cause:</strong> Wallet ID is invalid or doesn't exist.
|
|
109
|
+
</p>
|
|
110
|
+
|
|
111
|
+
<p>
|
|
112
|
+
<strong>Solution:</strong>
|
|
113
|
+
</p>
|
|
114
|
+
<CodeBlock
|
|
115
|
+
code={`// List wallets to verify IDs
|
|
116
|
+
const response = await fetch('/api/wallets?user_id=user_123')
|
|
117
|
+
const { wallets } = response.json()
|
|
118
|
+
|
|
119
|
+
console.log('Available wallets:', wallets.map(w => w.id))
|
|
120
|
+
|
|
121
|
+
// Use correct wallet ID
|
|
122
|
+
const correctWalletId = wallets[0].id`}
|
|
123
|
+
language="typescript"
|
|
124
|
+
title="List Wallets"
|
|
125
|
+
/>
|
|
126
|
+
|
|
127
|
+
<h2>Transaction Issues</h2>
|
|
128
|
+
|
|
129
|
+
<h3>Error: "Transaction Failed"</h3>
|
|
130
|
+
<p>
|
|
131
|
+
<strong>Causes:</strong>
|
|
132
|
+
</p>
|
|
133
|
+
<ul>
|
|
134
|
+
<li>Insufficient gas fees</li>
|
|
135
|
+
<li>Network congestion</li>
|
|
136
|
+
<li>Invalid recipient address</li>
|
|
137
|
+
<li>Smart contract revert</li>
|
|
138
|
+
</ul>
|
|
139
|
+
|
|
140
|
+
<p>
|
|
141
|
+
<strong>Solution:</strong>
|
|
142
|
+
</p>
|
|
143
|
+
<CodeBlock
|
|
144
|
+
code={`// Get detailed error information
|
|
145
|
+
const response = await fetch('/api/transactions/txn_123/details')
|
|
146
|
+
const { error, details } = response.json()
|
|
147
|
+
|
|
148
|
+
console.log('Error code:', error.code)
|
|
149
|
+
console.log('Reason:', details.revert_reason)
|
|
150
|
+
|
|
151
|
+
// Retry with higher gas price
|
|
152
|
+
const txResponse = await fetch('/api/transactions', {
|
|
153
|
+
method: 'POST',
|
|
154
|
+
body: JSON.stringify({
|
|
155
|
+
...txData,
|
|
156
|
+
gas_price: '150', // Increase from 100
|
|
157
|
+
}),
|
|
158
|
+
})`}
|
|
159
|
+
language="typescript"
|
|
160
|
+
title="Transaction Details"
|
|
161
|
+
/>
|
|
162
|
+
|
|
163
|
+
<h3>Error: "Gas Estimation Failed"</h3>
|
|
164
|
+
<p>
|
|
165
|
+
<strong>Cause:</strong> Unable to estimate gas for the transaction (usually contract-related).
|
|
166
|
+
</p>
|
|
167
|
+
|
|
168
|
+
<p>
|
|
169
|
+
<strong>Solution:</strong>
|
|
170
|
+
</p>
|
|
171
|
+
<CodeBlock
|
|
172
|
+
code={`// Try with explicit gas limit
|
|
173
|
+
const response = await fetch('/api/transactions', {
|
|
174
|
+
method: 'POST',
|
|
175
|
+
body: JSON.stringify({
|
|
176
|
+
wallet_id: walletId,
|
|
177
|
+
to: recipient,
|
|
178
|
+
amount: '1.0',
|
|
179
|
+
gas_limit: '100000', // Provide explicit gas limit
|
|
180
|
+
skip_gas_estimation: false,
|
|
181
|
+
}),
|
|
182
|
+
})`}
|
|
183
|
+
language="typescript"
|
|
184
|
+
title="Explicit Gas Limit"
|
|
185
|
+
/>
|
|
186
|
+
|
|
187
|
+
<h2>Network Issues</h2>
|
|
188
|
+
|
|
189
|
+
<h3>Error: "Network Error" or Timeout</h3>
|
|
190
|
+
<p>
|
|
191
|
+
<strong>Cause:</strong> Network connectivity issue or API service unavailable.
|
|
192
|
+
</p>
|
|
193
|
+
|
|
194
|
+
<p>
|
|
195
|
+
<strong>Solution:</strong>
|
|
196
|
+
</p>
|
|
197
|
+
<CodeBlock
|
|
198
|
+
code={`// Implement retry logic with exponential backoff
|
|
199
|
+
async function apiCallWithRetry(url, options, attempt = 1) {
|
|
200
|
+
try {
|
|
201
|
+
const response = await fetch(url, {
|
|
202
|
+
...options,
|
|
203
|
+
signal: AbortSignal.timeout(30000), // 30 second timeout
|
|
204
|
+
})
|
|
205
|
+
return response
|
|
206
|
+
} catch (error) {
|
|
207
|
+
if (attempt < 3 && error.name === 'AbortError') {
|
|
208
|
+
const delay = Math.pow(2, attempt - 1) * 1000
|
|
209
|
+
console.log(\`Retry attempt \${attempt} in \${delay}ms\`)
|
|
210
|
+
await new Promise(r => setTimeout(r, delay))
|
|
211
|
+
return apiCallWithRetry(url, options, attempt + 1)
|
|
212
|
+
}
|
|
213
|
+
throw error
|
|
214
|
+
}
|
|
215
|
+
}`}
|
|
216
|
+
language="typescript"
|
|
217
|
+
title="Retry Logic"
|
|
218
|
+
/>
|
|
219
|
+
|
|
220
|
+
<h2>Rate Limiting</h2>
|
|
221
|
+
|
|
222
|
+
<h3>Error: "Rate Limit Exceeded" (429)</h3>
|
|
223
|
+
<p>
|
|
224
|
+
<strong>Cause:</strong> Too many requests in a short period.
|
|
225
|
+
</p>
|
|
226
|
+
|
|
227
|
+
<p>
|
|
228
|
+
<strong>Solution:</strong>
|
|
229
|
+
</p>
|
|
230
|
+
<CodeBlock
|
|
231
|
+
code={`// Check rate limit headers
|
|
232
|
+
const response = await fetch(url)
|
|
233
|
+
|
|
234
|
+
const rateLimit = {
|
|
235
|
+
limit: response.headers.get('X-RateLimit-Limit'),
|
|
236
|
+
remaining: response.headers.get('X-RateLimit-Remaining'),
|
|
237
|
+
reset: response.headers.get('X-RateLimit-Reset'),
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (response.status === 429) {
|
|
241
|
+
const resetTime = parseInt(rateLimit.reset) * 1000
|
|
242
|
+
const waitMs = resetTime - Date.now()
|
|
243
|
+
|
|
244
|
+
console.log(\`Rate limited. Wait \${waitMs}ms until \${new Date(resetTime)}\`)
|
|
245
|
+
|
|
246
|
+
// Wait before retrying
|
|
247
|
+
await new Promise(r => setTimeout(r, waitMs))
|
|
248
|
+
}`}
|
|
249
|
+
language="typescript"
|
|
250
|
+
title="Rate Limit Handling"
|
|
251
|
+
/>
|
|
252
|
+
|
|
253
|
+
<h2>Development Issues</h2>
|
|
254
|
+
|
|
255
|
+
<h3>Hot Reload Not Working</h3>
|
|
256
|
+
<p>
|
|
257
|
+
<strong>Solution:</strong> Restart dev server after changing environment variables.
|
|
258
|
+
</p>
|
|
259
|
+
<CodeBlock
|
|
260
|
+
code={`# Stop the dev server
|
|
261
|
+
Ctrl+C
|
|
262
|
+
|
|
263
|
+
# Restart it
|
|
264
|
+
npm run dev`}
|
|
265
|
+
language="bash"
|
|
266
|
+
title="Restart Dev Server"
|
|
267
|
+
/>
|
|
268
|
+
|
|
269
|
+
<h3>CORS Errors</h3>
|
|
270
|
+
<p>
|
|
271
|
+
<strong>Solution:</strong> Use API routes instead of calling Lumina API directly from client.
|
|
272
|
+
</p>
|
|
273
|
+
<CodeBlock
|
|
274
|
+
code={`// ❌ Wrong - CORS error
|
|
275
|
+
const data = await fetch('https://api.lumina.dev/v1/wallets', {
|
|
276
|
+
headers: { 'Authorization': 'Bearer ...' }
|
|
277
|
+
})
|
|
278
|
+
|
|
279
|
+
// ✓ Correct - Use API route
|
|
280
|
+
const data = await fetch('/api/wallets')`}
|
|
281
|
+
language="typescript"
|
|
282
|
+
title="Avoid CORS"
|
|
283
|
+
/>
|
|
284
|
+
|
|
285
|
+
<Callout type="info">
|
|
286
|
+
Check the request_id in error responses. Include it when contacting support for faster troubleshooting.
|
|
287
|
+
</Callout>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<div className="flex justify-between mt-12 pt-8 border-t border-white/10">
|
|
291
|
+
<a href="/docs/troubleshooting/faq" className="text-emerald-400 hover:text-emerald-300">
|
|
292
|
+
← FAQ
|
|
293
|
+
</a>
|
|
294
|
+
<a href="/docs/guides/security" className="text-emerald-400 hover:text-emerald-300">
|
|
295
|
+
Security Guide →
|
|
296
|
+
</a>
|
|
297
|
+
</div>
|
|
298
|
+
</main>
|
|
299
|
+
</div>
|
|
300
|
+
)
|
|
301
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Breadcrumb } from '@/components/docs/breadcrumb'
|
|
2
|
+
import { Callout } from '@/components/docs/callout'
|
|
3
|
+
|
|
4
|
+
export const metadata = {
|
|
5
|
+
title: 'FAQ - Lumina Documentation',
|
|
6
|
+
description: 'Frequently asked questions about Lumina.',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function FAQPage() {
|
|
10
|
+
const faqs = [
|
|
11
|
+
{
|
|
12
|
+
question: 'What is Lumina?',
|
|
13
|
+
answer:
|
|
14
|
+
'Lumina is an embedded wallet infrastructure that allows developers to integrate secure, user-friendly wallet functionality into their applications without requiring users to install external wallets.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
question: 'Which blockchains does Lumina support?',
|
|
18
|
+
answer:
|
|
19
|
+
'Lumina supports Ethereum, Polygon, Arbitrum, Optimism, Base, Avalanche, and more. You can configure which chains to support in your LuminaProvider configuration.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
question: 'Is Lumina free to use?',
|
|
23
|
+
answer:
|
|
24
|
+
'Lumina offers a free tier for development and testing. Production use requires a paid plan. Check our pricing page for details.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
question: 'How do I get an API key?',
|
|
28
|
+
answer:
|
|
29
|
+
'Sign up for free at our dashboard and create a new API key. You\'ll get both a public key (for client-side use) and a secret key (for server-side use).',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
question: 'Can I use Lumina with Next.js?',
|
|
33
|
+
answer:
|
|
34
|
+
'Absolutely! Lumina works great with Next.js. See our Next.js Integration guide for best practices and setup instructions.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
question: 'What authentication methods does Lumina support?',
|
|
38
|
+
answer:
|
|
39
|
+
'Lumina supports email, passkeys, Google OAuth, and Discord OAuth. You can enable/disable specific methods in your configuration.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
question: 'Is my key secure?',
|
|
43
|
+
answer:
|
|
44
|
+
'Yes. Lumina uses industry-standard encryption and key management practices. Keys are stored securely on our infrastructure and are never exposed.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
question: 'Can I customize the UI components?',
|
|
48
|
+
answer:
|
|
49
|
+
'Yes. All Lumina components support custom styling via CSS classes. You can also use composition to create custom layouts.',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
question: 'How do I test with testnet?',
|
|
53
|
+
answer:
|
|
54
|
+
'Set NEXT_PUBLIC_LUMINA_NETWORK=testnet in your environment variables. Testnet uses Sepolia, Goerli, and other test networks.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
question: 'What\'s the difference between public and secret API keys?',
|
|
58
|
+
answer:
|
|
59
|
+
'Public keys are exposed to clients and should be used in browser code. Secret keys must be kept private and only used server-side. Never expose your secret key.',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
question: 'Can I use Lumina in production?',
|
|
63
|
+
answer:
|
|
64
|
+
'Yes, but you need a production API key with appropriate rate limits and security settings. Contact our sales team for enterprise plans.',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
question: 'How do I handle errors in my integration?',
|
|
68
|
+
answer:
|
|
69
|
+
'All Lumina components support onError callbacks. See our Error Handling guide for best practices.',
|
|
70
|
+
},
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
<Breadcrumb />
|
|
76
|
+
|
|
77
|
+
<div className="space-y-8">
|
|
78
|
+
<div className="space-y-4">
|
|
79
|
+
<h1 className="text-4xl font-bold text-white">Frequently Asked Questions</h1>
|
|
80
|
+
<p className="text-lg text-foreground/80">
|
|
81
|
+
Find answers to common questions about Lumina
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div className="space-y-6">
|
|
86
|
+
{faqs.map((faq, index) => (
|
|
87
|
+
<details key={index} className="group p-6 rounded-lg border border-white/10 hover:border-emerald-600/30 transition-colors cursor-pointer">
|
|
88
|
+
<summary className="flex items-center justify-between font-semibold text-lg text-foreground cursor-pointer">
|
|
89
|
+
<span className="group-open:text-emerald-400">{faq.question}</span>
|
|
90
|
+
<span className="text-2xl text-foreground/50 group-open:text-emerald-400 group-open:rotate-180 transition-transform">
|
|
91
|
+
▶
|
|
92
|
+
</span>
|
|
93
|
+
</summary>
|
|
94
|
+
<p className="mt-4 text-foreground/80">{faq.answer}</p>
|
|
95
|
+
</details>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<Callout type="info" title="Still have questions?">
|
|
100
|
+
If you can't find the answer you're looking for, reach out to our support team at support@lumina.dev or join our Discord community.
|
|
101
|
+
</Callout>
|
|
102
|
+
</div>
|
|
103
|
+
</>
|
|
104
|
+
)
|
|
105
|
+
}
|