Skip to content

Commit e4987bb

Browse files
committed
chore: update .gitignore to include android/app/.cxx directory
1 parent 22eef0d commit e4987bb

File tree

77 files changed

+23522
-47010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+23522
-47010
lines changed

.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.32.7"
3+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ build/
3131
rust/target/
3232
rust/wallets/
3333
rust/ldk.0.2.1/
34+
reference/
35+
36+
# FVM Version Cache
37+
.fvm/

CHANGELOG.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1+
## [0.6.2]
2+
Updated `ldk-node` to `0.6.2`.
3+
4+
### Notes
5+
- No breaking changes and no new functions exposed.
6+
- Bug fixes.
7+
- Fix node going into a unrecoverable state when previously generated transaction accepted first, fixed on `rust bdk_wallet 2.0.0`
8+
- refer to [ldk-node rust](https://github.com/lightningdevkit/ldk-node/releases) for misc fixes (rust, uniffi, etc).
9+
10+
11+
## [0.5.0]
12+
13+
Updated `flutter_rust_bridge` to `2.11.1`.
14+
Updated `ldk-node` to `0.5.0`.
15+
Updated `freezed` to `3.2.0`
16+
Updated `freezed-anotation` to `3.1.0`
17+
18+
### APIs added
19+
20+
- **FeeRate Class**: Added comprehensive Dart-native `FeeRate` class with utilities for fee rate conversion and common constants
21+
- Constants: `zero`, `min`, `max`, `broadcastMin`, `dust`
22+
- Constructors: `fromSatPerKwu()`, `fromSatPerVb()`, `fromSatPerVbUnchecked()`
23+
- Converters: `toSatPerVbFloor()`, `toSatPerVbCeil()`, `toSatPerKwu()`
24+
- Enhanced `OnChainPayment` methods to support `FeeRate` parameter
25+
26+
- **Chain Data Sources**: Added Electrum backend support as alternative to Esplora for chain and fee rate data
27+
- `ChainDataSourceConfig.electrum()` constructor with `ElectrumSyncConfig` support
28+
- Full FFI integration for Electrum chain data source configuration
29+
- Background sync configuration options with customizable sync intervals
30+
31+
- **Enhanced Payment Events**:
32+
- Added `payment_preimage` field to `PaymentSuccessful` events for better payment verification and tracking
33+
- Added `PaymentForwarded` events for tracking payment forwarding through the node with detailed fee and routing information
34+
- Custom TLV (Type-Length-Value) record support in payment events (`PaymentClaimable`, `PaymentReceived`) allowing additional metadata to be received with payments
35+
36+
- **LSP Integration**: Enhanced Lightning Service Provider support
37+
- LSPS2 service integration with `receiveViaJitChannel()` and `receiveVariableAmountViaJitChannel()` methods
38+
- `Bolt11Jit` payment variant with LSP fee limits and counterparty skimmed fee tracking
39+
- Enhanced JIT channel support for improved liquidity management
40+
41+
- **Payment Store Integration**: On-chain transactions now included in internal payment store and exposed via payment APIs
42+
43+
### Breaking Changes
44+
45+
- **flutter_rust_bridge**: Updated from `2.6.0` to `2.11.1` - this major update may require code changes in applications using low-level FFI bindings
46+
- **freezed**: Updated from previous version to `3.2.0` - may affect generated code and require regeneration of freezed classes
47+
- **ldk-node**: Updated to `0.5.0` with significant internal changes that may affect behavior in edge cases
48+
- **Event Structure Changes**: Payment events now include additional fields (`preimage`, `customRecords`) which may affect existing event handling code
49+
- **Chain Data Source Configuration**: Applications using manual chain source configuration may need to update to new `ChainDataSourceConfig.electrum()` syntax
50+
51+
### API changed
52+
53+
- Enhanced on-chain payment methods to optionally accept `FeeRate` parameters for custom fee control
54+
- `ChainDataSourceConfig` now supports Electrum as a chain data source option alongside Esplora and Bitcoin Core RPC via `ChainDataSourceConfig.electrum()`
55+
- Payment events enhanced with preimage information in `PaymentSuccessful` events for better payment tracking and verification
56+
- Payment events (`PaymentClaimable`, `PaymentReceived`) now include `customRecords` field for Custom TLV record support
57+
- Added `PaymentForwarded` event type for tracking payment forwarding through the node
58+
59+
### Fixed
60+
61+
- Resolved FeeRate FFI type conflicts by implementing native Dart solution
62+
- Improved type safety and developer experience for fee rate handling
63+
- Enhanced payment tracking with better event handling and preimage support
64+
65+
### Notes
66+
67+
- Custom TLV support is available for receiving payments via event `customRecords`, but `sendWithCustomTlvs` for spontaneous payments is not yet exposed in the public API
68+
169
## [0.4.3]
270

371
Updated `flutter_rust_bridge` to `2.6.0`.

cargokit/gradle/plugin.gradle

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class CargoKitPlugin implements Plugin<Project> {
8686
private Plugin _findFlutterPlugin(Map projects) {
8787
for (project in projects) {
8888
for (plugin in project.value.getPlugins()) {
89-
if (plugin.class.name == "FlutterPlugin") {
89+
if (plugin.class.name == "com.flutter.gradle.FlutterPlugin") {
9090
return plugin;
9191
}
9292
}
@@ -119,12 +119,29 @@ class CargoKitPlugin implements Plugin<Project> {
119119
def jniLibs = project.android.sourceSets.maybeCreate(buildType).jniLibs;
120120
jniLibs.srcDir(new File(cargoOutputDir))
121121

122-
def platforms = plugin.getTargetPlatforms().collect()
122+
def platforms = ["android-arm", "android-arm64", "android-x64"]
123+
124+
// Respect NDK ABI filters if set
125+
def abiFilters = plugin.project.android.defaultConfig.ndk?.abiFilters
126+
if (abiFilters != null && !abiFilters.isEmpty()) {
127+
// Filter platforms based on ABI filters
128+
platforms = platforms.findAll { platform ->
129+
if (platform == "android-arm" && abiFilters.contains("armeabi-v7a")) return true
130+
if (platform == "android-arm64" && abiFilters.contains("arm64-v8a")) return true
131+
// if (platform == "android-x86" && abiFilters.contains("x86")) return true
132+
if (platform == "android-x64" && abiFilters.contains("x86_64")) return true
133+
return false
134+
}
135+
}
123136

124137
// Same thing addFlutterDependencies does in flutter.gradle
125138
if (buildType == "debug") {
126-
// platforms.add("android-x86")
127-
platforms.add("android-x64")
139+
// Only add x64 if it's in ABI filters or no filters are set
140+
if (abiFilters == null || abiFilters.isEmpty() || abiFilters.contains("x86_64")) {
141+
if (!platforms.contains("android-x64")) {
142+
platforms.add("android-x64")
143+
}
144+
}
128145
}
129146

130147
// The task name depends on plugin properties, which are not available

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ app.*.map.json
4444
/android/app/debug
4545
/android/app/profile
4646
/android/app/release
47+
/android/app/.cxx/

example/README_CONFIGURATION.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Lightning Wallet Configuration System
2+
3+
This app now supports user-configurable node settings with persistent storage.
4+
5+
## Features
6+
7+
### 🔐 **User-Generated Mnemonics**
8+
- Users can generate their own secure mnemonics
9+
- Mnemonics are stored securely using SharedPreferences
10+
- Option to generate new mnemonics (creates new wallet)
11+
12+
### 🏷️ **Custom Node Names**
13+
- Users can set their own node name
14+
- Node name is displayed in the app title
15+
- Stored persistently for future sessions
16+
17+
### 🔌 **Configurable Ports**
18+
- Users can choose from available ports (9735-9740)
19+
- Prevents port conflicts when running multiple emulators
20+
- Port selection is stored and remembered
21+
22+
### 💾 **Persistent Storage**
23+
- All settings are saved using SharedPreferences
24+
- Settings persist across app restarts
25+
- No hardcoded values for production use
26+
27+
## First Run Experience
28+
29+
When users first launch the app, they'll see a beautiful onboarding flow:
30+
31+
1. **Step 1: Generate Mnemonic**
32+
- Tap "Generate Mnemonic" to create a new wallet
33+
- Copy the mnemonic to clipboard
34+
- Warning about keeping it safe
35+
36+
2. **Step 2: Set Node Name**
37+
- Enter a custom node name
38+
- This will be visible to other Lightning Network participants
39+
40+
3. **Step 3: Choose Port**
41+
- Select from available ports (9735-9740)
42+
- Different ports allow multiple emulators on same machine
43+
44+
## Settings Management
45+
46+
Users can access settings via the settings icon in the app bar:
47+
48+
- **View Current Settings**: See current mnemonic, node name, and port
49+
- **Update Settings**: Change node name or port
50+
- **Generate New Mnemonic**: Create a new wallet (warning about data loss)
51+
- **Copy Mnemonic**: Copy current mnemonic to clipboard
52+
53+
## Multiple Emulator Support
54+
55+
To run multiple emulators on the same machine:
56+
57+
1. **First Emulator**: Use default settings (port 9735)
58+
2. **Second Emulator**: Go to Settings → Change Port to 9736
59+
3. **Additional Emulators**: Use ports 9737, 9738, etc.
60+
61+
Each emulator will have its own:
62+
- Unique port
63+
- Separate storage directory
64+
- Independent wallet
65+
66+
## Technical Implementation
67+
68+
### Files Created/Modified:
69+
70+
- `lib/services/settings_service.dart` - Persistent storage service
71+
- `lib/screens/onboarding_screen.dart` - First-run setup flow
72+
- `lib/screens/settings_screen.dart` - Settings management UI
73+
- `lib/config/node_config.dart` - Updated to use user settings
74+
- `lib/main.dart` - Added startup flow and routing
75+
- `lib/screens/dashboard_screen.dart` - Added settings button
76+
77+
### Dependencies:
78+
- `shared_preferences: ^2.2.3` - For persistent storage
79+
- `google_fonts: ^6.2.1` - For beautiful typography
80+
- `qr_flutter: ^4.1.0` - For QR code display
81+
82+
## Security Notes
83+
84+
- Mnemonics are stored in SharedPreferences (device storage)
85+
- Consider implementing encryption for production use
86+
- Users are warned about keeping mnemonics safe
87+
- Option to generate new mnemonics creates completely new wallets
88+
89+
## Testing Multiple Emulators
90+
91+
1. Start first emulator with default settings
92+
2. Start second emulator and go through onboarding
93+
3. Choose different port (e.g., 9736)
94+
4. Both emulators can run simultaneously without conflicts
95+
5. Each has its own wallet and can connect to each other
96+
97+
## Future Enhancements
98+
99+
- [ ] Encrypt stored mnemonics
100+
- [ ] Add mnemonic validation
101+
- [ ] Support for custom port ranges
102+
- [ ] Backup/restore settings
103+
- [ ] Import existing mnemonics

example/android/app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99
android {
1010
compileSdk = flutter.compileSdkVersion
11-
ndkVersion = "25.1.8937393"
11+
ndkVersion = "26.3.11579264"
1212
namespace = "io.ldk.f.ldk_node_example"
1313
compileOptions {
1414
sourceCompatibility JavaVersion.VERSION_17
@@ -28,6 +28,11 @@ android {
2828
targetSdk = flutter.targetSdkVersion
2929
versionCode = flutter.versionCode
3030
versionName = flutter.versionName
31+
32+
ndk {
33+
// Filter out 32-bit architectures to avoid lightning crate compilation issues
34+
abiFilters 'arm64-v8a', 'x86_64'
35+
}
3136
}
3237

3338
buildTypes {

example/cargokit_options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
verbose_logging: false
2-
use_precompiled_binaries: true
1+
verbose_logging: true
2+
use_precompiled_binaries: false

0 commit comments

Comments
 (0)