portal_flutter 2.0.0
portal_flutter: ^2.0.0 copied to clipboard
Flutter SDK for Portal - Stablecoin wallet infrastructure
portal_flutter #
Flutter SDK for Portal — Stablecoin wallet infrastructure.
This is a federated plugin. Platform implementations live in the
portal_flutter_android
and portal_flutter_ios
packages and are pulled in automatically when you depend on
portal_flutter.
Installation #
dependencies:
portal_flutter: ^2.0.0
Then run flutter pub get.
Platform setup #
Android #
Set the minimum SDK in your app's android/app/build.gradle:
android {
defaultConfig {
minSdk = 24
}
}
iOS #
Set the deployment target to iOS 15.0 or higher — in Xcode under
Runner → General → Minimum Deployments, or in ios/Podfile:
platform :ios, '15.0'
The remaining step depends on which Apple dependency manager your app uses.
PortalSwift is distributed from GitHub rather than the CocoaPods trunk, so
CocoaPods needs to be told where to find it and Swift Package Manager does not.
Swift Package Manager (default on Flutter 3.44+)
Nothing to do. PortalSwift is declared in portal_flutter_ios's
Package.swift and resolved straight from its git URL.
On Flutter versions before 3.44, enable SPM first:
flutter config --enable-swift-package-manager
CocoaPods (Flutter before 3.44, or SPM disabled)
Add PortalSwift to your app's ios/Podfile yourself:
platform :ios, '15.0'
pod 'PortalSwift', :git => 'https://github.com/portal-hq/PortalSwift.git', :tag => '8.0.0'
The tag must match the PortalSwift version pinned in
portal_flutter_ios.podspec — currently 8.0.0. PortalSwift ships its own
podspec whose version tracks the tag, so a mismatched tag is an unsatisfiable
constraint: pod install fails outright rather than the build failing later.
Do not add the
pod 'PortalSwift'line while Swift Package Manager is enabled. Both graphs would pull the framework in and the build produces duplicate symbols.
Quickstart #
import 'package:portal_flutter/portal_flutter.dart';
final portal = Portal();
await portal.initialize(
apiKey: 'YOUR_CLIENT_API_KEY',
rpcConfig: {
'eip155:1': 'https://api.portalhq.io/rpc/v1/eip155/1',
'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp':
'https://api.portalhq.io/rpc/v1/solana/5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
},
);
final addresses = await portal.createWallet();
print(addresses.ethereum);
print(addresses.solana);
initialize also accepts autoApprove, apiHost, mpcHost,
enclaveMpcHost, logLevel, and featureFlags. Every other method throws a
PortalException until initialize has completed.