@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.
Files changed (80) hide show
  1. package/LICENSE +0 -0
  2. package/dist/cjs/components/ConnectWalletPrompt.js +13 -0
  3. package/dist/cjs/components/ConnectWalletPrompt.js.map +1 -0
  4. package/dist/cjs/components/ErrorDisplay.js +42 -0
  5. package/dist/cjs/components/ErrorDisplay.js.map +1 -0
  6. package/dist/cjs/components/InvestorDashboard.js +156 -0
  7. package/dist/cjs/components/InvestorDashboard.js.map +1 -0
  8. package/dist/cjs/components/KYCFlow.js +146 -0
  9. package/dist/cjs/components/KYCFlow.js.map +1 -0
  10. package/dist/cjs/components/LoadingSpinner.js +18 -0
  11. package/dist/cjs/components/LoadingSpinner.js.map +1 -0
  12. package/dist/cjs/components/TokenMintForm.js +163 -0
  13. package/dist/cjs/components/TokenMintForm.js.map +1 -0
  14. package/dist/cjs/components/YieldCalculator.js +97 -0
  15. package/dist/cjs/components/YieldCalculator.js.map +1 -0
  16. package/dist/cjs/hooks/useRWA.js +87 -40
  17. package/dist/cjs/hooks/useRWA.js.map +1 -1
  18. package/dist/cjs/index.js +11 -1
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/cjs/types/index.js +2 -2
  21. package/dist/cjs/types/index.js.map +1 -1
  22. package/dist/esm/components/ConnectWalletPrompt.js +10 -0
  23. package/dist/esm/components/ConnectWalletPrompt.js.map +1 -0
  24. package/dist/esm/components/ErrorDisplay.js +38 -0
  25. package/dist/esm/components/ErrorDisplay.js.map +1 -0
  26. package/dist/esm/components/InvestorDashboard.js +153 -0
  27. package/dist/esm/components/InvestorDashboard.js.map +1 -0
  28. package/dist/esm/components/KYCFlow.js +143 -0
  29. package/dist/esm/components/KYCFlow.js.map +1 -0
  30. package/dist/esm/components/LoadingSpinner.js +15 -0
  31. package/dist/esm/components/LoadingSpinner.js.map +1 -0
  32. package/dist/esm/components/TokenMintForm.js +158 -0
  33. package/dist/esm/components/TokenMintForm.js.map +1 -0
  34. package/dist/esm/components/YieldCalculator.js +94 -0
  35. package/dist/esm/components/YieldCalculator.js.map +1 -0
  36. package/dist/esm/hooks/useRWA.js +86 -39
  37. package/dist/esm/hooks/useRWA.js.map +1 -1
  38. package/dist/esm/index.js +4 -0
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/esm/types/index.js +3 -3
  41. package/dist/esm/types/index.js.map +1 -1
  42. package/dist/styles.css +3 -1
  43. package/dist/types/components/ConnectWalletPrompt.d.ts +15 -0
  44. package/dist/types/components/ConnectWalletPrompt.d.ts.map +1 -0
  45. package/dist/types/components/ErrorDisplay.d.ts +16 -0
  46. package/dist/types/components/ErrorDisplay.d.ts.map +1 -0
  47. package/dist/types/components/InvestorDashboard.d.ts +7 -0
  48. package/dist/types/components/InvestorDashboard.d.ts.map +1 -0
  49. package/dist/types/components/KYCFlow.d.ts +7 -0
  50. package/dist/types/components/KYCFlow.d.ts.map +1 -0
  51. package/dist/types/components/LoadingSpinner.d.ts +10 -0
  52. package/dist/types/components/LoadingSpinner.d.ts.map +1 -0
  53. package/dist/types/components/TokenMintForm.d.ts +15 -0
  54. package/dist/types/components/TokenMintForm.d.ts.map +1 -0
  55. package/dist/types/components/YieldCalculator.d.ts +7 -0
  56. package/dist/types/components/YieldCalculator.d.ts.map +1 -0
  57. package/dist/types/hooks/useRWA.d.ts +7 -19
  58. package/dist/types/hooks/useRWA.d.ts.map +1 -1
  59. package/dist/types/index.d.ts +5 -1
  60. package/dist/types/index.d.ts.map +1 -1
  61. package/dist/types/types/index.d.ts +113 -131
  62. package/dist/types/types/index.d.ts.map +1 -1
  63. package/package.json +65 -63
  64. package/src/components/ConnectWalletPrompt.tsx +47 -0
  65. package/src/components/ErrorDisplay.tsx +90 -0
  66. package/src/components/InvestorDashboard.tsx +315 -0
  67. package/src/components/KYCFlow.tsx +267 -0
  68. package/src/components/LoadingSpinner.tsx +33 -0
  69. package/src/components/TokenMintForm.tsx +291 -0
  70. package/src/components/YieldCalculator.tsx +250 -0
  71. package/src/hooks/useRWA.ts +90 -50
  72. package/src/index.ts +5 -17
  73. package/src/styles/index.css +60 -175
  74. package/src/types/index.ts +142 -135
  75. package/src/components/InvestorDashboard/index.tsx +0 -359
  76. package/src/components/KYCFlow/index.tsx +0 -434
  77. package/src/components/TokenMintForm/index.tsx +0 -590
  78. package/src/components/YieldCalculator/index.tsx +0 -541
  79. package/src/components/index.ts +0 -8
  80. package/src/hooks/index.ts +0 -5
