diff --git a/lib/libauk_dart.dart b/lib/libauk_dart.dart index f47dd6b..54ed892 100644 --- a/lib/libauk_dart.dart +++ b/lib/libauk_dart.dart @@ -52,7 +52,8 @@ class WalletStorage { } Future 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"]; } @@ -143,6 +144,34 @@ class WalletStorage { Future removeKeys() async { await _channel.invokeMethod('removeKeys', {"uuid": uuid}); } + + Future setupSSKR() async { + await _channel.invokeMethod('setupSSKR', {"uuid": uuid}); + } + + Future 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 shards, { + String? name, + DateTime? creationDate, + }) async { + await _channel.invokeMethod('restoreByBytewordShards', { + "uuid": uuid, + 'shares': shards, + 'name': name, + 'date': creationDate?.millisecondsSinceEpoch + }); + } } class TezosWallet { @@ -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; + } + } +}