@bind-protocol/sdk 0.8.0 → 0.9.0

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.
Files changed (36) hide show
  1. package/README.md +7 -11
  2. package/dist/{adapter-LeDOUfnn.d.ts → adapter-J6D9MZJV.d.ts} +2 -2
  3. package/dist/{adapter-DBvPax2O.d.cts → adapter-qe9f1ll3.d.cts} +2 -2
  4. package/dist/adapters/dimo/index.d.cts +3 -3
  5. package/dist/adapters/dimo/index.d.ts +3 -3
  6. package/dist/adapters/index.cjs +113 -138
  7. package/dist/adapters/index.cjs.map +1 -1
  8. package/dist/adapters/index.d.cts +4 -4
  9. package/dist/adapters/index.d.ts +4 -4
  10. package/dist/adapters/index.js +113 -138
  11. package/dist/adapters/index.js.map +1 -1
  12. package/dist/adapters/zktls/index.cjs +113 -138
  13. package/dist/adapters/zktls/index.cjs.map +1 -1
  14. package/dist/adapters/zktls/index.d.cts +3 -3
  15. package/dist/adapters/zktls/index.d.ts +3 -3
  16. package/dist/adapters/zktls/index.js +113 -138
  17. package/dist/adapters/zktls/index.js.map +1 -1
  18. package/dist/{client-Dlp02kxb.d.cts → client-CfYXpFLk.d.cts} +70 -32
  19. package/dist/{client-BsloIjSG.d.ts → client-CpJ87Xe0.d.ts} +70 -32
  20. package/dist/core/index.cjs +107 -125
  21. package/dist/core/index.cjs.map +1 -1
  22. package/dist/core/index.d.cts +2 -2
  23. package/dist/core/index.d.ts +2 -2
  24. package/dist/core/index.js +107 -125
  25. package/dist/core/index.js.map +1 -1
  26. package/dist/index.cjs +113 -138
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +4 -4
  29. package/dist/index.d.ts +4 -4
  30. package/dist/index.js +113 -138
  31. package/dist/index.js.map +1 -1
  32. package/dist/{types-D5XJykY-.d.cts → types-BcPssdQk.d.cts} +30 -174
  33. package/dist/{types-D5XJykY-.d.ts → types-BcPssdQk.d.ts} +30 -174
  34. package/dist/{types-CXWgNPXN.d.ts → types-D7Q7ymPa.d.ts} +1 -1
  35. package/dist/{types-D-cTYE3o.d.cts → types-ywkMNwun.d.cts} +1 -1
  36. package/package.json +1 -1
@@ -14,6 +14,19 @@ interface BindClientOptions {
14
14
  /** API base URL (default: https://api.bindprotocol.com) */
15
15
  baseUrl?: string;
16
16
  }
17
+ interface Pagination {
18
+ limit: number;
19
+ offset: number;
20
+ count: number;
21
+ total: number;
22
+ }
23
+ /**
24
+ * Common polling options (used by all wait* methods and verifySharedProof)
25
+ */
26
+ interface PollOptions {
27
+ intervalMs?: number;
28
+ timeoutMs?: number;
29
+ }
17
30
  type ProveJobStatus = 'pending' | 'processing' | 'completed' | 'failed';
18
31
  /**
19
32
  * Verification mode determines how the proof is verified
@@ -47,11 +60,6 @@ interface ProofDownloadUrls {
47
60
  /** Signed URL for public inputs in hex format (optional) */
48
61
  pubsHex?: string;
49
62
  }
