@procivis/react-native-one-core 1.94025.0 → 1.95657.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/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +47 -30
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +38 -38
- package/android/src/main/java/ch/procivis/one/core/Util.kt +3 -3
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +3 -3
- package/core-sdk.json +6 -6
- package/dist/src/config.d.ts +47 -33
- package/dist/src/config.js +63 -53
- package/dist/src/core.d.ts +7 -7
- package/dist/src/core.js +9 -7
- package/dist/src/one-core-uniffi-intf.d.ts +706 -692
- package/dist/src/one-core-uniffi-intf.js +357 -353
- package/ios/ProcivisOneCoreModule.m +16 -6
- package/ios/ProcivisOneCoreModule.swift +65 -38
- package/ios/RSEKeyStorage.swift +2 -2
- package/ios/Serialize.swift +12 -12
- package/ios/Util.swift +1 -1
- package/package.json +1 -1
|
@@ -21,13 +21,13 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
21
21
|
ReactContextBaseJavaModule(reactContext) {
|
|
22
22
|
override fun getName() = "ProcivisOneCoreModule"
|
|
23
23
|
|
|
24
|
-
private var oneCore:
|
|
24
|
+
private var oneCore: OneCoreInterface? = null
|
|
25
25
|
private var nfcHce: NfcHce = NfcHCE(reactContext)
|
|
26
26
|
private val scope = CoroutineScope(EmptyCoroutineContext)
|
|
27
27
|
|
|
28
|
-
private fun getCore():
|
|
29
|
-
return oneCore ?: throw
|
|
30
|
-
|
|
28
|
+
private fun getCore(): OneCoreInterface {
|
|
29
|
+
return oneCore ?: throw OneCoreException.Response(
|
|
30
|
+
ErrorResponse(
|
|
31
31
|
"BR_0184",
|
|
32
32
|
"core not initialized",
|
|
33
33
|
null
|
|
@@ -37,8 +37,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
37
37
|
|
|
38
38
|
private var ubiqu: UbiquKeyStorage? = null
|
|
39
39
|
private fun getUbiqu(): UbiquKeyStorage {
|
|
40
|
-
return ubiqu ?: throw
|
|
41
|
-
|
|
40
|
+
return ubiqu ?: throw OneCoreException.Response(
|
|
41
|
+
ErrorResponse(
|
|
42
42
|
"BR_0184",
|
|
43
43
|
"ubiqu not initialized",
|
|
44
44
|
null
|
|
@@ -54,7 +54,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
54
54
|
oneCore =
|
|
55
55
|
initializeCore(
|
|
56
56
|
context = context,
|
|
57
|
-
params =
|
|
57
|
+
params = InitParams(
|
|
58
58
|
configJson = configJson,
|
|
59
59
|
nativeSecureElement = AndroidKeyStoreKeyStorage(context),
|
|
60
60
|
remoteSecureElement = ubiqu,
|
|
@@ -85,9 +85,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@ReactMethod
|
|
88
|
-
fun runTask(task: String, promise: Promise) {
|
|
88
|
+
fun runTask(task: String, params: String?, promise: Promise) {
|
|
89
89
|
asyncCall(promise, scope) {
|
|
90
|
-
return@asyncCall getCore().runTask(task)
|
|
90
|
+
return@asyncCall getCore().runTask(task, params)
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -145,9 +145,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
@ReactMethod
|
|
148
|
-
fun
|
|
148
|
+
fun listDids(query: ReadableMap, promise: Promise) {
|
|
149
149
|
asyncCall(promise, scope) {
|
|
150
|
-
val dids = getCore().
|
|
150
|
+
val dids = getCore().listDids(construct(query))
|
|
151
151
|
return@asyncCall convertToRN(dids)
|
|
152
152
|
}
|
|
153
153
|
}
|
|
@@ -260,17 +260,17 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
260
260
|
) {
|
|
261
261
|
asyncCall(promise, scope) {
|
|
262
262
|
val submitCredentials =
|
|
263
|
-
mutableMapOf<String, List<
|
|
263
|
+
mutableMapOf<String, List<PresentationSubmitCredentialRequest>>()
|
|
264
264
|
for (entry in credentials.entryIterator) {
|
|
265
265
|
val credentialList = when (val credentialValue = entry.value) {
|
|
266
266
|
is ReadableMap -> {
|
|
267
267
|
// Single credential object - convert to list
|
|
268
|
-
listOf(construct<
|
|
268
|
+
listOf(construct<PresentationSubmitCredentialRequest>(credentialValue))
|
|
269
269
|
}
|
|
270
270
|
is ReadableArray -> {
|
|
271
271
|
// Array of credentials - convert each one
|
|
272
272
|
(0 until credentialValue.size()).map { index ->
|
|
273
|
-
construct<
|
|
273
|
+
construct<PresentationSubmitCredentialRequest>(credentialValue.getMap(index)!!)
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
else -> {
|
|
@@ -292,13 +292,13 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
292
292
|
) {
|
|
293
293
|
asyncCall(promise, scope) {
|
|
294
294
|
val submission =
|
|
295
|
-
mutableMapOf<String, List<
|
|
295
|
+
mutableMapOf<String, List<PresentationSubmitV2CredentialRequest>>()
|
|
296
296
|
for (entry in credentials.entryIterator) {
|
|
297
297
|
val credentialList = when (val credentialValue = entry.value) {
|
|
298
298
|
is ReadableMap -> {
|
|
299
299
|
// Single credential object - convert to list
|
|
300
300
|
listOf(
|
|
301
|
-
construct<
|
|
301
|
+
construct<PresentationSubmitV2CredentialRequest>(
|
|
302
302
|
credentialValue
|
|
303
303
|
)
|
|
304
304
|
)
|
|
@@ -307,7 +307,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
307
307
|
is ReadableArray -> {
|
|
308
308
|
// Array of credentials - convert each one
|
|
309
309
|
(0 until credentialValue.size()).map { index ->
|
|
310
|
-
construct<
|
|
310
|
+
construct<PresentationSubmitV2CredentialRequest>(
|
|
311
311
|
credentialValue.getMap(index)!!
|
|
312
312
|
)
|
|
313
313
|
}
|
|
@@ -328,9 +328,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
@ReactMethod
|
|
331
|
-
fun
|
|
331
|
+
fun listCredentials(query: ReadableMap, promise: Promise) {
|
|
332
332
|
asyncCall(promise, scope) {
|
|
333
|
-
val credentials = getCore().
|
|
333
|
+
val credentials = getCore().listCredentials(construct(query))
|
|
334
334
|
return@asyncCall convertToRN(credentials)
|
|
335
335
|
}
|
|
336
336
|
}
|
|
@@ -367,9 +367,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
@ReactMethod
|
|
370
|
-
fun
|
|
370
|
+
fun listCredentialSchemas(query: ReadableMap, promise: Promise) {
|
|
371
371
|
asyncCall(promise, scope) {
|
|
372
|
-
val schemas = getCore().
|
|
372
|
+
val schemas = getCore().listCredentialSchemas(construct(query))
|
|
373
373
|
return@asyncCall convertToRN(schemas)
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -406,9 +406,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
@ReactMethod
|
|
409
|
-
fun
|
|
409
|
+
fun listProofs(query: ReadableMap, promise: Promise) {
|
|
410
410
|
asyncCall(promise, scope) {
|
|
411
|
-
val proofs = getCore().
|
|
411
|
+
val proofs = getCore().listProofs(construct(query))
|
|
412
412
|
return@asyncCall convertToRN(proofs)
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -437,9 +437,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
@ReactMethod
|
|
440
|
-
fun
|
|
440
|
+
fun listProofSchemas(query: ReadableMap, promise: Promise) {
|
|
441
441
|
asyncCall(promise, scope) {
|
|
442
|
-
val schemas = getCore().
|
|
442
|
+
val schemas = getCore().listProofSchemas(construct(query))
|
|
443
443
|
return@asyncCall convertToRN(schemas)
|
|
444
444
|
}
|
|
445
445
|
}
|
|
@@ -481,9 +481,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
@ReactMethod
|
|
484
|
-
fun
|
|
484
|
+
fun listHistory(query: ReadableMap, promise: Promise) {
|
|
485
485
|
asyncCall(promise, scope) {
|
|
486
|
-
val history = getCore().
|
|
486
|
+
val history = getCore().listHistory(construct(query))
|
|
487
487
|
return@asyncCall convertToRN(history)
|
|
488
488
|
}
|
|
489
489
|
}
|
|
@@ -640,9 +640,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
640
640
|
@ReactMethod
|
|
641
641
|
fun deleteCache(types: ReadableArray?, promise: Promise) {
|
|
642
642
|
asyncCall(promise, scope) {
|
|
643
|
-
var cacheTypeList: List<
|
|
643
|
+
var cacheTypeList: List<CacheType>? = null;
|
|
644
644
|
if (types != null) {
|
|
645
|
-
cacheTypeList = enumList(types,
|
|
645
|
+
cacheTypeList = enumList(types, CacheType::valueOf)
|
|
646
646
|
}
|
|
647
647
|
getCore().deleteCache(cacheTypeList)
|
|
648
648
|
return@asyncCall null
|
|
@@ -652,7 +652,8 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
652
652
|
@ReactMethod
|
|
653
653
|
fun holderRegisterWalletUnit(request: ReadableMap, promise: Promise) {
|
|
654
654
|
asyncCall(promise, scope) {
|
|
655
|
-
|
|
655
|
+
val result = getCore().holderRegisterWalletUnit(construct(request))
|
|
656
|
+
return@asyncCall convertToRN(result)
|
|
656
657
|
}
|
|
657
658
|
}
|
|
658
659
|
|
|
@@ -664,6 +665,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
664
665
|
}
|
|
665
666
|
}
|
|
666
667
|
|
|
668
|
+
@ReactMethod
|
|
669
|
+
fun holderWalletUnitUpdate(walletUnitId: String, request: ReadableMap, promise: Promise) {
|
|
670
|
+
asyncCall(promise, scope) {
|
|
671
|
+
getCore().holderWalletUnitUpdate(walletUnitId, construct(request))
|
|
672
|
+
return@asyncCall null
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
667
676
|
@ReactMethod
|
|
668
677
|
fun holderGetWalletUnit(walletUnitId: String, promise: Promise) {
|
|
669
678
|
asyncCall(promise, scope) {
|
|
@@ -672,6 +681,14 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
672
681
|
}
|
|
673
682
|
}
|
|
674
683
|
|
|
684
|
+
@ReactMethod
|
|
685
|
+
fun holderGetWalletUnitTrustCollections(walletUnitId: String, promise: Promise) {
|
|
686
|
+
asyncCall(promise, scope) {
|
|
687
|
+
val result = getCore().holderGetWalletUnitTrustCollections(walletUnitId)
|
|
688
|
+
return@asyncCall convertToRN(result)
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
675
692
|
@ReactMethod
|
|
676
693
|
fun nfcReadIsoMdlEngagement(request: ReadableMap, promise: Promise) {
|
|
677
694
|
asyncCall(promise, scope) {
|
|
@@ -9,12 +9,12 @@ object SerializeSpecific {
|
|
|
9
9
|
object Obj {
|
|
10
10
|
private val CustomConversionTypes =
|
|
11
11
|
arrayOf(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
HistoryMetadata::class.java,
|
|
13
|
+
ClaimValue::class.java,
|
|
14
|
+
ProofClaimValue::class.java,
|
|
15
|
+
ApplicableCredentialOrFailureHint::class.java,
|
|
16
|
+
PresentationDefinitionV2ClaimValue::class.java,
|
|
17
|
+
HandleInvitationResponse::class.java,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
fun isCustomConversionType(input: Any?): Boolean {
|
|
@@ -27,31 +27,31 @@ object SerializeSpecific {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
fun convertCustom(input: Any): ReadableMap {
|
|
30
|
-
if (input is
|
|
30
|
+
if (input is HistoryMetadata) {
|
|
31
31
|
return historyMetadata(input)
|
|
32
32
|
}
|
|
33
|
-
if (input is
|
|
33
|
+
if (input is ClaimValue) {
|
|
34
34
|
return claimValue(input)
|
|
35
35
|
}
|
|
36
|
-
if (input is
|
|
36
|
+
if (input is ProofClaimValue) {
|
|
37
37
|
return proofClaimValue(input)
|
|
38
38
|
}
|
|
39
|
-
if (input is
|
|
39
|
+
if (input is ApplicableCredentialOrFailureHint) {
|
|
40
40
|
return credentialQuery(input)
|
|
41
41
|
}
|
|
42
|
-
if (input is
|
|
42
|
+
if (input is PresentationDefinitionV2ClaimValue) {
|
|
43
43
|
return presentationDefinitionV2ClaimValue(input)
|
|
44
44
|
}
|
|
45
|
-
if (input is
|
|
45
|
+
if (input is HandleInvitationResponse) {
|
|
46
46
|
return invitationResponse(input)
|
|
47
47
|
}
|
|
48
48
|
throw IllegalArgumentException("Invalid map conversion: $input")
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
private fun historyMetadata(metadata:
|
|
51
|
+
private fun historyMetadata(metadata: HistoryMetadata): ReadableMap {
|
|
52
52
|
val result = Arguments.createMap()
|
|
53
53
|
when (metadata) {
|
|
54
|
-
is
|
|
54
|
+
is HistoryMetadata.UnexportableEntities -> {
|
|
55
55
|
result.putString("type_", "UNEXPORTABLE_ENTITIES")
|
|
56
56
|
result.putMap(
|
|
57
57
|
"value",
|
|
@@ -59,7 +59,7 @@ object SerializeSpecific {
|
|
|
59
59
|
)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
is
|
|
62
|
+
is HistoryMetadata.ErrorMetadata -> {
|
|
63
63
|
result.putString("type_", "ERROR_METADATA")
|
|
64
64
|
result.putMap(
|
|
65
65
|
"value",
|
|
@@ -67,7 +67,7 @@ object SerializeSpecific {
|
|
|
67
67
|
)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
is
|
|
70
|
+
is HistoryMetadata.WalletUnitJwt -> {
|
|
71
71
|
result.putString("type_", "WALLET_UNIT_JWT")
|
|
72
72
|
val values = Arguments.createArray()
|
|
73
73
|
values.pushString(metadata.v1)
|
|
@@ -77,10 +77,10 @@ object SerializeSpecific {
|
|
|
77
77
|
return result
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
private fun credentialQuery(query:
|
|
80
|
+
private fun credentialQuery(query: ApplicableCredentialOrFailureHint): ReadableMap {
|
|
81
81
|
val result = Arguments.createMap()
|
|
82
82
|
when (query) {
|
|
83
|
-
is
|
|
83
|
+
is ApplicableCredentialOrFailureHint.ApplicableCredentials -> {
|
|
84
84
|
result.putString("type_", "APPLICABLE_CREDENTIALS")
|
|
85
85
|
result.putArray(
|
|
86
86
|
"applicableCredentials",
|
|
@@ -88,7 +88,7 @@ object SerializeSpecific {
|
|
|
88
88
|
)
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
is
|
|
91
|
+
is ApplicableCredentialOrFailureHint.FailureHint -> {
|
|
92
92
|
result.putString("type_", "FAILURE_HINT")
|
|
93
93
|
result.putMap("failureHint", convertToRN(query.failureHint) as ReadableMap)
|
|
94
94
|
}
|
|
@@ -96,20 +96,20 @@ object SerializeSpecific {
|
|
|
96
96
|
return result
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
private fun claimValue(value:
|
|
99
|
+
private fun claimValue(value: ClaimValue): ReadableMap {
|
|
100
100
|
val result = Arguments.createMap()
|
|
101
101
|
when (value) {
|
|
102
|
-
is
|
|
102
|
+
is ClaimValue.Boolean -> {
|
|
103
103
|
result.putString("type_", "BOOLEAN")
|
|
104
104
|
result.putBoolean("value", value.value)
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
is
|
|
107
|
+
is ClaimValue.Float -> {
|
|
108
108
|
result.putString("type_", "FLOAT")
|
|
109
109
|
result.putDouble("value", value.value)
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
is
|
|
112
|
+
is ClaimValue.Integer -> {
|
|
113
113
|
result.putString("type_", "INTEGER")
|
|
114
114
|
if (value.value < Int.MIN_VALUE || value.value > Int.MAX_VALUE) {
|
|
115
115
|
result.putDouble("value", value.value.toDouble())
|
|
@@ -118,12 +118,12 @@ object SerializeSpecific {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
is
|
|
121
|
+
is ClaimValue.String -> {
|
|
122
122
|
result.putString("type_", "STRING")
|
|
123
123
|
result.putString("value", value.value)
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
is
|
|
126
|
+
is ClaimValue.Nested -> {
|
|
127
127
|
result.putString("type_", "NESTED")
|
|
128
128
|
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
129
129
|
}
|
|
@@ -131,15 +131,15 @@ object SerializeSpecific {
|
|
|
131
131
|
return result
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
private fun proofClaimValue(value:
|
|
134
|
+
private fun proofClaimValue(value: ProofClaimValue): ReadableMap {
|
|
135
135
|
val result = Arguments.createMap()
|
|
136
136
|
when (value) {
|
|
137
|
-
is
|
|
137
|
+
is ProofClaimValue.Value -> {
|
|
138
138
|
result.putString("type_", "VALUE")
|
|
139
139
|
result.putString("value", value.value)
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
is
|
|
142
|
+
is ProofClaimValue.Claims -> {
|
|
143
143
|
result.putString("type_", "CLAIMS")
|
|
144
144
|
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
145
145
|
}
|
|
@@ -147,20 +147,20 @@ object SerializeSpecific {
|
|
|
147
147
|
return result
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
private fun presentationDefinitionV2ClaimValue(value:
|
|
150
|
+
private fun presentationDefinitionV2ClaimValue(value: PresentationDefinitionV2ClaimValue): ReadableMap {
|
|
151
151
|
val result = Arguments.createMap()
|
|
152
152
|
when (value) {
|
|
153
|
-
is
|
|
153
|
+
is PresentationDefinitionV2ClaimValue.Boolean -> {
|
|
154
154
|
result.putString("type_", "BOOLEAN")
|
|
155
155
|
result.putBoolean("value", value.value)
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
is
|
|
158
|
+
is PresentationDefinitionV2ClaimValue.Float -> {
|
|
159
159
|
result.putString("type_", "FLOAT")
|
|
160
160
|
result.putDouble("value", value.value)
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
is
|
|
163
|
+
is PresentationDefinitionV2ClaimValue.Integer -> {
|
|
164
164
|
result.putString("type_", "INTEGER")
|
|
165
165
|
if (value.value < Int.MIN_VALUE || value.value > Int.MAX_VALUE) {
|
|
166
166
|
result.putDouble("value", value.value.toDouble())
|
|
@@ -169,12 +169,12 @@ object SerializeSpecific {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
is
|
|
172
|
+
is PresentationDefinitionV2ClaimValue.String -> {
|
|
173
173
|
result.putString("type_", "STRING")
|
|
174
174
|
result.putString("value", value.value)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
is
|
|
177
|
+
is PresentationDefinitionV2ClaimValue.Nested -> {
|
|
178
178
|
result.putString("type_", "NESTED")
|
|
179
179
|
result.putArray("value", convertToRN(value.value) as ReadableArray)
|
|
180
180
|
}
|
|
@@ -182,10 +182,10 @@ object SerializeSpecific {
|
|
|
182
182
|
return result
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
private fun invitationResponse(value:
|
|
185
|
+
private fun invitationResponse(value: HandleInvitationResponse): ReadableMap {
|
|
186
186
|
val result = Arguments.createMap()
|
|
187
187
|
when (value) {
|
|
188
|
-
is
|
|
188
|
+
is HandleInvitationResponse.CredentialIssuance -> {
|
|
189
189
|
result.putString("type_", "CREDENTIAL_ISSUANCE")
|
|
190
190
|
result.putString("interactionId", value.interactionId)
|
|
191
191
|
value.keyStorageSecurityLevels?.let {
|
|
@@ -204,14 +204,14 @@ object SerializeSpecific {
|
|
|
204
204
|
result.putBoolean("requiresWalletInstanceAttestation", value.requiresWalletInstanceAttestation)
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
is
|
|
207
|
+
is HandleInvitationResponse.AuthorizationCodeFlow -> {
|
|
208
208
|
result.putString("type_", "AUTHORIZATION_CODE_FLOW")
|
|
209
209
|
result.putString("interactionId", value.interactionId)
|
|
210
210
|
result.putString("authorizationCodeFlowUrl", value.authorizationCodeFlowUrl)
|
|
211
211
|
result.putString("protocol", value.protocol)
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
is
|
|
214
|
+
is HandleInvitationResponse.ProofRequest -> {
|
|
215
215
|
result.putString("type_", "PROOF_REQUEST")
|
|
216
216
|
result.putString("interactionId", value.interactionId)
|
|
217
217
|
result.putString("proofId", value.proofId)
|
|
@@ -13,7 +13,7 @@ object Util {
|
|
|
13
13
|
override fun run() {
|
|
14
14
|
try {
|
|
15
15
|
promise.resolve(function())
|
|
16
|
-
} catch (error:
|
|
16
|
+
} catch (error: OneCoreException.Response) {
|
|
17
17
|
handleBindingException(promise, error)
|
|
18
18
|
} catch (error: Throwable) {
|
|
19
19
|
promise.reject(error)
|
|
@@ -26,7 +26,7 @@ object Util {
|
|
|
26
26
|
scope.launch {
|
|
27
27
|
try {
|
|
28
28
|
promise.resolve(function())
|
|
29
|
-
} catch (error:
|
|
29
|
+
} catch (error: OneCoreException.Response) {
|
|
30
30
|
handleBindingException(promise, error)
|
|
31
31
|
} catch (error: Throwable) {
|
|
32
32
|
promise.reject(error)
|
|
@@ -34,7 +34,7 @@ object Util {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
private fun handleBindingException(promise: Promise, error:
|
|
37
|
+
private fun handleBindingException(promise: Promise, error: OneCoreException.Response) {
|
|
38
38
|
val userInfo = Arguments.createMap()
|
|
39
39
|
val cause = error.data.cause?.message
|
|
40
40
|
if (!cause.isNullOrEmpty()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
package ch.procivis.one.core.ubiqu
|
|
2
2
|
|
|
3
|
-
import ch.procivis.one.core.
|
|
3
|
+
import ch.procivis.one.core.GeneratedKey
|
|
4
4
|
import ch.procivis.one.core.NativeKeyStorage
|
|
5
5
|
import ch.procivis.one.core.NativeKeyStorageException
|
|
6
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -12,7 +12,7 @@ class UbiquKeyStorage(private val context: ReactApplicationContext) : NativeKeyS
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// ==== NativeKeyStorage interface
|
|
15
|
-
override suspend fun generateKey(keyAlias: String):
|
|
15
|
+
override suspend fun generateKey(keyAlias: String): GeneratedKey {
|
|
16
16
|
throw NativeKeyStorageException.Unsupported()
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ class UbiquKeyStorage(private val context: ReactApplicationContext) : NativeKeyS
|
|
|
24
24
|
throw NativeKeyStorageException.Unsupported()
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
override suspend fun generateAttestationKey(keyAlias: String, nonce: String?):
|
|
27
|
+
override suspend fun generateAttestationKey(keyAlias: String, nonce: String?): GeneratedKey {
|
|
28
28
|
throw NativeKeyStorageException.Unsupported()
|
|
29
29
|
}
|
|
30
30
|
|
package/core-sdk.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"android": {
|
|
3
3
|
"debug": {
|
|
4
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
5
|
-
"sha1": "
|
|
4
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/95657/android/onecore-debug.aar",
|
|
5
|
+
"sha1": "e1a86a1459e3428ff14b4db6f97932bf8694e0b0"
|
|
6
6
|
},
|
|
7
7
|
"release": {
|
|
8
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
9
|
-
"sha1": "
|
|
8
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/95657/android/onecore-release.aar",
|
|
9
|
+
"sha1": "bee4052f721fb391564c1830ecf7165859307ed2"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"ios": {
|
|
13
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
14
|
-
"sha1": "
|
|
13
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/95657/ios/deploy.zip",
|
|
14
|
+
"sha1": "7d84d6f9f1d142ed955865aa9df76c12d73626df"
|
|
15
15
|
}
|
|
16
16
|
}
|