Skip to content

Commit

Permalink
updates libauk sskr iOS lib
Browse files Browse the repository at this point in the history
  • Loading branch information
thuyenBitmark authored and hvthhien committed Sep 23, 2022
1 parent 3ab410b commit 73e06d1
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion lib/libauk_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class WalletStorage {
}

Future<String> getAccountDIDSignature(String message) async {
Map res = await _channel.invokeMethod('getAccountDIDSignature', {"uuid": uuid, "message": message});
Map res = await _channel.invokeMethod(
'getAccountDIDSignature', {"uuid": uuid, "message": message});

return res["data"];
}
Expand Down Expand Up @@ -143,6 +144,34 @@ class WalletStorage {
Future<void> removeKeys() async {
await _channel.invokeMethod('removeKeys', {"uuid": uuid});
}

Future setupSSKR() async {
await _channel.invokeMethod('setupSSKR', {"uuid": uuid});
}

Future<String?> getShard(ShardType shardType) async {
Map res = await _channel.invokeMethod(
'getShard', {'uuid': uuid, 'shardType': shardType.intValue});
return res["data"];
}

Future removeShard(ShardType shardType) async {
await _channel.invokeMethod(
'removeShard', {"uuid": uuid, 'shardType': shardType.intValue});
}

Future restoreByBytewordShards(
List<String> shards, {
String? name,
DateTime? creationDate,
}) async {
await _channel.invokeMethod('restoreByBytewordShards', {
"uuid": uuid,
'shares': shards,
'name': name,
'date': creationDate?.millisecondsSinceEpoch
});
}
}

class TezosWallet {
Expand All @@ -152,3 +181,18 @@ class TezosWallet {

TezosWallet(this.address, this.secretKey, this.publicKey);
}

enum ShardType { Platform, ShardService, EmergencyContact }

extension ShardTypeExtension on ShardType {
int get intValue {
switch (this) {
case ShardType.Platform:
return 0;
case ShardType.ShardService:
return 1;
case ShardType.EmergencyContact:
return 2;
}
}
}

0 comments on commit 73e06d1

Please sign in to comment.