@chainloyalty/react 1.0.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.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @chainloyalty/react
3
+ * Main entry point for the ChainLoyalty React package
4
+ */
5
+ export { useTrackEvent, trackEvent } from './useTrackEvent.js';
6
+ export type { EventData, EventType, TrackEventResponse, UseTrackEventState } from './useTrackEvent.js';
7
+ export { RewardsDashboard } from './RewardsDashboard.js';
8
+ export type { RewardsDashboardProps, Badge, RewardHistoryItem, TierInfo, DashboardData } from './RewardsDashboard.js';
9
+ export { Leaderboard } from './Leaderboard.js';
10
+ export type { LeaderboardProps, LeaderboardEntry, LeaderboardTimeframe } from './Leaderboard.js';
11
+ export declare const PACKAGE_VERSION = "1.0.0";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGjG,eAAO,MAAM,eAAe,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @chainloyalty/react
3
+ * Main entry point for the ChainLoyalty React package
4
+ */
5
+ // Export hooks
6
+ export { useTrackEvent, trackEvent } from './useTrackEvent.js';
7
+ // Export components
8
+ export { RewardsDashboard } from './RewardsDashboard.js';
9
+ export { Leaderboard } from './Leaderboard.js';
10
+ // Version info
11
+ export const PACKAGE_VERSION = '1.0.0';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAe;AACf,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAG/D,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,eAAe;AACf,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @chainloyalty/react - useTrackEvent Hook
3
+ *
4
+ * Purpose:
5
+ * This hook provides a simple way to track user events in ChainLoyalty.
6
+ * It automatically captures the connected wallet address and handles:
7
+ * - Multiple event types (subscription, referral, feature_usage, milestone, purchase)
8
+ * - Loading, success, and error states
9
+ * - Toast notifications for user feedback
10
+ * - Returning structured responses
11
+ *
12
+ * Functionality:
13
+ * - useTrackEvent: React hook for tracking events within components
14
+ * - trackEvent: Standalone async function for tracking events programmatically
15
+ * - Automatic wallet address attachment
16
+ * - Built-in error handling and user notifications
17
+ */
18
+ export type EventType = 'subscription' | 'referral' | 'feature_usage' | 'milestone' | 'purchase';
19
+ export interface EventData {
20
+ type: EventType;
21
+ metadata?: Record<string, any>;
22
+ value?: number;
23
+ description?: string;
24
+ }
25
+ export interface TrackEventResponse {
26
+ success: boolean;
27
+ eventId?: string;
28
+ message: string;
29
+ data?: Record<string, any>;
30
+ error?: string;
31
+ }
32
+ export interface UseTrackEventState {
33
+ loading: boolean;
34
+ error: string | null;
35
+ success: boolean;
36
+ }
37
+ /**
38
+ * Standalone function to track an event programmatically.
39
+ * Can be called outside of React components.
40
+ *
41
+ * @param eventData - Event details (type, metadata, value, description)
42
+ * @param walletAddress - Connected wallet address (required)
43
+ * @returns Promise with tracking result
44
+ */
45
+ export declare const trackEvent: (eventData: EventData, walletAddress: string) => Promise<TrackEventResponse>;
46
+ /**
47
+ * React hook for tracking events within components.
48
+ * Provides loading, error, and success states.
49
+ * Automatically manages wallet state.
50
+ *
51
+ * @param walletAddress - Connected wallet address (required)
52
+ * @returns Object with track function and state
53
+ */
54
+ export declare const useTrackEvent: (walletAddress: string | null) => {
55
+ track: (eventData: EventData) => Promise<TrackEventResponse>;
56
+ loading: boolean;
57
+ error: string | null;
58
+ success: boolean;
59
+ };
60
+ /**
61
+ * Example of how to use useTrackEvent in a component:
62
+ *
63
+ * const { track, loading, error, success } = useTrackEvent(walletAddress);
64
+ *
65
+ * const handlePurchase = async () => {
66
+ * const response = await track({
67
+ * type: 'purchase',
68
+ * value: 99.99,
69
+ * description: 'Premium subscription',
70
+ * metadata: { productId: 'prod_123' },
71
+ * });
72
+ * };
73
+ */
74
+ export default useTrackEvent;
75
+ //# sourceMappingURL=useTrackEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTrackEvent.d.ts","sourceRoot":"","sources":["../src/useTrackEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,UAAU,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC;AAEjG,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAwED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACrB,WAAW,SAAS,EACpB,eAAe,MAAM,KACpB,OAAO,CAAC,kBAAkB,CAqD5B,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,eAAe,MAAM,GAAG,IAAI;uBAQpC,SAAS,KAAG,OAAO,CAAC,kBAAkB,CAAC;;;;CAgD5D,CAAC;AAMF;;;;;;;;;;;;;GAaG;AAEH,eAAe,aAAa,CAAC"}
@@ -0,0 +1,218 @@
1
+ /**
2
+ * @chainloyalty/react - useTrackEvent Hook
3
+ *
4
+ * Purpose:
5
+ * This hook provides a simple way to track user events in ChainLoyalty.
6
+ * It automatically captures the connected wallet address and handles:
7
+ * - Multiple event types (subscription, referral, feature_usage, milestone, purchase)
8
+ * - Loading, success, and error states
9
+ * - Toast notifications for user feedback
10
+ * - Returning structured responses
11
+ *
12
+ * Functionality:
13
+ * - useTrackEvent: React hook for tracking events within components
14
+ * - trackEvent: Standalone async function for tracking events programmatically
15
+ * - Automatic wallet address attachment
16
+ * - Built-in error handling and user notifications
17
+ */
18
+ import { useState, useCallback } from 'react';
19
+ // ============================================================================
20
+ // Mock Toast Notification System (Production: replace with your toast library)
21
+ // ============================================================================
22
+ const showToast = (message, type = 'success') => {
23
+ // In production, use react-hot-toast, sonner, or similar
24
+ console.log(`[${type.toUpperCase()}]`, message);
25
+ // Create a simple visual toast for demo
26
+ const toast = document.createElement('div');
27
+ toast.style.cssText = `
28
+ position: fixed;
29
+ bottom: 20px;
30
+ right: 20px;
31
+ padding: 12px 20px;
32
+ border-radius: 6px;
33
+ background-color: ${type === 'success' ? '#3FB950' : '#f85149'};
34
+ color: white;
35
+ font-size: 14px;
36
+ font-weight: 500;
37
+ z-index: 9999;
38
+ animation: slideInUp 0.3s ease-out;
39
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
40
+ `;
41
+ toast.textContent = message;
42
+ document.body.appendChild(toast);
43
+ setTimeout(() => {
44
+ toast.style.animation = 'slideOutDown 0.3s ease-in';
45
+ setTimeout(() => toast.remove(), 300);
46
+ }, 3000);
47
+ };
48
+ // ============================================================================
49
+ // Mock API Call Function
50
+ // ============================================================================
51
+ const callEventIngestionAPI = async (eventData) => {
52
+ // In production, replace this with actual API call:
53
+ // return fetch('/api/events/track', {
54
+ // method: 'POST',
55
+ // headers: { 'Content-Type': 'application/json' },
56
+ // body: JSON.stringify(eventData),
57
+ // }).then(res => res.json());
58
+ // Mock API call with realistic delay
59
+ return new Promise((resolve) => {
60
+ setTimeout(() => {
61
+ const eventId = `evt_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
62
+ resolve({
63
+ success: true,
64
+ eventId,
65
+ message: `Event "${eventData.type}" tracked successfully`,
66
+ data: {
67
+ type: eventData.type,
68
+ walletAddress: eventData.walletAddress,
69
+ timestamp: new Date().toISOString(),
70
+ eventId,
71
+ },
72
+ });
73
+ }, 500);
74
+ });
75
+ };
76
+ // ============================================================================
77
+ // Standalone trackEvent Function
78
+ // ============================================================================
79
+ /**
80
+ * Standalone function to track an event programmatically.
81
+ * Can be called outside of React components.
82
+ *
83
+ * @param eventData - Event details (type, metadata, value, description)
84
+ * @param walletAddress - Connected wallet address (required)
85
+ * @returns Promise with tracking result
86
+ */
87
+ export const trackEvent = async (eventData, walletAddress) => {
88
+ try {
89
+ if (!walletAddress) {
90
+ const error = 'Wallet address is required to track events';
91
+ showToast(error, 'error');
92
+ return {
93
+ success: false,
94
+ message: error,
95
+ error,
96
+ };
97
+ }
98
+ // Validate event type
99
+ const validEventTypes = [
100
+ 'subscription',
101
+ 'referral',
102
+ 'feature_usage',
103
+ 'milestone',
104
+ 'purchase',
105
+ ];
106
+ if (!validEventTypes.includes(eventData.type)) {
107
+ const error = `Invalid event type: ${eventData.type}`;
108
+ showToast(error, 'error');
109
+ return {
110
+ success: false,
111
+ message: error,
112
+ error,
113
+ };
114
+ }
115
+ // Call API
116
+ const response = await callEventIngestionAPI({
117
+ ...eventData,
118
+ walletAddress,
119
+ });
120
+ // Show success notification
121
+ if (response.success) {
122
+ showToast(response.message, 'success');
123
+ }
124
+ else {
125
+ showToast(response.message || 'Failed to track event', 'error');
126
+ }
127
+ return response;
128
+ }
129
+ catch (err) {
130
+ const errorMessage = err instanceof Error ? err.message : 'Failed to track event';
131
+ showToast(errorMessage, 'error');
132
+ return {
133
+ success: false,
134
+ message: errorMessage,
135
+ error: errorMessage,
136
+ };
137
+ }
138
+ };
139
+ // ============================================================================
140
+ // useTrackEvent Hook
141
+ // ============================================================================
142
+ /**
143
+ * React hook for tracking events within components.
144
+ * Provides loading, error, and success states.
145
+ * Automatically manages wallet state.
146
+ *
147
+ * @param walletAddress - Connected wallet address (required)
148
+ * @returns Object with track function and state
149
+ */
150
+ export const useTrackEvent = (walletAddress) => {
151
+ const [state, setState] = useState({
152
+ loading: false,
153
+ error: null,
154
+ success: false,
155
+ });
156
+ const track = useCallback(async (eventData) => {
157
+ // Reset state
158
+ setState({ loading: true, error: null, success: false });
159
+ try {
160
+ if (!walletAddress) {
161
+ throw new Error('Wallet not connected. Please connect your wallet first.');
162
+ }
163
+ // Call tracking function
164
+ const response = await trackEvent(eventData, walletAddress);
165
+ // Update state based on response
166
+ if (response.success) {
167
+ setState({ loading: false, error: null, success: true });
168
+ }
169
+ else {
170
+ setState({
171
+ loading: false,
172
+ error: response.error || response.message,
173
+ success: false,
174
+ });
175
+ }
176
+ return response;
177
+ }
178
+ catch (err) {
179
+ const errorMessage = err instanceof Error ? err.message : 'Unknown error';
180
+ setState({
181
+ loading: false,
182
+ error: errorMessage,
183
+ success: false,
184
+ });
185
+ showToast(errorMessage, 'error');
186
+ return {
187
+ success: false,
188
+ message: errorMessage,
189
+ error: errorMessage,
190
+ };
191
+ }
192
+ }, [walletAddress]);
193
+ return {
194
+ track,
195
+ loading: state.loading,
196
+ error: state.error,
197
+ success: state.success,
198
+ };
199
+ };
200
+ // ============================================================================
201
+ // Example Usage Hook (for documentation)
202
+ // ============================================================================
203
+ /**
204
+ * Example of how to use useTrackEvent in a component:
205
+ *
206
+ * const { track, loading, error, success } = useTrackEvent(walletAddress);
207
+ *
208
+ * const handlePurchase = async () => {
209
+ * const response = await track({
210
+ * type: 'purchase',
211
+ * value: 99.99,
212
+ * description: 'Premium subscription',
213
+ * metadata: { productId: 'prod_123' },
214
+ * });
215
+ * };
216
+ */
217
+ export default useTrackEvent;
218
+ //# sourceMappingURL=useTrackEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTrackEvent.js","sourceRoot":"","sources":["../src/useTrackEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AA6B9C,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAE/E,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,OAA4B,SAAS,EAAE,EAAE;IAC3E,yDAAyD;IACzD,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAEhD,wCAAwC;IACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5C,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG;;;;;;wBAMA,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;;;;;;;GAO/D,CAAC;IACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;IAC5B,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,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YAC1E,QAAQ,CAAC;gBACP,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,YAAY;gBACnB,OAAO,EAAE,KAAK;aACf,CAAC,CAAC;YACH,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YACjC,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,YAAY;gBACrB,KAAK,EAAE,YAAY;aACpB,CAAC;QACJ,CAAC;IACH,CAAC,EACD,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,OAAO;QACL,KAAK;QACL,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF,+EAA+E;AAC/E,yCAAyC;AACzC,+EAA+E;AAE/E;;;;;;;;;;;;;GAaG;AAEH,eAAe,aAAa,CAAC"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@chainloyalty/react",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "ChainLoyalty React Components - Event tracking, rewards dashboard, and leaderboard",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "type-check": "tsc --noEmit",
11
+ "dev": "tsc --watch"
12
+ },
13
+ "keywords": [
14
+ "chainloyalty",
15
+ "react",
16
+ "rewards",
17
+ "web3"
18
+ ],
19
+ "author": "ChainLoyalty Team",
20
+ "license": "MIT",
21
+ "dependencies": {
22
+ "@chainloyalty/react": "file:",
23
+ "lucide-react": "^0.263.1",
24
+ "react": ">=16.8.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/react": "^18.2.0",
28
+ "typescript": "^5.0.0"
29
+ },
30
+ "peerDependencies": {
31
+ "react": ">=16.8.0"
32
+ }
33
+ }