> For the complete documentation index, see [llms.txt](https://pallet-1.gitbook.io/pallet-white-paper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pallet-1.gitbook.io/pallet-white-paper/developers/2-wallet-sdk-integration/2.1-flutter-sdk/bridge-api.md).

# Bridge API

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});
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pallet-1.gitbook.io/pallet-white-paper/developers/2-wallet-sdk-integration/2.1-flutter-sdk/bridge-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
