@hyperledger/anoncreds-nodejs 0.5.0-alpha-20261027094647 → 0.5.0-alpha-20261027201040

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 (40) hide show
  1. package/build/index.d.mts +273 -0
  2. package/build/index.mjs +871 -0
  3. package/build/index.mjs.map +1 -0
  4. package/package.json +16 -8
  5. package/build/NodeJSAnoncreds.d.ts +0 -267
  6. package/build/NodeJSAnoncreds.js +0 -479
  7. package/build/NodeJSAnoncreds.js.map +0 -1
  8. package/build/ffi/alloc.d.ts +0 -10
  9. package/build/ffi/alloc.js +0 -38
  10. package/build/ffi/alloc.js.map +0 -1
  11. package/build/ffi/conversion.d.ts +0 -17
  12. package/build/ffi/conversion.js +0 -39
  13. package/build/ffi/conversion.js.map +0 -1
  14. package/build/ffi/index.d.ts +0 -5
  15. package/build/ffi/index.js +0 -22
  16. package/build/ffi/index.js.map +0 -1
  17. package/build/ffi/primitives.d.ts +0 -11
  18. package/build/ffi/primitives.js +0 -48
  19. package/build/ffi/primitives.js.map +0 -1
  20. package/build/ffi/serialize.d.ts +0 -1
  21. package/build/ffi/serialize.js +0 -46
  22. package/build/ffi/serialize.js.map +0 -1
  23. package/build/ffi/structures.d.ts +0 -27
  24. package/build/ffi/structures.js +0 -59
  25. package/build/ffi/structures.js.map +0 -1
  26. package/build/index.d.ts +0 -3
  27. package/build/index.js +0 -23
  28. package/build/index.js.map +0 -1
  29. package/build/library/NativeBindingInterface.d.ts +0 -2
  30. package/build/library/NativeBindingInterface.js +0 -3
  31. package/build/library/NativeBindingInterface.js.map +0 -1
  32. package/build/library/bindings.d.ts +0 -4
  33. package/build/library/bindings.js +0 -352
  34. package/build/library/bindings.js.map +0 -1
  35. package/build/library/index.d.ts +0 -3
  36. package/build/library/index.js +0 -20
  37. package/build/library/index.js.map +0 -1
  38. package/build/library/register.d.ts +0 -2
  39. package/build/library/register.js +0 -66
  40. package/build/library/register.js.map +0 -1
