11//! UTXO management
22
3+ use crate :: error:: { FFIError , FFIErrorCode } ;
4+ use crate :: managed_wallet:: FFIManagedWalletInfo ;
5+ use key_wallet:: wallet:: managed_wallet_info:: wallet_info_interface:: WalletInfoInterface ;
36use std:: ffi:: CString ;
47use std:: os:: raw:: c_char;
58use std:: ptr;
69
7- use crate :: error:: { FFIError , FFIErrorCode } ;
8- use crate :: managed_wallet:: FFIManagedWalletInfo ;
9-
1010/// UTXO structure for FFI
1111#[ repr( C ) ]
1212pub struct FFIUTXO {
@@ -99,7 +99,7 @@ pub unsafe extern "C" fn managed_wallet_get_utxos(
9999 let managed_info = & * managed_info;
100100
101101 // Get UTXOs from the managed wallet info
102- let utxos = managed_info. inner ( ) . get_utxos ( ) ;
102+ let utxos = managed_info. inner ( ) . utxos ( ) ;
103103
104104 if utxos. is_empty ( ) {
105105 * count_out = 0 ;
@@ -108,10 +108,10 @@ pub unsafe extern "C" fn managed_wallet_get_utxos(
108108 // Convert UTXOs to FFI format
109109 let mut ffi_utxos = Vec :: with_capacity ( utxos. len ( ) ) ;
110110
111- for ( outpoint , utxo) in utxos {
111+ for utxo in utxos {
112112 // Convert txid to byte array
113113 let mut txid_bytes = [ 0u8 ; 32 ] ;
114- txid_bytes. copy_from_slice ( & outpoint. txid [ ..] ) ;
114+ txid_bytes. copy_from_slice ( & utxo . outpoint . txid [ ..] ) ;
115115
116116 // Convert address to string
117117 let address_str = utxo. address . to_string ( ) ;
@@ -128,7 +128,7 @@ pub unsafe extern "C" fn managed_wallet_get_utxos(
128128
129129 let ffi_utxo = FFIUTXO :: new (
130130 txid_bytes,
131- outpoint. vout ,
131+ utxo . outpoint . vout ,
132132 utxo. value ( ) ,
133133 address_str,
134134 script_bytes,
0 commit comments