@neus/sdk 1.0.4 → 1.0.6
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 +21 -4
- package/SECURITY.md +11 -6
- package/cjs/client.cjs +132 -220
- package/cjs/gates.cjs +10 -33
- package/cjs/index.cjs +143 -252
- package/cjs/utils.cjs +0 -6
- package/cli/neus.mjs +589 -41
- package/client.js +1834 -1955
- package/errors.js +0 -34
- package/gates.js +73 -175
- package/index.js +0 -9
- package/package.json +5 -4
- package/types.d.ts +14 -459
- package/utils.js +1 -265
- package/widgets/README.md +45 -45
- package/widgets/index.js +0 -8
- package/widgets/verify-gate/dist/ProofBadge.js +0 -3
- package/widgets/verify-gate/dist/VerifyGate.js +58 -78
- package/widgets/verify-gate/index.js +0 -4
package/types.d.ts
CHANGED
|
@@ -1,105 +1,45 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NEUS SDK TypeScript Definitions
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
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
2
|
export interface Eip1193Provider {
|
|
11
3
|
request(args: { method: string; params?: unknown[] | Record<string, unknown> }): Promise<unknown>;
|
|
12
4
|
}
|
|
13
5
|
|
|
14
|
-
/**
|
|
15
|
-
* Wallet/provider object accepted by SDK methods that require signing.
|
|
16
|
-
* Prefer passing an EIP-1193 provider in browser environments.
|
|
17
|
-
*/
|
|
18
6
|
export type WalletLike = Eip1193Provider | { address?: string } | { getAddress?: () => Promise<string> } | { signMessage?: (message: string) => Promise<string> };
|
|
19
7
|
|
|
20
|
-
/**
|
|
21
|
-
* Main NEUS SDK client for creating and verifying proofs
|
|
22
|
-
*/
|
|
23
8
|
export class NeusClient {
|
|
24
9
|
constructor(config?: NeusClientConfig);
|
|
25
10
|
|
|
26
|
-
/**
|
|
27
|
-
* Create verification proof
|
|
28
|
-
* @param params - Verification parameters
|
|
29
|
-
* @returns Promise resolving to verification result
|
|
30
|
-
*/
|
|
31
11
|
verify(params: VerifyParams): Promise<VerificationResult>;
|
|
32
12
|
|
|
33
|
-
/**
|
|
34
|
-
* Get proof record by receipt ID.
|
|
35
|
-
* @param proofId - Proof receipt ID (0x + 64 hex).
|
|
36
|
-
*/
|
|
37
13
|
getProof(proofId: string): Promise<StatusResult>;
|
|
38
14
|
|
|
39
|
-
/**
|
|
40
|
-
* Get private proof record (owner-signed)
|
|
41
|
-
* @param proofId - Proof receipt ID.
|
|
42
|
-
* @param wallet - Optional injected wallet/provider (MetaMask/ethers Wallet)
|
|
43
|
-
*/
|
|
44
15
|
getPrivateProof(proofId: string, wallet?: WalletLike | GatePrivateAuth): Promise<StatusResult>;
|
|
45
16
|
|
|
46
|
-
/**
|
|
47
|
-
* Check API health
|
|
48
|
-
* @returns Promise resolving to health status
|
|
49
|
-
*/
|
|
50
17
|
isHealthy(): Promise<boolean>;
|
|
51
18
|
|
|
52
|
-
/** List available verifiers */
|
|
53
19
|
getVerifiers(): Promise<string[]>;
|
|
54
20
|
|
|
55
|
-
/** Get the public verifier catalog, including per-verifier capabilities. */
|
|
56
21
|
getVerifierCatalog(): Promise<VerifierCatalog>;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Poll verification status until completion
|
|
60
|
-
* @param proofId - Proof ID to poll.
|
|
61
|
-
* @param options - Polling configuration options
|
|
62
|
-
* @returns Promise resolving to final status
|
|
63
|
-
* @example
|
|
64
|
-
* const finalStatus = await client.pollProofStatus(proofId, {
|
|
65
|
-
* interval: 3000,
|
|
66
|
-
* onProgress: (status) => {
|
|
67
|
-
* // Handle status updates
|
|
68
|
-
* }
|
|
69
|
-
* });
|
|
70
|
-
*/
|
|
71
|
-
pollProofStatus(proofId: string, options?: PollOptions): Promise<StatusResult>;
|
|
72
|
-
|
|
73
|
-
/** Revoke own proof (owner-signed) */
|
|
74
|
-
revokeOwnProof(proofId: string, wallet?: { address: string }): Promise<boolean>;
|
|
75
22
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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>;
|
|
79
36
|
|
|
80
|
-
/**
|
|
81
|
-
* Get proofs by wallet address
|
|
82
|
-
* @param walletAddress - Target wallet address
|
|
83
|
-
* @param options - Filter options
|
|
84
|
-
* @returns Promise resolving to proofs result
|
|
85
|
-
*/
|
|
86
37
|
getProofsByWallet(walletAddress: string, options?: GetProofsOptions): Promise<ProofsResult>;
|
|
87
38
|
|
|
88
|
-
/**
|
|
89
|
-
* Get proofs by wallet or DID (owner access)
|
|
90
|
-
* Requests private proofs using owner signature headers.
|
|
91
|
-
*/
|
|
92
39
|
getPrivateProofsByWallet(walletAddress: string, options?: GetProofsOptions, wallet?: WalletLike): Promise<ProofsResult>;
|
|
93
40
|
|
|
94
|
-
/**
|
|
95
|
-
* Minimal eligibility check against public + unlisted proofs by default (API-backed).
|
|
96
|
-
* Prefer this for server-side integrations that do not need full proof payloads.
|
|
97
|
-
*/
|
|
98
41
|
gateCheck(params: GateCheckApiParams): Promise<GateCheckApiResponse>;
|
|
99
42
|
|
|
100
|
-
/**
|
|
101
|
-
* Pre-sign owner auth payload for repeated includePrivate gate checks (single prompt).
|
|
102
|
-
*/
|
|
103
43
|
createGatePrivateAuth(params: {
|
|
104
44
|
address: string;
|
|
105
45
|
wallet?: WalletLike;
|
|
@@ -107,69 +47,30 @@ declare module '@neus/sdk' {
|
|
|
107
47
|
signatureMethod?: string;
|
|
108
48
|
}): Promise<GatePrivateAuth>;
|
|
109
49
|
|
|
110
|
-
/**
|
|
111
|
-
* Evaluate gate requirements against existing proofs
|
|
112
|
-
* Returns whether wallet satisfies all requirements, with missing items listed
|
|
113
|
-
* @param params - Gate check parameters
|
|
114
|
-
* @returns Promise resolving to gate evaluation result
|
|
115
|
-
* @example
|
|
116
|
-
* const result = await client.checkGate({
|
|
117
|
-
* walletAddress: '0x...',
|
|
118
|
-
* requirements: [
|
|
119
|
-
* { verifierId: 'nft-ownership', maxAgeMs: 3600000, match: { contractAddress: '0x...' } },
|
|
120
|
-
* { verifierId: 'token-holding', maxAgeMs: 3600000, match: { contractAddress: '0x...' } },
|
|
121
|
-
* ],
|
|
122
|
-
* });
|
|
123
|
-
* if (result.satisfied) { /* allow access *\/ }
|
|
124
|
-
*/
|
|
125
50
|
checkGate(params: CheckGateParams): Promise<CheckGateResult>;
|
|
126
51
|
|
|
127
52
|
}
|
|
128
53
|
|
|
129
|
-
/**
|
|
130
|
-
* Privacy level options for verification data
|
|
131
|
-
*/
|
|
132
54
|
export type PrivacyLevel = 'public' | 'private';
|
|
133
55
|
|
|
134
|
-
/**
|
|
135
|
-
* Configuration options for NeusClient
|
|
136
|
-
*/
|
|
137
56
|
export interface NeusClientConfig {
|
|
138
|
-
/** API endpoint URL (defaults to hosted public API) */
|
|
139
57
|
apiUrl?: string;
|
|
140
|
-
/** Optional API key (server-side only; do not embed in browser apps) */
|
|
141
58
|
apiKey?: string;
|
|
142
|
-
/** Optional public app attribution ID (maps to X-Neus-App) */
|
|
143
59
|
appId?: string;
|
|
144
|
-
/** Optional x402 receipt token for retry calls (maps to PAYMENT-SIGNATURE) */
|
|
145
60
|
paymentSignature?: string;
|
|
146
|
-
/** Optional extra passthrough headers for advanced integrations */
|
|
147
61
|
extraHeaders?: Record<string, string>;
|
|
148
|
-
/** Request timeout in milliseconds */
|
|
149
62
|
timeout?: number;
|
|
150
|
-
/** Advanced. NEUS protocol primary-chain id override; most integrators omit. */
|
|
151
63
|
hubChainId?: number;
|
|
152
|
-
/** Enable SDK logging */
|
|
153
64
|
enableLogging?: boolean;
|
|
154
65
|
}
|
|
155
66
|
|
|
156
|
-
/**
|
|
157
|
-
* Verification options for privacy and storage control
|
|
158
|
-
*/
|
|
159
67
|
export interface VerificationOptions {
|
|
160
|
-
/** Privacy level for verification data */
|
|
161
68
|
privacyLevel?: PrivacyLevel;
|
|
162
|
-
/** Enable IPFS storage for public proofs */
|
|
163
69
|
enableIpfs?: boolean;
|
|
164
|
-
/** Store original content in proof (privacy consideration) */
|
|
165
70
|
storeOriginalContent?: boolean;
|
|
166
|
-
/** Target chains for cross-chain propagation (testnet chains for proof storage) */
|
|
167
71
|
targetChains?: number[];
|
|
168
|
-
/** Allow public display contexts */
|
|
169
72
|
publicDisplay?: boolean;
|
|
170
|
-
/** Metadata for public presentation */
|
|
171
73
|
meta?: Record<string, any>;
|
|
172
|
-
/** Verifier-specific options */
|
|
173
74
|
verifierOptions?: Record<string, any>;
|
|
174
75
|
}
|
|
175
76
|
|
|
@@ -191,89 +92,47 @@ declare module '@neus/sdk' {
|
|
|
191
92
|
meta?: Record<string, any>;
|
|
192
93
|
}
|
|
193
94
|
|
|
194
|
-
/**
|
|
195
|
-
* Parameters for manual verification
|
|
196
|
-
*/
|
|
197
95
|
export interface VerifyParams {
|
|
198
|
-
/** Auto path (recommended): single verifier */
|
|
199
96
|
verifier?: VerifierId;
|
|
200
|
-
/** Auto path: human-readable description */
|
|
201
97
|
content?: string;
|
|
202
|
-
/** Auto path: optional verifier-specific data */
|
|
203
98
|
data?: VerificationData;
|
|
204
|
-
/** Auto path: optional options */
|
|
205
99
|
options?: VerifyOptions;
|
|
206
100
|
|
|
207
|
-
/** Advanced/manual path: list of verifier IDs */
|
|
208
101
|
verifierIds?: VerifierId[];
|
|
209
|
-
/** Advanced/manual path: user's wallet address */
|
|
210
102
|
walletAddress?: string;
|
|
211
|
-
/** Advanced/manual path: EIP-191 signature */
|
|
212
103
|
signature?: string;
|
|
213
|
-
/** Advanced/manual path: signed timestamp */
|
|
214
104
|
signedTimestamp?: number;
|
|
215
|
-
/** Advanced/optional. EVM signing-context hint; when omitted, resolved to the NEUS protocol primary chain for signing. For chain-specific asset claims (NFT, token, contract), set chainId inside verifier data instead. */
|
|
216
105
|
chainId?: number;
|
|
217
|
-
/** CAIP-2 chain reference for universal mode (e.g. eip155:1, solana:mainnet) */
|
|
218
106
|
chain?: string;
|
|
219
|
-
/** Signature method hint for universal mode (eip191, ed25519, ...) */
|
|
220
107
|
signatureMethod?: string;
|
|
221
|
-
/** Auto path: optional wallet instance (browser/provider) */
|
|
222
108
|
wallet?: WalletLike;
|
|
223
109
|
}
|
|
224
110
|
|
|
225
|
-
/**
|
|
226
|
-
* Result from proof creation
|
|
227
|
-
*/
|
|
228
111
|
export interface ProofResult {
|
|
229
|
-
/** Proof receipt ID */
|
|
230
112
|
proofId: string;
|
|
231
|
-
/** HTTP wire field for the proof receipt ID. */
|
|
232
113
|
qHash: string;
|
|
233
|
-
/** Current status */
|
|
234
114
|
status: string;
|
|
235
|
-
/** Wallet address that created proof */
|
|
236
115
|
walletAddress?: string;
|
|
237
|
-
/** Stable URL for GET proof record */
|
|
238
116
|
proofUrl?: string;
|
|
239
|
-
/** Cross-chain enabled */
|
|
240
117
|
crossChain?: boolean;
|
|
241
118
|
}
|
|
242
119
|
|
|
243
|
-
/**
|
|
244
|
-
* Verification result
|
|
245
|
-
*/
|
|
246
120
|
export interface VerificationResult {
|
|
247
|
-
/** Proof receipt ID */
|
|
248
121
|
proofId: string;
|
|
249
|
-
/** HTTP wire field for the proof receipt ID. */
|
|
250
122
|
qHash: string;
|
|
251
|
-
/** Current status */
|
|
252
123
|
status: VerificationStatus;
|
|
253
|
-
/** Whether verification succeeded */
|
|
254
124
|
success: boolean;
|
|
255
|
-
/** Verification data */
|
|
256
125
|
data?: VerificationData;
|
|
257
126
|
}
|
|
258
127
|
|
|
259
|
-
/**
|
|
260
|
-
* Status check result
|
|
261
|
-
*/
|
|
262
128
|
export interface StatusResult {
|
|
263
|
-
/** Proof receipt ID */
|
|
264
129
|
proofId?: string;
|
|
265
|
-
/** HTTP wire field for the proof receipt ID. */
|
|
266
130
|
qHash?: string;
|
|
267
|
-
/** Stable URL for GET proof record */
|
|
268
131
|
proofUrl?: string | null;
|
|
269
|
-
/** Whether verification succeeded */
|
|
270
132
|
success: boolean;
|
|
271
|
-
/** Current status */
|
|
272
133
|
status: VerificationStatus;
|
|
273
|
-
/** Full verification data */
|
|
274
134
|
data?: {
|
|
275
135
|
proofId?: string;
|
|
276
|
-
/** HTTP wire field for the proof receipt ID. */
|
|
277
136
|
qHash?: string;
|
|
278
137
|
status: string;
|
|
279
138
|
walletAddress: string;
|
|
@@ -307,7 +166,6 @@ declare module '@neus/sdk' {
|
|
|
307
166
|
}>;
|
|
308
167
|
createdVouchers?: string[];
|
|
309
168
|
};
|
|
310
|
-
/** Advanced. Primary-chain transaction metadata from the NEUS protocol. */
|
|
311
169
|
hubTransaction?: {
|
|
312
170
|
txHash: string;
|
|
313
171
|
timestamp: number;
|
|
@@ -338,38 +196,20 @@ declare module '@neus/sdk' {
|
|
|
338
196
|
};
|
|
339
197
|
}
|
|
340
198
|
|
|
341
|
-
/**
|
|
342
|
-
* Polling options for status monitoring
|
|
343
|
-
*/
|
|
344
199
|
export interface PollOptions {
|
|
345
|
-
/** Polling interval in milliseconds (default: 5000) */
|
|
346
200
|
interval?: number;
|
|
347
|
-
/** Total timeout in milliseconds (default: 120000) */
|
|
348
201
|
timeout?: number;
|
|
349
|
-
/** Progress callback function */
|
|
350
202
|
onProgress?: (status: any) => void;
|
|
351
203
|
}
|
|
352
204
|
|
|
353
|
-
/**
|
|
354
|
-
* Validation result for verifier data
|
|
355
|
-
*/
|
|
356
205
|
export interface ValidationResult {
|
|
357
|
-
/** Whether validation passed */
|
|
358
206
|
valid: boolean;
|
|
359
|
-
/** Error message if validation failed */
|
|
360
207
|
error?: string;
|
|
361
|
-
/** Missing required fields */
|
|
362
208
|
missing?: string[];
|
|
363
|
-
/** Validation warnings */
|
|
364
209
|
warnings?: string[];
|
|
365
210
|
}
|
|
366
211
|
|
|
367
|
-
/**
|
|
368
|
-
* Core verifier identifiers
|
|
369
|
-
* Built-in verifier identifiers
|
|
370
|
-
*/
|
|
371
212
|
export type CoreVerifierId =
|
|
372
|
-
// Public verifiers (auto-path via verify())
|
|
373
213
|
| 'ownership-basic'
|
|
374
214
|
| 'ownership-social' // Hosted OAuth social ownership
|
|
375
215
|
| 'ownership-pseudonym' // Pseudonymous identity verification
|
|
@@ -381,22 +221,13 @@ declare module '@neus/sdk' {
|
|
|
381
221
|
| 'contract-ownership'
|
|
382
222
|
| 'wallet-risk' // Wallet risk assessment
|
|
383
223
|
| 'proof-of-human' // Hosted ZK personhood verification
|
|
384
|
-
// AI & Agent verifiers (portable, protocol-agnostic)
|
|
385
224
|
| 'agent-identity'
|
|
386
225
|
| 'agent-delegation'
|
|
387
226
|
| 'ai-content-moderation'
|
|
388
227
|
| string; // Allow custom verifier IDs
|
|
389
228
|
|
|
390
|
-
/**
|
|
391
|
-
* Available verifier identifiers (built-in)
|
|
392
|
-
* Alias for CoreVerifierId - use CoreVerifierId for type safety
|
|
393
|
-
* For custom verifiers, use string type with buildVerificationRequest()
|
|
394
|
-
*/
|
|
395
229
|
export type VerifierId = CoreVerifierId;
|
|
396
230
|
|
|
397
|
-
/**
|
|
398
|
-
* Verification status values (standard PROOF_STATUSES)
|
|
399
|
-
*/
|
|
400
231
|
export type VerificationStatus =
|
|
401
232
|
| 'processing_verifiers'
|
|
402
233
|
| 'processing_zk_proofs'
|
|
@@ -416,13 +247,7 @@ declare module '@neus/sdk' {
|
|
|
416
247
|
| 'error_storage_query'
|
|
417
248
|
| 'not_found';
|
|
418
249
|
|
|
419
|
-
// ============================================================================
|
|
420
|
-
// UTILITY EXPORTS
|
|
421
|
-
// ============================================================================
|
|
422
250
|
|
|
423
|
-
/**
|
|
424
|
-
* Construct verification message for manual signing
|
|
425
|
-
*/
|
|
426
251
|
export function constructVerificationMessage(params: {
|
|
427
252
|
walletAddress: string;
|
|
428
253
|
signedTimestamp: number;
|
|
@@ -432,39 +257,18 @@ declare module '@neus/sdk' {
|
|
|
432
257
|
chain?: string;
|
|
433
258
|
}): string;
|
|
434
259
|
|
|
435
|
-
/** CAIP-380 six-line signer message — line 1 */
|
|
436
260
|
export const PORTABLE_PROOF_SIGNER_HEADER: string;
|
|
437
261
|
|
|
438
|
-
/**
|
|
439
|
-
* Validate Ethereum wallet address
|
|
440
|
-
*/
|
|
441
262
|
export function validateWalletAddress(address: string): boolean;
|
|
442
263
|
|
|
443
|
-
/**
|
|
444
|
-
* Validate universal wallet address format (EVM/non-EVM).
|
|
445
|
-
*/
|
|
446
264
|
export function validateUniversalAddress(address: string, chain?: string): boolean;
|
|
447
265
|
|
|
448
|
-
/**
|
|
449
|
-
* Validate timestamp freshness
|
|
450
|
-
*/
|
|
451
266
|
export function validateTimestamp(timestamp: number, maxAgeMs?: number): boolean;
|
|
452
267
|
|
|
453
|
-
/**
|
|
454
|
-
* Validate Proof ID format (`qHash` wire alias)
|
|
455
|
-
*/
|
|
456
268
|
export function validateQHash(qHash: string): boolean;
|
|
457
269
|
|
|
458
|
-
/**
|
|
459
|
-
* Normalize wallet address to lowercase
|
|
460
|
-
*/
|
|
461
270
|
export function normalizeAddress(address: string): string;
|
|
462
271
|
|
|
463
|
-
/**
|
|
464
|
-
* Resolve DID from wallet identity via profile resolver endpoint.
|
|
465
|
-
* EVM wallets resolve to the NEUS protocol primary chain by default; chainId is optional.
|
|
466
|
-
* Use `chain` (CAIP-2) for non-EVM wallets (e.g. `solana:mainnet`).
|
|
467
|
-
*/
|
|
468
272
|
export function resolveDID(
|
|
469
273
|
params: {
|
|
470
274
|
walletAddress?: string;
|
|
@@ -483,9 +287,6 @@ declare module '@neus/sdk' {
|
|
|
483
287
|
raw: unknown;
|
|
484
288
|
}>;
|
|
485
289
|
|
|
486
|
-
/**
|
|
487
|
-
* Build a server-standardized signing payload.
|
|
488
|
-
*/
|
|
489
290
|
export function standardizeVerificationRequest(
|
|
490
291
|
params: Record<string, any>,
|
|
491
292
|
options?: {
|
|
@@ -496,9 +297,6 @@ declare module '@neus/sdk' {
|
|
|
496
297
|
}
|
|
497
298
|
): Promise<any>;
|
|
498
299
|
|
|
499
|
-
/**
|
|
500
|
-
* Resolve ZK Passport default configuration.
|
|
501
|
-
*/
|
|
502
300
|
export function resolveZkPassportConfig(overrides?: Record<string, any>): {
|
|
503
301
|
provider: string;
|
|
504
302
|
scope: string;
|
|
@@ -508,16 +306,8 @@ declare module '@neus/sdk' {
|
|
|
508
306
|
[key: string]: any;
|
|
509
307
|
};
|
|
510
308
|
|
|
511
|
-
/**
|
|
512
|
-
* Convert a UTF-8 message string to a 0x-prefixed hex payload.
|
|
513
|
-
*/
|
|
514
309
|
export function toHexUtf8(message: string): string;
|
|
515
310
|
|
|
516
|
-
/**
|
|
517
|
-
* Sign a message with an injected/provider wallet.
|
|
518
|
-
* Uses `personal_sign` and retries with UTF-8 hex payloads when providers
|
|
519
|
-
* report encoding/non-hex input issues (common with some embedded wallets).
|
|
520
|
-
*/
|
|
521
311
|
export function signMessage(params: {
|
|
522
312
|
provider?: any;
|
|
523
313
|
message: string;
|
|
@@ -525,14 +315,8 @@ declare module '@neus/sdk' {
|
|
|
525
315
|
chain?: string;
|
|
526
316
|
}): Promise<string>;
|
|
527
317
|
|
|
528
|
-
/**
|
|
529
|
-
* Validate a verifier payload for basic structural integrity
|
|
530
|
-
*/
|
|
531
318
|
export function validateVerifierPayload(verifierId: string, data: any): ValidationResult;
|
|
532
319
|
|
|
533
|
-
/**
|
|
534
|
-
* Build a standard verification request and signing message
|
|
535
|
-
*/
|
|
536
320
|
export function buildVerificationRequest(params: {
|
|
537
321
|
verifierIds: string[];
|
|
538
322
|
data: any;
|
|
@@ -543,24 +327,12 @@ declare module '@neus/sdk' {
|
|
|
543
327
|
signedTimestamp?: number;
|
|
544
328
|
}): { message: string; request: { verifierIds: string[]; data: any; walletAddress: string; signedTimestamp: number; chainId?: number; chain?: string; options?: any } };
|
|
545
329
|
|
|
546
|
-
/**
|
|
547
|
-
* Check if status is terminal (complete)
|
|
548
|
-
*/
|
|
549
330
|
export function isTerminalStatus(status: VerificationStatus): boolean;
|
|
550
331
|
|
|
551
|
-
/**
|
|
552
|
-
* Check if status indicates success
|
|
553
|
-
*/
|
|
554
332
|
export function isSuccessStatus(status: VerificationStatus): boolean;
|
|
555
333
|
|
|
556
|
-
/**
|
|
557
|
-
* Check if status indicates failure
|
|
558
|
-
*/
|
|
559
334
|
export function isFailureStatus(status: VerificationStatus): boolean;
|
|
560
335
|
|
|
561
|
-
/**
|
|
562
|
-
* Format status for display
|
|
563
|
-
*/
|
|
564
336
|
export function formatVerificationStatus(status: VerificationStatus): {
|
|
565
337
|
label: string;
|
|
566
338
|
description: string;
|
|
@@ -568,32 +340,17 @@ declare module '@neus/sdk' {
|
|
|
568
340
|
category: string;
|
|
569
341
|
};
|
|
570
342
|
|
|
571
|
-
/**
|
|
572
|
-
* Status polling utility
|
|
573
|
-
*/
|
|
574
343
|
export class StatusPoller {
|
|
575
344
|
constructor(client: NeusClient, proofId: string, options?: { interval?: number; maxAttempts?: number; exponentialBackoff?: boolean; maxInterval?: number });
|
|
576
345
|
poll(): Promise<StatusResult>;
|
|
577
346
|
}
|
|
578
347
|
|
|
579
|
-
/**
|
|
580
|
-
* Format timestamp to human readable string
|
|
581
|
-
*/
|
|
582
348
|
export function formatTimestamp(timestamp: number): string;
|
|
583
349
|
|
|
584
|
-
/**
|
|
585
|
-
* Check if chain ID is supported for cross-chain propagation
|
|
586
|
-
*/
|
|
587
350
|
export function isSupportedChain(chainId: number): boolean;
|
|
588
351
|
|
|
589
|
-
/**
|
|
590
|
-
* Create a delay/sleep function
|
|
591
|
-
*/
|
|
592
352
|
export function delay(ms: number): Promise<void>;
|
|
593
353
|
|
|
594
|
-
/**
|
|
595
|
-
* Retry utility with exponential backoff
|
|
596
|
-
*/
|
|
597
354
|
export function withRetry<T>(fn: () => Promise<T>, options?: {
|
|
598
355
|
maxAttempts?: number;
|
|
599
356
|
baseDelay?: number;
|
|
@@ -601,22 +358,12 @@ declare module '@neus/sdk' {
|
|
|
601
358
|
backoffFactor?: number;
|
|
602
359
|
}): Promise<T>;
|
|
603
360
|
|
|
604
|
-
|
|
605
|
-
// CONSTANTS & REGISTRY
|
|
606
|
-
// ============================================================================
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* Build `agent-delegation` maxSpend from a display decimal (e.g. USDC `"100.50"` with six decimal places).
|
|
610
|
-
* Returns a whole-number string in token base units (no decimal point) for the verifier API.
|
|
611
|
-
*/
|
|
361
|
+
|
|
612
362
|
export function toAgentDelegationMaxSpend(
|
|
613
363
|
humanAmount: string | number,
|
|
614
364
|
decimals: number
|
|
615
365
|
): string;
|
|
616
366
|
|
|
617
|
-
/**
|
|
618
|
-
* NEUS Network constants
|
|
619
|
-
*/
|
|
620
367
|
export const DEFAULT_HOSTED_VERIFY_URL: string;
|
|
621
368
|
|
|
622
369
|
export function getHostedCheckoutUrl(opts?: {
|
|
@@ -631,10 +378,6 @@ declare module '@neus/sdk' {
|
|
|
631
378
|
baseUrl?: string;
|
|
632
379
|
}): string;
|
|
633
380
|
|
|
634
|
-
/**
|
|
635
|
-
* Public gate monetization.charge from GET /api/v1/profile/gates/{gateId} (sanitized).
|
|
636
|
-
* Safe for clients: no payout secrets; `recipient` is the published settlement address when enabled.
|
|
637
|
-
*/
|
|
638
381
|
export type NeusPublicGateCharge = {
|
|
639
382
|
enabled: boolean;
|
|
640
383
|
scheme: string;
|
|
@@ -656,81 +399,44 @@ declare module '@neus/sdk' {
|
|
|
656
399
|
DEFAULT_VERIFIERS: VerifierId[];
|
|
657
400
|
};
|
|
658
401
|
|
|
659
|
-
// ============================================================================
|
|
660
|
-
// ERROR CLASSES
|
|
661
|
-
// ============================================================================
|
|
662
402
|
|
|
663
|
-
/**
|
|
664
|
-
* Base SDK error class
|
|
665
|
-
*/
|
|
666
403
|
export class SDKError extends Error {
|
|
667
404
|
code: string;
|
|
668
405
|
details: any;
|
|
669
406
|
}
|
|
670
407
|
|
|
671
|
-
/**
|
|
672
|
-
* API error class
|
|
673
|
-
*/
|
|
674
408
|
export class ApiError extends SDKError {
|
|
675
409
|
statusCode: number;
|
|
676
410
|
response: any;
|
|
677
411
|
}
|
|
678
412
|
|
|
679
|
-
/**
|
|
680
|
-
* Validation error class
|
|
681
|
-
*/
|
|
682
413
|
export class ValidationError extends SDKError {
|
|
683
414
|
field?: string;
|
|
684
415
|
value?: any;
|
|
685
416
|
}
|
|
686
417
|
|
|
687
|
-
/**
|
|
688
|
-
* Network error class
|
|
689
|
-
*/
|
|
690
418
|
export class NetworkError extends SDKError {
|
|
691
419
|
originalError?: Error;
|
|
692
420
|
}
|
|
693
421
|
|
|
694
|
-
/**
|
|
695
|
-
* Configuration error class
|
|
696
|
-
*/
|
|
697
422
|
export class ConfigurationError extends SDKError {
|
|
698
423
|
configKey?: string;
|
|
699
424
|
}
|
|
700
425
|
|
|
701
|
-
/**
|
|
702
|
-
* Verification error class
|
|
703
|
-
*/
|
|
704
426
|
export class VerificationError extends SDKError {
|
|
705
427
|
verifierId?: string;
|
|
706
428
|
}
|
|
707
429
|
|
|
708
|
-
/**
|
|
709
|
-
* Authentication error class
|
|
710
|
-
*/
|
|
711
430
|
export class AuthenticationError extends SDKError {}
|
|
712
431
|
|
|
713
|
-
// ============================================================================
|
|
714
|
-
// PROOFS & GATING TYPES
|
|
715
|
-
// ============================================================================
|
|
716
432
|
|
|
717
|
-
/**
|
|
718
|
-
* Options for getProofsByWallet
|
|
719
|
-
*/
|
|
720
433
|
export interface GetProofsOptions {
|
|
721
|
-
/** Limit results */
|
|
722
434
|
limit?: number;
|
|
723
|
-
/** Offset for pagination */
|
|
724
435
|
offset?: number;
|
|
725
|
-
/** CAIP-2 signer chain for owner-signed private access (non-EVM) */
|
|
726
436
|
chain?: string;
|
|
727
|
-
/** Signature method hint for owner-signed private access (eip191, ed25519, ...) */
|
|
728
437
|
signatureMethod?: string;
|
|
729
438
|
}
|
|
730
439
|
|
|
731
|
-
/**
|
|
732
|
-
* Result from getProofsByWallet
|
|
733
|
-
*/
|
|
734
440
|
export interface ProofsResult {
|
|
735
441
|
success: boolean;
|
|
736
442
|
proofs: any[];
|
|
@@ -739,81 +445,42 @@ declare module '@neus/sdk' {
|
|
|
739
445
|
nextOffset?: number | null;
|
|
740
446
|
}
|
|
741
447
|
|
|
742
|
-
/**
|
|
743
|
-
* Single gate requirement
|
|
744
|
-
*/
|
|
745
448
|
export interface GateRequirement {
|
|
746
|
-
/** Verifier ID */
|
|
747
449
|
verifierId: CoreVerifierId;
|
|
748
|
-
/** Maximum age for proof (ms) - if set, proof older than this is expired */
|
|
749
450
|
maxAgeMs?: number;
|
|
750
|
-
/** Is this requirement optional? */
|
|
751
451
|
optional?: boolean;
|
|
752
|
-
/** Minimum count of proofs with this verifier (default: 1) */
|
|
753
452
|
minCount?: number;
|
|
754
|
-
/** Verifier-specific match criteria */
|
|
755
453
|
match?: Record<string, any>;
|
|
756
454
|
}
|
|
757
455
|
|
|
758
|
-
/**
|
|
759
|
-
* Parameters for checkGate
|
|
760
|
-
*/
|
|
761
456
|
export interface CheckGateParams {
|
|
762
|
-
/** Wallet address to check */
|
|
763
457
|
walletAddress: string;
|
|
764
|
-
/** Gate requirements */
|
|
765
458
|
requirements: GateRequirement[];
|
|
766
|
-
/** Pre-fetched proofs (skip API call) */
|
|
767
459
|
proofs?: any[];
|
|
768
460
|
}
|
|
769
461
|
|
|
770
|
-
/**
|
|
771
|
-
* Result from checkGate
|
|
772
|
-
*/
|
|
773
462
|
export interface CheckGateResult {
|
|
774
|
-
/** All requirements satisfied? */
|
|
775
463
|
satisfied: boolean;
|
|
776
|
-
/** Requirements not met (missing or expired) */
|
|
777
464
|
missing: GateRequirement[];
|
|
778
|
-
/** Existing proofs keyed by verifierId */
|
|
779
465
|
existing: Record<string, any>;
|
|
780
|
-
/** All proofs evaluated */
|
|
781
466
|
allProofs: any[];
|
|
782
467
|
}
|
|
783
468
|
|
|
784
|
-
/**
|
|
785
|
-
* Parameters for gateCheck() (API-backed).
|
|
786
|
-
* Mirrors `GET /api/v1/proofs/check` query parameters.
|
|
787
|
-
*/
|
|
788
469
|
export interface GateCheckApiParams {
|
|
789
|
-
/** Wallet identity to check (EVM/Solana/NEAR) */
|
|
790
470
|
address: string;
|
|
791
|
-
/** Verifier IDs to match (array or comma-separated string) */
|
|
792
471
|
verifierIds?: string[] | string;
|
|
793
|
-
/** Require all verifierIds to be present on a single proof */
|
|
794
472
|
requireAll?: boolean;
|
|
795
|
-
/** Minimum number of matching proofs (default: 1) */
|
|
796
473
|
minCount?: number;
|
|
797
|
-
/** Optional time window in days */
|
|
798
474
|
sinceDays?: number;
|
|
799
|
-
/** Optional unix timestamp in milliseconds (lower bound) */
|
|
800
475
|
since?: number;
|
|
801
|
-
/** Max rows to scan (server may clamp) */
|
|
802
476
|
limit?: number;
|
|
803
|
-
/** Include private proofs for owner/controller-authorized checks */
|
|
804
477
|
includePrivate?: boolean;
|
|
805
|
-
/** Include matched qHashes in response (minimal identifiers only) */
|
|
806
478
|
includeQHashes?: boolean;
|
|
807
|
-
/** Optional wallet/provider used to sign includePrivate owner checks */
|
|
808
479
|
wallet?: WalletLike;
|
|
809
|
-
/** CAIP-2 signer chain for universal owner signatures (e.g. solana:mainnet) */
|
|
810
480
|
chain?: string;
|
|
811
|
-
/** Signature method hint for universal owner signatures (eip191, ed25519, ...) */
|
|
812
481
|
signatureMethod?: string;
|
|
813
|
-
/** Optional pre-signed owner auth payload to reuse across multiple gateCheck calls */
|
|
814
482
|
privateAuth?: GatePrivateAuth;
|
|
815
483
|
|
|
816
|
-
// Common match filters
|
|
817
484
|
referenceType?: string;
|
|
818
485
|
referenceId?: string;
|
|
819
486
|
tag?: string;
|
|
@@ -822,20 +489,14 @@ declare module '@neus/sdk' {
|
|
|
822
489
|
content?: string;
|
|
823
490
|
contentHash?: string;
|
|
824
491
|
|
|
825
|
-
// Asset/ownership filters — chainId here is the chain where the asset lives (e.g. 8453 for Base, 1 for Ethereum)
|
|
826
492
|
contractAddress?: string;
|
|
827
493
|
tokenId?: string;
|
|
828
|
-
/** EVM chain ID of the asset (e.g. 1, 8453). Required for nft-ownership, token-holding, contract-ownership. */
|
|
829
494
|
chainId?: number;
|
|
830
495
|
domain?: string;
|
|
831
496
|
minBalance?: string;
|
|
832
497
|
|
|
833
|
-
// Wallet filters
|
|
834
|
-
/** Risk assessment provider hint. Known value: webacy. */
|
|
835
498
|
provider?: string;
|
|
836
|
-
/** Social handle (ownership-social) or pseudonym handle (ownership-pseudonym); server matches data.handle / pseudonymId */
|
|
837
499
|
handle?: string;
|
|
838
|
-
/** ownership-pseudonym namespace filter (matches GET /api/v1/proofs/check `namespace` query) */
|
|
839
500
|
namespace?: string;
|
|
840
501
|
ownerAddress?: string;
|
|
841
502
|
riskLevel?: string;
|
|
@@ -860,7 +521,6 @@ declare module '@neus/sdk' {
|
|
|
860
521
|
eligible: boolean;
|
|
861
522
|
matchedCount?: number;
|
|
862
523
|
matchedQHashes?: string[];
|
|
863
|
-
/** @deprecated matchedProofIds is a compatibility alias of matchedQHashes (same values when provided). */
|
|
864
524
|
matchedProofIds?: string[];
|
|
865
525
|
matchedTags?: string[];
|
|
866
526
|
projections?: Array<Record<string, any>> | null;
|
|
@@ -878,61 +538,32 @@ declare module '@neus/sdk' {
|
|
|
878
538
|
timestamp?: number;
|
|
879
539
|
}
|
|
880
540
|
|
|
881
|
-
// ============================================================================
|
|
882
|
-
// GATE RECIPE EXPORTS (Examples, NOT defaults)
|
|
883
|
-
// ============================================================================
|
|
884
541
|
|
|
885
|
-
/** Time constant: 1 hour in milliseconds */
|
|
886
542
|
export const HOUR: number;
|
|
887
|
-
/** Time constant: 1 day in milliseconds */
|
|
888
543
|
export const DAY: number;
|
|
889
|
-
/** Time constant: 1 week in milliseconds */
|
|
890
544
|
export const WEEK: number;
|
|
891
|
-
/** Time constant: 1 month (30 days) in milliseconds */
|
|
892
545
|
export const MONTH: number;
|
|
893
|
-
/** Time constant: 1 year (365 days) in milliseconds */
|
|
894
546
|
export const YEAR: number;
|
|
895
547
|
|
|
896
|
-
/** NFT holder gate (add match.contractAddress when using) */
|
|
897
548
|
export const GATE_NFT_HOLDER: GateRequirement[];
|
|
898
|
-
/** Token holder gate (add match.contractAddress, minBalance when using) */
|
|
899
549
|
export const GATE_TOKEN_HOLDER: GateRequirement[];
|
|
900
|
-
/** Contract admin gate: requires recent contract ownership (1h TTL) */
|
|
901
550
|
export const GATE_CONTRACT_ADMIN: GateRequirement[];
|
|
902
|
-
/** Domain owner gate: requires DNS TXT verification */
|
|
903
551
|
export const GATE_DOMAIN_OWNER: GateRequirement[];
|
|
904
|
-
/** Linked wallets gate: requires wallet linking */
|
|
905
552
|
export const GATE_LINKED_WALLETS: GateRequirement[];
|
|
906
|
-
/** Agent identity gate: requires verified agent identity */
|
|
907
553
|
export const GATE_AGENT_IDENTITY: GateRequirement[];
|
|
908
|
-
/** Agent delegation gate: requires delegation proof (7-day TTL) */
|
|
909
554
|
export const GATE_AGENT_DELEGATION: GateRequirement[];
|
|
910
|
-
/** Content moderation gate: requires recent moderation proof */
|
|
911
555
|
export const GATE_CONTENT_MODERATION: GateRequirement[];
|
|
912
|
-
/** Wallet risk gate: provider-backed risk signal */
|
|
913
556
|
export const GATE_WALLET_RISK: GateRequirement[];
|
|
914
|
-
/** Pseudonym gate: requires pseudonymous identity proof */
|
|
915
557
|
export const GATE_PSEUDONYM: GateRequirement[];
|
|
916
558
|
|
|
917
|
-
/**
|
|
918
|
-
* Create a custom gate from verifier IDs or requirement objects
|
|
919
|
-
* @param requirements - Array of verifier IDs or requirement objects
|
|
920
|
-
*/
|
|
921
559
|
export function createGate(
|
|
922
560
|
requirements: Array<CoreVerifierId | GateRequirement>
|
|
923
561
|
): GateRequirement[];
|
|
924
562
|
|
|
925
|
-
/**
|
|
926
|
-
* Combine multiple gates (union of requirements)
|
|
927
|
-
* @param gates - Gate arrays to combine
|
|
928
|
-
*/
|
|
929
563
|
export function combineGates(
|
|
930
564
|
...gates: GateRequirement[][]
|
|
931
565
|
): GateRequirement[];
|
|
932
566
|
|
|
933
|
-
// ============================================================================
|
|
934
|
-
// SUPPORTING TYPES
|
|
935
|
-
// ============================================================================
|
|
936
567
|
|
|
937
568
|
type OwnershipBasicData = {
|
|
938
569
|
owner: string;
|
|
@@ -1016,7 +647,6 @@ declare module '@neus/sdk' {
|
|
|
1016
647
|
};
|
|
1017
648
|
|
|
1018
649
|
type WalletRiskData = {
|
|
1019
|
-
/** Risk assessment provider hint. Known value: webacy. */
|
|
1020
650
|
provider?: string;
|
|
1021
651
|
walletAddress?: string;
|
|
1022
652
|
chainId?: number;
|
|
@@ -1075,7 +705,6 @@ declare module '@neus/sdk' {
|
|
|
1075
705
|
agentId?: string;
|
|
1076
706
|
scope?: string;
|
|
1077
707
|
permissions?: any[];
|
|
1078
|
-
/** Whole-number string, token base units (1–78 digits, no decimal point). Build via `toAgentDelegationMaxSpend`. */
|
|
1079
708
|
maxSpend?: string;
|
|
1080
709
|
allowedPaymentTypes?: string[];
|
|
1081
710
|
receiptDisclosure?: 'none' | 'summary' | 'full';
|
|
@@ -1106,39 +735,27 @@ declare module '@neus/sdk' {
|
|
|
1106
735
|
|
|
1107
736
|
|
|
1108
737
|
interface VerifyOptions {
|
|
1109
|
-
/** Target chain IDs for cross-chain propagation (testnet chains for proof storage) */
|
|
1110
738
|
targetChains?: number[];
|
|
1111
|
-
/** Store sanitized snapshot on IPFS */
|
|
1112
739
|
enableIpfs?: boolean;
|
|
1113
|
-
/** Privacy level for public exposure and IPFS snapshots */
|
|
1114
740
|
privacyLevel?: 'private' | 'public';
|
|
1115
|
-
/** Allow public display contexts (UI showcases) */
|
|
1116
741
|
publicDisplay?: boolean;
|
|
1117
|
-
/** Include full original content in IPFS snapshot (only when privacy is public) */
|
|
1118
742
|
storeOriginalContent?: boolean;
|
|
1119
|
-
/** Metadata for public presentation, attribution, and discovery */
|
|
1120
743
|
meta?: {
|
|
1121
|
-
// Core display
|
|
1122
744
|
title?: string;
|
|
1123
745
|
description?: string;
|
|
1124
746
|
displayName?: string;
|
|
1125
747
|
contentText?: string;
|
|
1126
|
-
// Content metadata
|
|
1127
748
|
contentType?: string;
|
|
1128
749
|
contentDescription?: string;
|
|
1129
|
-
// Legal & licensing
|
|
1130
750
|
license?: string;
|
|
1131
751
|
publicContentLicense?: string;
|
|
1132
752
|
publicContentDisclaimer?: string;
|
|
1133
753
|
legal?: string;
|
|
1134
|
-
// Attribution & campaigns
|
|
1135
754
|
source?: string;
|
|
1136
755
|
campaign?: string;
|
|
1137
|
-
// Categorization
|
|
1138
756
|
tags?: string[];
|
|
1139
757
|
category?: string;
|
|
1140
758
|
};
|
|
1141
|
-
/** Reference to external content or file */
|
|
1142
759
|
reference?: {
|
|
1143
760
|
type:
|
|
1144
761
|
| 'ipfs'
|
|
@@ -1155,7 +772,6 @@ declare module '@neus/sdk' {
|
|
|
1155
772
|
| 'media'
|
|
1156
773
|
| 'username-claim'
|
|
1157
774
|
| 'other';
|
|
1158
|
-
/** Optional reference identifier (required only for reference-only proofs). */
|
|
1159
775
|
id?: string;
|
|
1160
776
|
title?: string;
|
|
1161
777
|
description?: string;
|
|
@@ -1163,9 +779,7 @@ declare module '@neus/sdk' {
|
|
|
1163
779
|
name?: string;
|
|
1164
780
|
size?: number;
|
|
1165
781
|
};
|
|
1166
|
-
/** Verifier-specific overrides */
|
|
1167
782
|
verifierOptions?: Record<string, any>;
|
|
1168
|
-
/** Optional user-presentable identity overrides */
|
|
1169
783
|
identity?: { pseudonym?: string; socials?: Record<string, string> };
|
|
1170
784
|
}
|
|
1171
785
|
|
|
@@ -1174,15 +788,11 @@ declare module '@neus/sdk' {
|
|
|
1174
788
|
|
|
1175
789
|
declare module '@neus/sdk/widgets' {
|
|
1176
790
|
export interface VerifyGateProps {
|
|
1177
|
-
/** Array of verifier IDs required for access */
|
|
1178
791
|
requiredVerifiers?: string[];
|
|
1179
|
-
/** Callback when verification completes successfully */
|
|
1180
792
|
onVerified?: (result: {
|
|
1181
793
|
proofId: string;
|
|
1182
|
-
/** HTTP wire field for the proof receipt ID. */
|
|
1183
794
|
qHash: string;
|
|
1184
795
|
proofIds?: string[];
|
|
1185
|
-
/** HTTP wire fields for proof receipt IDs. */
|
|
1186
796
|
qHashes?: string[];
|
|
1187
797
|
address?: string;
|
|
1188
798
|
txHash?: string | null;
|
|
@@ -1196,7 +806,6 @@ declare module '@neus/sdk/widgets' {
|
|
|
1196
806
|
results?: Array<{
|
|
1197
807
|
verifierId: string;
|
|
1198
808
|
proofId: string;
|
|
1199
|
-
/** HTTP wire field for the proof receipt ID. */
|
|
1200
809
|
qHash: string;
|
|
1201
810
|
address?: string;
|
|
1202
811
|
txHash?: string | null;
|
|
@@ -1205,86 +814,48 @@ declare module '@neus/sdk/widgets' {
|
|
|
1205
814
|
}>;
|
|
1206
815
|
proofsByVerifierId?: Record<string, any>;
|
|
1207
816
|
}) => void;
|
|
1208
|
-
/** Custom API endpoint URL */
|
|
1209
817
|
apiUrl?: string;
|
|
1210
|
-
/** Optional public app attribution ID (maps to X-Neus-App) */
|
|
1211
818
|
appId?: string;
|
|
1212
|
-
/** Optional x402 receipt token for retry calls (maps to PAYMENT-SIGNATURE) */
|
|
1213
819
|
paymentSignature?: string;
|
|
1214
|
-
/** Optional extra passthrough headers for advanced integrations */
|
|
1215
820
|
extraHeaders?: Record<string, string>;
|
|
1216
|
-
/** Hosted checkout URL for interactive verifiers (default: https://neus.network/verify) */
|
|
1217
821
|
hostedCheckoutUrl?: string;
|
|
1218
|
-
/** Optional OAuth provider id to pre-select for social/org verifiers (hosted flow) */
|
|
1219
822
|
oauthProvider?: string;
|
|
1220
|
-
/** Custom inline styles */
|
|
1221
823
|
style?: Record<string, any>;
|
|
1222
|
-
/** Child content to show when verified */
|
|
1223
824
|
children?: any;
|
|
1224
|
-
/** Verifier-specific options */
|
|
1225
825
|
verifierOptions?: Record<string, any>;
|
|
1226
|
-
/** Pre-built verifier data for each verifier */
|
|
1227
826
|
verifierData?: Record<string, any>;
|
|
1228
|
-
/** Proof creation options (defaults: private, publicDisplay false, storeOriginalContent true) */
|
|
1229
827
|
proofOptions?: Record<string, any>;
|
|
1230
|
-
/** Proof reuse strategy */
|
|
1231
828
|
strategy?: 'reuse-or-create' | 'reuse' | 'fresh';
|
|
1232
|
-
/** Check for existing proofs before verification */
|
|
1233
829
|
checkExisting?: boolean;
|
|
1234
|
-
/** Optional max age override (ms) for proof reuse */
|
|
1235
830
|
maxProofAgeMs?: number;
|
|
1236
|
-
/** Allow owner-signed lookups for private proof reuse */
|
|
1237
831
|
allowPrivateReuse?: boolean;
|
|
1238
|
-
/** Show NEUS branding */
|
|
1239
832
|
showBrand?: boolean;
|
|
1240
|
-
/** Disable interaction */
|
|
1241
833
|
disabled?: boolean;
|
|
1242
|
-
/** Custom button text */
|
|
1243
834
|
buttonText?: string;
|
|
1244
|
-
/** Mode: 'create' for new verification, 'access' for private proof access */
|
|
1245
835
|
mode?: 'create' | 'access';
|
|
1246
|
-
/** proofId for private proof access (required when mode='access') */
|
|
1247
836
|
proofId?: string | null;
|
|
1248
|
-
/** HTTP wire field for callers that receive API-shaped proof records. */
|
|
1249
837
|
qHash?: string | null;
|
|
1250
|
-
/** Optional injected wallet/provider for signing flows */
|
|
1251
838
|
wallet?: WalletLike | any;
|
|
1252
|
-
/** Optional CAIP-2 chain context for non-EVM owner signatures */
|
|
1253
839
|
chain?: string;
|
|
1254
|
-
/** Optional signature method hint for non-EVM owner signatures */
|
|
1255
840
|
signatureMethod?: string;
|
|
1256
|
-
/** Callback for state changes */
|
|
1257
841
|
onStateChange?: (state: string) => void;
|
|
1258
|
-
/** Callback for errors */
|
|
1259
842
|
onError?: (error: Error) => void;
|
|
1260
843
|
}
|
|
1261
844
|
|
|
1262
845
|
export function VerifyGate(props: VerifyGateProps): any;
|
|
1263
846
|
|
|
1264
847
|
export interface ProofBadgeProps {
|
|
1265
|
-
/** Proof receipt ID. */
|
|
1266
848
|
proofId?: string;
|
|
1267
|
-
/** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
|
|
1268
849
|
qHash?: string;
|
|
1269
|
-
/** URL path pattern for proof links. Supports :proofId. */
|
|
1270
850
|
proofUrlPattern?: string;
|
|
1271
|
-
/** Badge size */
|
|
1272
851
|
size?: 'sm' | 'md';
|
|
1273
|
-
/** UI platform base URL */
|
|
1274
852
|
uiLinkBase?: string;
|
|
1275
|
-
/** API base URL for status fetching */
|
|
1276
853
|
apiUrl?: string;
|
|
1277
|
-
/** Optional proof object to skip API fetch */
|
|
1278
854
|
proof?: any;
|
|
1279
|
-
/** Show chain count */
|
|
1280
855
|
showChains?: boolean;
|
|
1281
|
-
/** Show status label (default: true) */
|
|
1282
856
|
showLabel?: boolean;
|
|
1283
|
-
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1284
857
|
logoUrl?: string;
|
|
1285
|
-
/** Custom click handler */
|
|
1286
858
|
onClick?: (data: { proofId: string; qHash: string; status: string; chainCount?: number }) => void;
|
|
1287
|
-
/** Additional CSS class */
|
|
1288
859
|
className?: string;
|
|
1289
860
|
}
|
|
1290
861
|
|
|
@@ -1292,16 +863,12 @@ declare module '@neus/sdk/widgets' {
|
|
|
1292
863
|
|
|
1293
864
|
export interface SimpleProofBadgeProps {
|
|
1294
865
|
proofId?: string;
|
|
1295
|
-
/** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
|
|
1296
866
|
qHash?: string;
|
|
1297
|
-
/** URL path pattern for proof links. Supports :proofId. */
|
|
1298
867
|
proofUrlPattern?: string;
|
|
1299
868
|
uiLinkBase?: string;
|
|
1300
869
|
apiUrl?: string;
|
|
1301
870
|
size?: 'sm' | 'md';
|
|
1302
|
-
/** Label text (default: 'Verified') */
|
|
1303
871
|
label?: string;
|
|
1304
|
-
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1305
872
|
logoUrl?: string;
|
|
1306
873
|
proof?: any;
|
|
1307
874
|
onClick?: (data: { proofId: string; qHash: string; status: string }) => void;
|
|
@@ -1312,14 +879,11 @@ declare module '@neus/sdk/widgets' {
|
|
|
1312
879
|
|
|
1313
880
|
export interface NeusPillLinkProps {
|
|
1314
881
|
proofId?: string;
|
|
1315
|
-
/** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
|
|
1316
882
|
qHash?: string;
|
|
1317
|
-
/** URL path pattern for proof links. Supports :proofId. */
|
|
1318
883
|
proofUrlPattern?: string;
|
|
1319
884
|
uiLinkBase?: string;
|
|
1320
885
|
label?: string;
|
|
1321
886
|
size?: 'sm' | 'md';
|
|
1322
|
-
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1323
887
|
logoUrl?: string;
|
|
1324
888
|
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
1325
889
|
className?: string;
|
|
@@ -1328,23 +892,14 @@ declare module '@neus/sdk/widgets' {
|
|
|
1328
892
|
export function NeusPillLink(props: NeusPillLinkProps): any;
|
|
1329
893
|
|
|
1330
894
|
export interface VerifiedIconProps {
|
|
1331
|
-
/** Proof receipt ID for link */
|
|
1332
895
|
proofId?: string;
|
|
1333
|
-
/** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
|
|
1334
896
|
qHash?: string;
|
|
1335
|
-
/** URL path pattern for proof links. Supports :proofId. */
|
|
1336
897
|
proofUrlPattern?: string;
|
|
1337
|
-
/** UI platform base URL */
|
|
1338
898
|
uiLinkBase?: string;
|
|
1339
|
-
/** Icon size in pixels */
|
|
1340
899
|
size?: number;
|
|
1341
|
-
/** Logo URL override (defaults to bundled NEUS logo) */
|
|
1342
900
|
logoUrl?: string;
|
|
1343
|
-
/** Tooltip text */
|
|
1344
901
|
tooltip?: string;
|
|
1345
|
-
/** Custom click handler */
|
|
1346
902
|
onClick?: (data: { proofId?: string; qHash?: string }) => void;
|
|
1347
|
-
/** Additional CSS class */
|
|
1348
903
|
className?: string;
|
|
1349
904
|
}
|
|
1350
905
|
|