Bitverse
Home
  • Wallet Guide
    • 1.Introduction
    • 2.Why Bitverse wallet
    • 3.Getting Started
  • DEVELOPERs
    • 1.White Paper
    • 2.Wallet SDK Integration
      • 2.1 Flutter SDK
        • Integration Architecture
        • Bridge API
        • Develop Guide
        • Example
        • Integration Case
      • 2.2 Deeplink
        • Android
        • iOS
        • NFT Query
    • 3.H5 Wallet Integration
    • 4.Plugin Wallet Integration
    • 5.Wallet APIs
  • COMMON PROBLEMS
    • 1.What Is a Decentralized Wallet?
    • 2.What is MPC wallet?
    • 3.How to prevent DApp Approve scams?
    • 4.What Is the Miner Fee?
Powered by GitBook
On this page
  • Module Description
  • Bitverse Wallet Lite API
  • Delegate interface and it's implementation relay on third-part APP
  • Bitverse provides interface for the third-part APP
  1. DEVELOPERs
  2. 2.Wallet SDK Integration
  3. 2.1 Flutter SDK

Bridge API

Use bitverse_wallet_lite to develop the bridging layer to connect third-party apps.

PreviousIntegration ArchitectureNextDevelop Guide

Last updated 2 years ago

The bitverse_wallet_lite() module acts as a bridging layer and is developed based on the thrio() routing framework. Bitverse-lite can be customized according to the framework used by third-party apps.

Module Description

Bitverse Wallet Lite API

Delegate interface and it's implementation relay on third-part APP

abstract class BitverseDelegate {

  /// Get language, format: language-country, such as: en-US
  String getLang();

  /// Get device id
  String getDeviceId();

  /// Get the current environment (bitverse only has dev and prod environments)
  String getEnv();

  /// Set log proxy
  ILogDelegate getLogDelegate();

  /// Check if biometrics are supported
  Future<bool> checkBiometrics();

  /// Biometric Authentication Results
  Future<bool> authenticateBiometric();

  /// Track event reporting
  void uploadEvent(String eventName, {Map<String, dynamic>? properties});

  /// Check camera permissions
  Future<bool> checkCameraPermission();

  /// Scan pictures from photo albums and identify results
  Future<String?> scanAlbum();
}

Bitverse provides interface for the third-part APP

abstract class BitverseModule {
  factory BitverseModule() => BitverseModuleImpl();

  void setRootNavigatorKey(GlobalKey<NavigatorState> rootNavigatorKey);

  /// Configure AppDelegate, cold start must call
  void setBitverseDelegate(BitverseDelegate delegate);

  /// Lazy loading calls to Bitverse services
  Future<void> ensureInited(Object? params);

  BitverseDelegate get delegate;

  /// Asynchronous initialization: handle non-time-consuming operations necessary on cold start
  Future<void> onModuleAsyncInit(Object? params);

  /// Jump to the wallet homepage by routing
  Future<void> enterBitverseHome(BuildContext context);

  /// Get the list of Bitverse wallets
  Future<List<BWWallet>> getWalletList({BuildContext? context});

  /// Switch wallet
  Future<void> switchWallet({BuildContext? context, required String walletId});

  /// Get current selected wallet
  Future<String?> getCurrentWallet({BuildContext? context});

  /// Get a list of currently supported blockchains
  Future<List<BWBlockChain>> getChainList({BuildContext? context});

  /// Delete MPC wallet (jump wallet management page)
  Future<void> deleteWallet({BuildContext? context, required String 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 dialog
  Future<void> gotoWalletCreateByDialog({BuildContext? context, String? targetUrl});

  /// Return wallet Homepage as widget
  Future<Widget> walletHome({BuildContext? context});

  /// Jump to wallet settings page
  Future<void> gotoUserSettings({BuildContext? context});

  /// Message signature
  Future<void> signPersonalMessage(
      {BuildContext? context,
      required String walletId,
      required int chainId,
      required String msg,
      Function({dynamic result, bool success})? onFinish});

  /// Typed signature
  Future<void> signTypedMessage(
      {BuildContext? context,
      required String walletId,
      required int chainId,
      required String msg,
      required String raw,
      required Eip712TypedVersion version,
      Function({dynamic result, bool success})? onFinish});

  /// Transcation signature
  Future<void> signTransaction(
      {BuildContext? context,
      required String walletId,
      required int chainId,
      required String from,
      required String to,
      String? gas,
      String? gasPrice,
      String? value,
      String? data,
      Function({dynamic result, bool success})? onFinish});
}
https://github.com/Bitverse-Pte/bitverse_wallet_lite
https://github.com/flutter-thrio/flutter_thrio