@neus/sdk 1.0.2 → 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 -112
- package/cjs/client.cjs +545 -175
- package/cjs/errors.cjs +1 -0
- package/cjs/gates.cjs +1 -0
- package/cjs/index.cjs +725 -180
- package/cjs/utils.cjs +338 -3
- package/client.js +1951 -1729
- package/index.js +75 -64
- package/neus-logo.svg +3 -0
- package/package.json +9 -5
- package/types.d.ts +215 -30
- package/utils.js +407 -4
- 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 +283 -58
- package/widgets/verify-gate/index.js +13 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neus/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "NEUS SDK - Create and verify cryptographic proofs with simple, clean API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"require": "./cjs/index.cjs"
|
|
13
13
|
},
|
|
14
14
|
"./client": {
|
|
15
|
+
"types": "./types.d.ts",
|
|
15
16
|
"import": "./client.js",
|
|
16
17
|
"require": "./cjs/client.cjs"
|
|
17
18
|
},
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"lint": "eslint . --ignore-pattern widgets/verify-gate/dist/**",
|
|
46
47
|
"format": "prettier --write \"**/*.js\"",
|
|
47
48
|
"build": "npm run build:widgets && npm run build:cjs",
|
|
48
|
-
"build:widgets": "esbuild widgets/verify-gate/VerifyGate.jsx widgets/verify-gate/ProofBadge.jsx --bundle --platform=browser --format=esm --outdir=widgets/verify-gate/dist --jsx=automatic --legal-comments=none --external:react --external:react-dom --external:react/jsx-runtime --external:@neus/sdk/client",
|
|
49
|
+
"build:widgets": "esbuild widgets/verify-gate/VerifyGate.jsx widgets/verify-gate/ProofBadge.jsx --bundle --platform=browser --format=esm --outdir=widgets/verify-gate/dist --jsx=automatic --legal-comments=none --loader:.svg=dataurl --external:react --external:react-dom --external:react/jsx-runtime --external:@neus/sdk/client",
|
|
49
50
|
"build:cjs": "esbuild index.js client.js utils.js errors.js gates.js --bundle --platform=node --format=cjs --outdir=cjs --out-extension:.js=.cjs --legal-comments=none --external:ethers --external:@zkpassport/sdk --external:react --external:react-dom --external:react/jsx-runtime",
|
|
50
51
|
"prepack": "npm run build",
|
|
51
52
|
"prepublishOnly": "npm run lint && npm test && npm run build"
|
|
@@ -79,7 +80,6 @@
|
|
|
79
80
|
"engines": {
|
|
80
81
|
"node": ">=16.0.0"
|
|
81
82
|
},
|
|
82
|
-
"dependencies": {},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"ethers": "^6.0.0",
|
|
85
85
|
"react": ">=17.0.0",
|
|
@@ -99,12 +99,15 @@
|
|
|
99
99
|
"optionalDependencies": {
|
|
100
100
|
"@zkpassport/sdk": ">=1.0.0"
|
|
101
101
|
},
|
|
102
|
+
"dependencies": {
|
|
103
|
+
"bs58": "^6.0.0"
|
|
104
|
+
},
|
|
102
105
|
"devDependencies": {
|
|
103
|
-
"vitest": "^1.2.0",
|
|
104
106
|
"@vitest/coverage-v8": "^1.2.0",
|
|
107
|
+
"esbuild": "^0.20.2",
|
|
105
108
|
"eslint": "^8.56.0",
|
|
106
109
|
"prettier": "^3.2.0",
|
|
107
|
-
"
|
|
110
|
+
"vitest": "^1.2.0"
|
|
108
111
|
},
|
|
109
112
|
"files": [
|
|
110
113
|
"index.js",
|
|
@@ -118,6 +121,7 @@
|
|
|
118
121
|
"README.md",
|
|
119
122
|
"SECURITY.md",
|
|
120
123
|
"LICENSE",
|
|
124
|
+
"neus-logo.svg",
|
|
121
125
|
"widgets/index.js",
|
|
122
126
|
"widgets/verify-gate/index.js",
|
|
123
127
|
"widgets/verify-gate/dist/**"
|
package/types.d.ts
CHANGED
|
@@ -32,17 +32,17 @@ declare module '@neus/sdk' {
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Get verification status by proof ID
|
|
35
|
-
* @param
|
|
35
|
+
* @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
|
|
36
36
|
* @returns Promise resolving to current status
|
|
37
37
|
*/
|
|
38
|
-
getStatus(
|
|
38
|
+
getStatus(proofId: string): Promise<StatusResult>;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Get private proof status (owner-signed)
|
|
42
|
-
* @param
|
|
42
|
+
* @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
|
|
43
43
|
* @param wallet - Optional injected wallet/provider (MetaMask/ethers Wallet)
|
|
44
44
|
*/
|
|
45
|
-
getPrivateStatus(
|
|
45
|
+
getPrivateStatus(proofId: string, wallet?: WalletLike | GatePrivateAuth): Promise<StatusResult>;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Check API health
|
|
@@ -55,21 +55,21 @@ declare module '@neus/sdk' {
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Poll verification status until completion
|
|
58
|
-
* @param
|
|
58
|
+
* @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
|
|
59
59
|
* @param options - Polling configuration options
|
|
60
60
|
* @returns Promise resolving to final status
|
|
61
61
|
* @example
|
|
62
|
-
* const finalStatus = await client.pollProofStatus(
|
|
62
|
+
* const finalStatus = await client.pollProofStatus(proofId, {
|
|
63
63
|
* interval: 3000,
|
|
64
64
|
* onProgress: (status) => {
|
|
65
65
|
* // Handle status updates
|
|
66
66
|
* }
|
|
67
67
|
* });
|
|
68
68
|
*/
|
|
69
|
-
pollProofStatus(
|
|
69
|
+
pollProofStatus(proofId: string, options?: PollOptions): Promise<StatusResult>;
|
|
70
70
|
|
|
71
71
|
/** Revoke own proof (owner-signed) */
|
|
72
|
-
revokeOwnProof(
|
|
72
|
+
revokeOwnProof(proofId: string, wallet?: { address: string }): Promise<boolean>;
|
|
73
73
|
|
|
74
74
|
// ═══════════════════════════════════════════════════════════════
|
|
75
75
|
// PROOFS & GATING METHODS
|
|
@@ -95,6 +95,16 @@ declare module '@neus/sdk' {
|
|
|
95
95
|
*/
|
|
96
96
|
gateCheck(params: GateCheckApiParams): Promise<GateCheckApiResponse>;
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Pre-sign owner auth payload for repeated includePrivate gate checks (single prompt).
|
|
100
|
+
*/
|
|
101
|
+
createGatePrivateAuth(params: {
|
|
102
|
+
address: string;
|
|
103
|
+
wallet?: WalletLike;
|
|
104
|
+
chain?: string;
|
|
105
|
+
signatureMethod?: string;
|
|
106
|
+
}): Promise<GatePrivateAuth>;
|
|
107
|
+
|
|
98
108
|
/**
|
|
99
109
|
* Evaluate gate requirements against existing proofs
|
|
100
110
|
* Returns whether wallet satisfies all requirements, with missing items listed
|
|
@@ -125,10 +135,20 @@ declare module '@neus/sdk' {
|
|
|
125
135
|
export interface NeusClientConfig {
|
|
126
136
|
/** API endpoint URL (defaults to hosted public API) */
|
|
127
137
|
apiUrl?: string;
|
|
128
|
-
/** Optional
|
|
138
|
+
/** Optional API key (server-side only; do not embed in browser apps) */
|
|
129
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>;
|
|
130
148
|
/** Request timeout in milliseconds */
|
|
131
149
|
timeout?: number;
|
|
150
|
+
/** Optional chain override used by some app integrations */
|
|
151
|
+
hubChainId?: number;
|
|
132
152
|
/** Enable SDK logging */
|
|
133
153
|
enableLogging?: boolean;
|
|
134
154
|
}
|
|
@@ -188,7 +208,9 @@ declare module '@neus/sdk' {
|
|
|
188
208
|
* Result from proof creation
|
|
189
209
|
*/
|
|
190
210
|
export interface ProofResult {
|
|
191
|
-
/** Proof ID (
|
|
211
|
+
/** Proof ID (standard) */
|
|
212
|
+
proofId: string;
|
|
213
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
192
214
|
qHash: string;
|
|
193
215
|
/** Current status */
|
|
194
216
|
status: string;
|
|
@@ -204,7 +226,9 @@ declare module '@neus/sdk' {
|
|
|
204
226
|
* Verification result
|
|
205
227
|
*/
|
|
206
228
|
export interface VerificationResult {
|
|
207
|
-
/** Proof ID (
|
|
229
|
+
/** Proof ID (standard) */
|
|
230
|
+
proofId: string;
|
|
231
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
208
232
|
qHash: string;
|
|
209
233
|
/** Current status */
|
|
210
234
|
status: VerificationStatus;
|
|
@@ -218,13 +242,19 @@ declare module '@neus/sdk' {
|
|
|
218
242
|
* Status check result
|
|
219
243
|
*/
|
|
220
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;
|
|
221
249
|
/** Whether verification succeeded */
|
|
222
250
|
success: boolean;
|
|
223
251
|
/** Current status */
|
|
224
252
|
status: VerificationStatus;
|
|
225
253
|
/** Full verification data */
|
|
226
254
|
data?: {
|
|
227
|
-
|
|
255
|
+
proofId?: string;
|
|
256
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
257
|
+
qHash?: string;
|
|
228
258
|
status: string;
|
|
229
259
|
walletAddress: string;
|
|
230
260
|
verifierIds?: string[];
|
|
@@ -320,13 +350,16 @@ declare module '@neus/sdk' {
|
|
|
320
350
|
export type CoreVerifierId =
|
|
321
351
|
// Public verifiers (auto-path via verify())
|
|
322
352
|
| 'ownership-basic'
|
|
353
|
+
| 'ownership-social' // Hosted OAuth social ownership
|
|
323
354
|
| 'ownership-pseudonym' // Pseudonymous identity verification
|
|
355
|
+
| 'ownership-org-oauth' // Hosted OAuth organization ownership
|
|
324
356
|
| 'nft-ownership'
|
|
325
357
|
| 'token-holding'
|
|
326
358
|
| 'ownership-dns-txt'
|
|
327
359
|
| 'wallet-link'
|
|
328
360
|
| 'contract-ownership'
|
|
329
361
|
| 'wallet-risk' // Wallet risk assessment
|
|
362
|
+
| 'proof-of-human' // Hosted ZK personhood verification
|
|
330
363
|
// AI & Agent verifiers (ERC-8004 aligned)
|
|
331
364
|
| 'agent-identity'
|
|
332
365
|
| 'agent-delegation'
|
|
@@ -374,13 +407,19 @@ declare module '@neus/sdk' {
|
|
|
374
407
|
signedTimestamp: number;
|
|
375
408
|
data: any;
|
|
376
409
|
verifierIds: VerifierId[];
|
|
377
|
-
chainId
|
|
410
|
+
chainId?: number;
|
|
411
|
+
chain?: string;
|
|
378
412
|
}): string;
|
|
379
413
|
|
|
380
414
|
/**
|
|
381
415
|
* Validate Ethereum wallet address
|
|
382
416
|
*/
|
|
383
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;
|
|
384
423
|
|
|
385
424
|
/**
|
|
386
425
|
* Validate timestamp freshness
|
|
@@ -388,7 +427,7 @@ declare module '@neus/sdk' {
|
|
|
388
427
|
export function validateTimestamp(timestamp: number, maxAgeMs?: number): boolean;
|
|
389
428
|
|
|
390
429
|
/**
|
|
391
|
-
* Validate Proof ID (qHash)
|
|
430
|
+
* Validate Proof ID format (`qHash` wire alias)
|
|
392
431
|
*/
|
|
393
432
|
export function validateQHash(qHash: string): boolean;
|
|
394
433
|
|
|
@@ -397,6 +436,71 @@ declare module '@neus/sdk' {
|
|
|
397
436
|
*/
|
|
398
437
|
export function normalizeAddress(address: string): string;
|
|
399
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
|
+
|
|
400
504
|
/**
|
|
401
505
|
* Validate a verifier payload for basic structural integrity
|
|
402
506
|
*/
|
|
@@ -410,9 +514,10 @@ declare module '@neus/sdk' {
|
|
|
410
514
|
data: any;
|
|
411
515
|
walletAddress: string;
|
|
412
516
|
chainId?: number;
|
|
517
|
+
chain?: string;
|
|
413
518
|
options?: any;
|
|
414
519
|
signedTimestamp?: number;
|
|
415
|
-
}): { 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 } };
|
|
416
521
|
|
|
417
522
|
/**
|
|
418
523
|
* Check if status is terminal (complete)
|
|
@@ -443,7 +548,7 @@ declare module '@neus/sdk' {
|
|
|
443
548
|
* Status polling utility
|
|
444
549
|
*/
|
|
445
550
|
export class StatusPoller {
|
|
446
|
-
constructor(client: NeusClient,
|
|
551
|
+
constructor(client: NeusClient, proofId: string, options?: { interval?: number; maxAttempts?: number; exponentialBackoff?: boolean; maxInterval?: number });
|
|
447
552
|
poll(): Promise<StatusResult>;
|
|
448
553
|
}
|
|
449
554
|
|
|
@@ -475,7 +580,7 @@ declare module '@neus/sdk' {
|
|
|
475
580
|
/**
|
|
476
581
|
* Proof status
|
|
477
582
|
*/
|
|
478
|
-
// Use NeusClient.getStatus(
|
|
583
|
+
// Use NeusClient.getStatus(proofId) for status checks (`qHash` remains as deprecated alias).
|
|
479
584
|
|
|
480
585
|
|
|
481
586
|
// ============================================================================
|
|
@@ -567,6 +672,10 @@ declare module '@neus/sdk' {
|
|
|
567
672
|
limit?: number;
|
|
568
673
|
/** Offset for pagination */
|
|
569
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;
|
|
570
679
|
}
|
|
571
680
|
|
|
572
681
|
/**
|
|
@@ -624,10 +733,10 @@ declare module '@neus/sdk' {
|
|
|
624
733
|
|
|
625
734
|
/**
|
|
626
735
|
* Parameters for gateCheck() (API-backed).
|
|
627
|
-
* Mirrors `GET /api/v1/proofs/
|
|
736
|
+
* Mirrors `GET /api/v1/proofs/check` query parameters.
|
|
628
737
|
*/
|
|
629
738
|
export interface GateCheckApiParams {
|
|
630
|
-
/** Wallet
|
|
739
|
+
/** Wallet identity to check (EVM/Solana/NEAR) */
|
|
631
740
|
address: string;
|
|
632
741
|
/** Verifier IDs to match (array or comma-separated string) */
|
|
633
742
|
verifierIds?: string[] | string;
|
|
@@ -641,6 +750,18 @@ declare module '@neus/sdk' {
|
|
|
641
750
|
since?: number;
|
|
642
751
|
/** Max rows to scan (server may clamp) */
|
|
643
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;
|
|
644
765
|
|
|
645
766
|
// Common match filters
|
|
646
767
|
referenceType?: string;
|
|
@@ -670,12 +791,22 @@ declare module '@neus/sdk' {
|
|
|
670
791
|
verificationMethod?: string;
|
|
671
792
|
}
|
|
672
793
|
|
|
794
|
+
export interface GatePrivateAuth {
|
|
795
|
+
walletAddress: string;
|
|
796
|
+
signature: string;
|
|
797
|
+
signedTimestamp: number;
|
|
798
|
+
chain?: string;
|
|
799
|
+
signatureMethod?: string;
|
|
800
|
+
}
|
|
801
|
+
|
|
673
802
|
export interface GateCheckApiResponse {
|
|
674
803
|
success: boolean;
|
|
675
804
|
data?: {
|
|
676
805
|
eligible: boolean;
|
|
677
806
|
matchedCount?: number;
|
|
678
807
|
matchedQHashes?: string[];
|
|
808
|
+
/** @deprecated matchedProofIds is a legacy alias of matchedQHashes (same values when provided). */
|
|
809
|
+
matchedProofIds?: string[];
|
|
679
810
|
matchedTags?: string[];
|
|
680
811
|
projections?: Array<Record<string, any>> | null;
|
|
681
812
|
criteria?: Record<string, any>;
|
|
@@ -842,7 +973,8 @@ declare module '@neus/sdk' {
|
|
|
842
973
|
primaryWalletAddress: string;
|
|
843
974
|
secondaryWalletAddress: string;
|
|
844
975
|
signature: string;
|
|
845
|
-
|
|
976
|
+
chain: string;
|
|
977
|
+
signatureMethod: string;
|
|
846
978
|
signedTimestamp: number;
|
|
847
979
|
relationshipType?: 'primary' | 'personal' | 'org' | 'affiliate' | 'agent' | 'linked';
|
|
848
980
|
label?: string;
|
|
@@ -981,7 +1113,11 @@ declare module '@neus/sdk/widgets' {
|
|
|
981
1113
|
requiredVerifiers?: string[];
|
|
982
1114
|
/** Callback when verification completes successfully */
|
|
983
1115
|
onVerified?: (result: {
|
|
1116
|
+
proofId: string;
|
|
1117
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
984
1118
|
qHash: string;
|
|
1119
|
+
proofIds?: string[];
|
|
1120
|
+
/** @deprecated qHashes is a deprecated alias of proofIds (same values). */
|
|
985
1121
|
qHashes?: string[];
|
|
986
1122
|
address?: string;
|
|
987
1123
|
txHash?: string | null;
|
|
@@ -989,10 +1125,13 @@ declare module '@neus/sdk/widgets' {
|
|
|
989
1125
|
verifiedVerifiers?: any[];
|
|
990
1126
|
statusUrl?: string | null;
|
|
991
1127
|
existing?: boolean;
|
|
1128
|
+
eligible?: boolean;
|
|
992
1129
|
mode?: 'create' | 'access';
|
|
993
1130
|
data?: any;
|
|
994
1131
|
results?: Array<{
|
|
995
1132
|
verifierId: string;
|
|
1133
|
+
proofId: string;
|
|
1134
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
996
1135
|
qHash: string;
|
|
997
1136
|
address?: string;
|
|
998
1137
|
txHash?: string | null;
|
|
@@ -1003,6 +1142,16 @@ declare module '@neus/sdk/widgets' {
|
|
|
1003
1142
|
}) => void;
|
|
1004
1143
|
/** Custom API endpoint URL */
|
|
1005
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;
|
|
1006
1155
|
/** Custom inline styles */
|
|
1007
1156
|
style?: Record<string, any>;
|
|
1008
1157
|
/** Child content to show when verified */
|
|
@@ -1029,8 +1178,16 @@ declare module '@neus/sdk/widgets' {
|
|
|
1029
1178
|
buttonText?: string;
|
|
1030
1179
|
/** Mode: 'create' for new verification, 'access' for private proof access */
|
|
1031
1180
|
mode?: 'create' | 'access';
|
|
1032
|
-
/**
|
|
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). */
|
|
1033
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;
|
|
1034
1191
|
/** Callback for state changes */
|
|
1035
1192
|
onStateChange?: (state: string) => void;
|
|
1036
1193
|
/** Callback for errors */
|
|
@@ -1040,8 +1197,12 @@ declare module '@neus/sdk/widgets' {
|
|
|
1040
1197
|
export function VerifyGate(props: VerifyGateProps): any;
|
|
1041
1198
|
|
|
1042
1199
|
export interface ProofBadgeProps {
|
|
1043
|
-
/** Proof ID (
|
|
1044
|
-
|
|
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;
|
|
1045
1206
|
/** Badge size */
|
|
1046
1207
|
size?: 'sm' | 'md';
|
|
1047
1208
|
/** UI platform base URL */
|
|
@@ -1054,8 +1215,10 @@ declare module '@neus/sdk/widgets' {
|
|
|
1054
1215
|
showChains?: boolean;
|
|
1055
1216
|
/** Show status label (default: true) */
|
|
1056
1217
|
showLabel?: boolean;
|
|
1218
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1219
|
+
logoUrl?: string;
|
|
1057
1220
|
/** Custom click handler */
|
|
1058
|
-
onClick?: (data: { qHash: string; status: string; chainCount?: number }) => void;
|
|
1221
|
+
onClick?: (data: { proofId: string; qHash: string; status: string; chainCount?: number }) => void;
|
|
1059
1222
|
/** Additional CSS class */
|
|
1060
1223
|
className?: string;
|
|
1061
1224
|
}
|
|
@@ -1063,41 +1226,59 @@ declare module '@neus/sdk/widgets' {
|
|
|
1063
1226
|
export function ProofBadge(props: ProofBadgeProps): any;
|
|
1064
1227
|
|
|
1065
1228
|
export interface SimpleProofBadgeProps {
|
|
1066
|
-
|
|
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;
|
|
1067
1234
|
uiLinkBase?: string;
|
|
1068
1235
|
apiUrl?: string;
|
|
1069
1236
|
size?: 'sm' | 'md';
|
|
1070
1237
|
/** Label text (default: 'Verified') */
|
|
1071
1238
|
label?: string;
|
|
1239
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1240
|
+
logoUrl?: string;
|
|
1072
1241
|
proof?: any;
|
|
1073
|
-
onClick?: (data: { qHash: string; status: string }) => void;
|
|
1242
|
+
onClick?: (data: { proofId: string; qHash: string; status: string }) => void;
|
|
1074
1243
|
className?: string;
|
|
1075
1244
|
}
|
|
1076
1245
|
|
|
1077
1246
|
export function SimpleProofBadge(props: SimpleProofBadgeProps): any;
|
|
1078
1247
|
|
|
1079
1248
|
export interface NeusPillLinkProps {
|
|
1249
|
+
proofId?: string;
|
|
1250
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
1080
1251
|
qHash?: string;
|
|
1252
|
+
/** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
|
|
1253
|
+
proofUrlPattern?: string;
|
|
1081
1254
|
uiLinkBase?: string;
|
|
1082
1255
|
label?: string;
|
|
1083
1256
|
size?: 'sm' | 'md';
|
|
1084
|
-
|
|
1257
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1258
|
+
logoUrl?: string;
|
|
1259
|
+
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
1085
1260
|
className?: string;
|
|
1086
1261
|
}
|
|
1087
1262
|
|
|
1088
1263
|
export function NeusPillLink(props: NeusPillLinkProps): any;
|
|
1089
1264
|
|
|
1090
1265
|
export interface VerifiedIconProps {
|
|
1091
|
-
/** Proof ID (
|
|
1266
|
+
/** Proof ID (standard) for link */
|
|
1267
|
+
proofId?: string;
|
|
1268
|
+
/** @deprecated qHash is a deprecated alias of proofId (same value). */
|
|
1092
1269
|
qHash?: string;
|
|
1270
|
+
/** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
|
|
1271
|
+
proofUrlPattern?: string;
|
|
1093
1272
|
/** UI platform base URL */
|
|
1094
1273
|
uiLinkBase?: string;
|
|
1095
1274
|
/** Icon size in pixels */
|
|
1096
1275
|
size?: number;
|
|
1276
|
+
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1277
|
+
logoUrl?: string;
|
|
1097
1278
|
/** Tooltip text */
|
|
1098
1279
|
tooltip?: string;
|
|
1099
1280
|
/** Custom click handler */
|
|
1100
|
-
onClick?: (data: { qHash?: string }) => void;
|
|
1281
|
+
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
1101
1282
|
/** Additional CSS class */
|
|
1102
1283
|
className?: string;
|
|
1103
1284
|
}
|
|
@@ -1107,4 +1288,8 @@ declare module '@neus/sdk/widgets' {
|
|
|
1107
1288
|
|
|
1108
1289
|
declare module '@neus/sdk/widgets/verify-gate' {
|
|
1109
1290
|
export * from '@neus/sdk/widgets';
|
|
1110
|
-
}
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
declare module '@neus/sdk/client' {
|
|
1294
|
+
export { NeusClient } from '@neus/sdk';
|
|
1295
|
+
}
|