@@ -0,0 +1,273 @@
1
+ import { Anoncreds, AnoncredsErrorObject, NativeCredentialEntry, NativeCredentialProve, NativeCredentialRevocationConfig, NativeNonRevokedIntervalOverride, ObjectHandle } from "@hyperledger/anoncreds-shared";
2
+ import * as koffi$1 from "koffi";
3
+ export * from "@hyperledger/anoncreds-shared";
4
+ type TypeSpec = Parameters<typeof koffi$1.out>[0];
5
+ declare const nativeBindings: Record<string, [TypeSpec, Array<TypeSpec>]>;
6
+ type NativeMethods = Record<keyof typeof nativeBindings, (...args: unknown[]) => any>;
7
+ declare class NodeJSAnoncreds implements Anoncreds {
8
+ get nativeAnoncreds(): NativeMethods;
9
+ /**
10
+ * Fetch the error from the native library and throw it as a JS error
11
+ *
12
+ * NOTE:
13
+ * Checks whether the error code of the returned error matches the error code that was passed to the function.
14
+ * If it doesn't, we throw an error with the original errorCode, and a custom message explaining we weren't able
15
+ * to retrieve the error message from the native library. This should however not break functionality as long as
16
+ * error codes are used rather than error messages for error handling.
17
+ *
18
+ */
19
+ private getAnoncredsError;
20
+ getCurrentError(): AnoncredsErrorObject;
21
+ private handleError;
22
+ generateNonce(): string;
23
+ createSchema(options: {
24
+ name: string;
25
+ version: string;
26
+ issuerId: string;
27
+ attributeNames: string[];
28
+ }): ObjectHandle;
29
+ revocationRegistryDefinitionGetAttribute(options: {
30
+ objectHandle: ObjectHandle;
31
+ name: string;
32
+ }): string;
33
+ credentialGetAttribute(options: {
34
+ objectHandle: ObjectHandle;
35
+ name: string;
36
+ }): string | null;
37
+ createCredentialDefinition(options: {
38
+ schemaId: string;
39
+ schema: ObjectHandle;
40
+ issuerId: string;
41
+ tag: string;
42
+ signatureType: string;
43
+ supportRevocation: boolean;
44
+ }): {
45
+ credentialDefinition: ObjectHandle;
46
+ credentialDefinitionPrivate: ObjectHandle;
47
+ keyCorrectnessProof: ObjectHandle;
48
+ };
49
+ createCredential(options: {
50
+ credentialDefinition: ObjectHandle;
51
+ credentialDefinitionPrivate: ObjectHandle;
52
+ credentialOffer: ObjectHandle;
53
+ credentialRequest: ObjectHandle;
54
+ attributeRawValues: Record<string, string>;
55
+ attributeEncodedValues?: Record<string, string>;
56
+ revocationConfiguration?: NativeCredentialRevocationConfig;
57
+ }): ObjectHandle;
58
+ encodeCredentialAttributes(options: {
59
+ attributeRawValues: string[];
60
+ }): string[];
61
+ processCredential(options: {
62
+ credential: ObjectHandle;
63
+ credentialRequestMetadata: ObjectHandle;
64
+ linkSecret: string;
65
+ credentialDefinition: ObjectHandle;
66
+ revocationRegistryDefinition?: ObjectHandle | undefined;
67
+ }): ObjectHandle;
68
+ createCredentialOffer(options: {
69
+ schemaId: string;
70
+ credentialDefinitionId: string;
71
+ keyCorrectnessProof: ObjectHandle;
72
+ }): ObjectHandle;
73
+ createCredentialRequest(options: {
74
+ entropy?: string;
75
+ proverDid?: string;
76
+ credentialDefinition: ObjectHandle;
77
+ linkSecret: string;
78
+ linkSecretId: string;
79
+ credentialOffer: ObjectHandle;
80
+ }): {
81
+ credentialRequest: ObjectHandle;
82
+ credentialRequestMetadata: ObjectHandle;
83
+ };
84
+ createLinkSecret(): string;
85
+ createPresentation(options: {
86
+ presentationRequest: ObjectHandle;
87
+ credentials: NativeCredentialEntry[];
88
+ credentialsProve: NativeCredentialProve[];
89
+ selfAttest: Record<string, string>;
90
+ linkSecret: string;
91
+ schemas: Record<string, ObjectHandle>;
92
+ credentialDefinitions: Record<string, ObjectHandle>;
93
+ }): ObjectHandle;
94
+ verifyPresentation(options: {
95
+ presentation: ObjectHandle;
96
+ presentationRequest: ObjectHandle;
97
+ schemas: ObjectHandle[];
98
+ schemaIds: string[];
99
+ credentialDefinitions: ObjectHandle[];
100
+ credentialDefinitionIds: string[];
101
+ revocationRegistryDefinitions?: ObjectHandle[];
102
+ revocationRegistryDefinitionIds?: string[];
103
+ revocationStatusLists?: ObjectHandle[];
104
+ nonRevokedIntervalOverrides?: NativeNonRevokedIntervalOverride[];
105
+ }): boolean;
106
+ createRevocationStatusList(options: {
107
+ credentialDefinition: ObjectHandle;
108
+ revocationRegistryDefinitionId: string;
109
+ revocationRegistryDefinition: ObjectHandle;
110
+ revocationRegistryDefinitionPrivate: ObjectHandle;
111
+ issuerId: string;
112
+ issuanceByDefault: boolean;
113
+ timestamp?: number;
114
+ }): ObjectHandle;
115
+ updateRevocationStatusListTimestampOnly(options: {
116
+ timestamp: number;
117
+ currentRevocationStatusList: ObjectHandle;
118
+ }): ObjectHandle;
119
+ updateRevocationStatusList(options: {
120
+ credentialDefinition: ObjectHandle;
121
+ revocationRegistryDefinition: ObjectHandle;
122
+ revocationRegistryDefinitionPrivate: ObjectHandle;
123
+ currentRevocationStatusList: ObjectHandle;
124
+ issued?: number[];
125
+ revoked?: number[];
126
+ timestamp?: number;
127
+ }): ObjectHandle;
128
+ createRevocationRegistryDefinition(options: {
129
+ credentialDefinition: ObjectHandle;
130
+ credentialDefinitionId: string;
131
+ issuerId: string;
132
+ tag: string;
133
+ revocationRegistryType: string;
134
+ maximumCredentialNumber: number;
135
+ tailsDirectoryPath?: string;
136
+ }): {
137
+ revocationRegistryDefinition: ObjectHandle;
138
+ revocationRegistryDefinitionPrivate: ObjectHandle;
139
+ };
140
+ createOrUpdateRevocationState(options: {
141
+ revocationRegistryDefinition: ObjectHandle;
142
+ revocationStatusList: ObjectHandle;
143
+ revocationRegistryIndex: number;
144
+ tailsPath: string;
145
+ oldRevocationState?: ObjectHandle;
146
+ oldRevocationStatusList?: ObjectHandle;
147
+ }): ObjectHandle;
148
+ createW3cCredential(options: {
149
+ credentialDefinition: ObjectHandle;
150
+ credentialDefinitionPrivate: ObjectHandle;
151
+ credentialOffer: ObjectHandle;
152
+ credentialRequest: ObjectHandle;
153
+ attributeRawValues: Record<string, string>;
154
+ revocationConfiguration?: NativeCredentialRevocationConfig;
155
+ w3cVersion?: string;
156
+ }): ObjectHandle;
157
+ processW3cCredential(options: {
158
+ credential: ObjectHandle;
159
+ credentialRequestMetadata: ObjectHandle;
160
+ linkSecret: string;
161
+ credentialDefinition: ObjectHandle;
162
+ revocationRegistryDefinition?: ObjectHandle | undefined;
163
+ }): ObjectHandle;
164
+ createW3cPresentation(options: {
165
+ presentationRequest: ObjectHandle;
166
+ credentials: NativeCredentialEntry[];
167
+ credentialsProve: NativeCredentialProve[];
168
+ linkSecret: string;
169
+ schemas: Record<string, ObjectHandle>;
170
+ credentialDefinitions: Record<string, ObjectHandle>;
171
+ w3cVersion?: string;
172
+ }): ObjectHandle;
173
+ verifyW3cPresentation(options: {
174
+ presentation: ObjectHandle;
175
+ presentationRequest: ObjectHandle;
176
+ schemas: ObjectHandle[];
177
+ schemaIds: string[];
178
+ credentialDefinitions: ObjectHandle[];
179
+ credentialDefinitionIds: string[];
180
+ revocationRegistryDefinitions?: ObjectHandle[];
181
+ revocationRegistryDefinitionIds?: string[];
182
+ revocationStatusLists?: ObjectHandle[];
183
+ nonRevokedIntervalOverrides?: NativeNonRevokedIntervalOverride[];
184
+ }): boolean;
185
+ credentialToW3c(options: {
186
+ objectHandle: ObjectHandle;
187
+ issuerId: string;
188
+ w3cVersion?: string;
189
+ }): ObjectHandle;
190
+ credentialFromW3c(options: {
191
+ objectHandle: ObjectHandle;
192
+ }): ObjectHandle;
193
+ w3cCredentialGetIntegrityProofDetails(options: {
194
+ objectHandle: ObjectHandle;
195
+ }): ObjectHandle;
196
+ w3cCredentialProofGetAttribute(options: {
197
+ objectHandle: ObjectHandle;
198
+ name: string;
199
+ }): string | null;
200
+ w3cCredentialFromJson(options: {
201
+ json: string;
202
+ }): ObjectHandle;
203
+ w3cPresentationFromJson(options: {
204
+ json: string;
205
+ }): ObjectHandle;
206
+ version(): string;
207
+ setDefaultLogger(): void;
208
+ private objectFromJson;
209
+ presentationRequestFromJson(options: {
210
+ json: string;
211
+ }): ObjectHandle;
212
+ credentialRequestFromJson(options: {
213
+ json: string;
214
+ }): ObjectHandle;
215
+ credentialRequestMetadataFromJson(options: {
216
+ json: string;
217
+ }): ObjectHandle;
218
+ revocationRegistryDefinitionFromJson(options: {
219
+ json: string;
220
+ }): ObjectHandle;
221
+ revocationRegistryFromJson(options: {
222
+ json: string;
223
+ }): ObjectHandle;
224
+ revocationStatusListFromJson(options: {
225
+ json: string;
226
+ }): ObjectHandle;
227
+ revocationStateFromJson(options: {
228
+ json: string;
229
+ }): ObjectHandle;
230
+ presentationFromJson(options: {
231
+ json: string;
232
+ }): ObjectHandle;
233
+ credentialOfferFromJson(options: {
234
+ json: string;
235
+ }): ObjectHandle;
236
+ schemaFromJson(options: {
237
+ json: string;
238
+ }): ObjectHandle;
239
+ credentialFromJson(options: {
240
+ json: string;
241
+ }): ObjectHandle;
242
+ revocationRegistryDefinitionPrivateFromJson(options: {
243
+ json: string;
244
+ }): ObjectHandle;
245
+ credentialDefinitionFromJson(options: {
246
+ json: string;
247
+ }): ObjectHandle;
248
+ credentialDefinitionPrivateFromJson(options: {
249
+ json: string;
250
+ }): ObjectHandle;
251
+ keyCorrectnessProofFromJson(options: {
252
+ json: string;
253
+ }): ObjectHandle;
254
+ getJson(options: {
255
+ objectHandle: ObjectHandle;
256
+ }): string;
257
+ getTypeName(options: {
258
+ objectHandle: ObjectHandle;
259
+ }): string;
260
+ objectFree(options: {
261
+ objectHandle: ObjectHandle;
262
+ }): void;
263
+ private convertCredentialList;
264
+ private convertCredentialProves;
265
+ private convertSchemas;
266
+ private convertCredDefs;
267
+ private convertNonRevokedIntervalOverrides;
268
+ private convertAttributeNames;
269
+ private convertAttributeRawValues;
270
+ private convertRevocationConfiguration;
271
+ }
272
+ export declare const anoncredsNodeJS: NodeJSAnoncreds;
273
+ //# sourceMappingURL=index.d.mts.map