@mantle-rwa/react 0.1.0 → 0.1.2
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 +0 -0
- package/dist/cjs/components/ConnectWalletPrompt.js +13 -0
- package/dist/cjs/components/ConnectWalletPrompt.js.map +1 -0
- package/dist/cjs/components/ErrorDisplay.js +42 -0
- package/dist/cjs/components/ErrorDisplay.js.map +1 -0
- package/dist/cjs/components/InvestorDashboard.js +156 -0
- package/dist/cjs/components/InvestorDashboard.js.map +1 -0
- package/dist/cjs/components/KYCFlow.js +146 -0
- package/dist/cjs/components/KYCFlow.js.map +1 -0
- package/dist/cjs/components/LoadingSpinner.js +18 -0
- package/dist/cjs/components/LoadingSpinner.js.map +1 -0
- package/dist/cjs/components/TokenMintForm.js +163 -0
- package/dist/cjs/components/TokenMintForm.js.map +1 -0
- package/dist/cjs/components/YieldCalculator.js +97 -0
- package/dist/cjs/components/YieldCalculator.js.map +1 -0
- package/dist/cjs/hooks/useRWA.js +87 -40
- package/dist/cjs/hooks/useRWA.js.map +1 -1
- package/dist/cjs/index.js +11 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/index.js +2 -2
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/esm/components/ConnectWalletPrompt.js +10 -0
- package/dist/esm/components/ConnectWalletPrompt.js.map +1 -0
- package/dist/esm/components/ErrorDisplay.js +38 -0
- package/dist/esm/components/ErrorDisplay.js.map +1 -0
- package/dist/esm/components/InvestorDashboard.js +153 -0
- package/dist/esm/components/InvestorDashboard.js.map +1 -0
- package/dist/esm/components/KYCFlow.js +143 -0
- package/dist/esm/components/KYCFlow.js.map +1 -0
- package/dist/esm/components/LoadingSpinner.js +15 -0
- package/dist/esm/components/LoadingSpinner.js.map +1 -0
- package/dist/esm/components/TokenMintForm.js +158 -0
- package/dist/esm/components/TokenMintForm.js.map +1 -0
- package/dist/esm/components/YieldCalculator.js +94 -0
- package/dist/esm/components/YieldCalculator.js.map +1 -0
- package/dist/esm/hooks/useRWA.js +86 -39
- package/dist/esm/hooks/useRWA.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/index.js +3 -3
- package/dist/esm/types/index.js.map +1 -1
- package/dist/styles.css +3 -1
- package/dist/types/components/ConnectWalletPrompt.d.ts +15 -0
- package/dist/types/components/ConnectWalletPrompt.d.ts.map +1 -0
- package/dist/types/components/ErrorDisplay.d.ts +16 -0
- package/dist/types/components/ErrorDisplay.d.ts.map +1 -0
- package/dist/types/components/InvestorDashboard.d.ts +7 -0
- package/dist/types/components/InvestorDashboard.d.ts.map +1 -0
- package/dist/types/components/KYCFlow.d.ts +7 -0
- package/dist/types/components/KYCFlow.d.ts.map +1 -0
- package/dist/types/components/LoadingSpinner.d.ts +10 -0
- package/dist/types/components/LoadingSpinner.d.ts.map +1 -0
- package/dist/types/components/TokenMintForm.d.ts +15 -0
- package/dist/types/components/TokenMintForm.d.ts.map +1 -0
- package/dist/types/components/YieldCalculator.d.ts +7 -0
- package/dist/types/components/YieldCalculator.d.ts.map +1 -0
- package/dist/types/hooks/useRWA.d.ts +7 -19
- package/dist/types/hooks/useRWA.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +113 -131
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +65 -63
- package/src/components/ConnectWalletPrompt.tsx +47 -0
- package/src/components/ErrorDisplay.tsx +90 -0
- package/src/components/InvestorDashboard.tsx +315 -0
- package/src/components/KYCFlow.tsx +267 -0
- package/src/components/LoadingSpinner.tsx +33 -0
- package/src/components/TokenMintForm.tsx +291 -0
- package/src/components/YieldCalculator.tsx +250 -0
- package/src/hooks/useRWA.ts +90 -50
- package/src/index.ts +5 -17
- package/src/styles/index.css +60 -175
- package/src/types/index.ts +142 -135
- package/src/components/InvestorDashboard/index.tsx +0 -359
- package/src/components/KYCFlow/index.tsx +0 -434
- package/src/components/TokenMintForm/index.tsx +0 -590
- package/src/components/YieldCalculator/index.tsx +0 -541
- package/src/components/index.ts +0 -8
- package/src/hooks/index.ts +0 -5
package/src/styles/index.css
CHANGED
|
@@ -1,197 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @mantle-rwa/react - Default Styles
|
|
3
|
+
*
|
|
4
|
+
* Tailwind CSS styles for RWA React components.
|
|
5
|
+
* Import this file in your application to use default styling.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
@tailwind base;
|
|
2
9
|
@tailwind components;
|
|
3
10
|
@tailwind utilities;
|
|
4
11
|
|
|
5
|
-
/*
|
|
6
|
-
|
|
7
|
-
@apply rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.rwa-button {
|
|
11
|
-
@apply inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.rwa-button-primary {
|
|
15
|
-
@apply rwa-button bg-mantle-600 text-white hover:bg-mantle-700 focus:ring-mantle-500;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.rwa-button-secondary {
|
|
19
|
-
@apply rwa-button border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:ring-mantle-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.rwa-input {
|
|
23
|
-
@apply block w-full rounded-md border border-gray-300 px-3 py-2 text-sm placeholder-gray-400 focus:border-mantle-500 focus:outline-none focus:ring-1 focus:ring-mantle-500 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.rwa-label {
|
|
27
|
-
@apply block text-sm font-medium text-gray-700 dark:text-gray-200;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* KYCFlow Component Styles */
|
|
31
|
-
.rwa-kyc-flow {
|
|
32
|
-
@apply rounded-lg border border-gray-200 bg-white p-6 shadow-sm;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.rwa-kyc-flow.dark {
|
|
36
|
-
@apply border-gray-700 bg-gray-800;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.rwa-kyc-header {
|
|
40
|
-
@apply text-lg font-semibold text-gray-900 mb-4;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.rwa-kyc-flow.dark .rwa-kyc-header {
|
|
44
|
-
@apply text-white;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.rwa-kyc-error {
|
|
48
|
-
@apply flex items-center gap-2 mb-4 p-3 bg-red-50 text-red-700 rounded-md border border-red-200;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.rwa-kyc-flow.dark .rwa-kyc-error {
|
|
52
|
-
@apply bg-red-900/20 text-red-300 border-red-800;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.rwa-kyc-error-icon {
|
|
56
|
-
@apply flex-shrink-0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.rwa-kyc-provider {
|
|
60
|
-
@apply flex items-center gap-3 mb-6 p-3 bg-gray-50 rounded-md;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.rwa-kyc-flow.dark .rwa-kyc-provider {
|
|
64
|
-
@apply bg-gray-700/50;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.rwa-kyc-provider-logo {
|
|
68
|
-
@apply text-2xl;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.rwa-kyc-provider-details {
|
|
72
|
-
@apply flex flex-col;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.rwa-kyc-provider-name {
|
|
76
|
-
@apply font-medium text-gray-900;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.rwa-kyc-flow.dark .rwa-kyc-provider-name {
|
|
80
|
-
@apply text-white;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.rwa-kyc-provider-description {
|
|
84
|
-
@apply text-sm text-gray-500;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.rwa-kyc-flow.dark .rwa-kyc-provider-description {
|
|
88
|
-
@apply text-gray-400;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.rwa-kyc-steps {
|
|
92
|
-
@apply space-y-3 mb-6;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.rwa-kyc-step {
|
|
96
|
-
@apply flex items-start gap-3 p-3 rounded-md transition-colors;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.rwa-kyc-step.pending {
|
|
100
|
-
@apply bg-gray-50;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.rwa-kyc-flow.dark .rwa-kyc-step.pending {
|
|
104
|
-
@apply bg-gray-700/30;
|
|
105
|
-
}
|
|
12
|
+
/* Base component styles */
|
|
13
|
+
@layer components {
|
|
106
14
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
15
|
+
/* KYC Flow */
|
|
16
|
+
.rwa-kyc-flow {
|
|
17
|
+
@apply w-full;
|
|
18
|
+
}
|
|
110
19
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.rwa-kyc-step.completed {
|
|
116
|
-
@apply bg-green-50;
|
|
117
|
-
}
|
|
20
|
+
/* Investor Dashboard */
|
|
21
|
+
.rwa-investor-dashboard {
|
|
22
|
+
@apply w-full;
|
|
23
|
+
}
|
|
118
24
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
25
|
+
/* Token Mint Form */
|
|
26
|
+
.rwa-token-mint-form {
|
|
27
|
+
@apply w-full max-w-md;
|
|
28
|
+
}
|
|
122
29
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
30
|
+
/* Yield Calculator */
|
|
31
|
+
.rwa-yield-calculator {
|
|
32
|
+
@apply w-full;
|
|
33
|
+
}
|
|
126
34
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
35
|
+
/* Error Display */
|
|
36
|
+
.rwa-error-display {
|
|
37
|
+
@apply w-full;
|
|
38
|
+
}
|
|
130
39
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
40
|
+
/* Loading Spinner */
|
|
41
|
+
.rwa-loading-spinner {
|
|
42
|
+
@apply inline-flex items-center justify-center;
|
|
43
|
+
}
|
|
134
44
|
|
|
135
|
-
|
|
136
|
-
|
|
45
|
+
/* Connect Wallet Prompt */
|
|
46
|
+
.rwa-connect-wallet-prompt {
|
|
47
|
+
@apply w-full;
|
|
48
|
+
}
|
|
137
49
|
}
|
|
138
50
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
51
|
+
/* Dark mode support */
|
|
52
|
+
@layer utilities {
|
|
142
53
|
|
|
143
|
-
.
|
|
144
|
-
|
|
54
|
+
.dark .rwa-kyc-flow,
|
|
55
|
+
.dark .rwa-investor-dashboard,
|
|
56
|
+
.dark .rwa-token-mint-form,
|
|
57
|
+
.dark .rwa-yield-calculator {
|
|
58
|
+
@apply text-gray-100;
|
|
59
|
+
}
|
|
145
60
|
}
|
|
146
61
|
|
|
147
|
-
|
|
148
|
-
|
|
62
|
+
/* Custom animations */
|
|
63
|
+
@keyframes rwa-spin {
|
|
64
|
+
to {
|
|
65
|
+
transform: rotate(360deg);
|
|
66
|
+
}
|
|
149
67
|
}
|
|
150
68
|
|
|
151
|
-
.rwa-
|
|
152
|
-
|
|
69
|
+
.rwa-animate-spin {
|
|
70
|
+
animation: rwa-spin 1s linear infinite;
|
|
153
71
|
}
|
|
154
72
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
@apply font-medium text-gray-900;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.rwa-kyc-flow.dark .rwa-kyc-step-label {
|
|
164
|
-
@apply text-white;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.rwa-kyc-step-description {
|
|
168
|
-
@apply text-sm text-gray-500 mt-0.5;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.rwa-kyc-flow.dark .rwa-kyc-step-description {
|
|
172
|
-
@apply text-gray-400;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.rwa-kyc-actions {
|
|
176
|
-
@apply mt-6;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.rwa-kyc-actions button {
|
|
180
|
-
@apply w-full;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.rwa-kyc-success {
|
|
184
|
-
@apply flex items-center justify-center gap-2 p-3 bg-green-50 text-green-700 rounded-md font-medium;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.rwa-kyc-flow.dark .rwa-kyc-success {
|
|
188
|
-
@apply bg-green-900/20 text-green-300;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.rwa-kyc-success-icon {
|
|
192
|
-
@apply text-lg;
|
|
193
|
-
}
|
|
73
|
+
/* Focus styles for accessibility */
|
|
74
|
+
@layer utilities {
|
|
75
|
+
.rwa-focus-ring {
|
|
76
|
+
@apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2;
|
|
77
|
+
}
|
|
194
78
|
|
|
195
|
-
.rwa-
|
|
196
|
-
|
|
79
|
+
.dark .rwa-focus-ring {
|
|
80
|
+
@apply focus:ring-offset-gray-900;
|
|
81
|
+
}
|
|
197
82
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,193 +1,200 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Type definitions for @mantle-rwa/react
|
|
3
|
-
*/
|
|
2
|
+
* Type definitions for @mantle-rwa/react
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Re-export relevant types from SDK
|
|
6
|
+
export {
|
|
7
|
+
AccreditationTier,
|
|
8
|
+
type TokenInfo,
|
|
9
|
+
type InvestorData,
|
|
10
|
+
type TransactionResult,
|
|
11
|
+
type Distribution,
|
|
12
|
+
type DistributionPreview,
|
|
13
|
+
type HolderDistribution,
|
|
14
|
+
type PendingClaim,
|
|
15
|
+
type VerificationSession,
|
|
16
|
+
type NetworkConfig,
|
|
17
|
+
} from '@mantle-rwa/sdk';
|
|
18
|
+
|
|
19
|
+
import type { RWAClient, TransactionResult, AccreditationTier, DistributionPreview } from '@mantle-rwa/sdk';
|
|
20
|
+
|
|
21
|
+
/*//////////////////////////////////////////////////////////////
|
|
22
|
+
CONTRACT ADDRESSES
|
|
23
|
+
//////////////////////////////////////////////////////////////*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Contract addresses configuration
|
|
27
|
+
*/
|
|
28
|
+
export interface ContractAddresses {
|
|
29
|
+
/** RWA token contract address */
|
|
30
|
+
token?: string;
|
|
31
|
+
/** KYC registry contract address */
|
|
32
|
+
kycRegistry?: string;
|
|
33
|
+
/** Yield distributor contract address */
|
|
34
|
+
yieldDistributor?: string;
|
|
35
|
+
/** Asset vault contract address */
|
|
36
|
+
assetVault?: string;
|
|
37
|
+
/** RWA factory contract address */
|
|
38
|
+
factory?: string;
|
|
39
|
+
}
|
|
4
40
|
|
|
5
|
-
|
|
6
|
-
|
|
41
|
+
/*//////////////////////////////////////////////////////////////
|
|
42
|
+
HOOK TYPES
|
|
43
|
+
//////////////////////////////////////////////////////////////*/
|
|
7
44
|
|
|
8
45
|
/**
|
|
9
|
-
*
|
|
46
|
+
* Configuration for useRWA hook
|
|
10
47
|
*/
|
|
11
|
-
export
|
|
48
|
+
export interface UseRWAConfig {
|
|
49
|
+
/** Network to connect to (default: 'mantle-sepolia') */
|
|
50
|
+
network?: 'mantle' | 'mantle-sepolia';
|
|
51
|
+
/** Contract addresses configuration */
|
|
52
|
+
contracts?: ContractAddresses;
|
|
53
|
+
}
|
|
12
54
|
|
|
13
55
|
/**
|
|
14
|
-
*
|
|
56
|
+
* Return type for useRWA hook
|
|
15
57
|
*/
|
|
16
|
-
export
|
|
58
|
+
export interface UseRWAReturn {
|
|
59
|
+
/** The RWAClient instance (null if not initialized) */
|
|
60
|
+
client: RWAClient | null;
|
|
61
|
+
/** Whether the client is initialized and ready */
|
|
62
|
+
isInitialized: boolean;
|
|
63
|
+
/** Whether the client is currently initializing */
|
|
64
|
+
isLoading: boolean;
|
|
65
|
+
/** Error that occurred during initialization */
|
|
66
|
+
error: Error | null;
|
|
67
|
+
/** Whether a signer is available (wallet connected) */
|
|
68
|
+
hasSigner: boolean;
|
|
69
|
+
/** Contract addresses */
|
|
70
|
+
contracts: ContractAddresses;
|
|
71
|
+
/** Reinitialize the client */
|
|
72
|
+
reinitialize: () => Promise<void>;
|
|
73
|
+
}
|
|
17
74
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export type KYCRequiredField = 'identity' | 'accreditation' | 'address' | 'tax';
|
|
75
|
+
/*//////////////////////////////////////////////////////////////
|
|
76
|
+
COMPONENT PROPS
|
|
77
|
+
//////////////////////////////////////////////////////////////*/
|
|
22
78
|
|
|
23
79
|
/**
|
|
24
|
-
* KYC
|
|
80
|
+
* Verification status for KYC flow
|
|
25
81
|
*/
|
|
26
|
-
export
|
|
27
|
-
verified: boolean;
|
|
28
|
-
tier: number;
|
|
29
|
-
identityHash: string;
|
|
30
|
-
sessionId: string;
|
|
31
|
-
}
|
|
82
|
+
export type VerificationStatus = 'idle' | 'pending' | 'in_progress' | 'completed' | 'failed';
|
|
32
83
|
|
|
33
84
|
/**
|
|
34
|
-
* KYCFlow component
|
|
35
|
-
* @see Requirements 10.1, 10.2, 10.3, 10.4, 10.5
|
|
85
|
+
* Props for KYCFlow component
|
|
36
86
|
*/
|
|
37
87
|
export interface KYCFlowProps {
|
|
38
|
-
/** KYC
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
|
|
88
|
+
/** KYC registry contract address */
|
|
89
|
+
registryAddress: string;
|
|
90
|
+
/** Investor address to verify (defaults to connected wallet) */
|
|
91
|
+
investorAddress?: string;
|
|
92
|
+
/** Callback when verification status changes */
|
|
93
|
+
onStatusChange?: (status: VerificationStatus) => void;
|
|
94
|
+
/** Callback when verification completes successfully */
|
|
95
|
+
onComplete?: (tier: AccreditationTier) => void;
|
|
42
96
|
/** Callback when an error occurs */
|
|
43
97
|
onError?: (error: Error) => void;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
/** Theme mode */
|
|
47
|
-
theme?: Theme;
|
|
48
|
-
/** Custom styles override */
|
|
49
|
-
customStyles?: Partial<KYCFlowStyles>;
|
|
50
|
-
/** KYC Registry contract address for auto-update */
|
|
51
|
-
registryAddress?: string;
|
|
52
|
-
/** Whether to automatically update the on-chain registry */
|
|
53
|
-
autoUpdateRegistry?: boolean;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Custom styles for KYCFlow component
|
|
58
|
-
*/
|
|
59
|
-
export interface KYCFlowStyles {
|
|
60
|
-
container?: string;
|
|
61
|
-
header?: string;
|
|
62
|
-
content?: string;
|
|
63
|
-
button?: string;
|
|
64
|
-
input?: string;
|
|
65
|
-
error?: string;
|
|
98
|
+
/** Custom CSS class */
|
|
99
|
+
className?: string;
|
|
66
100
|
}
|
|
67
101
|
|
|
68
102
|
/**
|
|
69
|
-
* InvestorDashboard component
|
|
70
|
-
* @see Requirements 11.1, 11.2, 11.3, 11.4, 11.5
|
|
103
|
+
* Props for InvestorDashboard component
|
|
71
104
|
*/
|
|
72
105
|
export interface InvestorDashboardProps {
|
|
73
|
-
/** RWA
|
|
106
|
+
/** RWA token contract address */
|
|
74
107
|
tokenAddress: string;
|
|
75
|
-
/**
|
|
76
|
-
yieldDistributorAddress: string;
|
|
77
|
-
/** KYC Registry contract address */
|
|
108
|
+
/** KYC registry contract address */
|
|
78
109
|
kycRegistryAddress: string;
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Yield history entry
|
|
91
|
-
*/
|
|
92
|
-
export interface YieldHistoryEntry {
|
|
93
|
-
distributionId: number;
|
|
94
|
-
amount: bigint;
|
|
95
|
-
paymentToken: string;
|
|
96
|
-
claimedAt: Date;
|
|
110
|
+
/** Yield distributor contract address */
|
|
111
|
+
yieldDistributorAddress: string;
|
|
112
|
+
/** Investor address (defaults to connected wallet) */
|
|
113
|
+
investorAddress?: string;
|
|
114
|
+
/** Callback when yield claim succeeds */
|
|
115
|
+
onClaimSuccess?: (result: TransactionResult) => void;
|
|
116
|
+
/** Callback when an error occurs */
|
|
117
|
+
onError?: (error: Error) => void;
|
|
118
|
+
/** Custom CSS class */
|
|
119
|
+
className?: string;
|
|
97
120
|
}
|
|
98
121
|
|
|
99
122
|
/**
|
|
100
|
-
* TokenMintForm component
|
|
101
|
-
* @see Requirements 12.1, 12.2, 12.3, 12.4
|
|
123
|
+
* Props for TokenMintForm component
|
|
102
124
|
*/
|
|
103
125
|
export interface TokenMintFormProps {
|
|
104
|
-
/** RWA
|
|
126
|
+
/** RWA token contract address */
|
|
105
127
|
tokenAddress: string;
|
|
106
|
-
/** KYC
|
|
128
|
+
/** KYC registry contract address */
|
|
107
129
|
kycRegistryAddress: string;
|
|
108
|
-
/** Callback when
|
|
109
|
-
|
|
130
|
+
/** Callback when mint succeeds */
|
|
131
|
+
onSuccess?: (result: TransactionResult) => void;
|
|
110
132
|
/** Callback when an error occurs */
|
|
111
133
|
onError?: (error: Error) => void;
|
|
112
|
-
/**
|
|
113
|
-
|
|
114
|
-
/** Maximum batch size for CSV uploads */
|
|
115
|
-
maxBatchSize?: number;
|
|
116
|
-
/** Theme mode */
|
|
117
|
-
theme?: Theme;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Batch mint entry from CSV
|
|
122
|
-
*/
|
|
123
|
-
export interface BatchMintEntry {
|
|
124
|
-
recipient: string;
|
|
125
|
-
amount: string;
|
|
134
|
+
/** Custom CSS class */
|
|
135
|
+
className?: string;
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
/**
|
|
129
|
-
* YieldCalculator component
|
|
130
|
-
* @see Requirements 13.1, 13.2, 13.3, 13.4
|
|
139
|
+
* Props for YieldCalculator component
|
|
131
140
|
*/
|
|
132
141
|
export interface YieldCalculatorProps {
|
|
133
|
-
/** RWA
|
|
142
|
+
/** RWA token contract address */
|
|
134
143
|
tokenAddress: string;
|
|
135
|
-
/** Yield
|
|
144
|
+
/** Yield distributor contract address */
|
|
136
145
|
yieldDistributorAddress: string;
|
|
137
|
-
/**
|
|
138
|
-
|
|
139
|
-
/** Callback when
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
/** Theme mode */
|
|
146
|
-
theme?: Theme;
|
|
146
|
+
/** Optional list of holder addresses to include in preview */
|
|
147
|
+
holderAddresses?: string[];
|
|
148
|
+
/** Callback when calculation completes */
|
|
149
|
+
onCalculate?: (preview: DistributionPreview) => void;
|
|
150
|
+
/** Callback when an error occurs */
|
|
151
|
+
onError?: (error: Error) => void;
|
|
152
|
+
/** Custom CSS class */
|
|
153
|
+
className?: string;
|
|
147
154
|
}
|
|
148
155
|
|
|
156
|
+
/*//////////////////////////////////////////////////////////////
|
|
157
|
+
UTILITY TYPES
|
|
158
|
+
//////////////////////////////////////////////////////////////*/
|
|
159
|
+
|
|
149
160
|
/**
|
|
150
|
-
*
|
|
161
|
+
* Common loading state interface
|
|
151
162
|
*/
|
|
152
|
-
export interface
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
export interface LoadingState {
|
|
164
|
+
/** Whether data is loading */
|
|
165
|
+
isLoading: boolean;
|
|
166
|
+
/** Error that occurred */
|
|
167
|
+
error: Error | null;
|
|
156
168
|
}
|
|
157
169
|
|
|
158
170
|
/**
|
|
159
|
-
*
|
|
171
|
+
* Transaction state interface
|
|
160
172
|
*/
|
|
161
|
-
export interface
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
claimWindowDays?: number;
|
|
173
|
+
export interface TransactionState extends LoadingState {
|
|
174
|
+
/** Whether a transaction is pending */
|
|
175
|
+
isPending: boolean;
|
|
176
|
+
/** Transaction hash if available */
|
|
177
|
+
txHash: string | null;
|
|
167
178
|
}
|
|
168
179
|
|
|
169
180
|
/**
|
|
170
|
-
*
|
|
181
|
+
* Props for ErrorDisplay component
|
|
171
182
|
*/
|
|
172
|
-
export interface
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
export interface ErrorDisplayProps {
|
|
184
|
+
/** Error to display */
|
|
185
|
+
error: Error;
|
|
186
|
+
/** Callback for retry action */
|
|
187
|
+
onRetry?: () => void;
|
|
188
|
+
/** Custom CSS class */
|
|
189
|
+
className?: string;
|
|
177
190
|
}
|
|
178
191
|
|
|
179
192
|
/**
|
|
180
|
-
*
|
|
193
|
+
* Props for LoadingSpinner component
|
|
181
194
|
*/
|
|
182
|
-
export interface
|
|
183
|
-
/**
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
/** Connected wallet address */
|
|
188
|
-
address: string | undefined;
|
|
189
|
-
/** Whether wallet is connected */
|
|
190
|
-
isConnected: boolean;
|
|
191
|
-
/** Error if initialization failed */
|
|
192
|
-
error: Error | null;
|
|
195
|
+
export interface LoadingSpinnerProps {
|
|
196
|
+
/** Size of the spinner */
|
|
197
|
+
size?: 'sm' | 'md' | 'lg';
|
|
198
|
+
/** Custom CSS class */
|
|
199
|
+
className?: string;
|
|
193
200
|
}
|