@succinctlabs/react-native-zcam1 0.3.0 → 0.4.0-alpha.2
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/Zcam1Sdk.podspec +2 -2
- package/android/CMakeLists.txt +114 -0
- package/android/build.gradle +213 -0
- package/android/cpp-adapter-proving.cpp +35 -0
- package/android/cpp-adapter.cpp +35 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CaptureModule.kt +156 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CapturePackage.kt +38 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingModule.kt +43 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingPackage.kt +34 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkModule.kt +43 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkPackage.kt +34 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/CameraUtils.kt +80 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraService.kt +588 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraView.kt +107 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraViewManager.kt +33 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1OrientationManager.kt +73 -0
- package/cpp/generated/zcam1_c2pa_utils.cpp +170 -365
- package/cpp/generated/zcam1_c2pa_utils.hpp +0 -4
- package/cpp/generated/zcam1_certs_utils.cpp +121 -250
- package/cpp/generated/zcam1_common.cpp +1871 -0
- package/cpp/generated/zcam1_common.hpp +52 -0
- package/cpp/generated/zcam1_verify_utils.cpp +138 -265
- package/cpp/generated/zcam1_verify_utils.hpp +2 -2
- package/cpp/proving/generated/zcam1_common.cpp +1871 -0
- package/cpp/proving/generated/zcam1_common.hpp +52 -0
- package/cpp/proving/generated/zcam1_proving_utils.cpp +355 -417
- package/cpp/proving/generated/zcam1_proving_utils.hpp +13 -17
- package/cpp/proving/zcam1-proving.cpp +2 -0
- package/cpp/zcam1-sdk.cpp +2 -0
- package/lib/module/bindings.js +4 -0
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/camera.js +71 -13
- package/lib/module/camera.js.map +1 -1
- package/lib/module/capture.js +115 -38
- package/lib/module/capture.js.map +1 -1
- package/lib/module/common.js +18 -2
- package/lib/module/common.js.map +1 -1
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_c2pa_utils.js +117 -9
- package/lib/module/generated/zcam1_c2pa_utils.js.map +1 -1
- package/lib/module/generated/zcam1_certs_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_certs_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_certs_utils.js +6 -2
- package/lib/module/generated/zcam1_certs_utils.js.map +1 -1
- package/lib/module/generated/zcam1_common-ffi.js +47 -0
- package/lib/module/generated/zcam1_common-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_common.js +60 -0
- package/lib/module/generated/zcam1_common.js.map +1 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_proving_utils.js +53 -46
- package/lib/module/generated/zcam1_proving_utils.js.map +1 -1
- package/lib/module/generated/zcam1_verify_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_verify_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_verify_utils.js +70 -22
- package/lib/module/generated/zcam1_verify_utils.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/proving/NativeZcam1Proving.js +1 -1
- package/lib/module/proving/index.js +1 -1
- package/lib/module/proving/index.js.map +1 -1
- package/lib/module/proving/prove.js +14 -8
- package/lib/module/proving/prove.js.map +1 -1
- package/lib/module/utils.js +19 -14
- package/lib/module/utils.js.map +1 -1
- package/lib/module/verify.js +14 -22
- package/lib/module/verify.js.map +1 -1
- package/lib/typescript/src/bindings.d.ts +3 -0
- package/lib/typescript/src/bindings.d.ts.map +1 -1
- package/lib/typescript/src/camera.d.ts +15 -0
- package/lib/typescript/src/camera.d.ts.map +1 -1
- package/lib/typescript/src/capture.d.ts +40 -1
- package/lib/typescript/src/capture.d.ts.map +1 -1
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts +37 -46
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts +110 -8
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts +27 -32
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_certs_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_common-ffi.d.ts +77 -0
- package/lib/typescript/src/generated/zcam1_common-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_common.d.ts +17 -0
- package/lib/typescript/src/generated/zcam1_common.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts +44 -51
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts +26 -26
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts +29 -34
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts +94 -14
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/proving/NativeZcam1Proving.d.ts +1 -1
- package/lib/typescript/src/proving/index.d.ts +1 -1
- package/lib/typescript/src/proving/index.d.ts.map +1 -1
- package/lib/typescript/src/proving/prove.d.ts +3 -3
- package/lib/typescript/src/proving/prove.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/verify.d.ts +4 -3
- package/lib/typescript/src/verify.d.ts.map +1 -1
- package/package.json +13 -6
- package/react-native.config.js +11 -0
- package/src/bindings.tsx +4 -0
- package/src/camera.tsx +116 -11
- package/src/capture.tsx +150 -53
- package/src/common.tsx +22 -2
- package/src/generated/zcam1_c2pa_utils-ffi.ts +42 -56
- package/src/generated/zcam1_c2pa_utils.ts +224 -67
- package/src/generated/zcam1_certs_utils-ffi.ts +33 -36
- package/src/generated/zcam1_certs_utils.ts +27 -24
- package/src/generated/zcam1_common-ffi.ts +183 -0
- package/src/generated/zcam1_common.ts +116 -0
- package/src/generated/zcam1_proving_utils-ffi.ts +54 -67
- package/src/generated/zcam1_proving_utils.ts +133 -138
- package/src/generated/zcam1_verify_utils-ffi.ts +39 -40
- package/src/generated/zcam1_verify_utils.ts +109 -47
- package/src/index.ts +1 -1
- package/src/proving/NativeZcam1Proving.ts +2 -2
- package/src/proving/index.ts +1 -1
- package/src/proving/prove.tsx +22 -11
- package/src/utils.ts +26 -20
- package/src/verify.tsx +25 -42
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
2
2
|
// Trust me, you don't want to mess with it!
|
|
3
3
|
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
4
8
|
import {
|
|
5
9
|
type StructuralEquality as UniffiStructuralEquality,
|
|
6
10
|
type UniffiForeignFuture as RuntimeUniffiForeignFuture,
|
|
7
11
|
type UniffiRustCallStatus,
|
|
8
|
-
type
|
|
12
|
+
type UniffiGcObject,
|
|
9
13
|
type UniffiRustFutureContinuationCallback as RuntimeUniffiRustFutureContinuationCallback,
|
|
10
14
|
type UniffiResult,
|
|
11
15
|
} from "uniffi-bindgen-react-native";
|
|
@@ -23,35 +27,35 @@ interface NativeModuleInterface {
|
|
|
23
27
|
buffer: Uint8Array,
|
|
24
28
|
uniffi_out_err: UniffiRustCallStatus,
|
|
25
29
|
): string;
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
ubrn_uniffi_zcam1_proving_utils_fn_clone_provingclient(
|
|
31
|
+
handle: bigint,
|
|
28
32
|
uniffi_out_err: UniffiRustCallStatus,
|
|
29
33
|
): bigint;
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
ubrn_uniffi_zcam1_proving_utils_fn_free_provingclient(
|
|
35
|
+
handle: bigint,
|
|
32
36
|
uniffi_out_err: UniffiRustCallStatus,
|
|
33
37
|
): void;
|
|
34
|
-
|
|
38
|
+
ubrn_uniffi_zcam1_proving_utils_fn_constructor_provingclient_new(
|
|
39
|
+
privateKey: Uint8Array,
|
|
35
40
|
callback: Uint8Array,
|
|
41
|
+
networkMode: Uint8Array,
|
|
36
42
|
uniffi_out_err: UniffiRustCallStatus,
|
|
37
43
|
): bigint;
|
|
38
|
-
|
|
39
|
-
privateKey: Uint8Array,
|
|
44
|
+
ubrn_uniffi_zcam1_proving_utils_fn_constructor_provingclient_simulator(
|
|
40
45
|
callback: Uint8Array,
|
|
41
|
-
networkMode: Uint8Array,
|
|
42
46
|
uniffi_out_err: UniffiRustCallStatus,
|
|
43
47
|
): bigint;
|
|
44
|
-
|
|
48
|
+
ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_get_proof_status(
|
|
45
49
|
ptr: bigint,
|
|
46
50
|
requestId: Uint8Array,
|
|
47
51
|
): bigint;
|
|
48
|
-
|
|
52
|
+
ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_request_proof(
|
|
49
53
|
ptr: bigint,
|
|
50
54
|
filePath: Uint8Array,
|
|
51
55
|
format: Uint8Array,
|
|
52
|
-
|
|
56
|
+
production: number,
|
|
53
57
|
): bigint;
|
|
54
|
-
|
|
58
|
+
ubrn_uniffi_zcam1_proving_utils_fn_method_provingclient_vk_hash(
|
|
55
59
|
ptr: bigint,
|
|
56
60
|
uniffi_out_err: UniffiRustCallStatus,
|
|
57
61
|
): Uint8Array;
|
|
@@ -168,17 +172,6 @@ interface NativeModuleInterface {
|
|
|
168
172
|
handle: bigint,
|
|
169
173
|
uniffi_out_err: UniffiRustCallStatus,
|
|
170
174
|
): number;
|
|
171
|
-
ubrn_ffi_zcam1_proving_utils_rust_future_poll_pointer(
|
|
172
|
-
handle: bigint,
|
|
173
|
-
callback: UniffiRustFutureContinuationCallback,
|
|
174
|
-
callbackData: bigint,
|
|
175
|
-
): void;
|
|
176
|
-
ubrn_ffi_zcam1_proving_utils_rust_future_cancel_pointer(handle: bigint): void;
|
|
177
|
-
ubrn_ffi_zcam1_proving_utils_rust_future_free_pointer(handle: bigint): void;
|
|
178
|
-
ubrn_ffi_zcam1_proving_utils_rust_future_complete_pointer(
|
|
179
|
-
handle: bigint,
|
|
180
|
-
uniffi_out_err: UniffiRustCallStatus,
|
|
181
|
-
): bigint;
|
|
182
175
|
ubrn_ffi_zcam1_proving_utils_rust_future_poll_rust_buffer(
|
|
183
176
|
handle: bigint,
|
|
184
177
|
callback: UniffiRustFutureContinuationCallback,
|
|
@@ -201,17 +194,17 @@ interface NativeModuleInterface {
|
|
|
201
194
|
handle: bigint,
|
|
202
195
|
uniffi_out_err: UniffiRustCallStatus,
|
|
203
196
|
): void;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
197
|
+
ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_get_proof_status(): number;
|
|
198
|
+
ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_request_proof(): number;
|
|
199
|
+
ubrn_uniffi_zcam1_proving_utils_checksum_method_provingclient_vk_hash(): number;
|
|
200
|
+
ubrn_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_new(): number;
|
|
201
|
+
ubrn_uniffi_zcam1_proving_utils_checksum_constructor_provingclient_simulator(): number;
|
|
209
202
|
ubrn_uniffi_zcam1_proving_utils_checksum_method_initialized_initialized(): number;
|
|
210
203
|
ubrn_ffi_zcam1_proving_utils_uniffi_contract_version(): number;
|
|
211
|
-
|
|
204
|
+
ubrn_uniffi_internal_fn_method_provingclient_ffi__bless_pointer(
|
|
212
205
|
pointer: bigint,
|
|
213
206
|
uniffi_out_err: UniffiRustCallStatus,
|
|
214
|
-
):
|
|
207
|
+
): UniffiGcObject;
|
|
215
208
|
}
|
|
216
209
|
|
|
217
210
|
// Casting globalThis to any allows us to look for `NativeZcam1ProvingUtils`
|
|
@@ -224,119 +217,113 @@ export default getter;
|
|
|
224
217
|
|
|
225
218
|
// Structs and function types for calling back into Typescript from Rust.
|
|
226
219
|
export type UniffiRustFutureContinuationCallback = (data: bigint, pollResult: number) => void;
|
|
227
|
-
type
|
|
220
|
+
export type UniffiForeignFutureDroppedCallback = (handle: bigint) => void;
|
|
228
221
|
type UniffiCallbackInterfaceFree = (handle: bigint) => void;
|
|
229
|
-
|
|
222
|
+
type UniffiCallbackInterfaceClone = (handle: bigint) => UniffiResult<void>;
|
|
223
|
+
export type UniffiForeignFutureDroppedCallbackStruct = {
|
|
230
224
|
handle: bigint;
|
|
231
|
-
free:
|
|
225
|
+
free: UniffiForeignFutureDroppedCallback;
|
|
232
226
|
};
|
|
233
|
-
export type
|
|
227
|
+
export type UniffiForeignFutureResultU8 = {
|
|
234
228
|
returnValue: number;
|
|
235
229
|
callStatus: UniffiRustCallStatus;
|
|
236
230
|
};
|
|
237
231
|
export type UniffiForeignFutureCompleteU8 = (
|
|
238
232
|
callbackData: bigint,
|
|
239
|
-
result:
|
|
233
|
+
result: UniffiForeignFutureResultU8,
|
|
240
234
|
) => void;
|
|
241
|
-
export type
|
|
235
|
+
export type UniffiForeignFutureResultI8 = {
|
|
242
236
|
returnValue: number;
|
|
243
237
|
callStatus: UniffiRustCallStatus;
|
|
244
238
|
};
|
|
245
239
|
export type UniffiForeignFutureCompleteI8 = (
|
|
246
240
|
callbackData: bigint,
|
|
247
|
-
result:
|
|
241
|
+
result: UniffiForeignFutureResultI8,
|
|
248
242
|
) => void;
|
|
249
|
-
export type
|
|
243
|
+
export type UniffiForeignFutureResultU16 = {
|
|
250
244
|
returnValue: number;
|
|
251
245
|
callStatus: UniffiRustCallStatus;
|
|
252
246
|
};
|
|
253
247
|
export type UniffiForeignFutureCompleteU16 = (
|
|
254
248
|
callbackData: bigint,
|
|
255
|
-
result:
|
|
249
|
+
result: UniffiForeignFutureResultU16,
|
|
256
250
|
) => void;
|
|
257
|
-
export type
|
|
251
|
+
export type UniffiForeignFutureResultI16 = {
|
|
258
252
|
returnValue: number;
|
|
259
253
|
callStatus: UniffiRustCallStatus;
|
|
260
254
|
};
|
|
261
255
|
export type UniffiForeignFutureCompleteI16 = (
|
|
262
256
|
callbackData: bigint,
|
|
263
|
-
result:
|
|
257
|
+
result: UniffiForeignFutureResultI16,
|
|
264
258
|
) => void;
|
|
265
|
-
export type
|
|
259
|
+
export type UniffiForeignFutureResultU32 = {
|
|
266
260
|
returnValue: number;
|
|
267
261
|
callStatus: UniffiRustCallStatus;
|
|
268
262
|
};
|
|
269
263
|
export type UniffiForeignFutureCompleteU32 = (
|
|
270
264
|
callbackData: bigint,
|
|
271
|
-
result:
|
|
265
|
+
result: UniffiForeignFutureResultU32,
|
|
272
266
|
) => void;
|
|
273
|
-
export type
|
|
267
|
+
export type UniffiForeignFutureResultI32 = {
|
|
274
268
|
returnValue: number;
|
|
275
269
|
callStatus: UniffiRustCallStatus;
|
|
276
270
|
};
|
|
277
271
|
export type UniffiForeignFutureCompleteI32 = (
|
|
278
272
|
callbackData: bigint,
|
|
279
|
-
result:
|
|
273
|
+
result: UniffiForeignFutureResultI32,
|
|
280
274
|
) => void;
|
|
281
|
-
export type
|
|
275
|
+
export type UniffiForeignFutureResultU64 = {
|
|
282
276
|
returnValue: bigint;
|
|
283
277
|
callStatus: UniffiRustCallStatus;
|
|
284
278
|
};
|
|
285
279
|
export type UniffiForeignFutureCompleteU64 = (
|
|
286
280
|
callbackData: bigint,
|
|
287
|
-
result:
|
|
281
|
+
result: UniffiForeignFutureResultU64,
|
|
288
282
|
) => void;
|
|
289
|
-
export type
|
|
283
|
+
export type UniffiForeignFutureResultI64 = {
|
|
290
284
|
returnValue: bigint;
|
|
291
285
|
callStatus: UniffiRustCallStatus;
|
|
292
286
|
};
|
|
293
287
|
export type UniffiForeignFutureCompleteI64 = (
|
|
294
288
|
callbackData: bigint,
|
|
295
|
-
result:
|
|
289
|
+
result: UniffiForeignFutureResultI64,
|
|
296
290
|
) => void;
|
|
297
|
-
export type
|
|
291
|
+
export type UniffiForeignFutureResultF32 = {
|
|
298
292
|
returnValue: number;
|
|
299
293
|
callStatus: UniffiRustCallStatus;
|
|
300
294
|
};
|
|
301
295
|
export type UniffiForeignFutureCompleteF32 = (
|
|
302
296
|
callbackData: bigint,
|
|
303
|
-
result:
|
|
297
|
+
result: UniffiForeignFutureResultF32,
|
|
304
298
|
) => void;
|
|
305
|
-
export type
|
|
299
|
+
export type UniffiForeignFutureResultF64 = {
|
|
306
300
|
returnValue: number;
|
|
307
301
|
callStatus: UniffiRustCallStatus;
|
|
308
302
|
};
|
|
309
303
|
export type UniffiForeignFutureCompleteF64 = (
|
|
310
304
|
callbackData: bigint,
|
|
311
|
-
result:
|
|
305
|
+
result: UniffiForeignFutureResultF64,
|
|
312
306
|
) => void;
|
|
313
|
-
export type
|
|
314
|
-
returnValue: bigint;
|
|
315
|
-
callStatus: UniffiRustCallStatus;
|
|
316
|
-
};
|
|
317
|
-
export type UniffiForeignFutureCompletePointer = (
|
|
318
|
-
callbackData: bigint,
|
|
319
|
-
result: UniffiForeignFutureStructPointer,
|
|
320
|
-
) => void;
|
|
321
|
-
export type UniffiForeignFutureStructRustBuffer = {
|
|
307
|
+
export type UniffiForeignFutureResultRustBuffer = {
|
|
322
308
|
returnValue: Uint8Array;
|
|
323
309
|
callStatus: UniffiRustCallStatus;
|
|
324
310
|
};
|
|
325
311
|
export type UniffiForeignFutureCompleteRustBuffer = (
|
|
326
312
|
callbackData: bigint,
|
|
327
|
-
result:
|
|
313
|
+
result: UniffiForeignFutureResultRustBuffer,
|
|
328
314
|
) => void;
|
|
329
|
-
export type
|
|
315
|
+
export type UniffiForeignFutureResultVoid = {
|
|
330
316
|
callStatus: UniffiRustCallStatus;
|
|
331
317
|
};
|
|
332
318
|
export type UniffiForeignFutureCompleteVoid = (
|
|
333
319
|
callbackData: bigint,
|
|
334
|
-
result:
|
|
320
|
+
result: UniffiForeignFutureResultVoid,
|
|
335
321
|
) => void;
|
|
336
322
|
type UniffiCallbackInterfaceInitializedMethod0 = (uniffiHandle: bigint) => UniffiResult<void>;
|
|
337
323
|
export type UniffiVTableCallbackInterfaceInitialized = {
|
|
338
|
-
initialized: UniffiCallbackInterfaceInitializedMethod0;
|
|
339
324
|
uniffiFree: UniffiCallbackInterfaceFree;
|
|
325
|
+
uniffiClone: UniffiCallbackInterfaceClone;
|
|
326
|
+
initialized: UniffiCallbackInterfaceInitializedMethod0;
|
|
340
327
|
};
|
|
341
328
|
|
|
342
329
|
// UniffiRustFutureContinuationCallback is generated as part of the component interface's
|