Pallet white paper
  • WALLET GUIDE
    • 1、Introduction
    • 2、Why Pallet 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
  • Pallet Wallet Lite API
  • Delegate interface and it's implementation relay on third-part APP
  • Pallet provides interface for the third-part APP
  1. DEVELOPERS
  2. 2、Wallet SDK Integration
  3. 2.1 Flutter SDK

Bridge API

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

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

Pallet Wallet Lite API

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

abstract class PalletDelegate {

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

  /// Get device id
  String getDeviceId();

  /// Get the current environment (pallet 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();
}

Pallet provides interface for the third-part APP

abstract class PalletModule {
  factory PalletModule() => PalletPalletModuleImpl();

  void setRootNavigatorKey(GlobalKey<NavigatorState> rootNavigatorKey);

  /// Configure AppDelegate, cold start must call
  void setPalletDelegate(PalletDelegate delegate);

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

  PalletDelegate 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> enterPalletHome(BuildContext context);

  /// Get the list of Pallet 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});
}
PreviousIntegration ArchitectureNextDevelop Guide

Last updated 1 year ago