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
  • Wallet Pre Configuration
  • Android Configuration
  • iOS Configuration
  • Step 1: Add dependency in pubspec.yaml
  • Step 2: Register Pallet Module in module.dart
  • Step 3: Init Pallet Wallet SDK
  • Step 4: Invoke Wallet APIs when need
  1. DEVELOPERS
  2. 2、Wallet SDK Integration
  3. 2.1 Flutter SDK

Develop Guide

Wallet Pre Configuration

Android Configuration

1.Configure in AndroidManifest.xml

<activity android:name="clancey.simpleauth.simpleauthflutter.SimpleAuthCallbackActivity" android:exported="true">
    <intent-filter android:label="Pallet">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="db-feuuw50lyg85b3b" />
        <data android:scheme="com.googleusercontent.apps.312636396063-4vauh4vqdodasb7afkgvmrnldfm00ffj"/>
    </intent-filter>
</activity>

2.Initialization in MainActivity

class MainActivity: ThrioFlutterFragmentActivity() {
    init {
        System.loadLibrary("TrustWalletCore")
    }
    ...
}

iOS Configuration

  1. Add source config in Podfile

source 'git@github.com:Pallet-Pte/specs.git'

Step 1: Add dependency in pubspec.yaml

pallet_lite:
    hosted: https://jfrog.infra.ww5sawfyut0k.bitsvc.io/artifactory/api/pub/pallet-pub-prod-virtual/
    version: 1.0.6

  pallet:
    hosted: https://jfrog.infra.ww5sawfyut0k.bitsvc.io/artifactory/api/pub/pallet-pub-prod-virtual/
    version: 1.4.4

Step 2: Register Pallet Module in module.dart

class Module with ThrioModule, ModuleJsonDeserializer, ModuleJsonSerializer, ModuleParamScheme {
  @override
  void onModuleRegister(final ModuleContext moduleContext) {
    /// Set delegate for Pallet
    bv.PalletModule().setPalletDelegate(PalletDelegateImpl(moduleContext));
    /// Set rootNavigator
    bv.PalletModule().setRootNavigatorKey(RouteRegistry.rootNavigatorKey);
    /// Register Pallet Module
    registerModule(bv.Module(),moduleContext);
  }

  @override
  void onParamSchemeRegister(final ModuleContext moduleContext) {}

  @override
  void onJsonSerializerRegister(final ModuleContext moduleContext) {}

  @override
  void onJsonDeserializerRegister(final ModuleContext moduleContext) {}
}

Step 3: Init Pallet Wallet SDK

PalletModule().ensureInited(null);

Step 4: Invoke Wallet APIs when need

/// Enter the wallet home page
PalletModule().enterPalletHome(context);

/// Enter the wallet crate page
PalletModule().gotoCreateWallet(context);

More API references bridge-layer-api

PreviousBridge APINextExample

Last updated 1 year ago