@hyperledger/anoncreds-nodejs 0.1.0-dev.10
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/LICENSE +192 -0
- package/README.md +38 -0
- package/build/NodeJSAnoncreds.d.ts +233 -0
- package/build/NodeJSAnoncreds.js +346 -0
- package/build/NodeJSAnoncreds.js.map +1 -0
- package/build/ffi/alloc.d.ts +5 -0
- package/build/ffi/alloc.js +18 -0
- package/build/ffi/alloc.js.map +1 -0
- package/build/ffi/conversion.d.ts +8 -0
- package/build/ffi/conversion.js +8 -0
- package/build/ffi/conversion.js.map +1 -0
- package/build/ffi/index.d.ts +5 -0
- package/build/ffi/index.js +18 -0
- package/build/ffi/index.js.map +1 -0
- package/build/ffi/primitives.d.ts +14 -0
- package/build/ffi/primitives.js +21 -0
- package/build/ffi/primitives.js.map +1 -0
- package/build/ffi/serialize.d.ts +24 -0
- package/build/ffi/serialize.js +55 -0
- package/build/ffi/serialize.js.map +1 -0
- package/build/ffi/structures.d.ts +119 -0
- package/build/ffi/structures.js +112 -0
- package/build/ffi/structures.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +19 -0
- package/build/index.js.map +1 -0
- package/build/library/NativeBindingInterface.d.ts +27 -0
- package/build/library/NativeBindingInterface.js +4 -0
- package/build/library/NativeBindingInterface.js.map +1 -0
- package/build/library/bindings.d.ts +179 -0
- package/build/library/bindings.js +171 -0
- package/build/library/bindings.js.map +1 -0
- package/build/library/index.d.ts +3 -0
- package/build/library/index.js +16 -0
- package/build/library/index.js.map +1 -0
- package/build/library/register.d.ts +43 -0
- package/build/library/register.js +62 -0
- package/build/library/register.js.map +1 -0
- package/package.json +53 -0
- package/scripts/arch.js +22 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import RefArray from 'ref-array-di';
|
|
2
|
+
import * as ref from 'ref-napi';
|
|
3
|
+
import RefStruct from 'ref-struct-di';
|
|
4
|
+
export declare const StringArray: RefArray.ArrayType<string | null>;
|
|
5
|
+
export declare const ByteBufferArray: RefArray.ArrayType<number>;
|
|
6
|
+
export declare const ByteBufferArrayPtr: ref.Type<ref.Pointer<string | null>>;
|
|
7
|
+
export declare const Int64Array: RefArray.ArrayType<string | number>;
|
|
8
|
+
export declare const Int32Array: RefArray.ArrayType<number>;
|
|
9
|
+
export declare const StringArrayPtr: ref.Type<ref.Pointer<RefArray.TypedArray<string | null, number>>>;
|
|
10
|
+
export declare const ByteBufferStruct: RefStruct.StructType<{
|
|
11
|
+
len: ref.Type<string | number>;
|
|
12
|
+
data: ref.Type<ref.Pointer<string | null>>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const ByteBufferStructPtr: ref.Type<ref.Pointer<RefStruct.StructObject<{
|
|
15
|
+
len: string | number;
|
|
16
|
+
data: ref.Pointer<string | null>;
|
|
17
|
+
}>>>;
|
|
18
|
+
export declare const StringListStruct: RefStruct.StructType<{
|
|
19
|
+
count: ref.Type<string | number>;
|
|
20
|
+
data: ref.Type<RefArray.TypedArray<string | null, number>>;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const StringListStructPtr: ref.Type<ref.Pointer<RefStruct.StructObject<{
|
|
23
|
+
count: string | number;
|
|
24
|
+
data: RefArray.TypedArray<string | null, number>;
|
|
25
|
+
}>>>;
|
|
26
|
+
export declare const I64ListStruct: RefStruct.StructType<{
|
|
27
|
+
count: ref.Type<string | number>;
|
|
28
|
+
data: ref.Type<ref.Pointer<RefArray.TypedArray<string | number, number>>>;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const I32ListStruct: RefStruct.StructType<{
|
|
31
|
+
count: ref.Type<string | number>;
|
|
32
|
+
data: ref.Type<ref.Pointer<RefArray.TypedArray<number, number>>>;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const CredRevInfoStruct: RefStruct.StructType<{
|
|
35
|
+
reg_def: ref.Type<string | number>;
|
|
36
|
+
reg_def_private: ref.Type<string | number>;
|
|
37
|
+
reg_idx: ref.Type<string | number>;
|
|
38
|
+
tails_path: ref.Type<string | null>;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const CredentialEntryStruct: RefStruct.StructType<{
|
|
41
|
+
credential: ref.Type<string | number>;
|
|
42
|
+
timestamp: ref.Type<string | number>;
|
|
43
|
+
rev_state: ref.Type<string | number>;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const CredentialEntryArray: RefArray.ArrayType<RefStruct.StructObject<{
|
|
46
|
+
credential: string | number;
|
|
47
|
+
timestamp: string | number;
|
|
48
|
+
rev_state: string | number;
|
|
49
|
+
}>>;
|
|
50
|
+
export declare const CredentialEntryListStruct: RefStruct.StructType<{
|
|
51
|
+
count: ref.Type<string | number>;
|
|
52
|
+
data: ref.Type<RefArray.TypedArray<RefStruct.StructObject<{
|
|
53
|
+
credential: string | number;
|
|
54
|
+
timestamp: string | number;
|
|
55
|
+
rev_state: string | number;
|
|
56
|
+
}>, number>>;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const CredentialProveStruct: RefStruct.StructType<{
|
|
59
|
+
entry_idx: ref.Type<string | number>;
|
|
60
|
+
referent: ref.Type<string | null>;
|
|
61
|
+
is_predicate: ref.Type<number>;
|
|
62
|
+
reveal: ref.Type<number>;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const CredentialProveArray: RefArray.ArrayType<RefStruct.StructObject<{
|
|
65
|
+
entry_idx: string | number;
|
|
66
|
+
referent: string | null;
|
|
67
|
+
is_predicate: number;
|
|
68
|
+
reveal: number;
|
|
69
|
+
}>>;
|
|
70
|
+
export declare const CredentialProveListStruct: RefStruct.StructType<{
|
|
71
|
+
count: ref.Type<string | number>;
|
|
72
|
+
data: ref.Type<RefArray.TypedArray<RefStruct.StructObject<{
|
|
73
|
+
entry_idx: string | number;
|
|
74
|
+
referent: string | null;
|
|
75
|
+
is_predicate: number;
|
|
76
|
+
reveal: number;
|
|
77
|
+
}>, number>>;
|
|
78
|
+
}>;
|
|
79
|
+
export declare const ObjectHandleArray: RefArray.ArrayType<string | number>;
|
|
80
|
+
export declare const ObjectHandleListStruct: RefStruct.StructType<{
|
|
81
|
+
count: ref.Type<string | number>;
|
|
82
|
+
data: ref.Type<RefArray.TypedArray<string | number, number>>;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const RevocationEntryStruct: RefStruct.StructType<{
|
|
85
|
+
def_entry_idx: ref.Type<string | number>;
|
|
86
|
+
entry: ref.Type<string | number>;
|
|
87
|
+
timestamp: ref.Type<string | number>;
|
|
88
|
+
}>;
|
|
89
|
+
export declare const RevocationEntryArray: RefArray.ArrayType<RefStruct.StructObject<{
|
|
90
|
+
def_entry_idx: string | number;
|
|
91
|
+
entry: string | number;
|
|
92
|
+
timestamp: string | number;
|
|
93
|
+
}>>;
|
|
94
|
+
export declare const RevocationEntryListStruct: RefStruct.StructType<{
|
|
95
|
+
count: ref.Type<string | number>;
|
|
96
|
+
data: ref.Type<RefArray.TypedArray<RefStruct.StructObject<{
|
|
97
|
+
def_entry_idx: string | number;
|
|
98
|
+
entry: string | number;
|
|
99
|
+
timestamp: string | number;
|
|
100
|
+
}>, number>>;
|
|
101
|
+
}>;
|
|
102
|
+
export declare const NonRevokedIntervalOverrideStruct: RefStruct.StructType<{
|
|
103
|
+
rev_reg_def_id: ref.Type<string | null>;
|
|
104
|
+
requested_from_ts: ref.Type<number>;
|
|
105
|
+
override_rev_status_list_ts: ref.Type<number>;
|
|
106
|
+
}>;
|
|
107
|
+
export declare const NonRevokedIntervalOverrideArray: RefArray.ArrayType<RefStruct.StructObject<{
|
|
108
|
+
rev_reg_def_id: string | null;
|
|
109
|
+
requested_from_ts: number;
|
|
110
|
+
override_rev_status_list_ts: number;
|
|
111
|
+
}>>;
|
|
112
|
+
export declare const NonRevokedIntervalOverrideListStruct: RefStruct.StructType<{
|
|
113
|
+
count: ref.Type<string | number>;
|
|
114
|
+
data: ref.Type<RefArray.TypedArray<RefStruct.StructObject<{
|
|
115
|
+
rev_reg_def_id: string | null;
|
|
116
|
+
requested_from_ts: number;
|
|
117
|
+
override_rev_status_list_ts: number;
|
|
118
|
+
}>, number>>;
|
|
119
|
+
}>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.NonRevokedIntervalOverrideListStruct = exports.NonRevokedIntervalOverrideArray = exports.NonRevokedIntervalOverrideStruct = exports.RevocationEntryListStruct = exports.RevocationEntryArray = exports.RevocationEntryStruct = exports.ObjectHandleListStruct = exports.ObjectHandleArray = exports.CredentialProveListStruct = exports.CredentialProveArray = exports.CredentialProveStruct = exports.CredentialEntryListStruct = exports.CredentialEntryArray = exports.CredentialEntryStruct = exports.CredRevInfoStruct = exports.I32ListStruct = exports.I64ListStruct = exports.StringListStructPtr = exports.StringListStruct = exports.ByteBufferStructPtr = exports.ByteBufferStruct = exports.StringArrayPtr = exports.Int32Array = exports.Int64Array = exports.ByteBufferArrayPtr = exports.ByteBufferArray = exports.StringArray = void 0;
|
|
26
|
+
const ref_array_di_1 = __importDefault(require("ref-array-di"));
|
|
27
|
+
const ref = __importStar(require("ref-napi"));
|
|
28
|
+
const ref_struct_di_1 = __importDefault(require("ref-struct-di"));
|
|
29
|
+
const primitives_1 = require("./primitives");
|
|
30
|
+
const CStruct = (0, ref_struct_di_1.default)(ref);
|
|
31
|
+
const CArray = (0, ref_array_di_1.default)(ref);
|
|
32
|
+
exports.StringArray = CArray('string');
|
|
33
|
+
const FFI_INT32_ARRAY = CArray('int32');
|
|
34
|
+
const FFI_INT32_ARRAY_PTR = ref.refType(FFI_INT32_ARRAY);
|
|
35
|
+
const FFI_INT64_ARRAY = CArray('int64');
|
|
36
|
+
const FFI_INT64_ARRAY_PTR = ref.refType(FFI_INT64_ARRAY);
|
|
37
|
+
exports.ByteBufferArray = CArray('uint8');
|
|
38
|
+
exports.ByteBufferArrayPtr = ref.refType(primitives_1.FFI_STRING);
|
|
39
|
+
exports.Int64Array = FFI_INT64_ARRAY;
|
|
40
|
+
exports.Int32Array = FFI_INT32_ARRAY;
|
|
41
|
+
exports.StringArrayPtr = ref.refType(exports.StringArray);
|
|
42
|
+
exports.ByteBufferStruct = CStruct({
|
|
43
|
+
len: primitives_1.FFI_INT64,
|
|
44
|
+
data: exports.ByteBufferArrayPtr,
|
|
45
|
+
});
|
|
46
|
+
exports.ByteBufferStructPtr = ref.refType(exports.ByteBufferStruct);
|
|
47
|
+
exports.StringListStruct = CStruct({
|
|
48
|
+
count: ref.types.size_t,
|
|
49
|
+
data: exports.StringArray,
|
|
50
|
+
});
|
|
51
|
+
exports.StringListStructPtr = ref.refType(exports.StringListStruct);
|
|
52
|
+
exports.I64ListStruct = CStruct({
|
|
53
|
+
count: primitives_1.FFI_ISIZE,
|
|
54
|
+
data: FFI_INT64_ARRAY_PTR,
|
|
55
|
+
});
|
|
56
|
+
exports.I32ListStruct = CStruct({
|
|
57
|
+
count: primitives_1.FFI_ISIZE,
|
|
58
|
+
data: FFI_INT32_ARRAY_PTR,
|
|
59
|
+
});
|
|
60
|
+
exports.CredRevInfoStruct = CStruct({
|
|
61
|
+
reg_def: primitives_1.FFI_OBJECT_HANDLE,
|
|
62
|
+
reg_def_private: primitives_1.FFI_OBJECT_HANDLE,
|
|
63
|
+
reg_idx: primitives_1.FFI_INT64,
|
|
64
|
+
tails_path: primitives_1.FFI_STRING,
|
|
65
|
+
});
|
|
66
|
+
exports.CredentialEntryStruct = CStruct({
|
|
67
|
+
credential: primitives_1.FFI_ISIZE,
|
|
68
|
+
timestamp: primitives_1.FFI_INT64,
|
|
69
|
+
rev_state: primitives_1.FFI_ISIZE,
|
|
70
|
+
});
|
|
71
|
+
exports.CredentialEntryArray = CArray(exports.CredentialEntryStruct);
|
|
72
|
+
exports.CredentialEntryListStruct = CStruct({
|
|
73
|
+
count: primitives_1.FFI_ISIZE,
|
|
74
|
+
data: exports.CredentialEntryArray,
|
|
75
|
+
});
|
|
76
|
+
exports.CredentialProveStruct = CStruct({
|
|
77
|
+
entry_idx: primitives_1.FFI_INT64,
|
|
78
|
+
referent: primitives_1.FFI_STRING,
|
|
79
|
+
is_predicate: primitives_1.FFI_INT8,
|
|
80
|
+
reveal: primitives_1.FFI_INT8,
|
|
81
|
+
});
|
|
82
|
+
exports.CredentialProveArray = CArray(exports.CredentialProveStruct);
|
|
83
|
+
exports.CredentialProveListStruct = CStruct({
|
|
84
|
+
count: primitives_1.FFI_ISIZE,
|
|
85
|
+
data: exports.CredentialProveArray,
|
|
86
|
+
});
|
|
87
|
+
exports.ObjectHandleArray = CArray('size_t');
|
|
88
|
+
exports.ObjectHandleListStruct = CStruct({
|
|
89
|
+
count: primitives_1.FFI_ISIZE,
|
|
90
|
+
data: exports.ObjectHandleArray,
|
|
91
|
+
});
|
|
92
|
+
exports.RevocationEntryStruct = CStruct({
|
|
93
|
+
def_entry_idx: primitives_1.FFI_INT64,
|
|
94
|
+
entry: primitives_1.FFI_ISIZE,
|
|
95
|
+
timestamp: primitives_1.FFI_INT64,
|
|
96
|
+
});
|
|
97
|
+
exports.RevocationEntryArray = CArray(exports.RevocationEntryStruct);
|
|
98
|
+
exports.RevocationEntryListStruct = CStruct({
|
|
99
|
+
count: primitives_1.FFI_ISIZE,
|
|
100
|
+
data: exports.RevocationEntryArray,
|
|
101
|
+
});
|
|
102
|
+
exports.NonRevokedIntervalOverrideStruct = CStruct({
|
|
103
|
+
rev_reg_def_id: primitives_1.FFI_STRING,
|
|
104
|
+
requested_from_ts: primitives_1.FFI_INT32,
|
|
105
|
+
override_rev_status_list_ts: primitives_1.FFI_INT32,
|
|
106
|
+
});
|
|
107
|
+
exports.NonRevokedIntervalOverrideArray = CArray(exports.NonRevokedIntervalOverrideStruct);
|
|
108
|
+
exports.NonRevokedIntervalOverrideListStruct = CStruct({
|
|
109
|
+
count: primitives_1.FFI_ISIZE,
|
|
110
|
+
data: exports.NonRevokedIntervalOverrideArray,
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=structures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structures.js","sourceRoot":"","sources":["../../src/ffi/structures.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAmC;AACnC,8CAA+B;AAC/B,kEAAqC;AAErC,6CAAuG;AAEvG,MAAM,OAAO,GAAG,IAAA,uBAAS,EAAC,GAAG,CAAC,CAAA;AAC9B,MAAM,MAAM,GAAG,IAAA,sBAAQ,EAAC,GAAG,CAAC,CAAA;AAEf,QAAA,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAE3C,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AACvC,MAAM,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA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E,QAAA,oCAAoC,GAAG,OAAO,CAAC;IAC1D,KAAK,EAAE,sBAAS;IAChB,IAAI,EAAE,uCAA+B;CACtC,CAAC,CAAA"}
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.anoncredsNodeJS = void 0;
|
|
14
|
+
const anoncreds_shared_1 = require("@hyperledger/anoncreds-shared");
|
|
15
|
+
const NodeJSAnoncreds_1 = require("./NodeJSAnoncreds");
|
|
16
|
+
exports.anoncredsNodeJS = new NodeJSAnoncreds_1.NodeJSAnoncreds();
|
|
17
|
+
(0, anoncreds_shared_1.registerAnoncreds)({ lib: exports.anoncredsNodeJS });
|
|
18
|
+
__exportStar(require("@hyperledger/anoncreds-shared"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oEAAiE;AAEjE,uDAAmD;AAEtC,QAAA,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAA;AACpD,IAAA,oCAAiB,EAAC,EAAE,GAAG,EAAE,uBAAe,EAAE,CAAC,CAAA;AAE3C,gEAA6C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { nativeBindings } from './bindings';
|
|
2
|
+
interface StringTypeMapping {
|
|
3
|
+
pointer: Buffer;
|
|
4
|
+
'char*': Buffer;
|
|
5
|
+
string: string;
|
|
6
|
+
int64: number;
|
|
7
|
+
int32: number;
|
|
8
|
+
int8: number;
|
|
9
|
+
int: number;
|
|
10
|
+
size_t: number;
|
|
11
|
+
}
|
|
12
|
+
declare type ShapeOf<T> = {
|
|
13
|
+
[Property in keyof T]: T[Property];
|
|
14
|
+
};
|
|
15
|
+
declare type StringTypeArrayToTypes<List extends Array<keyof StringTypeMapping>> = {
|
|
16
|
+
[Item in keyof List]: List[Item] extends keyof StringTypeMapping ? StringTypeMapping[List[Item]] : Buffer;
|
|
17
|
+
};
|
|
18
|
+
declare type TypedMethods<Base extends {
|
|
19
|
+
[method: string | number | symbol]: [any, any[]];
|
|
20
|
+
}> = {
|
|
21
|
+
[Property in keyof Base]: (...args: StringTypeArrayToTypes<Base[Property][1]> extends any[] ? StringTypeArrayToTypes<Base[Property][1]> : []) => StringTypeMapping[Base[Property][0]];
|
|
22
|
+
};
|
|
23
|
+
declare type Mutable<T> = {
|
|
24
|
+
-readonly [K in keyof T]: Mutable<T[K]>;
|
|
25
|
+
};
|
|
26
|
+
export declare type NativeMethods = TypedMethods<ShapeOf<Mutable<typeof nativeBindings>>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeBindingInterface.js","sourceRoot":"","sources":["../../src/library/NativeBindingInterface.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
export declare const nativeBindings: {
|
|
2
|
+
readonly anoncreds_buffer_free: readonly [import("ref-napi").Type<void>, readonly [import("ref-struct-di").StructType<{
|
|
3
|
+
len: import("ref-napi").Type<string | number>;
|
|
4
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
5
|
+
}>]];
|
|
6
|
+
readonly anoncreds_create_credential: readonly ["uint", readonly ["size_t", "size_t", "size_t", "size_t", import("ref-struct-di").StructType<{
|
|
7
|
+
count: import("ref-napi").Type<string | number>;
|
|
8
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
9
|
+
}>, import("ref-struct-di").StructType<{
|
|
10
|
+
count: import("ref-napi").Type<string | number>;
|
|
11
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
12
|
+
}>, import("ref-struct-di").StructType<{
|
|
13
|
+
count: import("ref-napi").Type<string | number>;
|
|
14
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
15
|
+
}>, "string", "size_t", "size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
16
|
+
readonly anoncreds_create_credential_definition: readonly ["uint", readonly ["string", "size_t", "string", "string", "string", "int8", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>, import("ref-napi").Type<import("ref-napi").Pointer<string | number>>, import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
17
|
+
readonly anoncreds_create_credential_offer: readonly ["uint", readonly ["string", "string", "size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
18
|
+
readonly anoncreds_create_credential_request: readonly ["uint", readonly ["string", "string", "size_t", "size_t", "string", "size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>, import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
19
|
+
readonly anoncreds_create_master_secret: readonly ["uint", readonly [import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
20
|
+
readonly anoncreds_create_or_update_revocation_state: readonly ["uint", readonly ["size_t", "size_t", "int64", "string", "size_t", "size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
21
|
+
readonly anoncreds_create_presentation: readonly ["uint", readonly ["size_t", import("ref-struct-di").StructType<{
|
|
22
|
+
count: import("ref-napi").Type<string | number>;
|
|
23
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<import("ref-struct-di").StructObject<{
|
|
24
|
+
credential: string | number;
|
|
25
|
+
timestamp: string | number;
|
|
26
|
+
rev_state: string | number;
|
|
27
|
+
}>, number>>;
|
|
28
|
+
}>, import("ref-struct-di").StructType<{
|
|
29
|
+
count: import("ref-napi").Type<string | number>;
|
|
30
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<import("ref-struct-di").StructObject<{
|
|
31
|
+
entry_idx: string | number;
|
|
32
|
+
referent: string | null;
|
|
33
|
+
is_predicate: number;
|
|
34
|
+
reveal: number;
|
|
35
|
+
}>, number>>;
|
|
36
|
+
}>, import("ref-struct-di").StructType<{
|
|
37
|
+
count: import("ref-napi").Type<string | number>;
|
|
38
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
39
|
+
}>, import("ref-struct-di").StructType<{
|
|
40
|
+
count: import("ref-napi").Type<string | number>;
|
|
41
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
42
|
+
}>, "size_t", import("ref-struct-di").StructType<{
|
|
43
|
+
count: import("ref-napi").Type<string | number>;
|
|
44
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | number, number>>;
|
|
45
|
+
}>, import("ref-struct-di").StructType<{
|
|
46
|
+
count: import("ref-napi").Type<string | number>;
|
|
47
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
48
|
+
}>, import("ref-struct-di").StructType<{
|
|
49
|
+
count: import("ref-napi").Type<string | number>;
|
|
50
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | number, number>>;
|
|
51
|
+
}>, import("ref-struct-di").StructType<{
|
|
52
|
+
count: import("ref-napi").Type<string | number>;
|
|
53
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
54
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
55
|
+
readonly anoncreds_create_revocation_registry_def: readonly ["uint", readonly ["size_t", "string", "string", "string", "string", "int64", "string", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>, import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
56
|
+
readonly anoncreds_create_schema: readonly ["uint", readonly ["string", "string", "string", import("ref-struct-di").StructType<{
|
|
57
|
+
count: import("ref-napi").Type<string | number>;
|
|
58
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
59
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
60
|
+
readonly anoncreds_credential_get_attribute: readonly ["uint", readonly ["size_t", "string", import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
61
|
+
readonly anoncreds_encode_credential_attributes: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
62
|
+
count: import("ref-napi").Type<string | number>;
|
|
63
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
64
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
65
|
+
readonly anoncreds_generate_nonce: readonly ["uint", readonly [import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
66
|
+
readonly anoncreds_get_current_error: readonly ["uint", readonly [import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
67
|
+
readonly anoncreds_object_free: readonly [import("ref-napi").Type<void>, readonly ["size_t"]];
|
|
68
|
+
readonly anoncreds_object_get_json: readonly ["uint", readonly ["size_t", import("ref-napi").Type<import("ref-napi").Pointer<import("ref-struct-di").StructObject<{
|
|
69
|
+
len: string | number;
|
|
70
|
+
data: import("ref-napi").Pointer<string | null>;
|
|
71
|
+
}>>>]];
|
|
72
|
+
readonly anoncreds_object_get_type_name: readonly ["uint", readonly ["size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
73
|
+
readonly anoncreds_presentation_request_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
74
|
+
len: import("ref-napi").Type<string | number>;
|
|
75
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
76
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
77
|
+
readonly anoncreds_process_credential: readonly ["uint", readonly ["size_t", "size_t", "size_t", "size_t", "size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
78
|
+
readonly anoncreds_revocation_registry_definition_get_attribute: readonly ["uint", readonly ["size_t", "string", import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
79
|
+
readonly anoncreds_set_default_logger: readonly ["uint", readonly []];
|
|
80
|
+
readonly anoncreds_verify_presentation: readonly ["uint", readonly ["size_t", "size_t", import("ref-struct-di").StructType<{
|
|
81
|
+
count: import("ref-napi").Type<string | number>;
|
|
82
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | number, number>>;
|
|
83
|
+
}>, import("ref-struct-di").StructType<{
|
|
84
|
+
count: import("ref-napi").Type<string | number>;
|
|
85
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
86
|
+
}>, import("ref-struct-di").StructType<{
|
|
87
|
+
count: import("ref-napi").Type<string | number>;
|
|
88
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | number, number>>;
|
|
89
|
+
}>, import("ref-struct-di").StructType<{
|
|
90
|
+
count: import("ref-napi").Type<string | number>;
|
|
91
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
92
|
+
}>, import("ref-struct-di").StructType<{
|
|
93
|
+
count: import("ref-napi").Type<string | number>;
|
|
94
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | number, number>>;
|
|
95
|
+
}>, import("ref-struct-di").StructType<{
|
|
96
|
+
count: import("ref-napi").Type<string | number>;
|
|
97
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | null, number>>;
|
|
98
|
+
}>, import("ref-struct-di").StructType<{
|
|
99
|
+
count: import("ref-napi").Type<string | number>;
|
|
100
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<string | number, number>>;
|
|
101
|
+
}>, import("ref-struct-di").StructType<{
|
|
102
|
+
count: import("ref-napi").Type<string | number>;
|
|
103
|
+
data: import("ref-napi").Type<import("ref-array-di").TypedArray<import("ref-struct-di").StructObject<{
|
|
104
|
+
rev_reg_def_id: string | null;
|
|
105
|
+
requested_from_ts: number;
|
|
106
|
+
override_rev_status_list_ts: number;
|
|
107
|
+
}>, number>>;
|
|
108
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<number>>]];
|
|
109
|
+
readonly anoncreds_create_revocation_status_list: readonly ["uint", readonly ["string", "size_t", "string", "int64", "int8", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
110
|
+
readonly anoncreds_update_revocation_status_list_timestamp_only: readonly ["uint", readonly ["int64", "size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
111
|
+
readonly anoncreds_update_revocation_status_list: readonly ["uint", readonly ["int64", import("ref-struct-di").StructType<{
|
|
112
|
+
count: import("ref-napi").Type<string | number>;
|
|
113
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<import("ref-array-di").TypedArray<number, number>>>;
|
|
114
|
+
}>, import("ref-struct-di").StructType<{
|
|
115
|
+
count: import("ref-napi").Type<string | number>;
|
|
116
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<import("ref-array-di").TypedArray<number, number>>>;
|
|
117
|
+
}>, "size_t", "size_t", import("ref-napi").Type<import("ref-napi").Pointer<string | number>>]];
|
|
118
|
+
readonly anoncreds_version: readonly ["string", readonly []];
|
|
119
|
+
readonly anoncreds_master_secret_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
120
|
+
len: import("ref-napi").Type<string | number>;
|
|
121
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
122
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
123
|
+
readonly anoncreds_credential_request_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
124
|
+
len: import("ref-napi").Type<string | number>;
|
|
125
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
126
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
127
|
+
readonly anoncreds_credential_request_metadata_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
128
|
+
len: import("ref-napi").Type<string | number>;
|
|
129
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
130
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
131
|
+
readonly anoncreds_presentation_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
132
|
+
len: import("ref-napi").Type<string | number>;
|
|
133
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
134
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
135
|
+
readonly anoncreds_credential_offer_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
136
|
+
len: import("ref-napi").Type<string | number>;
|
|
137
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
138
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
139
|
+
readonly anoncreds_revocation_registry_definition_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
140
|
+
len: import("ref-napi").Type<string | number>;
|
|
141
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
142
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
143
|
+
readonly anoncreds_revocation_registry_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
144
|
+
len: import("ref-napi").Type<string | number>;
|
|
145
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
146
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
147
|
+
readonly anoncreds_revocation_state_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
148
|
+
len: import("ref-napi").Type<string | number>;
|
|
149
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
150
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
151
|
+
readonly anoncreds_credential_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
152
|
+
len: import("ref-napi").Type<string | number>;
|
|
153
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
154
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
155
|
+
readonly anoncreds_credential_definition_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
156
|
+
len: import("ref-napi").Type<string | number>;
|
|
157
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
158
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
159
|
+
readonly anoncreds_credential_definition_private_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
160
|
+
len: import("ref-napi").Type<string | number>;
|
|
161
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
162
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
163
|
+
readonly anoncreds_revocation_registry_definition_private_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
164
|
+
len: import("ref-napi").Type<string | number>;
|
|
165
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
166
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
167
|
+
readonly anoncreds_revocation_registry_delta_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
168
|
+
len: import("ref-napi").Type<string | number>;
|
|
169
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
170
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
171
|
+
readonly anoncreds_key_correctness_proof_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
172
|
+
len: import("ref-napi").Type<string | number>;
|
|
173
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
174
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
175
|
+
readonly anoncreds_schema_from_json: readonly ["uint", readonly [import("ref-struct-di").StructType<{
|
|
176
|
+
len: import("ref-napi").Type<string | number>;
|
|
177
|
+
data: import("ref-napi").Type<import("ref-napi").Pointer<string | null>>;
|
|
178
|
+
}>, import("ref-napi").Type<import("ref-napi").Pointer<string | null>>]];
|
|
179
|
+
};
|