Skip to content

Commit

Permalink
feat: add interface for new atSign management utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth committed Oct 7, 2024
1 parent 5736dbf commit 48c6d17
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
abstract class AtsignInformation {
String get atSign;
String get rootDomain;
}

// This will return a map which looks like:
//
// {
// "@alice": AtsignInformation{ atSign: "@alice", rootDomain: "root.atsign.org" },
// "@bob": AtsignInformation{ atSign: "@alice", rootDomain: "vip.ve.atsign.zone" },
// }
//
// Note: AtsignInformation is a class, so usage will look like
//
// var atSign = "@alice";
// var atSignInfo = await getAtsignEntries();
// var rootDomain = atSignInfo[atSign].rootDomain;
//
// Now you have the rootDomain for the existing atSign and can use it to onboard
// correctly

Future<Map<String, AtsignInformation>> getAtsignEntries() {
return Future.value({});
}

// This class will allow you to store atSign information
// you need to call this after onboarding a NEW atSign
Future<bool> saveAtsignInformation(AtsignInformation info) {
return Future.value(true);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Hand this method the atSign you wish to offboard
// Returns: a boolean, true = success, false = failed
Future<bool> preSignout(String atSign) async {
// We need to do the following before "signing out"
// - Wipe all application state
// - Remove the tray icon
return true;
}

0 comments on commit 48c6d17

Please sign in to comment.