@neus/sdk 1.0.3 → 1.0.4

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/types.d.ts CHANGED
@@ -31,18 +31,17 @@ declare module '@neus/sdk' {
31
31
  verify(params: VerifyParams): Promise<VerificationResult>;
32
32
 
33
33
  /**
34
- * Get verification status by proof ID
35
- * @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
36
- * @returns Promise resolving to current status
34
+ * Get proof record by receipt ID.
35
+ * @param proofId - Proof receipt ID (0x + 64 hex).
37
36
  */
38
- getStatus(proofId: string): Promise<StatusResult>;
37
+ getProof(proofId: string): Promise<StatusResult>;
39
38
 
40
39
  /**
41
- * Get private proof status (owner-signed)
42
- * @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
40
+ * Get private proof record (owner-signed)
41
+ * @param proofId - Proof receipt ID.
43
42
  * @param wallet - Optional injected wallet/provider (MetaMask/ethers Wallet)
44
43
  */
45
- getPrivateStatus(proofId: string, wallet?: WalletLike | GatePrivateAuth): Promise<StatusResult>;
44
+ getPrivateProof(proofId: string, wallet?: WalletLike | GatePrivateAuth): Promise<StatusResult>;
46
45
 
47
46
  /**
48
47
  * Check API health
@@ -52,10 +51,13 @@ declare module '@neus/sdk' {
52
51
 
53
52
  /** List available verifiers */
54
53
  getVerifiers(): Promise<string[]>;
54
+
55
+ /** Get the public verifier catalog, including per-verifier capabilities. */
56
+ getVerifierCatalog(): Promise<VerifierCatalog>;
55
57
 
56
58
  /**
57
59
  * Poll verification status until completion
58
- * @param proofId - Proof ID (standard). `qHash` is a deprecated alias (same value).
60
+ * @param proofId - Proof ID to poll.
59
61
  * @param options - Polling configuration options
60
62
  * @returns Promise resolving to final status
61
63
  * @example
@@ -90,7 +92,7 @@ declare module '@neus/sdk' {
90
92
  getPrivateProofsByWallet(walletAddress: string, options?: GetProofsOptions, wallet?: WalletLike): Promise<ProofsResult>;
91
93
 
92
94
  /**
93
- * Minimal eligibility check against public + discoverable proofs only (API-backed).
95
+ * Minimal eligibility check against public + unlisted proofs by default (API-backed).
94
96
  * Prefer this for server-side integrations that do not need full proof payloads.
95
97
  */
96
98
  gateCheck(params: GateCheckApiParams): Promise<GateCheckApiResponse>;
@@ -139,15 +141,13 @@ declare module '@neus/sdk' {
139
141
  apiKey?: string;
140
142
  /** Optional public app attribution ID (maps to X-Neus-App) */
141
143
  appId?: string;
142
- /** Optional sponsor capability token (maps to X-Sponsor-Grant) */
143
- sponsorGrant?: string;
144
144
  /** Optional x402 receipt token for retry calls (maps to PAYMENT-SIGNATURE) */
145
145
  paymentSignature?: string;
146
146
  /** Optional extra passthrough headers for advanced integrations */
147
147
  extraHeaders?: Record<string, string>;
148
148
  /** Request timeout in milliseconds */
149
149
  timeout?: number;
150
- /** Optional chain override used by some app integrations */
150
+ /** Advanced. NEUS protocol primary-chain id override; most integrators omit. */
151
151
  hubChainId?: number;
152
152
  /** Enable SDK logging */
153
153
  enableLogging?: boolean;
@@ -172,6 +172,24 @@ declare module '@neus/sdk' {
172
172
  /** Verifier-specific options */
173
173
  verifierOptions?: Record<string, any>;
174
174
  }
175
+
176
+ export interface VerifierCatalogMetadataEntry {
177
+ category?: string;
178
+ description?: string;
179
+ flowType?: 'instant' | 'interactive' | 'external_lookup' | string;
180
+ expiryType?: 'permanent' | 'point_in_time' | 'expiring' | string;
181
+ supportsDirectApi?: boolean;
182
+ supportsHostedVerify?: boolean;
183
+ dataSchema?: Record<string, any>;
184
+ requiredFields?: string[];
185
+ optionalFields?: string[];
186
+ }
187
+
188
+ export interface VerifierCatalog {
189
+ data: string[];
190
+ metadata: Record<string, VerifierCatalogMetadataEntry>;
191
+ meta?: Record<string, any>;
192
+ }
175
193
 
176
194
  /**
177
195
  * Parameters for manual verification
@@ -194,7 +212,7 @@ declare module '@neus/sdk' {
194
212
  signature?: string;
195
213
  /** Advanced/manual path: signed timestamp */
196
214
  signedTimestamp?: number;
197
- /** Advanced/manual path: chain ID for verification context; optional, managed by protocol */
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. */
198
216
  chainId?: number;
199
217
  /** CAIP-2 chain reference for universal mode (e.g. eip155:1, solana:mainnet) */
200
218
  chain?: string;
@@ -208,16 +226,16 @@ declare module '@neus/sdk' {
208
226
  * Result from proof creation
209
227
  */
210
228
  export interface ProofResult {
211
- /** Proof ID (standard) */
229
+ /** Proof receipt ID */
212
230
  proofId: string;
213
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
231
+ /** HTTP wire field for the proof receipt ID. */
214
232
  qHash: string;
215
233
  /** Current status */
216
234
  status: string;
217
235
  /** Wallet address that created proof */
218
236
  walletAddress?: string;
219
- /** Status check URL */
220
- statusUrl?: string;
237
+ /** Stable URL for GET proof record */
238
+ proofUrl?: string;
221
239
  /** Cross-chain enabled */
222
240
  crossChain?: boolean;
223
241
  }
@@ -226,9 +244,9 @@ declare module '@neus/sdk' {
226
244
  * Verification result
227
245
  */
228
246
  export interface VerificationResult {
229
- /** Proof ID (standard) */
247
+ /** Proof receipt ID */
230
248
  proofId: string;
231
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
249
+ /** HTTP wire field for the proof receipt ID. */
232
250
  qHash: string;
233
251
  /** Current status */
234
252
  status: VerificationStatus;
@@ -242,10 +260,12 @@ declare module '@neus/sdk' {
242
260
  * Status check result
243
261
  */
244
262
  export interface StatusResult {
245
- /** Proof ID (standard) */
263
+ /** Proof receipt ID */
246
264
  proofId?: string;
247
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
265
+ /** HTTP wire field for the proof receipt ID. */
248
266
  qHash?: string;
267
+ /** Stable URL for GET proof record */
268
+ proofUrl?: string | null;
249
269
  /** Whether verification succeeded */
250
270
  success: boolean;
251
271
  /** Current status */
@@ -253,7 +273,7 @@ declare module '@neus/sdk' {
253
273
  /** Full verification data */
254
274
  data?: {
255
275
  proofId?: string;
256
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
276
+ /** HTTP wire field for the proof receipt ID. */
257
277
  qHash?: string;
258
278
  status: string;
259
279
  walletAddress: string;
@@ -287,6 +307,7 @@ declare module '@neus/sdk' {
287
307
  }>;
288
308
  createdVouchers?: string[];
289
309
  };
310
+ /** Advanced. Primary-chain transaction metadata from the NEUS protocol. */
290
311
  hubTransaction?: {
291
312
  txHash: string;
292
313
  timestamp: number;
@@ -360,7 +381,7 @@ declare module '@neus/sdk' {
360
381
  | 'contract-ownership'
361
382
  | 'wallet-risk' // Wallet risk assessment
362
383
  | 'proof-of-human' // Hosted ZK personhood verification
363
- // AI & Agent verifiers (ERC-8004 aligned)
384
+ // AI & Agent verifiers (portable, protocol-agnostic)
364
385
  | 'agent-identity'
365
386
  | 'agent-delegation'
366
387
  | 'ai-content-moderation'
@@ -410,6 +431,9 @@ declare module '@neus/sdk' {
410
431
  chainId?: number;
411
432
  chain?: string;
412
433
  }): string;
434
+
435
+ /** CAIP-380 six-line signer message — line 1 */
436
+ export const PORTABLE_PROOF_SIGNER_HEADER: string;
413
437
 
414
438
  /**
415
439
  * Validate Ethereum wallet address
@@ -438,8 +462,8 @@ declare module '@neus/sdk' {
438
462
 
439
463
  /**
440
464
  * 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`).
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`).
443
467
  */
444
468
  export function resolveDID(
445
469
  params: {
@@ -577,19 +601,51 @@ declare module '@neus/sdk' {
577
601
  backoffFactor?: number;
578
602
  }): Promise<T>;
579
603
 
580
- /**
581
- * Proof status
582
- */
583
- // Use NeusClient.getStatus(proofId) for status checks (`qHash` remains as deprecated alias).
584
-
585
-
586
604
  // ============================================================================
587
605
  // CONSTANTS & REGISTRY
588
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
+ */
612
+ export function toAgentDelegationMaxSpend(
613
+ humanAmount: string | number,
614
+ decimals: number
615
+ ): string;
589
616
 
590
617
  /**
591
618
  * NEUS Network constants
592
619
  */
620
+ export const DEFAULT_HOSTED_VERIFY_URL: string;
621
+
622
+ export function getHostedCheckoutUrl(opts?: {
623
+ gateId?: string;
624
+ returnUrl?: string;
625
+ verifiers?: string[];
626
+ preset?: string;
627
+ mode?: string;
628
+ intent?: string;
629
+ origin?: string;
630
+ oauthProvider?: string;
631
+ baseUrl?: string;
632
+ }): string;
633
+
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
+ export type NeusPublicGateCharge = {
639
+ enabled: boolean;
640
+ scheme: string;
641
+ label: string;
642
+ amountUsd: number;
643
+ methods: string[];
644
+ appliesTo: string;
645
+ executionOrder?: string;
646
+ recipient?: string;
647
+ };
648
+
593
649
  export const NEUS_CONSTANTS: {
594
650
  HUB_CHAIN_ID: number;
595
651
  TESTNET_CHAINS: number[];
@@ -654,12 +710,6 @@ declare module '@neus/sdk' {
654
710
  */
655
711
  export class AuthenticationError extends SDKError {}
656
712
 
657
- // ============================================================================
658
- // SCHEMA ACCESS
659
- // ============================================================================
660
-
661
-
662
-
663
713
  // ============================================================================
664
714
  // PROOFS & GATING TYPES
665
715
  // ============================================================================
@@ -750,7 +800,7 @@ declare module '@neus/sdk' {
750
800
  since?: number;
751
801
  /** Max rows to scan (server may clamp) */
752
802
  limit?: number;
753
- /** Include private proofs for owner-authenticated checks */
803
+ /** Include private proofs for owner/controller-authorized checks */
754
804
  includePrivate?: boolean;
755
805
  /** Include matched qHashes in response (minimal identifiers only) */
756
806
  includeQHashes?: boolean;
@@ -772,9 +822,10 @@ declare module '@neus/sdk' {
772
822
  content?: string;
773
823
  contentHash?: string;
774
824
 
775
- // Asset/ownership filters
825
+ // Asset/ownership filters — chainId here is the chain where the asset lives (e.g. 8453 for Base, 1 for Ethereum)
776
826
  contractAddress?: string;
777
827
  tokenId?: string;
828
+ /** EVM chain ID of the asset (e.g. 1, 8453). Required for nft-ownership, token-holding, contract-ownership. */
778
829
  chainId?: number;
779
830
  domain?: string;
780
831
  minBalance?: string;
@@ -782,6 +833,10 @@ declare module '@neus/sdk' {
782
833
  // Wallet filters
783
834
  /** Risk assessment provider hint. Known value: webacy. */
784
835
  provider?: string;
836
+ /** Social handle (ownership-social) or pseudonym handle (ownership-pseudonym); server matches data.handle / pseudonymId */
837
+ handle?: string;
838
+ /** ownership-pseudonym namespace filter (matches GET /api/v1/proofs/check `namespace` query) */
839
+ namespace?: string;
785
840
  ownerAddress?: string;
786
841
  riskLevel?: string;
787
842
  sanctioned?: boolean;
@@ -805,7 +860,7 @@ declare module '@neus/sdk' {
805
860
  eligible: boolean;
806
861
  matchedCount?: number;
807
862
  matchedQHashes?: string[];
808
- /** @deprecated matchedProofIds is a legacy alias of matchedQHashes (same values when provided). */
863
+ /** @deprecated matchedProofIds is a compatibility alias of matchedQHashes (same values when provided). */
809
864
  matchedProofIds?: string[];
810
865
  matchedTags?: string[];
811
866
  projections?: Array<Record<string, any>> | null;
@@ -1004,6 +1059,13 @@ declare module '@neus/sdk' {
1004
1059
  agentType?: 'ai' | 'bot' | 'service' | 'automation' | 'agent';
1005
1060
  description?: string;
1006
1061
  capabilities?: any[];
1062
+ instructions?: string;
1063
+ skills?: string[];
1064
+ services?: Array<{
1065
+ name: string;
1066
+ endpoint: string;
1067
+ version?: string;
1068
+ }>;
1007
1069
  [key: string]: any;
1008
1070
  };
1009
1071
 
@@ -1013,10 +1075,13 @@ declare module '@neus/sdk' {
1013
1075
  agentId?: string;
1014
1076
  scope?: string;
1015
1077
  permissions?: any[];
1078
+ /** Whole-number string, token base units (1–78 digits, no decimal point). Build via `toAgentDelegationMaxSpend`. */
1016
1079
  maxSpend?: string;
1017
1080
  allowedPaymentTypes?: string[];
1018
1081
  receiptDisclosure?: 'none' | 'summary' | 'full';
1019
1082
  expiresAt?: number;
1083
+ instructions?: string;
1084
+ skills?: string[];
1020
1085
  [key: string]: any;
1021
1086
  };
1022
1087
 
@@ -1114,16 +1179,16 @@ declare module '@neus/sdk/widgets' {
1114
1179
  /** Callback when verification completes successfully */
1115
1180
  onVerified?: (result: {
1116
1181
  proofId: string;
1117
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
1182
+ /** HTTP wire field for the proof receipt ID. */
1118
1183
  qHash: string;
1119
1184
  proofIds?: string[];
1120
- /** @deprecated qHashes is a deprecated alias of proofIds (same values). */
1185
+ /** HTTP wire fields for proof receipt IDs. */
1121
1186
  qHashes?: string[];
1122
1187
  address?: string;
1123
1188
  txHash?: string | null;
1124
1189
  verifierIds: string[];
1125
1190
  verifiedVerifiers?: any[];
1126
- statusUrl?: string | null;
1191
+ proofUrl?: string | null;
1127
1192
  existing?: boolean;
1128
1193
  eligible?: boolean;
1129
1194
  mode?: 'create' | 'access';
@@ -1131,12 +1196,12 @@ declare module '@neus/sdk/widgets' {
1131
1196
  results?: Array<{
1132
1197
  verifierId: string;
1133
1198
  proofId: string;
1134
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
1199
+ /** HTTP wire field for the proof receipt ID. */
1135
1200
  qHash: string;
1136
1201
  address?: string;
1137
1202
  txHash?: string | null;
1138
1203
  verifiedVerifiers?: any[];
1139
- statusUrl?: string | null;
1204
+ proofUrl?: string | null;
1140
1205
  }>;
1141
1206
  proofsByVerifierId?: Record<string, any>;
1142
1207
  }) => void;
@@ -1144,14 +1209,14 @@ declare module '@neus/sdk/widgets' {
1144
1209
  apiUrl?: string;
1145
1210
  /** Optional public app attribution ID (maps to X-Neus-App) */
1146
1211
  appId?: string;
1147
- /** Optional sponsor capability token (maps to X-Sponsor-Grant) */
1148
- sponsorGrant?: string;
1149
1212
  /** Optional x402 receipt token for retry calls (maps to PAYMENT-SIGNATURE) */
1150
1213
  paymentSignature?: string;
1151
1214
  /** Optional extra passthrough headers for advanced integrations */
1152
1215
  extraHeaders?: Record<string, string>;
1153
1216
  /** Hosted checkout URL for interactive verifiers (default: https://neus.network/verify) */
1154
1217
  hostedCheckoutUrl?: string;
1218
+ /** Optional OAuth provider id to pre-select for social/org verifiers (hosted flow) */
1219
+ oauthProvider?: string;
1155
1220
  /** Custom inline styles */
1156
1221
  style?: Record<string, any>;
1157
1222
  /** Child content to show when verified */
@@ -1160,7 +1225,7 @@ declare module '@neus/sdk/widgets' {
1160
1225
  verifierOptions?: Record<string, any>;
1161
1226
  /** Pre-built verifier data for each verifier */
1162
1227
  verifierData?: Record<string, any>;
1163
- /** Proof creation options (privacyLevel, publicDisplay, storeOriginalContent) */
1228
+ /** Proof creation options (defaults: private, publicDisplay false, storeOriginalContent true) */
1164
1229
  proofOptions?: Record<string, any>;
1165
1230
  /** Proof reuse strategy */
1166
1231
  strategy?: 'reuse-or-create' | 'reuse' | 'fresh';
@@ -1180,7 +1245,7 @@ declare module '@neus/sdk/widgets' {
1180
1245
  mode?: 'create' | 'access';
1181
1246
  /** proofId for private proof access (required when mode='access') */
1182
1247
  proofId?: string | null;
1183
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
1248
+ /** HTTP wire field for callers that receive API-shaped proof records. */
1184
1249
  qHash?: string | null;
1185
1250
  /** Optional injected wallet/provider for signing flows */
1186
1251
  wallet?: WalletLike | any;
@@ -1197,11 +1262,11 @@ declare module '@neus/sdk/widgets' {
1197
1262
  export function VerifyGate(props: VerifyGateProps): any;
1198
1263
 
1199
1264
  export interface ProofBadgeProps {
1200
- /** Proof ID (standard). Provide either proofId or qHash. */
1265
+ /** Proof receipt ID. */
1201
1266
  proofId?: string;
1202
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
1267
+ /** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
1203
1268
  qHash?: string;
1204
- /** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
1269
+ /** URL path pattern for proof links. Supports :proofId. */
1205
1270
  proofUrlPattern?: string;
1206
1271
  /** Badge size */
1207
1272
  size?: 'sm' | 'md';
@@ -1227,9 +1292,9 @@ declare module '@neus/sdk/widgets' {
1227
1292
 
1228
1293
  export interface SimpleProofBadgeProps {
1229
1294
  proofId?: string;
1230
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
1295
+ /** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
1231
1296
  qHash?: string;
1232
- /** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
1297
+ /** URL path pattern for proof links. Supports :proofId. */
1233
1298
  proofUrlPattern?: string;
1234
1299
  uiLinkBase?: string;
1235
1300
  apiUrl?: string;
@@ -1247,9 +1312,9 @@ declare module '@neus/sdk/widgets' {
1247
1312
 
1248
1313
  export interface NeusPillLinkProps {
1249
1314
  proofId?: string;
1250
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
1315
+ /** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
1251
1316
  qHash?: string;
1252
- /** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
1317
+ /** URL path pattern for proof links. Supports :proofId. */
1253
1318
  proofUrlPattern?: string;
1254
1319
  uiLinkBase?: string;
1255
1320
  label?: string;
@@ -1263,11 +1328,11 @@ declare module '@neus/sdk/widgets' {
1263
1328
  export function NeusPillLink(props: NeusPillLinkProps): any;
1264
1329
 
1265
1330
  export interface VerifiedIconProps {
1266
- /** Proof ID (standard) for link */
1331
+ /** Proof receipt ID for link */
1267
1332
  proofId?: string;
1268
- /** @deprecated qHash is a deprecated alias of proofId (same value). */
1333
+ /** HTTP wire field for callers that receive API-shaped proof records. Prefer proofId. */
1269
1334
  qHash?: string;
1270
- /** URL path pattern for proof links. Supports :proofId and legacy :qHash tokens. */
1335
+ /** URL path pattern for proof links. Supports :proofId. */
1271
1336
  proofUrlPattern?: string;
1272
1337
  /** UI platform base URL */
1273
1338
  uiLinkBase?: string;