@neus/sdk 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -23
- package/SECURITY.md +38 -38
- package/cli/neus.mjs +100 -15
- package/client.js +1837 -1837
- package/package.json +136 -136
- package/types.d.ts +915 -915
- package/widgets/README.md +45 -45
- package/widgets/verify-gate/dist/VerifyGate.js +88 -21
package/types.d.ts
CHANGED
|
@@ -1,915 +1,915 @@
|
|
|
1
|
-
declare module '@neus/sdk' {
|
|
2
|
-
export interface Eip1193Provider {
|
|
3
|
-
request(args: { method: string; params?: unknown[] | Record<string, unknown> }): Promise<unknown>;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export type WalletLike = Eip1193Provider | { address?: string } | { getAddress?: () => Promise<string> } | { signMessage?: (message: string) => Promise<string> };
|
|
7
|
-
|
|
8
|
-
export class NeusClient {
|
|
9
|
-
constructor(config?: NeusClientConfig);
|
|
10
|
-
|
|
11
|
-
verify(params: VerifyParams): Promise<VerificationResult>;
|
|
12
|
-
|
|
13
|
-
getProof(proofId: string): Promise<StatusResult>;
|
|
14
|
-
|
|
15
|
-
getPrivateProof(proofId: string, wallet?: WalletLike | GatePrivateAuth): Promise<StatusResult>;
|
|
16
|
-
|
|
17
|
-
isHealthy(): Promise<boolean>;
|
|
18
|
-
|
|
19
|
-
getVerifiers(): Promise<string[]>;
|
|
20
|
-
|
|
21
|
-
getVerifierCatalog(): Promise<VerifierCatalog>;
|
|
22
|
-
|
|
23
|
-
createWalletLinkData(params: {
|
|
24
|
-
primaryWalletAddress: string;
|
|
25
|
-
secondaryWalletAddress: string;
|
|
26
|
-
wallet?: WalletLike;
|
|
27
|
-
chain?: string;
|
|
28
|
-
signedTimestamp?: number;
|
|
29
|
-
relationshipType?: 'primary' | 'personal' | 'org' | 'affiliate' | 'agent' | 'linked';
|
|
30
|
-
label?: string;
|
|
31
|
-
}): Promise<WalletLinkData>;
|
|
32
|
-
|
|
33
|
-
pollProofStatus(proofId: string, options?: PollOptions): Promise<StatusResult>;
|
|
34
|
-
|
|
35
|
-
revokeOwnProof(proofId: string, wallet?: { address: string }): Promise<boolean>;
|
|
36
|
-
|
|
37
|
-
getProofsByWallet(walletAddress: string, options?: GetProofsOptions): Promise<ProofsResult>;
|
|
38
|
-
|
|
39
|
-
getPrivateProofsByWallet(walletAddress: string, options?: GetProofsOptions, wallet?: WalletLike): Promise<ProofsResult>;
|
|
40
|
-
|
|
41
|
-
gateCheck(params: GateCheckApiParams): Promise<GateCheckApiResponse>;
|
|
42
|
-
|
|
43
|
-
createGatePrivateAuth(params: {
|
|
44
|
-
address: string;
|
|
45
|
-
wallet?: WalletLike;
|
|
46
|
-
chain?: string;
|
|
47
|
-
signatureMethod?: string;
|
|
48
|
-
}): Promise<GatePrivateAuth>;
|
|
49
|
-
|
|
50
|
-
checkGate(params: CheckGateParams): Promise<CheckGateResult>;
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type PrivacyLevel = 'public' | 'private';
|
|
55
|
-
|
|
56
|
-
export interface NeusClientConfig {
|
|
57
|
-
apiUrl?: string;
|
|
58
|
-
apiKey?: string;
|
|
59
|
-
appId?: string;
|
|
60
|
-
paymentSignature?: string;
|
|
61
|
-
extraHeaders?: Record<string, string>;
|
|
62
|
-
timeout?: number;
|
|
63
|
-
hubChainId?: number;
|
|
64
|
-
enableLogging?: boolean;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface VerificationOptions {
|
|
68
|
-
privacyLevel?: PrivacyLevel;
|
|
69
|
-
enableIpfs?: boolean;
|
|
70
|
-
storeOriginalContent?: boolean;
|
|
71
|
-
targetChains?: number[];
|
|
72
|
-
publicDisplay?: boolean;
|
|
73
|
-
meta?: Record<string, any>;
|
|
74
|
-
verifierOptions?: Record<string, any>;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface VerifierCatalogMetadataEntry {
|
|
78
|
-
category?: string;
|
|
79
|
-
description?: string;
|
|
80
|
-
flowType?: 'instant' | 'interactive' | 'external_lookup' | string;
|
|
81
|
-
expiryType?: 'permanent' | 'point_in_time' | 'expiring' | string;
|
|
82
|
-
supportsDirectApi?: boolean;
|
|
83
|
-
supportsHostedVerify?: boolean;
|
|
84
|
-
dataSchema?: Record<string, any>;
|
|
85
|
-
requiredFields?: string[];
|
|
86
|
-
optionalFields?: string[];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface VerifierCatalog {
|
|
90
|
-
data: string[];
|
|
91
|
-
metadata: Record<string, VerifierCatalogMetadataEntry>;
|
|
92
|
-
meta?: Record<string, any>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface VerifyParams {
|
|
96
|
-
verifier?: VerifierId;
|
|
97
|
-
content?: string;
|
|
98
|
-
data?: VerificationData;
|
|
99
|
-
options?: VerifyOptions;
|
|
100
|
-
|
|
101
|
-
verifierIds?: VerifierId[];
|
|
102
|
-
walletAddress?: string;
|
|
103
|
-
signature?: string;
|
|
104
|
-
signedTimestamp?: number;
|
|
105
|
-
chainId?: number;
|
|
106
|
-
chain?: string;
|
|
107
|
-
signatureMethod?: string;
|
|
108
|
-
wallet?: WalletLike;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface ProofResult {
|
|
112
|
-
proofId: string;
|
|
113
|
-
qHash: string;
|
|
114
|
-
status: string;
|
|
115
|
-
walletAddress?: string;
|
|
116
|
-
proofUrl?: string;
|
|
117
|
-
crossChain?: boolean;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface VerificationResult {
|
|
121
|
-
proofId: string;
|
|
122
|
-
qHash: string;
|
|
123
|
-
status: VerificationStatus;
|
|
124
|
-
success: boolean;
|
|
125
|
-
data?: VerificationData;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface StatusResult {
|
|
129
|
-
proofId?: string;
|
|
130
|
-
qHash?: string;
|
|
131
|
-
proofUrl?: string | null;
|
|
132
|
-
success: boolean;
|
|
133
|
-
status: VerificationStatus;
|
|
134
|
-
data?: {
|
|
135
|
-
proofId?: string;
|
|
136
|
-
qHash?: string;
|
|
137
|
-
status: string;
|
|
138
|
-
walletAddress: string;
|
|
139
|
-
verifierIds?: string[];
|
|
140
|
-
targetChains?: number[];
|
|
141
|
-
verifiedVerifiers?: Array<{
|
|
142
|
-
verifierId: string;
|
|
143
|
-
verified: boolean;
|
|
144
|
-
data: any;
|
|
145
|
-
status: string;
|
|
146
|
-
zkInfo?: {
|
|
147
|
-
zkStatus: string;
|
|
148
|
-
};
|
|
149
|
-
}>;
|
|
150
|
-
crosschain?: {
|
|
151
|
-
status: string;
|
|
152
|
-
hubTxHash?: string;
|
|
153
|
-
initiated?: number;
|
|
154
|
-
completed?: number;
|
|
155
|
-
totalChains?: number;
|
|
156
|
-
finalized?: number;
|
|
157
|
-
relayResults?: Record<string, {
|
|
158
|
-
success: boolean;
|
|
159
|
-
transactionHash?: string;
|
|
160
|
-
completedAt?: number;
|
|
161
|
-
chainId: number;
|
|
162
|
-
status: string;
|
|
163
|
-
gasUsed?: string;
|
|
164
|
-
blockNumber?: string;
|
|
165
|
-
voucherId?: string;
|
|
166
|
-
}>;
|
|
167
|
-
createdVouchers?: string[];
|
|
168
|
-
};
|
|
169
|
-
hubTransaction?: {
|
|
170
|
-
txHash: string;
|
|
171
|
-
timestamp: number;
|
|
172
|
-
chainId: number;
|
|
173
|
-
status: string;
|
|
174
|
-
};
|
|
175
|
-
ipfs?: {
|
|
176
|
-
cid: string;
|
|
177
|
-
gateway: string;
|
|
178
|
-
createdAt: number;
|
|
179
|
-
size: number;
|
|
180
|
-
};
|
|
181
|
-
options?: {
|
|
182
|
-
enableIpfs?: boolean;
|
|
183
|
-
publicDisplay?: boolean;
|
|
184
|
-
storeOriginalContent?: boolean;
|
|
185
|
-
verifierOptions?: object;
|
|
186
|
-
privacyLevel?: 'private' | 'public';
|
|
187
|
-
meta?: object;
|
|
188
|
-
};
|
|
189
|
-
meta?: {
|
|
190
|
-
privacyLevel: 'private' | 'public';
|
|
191
|
-
publiclyAccessible: boolean;
|
|
192
|
-
};
|
|
193
|
-
createdAt?: number;
|
|
194
|
-
completedAt?: number;
|
|
195
|
-
lastUpdated?: number;
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface PollOptions {
|
|
200
|
-
interval?: number;
|
|
201
|
-
timeout?: number;
|
|
202
|
-
onProgress?: (status: any) => void;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export interface ValidationResult {
|
|
206
|
-
valid: boolean;
|
|
207
|
-
error?: string;
|
|
208
|
-
missing?: string[];
|
|
209
|
-
warnings?: string[];
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export type CoreVerifierId =
|
|
213
|
-
| 'ownership-basic'
|
|
214
|
-
| 'ownership-social' // Hosted OAuth social ownership
|
|
215
|
-
| 'ownership-pseudonym' // Pseudonymous identity verification
|
|
216
|
-
| 'ownership-org-oauth' // Hosted OAuth organization ownership
|
|
217
|
-
| 'nft-ownership'
|
|
218
|
-
| 'token-holding'
|
|
219
|
-
| 'ownership-dns-txt'
|
|
220
|
-
| 'wallet-link'
|
|
221
|
-
| 'contract-ownership'
|
|
222
|
-
| 'wallet-risk' // Wallet risk assessment
|
|
223
|
-
| 'proof-of-human' // Hosted ZK personhood verification
|
|
224
|
-
| 'agent-identity'
|
|
225
|
-
| 'agent-delegation'
|
|
226
|
-
| 'ai-content-moderation'
|
|
227
|
-
| string; // Allow custom verifier IDs
|
|
228
|
-
|
|
229
|
-
export type VerifierId = CoreVerifierId;
|
|
230
|
-
|
|
231
|
-
export type VerificationStatus =
|
|
232
|
-
| 'processing_verifiers'
|
|
233
|
-
| 'processing_zk_proofs'
|
|
234
|
-
| 'verified'
|
|
235
|
-
| 'verified_no_verifiers'
|
|
236
|
-
| 'verified_crosschain_initiated'
|
|
237
|
-
| 'verified_crosschain_propagating'
|
|
238
|
-
| 'verified_crosschain_propagated'
|
|
239
|
-
| 'partially_verified'
|
|
240
|
-
| 'verified_propagation_failed'
|
|
241
|
-
| 'rejected'
|
|
242
|
-
| 'rejected_verifier_failure'
|
|
243
|
-
| 'rejected_zk_initiation_failure'
|
|
244
|
-
| 'error_processing_exception'
|
|
245
|
-
| 'error_initialization'
|
|
246
|
-
| 'error_storage_unavailable'
|
|
247
|
-
| 'error_storage_query'
|
|
248
|
-
| 'not_found';
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
export function constructVerificationMessage(params: {
|
|
252
|
-
walletAddress: string;
|
|
253
|
-
signedTimestamp: number;
|
|
254
|
-
data: any;
|
|
255
|
-
verifierIds: VerifierId[];
|
|
256
|
-
chainId?: number;
|
|
257
|
-
chain?: string;
|
|
258
|
-
}): string;
|
|
259
|
-
|
|
260
|
-
export const PORTABLE_PROOF_SIGNER_HEADER: string;
|
|
261
|
-
|
|
262
|
-
export function validateWalletAddress(address: string): boolean;
|
|
263
|
-
|
|
264
|
-
export function validateUniversalAddress(address: string, chain?: string): boolean;
|
|
265
|
-
|
|
266
|
-
export function validateTimestamp(timestamp: number, maxAgeMs?: number): boolean;
|
|
267
|
-
|
|
268
|
-
export function validateQHash(qHash: string): boolean;
|
|
269
|
-
|
|
270
|
-
export function normalizeAddress(address: string): string;
|
|
271
|
-
|
|
272
|
-
export function resolveDID(
|
|
273
|
-
params: {
|
|
274
|
-
walletAddress?: string;
|
|
275
|
-
chainId?: number;
|
|
276
|
-
chain?: string;
|
|
277
|
-
},
|
|
278
|
-
options?: {
|
|
279
|
-
endpoint?: string;
|
|
280
|
-
apiUrl?: string;
|
|
281
|
-
credentials?: 'omit' | 'same-origin' | 'include';
|
|
282
|
-
headers?: Record<string, string>;
|
|
283
|
-
}
|
|
284
|
-
): Promise<{
|
|
285
|
-
did: string;
|
|
286
|
-
data: unknown;
|
|
287
|
-
raw: unknown;
|
|
288
|
-
}>;
|
|
289
|
-
|
|
290
|
-
export function standardizeVerificationRequest(
|
|
291
|
-
params: Record<string, any>,
|
|
292
|
-
options?: {
|
|
293
|
-
endpoint?: string;
|
|
294
|
-
apiUrl?: string;
|
|
295
|
-
credentials?: 'omit' | 'same-origin' | 'include';
|
|
296
|
-
headers?: Record<string, string>;
|
|
297
|
-
}
|
|
298
|
-
): Promise<any>;
|
|
299
|
-
|
|
300
|
-
export function resolveZkPassportConfig(overrides?: Record<string, any>): {
|
|
301
|
-
provider: string;
|
|
302
|
-
scope: string;
|
|
303
|
-
checkSanctions: boolean;
|
|
304
|
-
requireFaceMatch: boolean;
|
|
305
|
-
faceMatchMode: string;
|
|
306
|
-
[key: string]: any;
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
export function toHexUtf8(message: string): string;
|
|
310
|
-
|
|
311
|
-
export function signMessage(params: {
|
|
312
|
-
provider?: any;
|
|
313
|
-
message: string;
|
|
314
|
-
walletAddress?: string;
|
|
315
|
-
chain?: string;
|
|
316
|
-
}): Promise<string>;
|
|
317
|
-
|
|
318
|
-
export function validateVerifierPayload(verifierId: string, data: any): ValidationResult;
|
|
319
|
-
|
|
320
|
-
export function buildVerificationRequest(params: {
|
|
321
|
-
verifierIds: string[];
|
|
322
|
-
data: any;
|
|
323
|
-
walletAddress: string;
|
|
324
|
-
chainId?: number;
|
|
325
|
-
chain?: string;
|
|
326
|
-
options?: any;
|
|
327
|
-
signedTimestamp?: number;
|
|
328
|
-
}): { message: string; request: { verifierIds: string[]; data: any; walletAddress: string; signedTimestamp: number; chainId?: number; chain?: string; options?: any } };
|
|
329
|
-
|
|
330
|
-
export function isTerminalStatus(status: VerificationStatus): boolean;
|
|
331
|
-
|
|
332
|
-
export function isSuccessStatus(status: VerificationStatus): boolean;
|
|
333
|
-
|
|
334
|
-
export function isFailureStatus(status: VerificationStatus): boolean;
|
|
335
|
-
|
|
336
|
-
export function formatVerificationStatus(status: VerificationStatus): {
|
|
337
|
-
label: string;
|
|
338
|
-
description: string;
|
|
339
|
-
color: string;
|
|
340
|
-
category: string;
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
export class StatusPoller {
|
|
344
|
-
constructor(client: NeusClient, proofId: string, options?: { interval?: number; maxAttempts?: number; exponentialBackoff?: boolean; maxInterval?: number });
|
|
345
|
-
poll(): Promise<StatusResult>;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
export function formatTimestamp(timestamp: number): string;
|
|
349
|
-
|
|
350
|
-
export function isSupportedChain(chainId: number): boolean;
|
|
351
|
-
|
|
352
|
-
export function delay(ms: number): Promise<void>;
|
|
353
|
-
|
|
354
|
-
export function withRetry<T>(fn: () => Promise<T>, options?: {
|
|
355
|
-
maxAttempts?: number;
|
|
356
|
-
baseDelay?: number;
|
|
357
|
-
maxDelay?: number;
|
|
358
|
-
backoffFactor?: number;
|
|
359
|
-
}): Promise<T>;
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
export function toAgentDelegationMaxSpend(
|
|
363
|
-
humanAmount: string | number,
|
|
364
|
-
decimals: number
|
|
365
|
-
): string;
|
|
366
|
-
|
|
367
|
-
export const DEFAULT_HOSTED_VERIFY_URL: string;
|
|
368
|
-
|
|
369
|
-
export function getHostedCheckoutUrl(opts?: {
|
|
370
|
-
gateId?: string;
|
|
371
|
-
returnUrl?: string;
|
|
372
|
-
verifiers?: string[];
|
|
373
|
-
preset?: string;
|
|
374
|
-
mode?: string;
|
|
375
|
-
intent?: string;
|
|
376
|
-
origin?: string;
|
|
377
|
-
oauthProvider?: string;
|
|
378
|
-
baseUrl?: string;
|
|
379
|
-
}): string;
|
|
380
|
-
|
|
381
|
-
export type NeusPublicGateCharge = {
|
|
382
|
-
enabled: boolean;
|
|
383
|
-
scheme: string;
|
|
384
|
-
label: string;
|
|
385
|
-
amountUsd: number;
|
|
386
|
-
methods: string[];
|
|
387
|
-
appliesTo: string;
|
|
388
|
-
executionOrder?: string;
|
|
389
|
-
recipient?: string;
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
export const NEUS_CONSTANTS: {
|
|
393
|
-
HUB_CHAIN_ID: number;
|
|
394
|
-
TESTNET_CHAINS: number[];
|
|
395
|
-
API_BASE_URL: string;
|
|
396
|
-
API_VERSION: string;
|
|
397
|
-
SIGNATURE_MAX_AGE_MS: number;
|
|
398
|
-
REQUEST_TIMEOUT_MS: number;
|
|
399
|
-
DEFAULT_VERIFIERS: VerifierId[];
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
export class SDKError extends Error {
|
|
404
|
-
code: string;
|
|
405
|
-
details: any;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
export class ApiError extends SDKError {
|
|
409
|
-
statusCode: number;
|
|
410
|
-
response: any;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
export class ValidationError extends SDKError {
|
|
414
|
-
field?: string;
|
|
415
|
-
value?: any;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export class NetworkError extends SDKError {
|
|
419
|
-
originalError?: Error;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
export class ConfigurationError extends SDKError {
|
|
423
|
-
configKey?: string;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
export class VerificationError extends SDKError {
|
|
427
|
-
verifierId?: string;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export class AuthenticationError extends SDKError {}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
export interface GetProofsOptions {
|
|
434
|
-
limit?: number;
|
|
435
|
-
offset?: number;
|
|
436
|
-
chain?: string;
|
|
437
|
-
signatureMethod?: string;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
export interface ProofsResult {
|
|
441
|
-
success: boolean;
|
|
442
|
-
proofs: any[];
|
|
443
|
-
totalCount: number;
|
|
444
|
-
hasMore: boolean;
|
|
445
|
-
nextOffset?: number | null;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
export interface GateRequirement {
|
|
449
|
-
verifierId: CoreVerifierId;
|
|
450
|
-
maxAgeMs?: number;
|
|
451
|
-
optional?: boolean;
|
|
452
|
-
minCount?: number;
|
|
453
|
-
match?: Record<string, any>;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
export interface CheckGateParams {
|
|
457
|
-
walletAddress: string;
|
|
458
|
-
requirements: GateRequirement[];
|
|
459
|
-
proofs?: any[];
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
export interface CheckGateResult {
|
|
463
|
-
satisfied: boolean;
|
|
464
|
-
missing: GateRequirement[];
|
|
465
|
-
existing: Record<string, any>;
|
|
466
|
-
allProofs: any[];
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
export interface GateCheckApiParams {
|
|
470
|
-
address: string;
|
|
471
|
-
verifierIds?: string[] | string;
|
|
472
|
-
requireAll?: boolean;
|
|
473
|
-
minCount?: number;
|
|
474
|
-
sinceDays?: number;
|
|
475
|
-
since?: number;
|
|
476
|
-
limit?: number;
|
|
477
|
-
includePrivate?: boolean;
|
|
478
|
-
includeQHashes?: boolean;
|
|
479
|
-
wallet?: WalletLike;
|
|
480
|
-
chain?: string;
|
|
481
|
-
signatureMethod?: string;
|
|
482
|
-
privateAuth?: GatePrivateAuth;
|
|
483
|
-
|
|
484
|
-
referenceType?: string;
|
|
485
|
-
referenceId?: string;
|
|
486
|
-
tag?: string;
|
|
487
|
-
tags?: string[] | string;
|
|
488
|
-
contentType?: string;
|
|
489
|
-
content?: string;
|
|
490
|
-
contentHash?: string;
|
|
491
|
-
|
|
492
|
-
contractAddress?: string;
|
|
493
|
-
tokenId?: string;
|
|
494
|
-
chainId?: number;
|
|
495
|
-
domain?: string;
|
|
496
|
-
minBalance?: string;
|
|
497
|
-
|
|
498
|
-
provider?: string;
|
|
499
|
-
handle?: string;
|
|
500
|
-
namespace?: string;
|
|
501
|
-
ownerAddress?: string;
|
|
502
|
-
riskLevel?: string;
|
|
503
|
-
sanctioned?: boolean;
|
|
504
|
-
poisoned?: boolean;
|
|
505
|
-
primaryWalletAddress?: string;
|
|
506
|
-
secondaryWalletAddress?: string;
|
|
507
|
-
verificationMethod?: string;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
export interface GatePrivateAuth {
|
|
511
|
-
walletAddress: string;
|
|
512
|
-
signature: string;
|
|
513
|
-
signedTimestamp: number;
|
|
514
|
-
chain?: string;
|
|
515
|
-
signatureMethod?: string;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
export interface GateCheckApiResponse {
|
|
519
|
-
success: boolean;
|
|
520
|
-
data?: {
|
|
521
|
-
eligible: boolean;
|
|
522
|
-
matchedCount?: number;
|
|
523
|
-
matchedQHashes?: string[];
|
|
524
|
-
matchedProofIds?: string[];
|
|
525
|
-
matchedTags?: string[];
|
|
526
|
-
projections?: Array<Record<string, any>> | null;
|
|
527
|
-
criteria?: Record<string, any>;
|
|
528
|
-
};
|
|
529
|
-
error?: any;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
export interface ApiResponse<T = any> {
|
|
534
|
-
success: boolean;
|
|
535
|
-
data?: T;
|
|
536
|
-
error?: any;
|
|
537
|
-
status?: string;
|
|
538
|
-
timestamp?: number;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
export const HOUR: number;
|
|
543
|
-
export const DAY: number;
|
|
544
|
-
export const WEEK: number;
|
|
545
|
-
export const MONTH: number;
|
|
546
|
-
export const YEAR: number;
|
|
547
|
-
|
|
548
|
-
export const GATE_NFT_HOLDER: GateRequirement[];
|
|
549
|
-
export const GATE_TOKEN_HOLDER: GateRequirement[];
|
|
550
|
-
export const GATE_CONTRACT_ADMIN: GateRequirement[];
|
|
551
|
-
export const GATE_DOMAIN_OWNER: GateRequirement[];
|
|
552
|
-
export const GATE_LINKED_WALLETS: GateRequirement[];
|
|
553
|
-
export const GATE_AGENT_IDENTITY: GateRequirement[];
|
|
554
|
-
export const GATE_AGENT_DELEGATION: GateRequirement[];
|
|
555
|
-
export const GATE_CONTENT_MODERATION: GateRequirement[];
|
|
556
|
-
export const GATE_WALLET_RISK: GateRequirement[];
|
|
557
|
-
export const GATE_PSEUDONYM: GateRequirement[];
|
|
558
|
-
|
|
559
|
-
export function createGate(
|
|
560
|
-
requirements: Array<CoreVerifierId | GateRequirement>
|
|
561
|
-
): GateRequirement[];
|
|
562
|
-
|
|
563
|
-
export function combineGates(
|
|
564
|
-
...gates: GateRequirement[][]
|
|
565
|
-
): GateRequirement[];
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
type OwnershipBasicData = {
|
|
569
|
-
owner: string;
|
|
570
|
-
content?: string;
|
|
571
|
-
contentHash?: string;
|
|
572
|
-
contentType?: string;
|
|
573
|
-
reference?: {
|
|
574
|
-
type:
|
|
575
|
-
| 'ipfs'
|
|
576
|
-
| 'ipfs-hash'
|
|
577
|
-
| 'url'
|
|
578
|
-
| 'license-nft'
|
|
579
|
-
| 'contract'
|
|
580
|
-
| 'qhash'
|
|
581
|
-
| 'ethereum-tx'
|
|
582
|
-
| 'on-chain-tx'
|
|
583
|
-
| 'tx'
|
|
584
|
-
| 'file'
|
|
585
|
-
| 'doc'
|
|
586
|
-
| 'media'
|
|
587
|
-
| 'username-claim'
|
|
588
|
-
| 'other';
|
|
589
|
-
id?: string;
|
|
590
|
-
title?: string;
|
|
591
|
-
description?: string;
|
|
592
|
-
mime?: string;
|
|
593
|
-
name?: string;
|
|
594
|
-
size?: number;
|
|
595
|
-
};
|
|
596
|
-
provenance?: {
|
|
597
|
-
declaredKind?: 'human' | 'ai' | 'mixed' | 'unknown';
|
|
598
|
-
aiContext?: {
|
|
599
|
-
generatorType?: 'local' | 'saas' | 'agent';
|
|
600
|
-
provider?: string;
|
|
601
|
-
model?: string;
|
|
602
|
-
runId?: string;
|
|
603
|
-
};
|
|
604
|
-
};
|
|
605
|
-
[key: string]: any;
|
|
606
|
-
};
|
|
607
|
-
|
|
608
|
-
type OwnershipPseudonymData = {
|
|
609
|
-
pseudonymId: string;
|
|
610
|
-
namespace?: string;
|
|
611
|
-
displayName?: string;
|
|
612
|
-
metadata?: Record<string, any>;
|
|
613
|
-
[key: string]: any;
|
|
614
|
-
};
|
|
615
|
-
|
|
616
|
-
type OwnershipDnsTxtData = {
|
|
617
|
-
domain: string;
|
|
618
|
-
walletAddress?: string;
|
|
619
|
-
[key: string]: any;
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
type ContractOwnershipData = {
|
|
623
|
-
contractAddress: string;
|
|
624
|
-
chainId: number;
|
|
625
|
-
walletAddress?: string;
|
|
626
|
-
method?: 'owner' | 'admin' | 'accessControl';
|
|
627
|
-
[key: string]: any;
|
|
628
|
-
};
|
|
629
|
-
|
|
630
|
-
type NftOwnershipData = {
|
|
631
|
-
ownerAddress?: string;
|
|
632
|
-
contractAddress: string;
|
|
633
|
-
tokenId: string;
|
|
634
|
-
tokenType?: 'erc721' | 'erc1155';
|
|
635
|
-
chainId: number;
|
|
636
|
-
blockNumber?: number;
|
|
637
|
-
[key: string]: any;
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
type TokenHoldingData = {
|
|
641
|
-
ownerAddress?: string;
|
|
642
|
-
contractAddress: string;
|
|
643
|
-
minBalance: string;
|
|
644
|
-
chainId: number;
|
|
645
|
-
blockNumber?: number;
|
|
646
|
-
[key: string]: any;
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
type WalletRiskData = {
|
|
650
|
-
provider?: string;
|
|
651
|
-
walletAddress?: string;
|
|
652
|
-
chainId?: number;
|
|
653
|
-
includeDetails?: boolean;
|
|
654
|
-
[key: string]: any;
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
type WalletLinkData = {
|
|
658
|
-
primaryWalletAddress: string;
|
|
659
|
-
secondaryWalletAddress: string;
|
|
660
|
-
signature: string;
|
|
661
|
-
chain: string;
|
|
662
|
-
signatureMethod: string;
|
|
663
|
-
signedTimestamp: number;
|
|
664
|
-
relationshipType?: 'primary' | 'personal' | 'org' | 'affiliate' | 'agent' | 'linked';
|
|
665
|
-
label?: string;
|
|
666
|
-
[key: string]: any;
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
type AiContentModerationData = {
|
|
670
|
-
content: string;
|
|
671
|
-
contentType:
|
|
672
|
-
| 'image/jpeg'
|
|
673
|
-
| 'image/png'
|
|
674
|
-
| 'image/webp'
|
|
675
|
-
| 'image/gif'
|
|
676
|
-
| 'text/plain'
|
|
677
|
-
| 'text/markdown'
|
|
678
|
-
| 'text/x-markdown'
|
|
679
|
-
| 'application/json'
|
|
680
|
-
| 'application/xml';
|
|
681
|
-
provider?: 'google-vision' | 'google-perspective';
|
|
682
|
-
[key: string]: any;
|
|
683
|
-
};
|
|
684
|
-
|
|
685
|
-
type AgentIdentityData = {
|
|
686
|
-
agentId: string;
|
|
687
|
-
agentWallet: string;
|
|
688
|
-
agentLabel?: string;
|
|
689
|
-
agentType?: 'ai' | 'bot' | 'service' | 'automation' | 'agent';
|
|
690
|
-
description?: string;
|
|
691
|
-
capabilities?: any[];
|
|
692
|
-
instructions?: string;
|
|
693
|
-
skills?: string[];
|
|
694
|
-
services?: Array<{
|
|
695
|
-
name: string;
|
|
696
|
-
endpoint: string;
|
|
697
|
-
version?: string;
|
|
698
|
-
}>;
|
|
699
|
-
[key: string]: any;
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
type AgentDelegationData = {
|
|
703
|
-
controllerWallet: string;
|
|
704
|
-
agentWallet: string;
|
|
705
|
-
agentId?: string;
|
|
706
|
-
scope?: string;
|
|
707
|
-
permissions?: any[];
|
|
708
|
-
maxSpend?: string;
|
|
709
|
-
allowedPaymentTypes?: string[];
|
|
710
|
-
receiptDisclosure?: 'none' | 'summary' | 'full';
|
|
711
|
-
expiresAt?: number;
|
|
712
|
-
instructions?: string;
|
|
713
|
-
skills?: string[];
|
|
714
|
-
[key: string]: any;
|
|
715
|
-
};
|
|
716
|
-
|
|
717
|
-
type CoreVerificationData =
|
|
718
|
-
| OwnershipBasicData
|
|
719
|
-
| OwnershipPseudonymData
|
|
720
|
-
| OwnershipDnsTxtData
|
|
721
|
-
| ContractOwnershipData
|
|
722
|
-
| NftOwnershipData
|
|
723
|
-
| TokenHoldingData
|
|
724
|
-
| WalletRiskData
|
|
725
|
-
| WalletLinkData
|
|
726
|
-
| AiContentModerationData
|
|
727
|
-
| AgentIdentityData
|
|
728
|
-
| AgentDelegationData;
|
|
729
|
-
|
|
730
|
-
type VerificationData =
|
|
731
|
-
| CoreVerificationData
|
|
732
|
-
| Record<string, CoreVerificationData>
|
|
733
|
-
| Record<string, any>;
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
interface VerifyOptions {
|
|
738
|
-
targetChains?: number[];
|
|
739
|
-
enableIpfs?: boolean;
|
|
740
|
-
privacyLevel?: 'private' | 'public';
|
|
741
|
-
publicDisplay?: boolean;
|
|
742
|
-
storeOriginalContent?: boolean;
|
|
743
|
-
meta?: {
|
|
744
|
-
title?: string;
|
|
745
|
-
description?: string;
|
|
746
|
-
displayName?: string;
|
|
747
|
-
contentText?: string;
|
|
748
|
-
contentType?: string;
|
|
749
|
-
contentDescription?: string;
|
|
750
|
-
license?: string;
|
|
751
|
-
publicContentLicense?: string;
|
|
752
|
-
publicContentDisclaimer?: string;
|
|
753
|
-
legal?: string;
|
|
754
|
-
source?: string;
|
|
755
|
-
campaign?: string;
|
|
756
|
-
tags?: string[];
|
|
757
|
-
category?: string;
|
|
758
|
-
};
|
|
759
|
-
reference?: {
|
|
760
|
-
type:
|
|
761
|
-
| 'ipfs'
|
|
762
|
-
| 'ipfs-hash'
|
|
763
|
-
| 'url'
|
|
764
|
-
| 'license-nft'
|
|
765
|
-
| 'contract'
|
|
766
|
-
| 'qhash'
|
|
767
|
-
| 'ethereum-tx'
|
|
768
|
-
| 'on-chain-tx'
|
|
769
|
-
| 'tx'
|
|
770
|
-
| 'file'
|
|
771
|
-
| 'doc'
|
|
772
|
-
| 'media'
|
|
773
|
-
| 'username-claim'
|
|
774
|
-
| 'other';
|
|
775
|
-
id?: string;
|
|
776
|
-
title?: string;
|
|
777
|
-
description?: string;
|
|
778
|
-
mime?: string;
|
|
779
|
-
name?: string;
|
|
780
|
-
size?: number;
|
|
781
|
-
};
|
|
782
|
-
verifierOptions?: Record<string, any>;
|
|
783
|
-
identity?: { pseudonym?: string; socials?: Record<string, string> };
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
declare module '@neus/sdk/widgets' {
|
|
790
|
-
export interface VerifyGateProps {
|
|
791
|
-
requiredVerifiers?: string[];
|
|
792
|
-
onVerified?: (result: {
|
|
793
|
-
proofId: string;
|
|
794
|
-
qHash: string;
|
|
795
|
-
proofIds?: string[];
|
|
796
|
-
qHashes?: string[];
|
|
797
|
-
address?: string;
|
|
798
|
-
txHash?: string | null;
|
|
799
|
-
verifierIds: string[];
|
|
800
|
-
verifiedVerifiers?: any[];
|
|
801
|
-
proofUrl?: string | null;
|
|
802
|
-
existing?: boolean;
|
|
803
|
-
eligible?: boolean;
|
|
804
|
-
mode?: 'create' | 'access';
|
|
805
|
-
data?: any;
|
|
806
|
-
results?: Array<{
|
|
807
|
-
verifierId: string;
|
|
808
|
-
proofId: string;
|
|
809
|
-
qHash: string;
|
|
810
|
-
address?: string;
|
|
811
|
-
txHash?: string | null;
|
|
812
|
-
verifiedVerifiers?: any[];
|
|
813
|
-
proofUrl?: string | null;
|
|
814
|
-
}>;
|
|
815
|
-
proofsByVerifierId?: Record<string, any>;
|
|
816
|
-
}) => void;
|
|
817
|
-
apiUrl?: string;
|
|
818
|
-
appId?: string;
|
|
819
|
-
paymentSignature?: string;
|
|
820
|
-
extraHeaders?: Record<string, string>;
|
|
821
|
-
hostedCheckoutUrl?: string;
|
|
822
|
-
oauthProvider?: string;
|
|
823
|
-
style?: Record<string, any>;
|
|
824
|
-
children?: any;
|
|
825
|
-
verifierOptions?: Record<string, any>;
|
|
826
|
-
verifierData?: Record<string, any>;
|
|
827
|
-
proofOptions?: Record<string, any>;
|
|
828
|
-
strategy?: 'reuse-or-create' | 'reuse' | 'fresh';
|
|
829
|
-
checkExisting?: boolean;
|
|
830
|
-
maxProofAgeMs?: number;
|
|
831
|
-
allowPrivateReuse?: boolean;
|
|
832
|
-
showBrand?: boolean;
|
|
833
|
-
disabled?: boolean;
|
|
834
|
-
buttonText?: string;
|
|
835
|
-
mode?: 'create' | 'access';
|
|
836
|
-
proofId?: string | null;
|
|
837
|
-
qHash?: string | null;
|
|
838
|
-
wallet?: WalletLike | any;
|
|
839
|
-
chain?: string;
|
|
840
|
-
signatureMethod?: string;
|
|
841
|
-
onStateChange?: (state: string) => void;
|
|
842
|
-
onError?: (error: Error) => void;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
export function VerifyGate(props: VerifyGateProps): any;
|
|
846
|
-
|
|
847
|
-
export interface ProofBadgeProps {
|
|
848
|
-
proofId?: string;
|
|
849
|
-
qHash?: string;
|
|
850
|
-
proofUrlPattern?: string;
|
|
851
|
-
size?: 'sm' | 'md';
|
|
852
|
-
uiLinkBase?: string;
|
|
853
|
-
apiUrl?: string;
|
|
854
|
-
proof?: any;
|
|
855
|
-
showChains?: boolean;
|
|
856
|
-
showLabel?: boolean;
|
|
857
|
-
logoUrl?: string;
|
|
858
|
-
onClick?: (data: { proofId: string; qHash: string; status: string; chainCount?: number }) => void;
|
|
859
|
-
className?: string;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
export function ProofBadge(props: ProofBadgeProps): any;
|
|
863
|
-
|
|
864
|
-
export interface SimpleProofBadgeProps {
|
|
865
|
-
proofId?: string;
|
|
866
|
-
qHash?: string;
|
|
867
|
-
proofUrlPattern?: string;
|
|
868
|
-
uiLinkBase?: string;
|
|
869
|
-
apiUrl?: string;
|
|
870
|
-
size?: 'sm' | 'md';
|
|
871
|
-
label?: string;
|
|
872
|
-
logoUrl?: string;
|
|
873
|
-
proof?: any;
|
|
874
|
-
onClick?: (data: { proofId: string; qHash: string; status: string }) => void;
|
|
875
|
-
className?: string;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
export function SimpleProofBadge(props: SimpleProofBadgeProps): any;
|
|
879
|
-
|
|
880
|
-
export interface NeusPillLinkProps {
|
|
881
|
-
proofId?: string;
|
|
882
|
-
qHash?: string;
|
|
883
|
-
proofUrlPattern?: string;
|
|
884
|
-
uiLinkBase?: string;
|
|
885
|
-
label?: string;
|
|
886
|
-
size?: 'sm' | 'md';
|
|
887
|
-
logoUrl?: string;
|
|
888
|
-
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
889
|
-
className?: string;
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
export function NeusPillLink(props: NeusPillLinkProps): any;
|
|
893
|
-
|
|
894
|
-
export interface VerifiedIconProps {
|
|
895
|
-
proofId?: string;
|
|
896
|
-
qHash?: string;
|
|
897
|
-
proofUrlPattern?: string;
|
|
898
|
-
uiLinkBase?: string;
|
|
899
|
-
size?: number;
|
|
900
|
-
logoUrl?: string;
|
|
901
|
-
tooltip?: string;
|
|
902
|
-
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
903
|
-
className?: string;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
export function VerifiedIcon(props: VerifiedIconProps): any;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
declare module '@neus/sdk/widgets/verify-gate' {
|
|
910
|
-
export * from '@neus/sdk/widgets';
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
declare module '@neus/sdk/client' {
|
|
914
|
-
export { NeusClient } from '@neus/sdk';
|
|
915
|
-
}
|
|
1
|
+
declare module '@neus/sdk' {
|
|
2
|
+
export interface Eip1193Provider {
|
|
3
|
+
request(args: { method: string; params?: unknown[] | Record<string, unknown> }): Promise<unknown>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type WalletLike = Eip1193Provider | { address?: string } | { getAddress?: () => Promise<string> } | { signMessage?: (message: string) => Promise<string> };
|
|
7
|
+
|
|
8
|
+
export class NeusClient {
|
|
9
|
+
constructor(config?: NeusClientConfig);
|
|
10
|
+
|
|
11
|
+
verify(params: VerifyParams): Promise<VerificationResult>;
|
|
12
|
+
|
|
13
|
+
getProof(proofId: string): Promise<StatusResult>;
|
|
14
|
+
|
|
15
|
+
getPrivateProof(proofId: string, wallet?: WalletLike | GatePrivateAuth): Promise<StatusResult>;
|
|
16
|
+
|
|
17
|
+
isHealthy(): Promise<boolean>;
|
|
18
|
+
|
|
19
|
+
getVerifiers(): Promise<string[]>;
|
|
20
|
+
|
|
21
|
+
getVerifierCatalog(): Promise<VerifierCatalog>;
|
|
22
|
+
|
|
23
|
+
createWalletLinkData(params: {
|
|
24
|
+
primaryWalletAddress: string;
|
|
25
|
+
secondaryWalletAddress: string;
|
|
26
|
+
wallet?: WalletLike;
|
|
27
|
+
chain?: string;
|
|
28
|
+
signedTimestamp?: number;
|
|
29
|
+
relationshipType?: 'primary' | 'personal' | 'org' | 'affiliate' | 'agent' | 'linked';
|
|
30
|
+
label?: string;
|
|
31
|
+
}): Promise<WalletLinkData>;
|
|
32
|
+
|
|
33
|
+
pollProofStatus(proofId: string, options?: PollOptions): Promise<StatusResult>;
|
|
34
|
+
|
|
35
|
+
revokeOwnProof(proofId: string, wallet?: { address: string }): Promise<boolean>;
|
|
36
|
+
|
|
37
|
+
getProofsByWallet(walletAddress: string, options?: GetProofsOptions): Promise<ProofsResult>;
|
|
38
|
+
|
|
39
|
+
getPrivateProofsByWallet(walletAddress: string, options?: GetProofsOptions, wallet?: WalletLike): Promise<ProofsResult>;
|
|
40
|
+
|
|
41
|
+
gateCheck(params: GateCheckApiParams): Promise<GateCheckApiResponse>;
|
|
42
|
+
|
|
43
|
+
createGatePrivateAuth(params: {
|
|
44
|
+
address: string;
|
|
45
|
+
wallet?: WalletLike;
|
|
46
|
+
chain?: string;
|
|
47
|
+
signatureMethod?: string;
|
|
48
|
+
}): Promise<GatePrivateAuth>;
|
|
49
|
+
|
|
50
|
+
checkGate(params: CheckGateParams): Promise<CheckGateResult>;
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type PrivacyLevel = 'public' | 'private';
|
|
55
|
+
|
|
56
|
+
export interface NeusClientConfig {
|
|
57
|
+
apiUrl?: string;
|
|
58
|
+
apiKey?: string;
|
|
59
|
+
appId?: string;
|
|
60
|
+
paymentSignature?: string;
|
|
61
|
+
extraHeaders?: Record<string, string>;
|
|
62
|
+
timeout?: number;
|
|
63
|
+
hubChainId?: number;
|
|
64
|
+
enableLogging?: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface VerificationOptions {
|
|
68
|
+
privacyLevel?: PrivacyLevel;
|
|
69
|
+
enableIpfs?: boolean;
|
|
70
|
+
storeOriginalContent?: boolean;
|
|
71
|
+
targetChains?: number[];
|
|
72
|
+
publicDisplay?: boolean;
|
|
73
|
+
meta?: Record<string, any>;
|
|
74
|
+
verifierOptions?: Record<string, any>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface VerifierCatalogMetadataEntry {
|
|
78
|
+
category?: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
flowType?: 'instant' | 'interactive' | 'external_lookup' | string;
|
|
81
|
+
expiryType?: 'permanent' | 'point_in_time' | 'expiring' | string;
|
|
82
|
+
supportsDirectApi?: boolean;
|
|
83
|
+
supportsHostedVerify?: boolean;
|
|
84
|
+
dataSchema?: Record<string, any>;
|
|
85
|
+
requiredFields?: string[];
|
|
86
|
+
optionalFields?: string[];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface VerifierCatalog {
|
|
90
|
+
data: string[];
|
|
91
|
+
metadata: Record<string, VerifierCatalogMetadataEntry>;
|
|
92
|
+
meta?: Record<string, any>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface VerifyParams {
|
|
96
|
+
verifier?: VerifierId;
|
|
97
|
+
content?: string;
|
|
98
|
+
data?: VerificationData;
|
|
99
|
+
options?: VerifyOptions;
|
|
100
|
+
|
|
101
|
+
verifierIds?: VerifierId[];
|
|
102
|
+
walletAddress?: string;
|
|
103
|
+
signature?: string;
|
|
104
|
+
signedTimestamp?: number;
|
|
105
|
+
chainId?: number;
|
|
106
|
+
chain?: string;
|
|
107
|
+
signatureMethod?: string;
|
|
108
|
+
wallet?: WalletLike;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ProofResult {
|
|
112
|
+
proofId: string;
|
|
113
|
+
qHash: string;
|
|
114
|
+
status: string;
|
|
115
|
+
walletAddress?: string;
|
|
116
|
+
proofUrl?: string;
|
|
117
|
+
crossChain?: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface VerificationResult {
|
|
121
|
+
proofId: string;
|
|
122
|
+
qHash: string;
|
|
123
|
+
status: VerificationStatus;
|
|
124
|
+
success: boolean;
|
|
125
|
+
data?: VerificationData;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface StatusResult {
|
|
129
|
+
proofId?: string;
|
|
130
|
+
qHash?: string;
|
|
131
|
+
proofUrl?: string | null;
|
|
132
|
+
success: boolean;
|
|
133
|
+
status: VerificationStatus;
|
|
134
|
+
data?: {
|
|
135
|
+
proofId?: string;
|
|
136
|
+
qHash?: string;
|
|
137
|
+
status: string;
|
|
138
|
+
walletAddress: string;
|
|
139
|
+
verifierIds?: string[];
|
|
140
|
+
targetChains?: number[];
|
|
141
|
+
verifiedVerifiers?: Array<{
|
|
142
|
+
verifierId: string;
|
|
143
|
+
verified: boolean;
|
|
144
|
+
data: any;
|
|
145
|
+
status: string;
|
|
146
|
+
zkInfo?: {
|
|
147
|
+
zkStatus: string;
|
|
148
|
+
};
|
|
149
|
+
}>;
|
|
150
|
+
crosschain?: {
|
|
151
|
+
status: string;
|
|
152
|
+
hubTxHash?: string;
|
|
153
|
+
initiated?: number;
|
|
154
|
+
completed?: number;
|
|
155
|
+
totalChains?: number;
|
|
156
|
+
finalized?: number;
|
|
157
|
+
relayResults?: Record<string, {
|
|
158
|
+
success: boolean;
|
|
159
|
+
transactionHash?: string;
|
|
160
|
+
completedAt?: number;
|
|
161
|
+
chainId: number;
|
|
162
|
+
status: string;
|
|
163
|
+
gasUsed?: string;
|
|
164
|
+
blockNumber?: string;
|
|
165
|
+
voucherId?: string;
|
|
166
|
+
}>;
|
|
167
|
+
createdVouchers?: string[];
|
|
168
|
+
};
|
|
169
|
+
hubTransaction?: {
|
|
170
|
+
txHash: string;
|
|
171
|
+
timestamp: number;
|
|
172
|
+
chainId: number;
|
|
173
|
+
status: string;
|
|
174
|
+
};
|
|
175
|
+
ipfs?: {
|
|
176
|
+
cid: string;
|
|
177
|
+
gateway: string;
|
|
178
|
+
createdAt: number;
|
|
179
|
+
size: number;
|
|
180
|
+
};
|
|
181
|
+
options?: {
|
|
182
|
+
enableIpfs?: boolean;
|
|
183
|
+
publicDisplay?: boolean;
|
|
184
|
+
storeOriginalContent?: boolean;
|
|
185
|
+
verifierOptions?: object;
|
|
186
|
+
privacyLevel?: 'private' | 'public';
|
|
187
|
+
meta?: object;
|
|
188
|
+
};
|
|
189
|
+
meta?: {
|
|
190
|
+
privacyLevel: 'private' | 'public';
|
|
191
|
+
publiclyAccessible: boolean;
|
|
192
|
+
};
|
|
193
|
+
createdAt?: number;
|
|
194
|
+
completedAt?: number;
|
|
195
|
+
lastUpdated?: number;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface PollOptions {
|
|
200
|
+
interval?: number;
|
|
201
|
+
timeout?: number;
|
|
202
|
+
onProgress?: (status: any) => void;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface ValidationResult {
|
|
206
|
+
valid: boolean;
|
|
207
|
+
error?: string;
|
|
208
|
+
missing?: string[];
|
|
209
|
+
warnings?: string[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export type CoreVerifierId =
|
|
213
|
+
| 'ownership-basic'
|
|
214
|
+
| 'ownership-social' // Hosted OAuth social ownership
|
|
215
|
+
| 'ownership-pseudonym' // Pseudonymous identity verification
|
|
216
|
+
| 'ownership-org-oauth' // Hosted OAuth organization ownership
|
|
217
|
+
| 'nft-ownership'
|
|
218
|
+
| 'token-holding'
|
|
219
|
+
| 'ownership-dns-txt'
|
|
220
|
+
| 'wallet-link'
|
|
221
|
+
| 'contract-ownership'
|
|
222
|
+
| 'wallet-risk' // Wallet risk assessment
|
|
223
|
+
| 'proof-of-human' // Hosted ZK personhood verification
|
|
224
|
+
| 'agent-identity'
|
|
225
|
+
| 'agent-delegation'
|
|
226
|
+
| 'ai-content-moderation'
|
|
227
|
+
| string; // Allow custom verifier IDs
|
|
228
|
+
|
|
229
|
+
export type VerifierId = CoreVerifierId;
|
|
230
|
+
|
|
231
|
+
export type VerificationStatus =
|
|
232
|
+
| 'processing_verifiers'
|
|
233
|
+
| 'processing_zk_proofs'
|
|
234
|
+
| 'verified'
|
|
235
|
+
| 'verified_no_verifiers'
|
|
236
|
+
| 'verified_crosschain_initiated'
|
|
237
|
+
| 'verified_crosschain_propagating'
|
|
238
|
+
| 'verified_crosschain_propagated'
|
|
239
|
+
| 'partially_verified'
|
|
240
|
+
| 'verified_propagation_failed'
|
|
241
|
+
| 'rejected'
|
|
242
|
+
| 'rejected_verifier_failure'
|
|
243
|
+
| 'rejected_zk_initiation_failure'
|
|
244
|
+
| 'error_processing_exception'
|
|
245
|
+
| 'error_initialization'
|
|
246
|
+
| 'error_storage_unavailable'
|
|
247
|
+
| 'error_storage_query'
|
|
248
|
+
| 'not_found';
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
export function constructVerificationMessage(params: {
|
|
252
|
+
walletAddress: string;
|
|
253
|
+
signedTimestamp: number;
|
|
254
|
+
data: any;
|
|
255
|
+
verifierIds: VerifierId[];
|
|
256
|
+
chainId?: number;
|
|
257
|
+
chain?: string;
|
|
258
|
+
}): string;
|
|
259
|
+
|
|
260
|
+
export const PORTABLE_PROOF_SIGNER_HEADER: string;
|
|
261
|
+
|
|
262
|
+
export function validateWalletAddress(address: string): boolean;
|
|
263
|
+
|
|
264
|
+
export function validateUniversalAddress(address: string, chain?: string): boolean;
|
|
265
|
+
|
|
266
|
+
export function validateTimestamp(timestamp: number, maxAgeMs?: number): boolean;
|
|
267
|
+
|
|
268
|
+
export function validateQHash(qHash: string): boolean;
|
|
269
|
+
|
|
270
|
+
export function normalizeAddress(address: string): string;
|
|
271
|
+
|
|
272
|
+
export function resolveDID(
|
|
273
|
+
params: {
|
|
274
|
+
walletAddress?: string;
|
|
275
|
+
chainId?: number;
|
|
276
|
+
chain?: string;
|
|
277
|
+
},
|
|
278
|
+
options?: {
|
|
279
|
+
endpoint?: string;
|
|
280
|
+
apiUrl?: string;
|
|
281
|
+
credentials?: 'omit' | 'same-origin' | 'include';
|
|
282
|
+
headers?: Record<string, string>;
|
|
283
|
+
}
|
|
284
|
+
): Promise<{
|
|
285
|
+
did: string;
|
|
286
|
+
data: unknown;
|
|
287
|
+
raw: unknown;
|
|
288
|
+
}>;
|
|
289
|
+
|
|
290
|
+
export function standardizeVerificationRequest(
|
|
291
|
+
params: Record<string, any>,
|
|
292
|
+
options?: {
|
|
293
|
+
endpoint?: string;
|
|
294
|
+
apiUrl?: string;
|
|
295
|
+
credentials?: 'omit' | 'same-origin' | 'include';
|
|
296
|
+
headers?: Record<string, string>;
|
|
297
|
+
}
|
|
298
|
+
): Promise<any>;
|
|
299
|
+
|
|
300
|
+
export function resolveZkPassportConfig(overrides?: Record<string, any>): {
|
|
301
|
+
provider: string;
|
|
302
|
+
scope: string;
|
|
303
|
+
checkSanctions: boolean;
|
|
304
|
+
requireFaceMatch: boolean;
|
|
305
|
+
faceMatchMode: string;
|
|
306
|
+
[key: string]: any;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
export function toHexUtf8(message: string): string;
|
|
310
|
+
|
|
311
|
+
export function signMessage(params: {
|
|
312
|
+
provider?: any;
|
|
313
|
+
message: string;
|
|
314
|
+
walletAddress?: string;
|
|
315
|
+
chain?: string;
|
|
316
|
+
}): Promise<string>;
|
|
317
|
+
|
|
318
|
+
export function validateVerifierPayload(verifierId: string, data: any): ValidationResult;
|
|
319
|
+
|
|
320
|
+
export function buildVerificationRequest(params: {
|
|
321
|
+
verifierIds: string[];
|
|
322
|
+
data: any;
|
|
323
|
+
walletAddress: string;
|
|
324
|
+
chainId?: number;
|
|
325
|
+
chain?: string;
|
|
326
|
+
options?: any;
|
|
327
|
+
signedTimestamp?: number;
|
|
328
|
+
}): { message: string; request: { verifierIds: string[]; data: any; walletAddress: string; signedTimestamp: number; chainId?: number; chain?: string; options?: any } };
|
|
329
|
+
|
|
330
|
+
export function isTerminalStatus(status: VerificationStatus): boolean;
|
|
331
|
+
|
|
332
|
+
export function isSuccessStatus(status: VerificationStatus): boolean;
|
|
333
|
+
|
|
334
|
+
export function isFailureStatus(status: VerificationStatus): boolean;
|
|
335
|
+
|
|
336
|
+
export function formatVerificationStatus(status: VerificationStatus): {
|
|
337
|
+
label: string;
|
|
338
|
+
description: string;
|
|
339
|
+
color: string;
|
|
340
|
+
category: string;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export class StatusPoller {
|
|
344
|
+
constructor(client: NeusClient, proofId: string, options?: { interval?: number; maxAttempts?: number; exponentialBackoff?: boolean; maxInterval?: number });
|
|
345
|
+
poll(): Promise<StatusResult>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export function formatTimestamp(timestamp: number): string;
|
|
349
|
+
|
|
350
|
+
export function isSupportedChain(chainId: number): boolean;
|
|
351
|
+
|
|
352
|
+
export function delay(ms: number): Promise<void>;
|
|
353
|
+
|
|
354
|
+
export function withRetry<T>(fn: () => Promise<T>, options?: {
|
|
355
|
+
maxAttempts?: number;
|
|
356
|
+
baseDelay?: number;
|
|
357
|
+
maxDelay?: number;
|
|
358
|
+
backoffFactor?: number;
|
|
359
|
+
}): Promise<T>;
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
export function toAgentDelegationMaxSpend(
|
|
363
|
+
humanAmount: string | number,
|
|
364
|
+
decimals: number
|
|
365
|
+
): string;
|
|
366
|
+
|
|
367
|
+
export const DEFAULT_HOSTED_VERIFY_URL: string;
|
|
368
|
+
|
|
369
|
+
export function getHostedCheckoutUrl(opts?: {
|
|
370
|
+
gateId?: string;
|
|
371
|
+
returnUrl?: string;
|
|
372
|
+
verifiers?: string[];
|
|
373
|
+
preset?: string;
|
|
374
|
+
mode?: string;
|
|
375
|
+
intent?: string;
|
|
376
|
+
origin?: string;
|
|
377
|
+
oauthProvider?: string;
|
|
378
|
+
baseUrl?: string;
|
|
379
|
+
}): string;
|
|
380
|
+
|
|
381
|
+
export type NeusPublicGateCharge = {
|
|
382
|
+
enabled: boolean;
|
|
383
|
+
scheme: string;
|
|
384
|
+
label: string;
|
|
385
|
+
amountUsd: number;
|
|
386
|
+
methods: string[];
|
|
387
|
+
appliesTo: string;
|
|
388
|
+
executionOrder?: string;
|
|
389
|
+
recipient?: string;
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
export const NEUS_CONSTANTS: {
|
|
393
|
+
HUB_CHAIN_ID: number;
|
|
394
|
+
TESTNET_CHAINS: number[];
|
|
395
|
+
API_BASE_URL: string;
|
|
396
|
+
API_VERSION: string;
|
|
397
|
+
SIGNATURE_MAX_AGE_MS: number;
|
|
398
|
+
REQUEST_TIMEOUT_MS: number;
|
|
399
|
+
DEFAULT_VERIFIERS: VerifierId[];
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
export class SDKError extends Error {
|
|
404
|
+
code: string;
|
|
405
|
+
details: any;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export class ApiError extends SDKError {
|
|
409
|
+
statusCode: number;
|
|
410
|
+
response: any;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export class ValidationError extends SDKError {
|
|
414
|
+
field?: string;
|
|
415
|
+
value?: any;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export class NetworkError extends SDKError {
|
|
419
|
+
originalError?: Error;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export class ConfigurationError extends SDKError {
|
|
423
|
+
configKey?: string;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export class VerificationError extends SDKError {
|
|
427
|
+
verifierId?: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export class AuthenticationError extends SDKError {}
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
export interface GetProofsOptions {
|
|
434
|
+
limit?: number;
|
|
435
|
+
offset?: number;
|
|
436
|
+
chain?: string;
|
|
437
|
+
signatureMethod?: string;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export interface ProofsResult {
|
|
441
|
+
success: boolean;
|
|
442
|
+
proofs: any[];
|
|
443
|
+
totalCount: number;
|
|
444
|
+
hasMore: boolean;
|
|
445
|
+
nextOffset?: number | null;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export interface GateRequirement {
|
|
449
|
+
verifierId: CoreVerifierId;
|
|
450
|
+
maxAgeMs?: number;
|
|
451
|
+
optional?: boolean;
|
|
452
|
+
minCount?: number;
|
|
453
|
+
match?: Record<string, any>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export interface CheckGateParams {
|
|
457
|
+
walletAddress: string;
|
|
458
|
+
requirements: GateRequirement[];
|
|
459
|
+
proofs?: any[];
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface CheckGateResult {
|
|
463
|
+
satisfied: boolean;
|
|
464
|
+
missing: GateRequirement[];
|
|
465
|
+
existing: Record<string, any>;
|
|
466
|
+
allProofs: any[];
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export interface GateCheckApiParams {
|
|
470
|
+
address: string;
|
|
471
|
+
verifierIds?: string[] | string;
|
|
472
|
+
requireAll?: boolean;
|
|
473
|
+
minCount?: number;
|
|
474
|
+
sinceDays?: number;
|
|
475
|
+
since?: number;
|
|
476
|
+
limit?: number;
|
|
477
|
+
includePrivate?: boolean;
|
|
478
|
+
includeQHashes?: boolean;
|
|
479
|
+
wallet?: WalletLike;
|
|
480
|
+
chain?: string;
|
|
481
|
+
signatureMethod?: string;
|
|
482
|
+
privateAuth?: GatePrivateAuth;
|
|
483
|
+
|
|
484
|
+
referenceType?: string;
|
|
485
|
+
referenceId?: string;
|
|
486
|
+
tag?: string;
|
|
487
|
+
tags?: string[] | string;
|
|
488
|
+
contentType?: string;
|
|
489
|
+
content?: string;
|
|
490
|
+
contentHash?: string;
|
|
491
|
+
|
|
492
|
+
contractAddress?: string;
|
|
493
|
+
tokenId?: string;
|
|
494
|
+
chainId?: number;
|
|
495
|
+
domain?: string;
|
|
496
|
+
minBalance?: string;
|
|
497
|
+
|
|
498
|
+
provider?: string;
|
|
499
|
+
handle?: string;
|
|
500
|
+
namespace?: string;
|
|
501
|
+
ownerAddress?: string;
|
|
502
|
+
riskLevel?: string;
|
|
503
|
+
sanctioned?: boolean;
|
|
504
|
+
poisoned?: boolean;
|
|
505
|
+
primaryWalletAddress?: string;
|
|
506
|
+
secondaryWalletAddress?: string;
|
|
507
|
+
verificationMethod?: string;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface GatePrivateAuth {
|
|
511
|
+
walletAddress: string;
|
|
512
|
+
signature: string;
|
|
513
|
+
signedTimestamp: number;
|
|
514
|
+
chain?: string;
|
|
515
|
+
signatureMethod?: string;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export interface GateCheckApiResponse {
|
|
519
|
+
success: boolean;
|
|
520
|
+
data?: {
|
|
521
|
+
eligible: boolean;
|
|
522
|
+
matchedCount?: number;
|
|
523
|
+
matchedQHashes?: string[];
|
|
524
|
+
matchedProofIds?: string[];
|
|
525
|
+
matchedTags?: string[];
|
|
526
|
+
projections?: Array<Record<string, any>> | null;
|
|
527
|
+
criteria?: Record<string, any>;
|
|
528
|
+
};
|
|
529
|
+
error?: any;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
export interface ApiResponse<T = any> {
|
|
534
|
+
success: boolean;
|
|
535
|
+
data?: T;
|
|
536
|
+
error?: any;
|
|
537
|
+
status?: string;
|
|
538
|
+
timestamp?: number;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
export const HOUR: number;
|
|
543
|
+
export const DAY: number;
|
|
544
|
+
export const WEEK: number;
|
|
545
|
+
export const MONTH: number;
|
|
546
|
+
export const YEAR: number;
|
|
547
|
+
|
|
548
|
+
export const GATE_NFT_HOLDER: GateRequirement[];
|
|
549
|
+
export const GATE_TOKEN_HOLDER: GateRequirement[];
|
|
550
|
+
export const GATE_CONTRACT_ADMIN: GateRequirement[];
|
|
551
|
+
export const GATE_DOMAIN_OWNER: GateRequirement[];
|
|
552
|
+
export const GATE_LINKED_WALLETS: GateRequirement[];
|
|
553
|
+
export const GATE_AGENT_IDENTITY: GateRequirement[];
|
|
554
|
+
export const GATE_AGENT_DELEGATION: GateRequirement[];
|
|
555
|
+
export const GATE_CONTENT_MODERATION: GateRequirement[];
|
|
556
|
+
export const GATE_WALLET_RISK: GateRequirement[];
|
|
557
|
+
export const GATE_PSEUDONYM: GateRequirement[];
|
|
558
|
+
|
|
559
|
+
export function createGate(
|
|
560
|
+
requirements: Array<CoreVerifierId | GateRequirement>
|
|
561
|
+
): GateRequirement[];
|
|
562
|
+
|
|
563
|
+
export function combineGates(
|
|
564
|
+
...gates: GateRequirement[][]
|
|
565
|
+
): GateRequirement[];
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
type OwnershipBasicData = {
|
|
569
|
+
owner: string;
|
|
570
|
+
content?: string;
|
|
571
|
+
contentHash?: string;
|
|
572
|
+
contentType?: string;
|
|
573
|
+
reference?: {
|
|
574
|
+
type:
|
|
575
|
+
| 'ipfs'
|
|
576
|
+
| 'ipfs-hash'
|
|
577
|
+
| 'url'
|
|
578
|
+
| 'license-nft'
|
|
579
|
+
| 'contract'
|
|
580
|
+
| 'qhash'
|
|
581
|
+
| 'ethereum-tx'
|
|
582
|
+
| 'on-chain-tx'
|
|
583
|
+
| 'tx'
|
|
584
|
+
| 'file'
|
|
585
|
+
| 'doc'
|
|
586
|
+
| 'media'
|
|
587
|
+
| 'username-claim'
|
|
588
|
+
| 'other';
|
|
589
|
+
id?: string;
|
|
590
|
+
title?: string;
|
|
591
|
+
description?: string;
|
|
592
|
+
mime?: string;
|
|
593
|
+
name?: string;
|
|
594
|
+
size?: number;
|
|
595
|
+
};
|
|
596
|
+
provenance?: {
|
|
597
|
+
declaredKind?: 'human' | 'ai' | 'mixed' | 'unknown';
|
|
598
|
+
aiContext?: {
|
|
599
|
+
generatorType?: 'local' | 'saas' | 'agent';
|
|
600
|
+
provider?: string;
|
|
601
|
+
model?: string;
|
|
602
|
+
runId?: string;
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
[key: string]: any;
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
type OwnershipPseudonymData = {
|
|
609
|
+
pseudonymId: string;
|
|
610
|
+
namespace?: string;
|
|
611
|
+
displayName?: string;
|
|
612
|
+
metadata?: Record<string, any>;
|
|
613
|
+
[key: string]: any;
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
type OwnershipDnsTxtData = {
|
|
617
|
+
domain: string;
|
|
618
|
+
walletAddress?: string;
|
|
619
|
+
[key: string]: any;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
type ContractOwnershipData = {
|
|
623
|
+
contractAddress: string;
|
|
624
|
+
chainId: number;
|
|
625
|
+
walletAddress?: string;
|
|
626
|
+
method?: 'owner' | 'admin' | 'accessControl';
|
|
627
|
+
[key: string]: any;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
type NftOwnershipData = {
|
|
631
|
+
ownerAddress?: string;
|
|
632
|
+
contractAddress: string;
|
|
633
|
+
tokenId: string;
|
|
634
|
+
tokenType?: 'erc721' | 'erc1155';
|
|
635
|
+
chainId: number;
|
|
636
|
+
blockNumber?: number;
|
|
637
|
+
[key: string]: any;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
type TokenHoldingData = {
|
|
641
|
+
ownerAddress?: string;
|
|
642
|
+
contractAddress: string;
|
|
643
|
+
minBalance: string;
|
|
644
|
+
chainId: number;
|
|
645
|
+
blockNumber?: number;
|
|
646
|
+
[key: string]: any;
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
type WalletRiskData = {
|
|
650
|
+
provider?: string;
|
|
651
|
+
walletAddress?: string;
|
|
652
|
+
chainId?: number;
|
|
653
|
+
includeDetails?: boolean;
|
|
654
|
+
[key: string]: any;
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
type WalletLinkData = {
|
|
658
|
+
primaryWalletAddress: string;
|
|
659
|
+
secondaryWalletAddress: string;
|
|
660
|
+
signature: string;
|
|
661
|
+
chain: string;
|
|
662
|
+
signatureMethod: string;
|
|
663
|
+
signedTimestamp: number;
|
|
664
|
+
relationshipType?: 'primary' | 'personal' | 'org' | 'affiliate' | 'agent' | 'linked';
|
|
665
|
+
label?: string;
|
|
666
|
+
[key: string]: any;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
type AiContentModerationData = {
|
|
670
|
+
content: string;
|
|
671
|
+
contentType:
|
|
672
|
+
| 'image/jpeg'
|
|
673
|
+
| 'image/png'
|
|
674
|
+
| 'image/webp'
|
|
675
|
+
| 'image/gif'
|
|
676
|
+
| 'text/plain'
|
|
677
|
+
| 'text/markdown'
|
|
678
|
+
| 'text/x-markdown'
|
|
679
|
+
| 'application/json'
|
|
680
|
+
| 'application/xml';
|
|
681
|
+
provider?: 'google-vision' | 'google-perspective';
|
|
682
|
+
[key: string]: any;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
type AgentIdentityData = {
|
|
686
|
+
agentId: string;
|
|
687
|
+
agentWallet: string;
|
|
688
|
+
agentLabel?: string;
|
|
689
|
+
agentType?: 'ai' | 'bot' | 'service' | 'automation' | 'agent';
|
|
690
|
+
description?: string;
|
|
691
|
+
capabilities?: any[];
|
|
692
|
+
instructions?: string;
|
|
693
|
+
skills?: string[];
|
|
694
|
+
services?: Array<{
|
|
695
|
+
name: string;
|
|
696
|
+
endpoint: string;
|
|
697
|
+
version?: string;
|
|
698
|
+
}>;
|
|
699
|
+
[key: string]: any;
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
type AgentDelegationData = {
|
|
703
|
+
controllerWallet: string;
|
|
704
|
+
agentWallet: string;
|
|
705
|
+
agentId?: string;
|
|
706
|
+
scope?: string;
|
|
707
|
+
permissions?: any[];
|
|
708
|
+
maxSpend?: string;
|
|
709
|
+
allowedPaymentTypes?: string[];
|
|
710
|
+
receiptDisclosure?: 'none' | 'summary' | 'full';
|
|
711
|
+
expiresAt?: number;
|
|
712
|
+
instructions?: string;
|
|
713
|
+
skills?: string[];
|
|
714
|
+
[key: string]: any;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
type CoreVerificationData =
|
|
718
|
+
| OwnershipBasicData
|
|
719
|
+
| OwnershipPseudonymData
|
|
720
|
+
| OwnershipDnsTxtData
|
|
721
|
+
| ContractOwnershipData
|
|
722
|
+
| NftOwnershipData
|
|
723
|
+
| TokenHoldingData
|
|
724
|
+
| WalletRiskData
|
|
725
|
+
| WalletLinkData
|
|
726
|
+
| AiContentModerationData
|
|
727
|
+
| AgentIdentityData
|
|
728
|
+
| AgentDelegationData;
|
|
729
|
+
|
|
730
|
+
type VerificationData =
|
|
731
|
+
| CoreVerificationData
|
|
732
|
+
| Record<string, CoreVerificationData>
|
|
733
|
+
| Record<string, any>;
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
interface VerifyOptions {
|
|
738
|
+
targetChains?: number[];
|
|
739
|
+
enableIpfs?: boolean;
|
|
740
|
+
privacyLevel?: 'private' | 'public';
|
|
741
|
+
publicDisplay?: boolean;
|
|
742
|
+
storeOriginalContent?: boolean;
|
|
743
|
+
meta?: {
|
|
744
|
+
title?: string;
|
|
745
|
+
description?: string;
|
|
746
|
+
displayName?: string;
|
|
747
|
+
contentText?: string;
|
|
748
|
+
contentType?: string;
|
|
749
|
+
contentDescription?: string;
|
|
750
|
+
license?: string;
|
|
751
|
+
publicContentLicense?: string;
|
|
752
|
+
publicContentDisclaimer?: string;
|
|
753
|
+
legal?: string;
|
|
754
|
+
source?: string;
|
|
755
|
+
campaign?: string;
|
|
756
|
+
tags?: string[];
|
|
757
|
+
category?: string;
|
|
758
|
+
};
|
|
759
|
+
reference?: {
|
|
760
|
+
type:
|
|
761
|
+
| 'ipfs'
|
|
762
|
+
| 'ipfs-hash'
|
|
763
|
+
| 'url'
|
|
764
|
+
| 'license-nft'
|
|
765
|
+
| 'contract'
|
|
766
|
+
| 'qhash'
|
|
767
|
+
| 'ethereum-tx'
|
|
768
|
+
| 'on-chain-tx'
|
|
769
|
+
| 'tx'
|
|
770
|
+
| 'file'
|
|
771
|
+
| 'doc'
|
|
772
|
+
| 'media'
|
|
773
|
+
| 'username-claim'
|
|
774
|
+
| 'other';
|
|
775
|
+
id?: string;
|
|
776
|
+
title?: string;
|
|
777
|
+
description?: string;
|
|
778
|
+
mime?: string;
|
|
779
|
+
name?: string;
|
|
780
|
+
size?: number;
|
|
781
|
+
};
|
|
782
|
+
verifierOptions?: Record<string, any>;
|
|
783
|
+
identity?: { pseudonym?: string; socials?: Record<string, string> };
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
declare module '@neus/sdk/widgets' {
|
|
790
|
+
export interface VerifyGateProps {
|
|
791
|
+
requiredVerifiers?: string[];
|
|
792
|
+
onVerified?: (result: {
|
|
793
|
+
proofId: string;
|
|
794
|
+
qHash: string;
|
|
795
|
+
proofIds?: string[];
|
|
796
|
+
qHashes?: string[];
|
|
797
|
+
address?: string;
|
|
798
|
+
txHash?: string | null;
|
|
799
|
+
verifierIds: string[];
|
|
800
|
+
verifiedVerifiers?: any[];
|
|
801
|
+
proofUrl?: string | null;
|
|
802
|
+
existing?: boolean;
|
|
803
|
+
eligible?: boolean;
|
|
804
|
+
mode?: 'create' | 'access';
|
|
805
|
+
data?: any;
|
|
806
|
+
results?: Array<{
|
|
807
|
+
verifierId: string;
|
|
808
|
+
proofId: string;
|
|
809
|
+
qHash: string;
|
|
810
|
+
address?: string;
|
|
811
|
+
txHash?: string | null;
|
|
812
|
+
verifiedVerifiers?: any[];
|
|
813
|
+
proofUrl?: string | null;
|
|
814
|
+
}>;
|
|
815
|
+
proofsByVerifierId?: Record<string, any>;
|
|
816
|
+
}) => void;
|
|
817
|
+
apiUrl?: string;
|
|
818
|
+
appId?: string;
|
|
819
|
+
paymentSignature?: string;
|
|
820
|
+
extraHeaders?: Record<string, string>;
|
|
821
|
+
hostedCheckoutUrl?: string;
|
|
822
|
+
oauthProvider?: string;
|
|
823
|
+
style?: Record<string, any>;
|
|
824
|
+
children?: any;
|
|
825
|
+
verifierOptions?: Record<string, any>;
|
|
826
|
+
verifierData?: Record<string, any>;
|
|
827
|
+
proofOptions?: Record<string, any>;
|
|
828
|
+
strategy?: 'reuse-or-create' | 'reuse' | 'fresh';
|
|
829
|
+
checkExisting?: boolean;
|
|
830
|
+
maxProofAgeMs?: number;
|
|
831
|
+
allowPrivateReuse?: boolean;
|
|
832
|
+
showBrand?: boolean;
|
|
833
|
+
disabled?: boolean;
|
|
834
|
+
buttonText?: string;
|
|
835
|
+
mode?: 'create' | 'access';
|
|
836
|
+
proofId?: string | null;
|
|
837
|
+
qHash?: string | null;
|
|
838
|
+
wallet?: WalletLike | any;
|
|
839
|
+
chain?: string;
|
|
840
|
+
signatureMethod?: string;
|
|
841
|
+
onStateChange?: (state: string) => void;
|
|
842
|
+
onError?: (error: Error) => void;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
export function VerifyGate(props: VerifyGateProps): any;
|
|
846
|
+
|
|
847
|
+
export interface ProofBadgeProps {
|
|
848
|
+
proofId?: string;
|
|
849
|
+
qHash?: string;
|
|
850
|
+
proofUrlPattern?: string;
|
|
851
|
+
size?: 'sm' | 'md';
|
|
852
|
+
uiLinkBase?: string;
|
|
853
|
+
apiUrl?: string;
|
|
854
|
+
proof?: any;
|
|
855
|
+
showChains?: boolean;
|
|
856
|
+
showLabel?: boolean;
|
|
857
|
+
logoUrl?: string;
|
|
858
|
+
onClick?: (data: { proofId: string; qHash: string; status: string; chainCount?: number }) => void;
|
|
859
|
+
className?: string;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
export function ProofBadge(props: ProofBadgeProps): any;
|
|
863
|
+
|
|
864
|
+
export interface SimpleProofBadgeProps {
|
|
865
|
+
proofId?: string;
|
|
866
|
+
qHash?: string;
|
|
867
|
+
proofUrlPattern?: string;
|
|
868
|
+
uiLinkBase?: string;
|
|
869
|
+
apiUrl?: string;
|
|
870
|
+
size?: 'sm' | 'md';
|
|
871
|
+
label?: string;
|
|
872
|
+
logoUrl?: string;
|
|
873
|
+
proof?: any;
|
|
874
|
+
onClick?: (data: { proofId: string; qHash: string; status: string }) => void;
|
|
875
|
+
className?: string;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
export function SimpleProofBadge(props: SimpleProofBadgeProps): any;
|
|
879
|
+
|
|
880
|
+
export interface NeusPillLinkProps {
|
|
881
|
+
proofId?: string;
|
|
882
|
+
qHash?: string;
|
|
883
|
+
proofUrlPattern?: string;
|
|
884
|
+
uiLinkBase?: string;
|
|
885
|
+
label?: string;
|
|
886
|
+
size?: 'sm' | 'md';
|
|
887
|
+
logoUrl?: string;
|
|
888
|
+
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
889
|
+
className?: string;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
export function NeusPillLink(props: NeusPillLinkProps): any;
|
|
893
|
+
|
|
894
|
+
export interface VerifiedIconProps {
|
|
895
|
+
proofId?: string;
|
|
896
|
+
qHash?: string;
|
|
897
|
+
proofUrlPattern?: string;
|
|
898
|
+
uiLinkBase?: string;
|
|
899
|
+
size?: number;
|
|
900
|
+
logoUrl?: string;
|
|
901
|
+
tooltip?: string;
|
|
902
|
+
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
903
|
+
className?: string;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export function VerifiedIcon(props: VerifiedIconProps): any;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
declare module '@neus/sdk/widgets/verify-gate' {
|
|
910
|
+
export * from '@neus/sdk/widgets';
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
declare module '@neus/sdk/client' {
|
|
914
|
+
export { NeusClient } from '@neus/sdk';
|
|
915
|
+
}
|