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