50
- interface SubmitProveJobRequest {
51
- circuitId: string;
52
- inputs: ProveJobInputs;
53
- verificationMode?: VerificationMode;
54
- }
55
63
  interface ProveJob {
56
64
  jobId: string;
57
65
  status: ProveJobStatus;
@@ -78,42 +86,18 @@ interface ProveJobSummary {
78
86
  completedAt: string | null;
79
87
  error: string | null;
80
88
  }
81
- interface SubmitProveJobResponse {
82
- success: boolean;
83
- data?: {
84
- jobId: string;
85
- status: ProveJobStatus;
86
- circuitId: string;
87
- verificationMode: VerificationMode;
88
- createdAt: string;
89
- };
90
- error?: string;
91
- requiredCredits?: number;
92
- availableCredits?: number;
93
- }
94
- interface GetProveJobResponse {
95
- success: boolean;
96
- data?: ProveJob;
97
- error?: string;
89
+ interface SubmitProveJobResult {
90
+ jobId: string;
91
+ status: ProveJobStatus;
92
+ circuitId: string;
93
+ verificationMode: VerificationMode;
94
+ createdAt: string;
98
95
  }
99
96
  interface ListProveJobsOptions {
100
97
  status?: ProveJobStatus;
101
98
  limit?: number;
102
99
  offset?: number;
103
100
  }
104
- interface ListProveJobsResponse {
105
- success: boolean;
106
- data?: {
107
- jobs: ProveJobSummary[];
108
- pagination: {
109
- limit: number;
110
- offset: number;
111
- count: number;
112
- total: number;
113
- };
114
- };
115
- error?: string;
116
- }
117
101
  type CircuitStatus = 'active' | 'disabled' | 'deprecated';
118
102
  type CircuitValidationStatus = 'pending' | 'validating' | 'validated' | 'failed';
119
103
  interface Circuit {
@@ -129,26 +113,10 @@ interface Circuit {
129
113
  createdAt: string;
130
114
  updatedAt?: string;
131
115
  }
132
- interface ListCircuitsResponse {
133
- success: boolean;
134
- data?: Circuit[];
135
- error?: string;
136
- }
137
- interface GetCircuitResponse {
138
- success: boolean;
139
- data?: Circuit;
140
- error?: string;
141
- }
142
- interface ActivateCircuitResponse {
143
- success: boolean;
144
- data?: {
145
- circuitId: string;
146
- status: CircuitStatus;
147
- message: string;
148
- };
149
- error?: string;
150
- validationStatus?: CircuitValidationStatus;
151
- validationErrors?: unknown;
116
+ interface ActivateCircuitResult {
117
+ circuitId: string;
118
+ status: CircuitStatus;
119
+ message: string;
152
120
  }
153
121
  interface BindCredential {
154
122
  /** The policy used to generate this credential */
@@ -201,34 +169,6 @@ interface ZkTlsSession {
201
169
  createdAt: number;
202
170
  updatedAt: number;
203
171
  }
204
- interface ListExtractorsResponse {
205
- success: boolean;
206
- data?: ZkTlsExtractor[];
207
- error?: string;
208
- }
209
- interface ListAttestationsResponse {
210
- success: boolean;
211
- data?: ZkTlsAttestation[];
212
- error?: string;
213
- }
214
- interface GetAttestationResponse {
215
- success: boolean;
216
- data?: ZkTlsAttestation;
217
- error?: string;
218
- }
219
- interface CreateSessionResponse {
220
- success: boolean;
221
- data?: {
222
- sessionId: string;
223
- authUrl: string;
224
- };
225
- error?: string;
226
- }
227
- interface GetSessionResponse {
228
- success: boolean;
229
- data?: ZkTlsSession;
230
- error?: string;
231
- }
232
172
  interface SharedProof {
233
173
  id: string;
234
174
  proveJobId: string;
@@ -260,11 +200,6 @@ interface ShareProofRequest {
260
200
  expiresAt?: string;
261
201
  note?: string;
262
202
  }
263
- interface ShareProofResponse {
264
- success: boolean;
265
- data?: SharedProof;
266
- error?: string;
267
- }
268
203
  interface ListSharedProofsOptions {
269
204
  direction?: 'outgoing' | 'incoming';
270
205
  limit?: number;
@@ -272,66 +207,14 @@ interface ListSharedProofsOptions {
272
207
  includeExpired?: boolean;
273
208
  includeRevoked?: boolean;
274
209
  }
275
- interface ListSharedProofsResponse {
276
- success: boolean;
277
- data?: {
278
- shares: SharedProof[];
279
- pagination: {
280
- limit: number;
281
- offset: number;
282
- count: number;
283
- total: number;
284
- };
285
- };
286
- error?: string;
287
- }
288
- interface GetSharedProofResponse {
289
- success: boolean;
290
- data?: SharedProof;
291
- error?: string;
292
- }
293
- interface RevokeSharedProofResponse {
294
- success: boolean;
295
- data?: {
296
- id: string;
297
- proveJobId: string;
298
- verifierOrgId: string;
299
- revokedAt: string;
300
- message: string;
301
- };
302
- error?: string;
210
+ interface RevokeSharedProofResult {
211
+ id: string;
212
+ proveJobId: string;
213
+ verifierOrgId: string;
214
+ revokedAt: string;
215
+ message: string;
303
216
  }
304
217
  type VerifyJobStatus = 'pending' | 'processing' | 'completed' | 'failed';
305
- /**
306
- * Response from queuing a verification job (before polling)
307
- */
308
- interface VerifyJobQueuedResponse {
309
- success: boolean;
310
- data?: {
311
- jobId: string;
312
- status: VerifyJobStatus;
313
- creditsCharged: number;
314
- message?: string;
315
- };
316
- error?: string;
317
- }
318
- /**
319
- * Response from polling a verification job status
320
- */
321
- interface VerifyJobStatusResponse {
322
- success: boolean;
323
- data?: {
324
- status: VerifyJobStatus;
325
- isValid?: boolean;
326
- error?: string;
327
- verificationTimeMs?: number;
328
- creditsCharged: number;
329
- verificationResultId?: string;
330
- publicInputs?: string[];
331
- publicInputsMatch?: boolean;
332
- };
333
- error?: string;
334
- }
335
218
  interface VerificationResult {
336
219
  isValid: boolean;
337
220
  error?: string;
@@ -341,20 +224,6 @@ interface VerificationResult {
341
224
  /** Public inputs from the proof (hex-encoded) */
342
225
  publicInputs?: string[];
343
226
  }
344
- interface VerifySharedProofResponse {
345
- success: boolean;
346
- data?: VerificationResult;
347
- error?: string;
348
- }
349
- interface VerifyUploadedProofRequest {
350
- proof: string;
351
- vk: string;
352
- }
353
- interface VerifyUploadedProofResponse {
354
- success: boolean;
355
- data?: VerificationResult;
356
- error?: string;
357
- }
358
227
  interface VerificationHistoryEntry {
359
228
  id: string;
360
229
  sharedProofId: string | null;
@@ -370,18 +239,5 @@ interface GetVerificationHistoryOptions {
370
239
  limit?: number;
371
240
  offset?: number;
372
241
  }
373
- interface GetVerificationHistoryResponse {
374
- success: boolean;
375
- data?: {
376
- results: VerificationHistoryEntry[];
377
- pagination: {
378
- limit: number;
379
- offset: number;
380
- count: number;
381
- total: number;
382
- };
383
- };
384
- error?: string;
385
- }
386
242
 
387
- export type { ActivateCircuitResponse as A, BindClientOptions as B, CircuitStatus as C, GetSharedProofResponse as D, VerifyJobStatus as E, VerifyJobQueuedResponse as F, GetProveJobResponse as G, VerifyJobStatusResponse as H, VerificationResult as I, VerifySharedProofResponse as J, VerifyUploadedProofRequest as K, ListProveJobsOptions as L, VerifyUploadedProofResponse as M, VerificationHistoryEntry as N, GetVerificationHistoryOptions as O, ProveJobStatus as P, GetVerificationHistoryResponse as Q, RevokeSharedProofResponse as R, SubmitProveJobRequest as S, VerificationMode as V, ZkTlsSessionStatus as Z, ProveJobInputs as a, ProveJobOutputs as b, ProofDownloadUrls as c, ProveJob as d, ProveJobSummary as e, SubmitProveJobResponse as f, ListProveJobsResponse as g, CircuitValidationStatus as h, Circuit as i, ListCircuitsResponse as j, GetCircuitResponse as k, BindCredential as l, ZkTlsExtractor as m, ZkTlsWitness as n, ZkTlsAttestation as o, ZkTlsSession as p, ListExtractorsResponse as q, ListAttestationsResponse as r, GetAttestationResponse as s, CreateSessionResponse as t, GetSessionResponse as u, SharedProof as v, ShareProofRequest as w, ShareProofResponse as x, ListSharedProofsOptions as y, ListSharedProofsResponse as z };
243
+ export type { ActivateCircuitResult as A, BindClientOptions as B, CircuitStatus as C, GetVerificationHistoryOptions as G, ListProveJobsOptions as L, Pagination as P, RevokeSharedProofResult as R, SubmitProveJobResult as S, VerificationMode as V, ZkTlsSessionStatus as Z, PollOptions as a, ProveJobStatus as b, ProveJobInputs as c, ProveJobOutputs as d, ProofDownloadUrls as e, ProveJob as f, ProveJobSummary as g, CircuitValidationStatus as h, Circuit as i, BindCredential as j, ZkTlsExtractor as k, ZkTlsWitness as l, ZkTlsAttestation as m, ZkTlsSession as n, SharedProof as o, ShareProofRequest as p, ListSharedProofsOptions as q, VerifyJobStatus as r, VerificationResult as s, VerificationHistoryEntry as t };
@@ -1,4 +1,4 @@
1
- import { a as ProveJobInputs } from './types-D5XJykY-.js';
1
+ import { c as ProveJobInputs } from './types-BcPssdQk.js';
2
2
 
3
3
  /**
4
4
  * Base types for data source adapters
@@ -1,4 +1,4 @@
1
- import { a as ProveJobInputs } from './types-D5XJykY-.cjs';
1
+ import { c as ProveJobInputs } from './types-BcPssdQk.cjs';
2
2
 
3
3
  /**
4
4
  * Base types for data source adapters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bind-protocol/sdk",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "TypeScript SDK for the Bind Protocol - privacy-preserving credential issuance and verification",
5
5
  "license": "MIT",
6
6
  "keywords": [