diff --git a/lib/lightning/lightning.dart b/lib/lightning/lightning.dart index 4343589..6a764ed 100644 --- a/lib/lightning/lightning.dart +++ b/lib/lightning/lightning.dart @@ -1,7 +1,11 @@ import 'package:ldk_node/ldk_node.dart'; + +import '../dlc/contract.dart'; +import '../dlc/oracle.dart'; +import 'taproot_channel.dart'; class DLC { final OracleClient oracle; - final Oracle oracle + final Oracle oracle; final Channel channel; final Contract contract; diff --git a/lib/lightning/taproot_channel.dart b/lib/lightning/taproot_channel.dart index fc47aa7..d1786c0 100644 --- a/lib/lightning/taproot_channel.dart +++ b/lib/lightning/taproot_channel.dart @@ -56,14 +56,14 @@ class DLC { final outcome = channel.determineOutcome(); // Create a settlement transaction based on the outcome - final settlementTx = await channel.createSettlementTransaction(outcome); + final settlementTx = await channel.createSettlementTransaction(outcome as int); // Sign and broadcast the settlement transaction final signedTx = await channel.signTransaction(settlementTx); await channel.broadcastTransaction(signedTx); // Distribute the funds as per the contract terms - await channel.distributeFunds(outcome); + await channel.distributeFunds(outcome as int); print("Contract executed and funds distributed based on outcome."); } catch (e) {