@@ -0,0 +1,11727 @@
1+/* This file was generated by uniffi-bindgen-cpp. */
2+#include <string>
3+
4+#include "wallet_engine.hpp"
5+
6+namespace wallet_engine {
7+namespace uniffi {
8+template <class> inline constexpr bool always_false_v = false;
9+
10+namespace {
11+void ensure_initialized() {
12+ auto bindings_contract_version = 30;
13+ auto scaffolding_contract_version = ffi_wallet_engine_uniffi_contract_version();
14+
15+ if (bindings_contract_version != scaffolding_contract_version) {
16+ throw std::runtime_error("UniFFI contract version mismatch: try cleaning and rebuilding your project");
17+ }
18+ if (uniffi_wallet_engine_checksum_func_parse_ton_transfer_link() != 38144) {
19+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
20+ }
21+ if (uniffi_wallet_engine_checksum_func_parse_ton_connect_manifest() != 55166) {
22+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
23+ }
24+ if (uniffi_wallet_engine_checksum_func_ton_connect_session_from_link() != 16316) {
25+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
26+ }
27+ if (uniffi_wallet_engine_checksum_func_ton_connect_session_restore() != 63276) {
28+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
29+ }
30+ if (uniffi_wallet_engine_checksum_func_convert_ton_address() != 28540) {
31+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
32+ }
33+ if (uniffi_wallet_engine_checksum_func_is_valid_ton_address() != 32896) {
34+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
35+ }
36+ if (uniffi_wallet_engine_checksum_func_parse_ton_address() != 26131) {
37+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
38+ }
39+ if (uniffi_wallet_engine_checksum_func_mnemonic_wordlist() != 1718) {
40+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
41+ }
42+ if (uniffi_wallet_engine_checksum_func_detect_mnemonic_schemes() != 22911) {
43+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
44+ }
45+ if (uniffi_wallet_engine_checksum_func_rotation_mnemonic_public_key() != 40177) {
46+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
47+ }
48+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_load_more_activity() != 30855) {
49+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
50+ }
51+ if (uniffi_wallet_engine_checksum_method_walletclient_load_more_activity() != 1728) {
52+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
53+ }
54+ if (uniffi_wallet_engine_checksum_method_walletclient_shutdown() != 12846) {
55+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
56+ }
57+ if (uniffi_wallet_engine_checksum_method_walletclient_snapshot() != 9252) {
58+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
59+ }
60+ if (uniffi_wallet_engine_checksum_method_walletclient_wait_for_change() != 21890) {
61+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
62+ }
63+ if (uniffi_wallet_engine_checksum_method_walletclient_resolve_dns() != 63449) {
64+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
65+ }
66+ if (uniffi_wallet_engine_checksum_method_walletclient_create_encrypted_comment() != 57304) {
67+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
68+ }
69+ if (uniffi_wallet_engine_checksum_method_walletclient_decrypt_comment() != 56301) {
70+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
71+ }
72+ if (uniffi_wallet_engine_checksum_method_walletclient_resolve_encrypted_comment_recipient() != 61038) {
73+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
74+ }
75+ if (uniffi_wallet_engine_checksum_method_walletclient_prepare_key_rotation() != 44629) {
76+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
77+ }
78+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_load_more_nfts() != 55435) {
79+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
80+ }
81+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_refresh_nfts() != 10319) {
82+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
83+ }
84+ if (uniffi_wallet_engine_checksum_method_walletclient_load_more_nfts() != 53428) {
85+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
86+ }
87+ if (uniffi_wallet_engine_checksum_method_walletclient_refresh_nfts() != 19017) {
88+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
89+ }
90+ if (uniffi_wallet_engine_checksum_method_walletclient_prepare_nft_transfer() != 62136) {
91+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
92+ }
93+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_nft_transfer() != 55191) {
94+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
95+ }
96+ if (uniffi_wallet_engine_checksum_method_walletclient_send_nft_transfer() != 6467) {
97+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
98+ }
99+ if (uniffi_wallet_engine_checksum_method_walletclient_prepare_transfer() != 35005) {
100+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
101+ }
102+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_send_preview() != 28394) {
103+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
104+ }
105+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_key_rotation() != 9076) {
106+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
107+ }
108+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_send() != 55971) {
109+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
110+ }
111+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_send_boc() != 21004) {
112+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
113+ }
114+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_sign_message() != 5984) {
115+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
116+ }
117+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_ton_connect() != 9616) {
118+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
119+ }
120+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_refresh() != 16959) {
121+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
122+ }
123+ if (uniffi_wallet_engine_checksum_method_walletclient_refresh() != 44556) {
124+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
125+ }
126+ if (uniffi_wallet_engine_checksum_method_walletclient_resolve_pending() != 41815) {
127+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
128+ }
129+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_send() != 37753) {
130+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
131+ }
132+ if (uniffi_wallet_engine_checksum_method_walletclient_send() != 23821) {
133+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
134+ }
135+ if (uniffi_wallet_engine_checksum_method_walletclient_send_boc() != 4063) {
136+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
137+ }
138+ if (uniffi_wallet_engine_checksum_method_walletclient_sign_message() != 31537) {
139+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
140+ }
141+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_read_protected_secret() != 7657) {
142+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
143+ }
144+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_store_protected_secret() != 21396) {
145+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
146+ }
147+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_delete_protected_secret() != 43335) {
148+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
149+ }
150+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_load_journal() != 51398) {
151+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
152+ }
153+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_compare_exchange_journal() != 63993) {
154+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
155+ }
156+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_approve_connect() != 6077) {
157+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
158+ }
159+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_begin_events_subscription() != 62684) {
160+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
161+ }
162+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_complete_pending_post() != 52225) {
163+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
164+ }
165+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_connect_prompt() != 24215) {
166+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
167+ }
168+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_disconnect() != 14920) {
169+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
170+ }
171+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_ingest_sse_chunk() != 62248) {
172+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
173+ }
174+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_pending_post() != 12209) {
175+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
176+ }
177+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_pending_requests() != 22341) {
178+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
179+ }
180+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_persisted() != 36457) {
181+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
182+ }
183+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_phase() != 52857) {
184+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
185+ }
186+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_disconnect_success() != 65002) {
187+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
188+ }
189+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_error() != 22566) {
190+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
191+ }
192+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_send_success() != 31724) {
193+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
194+ }
195+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_sign_message_success() != 63431) {
196+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
197+ }
198+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_reject_connect() != 45812) {
199+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
200+ }
201+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_decrypt_envelope() != 42978) {
202+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
203+ }
204+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_decrypt_request() != 40213) {
205+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
206+ }
207+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_connect_error() != 3125) {
208+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
209+ }
210+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_connect_event() != 12874) {
211+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
212+ }
213+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_disconnect_event() != 15862) {
214+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
215+ }
216+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_disconnect_success() != 11931) {
217+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
218+ }
219+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_envelope() != 50506) {
220+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
221+ }
222+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_error() != 24657) {
223+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
224+ }
225+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_send_success() != 2099) {
226+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
227+ }
228+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_sign_data_success() != 48287) {
229+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
230+ }
231+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_open_challenge() != 24298) {
232+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
233+ }
234+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_public_key_hex() != 32021) {
235+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
236+ }
237+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_signing_public_key() != 11397) {
238+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
239+ }
240+ if (uniffi_wallet_engine_checksum_method_wallethttphost_execute_http() != 43126) {
241+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
242+ }
243+ if (uniffi_wallet_engine_checksum_method_wallethttphost_cancel_http() != 55221) {
244+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
245+ }
246+ if (uniffi_wallet_engine_checksum_method_walletstatuslesshost_execute_statusless() != 29141) {
247+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
248+ }
249+ if (uniffi_wallet_engine_checksum_method_walletstatuslesshost_cancel_statusless() != 58537) {
250+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
251+ }
252+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_create_wallet() != 58283) {
253+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
254+ }
255+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_delete_wallet() != 60089) {
256+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
257+ }
258+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_derive_ton_connect_session() != 2602) {
259+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
260+ }
261+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_import_wallet() != 60352) {
262+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
263+ }
264+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_reveal_recovery_phrase() != 7144) {
265+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
266+ }
267+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_sign_ton_connect_data() != 38868) {
268+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
269+ }
270+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_sign_ton_connect_proof() != 59978) {
271+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
272+ }
273+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_ton_connect_account() != 32302) {
274+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
275+ }
276+ if (uniffi_wallet_engine_checksum_constructor_walletclient_new() != 8434) {
277+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
278+ }
279+ if (uniffi_wallet_engine_checksum_constructor_walletclient_new_statusless() != 59466) {
280+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
281+ }
282+ if (uniffi_wallet_engine_checksum_constructor_walletlifecycle_new() != 42116) {
283+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
284+ }
285+
286+ uniffi::UniffiCallbackInterfaceWalletHttpHost::init();
287+ uniffi::UniffiCallbackInterfaceWalletPlatformHost::init();
288+ uniffi::UniffiCallbackInterfaceWalletStatuslessHost::init();
289+ }
290+
291+// Note: we need this indirection here and can't inline this code in the rust_call function
292+// as it's a templated function
293+void initialize() {
294+ static std::once_flag init_flag;
295+ std::call_once(init_flag, ensure_initialized);
296+}
297+}
298+
299+template <typename F>
300+void check_rust_call(const RustCallStatus &status, F error_cb) {
301+ switch (status.code) {
302+ case 0:
303+ return;
304+
305+ case 1:
306+ if constexpr (!std::is_null_pointer_v<F>) {
307+ error_cb(status.error_buf)->throw_underlying();
308+ }
309+ break;
310+
311+ case 2:
312+ if (status.error_buf.len > 0) {
313+ throw std::runtime_error(FfiConverterString::lift(status.error_buf));
314+ }
315+
316+ throw std::runtime_error("A Rust panic has occurred");
317+ }
318+
319+ throw std::runtime_error("Unexpected Rust call status");
320+}
321+
322+template <typename F, typename EF, typename... Args, typename R = std::invoke_result_t<F, Args..., RustCallStatus *>>
323+R rust_call(F f, EF error_cb, Args... args) {
324+ initialize();
325+
326+ RustCallStatus status = { 0 };
327+
328+ if constexpr (std::is_void_v<R>) {
329+ f(args..., &status);
330+ check_rust_call(status, error_cb);
331+ } else {
332+ auto ret = f(args..., &status);
333+ check_rust_call(status, error_cb);
334+
335+ return ret;
336+ }
337+}
338+
339+namespace {
340+struct RustFutureContinuationState {
341+ std::mutex mutex;
342+ std::condition_variable condition;
343+ bool called = false;
344+ int8_t poll_result = 0;
345+};
346+
347+void rust_future_continuation(uint64_t data, int8_t poll_result) {
348+ auto *state = reinterpret_cast<RustFutureContinuationState *>(data);
349+ {
350+ std::lock_guard<std::mutex> lock(state->mutex);
351+ state->poll_result = poll_result;
352+ state->called = true;
353+ }
354+ state->condition.notify_one();
355+}
356+
357+void foreign_future_drop_noop(uint64_t) {}
358+
359+template <typename F>
360+struct RustFutureHandleGuard {
361+ uint64_t handle;
362+ F free;
363+
364+ ~RustFutureHandleGuard() {
365+ free(handle);
366+ }
367+};
368+}
369+
370+template <typename Start, typename Poll, typename Complete, typename Free, typename EF,
371+ typename R = std::invoke_result_t<Complete, uint64_t, RustCallStatus *>>
372+R rust_call_async(Start start, Poll poll, Complete complete, Free free, EF error_cb) {
373+ initialize();
374+
375+ auto handle = start();
376+ RustFutureHandleGuard guard { handle, free };
377+
378+ while (true) {
379+ RustFutureContinuationState state;
380+ poll(
381+ handle,
382+ reinterpret_cast<void *>(&rust_future_continuation),
383+ reinterpret_cast<uint64_t>(&state)
384+ );
385+
386+ std::unique_lock<std::mutex> lock(state.mutex);
387+ state.condition.wait(lock, [&state] { return state.called; });
388+ if (state.poll_result == 0) {
389+ break;
390+ }
391+ if (state.poll_result != 1) {
392+ throw std::runtime_error("Unexpected Rust future poll result");
393+ }
394+ }
395+
396+ RustCallStatus status = {};
397+ if constexpr (std::is_void_v<R>) {
398+ complete(handle, &status);
399+ check_rust_call(status, error_cb);
400+ } else {
401+ auto ret = complete(handle, &status);
402+ check_rust_call(status, error_cb);
403+ return ret;
404+ }
405+}
406+
407+template <typename F, typename W>
408+void rust_call_trait_interface(RustCallStatus* status, F make_call, W write_value) {
409+ initialize();
410+
411+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
412+
413+ try {
414+ if constexpr(has_return_type) {
415+ write_value(make_call());
416+ } else {
417+ make_call();
418+ }
419+ } catch (std::exception &e) {
420+ status->code = 2;
421+ status->error_buf = FfiConverterString::lower(e.what());
422+ }
423+}
424+
425+template <typename E, typename W, typename F, typename EF>
426+void rust_call_trait_interface_with_error(RustCallStatus* status, F make_call, W write_value, EF error_cb) {
427+ initialize();
428+
429+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
430+
431+ try {
432+ try {
433+ if constexpr(has_return_type) {
434+ write_value(make_call());
435+ } else {
436+ make_call();
437+ }
438+ } catch (E &e) {
439+ status->code = 1;
440+ status->error_buf = error_cb(e);
441+ }
442+ } catch (std::exception &e) {
443+ status->code = 2;
444+ status->error_buf = FfiConverterString::lower(e.what());
445+ }
446+}
447+
448+
449+RustBuffer rustbuffer_alloc(uint64_t len) {
450+ RustCallStatus status = { 0 };
451+ auto buffer = ffi_wallet_engine_rustbuffer_alloc(len, &status);
452+
453+ check_rust_call(status, nullptr);
454+
455+ return buffer;
456+}
457+
458+RustBuffer rustbuffer_from_bytes(const ForeignBytes &bytes) {
459+ RustCallStatus status = { 0 };
460+ auto buffer = ffi_wallet_engine_rustbuffer_from_bytes(bytes, &status);
461+
462+ check_rust_call(status, nullptr);
463+
464+ return buffer;
465+}
466+
467+void rustbuffer_free(RustBuffer buf) {
468+ RustCallStatus status = { 0 };
469+
470+ ffi_wallet_engine_rustbuffer_free(std::move(buf), &status);
471+ check_rust_call(status, nullptr);
472+}
473+
474+
475+uint16_t FfiConverterUInt16::lift(uint16_t val) {
476+ return val;
477+}
478+
479+uint16_t FfiConverterUInt16::lower(uint16_t val) {
480+ return val;
481+}
482+
483+uint16_t FfiConverterUInt16::read(RustStream &stream) {
484+ uint16_t ret;
485+ stream >> ret;
486+
487+ return ret;
488+}
489+
490+void FfiConverterUInt16::write(RustStream &stream, uint16_t val) {
491+ stream << val;
492+}
493+
494+uint64_t FfiConverterUInt16::allocation_size(uint16_t) {
495+ return static_cast<uint64_t>(sizeof(uint16_t));
496+}
497+uint32_t FfiConverterUInt32::lift(uint32_t val) {
498+ return val;
499+}
500+
501+uint32_t FfiConverterUInt32::lower(uint32_t val) {
502+ return val;
503+}
504+
505+uint32_t FfiConverterUInt32::read(RustStream &stream) {
506+ uint32_t ret;
507+ stream >> ret;
508+
509+ return ret;
510+}
511+
512+void FfiConverterUInt32::write(RustStream &stream, uint32_t val) {
513+ stream << val;
514+}
515+
516+uint64_t FfiConverterUInt32::allocation_size(uint32_t) {
517+ return static_cast<uint64_t>(sizeof(uint32_t));
518+}
519+int32_t FfiConverterInt32::lift(int32_t val) {
520+ return val;
521+}
522+
523+int32_t FfiConverterInt32::lower(int32_t val) {
524+ return val;
525+}
526+
527+int32_t FfiConverterInt32::read(RustStream &stream) {
528+ int32_t ret;
529+ stream >> ret;
530+
531+ return ret;
532+}
533+
534+void FfiConverterInt32::write(RustStream &stream, int32_t val) {
535+ stream << val;
536+}
537+
538+uint64_t FfiConverterInt32::allocation_size(int32_t) {
539+ return static_cast<uint64_t>(sizeof(int32_t));
540+}
541+uint64_t FfiConverterUInt64::lift(uint64_t val) {
542+ return val;
543+}
544+
545+uint64_t FfiConverterUInt64::lower(uint64_t val) {
546+ return val;
547+}
548+
549+uint64_t FfiConverterUInt64::read(RustStream &stream) {
550+ uint64_t ret;
551+ stream >> ret;
552+
553+ return ret;
554+}
555+
556+void FfiConverterUInt64::write(RustStream &stream, uint64_t val) {
557+ stream << val;
558+}
559+
560+uint64_t FfiConverterUInt64::allocation_size(uint64_t) {
561+ return static_cast<uint64_t>(sizeof(uint64_t));
562+}
563+int64_t FfiConverterInt64::lift(int64_t val) {
564+ return val;
565+}
566+
567+int64_t FfiConverterInt64::lower(int64_t val) {
568+ return val;
569+}
570+
571+int64_t FfiConverterInt64::read(RustStream &stream) {
572+ int64_t ret;
573+ stream >> ret;
574+
575+ return ret;
576+}
577+
578+void FfiConverterInt64::write(RustStream &stream, int64_t val) {
579+ stream << val;
580+}
581+
582+uint64_t FfiConverterInt64::allocation_size(int64_t) {
583+ return static_cast<uint64_t>(sizeof(int64_t));
584+}
585+
586+bool FfiConverterBool::lift(uint8_t val) {
587+ return !!val;
588+}
589+
590+uint8_t FfiConverterBool::lower(bool val) {
591+ return val;
592+}
593+
594+bool FfiConverterBool::read(RustStream &stream) {
595+ uint8_t val;
596+ stream >> val;
597+
598+ return val;
599+}
600+
601+void FfiConverterBool::write(RustStream &stream, bool val) {
602+ stream << val;
603+}
604+
605+uint64_t FfiConverterBool::allocation_size(bool) {
606+ return 1;
607+}
608+std::string FfiConverterString::lift(RustBuffer buf) {
609+ auto string = std::string(reinterpret_cast<char *>(buf.data), buf.len);
610+
611+ rustbuffer_free(buf);
612+
613+ return string;
614+}
615+
616+RustBuffer FfiConverterString::lower(const std::string &val) {
617+ auto len = static_cast<int32_t>(val.length());
618+ auto bytes = ForeignBytes { len, reinterpret_cast<uint8_t *>(const_cast<char *>(val.data())) };
619+
620+ return rustbuffer_from_bytes(bytes);
621+}
622+
623+std::string FfiConverterString::read(RustStream &stream) {
624+ int32_t len;
625+ std::string string;
626+
627+ stream >> len;
628+
629+ string.resize(len);
630+ stream.read(string.data(), len);
631+
632+ return string;
633+}
634+
635+void FfiConverterString::write(RustStream &stream, const std::string &val) {
636+ stream << static_cast<int32_t>(val.length());
637+ stream.write(val.data(), val.length());
638+}
639+
640+uint64_t FfiConverterString::allocation_size(const std::string &val) {
641+ return static_cast<uint64_t>(sizeof(int32_t) + val.length());
642+}
643+std::vector<uint8_t> FfiConverterBytes::lift(RustBuffer buf) {
644+ auto stream = RustStream(&buf);
645+ auto ret = read(stream);
646+
647+ rustbuffer_free(buf);
648+
649+ return ret;
650+}
651+
652+RustBuffer FfiConverterBytes::lower(const std::vector<uint8_t> &val) {
653+ auto buf = rustbuffer_alloc(allocation_size(val));
654+ auto stream = RustStream(&buf);
655+
656+ write(stream, val);
657+
658+ return buf;
659+}
660+
661+std::vector<uint8_t> FfiConverterBytes::read(RustStream &stream) {
662+ std::vector<uint8_t> ret;
663+ int32_t count;
664+ stream >> count;
665+
666+ ret.reserve(count);
667+
668+ for (decltype(count) i = 0; i < count; i++) {
669+ uint8_t elem;
670+ stream >> elem;
671+ ret.push_back(elem);
672+ }
673+
674+ return ret;
675+}
676+
677+void FfiConverterBytes::write(RustStream &stream, const std::vector<uint8_t> &val) {
678+ stream << static_cast<int32_t>(val.size());
679+
680+ for (auto &elem : val) {
681+ stream << elem;
682+ }
683+}
684+
685+uint64_t FfiConverterBytes::allocation_size(const std::vector<uint8_t> &val) {
686+ return static_cast<uint64_t>(sizeof(int32_t) + sizeof(uint8_t) * val.size());
687+}
688+} // namespace uniffi
689+
690+
691+
692+
693+
694+
695+
696+
697+
698+
699+
700+
701+
702+TonConnectDerivedSession::TonConnectDerivedSession(uint64_t ptr): instance(ptr) {}
703+
704+TonConnectDerivedSession::TonConnectDerivedSession(const TonConnectDerivedSession &other) : instance(0) {
705+ if (other.instance) {
706+ instance = other._uniffi_internal_clone_pointer();
707+ }
708+}
709+
710+
711+
712+
713+std::vector<uint8_t> TonConnectDerivedSession::decrypt_envelope(const std::vector<uint8_t> &body) {
714+ auto ptr = this->_uniffi_internal_clone_pointer();
715+ return uniffi::FfiConverterBytes::lift(
716+ uniffi::rust_call(
717+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_envelope,
718+ uniffi::FfiConverterTonConnectSessionError::lift,
719+ ptr, uniffi::FfiConverterBytes::lower(body)));
720+}
721+TonConnectDerivedRequest TonConnectDerivedSession::decrypt_request(const std::vector<uint8_t> &body, uint64_t now) {
722+ auto ptr = this->_uniffi_internal_clone_pointer();
723+ return uniffi::FfiConverterTypeTonConnectDerivedRequest::lift(
724+ uniffi::rust_call(
725+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_request,
726+ uniffi::FfiConverterTonConnectSessionError::lift,
727+ ptr, uniffi::FfiConverterBytes::lower(body), uniffi::FfiConverterUInt64::lower(now)));
728+}
729+std::vector<uint8_t> TonConnectDerivedSession::encrypt_connect_error(uint64_t event_id, const TonConnectConnectErrorCode &code, const std::string &message) {
730+ auto ptr = this->_uniffi_internal_clone_pointer();
731+ return uniffi::FfiConverterBytes::lift(
732+ uniffi::rust_call(
733+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_connect_error,
734+ uniffi::FfiConverterTonConnectSessionError::lift,
735+ ptr, uniffi::FfiConverterUInt64::lower(event_id), uniffi::FfiConverterTonConnectConnectErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
736+}
737+std::vector<uint8_t> TonConnectDerivedSession::encrypt_connect_event(uint64_t event_id, const TonConnectAccountInfo &account, std::optional<TonConnectProofReply> proof, const TonConnectDevice &device) {
738+ auto ptr = this->_uniffi_internal_clone_pointer();
739+ return uniffi::FfiConverterBytes::lift(
740+ uniffi::rust_call(
741+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_connect_event,
742+ uniffi::FfiConverterTonConnectSessionError::lift,
743+ ptr, uniffi::FfiConverterUInt64::lower(event_id), uniffi::FfiConverterTypeTonConnectAccountInfo::lower(account), uniffi::FfiConverterOptionalTypeTonConnectProofReply::lower(proof), uniffi::FfiConverterTypeTonConnectDevice::lower(device)));
744+}
745+std::vector<uint8_t> TonConnectDerivedSession::encrypt_disconnect_event(uint64_t event_id) {
746+ auto ptr = this->_uniffi_internal_clone_pointer();
747+ return uniffi::FfiConverterBytes::lift(
748+ uniffi::rust_call(
749+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_event,
750+ uniffi::FfiConverterTonConnectSessionError::lift,
751+ ptr, uniffi::FfiConverterUInt64::lower(event_id)));
752+}
753+std::vector<uint8_t> TonConnectDerivedSession::encrypt_disconnect_success(const std::string &request_id) {
754+ auto ptr = this->_uniffi_internal_clone_pointer();
755+ return uniffi::FfiConverterBytes::lift(
756+ uniffi::rust_call(
757+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_success,
758+ uniffi::FfiConverterTonConnectSessionError::lift,
759+ ptr, uniffi::FfiConverterString::lower(request_id)));
760+}
761+std::vector<uint8_t> TonConnectDerivedSession::encrypt_envelope(const std::vector<uint8_t> &body) {
762+ auto ptr = this->_uniffi_internal_clone_pointer();
763+ return uniffi::FfiConverterBytes::lift(
764+ uniffi::rust_call(
765+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_envelope,
766+ uniffi::FfiConverterTonConnectSessionError::lift,
767+ ptr, uniffi::FfiConverterBytes::lower(body)));
768+}
769+std::vector<uint8_t> TonConnectDerivedSession::encrypt_error(const std::string &request_id, const TonConnectRpcErrorCode &code, const std::string &message) {
770+ auto ptr = this->_uniffi_internal_clone_pointer();
771+ return uniffi::FfiConverterBytes::lift(
772+ uniffi::rust_call(
773+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_error,
774+ uniffi::FfiConverterTonConnectSessionError::lift,
775+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTonConnectRpcErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
776+}
777+std::vector<uint8_t> TonConnectDerivedSession::encrypt_send_success(const std::string &request_id, const std::string &signed_boc) {
778+ auto ptr = this->_uniffi_internal_clone_pointer();
779+ return uniffi::FfiConverterBytes::lift(
780+ uniffi::rust_call(
781+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_send_success,
782+ uniffi::FfiConverterTonConnectSessionError::lift,
783+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(signed_boc)));
784+}
785+std::vector<uint8_t> TonConnectDerivedSession::encrypt_sign_data_success(const std::string &request_id, const TonConnectSignedData &signed_data) {
786+ auto ptr = this->_uniffi_internal_clone_pointer();
787+ return uniffi::FfiConverterBytes::lift(
788+ uniffi::rust_call(
789+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_sign_data_success,
790+ uniffi::FfiConverterTonConnectSessionError::lift,
791+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTypeTonConnectSignedData::lower(signed_data)));
792+}
793+std::vector<uint8_t> TonConnectDerivedSession::open_challenge(const std::vector<uint8_t> &challenge) {
794+ auto ptr = this->_uniffi_internal_clone_pointer();
795+ return uniffi::FfiConverterBytes::lift(
796+ uniffi::rust_call(
797+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_open_challenge,
798+ uniffi::FfiConverterTonConnectSessionError::lift,
799+ ptr, uniffi::FfiConverterBytes::lower(challenge)));
800+}
801+std::string TonConnectDerivedSession::public_key_hex() {
802+ auto ptr = this->_uniffi_internal_clone_pointer();
803+ return uniffi::FfiConverterString::lift(
804+ uniffi::rust_call(
805+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_public_key_hex,
806+ nullptr,
807+ ptr));
808+}
809+std::vector<uint8_t> TonConnectDerivedSession::signing_public_key() {
810+ auto ptr = this->_uniffi_internal_clone_pointer();
811+ return uniffi::FfiConverterBytes::lift(
812+ uniffi::rust_call(
813+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_signing_public_key,
814+ nullptr,
815+ ptr));
816+}
817+
818+TonConnectDerivedSession::~TonConnectDerivedSession() {
819+ uniffi::rust_call(
820+ uniffi_wallet_engine_fn_free_tonconnectderivedsession,
821+ nullptr,
822+ this->instance
823+ );
824+}
825+
826+uint64_t TonConnectDerivedSession::_uniffi_internal_clone_pointer() const {
827+ return uniffi::rust_call(
828+ uniffi_wallet_engine_fn_clone_tonconnectderivedsession,
829+ nullptr,
830+ this->instance
831+ );
832+}
833+
834+
835+
836+
837+TonConnectSession::TonConnectSession(uint64_t ptr): instance(ptr) {}
838+
839+TonConnectSession::TonConnectSession(const TonConnectSession &other) : instance(0) {
840+ if (other.instance) {
841+ instance = other._uniffi_internal_clone_pointer();
842+ }
843+}
844+
845+
846+
847+
848+TonConnectPreparedPost TonConnectSession::approve_connect(const TonConnectAccountInfo &account, std::optional<TonConnectProofReply> proof, const TonConnectDevice &device) {
849+ auto ptr = this->_uniffi_internal_clone_pointer();
850+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
851+ uniffi::rust_call(
852+ uniffi_wallet_engine_fn_method_tonconnectsession_approve_connect,
853+ uniffi::FfiConverterTonConnectSessionError::lift,
854+ ptr, uniffi::FfiConverterTypeTonConnectAccountInfo::lower(account), uniffi::FfiConverterOptionalTypeTonConnectProofReply::lower(proof), uniffi::FfiConverterTypeTonConnectDevice::lower(device)));
855+}
856+std::string TonConnectSession::begin_events_subscription() {
857+ auto ptr = this->_uniffi_internal_clone_pointer();
858+ return uniffi::FfiConverterString::lift(
859+ uniffi::rust_call(
860+ uniffi_wallet_engine_fn_method_tonconnectsession_begin_events_subscription,
861+ uniffi::FfiConverterTonConnectSessionError::lift,
862+ ptr));
863+}
864+void TonConnectSession::complete_pending_post() {
865+ auto ptr = this->_uniffi_internal_clone_pointer();
866+
867+ uniffi::rust_call(
868+ uniffi_wallet_engine_fn_method_tonconnectsession_complete_pending_post,
869+ uniffi::FfiConverterTonConnectSessionError::lift,
870+ ptr);
871+}
872+std::optional<TonConnectConnectPrompt> TonConnectSession::connect_prompt() {
873+ auto ptr = this->_uniffi_internal_clone_pointer();
874+ return uniffi::FfiConverterOptionalTypeTonConnectConnectPrompt::lift(
875+ uniffi::rust_call(
876+ uniffi_wallet_engine_fn_method_tonconnectsession_connect_prompt,
877+ uniffi::FfiConverterTonConnectSessionError::lift,
878+ ptr));
879+}
880+TonConnectPreparedPost TonConnectSession::disconnect() {
881+ auto ptr = this->_uniffi_internal_clone_pointer();
882+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
883+ uniffi::rust_call(
884+ uniffi_wallet_engine_fn_method_tonconnectsession_disconnect,
885+ uniffi::FfiConverterTonConnectSessionError::lift,
886+ ptr));
887+}
888+std::vector<TonConnectIncomingRequest> TonConnectSession::ingest_sse_chunk(const std::vector<uint8_t> &chunk, uint64_t now) {
889+ auto ptr = this->_uniffi_internal_clone_pointer();
890+ return uniffi::FfiConverterSequenceTonConnectIncomingRequest::lift(
891+ uniffi::rust_call(
892+ uniffi_wallet_engine_fn_method_tonconnectsession_ingest_sse_chunk,
893+ uniffi::FfiConverterTonConnectSessionError::lift,
894+ ptr, uniffi::FfiConverterBytes::lower(chunk), uniffi::FfiConverterUInt64::lower(now)));
895+}
896+std::optional<TonConnectPreparedPost> TonConnectSession::pending_post() {
897+ auto ptr = this->_uniffi_internal_clone_pointer();
898+ return uniffi::FfiConverterOptionalTypeTonConnectPreparedPost::lift(
899+ uniffi::rust_call(
900+ uniffi_wallet_engine_fn_method_tonconnectsession_pending_post,
901+ uniffi::FfiConverterTonConnectSessionError::lift,
902+ ptr));
903+}
904+std::vector<TonConnectIncomingRequest> TonConnectSession::pending_requests(uint64_t now) {
905+ auto ptr = this->_uniffi_internal_clone_pointer();
906+ return uniffi::FfiConverterSequenceTonConnectIncomingRequest::lift(
907+ uniffi::rust_call(
908+ uniffi_wallet_engine_fn_method_tonconnectsession_pending_requests,
909+ uniffi::FfiConverterTonConnectSessionError::lift,
910+ ptr, uniffi::FfiConverterUInt64::lower(now)));
911+}
912+std::string TonConnectSession::persisted() {
913+ auto ptr = this->_uniffi_internal_clone_pointer();
914+ return uniffi::FfiConverterString::lift(
915+ uniffi::rust_call(
916+ uniffi_wallet_engine_fn_method_tonconnectsession_persisted,
917+ uniffi::FfiConverterTonConnectSessionError::lift,
918+ ptr));
919+}
920+TonConnectSessionPhase TonConnectSession::phase() {
921+ auto ptr = this->_uniffi_internal_clone_pointer();
922+ return uniffi::FfiConverterTonConnectSessionPhase::lift(
923+ uniffi::rust_call(
924+ uniffi_wallet_engine_fn_method_tonconnectsession_phase,
925+ uniffi::FfiConverterTonConnectSessionError::lift,
926+ ptr));
927+}
928+TonConnectPreparedPost TonConnectSession::prepare_disconnect_success(const std::string &request_id) {
929+ auto ptr = this->_uniffi_internal_clone_pointer();
930+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
931+ uniffi::rust_call(
932+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_disconnect_success,
933+ uniffi::FfiConverterTonConnectSessionError::lift,
934+ ptr, uniffi::FfiConverterString::lower(request_id)));
935+}
936+TonConnectPreparedPost TonConnectSession::prepare_error(const std::string &request_id, const TonConnectRpcErrorCode &code, const std::string &message) {
937+ auto ptr = this->_uniffi_internal_clone_pointer();
938+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
939+ uniffi::rust_call(
940+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_error,
941+ uniffi::FfiConverterTonConnectSessionError::lift,
942+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTonConnectRpcErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
943+}
944+TonConnectPreparedPost TonConnectSession::prepare_send_success(const std::string &request_id, const std::string &signed_boc) {
945+ auto ptr = this->_uniffi_internal_clone_pointer();
946+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
947+ uniffi::rust_call(
948+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_send_success,
949+ uniffi::FfiConverterTonConnectSessionError::lift,
950+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(signed_boc)));
951+}
952+TonConnectPreparedPost TonConnectSession::prepare_sign_message_success(const std::string &request_id, const std::string &internal_boc) {
953+ auto ptr = this->_uniffi_internal_clone_pointer();
954+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
955+ uniffi::rust_call(
956+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_sign_message_success,
957+ uniffi::FfiConverterTonConnectSessionError::lift,
958+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(internal_boc)));
959+}
960+TonConnectPreparedPost TonConnectSession::reject_connect(const std::string &message) {
961+ auto ptr = this->_uniffi_internal_clone_pointer();
962+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
963+ uniffi::rust_call(
964+ uniffi_wallet_engine_fn_method_tonconnectsession_reject_connect,
965+ uniffi::FfiConverterTonConnectSessionError::lift,
966+ ptr, uniffi::FfiConverterString::lower(message)));
967+}
968+
969+TonConnectSession::~TonConnectSession() {
970+ uniffi::rust_call(
971+ uniffi_wallet_engine_fn_free_tonconnectsession,
972+ nullptr,
973+ this->instance
974+ );
975+}
976+
977+uint64_t TonConnectSession::_uniffi_internal_clone_pointer() const {
978+ return uniffi::rust_call(
979+ uniffi_wallet_engine_fn_clone_tonconnectsession,
980+ nullptr,
981+ this->instance
982+ );
983+}
984+
985+
986+
987+
988+WalletClient::WalletClient(uint64_t ptr): instance(ptr) {}
989+
990+WalletClient::WalletClient(const WalletClient &other) : instance(0) {
991+ if (other.instance) {
992+ instance = other._uniffi_internal_clone_pointer();
993+ }
994+}
995+
996+
997+
998+
999+std::shared_ptr<WalletClient> WalletClient::init(const WalletClientConfig &config, const std::shared_ptr<WalletHttpHost> &http_host, const std::shared_ptr<WalletPlatformHost> &platform_host) {
1000+ return std::shared_ptr<WalletClient>(
1001+ new WalletClient(
1002+ uniffi::rust_call(
1003+ uniffi_wallet_engine_fn_constructor_walletclient_new,
1004+ uniffi::FfiConverterWalletClientError::lift, uniffi::FfiConverterTypeWalletClientConfig::lower(config), uniffi::FfiConverterWalletHttpHost::lower(http_host), uniffi::FfiConverterWalletPlatformHost::lower(platform_host)))
1005+ );
1006+}
1007+
1008+std::shared_ptr<WalletClient> WalletClient::new_statusless(const WalletClientConfig &config, const std::shared_ptr<WalletStatuslessHost> &statusless_host, const std::shared_ptr<WalletPlatformHost> &platform_host) {
1009+ return std::shared_ptr<WalletClient>(new WalletClient(
1010+ uniffi::rust_call(
1011+ uniffi_wallet_engine_fn_constructor_walletclient_new_statusless,
1012+ uniffi::FfiConverterWalletClientError::lift, uniffi::FfiConverterTypeWalletClientConfig::lower(config), uniffi::FfiConverterWalletStatuslessHost::lower(statusless_host), uniffi::FfiConverterWalletPlatformHost::lower(platform_host))));
1013+}
1014+
1015+void WalletClient::cancel_load_more_activity() {
1016+ auto ptr = this->_uniffi_internal_clone_pointer();
1017+
1018+ uniffi::rust_call_async(
1019+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_activity(
1020+ ptr); },
1021+ ffi_wallet_engine_rust_future_poll_void,
1022+ ffi_wallet_engine_rust_future_complete_void,
1023+ ffi_wallet_engine_rust_future_free_void,
1024+ uniffi::FfiConverterWalletClientError::lift
1025+ );
1026+}
1027+WalletUpdate WalletClient::load_more_activity() {
1028+ auto ptr = this->_uniffi_internal_clone_pointer();
1029+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1030+ uniffi::rust_call_async(
1031+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_load_more_activity(
1032+ ptr); },
1033+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1034+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1035+ ffi_wallet_engine_rust_future_free_rust_buffer,
1036+ uniffi::FfiConverterWalletClientError::lift
1037+ ));
1038+}
1039+void WalletClient::shutdown() {
1040+ auto ptr = this->_uniffi_internal_clone_pointer();
1041+
1042+ uniffi::rust_call_async(
1043+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_shutdown(
1044+ ptr); },
1045+ ffi_wallet_engine_rust_future_poll_void,
1046+ ffi_wallet_engine_rust_future_complete_void,
1047+ ffi_wallet_engine_rust_future_free_void,
1048+ uniffi::FfiConverterWalletClientError::lift
1049+ );
1050+}
1051+WalletSnapshot WalletClient::snapshot() {
1052+ auto ptr = this->_uniffi_internal_clone_pointer();
1053+ return uniffi::FfiConverterTypeWalletSnapshot::lift(
1054+ uniffi::rust_call(
1055+ uniffi_wallet_engine_fn_method_walletclient_snapshot,
1056+ uniffi::FfiConverterWalletClientError::lift,
1057+ ptr));
1058+}
1059+WalletSnapshot WalletClient::wait_for_change(uint64_t after_revision) {
1060+ auto ptr = this->_uniffi_internal_clone_pointer();
1061+ return uniffi::FfiConverterTypeWalletSnapshot::lift(
1062+ uniffi::rust_call_async(
1063+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_wait_for_change(
1064+ ptr, uniffi::FfiConverterUInt64::lower(after_revision)); },
1065+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1066+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1067+ ffi_wallet_engine_rust_future_free_rust_buffer,
1068+ uniffi::FfiConverterWalletClientError::lift
1069+ ));
1070+}
1071+std::optional<TonAddressString> WalletClient::resolve_dns(const std::string &name) {
1072+ auto ptr = this->_uniffi_internal_clone_pointer();
1073+ return uniffi::FfiConverterOptionalTypeTonAddressString::lift(
1074+ uniffi::rust_call_async(
1075+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_dns(
1076+ ptr, uniffi::FfiConverterString::lower(name)); },
1077+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1078+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1079+ ffi_wallet_engine_rust_future_free_rust_buffer,
1080+ uniffi::FfiConverterWalletClientError::lift
1081+ ));
1082+}
1083+Boc WalletClient::create_encrypted_comment(const CreateEncryptedCommentRequest &request) {
1084+ auto ptr = this->_uniffi_internal_clone_pointer();
1085+ return uniffi::FfiConverterTypeBoc::lift(
1086+ uniffi::rust_call_async(
1087+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_create_encrypted_comment(
1088+ ptr, uniffi::FfiConverterTypeCreateEncryptedCommentRequest::lower(request)); },
1089+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1090+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1091+ ffi_wallet_engine_rust_future_free_rust_buffer,
1092+ uniffi::FfiConverterWalletClientError::lift
1093+ ));
1094+}
1095+std::string WalletClient::decrypt_comment(const DecryptCommentRequest &request) {
1096+ auto ptr = this->_uniffi_internal_clone_pointer();
1097+ return uniffi::FfiConverterString::lift(
1098+ uniffi::rust_call_async(
1099+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_decrypt_comment(
1100+ ptr, uniffi::FfiConverterTypeDecryptCommentRequest::lower(request)); },
1101+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1102+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1103+ ffi_wallet_engine_rust_future_free_rust_buffer,
1104+ uniffi::FfiConverterWalletClientError::lift
1105+ ));
1106+}
1107+std::vector<uint8_t> WalletClient::resolve_encrypted_comment_recipient(const EncryptedCommentRecipientRequest &request) {
1108+ auto ptr = this->_uniffi_internal_clone_pointer();
1109+ return uniffi::FfiConverterBytes::lift(
1110+ uniffi::rust_call_async(
1111+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_encrypted_comment_recipient(
1112+ ptr, uniffi::FfiConverterTypeEncryptedCommentRecipientRequest::lower(request)); },
1113+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1114+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1115+ ffi_wallet_engine_rust_future_free_rust_buffer,
1116+ uniffi::FfiConverterWalletClientError::lift
1117+ ));
1118+}
1119+PreparedKeyRotation WalletClient::prepare_key_rotation(const PrepareKeyRotationRequest &request) {
1120+ auto ptr = this->_uniffi_internal_clone_pointer();
1121+ return uniffi::FfiConverterTypePreparedKeyRotation::lift(
1122+ uniffi::rust_call_async(
1123+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_key_rotation(
1124+ ptr, uniffi::FfiConverterTypePrepareKeyRotationRequest::lower(request)); },
1125+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1126+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1127+ ffi_wallet_engine_rust_future_free_rust_buffer,
1128+ uniffi::FfiConverterWalletClientError::lift
1129+ ));
1130+}
1131+void WalletClient::cancel_load_more_nfts() {
1132+ auto ptr = this->_uniffi_internal_clone_pointer();
1133+
1134+ uniffi::rust_call_async(
1135+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_nfts(
1136+ ptr); },
1137+ ffi_wallet_engine_rust_future_poll_void,
1138+ ffi_wallet_engine_rust_future_complete_void,
1139+ ffi_wallet_engine_rust_future_free_void,
1140+ uniffi::FfiConverterWalletClientError::lift
1141+ );
1142+}
1143+void WalletClient::cancel_refresh_nfts() {
1144+ auto ptr = this->_uniffi_internal_clone_pointer();
1145+
1146+ uniffi::rust_call_async(
1147+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh_nfts(
1148+ ptr); },
1149+ ffi_wallet_engine_rust_future_poll_void,
1150+ ffi_wallet_engine_rust_future_complete_void,
1151+ ffi_wallet_engine_rust_future_free_void,
1152+ uniffi::FfiConverterWalletClientError::lift
1153+ );
1154+}
1155+WalletUpdate WalletClient::load_more_nfts() {
1156+ auto ptr = this->_uniffi_internal_clone_pointer();
1157+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1158+ uniffi::rust_call_async(
1159+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_load_more_nfts(
1160+ ptr); },
1161+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1162+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1163+ ffi_wallet_engine_rust_future_free_rust_buffer,
1164+ uniffi::FfiConverterWalletClientError::lift
1165+ ));
1166+}
1167+WalletUpdate WalletClient::refresh_nfts() {
1168+ auto ptr = this->_uniffi_internal_clone_pointer();
1169+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1170+ uniffi::rust_call_async(
1171+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_refresh_nfts(
1172+ ptr); },
1173+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1174+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1175+ ffi_wallet_engine_rust_future_free_rust_buffer,
1176+ uniffi::FfiConverterWalletClientError::lift
1177+ ));
1178+}
1179+PreparedTransfer WalletClient::prepare_nft_transfer(const PrepareNftTransferRequest &request) {
1180+ auto ptr = this->_uniffi_internal_clone_pointer();
1181+ return uniffi::FfiConverterTypePreparedTransfer::lift(
1182+ uniffi::rust_call_async(
1183+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_nft_transfer(
1184+ ptr, uniffi::FfiConverterTypePrepareNftTransferRequest::lower(request)); },
1185+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1186+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1187+ ffi_wallet_engine_rust_future_free_rust_buffer,
1188+ uniffi::FfiConverterWalletClientError::lift
1189+ ));
1190+}
1191+SendPreview WalletClient::preview_nft_transfer(const NftTransferPreviewRequest &request) {
1192+ auto ptr = this->_uniffi_internal_clone_pointer();
1193+ return uniffi::FfiConverterTypeSendPreview::lift(
1194+ uniffi::rust_call_async(
1195+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_nft_transfer(
1196+ ptr, uniffi::FfiConverterTypeNftTransferPreviewRequest::lower(request)); },
1197+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1198+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1199+ ffi_wallet_engine_rust_future_free_rust_buffer,
1200+ uniffi::FfiConverterWalletClientError::lift
1201+ ));
1202+}
1203+SendResult WalletClient::send_nft_transfer(const NftTransferRequest &request) {
1204+ auto ptr = this->_uniffi_internal_clone_pointer();
1205+ return uniffi::FfiConverterTypeSendResult::lift(
1206+ uniffi::rust_call_async(
1207+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_send_nft_transfer(
1208+ ptr, uniffi::FfiConverterTypeNftTransferRequest::lower(request)); },
1209+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1210+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1211+ ffi_wallet_engine_rust_future_free_rust_buffer,
1212+ uniffi::FfiConverterWalletClientError::lift
1213+ ));
1214+}
1215+PreparedTransfer WalletClient::prepare_transfer(const PrepareTransferRequest &request) {
1216+ auto ptr = this->_uniffi_internal_clone_pointer();
1217+ return uniffi::FfiConverterTypePreparedTransfer::lift(
1218+ uniffi::rust_call_async(
1219+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_transfer(
1220+ ptr, uniffi::FfiConverterTypePrepareTransferRequest::lower(request)); },
1221+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1222+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1223+ ffi_wallet_engine_rust_future_free_rust_buffer,
1224+ uniffi::FfiConverterWalletClientError::lift
1225+ ));
1226+}
1227+void WalletClient::cancel_send_preview() {
1228+ auto ptr = this->_uniffi_internal_clone_pointer();
1229+
1230+ uniffi::rust_call_async(
1231+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send_preview(
1232+ ptr); },
1233+ ffi_wallet_engine_rust_future_poll_void,
1234+ ffi_wallet_engine_rust_future_complete_void,
1235+ ffi_wallet_engine_rust_future_free_void,
1236+ uniffi::FfiConverterWalletClientError::lift
1237+ );
1238+}
1239+SendPreview WalletClient::preview_key_rotation() {
1240+ auto ptr = this->_uniffi_internal_clone_pointer();
1241+ return uniffi::FfiConverterTypeSendPreview::lift(
1242+ uniffi::rust_call_async(
1243+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_key_rotation(
1244+ ptr); },
1245+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1246+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1247+ ffi_wallet_engine_rust_future_free_rust_buffer,
1248+ uniffi::FfiConverterWalletClientError::lift
1249+ ));
1250+}
1251+SendPreview WalletClient::preview_send(const SendPreviewRequest &request) {
1252+ auto ptr = this->_uniffi_internal_clone_pointer();
1253+ return uniffi::FfiConverterTypeSendPreview::lift(
1254+ uniffi::rust_call_async(
1255+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_send(
1256+ ptr, uniffi::FfiConverterTypeSendPreviewRequest::lower(request)); },
1257+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1258+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1259+ ffi_wallet_engine_rust_future_free_rust_buffer,
1260+ uniffi::FfiConverterWalletClientError::lift
1261+ ));
1262+}
1263+SendPreview WalletClient::preview_send_boc(const SendBocRequest &request) {
1264+ auto ptr = this->_uniffi_internal_clone_pointer();
1265+ return uniffi::FfiConverterTypeSendPreview::lift(
1266+ uniffi::rust_call_async(
1267+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_send_boc(
1268+ ptr, uniffi::FfiConverterTypeSendBocRequest::lower(request)); },
1269+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1270+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1271+ ffi_wallet_engine_rust_future_free_rust_buffer,
1272+ uniffi::FfiConverterWalletClientError::lift
1273+ ));
1274+}
1275+SignMessagePreview WalletClient::preview_sign_message(const SendPreviewRequest &request) {
1276+ auto ptr = this->_uniffi_internal_clone_pointer();
1277+ return uniffi::FfiConverterTypeSignMessagePreview::lift(
1278+ uniffi::rust_call_async(
1279+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_sign_message(
1280+ ptr, uniffi::FfiConverterTypeSendPreviewRequest::lower(request)); },
1281+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1282+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1283+ ffi_wallet_engine_rust_future_free_rust_buffer,
1284+ uniffi::FfiConverterWalletClientError::lift
1285+ ));
1286+}
1287+SendPreview WalletClient::preview_ton_connect(const SendRequest &request) {
1288+ auto ptr = this->_uniffi_internal_clone_pointer();
1289+ return uniffi::FfiConverterTypeSendPreview::lift(
1290+ uniffi::rust_call_async(
1291+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_ton_connect(
1292+ ptr, uniffi::FfiConverterTypeSendRequest::lower(request)); },
1293+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1294+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1295+ ffi_wallet_engine_rust_future_free_rust_buffer,
1296+ uniffi::FfiConverterWalletClientError::lift
1297+ ));
1298+}
1299+void WalletClient::cancel_refresh() {
1300+ auto ptr = this->_uniffi_internal_clone_pointer();
1301+
1302+ uniffi::rust_call_async(
1303+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh(
1304+ ptr); },
1305+ ffi_wallet_engine_rust_future_poll_void,
1306+ ffi_wallet_engine_rust_future_complete_void,
1307+ ffi_wallet_engine_rust_future_free_void,
1308+ uniffi::FfiConverterWalletClientError::lift
1309+ );
1310+}
1311+WalletUpdate WalletClient::refresh() {
1312+ auto ptr = this->_uniffi_internal_clone_pointer();
1313+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1314+ uniffi::rust_call_async(
1315+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_refresh(
1316+ ptr); },
1317+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1318+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1319+ ffi_wallet_engine_rust_future_free_rust_buffer,
1320+ uniffi::FfiConverterWalletClientError::lift
1321+ ));
1322+}
1323+SendSnapshot WalletClient::resolve_pending() {
1324+ auto ptr = this->_uniffi_internal_clone_pointer();
1325+ return uniffi::FfiConverterTypeSendSnapshot::lift(
1326+ uniffi::rust_call_async(
1327+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_pending(
1328+ ptr); },
1329+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1330+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1331+ ffi_wallet_engine_rust_future_free_rust_buffer,
1332+ uniffi::FfiConverterWalletClientError::lift
1333+ ));
1334+}
1335+void WalletClient::cancel_send() {
1336+ auto ptr = this->_uniffi_internal_clone_pointer();
1337+
1338+ uniffi::rust_call_async(
1339+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send(
1340+ ptr); },
1341+ ffi_wallet_engine_rust_future_poll_void,
1342+ ffi_wallet_engine_rust_future_complete_void,
1343+ ffi_wallet_engine_rust_future_free_void,
1344+ uniffi::FfiConverterWalletClientError::lift
1345+ );
1346+}
1347+SendResult WalletClient::send(const SendRequest &request) {
1348+ auto ptr = this->_uniffi_internal_clone_pointer();
1349+ return uniffi::FfiConverterTypeSendResult::lift(
1350+ uniffi::rust_call_async(
1351+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_send(
1352+ ptr, uniffi::FfiConverterTypeSendRequest::lower(request)); },
1353+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1354+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1355+ ffi_wallet_engine_rust_future_free_rust_buffer,
1356+ uniffi::FfiConverterWalletClientError::lift
1357+ ));
1358+}
1359+SendResult WalletClient::send_boc(const SendBocRequest &request) {
1360+ auto ptr = this->_uniffi_internal_clone_pointer();
1361+ return uniffi::FfiConverterTypeSendResult::lift(
1362+ uniffi::rust_call_async(
1363+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_send_boc(
1364+ ptr, uniffi::FfiConverterTypeSendBocRequest::lower(request)); },
1365+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1366+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1367+ ffi_wallet_engine_rust_future_free_rust_buffer,
1368+ uniffi::FfiConverterWalletClientError::lift
1369+ ));
1370+}
1371+SignMessageResult WalletClient::sign_message(const SignMessageRequest &request) {
1372+ auto ptr = this->_uniffi_internal_clone_pointer();
1373+ return uniffi::FfiConverterTypeSignMessageResult::lift(
1374+ uniffi::rust_call_async(
1375+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_sign_message(
1376+ ptr, uniffi::FfiConverterTypeSignMessageRequest::lower(request)); },
1377+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1378+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1379+ ffi_wallet_engine_rust_future_free_rust_buffer,
1380+ uniffi::FfiConverterWalletClientError::lift
1381+ ));
1382+}
1383+
1384+WalletClient::~WalletClient() {
1385+ uniffi::rust_call(
1386+ uniffi_wallet_engine_fn_free_walletclient,
1387+ nullptr,
1388+ this->instance
1389+ );
1390+}
1391+
1392+uint64_t WalletClient::_uniffi_internal_clone_pointer() const {
1393+ return uniffi::rust_call(
1394+ uniffi_wallet_engine_fn_clone_walletclient,
1395+ nullptr,
1396+ this->instance
1397+ );
1398+}
1399+
1400+
1401+namespace uniffi {
1402+
1403+ void UniffiCallbackInterfaceWalletHttpHost::execute_http(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1404+ auto obj = FfiConverterWalletHttpHost::handle_map.at(uniffi_handle);
1405+
1406+ auto make_call = [&]() -> HttpResponse {
1407+ auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_http(
1408+ arg0);
1409+ };
1410+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1411+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1412+ UniffiForeignFutureResultRustBuffer result = {};
1413+ uniffi_out_dropped_callback.handle = 0;
1414+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1415+
1416+
1417+ auto write_value = [&](const HttpResponse &v) {
1418+ result.return_value = FfiConverterTypeHttpResponse::lower(v);
1419+ };
1420+
1421+
1422+
1423+ rust_call_trait_interface_with_error<HttpHostError>(&result.call_status, make_call, write_value, FfiConverterHttpHostError::lower);
1424+
1425+ complete(uniffi_callback_data, result);
1426+}
1427+ void UniffiCallbackInterfaceWalletHttpHost::cancel_http(uint64_t uniffi_handle,RustBuffer request_id,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1428+ auto obj = FfiConverterWalletHttpHost::handle_map.at(uniffi_handle);
1429+
1430+ auto make_call = [&]() {
1431+ auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_http(
1432+ arg0);
1433+ };
1434+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1435+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1436+ UniffiForeignFutureResultVoid result = {};
1437+ uniffi_out_dropped_callback.handle = 0;
1438+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1439+
1440+
1441+ auto write_value = [](){};
1442+
1443+
1444+
1445+ rust_call_trait_interface(&result.call_status, make_call, write_value);
1446+
1447+ complete(uniffi_callback_data, result);
1448+}
1449+
1450+void UniffiCallbackInterfaceWalletHttpHost::uniffi_free(uint64_t uniffi_handle) {
1451+ FfiConverterWalletHttpHost::handle_map.erase(uniffi_handle);
1452+}
1453+
1454+uint64_t UniffiCallbackInterfaceWalletHttpHost::uniffi_clone(uint64_t uniffi_handle) {
1455+ return FfiConverterWalletHttpHost::handle_map.insert(
1456+ FfiConverterWalletHttpHost::handle_map.at(uniffi_handle)
1457+ );
1458+}
1459+
1460+void UniffiCallbackInterfaceWalletHttpHost::init() {
1461+ uniffi_wallet_engine_fn_init_callback_vtable_wallethttphost(vtable);
1462+}
1463+} // namespace uniffi
1464+
1465+
1466+WalletHttpHostImpl::WalletHttpHostImpl(uint64_t ptr): instance(ptr) {}
1467+
1468+WalletHttpHostImpl::WalletHttpHostImpl(const WalletHttpHostImpl &other) : instance(0) {
1469+ if (other.instance) {
1470+ instance = other._uniffi_internal_clone_pointer();
1471+ }
1472+}
1473+
1474+
1475+
1476+
1477+HttpResponse WalletHttpHostImpl::execute_http(const HttpRequest &request) {
1478+ auto ptr = this->_uniffi_internal_clone_pointer();
1479+ return uniffi::FfiConverterTypeHttpResponse::lift(
1480+ uniffi::rust_call_async(
1481+ [&]() { return uniffi_wallet_engine_fn_method_wallethttphost_execute_http(
1482+ ptr, uniffi::FfiConverterTypeHttpRequest::lower(request)); },
1483+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1484+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1485+ ffi_wallet_engine_rust_future_free_rust_buffer,
1486+ uniffi::FfiConverterHttpHostError::lift
1487+ ));
1488+}
1489+void WalletHttpHostImpl::cancel_http(const HttpRequestId &request_id) {
1490+ auto ptr = this->_uniffi_internal_clone_pointer();
1491+
1492+ uniffi::rust_call_async(
1493+ [&]() { return uniffi_wallet_engine_fn_method_wallethttphost_cancel_http(
1494+ ptr, uniffi::FfiConverterTypeHttpRequestId::lower(request_id)); },
1495+ ffi_wallet_engine_rust_future_poll_void,
1496+ ffi_wallet_engine_rust_future_complete_void,
1497+ ffi_wallet_engine_rust_future_free_void,
1498+ nullptr
1499+ );
1500+}
1501+
1502+WalletHttpHostImpl::~WalletHttpHostImpl() {
1503+ uniffi::rust_call(
1504+ uniffi_wallet_engine_fn_free_wallethttphost,
1505+ nullptr,
1506+ this->instance
1507+ );
1508+}
1509+
1510+uint64_t WalletHttpHostImpl::_uniffi_internal_clone_pointer() const {
1511+ return uniffi::rust_call(
1512+ uniffi_wallet_engine_fn_clone_wallethttphost,
1513+ nullptr,
1514+ this->instance
1515+ );
1516+}
1517+
1518+
1519+
1520+
1521+WalletLifecycle::WalletLifecycle(uint64_t ptr): instance(ptr) {}
1522+
1523+WalletLifecycle::WalletLifecycle(const WalletLifecycle &other) : instance(0) {
1524+ if (other.instance) {
1525+ instance = other._uniffi_internal_clone_pointer();
1526+ }
1527+}
1528+
1529+
1530+
1531+
1532+std::shared_ptr<WalletLifecycle> WalletLifecycle::init(const std::shared_ptr<WalletPlatformHost> &platform_host) {
1533+ return std::shared_ptr<WalletLifecycle>(
1534+ new WalletLifecycle(
1535+ uniffi::rust_call(
1536+ uniffi_wallet_engine_fn_constructor_walletlifecycle_new,
1537+ nullptr, uniffi::FfiConverterWalletPlatformHost::lower(platform_host)))
1538+ );
1539+}
1540+
1541+CreatedWallet WalletLifecycle::create_wallet(const CreateWalletRequest &request) {
1542+ auto ptr = this->_uniffi_internal_clone_pointer();
1543+ return uniffi::FfiConverterTypeCreatedWallet::lift(
1544+ uniffi::rust_call_async(
1545+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_create_wallet(
1546+ ptr, uniffi::FfiConverterTypeCreateWalletRequest::lower(request)); },
1547+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1548+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1549+ ffi_wallet_engine_rust_future_free_rust_buffer,
1550+ uniffi::FfiConverterWalletLifecycleError::lift
1551+ ));
1552+}
1553+void WalletLifecycle::delete_wallet(const WalletDescriptor &descriptor) {
1554+ auto ptr = this->_uniffi_internal_clone_pointer();
1555+
1556+ uniffi::rust_call_async(
1557+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_delete_wallet(
1558+ ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)); },
1559+ ffi_wallet_engine_rust_future_poll_void,
1560+ ffi_wallet_engine_rust_future_complete_void,
1561+ ffi_wallet_engine_rust_future_free_void,
1562+ uniffi::FfiConverterWalletLifecycleError::lift
1563+ );
1564+}
1565+std::shared_ptr<TonConnectDerivedSession> WalletLifecycle::derive_ton_connect_session(const TonConnectDerivedSessionRequest &request) {
1566+ auto ptr = this->_uniffi_internal_clone_pointer();
1567+ return uniffi::FfiConverterTonConnectDerivedSession::lift(
1568+ uniffi::rust_call_async(
1569+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_derive_ton_connect_session(
1570+ ptr, uniffi::FfiConverterTypeTonConnectDerivedSessionRequest::lower(request)); },
1571+ ffi_wallet_engine_rust_future_poll_u64,
1572+ ffi_wallet_engine_rust_future_complete_u64,
1573+ ffi_wallet_engine_rust_future_free_u64,
1574+ uniffi::FfiConverterWalletLifecycleError::lift
1575+ ));
1576+}
1577+WalletDescriptor WalletLifecycle::import_wallet(const ImportWalletRequest &request) {
1578+ auto ptr = this->_uniffi_internal_clone_pointer();
1579+ return uniffi::FfiConverterTypeWalletDescriptor::lift(
1580+ uniffi::rust_call_async(
1581+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_import_wallet(
1582+ ptr, uniffi::FfiConverterTypeImportWalletRequest::lower(request)); },
1583+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1584+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1585+ ffi_wallet_engine_rust_future_free_rust_buffer,
1586+ uniffi::FfiConverterWalletLifecycleError::lift
1587+ ));
1588+}
1589+RecoveryPhrase WalletLifecycle::reveal_recovery_phrase(const WalletDescriptor &descriptor) {
1590+ auto ptr = this->_uniffi_internal_clone_pointer();
1591+ return uniffi::FfiConverterTypeRecoveryPhrase::lift(
1592+ uniffi::rust_call_async(
1593+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_reveal_recovery_phrase(
1594+ ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)); },
1595+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1596+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1597+ ffi_wallet_engine_rust_future_free_rust_buffer,
1598+ uniffi::FfiConverterWalletLifecycleError::lift
1599+ ));
1600+}
1601+TonConnectSignedData WalletLifecycle::sign_ton_connect_data(const TonConnectSignDataSignRequest &request) {
1602+ auto ptr = this->_uniffi_internal_clone_pointer();
1603+ return uniffi::FfiConverterTypeTonConnectSignedData::lift(
1604+ uniffi::rust_call_async(
1605+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_sign_ton_connect_data(
1606+ ptr, uniffi::FfiConverterTypeTonConnectSignDataSignRequest::lower(request)); },
1607+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1608+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1609+ ffi_wallet_engine_rust_future_free_rust_buffer,
1610+ uniffi::FfiConverterWalletLifecycleError::lift
1611+ ));
1612+}
1613+TonConnectProofSignature WalletLifecycle::sign_ton_connect_proof(const TonConnectProofSignRequest &request) {
1614+ auto ptr = this->_uniffi_internal_clone_pointer();
1615+ return uniffi::FfiConverterTypeTonConnectProofSignature::lift(
1616+ uniffi::rust_call_async(
1617+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_sign_ton_connect_proof(
1618+ ptr, uniffi::FfiConverterTypeTonConnectProofSignRequest::lower(request)); },
1619+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1620+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1621+ ffi_wallet_engine_rust_future_free_rust_buffer,
1622+ uniffi::FfiConverterWalletLifecycleError::lift
1623+ ));
1624+}
1625+TonConnectAccountInfo WalletLifecycle::ton_connect_account(const WalletDescriptor &descriptor) {
1626+ auto ptr = this->_uniffi_internal_clone_pointer();
1627+ return uniffi::FfiConverterTypeTonConnectAccountInfo::lift(
1628+ uniffi::rust_call(
1629+ uniffi_wallet_engine_fn_method_walletlifecycle_ton_connect_account,
1630+ uniffi::FfiConverterWalletLifecycleError::lift,
1631+ ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)));
1632+}
1633+
1634+WalletLifecycle::~WalletLifecycle() {
1635+ uniffi::rust_call(
1636+ uniffi_wallet_engine_fn_free_walletlifecycle,
1637+ nullptr,
1638+ this->instance
1639+ );
1640+}
1641+
1642+uint64_t WalletLifecycle::_uniffi_internal_clone_pointer() const {
1643+ return uniffi::rust_call(
1644+ uniffi_wallet_engine_fn_clone_walletlifecycle,
1645+ nullptr,
1646+ this->instance
1647+ );
1648+}
1649+
1650+
1651+namespace uniffi {
1652+
1653+ void UniffiCallbackInterfaceWalletPlatformHost::read_protected_secret(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1654+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1655+
1656+ auto make_call = [&]() -> std::vector<uint8_t> {
1657+ auto arg0 =FfiConverterTypeProtectedSecretRead::lift(request);return obj->read_protected_secret(
1658+ arg0);
1659+ };
1660+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1661+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1662+ UniffiForeignFutureResultRustBuffer result = {};
1663+ uniffi_out_dropped_callback.handle = 0;
1664+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1665+
1666+
1667+ auto write_value = [&](const std::vector<uint8_t> &v) {
1668+ result.return_value = FfiConverterBytes::lower(v);
1669+ };
1670+
1671+
1672+
1673+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1674+
1675+ complete(uniffi_callback_data, result);
1676+}
1677+ void UniffiCallbackInterfaceWalletPlatformHost::store_protected_secret(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1678+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1679+
1680+ auto make_call = [&]() {
1681+ auto arg0 =FfiConverterTypeProtectedSecretStore::lift(request);obj->store_protected_secret(
1682+ arg0);
1683+ };
1684+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1685+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1686+ UniffiForeignFutureResultVoid result = {};
1687+ uniffi_out_dropped_callback.handle = 0;
1688+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1689+
1690+
1691+ auto write_value = [](){};
1692+
1693+
1694+
1695+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1696+
1697+ complete(uniffi_callback_data, result);
1698+}
1699+ void UniffiCallbackInterfaceWalletPlatformHost::delete_protected_secret(uint64_t uniffi_handle,RustBuffer secret_ref,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1700+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1701+
1702+ auto make_call = [&]() {
1703+ auto arg0 =FfiConverterTypeProtectedSecretRef::lift(secret_ref);obj->delete_protected_secret(
1704+ arg0);
1705+ };
1706+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1707+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1708+ UniffiForeignFutureResultVoid result = {};
1709+ uniffi_out_dropped_callback.handle = 0;
1710+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1711+
1712+
1713+ auto write_value = [](){};
1714+
1715+
1716+
1717+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1718+
1719+ complete(uniffi_callback_data, result);
1720+}
1721+ void UniffiCallbackInterfaceWalletPlatformHost::load_journal(uint64_t uniffi_handle,RustBuffer key,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1722+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1723+
1724+ auto make_call = [&]() -> std::optional<JournalRecord> {
1725+ auto arg0 =FfiConverterTypeJournalKey::lift(key);return obj->load_journal(
1726+ arg0);
1727+ };
1728+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1729+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1730+ UniffiForeignFutureResultRustBuffer result = {};
1731+ uniffi_out_dropped_callback.handle = 0;
1732+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1733+
1734+
1735+ auto write_value = [&](const std::optional<JournalRecord> &v) {
1736+ result.return_value = FfiConverterOptionalTypeJournalRecord::lower(v);
1737+ };
1738+
1739+
1740+
1741+ rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
1742+
1743+ complete(uniffi_callback_data, result);
1744+}
1745+ void UniffiCallbackInterfaceWalletPlatformHost::compare_exchange_journal(uint64_t uniffi_handle,RustBuffer mutation,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1746+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1747+
1748+ auto make_call = [&]() -> JournalCompareExchangeResult {
1749+ auto arg0 =FfiConverterTypeJournalCompareExchange::lift(mutation);return obj->compare_exchange_journal(
1750+ arg0);
1751+ };
1752+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1753+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1754+ UniffiForeignFutureResultRustBuffer result = {};
1755+ uniffi_out_dropped_callback.handle = 0;
1756+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1757+
1758+
1759+ auto write_value = [&](const JournalCompareExchangeResult &v) {
1760+ result.return_value = FfiConverterTypeJournalCompareExchangeResult::lower(v);
1761+ };
1762+
1763+
1764+
1765+ rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
1766+
1767+ complete(uniffi_callback_data, result);
1768+}
1769+
1770+void UniffiCallbackInterfaceWalletPlatformHost::uniffi_free(uint64_t uniffi_handle) {
1771+ FfiConverterWalletPlatformHost::handle_map.erase(uniffi_handle);
1772+}
1773+
1774+uint64_t UniffiCallbackInterfaceWalletPlatformHost::uniffi_clone(uint64_t uniffi_handle) {
1775+ return FfiConverterWalletPlatformHost::handle_map.insert(
1776+ FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle)
1777+ );
1778+}
1779+
1780+void UniffiCallbackInterfaceWalletPlatformHost::init() {
1781+ uniffi_wallet_engine_fn_init_callback_vtable_walletplatformhost(vtable);
1782+}
1783+} // namespace uniffi
1784+
1785+
1786+WalletPlatformHostImpl::WalletPlatformHostImpl(uint64_t ptr): instance(ptr) {}
1787+
1788+WalletPlatformHostImpl::WalletPlatformHostImpl(const WalletPlatformHostImpl &other) : instance(0) {
1789+ if (other.instance) {
1790+ instance = other._uniffi_internal_clone_pointer();
1791+ }
1792+}
1793+
1794+
1795+
1796+
1797+std::vector<uint8_t> WalletPlatformHostImpl::read_protected_secret(const ProtectedSecretRead &request) {
1798+ auto ptr = this->_uniffi_internal_clone_pointer();
1799+ return uniffi::FfiConverterBytes::lift(
1800+ uniffi::rust_call_async(
1801+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_read_protected_secret(
1802+ ptr, uniffi::FfiConverterTypeProtectedSecretRead::lower(request)); },
1803+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1804+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1805+ ffi_wallet_engine_rust_future_free_rust_buffer,
1806+ uniffi::FfiConverterProtectedSecretHostError::lift
1807+ ));
1808+}
1809+void WalletPlatformHostImpl::store_protected_secret(const ProtectedSecretStore &request) {
1810+ auto ptr = this->_uniffi_internal_clone_pointer();
1811+
1812+ uniffi::rust_call_async(
1813+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_store_protected_secret(
1814+ ptr, uniffi::FfiConverterTypeProtectedSecretStore::lower(request)); },
1815+ ffi_wallet_engine_rust_future_poll_void,
1816+ ffi_wallet_engine_rust_future_complete_void,
1817+ ffi_wallet_engine_rust_future_free_void,
1818+ uniffi::FfiConverterProtectedSecretHostError::lift
1819+ );
1820+}
1821+void WalletPlatformHostImpl::delete_protected_secret(const ProtectedSecretRef &secret_ref) {
1822+ auto ptr = this->_uniffi_internal_clone_pointer();
1823+
1824+ uniffi::rust_call_async(
1825+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_delete_protected_secret(
1826+ ptr, uniffi::FfiConverterTypeProtectedSecretRef::lower(secret_ref)); },
1827+ ffi_wallet_engine_rust_future_poll_void,
1828+ ffi_wallet_engine_rust_future_complete_void,
1829+ ffi_wallet_engine_rust_future_free_void,
1830+ uniffi::FfiConverterProtectedSecretHostError::lift
1831+ );
1832+}
1833+std::optional<JournalRecord> WalletPlatformHostImpl::load_journal(const JournalKey &key) {
1834+ auto ptr = this->_uniffi_internal_clone_pointer();
1835+ return uniffi::FfiConverterOptionalTypeJournalRecord::lift(
1836+ uniffi::rust_call_async(
1837+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_load_journal(
1838+ ptr, uniffi::FfiConverterTypeJournalKey::lower(key)); },
1839+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1840+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1841+ ffi_wallet_engine_rust_future_free_rust_buffer,
1842+ uniffi::FfiConverterJournalHostError::lift
1843+ ));
1844+}
1845+JournalCompareExchangeResult WalletPlatformHostImpl::compare_exchange_journal(const JournalCompareExchange &mutation) {
1846+ auto ptr = this->_uniffi_internal_clone_pointer();
1847+ return uniffi::FfiConverterTypeJournalCompareExchangeResult::lift(
1848+ uniffi::rust_call_async(
1849+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_compare_exchange_journal(
1850+ ptr, uniffi::FfiConverterTypeJournalCompareExchange::lower(mutation)); },
1851+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1852+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1853+ ffi_wallet_engine_rust_future_free_rust_buffer,
1854+ uniffi::FfiConverterJournalHostError::lift
1855+ ));
1856+}
1857+
1858+WalletPlatformHostImpl::~WalletPlatformHostImpl() {
1859+ uniffi::rust_call(
1860+ uniffi_wallet_engine_fn_free_walletplatformhost,
1861+ nullptr,
1862+ this->instance
1863+ );
1864+}
1865+
1866+uint64_t WalletPlatformHostImpl::_uniffi_internal_clone_pointer() const {
1867+ return uniffi::rust_call(
1868+ uniffi_wallet_engine_fn_clone_walletplatformhost,
1869+ nullptr,
1870+ this->instance
1871+ );
1872+}
1873+
1874+
1875+namespace uniffi {
1876+
1877+ void UniffiCallbackInterfaceWalletStatuslessHost::execute_statusless(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1878+ auto obj = FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle);
1879+
1880+ auto make_call = [&]() -> std::vector<uint8_t> {
1881+ auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_statusless(
1882+ arg0);
1883+ };
1884+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1885+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1886+ UniffiForeignFutureResultRustBuffer result = {};
1887+ uniffi_out_dropped_callback.handle = 0;
1888+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1889+
1890+
1891+ auto write_value = [&](const std::vector<uint8_t> &v) {
1892+ result.return_value = FfiConverterBytes::lower(v);
1893+ };
1894+
1895+
1896+
1897+ rust_call_trait_interface_with_error<StatuslessHostError>(&result.call_status, make_call, write_value, FfiConverterStatuslessHostError::lower);
1898+
1899+ complete(uniffi_callback_data, result);
1900+}
1901+ void UniffiCallbackInterfaceWalletStatuslessHost::cancel_statusless(uint64_t uniffi_handle,RustBuffer request_id,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1902+ auto obj = FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle);
1903+
1904+ auto make_call = [&]() {
1905+ auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_statusless(
1906+ arg0);
1907+ };
1908+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1909+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1910+ UniffiForeignFutureResultVoid result = {};
1911+ uniffi_out_dropped_callback.handle = 0;
1912+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1913+
1914+
1915+ auto write_value = [](){};
1916+
1917+
1918+
1919+ rust_call_trait_interface(&result.call_status, make_call, write_value);
1920+
1921+ complete(uniffi_callback_data, result);
1922+}
1923+
1924+void UniffiCallbackInterfaceWalletStatuslessHost::uniffi_free(uint64_t uniffi_handle) {
1925+ FfiConverterWalletStatuslessHost::handle_map.erase(uniffi_handle);
1926+}
1927+
1928+uint64_t UniffiCallbackInterfaceWalletStatuslessHost::uniffi_clone(uint64_t uniffi_handle) {
1929+ return FfiConverterWalletStatuslessHost::handle_map.insert(
1930+ FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle)
1931+ );
1932+}
1933+
1934+void UniffiCallbackInterfaceWalletStatuslessHost::init() {
1935+ uniffi_wallet_engine_fn_init_callback_vtable_walletstatuslesshost(vtable);
1936+}
1937+} // namespace uniffi
1938+
1939+
1940+WalletStatuslessHostImpl::WalletStatuslessHostImpl(uint64_t ptr): instance(ptr) {}
1941+
1942+WalletStatuslessHostImpl::WalletStatuslessHostImpl(const WalletStatuslessHostImpl &other) : instance(0) {
1943+ if (other.instance) {
1944+ instance = other._uniffi_internal_clone_pointer();
1945+ }
1946+}
1947+
1948+
1949+
1950+
1951+std::vector<uint8_t> WalletStatuslessHostImpl::execute_statusless(const HttpRequest &request) {
1952+ auto ptr = this->_uniffi_internal_clone_pointer();
1953+ return uniffi::FfiConverterBytes::lift(
1954+ uniffi::rust_call_async(
1955+ [&]() { return uniffi_wallet_engine_fn_method_walletstatuslesshost_execute_statusless(
1956+ ptr, uniffi::FfiConverterTypeHttpRequest::lower(request)); },
1957+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1958+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1959+ ffi_wallet_engine_rust_future_free_rust_buffer,
1960+ uniffi::FfiConverterStatuslessHostError::lift
1961+ ));
1962+}
1963+void WalletStatuslessHostImpl::cancel_statusless(const HttpRequestId &request_id) {
1964+ auto ptr = this->_uniffi_internal_clone_pointer();
1965+
1966+ uniffi::rust_call_async(
1967+ [&]() { return uniffi_wallet_engine_fn_method_walletstatuslesshost_cancel_statusless(
1968+ ptr, uniffi::FfiConverterTypeHttpRequestId::lower(request_id)); },
1969+ ffi_wallet_engine_rust_future_poll_void,
1970+ ffi_wallet_engine_rust_future_complete_void,
1971+ ffi_wallet_engine_rust_future_free_void,
1972+ nullptr
1973+ );
1974+}
1975+
1976+WalletStatuslessHostImpl::~WalletStatuslessHostImpl() {
1977+ uniffi::rust_call(
1978+ uniffi_wallet_engine_fn_free_walletstatuslesshost,
1979+ nullptr,
1980+ this->instance
1981+ );
1982+}
1983+
1984+uint64_t WalletStatuslessHostImpl::_uniffi_internal_clone_pointer() const {
1985+ return uniffi::rust_call(
1986+ uniffi_wallet_engine_fn_clone_walletstatuslesshost,
1987+ nullptr,
1988+ this->instance
1989+ );
1990+}
1991+
1992+
1993+
1994+
1995+
1996+
1997+
1998+
1999+
2000+
2001+
2002+
2003+
2004+
2005+
2006+
2007+
2008+
2009+
2010+
2011+
2012+
2013+
2014+
2015+
2016+
2017+
2018+
2019+
2020+
2021+
2022+
2023+
2024+
2025+
2026+
2027+
2028+
2029+
2030+
2031+
2032+
2033+
2034+
2035+
2036+
2037+
2038+
2039+
2040+
2041+
2042+
2043+
2044+
2045+
2046+
2047+
2048+
2049+
2050+
2051+
2052+
2053+
2054+
2055+
2056+
2057+
2058+
2059+
2060+
2061+
2062+
2063+
2064+
2065+
2066+
2067+
2068+
2069+
2070+
2071+
2072+
2073+
2074+
2075+
2076+
2077+
2078+
2079+
2080+
2081+
2082+
2083+
2084+
2085+
2086+
2087+
2088+
2089+
2090+
2091+
2092+
2093+
2094+
2095+
2096+
2097+
2098+
2099+
2100+
2101+
2102+
2103+
2104+
2105+
2106+
2107+
2108+
2109+
2110+
2111+
2112+
2113+
2114+
2115+
2116+
2117+
2118+
2119+
2120+
2121+
2122+
2123+
2124+
2125+
2126+
2127+
2128+
2129+
2130+
2131+
2132+
2133+
2134+
2135+
2136+
2137+
2138+
2139+
2140+
2141+
2142+
2143+
2144+
2145+
2146+namespace uniffi {
2147+
2148+
2149+
2150+
2151+
2152+
2153+
2154+
2155+
2156+
2157+std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::lift(uint64_t ptr) {
2158+ return std::shared_ptr<TonConnectDerivedSession>(new TonConnectDerivedSession(ptr));
2159+}
2160+
2161+uint64_t FfiConverterTonConnectDerivedSession::lower(const std::shared_ptr<TonConnectDerivedSession> &obj) {
2162+ return reinterpret_cast<TonConnectDerivedSession*>(obj.get())->_uniffi_internal_clone_pointer();
2163+}
2164+
2165+std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::read(RustStream &stream) {
2166+ uint64_t ptr;
2167+ stream >> ptr;
2168+
2169+ return FfiConverterTonConnectDerivedSession::lift(ptr);
2170+}
2171+
2172+void FfiConverterTonConnectDerivedSession::write(RustStream &stream, const std::shared_ptr<TonConnectDerivedSession> &obj) {
2173+ stream << FfiConverterTonConnectDerivedSession::lower(obj);
2174+}
2175+
2176+uint64_t FfiConverterTonConnectDerivedSession::allocation_size(const std::shared_ptr<TonConnectDerivedSession> &) {
2177+ return 8;
2178+}
2179+
2180+
2181+
2182+std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::lift(uint64_t ptr) {
2183+ return std::shared_ptr<TonConnectSession>(new TonConnectSession(ptr));
2184+}
2185+
2186+uint64_t FfiConverterTonConnectSession::lower(const std::shared_ptr<TonConnectSession> &obj) {
2187+ return reinterpret_cast<TonConnectSession*>(obj.get())->_uniffi_internal_clone_pointer();
2188+}
2189+
2190+std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::read(RustStream &stream) {
2191+ uint64_t ptr;
2192+ stream >> ptr;
2193+
2194+ return FfiConverterTonConnectSession::lift(ptr);
2195+}
2196+
2197+void FfiConverterTonConnectSession::write(RustStream &stream, const std::shared_ptr<TonConnectSession> &obj) {
2198+ stream << FfiConverterTonConnectSession::lower(obj);
2199+}
2200+
2201+uint64_t FfiConverterTonConnectSession::allocation_size(const std::shared_ptr<TonConnectSession> &) {
2202+ return 8;
2203+}
2204+
2205+
2206+
2207+std::shared_ptr<WalletClient> FfiConverterWalletClient::lift(uint64_t ptr) {
2208+ return std::shared_ptr<WalletClient>(new WalletClient(ptr));
2209+}
2210+
2211+uint64_t FfiConverterWalletClient::lower(const std::shared_ptr<WalletClient> &obj) {
2212+ return reinterpret_cast<WalletClient*>(obj.get())->_uniffi_internal_clone_pointer();
2213+}
2214+
2215+std::shared_ptr<WalletClient> FfiConverterWalletClient::read(RustStream &stream) {
2216+ uint64_t ptr;
2217+ stream >> ptr;
2218+
2219+ return FfiConverterWalletClient::lift(ptr);
2220+}
2221+
2222+void FfiConverterWalletClient::write(RustStream &stream, const std::shared_ptr<WalletClient> &obj) {
2223+ stream << FfiConverterWalletClient::lower(obj);
2224+}
2225+
2226+uint64_t FfiConverterWalletClient::allocation_size(const std::shared_ptr<WalletClient> &) {
2227+ return 8;
2228+}
2229+
2230+
2231+
2232+std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::lift(uint64_t ptr) {
2233+ return std::shared_ptr<WalletHttpHost>(new WalletHttpHostImpl(ptr));
2234+}
2235+
2236+uint64_t FfiConverterWalletHttpHost::lower(const std::shared_ptr<WalletHttpHost> &obj) {
2237+ return handle_map.insert(obj);
2238+}
2239+
2240+std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::read(RustStream &stream) {
2241+ uint64_t ptr;
2242+ stream >> ptr;
2243+
2244+ return FfiConverterWalletHttpHost::lift(ptr);
2245+}
2246+
2247+void FfiConverterWalletHttpHost::write(RustStream &stream, const std::shared_ptr<WalletHttpHost> &obj) {
2248+ stream << FfiConverterWalletHttpHost::lower(obj);
2249+}
2250+
2251+uint64_t FfiConverterWalletHttpHost::allocation_size(const std::shared_ptr<WalletHttpHost> &) {
2252+ return 8;
2253+}
2254+
2255+
2256+
2257+std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::lift(uint64_t ptr) {
2258+ return std::shared_ptr<WalletLifecycle>(new WalletLifecycle(ptr));
2259+}
2260+
2261+uint64_t FfiConverterWalletLifecycle::lower(const std::shared_ptr<WalletLifecycle> &obj) {
2262+ return reinterpret_cast<WalletLifecycle*>(obj.get())->_uniffi_internal_clone_pointer();
2263+}
2264+
2265+std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::read(RustStream &stream) {
2266+ uint64_t ptr;
2267+ stream >> ptr;
2268+
2269+ return FfiConverterWalletLifecycle::lift(ptr);
2270+}
2271+
2272+void FfiConverterWalletLifecycle::write(RustStream &stream, const std::shared_ptr<WalletLifecycle> &obj) {
2273+ stream << FfiConverterWalletLifecycle::lower(obj);
2274+}
2275+
2276+uint64_t FfiConverterWalletLifecycle::allocation_size(const std::shared_ptr<WalletLifecycle> &) {
2277+ return 8;
2278+}
2279+
2280+
2281+
2282+std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::lift(uint64_t ptr) {
2283+ return std::shared_ptr<WalletPlatformHost>(new WalletPlatformHostImpl(ptr));
2284+}
2285+
2286+uint64_t FfiConverterWalletPlatformHost::lower(const std::shared_ptr<WalletPlatformHost> &obj) {
2287+ return handle_map.insert(obj);
2288+}
2289+
2290+std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::read(RustStream &stream) {
2291+ uint64_t ptr;
2292+ stream >> ptr;
2293+
2294+ return FfiConverterWalletPlatformHost::lift(ptr);
2295+}
2296+
2297+void FfiConverterWalletPlatformHost::write(RustStream &stream, const std::shared_ptr<WalletPlatformHost> &obj) {
2298+ stream << FfiConverterWalletPlatformHost::lower(obj);
2299+}
2300+
2301+uint64_t FfiConverterWalletPlatformHost::allocation_size(const std::shared_ptr<WalletPlatformHost> &) {
2302+ return 8;
2303+}
2304+
2305+
2306+
2307+std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::lift(uint64_t ptr) {
2308+ return std::shared_ptr<WalletStatuslessHost>(new WalletStatuslessHostImpl(ptr));
2309+}
2310+
2311+uint64_t FfiConverterWalletStatuslessHost::lower(const std::shared_ptr<WalletStatuslessHost> &obj) {
2312+ return handle_map.insert(obj);
2313+}
2314+
2315+std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::read(RustStream &stream) {
2316+ uint64_t ptr;
2317+ stream >> ptr;
2318+
2319+ return FfiConverterWalletStatuslessHost::lift(ptr);
2320+}
2321+
2322+void FfiConverterWalletStatuslessHost::write(RustStream &stream, const std::shared_ptr<WalletStatuslessHost> &obj) {
2323+ stream << FfiConverterWalletStatuslessHost::lower(obj);
2324+}
2325+
2326+uint64_t FfiConverterWalletStatuslessHost::allocation_size(const std::shared_ptr<WalletStatuslessHost> &) {
2327+ return 8;
2328+}
2329+
2330+
2331+AccountSnapshot FfiConverterTypeAccountSnapshot::lift(RustBuffer buf) {
2332+ auto stream = RustStream(&buf);
2333+ auto ret = FfiConverterTypeAccountSnapshot::read(stream);
2334+
2335+ rustbuffer_free(buf);
2336+
2337+ return std::move(ret);
2338+}
2339+
2340+RustBuffer FfiConverterTypeAccountSnapshot::lower(const AccountSnapshot &val) {
2341+ auto buf = rustbuffer_alloc(allocation_size(val));
2342+ auto stream = RustStream(&buf);
2343+
2344+ FfiConverterTypeAccountSnapshot::write(stream, val);
2345+
2346+ return std::move(buf);
2347+}
2348+
2349+AccountSnapshot FfiConverterTypeAccountSnapshot::read(RustStream &stream) {
2350+ return {
2351+ FfiConverterTypeUnsignedDecimalString::read(stream),
2352+ FfiConverterAccountStatus::read(stream),
2353+ FfiConverterUInt64::read(stream)
2354+ };
2355+}
2356+
2357+void FfiConverterTypeAccountSnapshot::write(RustStream &stream, const AccountSnapshot &val) {
2358+ FfiConverterTypeUnsignedDecimalString::write(stream, val.balance_nanograms);
2359+ FfiConverterAccountStatus::write(stream, val.status);
2360+ FfiConverterUInt64::write(stream, val.sync_utime);
2361+}
2362+
2363+uint64_t FfiConverterTypeAccountSnapshot::allocation_size(const AccountSnapshot &val) {
2364+
2365+ return
2366+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.balance_nanograms) +
2367+ FfiConverterAccountStatus::allocation_size(val.status) +
2368+ FfiConverterUInt64::allocation_size(val.sync_utime);
2369+
2370+}
2371+
2372+
2373+ActivityCursor FfiConverterTypeActivityCursor::lift(RustBuffer buf) {
2374+ auto stream = RustStream(&buf);
2375+ auto ret = FfiConverterTypeActivityCursor::read(stream);
2376+
2377+ rustbuffer_free(buf);
2378+
2379+ return std::move(ret);
2380+}
2381+
2382+RustBuffer FfiConverterTypeActivityCursor::lower(const ActivityCursor &val) {
2383+ auto buf = rustbuffer_alloc(allocation_size(val));
2384+ auto stream = RustStream(&buf);
2385+
2386+ FfiConverterTypeActivityCursor::write(stream, val);
2387+
2388+ return std::move(buf);
2389+}
2390+
2391+ActivityCursor FfiConverterTypeActivityCursor::read(RustStream &stream) {
2392+ return {
2393+ FfiConverterTypeUnsignedDecimalString::read(stream),
2394+ FfiConverterTypeBase64Hash::read(stream)
2395+ };
2396+}
2397+
2398+void FfiConverterTypeActivityCursor::write(RustStream &stream, const ActivityCursor &val) {
2399+ FfiConverterTypeUnsignedDecimalString::write(stream, val.logical_time);
2400+ FfiConverterTypeBase64Hash::write(stream, val.hash);
2401+}
2402+
2403+uint64_t FfiConverterTypeActivityCursor::allocation_size(const ActivityCursor &val) {
2404+
2405+ return
2406+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.logical_time) +
2407+ FfiConverterTypeBase64Hash::allocation_size(val.hash);
2408+
2409+}
2410+
2411+
2412+ActivityItem FfiConverterTypeActivityItem::lift(RustBuffer buf) {
2413+ auto stream = RustStream(&buf);
2414+ auto ret = FfiConverterTypeActivityItem::read(stream);
2415+
2416+ rustbuffer_free(buf);
2417+
2418+ return std::move(ret);
2419+}
2420+
2421+RustBuffer FfiConverterTypeActivityItem::lower(const ActivityItem &val) {
2422+ auto buf = rustbuffer_alloc(allocation_size(val));
2423+ auto stream = RustStream(&buf);
2424+
2425+ FfiConverterTypeActivityItem::write(stream, val);
2426+
2427+ return std::move(buf);
2428+}
2429+
2430+ActivityItem FfiConverterTypeActivityItem::read(RustStream &stream) {
2431+ return {
2432+ FfiConverterString::read(stream),
2433+ FfiConverterTypeBase64Hash::read(stream),
2434+ FfiConverterTypeUnsignedDecimalString::read(stream),
2435+ FfiConverterUInt64::read(stream),
2436+ FfiConverterActivityDirection::read(stream),
2437+ FfiConverterTypeUnsignedDecimalString::read(stream),
2438+ FfiConverterTypeUnsignedDecimalString::read(stream),
2439+ FfiConverterActivityStatus::read(stream),
2440+ FfiConverterOptionalString::read(stream),
2441+ FfiConverterOptionalTypeBoc::read(stream),
2442+ FfiConverterOptionalTypeTonAddressString::read(stream)
2443+ };
2444+}
2445+
2446+void FfiConverterTypeActivityItem::write(RustStream &stream, const ActivityItem &val) {
2447+ FfiConverterString::write(stream, val.id);
2448+ FfiConverterTypeBase64Hash::write(stream, val.transaction_hash);
2449+ FfiConverterTypeUnsignedDecimalString::write(stream, val.logical_time);
2450+ FfiConverterUInt64::write(stream, val.timestamp);
2451+ FfiConverterActivityDirection::write(stream, val.direction);
2452+ FfiConverterTypeUnsignedDecimalString::write(stream, val.amount_nanograms);
2453+ FfiConverterTypeUnsignedDecimalString::write(stream, val.transaction_fee_nanograms);
2454+ FfiConverterActivityStatus::write(stream, val.status);
2455+ FfiConverterOptionalString::write(stream, val.comment);
2456+ FfiConverterOptionalTypeBoc::write(stream, val.encrypted_comment);
2457+ FfiConverterOptionalTypeTonAddressString::write(stream, val.counterparty);
2458+}
2459+
2460+uint64_t FfiConverterTypeActivityItem::allocation_size(const ActivityItem &val) {
2461+
2462+ return
2463+ FfiConverterString::allocation_size(val.id) +
2464+ FfiConverterTypeBase64Hash::allocation_size(val.transaction_hash) +
2465+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.logical_time) +
2466+ FfiConverterUInt64::allocation_size(val.timestamp) +
2467+ FfiConverterActivityDirection::allocation_size(val.direction) +
2468+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.amount_nanograms) +
2469+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.transaction_fee_nanograms) +
2470+ FfiConverterActivityStatus::allocation_size(val.status) +
2471+ FfiConverterOptionalString::allocation_size(val.comment) +
2472+ FfiConverterOptionalTypeBoc::allocation_size(val.encrypted_comment) +
2473+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.counterparty);
2474+
2475+}
2476+
2477+
2478+ActivityList FfiConverterTypeActivityList::lift(RustBuffer buf) {
2479+ auto stream = RustStream(&buf);
2480+ auto ret = FfiConverterTypeActivityList::read(stream);
2481+
2482+ rustbuffer_free(buf);
2483+
2484+ return std::move(ret);
2485+}
2486+
2487+RustBuffer FfiConverterTypeActivityList::lower(const ActivityList &val) {
2488+ auto buf = rustbuffer_alloc(allocation_size(val));
2489+ auto stream = RustStream(&buf);
2490+
2491+ FfiConverterTypeActivityList::write(stream, val);
2492+
2493+ return std::move(buf);
2494+}
2495+
2496+ActivityList FfiConverterTypeActivityList::read(RustStream &stream) {
2497+ return {
2498+ FfiConverterSequenceTypeActivityItem::read(stream),
2499+ FfiConverterTypeResourceState::read(stream),
2500+ FfiConverterTypeResourceState::read(stream),
2501+ FfiConverterBool::read(stream)
2502+ };
2503+}
2504+
2505+void FfiConverterTypeActivityList::write(RustStream &stream, const ActivityList &val) {
2506+ FfiConverterSequenceTypeActivityItem::write(stream, val.items);
2507+ FfiConverterTypeResourceState::write(stream, val.resource);
2508+ FfiConverterTypeResourceState::write(stream, val.pagination_resource);
2509+ FfiConverterBool::write(stream, val.has_more);
2510+}
2511+
2512+uint64_t FfiConverterTypeActivityList::allocation_size(const ActivityList &val) {
2513+
2514+ return
2515+ FfiConverterSequenceTypeActivityItem::allocation_size(val.items) +
2516+ FfiConverterTypeResourceState::allocation_size(val.resource) +
2517+ FfiConverterTypeResourceState::allocation_size(val.pagination_resource) +
2518+ FfiConverterBool::allocation_size(val.has_more);
2519+
2520+}
2521+
2522+
2523+CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::lift(RustBuffer buf) {
2524+ auto stream = RustStream(&buf);
2525+ auto ret = FfiConverterTypeCreateEncryptedCommentRequest::read(stream);
2526+
2527+ rustbuffer_free(buf);
2528+
2529+ return std::move(ret);
2530+}
2531+
2532+RustBuffer FfiConverterTypeCreateEncryptedCommentRequest::lower(const CreateEncryptedCommentRequest &val) {
2533+ auto buf = rustbuffer_alloc(allocation_size(val));
2534+ auto stream = RustStream(&buf);
2535+
2536+ FfiConverterTypeCreateEncryptedCommentRequest::write(stream, val);
2537+
2538+ return std::move(buf);
2539+}
2540+
2541+CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::read(RustStream &stream) {
2542+ return {
2543+ FfiConverterTypeTonAddressString::read(stream),
2544+ FfiConverterString::read(stream),
2545+ FfiConverterOptionalBytes::read(stream)
2546+ };
2547+}
2548+
2549+void FfiConverterTypeCreateEncryptedCommentRequest::write(RustStream &stream, const CreateEncryptedCommentRequest &val) {
2550+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
2551+ FfiConverterString::write(stream, val.comment);
2552+ FfiConverterOptionalBytes::write(stream, val.recipient_public_key);
2553+}
2554+
2555+uint64_t FfiConverterTypeCreateEncryptedCommentRequest::allocation_size(const CreateEncryptedCommentRequest &val) {
2556+
2557+ return
2558+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
2559+ FfiConverterString::allocation_size(val.comment) +
2560+ FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
2561+
2562+}
2563+
2564+
2565+CreateWalletRequest FfiConverterTypeCreateWalletRequest::lift(RustBuffer buf) {
2566+ auto stream = RustStream(&buf);
2567+ auto ret = FfiConverterTypeCreateWalletRequest::read(stream);
2568+
2569+ rustbuffer_free(buf);
2570+
2571+ return std::move(ret);
2572+}
2573+
2574+RustBuffer FfiConverterTypeCreateWalletRequest::lower(const CreateWalletRequest &val) {
2575+ auto buf = rustbuffer_alloc(allocation_size(val));
2576+ auto stream = RustStream(&buf);
2577+
2578+ FfiConverterTypeCreateWalletRequest::write(stream, val);
2579+
2580+ return std::move(buf);
2581+}
2582+
2583+CreateWalletRequest FfiConverterTypeCreateWalletRequest::read(RustStream &stream) {
2584+ return {
2585+ FfiConverterString::read(stream),
2586+ FfiConverterNetwork::read(stream)
2587+ };
2588+}
2589+
2590+void FfiConverterTypeCreateWalletRequest::write(RustStream &stream, const CreateWalletRequest &val) {
2591+ FfiConverterString::write(stream, val.record_id);
2592+ FfiConverterNetwork::write(stream, val.network);
2593+}
2594+
2595+uint64_t FfiConverterTypeCreateWalletRequest::allocation_size(const CreateWalletRequest &val) {
2596+
2597+ return
2598+ FfiConverterString::allocation_size(val.record_id) +
2599+ FfiConverterNetwork::allocation_size(val.network);
2600+
2601+}
2602+
2603+
2604+CreatedWallet FfiConverterTypeCreatedWallet::lift(RustBuffer buf) {
2605+ auto stream = RustStream(&buf);
2606+ auto ret = FfiConverterTypeCreatedWallet::read(stream);
2607+
2608+ rustbuffer_free(buf);
2609+
2610+ return std::move(ret);
2611+}
2612+
2613+RustBuffer FfiConverterTypeCreatedWallet::lower(const CreatedWallet &val) {
2614+ auto buf = rustbuffer_alloc(allocation_size(val));
2615+ auto stream = RustStream(&buf);
2616+
2617+ FfiConverterTypeCreatedWallet::write(stream, val);
2618+
2619+ return std::move(buf);
2620+}
2621+
2622+CreatedWallet FfiConverterTypeCreatedWallet::read(RustStream &stream) {
2623+ return {
2624+ FfiConverterTypeWalletDescriptor::read(stream),
2625+ FfiConverterTypeRecoveryPhrase::read(stream)
2626+ };
2627+}
2628+
2629+void FfiConverterTypeCreatedWallet::write(RustStream &stream, const CreatedWallet &val) {
2630+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
2631+ FfiConverterTypeRecoveryPhrase::write(stream, val.recovery_phrase);
2632+}
2633+
2634+uint64_t FfiConverterTypeCreatedWallet::allocation_size(const CreatedWallet &val) {
2635+
2636+ return
2637+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
2638+ FfiConverterTypeRecoveryPhrase::allocation_size(val.recovery_phrase);
2639+
2640+}
2641+
2642+
2643+DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::lift(RustBuffer buf) {
2644+ auto stream = RustStream(&buf);
2645+ auto ret = FfiConverterTypeDecryptCommentRequest::read(stream);
2646+
2647+ rustbuffer_free(buf);
2648+
2649+ return std::move(ret);
2650+}
2651+
2652+RustBuffer FfiConverterTypeDecryptCommentRequest::lower(const DecryptCommentRequest &val) {
2653+ auto buf = rustbuffer_alloc(allocation_size(val));
2654+ auto stream = RustStream(&buf);
2655+
2656+ FfiConverterTypeDecryptCommentRequest::write(stream, val);
2657+
2658+ return std::move(buf);
2659+}
2660+
2661+DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::read(RustStream &stream) {
2662+ return {
2663+ FfiConverterTypeTonAddressString::read(stream),
2664+ FfiConverterTypeBoc::read(stream)
2665+ };
2666+}
2667+
2668+void FfiConverterTypeDecryptCommentRequest::write(RustStream &stream, const DecryptCommentRequest &val) {
2669+ FfiConverterTypeTonAddressString::write(stream, val.sender);
2670+ FfiConverterTypeBoc::write(stream, val.body);
2671+}
2672+
2673+uint64_t FfiConverterTypeDecryptCommentRequest::allocation_size(const DecryptCommentRequest &val) {
2674+
2675+ return
2676+ FfiConverterTypeTonAddressString::allocation_size(val.sender) +
2677+ FfiConverterTypeBoc::allocation_size(val.body);
2678+
2679+}
2680+
2681+
2682+DomainError FfiConverterTypeDomainError::lift(RustBuffer buf) {
2683+ auto stream = RustStream(&buf);
2684+ auto ret = FfiConverterTypeDomainError::read(stream);
2685+
2686+ rustbuffer_free(buf);
2687+
2688+ return std::move(ret);
2689+}
2690+
2691+RustBuffer FfiConverterTypeDomainError::lower(const DomainError &val) {
2692+ auto buf = rustbuffer_alloc(allocation_size(val));
2693+ auto stream = RustStream(&buf);
2694+
2695+ FfiConverterTypeDomainError::write(stream, val);
2696+
2697+ return std::move(buf);
2698+}
2699+
2700+DomainError FfiConverterTypeDomainError::read(RustStream &stream) {
2701+ return {
2702+ FfiConverterErrorCode::read(stream),
2703+ FfiConverterErrorCategory::read(stream),
2704+ FfiConverterRetryAdvice::read(stream),
2705+ FfiConverterString::read(stream),
2706+ FfiConverterOptionalUInt16::read(stream),
2707+ FfiConverterOptionalUInt64::read(stream),
2708+ FfiConverterOptionalHttpHostErrorKind::read(stream)
2709+ };
2710+}
2711+
2712+void FfiConverterTypeDomainError::write(RustStream &stream, const DomainError &val) {
2713+ FfiConverterErrorCode::write(stream, val.code);
2714+ FfiConverterErrorCategory::write(stream, val.category);
2715+ FfiConverterRetryAdvice::write(stream, val.retry);
2716+ FfiConverterString::write(stream, val.developer_message);
2717+ FfiConverterOptionalUInt16::write(stream, val.provider_status);
2718+ FfiConverterOptionalUInt64::write(stream, val.retry_after_ms);
2719+ FfiConverterOptionalHttpHostErrorKind::write(stream, val.host_kind);
2720+}
2721+
2722+uint64_t FfiConverterTypeDomainError::allocation_size(const DomainError &val) {
2723+
2724+ return
2725+ FfiConverterErrorCode::allocation_size(val.code) +
2726+ FfiConverterErrorCategory::allocation_size(val.category) +
2727+ FfiConverterRetryAdvice::allocation_size(val.retry) +
2728+ FfiConverterString::allocation_size(val.developer_message) +
2729+ FfiConverterOptionalUInt16::allocation_size(val.provider_status) +
2730+ FfiConverterOptionalUInt64::allocation_size(val.retry_after_ms) +
2731+ FfiConverterOptionalHttpHostErrorKind::allocation_size(val.host_kind);
2732+
2733+}
2734+
2735+
2736+EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::lift(RustBuffer buf) {
2737+ auto stream = RustStream(&buf);
2738+ auto ret = FfiConverterTypeEncryptedCommentRecipientRequest::read(stream);
2739+
2740+ rustbuffer_free(buf);
2741+
2742+ return std::move(ret);
2743+}
2744+
2745+RustBuffer FfiConverterTypeEncryptedCommentRecipientRequest::lower(const EncryptedCommentRecipientRequest &val) {
2746+ auto buf = rustbuffer_alloc(allocation_size(val));
2747+ auto stream = RustStream(&buf);
2748+
2749+ FfiConverterTypeEncryptedCommentRecipientRequest::write(stream, val);
2750+
2751+ return std::move(buf);
2752+}
2753+
2754+EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::read(RustStream &stream) {
2755+ return {
2756+ FfiConverterTypeTonAddressString::read(stream),
2757+ FfiConverterOptionalBytes::read(stream)
2758+ };
2759+}
2760+
2761+void FfiConverterTypeEncryptedCommentRecipientRequest::write(RustStream &stream, const EncryptedCommentRecipientRequest &val) {
2762+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
2763+ FfiConverterOptionalBytes::write(stream, val.recipient_public_key);
2764+}
2765+
2766+uint64_t FfiConverterTypeEncryptedCommentRecipientRequest::allocation_size(const EncryptedCommentRecipientRequest &val) {
2767+
2768+ return
2769+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
2770+ FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
2771+
2772+}
2773+
2774+
2775+HttpHeader FfiConverterTypeHttpHeader::lift(RustBuffer buf) {
2776+ auto stream = RustStream(&buf);
2777+ auto ret = FfiConverterTypeHttpHeader::read(stream);
2778+
2779+ rustbuffer_free(buf);
2780+
2781+ return std::move(ret);
2782+}
2783+
2784+RustBuffer FfiConverterTypeHttpHeader::lower(const HttpHeader &val) {
2785+ auto buf = rustbuffer_alloc(allocation_size(val));
2786+ auto stream = RustStream(&buf);
2787+
2788+ FfiConverterTypeHttpHeader::write(stream, val);
2789+
2790+ return std::move(buf);
2791+}
2792+
2793+HttpHeader FfiConverterTypeHttpHeader::read(RustStream &stream) {
2794+ return {
2795+ FfiConverterString::read(stream),
2796+ FfiConverterString::read(stream)
2797+ };
2798+}
2799+
2800+void FfiConverterTypeHttpHeader::write(RustStream &stream, const HttpHeader &val) {
2801+ FfiConverterString::write(stream, val.name);
2802+ FfiConverterString::write(stream, val.value);
2803+}
2804+
2805+uint64_t FfiConverterTypeHttpHeader::allocation_size(const HttpHeader &val) {
2806+
2807+ return
2808+ FfiConverterString::allocation_size(val.name) +
2809+ FfiConverterString::allocation_size(val.value);
2810+
2811+}
2812+
2813+
2814+HttpRequest FfiConverterTypeHttpRequest::lift(RustBuffer buf) {
2815+ auto stream = RustStream(&buf);
2816+ auto ret = FfiConverterTypeHttpRequest::read(stream);
2817+
2818+ rustbuffer_free(buf);
2819+
2820+ return std::move(ret);
2821+}
2822+
2823+RustBuffer FfiConverterTypeHttpRequest::lower(const HttpRequest &val) {
2824+ auto buf = rustbuffer_alloc(allocation_size(val));
2825+ auto stream = RustStream(&buf);
2826+
2827+ FfiConverterTypeHttpRequest::write(stream, val);
2828+
2829+ return std::move(buf);
2830+}
2831+
2832+HttpRequest FfiConverterTypeHttpRequest::read(RustStream &stream) {
2833+ return {
2834+ FfiConverterTypeHttpRequestId::read(stream),
2835+ FfiConverterHttpMethod::read(stream),
2836+ FfiConverterString::read(stream),
2837+ FfiConverterSequenceTypeHttpHeader::read(stream),
2838+ FfiConverterBytes::read(stream),
2839+ FfiConverterUInt64::read(stream)
2840+ };
2841+}
2842+
2843+void FfiConverterTypeHttpRequest::write(RustStream &stream, const HttpRequest &val) {
2844+ FfiConverterTypeHttpRequestId::write(stream, val.id);
2845+ FfiConverterHttpMethod::write(stream, val.method);
2846+ FfiConverterString::write(stream, val.url);
2847+ FfiConverterSequenceTypeHttpHeader::write(stream, val.headers);
2848+ FfiConverterBytes::write(stream, val.body);
2849+ FfiConverterUInt64::write(stream, val.timeout_ms);
2850+}
2851+
2852+uint64_t FfiConverterTypeHttpRequest::allocation_size(const HttpRequest &val) {
2853+
2854+ return
2855+ FfiConverterTypeHttpRequestId::allocation_size(val.id) +
2856+ FfiConverterHttpMethod::allocation_size(val.method) +
2857+ FfiConverterString::allocation_size(val.url) +
2858+ FfiConverterSequenceTypeHttpHeader::allocation_size(val.headers) +
2859+ FfiConverterBytes::allocation_size(val.body) +
2860+ FfiConverterUInt64::allocation_size(val.timeout_ms);
2861+
2862+}
2863+
2864+
2865+HttpRequestId FfiConverterTypeHttpRequestId::lift(RustBuffer buf) {
2866+ auto stream = RustStream(&buf);
2867+ auto ret = FfiConverterTypeHttpRequestId::read(stream);
2868+
2869+ rustbuffer_free(buf);
2870+
2871+ return std::move(ret);
2872+}
2873+
2874+RustBuffer FfiConverterTypeHttpRequestId::lower(const HttpRequestId &val) {
2875+ auto buf = rustbuffer_alloc(allocation_size(val));
2876+ auto stream = RustStream(&buf);
2877+
2878+ FfiConverterTypeHttpRequestId::write(stream, val);
2879+
2880+ return std::move(buf);
2881+}
2882+
2883+HttpRequestId FfiConverterTypeHttpRequestId::read(RustStream &stream) {
2884+ return {
2885+ FfiConverterUInt64::read(stream)
2886+ };
2887+}
2888+
2889+void FfiConverterTypeHttpRequestId::write(RustStream &stream, const HttpRequestId &val) {
2890+ FfiConverterUInt64::write(stream, val.value);
2891+}
2892+
2893+uint64_t FfiConverterTypeHttpRequestId::allocation_size(const HttpRequestId &val) {
2894+
2895+ return
2896+ FfiConverterUInt64::allocation_size(val.value);
2897+
2898+}
2899+
2900+
2901+HttpResponse FfiConverterTypeHttpResponse::lift(RustBuffer buf) {
2902+ auto stream = RustStream(&buf);
2903+ auto ret = FfiConverterTypeHttpResponse::read(stream);
2904+
2905+ rustbuffer_free(buf);
2906+
2907+ return std::move(ret);
2908+}
2909+
2910+RustBuffer FfiConverterTypeHttpResponse::lower(const HttpResponse &val) {
2911+ auto buf = rustbuffer_alloc(allocation_size(val));
2912+ auto stream = RustStream(&buf);
2913+
2914+ FfiConverterTypeHttpResponse::write(stream, val);
2915+
2916+ return std::move(buf);
2917+}
2918+
2919+HttpResponse FfiConverterTypeHttpResponse::read(RustStream &stream) {
2920+ return {
2921+ FfiConverterUInt16::read(stream),
2922+ FfiConverterSequenceTypeHttpHeader::read(stream),
2923+ FfiConverterBytes::read(stream),
2924+ FfiConverterString::read(stream)
2925+ };
2926+}
2927+
2928+void FfiConverterTypeHttpResponse::write(RustStream &stream, const HttpResponse &val) {
2929+ FfiConverterUInt16::write(stream, val.status);
2930+ FfiConverterSequenceTypeHttpHeader::write(stream, val.headers);
2931+ FfiConverterBytes::write(stream, val.body);
2932+ FfiConverterString::write(stream, val.final_url);
2933+}
2934+
2935+uint64_t FfiConverterTypeHttpResponse::allocation_size(const HttpResponse &val) {
2936+
2937+ return
2938+ FfiConverterUInt16::allocation_size(val.status) +
2939+ FfiConverterSequenceTypeHttpHeader::allocation_size(val.headers) +
2940+ FfiConverterBytes::allocation_size(val.body) +
2941+ FfiConverterString::allocation_size(val.final_url);
2942+
2943+}
2944+
2945+
2946+ImportWalletRequest FfiConverterTypeImportWalletRequest::lift(RustBuffer buf) {
2947+ auto stream = RustStream(&buf);
2948+ auto ret = FfiConverterTypeImportWalletRequest::read(stream);
2949+
2950+ rustbuffer_free(buf);
2951+
2952+ return std::move(ret);
2953+}
2954+
2955+RustBuffer FfiConverterTypeImportWalletRequest::lower(const ImportWalletRequest &val) {
2956+ auto buf = rustbuffer_alloc(allocation_size(val));
2957+ auto stream = RustStream(&buf);
2958+
2959+ FfiConverterTypeImportWalletRequest::write(stream, val);
2960+
2961+ return std::move(buf);
2962+}
2963+
2964+ImportWalletRequest FfiConverterTypeImportWalletRequest::read(RustStream &stream) {
2965+ return {
2966+ FfiConverterString::read(stream),
2967+ FfiConverterNetwork::read(stream),
2968+ FfiConverterSequenceString::read(stream)
2969+ };
2970+}
2971+
2972+void FfiConverterTypeImportWalletRequest::write(RustStream &stream, const ImportWalletRequest &val) {
2973+ FfiConverterString::write(stream, val.record_id);
2974+ FfiConverterNetwork::write(stream, val.network);
2975+ FfiConverterSequenceString::write(stream, val.recovery_words);
2976+}
2977+
2978+uint64_t FfiConverterTypeImportWalletRequest::allocation_size(const ImportWalletRequest &val) {
2979+
2980+ return
2981+ FfiConverterString::allocation_size(val.record_id) +
2982+ FfiConverterNetwork::allocation_size(val.network) +
2983+ FfiConverterSequenceString::allocation_size(val.recovery_words);
2984+
2985+}
2986+
2987+
2988+JournalCompareExchange FfiConverterTypeJournalCompareExchange::lift(RustBuffer buf) {
2989+ auto stream = RustStream(&buf);
2990+ auto ret = FfiConverterTypeJournalCompareExchange::read(stream);
2991+
2992+ rustbuffer_free(buf);
2993+
2994+ return std::move(ret);
2995+}
2996+
2997+RustBuffer FfiConverterTypeJournalCompareExchange::lower(const JournalCompareExchange &val) {
2998+ auto buf = rustbuffer_alloc(allocation_size(val));
2999+ auto stream = RustStream(&buf);
3000+
3001+ FfiConverterTypeJournalCompareExchange::write(stream, val);
3002+
3003+ return std::move(buf);
3004+}
3005+
3006+JournalCompareExchange FfiConverterTypeJournalCompareExchange::read(RustStream &stream) {
3007+ return {
3008+ FfiConverterTypeJournalKey::read(stream),
3009+ FfiConverterOptionalUInt64::read(stream),
3010+ FfiConverterTypeJournalRecord::read(stream)
3011+ };
3012+}
3013+
3014+void FfiConverterTypeJournalCompareExchange::write(RustStream &stream, const JournalCompareExchange &val) {
3015+ FfiConverterTypeJournalKey::write(stream, val.key);
3016+ FfiConverterOptionalUInt64::write(stream, val.expected_version);
3017+ FfiConverterTypeJournalRecord::write(stream, val.replacement);
3018+}
3019+
3020+uint64_t FfiConverterTypeJournalCompareExchange::allocation_size(const JournalCompareExchange &val) {
3021+
3022+ return
3023+ FfiConverterTypeJournalKey::allocation_size(val.key) +
3024+ FfiConverterOptionalUInt64::allocation_size(val.expected_version) +
3025+ FfiConverterTypeJournalRecord::allocation_size(val.replacement);
3026+
3027+}
3028+
3029+
3030+JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::lift(RustBuffer buf) {
3031+ auto stream = RustStream(&buf);
3032+ auto ret = FfiConverterTypeJournalCompareExchangeResult::read(stream);
3033+
3034+ rustbuffer_free(buf);
3035+
3036+ return std::move(ret);
3037+}
3038+
3039+RustBuffer FfiConverterTypeJournalCompareExchangeResult::lower(const JournalCompareExchangeResult &val) {
3040+ auto buf = rustbuffer_alloc(allocation_size(val));
3041+ auto stream = RustStream(&buf);
3042+
3043+ FfiConverterTypeJournalCompareExchangeResult::write(stream, val);
3044+
3045+ return std::move(buf);
3046+}
3047+
3048+JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::read(RustStream &stream) {
3049+ return {
3050+ FfiConverterBool::read(stream),
3051+ FfiConverterOptionalTypeJournalRecord::read(stream)
3052+ };
3053+}
3054+
3055+void FfiConverterTypeJournalCompareExchangeResult::write(RustStream &stream, const JournalCompareExchangeResult &val) {
3056+ FfiConverterBool::write(stream, val.applied);
3057+ FfiConverterOptionalTypeJournalRecord::write(stream, val.current);
3058+}
3059+
3060+uint64_t FfiConverterTypeJournalCompareExchangeResult::allocation_size(const JournalCompareExchangeResult &val) {
3061+
3062+ return
3063+ FfiConverterBool::allocation_size(val.applied) +
3064+ FfiConverterOptionalTypeJournalRecord::allocation_size(val.current);
3065+
3066+}
3067+
3068+
3069+JournalKey FfiConverterTypeJournalKey::lift(RustBuffer buf) {
3070+ auto stream = RustStream(&buf);
3071+ auto ret = FfiConverterTypeJournalKey::read(stream);
3072+
3073+ rustbuffer_free(buf);
3074+
3075+ return std::move(ret);
3076+}
3077+
3078+RustBuffer FfiConverterTypeJournalKey::lower(const JournalKey &val) {
3079+ auto buf = rustbuffer_alloc(allocation_size(val));
3080+ auto stream = RustStream(&buf);
3081+
3082+ FfiConverterTypeJournalKey::write(stream, val);
3083+
3084+ return std::move(buf);
3085+}
3086+
3087+JournalKey FfiConverterTypeJournalKey::read(RustStream &stream) {
3088+ return {
3089+ FfiConverterString::read(stream),
3090+ FfiConverterString::read(stream)
3091+ };
3092+}
3093+
3094+void FfiConverterTypeJournalKey::write(RustStream &stream, const JournalKey &val) {
3095+ FfiConverterString::write(stream, val.record_id);
3096+ FfiConverterString::write(stream, val.slot);
3097+}
3098+
3099+uint64_t FfiConverterTypeJournalKey::allocation_size(const JournalKey &val) {
3100+
3101+ return
3102+ FfiConverterString::allocation_size(val.record_id) +
3103+ FfiConverterString::allocation_size(val.slot);
3104+
3105+}
3106+
3107+
3108+JournalRecord FfiConverterTypeJournalRecord::lift(RustBuffer buf) {
3109+ auto stream = RustStream(&buf);
3110+ auto ret = FfiConverterTypeJournalRecord::read(stream);
3111+
3112+ rustbuffer_free(buf);
3113+
3114+ return std::move(ret);
3115+}
3116+
3117+RustBuffer FfiConverterTypeJournalRecord::lower(const JournalRecord &val) {
3118+ auto buf = rustbuffer_alloc(allocation_size(val));
3119+ auto stream = RustStream(&buf);
3120+
3121+ FfiConverterTypeJournalRecord::write(stream, val);
3122+
3123+ return std::move(buf);
3124+}
3125+
3126+JournalRecord FfiConverterTypeJournalRecord::read(RustStream &stream) {
3127+ return {
3128+ FfiConverterUInt64::read(stream),
3129+ FfiConverterBytes::read(stream)
3130+ };
3131+}
3132+
3133+void FfiConverterTypeJournalRecord::write(RustStream &stream, const JournalRecord &val) {
3134+ FfiConverterUInt64::write(stream, val.version);
3135+ FfiConverterBytes::write(stream, val.payload);
3136+}
3137+
3138+uint64_t FfiConverterTypeJournalRecord::allocation_size(const JournalRecord &val) {
3139+
3140+ return
3141+ FfiConverterUInt64::allocation_size(val.version) +
3142+ FfiConverterBytes::allocation_size(val.payload);
3143+
3144+}
3145+
3146+
3147+NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::lift(RustBuffer buf) {
3148+ auto stream = RustStream(&buf);
3149+ auto ret = FfiConverterTypeNftCollectionDescriptor::read(stream);
3150+
3151+ rustbuffer_free(buf);
3152+
3153+ return std::move(ret);
3154+}
3155+
3156+RustBuffer FfiConverterTypeNftCollectionDescriptor::lower(const NftCollectionDescriptor &val) {
3157+ auto buf = rustbuffer_alloc(allocation_size(val));
3158+ auto stream = RustStream(&buf);
3159+
3160+ FfiConverterTypeNftCollectionDescriptor::write(stream, val);
3161+
3162+ return std::move(buf);
3163+}
3164+
3165+NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::read(RustStream &stream) {
3166+ return {
3167+ FfiConverterTypeTonAddressString::read(stream),
3168+ FfiConverterOptionalString::read(stream),
3169+ FfiConverterOptionalString::read(stream),
3170+ FfiConverterOptionalString::read(stream),
3171+ FfiConverterMapStringString::read(stream)
3172+ };
3173+}
3174+
3175+void FfiConverterTypeNftCollectionDescriptor::write(RustStream &stream, const NftCollectionDescriptor &val) {
3176+ FfiConverterTypeTonAddressString::write(stream, val.address);
3177+ FfiConverterOptionalString::write(stream, val.name);
3178+ FfiConverterOptionalString::write(stream, val.description);
3179+ FfiConverterOptionalString::write(stream, val.image);
3180+ FfiConverterMapStringString::write(stream, val.content);
3181+}
3182+
3183+uint64_t FfiConverterTypeNftCollectionDescriptor::allocation_size(const NftCollectionDescriptor &val) {
3184+
3185+ return
3186+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
3187+ FfiConverterOptionalString::allocation_size(val.name) +
3188+ FfiConverterOptionalString::allocation_size(val.description) +
3189+ FfiConverterOptionalString::allocation_size(val.image) +
3190+ FfiConverterMapStringString::allocation_size(val.content);
3191+
3192+}
3193+
3194+
3195+NftItem FfiConverterTypeNftItem::lift(RustBuffer buf) {
3196+ auto stream = RustStream(&buf);
3197+ auto ret = FfiConverterTypeNftItem::read(stream);
3198+
3199+ rustbuffer_free(buf);
3200+
3201+ return std::move(ret);
3202+}
3203+
3204+RustBuffer FfiConverterTypeNftItem::lower(const NftItem &val) {
3205+ auto buf = rustbuffer_alloc(allocation_size(val));
3206+ auto stream = RustStream(&buf);
3207+
3208+ FfiConverterTypeNftItem::write(stream, val);
3209+
3210+ return std::move(buf);
3211+}
3212+
3213+NftItem FfiConverterTypeNftItem::read(RustStream &stream) {
3214+ return {
3215+ FfiConverterTypeTonAddressString::read(stream),
3216+ FfiConverterOptionalTypeTonAddressString::read(stream),
3217+ FfiConverterOptionalTypeNftCollectionDescriptor::read(stream),
3218+ FfiConverterOptionalTypeTonAddressString::read(stream),
3219+ FfiConverterOptionalTypeTonAddressString::read(stream),
3220+ FfiConverterOptionalTypeTonAddressString::read(stream),
3221+ FfiConverterOptionalTypeTonAddressString::read(stream),
3222+ FfiConverterTypeUnsignedDecimalString::read(stream),
3223+ FfiConverterTypeUnsignedDecimalString::read(stream),
3224+ FfiConverterBool::read(stream),
3225+ FfiConverterBool::read(stream),
3226+ FfiConverterString::read(stream),
3227+ FfiConverterString::read(stream),
3228+ FfiConverterMapStringString::read(stream),
3229+ FfiConverterOptionalBool::read(stream),
3230+ FfiConverterOptionalBool::read(stream)
3231+ };
3232+}
3233+
3234+void FfiConverterTypeNftItem::write(RustStream &stream, const NftItem &val) {
3235+ FfiConverterTypeTonAddressString::write(stream, val.address);
3236+ FfiConverterOptionalTypeTonAddressString::write(stream, val.collection_address);
3237+ FfiConverterOptionalTypeNftCollectionDescriptor::write(stream, val.collection);
3238+ FfiConverterOptionalTypeTonAddressString::write(stream, val.owner_address);
3239+ FfiConverterOptionalTypeTonAddressString::write(stream, val.real_owner);
3240+ FfiConverterOptionalTypeTonAddressString::write(stream, val.sale_contract_address);
3241+ FfiConverterOptionalTypeTonAddressString::write(stream, val.auction_contract_address);
3242+ FfiConverterTypeUnsignedDecimalString::write(stream, val.index);
3243+ FfiConverterTypeUnsignedDecimalString::write(stream, val.last_transaction_lt);
3244+ FfiConverterBool::write(stream, val.initialized);
3245+ FfiConverterBool::write(stream, val.on_sale);
3246+ FfiConverterString::write(stream, val.code_hash);
3247+ FfiConverterString::write(stream, val.data_hash);
3248+ FfiConverterMapStringString::write(stream, val.content);
3249+ FfiConverterOptionalBool::write(stream, val.is_nsfw);
3250+ FfiConverterOptionalBool::write(stream, val.is_scam);
3251+}
3252+
3253+uint64_t FfiConverterTypeNftItem::allocation_size(const NftItem &val) {
3254+
3255+ return
3256+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
3257+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.collection_address) +
3258+ FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(val.collection) +
3259+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.owner_address) +
3260+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.real_owner) +
3261+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.sale_contract_address) +
3262+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.auction_contract_address) +
3263+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.index) +
3264+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.last_transaction_lt) +
3265+ FfiConverterBool::allocation_size(val.initialized) +
3266+ FfiConverterBool::allocation_size(val.on_sale) +
3267+ FfiConverterString::allocation_size(val.code_hash) +
3268+ FfiConverterString::allocation_size(val.data_hash) +
3269+ FfiConverterMapStringString::allocation_size(val.content) +
3270+ FfiConverterOptionalBool::allocation_size(val.is_nsfw) +
3271+ FfiConverterOptionalBool::allocation_size(val.is_scam);
3272+
3273+}
3274+
3275+
3276+NftList FfiConverterTypeNftList::lift(RustBuffer buf) {
3277+ auto stream = RustStream(&buf);
3278+ auto ret = FfiConverterTypeNftList::read(stream);
3279+
3280+ rustbuffer_free(buf);
3281+
3282+ return std::move(ret);
3283+}
3284+
3285+RustBuffer FfiConverterTypeNftList::lower(const NftList &val) {
3286+ auto buf = rustbuffer_alloc(allocation_size(val));
3287+ auto stream = RustStream(&buf);
3288+
3289+ FfiConverterTypeNftList::write(stream, val);
3290+
3291+ return std::move(buf);
3292+}
3293+
3294+NftList FfiConverterTypeNftList::read(RustStream &stream) {
3295+ return {
3296+ FfiConverterSequenceTypeNftItem::read(stream),
3297+ FfiConverterTypeResourceState::read(stream),
3298+ FfiConverterTypeResourceState::read(stream),
3299+ FfiConverterBool::read(stream)
3300+ };
3301+}
3302+
3303+void FfiConverterTypeNftList::write(RustStream &stream, const NftList &val) {
3304+ FfiConverterSequenceTypeNftItem::write(stream, val.items);
3305+ FfiConverterTypeResourceState::write(stream, val.resource);
3306+ FfiConverterTypeResourceState::write(stream, val.pagination_resource);
3307+ FfiConverterBool::write(stream, val.has_more);
3308+}
3309+
3310+uint64_t FfiConverterTypeNftList::allocation_size(const NftList &val) {
3311+
3312+ return
3313+ FfiConverterSequenceTypeNftItem::allocation_size(val.items) +
3314+ FfiConverterTypeResourceState::allocation_size(val.resource) +
3315+ FfiConverterTypeResourceState::allocation_size(val.pagination_resource) +
3316+ FfiConverterBool::allocation_size(val.has_more);
3317+
3318+}
3319+
3320+
3321+NftTransferIntent FfiConverterTypeNftTransferIntent::lift(RustBuffer buf) {
3322+ auto stream = RustStream(&buf);
3323+ auto ret = FfiConverterTypeNftTransferIntent::read(stream);
3324+
3325+ rustbuffer_free(buf);
3326+
3327+ return std::move(ret);
3328+}
3329+
3330+RustBuffer FfiConverterTypeNftTransferIntent::lower(const NftTransferIntent &val) {
3331+ auto buf = rustbuffer_alloc(allocation_size(val));
3332+ auto stream = RustStream(&buf);
3333+
3334+ FfiConverterTypeNftTransferIntent::write(stream, val);
3335+
3336+ return std::move(buf);
3337+}
3338+
3339+NftTransferIntent FfiConverterTypeNftTransferIntent::read(RustStream &stream) {
3340+ return {
3341+ FfiConverterTypeTonAddressString::read(stream),
3342+ FfiConverterTypeTonAddressString::read(stream),
3343+ FfiConverterNftTransferFunding::read(stream),
3344+ FfiConverterNftTransferPayload::read(stream),
3345+ FfiConverterSendExpiration::read(stream)
3346+ };
3347+}
3348+
3349+void FfiConverterTypeNftTransferIntent::write(RustStream &stream, const NftTransferIntent &val) {
3350+ FfiConverterTypeTonAddressString::write(stream, val.nft_address);
3351+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
3352+ FfiConverterNftTransferFunding::write(stream, val.funding);
3353+ FfiConverterNftTransferPayload::write(stream, val.payload);
3354+ FfiConverterSendExpiration::write(stream, val.expiration);
3355+}
3356+
3357+uint64_t FfiConverterTypeNftTransferIntent::allocation_size(const NftTransferIntent &val) {
3358+
3359+ return
3360+ FfiConverterTypeTonAddressString::allocation_size(val.nft_address) +
3361+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
3362+ FfiConverterNftTransferFunding::allocation_size(val.funding) +
3363+ FfiConverterNftTransferPayload::allocation_size(val.payload) +
3364+ FfiConverterSendExpiration::allocation_size(val.expiration);
3365+
3366+}
3367+
3368+
3369+NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::lift(RustBuffer buf) {
3370+ auto stream = RustStream(&buf);
3371+ auto ret = FfiConverterTypeNftTransferPreviewRequest::read(stream);
3372+
3373+ rustbuffer_free(buf);
3374+
3375+ return std::move(ret);
3376+}
3377+
3378+RustBuffer FfiConverterTypeNftTransferPreviewRequest::lower(const NftTransferPreviewRequest &val) {
3379+ auto buf = rustbuffer_alloc(allocation_size(val));
3380+ auto stream = RustStream(&buf);
3381+
3382+ FfiConverterTypeNftTransferPreviewRequest::write(stream, val);
3383+
3384+ return std::move(buf);
3385+}
3386+
3387+NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::read(RustStream &stream) {
3388+ return {
3389+ FfiConverterTypeNonEmptyString::read(stream),
3390+ FfiConverterTypeNftTransferIntent::read(stream)
3391+ };
3392+}
3393+
3394+void FfiConverterTypeNftTransferPreviewRequest::write(RustStream &stream, const NftTransferPreviewRequest &val) {
3395+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3396+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3397+}
3398+
3399+uint64_t FfiConverterTypeNftTransferPreviewRequest::allocation_size(const NftTransferPreviewRequest &val) {
3400+
3401+ return
3402+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3403+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3404+
3405+}
3406+
3407+
3408+NftTransferRequest FfiConverterTypeNftTransferRequest::lift(RustBuffer buf) {
3409+ auto stream = RustStream(&buf);
3410+ auto ret = FfiConverterTypeNftTransferRequest::read(stream);
3411+
3412+ rustbuffer_free(buf);
3413+
3414+ return std::move(ret);
3415+}
3416+
3417+RustBuffer FfiConverterTypeNftTransferRequest::lower(const NftTransferRequest &val) {
3418+ auto buf = rustbuffer_alloc(allocation_size(val));
3419+ auto stream = RustStream(&buf);
3420+
3421+ FfiConverterTypeNftTransferRequest::write(stream, val);
3422+
3423+ return std::move(buf);
3424+}
3425+
3426+NftTransferRequest FfiConverterTypeNftTransferRequest::read(RustStream &stream) {
3427+ return {
3428+ FfiConverterTypeNonEmptyString::read(stream),
3429+ FfiConverterBool::read(stream),
3430+ FfiConverterTypeNftTransferIntent::read(stream)
3431+ };
3432+}
3433+
3434+void FfiConverterTypeNftTransferRequest::write(RustStream &stream, const NftTransferRequest &val) {
3435+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3436+ FfiConverterBool::write(stream, val.force);
3437+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3438+}
3439+
3440+uint64_t FfiConverterTypeNftTransferRequest::allocation_size(const NftTransferRequest &val) {
3441+
3442+ return
3443+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3444+ FfiConverterBool::allocation_size(val.force) +
3445+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3446+
3447+}
3448+
3449+
3450+ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::lift(RustBuffer buf) {
3451+ auto stream = RustStream(&buf);
3452+ auto ret = FfiConverterTypeParsedTonTransferLink::read(stream);
3453+
3454+ rustbuffer_free(buf);
3455+
3456+ return std::move(ret);
3457+}
3458+
3459+RustBuffer FfiConverterTypeParsedTonTransferLink::lower(const ParsedTonTransferLink &val) {
3460+ auto buf = rustbuffer_alloc(allocation_size(val));
3461+ auto stream = RustStream(&buf);
3462+
3463+ FfiConverterTypeParsedTonTransferLink::write(stream, val);
3464+
3465+ return std::move(buf);
3466+}
3467+
3468+ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::read(RustStream &stream) {
3469+ return {
3470+ FfiConverterTypeTonAddressString::read(stream),
3471+ FfiConverterTonTransferAsset::read(stream),
3472+ FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
3473+ FfiConverterTonTransferPayload::read(stream),
3474+ FfiConverterSendExpiration::read(stream)
3475+ };
3476+}
3477+
3478+void FfiConverterTypeParsedTonTransferLink::write(RustStream &stream, const ParsedTonTransferLink &val) {
3479+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
3480+ FfiConverterTonTransferAsset::write(stream, val.asset);
3481+ FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val.amount);
3482+ FfiConverterTonTransferPayload::write(stream, val.payload);
3483+ FfiConverterSendExpiration::write(stream, val.expiration);
3484+}
3485+
3486+uint64_t FfiConverterTypeParsedTonTransferLink::allocation_size(const ParsedTonTransferLink &val) {
3487+
3488+ return
3489+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
3490+ FfiConverterTonTransferAsset::allocation_size(val.asset) +
3491+ FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val.amount) +
3492+ FfiConverterTonTransferPayload::allocation_size(val.payload) +
3493+ FfiConverterSendExpiration::allocation_size(val.expiration);
3494+
3495+}
3496+
3497+
3498+PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::lift(RustBuffer buf) {
3499+ auto stream = RustStream(&buf);
3500+ auto ret = FfiConverterTypePrepareKeyRotationRequest::read(stream);
3501+
3502+ rustbuffer_free(buf);
3503+
3504+ return std::move(ret);
3505+}
3506+
3507+RustBuffer FfiConverterTypePrepareKeyRotationRequest::lower(const PrepareKeyRotationRequest &val) {
3508+ auto buf = rustbuffer_alloc(allocation_size(val));
3509+ auto stream = RustStream(&buf);
3510+
3511+ FfiConverterTypePrepareKeyRotationRequest::write(stream, val);
3512+
3513+ return std::move(buf);
3514+}
3515+
3516+PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::read(RustStream &stream) {
3517+ return {
3518+ FfiConverterUInt64::read(stream),
3519+ FfiConverterKeyRotationMessageKind::read(stream)
3520+ };
3521+}
3522+
3523+void FfiConverterTypePrepareKeyRotationRequest::write(RustStream &stream, const PrepareKeyRotationRequest &val) {
3524+ FfiConverterUInt64::write(stream, val.valid_until);
3525+ FfiConverterKeyRotationMessageKind::write(stream, val.message_kind);
3526+}
3527+
3528+uint64_t FfiConverterTypePrepareKeyRotationRequest::allocation_size(const PrepareKeyRotationRequest &val) {
3529+
3530+ return
3531+ FfiConverterUInt64::allocation_size(val.valid_until) +
3532+ FfiConverterKeyRotationMessageKind::allocation_size(val.message_kind);
3533+
3534+}
3535+
3536+
3537+PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::lift(RustBuffer buf) {
3538+ auto stream = RustStream(&buf);
3539+ auto ret = FfiConverterTypePrepareNftTransferRequest::read(stream);
3540+
3541+ rustbuffer_free(buf);
3542+
3543+ return std::move(ret);
3544+}
3545+
3546+RustBuffer FfiConverterTypePrepareNftTransferRequest::lower(const PrepareNftTransferRequest &val) {
3547+ auto buf = rustbuffer_alloc(allocation_size(val));
3548+ auto stream = RustStream(&buf);
3549+
3550+ FfiConverterTypePrepareNftTransferRequest::write(stream, val);
3551+
3552+ return std::move(buf);
3553+}
3554+
3555+PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::read(RustStream &stream) {
3556+ return {
3557+ FfiConverterTypeNonEmptyString::read(stream),
3558+ FfiConverterTypeNftTransferIntent::read(stream)
3559+ };
3560+}
3561+
3562+void FfiConverterTypePrepareNftTransferRequest::write(RustStream &stream, const PrepareNftTransferRequest &val) {
3563+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3564+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3565+}
3566+
3567+uint64_t FfiConverterTypePrepareNftTransferRequest::allocation_size(const PrepareNftTransferRequest &val) {
3568+
3569+ return
3570+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3571+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3572+
3573+}
3574+
3575+
3576+PrepareTransferRequest FfiConverterTypePrepareTransferRequest::lift(RustBuffer buf) {
3577+ auto stream = RustStream(&buf);
3578+ auto ret = FfiConverterTypePrepareTransferRequest::read(stream);
3579+
3580+ rustbuffer_free(buf);
3581+
3582+ return std::move(ret);
3583+}
3584+
3585+RustBuffer FfiConverterTypePrepareTransferRequest::lower(const PrepareTransferRequest &val) {
3586+ auto buf = rustbuffer_alloc(allocation_size(val));
3587+ auto stream = RustStream(&buf);
3588+
3589+ FfiConverterTypePrepareTransferRequest::write(stream, val);
3590+
3591+ return std::move(buf);
3592+}
3593+
3594+PrepareTransferRequest FfiConverterTypePrepareTransferRequest::read(RustStream &stream) {
3595+ return {
3596+ FfiConverterTypeNonEmptyString::read(stream),
3597+ FfiConverterTypeSendIntent::read(stream)
3598+ };
3599+}
3600+
3601+void FfiConverterTypePrepareTransferRequest::write(RustStream &stream, const PrepareTransferRequest &val) {
3602+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3603+ FfiConverterTypeSendIntent::write(stream, val.intent);
3604+}
3605+
3606+uint64_t FfiConverterTypePrepareTransferRequest::allocation_size(const PrepareTransferRequest &val) {
3607+
3608+ return
3609+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3610+ FfiConverterTypeSendIntent::allocation_size(val.intent);
3611+
3612+}
3613+
3614+
3615+PreparedKeyRotation FfiConverterTypePreparedKeyRotation::lift(RustBuffer buf) {
3616+ auto stream = RustStream(&buf);
3617+ auto ret = FfiConverterTypePreparedKeyRotation::read(stream);
3618+
3619+ rustbuffer_free(buf);
3620+
3621+ return std::move(ret);
3622+}
3623+
3624+RustBuffer FfiConverterTypePreparedKeyRotation::lower(const PreparedKeyRotation &val) {
3625+ auto buf = rustbuffer_alloc(allocation_size(val));
3626+ auto stream = RustStream(&buf);
3627+
3628+ FfiConverterTypePreparedKeyRotation::write(stream, val);
3629+
3630+ return std::move(buf);
3631+}
3632+
3633+PreparedKeyRotation FfiConverterTypePreparedKeyRotation::read(RustStream &stream) {
3634+ return {
3635+ FfiConverterTypeRecoveryPhrase::read(stream),
3636+ FfiConverterBytes::read(stream),
3637+ FfiConverterTypeBoc::read(stream),
3638+ FfiConverterTypeBoc::read(stream),
3639+ FfiConverterTypeBoc::read(stream),
3640+ FfiConverterUInt32::read(stream),
3641+ FfiConverterUInt64::read(stream),
3642+ FfiConverterKeyRotationMessageKind::read(stream)
3643+ };
3644+}
3645+
3646+void FfiConverterTypePreparedKeyRotation::write(RustStream &stream, const PreparedKeyRotation &val) {
3647+ FfiConverterTypeRecoveryPhrase::write(stream, val.replacement_recovery_phrase);
3648+ FfiConverterBytes::write(stream, val.new_public_key);
3649+ FfiConverterTypeBoc::write(stream, val.signed_boc);
3650+ FfiConverterTypeBoc::write(stream, val.external_boc);
3651+ FfiConverterTypeBoc::write(stream, val.internal_boc);
3652+ FfiConverterUInt32::write(stream, val.seqno);
3653+ FfiConverterUInt64::write(stream, val.valid_until);
3654+ FfiConverterKeyRotationMessageKind::write(stream, val.message_kind);
3655+}
3656+
3657+uint64_t FfiConverterTypePreparedKeyRotation::allocation_size(const PreparedKeyRotation &val) {
3658+
3659+ return
3660+ FfiConverterTypeRecoveryPhrase::allocation_size(val.replacement_recovery_phrase) +
3661+ FfiConverterBytes::allocation_size(val.new_public_key) +
3662+ FfiConverterTypeBoc::allocation_size(val.signed_boc) +
3663+ FfiConverterTypeBoc::allocation_size(val.external_boc) +
3664+ FfiConverterTypeBoc::allocation_size(val.internal_boc) +
3665+ FfiConverterUInt32::allocation_size(val.seqno) +
3666+ FfiConverterUInt64::allocation_size(val.valid_until) +
3667+ FfiConverterKeyRotationMessageKind::allocation_size(val.message_kind);
3668+
3669+}
3670+
3671+
3672+PreparedTransfer FfiConverterTypePreparedTransfer::lift(RustBuffer buf) {
3673+ auto stream = RustStream(&buf);
3674+ auto ret = FfiConverterTypePreparedTransfer::read(stream);
3675+
3676+ rustbuffer_free(buf);
3677+
3678+ return std::move(ret);
3679+}
3680+
3681+RustBuffer FfiConverterTypePreparedTransfer::lower(const PreparedTransfer &val) {
3682+ auto buf = rustbuffer_alloc(allocation_size(val));
3683+ auto stream = RustStream(&buf);
3684+
3685+ FfiConverterTypePreparedTransfer::write(stream, val);
3686+
3687+ return std::move(buf);
3688+}
3689+
3690+PreparedTransfer FfiConverterTypePreparedTransfer::read(RustStream &stream) {
3691+ return {
3692+ FfiConverterTypeNonEmptyString::read(stream),
3693+ FfiConverterTypeBoc::read(stream),
3694+ FfiConverterTypeBoc::read(stream),
3695+ FfiConverterUInt32::read(stream),
3696+ FfiConverterUInt64::read(stream)
3697+ };
3698+}
3699+
3700+void FfiConverterTypePreparedTransfer::write(RustStream &stream, const PreparedTransfer &val) {
3701+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3702+ FfiConverterTypeBoc::write(stream, val.external_boc);
3703+ FfiConverterTypeBoc::write(stream, val.internal_boc);
3704+ FfiConverterUInt32::write(stream, val.seqno);
3705+ FfiConverterUInt64::write(stream, val.valid_until);
3706+}
3707+
3708+uint64_t FfiConverterTypePreparedTransfer::allocation_size(const PreparedTransfer &val) {
3709+
3710+ return
3711+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3712+ FfiConverterTypeBoc::allocation_size(val.external_boc) +
3713+ FfiConverterTypeBoc::allocation_size(val.internal_boc) +
3714+ FfiConverterUInt32::allocation_size(val.seqno) +
3715+ FfiConverterUInt64::allocation_size(val.valid_until);
3716+
3717+}
3718+
3719+
3720+ProtectedSecretRead FfiConverterTypeProtectedSecretRead::lift(RustBuffer buf) {
3721+ auto stream = RustStream(&buf);
3722+ auto ret = FfiConverterTypeProtectedSecretRead::read(stream);
3723+
3724+ rustbuffer_free(buf);
3725+
3726+ return std::move(ret);
3727+}
3728+
3729+RustBuffer FfiConverterTypeProtectedSecretRead::lower(const ProtectedSecretRead &val) {
3730+ auto buf = rustbuffer_alloc(allocation_size(val));
3731+ auto stream = RustStream(&buf);
3732+
3733+ FfiConverterTypeProtectedSecretRead::write(stream, val);
3734+
3735+ return std::move(buf);
3736+}
3737+
3738+ProtectedSecretRead FfiConverterTypeProtectedSecretRead::read(RustStream &stream) {
3739+ return {
3740+ FfiConverterTypeProtectedSecretRef::read(stream),
3741+ FfiConverterSecretAccessReason::read(stream),
3742+ FfiConverterString::read(stream)
3743+ };
3744+}
3745+
3746+void FfiConverterTypeProtectedSecretRead::write(RustStream &stream, const ProtectedSecretRead &val) {
3747+ FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
3748+ FfiConverterSecretAccessReason::write(stream, val.reason);
3749+ FfiConverterString::write(stream, val.prompt);
3750+}
3751+
3752+uint64_t FfiConverterTypeProtectedSecretRead::allocation_size(const ProtectedSecretRead &val) {
3753+
3754+ return
3755+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
3756+ FfiConverterSecretAccessReason::allocation_size(val.reason) +
3757+ FfiConverterString::allocation_size(val.prompt);
3758+
3759+}
3760+
3761+
3762+ProtectedSecretRef FfiConverterTypeProtectedSecretRef::lift(RustBuffer buf) {
3763+ auto stream = RustStream(&buf);
3764+ auto ret = FfiConverterTypeProtectedSecretRef::read(stream);
3765+
3766+ rustbuffer_free(buf);
3767+
3768+ return std::move(ret);
3769+}
3770+
3771+RustBuffer FfiConverterTypeProtectedSecretRef::lower(const ProtectedSecretRef &val) {
3772+ auto buf = rustbuffer_alloc(allocation_size(val));
3773+ auto stream = RustStream(&buf);
3774+
3775+ FfiConverterTypeProtectedSecretRef::write(stream, val);
3776+
3777+ return std::move(buf);
3778+}
3779+
3780+ProtectedSecretRef FfiConverterTypeProtectedSecretRef::read(RustStream &stream) {
3781+ return {
3782+ FfiConverterString::read(stream)
3783+ };
3784+}
3785+
3786+void FfiConverterTypeProtectedSecretRef::write(RustStream &stream, const ProtectedSecretRef &val) {
3787+ FfiConverterString::write(stream, val.value);
3788+}
3789+
3790+uint64_t FfiConverterTypeProtectedSecretRef::allocation_size(const ProtectedSecretRef &val) {
3791+
3792+ return
3793+ FfiConverterString::allocation_size(val.value);
3794+
3795+}
3796+
3797+
3798+ProtectedSecretStore FfiConverterTypeProtectedSecretStore::lift(RustBuffer buf) {
3799+ auto stream = RustStream(&buf);
3800+ auto ret = FfiConverterTypeProtectedSecretStore::read(stream);
3801+
3802+ rustbuffer_free(buf);
3803+
3804+ return std::move(ret);
3805+}
3806+
3807+RustBuffer FfiConverterTypeProtectedSecretStore::lower(const ProtectedSecretStore &val) {
3808+ auto buf = rustbuffer_alloc(allocation_size(val));
3809+ auto stream = RustStream(&buf);
3810+
3811+ FfiConverterTypeProtectedSecretStore::write(stream, val);
3812+
3813+ return std::move(buf);
3814+}
3815+
3816+ProtectedSecretStore FfiConverterTypeProtectedSecretStore::read(RustStream &stream) {
3817+ return {
3818+ FfiConverterTypeProtectedSecretRef::read(stream),
3819+ FfiConverterBytes::read(stream),
3820+ FfiConverterBool::read(stream)
3821+ };
3822+}
3823+
3824+void FfiConverterTypeProtectedSecretStore::write(RustStream &stream, const ProtectedSecretStore &val) {
3825+ FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
3826+ FfiConverterBytes::write(stream, val.bytes);
3827+ FfiConverterBool::write(stream, val.require_user_presence);
3828+}
3829+
3830+uint64_t FfiConverterTypeProtectedSecretStore::allocation_size(const ProtectedSecretStore &val) {
3831+
3832+ return
3833+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
3834+ FfiConverterBytes::allocation_size(val.bytes) +
3835+ FfiConverterBool::allocation_size(val.require_user_presence);
3836+
3837+}
3838+
3839+
3840+ProviderConfig FfiConverterTypeProviderConfig::lift(RustBuffer buf) {
3841+ auto stream = RustStream(&buf);
3842+ auto ret = FfiConverterTypeProviderConfig::read(stream);
3843+
3844+ rustbuffer_free(buf);
3845+
3846+ return std::move(ret);
3847+}
3848+
3849+RustBuffer FfiConverterTypeProviderConfig::lower(const ProviderConfig &val) {
3850+ auto buf = rustbuffer_alloc(allocation_size(val));
3851+ auto stream = RustStream(&buf);
3852+
3853+ FfiConverterTypeProviderConfig::write(stream, val);
3854+
3855+ return std::move(buf);
3856+}
3857+
3858+ProviderConfig FfiConverterTypeProviderConfig::read(RustStream &stream) {
3859+ return {
3860+ FfiConverterString::read(stream),
3861+ FfiConverterOptionalTypeTonAddressString::read(stream),
3862+ FfiConverterUInt64::read(stream)
3863+ };
3864+}
3865+
3866+void FfiConverterTypeProviderConfig::write(RustStream &stream, const ProviderConfig &val) {
3867+ FfiConverterString::write(stream, val.toncenter_base_url);
3868+ FfiConverterOptionalTypeTonAddressString::write(stream, val.dns_root_address);
3869+ FfiConverterUInt64::write(stream, val.request_timeout_ms);
3870+}
3871+
3872+uint64_t FfiConverterTypeProviderConfig::allocation_size(const ProviderConfig &val) {
3873+
3874+ return
3875+ FfiConverterString::allocation_size(val.toncenter_base_url) +
3876+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.dns_root_address) +
3877+ FfiConverterUInt64::allocation_size(val.request_timeout_ms);
3878+
3879+}
3880+
3881+
3882+RecoveryPhrase FfiConverterTypeRecoveryPhrase::lift(RustBuffer buf) {
3883+ auto stream = RustStream(&buf);
3884+ auto ret = FfiConverterTypeRecoveryPhrase::read(stream);
3885+
3886+ rustbuffer_free(buf);
3887+
3888+ return std::move(ret);
3889+}
3890+
3891+RustBuffer FfiConverterTypeRecoveryPhrase::lower(const RecoveryPhrase &val) {
3892+ auto buf = rustbuffer_alloc(allocation_size(val));
3893+ auto stream = RustStream(&buf);
3894+
3895+ FfiConverterTypeRecoveryPhrase::write(stream, val);
3896+
3897+ return std::move(buf);
3898+}
3899+
3900+RecoveryPhrase FfiConverterTypeRecoveryPhrase::read(RustStream &stream) {
3901+ return {
3902+ FfiConverterString::read(stream)
3903+ };
3904+}
3905+
3906+void FfiConverterTypeRecoveryPhrase::write(RustStream &stream, const RecoveryPhrase &val) {
3907+ FfiConverterString::write(stream, val.phrase);
3908+}
3909+
3910+uint64_t FfiConverterTypeRecoveryPhrase::allocation_size(const RecoveryPhrase &val) {
3911+
3912+ return
3913+ FfiConverterString::allocation_size(val.phrase);
3914+
3915+}
3916+
3917+
3918+ResolutionInfo FfiConverterTypeResolutionInfo::lift(RustBuffer buf) {
3919+ auto stream = RustStream(&buf);
3920+ auto ret = FfiConverterTypeResolutionInfo::read(stream);
3921+
3922+ rustbuffer_free(buf);
3923+
3924+ return std::move(ret);
3925+}
3926+
3927+RustBuffer FfiConverterTypeResolutionInfo::lower(const ResolutionInfo &val) {
3928+ auto buf = rustbuffer_alloc(allocation_size(val));
3929+ auto stream = RustStream(&buf);
3930+
3931+ FfiConverterTypeResolutionInfo::write(stream, val);
3932+
3933+ return std::move(buf);
3934+}
3935+
3936+ResolutionInfo FfiConverterTypeResolutionInfo::read(RustStream &stream) {
3937+ return {
3938+ FfiConverterOptionalTypeBase64Hash::read(stream),
3939+ FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
3940+ FfiConverterOptionalPendingReason::read(stream),
3941+ FfiConverterBool::read(stream),
3942+ FfiConverterOptionalUInt64::read(stream)
3943+ };
3944+}
3945+
3946+void FfiConverterTypeResolutionInfo::write(RustStream &stream, const ResolutionInfo &val) {
3947+ FfiConverterOptionalTypeBase64Hash::write(stream, val.transaction_hash);
3948+ FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val.transaction_lt);
3949+ FfiConverterOptionalPendingReason::write(stream, val.pending_reason);
3950+ FfiConverterBool::write(stream, val.can_force_retry);
3951+ FfiConverterOptionalUInt64::write(stream, val.retry_after_hint_ms);
3952+}
3953+
3954+uint64_t FfiConverterTypeResolutionInfo::allocation_size(const ResolutionInfo &val) {
3955+
3956+ return
3957+ FfiConverterOptionalTypeBase64Hash::allocation_size(val.transaction_hash) +
3958+ FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val.transaction_lt) +
3959+ FfiConverterOptionalPendingReason::allocation_size(val.pending_reason) +
3960+ FfiConverterBool::allocation_size(val.can_force_retry) +
3961+ FfiConverterOptionalUInt64::allocation_size(val.retry_after_hint_ms);
3962+
3963+}
3964+
3965+
3966+ResourceState FfiConverterTypeResourceState::lift(RustBuffer buf) {
3967+ auto stream = RustStream(&buf);
3968+ auto ret = FfiConverterTypeResourceState::read(stream);
3969+
3970+ rustbuffer_free(buf);
3971+
3972+ return std::move(ret);
3973+}
3974+
3975+RustBuffer FfiConverterTypeResourceState::lower(const ResourceState &val) {
3976+ auto buf = rustbuffer_alloc(allocation_size(val));
3977+ auto stream = RustStream(&buf);
3978+
3979+ FfiConverterTypeResourceState::write(stream, val);
3980+
3981+ return std::move(buf);
3982+}
3983+
3984+ResourceState FfiConverterTypeResourceState::read(RustStream &stream) {
3985+ return {
3986+ FfiConverterResourcePhase::read(stream),
3987+ FfiConverterOptionalTypeDomainError::read(stream)
3988+ };
3989+}
3990+
3991+void FfiConverterTypeResourceState::write(RustStream &stream, const ResourceState &val) {
3992+ FfiConverterResourcePhase::write(stream, val.phase);
3993+ FfiConverterOptionalTypeDomainError::write(stream, val.error);
3994+}
3995+
3996+uint64_t FfiConverterTypeResourceState::allocation_size(const ResourceState &val) {
3997+
3998+ return
3999+ FfiConverterResourcePhase::allocation_size(val.phase) +
4000+ FfiConverterOptionalTypeDomainError::allocation_size(val.error);
4001+
4002+}
4003+
4004+
4005+SendBocRequest FfiConverterTypeSendBocRequest::lift(RustBuffer buf) {
4006+ auto stream = RustStream(&buf);
4007+ auto ret = FfiConverterTypeSendBocRequest::read(stream);
4008+
4009+ rustbuffer_free(buf);
4010+
4011+ return std::move(ret);
4012+}
4013+
4014+RustBuffer FfiConverterTypeSendBocRequest::lower(const SendBocRequest &val) {
4015+ auto buf = rustbuffer_alloc(allocation_size(val));
4016+ auto stream = RustStream(&buf);
4017+
4018+ FfiConverterTypeSendBocRequest::write(stream, val);
4019+
4020+ return std::move(buf);
4021+}
4022+
4023+SendBocRequest FfiConverterTypeSendBocRequest::read(RustStream &stream) {
4024+ return {
4025+ FfiConverterTypeNonEmptyString::read(stream),
4026+ FfiConverterBool::read(stream),
4027+ FfiConverterTypeBoc::read(stream),
4028+ FfiConverterUInt32::read(stream),
4029+ FfiConverterUInt64::read(stream)
4030+ };
4031+}
4032+
4033+void FfiConverterTypeSendBocRequest::write(RustStream &stream, const SendBocRequest &val) {
4034+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4035+ FfiConverterBool::write(stream, val.force);
4036+ FfiConverterTypeBoc::write(stream, val.signed_boc);
4037+ FfiConverterUInt32::write(stream, val.seqno);
4038+ FfiConverterUInt64::write(stream, val.valid_until);
4039+}
4040+
4041+uint64_t FfiConverterTypeSendBocRequest::allocation_size(const SendBocRequest &val) {
4042+
4043+ return
4044+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4045+ FfiConverterBool::allocation_size(val.force) +
4046+ FfiConverterTypeBoc::allocation_size(val.signed_boc) +
4047+ FfiConverterUInt32::allocation_size(val.seqno) +
4048+ FfiConverterUInt64::allocation_size(val.valid_until);
4049+
4050+}
4051+
4052+
4053+SendEmulation FfiConverterTypeSendEmulation::lift(RustBuffer buf) {
4054+ auto stream = RustStream(&buf);
4055+ auto ret = FfiConverterTypeSendEmulation::read(stream);
4056+
4057+ rustbuffer_free(buf);
4058+
4059+ return std::move(ret);
4060+}
4061+
4062+RustBuffer FfiConverterTypeSendEmulation::lower(const SendEmulation &val) {
4063+ auto buf = rustbuffer_alloc(allocation_size(val));
4064+ auto stream = RustStream(&buf);
4065+
4066+ FfiConverterTypeSendEmulation::write(stream, val);
4067+
4068+ return std::move(buf);
4069+}
4070+
4071+SendEmulation FfiConverterTypeSendEmulation::read(RustStream &stream) {
4072+ return {
4073+ FfiConverterUInt32::read(stream),
4074+ FfiConverterTypeUnsignedDecimalString::read(stream),
4075+ FfiConverterTypeUnsignedDecimalString::read(stream),
4076+ FfiConverterUInt64::read(stream),
4077+ FfiConverterSequenceTypeSendEmulationAction::read(stream),
4078+ FfiConverterSequenceTypeSendEmulationTransaction::read(stream),
4079+ FfiConverterBool::read(stream),
4080+ FfiConverterBool::read(stream)
4081+ };
4082+}
4083+
4084+void FfiConverterTypeSendEmulation::write(RustStream &stream, const SendEmulation &val) {
4085+ FfiConverterUInt32::write(stream, val.mc_block_seqno);
4086+ FfiConverterTypeUnsignedDecimalString::write(stream, val.wallet_fees_nanograms);
4087+ FfiConverterTypeUnsignedDecimalString::write(stream, val.trace_fees_nanograms);
4088+ FfiConverterUInt64::write(stream, val.transaction_count);
4089+ FfiConverterSequenceTypeSendEmulationAction::write(stream, val.actions);
4090+ FfiConverterSequenceTypeSendEmulationTransaction::write(stream, val.transactions);
4091+ FfiConverterBool::write(stream, val.trace_succeeded);
4092+ FfiConverterBool::write(stream, val.is_incomplete);
4093+}
4094+
4095+uint64_t FfiConverterTypeSendEmulation::allocation_size(const SendEmulation &val) {
4096+
4097+ return
4098+ FfiConverterUInt32::allocation_size(val.mc_block_seqno) +
4099+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.wallet_fees_nanograms) +
4100+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.trace_fees_nanograms) +
4101+ FfiConverterUInt64::allocation_size(val.transaction_count) +
4102+ FfiConverterSequenceTypeSendEmulationAction::allocation_size(val.actions) +
4103+ FfiConverterSequenceTypeSendEmulationTransaction::allocation_size(val.transactions) +
4104+ FfiConverterBool::allocation_size(val.trace_succeeded) +
4105+ FfiConverterBool::allocation_size(val.is_incomplete);
4106+
4107+}
4108+
4109+
4110+SendEmulationAction FfiConverterTypeSendEmulationAction::lift(RustBuffer buf) {
4111+ auto stream = RustStream(&buf);
4112+ auto ret = FfiConverterTypeSendEmulationAction::read(stream);
4113+
4114+ rustbuffer_free(buf);
4115+
4116+ return std::move(ret);
4117+}
4118+
4119+RustBuffer FfiConverterTypeSendEmulationAction::lower(const SendEmulationAction &val) {
4120+ auto buf = rustbuffer_alloc(allocation_size(val));
4121+ auto stream = RustStream(&buf);
4122+
4123+ FfiConverterTypeSendEmulationAction::write(stream, val);
4124+
4125+ return std::move(buf);
4126+}
4127+
4128+SendEmulationAction FfiConverterTypeSendEmulationAction::read(RustStream &stream) {
4129+ return {
4130+ FfiConverterTypeBase64Hash::read(stream),
4131+ FfiConverterTypeNonEmptyString::read(stream),
4132+ FfiConverterBool::read(stream),
4133+ FfiConverterSequenceTypeTonAddressString::read(stream),
4134+ FfiConverterSequenceTypeBase64Hash::read(stream),
4135+ FfiConverterString::read(stream)
4136+ };
4137+}
4138+
4139+void FfiConverterTypeSendEmulationAction::write(RustStream &stream, const SendEmulationAction &val) {
4140+ FfiConverterTypeBase64Hash::write(stream, val.action_id);
4141+ FfiConverterTypeNonEmptyString::write(stream, val.kind);
4142+ FfiConverterBool::write(stream, val.succeeded);
4143+ FfiConverterSequenceTypeTonAddressString::write(stream, val.accounts);
4144+ FfiConverterSequenceTypeBase64Hash::write(stream, val.transaction_hashes);
4145+ FfiConverterString::write(stream, val.details_json);
4146+}
4147+
4148+uint64_t FfiConverterTypeSendEmulationAction::allocation_size(const SendEmulationAction &val) {
4149+
4150+ return
4151+ FfiConverterTypeBase64Hash::allocation_size(val.action_id) +
4152+ FfiConverterTypeNonEmptyString::allocation_size(val.kind) +
4153+ FfiConverterBool::allocation_size(val.succeeded) +
4154+ FfiConverterSequenceTypeTonAddressString::allocation_size(val.accounts) +
4155+ FfiConverterSequenceTypeBase64Hash::allocation_size(val.transaction_hashes) +
4156+ FfiConverterString::allocation_size(val.details_json);
4157+
4158+}
4159+
4160+
4161+SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::lift(RustBuffer buf) {
4162+ auto stream = RustStream(&buf);
4163+ auto ret = FfiConverterTypeSendEmulationTransaction::read(stream);
4164+
4165+ rustbuffer_free(buf);
4166+
4167+ return std::move(ret);
4168+}
4169+
4170+RustBuffer FfiConverterTypeSendEmulationTransaction::lower(const SendEmulationTransaction &val) {
4171+ auto buf = rustbuffer_alloc(allocation_size(val));
4172+ auto stream = RustStream(&buf);
4173+
4174+ FfiConverterTypeSendEmulationTransaction::write(stream, val);
4175+
4176+ return std::move(buf);
4177+}
4178+
4179+SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::read(RustStream &stream) {
4180+ return {
4181+ FfiConverterTypeTonAddressString::read(stream),
4182+ FfiConverterBool::read(stream),
4183+ FfiConverterBool::read(stream)
4184+ };
4185+}
4186+
4187+void FfiConverterTypeSendEmulationTransaction::write(RustStream &stream, const SendEmulationTransaction &val) {
4188+ FfiConverterTypeTonAddressString::write(stream, val.account);
4189+ FfiConverterBool::write(stream, val.succeeded);
4190+ FfiConverterBool::write(stream, val.is_root);
4191+}
4192+
4193+uint64_t FfiConverterTypeSendEmulationTransaction::allocation_size(const SendEmulationTransaction &val) {
4194+
4195+ return
4196+ FfiConverterTypeTonAddressString::allocation_size(val.account) +
4197+ FfiConverterBool::allocation_size(val.succeeded) +
4198+ FfiConverterBool::allocation_size(val.is_root);
4199+
4200+}
4201+
4202+
4203+SendIntent FfiConverterTypeSendIntent::lift(RustBuffer buf) {
4204+ auto stream = RustStream(&buf);
4205+ auto ret = FfiConverterTypeSendIntent::read(stream);
4206+
4207+ rustbuffer_free(buf);
4208+
4209+ return std::move(ret);
4210+}
4211+
4212+RustBuffer FfiConverterTypeSendIntent::lower(const SendIntent &val) {
4213+ auto buf = rustbuffer_alloc(allocation_size(val));
4214+ auto stream = RustStream(&buf);
4215+
4216+ FfiConverterTypeSendIntent::write(stream, val);
4217+
4218+ return std::move(buf);
4219+}
4220+
4221+SendIntent FfiConverterTypeSendIntent::read(RustStream &stream) {
4222+ return {
4223+ FfiConverterSendExpiration::read(stream),
4224+ FfiConverterSequenceTypeSendMessage::read(stream)
4225+ };
4226+}
4227+
4228+void FfiConverterTypeSendIntent::write(RustStream &stream, const SendIntent &val) {
4229+ FfiConverterSendExpiration::write(stream, val.expiration);
4230+ FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
4231+}
4232+
4233+uint64_t FfiConverterTypeSendIntent::allocation_size(const SendIntent &val) {
4234+
4235+ return
4236+ FfiConverterSendExpiration::allocation_size(val.expiration) +
4237+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages);
4238+
4239+}
4240+
4241+
4242+SendMessage FfiConverterTypeSendMessage::lift(RustBuffer buf) {
4243+ auto stream = RustStream(&buf);
4244+ auto ret = FfiConverterTypeSendMessage::read(stream);
4245+
4246+ rustbuffer_free(buf);
4247+
4248+ return std::move(ret);
4249+}
4250+
4251+RustBuffer FfiConverterTypeSendMessage::lower(const SendMessage &val) {
4252+ auto buf = rustbuffer_alloc(allocation_size(val));
4253+ auto stream = RustStream(&buf);
4254+
4255+ FfiConverterTypeSendMessage::write(stream, val);
4256+
4257+ return std::move(buf);
4258+}
4259+
4260+SendMessage FfiConverterTypeSendMessage::read(RustStream &stream) {
4261+ return {
4262+ FfiConverterTypeTonAddressString::read(stream),
4263+ FfiConverterSendAmount::read(stream),
4264+ FfiConverterSendMessageBody::read(stream),
4265+ FfiConverterBool::read(stream),
4266+ FfiConverterOptionalTypeBoc::read(stream)
4267+ };
4268+}
4269+
4270+void FfiConverterTypeSendMessage::write(RustStream &stream, const SendMessage &val) {
4271+ FfiConverterTypeTonAddressString::write(stream, val.destination);
4272+ FfiConverterSendAmount::write(stream, val.amount);
4273+ FfiConverterSendMessageBody::write(stream, val.body);
4274+ FfiConverterBool::write(stream, val.bounce);
4275+ FfiConverterOptionalTypeBoc::write(stream, val.state_init);
4276+}
4277+
4278+uint64_t FfiConverterTypeSendMessage::allocation_size(const SendMessage &val) {
4279+
4280+ return
4281+ FfiConverterTypeTonAddressString::allocation_size(val.destination) +
4282+ FfiConverterSendAmount::allocation_size(val.amount) +
4283+ FfiConverterSendMessageBody::allocation_size(val.body) +
4284+ FfiConverterBool::allocation_size(val.bounce) +
4285+ FfiConverterOptionalTypeBoc::allocation_size(val.state_init);
4286+
4287+}
4288+
4289+
4290+SendPreview FfiConverterTypeSendPreview::lift(RustBuffer buf) {
4291+ auto stream = RustStream(&buf);
4292+ auto ret = FfiConverterTypeSendPreview::read(stream);
4293+
4294+ rustbuffer_free(buf);
4295+
4296+ return std::move(ret);
4297+}
4298+
4299+RustBuffer FfiConverterTypeSendPreview::lower(const SendPreview &val) {
4300+ auto buf = rustbuffer_alloc(allocation_size(val));
4301+ auto stream = RustStream(&buf);
4302+
4303+ FfiConverterTypeSendPreview::write(stream, val);
4304+
4305+ return std::move(buf);
4306+}
4307+
4308+SendPreview FfiConverterTypeSendPreview::read(RustStream &stream) {
4309+ return {
4310+ FfiConverterSequenceTypeSendMessage::read(stream),
4311+ FfiConverterUInt64::read(stream),
4312+ FfiConverterTypeBoc::read(stream),
4313+ FfiConverterTypeSendEmulation::read(stream)
4314+ };
4315+}
4316+
4317+void FfiConverterTypeSendPreview::write(RustStream &stream, const SendPreview &val) {
4318+ FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
4319+ FfiConverterUInt64::write(stream, val.valid_until);
4320+ FfiConverterTypeBoc::write(stream, val.message_boc_base64);
4321+ FfiConverterTypeSendEmulation::write(stream, val.emulation);
4322+}
4323+
4324+uint64_t FfiConverterTypeSendPreview::allocation_size(const SendPreview &val) {
4325+
4326+ return
4327+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages) +
4328+ FfiConverterUInt64::allocation_size(val.valid_until) +
4329+ FfiConverterTypeBoc::allocation_size(val.message_boc_base64) +
4330+ FfiConverterTypeSendEmulation::allocation_size(val.emulation);
4331+
4332+}
4333+
4334+
4335+SendPreviewRequest FfiConverterTypeSendPreviewRequest::lift(RustBuffer buf) {
4336+ auto stream = RustStream(&buf);
4337+ auto ret = FfiConverterTypeSendPreviewRequest::read(stream);
4338+
4339+ rustbuffer_free(buf);
4340+
4341+ return std::move(ret);
4342+}
4343+
4344+RustBuffer FfiConverterTypeSendPreviewRequest::lower(const SendPreviewRequest &val) {
4345+ auto buf = rustbuffer_alloc(allocation_size(val));
4346+ auto stream = RustStream(&buf);
4347+
4348+ FfiConverterTypeSendPreviewRequest::write(stream, val);
4349+
4350+ return std::move(buf);
4351+}
4352+
4353+SendPreviewRequest FfiConverterTypeSendPreviewRequest::read(RustStream &stream) {
4354+ return {
4355+ FfiConverterTypeSendIntent::read(stream)
4356+ };
4357+}
4358+
4359+void FfiConverterTypeSendPreviewRequest::write(RustStream &stream, const SendPreviewRequest &val) {
4360+ FfiConverterTypeSendIntent::write(stream, val.intent);
4361+}
4362+
4363+uint64_t FfiConverterTypeSendPreviewRequest::allocation_size(const SendPreviewRequest &val) {
4364+
4365+ return
4366+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4367+
4368+}
4369+
4370+
4371+SendRequest FfiConverterTypeSendRequest::lift(RustBuffer buf) {
4372+ auto stream = RustStream(&buf);
4373+ auto ret = FfiConverterTypeSendRequest::read(stream);
4374+
4375+ rustbuffer_free(buf);
4376+
4377+ return std::move(ret);
4378+}
4379+
4380+RustBuffer FfiConverterTypeSendRequest::lower(const SendRequest &val) {
4381+ auto buf = rustbuffer_alloc(allocation_size(val));
4382+ auto stream = RustStream(&buf);
4383+
4384+ FfiConverterTypeSendRequest::write(stream, val);
4385+
4386+ return std::move(buf);
4387+}
4388+
4389+SendRequest FfiConverterTypeSendRequest::read(RustStream &stream) {
4390+ return {
4391+ FfiConverterTypeNonEmptyString::read(stream),
4392+ FfiConverterBool::read(stream),
4393+ FfiConverterTypeSendIntent::read(stream)
4394+ };
4395+}
4396+
4397+void FfiConverterTypeSendRequest::write(RustStream &stream, const SendRequest &val) {
4398+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4399+ FfiConverterBool::write(stream, val.force);
4400+ FfiConverterTypeSendIntent::write(stream, val.intent);
4401+}
4402+
4403+uint64_t FfiConverterTypeSendRequest::allocation_size(const SendRequest &val) {
4404+
4405+ return
4406+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4407+ FfiConverterBool::allocation_size(val.force) +
4408+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4409+
4410+}
4411+
4412+
4413+SendResult FfiConverterTypeSendResult::lift(RustBuffer buf) {
4414+ auto stream = RustStream(&buf);
4415+ auto ret = FfiConverterTypeSendResult::read(stream);
4416+
4417+ rustbuffer_free(buf);
4418+
4419+ return std::move(ret);
4420+}
4421+
4422+RustBuffer FfiConverterTypeSendResult::lower(const SendResult &val) {
4423+ auto buf = rustbuffer_alloc(allocation_size(val));
4424+ auto stream = RustStream(&buf);
4425+
4426+ FfiConverterTypeSendResult::write(stream, val);
4427+
4428+ return std::move(buf);
4429+}
4430+
4431+SendResult FfiConverterTypeSendResult::read(RustStream &stream) {
4432+ return {
4433+ FfiConverterTypeNonEmptyString::read(stream),
4434+ FfiConverterTypeBase64Hash::read(stream),
4435+ FfiConverterTypeBoc::read(stream),
4436+ FfiConverterSendPhase::read(stream)
4437+ };
4438+}
4439+
4440+void FfiConverterTypeSendResult::write(RustStream &stream, const SendResult &val) {
4441+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4442+ FfiConverterTypeBase64Hash::write(stream, val.message_hash);
4443+ FfiConverterTypeBoc::write(stream, val.signed_boc);
4444+ FfiConverterSendPhase::write(stream, val.phase);
4445+}
4446+
4447+uint64_t FfiConverterTypeSendResult::allocation_size(const SendResult &val) {
4448+
4449+ return
4450+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4451+ FfiConverterTypeBase64Hash::allocation_size(val.message_hash) +
4452+ FfiConverterTypeBoc::allocation_size(val.signed_boc) +
4453+ FfiConverterSendPhase::allocation_size(val.phase);
4454+
4455+}
4456+
4457+
4458+SendSnapshot FfiConverterTypeSendSnapshot::lift(RustBuffer buf) {
4459+ auto stream = RustStream(&buf);
4460+ auto ret = FfiConverterTypeSendSnapshot::read(stream);
4461+
4462+ rustbuffer_free(buf);
4463+
4464+ return std::move(ret);
4465+}
4466+
4467+RustBuffer FfiConverterTypeSendSnapshot::lower(const SendSnapshot &val) {
4468+ auto buf = rustbuffer_alloc(allocation_size(val));
4469+ auto stream = RustStream(&buf);
4470+
4471+ FfiConverterTypeSendSnapshot::write(stream, val);
4472+
4473+ return std::move(buf);
4474+}
4475+
4476+SendSnapshot FfiConverterTypeSendSnapshot::read(RustStream &stream) {
4477+ return {
4478+ FfiConverterOptionalTypeNonEmptyString::read(stream),
4479+ FfiConverterSendPhase::read(stream),
4480+ FfiConverterOptionalString::read(stream),
4481+ FfiConverterOptionalTypeResolutionInfo::read(stream)
4482+ };
4483+}
4484+
4485+void FfiConverterTypeSendSnapshot::write(RustStream &stream, const SendSnapshot &val) {
4486+ FfiConverterOptionalTypeNonEmptyString::write(stream, val.operation_id);
4487+ FfiConverterSendPhase::write(stream, val.phase);
4488+ FfiConverterOptionalString::write(stream, val.error_message);
4489+ FfiConverterOptionalTypeResolutionInfo::write(stream, val.resolution);
4490+}
4491+
4492+uint64_t FfiConverterTypeSendSnapshot::allocation_size(const SendSnapshot &val) {
4493+
4494+ return
4495+ FfiConverterOptionalTypeNonEmptyString::allocation_size(val.operation_id) +
4496+ FfiConverterSendPhase::allocation_size(val.phase) +
4497+ FfiConverterOptionalString::allocation_size(val.error_message) +
4498+ FfiConverterOptionalTypeResolutionInfo::allocation_size(val.resolution);
4499+
4500+}
4501+
4502+
4503+SignMessagePreview FfiConverterTypeSignMessagePreview::lift(RustBuffer buf) {
4504+ auto stream = RustStream(&buf);
4505+ auto ret = FfiConverterTypeSignMessagePreview::read(stream);
4506+
4507+ rustbuffer_free(buf);
4508+
4509+ return std::move(ret);
4510+}
4511+
4512+RustBuffer FfiConverterTypeSignMessagePreview::lower(const SignMessagePreview &val) {
4513+ auto buf = rustbuffer_alloc(allocation_size(val));
4514+ auto stream = RustStream(&buf);
4515+
4516+ FfiConverterTypeSignMessagePreview::write(stream, val);
4517+
4518+ return std::move(buf);
4519+}
4520+
4521+SignMessagePreview FfiConverterTypeSignMessagePreview::read(RustStream &stream) {
4522+ return {
4523+ FfiConverterSequenceTypeSendMessage::read(stream),
4524+ FfiConverterUInt64::read(stream),
4525+ FfiConverterBool::read(stream)
4526+ };
4527+}
4528+
4529+void FfiConverterTypeSignMessagePreview::write(RustStream &stream, const SignMessagePreview &val) {
4530+ FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
4531+ FfiConverterUInt64::write(stream, val.valid_until);
4532+ FfiConverterBool::write(stream, val.needs_state_init);
4533+}
4534+
4535+uint64_t FfiConverterTypeSignMessagePreview::allocation_size(const SignMessagePreview &val) {
4536+
4537+ return
4538+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages) +
4539+ FfiConverterUInt64::allocation_size(val.valid_until) +
4540+ FfiConverterBool::allocation_size(val.needs_state_init);
4541+
4542+}
4543+
4544+
4545+SignMessageRequest FfiConverterTypeSignMessageRequest::lift(RustBuffer buf) {
4546+ auto stream = RustStream(&buf);
4547+ auto ret = FfiConverterTypeSignMessageRequest::read(stream);
4548+
4549+ rustbuffer_free(buf);
4550+
4551+ return std::move(ret);
4552+}
4553+
4554+RustBuffer FfiConverterTypeSignMessageRequest::lower(const SignMessageRequest &val) {
4555+ auto buf = rustbuffer_alloc(allocation_size(val));
4556+ auto stream = RustStream(&buf);
4557+
4558+ FfiConverterTypeSignMessageRequest::write(stream, val);
4559+
4560+ return std::move(buf);
4561+}
4562+
4563+SignMessageRequest FfiConverterTypeSignMessageRequest::read(RustStream &stream) {
4564+ return {
4565+ FfiConverterTypeNonEmptyString::read(stream),
4566+ FfiConverterBool::read(stream),
4567+ FfiConverterTypeSendIntent::read(stream)
4568+ };
4569+}
4570+
4571+void FfiConverterTypeSignMessageRequest::write(RustStream &stream, const SignMessageRequest &val) {
4572+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4573+ FfiConverterBool::write(stream, val.force);
4574+ FfiConverterTypeSendIntent::write(stream, val.intent);
4575+}
4576+
4577+uint64_t FfiConverterTypeSignMessageRequest::allocation_size(const SignMessageRequest &val) {
4578+
4579+ return
4580+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4581+ FfiConverterBool::allocation_size(val.force) +
4582+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4583+
4584+}
4585+
4586+
4587+SignMessageResult FfiConverterTypeSignMessageResult::lift(RustBuffer buf) {
4588+ auto stream = RustStream(&buf);
4589+ auto ret = FfiConverterTypeSignMessageResult::read(stream);
4590+
4591+ rustbuffer_free(buf);
4592+
4593+ return std::move(ret);
4594+}
4595+
4596+RustBuffer FfiConverterTypeSignMessageResult::lower(const SignMessageResult &val) {
4597+ auto buf = rustbuffer_alloc(allocation_size(val));
4598+ auto stream = RustStream(&buf);
4599+
4600+ FfiConverterTypeSignMessageResult::write(stream, val);
4601+
4602+ return std::move(buf);
4603+}
4604+
4605+SignMessageResult FfiConverterTypeSignMessageResult::read(RustStream &stream) {
4606+ return {
4607+ FfiConverterTypeNonEmptyString::read(stream),
4608+ FfiConverterTypeBoc::read(stream),
4609+ FfiConverterUInt64::read(stream),
4610+ FfiConverterSendPhase::read(stream)
4611+ };
4612+}
4613+
4614+void FfiConverterTypeSignMessageResult::write(RustStream &stream, const SignMessageResult &val) {
4615+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4616+ FfiConverterTypeBoc::write(stream, val.internal_boc);
4617+ FfiConverterUInt64::write(stream, val.valid_until);
4618+ FfiConverterSendPhase::write(stream, val.phase);
4619+}
4620+
4621+uint64_t FfiConverterTypeSignMessageResult::allocation_size(const SignMessageResult &val) {
4622+
4623+ return
4624+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4625+ FfiConverterTypeBoc::allocation_size(val.internal_boc) +
4626+ FfiConverterUInt64::allocation_size(val.valid_until) +
4627+ FfiConverterSendPhase::allocation_size(val.phase);
4628+
4629+}
4630+
4631+
4632+TonAddressInfo FfiConverterTypeTonAddressInfo::lift(RustBuffer buf) {
4633+ auto stream = RustStream(&buf);
4634+ auto ret = FfiConverterTypeTonAddressInfo::read(stream);
4635+
4636+ rustbuffer_free(buf);
4637+
4638+ return std::move(ret);
4639+}
4640+
4641+RustBuffer FfiConverterTypeTonAddressInfo::lower(const TonAddressInfo &val) {
4642+ auto buf = rustbuffer_alloc(allocation_size(val));
4643+ auto stream = RustStream(&buf);
4644+
4645+ FfiConverterTypeTonAddressInfo::write(stream, val);
4646+
4647+ return std::move(buf);
4648+}
4649+
4650+TonAddressInfo FfiConverterTypeTonAddressInfo::read(RustStream &stream) {
4651+ return {
4652+ FfiConverterString::read(stream),
4653+ FfiConverterInt32::read(stream),
4654+ FfiConverterTonAddressFormat::read(stream)
4655+ };
4656+}
4657+
4658+void FfiConverterTypeTonAddressInfo::write(RustStream &stream, const TonAddressInfo &val) {
4659+ FfiConverterString::write(stream, val.raw);
4660+ FfiConverterInt32::write(stream, val.workchain);
4661+ FfiConverterTonAddressFormat::write(stream, val.format);
4662+}
4663+
4664+uint64_t FfiConverterTypeTonAddressInfo::allocation_size(const TonAddressInfo &val) {
4665+
4666+ return
4667+ FfiConverterString::allocation_size(val.raw) +
4668+ FfiConverterInt32::allocation_size(val.workchain) +
4669+ FfiConverterTonAddressFormat::allocation_size(val.format);
4670+
4671+}
4672+
4673+
4674+TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::lift(RustBuffer buf) {
4675+ auto stream = RustStream(&buf);
4676+ auto ret = FfiConverterTypeTonConnectAccountInfo::read(stream);
4677+
4678+ rustbuffer_free(buf);
4679+
4680+ return std::move(ret);
4681+}
4682+
4683+RustBuffer FfiConverterTypeTonConnectAccountInfo::lower(const TonConnectAccountInfo &val) {
4684+ auto buf = rustbuffer_alloc(allocation_size(val));
4685+ auto stream = RustStream(&buf);
4686+
4687+ FfiConverterTypeTonConnectAccountInfo::write(stream, val);
4688+
4689+ return std::move(buf);
4690+}
4691+
4692+TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::read(RustStream &stream) {
4693+ return {
4694+ FfiConverterString::read(stream),
4695+ FfiConverterString::read(stream),
4696+ FfiConverterString::read(stream),
4697+ FfiConverterBytes::read(stream)
4698+ };
4699+}
4700+
4701+void FfiConverterTypeTonConnectAccountInfo::write(RustStream &stream, const TonConnectAccountInfo &val) {
4702+ FfiConverterString::write(stream, val.address);
4703+ FfiConverterString::write(stream, val.network);
4704+ FfiConverterString::write(stream, val.wallet_state_init);
4705+ FfiConverterBytes::write(stream, val.public_key);
4706+}
4707+
4708+uint64_t FfiConverterTypeTonConnectAccountInfo::allocation_size(const TonConnectAccountInfo &val) {
4709+
4710+ return
4711+ FfiConverterString::allocation_size(val.address) +
4712+ FfiConverterString::allocation_size(val.network) +
4713+ FfiConverterString::allocation_size(val.wallet_state_init) +
4714+ FfiConverterBytes::allocation_size(val.public_key);
4715+
4716+}
4717+
4718+
4719+TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
4720+ auto stream = RustStream(&buf);
4721+ auto ret = FfiConverterTypeTonConnectConnectPrompt::read(stream);
4722+
4723+ rustbuffer_free(buf);
4724+
4725+ return std::move(ret);
4726+}
4727+
4728+RustBuffer FfiConverterTypeTonConnectConnectPrompt::lower(const TonConnectConnectPrompt &val) {
4729+ auto buf = rustbuffer_alloc(allocation_size(val));
4730+ auto stream = RustStream(&buf);
4731+
4732+ FfiConverterTypeTonConnectConnectPrompt::write(stream, val);
4733+
4734+ return std::move(buf);
4735+}
4736+
4737+TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::read(RustStream &stream) {
4738+ return {
4739+ FfiConverterString::read(stream),
4740+ FfiConverterOptionalString::read(stream),
4741+ FfiConverterOptionalString::read(stream)
4742+ };
4743+}
4744+
4745+void FfiConverterTypeTonConnectConnectPrompt::write(RustStream &stream, const TonConnectConnectPrompt &val) {
4746+ FfiConverterString::write(stream, val.manifest_url);
4747+ FfiConverterOptionalString::write(stream, val.requested_network);
4748+ FfiConverterOptionalString::write(stream, val.proof_payload);
4749+}
4750+
4751+uint64_t FfiConverterTypeTonConnectConnectPrompt::allocation_size(const TonConnectConnectPrompt &val) {
4752+
4753+ return
4754+ FfiConverterString::allocation_size(val.manifest_url) +
4755+ FfiConverterOptionalString::allocation_size(val.requested_network) +
4756+ FfiConverterOptionalString::allocation_size(val.proof_payload);
4757+
4758+}
4759+
4760+
4761+TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::lift(RustBuffer buf) {
4762+ auto stream = RustStream(&buf);
4763+ auto ret = FfiConverterTypeTonConnectDerivedRequest::read(stream);
4764+
4765+ rustbuffer_free(buf);
4766+
4767+ return std::move(ret);
4768+}
4769+
4770+RustBuffer FfiConverterTypeTonConnectDerivedRequest::lower(const TonConnectDerivedRequest &val) {
4771+ auto buf = rustbuffer_alloc(allocation_size(val));
4772+ auto stream = RustStream(&buf);
4773+
4774+ FfiConverterTypeTonConnectDerivedRequest::write(stream, val);
4775+
4776+ return std::move(buf);
4777+}
4778+
4779+TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::read(RustStream &stream) {
4780+ return {
4781+ FfiConverterTonConnectIncomingRequest::read(stream),
4782+ FfiConverterOptionalInt64::read(stream)
4783+ };
4784+}
4785+
4786+void FfiConverterTypeTonConnectDerivedRequest::write(RustStream &stream, const TonConnectDerivedRequest &val) {
4787+ FfiConverterTonConnectIncomingRequest::write(stream, val.request);
4788+ FfiConverterOptionalInt64::write(stream, val.request_id);
4789+}
4790+
4791+uint64_t FfiConverterTypeTonConnectDerivedRequest::allocation_size(const TonConnectDerivedRequest &val) {
4792+
4793+ return
4794+ FfiConverterTonConnectIncomingRequest::allocation_size(val.request) +
4795+ FfiConverterOptionalInt64::allocation_size(val.request_id);
4796+
4797+}
4798+
4799+
4800+TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::lift(RustBuffer buf) {
4801+ auto stream = RustStream(&buf);
4802+ auto ret = FfiConverterTypeTonConnectDerivedSessionRequest::read(stream);
4803+
4804+ rustbuffer_free(buf);
4805+
4806+ return std::move(ret);
4807+}
4808+
4809+RustBuffer FfiConverterTypeTonConnectDerivedSessionRequest::lower(const TonConnectDerivedSessionRequest &val) {
4810+ auto buf = rustbuffer_alloc(allocation_size(val));
4811+ auto stream = RustStream(&buf);
4812+
4813+ FfiConverterTypeTonConnectDerivedSessionRequest::write(stream, val);
4814+
4815+ return std::move(buf);
4816+}
4817+
4818+TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::read(RustStream &stream) {
4819+ return {
4820+ FfiConverterTypeWalletDescriptor::read(stream),
4821+ FfiConverterString::read(stream),
4822+ FfiConverterBytes::read(stream)
4823+ };
4824+}
4825+
4826+void FfiConverterTypeTonConnectDerivedSessionRequest::write(RustStream &stream, const TonConnectDerivedSessionRequest &val) {
4827+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
4828+ FfiConverterString::write(stream, val.dapp_client_id);
4829+ FfiConverterBytes::write(stream, val.nonce);
4830+}
4831+
4832+uint64_t FfiConverterTypeTonConnectDerivedSessionRequest::allocation_size(const TonConnectDerivedSessionRequest &val) {
4833+
4834+ return
4835+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
4836+ FfiConverterString::allocation_size(val.dapp_client_id) +
4837+ FfiConverterBytes::allocation_size(val.nonce);
4838+
4839+}
4840+
4841+
4842+TonConnectDevice FfiConverterTypeTonConnectDevice::lift(RustBuffer buf) {
4843+ auto stream = RustStream(&buf);
4844+ auto ret = FfiConverterTypeTonConnectDevice::read(stream);
4845+
4846+ rustbuffer_free(buf);
4847+
4848+ return std::move(ret);
4849+}
4850+
4851+RustBuffer FfiConverterTypeTonConnectDevice::lower(const TonConnectDevice &val) {
4852+ auto buf = rustbuffer_alloc(allocation_size(val));
4853+ auto stream = RustStream(&buf);
4854+
4855+ FfiConverterTypeTonConnectDevice::write(stream, val);
4856+
4857+ return std::move(buf);
4858+}
4859+
4860+TonConnectDevice FfiConverterTypeTonConnectDevice::read(RustStream &stream) {
4861+ return {
4862+ FfiConverterTonConnectDevicePlatform::read(stream),
4863+ FfiConverterString::read(stream),
4864+ FfiConverterString::read(stream)
4865+ };
4866+}
4867+
4868+void FfiConverterTypeTonConnectDevice::write(RustStream &stream, const TonConnectDevice &val) {
4869+ FfiConverterTonConnectDevicePlatform::write(stream, val.platform);
4870+ FfiConverterString::write(stream, val.app_name);
4871+ FfiConverterString::write(stream, val.app_version);
4872+}
4873+
4874+uint64_t FfiConverterTypeTonConnectDevice::allocation_size(const TonConnectDevice &val) {
4875+
4876+ return
4877+ FfiConverterTonConnectDevicePlatform::allocation_size(val.platform) +
4878+ FfiConverterString::allocation_size(val.app_name) +
4879+ FfiConverterString::allocation_size(val.app_version);
4880+
4881+}
4882+
4883+
4884+TonConnectManifest FfiConverterTypeTonConnectManifest::lift(RustBuffer buf) {
4885+ auto stream = RustStream(&buf);
4886+ auto ret = FfiConverterTypeTonConnectManifest::read(stream);
4887+
4888+ rustbuffer_free(buf);
4889+
4890+ return std::move(ret);
4891+}
4892+
4893+RustBuffer FfiConverterTypeTonConnectManifest::lower(const TonConnectManifest &val) {
4894+ auto buf = rustbuffer_alloc(allocation_size(val));
4895+ auto stream = RustStream(&buf);
4896+
4897+ FfiConverterTypeTonConnectManifest::write(stream, val);
4898+
4899+ return std::move(buf);
4900+}
4901+
4902+TonConnectManifest FfiConverterTypeTonConnectManifest::read(RustStream &stream) {
4903+ return {
4904+ FfiConverterString::read(stream),
4905+ FfiConverterString::read(stream),
4906+ FfiConverterString::read(stream),
4907+ FfiConverterString::read(stream)
4908+ };
4909+}
4910+
4911+void FfiConverterTypeTonConnectManifest::write(RustStream &stream, const TonConnectManifest &val) {
4912+ FfiConverterString::write(stream, val.url);
4913+ FfiConverterString::write(stream, val.name);
4914+ FfiConverterString::write(stream, val.icon_url);
4915+ FfiConverterString::write(stream, val.domain);
4916+}
4917+
4918+uint64_t FfiConverterTypeTonConnectManifest::allocation_size(const TonConnectManifest &val) {
4919+
4920+ return
4921+ FfiConverterString::allocation_size(val.url) +
4922+ FfiConverterString::allocation_size(val.name) +
4923+ FfiConverterString::allocation_size(val.icon_url) +
4924+ FfiConverterString::allocation_size(val.domain);
4925+
4926+}
4927+
4928+
4929+TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::lift(RustBuffer buf) {
4930+ auto stream = RustStream(&buf);
4931+ auto ret = FfiConverterTypeTonConnectPreparedPost::read(stream);
4932+
4933+ rustbuffer_free(buf);
4934+
4935+ return std::move(ret);
4936+}
4937+
4938+RustBuffer FfiConverterTypeTonConnectPreparedPost::lower(const TonConnectPreparedPost &val) {
4939+ auto buf = rustbuffer_alloc(allocation_size(val));
4940+ auto stream = RustStream(&buf);
4941+
4942+ FfiConverterTypeTonConnectPreparedPost::write(stream, val);
4943+
4944+ return std::move(buf);
4945+}
4946+
4947+TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::read(RustStream &stream) {
4948+ return {
4949+ FfiConverterString::read(stream),
4950+ FfiConverterString::read(stream)
4951+ };
4952+}
4953+
4954+void FfiConverterTypeTonConnectPreparedPost::write(RustStream &stream, const TonConnectPreparedPost &val) {
4955+ FfiConverterString::write(stream, val.url);
4956+ FfiConverterString::write(stream, val.body);
4957+}
4958+
4959+uint64_t FfiConverterTypeTonConnectPreparedPost::allocation_size(const TonConnectPreparedPost &val) {
4960+
4961+ return
4962+ FfiConverterString::allocation_size(val.url) +
4963+ FfiConverterString::allocation_size(val.body);
4964+
4965+}
4966+
4967+
4968+TonConnectProofReply FfiConverterTypeTonConnectProofReply::lift(RustBuffer buf) {
4969+ auto stream = RustStream(&buf);
4970+ auto ret = FfiConverterTypeTonConnectProofReply::read(stream);
4971+
4972+ rustbuffer_free(buf);
4973+
4974+ return std::move(ret);
4975+}
4976+
4977+RustBuffer FfiConverterTypeTonConnectProofReply::lower(const TonConnectProofReply &val) {
4978+ auto buf = rustbuffer_alloc(allocation_size(val));
4979+ auto stream = RustStream(&buf);
4980+
4981+ FfiConverterTypeTonConnectProofReply::write(stream, val);
4982+
4983+ return std::move(buf);
4984+}
4985+
4986+TonConnectProofReply FfiConverterTypeTonConnectProofReply::read(RustStream &stream) {
4987+ return {
4988+ FfiConverterUInt64::read(stream),
4989+ FfiConverterString::read(stream),
4990+ FfiConverterString::read(stream),
4991+ FfiConverterBytes::read(stream)
4992+ };
4993+}
4994+
4995+void FfiConverterTypeTonConnectProofReply::write(RustStream &stream, const TonConnectProofReply &val) {
4996+ FfiConverterUInt64::write(stream, val.timestamp);
4997+ FfiConverterString::write(stream, val.domain);
4998+ FfiConverterString::write(stream, val.payload);
4999+ FfiConverterBytes::write(stream, val.signature);
5000+}
5001+
5002+uint64_t FfiConverterTypeTonConnectProofReply::allocation_size(const TonConnectProofReply &val) {
5003+
5004+ return
5005+ FfiConverterUInt64::allocation_size(val.timestamp) +
5006+ FfiConverterString::allocation_size(val.domain) +
5007+ FfiConverterString::allocation_size(val.payload) +
5008+ FfiConverterBytes::allocation_size(val.signature);
5009+
5010+}
5011+
5012+
5013+TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::lift(RustBuffer buf) {
5014+ auto stream = RustStream(&buf);
5015+ auto ret = FfiConverterTypeTonConnectProofSignRequest::read(stream);
5016+
5017+ rustbuffer_free(buf);
5018+
5019+ return std::move(ret);
5020+}
5021+
5022+RustBuffer FfiConverterTypeTonConnectProofSignRequest::lower(const TonConnectProofSignRequest &val) {
5023+ auto buf = rustbuffer_alloc(allocation_size(val));
5024+ auto stream = RustStream(&buf);
5025+
5026+ FfiConverterTypeTonConnectProofSignRequest::write(stream, val);
5027+
5028+ return std::move(buf);
5029+}
5030+
5031+TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::read(RustStream &stream) {
5032+ return {
5033+ FfiConverterTypeWalletDescriptor::read(stream),
5034+ FfiConverterString::read(stream),
5035+ FfiConverterUInt64::read(stream),
5036+ FfiConverterString::read(stream)
5037+ };
5038+}
5039+
5040+void FfiConverterTypeTonConnectProofSignRequest::write(RustStream &stream, const TonConnectProofSignRequest &val) {
5041+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
5042+ FfiConverterString::write(stream, val.domain);
5043+ FfiConverterUInt64::write(stream, val.timestamp);
5044+ FfiConverterString::write(stream, val.payload);
5045+}
5046+
5047+uint64_t FfiConverterTypeTonConnectProofSignRequest::allocation_size(const TonConnectProofSignRequest &val) {
5048+
5049+ return
5050+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
5051+ FfiConverterString::allocation_size(val.domain) +
5052+ FfiConverterUInt64::allocation_size(val.timestamp) +
5053+ FfiConverterString::allocation_size(val.payload);
5054+
5055+}
5056+
5057+
5058+TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::lift(RustBuffer buf) {
5059+ auto stream = RustStream(&buf);
5060+ auto ret = FfiConverterTypeTonConnectProofSignature::read(stream);
5061+
5062+ rustbuffer_free(buf);
5063+
5064+ return std::move(ret);
5065+}
5066+
5067+RustBuffer FfiConverterTypeTonConnectProofSignature::lower(const TonConnectProofSignature &val) {
5068+ auto buf = rustbuffer_alloc(allocation_size(val));
5069+ auto stream = RustStream(&buf);
5070+
5071+ FfiConverterTypeTonConnectProofSignature::write(stream, val);
5072+
5073+ return std::move(buf);
5074+}
5075+
5076+TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::read(RustStream &stream) {
5077+ return {
5078+ FfiConverterBytes::read(stream),
5079+ FfiConverterBytes::read(stream)
5080+ };
5081+}
5082+
5083+void FfiConverterTypeTonConnectProofSignature::write(RustStream &stream, const TonConnectProofSignature &val) {
5084+ FfiConverterBytes::write(stream, val.signature);
5085+ FfiConverterBytes::write(stream, val.public_key);
5086+}
5087+
5088+uint64_t FfiConverterTypeTonConnectProofSignature::allocation_size(const TonConnectProofSignature &val) {
5089+
5090+ return
5091+ FfiConverterBytes::allocation_size(val.signature) +
5092+ FfiConverterBytes::allocation_size(val.public_key);
5093+
5094+}
5095+
5096+
5097+TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::lift(RustBuffer buf) {
5098+ auto stream = RustStream(&buf);
5099+ auto ret = FfiConverterTypeTonConnectSessionConfig::read(stream);
5100+
5101+ rustbuffer_free(buf);
5102+
5103+ return std::move(ret);
5104+}
5105+
5106+RustBuffer FfiConverterTypeTonConnectSessionConfig::lower(const TonConnectSessionConfig &val) {
5107+ auto buf = rustbuffer_alloc(allocation_size(val));
5108+ auto stream = RustStream(&buf);
5109+
5110+ FfiConverterTypeTonConnectSessionConfig::write(stream, val);
5111+
5112+ return std::move(buf);
5113+}
5114+
5115+TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::read(RustStream &stream) {
5116+ return {
5117+ FfiConverterString::read(stream),
5118+ FfiConverterUInt64::read(stream),
5119+ FfiConverterUInt32::read(stream)
5120+ };
5121+}
5122+
5123+void FfiConverterTypeTonConnectSessionConfig::write(RustStream &stream, const TonConnectSessionConfig &val) {
5124+ FfiConverterString::write(stream, val.bridge_url);
5125+ FfiConverterUInt64::write(stream, val.max_event_bytes);
5126+ FfiConverterUInt32::write(stream, val.message_ttl_seconds);
5127+}
5128+
5129+uint64_t FfiConverterTypeTonConnectSessionConfig::allocation_size(const TonConnectSessionConfig &val) {
5130+
5131+ return
5132+ FfiConverterString::allocation_size(val.bridge_url) +
5133+ FfiConverterUInt64::allocation_size(val.max_event_bytes) +
5134+ FfiConverterUInt32::allocation_size(val.message_ttl_seconds);
5135+
5136+}
5137+
5138+
5139+TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::lift(RustBuffer buf) {
5140+ auto stream = RustStream(&buf);
5141+ auto ret = FfiConverterTypeTonConnectSignDataRequest::read(stream);
5142+
5143+ rustbuffer_free(buf);
5144+
5145+ return std::move(ret);
5146+}
5147+
5148+RustBuffer FfiConverterTypeTonConnectSignDataRequest::lower(const TonConnectSignDataRequest &val) {
5149+ auto buf = rustbuffer_alloc(allocation_size(val));
5150+ auto stream = RustStream(&buf);
5151+
5152+ FfiConverterTypeTonConnectSignDataRequest::write(stream, val);
5153+
5154+ return std::move(buf);
5155+}
5156+
5157+TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::read(RustStream &stream) {
5158+ return {
5159+ FfiConverterTonConnectSignDataPayload::read(stream),
5160+ FfiConverterOptionalString::read(stream),
5161+ FfiConverterOptionalString::read(stream)
5162+ };
5163+}
5164+
5165+void FfiConverterTypeTonConnectSignDataRequest::write(RustStream &stream, const TonConnectSignDataRequest &val) {
5166+ FfiConverterTonConnectSignDataPayload::write(stream, val.payload);
5167+ FfiConverterOptionalString::write(stream, val.network);
5168+ FfiConverterOptionalString::write(stream, val.from);
5169+}
5170+
5171+uint64_t FfiConverterTypeTonConnectSignDataRequest::allocation_size(const TonConnectSignDataRequest &val) {
5172+
5173+ return
5174+ FfiConverterTonConnectSignDataPayload::allocation_size(val.payload) +
5175+ FfiConverterOptionalString::allocation_size(val.network) +
5176+ FfiConverterOptionalString::allocation_size(val.from);
5177+
5178+}
5179+
5180+
5181+TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::lift(RustBuffer buf) {
5182+ auto stream = RustStream(&buf);
5183+ auto ret = FfiConverterTypeTonConnectSignDataSignRequest::read(stream);
5184+
5185+ rustbuffer_free(buf);
5186+
5187+ return std::move(ret);
5188+}
5189+
5190+RustBuffer FfiConverterTypeTonConnectSignDataSignRequest::lower(const TonConnectSignDataSignRequest &val) {
5191+ auto buf = rustbuffer_alloc(allocation_size(val));
5192+ auto stream = RustStream(&buf);
5193+
5194+ FfiConverterTypeTonConnectSignDataSignRequest::write(stream, val);
5195+
5196+ return std::move(buf);
5197+}
5198+
5199+TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::read(RustStream &stream) {
5200+ return {
5201+ FfiConverterTypeWalletDescriptor::read(stream),
5202+ FfiConverterTypeTonConnectSignDataRequest::read(stream),
5203+ FfiConverterString::read(stream),
5204+ FfiConverterUInt64::read(stream)
5205+ };
5206+}
5207+
5208+void FfiConverterTypeTonConnectSignDataSignRequest::write(RustStream &stream, const TonConnectSignDataSignRequest &val) {
5209+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
5210+ FfiConverterTypeTonConnectSignDataRequest::write(stream, val.request);
5211+ FfiConverterString::write(stream, val.domain);
5212+ FfiConverterUInt64::write(stream, val.timestamp);
5213+}
5214+
5215+uint64_t FfiConverterTypeTonConnectSignDataSignRequest::allocation_size(const TonConnectSignDataSignRequest &val) {
5216+
5217+ return
5218+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
5219+ FfiConverterTypeTonConnectSignDataRequest::allocation_size(val.request) +
5220+ FfiConverterString::allocation_size(val.domain) +
5221+ FfiConverterUInt64::allocation_size(val.timestamp);
5222+
5223+}
5224+
5225+
5226+TonConnectSignedData FfiConverterTypeTonConnectSignedData::lift(RustBuffer buf) {
5227+ auto stream = RustStream(&buf);
5228+ auto ret = FfiConverterTypeTonConnectSignedData::read(stream);
5229+
5230+ rustbuffer_free(buf);
5231+
5232+ return std::move(ret);
5233+}
5234+
5235+RustBuffer FfiConverterTypeTonConnectSignedData::lower(const TonConnectSignedData &val) {
5236+ auto buf = rustbuffer_alloc(allocation_size(val));
5237+ auto stream = RustStream(&buf);
5238+
5239+ FfiConverterTypeTonConnectSignedData::write(stream, val);
5240+
5241+ return std::move(buf);
5242+}
5243+
5244+TonConnectSignedData FfiConverterTypeTonConnectSignedData::read(RustStream &stream) {
5245+ return {
5246+ FfiConverterTypeTonConnectSignDataRequest::read(stream),
5247+ FfiConverterString::read(stream),
5248+ FfiConverterUInt64::read(stream),
5249+ FfiConverterBytes::read(stream),
5250+ FfiConverterBytes::read(stream)
5251+ };
5252+}
5253+
5254+void FfiConverterTypeTonConnectSignedData::write(RustStream &stream, const TonConnectSignedData &val) {
5255+ FfiConverterTypeTonConnectSignDataRequest::write(stream, val.request);
5256+ FfiConverterString::write(stream, val.domain);
5257+ FfiConverterUInt64::write(stream, val.timestamp);
5258+ FfiConverterBytes::write(stream, val.signature);
5259+ FfiConverterBytes::write(stream, val.public_key);
5260+}
5261+
5262+uint64_t FfiConverterTypeTonConnectSignedData::allocation_size(const TonConnectSignedData &val) {
5263+
5264+ return
5265+ FfiConverterTypeTonConnectSignDataRequest::allocation_size(val.request) +
5266+ FfiConverterString::allocation_size(val.domain) +
5267+ FfiConverterUInt64::allocation_size(val.timestamp) +
5268+ FfiConverterBytes::allocation_size(val.signature) +
5269+ FfiConverterBytes::allocation_size(val.public_key);
5270+
5271+}
5272+
5273+
5274+WalletClientConfig FfiConverterTypeWalletClientConfig::lift(RustBuffer buf) {
5275+ auto stream = RustStream(&buf);
5276+ auto ret = FfiConverterTypeWalletClientConfig::read(stream);
5277+
5278+ rustbuffer_free(buf);
5279+
5280+ return std::move(ret);
5281+}
5282+
5283+RustBuffer FfiConverterTypeWalletClientConfig::lower(const WalletClientConfig &val) {
5284+ auto buf = rustbuffer_alloc(allocation_size(val));
5285+ auto stream = RustStream(&buf);
5286+
5287+ FfiConverterTypeWalletClientConfig::write(stream, val);
5288+
5289+ return std::move(buf);
5290+}
5291+
5292+WalletClientConfig FfiConverterTypeWalletClientConfig::read(RustStream &stream) {
5293+ return {
5294+ FfiConverterTypeNonEmptyString::read(stream),
5295+ FfiConverterTypeTonAddressString::read(stream),
5296+ FfiConverterBytes::read(stream),
5297+ FfiConverterOptionalTypeProtectedSecretRef::read(stream),
5298+ FfiConverterNetwork::read(stream),
5299+ FfiConverterUInt64::read(stream),
5300+ FfiConverterUInt64::read(stream),
5301+ FfiConverterTypeProviderConfig::read(stream)
5302+ };
5303+}
5304+
5305+void FfiConverterTypeWalletClientConfig::write(RustStream &stream, const WalletClientConfig &val) {
5306+ FfiConverterTypeNonEmptyString::write(stream, val.record_id);
5307+ FfiConverterTypeTonAddressString::write(stream, val.address);
5308+ FfiConverterBytes::write(stream, val.public_key);
5309+ FfiConverterOptionalTypeProtectedSecretRef::write(stream, val.local_secret_ref);
5310+ FfiConverterNetwork::write(stream, val.network);
5311+ FfiConverterUInt64::write(stream, val.send_validity_seconds);
5312+ FfiConverterUInt64::write(stream, val.resolution_margin_seconds);
5313+ FfiConverterTypeProviderConfig::write(stream, val.providers);
5314+}
5315+
5316+uint64_t FfiConverterTypeWalletClientConfig::allocation_size(const WalletClientConfig &val) {
5317+
5318+ return
5319+ FfiConverterTypeNonEmptyString::allocation_size(val.record_id) +
5320+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
5321+ FfiConverterBytes::allocation_size(val.public_key) +
5322+ FfiConverterOptionalTypeProtectedSecretRef::allocation_size(val.local_secret_ref) +
5323+ FfiConverterNetwork::allocation_size(val.network) +
5324+ FfiConverterUInt64::allocation_size(val.send_validity_seconds) +
5325+ FfiConverterUInt64::allocation_size(val.resolution_margin_seconds) +
5326+ FfiConverterTypeProviderConfig::allocation_size(val.providers);
5327+
5328+}
5329+
5330+
5331+WalletDescriptor FfiConverterTypeWalletDescriptor::lift(RustBuffer buf) {
5332+ auto stream = RustStream(&buf);
5333+ auto ret = FfiConverterTypeWalletDescriptor::read(stream);
5334+
5335+ rustbuffer_free(buf);
5336+
5337+ return std::move(ret);
5338+}
5339+
5340+RustBuffer FfiConverterTypeWalletDescriptor::lower(const WalletDescriptor &val) {
5341+ auto buf = rustbuffer_alloc(allocation_size(val));
5342+ auto stream = RustStream(&buf);
5343+
5344+ FfiConverterTypeWalletDescriptor::write(stream, val);
5345+
5346+ return std::move(buf);
5347+}
5348+
5349+WalletDescriptor FfiConverterTypeWalletDescriptor::read(RustStream &stream) {
5350+ return {
5351+ FfiConverterString::read(stream),
5352+ FfiConverterTypeTonAddressString::read(stream),
5353+ FfiConverterBytes::read(stream),
5354+ FfiConverterNetwork::read(stream),
5355+ FfiConverterTypeProtectedSecretRef::read(stream)
5356+ };
5357+}
5358+
5359+void FfiConverterTypeWalletDescriptor::write(RustStream &stream, const WalletDescriptor &val) {
5360+ FfiConverterString::write(stream, val.record_id);
5361+ FfiConverterTypeTonAddressString::write(stream, val.address);
5362+ FfiConverterBytes::write(stream, val.public_key);
5363+ FfiConverterNetwork::write(stream, val.network);
5364+ FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
5365+}
5366+
5367+uint64_t FfiConverterTypeWalletDescriptor::allocation_size(const WalletDescriptor &val) {
5368+
5369+ return
5370+ FfiConverterString::allocation_size(val.record_id) +
5371+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
5372+ FfiConverterBytes::allocation_size(val.public_key) +
5373+ FfiConverterNetwork::allocation_size(val.network) +
5374+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref);
5375+
5376+}
5377+
5378+
5379+WalletSnapshot FfiConverterTypeWalletSnapshot::lift(RustBuffer buf) {
5380+ auto stream = RustStream(&buf);
5381+ auto ret = FfiConverterTypeWalletSnapshot::read(stream);
5382+
5383+ rustbuffer_free(buf);
5384+
5385+ return std::move(ret);
5386+}
5387+
5388+RustBuffer FfiConverterTypeWalletSnapshot::lower(const WalletSnapshot &val) {
5389+ auto buf = rustbuffer_alloc(allocation_size(val));
5390+ auto stream = RustStream(&buf);
5391+
5392+ FfiConverterTypeWalletSnapshot::write(stream, val);
5393+
5394+ return std::move(buf);
5395+}
5396+
5397+WalletSnapshot FfiConverterTypeWalletSnapshot::read(RustStream &stream) {
5398+ return {
5399+ FfiConverterUInt64::read(stream),
5400+ FfiConverterTypeNonEmptyString::read(stream),
5401+ FfiConverterTypeTonAddressString::read(stream),
5402+ FfiConverterNetwork::read(stream),
5403+ FfiConverterOptionalTypeAccountSnapshot::read(stream),
5404+ FfiConverterTypeResourceState::read(stream),
5405+ FfiConverterTypeActivityList::read(stream),
5406+ FfiConverterOptionalTypeActivityCursor::read(stream),
5407+ FfiConverterTypeNftList::read(stream),
5408+ FfiConverterTypeSendSnapshot::read(stream)
5409+ };
5410+}
5411+
5412+void FfiConverterTypeWalletSnapshot::write(RustStream &stream, const WalletSnapshot &val) {
5413+ FfiConverterUInt64::write(stream, val.revision);
5414+ FfiConverterTypeNonEmptyString::write(stream, val.record_id);
5415+ FfiConverterTypeTonAddressString::write(stream, val.address);
5416+ FfiConverterNetwork::write(stream, val.network);
5417+ FfiConverterOptionalTypeAccountSnapshot::write(stream, val.account);
5418+ FfiConverterTypeResourceState::write(stream, val.account_resource);
5419+ FfiConverterTypeActivityList::write(stream, val.activity);
5420+ FfiConverterOptionalTypeActivityCursor::write(stream, val.activity_cursor);
5421+ FfiConverterTypeNftList::write(stream, val.nfts);
5422+ FfiConverterTypeSendSnapshot::write(stream, val.send);
5423+}
5424+
5425+uint64_t FfiConverterTypeWalletSnapshot::allocation_size(const WalletSnapshot &val) {
5426+
5427+ return
5428+ FfiConverterUInt64::allocation_size(val.revision) +
5429+ FfiConverterTypeNonEmptyString::allocation_size(val.record_id) +
5430+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
5431+ FfiConverterNetwork::allocation_size(val.network) +
5432+ FfiConverterOptionalTypeAccountSnapshot::allocation_size(val.account) +
5433+ FfiConverterTypeResourceState::allocation_size(val.account_resource) +
5434+ FfiConverterTypeActivityList::allocation_size(val.activity) +
5435+ FfiConverterOptionalTypeActivityCursor::allocation_size(val.activity_cursor) +
5436+ FfiConverterTypeNftList::allocation_size(val.nfts) +
5437+ FfiConverterTypeSendSnapshot::allocation_size(val.send);
5438+
5439+}
5440+
5441+
5442+WalletUpdate FfiConverterTypeWalletUpdate::lift(RustBuffer buf) {
5443+ auto stream = RustStream(&buf);
5444+ auto ret = FfiConverterTypeWalletUpdate::read(stream);
5445+
5446+ rustbuffer_free(buf);
5447+
5448+ return std::move(ret);
5449+}
5450+
5451+RustBuffer FfiConverterTypeWalletUpdate::lower(const WalletUpdate &val) {
5452+ auto buf = rustbuffer_alloc(allocation_size(val));
5453+ auto stream = RustStream(&buf);
5454+
5455+ FfiConverterTypeWalletUpdate::write(stream, val);
5456+
5457+ return std::move(buf);
5458+}
5459+
5460+WalletUpdate FfiConverterTypeWalletUpdate::read(RustStream &stream) {
5461+ return {
5462+ FfiConverterWalletOperationOutcome::read(stream),
5463+ FfiConverterUInt64::read(stream),
5464+ FfiConverterUInt64::read(stream),
5465+ FfiConverterTypeWalletSnapshot::read(stream)
5466+ };
5467+}
5468+
5469+void FfiConverterTypeWalletUpdate::write(RustStream &stream, const WalletUpdate &val) {
5470+ FfiConverterWalletOperationOutcome::write(stream, val.outcome);
5471+ FfiConverterUInt64::write(stream, val.activity_items_added);
5472+ FfiConverterUInt64::write(stream, val.nft_items_added);
5473+ FfiConverterTypeWalletSnapshot::write(stream, val.snapshot);
5474+}
5475+
5476+uint64_t FfiConverterTypeWalletUpdate::allocation_size(const WalletUpdate &val) {
5477+
5478+ return
5479+ FfiConverterWalletOperationOutcome::allocation_size(val.outcome) +
5480+ FfiConverterUInt64::allocation_size(val.activity_items_added) +
5481+ FfiConverterUInt64::allocation_size(val.nft_items_added) +
5482+ FfiConverterTypeWalletSnapshot::allocation_size(val.snapshot);
5483+
5484+}
5485+
5486+
5487+AccountStatus FfiConverterAccountStatus::lift(RustBuffer buf) {
5488+ auto stream = RustStream(&buf);
5489+ auto ret = FfiConverterAccountStatus::read(stream);
5490+
5491+ rustbuffer_free(buf);
5492+
5493+ return std::move(ret);
5494+}
5495+
5496+RustBuffer FfiConverterAccountStatus::lower(const AccountStatus &val) {
5497+ auto buf = rustbuffer_alloc(FfiConverterAccountStatus::allocation_size(val));
5498+ auto stream = RustStream(&buf);
5499+
5500+ FfiConverterAccountStatus::write(stream, val);
5501+
5502+ return std::move(buf);
5503+}
5504+
5505+AccountStatus FfiConverterAccountStatus::read(RustStream &stream) {
5506+ int32_t variant;
5507+ stream >> variant;
5508+
5509+ switch (variant) {
5510+
5511+ case 1:
5512+ return AccountStatus::kNonexistent;
5513+
5514+ case 2:
5515+ return AccountStatus::kUninitialized;
5516+
5517+ case 3:
5518+ return AccountStatus::kActive;
5519+
5520+ case 4:
5521+ return AccountStatus::kFrozen;
5522+
5523+ case 5:
5524+ return AccountStatus::kUnknown;
5525+
5526+ default:
5527+ throw std::runtime_error("No matching AccountStatus variant");
5528+ }
5529+}
5530+
5531+void FfiConverterAccountStatus::write(RustStream &stream, const AccountStatus &val) {
5532+ switch (val) {
5533+
5534+ case AccountStatus::kNonexistent:
5535+ stream << static_cast<int32_t>(1);
5536+ break;
5537+
5538+ case AccountStatus::kUninitialized:
5539+ stream << static_cast<int32_t>(2);
5540+ break;
5541+
5542+ case AccountStatus::kActive:
5543+ stream << static_cast<int32_t>(3);
5544+ break;
5545+
5546+ case AccountStatus::kFrozen:
5547+ stream << static_cast<int32_t>(4);
5548+ break;
5549+
5550+ case AccountStatus::kUnknown:
5551+ stream << static_cast<int32_t>(5);
5552+ break;
5553+
5554+ default:
5555+ throw std::runtime_error("No matching AccountStatus variant");
5556+ }
5557+}
5558+
5559+uint64_t FfiConverterAccountStatus::allocation_size(const AccountStatus &) {
5560+ return static_cast<uint64_t>(sizeof(int32_t));
5561+}
5562+
5563+
5564+ActivityDirection FfiConverterActivityDirection::lift(RustBuffer buf) {
5565+ auto stream = RustStream(&buf);
5566+ auto ret = FfiConverterActivityDirection::read(stream);
5567+
5568+ rustbuffer_free(buf);
5569+
5570+ return std::move(ret);
5571+}
5572+
5573+RustBuffer FfiConverterActivityDirection::lower(const ActivityDirection &val) {
5574+ auto buf = rustbuffer_alloc(FfiConverterActivityDirection::allocation_size(val));
5575+ auto stream = RustStream(&buf);
5576+
5577+ FfiConverterActivityDirection::write(stream, val);
5578+
5579+ return std::move(buf);
5580+}
5581+
5582+ActivityDirection FfiConverterActivityDirection::read(RustStream &stream) {
5583+ int32_t variant;
5584+ stream >> variant;
5585+
5586+ switch (variant) {
5587+
5588+ case 1:
5589+ return ActivityDirection::kSent;
5590+
5591+ case 2:
5592+ return ActivityDirection::kReceived;
5593+
5594+ default:
5595+ throw std::runtime_error("No matching ActivityDirection variant");
5596+ }
5597+}
5598+
5599+void FfiConverterActivityDirection::write(RustStream &stream, const ActivityDirection &val) {
5600+ switch (val) {
5601+
5602+ case ActivityDirection::kSent:
5603+ stream << static_cast<int32_t>(1);
5604+ break;
5605+
5606+ case ActivityDirection::kReceived:
5607+ stream << static_cast<int32_t>(2);
5608+ break;
5609+
5610+ default:
5611+ throw std::runtime_error("No matching ActivityDirection variant");
5612+ }
5613+}
5614+
5615+uint64_t FfiConverterActivityDirection::allocation_size(const ActivityDirection &) {
5616+ return static_cast<uint64_t>(sizeof(int32_t));
5617+}
5618+
5619+
5620+ActivityStatus FfiConverterActivityStatus::lift(RustBuffer buf) {
5621+ auto stream = RustStream(&buf);
5622+ auto ret = FfiConverterActivityStatus::read(stream);
5623+
5624+ rustbuffer_free(buf);
5625+
5626+ return std::move(ret);
5627+}
5628+
5629+RustBuffer FfiConverterActivityStatus::lower(const ActivityStatus &val) {
5630+ auto buf = rustbuffer_alloc(FfiConverterActivityStatus::allocation_size(val));
5631+ auto stream = RustStream(&buf);
5632+
5633+ FfiConverterActivityStatus::write(stream, val);
5634+
5635+ return std::move(buf);
5636+}
5637+
5638+ActivityStatus FfiConverterActivityStatus::read(RustStream &stream) {
5639+ int32_t variant;
5640+ stream >> variant;
5641+
5642+ switch (variant) {
5643+
5644+ case 1:
5645+ return ActivityStatus::kSuccess;
5646+
5647+ case 2:
5648+ return ActivityStatus::kFailed;
5649+
5650+ case 3:
5651+ return ActivityStatus::kBounced;
5652+
5653+ default:
5654+ throw std::runtime_error("No matching ActivityStatus variant");
5655+ }
5656+}
5657+
5658+void FfiConverterActivityStatus::write(RustStream &stream, const ActivityStatus &val) {
5659+ switch (val) {
5660+
5661+ case ActivityStatus::kSuccess:
5662+ stream << static_cast<int32_t>(1);
5663+ break;
5664+
5665+ case ActivityStatus::kFailed:
5666+ stream << static_cast<int32_t>(2);
5667+ break;
5668+
5669+ case ActivityStatus::kBounced:
5670+ stream << static_cast<int32_t>(3);
5671+ break;
5672+
5673+ default:
5674+ throw std::runtime_error("No matching ActivityStatus variant");
5675+ }
5676+}
5677+
5678+uint64_t FfiConverterActivityStatus::allocation_size(const ActivityStatus &) {
5679+ return static_cast<uint64_t>(sizeof(int32_t));
5680+}
5681+
5682+
5683+ErrorCategory FfiConverterErrorCategory::lift(RustBuffer buf) {
5684+ auto stream = RustStream(&buf);
5685+ auto ret = FfiConverterErrorCategory::read(stream);
5686+
5687+ rustbuffer_free(buf);
5688+
5689+ return std::move(ret);
5690+}
5691+
5692+RustBuffer FfiConverterErrorCategory::lower(const ErrorCategory &val) {
5693+ auto buf = rustbuffer_alloc(FfiConverterErrorCategory::allocation_size(val));
5694+ auto stream = RustStream(&buf);
5695+
5696+ FfiConverterErrorCategory::write(stream, val);
5697+
5698+ return std::move(buf);
5699+}
5700+
5701+ErrorCategory FfiConverterErrorCategory::read(RustStream &stream) {
5702+ int32_t variant;
5703+ stream >> variant;
5704+
5705+ switch (variant) {
5706+
5707+ case 1:
5708+ return ErrorCategory::kTransport;
5709+
5710+ case 2:
5711+ return ErrorCategory::kProviderProtocol;
5712+
5713+ case 3:
5714+ return ErrorCategory::kRateLimit;
5715+
5716+ case 4:
5717+ return ErrorCategory::kCancellation;
5718+
5719+ case 5:
5720+ return ErrorCategory::kHostPolicy;
5721+
5722+ default:
5723+ throw std::runtime_error("No matching ErrorCategory variant");
5724+ }
5725+}
5726+
5727+void FfiConverterErrorCategory::write(RustStream &stream, const ErrorCategory &val) {
5728+ switch (val) {
5729+
5730+ case ErrorCategory::kTransport:
5731+ stream << static_cast<int32_t>(1);
5732+ break;
5733+
5734+ case ErrorCategory::kProviderProtocol:
5735+ stream << static_cast<int32_t>(2);
5736+ break;
5737+
5738+ case ErrorCategory::kRateLimit:
5739+ stream << static_cast<int32_t>(3);
5740+ break;
5741+
5742+ case ErrorCategory::kCancellation:
5743+ stream << static_cast<int32_t>(4);
5744+ break;
5745+
5746+ case ErrorCategory::kHostPolicy:
5747+ stream << static_cast<int32_t>(5);
5748+ break;
5749+
5750+ default:
5751+ throw std::runtime_error("No matching ErrorCategory variant");
5752+ }
5753+}
5754+
5755+uint64_t FfiConverterErrorCategory::allocation_size(const ErrorCategory &) {
5756+ return static_cast<uint64_t>(sizeof(int32_t));
5757+}
5758+
5759+
5760+ErrorCode FfiConverterErrorCode::lift(RustBuffer buf) {
5761+ auto stream = RustStream(&buf);
5762+ auto ret = FfiConverterErrorCode::read(stream);
5763+
5764+ rustbuffer_free(buf);
5765+
5766+ return std::move(ret);
5767+}
5768+
5769+RustBuffer FfiConverterErrorCode::lower(const ErrorCode &val) {
5770+ auto buf = rustbuffer_alloc(FfiConverterErrorCode::allocation_size(val));
5771+ auto stream = RustStream(&buf);
5772+
5773+ FfiConverterErrorCode::write(stream, val);
5774+
5775+ return std::move(buf);
5776+}
5777+
5778+ErrorCode FfiConverterErrorCode::read(RustStream &stream) {
5779+ int32_t variant;
5780+ stream >> variant;
5781+
5782+ switch (variant) {
5783+
5784+ case 1:
5785+ return ErrorCode::kInvalidProviderResponse;
5786+
5787+ case 2:
5788+ return ErrorCode::kHttpRejected;
5789+
5790+ case 3:
5791+ return ErrorCode::kRateLimited;
5792+
5793+ case 4:
5794+ return ErrorCode::kTransportFailed;
5795+
5796+ case 5:
5797+ return ErrorCode::kHostCancelled;
5798+
5799+ case 6:
5800+ return ErrorCode::kResponseTooLarge;
5801+
5802+ case 7:
5803+ return ErrorCode::kHostPolicyViolation;
5804+
5805+ default:
5806+ throw std::runtime_error("No matching ErrorCode variant");
5807+ }
5808+}
5809+
5810+void FfiConverterErrorCode::write(RustStream &stream, const ErrorCode &val) {
5811+ switch (val) {
5812+
5813+ case ErrorCode::kInvalidProviderResponse:
5814+ stream << static_cast<int32_t>(1);
5815+ break;
5816+
5817+ case ErrorCode::kHttpRejected:
5818+ stream << static_cast<int32_t>(2);
5819+ break;
5820+
5821+ case ErrorCode::kRateLimited:
5822+ stream << static_cast<int32_t>(3);
5823+ break;
5824+
5825+ case ErrorCode::kTransportFailed:
5826+ stream << static_cast<int32_t>(4);
5827+ break;
5828+
5829+ case ErrorCode::kHostCancelled:
5830+ stream << static_cast<int32_t>(5);
5831+ break;
5832+
5833+ case ErrorCode::kResponseTooLarge:
5834+ stream << static_cast<int32_t>(6);
5835+ break;
5836+
5837+ case ErrorCode::kHostPolicyViolation:
5838+ stream << static_cast<int32_t>(7);
5839+ break;
5840+
5841+ default:
5842+ throw std::runtime_error("No matching ErrorCode variant");
5843+ }
5844+}
5845+
5846+uint64_t FfiConverterErrorCode::allocation_size(const ErrorCode &) {
5847+ return static_cast<uint64_t>(sizeof(int32_t));
5848+}
5849+
5850+
5851+std::shared_ptr<HttpHostError> FfiConverterHttpHostError::lift(RustBuffer buf) {
5852+ auto stream = RustStream(&buf);
5853+ auto ret = FfiConverterHttpHostError::read(stream);
5854+
5855+ rustbuffer_free(buf);
5856+
5857+ return ret;
5858+}
5859+
5860+RustBuffer FfiConverterHttpHostError::lower(const HttpHostError &val) {
5861+ auto buf = rustbuffer_alloc(allocation_size(val));
5862+ auto stream = RustStream(&buf);
5863+
5864+ FfiConverterHttpHostError::write(stream, val);
5865+
5866+ return std::move(buf);
5867+}
5868+
5869+std::shared_ptr<HttpHostError> FfiConverterHttpHostError::read(RustStream &stream) {
5870+ int32_t v;
5871+ stream >> v;
5872+
5873+ switch (v) {
5874+ case 1:
5875+ {
5876+ http_host_error::Failed var("HttpHostError::Failed");
5877+ var.kind = FfiConverterHttpHostErrorKind::read(stream);
5878+ var.diagnostic = FfiConverterString::read(stream);
5879+ auto what_arg = FfiConverterString::lift(
5880+ rust_call(
5881+ uniffi_wallet_engine_fn_method_httphosterror_uniffi_trait_display,
5882+ nullptr,
5883+ FfiConverterHttpHostError::lower(var)
5884+ )
5885+ );
5886+ auto ret = std::make_shared<http_host_error::Failed>(what_arg);
5887+ ret->kind = std::move(var.kind);
5888+ ret->diagnostic = std::move(var.diagnostic);
5889+ return ret;
5890+ }
5891+ default:
5892+ throw std::runtime_error("Unexpected error variant");
5893+ }
5894+}
5895+
5896+void FfiConverterHttpHostError::write(RustStream &stream, const HttpHostError &val) {
5897+ stream << val.get_variant_idx();
5898+ switch (val.get_variant_idx()) {
5899+ case 1:
5900+ {
5901+ auto var = static_cast<const http_host_error::Failed&>(val);
5902+ FfiConverterHttpHostErrorKind::write(stream, var.kind);
5903+ FfiConverterString::write(stream, var.diagnostic);
5904+ break;
5905+ }
5906+ }
5907+}
5908+
5909+uint64_t FfiConverterHttpHostError::allocation_size(const HttpHostError &val) {
5910+ switch (val.get_variant_idx()) {
5911+ case 1:
5912+ {
5913+ auto var = static_cast<const http_host_error::Failed&>(val);
5914+ return static_cast<uint64_t>(sizeof(int32_t)
5915+ + FfiConverterHttpHostErrorKind::allocation_size(var.kind)
5916+ + FfiConverterString::allocation_size(var.diagnostic));
5917+ }
5918+ default:
5919+ throw std::runtime_error("Unexpected error variant");
5920+ }
5921+}
5922+
5923+
5924+HttpHostErrorKind FfiConverterHttpHostErrorKind::lift(RustBuffer buf) {
5925+ auto stream = RustStream(&buf);
5926+ auto ret = FfiConverterHttpHostErrorKind::read(stream);
5927+
5928+ rustbuffer_free(buf);
5929+
5930+ return std::move(ret);
5931+}
5932+
5933+RustBuffer FfiConverterHttpHostErrorKind::lower(const HttpHostErrorKind &val) {
5934+ auto buf = rustbuffer_alloc(FfiConverterHttpHostErrorKind::allocation_size(val));
5935+ auto stream = RustStream(&buf);
5936+
5937+ FfiConverterHttpHostErrorKind::write(stream, val);
5938+
5939+ return std::move(buf);
5940+}
5941+
5942+HttpHostErrorKind FfiConverterHttpHostErrorKind::read(RustStream &stream) {
5943+ int32_t variant;
5944+ stream >> variant;
5945+
5946+ switch (variant) {
5947+
5948+ case 1:
5949+ return HttpHostErrorKind::kOffline;
5950+
5951+ case 2:
5952+ return HttpHostErrorKind::kTimeout;
5953+
5954+ case 3:
5955+ return HttpHostErrorKind::kConnectionLost;
5956+
5957+ case 4:
5958+ return HttpHostErrorKind::kDns;
5959+
5960+ case 5:
5961+ return HttpHostErrorKind::kTls;
5962+
5963+ case 6:
5964+ return HttpHostErrorKind::kPolicyViolation;
5965+
5966+ case 7:
5967+ return HttpHostErrorKind::kResponseTooLarge;
5968+
5969+ case 8:
5970+ return HttpHostErrorKind::kCancelled;
5971+
5972+ case 9:
5973+ return HttpHostErrorKind::kOther;
5974+
5975+ default:
5976+ throw std::runtime_error("No matching HttpHostErrorKind variant");
5977+ }
5978+}
5979+
5980+void FfiConverterHttpHostErrorKind::write(RustStream &stream, const HttpHostErrorKind &val) {
5981+ switch (val) {
5982+
5983+ case HttpHostErrorKind::kOffline:
5984+ stream << static_cast<int32_t>(1);
5985+ break;
5986+
5987+ case HttpHostErrorKind::kTimeout:
5988+ stream << static_cast<int32_t>(2);
5989+ break;
5990+
5991+ case HttpHostErrorKind::kConnectionLost:
5992+ stream << static_cast<int32_t>(3);
5993+ break;
5994+
5995+ case HttpHostErrorKind::kDns:
5996+ stream << static_cast<int32_t>(4);
5997+ break;
5998+
5999+ case HttpHostErrorKind::kTls:
6000+ stream << static_cast<int32_t>(5);
6001+ break;
6002+
6003+ case HttpHostErrorKind::kPolicyViolation:
6004+ stream << static_cast<int32_t>(6);
6005+ break;
6006+
6007+ case HttpHostErrorKind::kResponseTooLarge:
6008+ stream << static_cast<int32_t>(7);
6009+ break;
6010+
6011+ case HttpHostErrorKind::kCancelled:
6012+ stream << static_cast<int32_t>(8);
6013+ break;
6014+
6015+ case HttpHostErrorKind::kOther:
6016+ stream << static_cast<int32_t>(9);
6017+ break;
6018+
6019+ default:
6020+ throw std::runtime_error("No matching HttpHostErrorKind variant");
6021+ }
6022+}
6023+
6024+uint64_t FfiConverterHttpHostErrorKind::allocation_size(const HttpHostErrorKind &) {
6025+ return static_cast<uint64_t>(sizeof(int32_t));
6026+}
6027+
6028+
6029+HttpMethod FfiConverterHttpMethod::lift(RustBuffer buf) {
6030+ auto stream = RustStream(&buf);
6031+ auto ret = FfiConverterHttpMethod::read(stream);
6032+
6033+ rustbuffer_free(buf);
6034+
6035+ return std::move(ret);
6036+}
6037+
6038+RustBuffer FfiConverterHttpMethod::lower(const HttpMethod &val) {
6039+ auto buf = rustbuffer_alloc(FfiConverterHttpMethod::allocation_size(val));
6040+ auto stream = RustStream(&buf);
6041+
6042+ FfiConverterHttpMethod::write(stream, val);
6043+
6044+ return std::move(buf);
6045+}
6046+
6047+HttpMethod FfiConverterHttpMethod::read(RustStream &stream) {
6048+ int32_t variant;
6049+ stream >> variant;
6050+
6051+ switch (variant) {
6052+
6053+ case 1:
6054+ return HttpMethod::kGet;
6055+
6056+ case 2:
6057+ return HttpMethod::kPost;
6058+
6059+ default:
6060+ throw std::runtime_error("No matching HttpMethod variant");
6061+ }
6062+}
6063+
6064+void FfiConverterHttpMethod::write(RustStream &stream, const HttpMethod &val) {
6065+ switch (val) {
6066+
6067+ case HttpMethod::kGet:
6068+ stream << static_cast<int32_t>(1);
6069+ break;
6070+
6071+ case HttpMethod::kPost:
6072+ stream << static_cast<int32_t>(2);
6073+ break;
6074+
6075+ default:
6076+ throw std::runtime_error("No matching HttpMethod variant");
6077+ }
6078+}
6079+
6080+uint64_t FfiConverterHttpMethod::allocation_size(const HttpMethod &) {
6081+ return static_cast<uint64_t>(sizeof(int32_t));
6082+}
6083+
6084+
6085+std::shared_ptr<JournalHostError> FfiConverterJournalHostError::lift(RustBuffer buf) {
6086+ auto stream = RustStream(&buf);
6087+ auto ret = FfiConverterJournalHostError::read(stream);
6088+
6089+ rustbuffer_free(buf);
6090+
6091+ return ret;
6092+}
6093+
6094+RustBuffer FfiConverterJournalHostError::lower(const JournalHostError &val) {
6095+ auto buf = rustbuffer_alloc(allocation_size(val));
6096+ auto stream = RustStream(&buf);
6097+
6098+ FfiConverterJournalHostError::write(stream, val);
6099+
6100+ return std::move(buf);
6101+}
6102+
6103+std::shared_ptr<JournalHostError> FfiConverterJournalHostError::read(RustStream &stream) {
6104+ int32_t v;
6105+ stream >> v;
6106+
6107+ switch (v) {
6108+ case 1:
6109+ {
6110+ journal_host_error::Failed var("JournalHostError::Failed");
6111+ var.kind = FfiConverterJournalHostErrorKind::read(stream);
6112+ var.diagnostic = FfiConverterString::read(stream);
6113+ auto what_arg = FfiConverterString::lift(
6114+ rust_call(
6115+ uniffi_wallet_engine_fn_method_journalhosterror_uniffi_trait_display,
6116+ nullptr,
6117+ FfiConverterJournalHostError::lower(var)
6118+ )
6119+ );
6120+ auto ret = std::make_shared<journal_host_error::Failed>(what_arg);
6121+ ret->kind = std::move(var.kind);
6122+ ret->diagnostic = std::move(var.diagnostic);
6123+ return ret;
6124+ }
6125+ default:
6126+ throw std::runtime_error("Unexpected error variant");
6127+ }
6128+}
6129+
6130+void FfiConverterJournalHostError::write(RustStream &stream, const JournalHostError &val) {
6131+ stream << val.get_variant_idx();
6132+ switch (val.get_variant_idx()) {
6133+ case 1:
6134+ {
6135+ auto var = static_cast<const journal_host_error::Failed&>(val);
6136+ FfiConverterJournalHostErrorKind::write(stream, var.kind);
6137+ FfiConverterString::write(stream, var.diagnostic);
6138+ break;
6139+ }
6140+ }
6141+}
6142+
6143+uint64_t FfiConverterJournalHostError::allocation_size(const JournalHostError &val) {
6144+ switch (val.get_variant_idx()) {
6145+ case 1:
6146+ {
6147+ auto var = static_cast<const journal_host_error::Failed&>(val);
6148+ return static_cast<uint64_t>(sizeof(int32_t)
6149+ + FfiConverterJournalHostErrorKind::allocation_size(var.kind)
6150+ + FfiConverterString::allocation_size(var.diagnostic));
6151+ }
6152+ default:
6153+ throw std::runtime_error("Unexpected error variant");
6154+ }
6155+}
6156+
6157+
6158+JournalHostErrorKind FfiConverterJournalHostErrorKind::lift(RustBuffer buf) {
6159+ auto stream = RustStream(&buf);
6160+ auto ret = FfiConverterJournalHostErrorKind::read(stream);
6161+
6162+ rustbuffer_free(buf);
6163+
6164+ return std::move(ret);
6165+}
6166+
6167+RustBuffer FfiConverterJournalHostErrorKind::lower(const JournalHostErrorKind &val) {
6168+ auto buf = rustbuffer_alloc(FfiConverterJournalHostErrorKind::allocation_size(val));
6169+ auto stream = RustStream(&buf);
6170+
6171+ FfiConverterJournalHostErrorKind::write(stream, val);
6172+
6173+ return std::move(buf);
6174+}
6175+
6176+JournalHostErrorKind FfiConverterJournalHostErrorKind::read(RustStream &stream) {
6177+ int32_t variant;
6178+ stream >> variant;
6179+
6180+ switch (variant) {
6181+
6182+ case 1:
6183+ return JournalHostErrorKind::kUnavailable;
6184+
6185+ case 2:
6186+ return JournalHostErrorKind::kCorruptData;
6187+
6188+ case 3:
6189+ return JournalHostErrorKind::kCancelled;
6190+
6191+ case 4:
6192+ return JournalHostErrorKind::kOther;
6193+
6194+ default:
6195+ throw std::runtime_error("No matching JournalHostErrorKind variant");
6196+ }
6197+}
6198+
6199+void FfiConverterJournalHostErrorKind::write(RustStream &stream, const JournalHostErrorKind &val) {
6200+ switch (val) {
6201+
6202+ case JournalHostErrorKind::kUnavailable:
6203+ stream << static_cast<int32_t>(1);
6204+ break;
6205+
6206+ case JournalHostErrorKind::kCorruptData:
6207+ stream << static_cast<int32_t>(2);
6208+ break;
6209+
6210+ case JournalHostErrorKind::kCancelled:
6211+ stream << static_cast<int32_t>(3);
6212+ break;
6213+
6214+ case JournalHostErrorKind::kOther:
6215+ stream << static_cast<int32_t>(4);
6216+ break;
6217+
6218+ default:
6219+ throw std::runtime_error("No matching JournalHostErrorKind variant");
6220+ }
6221+}
6222+
6223+uint64_t FfiConverterJournalHostErrorKind::allocation_size(const JournalHostErrorKind &) {
6224+ return static_cast<uint64_t>(sizeof(int32_t));
6225+}
6226+
6227+
6228+KeyRotationMessageKind FfiConverterKeyRotationMessageKind::lift(RustBuffer buf) {
6229+ auto stream = RustStream(&buf);
6230+ auto ret = FfiConverterKeyRotationMessageKind::read(stream);
6231+
6232+ rustbuffer_free(buf);
6233+
6234+ return std::move(ret);
6235+}
6236+
6237+RustBuffer FfiConverterKeyRotationMessageKind::lower(const KeyRotationMessageKind &val) {
6238+ auto buf = rustbuffer_alloc(FfiConverterKeyRotationMessageKind::allocation_size(val));
6239+ auto stream = RustStream(&buf);
6240+
6241+ FfiConverterKeyRotationMessageKind::write(stream, val);
6242+
6243+ return std::move(buf);
6244+}
6245+
6246+KeyRotationMessageKind FfiConverterKeyRotationMessageKind::read(RustStream &stream) {
6247+ int32_t variant;
6248+ stream >> variant;
6249+
6250+ switch (variant) {
6251+
6252+ case 1:
6253+ return KeyRotationMessageKind::kExternal;
6254+
6255+ case 2:
6256+ return KeyRotationMessageKind::kInternal;
6257+
6258+ default:
6259+ throw std::runtime_error("No matching KeyRotationMessageKind variant");
6260+ }
6261+}
6262+
6263+void FfiConverterKeyRotationMessageKind::write(RustStream &stream, const KeyRotationMessageKind &val) {
6264+ switch (val) {
6265+
6266+ case KeyRotationMessageKind::kExternal:
6267+ stream << static_cast<int32_t>(1);
6268+ break;
6269+
6270+ case KeyRotationMessageKind::kInternal:
6271+ stream << static_cast<int32_t>(2);
6272+ break;
6273+
6274+ default:
6275+ throw std::runtime_error("No matching KeyRotationMessageKind variant");
6276+ }
6277+}
6278+
6279+uint64_t FfiConverterKeyRotationMessageKind::allocation_size(const KeyRotationMessageKind &) {
6280+ return static_cast<uint64_t>(sizeof(int32_t));
6281+}
6282+
6283+
6284+MnemonicScheme FfiConverterMnemonicScheme::lift(RustBuffer buf) {
6285+ auto stream = RustStream(&buf);
6286+ auto ret = FfiConverterMnemonicScheme::read(stream);
6287+
6288+ rustbuffer_free(buf);
6289+
6290+ return std::move(ret);
6291+}
6292+
6293+RustBuffer FfiConverterMnemonicScheme::lower(const MnemonicScheme &val) {
6294+ auto buf = rustbuffer_alloc(FfiConverterMnemonicScheme::allocation_size(val));
6295+ auto stream = RustStream(&buf);
6296+
6297+ FfiConverterMnemonicScheme::write(stream, val);
6298+
6299+ return std::move(buf);
6300+}
6301+
6302+MnemonicScheme FfiConverterMnemonicScheme::read(RustStream &stream) {
6303+ int32_t variant;
6304+ stream >> variant;
6305+
6306+ switch (variant) {
6307+
6308+ case 1:
6309+ return MnemonicScheme::kRotation;
6310+
6311+ case 2:
6312+ return MnemonicScheme::kTon;
6313+
6314+ case 3:
6315+ return MnemonicScheme::kBip39;
6316+
6317+ default:
6318+ throw std::runtime_error("No matching MnemonicScheme variant");
6319+ }
6320+}
6321+
6322+void FfiConverterMnemonicScheme::write(RustStream &stream, const MnemonicScheme &val) {
6323+ switch (val) {
6324+
6325+ case MnemonicScheme::kRotation:
6326+ stream << static_cast<int32_t>(1);
6327+ break;
6328+
6329+ case MnemonicScheme::kTon:
6330+ stream << static_cast<int32_t>(2);
6331+ break;
6332+
6333+ case MnemonicScheme::kBip39:
6334+ stream << static_cast<int32_t>(3);
6335+ break;
6336+
6337+ default:
6338+ throw std::runtime_error("No matching MnemonicScheme variant");
6339+ }
6340+}
6341+
6342+uint64_t FfiConverterMnemonicScheme::allocation_size(const MnemonicScheme &) {
6343+ return static_cast<uint64_t>(sizeof(int32_t));
6344+}
6345+
6346+
6347+Network FfiConverterNetwork::lift(RustBuffer buf) {
6348+ auto stream = RustStream(&buf);
6349+ auto ret = FfiConverterNetwork::read(stream);
6350+
6351+ rustbuffer_free(buf);
6352+
6353+ return std::move(ret);
6354+}
6355+
6356+RustBuffer FfiConverterNetwork::lower(const Network &val) {
6357+ auto buf = rustbuffer_alloc(FfiConverterNetwork::allocation_size(val));
6358+ auto stream = RustStream(&buf);
6359+
6360+ FfiConverterNetwork::write(stream, val);
6361+
6362+ return std::move(buf);
6363+}
6364+
6365+Network FfiConverterNetwork::read(RustStream &stream) {
6366+ int32_t variant;
6367+ stream >> variant;
6368+
6369+ switch (variant) {
6370+
6371+ case 1:
6372+ return Network::kMainnet;
6373+
6374+ case 2:
6375+ return Network::kTestnet;
6376+
6377+ default:
6378+ throw std::runtime_error("No matching Network variant");
6379+ }
6380+}
6381+
6382+void FfiConverterNetwork::write(RustStream &stream, const Network &val) {
6383+ switch (val) {
6384+
6385+ case Network::kMainnet:
6386+ stream << static_cast<int32_t>(1);
6387+ break;
6388+
6389+ case Network::kTestnet:
6390+ stream << static_cast<int32_t>(2);
6391+ break;
6392+
6393+ default:
6394+ throw std::runtime_error("No matching Network variant");
6395+ }
6396+}
6397+
6398+uint64_t FfiConverterNetwork::allocation_size(const Network &) {
6399+ return static_cast<uint64_t>(sizeof(int32_t));
6400+}
6401+
6402+
6403+NftTransferFunding FfiConverterNftTransferFunding::lift(RustBuffer buf) {
6404+ auto stream = RustStream(&buf);
6405+ auto ret = FfiConverterNftTransferFunding::read(stream);
6406+
6407+ rustbuffer_free(buf);
6408+
6409+ return std::move(ret);
6410+}
6411+
6412+RustBuffer FfiConverterNftTransferFunding::lower(const NftTransferFunding &val) {
6413+ auto buf = rustbuffer_alloc(FfiConverterNftTransferFunding::allocation_size(val));
6414+ auto stream = RustStream(&buf);
6415+
6416+ FfiConverterNftTransferFunding::write(stream, val);
6417+
6418+ return std::move(buf);
6419+}
6420+
6421+NftTransferFunding FfiConverterNftTransferFunding::read(RustStream &stream) {
6422+ int32_t variant_id;
6423+ stream >> variant_id;
6424+
6425+ switch (variant_id) {
6426+
6427+ case 1:
6428+ return NftTransferFunding::kExact {
6429+ .attached_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
6430+ .forward_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
6431+ };
6432+
6433+ default:
6434+ throw std::runtime_error("No matching NftTransferFunding variant");
6435+ }
6436+}
6437+
6438+void FfiConverterNftTransferFunding::write(RustStream &stream, const NftTransferFunding &val) {
6439+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
6440+
6441+ stream << variant_id;
6442+
6443+ std::visit([&](auto &&arg) {
6444+ using T = std::decay_t<decltype(arg)>;
6445+ if constexpr (std::is_same_v<T, NftTransferFunding::kExact>) {
6446+ FfiConverterTypeUnsignedDecimalString::write(stream, arg.attached_nanograms);
6447+ FfiConverterTypeUnsignedDecimalString::write(stream, arg.forward_nanograms);
6448+ }
6449+ else {
6450+ static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
6451+ }
6452+ }, val.variant);
6453+}
6454+
6455+uint64_t FfiConverterNftTransferFunding::allocation_size(const NftTransferFunding &val) {
6456+ uint64_t size = sizeof(int32_t);
6457+
6458+ size += std::visit([&](auto &&arg) {
6459+ using T = std::decay_t<decltype(arg)>;
6460+ if constexpr (std::is_same_v<T, NftTransferFunding::kExact>) {
6461+ uint64_t size = 0;
6462+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.attached_nanograms);
6463+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.forward_nanograms);
6464+ return size;
6465+ }
6466+ else {
6467+ static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
6468+ }
6469+ }, val.variant);
6470+
6471+ return size;
6472+}
6473+
6474+
6475+NftTransferPayload FfiConverterNftTransferPayload::lift(RustBuffer buf) {
6476+ auto stream = RustStream(&buf);
6477+ auto ret = FfiConverterNftTransferPayload::read(stream);
6478+
6479+ rustbuffer_free(buf);
6480+
6481+ return std::move(ret);
6482+}
6483+
6484+RustBuffer FfiConverterNftTransferPayload::lower(const NftTransferPayload &val) {
6485+ auto buf = rustbuffer_alloc(FfiConverterNftTransferPayload::allocation_size(val));
6486+ auto stream = RustStream(&buf);
6487+
6488+ FfiConverterNftTransferPayload::write(stream, val);
6489+
6490+ return std::move(buf);
6491+}
6492+
6493+NftTransferPayload FfiConverterNftTransferPayload::read(RustStream &stream) {
6494+ int32_t variant_id;
6495+ stream >> variant_id;
6496+
6497+ switch (variant_id) {
6498+
6499+ case 1:
6500+ return NftTransferPayload::kEmpty {
6501+ };
6502+
6503+ case 2:
6504+ return NftTransferPayload::kComment {
6505+ .text = FfiConverterString::read(stream),
6506+ };
6507+
6508+ case 3:
6509+ return NftTransferPayload::kRawPayload {
6510+ .boc = FfiConverterTypeBoc::read(stream),
6511+ };
6512+
6513+ default:
6514+ throw std::runtime_error("No matching NftTransferPayload variant");
6515+ }
6516+}
6517+
6518+void FfiConverterNftTransferPayload::write(RustStream &stream, const NftTransferPayload &val) {
6519+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
6520+
6521+ stream << variant_id;
6522+
6523+ std::visit([&](auto &&arg) {
6524+ using T = std::decay_t<decltype(arg)>;
6525+ if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
6526+ }
6527+ else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
6528+ FfiConverterString::write(stream, arg.text);
6529+ }
6530+ else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
6531+ FfiConverterTypeBoc::write(stream, arg.boc);
6532+ }
6533+ else {
6534+ static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
6535+ }
6536+ }, val.variant);
6537+}
6538+
6539+uint64_t FfiConverterNftTransferPayload::allocation_size(const NftTransferPayload &val) {
6540+ uint64_t size = sizeof(int32_t);
6541+
6542+ size += std::visit([&](auto &&arg) {
6543+ using T = std::decay_t<decltype(arg)>;
6544+ if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
6545+ uint64_t size = 0;
6546+ return size;
6547+ }
6548+ else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
6549+ uint64_t size = 0;
6550+ size += FfiConverterString::allocation_size(arg.text);
6551+ return size;
6552+ }
6553+ else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
6554+ uint64_t size = 0;
6555+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
6556+ return size;
6557+ }
6558+ else {
6559+ static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
6560+ }
6561+ }, val.variant);
6562+
6563+ return size;
6564+}
6565+
6566+
6567+PendingReason FfiConverterPendingReason::lift(RustBuffer buf) {
6568+ auto stream = RustStream(&buf);
6569+ auto ret = FfiConverterPendingReason::read(stream);
6570+
6571+ rustbuffer_free(buf);
6572+
6573+ return std::move(ret);
6574+}
6575+
6576+RustBuffer FfiConverterPendingReason::lower(const PendingReason &val) {
6577+ auto buf = rustbuffer_alloc(FfiConverterPendingReason::allocation_size(val));
6578+ auto stream = RustStream(&buf);
6579+
6580+ FfiConverterPendingReason::write(stream, val);
6581+
6582+ return std::move(buf);
6583+}
6584+
6585+PendingReason FfiConverterPendingReason::read(RustStream &stream) {
6586+ int32_t variant;
6587+ stream >> variant;
6588+
6589+ switch (variant) {
6590+
6591+ case 1:
6592+ return PendingReason::kInMempool;
6593+
6594+ case 2:
6595+ return PendingReason::kAwaitingWindow;
6596+
6597+ default:
6598+ throw std::runtime_error("No matching PendingReason variant");
6599+ }
6600+}
6601+
6602+void FfiConverterPendingReason::write(RustStream &stream, const PendingReason &val) {
6603+ switch (val) {
6604+
6605+ case PendingReason::kInMempool:
6606+ stream << static_cast<int32_t>(1);
6607+ break;
6608+
6609+ case PendingReason::kAwaitingWindow:
6610+ stream << static_cast<int32_t>(2);
6611+ break;
6612+
6613+ default:
6614+ throw std::runtime_error("No matching PendingReason variant");
6615+ }
6616+}
6617+
6618+uint64_t FfiConverterPendingReason::allocation_size(const PendingReason &) {
6619+ return static_cast<uint64_t>(sizeof(int32_t));
6620+}
6621+
6622+
6623+std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::lift(RustBuffer buf) {
6624+ auto stream = RustStream(&buf);
6625+ auto ret = FfiConverterProtectedSecretHostError::read(stream);
6626+
6627+ rustbuffer_free(buf);
6628+
6629+ return ret;
6630+}
6631+
6632+RustBuffer FfiConverterProtectedSecretHostError::lower(const ProtectedSecretHostError &val) {
6633+ auto buf = rustbuffer_alloc(allocation_size(val));
6634+ auto stream = RustStream(&buf);
6635+
6636+ FfiConverterProtectedSecretHostError::write(stream, val);
6637+
6638+ return std::move(buf);
6639+}
6640+
6641+std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::read(RustStream &stream) {
6642+ int32_t v;
6643+ stream >> v;
6644+
6645+ switch (v) {
6646+ case 1:
6647+ {
6648+ protected_secret_host_error::Failed var("ProtectedSecretHostError::Failed");
6649+ var.kind = FfiConverterProtectedSecretHostErrorKind::read(stream);
6650+ var.diagnostic = FfiConverterString::read(stream);
6651+ auto what_arg = FfiConverterString::lift(
6652+ rust_call(
6653+ uniffi_wallet_engine_fn_method_protectedsecrethosterror_uniffi_trait_display,
6654+ nullptr,
6655+ FfiConverterProtectedSecretHostError::lower(var)
6656+ )
6657+ );
6658+ auto ret = std::make_shared<protected_secret_host_error::Failed>(what_arg);
6659+ ret->kind = std::move(var.kind);
6660+ ret->diagnostic = std::move(var.diagnostic);
6661+ return ret;
6662+ }
6663+ default:
6664+ throw std::runtime_error("Unexpected error variant");
6665+ }
6666+}
6667+
6668+void FfiConverterProtectedSecretHostError::write(RustStream &stream, const ProtectedSecretHostError &val) {
6669+ stream << val.get_variant_idx();
6670+ switch (val.get_variant_idx()) {
6671+ case 1:
6672+ {
6673+ auto var = static_cast<const protected_secret_host_error::Failed&>(val);
6674+ FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
6675+ FfiConverterString::write(stream, var.diagnostic);
6676+ break;
6677+ }
6678+ }
6679+}
6680+
6681+uint64_t FfiConverterProtectedSecretHostError::allocation_size(const ProtectedSecretHostError &val) {
6682+ switch (val.get_variant_idx()) {
6683+ case 1:
6684+ {
6685+ auto var = static_cast<const protected_secret_host_error::Failed&>(val);
6686+ return static_cast<uint64_t>(sizeof(int32_t)
6687+ + FfiConverterProtectedSecretHostErrorKind::allocation_size(var.kind)
6688+ + FfiConverterString::allocation_size(var.diagnostic));
6689+ }
6690+ default:
6691+ throw std::runtime_error("Unexpected error variant");
6692+ }
6693+}
6694+
6695+
6696+ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::lift(RustBuffer buf) {
6697+ auto stream = RustStream(&buf);
6698+ auto ret = FfiConverterProtectedSecretHostErrorKind::read(stream);
6699+
6700+ rustbuffer_free(buf);
6701+
6702+ return std::move(ret);
6703+}
6704+
6705+RustBuffer FfiConverterProtectedSecretHostErrorKind::lower(const ProtectedSecretHostErrorKind &val) {
6706+ auto buf = rustbuffer_alloc(FfiConverterProtectedSecretHostErrorKind::allocation_size(val));
6707+ auto stream = RustStream(&buf);
6708+
6709+ FfiConverterProtectedSecretHostErrorKind::write(stream, val);
6710+
6711+ return std::move(buf);
6712+}
6713+
6714+ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::read(RustStream &stream) {
6715+ int32_t variant;
6716+ stream >> variant;
6717+
6718+ switch (variant) {
6719+
6720+ case 1:
6721+ return ProtectedSecretHostErrorKind::kNotFound;
6722+
6723+ case 2:
6724+ return ProtectedSecretHostErrorKind::kAuthenticationFailed;
6725+
6726+ case 3:
6727+ return ProtectedSecretHostErrorKind::kCancelled;
6728+
6729+ case 4:
6730+ return ProtectedSecretHostErrorKind::kUnavailable;
6731+
6732+ case 5:
6733+ return ProtectedSecretHostErrorKind::kPolicyViolation;
6734+
6735+ case 6:
6736+ return ProtectedSecretHostErrorKind::kOther;
6737+
6738+ default:
6739+ throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
6740+ }
6741+}
6742+
6743+void FfiConverterProtectedSecretHostErrorKind::write(RustStream &stream, const ProtectedSecretHostErrorKind &val) {
6744+ switch (val) {
6745+
6746+ case ProtectedSecretHostErrorKind::kNotFound:
6747+ stream << static_cast<int32_t>(1);
6748+ break;
6749+
6750+ case ProtectedSecretHostErrorKind::kAuthenticationFailed:
6751+ stream << static_cast<int32_t>(2);
6752+ break;
6753+
6754+ case ProtectedSecretHostErrorKind::kCancelled:
6755+ stream << static_cast<int32_t>(3);
6756+ break;
6757+
6758+ case ProtectedSecretHostErrorKind::kUnavailable:
6759+ stream << static_cast<int32_t>(4);
6760+ break;
6761+
6762+ case ProtectedSecretHostErrorKind::kPolicyViolation:
6763+ stream << static_cast<int32_t>(5);
6764+ break;
6765+
6766+ case ProtectedSecretHostErrorKind::kOther:
6767+ stream << static_cast<int32_t>(6);
6768+ break;
6769+
6770+ default:
6771+ throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
6772+ }
6773+}
6774+
6775+uint64_t FfiConverterProtectedSecretHostErrorKind::allocation_size(const ProtectedSecretHostErrorKind &) {
6776+ return static_cast<uint64_t>(sizeof(int32_t));
6777+}
6778+
6779+
6780+ResourcePhase FfiConverterResourcePhase::lift(RustBuffer buf) {
6781+ auto stream = RustStream(&buf);
6782+ auto ret = FfiConverterResourcePhase::read(stream);
6783+
6784+ rustbuffer_free(buf);
6785+
6786+ return std::move(ret);
6787+}
6788+
6789+RustBuffer FfiConverterResourcePhase::lower(const ResourcePhase &val) {
6790+ auto buf = rustbuffer_alloc(FfiConverterResourcePhase::allocation_size(val));
6791+ auto stream = RustStream(&buf);
6792+
6793+ FfiConverterResourcePhase::write(stream, val);
6794+
6795+ return std::move(buf);
6796+}
6797+
6798+ResourcePhase FfiConverterResourcePhase::read(RustStream &stream) {
6799+ int32_t variant;
6800+ stream >> variant;
6801+
6802+ switch (variant) {
6803+
6804+ case 1:
6805+ return ResourcePhase::kIdle;
6806+
6807+ case 2:
6808+ return ResourcePhase::kLoading;
6809+
6810+ case 3:
6811+ return ResourcePhase::kReady;
6812+
6813+ case 4:
6814+ return ResourcePhase::kFailed;
6815+
6816+ default:
6817+ throw std::runtime_error("No matching ResourcePhase variant");
6818+ }
6819+}
6820+
6821+void FfiConverterResourcePhase::write(RustStream &stream, const ResourcePhase &val) {
6822+ switch (val) {
6823+
6824+ case ResourcePhase::kIdle:
6825+ stream << static_cast<int32_t>(1);
6826+ break;
6827+
6828+ case ResourcePhase::kLoading:
6829+ stream << static_cast<int32_t>(2);
6830+ break;
6831+
6832+ case ResourcePhase::kReady:
6833+ stream << static_cast<int32_t>(3);
6834+ break;
6835+
6836+ case ResourcePhase::kFailed:
6837+ stream << static_cast<int32_t>(4);
6838+ break;
6839+
6840+ default:
6841+ throw std::runtime_error("No matching ResourcePhase variant");
6842+ }
6843+}
6844+
6845+uint64_t FfiConverterResourcePhase::allocation_size(const ResourcePhase &) {
6846+ return static_cast<uint64_t>(sizeof(int32_t));
6847+}
6848+
6849+
6850+RetryAdvice FfiConverterRetryAdvice::lift(RustBuffer buf) {
6851+ auto stream = RustStream(&buf);
6852+ auto ret = FfiConverterRetryAdvice::read(stream);
6853+
6854+ rustbuffer_free(buf);
6855+
6856+ return std::move(ret);
6857+}
6858+
6859+RustBuffer FfiConverterRetryAdvice::lower(const RetryAdvice &val) {
6860+ auto buf = rustbuffer_alloc(FfiConverterRetryAdvice::allocation_size(val));
6861+ auto stream = RustStream(&buf);
6862+
6863+ FfiConverterRetryAdvice::write(stream, val);
6864+
6865+ return std::move(buf);
6866+}
6867+
6868+RetryAdvice FfiConverterRetryAdvice::read(RustStream &stream) {
6869+ int32_t variant;
6870+ stream >> variant;
6871+
6872+ switch (variant) {
6873+
6874+ case 1:
6875+ return RetryAdvice::kNone;
6876+
6877+ case 2:
6878+ return RetryAdvice::kSafe;
6879+
6880+ case 3:
6881+ return RetryAdvice::kAfterDelay;
6882+
6883+ default:
6884+ throw std::runtime_error("No matching RetryAdvice variant");
6885+ }
6886+}
6887+
6888+void FfiConverterRetryAdvice::write(RustStream &stream, const RetryAdvice &val) {
6889+ switch (val) {
6890+
6891+ case RetryAdvice::kNone:
6892+ stream << static_cast<int32_t>(1);
6893+ break;
6894+
6895+ case RetryAdvice::kSafe:
6896+ stream << static_cast<int32_t>(2);
6897+ break;
6898+
6899+ case RetryAdvice::kAfterDelay:
6900+ stream << static_cast<int32_t>(3);
6901+ break;
6902+
6903+ default:
6904+ throw std::runtime_error("No matching RetryAdvice variant");
6905+ }
6906+}
6907+
6908+uint64_t FfiConverterRetryAdvice::allocation_size(const RetryAdvice &) {
6909+ return static_cast<uint64_t>(sizeof(int32_t));
6910+}
6911+
6912+
6913+SecretAccessReason FfiConverterSecretAccessReason::lift(RustBuffer buf) {
6914+ auto stream = RustStream(&buf);
6915+ auto ret = FfiConverterSecretAccessReason::read(stream);
6916+
6917+ rustbuffer_free(buf);
6918+
6919+ return std::move(ret);
6920+}
6921+
6922+RustBuffer FfiConverterSecretAccessReason::lower(const SecretAccessReason &val) {
6923+ auto buf = rustbuffer_alloc(FfiConverterSecretAccessReason::allocation_size(val));
6924+ auto stream = RustStream(&buf);
6925+
6926+ FfiConverterSecretAccessReason::write(stream, val);
6927+
6928+ return std::move(buf);
6929+}
6930+
6931+SecretAccessReason FfiConverterSecretAccessReason::read(RustStream &stream) {
6932+ int32_t variant;
6933+ stream >> variant;
6934+
6935+ switch (variant) {
6936+
6937+ case 1:
6938+ return SecretAccessReason::kCreateWallet;
6939+
6940+ case 2:
6941+ return SecretAccessReason::kSignTransfer;
6942+
6943+ case 3:
6944+ return SecretAccessReason::kSignTonConnectProof;
6945+
6946+ case 4:
6947+ return SecretAccessReason::kPrepareKeyRotation;
6948+
6949+ case 5:
6950+ return SecretAccessReason::kEncryptComment;
6951+
6952+ case 6:
6953+ return SecretAccessReason::kDecryptComment;
6954+
6955+ case 7:
6956+ return SecretAccessReason::kRevealRecoveryPhrase;
6957+
6958+ case 8:
6959+ return SecretAccessReason::kDeriveTonConnectSessionKey;
6960+
6961+ case 9:
6962+ return SecretAccessReason::kSignTonConnectData;
6963+
6964+ default:
6965+ throw std::runtime_error("No matching SecretAccessReason variant");
6966+ }
6967+}
6968+
6969+void FfiConverterSecretAccessReason::write(RustStream &stream, const SecretAccessReason &val) {
6970+ switch (val) {
6971+
6972+ case SecretAccessReason::kCreateWallet:
6973+ stream << static_cast<int32_t>(1);
6974+ break;
6975+
6976+ case SecretAccessReason::kSignTransfer:
6977+ stream << static_cast<int32_t>(2);
6978+ break;
6979+
6980+ case SecretAccessReason::kSignTonConnectProof:
6981+ stream << static_cast<int32_t>(3);
6982+ break;
6983+
6984+ case SecretAccessReason::kPrepareKeyRotation:
6985+ stream << static_cast<int32_t>(4);
6986+ break;
6987+
6988+ case SecretAccessReason::kEncryptComment:
6989+ stream << static_cast<int32_t>(5);
6990+ break;
6991+
6992+ case SecretAccessReason::kDecryptComment:
6993+ stream << static_cast<int32_t>(6);
6994+ break;
6995+
6996+ case SecretAccessReason::kRevealRecoveryPhrase:
6997+ stream << static_cast<int32_t>(7);
6998+ break;
6999+
7000+ case SecretAccessReason::kDeriveTonConnectSessionKey:
7001+ stream << static_cast<int32_t>(8);
7002+ break;
7003+
7004+ case SecretAccessReason::kSignTonConnectData:
7005+ stream << static_cast<int32_t>(9);
7006+ break;
7007+
7008+ default:
7009+ throw std::runtime_error("No matching SecretAccessReason variant");
7010+ }
7011+}
7012+
7013+uint64_t FfiConverterSecretAccessReason::allocation_size(const SecretAccessReason &) {
7014+ return static_cast<uint64_t>(sizeof(int32_t));
7015+}
7016+
7017+
7018+SendAmount FfiConverterSendAmount::lift(RustBuffer buf) {
7019+ auto stream = RustStream(&buf);
7020+ auto ret = FfiConverterSendAmount::read(stream);
7021+
7022+ rustbuffer_free(buf);
7023+
7024+ return std::move(ret);
7025+}
7026+
7027+RustBuffer FfiConverterSendAmount::lower(const SendAmount &val) {
7028+ auto buf = rustbuffer_alloc(FfiConverterSendAmount::allocation_size(val));
7029+ auto stream = RustStream(&buf);
7030+
7031+ FfiConverterSendAmount::write(stream, val);
7032+
7033+ return std::move(buf);
7034+}
7035+
7036+SendAmount FfiConverterSendAmount::read(RustStream &stream) {
7037+ int32_t variant_id;
7038+ stream >> variant_id;
7039+
7040+ switch (variant_id) {
7041+
7042+ case 1:
7043+ return SendAmount::kExact {
7044+ .nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
7045+ };
7046+
7047+ case 2:
7048+ return SendAmount::kAll {
7049+ };
7050+
7051+ default:
7052+ throw std::runtime_error("No matching SendAmount variant");
7053+ }
7054+}
7055+
7056+void FfiConverterSendAmount::write(RustStream &stream, const SendAmount &val) {
7057+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7058+
7059+ stream << variant_id;
7060+
7061+ std::visit([&](auto &&arg) {
7062+ using T = std::decay_t<decltype(arg)>;
7063+ if constexpr (std::is_same_v<T, SendAmount::kExact>) {
7064+ FfiConverterTypeUnsignedDecimalString::write(stream, arg.nanograms);
7065+ }
7066+ else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
7067+ }
7068+ else {
7069+ static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
7070+ }
7071+ }, val.variant);
7072+}
7073+
7074+uint64_t FfiConverterSendAmount::allocation_size(const SendAmount &val) {
7075+ uint64_t size = sizeof(int32_t);
7076+
7077+ size += std::visit([&](auto &&arg) {
7078+ using T = std::decay_t<decltype(arg)>;
7079+ if constexpr (std::is_same_v<T, SendAmount::kExact>) {
7080+ uint64_t size = 0;
7081+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.nanograms);
7082+ return size;
7083+ }
7084+ else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
7085+ uint64_t size = 0;
7086+ return size;
7087+ }
7088+ else {
7089+ static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
7090+ }
7091+ }, val.variant);
7092+
7093+ return size;
7094+}
7095+
7096+
7097+SendExpiration FfiConverterSendExpiration::lift(RustBuffer buf) {
7098+ auto stream = RustStream(&buf);
7099+ auto ret = FfiConverterSendExpiration::read(stream);
7100+
7101+ rustbuffer_free(buf);
7102+
7103+ return std::move(ret);
7104+}
7105+
7106+RustBuffer FfiConverterSendExpiration::lower(const SendExpiration &val) {
7107+ auto buf = rustbuffer_alloc(FfiConverterSendExpiration::allocation_size(val));
7108+ auto stream = RustStream(&buf);
7109+
7110+ FfiConverterSendExpiration::write(stream, val);
7111+
7112+ return std::move(buf);
7113+}
7114+
7115+SendExpiration FfiConverterSendExpiration::read(RustStream &stream) {
7116+ int32_t variant_id;
7117+ stream >> variant_id;
7118+
7119+ switch (variant_id) {
7120+
7121+ case 1:
7122+ return SendExpiration::kEngineDefault {
7123+ };
7124+
7125+ case 2:
7126+ return SendExpiration::kExact {
7127+ .unix_timestamp = FfiConverterUInt64::read(stream),
7128+ };
7129+
7130+ default:
7131+ throw std::runtime_error("No matching SendExpiration variant");
7132+ }
7133+}
7134+
7135+void FfiConverterSendExpiration::write(RustStream &stream, const SendExpiration &val) {
7136+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7137+
7138+ stream << variant_id;
7139+
7140+ std::visit([&](auto &&arg) {
7141+ using T = std::decay_t<decltype(arg)>;
7142+ if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
7143+ }
7144+ else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
7145+ FfiConverterUInt64::write(stream, arg.unix_timestamp);
7146+ }
7147+ else {
7148+ static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
7149+ }
7150+ }, val.variant);
7151+}
7152+
7153+uint64_t FfiConverterSendExpiration::allocation_size(const SendExpiration &val) {
7154+ uint64_t size = sizeof(int32_t);
7155+
7156+ size += std::visit([&](auto &&arg) {
7157+ using T = std::decay_t<decltype(arg)>;
7158+ if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
7159+ uint64_t size = 0;
7160+ return size;
7161+ }
7162+ else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
7163+ uint64_t size = 0;
7164+ size += FfiConverterUInt64::allocation_size(arg.unix_timestamp);
7165+ return size;
7166+ }
7167+ else {
7168+ static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
7169+ }
7170+ }, val.variant);
7171+
7172+ return size;
7173+}
7174+
7175+
7176+SendMessageBody FfiConverterSendMessageBody::lift(RustBuffer buf) {
7177+ auto stream = RustStream(&buf);
7178+ auto ret = FfiConverterSendMessageBody::read(stream);
7179+
7180+ rustbuffer_free(buf);
7181+
7182+ return std::move(ret);
7183+}
7184+
7185+RustBuffer FfiConverterSendMessageBody::lower(const SendMessageBody &val) {
7186+ auto buf = rustbuffer_alloc(FfiConverterSendMessageBody::allocation_size(val));
7187+ auto stream = RustStream(&buf);
7188+
7189+ FfiConverterSendMessageBody::write(stream, val);
7190+
7191+ return std::move(buf);
7192+}
7193+
7194+SendMessageBody FfiConverterSendMessageBody::read(RustStream &stream) {
7195+ int32_t variant_id;
7196+ stream >> variant_id;
7197+
7198+ switch (variant_id) {
7199+
7200+ case 1:
7201+ return SendMessageBody::kEmpty {
7202+ };
7203+
7204+ case 2:
7205+ return SendMessageBody::kComment {
7206+ .text = FfiConverterString::read(stream),
7207+ };
7208+
7209+ case 3:
7210+ return SendMessageBody::kRawPayload {
7211+ .boc = FfiConverterTypeBoc::read(stream),
7212+ };
7213+
7214+ default:
7215+ throw std::runtime_error("No matching SendMessageBody variant");
7216+ }
7217+}
7218+
7219+void FfiConverterSendMessageBody::write(RustStream &stream, const SendMessageBody &val) {
7220+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7221+
7222+ stream << variant_id;
7223+
7224+ std::visit([&](auto &&arg) {
7225+ using T = std::decay_t<decltype(arg)>;
7226+ if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
7227+ }
7228+ else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
7229+ FfiConverterString::write(stream, arg.text);
7230+ }
7231+ else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
7232+ FfiConverterTypeBoc::write(stream, arg.boc);
7233+ }
7234+ else {
7235+ static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
7236+ }
7237+ }, val.variant);
7238+}
7239+
7240+uint64_t FfiConverterSendMessageBody::allocation_size(const SendMessageBody &val) {
7241+ uint64_t size = sizeof(int32_t);
7242+
7243+ size += std::visit([&](auto &&arg) {
7244+ using T = std::decay_t<decltype(arg)>;
7245+ if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
7246+ uint64_t size = 0;
7247+ return size;
7248+ }
7249+ else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
7250+ uint64_t size = 0;
7251+ size += FfiConverterString::allocation_size(arg.text);
7252+ return size;
7253+ }
7254+ else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
7255+ uint64_t size = 0;
7256+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
7257+ return size;
7258+ }
7259+ else {
7260+ static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
7261+ }
7262+ }, val.variant);
7263+
7264+ return size;
7265+}
7266+
7267+
7268+SendPhase FfiConverterSendPhase::lift(RustBuffer buf) {
7269+ auto stream = RustStream(&buf);
7270+ auto ret = FfiConverterSendPhase::read(stream);
7271+
7272+ rustbuffer_free(buf);
7273+
7274+ return std::move(ret);
7275+}
7276+
7277+RustBuffer FfiConverterSendPhase::lower(const SendPhase &val) {
7278+ auto buf = rustbuffer_alloc(FfiConverterSendPhase::allocation_size(val));
7279+ auto stream = RustStream(&buf);
7280+
7281+ FfiConverterSendPhase::write(stream, val);
7282+
7283+ return std::move(buf);
7284+}
7285+
7286+SendPhase FfiConverterSendPhase::read(RustStream &stream) {
7287+ int32_t variant;
7288+ stream >> variant;
7289+
7290+ switch (variant) {
7291+
7292+ case 1:
7293+ return SendPhase::kIdle;
7294+
7295+ case 2:
7296+ return SendPhase::kValidating;
7297+
7298+ case 3:
7299+ return SendPhase::kAuthorizing;
7300+
7301+ case 4:
7302+ return SendPhase::kPreparing;
7303+
7304+ case 5:
7305+ return SendPhase::kPersisting;
7306+
7307+ case 6:
7308+ return SendPhase::kReadyToSubmit;
7309+
7310+ case 7:
7311+ return SendPhase::kSubmitting;
7312+
7313+ case 8:
7314+ return SendPhase::kSubmissionUnknown;
7315+
7316+ case 9:
7317+ return SendPhase::kSubmitted;
7318+
7319+ case 10:
7320+ return SendPhase::kHandedOff;
7321+
7322+ case 11:
7323+ return SendPhase::kConfirmed;
7324+
7325+ case 12:
7326+ return SendPhase::kReplaced;
7327+
7328+ case 13:
7329+ return SendPhase::kSequenceNumberConsumed;
7330+
7331+ case 14:
7332+ return SendPhase::kExpired;
7333+
7334+ case 15:
7335+ return SendPhase::kSuperseded;
7336+
7337+ case 16:
7338+ return SendPhase::kFailed;
7339+
7340+ case 17:
7341+ return SendPhase::kCancelled;
7342+
7343+ default:
7344+ throw std::runtime_error("No matching SendPhase variant");
7345+ }
7346+}
7347+
7348+void FfiConverterSendPhase::write(RustStream &stream, const SendPhase &val) {
7349+ switch (val) {
7350+
7351+ case SendPhase::kIdle:
7352+ stream << static_cast<int32_t>(1);
7353+ break;
7354+
7355+ case SendPhase::kValidating:
7356+ stream << static_cast<int32_t>(2);
7357+ break;
7358+
7359+ case SendPhase::kAuthorizing:
7360+ stream << static_cast<int32_t>(3);
7361+ break;
7362+
7363+ case SendPhase::kPreparing:
7364+ stream << static_cast<int32_t>(4);
7365+ break;
7366+
7367+ case SendPhase::kPersisting:
7368+ stream << static_cast<int32_t>(5);
7369+ break;
7370+
7371+ case SendPhase::kReadyToSubmit:
7372+ stream << static_cast<int32_t>(6);
7373+ break;
7374+
7375+ case SendPhase::kSubmitting:
7376+ stream << static_cast<int32_t>(7);
7377+ break;
7378+
7379+ case SendPhase::kSubmissionUnknown:
7380+ stream << static_cast<int32_t>(8);
7381+ break;
7382+
7383+ case SendPhase::kSubmitted:
7384+ stream << static_cast<int32_t>(9);
7385+ break;
7386+
7387+ case SendPhase::kHandedOff:
7388+ stream << static_cast<int32_t>(10);
7389+ break;
7390+
7391+ case SendPhase::kConfirmed:
7392+ stream << static_cast<int32_t>(11);
7393+ break;
7394+
7395+ case SendPhase::kReplaced:
7396+ stream << static_cast<int32_t>(12);
7397+ break;
7398+
7399+ case SendPhase::kSequenceNumberConsumed:
7400+ stream << static_cast<int32_t>(13);
7401+ break;
7402+
7403+ case SendPhase::kExpired:
7404+ stream << static_cast<int32_t>(14);
7405+ break;
7406+
7407+ case SendPhase::kSuperseded:
7408+ stream << static_cast<int32_t>(15);
7409+ break;
7410+
7411+ case SendPhase::kFailed:
7412+ stream << static_cast<int32_t>(16);
7413+ break;
7414+
7415+ case SendPhase::kCancelled:
7416+ stream << static_cast<int32_t>(17);
7417+ break;
7418+
7419+ default:
7420+ throw std::runtime_error("No matching SendPhase variant");
7421+ }
7422+}
7423+
7424+uint64_t FfiConverterSendPhase::allocation_size(const SendPhase &) {
7425+ return static_cast<uint64_t>(sizeof(int32_t));
7426+}
7427+
7428+
7429+std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::lift(RustBuffer buf) {
7430+ auto stream = RustStream(&buf);
7431+ auto ret = FfiConverterStatuslessHostError::read(stream);
7432+
7433+ rustbuffer_free(buf);
7434+
7435+ return ret;
7436+}
7437+
7438+RustBuffer FfiConverterStatuslessHostError::lower(const StatuslessHostError &val) {
7439+ auto buf = rustbuffer_alloc(allocation_size(val));
7440+ auto stream = RustStream(&buf);
7441+
7442+ FfiConverterStatuslessHostError::write(stream, val);
7443+
7444+ return std::move(buf);
7445+}
7446+
7447+std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::read(RustStream &stream) {
7448+ int32_t v;
7449+ stream >> v;
7450+
7451+ switch (v) {
7452+ case 1:
7453+ {
7454+ statusless_host_error::Failed var("StatuslessHostError::Failed");
7455+ var.kind = FfiConverterStatuslessHostErrorKind::read(stream);
7456+ var.diagnostic = FfiConverterString::read(stream);
7457+ auto what_arg = FfiConverterString::lift(
7458+ rust_call(
7459+ uniffi_wallet_engine_fn_method_statuslesshosterror_uniffi_trait_display,
7460+ nullptr,
7461+ FfiConverterStatuslessHostError::lower(var)
7462+ )
7463+ );
7464+ auto ret = std::make_shared<statusless_host_error::Failed>(what_arg);
7465+ ret->kind = std::move(var.kind);
7466+ ret->diagnostic = std::move(var.diagnostic);
7467+ return ret;
7468+ }
7469+ default:
7470+ throw std::runtime_error("Unexpected error variant");
7471+ }
7472+}
7473+
7474+void FfiConverterStatuslessHostError::write(RustStream &stream, const StatuslessHostError &val) {
7475+ stream << val.get_variant_idx();
7476+ switch (val.get_variant_idx()) {
7477+ case 1:
7478+ {
7479+ auto var = static_cast<const statusless_host_error::Failed&>(val);
7480+ FfiConverterStatuslessHostErrorKind::write(stream, var.kind);
7481+ FfiConverterString::write(stream, var.diagnostic);
7482+ break;
7483+ }
7484+ }
7485+}
7486+
7487+uint64_t FfiConverterStatuslessHostError::allocation_size(const StatuslessHostError &val) {
7488+ switch (val.get_variant_idx()) {
7489+ case 1:
7490+ {
7491+ auto var = static_cast<const statusless_host_error::Failed&>(val);
7492+ return static_cast<uint64_t>(sizeof(int32_t)
7493+ + FfiConverterStatuslessHostErrorKind::allocation_size(var.kind)
7494+ + FfiConverterString::allocation_size(var.diagnostic));
7495+ }
7496+ default:
7497+ throw std::runtime_error("Unexpected error variant");
7498+ }
7499+}
7500+
7501+
7502+StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::lift(RustBuffer buf) {
7503+ auto stream = RustStream(&buf);
7504+ auto ret = FfiConverterStatuslessHostErrorKind::read(stream);
7505+
7506+ rustbuffer_free(buf);
7507+
7508+ return std::move(ret);
7509+}
7510+
7511+RustBuffer FfiConverterStatuslessHostErrorKind::lower(const StatuslessHostErrorKind &val) {
7512+ auto buf = rustbuffer_alloc(FfiConverterStatuslessHostErrorKind::allocation_size(val));
7513+ auto stream = RustStream(&buf);
7514+
7515+ FfiConverterStatuslessHostErrorKind::write(stream, val);
7516+
7517+ return std::move(buf);
7518+}
7519+
7520+StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::read(RustStream &stream) {
7521+ int32_t variant;
7522+ stream >> variant;
7523+
7524+ switch (variant) {
7525+
7526+ case 1:
7527+ return StatuslessHostErrorKind::kOffline;
7528+
7529+ case 2:
7530+ return StatuslessHostErrorKind::kTimeout;
7531+
7532+ case 3:
7533+ return StatuslessHostErrorKind::kConnectionLost;
7534+
7535+ case 4:
7536+ return StatuslessHostErrorKind::kPolicyViolation;
7537+
7538+ case 5:
7539+ return StatuslessHostErrorKind::kResponseTooLarge;
7540+
7541+ case 6:
7542+ return StatuslessHostErrorKind::kCancelled;
7543+
7544+ case 7:
7545+ return StatuslessHostErrorKind::kOther;
7546+
7547+ default:
7548+ throw std::runtime_error("No matching StatuslessHostErrorKind variant");
7549+ }
7550+}
7551+
7552+void FfiConverterStatuslessHostErrorKind::write(RustStream &stream, const StatuslessHostErrorKind &val) {
7553+ switch (val) {
7554+
7555+ case StatuslessHostErrorKind::kOffline:
7556+ stream << static_cast<int32_t>(1);
7557+ break;
7558+
7559+ case StatuslessHostErrorKind::kTimeout:
7560+ stream << static_cast<int32_t>(2);
7561+ break;
7562+
7563+ case StatuslessHostErrorKind::kConnectionLost:
7564+ stream << static_cast<int32_t>(3);
7565+ break;
7566+
7567+ case StatuslessHostErrorKind::kPolicyViolation:
7568+ stream << static_cast<int32_t>(4);
7569+ break;
7570+
7571+ case StatuslessHostErrorKind::kResponseTooLarge:
7572+ stream << static_cast<int32_t>(5);
7573+ break;
7574+
7575+ case StatuslessHostErrorKind::kCancelled:
7576+ stream << static_cast<int32_t>(6);
7577+ break;
7578+
7579+ case StatuslessHostErrorKind::kOther:
7580+ stream << static_cast<int32_t>(7);
7581+ break;
7582+
7583+ default:
7584+ throw std::runtime_error("No matching StatuslessHostErrorKind variant");
7585+ }
7586+}
7587+
7588+uint64_t FfiConverterStatuslessHostErrorKind::allocation_size(const StatuslessHostErrorKind &) {
7589+ return static_cast<uint64_t>(sizeof(int32_t));
7590+}
7591+
7592+
7593+std::shared_ptr<TonAddressError> FfiConverterTonAddressError::lift(RustBuffer buf) {
7594+ auto stream = RustStream(&buf);
7595+ auto ret = FfiConverterTonAddressError::read(stream);
7596+
7597+ rustbuffer_free(buf);
7598+
7599+ return ret;
7600+}
7601+
7602+RustBuffer FfiConverterTonAddressError::lower(const TonAddressError &val) {
7603+ auto buf = rustbuffer_alloc(allocation_size(val));
7604+ auto stream = RustStream(&buf);
7605+
7606+ FfiConverterTonAddressError::write(stream, val);
7607+
7608+ return std::move(buf);
7609+}
7610+
7611+std::shared_ptr<TonAddressError> FfiConverterTonAddressError::read(RustStream &stream) {
7612+ int32_t v;
7613+ stream >> v;
7614+
7615+ switch (v) {
7616+ case 1:
7617+ {
7618+ ton_address_error::InvalidAddress var("TonAddressError::InvalidAddress");
7619+ auto what_arg = FfiConverterString::lift(
7620+ rust_call(
7621+ uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
7622+ nullptr,
7623+ FfiConverterTonAddressError::lower(var)
7624+ )
7625+ );
7626+ auto ret = std::make_shared<ton_address_error::InvalidAddress>(what_arg);
7627+ return ret;
7628+ }
7629+ case 2:
7630+ {
7631+ ton_address_error::UnsupportedWorkchain var("TonAddressError::UnsupportedWorkchain");
7632+ auto what_arg = FfiConverterString::lift(
7633+ rust_call(
7634+ uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
7635+ nullptr,
7636+ FfiConverterTonAddressError::lower(var)
7637+ )
7638+ );
7639+ auto ret = std::make_shared<ton_address_error::UnsupportedWorkchain>(what_arg);
7640+ return ret;
7641+ }
7642+ default:
7643+ throw std::runtime_error("Unexpected error variant");
7644+ }
7645+}
7646+
7647+void FfiConverterTonAddressError::write(RustStream &stream, const TonAddressError &val) {
7648+ stream << val.get_variant_idx();
7649+ switch (val.get_variant_idx()) {
7650+ case 1:
7651+ {
7652+ auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
7653+ break;
7654+ }
7655+ case 2:
7656+ {
7657+ auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
7658+ break;
7659+ }
7660+ }
7661+}
7662+
7663+uint64_t FfiConverterTonAddressError::allocation_size(const TonAddressError &val) {
7664+ switch (val.get_variant_idx()) {
7665+ case 1:
7666+ {
7667+ auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
7668+ return static_cast<uint64_t>(sizeof(int32_t));
7669+ }
7670+ case 2:
7671+ {
7672+ auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
7673+ return static_cast<uint64_t>(sizeof(int32_t));
7674+ }
7675+ default:
7676+ throw std::runtime_error("Unexpected error variant");
7677+ }
7678+}
7679+
7680+
7681+TonAddressFormat FfiConverterTonAddressFormat::lift(RustBuffer buf) {
7682+ auto stream = RustStream(&buf);
7683+ auto ret = FfiConverterTonAddressFormat::read(stream);
7684+
7685+ rustbuffer_free(buf);
7686+
7687+ return std::move(ret);
7688+}
7689+
7690+RustBuffer FfiConverterTonAddressFormat::lower(const TonAddressFormat &val) {
7691+ auto buf = rustbuffer_alloc(FfiConverterTonAddressFormat::allocation_size(val));
7692+ auto stream = RustStream(&buf);
7693+
7694+ FfiConverterTonAddressFormat::write(stream, val);
7695+
7696+ return std::move(buf);
7697+}
7698+
7699+TonAddressFormat FfiConverterTonAddressFormat::read(RustStream &stream) {
7700+ int32_t variant_id;
7701+ stream >> variant_id;
7702+
7703+ switch (variant_id) {
7704+
7705+ case 1:
7706+ return TonAddressFormat::kRaw {
7707+ };
7708+
7709+ case 2:
7710+ return TonAddressFormat::kUserFriendly {
7711+ .bounceable = FfiConverterBool::read(stream),
7712+ .testnet = FfiConverterBool::read(stream),
7713+ };
7714+
7715+ default:
7716+ throw std::runtime_error("No matching TonAddressFormat variant");
7717+ }
7718+}
7719+
7720+void FfiConverterTonAddressFormat::write(RustStream &stream, const TonAddressFormat &val) {
7721+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7722+
7723+ stream << variant_id;
7724+
7725+ std::visit([&](auto &&arg) {
7726+ using T = std::decay_t<decltype(arg)>;
7727+ if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
7728+ }
7729+ else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
7730+ FfiConverterBool::write(stream, arg.bounceable);
7731+ FfiConverterBool::write(stream, arg.testnet);
7732+ }
7733+ else {
7734+ static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
7735+ }
7736+ }, val.variant);
7737+}
7738+
7739+uint64_t FfiConverterTonAddressFormat::allocation_size(const TonAddressFormat &val) {
7740+ uint64_t size = sizeof(int32_t);
7741+
7742+ size += std::visit([&](auto &&arg) {
7743+ using T = std::decay_t<decltype(arg)>;
7744+ if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
7745+ uint64_t size = 0;
7746+ return size;
7747+ }
7748+ else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
7749+ uint64_t size = 0;
7750+ size += FfiConverterBool::allocation_size(arg.bounceable);
7751+ size += FfiConverterBool::allocation_size(arg.testnet);
7752+ return size;
7753+ }
7754+ else {
7755+ static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
7756+ }
7757+ }, val.variant);
7758+
7759+ return size;
7760+}
7761+
7762+
7763+TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::lift(RustBuffer buf) {
7764+ auto stream = RustStream(&buf);
7765+ auto ret = FfiConverterTonConnectConnectErrorCode::read(stream);
7766+
7767+ rustbuffer_free(buf);
7768+
7769+ return std::move(ret);
7770+}
7771+
7772+RustBuffer FfiConverterTonConnectConnectErrorCode::lower(const TonConnectConnectErrorCode &val) {
7773+ auto buf = rustbuffer_alloc(FfiConverterTonConnectConnectErrorCode::allocation_size(val));
7774+ auto stream = RustStream(&buf);
7775+
7776+ FfiConverterTonConnectConnectErrorCode::write(stream, val);
7777+
7778+ return std::move(buf);
7779+}
7780+
7781+TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::read(RustStream &stream) {
7782+ int32_t variant;
7783+ stream >> variant;
7784+
7785+ switch (variant) {
7786+
7787+ case 1:
7788+ return TonConnectConnectErrorCode::kManifestNotFound;
7789+
7790+ case 2:
7791+ return TonConnectConnectErrorCode::kManifestContent;
7792+
7793+ case 3:
7794+ return TonConnectConnectErrorCode::kUserDeclined;
7795+
7796+ default:
7797+ throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
7798+ }
7799+}
7800+
7801+void FfiConverterTonConnectConnectErrorCode::write(RustStream &stream, const TonConnectConnectErrorCode &val) {
7802+ switch (val) {
7803+
7804+ case TonConnectConnectErrorCode::kManifestNotFound:
7805+ stream << static_cast<int32_t>(1);
7806+ break;
7807+
7808+ case TonConnectConnectErrorCode::kManifestContent:
7809+ stream << static_cast<int32_t>(2);
7810+ break;
7811+
7812+ case TonConnectConnectErrorCode::kUserDeclined:
7813+ stream << static_cast<int32_t>(3);
7814+ break;
7815+
7816+ default:
7817+ throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
7818+ }
7819+}
7820+
7821+uint64_t FfiConverterTonConnectConnectErrorCode::allocation_size(const TonConnectConnectErrorCode &) {
7822+ return static_cast<uint64_t>(sizeof(int32_t));
7823+}
7824+
7825+
7826+TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::lift(RustBuffer buf) {
7827+ auto stream = RustStream(&buf);
7828+ auto ret = FfiConverterTonConnectDevicePlatform::read(stream);
7829+
7830+ rustbuffer_free(buf);
7831+
7832+ return std::move(ret);
7833+}
7834+
7835+RustBuffer FfiConverterTonConnectDevicePlatform::lower(const TonConnectDevicePlatform &val) {
7836+ auto buf = rustbuffer_alloc(FfiConverterTonConnectDevicePlatform::allocation_size(val));
7837+ auto stream = RustStream(&buf);
7838+
7839+ FfiConverterTonConnectDevicePlatform::write(stream, val);
7840+
7841+ return std::move(buf);
7842+}
7843+
7844+TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::read(RustStream &stream) {
7845+ int32_t variant;
7846+ stream >> variant;
7847+
7848+ switch (variant) {
7849+
7850+ case 1:
7851+ return TonConnectDevicePlatform::kIphone;
7852+
7853+ case 2:
7854+ return TonConnectDevicePlatform::kIpad;
7855+
7856+ case 3:
7857+ return TonConnectDevicePlatform::kAndroid;
7858+
7859+ case 4:
7860+ return TonConnectDevicePlatform::kWindows;
7861+
7862+ case 5:
7863+ return TonConnectDevicePlatform::kMac;
7864+
7865+ case 6:
7866+ return TonConnectDevicePlatform::kLinux;
7867+
7868+ case 7:
7869+ return TonConnectDevicePlatform::kBrowser;
7870+
7871+ default:
7872+ throw std::runtime_error("No matching TonConnectDevicePlatform variant");
7873+ }
7874+}
7875+
7876+void FfiConverterTonConnectDevicePlatform::write(RustStream &stream, const TonConnectDevicePlatform &val) {
7877+ switch (val) {
7878+
7879+ case TonConnectDevicePlatform::kIphone:
7880+ stream << static_cast<int32_t>(1);
7881+ break;
7882+
7883+ case TonConnectDevicePlatform::kIpad:
7884+ stream << static_cast<int32_t>(2);
7885+ break;
7886+
7887+ case TonConnectDevicePlatform::kAndroid:
7888+ stream << static_cast<int32_t>(3);
7889+ break;
7890+
7891+ case TonConnectDevicePlatform::kWindows:
7892+ stream << static_cast<int32_t>(4);
7893+ break;
7894+
7895+ case TonConnectDevicePlatform::kMac:
7896+ stream << static_cast<int32_t>(5);
7897+ break;
7898+
7899+ case TonConnectDevicePlatform::kLinux:
7900+ stream << static_cast<int32_t>(6);
7901+ break;
7902+
7903+ case TonConnectDevicePlatform::kBrowser:
7904+ stream << static_cast<int32_t>(7);
7905+ break;
7906+
7907+ default:
7908+ throw std::runtime_error("No matching TonConnectDevicePlatform variant");
7909+ }
7910+}
7911+
7912+uint64_t FfiConverterTonConnectDevicePlatform::allocation_size(const TonConnectDevicePlatform &) {
7913+ return static_cast<uint64_t>(sizeof(int32_t));
7914+}
7915+
7916+
7917+TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::lift(RustBuffer buf) {
7918+ auto stream = RustStream(&buf);
7919+ auto ret = FfiConverterTonConnectIncomingRequest::read(stream);
7920+
7921+ rustbuffer_free(buf);
7922+
7923+ return std::move(ret);
7924+}
7925+
7926+RustBuffer FfiConverterTonConnectIncomingRequest::lower(const TonConnectIncomingRequest &val) {
7927+ auto buf = rustbuffer_alloc(FfiConverterTonConnectIncomingRequest::allocation_size(val));
7928+ auto stream = RustStream(&buf);
7929+
7930+ FfiConverterTonConnectIncomingRequest::write(stream, val);
7931+
7932+ return std::move(buf);
7933+}
7934+
7935+TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::read(RustStream &stream) {
7936+ int32_t variant_id;
7937+ stream >> variant_id;
7938+
7939+ switch (variant_id) {
7940+
7941+ case 1:
7942+ return TonConnectIncomingRequest::kSendTransaction {
7943+ .id = FfiConverterString::read(stream),
7944+ .method = FfiConverterString::read(stream),
7945+ .request = FfiConverterTypeSendRequest::read(stream),
7946+ };
7947+
7948+ case 2:
7949+ return TonConnectIncomingRequest::kSignMessage {
7950+ .id = FfiConverterString::read(stream),
7951+ .method = FfiConverterString::read(stream),
7952+ .request = FfiConverterTypeSignMessageRequest::read(stream),
7953+ };
7954+
7955+ case 3:
7956+ return TonConnectIncomingRequest::kDisconnect {
7957+ .id = FfiConverterString::read(stream),
7958+ .method = FfiConverterString::read(stream),
7959+ };
7960+
7961+ case 4:
7962+ return TonConnectIncomingRequest::kUnsupported {
7963+ .id = FfiConverterString::read(stream),
7964+ .method = FfiConverterString::read(stream),
7965+ .error_code = FfiConverterTonConnectRpcErrorCode::read(stream),
7966+ .error_message = FfiConverterString::read(stream),
7967+ };
7968+
7969+ case 5:
7970+ return TonConnectIncomingRequest::kSignData {
7971+ .id = FfiConverterString::read(stream),
7972+ .method = FfiConverterString::read(stream),
7973+ .request = FfiConverterTypeTonConnectSignDataRequest::read(stream),
7974+ };
7975+
7976+ default:
7977+ throw std::runtime_error("No matching TonConnectIncomingRequest variant");
7978+ }
7979+}
7980+
7981+void FfiConverterTonConnectIncomingRequest::write(RustStream &stream, const TonConnectIncomingRequest &val) {
7982+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7983+
7984+ stream << variant_id;
7985+
7986+ std::visit([&](auto &&arg) {
7987+ using T = std::decay_t<decltype(arg)>;
7988+ if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSendTransaction>) {
7989+ FfiConverterString::write(stream, arg.id);
7990+ FfiConverterString::write(stream, arg.method);
7991+ FfiConverterTypeSendRequest::write(stream, arg.request);
7992+ }
7993+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignMessage>) {
7994+ FfiConverterString::write(stream, arg.id);
7995+ FfiConverterString::write(stream, arg.method);
7996+ FfiConverterTypeSignMessageRequest::write(stream, arg.request);
7997+ }
7998+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
7999+ FfiConverterString::write(stream, arg.id);
8000+ FfiConverterString::write(stream, arg.method);
8001+ }
8002+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kUnsupported>) {
8003+ FfiConverterString::write(stream, arg.id);
8004+ FfiConverterString::write(stream, arg.method);
8005+ FfiConverterTonConnectRpcErrorCode::write(stream, arg.error_code);
8006+ FfiConverterString::write(stream, arg.error_message);
8007+ }
8008+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignData>) {
8009+ FfiConverterString::write(stream, arg.id);
8010+ FfiConverterString::write(stream, arg.method);
8011+ FfiConverterTypeTonConnectSignDataRequest::write(stream, arg.request);
8012+ }
8013+ else {
8014+ static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
8015+ }
8016+ }, val.variant);
8017+}
8018+
8019+uint64_t FfiConverterTonConnectIncomingRequest::allocation_size(const TonConnectIncomingRequest &val) {
8020+ uint64_t size = sizeof(int32_t);
8021+
8022+ size += std::visit([&](auto &&arg) {
8023+ using T = std::decay_t<decltype(arg)>;
8024+ if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSendTransaction>) {
8025+ uint64_t size = 0;
8026+ size += FfiConverterString::allocation_size(arg.id);
8027+ size += FfiConverterString::allocation_size(arg.method);
8028+ size += FfiConverterTypeSendRequest::allocation_size(arg.request);
8029+ return size;
8030+ }
8031+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignMessage>) {
8032+ uint64_t size = 0;
8033+ size += FfiConverterString::allocation_size(arg.id);
8034+ size += FfiConverterString::allocation_size(arg.method);
8035+ size += FfiConverterTypeSignMessageRequest::allocation_size(arg.request);
8036+ return size;
8037+ }
8038+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
8039+ uint64_t size = 0;
8040+ size += FfiConverterString::allocation_size(arg.id);
8041+ size += FfiConverterString::allocation_size(arg.method);
8042+ return size;
8043+ }
8044+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kUnsupported>) {
8045+ uint64_t size = 0;
8046+ size += FfiConverterString::allocation_size(arg.id);
8047+ size += FfiConverterString::allocation_size(arg.method);
8048+ size += FfiConverterTonConnectRpcErrorCode::allocation_size(arg.error_code);
8049+ size += FfiConverterString::allocation_size(arg.error_message);
8050+ return size;
8051+ }
8052+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignData>) {
8053+ uint64_t size = 0;
8054+ size += FfiConverterString::allocation_size(arg.id);
8055+ size += FfiConverterString::allocation_size(arg.method);
8056+ size += FfiConverterTypeTonConnectSignDataRequest::allocation_size(arg.request);
8057+ return size;
8058+ }
8059+ else {
8060+ static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
8061+ }
8062+ }, val.variant);
8063+
8064+ return size;
8065+}
8066+
8067+
8068+TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::lift(RustBuffer buf) {
8069+ auto stream = RustStream(&buf);
8070+ auto ret = FfiConverterTonConnectRpcErrorCode::read(stream);
8071+
8072+ rustbuffer_free(buf);
8073+
8074+ return std::move(ret);
8075+}
8076+
8077+RustBuffer FfiConverterTonConnectRpcErrorCode::lower(const TonConnectRpcErrorCode &val) {
8078+ auto buf = rustbuffer_alloc(FfiConverterTonConnectRpcErrorCode::allocation_size(val));
8079+ auto stream = RustStream(&buf);
8080+
8081+ FfiConverterTonConnectRpcErrorCode::write(stream, val);
8082+
8083+ return std::move(buf);
8084+}
8085+
8086+TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::read(RustStream &stream) {
8087+ int32_t variant;
8088+ stream >> variant;
8089+
8090+ switch (variant) {
8091+
8092+ case 1:
8093+ return TonConnectRpcErrorCode::kUnknown;
8094+
8095+ case 2:
8096+ return TonConnectRpcErrorCode::kBadRequest;
8097+
8098+ case 3:
8099+ return TonConnectRpcErrorCode::kUnknownApp;
8100+
8101+ case 4:
8102+ return TonConnectRpcErrorCode::kUserDeclined;
8103+
8104+ case 5:
8105+ return TonConnectRpcErrorCode::kMethodNotSupported;
8106+
8107+ default:
8108+ throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
8109+ }
8110+}
8111+
8112+void FfiConverterTonConnectRpcErrorCode::write(RustStream &stream, const TonConnectRpcErrorCode &val) {
8113+ switch (val) {
8114+
8115+ case TonConnectRpcErrorCode::kUnknown:
8116+ stream << static_cast<int32_t>(1);
8117+ break;
8118+
8119+ case TonConnectRpcErrorCode::kBadRequest:
8120+ stream << static_cast<int32_t>(2);
8121+ break;
8122+
8123+ case TonConnectRpcErrorCode::kUnknownApp:
8124+ stream << static_cast<int32_t>(3);
8125+ break;
8126+
8127+ case TonConnectRpcErrorCode::kUserDeclined:
8128+ stream << static_cast<int32_t>(4);
8129+ break;
8130+
8131+ case TonConnectRpcErrorCode::kMethodNotSupported:
8132+ stream << static_cast<int32_t>(5);
8133+ break;
8134+
8135+ default:
8136+ throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
8137+ }
8138+}
8139+
8140+uint64_t FfiConverterTonConnectRpcErrorCode::allocation_size(const TonConnectRpcErrorCode &) {
8141+ return static_cast<uint64_t>(sizeof(int32_t));
8142+}
8143+
8144+
8145+std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::lift(RustBuffer buf) {
8146+ auto stream = RustStream(&buf);
8147+ auto ret = FfiConverterTonConnectSessionError::read(stream);
8148+
8149+ rustbuffer_free(buf);
8150+
8151+ return ret;
8152+}
8153+
8154+RustBuffer FfiConverterTonConnectSessionError::lower(const TonConnectSessionError &val) {
8155+ auto buf = rustbuffer_alloc(allocation_size(val));
8156+ auto stream = RustStream(&buf);
8157+
8158+ FfiConverterTonConnectSessionError::write(stream, val);
8159+
8160+ return std::move(buf);
8161+}
8162+
8163+std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::read(RustStream &stream) {
8164+ int32_t v;
8165+ stream >> v;
8166+
8167+ switch (v) {
8168+ case 1:
8169+ {
8170+ ton_connect_session_error::Failed var("TonConnectSessionError::Failed");
8171+ var.diagnostic = FfiConverterString::read(stream);
8172+ auto what_arg = FfiConverterString::lift(
8173+ rust_call(
8174+ uniffi_wallet_engine_fn_method_tonconnectsessionerror_uniffi_trait_display,
8175+ nullptr,
8176+ FfiConverterTonConnectSessionError::lower(var)
8177+ )
8178+ );
8179+ auto ret = std::make_shared<ton_connect_session_error::Failed>(what_arg);
8180+ ret->diagnostic = std::move(var.diagnostic);
8181+ return ret;
8182+ }
8183+ default:
8184+ throw std::runtime_error("Unexpected error variant");
8185+ }
8186+}
8187+
8188+void FfiConverterTonConnectSessionError::write(RustStream &stream, const TonConnectSessionError &val) {
8189+ stream << val.get_variant_idx();
8190+ switch (val.get_variant_idx()) {
8191+ case 1:
8192+ {
8193+ auto var = static_cast<const ton_connect_session_error::Failed&>(val);
8194+ FfiConverterString::write(stream, var.diagnostic);
8195+ break;
8196+ }
8197+ }
8198+}
8199+
8200+uint64_t FfiConverterTonConnectSessionError::allocation_size(const TonConnectSessionError &val) {
8201+ switch (val.get_variant_idx()) {
8202+ case 1:
8203+ {
8204+ auto var = static_cast<const ton_connect_session_error::Failed&>(val);
8205+ return static_cast<uint64_t>(sizeof(int32_t)
8206+ + FfiConverterString::allocation_size(var.diagnostic));
8207+ }
8208+ default:
8209+ throw std::runtime_error("Unexpected error variant");
8210+ }
8211+}
8212+
8213+
8214+TonConnectSessionPhase FfiConverterTonConnectSessionPhase::lift(RustBuffer buf) {
8215+ auto stream = RustStream(&buf);
8216+ auto ret = FfiConverterTonConnectSessionPhase::read(stream);
8217+
8218+ rustbuffer_free(buf);
8219+
8220+ return std::move(ret);
8221+}
8222+
8223+RustBuffer FfiConverterTonConnectSessionPhase::lower(const TonConnectSessionPhase &val) {
8224+ auto buf = rustbuffer_alloc(FfiConverterTonConnectSessionPhase::allocation_size(val));
8225+ auto stream = RustStream(&buf);
8226+
8227+ FfiConverterTonConnectSessionPhase::write(stream, val);
8228+
8229+ return std::move(buf);
8230+}
8231+
8232+TonConnectSessionPhase FfiConverterTonConnectSessionPhase::read(RustStream &stream) {
8233+ int32_t variant;
8234+ stream >> variant;
8235+
8236+ switch (variant) {
8237+
8238+ case 1:
8239+ return TonConnectSessionPhase::kPendingConnect;
8240+
8241+ case 2:
8242+ return TonConnectSessionPhase::kConnected;
8243+
8244+ case 3:
8245+ return TonConnectSessionPhase::kDisconnected;
8246+
8247+ default:
8248+ throw std::runtime_error("No matching TonConnectSessionPhase variant");
8249+ }
8250+}
8251+
8252+void FfiConverterTonConnectSessionPhase::write(RustStream &stream, const TonConnectSessionPhase &val) {
8253+ switch (val) {
8254+
8255+ case TonConnectSessionPhase::kPendingConnect:
8256+ stream << static_cast<int32_t>(1);
8257+ break;
8258+
8259+ case TonConnectSessionPhase::kConnected:
8260+ stream << static_cast<int32_t>(2);
8261+ break;
8262+
8263+ case TonConnectSessionPhase::kDisconnected:
8264+ stream << static_cast<int32_t>(3);
8265+ break;
8266+
8267+ default:
8268+ throw std::runtime_error("No matching TonConnectSessionPhase variant");
8269+ }
8270+}
8271+
8272+uint64_t FfiConverterTonConnectSessionPhase::allocation_size(const TonConnectSessionPhase &) {
8273+ return static_cast<uint64_t>(sizeof(int32_t));
8274+}
8275+
8276+
8277+TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::lift(RustBuffer buf) {
8278+ auto stream = RustStream(&buf);
8279+ auto ret = FfiConverterTonConnectSignDataPayload::read(stream);
8280+
8281+ rustbuffer_free(buf);
8282+
8283+ return std::move(ret);
8284+}
8285+
8286+RustBuffer FfiConverterTonConnectSignDataPayload::lower(const TonConnectSignDataPayload &val) {
8287+ auto buf = rustbuffer_alloc(FfiConverterTonConnectSignDataPayload::allocation_size(val));
8288+ auto stream = RustStream(&buf);
8289+
8290+ FfiConverterTonConnectSignDataPayload::write(stream, val);
8291+
8292+ return std::move(buf);
8293+}
8294+
8295+TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::read(RustStream &stream) {
8296+ int32_t variant_id;
8297+ stream >> variant_id;
8298+
8299+ switch (variant_id) {
8300+
8301+ case 1:
8302+ return TonConnectSignDataPayload::kText {
8303+ .text = FfiConverterString::read(stream),
8304+ };
8305+
8306+ case 2:
8307+ return TonConnectSignDataPayload::kBinary {
8308+ .bytes = FfiConverterString::read(stream),
8309+ };
8310+
8311+ case 3:
8312+ return TonConnectSignDataPayload::kCell {
8313+ .schema = FfiConverterString::read(stream),
8314+ .cell = FfiConverterString::read(stream),
8315+ };
8316+
8317+ default:
8318+ throw std::runtime_error("No matching TonConnectSignDataPayload variant");
8319+ }
8320+}
8321+
8322+void FfiConverterTonConnectSignDataPayload::write(RustStream &stream, const TonConnectSignDataPayload &val) {
8323+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8324+
8325+ stream << variant_id;
8326+
8327+ std::visit([&](auto &&arg) {
8328+ using T = std::decay_t<decltype(arg)>;
8329+ if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kText>) {
8330+ FfiConverterString::write(stream, arg.text);
8331+ }
8332+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
8333+ FfiConverterString::write(stream, arg.bytes);
8334+ }
8335+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
8336+ FfiConverterString::write(stream, arg.schema);
8337+ FfiConverterString::write(stream, arg.cell);
8338+ }
8339+ else {
8340+ static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
8341+ }
8342+ }, val.variant);
8343+}
8344+
8345+uint64_t FfiConverterTonConnectSignDataPayload::allocation_size(const TonConnectSignDataPayload &val) {
8346+ uint64_t size = sizeof(int32_t);
8347+
8348+ size += std::visit([&](auto &&arg) {
8349+ using T = std::decay_t<decltype(arg)>;
8350+ if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kText>) {
8351+ uint64_t size = 0;
8352+ size += FfiConverterString::allocation_size(arg.text);
8353+ return size;
8354+ }
8355+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
8356+ uint64_t size = 0;
8357+ size += FfiConverterString::allocation_size(arg.bytes);
8358+ return size;
8359+ }
8360+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
8361+ uint64_t size = 0;
8362+ size += FfiConverterString::allocation_size(arg.schema);
8363+ size += FfiConverterString::allocation_size(arg.cell);
8364+ return size;
8365+ }
8366+ else {
8367+ static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
8368+ }
8369+ }, val.variant);
8370+
8371+ return size;
8372+}
8373+
8374+
8375+TonTransferAsset FfiConverterTonTransferAsset::lift(RustBuffer buf) {
8376+ auto stream = RustStream(&buf);
8377+ auto ret = FfiConverterTonTransferAsset::read(stream);
8378+
8379+ rustbuffer_free(buf);
8380+
8381+ return std::move(ret);
8382+}
8383+
8384+RustBuffer FfiConverterTonTransferAsset::lower(const TonTransferAsset &val) {
8385+ auto buf = rustbuffer_alloc(FfiConverterTonTransferAsset::allocation_size(val));
8386+ auto stream = RustStream(&buf);
8387+
8388+ FfiConverterTonTransferAsset::write(stream, val);
8389+
8390+ return std::move(buf);
8391+}
8392+
8393+TonTransferAsset FfiConverterTonTransferAsset::read(RustStream &stream) {
8394+ int32_t variant_id;
8395+ stream >> variant_id;
8396+
8397+ switch (variant_id) {
8398+
8399+ case 1:
8400+ return TonTransferAsset::kGram {
8401+ };
8402+
8403+ case 2:
8404+ return TonTransferAsset::kJetton {
8405+ .master = FfiConverterTypeTonAddressString::read(stream),
8406+ };
8407+
8408+ default:
8409+ throw std::runtime_error("No matching TonTransferAsset variant");
8410+ }
8411+}
8412+
8413+void FfiConverterTonTransferAsset::write(RustStream &stream, const TonTransferAsset &val) {
8414+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8415+
8416+ stream << variant_id;
8417+
8418+ std::visit([&](auto &&arg) {
8419+ using T = std::decay_t<decltype(arg)>;
8420+ if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
8421+ }
8422+ else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
8423+ FfiConverterTypeTonAddressString::write(stream, arg.master);
8424+ }
8425+ else {
8426+ static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
8427+ }
8428+ }, val.variant);
8429+}
8430+
8431+uint64_t FfiConverterTonTransferAsset::allocation_size(const TonTransferAsset &val) {
8432+ uint64_t size = sizeof(int32_t);
8433+
8434+ size += std::visit([&](auto &&arg) {
8435+ using T = std::decay_t<decltype(arg)>;
8436+ if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
8437+ uint64_t size = 0;
8438+ return size;
8439+ }
8440+ else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
8441+ uint64_t size = 0;
8442+ size += FfiConverterTypeTonAddressString::allocation_size(arg.master);
8443+ return size;
8444+ }
8445+ else {
8446+ static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
8447+ }
8448+ }, val.variant);
8449+
8450+ return size;
8451+}
8452+
8453+
8454+std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::lift(RustBuffer buf) {
8455+ auto stream = RustStream(&buf);
8456+ auto ret = FfiConverterTonTransferLinkError::read(stream);
8457+
8458+ rustbuffer_free(buf);
8459+
8460+ return ret;
8461+}
8462+
8463+RustBuffer FfiConverterTonTransferLinkError::lower(const TonTransferLinkError &val) {
8464+ auto buf = rustbuffer_alloc(allocation_size(val));
8465+ auto stream = RustStream(&buf);
8466+
8467+ FfiConverterTonTransferLinkError::write(stream, val);
8468+
8469+ return std::move(buf);
8470+}
8471+
8472+std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::read(RustStream &stream) {
8473+ int32_t v;
8474+ stream >> v;
8475+
8476+ switch (v) {
8477+ case 1:
8478+ {
8479+ ton_transfer_link_error::NotTonTransfer var("TonTransferLinkError::NotTonTransfer");
8480+ return std::make_shared<ton_transfer_link_error::NotTonTransfer>(var);
8481+ }
8482+ case 2:
8483+ {
8484+ ton_transfer_link_error::InvalidUrl var("TonTransferLinkError::InvalidUrl");
8485+ return std::make_shared<ton_transfer_link_error::InvalidUrl>(var);
8486+ }
8487+ case 3:
8488+ {
8489+ ton_transfer_link_error::MissingRecipient var("TonTransferLinkError::MissingRecipient");
8490+ return std::make_shared<ton_transfer_link_error::MissingRecipient>(var);
8491+ }
8492+ case 4:
8493+ {
8494+ ton_transfer_link_error::InvalidRecipient var("TonTransferLinkError::InvalidRecipient");
8495+ return std::make_shared<ton_transfer_link_error::InvalidRecipient>(var);
8496+ }
8497+ case 5:
8498+ {
8499+ ton_transfer_link_error::DuplicateParameter var("TonTransferLinkError::DuplicateParameter");
8500+ var.name = FfiConverterString::read(stream);
8501+ return std::make_shared<ton_transfer_link_error::DuplicateParameter>(var);
8502+ }
8503+ case 6:
8504+ {
8505+ ton_transfer_link_error::UnsupportedParameter var("TonTransferLinkError::UnsupportedParameter");
8506+ var.name = FfiConverterString::read(stream);
8507+ return std::make_shared<ton_transfer_link_error::UnsupportedParameter>(var);
8508+ }
8509+ case 7:
8510+ {
8511+ ton_transfer_link_error::InvalidAmount var("TonTransferLinkError::InvalidAmount");
8512+ return std::make_shared<ton_transfer_link_error::InvalidAmount>(var);
8513+ }
8514+ case 8:
8515+ {
8516+ ton_transfer_link_error::InvalidExpiration var("TonTransferLinkError::InvalidExpiration");
8517+ return std::make_shared<ton_transfer_link_error::InvalidExpiration>(var);
8518+ }
8519+ case 9:
8520+ {
8521+ ton_transfer_link_error::InvalidJettonMaster var("TonTransferLinkError::InvalidJettonMaster");
8522+ return std::make_shared<ton_transfer_link_error::InvalidJettonMaster>(var);
8523+ }
8524+ case 10:
8525+ {
8526+ ton_transfer_link_error::InvalidBinaryPayload var("TonTransferLinkError::InvalidBinaryPayload");
8527+ return std::make_shared<ton_transfer_link_error::InvalidBinaryPayload>(var);
8528+ }
8529+ case 11:
8530+ {
8531+ ton_transfer_link_error::ConflictingPayloads var("TonTransferLinkError::ConflictingPayloads");
8532+ return std::make_shared<ton_transfer_link_error::ConflictingPayloads>(var);
8533+ }
8534+ case 12:
8535+ {
8536+ ton_transfer_link_error::BinaryJettonConflict var("TonTransferLinkError::BinaryJettonConflict");
8537+ return std::make_shared<ton_transfer_link_error::BinaryJettonConflict>(var);
8538+ }
8539+ default:
8540+ throw std::runtime_error("Unexpected error variant");
8541+ }
8542+}
8543+
8544+void FfiConverterTonTransferLinkError::write(RustStream &stream, const TonTransferLinkError &val) {
8545+ stream << val.get_variant_idx();
8546+ switch (val.get_variant_idx()) {
8547+ case 1:
8548+ {
8549+ auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
8550+ break;
8551+ }
8552+ case 2:
8553+ {
8554+ auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
8555+ break;
8556+ }
8557+ case 3:
8558+ {
8559+ auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
8560+ break;
8561+ }
8562+ case 4:
8563+ {
8564+ auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
8565+ break;
8566+ }
8567+ case 5:
8568+ {
8569+ auto var = static_cast<const ton_transfer_link_error::DuplicateParameter&>(val);
8570+ FfiConverterString::write(stream, var.name);
8571+ break;
8572+ }
8573+ case 6:
8574+ {
8575+ auto var = static_cast<const ton_transfer_link_error::UnsupportedParameter&>(val);
8576+ FfiConverterString::write(stream, var.name);
8577+ break;
8578+ }
8579+ case 7:
8580+ {
8581+ auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
8582+ break;
8583+ }
8584+ case 8:
8585+ {
8586+ auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
8587+ break;
8588+ }
8589+ case 9:
8590+ {
8591+ auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
8592+ break;
8593+ }
8594+ case 10:
8595+ {
8596+ auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
8597+ break;
8598+ }
8599+ case 11:
8600+ {
8601+ auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
8602+ break;
8603+ }
8604+ case 12:
8605+ {
8606+ auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
8607+ break;
8608+ }
8609+ }
8610+}
8611+
8612+uint64_t FfiConverterTonTransferLinkError::allocation_size(const TonTransferLinkError &val) {
8613+ switch (val.get_variant_idx()) {
8614+ case 1:
8615+ {
8616+ auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
8617+ return static_cast<uint64_t>(sizeof(int32_t));
8618+ }
8619+ case 2:
8620+ {
8621+ auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
8622+ return static_cast<uint64_t>(sizeof(int32_t));
8623+ }
8624+ case 3:
8625+ {
8626+ auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
8627+ return static_cast<uint64_t>(sizeof(int32_t));
8628+ }
8629+ case 4:
8630+ {
8631+ auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
8632+ return static_cast<uint64_t>(sizeof(int32_t));
8633+ }
8634+ case 5:
8635+ {
8636+ auto var = static_cast<const ton_transfer_link_error::DuplicateParameter&>(val);
8637+ return static_cast<uint64_t>(sizeof(int32_t)
8638+ + FfiConverterString::allocation_size(var.name));
8639+ }
8640+ case 6:
8641+ {
8642+ auto var = static_cast<const ton_transfer_link_error::UnsupportedParameter&>(val);
8643+ return static_cast<uint64_t>(sizeof(int32_t)
8644+ + FfiConverterString::allocation_size(var.name));
8645+ }
8646+ case 7:
8647+ {
8648+ auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
8649+ return static_cast<uint64_t>(sizeof(int32_t));
8650+ }
8651+ case 8:
8652+ {
8653+ auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
8654+ return static_cast<uint64_t>(sizeof(int32_t));
8655+ }
8656+ case 9:
8657+ {
8658+ auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
8659+ return static_cast<uint64_t>(sizeof(int32_t));
8660+ }
8661+ case 10:
8662+ {
8663+ auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
8664+ return static_cast<uint64_t>(sizeof(int32_t));
8665+ }
8666+ case 11:
8667+ {
8668+ auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
8669+ return static_cast<uint64_t>(sizeof(int32_t));
8670+ }
8671+ case 12:
8672+ {
8673+ auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
8674+ return static_cast<uint64_t>(sizeof(int32_t));
8675+ }
8676+ default:
8677+ throw std::runtime_error("Unexpected error variant");
8678+ }
8679+}
8680+
8681+
8682+TonTransferPayload FfiConverterTonTransferPayload::lift(RustBuffer buf) {
8683+ auto stream = RustStream(&buf);
8684+ auto ret = FfiConverterTonTransferPayload::read(stream);
8685+
8686+ rustbuffer_free(buf);
8687+
8688+ return std::move(ret);
8689+}
8690+
8691+RustBuffer FfiConverterTonTransferPayload::lower(const TonTransferPayload &val) {
8692+ auto buf = rustbuffer_alloc(FfiConverterTonTransferPayload::allocation_size(val));
8693+ auto stream = RustStream(&buf);
8694+
8695+ FfiConverterTonTransferPayload::write(stream, val);
8696+
8697+ return std::move(buf);
8698+}
8699+
8700+TonTransferPayload FfiConverterTonTransferPayload::read(RustStream &stream) {
8701+ int32_t variant_id;
8702+ stream >> variant_id;
8703+
8704+ switch (variant_id) {
8705+
8706+ case 1:
8707+ return TonTransferPayload::kNone {
8708+ };
8709+
8710+ case 2:
8711+ return TonTransferPayload::kText {
8712+ .text = FfiConverterString::read(stream),
8713+ };
8714+
8715+ case 3:
8716+ return TonTransferPayload::kBoc {
8717+ .boc = FfiConverterTypeBoc::read(stream),
8718+ };
8719+
8720+ default:
8721+ throw std::runtime_error("No matching TonTransferPayload variant");
8722+ }
8723+}
8724+
8725+void FfiConverterTonTransferPayload::write(RustStream &stream, const TonTransferPayload &val) {
8726+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8727+
8728+ stream << variant_id;
8729+
8730+ std::visit([&](auto &&arg) {
8731+ using T = std::decay_t<decltype(arg)>;
8732+ if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
8733+ }
8734+ else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
8735+ FfiConverterString::write(stream, arg.text);
8736+ }
8737+ else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
8738+ FfiConverterTypeBoc::write(stream, arg.boc);
8739+ }
8740+ else {
8741+ static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
8742+ }
8743+ }, val.variant);
8744+}
8745+
8746+uint64_t FfiConverterTonTransferPayload::allocation_size(const TonTransferPayload &val) {
8747+ uint64_t size = sizeof(int32_t);
8748+
8749+ size += std::visit([&](auto &&arg) {
8750+ using T = std::decay_t<decltype(arg)>;
8751+ if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
8752+ uint64_t size = 0;
8753+ return size;
8754+ }
8755+ else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
8756+ uint64_t size = 0;
8757+ size += FfiConverterString::allocation_size(arg.text);
8758+ return size;
8759+ }
8760+ else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
8761+ uint64_t size = 0;
8762+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
8763+ return size;
8764+ }
8765+ else {
8766+ static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
8767+ }
8768+ }, val.variant);
8769+
8770+ return size;
8771+}
8772+
8773+
8774+std::shared_ptr<WalletClientError> FfiConverterWalletClientError::lift(RustBuffer buf) {
8775+ auto stream = RustStream(&buf);
8776+ auto ret = FfiConverterWalletClientError::read(stream);
8777+
8778+ rustbuffer_free(buf);
8779+
8780+ return ret;
8781+}
8782+
8783+RustBuffer FfiConverterWalletClientError::lower(const WalletClientError &val) {
8784+ auto buf = rustbuffer_alloc(allocation_size(val));
8785+ auto stream = RustStream(&buf);
8786+
8787+ FfiConverterWalletClientError::write(stream, val);
8788+
8789+ return std::move(buf);
8790+}
8791+
8792+std::shared_ptr<WalletClientError> FfiConverterWalletClientError::read(RustStream &stream) {
8793+ int32_t v;
8794+ stream >> v;
8795+
8796+ switch (v) {
8797+ case 1:
8798+ {
8799+ wallet_client_error::InvalidLocalSecretReference var("WalletClientError::InvalidLocalSecretReference");
8800+ auto what_arg = FfiConverterString::lift(
8801+ rust_call(
8802+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8803+ nullptr,
8804+ FfiConverterWalletClientError::lower(var)
8805+ )
8806+ );
8807+ auto ret = std::make_shared<wallet_client_error::InvalidLocalSecretReference>(what_arg);
8808+ return ret;
8809+ }
8810+ case 2:
8811+ {
8812+ wallet_client_error::InvalidWalletPublicKey var("WalletClientError::InvalidWalletPublicKey");
8813+ auto what_arg = FfiConverterString::lift(
8814+ rust_call(
8815+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8816+ nullptr,
8817+ FfiConverterWalletClientError::lower(var)
8818+ )
8819+ );
8820+ auto ret = std::make_shared<wallet_client_error::InvalidWalletPublicKey>(what_arg);
8821+ return ret;
8822+ }
8823+ case 3:
8824+ {
8825+ wallet_client_error::WalletIdentityMismatch var("WalletClientError::WalletIdentityMismatch");
8826+ auto what_arg = FfiConverterString::lift(
8827+ rust_call(
8828+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8829+ nullptr,
8830+ FfiConverterWalletClientError::lower(var)
8831+ )
8832+ );
8833+ auto ret = std::make_shared<wallet_client_error::WalletIdentityMismatch>(what_arg);
8834+ return ret;
8835+ }
8836+ case 4:
8837+ {
8838+ wallet_client_error::InvalidProviderBaseUrl var("WalletClientError::InvalidProviderBaseUrl");
8839+ auto what_arg = FfiConverterString::lift(
8840+ rust_call(
8841+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8842+ nullptr,
8843+ FfiConverterWalletClientError::lower(var)
8844+ )
8845+ );
8846+ auto ret = std::make_shared<wallet_client_error::InvalidProviderBaseUrl>(what_arg);
8847+ return ret;
8848+ }
8849+ case 5:
8850+ {
8851+ wallet_client_error::InvalidSendRequest var("WalletClientError::InvalidSendRequest");
8852+ auto what_arg = FfiConverterString::lift(
8853+ rust_call(
8854+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8855+ nullptr,
8856+ FfiConverterWalletClientError::lower(var)
8857+ )
8858+ );
8859+ auto ret = std::make_shared<wallet_client_error::InvalidSendRequest>(what_arg);
8860+ return ret;
8861+ }
8862+ case 6:
8863+ {
8864+ wallet_client_error::NftTransferUnavailable var("WalletClientError::NftTransferUnavailable");
8865+ var.diagnostic = FfiConverterString::read(stream);
8866+ auto what_arg = FfiConverterString::lift(
8867+ rust_call(
8868+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8869+ nullptr,
8870+ FfiConverterWalletClientError::lower(var)
8871+ )
8872+ );
8873+ auto ret = std::make_shared<wallet_client_error::NftTransferUnavailable>(what_arg);
8874+ ret->diagnostic = std::move(var.diagnostic);
8875+ return ret;
8876+ }
8877+ case 7:
8878+ {
8879+ wallet_client_error::NftTransferEmulationRejected var("WalletClientError::NftTransferEmulationRejected");
8880+ var.diagnostic = FfiConverterString::read(stream);
8881+ auto what_arg = FfiConverterString::lift(
8882+ rust_call(
8883+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8884+ nullptr,
8885+ FfiConverterWalletClientError::lower(var)
8886+ )
8887+ );
8888+ auto ret = std::make_shared<wallet_client_error::NftTransferEmulationRejected>(what_arg);
8889+ ret->diagnostic = std::move(var.diagnostic);
8890+ return ret;
8891+ }
8892+ case 8:
8893+ {
8894+ wallet_client_error::EncryptedCommentUnavailable var("WalletClientError::EncryptedCommentUnavailable");
8895+ var.diagnostic = FfiConverterString::read(stream);
8896+ auto what_arg = FfiConverterString::lift(
8897+ rust_call(
8898+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8899+ nullptr,
8900+ FfiConverterWalletClientError::lower(var)
8901+ )
8902+ );
8903+ auto ret = std::make_shared<wallet_client_error::EncryptedCommentUnavailable>(what_arg);
8904+ ret->diagnostic = std::move(var.diagnostic);
8905+ return ret;
8906+ }
8907+ case 9:
8908+ {
8909+ wallet_client_error::DnsResolutionUnavailable var("WalletClientError::DnsResolutionUnavailable");
8910+ var.diagnostic = FfiConverterString::read(stream);
8911+ auto what_arg = FfiConverterString::lift(
8912+ rust_call(
8913+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8914+ nullptr,
8915+ FfiConverterWalletClientError::lower(var)
8916+ )
8917+ );
8918+ auto ret = std::make_shared<wallet_client_error::DnsResolutionUnavailable>(what_arg);
8919+ ret->diagnostic = std::move(var.diagnostic);
8920+ return ret;
8921+ }
8922+ case 10:
8923+ {
8924+ wallet_client_error::KeyRotationUnavailable var("WalletClientError::KeyRotationUnavailable");
8925+ var.diagnostic = FfiConverterString::read(stream);
8926+ auto what_arg = FfiConverterString::lift(
8927+ rust_call(
8928+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8929+ nullptr,
8930+ FfiConverterWalletClientError::lower(var)
8931+ )
8932+ );
8933+ auto ret = std::make_shared<wallet_client_error::KeyRotationUnavailable>(what_arg);
8934+ ret->diagnostic = std::move(var.diagnostic);
8935+ return ret;
8936+ }
8937+ case 11:
8938+ {
8939+ wallet_client_error::LocalSigningUnavailable var("WalletClientError::LocalSigningUnavailable");
8940+ auto what_arg = FfiConverterString::lift(
8941+ rust_call(
8942+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8943+ nullptr,
8944+ FfiConverterWalletClientError::lower(var)
8945+ )
8946+ );
8947+ auto ret = std::make_shared<wallet_client_error::LocalSigningUnavailable>(what_arg);
8948+ return ret;
8949+ }
8950+ case 12:
8951+ {
8952+ wallet_client_error::IdentifierExhausted var("WalletClientError::IdentifierExhausted");
8953+ auto what_arg = FfiConverterString::lift(
8954+ rust_call(
8955+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8956+ nullptr,
8957+ FfiConverterWalletClientError::lower(var)
8958+ )
8959+ );
8960+ auto ret = std::make_shared<wallet_client_error::IdentifierExhausted>(what_arg);
8961+ return ret;
8962+ }
8963+ case 13:
8964+ {
8965+ wallet_client_error::StateUnavailable var("WalletClientError::StateUnavailable");
8966+ auto what_arg = FfiConverterString::lift(
8967+ rust_call(
8968+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8969+ nullptr,
8970+ FfiConverterWalletClientError::lower(var)
8971+ )
8972+ );
8973+ auto ret = std::make_shared<wallet_client_error::StateUnavailable>(what_arg);
8974+ return ret;
8975+ }
8976+ case 14:
8977+ {
8978+ wallet_client_error::SendAlreadyInProgress var("WalletClientError::SendAlreadyInProgress");
8979+ auto what_arg = FfiConverterString::lift(
8980+ rust_call(
8981+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8982+ nullptr,
8983+ FfiConverterWalletClientError::lower(var)
8984+ )
8985+ );
8986+ auto ret = std::make_shared<wallet_client_error::SendAlreadyInProgress>(what_arg);
8987+ return ret;
8988+ }
8989+ case 15:
8990+ {
8991+ wallet_client_error::SendPreviewAlreadyInProgress var("WalletClientError::SendPreviewAlreadyInProgress");
8992+ auto what_arg = FfiConverterString::lift(
8993+ rust_call(
8994+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8995+ nullptr,
8996+ FfiConverterWalletClientError::lower(var)
8997+ )
8998+ );
8999+ auto ret = std::make_shared<wallet_client_error::SendPreviewAlreadyInProgress>(what_arg);
9000+ return ret;
9001+ }
9002+ case 16:
9003+ {
9004+ wallet_client_error::PreviousSubmissionUnresolved var("WalletClientError::PreviousSubmissionUnresolved");
9005+ auto what_arg = FfiConverterString::lift(
9006+ rust_call(
9007+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9008+ nullptr,
9009+ FfiConverterWalletClientError::lower(var)
9010+ )
9011+ );
9012+ auto ret = std::make_shared<wallet_client_error::PreviousSubmissionUnresolved>(what_arg);
9013+ return ret;
9014+ }
9015+ case 17:
9016+ {
9017+ wallet_client_error::WalletSeqnoNotAdvanced var("WalletClientError::WalletSeqnoNotAdvanced");
9018+ auto what_arg = FfiConverterString::lift(
9019+ rust_call(
9020+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9021+ nullptr,
9022+ FfiConverterWalletClientError::lower(var)
9023+ )
9024+ );
9025+ auto ret = std::make_shared<wallet_client_error::WalletSeqnoNotAdvanced>(what_arg);
9026+ return ret;
9027+ }
9028+ case 18:
9029+ {
9030+ wallet_client_error::SendAccountUnavailable var("WalletClientError::SendAccountUnavailable");
9031+ var.status = FfiConverterAccountStatus::read(stream);
9032+ auto what_arg = FfiConverterString::lift(
9033+ rust_call(
9034+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9035+ nullptr,
9036+ FfiConverterWalletClientError::lower(var)
9037+ )
9038+ );
9039+ auto ret = std::make_shared<wallet_client_error::SendAccountUnavailable>(what_arg);
9040+ ret->status = std::move(var.status);
9041+ return ret;
9042+ }
9043+ case 19:
9044+ {
9045+ wallet_client_error::InsufficientBalance var("WalletClientError::InsufficientBalance");
9046+ var.available_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9047+ var.requested_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9048+ auto what_arg = FfiConverterString::lift(
9049+ rust_call(
9050+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9051+ nullptr,
9052+ FfiConverterWalletClientError::lower(var)
9053+ )
9054+ );
9055+ auto ret = std::make_shared<wallet_client_error::InsufficientBalance>(what_arg);
9056+ ret->available_nanograms = std::move(var.available_nanograms);
9057+ ret->requested_nanograms = std::move(var.requested_nanograms);
9058+ return ret;
9059+ }
9060+ case 20:
9061+ {
9062+ wallet_client_error::InsufficientBalanceForFees var("WalletClientError::InsufficientBalanceForFees");
9063+ var.available_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9064+ var.requested_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9065+ var.estimated_fee_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9066+ auto what_arg = FfiConverterString::lift(
9067+ rust_call(
9068+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9069+ nullptr,
9070+ FfiConverterWalletClientError::lower(var)
9071+ )
9072+ );
9073+ auto ret = std::make_shared<wallet_client_error::InsufficientBalanceForFees>(what_arg);
9074+ ret->available_nanograms = std::move(var.available_nanograms);
9075+ ret->requested_nanograms = std::move(var.requested_nanograms);
9076+ ret->estimated_fee_nanograms = std::move(var.estimated_fee_nanograms);
9077+ return ret;
9078+ }
9079+ case 21:
9080+ {
9081+ wallet_client_error::InvalidProtectedSecret var("WalletClientError::InvalidProtectedSecret");
9082+ auto what_arg = FfiConverterString::lift(
9083+ rust_call(
9084+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9085+ nullptr,
9086+ FfiConverterWalletClientError::lower(var)
9087+ )
9088+ );
9089+ auto ret = std::make_shared<wallet_client_error::InvalidProtectedSecret>(what_arg);
9090+ return ret;
9091+ }
9092+ case 22:
9093+ {
9094+ wallet_client_error::SendPreviewFailed var("WalletClientError::SendPreviewFailed");
9095+ var.diagnostic = FfiConverterString::read(stream);
9096+ auto what_arg = FfiConverterString::lift(
9097+ rust_call(
9098+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9099+ nullptr,
9100+ FfiConverterWalletClientError::lower(var)
9101+ )
9102+ );
9103+ auto ret = std::make_shared<wallet_client_error::SendPreviewFailed>(what_arg);
9104+ ret->diagnostic = std::move(var.diagnostic);
9105+ return ret;
9106+ }
9107+ case 23:
9108+ {
9109+ wallet_client_error::EmulationFailed var("WalletClientError::EmulationFailed");
9110+ var.diagnostic = FfiConverterString::read(stream);
9111+ auto what_arg = FfiConverterString::lift(
9112+ rust_call(
9113+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9114+ nullptr,
9115+ FfiConverterWalletClientError::lower(var)
9116+ )
9117+ );
9118+ auto ret = std::make_shared<wallet_client_error::EmulationFailed>(what_arg);
9119+ ret->diagnostic = std::move(var.diagnostic);
9120+ return ret;
9121+ }
9122+ case 24:
9123+ {
9124+ wallet_client_error::EmulationMessageNotAccepted var("WalletClientError::EmulationMessageNotAccepted");
9125+ var.diagnostic = FfiConverterString::read(stream);
9126+ auto what_arg = FfiConverterString::lift(
9127+ rust_call(
9128+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9129+ nullptr,
9130+ FfiConverterWalletClientError::lower(var)
9131+ )
9132+ );
9133+ auto ret = std::make_shared<wallet_client_error::EmulationMessageNotAccepted>(what_arg);
9134+ ret->diagnostic = std::move(var.diagnostic);
9135+ return ret;
9136+ }
9137+ case 25:
9138+ {
9139+ wallet_client_error::EmulationRejected var("WalletClientError::EmulationRejected");
9140+ var.diagnostic = FfiConverterString::read(stream);
9141+ var.compute_exit_code = FfiConverterOptionalInt32::read(stream);
9142+ var.action_result_code = FfiConverterOptionalInt32::read(stream);
9143+ auto what_arg = FfiConverterString::lift(
9144+ rust_call(
9145+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9146+ nullptr,
9147+ FfiConverterWalletClientError::lower(var)
9148+ )
9149+ );
9150+ auto ret = std::make_shared<wallet_client_error::EmulationRejected>(what_arg);
9151+ ret->diagnostic = std::move(var.diagnostic);
9152+ ret->compute_exit_code = std::move(var.compute_exit_code);
9153+ ret->action_result_code = std::move(var.action_result_code);
9154+ return ret;
9155+ }
9156+ case 26:
9157+ {
9158+ wallet_client_error::SendFailed var("WalletClientError::SendFailed");
9159+ var.diagnostic = FfiConverterString::read(stream);
9160+ auto what_arg = FfiConverterString::lift(
9161+ rust_call(
9162+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9163+ nullptr,
9164+ FfiConverterWalletClientError::lower(var)
9165+ )
9166+ );
9167+ auto ret = std::make_shared<wallet_client_error::SendFailed>(what_arg);
9168+ ret->diagnostic = std::move(var.diagnostic);
9169+ return ret;
9170+ }
9171+ case 27:
9172+ {
9173+ wallet_client_error::SubmissionUnknown var("WalletClientError::SubmissionUnknown");
9174+ var.diagnostic = FfiConverterString::read(stream);
9175+ auto what_arg = FfiConverterString::lift(
9176+ rust_call(
9177+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9178+ nullptr,
9179+ FfiConverterWalletClientError::lower(var)
9180+ )
9181+ );
9182+ auto ret = std::make_shared<wallet_client_error::SubmissionUnknown>(what_arg);
9183+ ret->diagnostic = std::move(var.diagnostic);
9184+ return ret;
9185+ }
9186+ case 28:
9187+ {
9188+ wallet_client_error::SendCancellationTooLate var("WalletClientError::SendCancellationTooLate");
9189+ auto what_arg = FfiConverterString::lift(
9190+ rust_call(
9191+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9192+ nullptr,
9193+ FfiConverterWalletClientError::lower(var)
9194+ )
9195+ );
9196+ auto ret = std::make_shared<wallet_client_error::SendCancellationTooLate>(what_arg);
9197+ return ret;
9198+ }
9199+ case 29:
9200+ {
9201+ wallet_client_error::Shutdown var("WalletClientError::Shutdown");
9202+ auto what_arg = FfiConverterString::lift(
9203+ rust_call(
9204+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9205+ nullptr,
9206+ FfiConverterWalletClientError::lower(var)
9207+ )
9208+ );
9209+ auto ret = std::make_shared<wallet_client_error::Shutdown>(what_arg);
9210+ return ret;
9211+ }
9212+ case 30:
9213+ {
9214+ wallet_client_error::EncryptedCommentLookupFailed var("WalletClientError::EncryptedCommentLookupFailed");
9215+ var.diagnostic = FfiConverterString::read(stream);
9216+ auto what_arg = FfiConverterString::lift(
9217+ rust_call(
9218+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9219+ nullptr,
9220+ FfiConverterWalletClientError::lower(var)
9221+ )
9222+ );
9223+ auto ret = std::make_shared<wallet_client_error::EncryptedCommentLookupFailed>(what_arg);
9224+ ret->diagnostic = std::move(var.diagnostic);
9225+ return ret;
9226+ }
9227+ default:
9228+ throw std::runtime_error("Unexpected error variant");
9229+ }
9230+}
9231+
9232+void FfiConverterWalletClientError::write(RustStream &stream, const WalletClientError &val) {
9233+ stream << val.get_variant_idx();
9234+ switch (val.get_variant_idx()) {
9235+ case 1:
9236+ {
9237+ auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
9238+ break;
9239+ }
9240+ case 2:
9241+ {
9242+ auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
9243+ break;
9244+ }
9245+ case 3:
9246+ {
9247+ auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
9248+ break;
9249+ }
9250+ case 4:
9251+ {
9252+ auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
9253+ break;
9254+ }
9255+ case 5:
9256+ {
9257+ auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
9258+ break;
9259+ }
9260+ case 6:
9261+ {
9262+ auto var = static_cast<const wallet_client_error::NftTransferUnavailable&>(val);
9263+ FfiConverterString::write(stream, var.diagnostic);
9264+ break;
9265+ }
9266+ case 7:
9267+ {
9268+ auto var = static_cast<const wallet_client_error::NftTransferEmulationRejected&>(val);
9269+ FfiConverterString::write(stream, var.diagnostic);
9270+ break;
9271+ }
9272+ case 8:
9273+ {
9274+ auto var = static_cast<const wallet_client_error::EncryptedCommentUnavailable&>(val);
9275+ FfiConverterString::write(stream, var.diagnostic);
9276+ break;
9277+ }
9278+ case 9:
9279+ {
9280+ auto var = static_cast<const wallet_client_error::DnsResolutionUnavailable&>(val);
9281+ FfiConverterString::write(stream, var.diagnostic);
9282+ break;
9283+ }
9284+ case 10:
9285+ {
9286+ auto var = static_cast<const wallet_client_error::KeyRotationUnavailable&>(val);
9287+ FfiConverterString::write(stream, var.diagnostic);
9288+ break;
9289+ }
9290+ case 11:
9291+ {
9292+ auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
9293+ break;
9294+ }
9295+ case 12:
9296+ {
9297+ auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
9298+ break;
9299+ }
9300+ case 13:
9301+ {
9302+ auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
9303+ break;
9304+ }
9305+ case 14:
9306+ {
9307+ auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
9308+ break;
9309+ }
9310+ case 15:
9311+ {
9312+ auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
9313+ break;
9314+ }
9315+ case 16:
9316+ {
9317+ auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
9318+ break;
9319+ }
9320+ case 17:
9321+ {
9322+ auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
9323+ break;
9324+ }
9325+ case 18:
9326+ {
9327+ auto var = static_cast<const wallet_client_error::SendAccountUnavailable&>(val);
9328+ FfiConverterAccountStatus::write(stream, var.status);
9329+ break;
9330+ }
9331+ case 19:
9332+ {
9333+ auto var = static_cast<const wallet_client_error::InsufficientBalance&>(val);
9334+ FfiConverterTypeUnsignedDecimalString::write(stream, var.available_nanograms);
9335+ FfiConverterTypeUnsignedDecimalString::write(stream, var.requested_nanograms);
9336+ break;
9337+ }
9338+ case 20:
9339+ {
9340+ auto var = static_cast<const wallet_client_error::InsufficientBalanceForFees&>(val);
9341+ FfiConverterTypeUnsignedDecimalString::write(stream, var.available_nanograms);
9342+ FfiConverterTypeUnsignedDecimalString::write(stream, var.requested_nanograms);
9343+ FfiConverterTypeUnsignedDecimalString::write(stream, var.estimated_fee_nanograms);
9344+ break;
9345+ }
9346+ case 21:
9347+ {
9348+ auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
9349+ break;
9350+ }
9351+ case 22:
9352+ {
9353+ auto var = static_cast<const wallet_client_error::SendPreviewFailed&>(val);
9354+ FfiConverterString::write(stream, var.diagnostic);
9355+ break;
9356+ }
9357+ case 23:
9358+ {
9359+ auto var = static_cast<const wallet_client_error::EmulationFailed&>(val);
9360+ FfiConverterString::write(stream, var.diagnostic);
9361+ break;
9362+ }
9363+ case 24:
9364+ {
9365+ auto var = static_cast<const wallet_client_error::EmulationMessageNotAccepted&>(val);
9366+ FfiConverterString::write(stream, var.diagnostic);
9367+ break;
9368+ }
9369+ case 25:
9370+ {
9371+ auto var = static_cast<const wallet_client_error::EmulationRejected&>(val);
9372+ FfiConverterString::write(stream, var.diagnostic);
9373+ FfiConverterOptionalInt32::write(stream, var.compute_exit_code);
9374+ FfiConverterOptionalInt32::write(stream, var.action_result_code);
9375+ break;
9376+ }
9377+ case 26:
9378+ {
9379+ auto var = static_cast<const wallet_client_error::SendFailed&>(val);
9380+ FfiConverterString::write(stream, var.diagnostic);
9381+ break;
9382+ }
9383+ case 27:
9384+ {
9385+ auto var = static_cast<const wallet_client_error::SubmissionUnknown&>(val);
9386+ FfiConverterString::write(stream, var.diagnostic);
9387+ break;
9388+ }
9389+ case 28:
9390+ {
9391+ auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
9392+ break;
9393+ }
9394+ case 29:
9395+ {
9396+ auto var = static_cast<const wallet_client_error::Shutdown&>(val);
9397+ break;
9398+ }
9399+ case 30:
9400+ {
9401+ auto var = static_cast<const wallet_client_error::EncryptedCommentLookupFailed&>(val);
9402+ FfiConverterString::write(stream, var.diagnostic);
9403+ break;
9404+ }
9405+ }
9406+}
9407+
9408+uint64_t FfiConverterWalletClientError::allocation_size(const WalletClientError &val) {
9409+ switch (val.get_variant_idx()) {
9410+ case 1:
9411+ {
9412+ auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
9413+ return static_cast<uint64_t>(sizeof(int32_t));
9414+ }
9415+ case 2:
9416+ {
9417+ auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
9418+ return static_cast<uint64_t>(sizeof(int32_t));
9419+ }
9420+ case 3:
9421+ {
9422+ auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
9423+ return static_cast<uint64_t>(sizeof(int32_t));
9424+ }
9425+ case 4:
9426+ {
9427+ auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
9428+ return static_cast<uint64_t>(sizeof(int32_t));
9429+ }
9430+ case 5:
9431+ {
9432+ auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
9433+ return static_cast<uint64_t>(sizeof(int32_t));
9434+ }
9435+ case 6:
9436+ {
9437+ auto var = static_cast<const wallet_client_error::NftTransferUnavailable&>(val);
9438+ return static_cast<uint64_t>(sizeof(int32_t)
9439+ + FfiConverterString::allocation_size(var.diagnostic));
9440+ }
9441+ case 7:
9442+ {
9443+ auto var = static_cast<const wallet_client_error::NftTransferEmulationRejected&>(val);
9444+ return static_cast<uint64_t>(sizeof(int32_t)
9445+ + FfiConverterString::allocation_size(var.diagnostic));
9446+ }
9447+ case 8:
9448+ {
9449+ auto var = static_cast<const wallet_client_error::EncryptedCommentUnavailable&>(val);
9450+ return static_cast<uint64_t>(sizeof(int32_t)
9451+ + FfiConverterString::allocation_size(var.diagnostic));
9452+ }
9453+ case 9:
9454+ {
9455+ auto var = static_cast<const wallet_client_error::DnsResolutionUnavailable&>(val);
9456+ return static_cast<uint64_t>(sizeof(int32_t)
9457+ + FfiConverterString::allocation_size(var.diagnostic));
9458+ }
9459+ case 10:
9460+ {
9461+ auto var = static_cast<const wallet_client_error::KeyRotationUnavailable&>(val);
9462+ return static_cast<uint64_t>(sizeof(int32_t)
9463+ + FfiConverterString::allocation_size(var.diagnostic));
9464+ }
9465+ case 11:
9466+ {
9467+ auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
9468+ return static_cast<uint64_t>(sizeof(int32_t));
9469+ }
9470+ case 12:
9471+ {
9472+ auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
9473+ return static_cast<uint64_t>(sizeof(int32_t));
9474+ }
9475+ case 13:
9476+ {
9477+ auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
9478+ return static_cast<uint64_t>(sizeof(int32_t));
9479+ }
9480+ case 14:
9481+ {
9482+ auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
9483+ return static_cast<uint64_t>(sizeof(int32_t));
9484+ }
9485+ case 15:
9486+ {
9487+ auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
9488+ return static_cast<uint64_t>(sizeof(int32_t));
9489+ }
9490+ case 16:
9491+ {
9492+ auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
9493+ return static_cast<uint64_t>(sizeof(int32_t));
9494+ }
9495+ case 17:
9496+ {
9497+ auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
9498+ return static_cast<uint64_t>(sizeof(int32_t));
9499+ }
9500+ case 18:
9501+ {
9502+ auto var = static_cast<const wallet_client_error::SendAccountUnavailable&>(val);
9503+ return static_cast<uint64_t>(sizeof(int32_t)
9504+ + FfiConverterAccountStatus::allocation_size(var.status));
9505+ }
9506+ case 19:
9507+ {
9508+ auto var = static_cast<const wallet_client_error::InsufficientBalance&>(val);
9509+ return static_cast<uint64_t>(sizeof(int32_t)
9510+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.available_nanograms)
9511+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.requested_nanograms));
9512+ }
9513+ case 20:
9514+ {
9515+ auto var = static_cast<const wallet_client_error::InsufficientBalanceForFees&>(val);
9516+ return static_cast<uint64_t>(sizeof(int32_t)
9517+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.available_nanograms)
9518+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.requested_nanograms)
9519+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.estimated_fee_nanograms));
9520+ }
9521+ case 21:
9522+ {
9523+ auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
9524+ return static_cast<uint64_t>(sizeof(int32_t));
9525+ }
9526+ case 22:
9527+ {
9528+ auto var = static_cast<const wallet_client_error::SendPreviewFailed&>(val);
9529+ return static_cast<uint64_t>(sizeof(int32_t)
9530+ + FfiConverterString::allocation_size(var.diagnostic));
9531+ }
9532+ case 23:
9533+ {
9534+ auto var = static_cast<const wallet_client_error::EmulationFailed&>(val);
9535+ return static_cast<uint64_t>(sizeof(int32_t)
9536+ + FfiConverterString::allocation_size(var.diagnostic));
9537+ }
9538+ case 24:
9539+ {
9540+ auto var = static_cast<const wallet_client_error::EmulationMessageNotAccepted&>(val);
9541+ return static_cast<uint64_t>(sizeof(int32_t)
9542+ + FfiConverterString::allocation_size(var.diagnostic));
9543+ }
9544+ case 25:
9545+ {
9546+ auto var = static_cast<const wallet_client_error::EmulationRejected&>(val);
9547+ return static_cast<uint64_t>(sizeof(int32_t)
9548+ + FfiConverterString::allocation_size(var.diagnostic)
9549+ + FfiConverterOptionalInt32::allocation_size(var.compute_exit_code)
9550+ + FfiConverterOptionalInt32::allocation_size(var.action_result_code));
9551+ }
9552+ case 26:
9553+ {
9554+ auto var = static_cast<const wallet_client_error::SendFailed&>(val);
9555+ return static_cast<uint64_t>(sizeof(int32_t)
9556+ + FfiConverterString::allocation_size(var.diagnostic));
9557+ }
9558+ case 27:
9559+ {
9560+ auto var = static_cast<const wallet_client_error::SubmissionUnknown&>(val);
9561+ return static_cast<uint64_t>(sizeof(int32_t)
9562+ + FfiConverterString::allocation_size(var.diagnostic));
9563+ }
9564+ case 28:
9565+ {
9566+ auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
9567+ return static_cast<uint64_t>(sizeof(int32_t));
9568+ }
9569+ case 29:
9570+ {
9571+ auto var = static_cast<const wallet_client_error::Shutdown&>(val);
9572+ return static_cast<uint64_t>(sizeof(int32_t));
9573+ }
9574+ case 30:
9575+ {
9576+ auto var = static_cast<const wallet_client_error::EncryptedCommentLookupFailed&>(val);
9577+ return static_cast<uint64_t>(sizeof(int32_t)
9578+ + FfiConverterString::allocation_size(var.diagnostic));
9579+ }
9580+ default:
9581+ throw std::runtime_error("Unexpected error variant");
9582+ }
9583+}
9584+
9585+
9586+std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::lift(RustBuffer buf) {
9587+ auto stream = RustStream(&buf);
9588+ auto ret = FfiConverterWalletLifecycleError::read(stream);
9589+
9590+ rustbuffer_free(buf);
9591+
9592+ return ret;
9593+}
9594+
9595+RustBuffer FfiConverterWalletLifecycleError::lower(const WalletLifecycleError &val) {
9596+ auto buf = rustbuffer_alloc(allocation_size(val));
9597+ auto stream = RustStream(&buf);
9598+
9599+ FfiConverterWalletLifecycleError::write(stream, val);
9600+
9601+ return std::move(buf);
9602+}
9603+
9604+std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::read(RustStream &stream) {
9605+ int32_t v;
9606+ stream >> v;
9607+
9608+ switch (v) {
9609+ case 1:
9610+ {
9611+ wallet_lifecycle_error::InvalidRecordId var("WalletLifecycleError::InvalidRecordId");
9612+ auto what_arg = FfiConverterString::lift(
9613+ rust_call(
9614+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9615+ nullptr,
9616+ FfiConverterWalletLifecycleError::lower(var)
9617+ )
9618+ );
9619+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecordId>(what_arg);
9620+ return ret;
9621+ }
9622+ case 2:
9623+ {
9624+ wallet_lifecycle_error::InvalidRecoveryPhrase var("WalletLifecycleError::InvalidRecoveryPhrase");
9625+ auto what_arg = FfiConverterString::lift(
9626+ rust_call(
9627+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9628+ nullptr,
9629+ FfiConverterWalletLifecycleError::lower(var)
9630+ )
9631+ );
9632+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecoveryPhrase>(what_arg);
9633+ return ret;
9634+ }
9635+ case 3:
9636+ {
9637+ wallet_lifecycle_error::AddressDerivationFailed var("WalletLifecycleError::AddressDerivationFailed");
9638+ auto what_arg = FfiConverterString::lift(
9639+ rust_call(
9640+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9641+ nullptr,
9642+ FfiConverterWalletLifecycleError::lower(var)
9643+ )
9644+ );
9645+ auto ret = std::make_shared<wallet_lifecycle_error::AddressDerivationFailed>(what_arg);
9646+ return ret;
9647+ }
9648+ case 4:
9649+ {
9650+ wallet_lifecycle_error::TonConnectSigningFailed var("WalletLifecycleError::TonConnectSigningFailed");
9651+ auto what_arg = FfiConverterString::lift(
9652+ rust_call(
9653+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9654+ nullptr,
9655+ FfiConverterWalletLifecycleError::lower(var)
9656+ )
9657+ );
9658+ auto ret = std::make_shared<wallet_lifecycle_error::TonConnectSigningFailed>(what_arg);
9659+ return ret;
9660+ }
9661+ case 5:
9662+ {
9663+ wallet_lifecycle_error::SecretWalletMismatch var("WalletLifecycleError::SecretWalletMismatch");
9664+ auto what_arg = FfiConverterString::lift(
9665+ rust_call(
9666+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9667+ nullptr,
9668+ FfiConverterWalletLifecycleError::lower(var)
9669+ )
9670+ );
9671+ auto ret = std::make_shared<wallet_lifecycle_error::SecretWalletMismatch>(what_arg);
9672+ return ret;
9673+ }
9674+ case 6:
9675+ {
9676+ wallet_lifecycle_error::ProtectedSecretHost var("WalletLifecycleError::ProtectedSecretHost");
9677+ var.kind = FfiConverterProtectedSecretHostErrorKind::read(stream);
9678+ var.diagnostic = FfiConverterString::read(stream);
9679+ auto what_arg = FfiConverterString::lift(
9680+ rust_call(
9681+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9682+ nullptr,
9683+ FfiConverterWalletLifecycleError::lower(var)
9684+ )
9685+ );
9686+ auto ret = std::make_shared<wallet_lifecycle_error::ProtectedSecretHost>(what_arg);
9687+ ret->kind = std::move(var.kind);
9688+ ret->diagnostic = std::move(var.diagnostic);
9689+ return ret;
9690+ }
9691+ case 7:
9692+ {
9693+ wallet_lifecycle_error::InvalidTonConnectSessionInput var("WalletLifecycleError::InvalidTonConnectSessionInput");
9694+ auto what_arg = FfiConverterString::lift(
9695+ rust_call(
9696+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9697+ nullptr,
9698+ FfiConverterWalletLifecycleError::lower(var)
9699+ )
9700+ );
9701+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidTonConnectSessionInput>(what_arg);
9702+ return ret;
9703+ }
9704+ default:
9705+ throw std::runtime_error("Unexpected error variant");
9706+ }
9707+}
9708+
9709+void FfiConverterWalletLifecycleError::write(RustStream &stream, const WalletLifecycleError &val) {
9710+ stream << val.get_variant_idx();
9711+ switch (val.get_variant_idx()) {
9712+ case 1:
9713+ {
9714+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
9715+ break;
9716+ }
9717+ case 2:
9718+ {
9719+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
9720+ break;
9721+ }
9722+ case 3:
9723+ {
9724+ auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
9725+ break;
9726+ }
9727+ case 4:
9728+ {
9729+ auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
9730+ break;
9731+ }
9732+ case 5:
9733+ {
9734+ auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
9735+ break;
9736+ }
9737+ case 6:
9738+ {
9739+ auto var = static_cast<const wallet_lifecycle_error::ProtectedSecretHost&>(val);
9740+ FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
9741+ FfiConverterString::write(stream, var.diagnostic);
9742+ break;
9743+ }
9744+ case 7:
9745+ {
9746+ auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
9747+ break;
9748+ }
9749+ }
9750+}
9751+
9752+uint64_t FfiConverterWalletLifecycleError::allocation_size(const WalletLifecycleError &val) {
9753+ switch (val.get_variant_idx()) {
9754+ case 1:
9755+ {
9756+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
9757+ return static_cast<uint64_t>(sizeof(int32_t));
9758+ }
9759+ case 2:
9760+ {
9761+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
9762+ return static_cast<uint64_t>(sizeof(int32_t));
9763+ }
9764+ case 3:
9765+ {
9766+ auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
9767+ return static_cast<uint64_t>(sizeof(int32_t));
9768+ }
9769+ case 4:
9770+ {
9771+ auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
9772+ return static_cast<uint64_t>(sizeof(int32_t));
9773+ }
9774+ case 5:
9775+ {
9776+ auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
9777+ return static_cast<uint64_t>(sizeof(int32_t));
9778+ }
9779+ case 6:
9780+ {
9781+ auto var = static_cast<const wallet_lifecycle_error::ProtectedSecretHost&>(val);
9782+ return static_cast<uint64_t>(sizeof(int32_t)
9783+ + FfiConverterProtectedSecretHostErrorKind::allocation_size(var.kind)
9784+ + FfiConverterString::allocation_size(var.diagnostic));
9785+ }
9786+ case 7:
9787+ {
9788+ auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
9789+ return static_cast<uint64_t>(sizeof(int32_t));
9790+ }
9791+ default:
9792+ throw std::runtime_error("Unexpected error variant");
9793+ }
9794+}
9795+
9796+
9797+WalletOperationOutcome FfiConverterWalletOperationOutcome::lift(RustBuffer buf) {
9798+ auto stream = RustStream(&buf);
9799+ auto ret = FfiConverterWalletOperationOutcome::read(stream);
9800+
9801+ rustbuffer_free(buf);
9802+
9803+ return std::move(ret);
9804+}
9805+
9806+RustBuffer FfiConverterWalletOperationOutcome::lower(const WalletOperationOutcome &val) {
9807+ auto buf = rustbuffer_alloc(FfiConverterWalletOperationOutcome::allocation_size(val));
9808+ auto stream = RustStream(&buf);
9809+
9810+ FfiConverterWalletOperationOutcome::write(stream, val);
9811+
9812+ return std::move(buf);
9813+}
9814+
9815+WalletOperationOutcome FfiConverterWalletOperationOutcome::read(RustStream &stream) {
9816+ int32_t variant;
9817+ stream >> variant;
9818+
9819+ switch (variant) {
9820+
9821+ case 1:
9822+ return WalletOperationOutcome::kCompleted;
9823+
9824+ case 2:
9825+ return WalletOperationOutcome::kPartiallyCompleted;
9826+
9827+ case 3:
9828+ return WalletOperationOutcome::kFailed;
9829+
9830+ case 4:
9831+ return WalletOperationOutcome::kCancelled;
9832+
9833+ case 5:
9834+ return WalletOperationOutcome::kSuperseded;
9835+
9836+ case 6:
9837+ return WalletOperationOutcome::kSkipped;
9838+
9839+ default:
9840+ throw std::runtime_error("No matching WalletOperationOutcome variant");
9841+ }
9842+}
9843+
9844+void FfiConverterWalletOperationOutcome::write(RustStream &stream, const WalletOperationOutcome &val) {
9845+ switch (val) {
9846+
9847+ case WalletOperationOutcome::kCompleted:
9848+ stream << static_cast<int32_t>(1);
9849+ break;
9850+
9851+ case WalletOperationOutcome::kPartiallyCompleted:
9852+ stream << static_cast<int32_t>(2);
9853+ break;
9854+
9855+ case WalletOperationOutcome::kFailed:
9856+ stream << static_cast<int32_t>(3);
9857+ break;
9858+
9859+ case WalletOperationOutcome::kCancelled:
9860+ stream << static_cast<int32_t>(4);
9861+ break;
9862+
9863+ case WalletOperationOutcome::kSuperseded:
9864+ stream << static_cast<int32_t>(5);
9865+ break;
9866+
9867+ case WalletOperationOutcome::kSkipped:
9868+ stream << static_cast<int32_t>(6);
9869+ break;
9870+
9871+ default:
9872+ throw std::runtime_error("No matching WalletOperationOutcome variant");
9873+ }
9874+}
9875+
9876+uint64_t FfiConverterWalletOperationOutcome::allocation_size(const WalletOperationOutcome &) {
9877+ return static_cast<uint64_t>(sizeof(int32_t));
9878+}
9879+
9880+std::optional<uint16_t> FfiConverterOptionalUInt16::lift(RustBuffer buf) {
9881+ auto stream = RustStream(&buf);
9882+ auto ret = FfiConverterOptionalUInt16::read(stream);
9883+
9884+ rustbuffer_free(buf);
9885+
9886+ return ret;
9887+}
9888+
9889+RustBuffer FfiConverterOptionalUInt16::lower(const std::optional<uint16_t>& val) {
9890+ auto buf = rustbuffer_alloc(FfiConverterOptionalUInt16::allocation_size(val));
9891+ auto stream = RustStream(&buf);
9892+
9893+ FfiConverterOptionalUInt16::write(stream, val);
9894+
9895+ return buf;
9896+}
9897+
9898+std::optional<uint16_t> FfiConverterOptionalUInt16::read(RustStream &stream) {
9899+ char has_value;
9900+
9901+ stream.get(has_value);
9902+ if (has_value) {
9903+ return std::make_optional(FfiConverterUInt16::read(stream));
9904+ } else {
9905+ return std::nullopt;
9906+ }
9907+}
9908+
9909+void FfiConverterOptionalUInt16::write(RustStream &stream, const std::optional<uint16_t>& value) {
9910+ stream.put(static_cast<uint8_t>(!!value));
9911+
9912+ if (value) {
9913+ FfiConverterUInt16::write(stream, value.value());
9914+ }
9915+}
9916+
9917+uint64_t FfiConverterOptionalUInt16::allocation_size(const std::optional<uint16_t> &val) {
9918+ uint64_t ret = 1;
9919+
9920+ if (val) {
9921+ ret += FfiConverterUInt16::allocation_size(val.value());
9922+ }
9923+
9924+ return ret;
9925+}
9926+
9927+std::optional<int32_t> FfiConverterOptionalInt32::lift(RustBuffer buf) {
9928+ auto stream = RustStream(&buf);
9929+ auto ret = FfiConverterOptionalInt32::read(stream);
9930+
9931+ rustbuffer_free(buf);
9932+
9933+ return ret;
9934+}
9935+
9936+RustBuffer FfiConverterOptionalInt32::lower(const std::optional<int32_t>& val) {
9937+ auto buf = rustbuffer_alloc(FfiConverterOptionalInt32::allocation_size(val));
9938+ auto stream = RustStream(&buf);
9939+
9940+ FfiConverterOptionalInt32::write(stream, val);
9941+
9942+ return buf;
9943+}
9944+
9945+std::optional<int32_t> FfiConverterOptionalInt32::read(RustStream &stream) {
9946+ char has_value;
9947+
9948+ stream.get(has_value);
9949+ if (has_value) {
9950+ return std::make_optional(FfiConverterInt32::read(stream));
9951+ } else {
9952+ return std::nullopt;
9953+ }
9954+}
9955+
9956+void FfiConverterOptionalInt32::write(RustStream &stream, const std::optional<int32_t>& value) {
9957+ stream.put(static_cast<uint8_t>(!!value));
9958+
9959+ if (value) {
9960+ FfiConverterInt32::write(stream, value.value());
9961+ }
9962+}
9963+
9964+uint64_t FfiConverterOptionalInt32::allocation_size(const std::optional<int32_t> &val) {
9965+ uint64_t ret = 1;
9966+
9967+ if (val) {
9968+ ret += FfiConverterInt32::allocation_size(val.value());
9969+ }
9970+
9971+ return ret;
9972+}
9973+
9974+std::optional<uint64_t> FfiConverterOptionalUInt64::lift(RustBuffer buf) {
9975+ auto stream = RustStream(&buf);
9976+ auto ret = FfiConverterOptionalUInt64::read(stream);
9977+
9978+ rustbuffer_free(buf);
9979+
9980+ return ret;
9981+}
9982+
9983+RustBuffer FfiConverterOptionalUInt64::lower(const std::optional<uint64_t>& val) {
9984+ auto buf = rustbuffer_alloc(FfiConverterOptionalUInt64::allocation_size(val));
9985+ auto stream = RustStream(&buf);
9986+
9987+ FfiConverterOptionalUInt64::write(stream, val);
9988+
9989+ return buf;
9990+}
9991+
9992+std::optional<uint64_t> FfiConverterOptionalUInt64::read(RustStream &stream) {
9993+ char has_value;
9994+
9995+ stream.get(has_value);
9996+ if (has_value) {
9997+ return std::make_optional(FfiConverterUInt64::read(stream));
9998+ } else {
9999+ return std::nullopt;
10000+ }
10001+}
10002+
10003+void FfiConverterOptionalUInt64::write(RustStream &stream, const std::optional<uint64_t>& value) {
10004+ stream.put(static_cast<uint8_t>(!!value));
10005+
10006+ if (value) {
10007+ FfiConverterUInt64::write(stream, value.value());
10008+ }
10009+}
10010+
10011+uint64_t FfiConverterOptionalUInt64::allocation_size(const std::optional<uint64_t> &val) {
10012+ uint64_t ret = 1;
10013+
10014+ if (val) {
10015+ ret += FfiConverterUInt64::allocation_size(val.value());
10016+ }
10017+
10018+ return ret;
10019+}
10020+
10021+std::optional<int64_t> FfiConverterOptionalInt64::lift(RustBuffer buf) {
10022+ auto stream = RustStream(&buf);
10023+ auto ret = FfiConverterOptionalInt64::read(stream);
10024+
10025+ rustbuffer_free(buf);
10026+
10027+ return ret;
10028+}
10029+
10030+RustBuffer FfiConverterOptionalInt64::lower(const std::optional<int64_t>& val) {
10031+ auto buf = rustbuffer_alloc(FfiConverterOptionalInt64::allocation_size(val));
10032+ auto stream = RustStream(&buf);
10033+
10034+ FfiConverterOptionalInt64::write(stream, val);
10035+
10036+ return buf;
10037+}
10038+
10039+std::optional<int64_t> FfiConverterOptionalInt64::read(RustStream &stream) {
10040+ char has_value;
10041+
10042+ stream.get(has_value);
10043+ if (has_value) {
10044+ return std::make_optional(FfiConverterInt64::read(stream));
10045+ } else {
10046+ return std::nullopt;
10047+ }
10048+}
10049+
10050+void FfiConverterOptionalInt64::write(RustStream &stream, const std::optional<int64_t>& value) {
10051+ stream.put(static_cast<uint8_t>(!!value));
10052+
10053+ if (value) {
10054+ FfiConverterInt64::write(stream, value.value());
10055+ }
10056+}
10057+
10058+uint64_t FfiConverterOptionalInt64::allocation_size(const std::optional<int64_t> &val) {
10059+ uint64_t ret = 1;
10060+
10061+ if (val) {
10062+ ret += FfiConverterInt64::allocation_size(val.value());
10063+ }
10064+
10065+ return ret;
10066+}
10067+
10068+std::optional<bool> FfiConverterOptionalBool::lift(RustBuffer buf) {
10069+ auto stream = RustStream(&buf);
10070+ auto ret = FfiConverterOptionalBool::read(stream);
10071+
10072+ rustbuffer_free(buf);
10073+
10074+ return ret;
10075+}
10076+
10077+RustBuffer FfiConverterOptionalBool::lower(const std::optional<bool>& val) {
10078+ auto buf = rustbuffer_alloc(FfiConverterOptionalBool::allocation_size(val));
10079+ auto stream = RustStream(&buf);
10080+
10081+ FfiConverterOptionalBool::write(stream, val);
10082+
10083+ return buf;
10084+}
10085+
10086+std::optional<bool> FfiConverterOptionalBool::read(RustStream &stream) {
10087+ char has_value;
10088+
10089+ stream.get(has_value);
10090+ if (has_value) {
10091+ return std::make_optional(FfiConverterBool::read(stream));
10092+ } else {
10093+ return std::nullopt;
10094+ }
10095+}
10096+
10097+void FfiConverterOptionalBool::write(RustStream &stream, const std::optional<bool>& value) {
10098+ stream.put(static_cast<uint8_t>(!!value));
10099+
10100+ if (value) {
10101+ FfiConverterBool::write(stream, value.value());
10102+ }
10103+}
10104+
10105+uint64_t FfiConverterOptionalBool::allocation_size(const std::optional<bool> &val) {
10106+ uint64_t ret = 1;
10107+
10108+ if (val) {
10109+ ret += FfiConverterBool::allocation_size(val.value());
10110+ }
10111+
10112+ return ret;
10113+}
10114+
10115+std::optional<std::string> FfiConverterOptionalString::lift(RustBuffer buf) {
10116+ auto stream = RustStream(&buf);
10117+ auto ret = FfiConverterOptionalString::read(stream);
10118+
10119+ rustbuffer_free(buf);
10120+
10121+ return ret;
10122+}
10123+
10124+RustBuffer FfiConverterOptionalString::lower(const std::optional<std::string>& val) {
10125+ auto buf = rustbuffer_alloc(FfiConverterOptionalString::allocation_size(val));
10126+ auto stream = RustStream(&buf);
10127+
10128+ FfiConverterOptionalString::write(stream, val);
10129+
10130+ return buf;
10131+}
10132+
10133+std::optional<std::string> FfiConverterOptionalString::read(RustStream &stream) {
10134+ char has_value;
10135+
10136+ stream.get(has_value);
10137+ if (has_value) {
10138+ return std::make_optional(FfiConverterString::read(stream));
10139+ } else {
10140+ return std::nullopt;
10141+ }
10142+}
10143+
10144+void FfiConverterOptionalString::write(RustStream &stream, const std::optional<std::string>& value) {
10145+ stream.put(static_cast<uint8_t>(!!value));
10146+
10147+ if (value) {
10148+ FfiConverterString::write(stream, value.value());
10149+ }
10150+}
10151+
10152+uint64_t FfiConverterOptionalString::allocation_size(const std::optional<std::string> &val) {
10153+ uint64_t ret = 1;
10154+
10155+ if (val) {
10156+ ret += FfiConverterString::allocation_size(val.value());
10157+ }
10158+
10159+ return ret;
10160+}
10161+
10162+std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::lift(RustBuffer buf) {
10163+ auto stream = RustStream(&buf);
10164+ auto ret = FfiConverterOptionalBytes::read(stream);
10165+
10166+ rustbuffer_free(buf);
10167+
10168+ return ret;
10169+}
10170+
10171+RustBuffer FfiConverterOptionalBytes::lower(const std::optional<std::vector<uint8_t>>& val) {
10172+ auto buf = rustbuffer_alloc(FfiConverterOptionalBytes::allocation_size(val));
10173+ auto stream = RustStream(&buf);
10174+
10175+ FfiConverterOptionalBytes::write(stream, val);
10176+
10177+ return buf;
10178+}
10179+
10180+std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::read(RustStream &stream) {
10181+ char has_value;
10182+
10183+ stream.get(has_value);
10184+ if (has_value) {
10185+ return std::make_optional(FfiConverterBytes::read(stream));
10186+ } else {
10187+ return std::nullopt;
10188+ }
10189+}
10190+
10191+void FfiConverterOptionalBytes::write(RustStream &stream, const std::optional<std::vector<uint8_t>>& value) {
10192+ stream.put(static_cast<uint8_t>(!!value));
10193+
10194+ if (value) {
10195+ FfiConverterBytes::write(stream, value.value());
10196+ }
10197+}
10198+
10199+uint64_t FfiConverterOptionalBytes::allocation_size(const std::optional<std::vector<uint8_t>> &val) {
10200+ uint64_t ret = 1;
10201+
10202+ if (val) {
10203+ ret += FfiConverterBytes::allocation_size(val.value());
10204+ }
10205+
10206+ return ret;
10207+}
10208+
10209+std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::lift(RustBuffer buf) {
10210+ auto stream = RustStream(&buf);
10211+ auto ret = FfiConverterOptionalTypeAccountSnapshot::read(stream);
10212+
10213+ rustbuffer_free(buf);
10214+
10215+ return ret;
10216+}
10217+
10218+RustBuffer FfiConverterOptionalTypeAccountSnapshot::lower(const std::optional<AccountSnapshot>& val) {
10219+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeAccountSnapshot::allocation_size(val));
10220+ auto stream = RustStream(&buf);
10221+
10222+ FfiConverterOptionalTypeAccountSnapshot::write(stream, val);
10223+
10224+ return buf;
10225+}
10226+
10227+std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::read(RustStream &stream) {
10228+ char has_value;
10229+
10230+ stream.get(has_value);
10231+ if (has_value) {
10232+ return std::make_optional(FfiConverterTypeAccountSnapshot::read(stream));
10233+ } else {
10234+ return std::nullopt;
10235+ }
10236+}
10237+
10238+void FfiConverterOptionalTypeAccountSnapshot::write(RustStream &stream, const std::optional<AccountSnapshot>& value) {
10239+ stream.put(static_cast<uint8_t>(!!value));
10240+
10241+ if (value) {
10242+ FfiConverterTypeAccountSnapshot::write(stream, value.value());
10243+ }
10244+}
10245+
10246+uint64_t FfiConverterOptionalTypeAccountSnapshot::allocation_size(const std::optional<AccountSnapshot> &val) {
10247+ uint64_t ret = 1;
10248+
10249+ if (val) {
10250+ ret += FfiConverterTypeAccountSnapshot::allocation_size(val.value());
10251+ }
10252+
10253+ return ret;
10254+}
10255+
10256+std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::lift(RustBuffer buf) {
10257+ auto stream = RustStream(&buf);
10258+ auto ret = FfiConverterOptionalTypeActivityCursor::read(stream);
10259+
10260+ rustbuffer_free(buf);
10261+
10262+ return ret;
10263+}
10264+
10265+RustBuffer FfiConverterOptionalTypeActivityCursor::lower(const std::optional<ActivityCursor>& val) {
10266+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeActivityCursor::allocation_size(val));
10267+ auto stream = RustStream(&buf);
10268+
10269+ FfiConverterOptionalTypeActivityCursor::write(stream, val);
10270+
10271+ return buf;
10272+}
10273+
10274+std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::read(RustStream &stream) {
10275+ char has_value;
10276+
10277+ stream.get(has_value);
10278+ if (has_value) {
10279+ return std::make_optional(FfiConverterTypeActivityCursor::read(stream));
10280+ } else {
10281+ return std::nullopt;
10282+ }
10283+}
10284+
10285+void FfiConverterOptionalTypeActivityCursor::write(RustStream &stream, const std::optional<ActivityCursor>& value) {
10286+ stream.put(static_cast<uint8_t>(!!value));
10287+
10288+ if (value) {
10289+ FfiConverterTypeActivityCursor::write(stream, value.value());
10290+ }
10291+}
10292+
10293+uint64_t FfiConverterOptionalTypeActivityCursor::allocation_size(const std::optional<ActivityCursor> &val) {
10294+ uint64_t ret = 1;
10295+
10296+ if (val) {
10297+ ret += FfiConverterTypeActivityCursor::allocation_size(val.value());
10298+ }
10299+
10300+ return ret;
10301+}
10302+
10303+std::optional<DomainError> FfiConverterOptionalTypeDomainError::lift(RustBuffer buf) {
10304+ auto stream = RustStream(&buf);
10305+ auto ret = FfiConverterOptionalTypeDomainError::read(stream);
10306+
10307+ rustbuffer_free(buf);
10308+
10309+ return ret;
10310+}
10311+
10312+RustBuffer FfiConverterOptionalTypeDomainError::lower(const std::optional<DomainError>& val) {
10313+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeDomainError::allocation_size(val));
10314+ auto stream = RustStream(&buf);
10315+
10316+ FfiConverterOptionalTypeDomainError::write(stream, val);
10317+
10318+ return buf;
10319+}
10320+
10321+std::optional<DomainError> FfiConverterOptionalTypeDomainError::read(RustStream &stream) {
10322+ char has_value;
10323+
10324+ stream.get(has_value);
10325+ if (has_value) {
10326+ return std::make_optional(FfiConverterTypeDomainError::read(stream));
10327+ } else {
10328+ return std::nullopt;
10329+ }
10330+}
10331+
10332+void FfiConverterOptionalTypeDomainError::write(RustStream &stream, const std::optional<DomainError>& value) {
10333+ stream.put(static_cast<uint8_t>(!!value));
10334+
10335+ if (value) {
10336+ FfiConverterTypeDomainError::write(stream, value.value());
10337+ }
10338+}
10339+
10340+uint64_t FfiConverterOptionalTypeDomainError::allocation_size(const std::optional<DomainError> &val) {
10341+ uint64_t ret = 1;
10342+
10343+ if (val) {
10344+ ret += FfiConverterTypeDomainError::allocation_size(val.value());
10345+ }
10346+
10347+ return ret;
10348+}
10349+
10350+std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::lift(RustBuffer buf) {
10351+ auto stream = RustStream(&buf);
10352+ auto ret = FfiConverterOptionalTypeJournalRecord::read(stream);
10353+
10354+ rustbuffer_free(buf);
10355+
10356+ return ret;
10357+}
10358+
10359+RustBuffer FfiConverterOptionalTypeJournalRecord::lower(const std::optional<JournalRecord>& val) {
10360+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeJournalRecord::allocation_size(val));
10361+ auto stream = RustStream(&buf);
10362+
10363+ FfiConverterOptionalTypeJournalRecord::write(stream, val);
10364+
10365+ return buf;
10366+}
10367+
10368+std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::read(RustStream &stream) {
10369+ char has_value;
10370+
10371+ stream.get(has_value);
10372+ if (has_value) {
10373+ return std::make_optional(FfiConverterTypeJournalRecord::read(stream));
10374+ } else {
10375+ return std::nullopt;
10376+ }
10377+}
10378+
10379+void FfiConverterOptionalTypeJournalRecord::write(RustStream &stream, const std::optional<JournalRecord>& value) {
10380+ stream.put(static_cast<uint8_t>(!!value));
10381+
10382+ if (value) {
10383+ FfiConverterTypeJournalRecord::write(stream, value.value());
10384+ }
10385+}
10386+
10387+uint64_t FfiConverterOptionalTypeJournalRecord::allocation_size(const std::optional<JournalRecord> &val) {
10388+ uint64_t ret = 1;
10389+
10390+ if (val) {
10391+ ret += FfiConverterTypeJournalRecord::allocation_size(val.value());
10392+ }
10393+
10394+ return ret;
10395+}
10396+
10397+std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::lift(RustBuffer buf) {
10398+ auto stream = RustStream(&buf);
10399+ auto ret = FfiConverterOptionalTypeNftCollectionDescriptor::read(stream);
10400+
10401+ rustbuffer_free(buf);
10402+
10403+ return ret;
10404+}
10405+
10406+RustBuffer FfiConverterOptionalTypeNftCollectionDescriptor::lower(const std::optional<NftCollectionDescriptor>& val) {
10407+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(val));
10408+ auto stream = RustStream(&buf);
10409+
10410+ FfiConverterOptionalTypeNftCollectionDescriptor::write(stream, val);
10411+
10412+ return buf;
10413+}
10414+
10415+std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::read(RustStream &stream) {
10416+ char has_value;
10417+
10418+ stream.get(has_value);
10419+ if (has_value) {
10420+ return std::make_optional(FfiConverterTypeNftCollectionDescriptor::read(stream));
10421+ } else {
10422+ return std::nullopt;
10423+ }
10424+}
10425+
10426+void FfiConverterOptionalTypeNftCollectionDescriptor::write(RustStream &stream, const std::optional<NftCollectionDescriptor>& value) {
10427+ stream.put(static_cast<uint8_t>(!!value));
10428+
10429+ if (value) {
10430+ FfiConverterTypeNftCollectionDescriptor::write(stream, value.value());
10431+ }
10432+}
10433+
10434+uint64_t FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(const std::optional<NftCollectionDescriptor> &val) {
10435+ uint64_t ret = 1;
10436+
10437+ if (val) {
10438+ ret += FfiConverterTypeNftCollectionDescriptor::allocation_size(val.value());
10439+ }
10440+
10441+ return ret;
10442+}
10443+
10444+std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::lift(RustBuffer buf) {
10445+ auto stream = RustStream(&buf);
10446+ auto ret = FfiConverterOptionalTypeProtectedSecretRef::read(stream);
10447+
10448+ rustbuffer_free(buf);
10449+
10450+ return ret;
10451+}
10452+
10453+RustBuffer FfiConverterOptionalTypeProtectedSecretRef::lower(const std::optional<ProtectedSecretRef>& val) {
10454+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeProtectedSecretRef::allocation_size(val));
10455+ auto stream = RustStream(&buf);
10456+
10457+ FfiConverterOptionalTypeProtectedSecretRef::write(stream, val);
10458+
10459+ return buf;
10460+}
10461+
10462+std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::read(RustStream &stream) {
10463+ char has_value;
10464+
10465+ stream.get(has_value);
10466+ if (has_value) {
10467+ return std::make_optional(FfiConverterTypeProtectedSecretRef::read(stream));
10468+ } else {
10469+ return std::nullopt;
10470+ }
10471+}
10472+
10473+void FfiConverterOptionalTypeProtectedSecretRef::write(RustStream &stream, const std::optional<ProtectedSecretRef>& value) {
10474+ stream.put(static_cast<uint8_t>(!!value));
10475+
10476+ if (value) {
10477+ FfiConverterTypeProtectedSecretRef::write(stream, value.value());
10478+ }
10479+}
10480+
10481+uint64_t FfiConverterOptionalTypeProtectedSecretRef::allocation_size(const std::optional<ProtectedSecretRef> &val) {
10482+ uint64_t ret = 1;
10483+
10484+ if (val) {
10485+ ret += FfiConverterTypeProtectedSecretRef::allocation_size(val.value());
10486+ }
10487+
10488+ return ret;
10489+}
10490+
10491+std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::lift(RustBuffer buf) {
10492+ auto stream = RustStream(&buf);
10493+ auto ret = FfiConverterOptionalTypeResolutionInfo::read(stream);
10494+
10495+ rustbuffer_free(buf);
10496+
10497+ return ret;
10498+}
10499+
10500+RustBuffer FfiConverterOptionalTypeResolutionInfo::lower(const std::optional<ResolutionInfo>& val) {
10501+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeResolutionInfo::allocation_size(val));
10502+ auto stream = RustStream(&buf);
10503+
10504+ FfiConverterOptionalTypeResolutionInfo::write(stream, val);
10505+
10506+ return buf;
10507+}
10508+
10509+std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::read(RustStream &stream) {
10510+ char has_value;
10511+
10512+ stream.get(has_value);
10513+ if (has_value) {
10514+ return std::make_optional(FfiConverterTypeResolutionInfo::read(stream));
10515+ } else {
10516+ return std::nullopt;
10517+ }
10518+}
10519+
10520+void FfiConverterOptionalTypeResolutionInfo::write(RustStream &stream, const std::optional<ResolutionInfo>& value) {
10521+ stream.put(static_cast<uint8_t>(!!value));
10522+
10523+ if (value) {
10524+ FfiConverterTypeResolutionInfo::write(stream, value.value());
10525+ }
10526+}
10527+
10528+uint64_t FfiConverterOptionalTypeResolutionInfo::allocation_size(const std::optional<ResolutionInfo> &val) {
10529+ uint64_t ret = 1;
10530+
10531+ if (val) {
10532+ ret += FfiConverterTypeResolutionInfo::allocation_size(val.value());
10533+ }
10534+
10535+ return ret;
10536+}
10537+
10538+std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
10539+ auto stream = RustStream(&buf);
10540+ auto ret = FfiConverterOptionalTypeTonConnectConnectPrompt::read(stream);
10541+
10542+ rustbuffer_free(buf);
10543+
10544+ return ret;
10545+}
10546+
10547+RustBuffer FfiConverterOptionalTypeTonConnectConnectPrompt::lower(const std::optional<TonConnectConnectPrompt>& val) {
10548+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(val));
10549+ auto stream = RustStream(&buf);
10550+
10551+ FfiConverterOptionalTypeTonConnectConnectPrompt::write(stream, val);
10552+
10553+ return buf;
10554+}
10555+
10556+std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::read(RustStream &stream) {
10557+ char has_value;
10558+
10559+ stream.get(has_value);
10560+ if (has_value) {
10561+ return std::make_optional(FfiConverterTypeTonConnectConnectPrompt::read(stream));
10562+ } else {
10563+ return std::nullopt;
10564+ }
10565+}
10566+
10567+void FfiConverterOptionalTypeTonConnectConnectPrompt::write(RustStream &stream, const std::optional<TonConnectConnectPrompt>& value) {
10568+ stream.put(static_cast<uint8_t>(!!value));
10569+
10570+ if (value) {
10571+ FfiConverterTypeTonConnectConnectPrompt::write(stream, value.value());
10572+ }
10573+}
10574+
10575+uint64_t FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(const std::optional<TonConnectConnectPrompt> &val) {
10576+ uint64_t ret = 1;
10577+
10578+ if (val) {
10579+ ret += FfiConverterTypeTonConnectConnectPrompt::allocation_size(val.value());
10580+ }
10581+
10582+ return ret;
10583+}
10584+
10585+std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::lift(RustBuffer buf) {
10586+ auto stream = RustStream(&buf);
10587+ auto ret = FfiConverterOptionalTypeTonConnectPreparedPost::read(stream);
10588+
10589+ rustbuffer_free(buf);
10590+
10591+ return ret;
10592+}
10593+
10594+RustBuffer FfiConverterOptionalTypeTonConnectPreparedPost::lower(const std::optional<TonConnectPreparedPost>& val) {
10595+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(val));
10596+ auto stream = RustStream(&buf);
10597+
10598+ FfiConverterOptionalTypeTonConnectPreparedPost::write(stream, val);
10599+
10600+ return buf;
10601+}
10602+
10603+std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::read(RustStream &stream) {
10604+ char has_value;
10605+
10606+ stream.get(has_value);
10607+ if (has_value) {
10608+ return std::make_optional(FfiConverterTypeTonConnectPreparedPost::read(stream));
10609+ } else {
10610+ return std::nullopt;
10611+ }
10612+}
10613+
10614+void FfiConverterOptionalTypeTonConnectPreparedPost::write(RustStream &stream, const std::optional<TonConnectPreparedPost>& value) {
10615+ stream.put(static_cast<uint8_t>(!!value));
10616+
10617+ if (value) {
10618+ FfiConverterTypeTonConnectPreparedPost::write(stream, value.value());
10619+ }
10620+}
10621+
10622+uint64_t FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(const std::optional<TonConnectPreparedPost> &val) {
10623+ uint64_t ret = 1;
10624+
10625+ if (val) {
10626+ ret += FfiConverterTypeTonConnectPreparedPost::allocation_size(val.value());
10627+ }
10628+
10629+ return ret;
10630+}
10631+
10632+std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::lift(RustBuffer buf) {
10633+ auto stream = RustStream(&buf);
10634+ auto ret = FfiConverterOptionalTypeTonConnectProofReply::read(stream);
10635+
10636+ rustbuffer_free(buf);
10637+
10638+ return ret;
10639+}
10640+
10641+RustBuffer FfiConverterOptionalTypeTonConnectProofReply::lower(const std::optional<TonConnectProofReply>& val) {
10642+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectProofReply::allocation_size(val));
10643+ auto stream = RustStream(&buf);
10644+
10645+ FfiConverterOptionalTypeTonConnectProofReply::write(stream, val);
10646+
10647+ return buf;
10648+}
10649+
10650+std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::read(RustStream &stream) {
10651+ char has_value;
10652+
10653+ stream.get(has_value);
10654+ if (has_value) {
10655+ return std::make_optional(FfiConverterTypeTonConnectProofReply::read(stream));
10656+ } else {
10657+ return std::nullopt;
10658+ }
10659+}
10660+
10661+void FfiConverterOptionalTypeTonConnectProofReply::write(RustStream &stream, const std::optional<TonConnectProofReply>& value) {
10662+ stream.put(static_cast<uint8_t>(!!value));
10663+
10664+ if (value) {
10665+ FfiConverterTypeTonConnectProofReply::write(stream, value.value());
10666+ }
10667+}
10668+
10669+uint64_t FfiConverterOptionalTypeTonConnectProofReply::allocation_size(const std::optional<TonConnectProofReply> &val) {
10670+ uint64_t ret = 1;
10671+
10672+ if (val) {
10673+ ret += FfiConverterTypeTonConnectProofReply::allocation_size(val.value());
10674+ }
10675+
10676+ return ret;
10677+}
10678+
10679+std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::lift(RustBuffer buf) {
10680+ auto stream = RustStream(&buf);
10681+ auto ret = FfiConverterOptionalHttpHostErrorKind::read(stream);
10682+
10683+ rustbuffer_free(buf);
10684+
10685+ return ret;
10686+}
10687+
10688+RustBuffer FfiConverterOptionalHttpHostErrorKind::lower(const std::optional<HttpHostErrorKind>& val) {
10689+ auto buf = rustbuffer_alloc(FfiConverterOptionalHttpHostErrorKind::allocation_size(val));
10690+ auto stream = RustStream(&buf);
10691+
10692+ FfiConverterOptionalHttpHostErrorKind::write(stream, val);
10693+
10694+ return buf;
10695+}
10696+
10697+std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::read(RustStream &stream) {
10698+ char has_value;
10699+
10700+ stream.get(has_value);
10701+ if (has_value) {
10702+ return std::make_optional(FfiConverterHttpHostErrorKind::read(stream));
10703+ } else {
10704+ return std::nullopt;
10705+ }
10706+}
10707+
10708+void FfiConverterOptionalHttpHostErrorKind::write(RustStream &stream, const std::optional<HttpHostErrorKind>& value) {
10709+ stream.put(static_cast<uint8_t>(!!value));
10710+
10711+ if (value) {
10712+ FfiConverterHttpHostErrorKind::write(stream, value.value());
10713+ }
10714+}
10715+
10716+uint64_t FfiConverterOptionalHttpHostErrorKind::allocation_size(const std::optional<HttpHostErrorKind> &val) {
10717+ uint64_t ret = 1;
10718+
10719+ if (val) {
10720+ ret += FfiConverterHttpHostErrorKind::allocation_size(val.value());
10721+ }
10722+
10723+ return ret;
10724+}
10725+
10726+std::optional<PendingReason> FfiConverterOptionalPendingReason::lift(RustBuffer buf) {
10727+ auto stream = RustStream(&buf);
10728+ auto ret = FfiConverterOptionalPendingReason::read(stream);
10729+
10730+ rustbuffer_free(buf);
10731+
10732+ return ret;
10733+}
10734+
10735+RustBuffer FfiConverterOptionalPendingReason::lower(const std::optional<PendingReason>& val) {
10736+ auto buf = rustbuffer_alloc(FfiConverterOptionalPendingReason::allocation_size(val));
10737+ auto stream = RustStream(&buf);
10738+
10739+ FfiConverterOptionalPendingReason::write(stream, val);
10740+
10741+ return buf;
10742+}
10743+
10744+std::optional<PendingReason> FfiConverterOptionalPendingReason::read(RustStream &stream) {
10745+ char has_value;
10746+
10747+ stream.get(has_value);
10748+ if (has_value) {
10749+ return std::make_optional(FfiConverterPendingReason::read(stream));
10750+ } else {
10751+ return std::nullopt;
10752+ }
10753+}
10754+
10755+void FfiConverterOptionalPendingReason::write(RustStream &stream, const std::optional<PendingReason>& value) {
10756+ stream.put(static_cast<uint8_t>(!!value));
10757+
10758+ if (value) {
10759+ FfiConverterPendingReason::write(stream, value.value());
10760+ }
10761+}
10762+
10763+uint64_t FfiConverterOptionalPendingReason::allocation_size(const std::optional<PendingReason> &val) {
10764+ uint64_t ret = 1;
10765+
10766+ if (val) {
10767+ ret += FfiConverterPendingReason::allocation_size(val.value());
10768+ }
10769+
10770+ return ret;
10771+}
10772+
10773+std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::lift(RustBuffer buf) {
10774+ auto stream = RustStream(&buf);
10775+ auto ret = FfiConverterOptionalTypeBase64Hash::read(stream);
10776+
10777+ rustbuffer_free(buf);
10778+
10779+ return ret;
10780+}
10781+
10782+RustBuffer FfiConverterOptionalTypeBase64Hash::lower(const std::optional<Base64Hash>& val) {
10783+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBase64Hash::allocation_size(val));
10784+ auto stream = RustStream(&buf);
10785+
10786+ FfiConverterOptionalTypeBase64Hash::write(stream, val);
10787+
10788+ return buf;
10789+}
10790+
10791+std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::read(RustStream &stream) {
10792+ char has_value;
10793+
10794+ stream.get(has_value);
10795+ if (has_value) {
10796+ return std::make_optional(FfiConverterTypeBase64Hash::read(stream));
10797+ } else {
10798+ return std::nullopt;
10799+ }
10800+}
10801+
10802+void FfiConverterOptionalTypeBase64Hash::write(RustStream &stream, const std::optional<Base64Hash>& value) {
10803+ stream.put(static_cast<uint8_t>(!!value));
10804+
10805+ if (value) {
10806+ FfiConverterTypeBase64Hash::write(stream, value.value());
10807+ }
10808+}
10809+
10810+uint64_t FfiConverterOptionalTypeBase64Hash::allocation_size(const std::optional<Base64Hash> &val) {
10811+ uint64_t ret = 1;
10812+
10813+ if (val) {
10814+ ret += FfiConverterTypeBase64Hash::allocation_size(val.value());
10815+ }
10816+
10817+ return ret;
10818+}
10819+
10820+std::optional<Boc> FfiConverterOptionalTypeBoc::lift(RustBuffer buf) {
10821+ auto stream = RustStream(&buf);
10822+ auto ret = FfiConverterOptionalTypeBoc::read(stream);
10823+
10824+ rustbuffer_free(buf);
10825+
10826+ return ret;
10827+}
10828+
10829+RustBuffer FfiConverterOptionalTypeBoc::lower(const std::optional<Boc>& val) {
10830+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBoc::allocation_size(val));
10831+ auto stream = RustStream(&buf);
10832+
10833+ FfiConverterOptionalTypeBoc::write(stream, val);
10834+
10835+ return buf;
10836+}
10837+
10838+std::optional<Boc> FfiConverterOptionalTypeBoc::read(RustStream &stream) {
10839+ char has_value;
10840+
10841+ stream.get(has_value);
10842+ if (has_value) {
10843+ return std::make_optional(FfiConverterTypeBoc::read(stream));
10844+ } else {
10845+ return std::nullopt;
10846+ }
10847+}
10848+
10849+void FfiConverterOptionalTypeBoc::write(RustStream &stream, const std::optional<Boc>& value) {
10850+ stream.put(static_cast<uint8_t>(!!value));
10851+
10852+ if (value) {
10853+ FfiConverterTypeBoc::write(stream, value.value());
10854+ }
10855+}
10856+
10857+uint64_t FfiConverterOptionalTypeBoc::allocation_size(const std::optional<Boc> &val) {
10858+ uint64_t ret = 1;
10859+
10860+ if (val) {
10861+ ret += FfiConverterTypeBoc::allocation_size(val.value());
10862+ }
10863+
10864+ return ret;
10865+}
10866+
10867+std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::lift(RustBuffer buf) {
10868+ auto stream = RustStream(&buf);
10869+ auto ret = FfiConverterOptionalTypeNonEmptyString::read(stream);
10870+
10871+ rustbuffer_free(buf);
10872+
10873+ return ret;
10874+}
10875+
10876+RustBuffer FfiConverterOptionalTypeNonEmptyString::lower(const std::optional<NonEmptyString>& val) {
10877+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNonEmptyString::allocation_size(val));
10878+ auto stream = RustStream(&buf);
10879+
10880+ FfiConverterOptionalTypeNonEmptyString::write(stream, val);
10881+
10882+ return buf;
10883+}
10884+
10885+std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::read(RustStream &stream) {
10886+ char has_value;
10887+
10888+ stream.get(has_value);
10889+ if (has_value) {
10890+ return std::make_optional(FfiConverterTypeNonEmptyString::read(stream));
10891+ } else {
10892+ return std::nullopt;
10893+ }
10894+}
10895+
10896+void FfiConverterOptionalTypeNonEmptyString::write(RustStream &stream, const std::optional<NonEmptyString>& value) {
10897+ stream.put(static_cast<uint8_t>(!!value));
10898+
10899+ if (value) {
10900+ FfiConverterTypeNonEmptyString::write(stream, value.value());
10901+ }
10902+}
10903+
10904+uint64_t FfiConverterOptionalTypeNonEmptyString::allocation_size(const std::optional<NonEmptyString> &val) {
10905+ uint64_t ret = 1;
10906+
10907+ if (val) {
10908+ ret += FfiConverterTypeNonEmptyString::allocation_size(val.value());
10909+ }
10910+
10911+ return ret;
10912+}
10913+
10914+std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::lift(RustBuffer buf) {
10915+ auto stream = RustStream(&buf);
10916+ auto ret = FfiConverterOptionalTypeTonAddressString::read(stream);
10917+
10918+ rustbuffer_free(buf);
10919+
10920+ return ret;
10921+}
10922+
10923+RustBuffer FfiConverterOptionalTypeTonAddressString::lower(const std::optional<TonAddressString>& val) {
10924+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonAddressString::allocation_size(val));
10925+ auto stream = RustStream(&buf);
10926+
10927+ FfiConverterOptionalTypeTonAddressString::write(stream, val);
10928+
10929+ return buf;
10930+}
10931+
10932+std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::read(RustStream &stream) {
10933+ char has_value;
10934+
10935+ stream.get(has_value);
10936+ if (has_value) {
10937+ return std::make_optional(FfiConverterTypeTonAddressString::read(stream));
10938+ } else {
10939+ return std::nullopt;
10940+ }
10941+}
10942+
10943+void FfiConverterOptionalTypeTonAddressString::write(RustStream &stream, const std::optional<TonAddressString>& value) {
10944+ stream.put(static_cast<uint8_t>(!!value));
10945+
10946+ if (value) {
10947+ FfiConverterTypeTonAddressString::write(stream, value.value());
10948+ }
10949+}
10950+
10951+uint64_t FfiConverterOptionalTypeTonAddressString::allocation_size(const std::optional<TonAddressString> &val) {
10952+ uint64_t ret = 1;
10953+
10954+ if (val) {
10955+ ret += FfiConverterTypeTonAddressString::allocation_size(val.value());
10956+ }
10957+
10958+ return ret;
10959+}
10960+
10961+std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::lift(RustBuffer buf) {
10962+ auto stream = RustStream(&buf);
10963+ auto ret = FfiConverterOptionalTypeUnsignedDecimalString::read(stream);
10964+
10965+ rustbuffer_free(buf);
10966+
10967+ return ret;
10968+}
10969+
10970+RustBuffer FfiConverterOptionalTypeUnsignedDecimalString::lower(const std::optional<UnsignedDecimalString>& val) {
10971+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val));
10972+ auto stream = RustStream(&buf);
10973+
10974+ FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val);
10975+
10976+ return buf;
10977+}
10978+
10979+std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::read(RustStream &stream) {
10980+ char has_value;
10981+
10982+ stream.get(has_value);
10983+ if (has_value) {
10984+ return std::make_optional(FfiConverterTypeUnsignedDecimalString::read(stream));
10985+ } else {
10986+ return std::nullopt;
10987+ }
10988+}
10989+
10990+void FfiConverterOptionalTypeUnsignedDecimalString::write(RustStream &stream, const std::optional<UnsignedDecimalString>& value) {
10991+ stream.put(static_cast<uint8_t>(!!value));
10992+
10993+ if (value) {
10994+ FfiConverterTypeUnsignedDecimalString::write(stream, value.value());
10995+ }
10996+}
10997+
10998+uint64_t FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(const std::optional<UnsignedDecimalString> &val) {
10999+ uint64_t ret = 1;
11000+
11001+ if (val) {
11002+ ret += FfiConverterTypeUnsignedDecimalString::allocation_size(val.value());
11003+ }
11004+
11005+ return ret;
11006+}
11007+
11008+
11009+std::vector<std::string> FfiConverterSequenceString::lift(RustBuffer buf) {
11010+ auto stream = RustStream(&buf);
11011+ auto ret = read(stream);
11012+
11013+ rustbuffer_free(buf);
11014+
11015+ return ret;
11016+}
11017+
11018+RustBuffer FfiConverterSequenceString::lower(const std::vector<std::string> &val) {
11019+ auto buf = rustbuffer_alloc(allocation_size(val));
11020+ auto stream = RustStream(&buf);
11021+
11022+ write(stream, val);
11023+
11024+ return buf;
11025+}
11026+
11027+std::vector<std::string> FfiConverterSequenceString::read(RustStream &stream) {
11028+ std::vector<std::string> ret;
11029+ int32_t count;
11030+ stream >> count;
11031+
11032+ ret.reserve(count);
11033+
11034+ for (decltype(count) i = 0; i < count; i++) {
11035+ ret.push_back(FfiConverterString::read(stream));
11036+ }
11037+
11038+ return ret;
11039+}
11040+
11041+void FfiConverterSequenceString::write(RustStream &stream, const std::vector<std::string> &val) {
11042+ stream << static_cast<int32_t>(val.size());
11043+
11044+ for (auto &elem : val) {
11045+ FfiConverterString::write(stream, elem);
11046+ }
11047+}
11048+
11049+uint64_t FfiConverterSequenceString::allocation_size(const std::vector<std::string> &val) {
11050+ uint64_t size = sizeof(int32_t);
11051+
11052+ for (auto &elem : val) {
11053+ size += FfiConverterString::allocation_size(elem);
11054+ }
11055+
11056+ return size;
11057+}
11058+
11059+
11060+std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::lift(RustBuffer buf) {
11061+ auto stream = RustStream(&buf);
11062+ auto ret = read(stream);
11063+
11064+ rustbuffer_free(buf);
11065+
11066+ return ret;
11067+}
11068+
11069+RustBuffer FfiConverterSequenceTypeActivityItem::lower(const std::vector<ActivityItem> &val) {
11070+ auto buf = rustbuffer_alloc(allocation_size(val));
11071+ auto stream = RustStream(&buf);
11072+
11073+ write(stream, val);
11074+
11075+ return buf;
11076+}
11077+
11078+std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::read(RustStream &stream) {
11079+ std::vector<ActivityItem> ret;
11080+ int32_t count;
11081+ stream >> count;
11082+
11083+ ret.reserve(count);
11084+
11085+ for (decltype(count) i = 0; i < count; i++) {
11086+ ret.push_back(FfiConverterTypeActivityItem::read(stream));
11087+ }
11088+
11089+ return ret;
11090+}
11091+
11092+void FfiConverterSequenceTypeActivityItem::write(RustStream &stream, const std::vector<ActivityItem> &val) {
11093+ stream << static_cast<int32_t>(val.size());
11094+
11095+ for (auto &elem : val) {
11096+ FfiConverterTypeActivityItem::write(stream, elem);
11097+ }
11098+}
11099+
11100+uint64_t FfiConverterSequenceTypeActivityItem::allocation_size(const std::vector<ActivityItem> &val) {
11101+ uint64_t size = sizeof(int32_t);
11102+
11103+ for (auto &elem : val) {
11104+ size += FfiConverterTypeActivityItem::allocation_size(elem);
11105+ }
11106+
11107+ return size;
11108+}
11109+
11110+
11111+std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::lift(RustBuffer buf) {
11112+ auto stream = RustStream(&buf);
11113+ auto ret = read(stream);
11114+
11115+ rustbuffer_free(buf);
11116+
11117+ return ret;
11118+}
11119+
11120+RustBuffer FfiConverterSequenceTypeHttpHeader::lower(const std::vector<HttpHeader> &val) {
11121+ auto buf = rustbuffer_alloc(allocation_size(val));
11122+ auto stream = RustStream(&buf);
11123+
11124+ write(stream, val);
11125+
11126+ return buf;
11127+}
11128+
11129+std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::read(RustStream &stream) {
11130+ std::vector<HttpHeader> ret;
11131+ int32_t count;
11132+ stream >> count;
11133+
11134+ ret.reserve(count);
11135+
11136+ for (decltype(count) i = 0; i < count; i++) {
11137+ ret.push_back(FfiConverterTypeHttpHeader::read(stream));
11138+ }
11139+
11140+ return ret;
11141+}
11142+
11143+void FfiConverterSequenceTypeHttpHeader::write(RustStream &stream, const std::vector<HttpHeader> &val) {
11144+ stream << static_cast<int32_t>(val.size());
11145+
11146+ for (auto &elem : val) {
11147+ FfiConverterTypeHttpHeader::write(stream, elem);
11148+ }
11149+}
11150+
11151+uint64_t FfiConverterSequenceTypeHttpHeader::allocation_size(const std::vector<HttpHeader> &val) {
11152+ uint64_t size = sizeof(int32_t);
11153+
11154+ for (auto &elem : val) {
11155+ size += FfiConverterTypeHttpHeader::allocation_size(elem);
11156+ }
11157+
11158+ return size;
11159+}
11160+
11161+
11162+std::vector<NftItem> FfiConverterSequenceTypeNftItem::lift(RustBuffer buf) {
11163+ auto stream = RustStream(&buf);
11164+ auto ret = read(stream);
11165+
11166+ rustbuffer_free(buf);
11167+
11168+ return ret;
11169+}
11170+
11171+RustBuffer FfiConverterSequenceTypeNftItem::lower(const std::vector<NftItem> &val) {
11172+ auto buf = rustbuffer_alloc(allocation_size(val));
11173+ auto stream = RustStream(&buf);
11174+
11175+ write(stream, val);
11176+
11177+ return buf;
11178+}
11179+
11180+std::vector<NftItem> FfiConverterSequenceTypeNftItem::read(RustStream &stream) {
11181+ std::vector<NftItem> ret;
11182+ int32_t count;
11183+ stream >> count;
11184+
11185+ ret.reserve(count);
11186+
11187+ for (decltype(count) i = 0; i < count; i++) {
11188+ ret.push_back(FfiConverterTypeNftItem::read(stream));
11189+ }
11190+
11191+ return ret;
11192+}
11193+
11194+void FfiConverterSequenceTypeNftItem::write(RustStream &stream, const std::vector<NftItem> &val) {
11195+ stream << static_cast<int32_t>(val.size());
11196+
11197+ for (auto &elem : val) {
11198+ FfiConverterTypeNftItem::write(stream, elem);
11199+ }
11200+}
11201+
11202+uint64_t FfiConverterSequenceTypeNftItem::allocation_size(const std::vector<NftItem> &val) {
11203+ uint64_t size = sizeof(int32_t);
11204+
11205+ for (auto &elem : val) {
11206+ size += FfiConverterTypeNftItem::allocation_size(elem);
11207+ }
11208+
11209+ return size;
11210+}
11211+
11212+
11213+std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::lift(RustBuffer buf) {
11214+ auto stream = RustStream(&buf);
11215+ auto ret = read(stream);
11216+
11217+ rustbuffer_free(buf);
11218+
11219+ return ret;
11220+}
11221+
11222+RustBuffer FfiConverterSequenceTypeSendEmulationAction::lower(const std::vector<SendEmulationAction> &val) {
11223+ auto buf = rustbuffer_alloc(allocation_size(val));
11224+ auto stream = RustStream(&buf);
11225+
11226+ write(stream, val);
11227+
11228+ return buf;
11229+}
11230+
11231+std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::read(RustStream &stream) {
11232+ std::vector<SendEmulationAction> ret;
11233+ int32_t count;
11234+ stream >> count;
11235+
11236+ ret.reserve(count);
11237+
11238+ for (decltype(count) i = 0; i < count; i++) {
11239+ ret.push_back(FfiConverterTypeSendEmulationAction::read(stream));
11240+ }
11241+
11242+ return ret;
11243+}
11244+
11245+void FfiConverterSequenceTypeSendEmulationAction::write(RustStream &stream, const std::vector<SendEmulationAction> &val) {
11246+ stream << static_cast<int32_t>(val.size());
11247+
11248+ for (auto &elem : val) {
11249+ FfiConverterTypeSendEmulationAction::write(stream, elem);
11250+ }
11251+}
11252+
11253+uint64_t FfiConverterSequenceTypeSendEmulationAction::allocation_size(const std::vector<SendEmulationAction> &val) {
11254+ uint64_t size = sizeof(int32_t);
11255+
11256+ for (auto &elem : val) {
11257+ size += FfiConverterTypeSendEmulationAction::allocation_size(elem);
11258+ }
11259+
11260+ return size;
11261+}
11262+
11263+
11264+std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::lift(RustBuffer buf) {
11265+ auto stream = RustStream(&buf);
11266+ auto ret = read(stream);
11267+
11268+ rustbuffer_free(buf);
11269+
11270+ return ret;
11271+}
11272+
11273+RustBuffer FfiConverterSequenceTypeSendEmulationTransaction::lower(const std::vector<SendEmulationTransaction> &val) {
11274+ auto buf = rustbuffer_alloc(allocation_size(val));
11275+ auto stream = RustStream(&buf);
11276+
11277+ write(stream, val);
11278+
11279+ return buf;
11280+}
11281+
11282+std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::read(RustStream &stream) {
11283+ std::vector<SendEmulationTransaction> ret;
11284+ int32_t count;
11285+ stream >> count;
11286+
11287+ ret.reserve(count);
11288+
11289+ for (decltype(count) i = 0; i < count; i++) {
11290+ ret.push_back(FfiConverterTypeSendEmulationTransaction::read(stream));
11291+ }
11292+
11293+ return ret;
11294+}
11295+
11296+void FfiConverterSequenceTypeSendEmulationTransaction::write(RustStream &stream, const std::vector<SendEmulationTransaction> &val) {
11297+ stream << static_cast<int32_t>(val.size());
11298+
11299+ for (auto &elem : val) {
11300+ FfiConverterTypeSendEmulationTransaction::write(stream, elem);
11301+ }
11302+}
11303+
11304+uint64_t FfiConverterSequenceTypeSendEmulationTransaction::allocation_size(const std::vector<SendEmulationTransaction> &val) {
11305+ uint64_t size = sizeof(int32_t);
11306+
11307+ for (auto &elem : val) {
11308+ size += FfiConverterTypeSendEmulationTransaction::allocation_size(elem);
11309+ }
11310+
11311+ return size;
11312+}
11313+
11314+
11315+std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::lift(RustBuffer buf) {
11316+ auto stream = RustStream(&buf);
11317+ auto ret = read(stream);
11318+
11319+ rustbuffer_free(buf);
11320+
11321+ return ret;
11322+}
11323+
11324+RustBuffer FfiConverterSequenceTypeSendMessage::lower(const std::vector<SendMessage> &val) {
11325+ auto buf = rustbuffer_alloc(allocation_size(val));
11326+ auto stream = RustStream(&buf);
11327+
11328+ write(stream, val);
11329+
11330+ return buf;
11331+}
11332+
11333+std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::read(RustStream &stream) {
11334+ std::vector<SendMessage> ret;
11335+ int32_t count;
11336+ stream >> count;
11337+
11338+ ret.reserve(count);
11339+
11340+ for (decltype(count) i = 0; i < count; i++) {
11341+ ret.push_back(FfiConverterTypeSendMessage::read(stream));
11342+ }
11343+
11344+ return ret;
11345+}
11346+
11347+void FfiConverterSequenceTypeSendMessage::write(RustStream &stream, const std::vector<SendMessage> &val) {
11348+ stream << static_cast<int32_t>(val.size());
11349+
11350+ for (auto &elem : val) {
11351+ FfiConverterTypeSendMessage::write(stream, elem);
11352+ }
11353+}
11354+
11355+uint64_t FfiConverterSequenceTypeSendMessage::allocation_size(const std::vector<SendMessage> &val) {
11356+ uint64_t size = sizeof(int32_t);
11357+
11358+ for (auto &elem : val) {
11359+ size += FfiConverterTypeSendMessage::allocation_size(elem);
11360+ }
11361+
11362+ return size;
11363+}
11364+
11365+
11366+std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::lift(RustBuffer buf) {
11367+ auto stream = RustStream(&buf);
11368+ auto ret = read(stream);
11369+
11370+ rustbuffer_free(buf);
11371+
11372+ return ret;
11373+}
11374+
11375+RustBuffer FfiConverterSequenceMnemonicScheme::lower(const std::vector<MnemonicScheme> &val) {
11376+ auto buf = rustbuffer_alloc(allocation_size(val));
11377+ auto stream = RustStream(&buf);
11378+
11379+ write(stream, val);
11380+
11381+ return buf;
11382+}
11383+
11384+std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::read(RustStream &stream) {
11385+ std::vector<MnemonicScheme> ret;
11386+ int32_t count;
11387+ stream >> count;
11388+
11389+ ret.reserve(count);
11390+
11391+ for (decltype(count) i = 0; i < count; i++) {
11392+ ret.push_back(FfiConverterMnemonicScheme::read(stream));
11393+ }
11394+
11395+ return ret;
11396+}
11397+
11398+void FfiConverterSequenceMnemonicScheme::write(RustStream &stream, const std::vector<MnemonicScheme> &val) {
11399+ stream << static_cast<int32_t>(val.size());
11400+
11401+ for (auto &elem : val) {
11402+ FfiConverterMnemonicScheme::write(stream, elem);
11403+ }
11404+}
11405+
11406+uint64_t FfiConverterSequenceMnemonicScheme::allocation_size(const std::vector<MnemonicScheme> &val) {
11407+ uint64_t size = sizeof(int32_t);
11408+
11409+ for (auto &elem : val) {
11410+ size += FfiConverterMnemonicScheme::allocation_size(elem);
11411+ }
11412+
11413+ return size;
11414+}
11415+
11416+
11417+std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::lift(RustBuffer buf) {
11418+ auto stream = RustStream(&buf);
11419+ auto ret = read(stream);
11420+
11421+ rustbuffer_free(buf);
11422+
11423+ return ret;
11424+}
11425+
11426+RustBuffer FfiConverterSequenceTonConnectIncomingRequest::lower(const std::vector<TonConnectIncomingRequest> &val) {
11427+ auto buf = rustbuffer_alloc(allocation_size(val));
11428+ auto stream = RustStream(&buf);
11429+
11430+ write(stream, val);
11431+
11432+ return buf;
11433+}
11434+
11435+std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::read(RustStream &stream) {
11436+ std::vector<TonConnectIncomingRequest> ret;
11437+ int32_t count;
11438+ stream >> count;
11439+
11440+ ret.reserve(count);
11441+
11442+ for (decltype(count) i = 0; i < count; i++) {
11443+ ret.push_back(FfiConverterTonConnectIncomingRequest::read(stream));
11444+ }
11445+
11446+ return ret;
11447+}
11448+
11449+void FfiConverterSequenceTonConnectIncomingRequest::write(RustStream &stream, const std::vector<TonConnectIncomingRequest> &val) {
11450+ stream << static_cast<int32_t>(val.size());
11451+
11452+ for (auto &elem : val) {
11453+ FfiConverterTonConnectIncomingRequest::write(stream, elem);
11454+ }
11455+}
11456+
11457+uint64_t FfiConverterSequenceTonConnectIncomingRequest::allocation_size(const std::vector<TonConnectIncomingRequest> &val) {
11458+ uint64_t size = sizeof(int32_t);
11459+
11460+ for (auto &elem : val) {
11461+ size += FfiConverterTonConnectIncomingRequest::allocation_size(elem);
11462+ }
11463+
11464+ return size;
11465+}
11466+
11467+
11468+std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::lift(RustBuffer buf) {
11469+ auto stream = RustStream(&buf);
11470+ auto ret = read(stream);
11471+
11472+ rustbuffer_free(buf);
11473+
11474+ return ret;
11475+}
11476+
11477+RustBuffer FfiConverterSequenceTypeBase64Hash::lower(const std::vector<Base64Hash> &val) {
11478+ auto buf = rustbuffer_alloc(allocation_size(val));
11479+ auto stream = RustStream(&buf);
11480+
11481+ write(stream, val);
11482+
11483+ return buf;
11484+}
11485+
11486+std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::read(RustStream &stream) {
11487+ std::vector<Base64Hash> ret;
11488+ int32_t count;
11489+ stream >> count;
11490+
11491+ ret.reserve(count);
11492+
11493+ for (decltype(count) i = 0; i < count; i++) {
11494+ ret.push_back(FfiConverterTypeBase64Hash::read(stream));
11495+ }
11496+
11497+ return ret;
11498+}
11499+
11500+void FfiConverterSequenceTypeBase64Hash::write(RustStream &stream, const std::vector<Base64Hash> &val) {
11501+ stream << static_cast<int32_t>(val.size());
11502+
11503+ for (auto &elem : val) {
11504+ FfiConverterTypeBase64Hash::write(stream, elem);
11505+ }
11506+}
11507+
11508+uint64_t FfiConverterSequenceTypeBase64Hash::allocation_size(const std::vector<Base64Hash> &val) {
11509+ uint64_t size = sizeof(int32_t);
11510+
11511+ for (auto &elem : val) {
11512+ size += FfiConverterTypeBase64Hash::allocation_size(elem);
11513+ }
11514+
11515+ return size;
11516+}
11517+
11518+
11519+std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::lift(RustBuffer buf) {
11520+ auto stream = RustStream(&buf);
11521+ auto ret = read(stream);
11522+
11523+ rustbuffer_free(buf);
11524+
11525+ return ret;
11526+}
11527+
11528+RustBuffer FfiConverterSequenceTypeTonAddressString::lower(const std::vector<TonAddressString> &val) {
11529+ auto buf = rustbuffer_alloc(allocation_size(val));
11530+ auto stream = RustStream(&buf);
11531+
11532+ write(stream, val);
11533+
11534+ return buf;
11535+}
11536+
11537+std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::read(RustStream &stream) {
11538+ std::vector<TonAddressString> ret;
11539+ int32_t count;
11540+ stream >> count;
11541+
11542+ ret.reserve(count);
11543+
11544+ for (decltype(count) i = 0; i < count; i++) {
11545+ ret.push_back(FfiConverterTypeTonAddressString::read(stream));
11546+ }
11547+
11548+ return ret;
11549+}
11550+
11551+void FfiConverterSequenceTypeTonAddressString::write(RustStream &stream, const std::vector<TonAddressString> &val) {
11552+ stream << static_cast<int32_t>(val.size());
11553+
11554+ for (auto &elem : val) {
11555+ FfiConverterTypeTonAddressString::write(stream, elem);
11556+ }
11557+}
11558+
11559+uint64_t FfiConverterSequenceTypeTonAddressString::allocation_size(const std::vector<TonAddressString> &val) {
11560+ uint64_t size = sizeof(int32_t);
11561+
11562+ for (auto &elem : val) {
11563+ size += FfiConverterTypeTonAddressString::allocation_size(elem);
11564+ }
11565+
11566+ return size;
11567+}
11568+
11569+
11570+std::unordered_map<std::string, std::string> FfiConverterMapStringString::lift(RustBuffer buf) {
11571+ auto stream = RustStream(&buf);
11572+ auto ret = read(stream);
11573+
11574+ rustbuffer_free(buf);
11575+
11576+ return ret;
11577+}
11578+
11579+RustBuffer FfiConverterMapStringString::lower(const std::unordered_map<std::string, std::string> &val) {
11580+ auto buf = rustbuffer_alloc(allocation_size(val));
11581+ auto stream = RustStream(&buf);
11582+
11583+ write(stream, val);
11584+
11585+ return buf;
11586+}
11587+
11588+std::unordered_map<std::string, std::string> FfiConverterMapStringString::read(RustStream &stream) {
11589+ std::unordered_map<std::string, std::string> ret;
11590+ int32_t count;
11591+ stream >> count;
11592+
11593+ ret.reserve(count);
11594+
11595+ for (decltype(count) i = 0; i < count; i++) {
11596+ ret.insert({ FfiConverterString::read(stream), FfiConverterString::read(stream) });
11597+ }
11598+
11599+ return ret;
11600+}
11601+
11602+void FfiConverterMapStringString::write(RustStream &stream, const std::unordered_map<std::string, std::string> &val) {
11603+ stream << static_cast<int32_t>(val.size());
11604+
11605+ for (auto &entry : val) {
11606+ FfiConverterString::write(stream, entry.first);
11607+ FfiConverterString::write(stream, entry.second);
11608+ }
11609+}
11610+
11611+uint64_t FfiConverterMapStringString::allocation_size(const std::unordered_map<std::string, std::string> &val) {
11612+ uint64_t size = sizeof(int32_t);
11613+
11614+ for (auto &entry : val) {
11615+ size += FfiConverterString::allocation_size(entry.first);
11616+ size += FfiConverterString::allocation_size(entry.second);
11617+ }
11618+
11619+ return size;
11620+}
11621+
11622+
11623+
11624+
11625+
11626+
11627+}
11628+
11629+ParsedTonTransferLink parse_ton_transfer_link(const std::string &value) {
11630+ auto ret =
11631+ uniffi::rust_call(
11632+ uniffi_wallet_engine_fn_func_parse_ton_transfer_link,
11633+ uniffi::FfiConverterTonTransferLinkError::lift, uniffi::FfiConverterString::lower(value));
11634+
11635+ return uniffi::FfiConverterTypeParsedTonTransferLink::lift(ret);
11636+}
11637+
11638+
11639+TonConnectManifest parse_ton_connect_manifest(const std::string &json) {
11640+ auto ret =
11641+ uniffi::rust_call(
11642+ uniffi_wallet_engine_fn_func_parse_ton_connect_manifest,
11643+ uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(json));
11644+
11645+ return uniffi::FfiConverterTypeTonConnectManifest::lift(ret);
11646+}
11647+
11648+
11649+std::shared_ptr<TonConnectSession> ton_connect_session_from_link(const std::string &link, const TonConnectSessionConfig &config) {
11650+ auto ret =
11651+ uniffi::rust_call(
11652+ uniffi_wallet_engine_fn_func_ton_connect_session_from_link,
11653+ uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(link), uniffi::FfiConverterTypeTonConnectSessionConfig::lower(config));
11654+
11655+ return uniffi::FfiConverterTonConnectSession::lift(ret);
11656+}
11657+
11658+
11659+std::shared_ptr<TonConnectSession> ton_connect_session_restore(const std::string &persisted, const TonConnectSessionConfig &config) {
11660+ auto ret =
11661+ uniffi::rust_call(
11662+ uniffi_wallet_engine_fn_func_ton_connect_session_restore,
11663+ uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(persisted), uniffi::FfiConverterTypeTonConnectSessionConfig::lower(config));
11664+
11665+ return uniffi::FfiConverterTonConnectSession::lift(ret);
11666+}
11667+
11668+
11669+std::string convert_ton_address(const std::string &value, TonAddressFormat format) {
11670+ auto ret =
11671+ uniffi::rust_call(
11672+ uniffi_wallet_engine_fn_func_convert_ton_address,
11673+ uniffi::FfiConverterTonAddressError::lift, uniffi::FfiConverterString::lower(value), uniffi::FfiConverterTonAddressFormat::lower(format));
11674+
11675+ return uniffi::FfiConverterString::lift(ret);
11676+}
11677+
11678+
11679+bool is_valid_ton_address(const std::string &value) {
11680+ auto ret =
11681+ uniffi::rust_call(
11682+ uniffi_wallet_engine_fn_func_is_valid_ton_address,
11683+ nullptr, uniffi::FfiConverterString::lower(value));
11684+
11685+ return uniffi::FfiConverterBool::lift(ret);
11686+}
11687+
11688+
11689+TonAddressInfo parse_ton_address(const std::string &value) {
11690+ auto ret =
11691+ uniffi::rust_call(
11692+ uniffi_wallet_engine_fn_func_parse_ton_address,
11693+ uniffi::FfiConverterTonAddressError::lift, uniffi::FfiConverterString::lower(value));
11694+
11695+ return uniffi::FfiConverterTypeTonAddressInfo::lift(ret);
11696+}
11697+
11698+
11699+std::vector<std::string> mnemonic_wordlist() {
11700+ auto ret =
11701+ uniffi::rust_call(
11702+ uniffi_wallet_engine_fn_func_mnemonic_wordlist,
11703+ nullptr);
11704+
11705+ return uniffi::FfiConverterSequenceString::lift(ret);
11706+}
11707+
11708+
11709+std::vector<MnemonicScheme> detect_mnemonic_schemes(const std::vector<std::string> &words) {
11710+ auto ret =
11711+ uniffi::rust_call(
11712+ uniffi_wallet_engine_fn_func_detect_mnemonic_schemes,
11713+ nullptr, uniffi::FfiConverterSequenceString::lower(words));
11714+
11715+ return uniffi::FfiConverterSequenceMnemonicScheme::lift(ret);
11716+}
11717+
11718+
11719+std::vector<uint8_t> rotation_mnemonic_public_key(const std::string &phrase) {
11720+ auto ret =
11721+ uniffi::rust_call(
11722+ uniffi_wallet_engine_fn_func_rotation_mnemonic_public_key,
11723+ uniffi::FfiConverterWalletLifecycleError::lift, uniffi::FfiConverterString::lower(phrase));
11724+
11725+ return uniffi::FfiConverterBytes::lift(ret);
11726+}
11727+} // namespace wallet_engine