Delegate interface and it's implementation relay on third-part APP
abstractclassBitverseDelegate {/// Get language, format: language-country, such as: en-USStringgetLang();/// Get device idStringgetDeviceId();/// Get the current environment (bitverse only has dev and prod environments)StringgetEnv();/// Set log proxyILogDelegategetLogDelegate();/// Check if biometrics are supportedFuture<bool> checkBiometrics();/// Biometric Authentication ResultsFuture<bool> authenticateBiometric();/// Track event reportingvoiduploadEvent(String eventName, {Map<String, dynamic>? properties});/// Check camera permissionsFuture<bool> checkCameraPermission();/// Scan pictures from photo albums and identify resultsFuture<String?> scanAlbum();}
Bitverse provides interface for the third-part APP
abstractclassBitverseModule {factoryBitverseModule() =>BitverseModuleImpl();voidsetRootNavigatorKey(GlobalKey<NavigatorState> rootNavigatorKey);/// Configure AppDelegate, cold start must callvoidsetBitverseDelegate(BitverseDelegate delegate);/// Lazy loading calls to Bitverse servicesFuture<void> ensureInited(Object? params);BitverseDelegateget delegate;/// Asynchronous initialization: handle non-time-consuming operations necessary on cold startFuture<void> onModuleAsyncInit(Object? params);/// Jump to the wallet homepage by routingFuture<void> enterBitverseHome(BuildContext context);/// Get the list of Bitverse walletsFuture<List<BWWallet>> getWalletList({BuildContext? context});/// Switch walletFuture<void> switchWallet({BuildContext? context, requiredString walletId});/// Get current selected walletFuture<String?> getCurrentWallet({BuildContext? context});/// Get a list of currently supported blockchainsFuture<List<BWBlockChain>> getChainList({BuildContext? context});/// Delete MPC wallet (jump wallet management page)Future<void> deleteWallet({BuildContext? context, requiredString walletId});/// Create MPC wallet (jump wallet creation & restoration page)Future<void> gotoCreateWallet({BuildContext? context, String? targetUrl});/// Create a MPC wallet and open it through a dialogFuture<void> gotoWalletCreateByDialog({BuildContext? context, String? targetUrl});/// Return wallet Homepage as widgetFuture<Widget> walletHome({BuildContext? context});/// Jump to wallet settings pageFuture<void> gotoUserSettings({BuildContext? context});/// Message signatureFuture<void> signPersonalMessage( {BuildContext? context,requiredString walletId,requiredint chainId,requiredString msg,Function({dynamic result, bool success})? onFinish});/// Typed signatureFuture<void> signTypedMessage( {BuildContext? context,requiredString walletId,requiredint chainId,requiredString msg,requiredString raw,requiredEip712TypedVersion version,Function({dynamic result, bool success})? onFinish});/// Transcation signatureFuture<void> signTransaction( {BuildContext? context,requiredString walletId,requiredint chainId,requiredString from,requiredString to,String? gas,String? gasPrice,String? value,String? data,Function({dynamic result, bool success})? onFinish});}