@bind-protocol/sdk 0.7.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.
- package/README.md +7 -11
- package/dist/{adapter-Cl7HtxU3.d.ts → adapter-J6D9MZJV.d.ts} +2 -2
- package/dist/{adapter-zyYSX6_e.d.cts → adapter-qe9f1ll3.d.cts} +2 -2
- package/dist/adapters/dimo/index.d.cts +3 -3
- package/dist/adapters/dimo/index.d.ts +3 -3
- package/dist/adapters/index.cjs +113 -137
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +4 -4
- package/dist/adapters/index.d.ts +4 -4
- package/dist/adapters/index.js +113 -137
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/zktls/index.cjs +113 -137
- package/dist/adapters/zktls/index.cjs.map +1 -1
- package/dist/adapters/zktls/index.d.cts +3 -3
- package/dist/adapters/zktls/index.d.ts +3 -3
- package/dist/adapters/zktls/index.js +113 -137
- package/dist/adapters/zktls/index.js.map +1 -1
- package/dist/{client-CadOSqx6.d.ts → client-CfYXpFLk.d.cts} +70 -32
- package/dist/{client-BkohyCGJ.d.cts → client-CpJ87Xe0.d.ts} +70 -32
- package/dist/core/index.cjs +107 -124
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +107 -124
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +113 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +113 -137
- package/dist/index.js.map +1 -1
- package/dist/{types-Cz9q5U3r.d.cts → types-BcPssdQk.d.cts} +32 -174
- package/dist/{types-Cz9q5U3r.d.ts → types-BcPssdQk.d.ts} +32 -174
- package/dist/{types-Ca_xbN13.d.ts → types-D7Q7ymPa.d.ts} +1 -1
- package/dist/{types-DAN8BlbI.d.cts → types-ywkMNwun.d.cts} +1 -1
- 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
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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,86 +207,22 @@ interface ListSharedProofsOptions {
|
|
|
272
207
|
includeExpired?: boolean;
|
|
273
208
|
includeRevoked?: boolean;
|
|
274
209
|
}
|
|
275
|
-
interface
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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;
|
|
338
221
|
verificationTimeMs: number;
|
|
339
222
|
creditsCharged: number;
|
|
340
223
|
verificationResultId: string;
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
success: boolean;
|
|
344
|
-
data?: VerificationResult;
|
|
345
|
-
error?: string;
|
|
346
|
-
}
|
|
347
|
-
interface VerifyUploadedProofRequest {
|
|
348
|
-
proof: string;
|
|
349
|
-
vk: string;
|
|
350
|
-
}
|
|
351
|
-
interface VerifyUploadedProofResponse {
|
|
352
|
-
success: boolean;
|
|
353
|
-
data?: VerificationResult;
|
|
354
|
-
error?: string;
|
|
224
|
+
/** Public inputs from the proof (hex-encoded) */
|
|
225
|
+
publicInputs?: string[];
|
|
355
226
|
}
|
|
356
227
|
interface VerificationHistoryEntry {
|
|
357
228
|
id: string;
|
|
@@ -368,18 +239,5 @@ interface GetVerificationHistoryOptions {
|
|
|
368
239
|
limit?: number;
|
|
369
240
|
offset?: number;
|
|
370
241
|
}
|
|
371
|
-
interface GetVerificationHistoryResponse {
|
|
372
|
-
success: boolean;
|
|
373
|
-
data?: {
|
|
374
|
-
results: VerificationHistoryEntry[];
|
|
375
|
-
pagination: {
|
|
376
|
-
limit: number;
|
|
377
|
-
offset: number;
|
|
378
|
-
count: number;
|
|
379
|
-
total: number;
|
|
380
|
-
};
|
|
381
|
-
};
|
|
382
|
-
error?: string;
|
|
383
|
-
}
|
|
384
242
|
|
|
385
|
-
export type {
|
|
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 };
|