@@ -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
- /* Custom component styles */
6
- .rwa-card {
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
- .rwa-kyc-step.in_progress {
108
- @apply bg-blue-50 border border-blue-200;
109
- }
15
+ /* KYC Flow */
16
+ .rwa-kyc-flow {
17
+ @apply w-full;
18
+ }
110
19
 
111
- .rwa-kyc-flow.dark .rwa-kyc-step.in_progress {
112
- @apply bg-blue-900/20 border-blue-800;
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
- .rwa-kyc-flow.dark .rwa-kyc-step.completed {
120
- @apply bg-green-900/20;
121
- }
25
+ /* Token Mint Form */
26
+ .rwa-token-mint-form {
27
+ @apply w-full max-w-md;
28
+ }
122
29
 
123
- .rwa-kyc-step.failed {
124
- @apply bg-red-50;
125
- }
30
+ /* Yield Calculator */
31
+ .rwa-yield-calculator {
32
+ @apply w-full;
33
+ }
126
34
 
127
- .rwa-kyc-flow.dark .rwa-kyc-step.failed {
128
- @apply bg-red-900/20;
129
- }
35
+ /* Error Display */
36
+ .rwa-error-display {
37
+ @apply w-full;
38
+ }
130
39
 
131
- .rwa-kyc-step-indicator {
132
- @apply flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium;
133
- }
40
+ /* Loading Spinner */
41
+ .rwa-loading-spinner {
42
+ @apply inline-flex items-center justify-center;
43
+ }
134
44
 
135
- .rwa-kyc-step.pending .rwa-kyc-step-indicator {
136
- @apply bg-gray-200 text-gray-600;
45
+ /* Connect Wallet Prompt */
46
+ .rwa-connect-wallet-prompt {
47
+ @apply w-full;
48
+ }
137
49
  }
138
50
 
139
- .rwa-kyc-flow.dark .rwa-kyc-step.pending .rwa-kyc-step-indicator {
140
- @apply bg-gray-600 text-gray-300;
141
- }
51
+ /* Dark mode support */
52
+ @layer utilities {
142
53
 
143
- .rwa-kyc-step.in_progress .rwa-kyc-step-indicator {
144
- @apply bg-blue-500 text-white;
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
- .rwa-kyc-step.completed .rwa-kyc-step-indicator {
148
- @apply bg-green-500 text-white;
62
+ /* Custom animations */
63
+ @keyframes rwa-spin {
64
+ to {
65
+ transform: rotate(360deg);
66
+ }
149
67
  }
150
68
 
151
- .rwa-kyc-step.failed .rwa-kyc-step-indicator {
152
- @apply bg-red-500 text-white;
69
+ .rwa-animate-spin {
70
+ animation: rwa-spin 1s linear infinite;
153
71
  }
154
72
 
155
- .rwa-kyc-step-content {
156
- @apply flex flex-col;
157
- }
158
-
159
- .rwa-kyc-step-label {
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-kyc-session {
196
- @apply mt-4 text-center;
79
+ .dark .rwa-focus-ring {
80
+ @apply focus:ring-offset-gray-900;
81
+ }
197
82
  }
@@ -1,193 +1,200 @@
1
1
  /**
2
- * Type definitions for @mantle-rwa/react components
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
- // Re-export SDK types that are commonly used
6
- export { AccreditationTier } from '@mantle-rwa/sdk';
41
+ /*//////////////////////////////////////////////////////////////
42
+ HOOK TYPES
43
+ //////////////////////////////////////////////////////////////*/
7
44
 
8
45
  /**
9
- * Theme options for components
46
+ * Configuration for useRWA hook
10
47
  */
11
- export type Theme = 'light' | 'dark';
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
- * KYC Provider options
56
+ * Return type for useRWA hook
15
57
  */
16
- export type KYCProviderType = 'persona' | 'synaps' | 'jumio';
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
- * Required fields for KYC verification
20
- */
21
- export type KYCRequiredField = 'identity' | 'accreditation' | 'address' | 'tax';
75
+ /*//////////////////////////////////////////////////////////////
76
+ COMPONENT PROPS
77
+ //////////////////////////////////////////////////////////////*/
22
78
 
23
79
  /**
24
- * KYC verification result
80
+ * Verification status for KYC flow
25
81
  */
26
- export interface KYCResult {
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 props
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 provider to use */
39
- provider: KYCProviderType;
40
- /** Callback when KYC verification completes */
41
- onComplete: (kycData: KYCResult) => void;
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
- /** Required verification fields */
45
- requiredFields: KYCRequiredField[];
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 props
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 Token contract address */
106
+ /** RWA token contract address */
74
107
  tokenAddress: string;
75
- /** Yield Distributor contract address */
76
- yieldDistributorAddress: string;
77
- /** KYC Registry contract address */
108
+ /** KYC registry contract address */
78
109
  kycRegistryAddress: string;
79
- /** Theme mode */
80
- theme?: Theme;
81
- /** Callback when yield is claimed */
82
- onClaimYield?: (distributionId: number) => void;
83
- /** Whether to show portfolio value */
84
- showPortfolioValue?: boolean;
85
- /** Price oracle address for portfolio value calculation */
86
- priceOracle?: string;
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 props
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 Token contract address */
126
+ /** RWA token contract address */
105
127
  tokenAddress: string;
106
- /** KYC Registry contract address */
128
+ /** KYC registry contract address */
107
129
  kycRegistryAddress: string;
108
- /** Callback when minting completes */
109
- onMintComplete?: (txHash: string, recipient: string, amount: string) => void;
130
+ /** Callback when mint succeeds */
131
+ onSuccess?: (result: TransactionResult) => void;
110
132
  /** Callback when an error occurs */
111
133
  onError?: (error: Error) => void;
112
- /** Whether to allow batch minting via CSV */
113
- allowBatchMint?: boolean;
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 props
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 Token contract address */
142
+ /** RWA token contract address */
134
143
  tokenAddress: string;
135
- /** Yield Distributor contract address */
144
+ /** Yield distributor contract address */
136
145
  yieldDistributorAddress: string;
137
- /** Supported payment tokens */
138
- supportedPaymentTokens: PaymentToken[];
139
- /** Callback when distribution is initiated */
140
- onDistribute?: (config: DistributionConfig) => void;
141
- /** Whether to show distribution chart */
142
- showChart?: boolean;
143
- /** Whether to allow export functionality */
144
- allowExport?: boolean;
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
- * Payment token configuration
161
+ * Common loading state interface
151
162
  */
152
- export interface PaymentToken {
153
- address: string;
154
- symbol: string;
155
- decimals: number;
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
- * Distribution configuration
171
+ * Transaction state interface
160
172
  */
161
- export interface DistributionConfig {
162
- tokenAddress: string;
163
- paymentToken: string;
164
- totalAmount: string;
165
- snapshotDate?: Date;
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
- * Distribution preview entry
181
+ * Props for ErrorDisplay component
171
182
  */
172
- export interface DistributionPreviewEntry {
173
- address: string;
174
- balance: bigint;
175
- yieldAmount: bigint;
176
- percentage: number;
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
- * useRWA hook return type
193
+ * Props for LoadingSpinner component
181
194
  */
182
- export interface UseRWAReturn {
183
- /** Whether the SDK client is initialized */
184
- isInitialized: boolean;
185
- /** Current network chain ID */
186
- chainId: number | undefined;
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
  }