@proofchain/sdk 1.2.0 → 2.1.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.
package/dist/index.d.mts CHANGED
@@ -1,328 +1,2578 @@
1
- import { Signer, Provider, ContractTransactionResponse } from 'ethers';
2
-
3
- interface ChallengeRequest {
4
- wallet_address: string;
5
- }
6
- interface VerifyRequest {
7
- wallet_address: string;
8
- signature: string;
9
- message: string;
1
+ /**
2
+ * HTTP Client for ProofChain API
3
+ */
4
+ interface HttpClientOptions {
5
+ apiKey: string;
6
+ baseUrl?: string;
7
+ timeout?: number;
8
+ maxRetries?: number;
10
9
  }
11
- interface EventCreate {
12
- user_id: string;
13
- event_type: string;
14
- data: Record<string, unknown>;
10
+ declare class HttpClient {
11
+ private apiKey;
12
+ private baseUrl;
13
+ private timeout;
14
+ private maxRetries;
15
+ constructor(options: HttpClientOptions);
16
+ private getHeaders;
17
+ private handleResponse;
18
+ private fetchWithRetry;
19
+ request<T>(method: string, path: string, options?: {
20
+ body?: unknown;
21
+ params?: Record<string, string | number | undefined>;
22
+ }): Promise<T>;
23
+ requestMultipart<T>(path: string, formData: FormData): Promise<T>;
24
+ getRaw(path: string): Promise<ArrayBuffer>;
25
+ get<T>(path: string, params?: Record<string, string | number | undefined>): Promise<T>;
26
+ post<T>(path: string, body?: unknown): Promise<T>;
27
+ put<T>(path: string, body?: unknown): Promise<T>;
28
+ patch<T>(path: string, body?: unknown): Promise<T>;
29
+ delete<T>(path: string): Promise<T>;
15
30
  }
16
- interface EventQuery {
17
- event_types?: string[];
18
- start_time?: string;
19
- end_time?: string;
20
- include_invalidated?: boolean;
31
+
32
+ /**
33
+ * ProofChain SDK Types
34
+ */
35
+ type AttestationMode = 'direct' | 'batch' | 'channel';
36
+ type EventStatus = 'pending' | 'queued' | 'confirmed' | 'settled' | 'failed';
37
+ type ChannelState = 'open' | 'syncing' | 'settling' | 'settled' | 'closed';
38
+ interface AttestationResult {
39
+ id: string;
40
+ ipfsHash: string;
41
+ documentHash: string;
42
+ gatewayUrl: string;
43
+ verifyUrl: string;
44
+ certificateId: string;
45
+ status: EventStatus;
46
+ attestationMode: AttestationMode;
47
+ timestamp: string;
48
+ blockchainTx?: string;
49
+ proof?: string[];
21
50
  }
22
- interface VerifyProofRequest {
23
- leaf: string;
24
- proof: string[];
25
- root: string;
51
+ interface Event {
52
+ id: string;
53
+ eventType: string;
54
+ userId: string;
55
+ ipfsHash: string;
56
+ documentHash?: string;
57
+ gatewayUrl: string;
58
+ certificateId: string;
59
+ status: EventStatus;
60
+ attestationMode: AttestationMode;
61
+ timestamp: string;
62
+ data?: Record<string, unknown>;
63
+ blockchainTx?: string;
64
+ batchId?: string;
65
+ channelId?: string;
26
66
  }
27
- interface LinkWalletRequest {
28
- user_id: string;
29
- wallet_address: string;
30
- is_primary?: boolean;
67
+ interface Channel {
68
+ channelId: string;
69
+ name: string;
70
+ state: ChannelState;
71
+ createdAt: string;
31
72
  }
32
- interface HealthResponse {
33
- status: string;
34
- timestamp: string;
73
+ interface ChannelStatus {
74
+ channelId: string;
75
+ name: string;
76
+ state: ChannelState;
77
+ eventCount: number;
78
+ syncedCount: number;
79
+ pendingCount: number;
80
+ createdAt: string;
81
+ lastActivity?: string;
82
+ lastSettlement?: string;
83
+ merkleRoot?: string;
35
84
  }
36
- interface ChallengeResponse {
37
- message: string;
38
- nonce: string;
39
- expires_at: string;
85
+ interface Settlement {
86
+ channelId: string;
87
+ txHash: string;
88
+ merkleRoot: string;
89
+ eventCount: number;
90
+ blockNumber: number;
91
+ gasUsed: number;
92
+ settledAt: string;
40
93
  }
41
- interface AuthResponse {
42
- access_token: string;
43
- token_type: string;
44
- expires_in: number;
45
- wallet_address: string;
94
+ interface Certificate {
95
+ certificateId: string;
96
+ recipientName: string;
97
+ recipientEmail?: string;
98
+ title: string;
99
+ description?: string;
100
+ ipfsHash: string;
101
+ verifyUrl: string;
102
+ qrCodeUrl: string;
103
+ issuedAt: string;
104
+ expiresAt?: string;
105
+ revoked: boolean;
106
+ revokedAt?: string;
107
+ revocationReason?: string;
108
+ metadata?: Record<string, unknown>;
109
+ blockchainTx?: string;
46
110
  }
47
- interface Event {
111
+ interface Webhook {
48
112
  id: string;
49
- user_id: string;
50
- event_type: string;
51
- ipfs_hash: string;
52
- timestamp: string;
53
- invalidated: boolean;
54
- gateway_url?: string;
55
- data?: Record<string, unknown>;
113
+ url: string;
114
+ events: string[];
115
+ active: boolean;
116
+ createdAt: string;
117
+ lastTriggered?: string;
118
+ failureCount: number;
56
119
  }
57
- interface EventsListResponse {
58
- events: Event[];
120
+ interface VerificationResult {
121
+ valid: boolean;
122
+ ipfsHash: string;
123
+ documentHash?: string;
124
+ timestamp?: string;
125
+ certificateId?: string;
126
+ blockchainTx?: string;
127
+ blockNumber?: number;
128
+ attestationMode?: AttestationMode;
129
+ proofVerified: boolean;
130
+ message: string;
131
+ }
132
+ interface SearchResult {
59
133
  total: number;
134
+ page: number;
60
135
  limit: number;
61
- offset: number;
136
+ events: Event[];
62
137
  }
63
- interface MerkleTree {
64
- user_id: string;
65
- root: string | null;
66
- event_count: number;
67
- rebuilt_at?: string;
138
+ interface UsageStats {
139
+ periodStart: string;
140
+ periodEnd: string;
141
+ eventsCreated: number;
142
+ documentsAttested: number;
143
+ verifications: number;
144
+ apiCalls: number;
145
+ storageBytes: number;
146
+ channelsCreated: number;
147
+ settlements: number;
68
148
  }
69
- interface MerkleProof {
70
- user_id: string;
71
- ipfs_hash: string;
72
- leaf: string;
73
- proof: string[];
74
- root: string;
75
- index: number;
76
- event_type?: string;
77
- timestamp?: number;
149
+ interface TenantInfo {
150
+ tenantId: string;
151
+ name: string;
152
+ subdomain: string;
153
+ plan: string;
154
+ createdAt: string;
155
+ apiKeysCount: number;
156
+ eventsCount: number;
157
+ storageUsedBytes: number;
78
158
  }
79
- interface VerifyProofResponse {
80
- valid: boolean;
81
- leaf: string;
82
- root: string;
159
+ interface StreamAck {
160
+ sequence: number;
161
+ channelId: string;
162
+ received: boolean;
83
163
  }
84
- interface Wallet {
85
- wallet_address: string;
86
- user_id: string;
87
- is_primary: boolean;
88
- linked_at: string;
89
- merkle_root?: string;
90
- onchain_root?: string;
91
- onchain_synced?: boolean;
164
+ interface AttestRequest {
165
+ file: File | Blob | Buffer | ArrayBuffer;
166
+ filename?: string;
167
+ userId: string;
168
+ eventType?: string;
169
+ metadata?: Record<string, unknown>;
170
+ encrypt?: boolean;
92
171
  }
93
- interface WalletStatus {
94
- user_id: string;
95
- wallets: Wallet[];
96
- merkle_root: string | null;
97
- onchain_synced: boolean;
172
+ interface CreateEventRequest {
173
+ eventType: string;
174
+ userId: string;
175
+ data?: Record<string, unknown>;
176
+ source?: string;
98
177
  }
99
- interface AttestationClientConfig {
100
- baseUrl: string;
101
- accessToken?: string;
102
- timeout?: number;
178
+ interface ListEventsRequest {
179
+ userId?: string;
180
+ eventType?: string;
181
+ status?: string;
182
+ startDate?: string;
183
+ endDate?: string;
184
+ limit?: number;
185
+ offset?: number;
103
186
  }
104
- interface RequestOptions {
105
- headers?: Record<string, string>;
106
- signal?: AbortSignal;
187
+ interface SearchRequest {
188
+ query: string;
189
+ userId?: string;
190
+ eventType?: string;
191
+ startDate?: string;
192
+ endDate?: string;
193
+ limit?: number;
194
+ page?: number;
107
195
  }
108
- interface QuestStep {
109
- id: string;
196
+ interface CreateChannelRequest {
110
197
  name: string;
111
198
  description?: string;
112
- order: number;
113
- step_type: 'event_count' | 'event_match' | 'unique_values' | 'cumulative' | 'streak' | 'manual';
114
- event_type?: string;
115
- event_types?: string[];
116
- criteria?: Record<string, unknown>;
117
- required_data_fields?: Record<string, unknown>;
118
- step_points?: number;
119
- icon_url?: string;
120
- is_optional: boolean;
121
199
  }
122
- interface Quest {
123
- id: string;
124
- name: string;
125
- slug: string;
200
+ interface StreamEventRequest {
201
+ eventType: string;
202
+ userId: string;
203
+ data?: Record<string, unknown>;
204
+ source?: string;
205
+ }
206
+ interface IssueCertificateRequest {
207
+ recipientName: string;
208
+ recipientEmail?: string;
209
+ title: string;
126
210
  description?: string;
127
- short_description?: string;
128
- icon_url?: string;
129
- banner_url?: string;
130
- category?: string;
131
- difficulty?: 'easy' | 'medium' | 'hard' | 'legendary';
132
- estimated_time?: string;
133
- status: 'draft' | 'active' | 'paused' | 'ended' | 'archived';
134
- is_ordered: boolean;
135
- is_repeatable: boolean;
136
- is_available: boolean;
137
- total_steps: number;
138
- starts_at?: string;
139
- ends_at?: string;
140
- time_limit_hours?: number;
141
- max_participants?: number;
142
- current_participants: number;
143
- max_completions?: number;
144
- current_completions: number;
145
- reward_points?: number;
146
- is_public: boolean;
147
- is_featured: boolean;
148
- tags: string[];
149
- steps: QuestStep[];
150
- created_at: string;
211
+ metadata?: Record<string, unknown>;
212
+ expiresAt?: string;
213
+ }
214
+ interface ListCertificatesRequest {
215
+ recipientEmail?: string;
216
+ limit?: number;
217
+ offset?: number;
218
+ }
219
+ interface CreateWebhookRequest {
220
+ url: string;
221
+ events: string[];
222
+ secret?: string;
223
+ }
224
+ interface UpdateWebhookRequest {
225
+ url?: string;
226
+ events?: string[];
227
+ active?: boolean;
151
228
  }
152
- interface RewardInfo {
229
+ interface VaultFile {
230
+ id: string;
231
+ filename: string;
232
+ mimeType: string;
233
+ size: number;
234
+ ipfsHash: string;
235
+ userId: string;
236
+ folderId?: string;
237
+ accessMode: 'private' | 'public' | 'shared';
238
+ createdAt: string;
239
+ updatedAt?: string;
240
+ }
241
+ interface VaultFolder {
153
242
  id: string;
154
243
  name: string;
155
- description?: string;
156
- type: 'points' | 'nft' | 'badge' | 'coupon' | 'custom';
157
- image_url?: string;
158
- issued_at?: string;
159
- claimed: boolean;
160
- claim_url?: string;
161
- metadata: Record<string, unknown>;
244
+ parentId?: string;
245
+ createdAt: string;
162
246
  }
163
- interface UserQuestProgress {
247
+ interface VaultListResponse {
248
+ files: VaultFile[];
249
+ folders: VaultFolder[];
250
+ totalFiles: number;
251
+ totalSize: number;
252
+ }
253
+ interface VaultStats {
254
+ totalFiles: number;
255
+ totalFolders: number;
256
+ totalSize: number;
257
+ usedQuota: number;
258
+ maxQuota: number;
259
+ }
260
+ interface VaultUploadRequest {
261
+ file: File | Blob | Buffer | ArrayBuffer;
262
+ filename?: string;
263
+ userId: string;
264
+ folderId?: string;
265
+ accessMode?: 'private' | 'public' | 'shared';
266
+ }
267
+ interface SearchFilters {
268
+ query?: string;
269
+ eventTypes?: string[];
270
+ eventSources?: string[];
271
+ userIds?: string[];
272
+ status?: string;
273
+ hasDocument?: boolean;
274
+ hasBlockchainProof?: boolean;
275
+ fromDate?: string;
276
+ toDate?: string;
277
+ }
278
+ interface SearchQueryRequest {
279
+ filters?: SearchFilters;
280
+ offset?: number;
281
+ limit?: number;
282
+ includeData?: boolean;
283
+ }
284
+ interface SearchResponse {
285
+ total: number;
286
+ offset: number;
287
+ limit: number;
288
+ results: Event[];
289
+ }
290
+ interface Facet {
291
+ key: string;
292
+ count: number;
293
+ }
294
+ interface FacetsResponse {
295
+ eventTypes: Facet[];
296
+ eventSources: Facet[];
297
+ statuses: Facet[];
298
+ users: Facet[];
299
+ }
300
+ interface SearchStats {
301
+ periodDays: number;
302
+ totalEvents: number;
303
+ uniqueUsers: number;
304
+ eventsPerDay: number;
305
+ totalStorageBytes: number;
306
+ }
307
+ interface CertificateVerifyResult {
308
+ certificateId: string;
309
+ status: 'VALID' | 'REVOKED' | 'EXPIRED' | 'NOT_FOUND';
310
+ recipientName: string;
311
+ title: string;
312
+ issuedAt: string;
313
+ expiresAt?: string;
314
+ revokedAt?: string;
315
+ revocationReason?: string;
316
+ ipfsHash: string;
317
+ verifyUrl: string;
318
+ blockchain?: Record<string, unknown>;
319
+ }
320
+ interface ProofVerifyResult {
321
+ valid: boolean;
322
+ message: string;
323
+ verifiedAt: string;
324
+ }
325
+ interface BatchVerifyResult {
326
+ batchId: string;
327
+ merkleRoot: string;
328
+ totalEvents: number;
329
+ blockchainTx?: string;
330
+ blockNumber?: number;
331
+ verified: boolean;
332
+ }
333
+ interface EventBatchProof {
334
+ eventId: string;
335
+ certificateId: string;
336
+ batchId: string;
337
+ leafIndex: number;
338
+ merkleProof: string[];
339
+ merkleRoot: string;
340
+ blockchainTx?: string;
341
+ verified: boolean;
342
+ }
343
+ interface ApiKey {
164
344
  id: string;
165
- quest_id: string;
166
- user_id: string;
167
- status: 'not_started' | 'in_progress' | 'completed' | 'reward_pending' | 'reward_issued' | 'expired' | 'abandoned';
168
- current_step: number;
169
- steps_completed: number;
170
- total_steps: number;
171
- completion_percentage: number;
172
- points_earned: number;
173
- step_progress: Record<string, {
174
- count: number;
175
- unique_values?: string[];
176
- completed?: boolean;
177
- completed_at?: string;
178
- }>;
179
- started_at?: string;
180
- completed_at?: string;
181
- expires_at?: string;
182
- completion_count: number;
183
- reward_earned_id?: string;
184
- reward_issued_at?: string;
185
- reward?: RewardInfo;
186
- }
187
- interface QuestWithProgress {
188
- quest: Quest;
189
- progress?: UserQuestProgress;
190
- }
191
- interface QuestStepCompletionResult {
192
- step_index: number;
193
- step_completed: boolean;
194
- quest_completed: boolean;
195
- current_count: number;
196
- target_count: number;
197
- points_earned: number;
345
+ name: string;
346
+ keyPrefix: string;
347
+ permissions: string[];
348
+ createdAt: string;
349
+ lastUsedAt?: string;
350
+ expiresAt?: string;
351
+ isActive: boolean;
352
+ key?: string;
198
353
  }
354
+ interface BlockchainStats {
355
+ totalTransactions: number;
356
+ totalGasUsed: number;
357
+ totalEventsAttested: number;
358
+ pendingEvents: number;
359
+ lastTransaction?: string;
360
+ contractAddress?: string;
361
+ chainId: number;
362
+ chainName: string;
363
+ }
364
+ interface BlockchainProof {
365
+ certificateId: string;
366
+ verified: boolean;
367
+ txHash?: string;
368
+ blockNumber?: number;
369
+ merkleRoot?: string;
370
+ merkleProof?: string[];
371
+ leafIndex?: number;
372
+ chainName: string;
373
+ }
374
+ interface CreateApiKeyRequest {
375
+ name: string;
376
+ permissions?: string[];
377
+ expiresInDays?: number;
378
+ }
379
+ interface ProofChainOptions {
380
+ apiKey: string;
381
+ baseUrl?: string;
382
+ timeout?: number;
383
+ maxRetries?: number;
384
+ }
385
+
386
+ /**
387
+ * Vault Resource - File storage operations
388
+ */
199
389
 
200
- declare class AttestationClientError extends Error {
201
- status: number;
202
- body?: unknown | undefined;
203
- constructor(message: string, status: number, body?: unknown | undefined);
390
+ declare class VaultResource {
391
+ private http;
392
+ constructor(http: HttpClient);
393
+ /**
394
+ * List files and folders in the vault.
395
+ */
396
+ list(folderId?: string): Promise<VaultListResponse>;
397
+ /**
398
+ * Upload a file to the vault.
399
+ */
400
+ upload(request: VaultUploadRequest): Promise<VaultFile>;
401
+ /**
402
+ * Get file details.
403
+ */
404
+ get(fileId: string): Promise<VaultFile>;
405
+ /**
406
+ * Download a file.
407
+ */
408
+ download(fileId: string): Promise<ArrayBuffer>;
409
+ /**
410
+ * Delete a file.
411
+ */
412
+ delete(fileId: string): Promise<void>;
413
+ /**
414
+ * Move a file to a folder.
415
+ */
416
+ move(fileId: string, folderId: string): Promise<VaultFile>;
417
+ /**
418
+ * Create a folder.
419
+ */
420
+ createFolder(name: string, parentId?: string): Promise<VaultFolder>;
421
+ /**
422
+ * Delete a folder.
423
+ */
424
+ deleteFolder(folderId: string): Promise<void>;
425
+ /**
426
+ * Get vault statistics.
427
+ */
428
+ stats(): Promise<VaultStats>;
429
+ /**
430
+ * Create a shareable link.
431
+ */
432
+ share(fileId: string, expiresInHours?: number): Promise<{
433
+ url: string;
434
+ expiresAt: string;
435
+ }>;
204
436
  }
205
- declare class AttestationClient {
206
- private baseUrl;
207
- private accessToken?;
208
- private timeout;
209
- constructor(config: AttestationClientConfig);
210
- private request;
211
- setAccessToken(token: string): void;
212
- clearAccessToken(): void;
213
- health(): Promise<HealthResponse>;
214
- requestChallenge(walletAddress: string): Promise<ChallengeResponse>;
215
- verifySignature(walletAddress: string, signature: string, message: string): Promise<AuthResponse>;
216
- createEvent(event: EventCreate): Promise<Event>;
217
- getEvents(userId: string, options?: {
218
- limit?: number;
219
- offset?: number;
220
- eventType?: string;
221
- fetchData?: boolean;
222
- }): Promise<EventsListResponse>;
223
- queryEvents(userId: string, query: EventQuery): Promise<EventsListResponse>;
224
- rebuildMerkleTree(userId: string): Promise<MerkleTree>;
225
- getMerkleRoot(userId: string): Promise<MerkleTree>;
226
- getMerkleProof(userId: string, ipfsHash: string): Promise<MerkleProof>;
227
- verifyMerkleProof(leaf: string, proof: string[], root: string): Promise<VerifyProofResponse>;
228
- linkWallet(request: LinkWalletRequest): Promise<Wallet>;
229
- getWalletStatus(userId: string): Promise<WalletStatus>;
230
- /**
231
- * List available quests for a user
232
- * @param userId - End user external ID
233
- * @param options - Filter options
234
- */
235
- getAvailableQuests(userId: string, options?: {
236
- category?: string;
237
- limit?: number;
238
- }): Promise<QuestWithProgress[]>;
437
+
438
+ /**
439
+ * Search Resource - Advanced search operations
440
+ */
441
+
442
+ declare class SearchResource {
443
+ private http;
444
+ constructor(http: HttpClient);
239
445
  /**
240
- * Get a specific quest by ID with all steps
241
- * @param questId - Quest ID
446
+ * Search events with filters.
242
447
  */
243
- getQuest(questId: string): Promise<Quest>;
448
+ query(request?: SearchQueryRequest): Promise<SearchResponse>;
244
449
  /**
245
- * Start a quest for a user
246
- * @param questId - Quest ID
247
- * @param userId - End user external ID
450
+ * Quick search across all fields.
248
451
  */
249
- startQuest(questId: string, userId: string): Promise<UserQuestProgress>;
452
+ quick(query: string, limit?: number): Promise<SearchResponse>;
250
453
  /**
251
- * Get user's progress on a specific quest
252
- * @param questId - Quest ID
253
- * @param userId - End user external ID
454
+ * Get events for a specific user.
254
455
  */
255
- getQuestProgress(questId: string, userId: string): Promise<UserQuestProgress>;
456
+ byUser(userId: string, limit?: number, offset?: number): Promise<SearchResponse>;
256
457
  /**
257
- * Get all quest progress for a user
258
- * @param userId - End user external ID
259
- * @param status - Optional status filter
458
+ * Get event by certificate ID.
459
+ */
460
+ byCertificate(certificateId: string): Promise<Event>;
461
+ /**
462
+ * Get faceted aggregations.
260
463
  */
261
- getUserQuestProgress(userId: string, status?: string): Promise<UserQuestProgress[]>;
464
+ facets(fromDate?: string, toDate?: string): Promise<FacetsResponse>;
262
465
  /**
263
- * Complete or increment a quest step
264
- * @param questId - Quest ID
265
- * @param userId - End user external ID
266
- * @param stepIndex - Step index (0-based)
267
- * @param options - Completion options
466
+ * Get search statistics.
268
467
  */
269
- completeQuestStep(questId: string, userId: string, stepIndex: number, options?: {
270
- count?: number;
271
- value?: string;
272
- }): Promise<QuestStepCompletionResult>;
468
+ stats(): Promise<SearchStats>;
273
469
  }
274
470
 
275
- interface AttestationRoot {
276
- merkleRoot: string;
277
- eventCount: bigint;
278
- lastUpdated: bigint;
279
- latestIpfsHash: string;
471
+ /**
472
+ * Verify Resource - Public verification operations
473
+ */
474
+
475
+ declare class VerifyResource {
476
+ private http;
477
+ constructor(http: HttpClient);
478
+ /**
479
+ * Verify a certificate by ID.
480
+ */
481
+ certificate(certificateId: string): Promise<CertificateVerifyResult>;
482
+ /**
483
+ * Verify an event by IPFS hash.
484
+ */
485
+ event(ipfsHash: string): Promise<Record<string, unknown>>;
486
+ /**
487
+ * Verify a Merkle proof.
488
+ */
489
+ proof(leaf: string, proof: string[], root: string): Promise<ProofVerifyResult>;
490
+ /**
491
+ * Verify a batch by ID.
492
+ */
493
+ batch(batchId: string): Promise<BatchVerifyResult>;
494
+ /**
495
+ * Get batch proof for an event.
496
+ */
497
+ eventBatchProof(eventId: string): Promise<EventBatchProof>;
498
+ /**
499
+ * Batch verify multiple items.
500
+ */
501
+ batchVerify(items: Array<{
502
+ type: string;
503
+ id: string;
504
+ }>): Promise<Record<string, unknown>>;
280
505
  }
281
- interface RootHistory {
282
- merkleRoot: string;
283
- eventCount: bigint;
284
- timestamp: bigint;
285
- }
286
- interface RootUpdatedEvent {
287
- wallet: string;
288
- newRoot: string;
289
- previousRoot: string;
290
- eventCount: bigint;
291
- latestIpfsHash: string;
292
- }
293
- declare class AttestationRegistryContract {
294
- private contract;
295
- private signer?;
296
- constructor(contractAddress: string, signerOrProvider: Signer | Provider);
297
- getRoot(wallet: string): Promise<AttestationRoot>;
298
- getHistoryCount(wallet: string): Promise<bigint>;
299
- getHistoricalRoot(wallet: string, index: number): Promise<RootHistory>;
300
- verifyAttestation(wallet: string, leaf: string, proof: string[]): Promise<boolean>;
301
- computeLeaf(ipfsHash: string, eventType: string, timestamp: number): Promise<string>;
302
- getWalletByIpfsHash(ipfsHash: string): Promise<string>;
303
- isAuthorizedUpdater(address: string): Promise<boolean>;
304
- owner(): Promise<string>;
305
- updateRoot(wallet: string, newRoot: string, eventCount: number, latestIpfsHash: string): Promise<ContractTransactionResponse>;
306
- batchUpdateRoots(wallets: string[], roots: string[], eventCounts: number[], ipfsHashes: string[]): Promise<ContractTransactionResponse>;
307
- setAuthorizedUpdater(updater: string, authorized: boolean): Promise<ContractTransactionResponse>;
308
- onRootUpdated(callback: (event: RootUpdatedEvent) => void, filter?: {
309
- wallet?: string;
310
- }): void;
311
- removeAllListeners(): void;
312
- static computeLeafOffchain(ipfsHash: string, eventType: string, timestamp: number): string;
313
- static verifyProofOffchain(leaf: string, proof: string[], root: string): boolean;
506
+
507
+ /**
508
+ * Tenant Resource - Tenant management operations
509
+ */
510
+
511
+ declare class TenantResource {
512
+ private http;
513
+ constructor(http: HttpClient);
514
+ /**
515
+ * List all API keys.
516
+ */
517
+ listApiKeys(): Promise<ApiKey[]>;
518
+ /**
519
+ * Create a new API key.
520
+ */
521
+ createApiKey(request: CreateApiKeyRequest): Promise<ApiKey>;
522
+ /**
523
+ * Delete an API key.
524
+ */
525
+ deleteApiKey(keyId: string): Promise<void>;
526
+ /**
527
+ * Get detailed usage statistics.
528
+ */
529
+ usageDetailed(fromDate?: string, toDate?: string): Promise<Record<string, unknown>>;
530
+ /**
531
+ * Get tenant context.
532
+ */
533
+ context(): Promise<Record<string, unknown>>;
534
+ /**
535
+ * Get blockchain statistics.
536
+ */
537
+ blockchainStats(): Promise<BlockchainStats>;
538
+ /**
539
+ * Verify a certificate on the blockchain.
540
+ */
541
+ blockchainVerify(certificateId: string): Promise<BlockchainProof>;
542
+ /**
543
+ * List blockchain certificates.
544
+ */
545
+ blockchainCertificates(limit?: number, offset?: number): Promise<Record<string, unknown>>;
546
+ /**
547
+ * Force batch settlement.
548
+ */
549
+ forceBatch(): Promise<Record<string, unknown>>;
550
+ /**
551
+ * Settle all pending events.
552
+ */
553
+ settleAll(): Promise<Record<string, unknown>>;
554
+ /**
555
+ * Settle a specific event.
556
+ */
557
+ settleEvent(eventId: string): Promise<Record<string, unknown>>;
314
558
  }
315
559
 
316
560
  /**
317
- * Copyright (c) 2024-2025 Clive Watts / MegaWatts Solutions
318
- * All Rights Reserved.
561
+ * Passport API Client
319
562
  *
320
- * PROPRIETARY AND CONFIDENTIAL
321
- * This software is the exclusive property of MegaWatts Solutions.
322
- * Unauthorized copying, distribution, or use is strictly prohibited.
323
- * See LICENSE file for full terms.
563
+ * Manage user passports, templates, badges, and achievements.
324
564
  */
325
565
 
326
- declare function createClient(baseUrl: string, accessToken?: string): AttestationClient;
566
+ interface Passport {
567
+ id: string;
568
+ tenant_id: string;
569
+ user_id: string;
570
+ wallet_address?: string;
571
+ level: number;
572
+ points: number;
573
+ experience: number;
574
+ traits: Record<string, any>;
575
+ custom_metadata: Record<string, any>;
576
+ on_chain_token_id?: string;
577
+ on_chain_tx_hash?: string;
578
+ created_at: string;
579
+ last_updated_at: string;
580
+ }
581
+ interface PassportWithFields extends Passport {
582
+ template_id?: string;
583
+ template_name?: string;
584
+ field_values: FieldValue[];
585
+ }
586
+ interface FieldValue {
587
+ field_key: string;
588
+ field_name: string;
589
+ value: any;
590
+ data_type: string;
591
+ computed_at?: string;
592
+ manually_set: boolean;
593
+ }
594
+ interface PassportTemplate {
595
+ id: string;
596
+ tenant_id: string;
597
+ name: string;
598
+ description?: string;
599
+ slug: string;
600
+ icon_url?: string;
601
+ is_default: boolean;
602
+ is_active: boolean;
603
+ created_at: string;
604
+ updated_at: string;
605
+ fields: TemplateField[];
606
+ }
607
+ interface TemplateField {
608
+ id: string;
609
+ template_id: string;
610
+ name: string;
611
+ field_key: string;
612
+ description?: string;
613
+ data_type: string;
614
+ default_value?: any;
615
+ formula?: string;
616
+ formula_type?: string;
617
+ aggregation?: string;
618
+ event_filter?: Record<string, any>;
619
+ display_format?: string;
620
+ icon?: string;
621
+ color?: string;
622
+ sort_order: number;
623
+ is_visible: boolean;
624
+ is_computed: boolean;
625
+ created_at: string;
626
+ }
627
+ interface Badge {
628
+ id: string;
629
+ tenant_id: string;
630
+ badge_id: string;
631
+ name: string;
632
+ description?: string;
633
+ icon_url?: string;
634
+ rarity: string;
635
+ requirements: Record<string, any>;
636
+ created_at: string;
637
+ }
638
+ interface Achievement {
639
+ id: string;
640
+ tenant_id: string;
641
+ achievement_id: string;
642
+ name: string;
643
+ description?: string;
644
+ category?: string;
645
+ points_reward: number;
646
+ requirements: Record<string, any>;
647
+ created_at: string;
648
+ }
649
+ interface UserBadge {
650
+ id: string;
651
+ passport_id: string;
652
+ badge_id: string;
653
+ badge: Badge;
654
+ earned_at: string;
655
+ metadata?: Record<string, any>;
656
+ }
657
+ interface UserAchievement {
658
+ id: string;
659
+ passport_id: string;
660
+ achievement_id: string;
661
+ achievement: Achievement;
662
+ earned_at: string;
663
+ progress: number;
664
+ completed: boolean;
665
+ }
666
+ interface PassportHistory {
667
+ id: string;
668
+ passport_id: string;
669
+ event_type: string;
670
+ old_value?: any;
671
+ new_value?: any;
672
+ change_reason?: string;
673
+ created_at: string;
674
+ }
675
+ interface CreatePassportRequest {
676
+ user_id: string;
677
+ wallet_address?: string;
678
+ level?: number;
679
+ points?: number;
680
+ experience?: number;
681
+ traits?: Record<string, any>;
682
+ custom_metadata?: Record<string, any>;
683
+ }
684
+ interface UpdatePassportRequest {
685
+ wallet_address?: string;
686
+ level?: number;
687
+ points?: number;
688
+ experience?: number;
689
+ traits?: Record<string, any>;
690
+ custom_metadata?: Record<string, any>;
691
+ }
692
+ interface CreateTemplateRequest {
693
+ name: string;
694
+ description?: string;
695
+ slug: string;
696
+ icon_url?: string;
697
+ is_default?: boolean;
698
+ fields?: CreateTemplateFieldRequest[];
699
+ }
700
+ interface CreateTemplateFieldRequest {
701
+ name: string;
702
+ field_key: string;
703
+ description?: string;
704
+ data_type?: string;
705
+ default_value?: any;
706
+ formula?: string;
707
+ formula_type?: string;
708
+ aggregation?: string;
709
+ event_filter?: Record<string, any>;
710
+ display_format?: string;
711
+ icon?: string;
712
+ color?: string;
713
+ sort_order?: number;
714
+ is_visible?: boolean;
715
+ is_computed?: boolean;
716
+ }
717
+ interface CreateBadgeRequest {
718
+ badge_id: string;
719
+ name: string;
720
+ description?: string;
721
+ icon_url?: string;
722
+ rarity?: string;
723
+ requirements?: Record<string, any>;
724
+ }
725
+ interface CreateAchievementRequest {
726
+ achievement_id: string;
727
+ name: string;
728
+ description?: string;
729
+ category?: string;
730
+ points_reward?: number;
731
+ requirements?: Record<string, any>;
732
+ }
733
+ interface ListOptions {
734
+ limit?: number;
735
+ offset?: number;
736
+ }
737
+ declare class PassportClient {
738
+ private http;
739
+ constructor(http: HttpClient);
740
+ /**
741
+ * List all passports for the tenant
742
+ */
743
+ list(options?: ListOptions): Promise<Passport[]>;
744
+ /**
745
+ * Get a passport by user ID
746
+ */
747
+ get(userId: string): Promise<Passport>;
748
+ /**
749
+ * Get a passport with all field values
750
+ */
751
+ getWithFields(userId: string): Promise<PassportWithFields>;
752
+ /**
753
+ * Create a new passport for a user
754
+ */
755
+ create(data: CreatePassportRequest): Promise<Passport>;
756
+ /**
757
+ * Update a passport
758
+ */
759
+ update(userId: string, data: UpdatePassportRequest): Promise<Passport>;
760
+ /**
761
+ * Delete a passport
762
+ */
763
+ delete(userId: string): Promise<void>;
764
+ /**
765
+ * Add points to a passport
766
+ */
767
+ addPoints(userId: string, points: number, reason?: string): Promise<Passport>;
768
+ /**
769
+ * Level up a passport
770
+ */
771
+ levelUp(userId: string): Promise<Passport>;
772
+ /**
773
+ * Link a wallet address to a passport
774
+ */
775
+ linkWallet(userId: string, walletAddress: string): Promise<Passport>;
776
+ /**
777
+ * Get all field values for a passport
778
+ */
779
+ getFieldValues(userId: string): Promise<FieldValue[]>;
780
+ /**
781
+ * Set a field value manually
782
+ */
783
+ setFieldValue(userId: string, fieldKey: string, value: any): Promise<void>;
784
+ /**
785
+ * Recompute all computed field values
786
+ */
787
+ recomputeFields(userId: string): Promise<{
788
+ updated_fields: Record<string, any>;
789
+ }>;
790
+ /**
791
+ * Assign a template to a passport
792
+ */
793
+ assignTemplate(userId: string, templateId: string): Promise<void>;
794
+ /**
795
+ * List all passport templates
796
+ */
797
+ listTemplates(): Promise<PassportTemplate[]>;
798
+ /**
799
+ * Get a template by ID
800
+ */
801
+ getTemplate(templateId: string): Promise<PassportTemplate>;
802
+ /**
803
+ * Create a new template
804
+ */
805
+ createTemplate(data: CreateTemplateRequest): Promise<PassportTemplate>;
806
+ /**
807
+ * Add a field to a template
808
+ */
809
+ addTemplateField(templateId: string, field: CreateTemplateFieldRequest): Promise<TemplateField>;
810
+ /**
811
+ * Delete a template
812
+ */
813
+ deleteTemplate(templateId: string): Promise<void>;
814
+ /**
815
+ * List all badges
816
+ */
817
+ listBadges(): Promise<Badge[]>;
818
+ /**
819
+ * Create a badge
820
+ */
821
+ createBadge(data: CreateBadgeRequest): Promise<Badge>;
822
+ /**
823
+ * Award a badge to a user
824
+ */
825
+ awardBadge(userId: string, badgeId: string, metadata?: Record<string, any>): Promise<UserBadge>;
826
+ /**
827
+ * Get badges earned by a user
828
+ */
829
+ getUserBadges(userId: string): Promise<UserBadge[]>;
830
+ /**
831
+ * List all achievements
832
+ */
833
+ listAchievements(): Promise<Achievement[]>;
834
+ /**
835
+ * Create an achievement
836
+ */
837
+ createAchievement(data: CreateAchievementRequest): Promise<Achievement>;
838
+ /**
839
+ * Get achievements for a user
840
+ */
841
+ getUserAchievements(userId: string): Promise<UserAchievement[]>;
842
+ /**
843
+ * Update achievement progress
844
+ */
845
+ updateAchievementProgress(userId: string, achievementId: string, progress: number): Promise<UserAchievement>;
846
+ /**
847
+ * Get passport history/activity log
848
+ */
849
+ getHistory(userId: string, options?: ListOptions): Promise<PassportHistory[]>;
850
+ /**
851
+ * Get passport data for a user using Passport V2 API.
852
+ * This integrates with custom data views for dynamic computation.
853
+ *
854
+ * @param userId - The user ID
855
+ * @param passportId - Optional specific passport definition ID
856
+ * @returns Passport data with computed fields from data view
857
+ */
858
+ getPassportV2(userId: string, passportId?: string): Promise<PassportV2Data>;
859
+ /**
860
+ * Get passport view data for a user (alias for getPassportV2).
861
+ *
862
+ * @param userId - The user ID
863
+ * @param passportId - Optional specific passport definition ID
864
+ * @returns Passport data with computed fields from data view
865
+ */
866
+ getPassportView(userId: string, passportId?: string): Promise<PassportV2Data>;
867
+ /**
868
+ * Get user milestones from Passport V2.
869
+ *
870
+ * @param userId - The user ID
871
+ * @param passportId - Optional passport ID to filter milestones
872
+ * @returns List of milestones achieved by the user
873
+ */
874
+ getMilestones(userId: string, passportId?: string): Promise<Milestone[]>;
875
+ /**
876
+ * List available data views that can be used for passports.
877
+ * Includes built-in views and custom data views.
878
+ *
879
+ * @returns List of available views with their columns
880
+ */
881
+ listAvailableViews(): Promise<AvailableView[]>;
882
+ /**
883
+ * List passport definitions for the tenant.
884
+ *
885
+ * @returns List of passport definitions
886
+ */
887
+ listPassportDefinitions(): Promise<PassportDefinition[]>;
888
+ /**
889
+ * Create a new passport definition linked to a data view.
890
+ *
891
+ * @param definition - The passport definition to create
892
+ * @returns Created passport definition
893
+ *
894
+ * @example
895
+ * ```typescript
896
+ * const passport = await client.passports.createPassportDefinition({
897
+ * name: 'Fan Engagement Passport',
898
+ * description: 'Track fan engagement metrics',
899
+ * data_view_id: 'builtin-fan-profile', // or custom view UUID
900
+ * display_columns: ['fan_score', 'loyalty_tier', 'total_events'],
901
+ * column_labels: {
902
+ * fan_score: 'Engagement Score',
903
+ * loyalty_tier: 'Tier',
904
+ * total_events: 'Activities'
905
+ * }
906
+ * });
907
+ * ```
908
+ */
909
+ createPassportDefinition(definition: CreatePassportDefinitionRequest): Promise<PassportDefinition>;
910
+ }
911
+ interface PassportV2Data {
912
+ user_id: string;
913
+ passport: PassportDefinition;
914
+ data: Record<string, PassportFieldValue>;
915
+ milestones: Milestone[];
916
+ generated_at: string;
917
+ }
918
+ interface PassportFieldValue {
919
+ label: string;
920
+ value: any;
921
+ format?: string;
922
+ }
923
+ interface PassportDefinition {
924
+ id: string;
925
+ tenant_id: string;
926
+ name: string;
927
+ description?: string;
928
+ slug?: string;
929
+ data_view_id?: string;
930
+ data_view_name?: string;
931
+ display_columns: string[];
932
+ column_labels: Record<string, string>;
933
+ column_formats: Record<string, string>;
934
+ is_default: boolean;
935
+ is_active: boolean;
936
+ is_public: boolean;
937
+ created_at: string;
938
+ threshold_count: number;
939
+ }
940
+ interface Milestone {
941
+ id: string;
942
+ name: string;
943
+ description?: string;
944
+ milestone_type: string;
945
+ icon_url?: string;
946
+ badge_color?: string;
947
+ points_reward: number;
948
+ triggered_at: string;
949
+ value_at_trigger?: any;
950
+ }
951
+ interface AvailableView {
952
+ id: string;
953
+ name: string;
954
+ view_name: string;
955
+ description?: string;
956
+ is_builtin: boolean;
957
+ is_custom_computation?: boolean;
958
+ view_type?: string;
959
+ columns: ViewColumn[];
960
+ }
961
+ interface ViewColumn {
962
+ name: string;
963
+ type: string;
964
+ computation_type?: string;
965
+ }
966
+ interface CreatePassportDefinitionRequest {
967
+ name: string;
968
+ description?: string;
969
+ slug?: string;
970
+ data_view_id?: string;
971
+ display_columns?: string[];
972
+ column_labels?: Record<string, string>;
973
+ column_formats?: Record<string, string>;
974
+ is_default?: boolean;
975
+ is_public?: boolean;
976
+ }
977
+
978
+ /**
979
+ * Wallet Management API Client
980
+ *
981
+ * Manage CDP wallets, NFTs, and token swaps for end-users.
982
+ */
983
+
984
+ interface Wallet {
985
+ wallet_id: string;
986
+ address: string;
987
+ user_id: string;
988
+ wallet_type: 'eoa' | 'smart' | 'solana';
989
+ network: string;
990
+ name?: string;
991
+ status: string;
992
+ created_at: string;
993
+ metadata?: Record<string, any>;
994
+ supports_export?: boolean;
995
+ owner_wallet_id?: string;
996
+ is_deployed?: boolean;
997
+ }
998
+ interface DualWallets {
999
+ user_id: string;
1000
+ asset_wallet: Wallet;
1001
+ smart_wallet: Wallet;
1002
+ network: string;
1003
+ }
1004
+ interface WalletBalance {
1005
+ wallet_id: string;
1006
+ address: string;
1007
+ network: string;
1008
+ balances: TokenBalance[];
1009
+ }
1010
+ interface TokenBalance {
1011
+ token: string;
1012
+ symbol: string;
1013
+ balance: string;
1014
+ decimals: number;
1015
+ usd_value?: number;
1016
+ }
1017
+ interface NFT {
1018
+ id: string;
1019
+ wallet_id: string;
1020
+ contract_address: string;
1021
+ token_id: string;
1022
+ network: string;
1023
+ name?: string;
1024
+ description?: string;
1025
+ image_url?: string;
1026
+ metadata?: Record<string, any>;
1027
+ source: string;
1028
+ acquired_at: string;
1029
+ }
1030
+ interface SwapQuote {
1031
+ from_token: string;
1032
+ to_token: string;
1033
+ from_amount: string;
1034
+ to_amount: string;
1035
+ exchange_rate: string;
1036
+ price_impact: string;
1037
+ gas_estimate: string;
1038
+ expires_at: string;
1039
+ }
1040
+ interface SwapResult {
1041
+ transaction_hash: string;
1042
+ status: string;
1043
+ from_token: string;
1044
+ to_token: string;
1045
+ from_amount: string;
1046
+ to_amount: string;
1047
+ gas_used: string;
1048
+ }
1049
+ interface WalletStats {
1050
+ total_wallets: number;
1051
+ by_type: Record<string, number>;
1052
+ by_network: Record<string, number>;
1053
+ }
1054
+ interface ComprehensiveWalletInfo {
1055
+ wallet_id: string;
1056
+ address: string;
1057
+ user_id: string;
1058
+ wallet_type: string;
1059
+ network: string;
1060
+ name?: string;
1061
+ status: string;
1062
+ supports_export: boolean;
1063
+ created_at: string;
1064
+ metadata?: Record<string, any>;
1065
+ owner_wallet_id?: string;
1066
+ owner_address?: string;
1067
+ is_deployed?: boolean;
1068
+ balances?: {
1069
+ address: string;
1070
+ network: string;
1071
+ tokens: TokenBalance[];
1072
+ fetched_at: string;
1073
+ };
1074
+ nfts?: {
1075
+ total: number;
1076
+ items: NFT[];
1077
+ };
1078
+ activity?: {
1079
+ recent_swaps: SwapResult[];
1080
+ total_swaps: number;
1081
+ };
1082
+ }
1083
+ interface UserWalletSummary {
1084
+ user_id: string;
1085
+ total_wallets: number;
1086
+ total_nfts: number;
1087
+ total_swaps: number;
1088
+ wallets: Array<{
1089
+ wallet_id: string;
1090
+ address: string;
1091
+ wallet_type: string;
1092
+ network: string;
1093
+ name?: string;
1094
+ supports_export: boolean;
1095
+ created_at: string;
1096
+ owner_wallet_id?: string;
1097
+ is_deployed?: boolean;
1098
+ balances?: {
1099
+ address: string;
1100
+ network: string;
1101
+ tokens: TokenBalance[];
1102
+ fetched_at: string;
1103
+ };
1104
+ }>;
1105
+ }
1106
+ interface CreateWalletRequest {
1107
+ user_id: string;
1108
+ wallet_type?: 'eoa' | 'smart' | 'solana';
1109
+ network?: string;
1110
+ name?: string;
1111
+ metadata?: Record<string, any>;
1112
+ }
1113
+ interface CreateDualWalletsRequest {
1114
+ user_id: string;
1115
+ network?: string;
1116
+ name_prefix?: string;
1117
+ }
1118
+ interface SwapQuoteRequest {
1119
+ from_token: string;
1120
+ to_token: string;
1121
+ from_amount: string;
1122
+ network?: string;
1123
+ slippage_bps?: number;
1124
+ }
1125
+ interface ExecuteSwapRequest {
1126
+ wallet_id: string;
1127
+ from_token: string;
1128
+ to_token: string;
1129
+ from_amount: string;
1130
+ network?: string;
1131
+ slippage_bps?: number;
1132
+ }
1133
+ interface AddNFTRequest {
1134
+ contract_address: string;
1135
+ token_id: string;
1136
+ network: string;
1137
+ metadata?: Record<string, any>;
1138
+ source?: string;
1139
+ }
1140
+ interface TransferRequest {
1141
+ from_address: string;
1142
+ to_address: string;
1143
+ amount: string;
1144
+ token?: string;
1145
+ network?: string;
1146
+ }
1147
+ interface TransferResult {
1148
+ tx_hash: string;
1149
+ from: string;
1150
+ to: string;
1151
+ amount: string;
1152
+ token: string;
1153
+ network: string;
1154
+ status: string;
1155
+ }
1156
+ interface UserWithWallets {
1157
+ user_id: string;
1158
+ wallets: Array<{
1159
+ wallet_id: string;
1160
+ address: string;
1161
+ wallet_type: string;
1162
+ network: string;
1163
+ name?: string;
1164
+ status: string;
1165
+ }>;
1166
+ }
1167
+ interface UsersWithWalletsResponse {
1168
+ users: UserWithWallets[];
1169
+ total: number;
1170
+ limit: number;
1171
+ offset: number;
1172
+ }
1173
+ declare class WalletClient {
1174
+ private http;
1175
+ constructor(http: HttpClient);
1176
+ /**
1177
+ * Create a single wallet for a user
1178
+ */
1179
+ create(data: CreateWalletRequest): Promise<Wallet>;
1180
+ /**
1181
+ * Get a wallet by ID
1182
+ */
1183
+ get(walletId: string): Promise<Wallet>;
1184
+ /**
1185
+ * List wallets for a user
1186
+ */
1187
+ listByUser(userId: string): Promise<Wallet[]>;
1188
+ /**
1189
+ * Get wallet statistics
1190
+ */
1191
+ stats(): Promise<WalletStats>;
1192
+ /**
1193
+ * List all users who have wallets, grouped by user_id.
1194
+ *
1195
+ * @param limit - Maximum number of users to return (default 50)
1196
+ * @param offset - Offset for pagination (default 0)
1197
+ * @returns List of users with their wallets
1198
+ */
1199
+ listUsersWithWallets(limit?: number, offset?: number): Promise<UsersWithWalletsResponse>;
1200
+ /**
1201
+ * Create dual wallets (EOA asset wallet + Smart Account) for a user
1202
+ */
1203
+ createDual(data: CreateDualWalletsRequest): Promise<DualWallets>;
1204
+ /**
1205
+ * Bulk create dual wallets for multiple users
1206
+ */
1207
+ createDualBulk(userIds: string[], network?: string): Promise<DualWallets[]>;
1208
+ /**
1209
+ * Get wallet balance
1210
+ */
1211
+ getBalance(walletId: string): Promise<WalletBalance>;
1212
+ /**
1213
+ * Get comprehensive wallet information in a single call.
1214
+ *
1215
+ * Returns everything about a wallet:
1216
+ * - Basic wallet details (address, type, network)
1217
+ * - Token balances (native + ERC20)
1218
+ * - NFT holdings with metadata
1219
+ * - Recent activity (swaps, transfers)
1220
+ *
1221
+ * @param walletId - Wallet ID to query
1222
+ * @param options - Control what data is included
1223
+ */
1224
+ getInfo(walletId: string, options?: {
1225
+ includeBalances?: boolean;
1226
+ includeNfts?: boolean;
1227
+ includeActivity?: boolean;
1228
+ }): Promise<ComprehensiveWalletInfo>;
1229
+ /**
1230
+ * Get comprehensive summary of all wallets for a user.
1231
+ *
1232
+ * Returns all wallets (EOA + Smart) with aggregated stats:
1233
+ * - Total NFTs across all wallets
1234
+ * - Total swaps executed
1235
+ * - Token balances (optional)
1236
+ *
1237
+ * @param userId - User ID to query
1238
+ * @param includeBalances - Include token balances (requires Alchemy)
1239
+ */
1240
+ getUserSummary(userId: string, includeBalances?: boolean): Promise<UserWalletSummary>;
1241
+ /**
1242
+ * Export private key for an EOA wallet (requires acknowledgment)
1243
+ */
1244
+ exportKey(walletId: string): Promise<{
1245
+ private_key: string;
1246
+ warning: string;
1247
+ }>;
1248
+ /**
1249
+ * Transfer tokens from one address to another.
1250
+ *
1251
+ * @param request - Transfer details
1252
+ * @returns Transaction result with hash and status
1253
+ *
1254
+ * @example
1255
+ * ```typescript
1256
+ * const result = await client.wallets.transfer({
1257
+ * from_address: '0x123...',
1258
+ * to_address: '0x456...',
1259
+ * amount: '0.1',
1260
+ * token: 'ETH',
1261
+ * network: 'base-sepolia',
1262
+ * });
1263
+ * console.log('TX Hash:', result.tx_hash);
1264
+ * ```
1265
+ */
1266
+ transfer(request: TransferRequest): Promise<TransferResult>;
1267
+ /**
1268
+ * Get a swap quote
1269
+ */
1270
+ getSwapQuote(request: SwapQuoteRequest): Promise<SwapQuote>;
1271
+ /**
1272
+ * Execute a token swap
1273
+ */
1274
+ executeSwap(request: ExecuteSwapRequest): Promise<SwapResult>;
1275
+ /**
1276
+ * Get NFTs for a wallet
1277
+ */
1278
+ getNFTs(walletId: string): Promise<NFT[]>;
1279
+ /**
1280
+ * Get all NFTs for a user (across all wallets)
1281
+ */
1282
+ getUserNFTs(userId: string): Promise<NFT[]>;
1283
+ /**
1284
+ * Add an NFT to wallet tracking
1285
+ */
1286
+ addNFT(walletId: string, nft: AddNFTRequest): Promise<NFT>;
1287
+ }
1288
+
1289
+ /**
1290
+ * End Users API Client
1291
+ *
1292
+ * Manage end-users discovered from events - profiles, segments, and activity.
1293
+ */
1294
+
1295
+ interface EndUser {
1296
+ id: string;
1297
+ external_id: string;
1298
+ email?: string;
1299
+ first_name?: string;
1300
+ last_name?: string;
1301
+ display_name?: string;
1302
+ avatar_url?: string;
1303
+ phone?: string;
1304
+ date_of_birth?: string;
1305
+ country?: string;
1306
+ city?: string;
1307
+ timezone?: string;
1308
+ language?: string;
1309
+ bio?: string;
1310
+ wallet_address?: string;
1311
+ wallet_source?: string;
1312
+ status: string;
1313
+ total_events: number;
1314
+ first_event_at?: string;
1315
+ last_event_at?: string;
1316
+ event_types: string[];
1317
+ segments: string[];
1318
+ tags: Record<string, any>;
1319
+ points_balance: number;
1320
+ lifetime_points: number;
1321
+ attributes: Record<string, any>;
1322
+ created_at: string;
1323
+ discovered_at?: string;
1324
+ }
1325
+ interface EndUserListResponse {
1326
+ users: EndUser[];
1327
+ total: number;
1328
+ page: number;
1329
+ page_size: number;
1330
+ has_more: boolean;
1331
+ }
1332
+ interface UserActivity {
1333
+ event_id: string;
1334
+ event_type: string;
1335
+ timestamp: string;
1336
+ data: Record<string, any>;
1337
+ }
1338
+ interface UserActivityResponse {
1339
+ user_id: string;
1340
+ activities: UserActivity[];
1341
+ total: number;
1342
+ page: number;
1343
+ page_size: number;
1344
+ }
1345
+ interface CreateEndUserRequest {
1346
+ external_id: string;
1347
+ email?: string;
1348
+ first_name?: string;
1349
+ last_name?: string;
1350
+ display_name?: string;
1351
+ phone?: string;
1352
+ date_of_birth?: string;
1353
+ country?: string;
1354
+ city?: string;
1355
+ timezone?: string;
1356
+ language?: string;
1357
+ bio?: string;
1358
+ wallet_address?: string;
1359
+ segments?: string[];
1360
+ tags?: Record<string, any>;
1361
+ attributes?: Record<string, any>;
1362
+ }
1363
+ interface UpdateEndUserRequest {
1364
+ email?: string;
1365
+ first_name?: string;
1366
+ last_name?: string;
1367
+ display_name?: string;
1368
+ avatar_url?: string;
1369
+ phone?: string;
1370
+ date_of_birth?: string;
1371
+ country?: string;
1372
+ city?: string;
1373
+ timezone?: string;
1374
+ language?: string;
1375
+ bio?: string;
1376
+ segments?: string[];
1377
+ tags?: Record<string, any>;
1378
+ attributes?: Record<string, any>;
1379
+ }
1380
+ interface ListEndUsersOptions {
1381
+ page?: number;
1382
+ page_size?: number;
1383
+ search?: string;
1384
+ status?: string;
1385
+ segment?: string;
1386
+ has_wallet?: boolean;
1387
+ sort_by?: string;
1388
+ sort_order?: 'asc' | 'desc';
1389
+ }
1390
+ interface LinkWalletRequest {
1391
+ wallet_address: string;
1392
+ wallet_source?: string;
1393
+ signature?: string;
1394
+ }
1395
+ interface MergeUsersRequest {
1396
+ source_user_id: string;
1397
+ target_user_id: string;
1398
+ }
1399
+ declare class EndUsersClient {
1400
+ private http;
1401
+ constructor(http: HttpClient);
1402
+ /**
1403
+ * List end-users with pagination and filters
1404
+ */
1405
+ list(options?: ListEndUsersOptions): Promise<EndUserListResponse>;
1406
+ /**
1407
+ * Get an end-user by ID
1408
+ */
1409
+ get(userId: string): Promise<EndUser>;
1410
+ /**
1411
+ * Get an end-user by external ID
1412
+ */
1413
+ getByExternalId(externalId: string): Promise<EndUser>;
1414
+ /**
1415
+ * Create an end-user manually
1416
+ */
1417
+ create(data: CreateEndUserRequest): Promise<EndUser>;
1418
+ /**
1419
+ * Update an end-user profile
1420
+ */
1421
+ update(userId: string, data: UpdateEndUserRequest): Promise<EndUser>;
1422
+ /**
1423
+ * Delete an end-user
1424
+ */
1425
+ delete(userId: string): Promise<void>;
1426
+ /**
1427
+ * Link a wallet to an end-user
1428
+ */
1429
+ linkWallet(userId: string, request: LinkWalletRequest): Promise<EndUser>;
1430
+ /**
1431
+ * Unlink wallet from an end-user
1432
+ */
1433
+ unlinkWallet(userId: string): Promise<EndUser>;
1434
+ /**
1435
+ * Get user activity/events
1436
+ */
1437
+ getActivity(userId: string, options?: {
1438
+ page?: number;
1439
+ page_size?: number;
1440
+ event_type?: string;
1441
+ }): Promise<UserActivityResponse>;
1442
+ /**
1443
+ * Add points to a user
1444
+ */
1445
+ addPoints(userId: string, points: number, reason?: string): Promise<EndUser>;
1446
+ /**
1447
+ * Add a segment to a user
1448
+ */
1449
+ addSegment(userId: string, segment: string): Promise<EndUser>;
1450
+ /**
1451
+ * Remove a segment from a user
1452
+ */
1453
+ removeSegment(userId: string, segment: string): Promise<EndUser>;
1454
+ /**
1455
+ * Merge two users (moves all data from source to target)
1456
+ */
1457
+ merge(request: MergeUsersRequest): Promise<EndUser>;
1458
+ /**
1459
+ * Export users as CSV
1460
+ */
1461
+ export(options?: {
1462
+ segment?: string;
1463
+ format?: 'csv' | 'json';
1464
+ }): Promise<Blob>;
1465
+ }
1466
+
1467
+ /**
1468
+ * Rewards API Client
1469
+ *
1470
+ * Manage reward definitions, earned rewards, and NFT minting.
1471
+ */
1472
+
1473
+ interface RewardDefinition {
1474
+ id: string;
1475
+ name: string;
1476
+ slug: string;
1477
+ description?: string;
1478
+ reward_type: 'nft' | 'points' | 'token' | 'badge';
1479
+ value?: number;
1480
+ value_currency?: string;
1481
+ token_contract_address?: string;
1482
+ token_symbol?: string;
1483
+ token_decimals: number;
1484
+ token_chain: string;
1485
+ nft_minting_strategy?: string;
1486
+ nft_pre_mint_count?: number;
1487
+ nft_minted_pool_count: number;
1488
+ nft_is_soulbound: boolean;
1489
+ passport_threshold_id?: string;
1490
+ trigger_type: string;
1491
+ trigger_config?: Record<string, any>;
1492
+ max_per_user?: number;
1493
+ max_total?: number;
1494
+ current_issued: number;
1495
+ is_active: boolean;
1496
+ icon_url?: string;
1497
+ badge_color?: string;
1498
+ created_at: string;
1499
+ }
1500
+ interface EarnedReward {
1501
+ id: string;
1502
+ user_id: string;
1503
+ user_external_id: string;
1504
+ reward_name: string;
1505
+ reward_type: string;
1506
+ status: string;
1507
+ nft_token_id?: number;
1508
+ nft_tx_hash?: string;
1509
+ earned_at: string;
1510
+ distributed_at?: string;
1511
+ }
1512
+ interface RewardAsset {
1513
+ id: string;
1514
+ definition_id: string;
1515
+ asset_type: string;
1516
+ file_path: string;
1517
+ mime_type: string;
1518
+ file_size: number;
1519
+ metadata?: Record<string, any>;
1520
+ created_at: string;
1521
+ }
1522
+ interface CreateRewardDefinitionRequest {
1523
+ name: string;
1524
+ slug: string;
1525
+ description?: string;
1526
+ campaign_id?: string;
1527
+ reward_type?: 'nft' | 'points' | 'token' | 'badge';
1528
+ value?: number;
1529
+ value_currency?: string;
1530
+ token_contract_address?: string;
1531
+ token_symbol?: string;
1532
+ token_decimals?: number;
1533
+ token_chain?: string;
1534
+ nft_metadata_template?: Record<string, any>;
1535
+ nft_is_soulbound?: boolean;
1536
+ nft_validity_days?: number;
1537
+ nft_minting_strategy?: 'mint_on_earn' | 'pre_mint_pool' | 'lazy_mint';
1538
+ nft_pre_mint_count?: number;
1539
+ passport_threshold_id?: string;
1540
+ trigger_type?: 'event_count' | 'event_match' | 'threshold' | 'manual' | 'custom_code';
1541
+ trigger_config?: Record<string, any>;
1542
+ max_per_user?: number;
1543
+ max_total?: number;
1544
+ is_active?: boolean;
1545
+ icon_url?: string;
1546
+ badge_color?: string;
1547
+ is_public?: boolean;
1548
+ }
1549
+ interface ManualRewardRequest {
1550
+ definition_id: string;
1551
+ user_ids: string[];
1552
+ trigger_data?: Record<string, any>;
1553
+ distribute_immediately?: boolean;
1554
+ }
1555
+ interface ListRewardsOptions {
1556
+ is_active?: boolean;
1557
+ reward_type?: string;
1558
+ limit?: number;
1559
+ offset?: number;
1560
+ }
1561
+ declare class RewardsClient {
1562
+ private http;
1563
+ constructor(http: HttpClient);
1564
+ /**
1565
+ * List reward definitions
1566
+ */
1567
+ listDefinitions(options?: ListRewardsOptions): Promise<RewardDefinition[]>;
1568
+ /**
1569
+ * Get a reward definition by ID
1570
+ */
1571
+ getDefinition(definitionId: string): Promise<RewardDefinition>;
1572
+ /**
1573
+ * Create a reward definition
1574
+ */
1575
+ createDefinition(data: CreateRewardDefinitionRequest): Promise<RewardDefinition>;
1576
+ /**
1577
+ * Update a reward definition
1578
+ */
1579
+ updateDefinition(definitionId: string, data: Partial<CreateRewardDefinitionRequest>): Promise<RewardDefinition>;
1580
+ /**
1581
+ * Delete a reward definition
1582
+ */
1583
+ deleteDefinition(definitionId: string): Promise<void>;
1584
+ /**
1585
+ * Activate a reward definition
1586
+ */
1587
+ activateDefinition(definitionId: string): Promise<RewardDefinition>;
1588
+ /**
1589
+ * Deactivate a reward definition
1590
+ */
1591
+ deactivateDefinition(definitionId: string): Promise<RewardDefinition>;
1592
+ /**
1593
+ * List earned rewards
1594
+ */
1595
+ listEarned(options?: {
1596
+ user_id?: string;
1597
+ definition_id?: string;
1598
+ status?: string;
1599
+ limit?: number;
1600
+ offset?: number;
1601
+ }): Promise<EarnedReward[]>;
1602
+ /**
1603
+ * Get earned rewards for a user
1604
+ */
1605
+ getUserRewards(userId: string): Promise<EarnedReward[]>;
1606
+ /**
1607
+ * Manually award rewards to users
1608
+ */
1609
+ awardManual(request: ManualRewardRequest): Promise<EarnedReward[]>;
1610
+ /**
1611
+ * Distribute pending rewards (mint NFTs, transfer tokens)
1612
+ */
1613
+ distributePending(earnedRewardId: string): Promise<EarnedReward>;
1614
+ /**
1615
+ * Upload an asset for a reward (image, metadata JSON)
1616
+ */
1617
+ uploadAsset(definitionId: string, file: Blob, assetType: 'image' | 'metadata' | 'animation'): Promise<RewardAsset>;
1618
+ /**
1619
+ * List assets for a reward definition
1620
+ */
1621
+ listAssets(definitionId: string): Promise<RewardAsset[]>;
1622
+ }
1623
+
1624
+ /**
1625
+ * Quests API Client
1626
+ *
1627
+ * Manage quests, steps, and user progress tracking.
1628
+ */
1629
+
1630
+ interface Quest {
1631
+ id: string;
1632
+ name: string;
1633
+ slug: string;
1634
+ description?: string;
1635
+ short_description?: string;
1636
+ icon_url?: string;
1637
+ banner_url?: string;
1638
+ category?: string;
1639
+ difficulty?: string;
1640
+ estimated_time?: string;
1641
+ is_ordered: boolean;
1642
+ is_repeatable: boolean;
1643
+ repeat_cooldown_hours?: number;
1644
+ max_completions_per_user?: number;
1645
+ starts_at?: string;
1646
+ ends_at?: string;
1647
+ time_limit_hours?: number;
1648
+ prerequisite_quest_ids: string[];
1649
+ max_participants?: number;
1650
+ max_completions?: number;
1651
+ reward_definition_id?: string;
1652
+ reward_points?: number;
1653
+ is_public: boolean;
1654
+ is_featured: boolean;
1655
+ tags: string[];
1656
+ status: 'draft' | 'active' | 'paused' | 'completed' | 'archived';
1657
+ steps: QuestStep[];
1658
+ total_participants: number;
1659
+ total_completions: number;
1660
+ created_at: string;
1661
+ updated_at: string;
1662
+ }
1663
+ interface QuestStep {
1664
+ id: string;
1665
+ quest_id: string;
1666
+ name: string;
1667
+ description?: string;
1668
+ order: number;
1669
+ step_type: 'event' | 'manual' | 'external' | 'compound';
1670
+ event_type?: string;
1671
+ event_types?: string[];
1672
+ criteria?: Record<string, any>;
1673
+ required_data_fields?: string[];
1674
+ step_points?: number;
1675
+ icon_url?: string;
1676
+ is_optional: boolean;
1677
+ }
1678
+ interface UserQuestProgress {
1679
+ id: string;
1680
+ user_id: string;
1681
+ quest_id: string;
1682
+ quest_name: string;
1683
+ status: 'not_started' | 'in_progress' | 'completed' | 'failed' | 'expired';
1684
+ started_at?: string;
1685
+ completed_at?: string;
1686
+ expires_at?: string;
1687
+ completion_count: number;
1688
+ current_step_order: number;
1689
+ step_progress: StepProgress[];
1690
+ points_earned: number;
1691
+ reward_earned: boolean;
1692
+ }
1693
+ interface StepProgress {
1694
+ step_id: string;
1695
+ step_name: string;
1696
+ order: number;
1697
+ status: 'pending' | 'in_progress' | 'completed' | 'skipped';
1698
+ completed_at?: string;
1699
+ event_id?: string;
1700
+ }
1701
+ interface QuestWithProgress extends Quest {
1702
+ user_progress?: UserQuestProgress;
1703
+ }
1704
+ interface CreateQuestRequest {
1705
+ name: string;
1706
+ slug?: string;
1707
+ description?: string;
1708
+ short_description?: string;
1709
+ icon_url?: string;
1710
+ banner_url?: string;
1711
+ category?: string;
1712
+ difficulty?: string;
1713
+ estimated_time?: string;
1714
+ is_ordered?: boolean;
1715
+ is_repeatable?: boolean;
1716
+ repeat_cooldown_hours?: number;
1717
+ max_completions_per_user?: number;
1718
+ starts_at?: string;
1719
+ ends_at?: string;
1720
+ time_limit_hours?: number;
1721
+ prerequisite_quest_ids?: string[];
1722
+ max_participants?: number;
1723
+ max_completions?: number;
1724
+ reward_definition_id?: string;
1725
+ reward_points?: number;
1726
+ is_public?: boolean;
1727
+ is_featured?: boolean;
1728
+ tags?: string[];
1729
+ steps: CreateQuestStepRequest[];
1730
+ }
1731
+ interface CreateQuestStepRequest {
1732
+ name: string;
1733
+ description?: string;
1734
+ order?: number;
1735
+ step_type?: 'event' | 'manual' | 'external' | 'compound';
1736
+ event_type?: string;
1737
+ event_types?: string[];
1738
+ criteria?: Record<string, any>;
1739
+ required_data_fields?: string[];
1740
+ step_points?: number;
1741
+ icon_url?: string;
1742
+ is_optional?: boolean;
1743
+ }
1744
+ interface ListQuestsOptions {
1745
+ status?: string;
1746
+ category?: string;
1747
+ is_public?: boolean;
1748
+ is_featured?: boolean;
1749
+ limit?: number;
1750
+ offset?: number;
1751
+ }
1752
+ declare class QuestsClient {
1753
+ private http;
1754
+ constructor(http: HttpClient);
1755
+ /**
1756
+ * List quests
1757
+ */
1758
+ list(options?: ListQuestsOptions): Promise<Quest[]>;
1759
+ /**
1760
+ * Get a quest by ID
1761
+ */
1762
+ get(questId: string): Promise<Quest>;
1763
+ /**
1764
+ * Get a quest by slug
1765
+ */
1766
+ getBySlug(slug: string): Promise<Quest>;
1767
+ /**
1768
+ * Create a quest
1769
+ */
1770
+ create(data: CreateQuestRequest): Promise<Quest>;
1771
+ /**
1772
+ * Update a quest
1773
+ */
1774
+ update(questId: string, data: Partial<CreateQuestRequest>): Promise<Quest>;
1775
+ /**
1776
+ * Delete a quest
1777
+ */
1778
+ delete(questId: string): Promise<void>;
1779
+ /**
1780
+ * Activate a quest
1781
+ */
1782
+ activate(questId: string): Promise<Quest>;
1783
+ /**
1784
+ * Pause a quest
1785
+ */
1786
+ pause(questId: string): Promise<Quest>;
1787
+ /**
1788
+ * Archive a quest
1789
+ */
1790
+ archive(questId: string): Promise<Quest>;
1791
+ /**
1792
+ * Get quest with user progress
1793
+ */
1794
+ getWithProgress(questId: string, userId: string): Promise<QuestWithProgress>;
1795
+ /**
1796
+ * List quests with progress for a user
1797
+ */
1798
+ listWithProgress(userId: string, options?: ListQuestsOptions): Promise<QuestWithProgress[]>;
1799
+ /**
1800
+ * Start a quest for a user
1801
+ */
1802
+ startQuest(questId: string, userId: string): Promise<UserQuestProgress>;
1803
+ /**
1804
+ * Get user's progress on a quest
1805
+ */
1806
+ getUserProgress(questId: string, userId: string): Promise<UserQuestProgress>;
1807
+ /**
1808
+ * Complete a step manually
1809
+ */
1810
+ completeStep(questId: string, userId: string, stepId: string): Promise<UserQuestProgress>;
1811
+ /**
1812
+ * Get all quest progress for a user
1813
+ */
1814
+ getAllUserProgress(userId: string): Promise<UserQuestProgress[]>;
1815
+ /**
1816
+ * Add a step to a quest
1817
+ */
1818
+ addStep(questId: string, step: CreateQuestStepRequest): Promise<QuestStep>;
1819
+ /**
1820
+ * Update a step
1821
+ */
1822
+ updateStep(questId: string, stepId: string, data: Partial<CreateQuestStepRequest>): Promise<QuestStep>;
1823
+ /**
1824
+ * Delete a step
1825
+ */
1826
+ deleteStep(questId: string, stepId: string): Promise<void>;
1827
+ /**
1828
+ * Reorder steps
1829
+ */
1830
+ reorderSteps(questId: string, stepIds: string[]): Promise<Quest>;
1831
+ }
1832
+
1833
+ /**
1834
+ * Schema Validation API Client
1835
+ *
1836
+ * Manage event schemas for data validation.
1837
+ */
1838
+
1839
+ interface Schema {
1840
+ id: string;
1841
+ name: string;
1842
+ version: string;
1843
+ display_name?: string;
1844
+ description?: string;
1845
+ status: 'draft' | 'active' | 'deprecated';
1846
+ is_default: boolean;
1847
+ usage_count: number;
1848
+ created_at?: string;
1849
+ updated_at?: string;
1850
+ }
1851
+ interface SchemaDetail extends Schema {
1852
+ schema_definition: Record<string, any>;
1853
+ yaml_content: string;
1854
+ }
1855
+ interface SchemaField {
1856
+ name: string;
1857
+ type: string;
1858
+ required?: boolean;
1859
+ description?: string;
1860
+ default?: any;
1861
+ min?: number;
1862
+ max?: number;
1863
+ pattern?: string;
1864
+ values?: string[];
1865
+ }
1866
+ interface ValidationResult {
1867
+ valid: boolean;
1868
+ schema_name: string;
1869
+ schema_version?: string;
1870
+ errors: ValidationError$1[];
1871
+ }
1872
+ interface ValidationError$1 {
1873
+ field: string;
1874
+ message: string;
1875
+ value?: any;
1876
+ }
1877
+ interface SchemaListResponse {
1878
+ schemas: Schema[];
1879
+ total: number;
1880
+ }
1881
+ interface CreateSchemaRequest {
1882
+ yaml_content: string;
1883
+ }
1884
+ interface ValidateDataRequest {
1885
+ schema_name: string;
1886
+ schema_version?: string;
1887
+ data: Record<string, any>;
1888
+ }
1889
+ interface ListSchemasOptions {
1890
+ status?: 'draft' | 'active' | 'deprecated';
1891
+ search?: string;
1892
+ limit?: number;
1893
+ offset?: number;
1894
+ }
1895
+ declare class SchemasClient {
1896
+ private http;
1897
+ constructor(http: HttpClient);
1898
+ /**
1899
+ * List schemas
1900
+ */
1901
+ list(options?: ListSchemasOptions): Promise<SchemaListResponse>;
1902
+ /**
1903
+ * Get a schema by name and optional version
1904
+ */
1905
+ get(name: string, version?: string): Promise<SchemaDetail>;
1906
+ /**
1907
+ * Create a schema from YAML content
1908
+ *
1909
+ * Example YAML:
1910
+ * ```yaml
1911
+ * name: my_event
1912
+ * version: "1.0"
1913
+ * description: My custom event schema
1914
+ *
1915
+ * fields:
1916
+ * user_id:
1917
+ * type: string
1918
+ * required: true
1919
+ * amount:
1920
+ * type: number
1921
+ * min: 0
1922
+ * status:
1923
+ * type: enum
1924
+ * values: [pending, completed, failed]
1925
+ * ```
1926
+ */
1927
+ create(yamlContent: string): Promise<SchemaDetail>;
1928
+ /**
1929
+ * Update a schema (creates new version)
1930
+ */
1931
+ update(name: string, yamlContent: string): Promise<SchemaDetail>;
1932
+ /**
1933
+ * Delete a schema
1934
+ */
1935
+ delete(name: string, version?: string): Promise<void>;
1936
+ /**
1937
+ * Activate a schema (make it available for validation)
1938
+ */
1939
+ activate(name: string, version?: string): Promise<Schema>;
1940
+ /**
1941
+ * Deprecate a schema
1942
+ */
1943
+ deprecate(name: string, version?: string): Promise<Schema>;
1944
+ /**
1945
+ * Set a schema as the default for its name
1946
+ */
1947
+ setDefault(name: string, version: string): Promise<Schema>;
1948
+ /**
1949
+ * Validate data against a schema
1950
+ */
1951
+ validate(request: ValidateDataRequest): Promise<ValidationResult>;
1952
+ /**
1953
+ * Validate data against multiple schemas
1954
+ */
1955
+ validateMultiple(schemaNames: string[], data: Record<string, any>): Promise<ValidationResult[]>;
1956
+ /**
1957
+ * Get schema usage statistics
1958
+ */
1959
+ getUsageStats(name: string): Promise<{
1960
+ total_validations: number;
1961
+ successful_validations: number;
1962
+ failed_validations: number;
1963
+ last_used_at?: string;
1964
+ }>;
1965
+ /**
1966
+ * Clone a schema with a new name
1967
+ */
1968
+ clone(sourceName: string, newName: string, newVersion?: string): Promise<SchemaDetail>;
1969
+ }
1970
+
1971
+ /**
1972
+ * Data Views Client
1973
+ *
1974
+ * Client for managing and executing custom data views with multi-computation support.
1975
+ */
1976
+
1977
+ interface DataViewColumn {
1978
+ name: string;
1979
+ type: string;
1980
+ }
1981
+ interface DataViewInfo {
1982
+ id: string;
1983
+ name: string;
1984
+ view_name: string;
1985
+ description: string;
1986
+ is_builtin: boolean;
1987
+ columns: DataViewColumn[];
1988
+ }
1989
+ interface DataViewListResponse {
1990
+ own_views: DataViewSummary[];
1991
+ public_views: DataViewSummary[];
1992
+ builtin_views: DataViewSummary[];
1993
+ }
1994
+ interface DataViewSummary {
1995
+ name: string;
1996
+ display_name?: string;
1997
+ description: string;
1998
+ view_type?: string;
1999
+ source_categories?: string[];
2000
+ }
2001
+ interface DataViewDetail {
2002
+ id: string;
2003
+ name: string;
2004
+ display_name: string;
2005
+ description: string;
2006
+ view_type: string;
2007
+ computation: DataViewComputation | DataViewComputation[];
2008
+ source_categories: string[];
2009
+ is_public: boolean;
2010
+ created_at: string;
2011
+ updated_at: string;
2012
+ }
2013
+ interface DataViewComputation {
2014
+ type: 'count' | 'score' | 'aggregate' | 'latest' | 'tier' | 'time_decay';
2015
+ name?: string;
2016
+ event_types?: string[];
2017
+ time_window_days?: number;
2018
+ event_weights?: Record<string, number>;
2019
+ max_score?: number;
2020
+ decay_rate?: number;
2021
+ field?: string;
2022
+ operation?: 'sum' | 'avg' | 'min' | 'max' | 'count';
2023
+ group_by?: string;
2024
+ limit?: number;
2025
+ fields?: string[];
2026
+ tiers?: TierDefinition[];
2027
+ score_source?: string;
2028
+ }
2029
+ interface TierDefinition {
2030
+ name: string;
2031
+ min: number;
2032
+ max: number;
2033
+ }
2034
+ interface DataViewExecuteResult {
2035
+ view_name: string;
2036
+ display_name: string;
2037
+ identifier: string;
2038
+ identifier_type: 'wallet' | 'user_id';
2039
+ data: Record<string, unknown>;
2040
+ computed_at: string;
2041
+ total_events: number;
2042
+ }
2043
+ interface DataViewPreviewRequest {
2044
+ wallet_address: string;
2045
+ computation: DataViewComputation | DataViewComputation[];
2046
+ time_window_days?: number;
2047
+ limit?: number;
2048
+ }
2049
+ interface DataViewPreviewResult {
2050
+ preview: true;
2051
+ wallet_address: string;
2052
+ computation_type: string;
2053
+ result: Record<string, unknown>;
2054
+ events_processed: number;
2055
+ time_window_days: number;
2056
+ }
2057
+ interface CreateDataViewRequest {
2058
+ name: string;
2059
+ display_name: string;
2060
+ description: string;
2061
+ view_type?: string;
2062
+ computation: DataViewComputation | DataViewComputation[];
2063
+ source_categories?: string[];
2064
+ is_public?: boolean;
2065
+ }
2066
+ interface UpdateDataViewRequest {
2067
+ display_name?: string;
2068
+ description?: string;
2069
+ computation?: DataViewComputation | DataViewComputation[];
2070
+ source_categories?: string[];
2071
+ is_public?: boolean;
2072
+ }
2073
+ interface FanProfileView {
2074
+ wallet_address: string;
2075
+ fan_score: number;
2076
+ total_events: number;
2077
+ event_breakdown: Record<string, number>;
2078
+ first_seen: string;
2079
+ last_seen: string;
2080
+ loyalty_tier: string;
2081
+ computed_at: string;
2082
+ }
2083
+ interface ActivitySummaryView {
2084
+ wallet_address: string;
2085
+ total_events: number;
2086
+ event_count_by_type: Record<string, number>;
2087
+ last_activity: string;
2088
+ active_days: number;
2089
+ period_days: number;
2090
+ computed_at: string;
2091
+ }
2092
+ interface EventMetadata {
2093
+ event_types: Array<{
2094
+ event_type: string;
2095
+ count: number;
2096
+ last_seen: string;
2097
+ }>;
2098
+ total_events: number;
2099
+ categories: string[];
2100
+ }
2101
+ interface ViewTemplate {
2102
+ id: string;
2103
+ name: string;
2104
+ description: string;
2105
+ computation: DataViewComputation;
2106
+ }
2107
+ /**
2108
+ * Data Views client for managing and executing custom data views.
2109
+ *
2110
+ * @example
2111
+ * ```typescript
2112
+ * const client = new ProofChain({ apiKey: 'your-api-key' });
2113
+ *
2114
+ * // List available views
2115
+ * const views = await client.dataViews.list();
2116
+ *
2117
+ * // Execute a view for a wallet
2118
+ * const result = await client.dataViews.execute('0x123...', 'fan_score');
2119
+ *
2120
+ * // Preview a computation
2121
+ * const preview = await client.dataViews.preview({
2122
+ * wallet_address: '0x123...',
2123
+ * computation: {
2124
+ * type: 'score',
2125
+ * event_weights: { purchase: 10, login: 1 },
2126
+ * max_score: 1000
2127
+ * }
2128
+ * });
2129
+ * ```
2130
+ */
2131
+ declare class DataViewsClient {
2132
+ private http;
2133
+ constructor(http: HttpClient);
2134
+ /**
2135
+ * List all available data views.
2136
+ * Returns own views, public views from other tenants, and builtin views.
2137
+ */
2138
+ list(): Promise<DataViewListResponse>;
2139
+ /**
2140
+ * Get detailed information about a specific data view.
2141
+ */
2142
+ get(viewName: string): Promise<DataViewDetail>;
2143
+ /**
2144
+ * Create a new custom data view.
2145
+ *
2146
+ * @example
2147
+ * ```typescript
2148
+ * const view = await client.dataViews.create({
2149
+ * name: 'engagement_score',
2150
+ * display_name: 'User Engagement Score',
2151
+ * description: 'Weighted score based on user activity',
2152
+ * view_type: 'multi-computation',
2153
+ * computation: [
2154
+ * {
2155
+ * type: 'score',
2156
+ * name: 'activity_score',
2157
+ * event_types: ['page_view', 'purchase'],
2158
+ * event_weights: { page_view: 1, purchase: 10 },
2159
+ * max_score: 1000
2160
+ * },
2161
+ * {
2162
+ * type: 'tier',
2163
+ * name: 'loyalty_tier',
2164
+ * score_source: 'activity_score',
2165
+ * tiers: [
2166
+ * { name: 'Bronze', min: 0, max: 100 },
2167
+ * { name: 'Silver', min: 100, max: 500 },
2168
+ * { name: 'Gold', min: 500, max: 1000 }
2169
+ * ]
2170
+ * }
2171
+ * ]
2172
+ * });
2173
+ * ```
2174
+ */
2175
+ create(request: CreateDataViewRequest): Promise<DataViewDetail>;
2176
+ /**
2177
+ * Update an existing data view.
2178
+ */
2179
+ update(viewName: string, request: UpdateDataViewRequest): Promise<DataViewDetail>;
2180
+ /**
2181
+ * Delete a data view.
2182
+ */
2183
+ delete(viewName: string): Promise<void>;
2184
+ /**
2185
+ * Execute a data view for a specific user.
2186
+ *
2187
+ * The identifier can be either:
2188
+ * - A wallet address (0x...) - queries web3-bound events
2189
+ * - A user_id - queries all events for that user
2190
+ *
2191
+ * @example
2192
+ * ```typescript
2193
+ * // By user ID
2194
+ * const result = await client.dataViews.execute('user-123', 'fan_score');
2195
+ *
2196
+ * // By wallet address
2197
+ * const result = await client.dataViews.execute('0x123...abc', 'fan_score');
2198
+ *
2199
+ * console.log('Data:', result.data);
2200
+ * console.log('Events processed:', result.total_events);
2201
+ * ```
2202
+ */
2203
+ execute(identifier: string, viewName: string): Promise<DataViewExecuteResult>;
2204
+ /**
2205
+ * Preview a data view computation without saving it.
2206
+ * Useful for testing computation configurations before creating a view.
2207
+ *
2208
+ * @example
2209
+ * ```typescript
2210
+ * const preview = await client.dataViews.preview({
2211
+ * wallet_address: '0x123...',
2212
+ * computation: {
2213
+ * type: 'score',
2214
+ * event_types: ['purchase', 'login'],
2215
+ * event_weights: { purchase: 10, login: 1 },
2216
+ * max_score: 1000
2217
+ * },
2218
+ * time_window_days: 30
2219
+ * });
2220
+ * ```
2221
+ */
2222
+ preview(request: DataViewPreviewRequest): Promise<DataViewPreviewResult>;
2223
+ /**
2224
+ * Get the fan profile view for a wallet.
2225
+ * This is a builtin view that aggregates user activity into a profile.
2226
+ */
2227
+ getFanProfile(walletAddress: string): Promise<FanProfileView>;
2228
+ /**
2229
+ * Get the activity summary view for a wallet.
2230
+ * This is a builtin view that summarizes user activity over time.
2231
+ */
2232
+ getActivitySummary(walletAddress: string, days?: number): Promise<ActivitySummaryView>;
2233
+ /**
2234
+ * Get event metadata including available event types and their counts.
2235
+ * Useful for building dynamic UIs that show available event types.
2236
+ */
2237
+ getEventMetadata(): Promise<EventMetadata>;
2238
+ /**
2239
+ * Get available view templates for creating new views.
2240
+ * Templates provide pre-configured computation patterns.
2241
+ */
2242
+ getTemplates(): Promise<ViewTemplate[]>;
2243
+ }
2244
+
2245
+ /**
2246
+ * ProofChain Client
2247
+ */
2248
+
2249
+ /**
2250
+ * Documents resource for attestation operations.
2251
+ */
2252
+ declare class DocumentsResource {
2253
+ private http;
2254
+ constructor(http: HttpClient);
2255
+ /**
2256
+ * Attest a document file.
2257
+ */
2258
+ attest(request: AttestRequest): Promise<AttestationResult>;
2259
+ /**
2260
+ * Get a document by its IPFS hash.
2261
+ */
2262
+ get(ipfsHash: string): Promise<Event>;
2263
+ }
2264
+ /**
2265
+ * Events resource for event operations.
2266
+ */
2267
+ declare class EventsResource {
2268
+ private http;
2269
+ constructor(http: HttpClient);
2270
+ /**
2271
+ * Create a new attestation event.
2272
+ */
2273
+ create(request: CreateEventRequest): Promise<Event>;
2274
+ /**
2275
+ * Get an event by ID.
2276
+ */
2277
+ get(eventId: string): Promise<Event>;
2278
+ /**
2279
+ * List events with optional filters.
2280
+ */
2281
+ list(request?: ListEventsRequest): Promise<Event[]>;
2282
+ /**
2283
+ * Search events by query.
2284
+ */
2285
+ search(request: SearchRequest): Promise<SearchResult>;
2286
+ /**
2287
+ * Get an event by its IPFS hash.
2288
+ */
2289
+ byHash(ipfsHash: string): Promise<Event>;
2290
+ /**
2291
+ * Create multiple events in a batch.
2292
+ *
2293
+ * Note: For high-throughput ingestion, use the IngestionClient instead.
2294
+ * This method is a convenience wrapper that creates events sequentially.
2295
+ *
2296
+ * @param events - Array of event requests
2297
+ * @returns Array of created events
2298
+ */
2299
+ createBatch(events: CreateEventRequest[]): Promise<Event[]>;
2300
+ }
2301
+ /**
2302
+ * Channels resource for state channel operations.
2303
+ */
2304
+ declare class ChannelsResource {
2305
+ private http;
2306
+ constructor(http: HttpClient);
2307
+ /**
2308
+ * Create a new state channel.
2309
+ */
2310
+ create(request: CreateChannelRequest): Promise<Channel>;
2311
+ /**
2312
+ * Get a channel by ID.
2313
+ */
2314
+ get(channelId: string): Promise<Channel>;
2315
+ /**
2316
+ * Get detailed status of a channel.
2317
+ */
2318
+ status(channelId: string): Promise<ChannelStatus>;
2319
+ /**
2320
+ * List all channels.
2321
+ */
2322
+ list(limit?: number, offset?: number): Promise<Channel[]>;
2323
+ /**
2324
+ * Stream an event to a channel.
2325
+ */
2326
+ stream(channelId: string, request: StreamEventRequest): Promise<StreamAck>;
2327
+ /**
2328
+ * Stream multiple events in a single request.
2329
+ */
2330
+ streamBatch(channelId: string, events: StreamEventRequest[]): Promise<Record<string, unknown>>;
2331
+ /**
2332
+ * Settle a channel on-chain.
2333
+ */
2334
+ settle(channelId: string): Promise<Settlement>;
2335
+ /**
2336
+ * Close a channel.
2337
+ */
2338
+ close(channelId: string): Promise<Channel>;
2339
+ }
2340
+ /**
2341
+ * Certificates resource for certificate operations.
2342
+ */
2343
+ declare class CertificatesResource {
2344
+ private http;
2345
+ constructor(http: HttpClient);
2346
+ /**
2347
+ * Issue a new certificate.
2348
+ */
2349
+ issue(request: IssueCertificateRequest): Promise<Certificate>;
2350
+ /**
2351
+ * Get a certificate by ID.
2352
+ */
2353
+ get(certificateId: string): Promise<Certificate>;
2354
+ /**
2355
+ * List certificates.
2356
+ */
2357
+ list(request?: ListCertificatesRequest): Promise<Certificate[]>;
2358
+ /**
2359
+ * Revoke a certificate.
2360
+ */
2361
+ revoke(certificateId: string, reason?: string): Promise<Certificate>;
2362
+ /**
2363
+ * Verify a certificate.
2364
+ */
2365
+ verify(certificateId: string): Promise<Record<string, unknown>>;
2366
+ }
2367
+ /**
2368
+ * Webhooks resource for webhook operations.
2369
+ */
2370
+ declare class WebhooksResource {
2371
+ private http;
2372
+ constructor(http: HttpClient);
2373
+ /**
2374
+ * Create a new webhook.
2375
+ */
2376
+ create(request: CreateWebhookRequest): Promise<Webhook>;
2377
+ /**
2378
+ * Get a webhook by ID.
2379
+ */
2380
+ get(webhookId: string): Promise<Webhook>;
2381
+ /**
2382
+ * List all webhooks.
2383
+ */
2384
+ list(): Promise<Webhook[]>;
2385
+ /**
2386
+ * Update a webhook.
2387
+ */
2388
+ update(webhookId: string, request: UpdateWebhookRequest): Promise<Webhook>;
2389
+ /**
2390
+ * Delete a webhook.
2391
+ */
2392
+ delete(webhookId: string): Promise<void>;
2393
+ /**
2394
+ * Send a test event to a webhook.
2395
+ */
2396
+ test(webhookId: string): Promise<Record<string, unknown>>;
2397
+ }
2398
+ /**
2399
+ * Main ProofChain client.
2400
+ */
2401
+ declare class ProofChain {
2402
+ private http;
2403
+ /** Documents resource for attestation operations */
2404
+ documents: DocumentsResource;
2405
+ /** Events resource for event operations */
2406
+ events: EventsResource;
2407
+ /** Channels resource for state channel operations */
2408
+ channels: ChannelsResource;
2409
+ /** Certificates resource for certificate operations */
2410
+ certificates: CertificatesResource;
2411
+ /** Webhooks resource for webhook operations */
2412
+ webhooks: WebhooksResource;
2413
+ /** Vault resource for file storage operations */
2414
+ vault: VaultResource;
2415
+ /** Search resource for advanced search operations */
2416
+ search: SearchResource;
2417
+ /** Verify resource for public verification operations */
2418
+ verifyResource: VerifyResource;
2419
+ /** Tenant resource for tenant management operations */
2420
+ tenant: TenantResource;
2421
+ /** Passport client for user passport operations */
2422
+ passports: PassportClient;
2423
+ /** Wallet client for CDP wallet operations */
2424
+ wallets: WalletClient;
2425
+ /** End users client for user management */
2426
+ users: EndUsersClient;
2427
+ /** Rewards client for reward definitions and distribution */
2428
+ rewards: RewardsClient;
2429
+ /** Quests client for quest management */
2430
+ quests: QuestsClient;
2431
+ /** Schemas client for event schema validation */
2432
+ schemas: SchemasClient;
2433
+ /** Data Views client for custom data view operations */
2434
+ dataViews: DataViewsClient;
2435
+ constructor(options: ProofChainOptions);
2436
+ /**
2437
+ * Create a client from environment variables.
2438
+ * Reads PROOFCHAIN_API_KEY and optionally PROOFCHAIN_BASE_URL.
2439
+ */
2440
+ static fromEnv(): ProofChain;
2441
+ /**
2442
+ * Verify a document or event by its IPFS hash.
2443
+ */
2444
+ verify(ipfsHash: string): Promise<VerificationResult>;
2445
+ /**
2446
+ * Get information about the current tenant.
2447
+ */
2448
+ tenantInfo(): Promise<TenantInfo>;
2449
+ /**
2450
+ * Get API usage statistics.
2451
+ */
2452
+ usage(period?: string): Promise<UsageStats>;
2453
+ }
2454
+
2455
+ /**
2456
+ * High-Performance Ingestion Client
2457
+ *
2458
+ * Uses the Rust ingestion API at ingest.proofchain.co.za for maximum throughput.
2459
+ * Supports single events, batch events, and WebSocket streaming.
2460
+ */
2461
+ interface IngestEventRequest {
2462
+ userId: string;
2463
+ eventType: string;
2464
+ data?: Record<string, unknown>;
2465
+ eventSource?: string;
2466
+ schemaIds?: string[];
2467
+ }
2468
+ interface IngestEventResponse {
2469
+ eventId: string;
2470
+ certificateId: string;
2471
+ status: string;
2472
+ queuePosition?: number;
2473
+ estimatedConfirmation?: string;
2474
+ }
2475
+ interface BatchIngestRequest {
2476
+ events: IngestEventRequest[];
2477
+ }
2478
+ interface BatchIngestResponse {
2479
+ totalEvents: number;
2480
+ queued: number;
2481
+ failed: number;
2482
+ results: IngestEventResponse[];
2483
+ }
2484
+ interface IngestionClientOptions {
2485
+ apiKey: string;
2486
+ ingestUrl?: string;
2487
+ timeout?: number;
2488
+ }
2489
+ /**
2490
+ * High-performance ingestion client for the Rust ingestion API.
2491
+ *
2492
+ * @example
2493
+ * ```typescript
2494
+ * const ingestion = new IngestionClient({ apiKey: 'your-api-key' });
2495
+ *
2496
+ * // Single event
2497
+ * const result = await ingestion.ingest({
2498
+ * userId: 'user-123',
2499
+ * eventType: 'purchase',
2500
+ * data: { amount: 99.99, product: 'widget' }
2501
+ * });
2502
+ *
2503
+ * // Batch events (up to 1000)
2504
+ * const batchResult = await ingestion.ingestBatch({
2505
+ * events: [
2506
+ * { userId: 'user-1', eventType: 'click', data: { page: '/home' } },
2507
+ * { userId: 'user-2', eventType: 'click', data: { page: '/products' } },
2508
+ * ]
2509
+ * });
2510
+ * ```
2511
+ */
2512
+ declare class IngestionClient {
2513
+ private apiKey;
2514
+ private ingestUrl;
2515
+ private timeout;
2516
+ constructor(options: IngestionClientOptions);
2517
+ private getHeaders;
2518
+ private handleResponse;
2519
+ /**
2520
+ * Ingest a single event using the high-performance Rust API.
2521
+ * Events are attested immediately upon ingestion.
2522
+ */
2523
+ ingest(request: IngestEventRequest): Promise<IngestEventResponse>;
2524
+ /**
2525
+ * Ingest multiple events in a single request (up to 1000 events).
2526
+ * More efficient than individual calls for bulk data.
2527
+ */
2528
+ ingestBatch(request: BatchIngestRequest): Promise<BatchIngestResponse>;
2529
+ /**
2530
+ * Get the status of an event by ID.
2531
+ */
2532
+ getEventStatus(eventId: string): Promise<{
2533
+ status: string;
2534
+ ipfsHash?: string;
2535
+ }>;
2536
+ }
2537
+
2538
+ /**
2539
+ * ProofChain SDK Error Classes
2540
+ */
2541
+ declare class ProofChainError extends Error {
2542
+ statusCode?: number;
2543
+ responseBody?: Record<string, unknown>;
2544
+ constructor(message: string, statusCode?: number, responseBody?: Record<string, unknown>);
2545
+ }
2546
+ declare class AuthenticationError extends ProofChainError {
2547
+ constructor(message?: string);
2548
+ }
2549
+ declare class AuthorizationError extends ProofChainError {
2550
+ constructor(message?: string);
2551
+ }
2552
+ declare class NotFoundError extends ProofChainError {
2553
+ constructor(message?: string);
2554
+ }
2555
+ interface ValidationErrorDetail {
2556
+ field: string;
2557
+ message: string;
2558
+ }
2559
+ declare class ValidationError extends ProofChainError {
2560
+ errors: ValidationErrorDetail[];
2561
+ constructor(message?: string, errors?: ValidationErrorDetail[]);
2562
+ }
2563
+ declare class RateLimitError extends ProofChainError {
2564
+ retryAfter?: number;
2565
+ constructor(retryAfter?: number);
2566
+ }
2567
+ declare class ServerError extends ProofChainError {
2568
+ constructor(message?: string, statusCode?: number);
2569
+ }
2570
+ declare class NetworkError extends ProofChainError {
2571
+ cause?: Error;
2572
+ constructor(message?: string, cause?: Error);
2573
+ }
2574
+ declare class TimeoutError extends ProofChainError {
2575
+ constructor(message?: string);
2576
+ }
327
2577
 
328
- export { AttestationClient, type AttestationClientConfig, AttestationClientError, AttestationRegistryContract, type AttestationRoot, type AuthResponse, type ChallengeRequest, type ChallengeResponse, type Event, type EventCreate, type EventQuery, type EventsListResponse, type HealthResponse, type LinkWalletRequest, type MerkleProof, type MerkleTree, type Quest, type QuestStep, type QuestStepCompletionResult, type QuestWithProgress, type RequestOptions, type RewardInfo, type RootHistory, type RootUpdatedEvent, type UserQuestProgress, type VerifyProofRequest, type VerifyProofResponse, type VerifyRequest, type Wallet, type WalletStatus, createClient };
2578
+ export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type ApiKey, type AttestRequest, type AttestationMode, type AttestationResult, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest, type CreateWebhookRequest, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FieldValue, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type LinkWalletRequest, type ListCertificatesRequest, type ListEndUsersOptions, type ListEventsRequest, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type NFT, NetworkError, NotFoundError, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RewardAsset, type RewardDefinition, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type Settlement, type StepProgress, type StreamAck, type StreamEventRequest, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserQuestProgress, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletStats, type Webhook, WebhooksResource };