@diviswap/sdk 1.7.6
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/LICENSE +21 -0
- package/README.md +510 -0
- package/bin/create-diviswap-app.js +25 -0
- package/bin/diviswap-sdk.js +4 -0
- package/dist/cli/index.js +1888 -0
- package/dist/cli/templates/nextjs-app/actions.ts.hbs +259 -0
- package/dist/cli/templates/nextjs-app/api-hooks.ts.hbs +439 -0
- package/dist/cli/templates/nextjs-app/api-route.ts.hbs +502 -0
- package/dist/cli/templates/nextjs-app/auth-context.tsx.hbs +59 -0
- package/dist/cli/templates/nextjs-app/client.ts.hbs +116 -0
- package/dist/cli/templates/nextjs-app/dashboard-hooks.ts.hbs +180 -0
- package/dist/cli/templates/nextjs-app/example-page.tsx.hbs +276 -0
- package/dist/cli/templates/nextjs-app/hooks.ts.hbs +252 -0
- package/dist/cli/templates/nextjs-app/kyc-hooks.ts.hbs +87 -0
- package/dist/cli/templates/nextjs-app/kyc-wizard.css.hbs +433 -0
- package/dist/cli/templates/nextjs-app/kyc-wizard.tsx.hbs +711 -0
- package/dist/cli/templates/nextjs-app/layout-wrapper.tsx.hbs +13 -0
- package/dist/cli/templates/nextjs-app/layout.tsx.hbs +13 -0
- package/dist/cli/templates/nextjs-app/middleware.ts.hbs +49 -0
- package/dist/cli/templates/nextjs-app/provider-wrapper.tsx.hbs +8 -0
- package/dist/cli/templates/nextjs-app/provider.tsx.hbs +408 -0
- package/dist/cli/templates/nextjs-app/setup-provider.tsx.hbs +25 -0
- package/dist/cli/templates/nextjs-app/types.ts.hbs +159 -0
- package/dist/cli/templates/react/api-client-wrapper.ts.hbs +89 -0
- package/dist/cli/templates/react/example.tsx.hbs +69 -0
- package/dist/cli/templates/react/tanstack-hooks.ts.hbs +185 -0
- package/dist/cli/templates/webhooks/nextjs.hbs +98 -0
- package/dist/index.d.mts +91 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +2339 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2313 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react/index.d.mts +192 -0
- package/dist/react/index.d.ts +192 -0
- package/dist/react/index.js +1083 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +1064 -0
- package/dist/react/index.mjs.map +1 -0
- package/dist/wallet-BEGvzNtB.d.mts +1614 -0
- package/dist/wallet-BEGvzNtB.d.ts +1614 -0
- package/package.json +102 -0
- package/src/cli/templates/index.ts +65 -0
- package/src/cli/templates/nextjs-app/actions.ts.hbs +259 -0
- package/src/cli/templates/nextjs-app/api-hooks.ts.hbs +439 -0
- package/src/cli/templates/nextjs-app/api-route.ts.hbs +502 -0
- package/src/cli/templates/nextjs-app/auth-context.tsx.hbs +59 -0
- package/src/cli/templates/nextjs-app/client.ts.hbs +116 -0
- package/src/cli/templates/nextjs-app/dashboard-hooks.ts.hbs +180 -0
- package/src/cli/templates/nextjs-app/example-page.tsx.hbs +276 -0
- package/src/cli/templates/nextjs-app/hooks.ts.hbs +252 -0
- package/src/cli/templates/nextjs-app/kyc-hooks.ts.hbs +87 -0
- package/src/cli/templates/nextjs-app/kyc-wizard.css.hbs +433 -0
- package/src/cli/templates/nextjs-app/kyc-wizard.tsx.hbs +711 -0
- package/src/cli/templates/nextjs-app/layout-wrapper.tsx.hbs +13 -0
- package/src/cli/templates/nextjs-app/layout.tsx.hbs +13 -0
- package/src/cli/templates/nextjs-app/middleware.ts.hbs +49 -0
- package/src/cli/templates/nextjs-app/provider-wrapper.tsx.hbs +8 -0
- package/src/cli/templates/nextjs-app/provider.tsx.hbs +408 -0
- package/src/cli/templates/nextjs-app/setup-provider.tsx.hbs +25 -0
- package/src/cli/templates/nextjs-app/types.ts.hbs +159 -0
- package/src/cli/templates/react/api-client-wrapper.ts.hbs +89 -0
- package/src/cli/templates/react/example.tsx.hbs +69 -0
- package/src/cli/templates/react/tanstack-hooks.ts.hbs +185 -0
- package/src/cli/templates/shared/client.ts +78 -0
- package/src/cli/templates/webhooks/nextjs.hbs +98 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/* Diviswap KYC Wizard Styles */
|
|
2
|
+
.diviswap-kyc-container {
|
|
3
|
+
max-width: 600px;
|
|
4
|
+
margin: 0 auto;
|
|
5
|
+
padding: 2rem;
|
|
6
|
+
border: 1px solid #e5e7eb;
|
|
7
|
+
border-radius: 12px;
|
|
8
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
9
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Progress Bar */
|
|
13
|
+
.progress-container {
|
|
14
|
+
margin-bottom: 2rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.progress-bar {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 6px;
|
|
20
|
+
background-color: #e5e7eb;
|
|
21
|
+
border-radius: 3px;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
margin-bottom: 0.5rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.progress-fill {
|
|
27
|
+
height: 100%;
|
|
28
|
+
transition: width 0.3s ease;
|
|
29
|
+
border-radius: 3px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.progress-text {
|
|
33
|
+
font-size: 0.875rem;
|
|
34
|
+
color: #6b7280;
|
|
35
|
+
text-align: center;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Step Layout */
|
|
39
|
+
.kyc-step {
|
|
40
|
+
min-height: 400px;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.step-header {
|
|
46
|
+
text-align: center;
|
|
47
|
+
margin-bottom: 2rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.step-header h2 {
|
|
51
|
+
font-size: 1.5rem;
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
margin: 0 0 0.5rem 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.step-header p {
|
|
57
|
+
color: #6b7280;
|
|
58
|
+
margin: 0;
|
|
59
|
+
line-height: 1.5;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.step-icon {
|
|
63
|
+
width: 3rem;
|
|
64
|
+
height: 3rem;
|
|
65
|
+
margin: 0 auto 1rem auto;
|
|
66
|
+
display: block;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.success-icon {
|
|
70
|
+
color: #10b981 !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Forms */
|
|
74
|
+
.step-form {
|
|
75
|
+
flex: 1;
|
|
76
|
+
margin-bottom: 2rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.form-row {
|
|
80
|
+
display: grid;
|
|
81
|
+
grid-template-columns: 1fr 1fr;
|
|
82
|
+
gap: 1rem;
|
|
83
|
+
margin-bottom: 1rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.form-field {
|
|
87
|
+
margin-bottom: 1rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.form-field label {
|
|
91
|
+
display: block;
|
|
92
|
+
font-size: 0.875rem;
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
margin-bottom: 0.25rem;
|
|
95
|
+
color: inherit;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.form-field input,
|
|
99
|
+
.form-field select {
|
|
100
|
+
width: 100%;
|
|
101
|
+
padding: 0.75rem;
|
|
102
|
+
border: 1px solid #d1d5db;
|
|
103
|
+
border-radius: 6px;
|
|
104
|
+
font-size: 1rem;
|
|
105
|
+
background-color: inherit;
|
|
106
|
+
color: inherit;
|
|
107
|
+
transition: border-color 0.2s;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.form-field input:focus,
|
|
111
|
+
.form-field select:focus {
|
|
112
|
+
outline: none;
|
|
113
|
+
border-color: #6366f1;
|
|
114
|
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.date-inputs {
|
|
118
|
+
display: grid;
|
|
119
|
+
grid-template-columns: 2fr 1fr 1fr;
|
|
120
|
+
gap: 0.5rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Buttons */
|
|
124
|
+
.step-actions {
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: space-between;
|
|
127
|
+
gap: 1rem;
|
|
128
|
+
margin-top: auto;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.btn-primary,
|
|
132
|
+
.btn-secondary {
|
|
133
|
+
padding: 0.75rem 1.5rem;
|
|
134
|
+
border-radius: 6px;
|
|
135
|
+
font-size: 1rem;
|
|
136
|
+
font-weight: 500;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
transition: all 0.2s;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
gap: 0.5rem;
|
|
142
|
+
border: none;
|
|
143
|
+
min-width: 120px;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.btn-primary {
|
|
148
|
+
background-color: #6366f1;
|
|
149
|
+
color: white;
|
|
150
|
+
flex: 1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.btn-primary:hover:not(:disabled) {
|
|
154
|
+
transform: translateY(-1px);
|
|
155
|
+
box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.btn-primary:disabled {
|
|
159
|
+
opacity: 0.5;
|
|
160
|
+
cursor: not-allowed;
|
|
161
|
+
transform: none;
|
|
162
|
+
box-shadow: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.btn-secondary {
|
|
166
|
+
background-color: transparent;
|
|
167
|
+
color: #6b7280;
|
|
168
|
+
border: 1px solid #d1d5db;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.btn-secondary:hover {
|
|
172
|
+
background-color: #f9fafb;
|
|
173
|
+
border-color: #9ca3af;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.btn-icon {
|
|
177
|
+
width: 1rem;
|
|
178
|
+
height: 1rem;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.animate-spin {
|
|
182
|
+
animation: spin 1s linear infinite;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@keyframes spin {
|
|
186
|
+
from { transform: rotate(0deg); }
|
|
187
|
+
to { transform: rotate(360deg); }
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Intro Step */
|
|
191
|
+
.verification-info {
|
|
192
|
+
margin: 2rem 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.info-item {
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: flex-start;
|
|
198
|
+
gap: 1rem;
|
|
199
|
+
margin-bottom: 1.5rem;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.info-number {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
width: 2rem;
|
|
207
|
+
height: 2rem;
|
|
208
|
+
background-color: #6366f1;
|
|
209
|
+
color: white;
|
|
210
|
+
border-radius: 50%;
|
|
211
|
+
font-weight: 600;
|
|
212
|
+
font-size: 0.875rem;
|
|
213
|
+
flex-shrink: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.info-item h4 {
|
|
217
|
+
margin: 0 0 0.25rem 0;
|
|
218
|
+
font-size: 1rem;
|
|
219
|
+
font-weight: 600;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.info-item p {
|
|
223
|
+
margin: 0;
|
|
224
|
+
color: #6b7280;
|
|
225
|
+
font-size: 0.875rem;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Review Step */
|
|
229
|
+
.review-sections {
|
|
230
|
+
margin-bottom: 2rem;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.review-section {
|
|
234
|
+
margin-bottom: 1.5rem;
|
|
235
|
+
padding: 1rem;
|
|
236
|
+
background-color: #f9fafb;
|
|
237
|
+
border-radius: 6px;
|
|
238
|
+
border: 1px solid #e5e7eb;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.review-section h3 {
|
|
242
|
+
margin: 0 0 1rem 0;
|
|
243
|
+
font-size: 1.125rem;
|
|
244
|
+
font-weight: 600;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.review-item {
|
|
248
|
+
display: flex;
|
|
249
|
+
justify-content: space-between;
|
|
250
|
+
margin-bottom: 0.5rem;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.review-item:last-child {
|
|
254
|
+
margin-bottom: 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.review-item span:first-child {
|
|
258
|
+
font-weight: 500;
|
|
259
|
+
color: #6b7280;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Success Step */
|
|
263
|
+
.success-info {
|
|
264
|
+
margin: 2rem 0;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.info-box {
|
|
268
|
+
padding: 1.5rem;
|
|
269
|
+
background-color: #f0fdf4;
|
|
270
|
+
border: 1px solid #bbf7d0;
|
|
271
|
+
border-radius: 6px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.info-box h4 {
|
|
275
|
+
margin: 0 0 1rem 0;
|
|
276
|
+
color: #166534;
|
|
277
|
+
font-weight: 600;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.info-box ul {
|
|
281
|
+
margin: 0;
|
|
282
|
+
padding-left: 1.5rem;
|
|
283
|
+
color: #166534;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.info-box li {
|
|
287
|
+
margin-bottom: 0.5rem;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* Modal */
|
|
291
|
+
.diviswap-kyc-modal-overlay {
|
|
292
|
+
position: fixed;
|
|
293
|
+
top: 0;
|
|
294
|
+
left: 0;
|
|
295
|
+
right: 0;
|
|
296
|
+
bottom: 0;
|
|
297
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
z-index: 1000;
|
|
302
|
+
padding: 1rem;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.diviswap-kyc-modal {
|
|
306
|
+
background-color: white;
|
|
307
|
+
border-radius: 12px;
|
|
308
|
+
max-width: 600px;
|
|
309
|
+
width: 100%;
|
|
310
|
+
max-height: 90vh;
|
|
311
|
+
overflow-y: auto;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.diviswap-kyc-modal .diviswap-kyc-container {
|
|
315
|
+
border: none;
|
|
316
|
+
box-shadow: none;
|
|
317
|
+
margin: 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Dark Theme */
|
|
321
|
+
.diviswap-kyc-container[data-theme="dark"] {
|
|
322
|
+
background-color: #1f2937;
|
|
323
|
+
color: #f9fafb;
|
|
324
|
+
border-color: #374151;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.diviswap-kyc-container[data-theme="dark"] .form-field input,
|
|
328
|
+
.diviswap-kyc-container[data-theme="dark"] .form-field select {
|
|
329
|
+
background-color: #374151;
|
|
330
|
+
border-color: #4b5563;
|
|
331
|
+
color: #f9fafb;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.diviswap-kyc-container[data-theme="dark"] .form-field input:focus,
|
|
335
|
+
.diviswap-kyc-container[data-theme="dark"] .form-field select:focus {
|
|
336
|
+
border-color: #6366f1;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.diviswap-kyc-container[data-theme="dark"] .review-section {
|
|
340
|
+
background-color: #374151;
|
|
341
|
+
border-color: #4b5563;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.diviswap-kyc-container[data-theme="dark"] .btn-secondary {
|
|
345
|
+
border-color: #4b5563;
|
|
346
|
+
color: #d1d5db;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.diviswap-kyc-container[data-theme="dark"] .btn-secondary:hover {
|
|
350
|
+
background-color: #374151;
|
|
351
|
+
border-color: #6b7280;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.diviswap-kyc-container[data-theme="dark"] .info-box {
|
|
355
|
+
background-color: #064e3b;
|
|
356
|
+
border-color: #047857;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* Responsive Design */
|
|
360
|
+
@media (max-width: 640px) {
|
|
361
|
+
.diviswap-kyc-container {
|
|
362
|
+
padding: 1rem;
|
|
363
|
+
margin: 1rem;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.form-row {
|
|
367
|
+
grid-template-columns: 1fr;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.date-inputs {
|
|
371
|
+
grid-template-columns: 1fr;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.step-actions {
|
|
375
|
+
flex-direction: column;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.btn-primary,
|
|
379
|
+
.btn-secondary {
|
|
380
|
+
width: 100%;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.info-item {
|
|
384
|
+
flex-direction: column;
|
|
385
|
+
text-align: center;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.review-item {
|
|
389
|
+
flex-direction: column;
|
|
390
|
+
gap: 0.25rem;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.review-item span:first-child {
|
|
394
|
+
font-size: 0.875rem;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/* Accessibility */
|
|
399
|
+
@media (prefers-reduced-motion: reduce) {
|
|
400
|
+
.progress-fill,
|
|
401
|
+
.btn-primary,
|
|
402
|
+
.btn-secondary {
|
|
403
|
+
transition: none;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.animate-spin {
|
|
407
|
+
animation: none;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* Focus Styles for Accessibility */
|
|
412
|
+
.btn-primary:focus,
|
|
413
|
+
.btn-secondary:focus {
|
|
414
|
+
outline: 2px solid #6366f1;
|
|
415
|
+
outline-offset: 2px;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/* High Contrast Mode */
|
|
419
|
+
@media (prefers-contrast: high) {
|
|
420
|
+
.diviswap-kyc-container {
|
|
421
|
+
border-width: 2px;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.form-field input,
|
|
425
|
+
.form-field select {
|
|
426
|
+
border-width: 2px;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.btn-primary,
|
|
430
|
+
.btn-secondary {
|
|
431
|
+
border-width: 2px;
|
|
432
|
+
}
|
|
433
|
+
}
|