@cedros/login-react 0.0.42 → 0.0.44
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/README.md +216 -0
- package/dist/{AuthenticationSettings-JxHsBst9.cjs → AuthenticationSettings-BlYOmaEG.cjs} +1 -1
- package/dist/{AuthenticationSettings-JxHsBst9.cjs.map → AuthenticationSettings-BlYOmaEG.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-DwSxgjbH.js → AuthenticationSettings-BsuwWKbT.js} +1 -1
- package/dist/{AuthenticationSettings-DwSxgjbH.js.map → AuthenticationSettings-BsuwWKbT.js.map} +1 -1
- package/dist/{AuthenticationSettings-CheE3j7w.js → AuthenticationSettings-DrHqtD7p.js} +1 -1
- package/dist/{AuthenticationSettings-CheE3j7w.js.map → AuthenticationSettings-DrHqtD7p.js.map} +1 -1
- package/dist/{AuthenticationSettings-Dl41GbJL.cjs → AuthenticationSettings-bNQiNQ9g.cjs} +1 -1
- package/dist/{AuthenticationSettings-Dl41GbJL.cjs.map → AuthenticationSettings-bNQiNQ9g.cjs.map} +1 -1
- package/dist/{AutosaveStatus-BMXjH1XN.cjs → AutosaveStatus-CZSwtgrL.cjs} +1 -1
- package/dist/AutosaveStatus-CZSwtgrL.cjs.map +1 -0
- package/dist/{AutosaveStatus-DNuCl59W.js → AutosaveStatus-D-roPsRx.js} +331 -296
- package/dist/AutosaveStatus-D-roPsRx.js.map +1 -0
- package/dist/{CreditSystemSettings-LvA8rb17.cjs → CreditSystemSettings-3R6crxvW.cjs} +1 -1
- package/dist/{CreditSystemSettings-LvA8rb17.cjs.map → CreditSystemSettings-3R6crxvW.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-HSdF2_CY.js → CreditSystemSettings-BTqZFn4K.js} +1 -1
- package/dist/{CreditSystemSettings-HSdF2_CY.js.map → CreditSystemSettings-BTqZFn4K.js.map} +1 -1
- package/dist/{CreditSystemSettings-BVgl6uUg.cjs → CreditSystemSettings-BskW_NKx.cjs} +1 -1
- package/dist/{CreditSystemSettings-BVgl6uUg.cjs.map → CreditSystemSettings-BskW_NKx.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-C-ksysSx.js → CreditSystemSettings-SL45GRH3.js} +1 -1
- package/dist/{CreditSystemSettings-C-ksysSx.js.map → CreditSystemSettings-SL45GRH3.js.map} +1 -1
- package/dist/{EmailSettings-hIhJzux0.js → EmailSettings-BUAQji4I.js} +1 -1
- package/dist/{EmailSettings-hIhJzux0.js.map → EmailSettings-BUAQji4I.js.map} +1 -1
- package/dist/{EmailSettings-DC_zT4nI.cjs → EmailSettings-CEC1rhrm.cjs} +1 -1
- package/dist/{EmailSettings-DC_zT4nI.cjs.map → EmailSettings-CEC1rhrm.cjs.map} +1 -1
- package/dist/{EmailSettings-QBMzpbxv.cjs → EmailSettings-CihElRkc.cjs} +1 -1
- package/dist/{EmailSettings-QBMzpbxv.cjs.map → EmailSettings-CihElRkc.cjs.map} +1 -1
- package/dist/{EmailSettings-Cy1cuVUq.js → EmailSettings-XETM8FdS.js} +1 -1
- package/dist/{EmailSettings-Cy1cuVUq.js.map → EmailSettings-XETM8FdS.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CvvTnRvt.js → EmbeddedWalletSettings-B-083zu6.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CvvTnRvt.js.map → EmbeddedWalletSettings-B-083zu6.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-Cwiug0vR.js → EmbeddedWalletSettings-CCT9DwmL.js} +1 -1
- package/dist/{EmbeddedWalletSettings-Cwiug0vR.js.map → EmbeddedWalletSettings-CCT9DwmL.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-C81QQMWz.cjs → EmbeddedWalletSettings-DXIjansC.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-C81QQMWz.cjs.map → EmbeddedWalletSettings-DXIjansC.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-4qC9KBwh.cjs → EmbeddedWalletSettings-MtwR81WH.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-4qC9KBwh.cjs.map → EmbeddedWalletSettings-MtwR81WH.cjs.map} +1 -1
- package/dist/{PermissionsSection-CSB_Ikj9.cjs → PermissionsSection-4zcE9Zs9.cjs} +1 -1
- package/dist/PermissionsSection-4zcE9Zs9.cjs.map +1 -0
- package/dist/{PermissionsSection-BDDiEfho.js → PermissionsSection-mm9hfp-u.js} +94 -74
- package/dist/PermissionsSection-mm9hfp-u.js.map +1 -0
- package/dist/{ServerSettings-DPqHtsgV.js → ServerSettings-24DA_BOI.js} +1 -1
- package/dist/{ServerSettings-DPqHtsgV.js.map → ServerSettings-24DA_BOI.js.map} +1 -1
- package/dist/{ServerSettings-BV0SipW1.cjs → ServerSettings-BNc4LEs4.cjs} +1 -1
- package/dist/{ServerSettings-BV0SipW1.cjs.map → ServerSettings-BNc4LEs4.cjs.map} +1 -1
- package/dist/{ServerSettings-Bf7gFE8r.cjs → ServerSettings-BTEuzdrf.cjs} +1 -1
- package/dist/{ServerSettings-Bf7gFE8r.cjs.map → ServerSettings-BTEuzdrf.cjs.map} +1 -1
- package/dist/{ServerSettings-Sfr0CG6K.js → ServerSettings-DBpbRihl.js} +1 -1
- package/dist/{ServerSettings-Sfr0CG6K.js.map → ServerSettings-DBpbRihl.js.map} +1 -1
- package/dist/{TeamSection-BhsBEckR.js → TeamSection-C_eODdLU.js} +1 -1
- package/dist/{TeamSection-BhsBEckR.js.map → TeamSection-C_eODdLU.js.map} +1 -1
- package/dist/{TeamSection-DLxtRmta.cjs → TeamSection-Km7EwLWD.cjs} +1 -1
- package/dist/{TeamSection-DLxtRmta.cjs.map → TeamSection-Km7EwLWD.cjs.map} +1 -1
- package/dist/{UsersSection-BEKfbhQ4.cjs → UsersSection-C1Tt0ePx.cjs} +1 -1
- package/dist/{UsersSection-BEKfbhQ4.cjs.map → UsersSection-C1Tt0ePx.cjs.map} +1 -1
- package/dist/{UsersSection-DbGkmxty.js → UsersSection-Ct_E-MBF.js} +1 -1
- package/dist/{UsersSection-DbGkmxty.js.map → UsersSection-Ct_E-MBF.js.map} +1 -1
- package/dist/{WebhookSettings-CMROMCFT.js → WebhookSettings-BhIwucKb.js} +1 -1
- package/dist/{WebhookSettings-CMROMCFT.js.map → WebhookSettings-BhIwucKb.js.map} +1 -1
- package/dist/{WebhookSettings-BPCKv5Or.cjs → WebhookSettings-C6X_JJcD.cjs} +1 -1
- package/dist/{WebhookSettings-BPCKv5Or.cjs.map → WebhookSettings-C6X_JJcD.cjs.map} +1 -1
- package/dist/{WebhookSettings-D4mKAWAg.js → WebhookSettings-D9IsXZJN.js} +1 -1
- package/dist/{WebhookSettings-D4mKAWAg.js.map → WebhookSettings-D9IsXZJN.js.map} +1 -1
- package/dist/{WebhookSettings-Cj-iELGa.cjs → WebhookSettings-H1x6IKOj.cjs} +1 -1
- package/dist/{WebhookSettings-Cj-iELGa.cjs.map → WebhookSettings-H1x6IKOj.cjs.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +217 -22
- package/dist/index.js +7551 -6310
- package/dist/index.js.map +1 -1
- package/dist/{plugin-BHGg7ius.cjs → plugin-BwwJh2cY.cjs} +1 -1
- package/dist/{plugin-BHGg7ius.cjs.map → plugin-BwwJh2cY.cjs.map} +1 -1
- package/dist/{plugin-CK2d7aP5.js → plugin-CetHtdLq.js} +1 -1
- package/dist/{plugin-CK2d7aP5.js.map → plugin-CetHtdLq.js.map} +1 -1
- package/dist/useUsersStatsSummary-BGeh3RnI.js +2025 -0
- package/dist/useUsersStatsSummary-BGeh3RnI.js.map +1 -0
- package/dist/useUsersStatsSummary-DnsYtFGX.cjs +1 -0
- package/dist/useUsersStatsSummary-DnsYtFGX.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/AutosaveStatus-BMXjH1XN.cjs.map +0 -1
- package/dist/AutosaveStatus-DNuCl59W.js.map +0 -1
- package/dist/PermissionsSection-BDDiEfho.js.map +0 -1
- package/dist/PermissionsSection-CSB_Ikj9.cjs.map +0 -1
- package/dist/useUsersStatsSummary-9HQDKBU5.js +0 -1879
- package/dist/useUsersStatsSummary-9HQDKBU5.js.map +0 -1
- package/dist/useUsersStatsSummary-DiRC8sGs.cjs +0 -1
- package/dist/useUsersStatsSummary-DiRC8sGs.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -89,6 +89,22 @@ export declare interface AccreditationPendingListResponse {
|
|
|
89
89
|
total: number;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Item returned by GET /admin/accreditation/pending — includes user context.
|
|
94
|
+
*/
|
|
95
|
+
export declare interface AccreditationQueueItem extends AccreditationSubmissionItem {
|
|
96
|
+
userId: string;
|
|
97
|
+
userEmail?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Response for GET /admin/accreditation/pending (queue list variant)
|
|
102
|
+
*/
|
|
103
|
+
export declare interface AccreditationQueueListResponse {
|
|
104
|
+
items: AccreditationQueueItem[];
|
|
105
|
+
total: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
92
108
|
/** Overall accreditation status for a user. */
|
|
93
109
|
export declare type AccreditationStatus = 'none' | 'pending' | 'approved' | 'rejected' | 'expired';
|
|
94
110
|
|
|
@@ -150,6 +166,28 @@ export declare interface AcknowledgeRecoveryRequest {
|
|
|
150
166
|
confirmed: boolean;
|
|
151
167
|
}
|
|
152
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Admin accreditation review queue.
|
|
171
|
+
*
|
|
172
|
+
* Inputs: className.
|
|
173
|
+
* Outputs: renders tabbed queue; approves/rejects submissions via API.
|
|
174
|
+
* Errors: displayed inline per row and globally.
|
|
175
|
+
*/
|
|
176
|
+
export declare function AdminAccreditationQueue({ className }: AdminAccreditationQueueProps): JSX.Element;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Admin queue for reviewing accredited investor submissions.
|
|
180
|
+
*
|
|
181
|
+
* Tabs: Pending | All
|
|
182
|
+
* Each row is expandable to show submission detail, documents, and the
|
|
183
|
+
* approve/reject review form.
|
|
184
|
+
*
|
|
185
|
+
* Requires system admin privileges.
|
|
186
|
+
*/
|
|
187
|
+
export declare interface AdminAccreditationQueueProps {
|
|
188
|
+
className?: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
153
191
|
/**
|
|
154
192
|
* Admin-level detail view of a single submission, including documents.
|
|
155
193
|
*/
|
|
@@ -431,6 +469,27 @@ declare interface AdminReferredUsersResponse {
|
|
|
431
469
|
offset: number;
|
|
432
470
|
}
|
|
433
471
|
|
|
472
|
+
/**
|
|
473
|
+
* Admin sanctions screening status panel.
|
|
474
|
+
*
|
|
475
|
+
* Inputs: className.
|
|
476
|
+
* Outputs: displays stats and allows force-refresh of the OFAC/sanctions cache.
|
|
477
|
+
* Errors: displayed inline with retry support.
|
|
478
|
+
*/
|
|
479
|
+
export declare function AdminSanctionsPanel({ className }: AdminSanctionsPanelProps): JSX.Element;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Admin panel for sanctions screening status and cache management.
|
|
483
|
+
*
|
|
484
|
+
* Shows: sanctioned addresses count, sanctioned countries count, cache age,
|
|
485
|
+
* last refresh timestamp, and a "Force Refresh" action.
|
|
486
|
+
*
|
|
487
|
+
* Requires system admin privileges.
|
|
488
|
+
*/
|
|
489
|
+
export declare interface AdminSanctionsPanelProps {
|
|
490
|
+
className?: string;
|
|
491
|
+
}
|
|
492
|
+
|
|
434
493
|
/**
|
|
435
494
|
* Section configuration for sidebar navigation.
|
|
436
495
|
*
|
|
@@ -1167,6 +1226,12 @@ export declare interface CompleteAccountPromptProps {
|
|
|
1167
1226
|
className?: string;
|
|
1168
1227
|
}
|
|
1169
1228
|
|
|
1229
|
+
export declare function ComplianceSettings({ className }: ComplianceSettingsProps): JSX.Element;
|
|
1230
|
+
|
|
1231
|
+
export declare interface ComplianceSettingsProps {
|
|
1232
|
+
className?: string;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1170
1235
|
/** Request to create a derived wallet */
|
|
1171
1236
|
export declare interface CreateDerivedWalletRequest {
|
|
1172
1237
|
/** Human-readable label for the wallet (1-100 chars) */
|
|
@@ -1338,30 +1403,10 @@ declare interface CustomTokenDefinition {
|
|
|
1338
1403
|
}
|
|
1339
1404
|
|
|
1340
1405
|
/**
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1343
|
-
* A complete, ready-to-use admin panel following shadcn/ui dashboard patterns.
|
|
1344
|
-
*
|
|
1345
|
-
* @example
|
|
1346
|
-
* ```tsx
|
|
1347
|
-
* // Minimal setup - everything included
|
|
1348
|
-
* function AdminPage() {
|
|
1349
|
-
* return <CedrosAdminDashboard />;
|
|
1350
|
-
* }
|
|
1351
|
-
*
|
|
1352
|
-
* // Customized sections
|
|
1353
|
-
* function AdminPage() {
|
|
1354
|
-
* return (
|
|
1355
|
-
* <CedrosAdminDashboard
|
|
1356
|
-
* sections={['users', 'team', 'deposits', 'settings-auth']}
|
|
1357
|
-
* title="My App Admin"
|
|
1358
|
-
* />
|
|
1359
|
-
* );
|
|
1360
|
-
* }
|
|
1361
|
-
* ```
|
|
1406
|
+
* Types and props interfaces for CedrosAdminDashboard
|
|
1362
1407
|
*/
|
|
1363
1408
|
/** Available dashboard sections */
|
|
1364
|
-
export declare type DashboardSection = 'users' | 'team' | 'referrals' | 'deposits' | 'withdrawals' | 'settings-wallet' | 'settings-auth' | 'settings-messaging' | 'settings-credits' | 'settings-server' | 'settings-images';
|
|
1409
|
+
export declare type DashboardSection = 'users' | 'team' | 'referrals' | 'deposits' | 'withdrawals' | 'compliance' | 'accreditation-queue' | 'sanctions' | 'settings-wallet' | 'settings-auth' | 'settings-messaging' | 'settings-credits' | 'settings-compliance' | 'settings-referrals' | 'settings-server' | 'settings-images';
|
|
1365
1410
|
|
|
1366
1411
|
declare type DeepPartial<T> = {
|
|
1367
1412
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
@@ -3036,6 +3081,12 @@ declare interface ReferralInfo {
|
|
|
3036
3081
|
directPayoutEnabled: boolean;
|
|
3037
3082
|
}
|
|
3038
3083
|
|
|
3084
|
+
export declare function ReferralSettings({ className }: ReferralSettingsProps): JSX.Element;
|
|
3085
|
+
|
|
3086
|
+
export declare interface ReferralSettingsProps {
|
|
3087
|
+
className?: string;
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3039
3090
|
/**
|
|
3040
3091
|
* A single user entry in the referral network response
|
|
3041
3092
|
*/
|
|
@@ -3109,6 +3160,53 @@ export declare interface RevokeAllSessionsResponse {
|
|
|
3109
3160
|
message: string;
|
|
3110
3161
|
}
|
|
3111
3162
|
|
|
3163
|
+
declare interface RewardHistoryItem {
|
|
3164
|
+
id: string;
|
|
3165
|
+
triggerType: string;
|
|
3166
|
+
amount: number;
|
|
3167
|
+
currency: string;
|
|
3168
|
+
status: string;
|
|
3169
|
+
txSignature: string | null;
|
|
3170
|
+
createdAt: string;
|
|
3171
|
+
completedAt: string | null;
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
declare interface RewardsHistoryResponse {
|
|
3175
|
+
items: RewardHistoryItem[];
|
|
3176
|
+
total: number;
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
declare interface RewardsInfo {
|
|
3180
|
+
totalEarned: number;
|
|
3181
|
+
pendingAmount: number;
|
|
3182
|
+
pendingCount: number;
|
|
3183
|
+
currency: string;
|
|
3184
|
+
rewardType: string;
|
|
3185
|
+
payoutWalletAddress: string | null;
|
|
3186
|
+
referralCount: number;
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
/**
|
|
3190
|
+
* Self-contained rewards dashboard panel.
|
|
3191
|
+
*
|
|
3192
|
+
* Shows a summary of earned rewards, pending payouts, referral count,
|
|
3193
|
+
* a payout wallet editor (for direct_payout mode), and a paginated history
|
|
3194
|
+
* table with Solana explorer links.
|
|
3195
|
+
*
|
|
3196
|
+
* @example
|
|
3197
|
+
* ```tsx
|
|
3198
|
+
* <RewardsPanel explorerUrl="https://explorer.solana.com" />
|
|
3199
|
+
* ```
|
|
3200
|
+
*/
|
|
3201
|
+
export declare function RewardsPanel({ explorerUrl, className }: RewardsPanelProps): JSX.Element;
|
|
3202
|
+
|
|
3203
|
+
export declare interface RewardsPanelProps {
|
|
3204
|
+
/** Solana explorer URL base (default: https://explorer.solana.com) */
|
|
3205
|
+
explorerUrl?: string;
|
|
3206
|
+
/** Additional CSS class */
|
|
3207
|
+
className?: string;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3112
3210
|
/**
|
|
3113
3211
|
* Request to rotate user secret (re-encrypt Share A)
|
|
3114
3212
|
*
|
|
@@ -3135,6 +3233,17 @@ export declare type RotateUserSecretRequest = UnlockCredentialRequest & {
|
|
|
3135
3233
|
prfSalt?: string;
|
|
3136
3234
|
};
|
|
3137
3235
|
|
|
3236
|
+
/**
|
|
3237
|
+
* Stats returned by GET /admin/sanctions/stats
|
|
3238
|
+
*/
|
|
3239
|
+
export declare interface SanctionsStats {
|
|
3240
|
+
sanctionedAddresses: number;
|
|
3241
|
+
sanctionedCountries: number;
|
|
3242
|
+
cacheAgeSeconds?: number;
|
|
3243
|
+
lastRefreshedAt?: string;
|
|
3244
|
+
configured: boolean;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3138
3247
|
/** Section identifier, unique within a plugin */
|
|
3139
3248
|
export declare type SectionId = string;
|
|
3140
3249
|
|
|
@@ -3691,6 +3800,50 @@ export declare interface TokenBalanceEntry {
|
|
|
3691
3800
|
decimals: number;
|
|
3692
3801
|
}
|
|
3693
3802
|
|
|
3803
|
+
/**
|
|
3804
|
+
* Token gate enforcement scope.
|
|
3805
|
+
*/
|
|
3806
|
+
export declare type TokenGateEnforcement = 'all' | 'deposits' | 'withdrawals';
|
|
3807
|
+
|
|
3808
|
+
/**
|
|
3809
|
+
* A single token gate rule stored in the `token_gating_rules` system setting.
|
|
3810
|
+
*/
|
|
3811
|
+
export declare interface TokenGateRule {
|
|
3812
|
+
id: string;
|
|
3813
|
+
name: string;
|
|
3814
|
+
ruleType: TokenGateRuleType;
|
|
3815
|
+
collectionAddress?: string;
|
|
3816
|
+
mintAddress?: string;
|
|
3817
|
+
minQuantity?: number;
|
|
3818
|
+
minAmount?: string;
|
|
3819
|
+
enforcement: TokenGateEnforcement;
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3822
|
+
/**
|
|
3823
|
+
* Token gate rule type.
|
|
3824
|
+
*/
|
|
3825
|
+
export declare type TokenGateRuleType = 'nft_collection' | 'fungible_token' | 'any_nft';
|
|
3826
|
+
|
|
3827
|
+
/**
|
|
3828
|
+
* Admin settings panel for token gate rules.
|
|
3829
|
+
*
|
|
3830
|
+
* Inputs: className optional CSS modifier.
|
|
3831
|
+
* Outputs: reads/writes `token_gating_rules` system setting as JSON.
|
|
3832
|
+
* Errors: displayed inline; save errors shown near the form.
|
|
3833
|
+
*/
|
|
3834
|
+
export declare function TokenGateSettings({ className }: TokenGateSettingsProps): JSX.Element;
|
|
3835
|
+
|
|
3836
|
+
/**
|
|
3837
|
+
* Admin settings page for managing token gate rules.
|
|
3838
|
+
*
|
|
3839
|
+
* Rules are persisted as JSON in the `token_gating_rules` system setting.
|
|
3840
|
+
* Each rule specifies a token type, address/mint, minimum hold amount, and
|
|
3841
|
+
* which operations (deposits / withdrawals / all) are gated.
|
|
3842
|
+
*/
|
|
3843
|
+
export declare interface TokenGateSettingsProps {
|
|
3844
|
+
className?: string;
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3694
3847
|
/**
|
|
3695
3848
|
* JWT token pair returned from authentication
|
|
3696
3849
|
*/
|
|
@@ -5050,6 +5203,48 @@ export declare interface UseReferralReturn {
|
|
|
5050
5203
|
error: Error | null;
|
|
5051
5204
|
}
|
|
5052
5205
|
|
|
5206
|
+
/**
|
|
5207
|
+
* Hook for fetching rewards info and history, and managing payout wallet.
|
|
5208
|
+
*
|
|
5209
|
+
* @example
|
|
5210
|
+
* ```tsx
|
|
5211
|
+
* const { rewards, history, fetchRewards, fetchHistory, setPayoutWallet, isLoading } = useRewards();
|
|
5212
|
+
*
|
|
5213
|
+
* useEffect(() => {
|
|
5214
|
+
* fetchRewards();
|
|
5215
|
+
* fetchHistory(10, 0);
|
|
5216
|
+
* }, [fetchRewards, fetchHistory]);
|
|
5217
|
+
* ```
|
|
5218
|
+
*/
|
|
5219
|
+
export declare function useRewards(): UseRewardsReturn;
|
|
5220
|
+
|
|
5221
|
+
/**
|
|
5222
|
+
* Return type for the useRewards hook.
|
|
5223
|
+
*
|
|
5224
|
+
* Inputs: none (reads config from CedrosLoginProvider context)
|
|
5225
|
+
* Outputs: rewards summary, history list, and mutation methods
|
|
5226
|
+
* Errors: all methods throw on failure and set `error` state
|
|
5227
|
+
* Invariants: `isLoading` is true only while a request is in flight
|
|
5228
|
+
*/
|
|
5229
|
+
export declare interface UseRewardsReturn {
|
|
5230
|
+
/** Rewards summary data */
|
|
5231
|
+
rewards: RewardsInfo | null;
|
|
5232
|
+
/** Reward history items */
|
|
5233
|
+
history: RewardHistoryItem[];
|
|
5234
|
+
/** Total history count */
|
|
5235
|
+
historyTotal: number;
|
|
5236
|
+
/** Fetch rewards summary */
|
|
5237
|
+
fetchRewards: () => Promise<RewardsInfo>;
|
|
5238
|
+
/** Fetch reward history (paginated) */
|
|
5239
|
+
fetchHistory: (limit?: number, offset?: number) => Promise<RewardsHistoryResponse>;
|
|
5240
|
+
/** Set payout wallet address (null to clear) */
|
|
5241
|
+
setPayoutWallet: (walletAddress: string | null) => Promise<void>;
|
|
5242
|
+
/** Whether a request is in progress */
|
|
5243
|
+
isLoading: boolean;
|
|
5244
|
+
/** Error from the last operation */
|
|
5245
|
+
error: Error | null;
|
|
5246
|
+
}
|
|
5247
|
+
|
|
5053
5248
|
/**
|
|
5054
5249
|
* User profile settings panel.
|
|
5055
5250
|
*
|