@neus/sdk 1.0.1 → 1.0.3
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 +150 -140
- package/cjs/client.cjs +634 -223
- package/cjs/errors.cjs +1 -0
- package/cjs/gates.cjs +1 -0
- package/cjs/index.cjs +840 -236
- package/cjs/utils.cjs +408 -12
- package/client.js +502 -244
- package/index.js +75 -64
- package/neus-logo.svg +3 -0
- package/package.json +9 -5
- package/types.d.ts +379 -82
- package/utils.js +443 -14
- package/widgets/README.md +64 -53
- package/widgets/index.js +9 -9
- package/widgets/verify-gate/dist/ProofBadge.js +51 -38
- package/widgets/verify-gate/dist/VerifyGate.js +284 -59
- package/widgets/verify-gate/index.js +13 -13
package/types.d.ts
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
declare module '@neus/sdk' {
|
|
6
|
+
/**
|
|
7
|
+
* Minimal EIP-1193 provider interface (browser wallets like MetaMask).
|
|
8
|
+
* The SDK also supports other wallet objects; use this for typing in integrations.
|
|
9
|
+
*/
|
|
10
|
+
export interface Eip1193Provider {
|
|
11
|
+
request(args: { method: string; params?: unknown[] | Record<string, unknown> }): Promise<unknown>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Wallet/provider object accepted by SDK methods that require signing.
|
|
16
|
+
* Prefer passing an EIP-1193 provider in browser environments.
|
|
17
|
+
*/
|
|
18
|
+
export type WalletLike = Eip1193Provider | { address?: string } | { getAddress?: () => Promise<string> } | { signMessage?: (message: string) => Promise<string> };
|
|
19
|
+
|
|
6
20
|
/**
|
|
7
21
|
* Main NEUS SDK client for creating and verifying proofs
|
|
8
22
|
*/
|
|
@@ -18,17 +32,17 @@ declare module '@neus/sdk' {
|
|
|
18
32
|
|
|
19
33
|
/**
|
|
20
34
|
* Get verification status by proof ID
|
|
21
|
-
* @param
|
|
35
|
+
* @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
|
|
22
36
|
* @returns Promise resolving to current status
|
|
23
37
|
*/
|
|
24
|
-
getStatus(
|
|
38
|
+
getStatus(proofId: string): Promise<StatusResult>;
|
|
25
39
|
|
|
26
40
|
/**
|
|
27
41
|
* Get private proof status (owner-signed)
|
|
28
|
-
* @param
|
|
42
|
+
* @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
|
|
29
43
|
* @param wallet - Optional injected wallet/provider (MetaMask/ethers Wallet)
|
|
30
44
|
*/
|
|
31
|
-
getPrivateStatus(
|
|
45
|
+
getPrivateStatus(proofId: string, wallet?: WalletLike | GatePrivateAuth): Promise<StatusResult>;
|
|
32
46
|
|
|
33
47
|
/**
|
|
34
48
|
* Check API health
|
|
@@ -41,24 +55,24 @@ declare module '@neus/sdk' {
|
|
|
41
55
|
|
|
42
56
|
/**
|
|
43
57
|
* Poll verification status until completion
|
|
44
|
-
* @param
|
|
58
|
+
* @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
|
|
45
59
|
* @param options - Polling configuration options
|
|
46
60
|
* @returns Promise resolving to final status
|
|
47
61
|
* @example
|
|
48
|
-
* const finalStatus = await client.pollProofStatus(
|
|
62
|
+
* const finalStatus = await client.pollProofStatus(proofId, {
|
|
49
63
|
* interval: 3000,
|
|
50
64
|
* onProgress: (status) => {
|
|
51
65
|
* // Handle status updates
|
|
52
66
|
* }
|
|
53
67
|
* });
|
|
54
68
|
*/
|
|
55
|
-
pollProofStatus(
|
|
69
|
+
pollProofStatus(proofId: string, options?: PollOptions): Promise<StatusResult>;
|
|
56
70
|
|
|
57
71
|
/** Revoke own proof (owner-signed) */
|
|
58
|
-
revokeOwnProof(
|
|
72
|
+
revokeOwnProof(proofId: string, wallet?: { address: string }): Promise<boolean>;
|
|
59
73
|
|
|
60
74
|
// ═══════════════════════════════════════════════════════════════
|
|
61
|
-
//
|
|
75
|
+
// PROOFS & GATING METHODS
|
|
62
76
|
// ═══════════════════════════════════════════════════════════════
|
|
63
77
|
|
|
64
78
|
/**
|
|
@@ -73,7 +87,7 @@ declare module '@neus/sdk' {
|
|
|
73
87
|
* Get proofs by wallet or DID (owner access)
|
|
74
88
|
* Requests private proofs using owner signature headers.
|
|
75
89
|
*/
|
|
76
|
-
getPrivateProofsByWallet(walletAddress: string, options?: GetProofsOptions, wallet?:
|
|
90
|
+
getPrivateProofsByWallet(walletAddress: string, options?: GetProofsOptions, wallet?: WalletLike): Promise<ProofsResult>;
|
|
77
91
|
|
|
78
92
|
/**
|
|
79
93
|
* Minimal eligibility check against public + discoverable proofs only (API-backed).
|
|
@@ -82,10 +96,14 @@ declare module '@neus/sdk' {
|
|
|
82
96
|
gateCheck(params: GateCheckApiParams): Promise<GateCheckApiResponse>;
|
|
83
97
|
|
|
84
98
|
/**
|
|
85
|
-
*
|
|
86
|
-
* Requires Premium API key and does NOT mint/store proofs.
|
|
99
|
+
* Pre-sign owner auth payload for repeated includePrivate gate checks (single prompt).
|
|
87
100
|
*/
|
|
88
|
-
|
|
101
|
+
createGatePrivateAuth(params: {
|
|
102
|
+
address: string;
|
|
103
|
+
wallet?: WalletLike;
|
|
104
|
+
chain?: string;
|
|
105
|
+
signatureMethod?: string;
|
|
106
|
+
}): Promise<GatePrivateAuth>;
|
|
89
107
|
|
|
90
108
|
/**
|
|
91
109
|
* Evaluate gate requirements against existing proofs
|
|
@@ -117,10 +135,20 @@ declare module '@neus/sdk' {
|
|
|
117
135
|
export interface NeusClientConfig {
|
|
118
136
|
/** API endpoint URL (defaults to hosted public API) */
|
|
119
137
|
apiUrl?: string;
|
|
120
|
-
/** Optional
|
|
138
|
+
/** Optional API key (server-side only; do not embed in browser apps) */
|
|
121
139
|
apiKey?: string;
|
|
140
|
+
/** Optional public app attribution ID (maps to X-Neus-App) */
|
|
141
|
+
appId?: string;
|
|
142
|
+
/** Optional sponsor capability token (maps to X-Sponsor-Grant) */
|
|
143
|
+
sponsorGrant?: string;
|
|
144
|
+
/** Optional x402 receipt token for retry calls (maps to PAYMENT-SIGNATURE) */
|
|
145
|
+
paymentSignature?: string;
|
|
146
|
+
/** Optional extra passthrough headers for advanced integrations */
|
|
147
|
+
extraHeaders?: Record<string, string>;
|
|
122
148
|
/** Request timeout in milliseconds */
|
|
123
149
|
timeout?: number;
|
|
150
|
+
/** Optional chain override used by some app integrations */
|
|
151
|
+
hubChainId?: number;
|
|
124
152
|
/** Enable SDK logging */
|
|
125
153
|
enableLogging?: boolean;
|
|
126
154
|
}
|
|
@@ -168,19 +196,21 @@ declare module '@neus/sdk' {
|
|
|
168
196
|
signedTimestamp?: number;
|
|
169
197
|
/** Advanced/manual path: chain ID for verification context; optional, managed by protocol */
|
|
170
198
|
chainId?: number;
|
|
171
|
-
/**
|
|
199
|
+
/** CAIP-2 chain reference for universal mode (e.g. eip155:1, solana:mainnet) */
|
|
172
200
|
chain?: string;
|
|
173
|
-
/**
|
|
201
|
+
/** Signature method hint for universal mode (eip191, ed25519, ...) */
|
|
174
202
|
signatureMethod?: string;
|
|
175
203
|
/** Auto path: optional wallet instance (browser/provider) */
|
|
176
|
-
wallet?:
|
|
204
|
+
wallet?: WalletLike;
|
|
177
205
|
}
|
|
178
206
|
|
|
179
207
|
/**
|
|
180
208
|
* Result from proof creation
|
|
181
209
|
*/
|
|
182
210
|
export interface ProofResult {
|
|
183
|
-
/** Proof ID (
|
|
211
|
+
/** Proof ID (standard) */
|
|
212
|
+
proofId: string;
|
|
213
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
184
214
|
qHash: string;
|
|
185
215
|
/** Current status */
|
|
186
216
|
status: string;
|
|
@@ -196,7 +226,9 @@ declare module '@neus/sdk' {
|
|
|
196
226
|
* Verification result
|
|
197
227
|
*/
|
|
198
228
|
export interface VerificationResult {
|
|
199
|
-
/** Proof ID (
|
|
229
|
+
/** Proof ID (standard) */
|
|
230
|
+
proofId: string;
|
|
231
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
200
232
|
qHash: string;
|
|
201
233
|
/** Current status */
|
|
202
234
|
status: VerificationStatus;
|
|
@@ -210,13 +242,19 @@ declare module '@neus/sdk' {
|
|
|
210
242
|
* Status check result
|
|
211
243
|
*/
|
|
212
244
|
export interface StatusResult {
|
|
245
|
+
/** Proof ID (standard) */
|
|
246
|
+
proofId?: string;
|
|
247
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
248
|
+
qHash?: string;
|
|
213
249
|
/** Whether verification succeeded */
|
|
214
250
|
success: boolean;
|
|
215
251
|
/** Current status */
|
|
216
252
|
status: VerificationStatus;
|
|
217
253
|
/** Full verification data */
|
|
218
254
|
data?: {
|
|
219
|
-
|
|
255
|
+
proofId?: string;
|
|
256
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
257
|
+
qHash?: string;
|
|
220
258
|
status: string;
|
|
221
259
|
walletAddress: string;
|
|
222
260
|
verifierIds?: string[];
|
|
@@ -312,13 +350,16 @@ declare module '@neus/sdk' {
|
|
|
312
350
|
export type CoreVerifierId =
|
|
313
351
|
// Public verifiers (auto-path via verify())
|
|
314
352
|
| 'ownership-basic'
|
|
353
|
+
| 'ownership-social' // Hosted OAuth social ownership
|
|
315
354
|
| 'ownership-pseudonym' // Pseudonymous identity verification
|
|
355
|
+
| 'ownership-org-oauth' // Hosted OAuth organization ownership
|
|
316
356
|
| 'nft-ownership'
|
|
317
357
|
| 'token-holding'
|
|
318
358
|
| 'ownership-dns-txt'
|
|
319
359
|
| 'wallet-link'
|
|
320
360
|
| 'contract-ownership'
|
|
321
361
|
| 'wallet-risk' // Wallet risk assessment
|
|
362
|
+
| 'proof-of-human' // Hosted ZK personhood verification
|
|
322
363
|
// AI & Agent verifiers (ERC-8004 aligned)
|
|
323
364
|
| 'agent-identity'
|
|
324
365
|
| 'agent-delegation'
|
|
@@ -366,13 +407,19 @@ declare module '@neus/sdk' {
|
|
|
366
407
|
signedTimestamp: number;
|
|
367
408
|
data: any;
|
|
368
409
|
verifierIds: VerifierId[];
|
|
369
|
-
chainId
|
|
410
|
+
chainId?: number;
|
|
411
|
+
chain?: string;
|
|
370
412
|
}): string;
|
|
371
413
|
|
|
372
414
|
/**
|
|
373
415
|
* Validate Ethereum wallet address
|
|
374
416
|
*/
|
|
375
417
|
export function validateWalletAddress(address: string): boolean;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Validate universal wallet address format (EVM/non-EVM).
|
|
421
|
+
*/
|
|
422
|
+
export function validateUniversalAddress(address: string, chain?: string): boolean;
|
|
376
423
|
|
|
377
424
|
/**
|
|
378
425
|
* Validate timestamp freshness
|
|
@@ -380,7 +427,7 @@ declare module '@neus/sdk' {
|
|
|
380
427
|
export function validateTimestamp(timestamp: number, maxAgeMs?: number): boolean;
|
|
381
428
|
|
|
382
429
|
/**
|
|
383
|
-
* Validate Proof ID (qHash)
|
|
430
|
+
* Validate Proof ID format (`qHash` wire alias)
|
|
384
431
|
*/
|
|
385
432
|
export function validateQHash(qHash: string): boolean;
|
|
386
433
|
|
|
@@ -389,6 +436,71 @@ declare module '@neus/sdk' {
|
|
|
389
436
|
*/
|
|
390
437
|
export function normalizeAddress(address: string): string;
|
|
391
438
|
|
|
439
|
+
/**
|
|
440
|
+
* Resolve DID from wallet identity via profile resolver endpoint.
|
|
441
|
+
* Use `chainId` for EVM wallets and `chain` (CAIP-2) for non-EVM wallets
|
|
442
|
+
* such as Solana (`solana:mainnet`).
|
|
443
|
+
*/
|
|
444
|
+
export function resolveDID(
|
|
445
|
+
params: {
|
|
446
|
+
walletAddress?: string;
|
|
447
|
+
chainId?: number;
|
|
448
|
+
chain?: string;
|
|
449
|
+
},
|
|
450
|
+
options?: {
|
|
451
|
+
endpoint?: string;
|
|
452
|
+
apiUrl?: string;
|
|
453
|
+
credentials?: 'omit' | 'same-origin' | 'include';
|
|
454
|
+
headers?: Record<string, string>;
|
|
455
|
+
}
|
|
456
|
+
): Promise<{
|
|
457
|
+
did: string;
|
|
458
|
+
data: unknown;
|
|
459
|
+
raw: unknown;
|
|
460
|
+
}>;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Build a server-standardized signing payload.
|
|
464
|
+
*/
|
|
465
|
+
export function standardizeVerificationRequest(
|
|
466
|
+
params: Record<string, any>,
|
|
467
|
+
options?: {
|
|
468
|
+
endpoint?: string;
|
|
469
|
+
apiUrl?: string;
|
|
470
|
+
credentials?: 'omit' | 'same-origin' | 'include';
|
|
471
|
+
headers?: Record<string, string>;
|
|
472
|
+
}
|
|
473
|
+
): Promise<any>;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Resolve ZK Passport default configuration.
|
|
477
|
+
*/
|
|
478
|
+
export function resolveZkPassportConfig(overrides?: Record<string, any>): {
|
|
479
|
+
provider: string;
|
|
480
|
+
scope: string;
|
|
481
|
+
checkSanctions: boolean;
|
|
482
|
+
requireFaceMatch: boolean;
|
|
483
|
+
faceMatchMode: string;
|
|
484
|
+
[key: string]: any;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Convert a UTF-8 message string to a 0x-prefixed hex payload.
|
|
489
|
+
*/
|
|
490
|
+
export function toHexUtf8(message: string): string;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Sign a message with an injected/provider wallet.
|
|
494
|
+
* Uses `personal_sign` and retries with UTF-8 hex payloads when providers
|
|
495
|
+
* report encoding/non-hex input issues (common with some embedded wallets).
|
|
496
|
+
*/
|
|
497
|
+
export function signMessage(params: {
|
|
498
|
+
provider?: any;
|
|
499
|
+
message: string;
|
|
500
|
+
walletAddress?: string;
|
|
501
|
+
chain?: string;
|
|
502
|
+
}): Promise<string>;
|
|
503
|
+
|
|
392
504
|
/**
|
|
393
505
|
* Validate a verifier payload for basic structural integrity
|
|
394
506
|
*/
|
|
@@ -402,9 +514,10 @@ declare module '@neus/sdk' {
|
|
|
402
514
|
data: any;
|
|
403
515
|
walletAddress: string;
|
|
404
516
|
chainId?: number;
|
|
517
|
+
chain?: string;
|
|
405
518
|
options?: any;
|
|
406
519
|
signedTimestamp?: number;
|
|
407
|
-
}): { message: string; request: { verifierIds: string[]; data: any; walletAddress: string; signedTimestamp: number; chainId
|
|
520
|
+
}): { message: string; request: { verifierIds: string[]; data: any; walletAddress: string; signedTimestamp: number; chainId?: number; chain?: string; options?: any } };
|
|
408
521
|
|
|
409
522
|
/**
|
|
410
523
|
* Check if status is terminal (complete)
|
|
@@ -435,7 +548,7 @@ declare module '@neus/sdk' {
|
|
|
435
548
|
* Status polling utility
|
|
436
549
|
*/
|
|
437
550
|
export class StatusPoller {
|
|
438
|
-
constructor(client: NeusClient,
|
|
551
|
+
constructor(client: NeusClient, proofId: string, options?: { interval?: number; maxAttempts?: number; exponentialBackoff?: boolean; maxInterval?: number });
|
|
439
552
|
poll(): Promise<StatusResult>;
|
|
440
553
|
}
|
|
441
554
|
|
|
@@ -467,7 +580,7 @@ declare module '@neus/sdk' {
|
|
|
467
580
|
/**
|
|
468
581
|
* Proof status
|
|
469
582
|
*/
|
|
470
|
-
// Use NeusClient.getStatus(
|
|
583
|
+
// Use NeusClient.getStatus(proofId) for status checks (`qHash` remains as deprecated alias).
|
|
471
584
|
|
|
472
585
|
|
|
473
586
|
// ============================================================================
|
|
@@ -548,7 +661,7 @@ declare module '@neus/sdk' {
|
|
|
548
661
|
|
|
549
662
|
|
|
550
663
|
// ============================================================================
|
|
551
|
-
//
|
|
664
|
+
// PROOFS & GATING TYPES
|
|
552
665
|
// ============================================================================
|
|
553
666
|
|
|
554
667
|
/**
|
|
@@ -559,6 +672,10 @@ declare module '@neus/sdk' {
|
|
|
559
672
|
limit?: number;
|
|
560
673
|
/** Offset for pagination */
|
|
561
674
|
offset?: number;
|
|
675
|
+
/** CAIP-2 signer chain for owner-signed private access (non-EVM) */
|
|
676
|
+
chain?: string;
|
|
677
|
+
/** Signature method hint for owner-signed private access (eip191, ed25519, ...) */
|
|
678
|
+
signatureMethod?: string;
|
|
562
679
|
}
|
|
563
680
|
|
|
564
681
|
/**
|
|
@@ -616,10 +733,10 @@ declare module '@neus/sdk' {
|
|
|
616
733
|
|
|
617
734
|
/**
|
|
618
735
|
* Parameters for gateCheck() (API-backed).
|
|
619
|
-
* Mirrors `GET /api/v1/proofs/
|
|
736
|
+
* Mirrors `GET /api/v1/proofs/check` query parameters.
|
|
620
737
|
*/
|
|
621
738
|
export interface GateCheckApiParams {
|
|
622
|
-
/** Wallet
|
|
739
|
+
/** Wallet identity to check (EVM/Solana/NEAR) */
|
|
623
740
|
address: string;
|
|
624
741
|
/** Verifier IDs to match (array or comma-separated string) */
|
|
625
742
|
verifierIds?: string[] | string;
|
|
@@ -633,6 +750,18 @@ declare module '@neus/sdk' {
|
|
|
633
750
|
since?: number;
|
|
634
751
|
/** Max rows to scan (server may clamp) */
|
|
635
752
|
limit?: number;
|
|
753
|
+
/** Include private proofs for owner-authenticated checks */
|
|
754
|
+
includePrivate?: boolean;
|
|
755
|
+
/** Include matched qHashes in response (minimal identifiers only) */
|
|
756
|
+
includeQHashes?: boolean;
|
|
757
|
+
/** Optional wallet/provider used to sign includePrivate owner checks */
|
|
758
|
+
wallet?: WalletLike;
|
|
759
|
+
/** CAIP-2 signer chain for universal owner signatures (e.g. solana:mainnet) */
|
|
760
|
+
chain?: string;
|
|
761
|
+
/** Signature method hint for universal owner signatures (eip191, ed25519, ...) */
|
|
762
|
+
signatureMethod?: string;
|
|
763
|
+
/** Optional pre-signed owner auth payload to reuse across multiple gateCheck calls */
|
|
764
|
+
privateAuth?: GatePrivateAuth;
|
|
636
765
|
|
|
637
766
|
// Common match filters
|
|
638
767
|
referenceType?: string;
|
|
@@ -650,9 +779,9 @@ declare module '@neus/sdk' {
|
|
|
650
779
|
domain?: string;
|
|
651
780
|
minBalance?: string;
|
|
652
781
|
|
|
653
|
-
//
|
|
782
|
+
// Wallet filters
|
|
783
|
+
/** Risk assessment provider hint. Known value: webacy. */
|
|
654
784
|
provider?: string;
|
|
655
|
-
handle?: string;
|
|
656
785
|
ownerAddress?: string;
|
|
657
786
|
riskLevel?: string;
|
|
658
787
|
sanctioned?: boolean;
|
|
@@ -660,12 +789,14 @@ declare module '@neus/sdk' {
|
|
|
660
789
|
primaryWalletAddress?: string;
|
|
661
790
|
secondaryWalletAddress?: string;
|
|
662
791
|
verificationMethod?: string;
|
|
792
|
+
}
|
|
663
793
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
794
|
+
export interface GatePrivateAuth {
|
|
795
|
+
walletAddress: string;
|
|
796
|
+
signature: string;
|
|
797
|
+
signedTimestamp: number;
|
|
798
|
+
chain?: string;
|
|
799
|
+
signatureMethod?: string;
|
|
669
800
|
}
|
|
670
801
|
|
|
671
802
|
export interface GateCheckApiResponse {
|
|
@@ -674,6 +805,8 @@ declare module '@neus/sdk' {
|
|
|
674
805
|
eligible: boolean;
|
|
675
806
|
matchedCount?: number;
|
|
676
807
|
matchedQHashes?: string[];
|
|
808
|
+
/** @deprecated matchedProofIds is a legacy alias of matchedQHashes (same values when provided). */
|
|
809
|
+
matchedProofIds?: string[];
|
|
677
810
|
matchedTags?: string[];
|
|
678
811
|
projections?: Array<Record<string, any>> | null;
|
|
679
812
|
criteria?: Record<string, any>;
|
|
@@ -681,38 +814,6 @@ declare module '@neus/sdk' {
|
|
|
681
814
|
error?: any;
|
|
682
815
|
}
|
|
683
816
|
|
|
684
|
-
/**
|
|
685
|
-
* Parameters for lookup() (API-backed).
|
|
686
|
-
* Mirrors `POST /api/v1/verification/lookup` body.
|
|
687
|
-
*/
|
|
688
|
-
export interface LookupParams {
|
|
689
|
-
/** Premium API key (sk_live_... or sk_test_...) */
|
|
690
|
-
apiKey: string;
|
|
691
|
-
/** Verifiers to run (external_lookup only) */
|
|
692
|
-
verifierIds: string[];
|
|
693
|
-
/** Wallet to evaluate */
|
|
694
|
-
targetWalletAddress: string;
|
|
695
|
-
/** Verifier input data (e.g., contractAddress/tokenId/chainId) */
|
|
696
|
-
data?: Record<string, any>;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
export interface LookupApiResponse {
|
|
700
|
-
success: boolean;
|
|
701
|
-
data?: {
|
|
702
|
-
mode: 'lookup';
|
|
703
|
-
requestId: string;
|
|
704
|
-
targetWalletAddress: string;
|
|
705
|
-
payerWallet: string;
|
|
706
|
-
verifierIds: string[];
|
|
707
|
-
verified: boolean;
|
|
708
|
-
results: any[];
|
|
709
|
-
timing?: {
|
|
710
|
-
startedAt: number;
|
|
711
|
-
durationMs: number;
|
|
712
|
-
};
|
|
713
|
-
};
|
|
714
|
-
error?: any;
|
|
715
|
-
}
|
|
716
817
|
|
|
717
818
|
export interface ApiResponse<T = any> {
|
|
718
819
|
success: boolean;
|
|
@@ -778,12 +879,27 @@ declare module '@neus/sdk' {
|
|
|
778
879
|
// SUPPORTING TYPES
|
|
779
880
|
// ============================================================================
|
|
780
881
|
|
|
781
|
-
|
|
782
|
-
content?: string;
|
|
882
|
+
type OwnershipBasicData = {
|
|
783
883
|
owner: string;
|
|
884
|
+
content?: string;
|
|
885
|
+
contentHash?: string;
|
|
886
|
+
contentType?: string;
|
|
784
887
|
reference?: {
|
|
785
|
-
type:
|
|
786
|
-
|
|
888
|
+
type:
|
|
889
|
+
| 'ipfs'
|
|
890
|
+
| 'ipfs-hash'
|
|
891
|
+
| 'url'
|
|
892
|
+
| 'license-nft'
|
|
893
|
+
| 'contract'
|
|
894
|
+
| 'qhash'
|
|
895
|
+
| 'ethereum-tx'
|
|
896
|
+
| 'on-chain-tx'
|
|
897
|
+
| 'tx'
|
|
898
|
+
| 'file'
|
|
899
|
+
| 'doc'
|
|
900
|
+
| 'media'
|
|
901
|
+
| 'username-claim'
|
|
902
|
+
| 'other';
|
|
787
903
|
id?: string;
|
|
788
904
|
title?: string;
|
|
789
905
|
description?: string;
|
|
@@ -791,8 +907,136 @@ declare module '@neus/sdk' {
|
|
|
791
907
|
name?: string;
|
|
792
908
|
size?: number;
|
|
793
909
|
};
|
|
910
|
+
provenance?: {
|
|
911
|
+
declaredKind?: 'human' | 'ai' | 'mixed' | 'unknown';
|
|
912
|
+
aiContext?: {
|
|
913
|
+
generatorType?: 'local' | 'saas' | 'agent';
|
|
914
|
+
provider?: string;
|
|
915
|
+
model?: string;
|
|
916
|
+
runId?: string;
|
|
917
|
+
};
|
|
918
|
+
};
|
|
794
919
|
[key: string]: any;
|
|
795
|
-
}
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
type OwnershipPseudonymData = {
|
|
923
|
+
pseudonymId: string;
|
|
924
|
+
namespace?: string;
|
|
925
|
+
displayName?: string;
|
|
926
|
+
metadata?: Record<string, any>;
|
|
927
|
+
[key: string]: any;
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
type OwnershipDnsTxtData = {
|
|
931
|
+
domain: string;
|
|
932
|
+
walletAddress?: string;
|
|
933
|
+
[key: string]: any;
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
type ContractOwnershipData = {
|
|
937
|
+
contractAddress: string;
|
|
938
|
+
chainId: number;
|
|
939
|
+
walletAddress?: string;
|
|
940
|
+
method?: 'owner' | 'admin' | 'accessControl';
|
|
941
|
+
[key: string]: any;
|
|
942
|
+
};
|
|
943
|
+
|
|
944
|
+
type NftOwnershipData = {
|
|
945
|
+
ownerAddress?: string;
|
|
946
|
+
contractAddress: string;
|
|
947
|
+
tokenId: string;
|
|
948
|
+
tokenType?: 'erc721' | 'erc1155';
|
|
949
|
+
chainId: number;
|
|
950
|
+
blockNumber?: number;
|
|
951
|
+
[key: string]: any;
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
type TokenHoldingData = {
|
|
955
|
+
ownerAddress?: string;
|
|
956
|
+
contractAddress: string;
|
|
957
|
+
minBalance: string;
|
|
958
|
+
chainId: number;
|
|
959
|
+
blockNumber?: number;
|
|
960
|
+
[key: string]: any;
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
type WalletRiskData = {
|
|
964
|
+
/** Risk assessment provider hint. Known value: webacy. */
|
|
965
|
+
provider?: string;
|
|
966
|
+
walletAddress?: string;
|
|
967
|
+
chainId?: number;
|
|
968
|
+
includeDetails?: boolean;
|
|
969
|
+
[key: string]: any;
|
|
970
|
+
};
|
|
971
|
+
|
|
972
|
+
type WalletLinkData = {
|
|
973
|
+
primaryWalletAddress: string;
|
|
974
|
+
secondaryWalletAddress: string;
|
|
975
|
+
signature: string;
|
|
976
|
+
chain: string;
|
|
977
|
+
signatureMethod: string;
|
|
978
|
+
signedTimestamp: number;
|
|
979
|
+
relationshipType?: 'primary' | 'personal' | 'org' | 'affiliate' | 'agent' | 'linked';
|
|
980
|
+
label?: string;
|
|
981
|
+
[key: string]: any;
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
type AiContentModerationData = {
|
|
985
|
+
content: string;
|
|
986
|
+
contentType:
|
|
987
|
+
| 'image/jpeg'
|
|
988
|
+
| 'image/png'
|
|
989
|
+
| 'image/webp'
|
|
990
|
+
| 'image/gif'
|
|
991
|
+
| 'text/plain'
|
|
992
|
+
| 'text/markdown'
|
|
993
|
+
| 'text/x-markdown'
|
|
994
|
+
| 'application/json'
|
|
995
|
+
| 'application/xml';
|
|
996
|
+
provider?: 'google-vision' | 'google-perspective';
|
|
997
|
+
[key: string]: any;
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
type AgentIdentityData = {
|
|
1001
|
+
agentId: string;
|
|
1002
|
+
agentWallet: string;
|
|
1003
|
+
agentLabel?: string;
|
|
1004
|
+
agentType?: 'ai' | 'bot' | 'service' | 'automation' | 'agent';
|
|
1005
|
+
description?: string;
|
|
1006
|
+
capabilities?: any[];
|
|
1007
|
+
[key: string]: any;
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
type AgentDelegationData = {
|
|
1011
|
+
controllerWallet: string;
|
|
1012
|
+
agentWallet: string;
|
|
1013
|
+
agentId?: string;
|
|
1014
|
+
scope?: string;
|
|
1015
|
+
permissions?: any[];
|
|
1016
|
+
maxSpend?: string;
|
|
1017
|
+
allowedPaymentTypes?: string[];
|
|
1018
|
+
receiptDisclosure?: 'none' | 'summary' | 'full';
|
|
1019
|
+
expiresAt?: number;
|
|
1020
|
+
[key: string]: any;
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
type CoreVerificationData =
|
|
1024
|
+
| OwnershipBasicData
|
|
1025
|
+
| OwnershipPseudonymData
|
|
1026
|
+
| OwnershipDnsTxtData
|
|
1027
|
+
| ContractOwnershipData
|
|
1028
|
+
| NftOwnershipData
|
|
1029
|
+
| TokenHoldingData
|
|
1030
|
+
| WalletRiskData
|
|
1031
|
+
| WalletLinkData
|
|
1032
|
+
| AiContentModerationData
|
|
1033
|
+
| AgentIdentityData
|
|
1034
|
+
| AgentDelegationData;
|
|
1035
|
+
|
|
1036
|
+
type VerificationData =
|
|
1037
|
+
| CoreVerificationData
|
|
1038
|
+
| Record<string, CoreVerificationData>
|
|
1039
|
+
| Record<string, any>;
|
|
796
1040
|
|
|
797
1041
|
|
|
798
1042
|
|
|
@@ -869,7 +1113,11 @@ declare module '@neus/sdk/widgets' {
|
|
|
869
1113
|
requiredVerifiers?: string[];
|
|
870
1114
|
/** Callback when verification completes successfully */
|
|
871
1115
|
onVerified?: (result: {
|
|
1116
|
+
proofId: string;
|
|
1117
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
872
1118
|
qHash: string;
|
|
1119
|
+
proofIds?: string[];
|
|
1120
|
+
/** @deprecated qHashes is a deprecated alias of proofIds (same values). */
|
|
873
1121
|
qHashes?: string[];
|
|
874
1122
|
address?: string;
|
|
875
1123
|
txHash?: string | null;
|
|
@@ -877,10 +1125,13 @@ declare module '@neus/sdk/widgets' {
|
|
|
877
1125
|
verifiedVerifiers?: any[];
|
|
878
1126
|
statusUrl?: string | null;
|
|
879
1127
|
existing?: boolean;
|
|
1128
|
+
eligible?: boolean;
|
|
880
1129
|
mode?: 'create' | 'access';
|
|
881
1130
|
data?: any;
|
|
882
1131
|
results?: Array<{
|
|
883
1132
|
verifierId: string;
|
|
1133
|
+
proofId: string;
|
|
1134
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
884
1135
|
qHash: string;
|
|
885
1136
|
address?: string;
|
|
886
1137
|
txHash?: string | null;
|
|
@@ -891,6 +1142,16 @@ declare module '@neus/sdk/widgets' {
|
|
|
891
1142
|
}) => void;
|
|
892
1143
|
/** Custom API endpoint URL */
|
|
893
1144
|
apiUrl?: string;
|
|
1145
|
+
/** Optional public app attribution ID (maps to X-Neus-App) */
|
|
1146
|
+
appId?: string;
|
|
1147
|
+
/** Optional sponsor capability token (maps to X-Sponsor-Grant) */
|
|
1148
|
+
sponsorGrant?: string;
|
|
1149
|
+
/** Optional x402 receipt token for retry calls (maps to PAYMENT-SIGNATURE) */
|
|
1150
|
+
paymentSignature?: string;
|
|
1151
|
+
/** Optional extra passthrough headers for advanced integrations */
|
|
1152
|
+
extraHeaders?: Record<string, string>;
|
|
1153
|
+
/** Hosted checkout URL for interactive verifiers (default: https://neus.network/verify) */
|
|
1154
|
+
hostedCheckoutUrl?: string;
|
|
894
1155
|
/** Custom inline styles */
|
|
895
1156
|
style?: Record<string, any>;
|
|
896
1157
|
/** Child content to show when verified */
|
|
@@ -917,8 +1178,16 @@ declare module '@neus/sdk/widgets' {
|
|
|
917
1178
|
buttonText?: string;
|
|
918
1179
|
/** Mode: 'create' for new verification, 'access' for private proof access */
|
|
919
1180
|
mode?: 'create' | 'access';
|
|
920
|
-
/**
|
|
1181
|
+
/** proofId for private proof access (required when mode='access') */
|
|
1182
|
+
proofId?: string | null;
|
|
1183
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
921
1184
|
qHash?: string | null;
|
|
1185
|
+
/** Optional injected wallet/provider for signing flows */
|
|
1186
|
+
wallet?: WalletLike | any;
|
|
1187
|
+
/** Optional CAIP-2 chain context for non-EVM owner signatures */
|
|
1188
|
+
chain?: string;
|
|
1189
|
+
/** Optional signature method hint for non-EVM owner signatures */
|
|
1190
|
+
signatureMethod?: string;
|
|
922
1191
|
/** Callback for state changes */
|
|
923
1192
|
onStateChange?: (state: string) => void;
|
|
924
1193
|
/** Callback for errors */
|
|
@@ -928,8 +1197,12 @@ declare module '@neus/sdk/widgets' {
|
|
|
928
1197
|
export function VerifyGate(props: VerifyGateProps): any;
|
|
929
1198
|
|
|
930
1199
|
export interface ProofBadgeProps {
|
|
931
|
-
/** Proof ID (
|
|
932
|
-
|
|
1200
|
+
/** Proof ID (standard). Provide either proofId or qHash. */
|
|
1201
|
+
proofId?: string;
|
|
1202
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
1203
|
+
qHash?: string;
|
|
1204
|
+
/** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
|
|
1205
|
+
proofUrlPattern?: string;
|
|
933
1206
|
/** Badge size */
|
|
934
1207
|
size?: 'sm' | 'md';
|
|
935
1208
|
/** UI platform base URL */
|
|
@@ -942,8 +1215,10 @@ declare module '@neus/sdk/widgets' {
|
|
|
942
1215
|
showChains?: boolean;
|
|
943
1216
|
/** Show status label (default: true) */
|
|
944
1217
|
showLabel?: boolean;
|
|
1218
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1219
|
+
logoUrl?: string;
|
|
945
1220
|
/** Custom click handler */
|
|
946
|
-
onClick?: (data: { qHash: string; status: string; chainCount?: number }) => void;
|
|
1221
|
+
onClick?: (data: { proofId: string; qHash: string; status: string; chainCount?: number }) => void;
|
|
947
1222
|
/** Additional CSS class */
|
|
948
1223
|
className?: string;
|
|
949
1224
|
}
|
|
@@ -951,41 +1226,59 @@ declare module '@neus/sdk/widgets' {
|
|
|
951
1226
|
export function ProofBadge(props: ProofBadgeProps): any;
|
|
952
1227
|
|
|
953
1228
|
export interface SimpleProofBadgeProps {
|
|
954
|
-
|
|
1229
|
+
proofId?: string;
|
|
1230
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
1231
|
+
qHash?: string;
|
|
1232
|
+
/** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
|
|
1233
|
+
proofUrlPattern?: string;
|
|
955
1234
|
uiLinkBase?: string;
|
|
956
1235
|
apiUrl?: string;
|
|
957
1236
|
size?: 'sm' | 'md';
|
|
958
1237
|
/** Label text (default: 'Verified') */
|
|
959
1238
|
label?: string;
|
|
1239
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1240
|
+
logoUrl?: string;
|
|
960
1241
|
proof?: any;
|
|
961
|
-
onClick?: (data: { qHash: string; status: string }) => void;
|
|
1242
|
+
onClick?: (data: { proofId: string; qHash: string; status: string }) => void;
|
|
962
1243
|
className?: string;
|
|
963
1244
|
}
|
|
964
1245
|
|
|
965
1246
|
export function SimpleProofBadge(props: SimpleProofBadgeProps): any;
|
|
966
1247
|
|
|
967
1248
|
export interface NeusPillLinkProps {
|
|
1249
|
+
proofId?: string;
|
|
1250
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
968
1251
|
qHash?: string;
|
|
1252
|
+
/** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
|
|
1253
|
+
proofUrlPattern?: string;
|
|
969
1254
|
uiLinkBase?: string;
|
|
970
1255
|
label?: string;
|
|
971
1256
|
size?: 'sm' | 'md';
|
|
972
|
-
|
|
1257
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1258
|
+
logoUrl?: string;
|
|
1259
|
+
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
973
1260
|
className?: string;
|
|
974
1261
|
}
|
|
975
1262
|
|
|
976
1263
|
export function NeusPillLink(props: NeusPillLinkProps): any;
|
|
977
1264
|
|
|
978
1265
|
export interface VerifiedIconProps {
|
|
979
|
-
/** Proof ID (
|
|
1266
|
+
/** Proof ID (standard) for link */
|
|
1267
|
+
proofId?: string;
|
|
1268
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
980
1269
|
qHash?: string;
|
|
1270
|
+
/** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
|
|
1271
|
+
proofUrlPattern?: string;
|
|
981
1272
|
/** UI platform base URL */
|
|
982
1273
|
uiLinkBase?: string;
|
|
983
1274
|
/** Icon size in pixels */
|
|
984
1275
|
size?: number;
|
|
1276
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1277
|
+
logoUrl?: string;
|
|
985
1278
|
/** Tooltip text */
|
|
986
1279
|
tooltip?: string;
|
|
987
1280
|
/** Custom click handler */
|
|
988
|
-
onClick?: (data: { qHash?: string }) => void;
|
|
1281
|
+
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
989
1282
|
/** Additional CSS class */
|
|
990
1283
|
className?: string;
|
|
991
1284
|
}
|
|
@@ -995,4 +1288,8 @@ declare module '@neus/sdk/widgets' {
|
|
|
995
1288
|
|
|
996
1289
|
declare module '@neus/sdk/widgets/verify-gate' {
|
|
997
1290
|
export * from '@neus/sdk/widgets';
|
|
998
|
-
}
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
declare module '@neus/sdk/client' {
|
|
1294
|
+
export { NeusClient } from '@neus/sdk';
|
|
1295
|
+
}
|