@@ -59,6 +59,8 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
5959 constructor_argument_prep += current_prep
6060 elif current_argument_details .rust_obj == 'LDK' + current_argument_details .swift_type :
6161 passed_argument_name += '.cOpaqueStruct!'
62+ elif current_argument_details .rust_obj == 'LDKC' + current_argument_details .swift_type :
63+ passed_argument_name += '.cOpaqueStruct!'
6264
6365 swift_arguments .append (f'{ argument_name } : { current_argument_details .swift_type } ' )
6466 native_arguments .append (f'{ passed_argument_name } ' )
@@ -134,6 +136,9 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
134136 if current_return_type .rust_obj is None and current_return_type .swift_type .startswith ('[' ):
135137 current_swift_return_type = current_return_type .swift_raw_type
136138
139+ if current_return_type .swift_type .startswith ('[' ) and not current_return_type .is_native_primitive and not current_return_type .swift_type .startswith ('[UInt' ):
140+ current_swift_return_type = current_return_type .swift_raw_type .replace ('[' , '[LDK' )
141+
137142 current_replacement = current_replacement .replace ('func methodName(' , f'func { current_method_name } (' )
138143
139144 if is_clone_method :
@@ -181,6 +186,8 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
181186 # native_arguments.append(f'{passed_argument_name}')
182187 if current_argument_details .rust_obj == 'LDK' + current_argument_details .swift_type and not current_argument_details .is_ptr :
183188 native_arguments .append (f'{ passed_argument_name } .cOpaqueStruct!' )
189+ elif current_argument_details .rust_obj == 'LDKC' + current_argument_details .swift_type and not current_argument_details .is_ptr :
190+ native_arguments .append (f'{ passed_argument_name } .cOpaqueStruct!' )
184191 elif current_argument_details .rust_obj is not None and current_argument_details .rust_obj .startswith (
185192 'LDK' ) and current_argument_details .swift_type .startswith ('[' ):
186193 native_arguments .append (f'Bindings.new_{ current_argument_details .rust_obj } (array: { passed_argument_name } )' )
0 commit comments