Commit c4fac22
fix(key-wallet-ffi): extract asset lock builder into key-wallet (#604)
Moves the asset lock transaction building logic out of the FFI layer
into a dedicated `asset_lock_builder` module in key-wallet. The FFI
function is now a thin bridge that converts types and delegates to
`build_asset_lock_transaction()`.
The new builder:
- Lives in key-wallet/src/wallet/managed_wallet_info/asset_lock_builder.rs
- Handles credit output setup, coin selection, key derivation, signing
- Returns AssetLockResult with transaction, fee, output_index, private_key
- Is testable without FFI and reusable from any Rust consumer
Also adds `TransactionBuilder::add_raw_output(TxOut)` for adding
pre-built outputs (needed for credit outputs before coin selection).
Closes #602
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 09f03e0 commit c4fac22
File tree
6 files changed
+466
-294
lines changed- key-wallet-ffi
- src
- key-wallet/src
- managed_account
- wallet/managed_wallet_info
6 files changed
+466
-294
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
1288 | | - | |
| 1288 | + | |
1289 | 1289 | | |
1290 | 1290 | | |
1291 | 1291 | | |
1292 | | - | |
| 1292 | + | |
1293 | 1293 | | |
1294 | 1294 | | |
1295 | | - | |
| 1295 | + | |
1296 | 1296 | | |
1297 | 1297 | | |
1298 | 1298 | | |
| |||
0 commit comments