@@ -0,0 +1,11727 @@
1+/* This file was generated by uniffi-bindgen-cpp. */
4+#include "wallet_engine.hpp"
6+namespace wallet_engine {
8+template <class> inline constexpr bool always_false_v = false;
11+void ensure_initialized() {
12+ auto bindings_contract_version = 30;
13+ auto scaffolding_contract_version = ffi_wallet_engine_uniffi_contract_version();
15+ if (bindings_contract_version != scaffolding_contract_version) {
16+ throw std::runtime_error("UniFFI contract version mismatch: try cleaning and rebuilding your project");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
286+ uniffi::UniffiCallbackInterfaceWalletHttpHost::init();
287+ uniffi::UniffiCallbackInterfaceWalletPlatformHost::init();
288+ uniffi::UniffiCallbackInterfaceWalletStatuslessHost::init();
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
294+ static std::once_flag init_flag;
295+ std::call_once(init_flag, ensure_initialized);
299+template <typename F>
300+void check_rust_call(const RustCallStatus &status, F error_cb) {
301+ switch (status.code) {
306+ if constexpr (!std::is_null_pointer_v<F>) {
307+ error_cb(status.error_buf)->throw_underlying();
312+ if (status.error_buf.len > 0) {
313+ throw std::runtime_error(FfiConverterString::lift(status.error_buf));
316+ throw std::runtime_error("A Rust panic has occurred");
319+ throw std::runtime_error("Unexpected Rust call status");
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) {
326+ RustCallStatus status = { 0 };
328+ if constexpr (std::is_void_v<R>) {
329+ f(args..., &status);
330+ check_rust_call(status, error_cb);
332+ auto ret = f(args..., &status);
333+ check_rust_call(status, error_cb);
340+struct RustFutureContinuationState {
342+ std::condition_variable condition;
343+ bool called = false;
344+ int8_t poll_result = 0;
347+void rust_future_continuation(uint64_t data, int8_t poll_result) {
348+ auto *state = reinterpret_cast<RustFutureContinuationState *>(data);
350+ std::lock_guard<std::mutex> lock(state->mutex);
351+ state->poll_result = poll_result;
352+ state->called = true;
354+ state->condition.notify_one();
357+void foreign_future_drop_noop(uint64_t) {}
359+template <typename F>
360+struct RustFutureHandleGuard {
364+ ~RustFutureHandleGuard() {
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) {
375+ auto handle = start();
376+ RustFutureHandleGuard guard { handle, free };
379+ RustFutureContinuationState state;
382+ reinterpret_cast<void *>(&rust_future_continuation),
383+ reinterpret_cast<uint64_t>(&state)
386+ std::unique_lock<std::mutex> lock(state.mutex);
387+ state.condition.wait(lock, [&state] { return state.called; });
388+ if (state.poll_result == 0) {
391+ if (state.poll_result != 1) {
392+ throw std::runtime_error("Unexpected Rust future poll result");
396+ RustCallStatus status = {};
397+ if constexpr (std::is_void_v<R>) {
398+ complete(handle, &status);
399+ check_rust_call(status, error_cb);
401+ auto ret = complete(handle, &status);
402+ check_rust_call(status, error_cb);
407+template <typename F, typename W>
408+void rust_call_trait_interface(RustCallStatus* status, F make_call, W write_value) {
411+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
414+ if constexpr(has_return_type) {
415+ write_value(make_call());
419+ } catch (std::exception &e) {
421+ status->error_buf = FfiConverterString::lower(e.what());
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) {
429+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
433+ if constexpr(has_return_type) {
434+ write_value(make_call());
440+ status->error_buf = error_cb(e);
442+ } catch (std::exception &e) {
444+ status->error_buf = FfiConverterString::lower(e.what());
449+RustBuffer rustbuffer_alloc(uint64_t len) {
450+ RustCallStatus status = { 0 };
451+ auto buffer = ffi_wallet_engine_rustbuffer_alloc(len, &status);
453+ check_rust_call(status, nullptr);
458+RustBuffer rustbuffer_from_bytes(const ForeignBytes &bytes) {
459+ RustCallStatus status = { 0 };
460+ auto buffer = ffi_wallet_engine_rustbuffer_from_bytes(bytes, &status);
462+ check_rust_call(status, nullptr);
467+void rustbuffer_free(RustBuffer buf) {
468+ RustCallStatus status = { 0 };
470+ ffi_wallet_engine_rustbuffer_free(std::move(buf), &status);
471+ check_rust_call(status, nullptr);
475+uint16_t FfiConverterUInt16::lift(uint16_t val) {
479+uint16_t FfiConverterUInt16::lower(uint16_t val) {
483+uint16_t FfiConverterUInt16::read(RustStream &stream) {
490+void FfiConverterUInt16::write(RustStream &stream, uint16_t val) {
494+uint64_t FfiConverterUInt16::allocation_size(uint16_t) {
495+ return static_cast<uint64_t>(sizeof(uint16_t));
497+uint32_t FfiConverterUInt32::lift(uint32_t val) {
501+uint32_t FfiConverterUInt32::lower(uint32_t val) {
505+uint32_t FfiConverterUInt32::read(RustStream &stream) {
512+void FfiConverterUInt32::write(RustStream &stream, uint32_t val) {
516+uint64_t FfiConverterUInt32::allocation_size(uint32_t) {
517+ return static_cast<uint64_t>(sizeof(uint32_t));
519+int32_t FfiConverterInt32::lift(int32_t val) {
523+int32_t FfiConverterInt32::lower(int32_t val) {
527+int32_t FfiConverterInt32::read(RustStream &stream) {
534+void FfiConverterInt32::write(RustStream &stream, int32_t val) {
538+uint64_t FfiConverterInt32::allocation_size(int32_t) {
539+ return static_cast<uint64_t>(sizeof(int32_t));
541+uint64_t FfiConverterUInt64::lift(uint64_t val) {
545+uint64_t FfiConverterUInt64::lower(uint64_t val) {
549+uint64_t FfiConverterUInt64::read(RustStream &stream) {
556+void FfiConverterUInt64::write(RustStream &stream, uint64_t val) {
560+uint64_t FfiConverterUInt64::allocation_size(uint64_t) {
561+ return static_cast<uint64_t>(sizeof(uint64_t));
563+int64_t FfiConverterInt64::lift(int64_t val) {
567+int64_t FfiConverterInt64::lower(int64_t val) {
571+int64_t FfiConverterInt64::read(RustStream &stream) {
578+void FfiConverterInt64::write(RustStream &stream, int64_t val) {
582+uint64_t FfiConverterInt64::allocation_size(int64_t) {
583+ return static_cast<uint64_t>(sizeof(int64_t));
586+bool FfiConverterBool::lift(uint8_t val) {
590+uint8_t FfiConverterBool::lower(bool val) {
594+bool FfiConverterBool::read(RustStream &stream) {
601+void FfiConverterBool::write(RustStream &stream, bool val) {
605+uint64_t FfiConverterBool::allocation_size(bool) {
608+std::string FfiConverterString::lift(RustBuffer buf) {
609+ auto string = std::string(reinterpret_cast<char *>(buf.data), buf.len);
611+ rustbuffer_free(buf);
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())) };
620+ return rustbuffer_from_bytes(bytes);
623+std::string FfiConverterString::read(RustStream &stream) {
630+ stream.read(string.data(), len);
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());
640+uint64_t FfiConverterString::allocation_size(const std::string &val) {
641+ return static_cast<uint64_t>(sizeof(int32_t) + val.length());
643+std::vector<uint8_t> FfiConverterBytes::lift(RustBuffer buf) {
644+ auto stream = RustStream(&buf);
645+ auto ret = read(stream);
647+ rustbuffer_free(buf);
652+RustBuffer FfiConverterBytes::lower(const std::vector<uint8_t> &val) {
653+ auto buf = rustbuffer_alloc(allocation_size(val));
654+ auto stream = RustStream(&buf);
661+std::vector<uint8_t> FfiConverterBytes::read(RustStream &stream) {
662+ std::vector<uint8_t> ret;
668+ for (decltype(count) i = 0; i < count; i++) {
671+ ret.push_back(elem);
677+void FfiConverterBytes::write(RustStream &stream, const std::vector<uint8_t> &val) {
678+ stream << static_cast<int32_t>(val.size());
680+ for (auto &elem : val) {
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());
688+} // namespace uniffi
702+TonConnectDerivedSession::TonConnectDerivedSession(uint64_t ptr): instance(ptr) {}
704+TonConnectDerivedSession::TonConnectDerivedSession(const TonConnectDerivedSession &other) : instance(0) {
705+ if (other.instance) {
706+ instance = other._uniffi_internal_clone_pointer();
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(
717+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_envelope,
718+ uniffi::FfiConverterTonConnectSessionError::lift,
719+ ptr, uniffi::FfiConverterBytes::lower(body)));
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(
725+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_request,
726+ uniffi::FfiConverterTonConnectSessionError::lift,
727+ ptr, uniffi::FfiConverterBytes::lower(body), uniffi::FfiConverterUInt64::lower(now)));
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(
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)));
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(
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)));
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(
749+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_event,
750+ uniffi::FfiConverterTonConnectSessionError::lift,
751+ ptr, uniffi::FfiConverterUInt64::lower(event_id)));
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(
757+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_success,
758+ uniffi::FfiConverterTonConnectSessionError::lift,
759+ ptr, uniffi::FfiConverterString::lower(request_id)));
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(
765+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_envelope,
766+ uniffi::FfiConverterTonConnectSessionError::lift,
767+ ptr, uniffi::FfiConverterBytes::lower(body)));
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(
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)));
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(
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)));
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(
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)));
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(
797+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_open_challenge,
798+ uniffi::FfiConverterTonConnectSessionError::lift,
799+ ptr, uniffi::FfiConverterBytes::lower(challenge)));
801+std::string TonConnectDerivedSession::public_key_hex() {
802+ auto ptr = this->_uniffi_internal_clone_pointer();
803+ return uniffi::FfiConverterString::lift(
805+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_public_key_hex,
809+std::vector<uint8_t> TonConnectDerivedSession::signing_public_key() {
810+ auto ptr = this->_uniffi_internal_clone_pointer();
811+ return uniffi::FfiConverterBytes::lift(
813+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_signing_public_key,
818+TonConnectDerivedSession::~TonConnectDerivedSession() {
820+ uniffi_wallet_engine_fn_free_tonconnectderivedsession,
826+uint64_t TonConnectDerivedSession::_uniffi_internal_clone_pointer() const {
827+ return uniffi::rust_call(
828+ uniffi_wallet_engine_fn_clone_tonconnectderivedsession,
837+TonConnectSession::TonConnectSession(uint64_t ptr): instance(ptr) {}
839+TonConnectSession::TonConnectSession(const TonConnectSession &other) : instance(0) {
840+ if (other.instance) {
841+ instance = other._uniffi_internal_clone_pointer();
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(
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)));
856+std::string TonConnectSession::begin_events_subscription() {
857+ auto ptr = this->_uniffi_internal_clone_pointer();
858+ return uniffi::FfiConverterString::lift(
860+ uniffi_wallet_engine_fn_method_tonconnectsession_begin_events_subscription,
861+ uniffi::FfiConverterTonConnectSessionError::lift,
864+void TonConnectSession::complete_pending_post() {
865+ auto ptr = this->_uniffi_internal_clone_pointer();
868+ uniffi_wallet_engine_fn_method_tonconnectsession_complete_pending_post,
869+ uniffi::FfiConverterTonConnectSessionError::lift,
872+std::optional<TonConnectConnectPrompt> TonConnectSession::connect_prompt() {
873+ auto ptr = this->_uniffi_internal_clone_pointer();
874+ return uniffi::FfiConverterOptionalTypeTonConnectConnectPrompt::lift(
876+ uniffi_wallet_engine_fn_method_tonconnectsession_connect_prompt,
877+ uniffi::FfiConverterTonConnectSessionError::lift,
880+TonConnectPreparedPost TonConnectSession::disconnect() {
881+ auto ptr = this->_uniffi_internal_clone_pointer();
882+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
884+ uniffi_wallet_engine_fn_method_tonconnectsession_disconnect,
885+ uniffi::FfiConverterTonConnectSessionError::lift,
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(
892+ uniffi_wallet_engine_fn_method_tonconnectsession_ingest_sse_chunk,
893+ uniffi::FfiConverterTonConnectSessionError::lift,
894+ ptr, uniffi::FfiConverterBytes::lower(chunk), uniffi::FfiConverterUInt64::lower(now)));
896+std::optional<TonConnectPreparedPost> TonConnectSession::pending_post() {
897+ auto ptr = this->_uniffi_internal_clone_pointer();
898+ return uniffi::FfiConverterOptionalTypeTonConnectPreparedPost::lift(
900+ uniffi_wallet_engine_fn_method_tonconnectsession_pending_post,
901+ uniffi::FfiConverterTonConnectSessionError::lift,
904+std::vector<TonConnectIncomingRequest> TonConnectSession::pending_requests(uint64_t now) {
905+ auto ptr = this->_uniffi_internal_clone_pointer();
906+ return uniffi::FfiConverterSequenceTonConnectIncomingRequest::lift(
908+ uniffi_wallet_engine_fn_method_tonconnectsession_pending_requests,
909+ uniffi::FfiConverterTonConnectSessionError::lift,
910+ ptr, uniffi::FfiConverterUInt64::lower(now)));
912+std::string TonConnectSession::persisted() {
913+ auto ptr = this->_uniffi_internal_clone_pointer();
914+ return uniffi::FfiConverterString::lift(
916+ uniffi_wallet_engine_fn_method_tonconnectsession_persisted,
917+ uniffi::FfiConverterTonConnectSessionError::lift,
920+TonConnectSessionPhase TonConnectSession::phase() {
921+ auto ptr = this->_uniffi_internal_clone_pointer();
922+ return uniffi::FfiConverterTonConnectSessionPhase::lift(
924+ uniffi_wallet_engine_fn_method_tonconnectsession_phase,
925+ uniffi::FfiConverterTonConnectSessionError::lift,
928+TonConnectPreparedPost TonConnectSession::prepare_disconnect_success(const std::string &request_id) {
929+ auto ptr = this->_uniffi_internal_clone_pointer();
930+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
932+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_disconnect_success,
933+ uniffi::FfiConverterTonConnectSessionError::lift,
934+ ptr, uniffi::FfiConverterString::lower(request_id)));
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(
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)));
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(
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)));
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(
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)));
960+TonConnectPreparedPost TonConnectSession::reject_connect(const std::string &message) {
961+ auto ptr = this->_uniffi_internal_clone_pointer();
962+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
964+ uniffi_wallet_engine_fn_method_tonconnectsession_reject_connect,
965+ uniffi::FfiConverterTonConnectSessionError::lift,
966+ ptr, uniffi::FfiConverterString::lower(message)));
969+TonConnectSession::~TonConnectSession() {
971+ uniffi_wallet_engine_fn_free_tonconnectsession,
977+uint64_t TonConnectSession::_uniffi_internal_clone_pointer() const {
978+ return uniffi::rust_call(
979+ uniffi_wallet_engine_fn_clone_tonconnectsession,
988+WalletClient::WalletClient(uint64_t ptr): instance(ptr) {}
990+WalletClient::WalletClient(const WalletClient &other) : instance(0) {
991+ if (other.instance) {
992+ instance = other._uniffi_internal_clone_pointer();
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>(
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)))
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(
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))));
1015+void WalletClient::cancel_load_more_activity() {
1016+ auto ptr = this->_uniffi_internal_clone_pointer();
1018+ uniffi::rust_call_async(
1019+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_activity(
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
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(
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
1039+void WalletClient::shutdown() {
1040+ auto ptr = this->_uniffi_internal_clone_pointer();
1042+ uniffi::rust_call_async(
1043+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_shutdown(
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
1051+WalletSnapshot WalletClient::snapshot() {
1052+ auto ptr = this->_uniffi_internal_clone_pointer();
1053+ return uniffi::FfiConverterTypeWalletSnapshot::lift(
1055+ uniffi_wallet_engine_fn_method_walletclient_snapshot,
1056+ uniffi::FfiConverterWalletClientError::lift,
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
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
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
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
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
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
1131+void WalletClient::cancel_load_more_nfts() {
1132+ auto ptr = this->_uniffi_internal_clone_pointer();
1134+ uniffi::rust_call_async(
1135+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_nfts(
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
1143+void WalletClient::cancel_refresh_nfts() {
1144+ auto ptr = this->_uniffi_internal_clone_pointer();
1146+ uniffi::rust_call_async(
1147+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh_nfts(
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
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(
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
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(
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
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
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
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
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
1227+void WalletClient::cancel_send_preview() {
1228+ auto ptr = this->_uniffi_internal_clone_pointer();
1230+ uniffi::rust_call_async(
1231+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send_preview(
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
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(
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
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
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
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
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
1299+void WalletClient::cancel_refresh() {
1300+ auto ptr = this->_uniffi_internal_clone_pointer();
1302+ uniffi::rust_call_async(
1303+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh(
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
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(
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
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(
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
1335+void WalletClient::cancel_send() {
1336+ auto ptr = this->_uniffi_internal_clone_pointer();
1338+ uniffi::rust_call_async(
1339+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send(
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
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
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
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
1384+WalletClient::~WalletClient() {
1386+ uniffi_wallet_engine_fn_free_walletclient,
1392+uint64_t WalletClient::_uniffi_internal_clone_pointer() const {
1393+ return uniffi::rust_call(
1394+ uniffi_wallet_engine_fn_clone_walletclient,
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);
1406+ auto make_call = [&]() -> HttpResponse {
1407+ auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_http(
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);
1417+ auto write_value = [&](const HttpResponse &v) {
1418+ result.return_value = FfiConverterTypeHttpResponse::lower(v);
1423+ rust_call_trait_interface_with_error<HttpHostError>(&result.call_status, make_call, write_value, FfiConverterHttpHostError::lower);
1425+ complete(uniffi_callback_data, result);
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);
1430+ auto make_call = [&]() {
1431+ auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_http(
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);
1441+ auto write_value = [](){};
1445+ rust_call_trait_interface(&result.call_status, make_call, write_value);
1447+ complete(uniffi_callback_data, result);
1450+void UniffiCallbackInterfaceWalletHttpHost::uniffi_free(uint64_t uniffi_handle) {
1451+ FfiConverterWalletHttpHost::handle_map.erase(uniffi_handle);
1454+uint64_t UniffiCallbackInterfaceWalletHttpHost::uniffi_clone(uint64_t uniffi_handle) {
1455+ return FfiConverterWalletHttpHost::handle_map.insert(
1456+ FfiConverterWalletHttpHost::handle_map.at(uniffi_handle)
1460+void UniffiCallbackInterfaceWalletHttpHost::init() {
1461+ uniffi_wallet_engine_fn_init_callback_vtable_wallethttphost(vtable);
1463+} // namespace uniffi
1466+WalletHttpHostImpl::WalletHttpHostImpl(uint64_t ptr): instance(ptr) {}
1468+WalletHttpHostImpl::WalletHttpHostImpl(const WalletHttpHostImpl &other) : instance(0) {
1469+ if (other.instance) {
1470+ instance = other._uniffi_internal_clone_pointer();
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
1489+void WalletHttpHostImpl::cancel_http(const HttpRequestId &request_id) {
1490+ auto ptr = this->_uniffi_internal_clone_pointer();
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,
1502+WalletHttpHostImpl::~WalletHttpHostImpl() {
1504+ uniffi_wallet_engine_fn_free_wallethttphost,
1510+uint64_t WalletHttpHostImpl::_uniffi_internal_clone_pointer() const {
1511+ return uniffi::rust_call(
1512+ uniffi_wallet_engine_fn_clone_wallethttphost,
1521+WalletLifecycle::WalletLifecycle(uint64_t ptr): instance(ptr) {}
1523+WalletLifecycle::WalletLifecycle(const WalletLifecycle &other) : instance(0) {
1524+ if (other.instance) {
1525+ instance = other._uniffi_internal_clone_pointer();
1532+std::shared_ptr<WalletLifecycle> WalletLifecycle::init(const std::shared_ptr<WalletPlatformHost> &platform_host) {
1533+ return std::shared_ptr<WalletLifecycle>(
1534+ new WalletLifecycle(
1536+ uniffi_wallet_engine_fn_constructor_walletlifecycle_new,
1537+ nullptr, uniffi::FfiConverterWalletPlatformHost::lower(platform_host)))
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
1553+void WalletLifecycle::delete_wallet(const WalletDescriptor &descriptor) {
1554+ auto ptr = this->_uniffi_internal_clone_pointer();
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
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
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
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
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
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
1625+TonConnectAccountInfo WalletLifecycle::ton_connect_account(const WalletDescriptor &descriptor) {
1626+ auto ptr = this->_uniffi_internal_clone_pointer();
1627+ return uniffi::FfiConverterTypeTonConnectAccountInfo::lift(
1629+ uniffi_wallet_engine_fn_method_walletlifecycle_ton_connect_account,
1630+ uniffi::FfiConverterWalletLifecycleError::lift,
1631+ ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)));
1634+WalletLifecycle::~WalletLifecycle() {
1636+ uniffi_wallet_engine_fn_free_walletlifecycle,
1642+uint64_t WalletLifecycle::_uniffi_internal_clone_pointer() const {
1643+ return uniffi::rust_call(
1644+ uniffi_wallet_engine_fn_clone_walletlifecycle,
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);
1656+ auto make_call = [&]() -> std::vector<uint8_t> {
1657+ auto arg0 =FfiConverterTypeProtectedSecretRead::lift(request);return obj->read_protected_secret(
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);
1667+ auto write_value = [&](const std::vector<uint8_t> &v) {
1668+ result.return_value = FfiConverterBytes::lower(v);
1673+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1675+ complete(uniffi_callback_data, result);
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);
1680+ auto make_call = [&]() {
1681+ auto arg0 =FfiConverterTypeProtectedSecretStore::lift(request);obj->store_protected_secret(
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);
1691+ auto write_value = [](){};
1695+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1697+ complete(uniffi_callback_data, result);
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);
1702+ auto make_call = [&]() {
1703+ auto arg0 =FfiConverterTypeProtectedSecretRef::lift(secret_ref);obj->delete_protected_secret(
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);
1713+ auto write_value = [](){};
1717+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1719+ complete(uniffi_callback_data, result);
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);
1724+ auto make_call = [&]() -> std::optional<JournalRecord> {
1725+ auto arg0 =FfiConverterTypeJournalKey::lift(key);return obj->load_journal(
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);
1735+ auto write_value = [&](const std::optional<JournalRecord> &v) {
1736+ result.return_value = FfiConverterOptionalTypeJournalRecord::lower(v);
1741+ rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
1743+ complete(uniffi_callback_data, result);
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);
1748+ auto make_call = [&]() -> JournalCompareExchangeResult {
1749+ auto arg0 =FfiConverterTypeJournalCompareExchange::lift(mutation);return obj->compare_exchange_journal(
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);
1759+ auto write_value = [&](const JournalCompareExchangeResult &v) {
1760+ result.return_value = FfiConverterTypeJournalCompareExchangeResult::lower(v);
1765+ rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
1767+ complete(uniffi_callback_data, result);
1770+void UniffiCallbackInterfaceWalletPlatformHost::uniffi_free(uint64_t uniffi_handle) {
1771+ FfiConverterWalletPlatformHost::handle_map.erase(uniffi_handle);
1774+uint64_t UniffiCallbackInterfaceWalletPlatformHost::uniffi_clone(uint64_t uniffi_handle) {
1775+ return FfiConverterWalletPlatformHost::handle_map.insert(
1776+ FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle)
1780+void UniffiCallbackInterfaceWalletPlatformHost::init() {
1781+ uniffi_wallet_engine_fn_init_callback_vtable_walletplatformhost(vtable);
1783+} // namespace uniffi
1786+WalletPlatformHostImpl::WalletPlatformHostImpl(uint64_t ptr): instance(ptr) {}
1788+WalletPlatformHostImpl::WalletPlatformHostImpl(const WalletPlatformHostImpl &other) : instance(0) {
1789+ if (other.instance) {
1790+ instance = other._uniffi_internal_clone_pointer();
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
1809+void WalletPlatformHostImpl::store_protected_secret(const ProtectedSecretStore &request) {
1810+ auto ptr = this->_uniffi_internal_clone_pointer();
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
1821+void WalletPlatformHostImpl::delete_protected_secret(const ProtectedSecretRef &secret_ref) {
1822+ auto ptr = this->_uniffi_internal_clone_pointer();
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
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
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
1858+WalletPlatformHostImpl::~WalletPlatformHostImpl() {
1860+ uniffi_wallet_engine_fn_free_walletplatformhost,
1866+uint64_t WalletPlatformHostImpl::_uniffi_internal_clone_pointer() const {
1867+ return uniffi::rust_call(
1868+ uniffi_wallet_engine_fn_clone_walletplatformhost,
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);
1880+ auto make_call = [&]() -> std::vector<uint8_t> {
1881+ auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_statusless(
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);
1891+ auto write_value = [&](const std::vector<uint8_t> &v) {
1892+ result.return_value = FfiConverterBytes::lower(v);
1897+ rust_call_trait_interface_with_error<StatuslessHostError>(&result.call_status, make_call, write_value, FfiConverterStatuslessHostError::lower);
1899+ complete(uniffi_callback_data, result);
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);
1904+ auto make_call = [&]() {
1905+ auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_statusless(
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);
1915+ auto write_value = [](){};
1919+ rust_call_trait_interface(&result.call_status, make_call, write_value);
1921+ complete(uniffi_callback_data, result);
1924+void UniffiCallbackInterfaceWalletStatuslessHost::uniffi_free(uint64_t uniffi_handle) {
1925+ FfiConverterWalletStatuslessHost::handle_map.erase(uniffi_handle);
1928+uint64_t UniffiCallbackInterfaceWalletStatuslessHost::uniffi_clone(uint64_t uniffi_handle) {
1929+ return FfiConverterWalletStatuslessHost::handle_map.insert(
1930+ FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle)
1934+void UniffiCallbackInterfaceWalletStatuslessHost::init() {
1935+ uniffi_wallet_engine_fn_init_callback_vtable_walletstatuslesshost(vtable);
1937+} // namespace uniffi
1940+WalletStatuslessHostImpl::WalletStatuslessHostImpl(uint64_t ptr): instance(ptr) {}
1942+WalletStatuslessHostImpl::WalletStatuslessHostImpl(const WalletStatuslessHostImpl &other) : instance(0) {
1943+ if (other.instance) {
1944+ instance = other._uniffi_internal_clone_pointer();
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
1963+void WalletStatuslessHostImpl::cancel_statusless(const HttpRequestId &request_id) {
1964+ auto ptr = this->_uniffi_internal_clone_pointer();
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,
1976+WalletStatuslessHostImpl::~WalletStatuslessHostImpl() {
1978+ uniffi_wallet_engine_fn_free_walletstatuslesshost,
1984+uint64_t WalletStatuslessHostImpl::_uniffi_internal_clone_pointer() const {
1985+ return uniffi::rust_call(
1986+ uniffi_wallet_engine_fn_clone_walletstatuslesshost,
2157+std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::lift(uint64_t ptr) {
2158+ return std::shared_ptr<TonConnectDerivedSession>(new TonConnectDerivedSession(ptr));
2161+uint64_t FfiConverterTonConnectDerivedSession::lower(const std::shared_ptr<TonConnectDerivedSession> &obj) {
2162+ return reinterpret_cast<TonConnectDerivedSession*>(obj.get())->_uniffi_internal_clone_pointer();
2165+std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::read(RustStream &stream) {
2169+ return FfiConverterTonConnectDerivedSession::lift(ptr);
2172+void FfiConverterTonConnectDerivedSession::write(RustStream &stream, const std::shared_ptr<TonConnectDerivedSession> &obj) {
2173+ stream << FfiConverterTonConnectDerivedSession::lower(obj);
2176+uint64_t FfiConverterTonConnectDerivedSession::allocation_size(const std::shared_ptr<TonConnectDerivedSession> &) {
2182+std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::lift(uint64_t ptr) {
2183+ return std::shared_ptr<TonConnectSession>(new TonConnectSession(ptr));
2186+uint64_t FfiConverterTonConnectSession::lower(const std::shared_ptr<TonConnectSession> &obj) {
2187+ return reinterpret_cast<TonConnectSession*>(obj.get())->_uniffi_internal_clone_pointer();
2190+std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::read(RustStream &stream) {
2194+ return FfiConverterTonConnectSession::lift(ptr);
2197+void FfiConverterTonConnectSession::write(RustStream &stream, const std::shared_ptr<TonConnectSession> &obj) {
2198+ stream << FfiConverterTonConnectSession::lower(obj);
2201+uint64_t FfiConverterTonConnectSession::allocation_size(const std::shared_ptr<TonConnectSession> &) {
2207+std::shared_ptr<WalletClient> FfiConverterWalletClient::lift(uint64_t ptr) {
2208+ return std::shared_ptr<WalletClient>(new WalletClient(ptr));
2211+uint64_t FfiConverterWalletClient::lower(const std::shared_ptr<WalletClient> &obj) {
2212+ return reinterpret_cast<WalletClient*>(obj.get())->_uniffi_internal_clone_pointer();
2215+std::shared_ptr<WalletClient> FfiConverterWalletClient::read(RustStream &stream) {
2219+ return FfiConverterWalletClient::lift(ptr);
2222+void FfiConverterWalletClient::write(RustStream &stream, const std::shared_ptr<WalletClient> &obj) {
2223+ stream << FfiConverterWalletClient::lower(obj);
2226+uint64_t FfiConverterWalletClient::allocation_size(const std::shared_ptr<WalletClient> &) {
2232+std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::lift(uint64_t ptr) {
2233+ return std::shared_ptr<WalletHttpHost>(new WalletHttpHostImpl(ptr));
2236+uint64_t FfiConverterWalletHttpHost::lower(const std::shared_ptr<WalletHttpHost> &obj) {
2237+ return handle_map.insert(obj);
2240+std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::read(RustStream &stream) {
2244+ return FfiConverterWalletHttpHost::lift(ptr);
2247+void FfiConverterWalletHttpHost::write(RustStream &stream, const std::shared_ptr<WalletHttpHost> &obj) {
2248+ stream << FfiConverterWalletHttpHost::lower(obj);
2251+uint64_t FfiConverterWalletHttpHost::allocation_size(const std::shared_ptr<WalletHttpHost> &) {
2257+std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::lift(uint64_t ptr) {
2258+ return std::shared_ptr<WalletLifecycle>(new WalletLifecycle(ptr));
2261+uint64_t FfiConverterWalletLifecycle::lower(const std::shared_ptr<WalletLifecycle> &obj) {
2262+ return reinterpret_cast<WalletLifecycle*>(obj.get())->_uniffi_internal_clone_pointer();
2265+std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::read(RustStream &stream) {
2269+ return FfiConverterWalletLifecycle::lift(ptr);
2272+void FfiConverterWalletLifecycle::write(RustStream &stream, const std::shared_ptr<WalletLifecycle> &obj) {
2273+ stream << FfiConverterWalletLifecycle::lower(obj);
2276+uint64_t FfiConverterWalletLifecycle::allocation_size(const std::shared_ptr<WalletLifecycle> &) {
2282+std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::lift(uint64_t ptr) {
2283+ return std::shared_ptr<WalletPlatformHost>(new WalletPlatformHostImpl(ptr));
2286+uint64_t FfiConverterWalletPlatformHost::lower(const std::shared_ptr<WalletPlatformHost> &obj) {
2287+ return handle_map.insert(obj);
2290+std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::read(RustStream &stream) {
2294+ return FfiConverterWalletPlatformHost::lift(ptr);
2297+void FfiConverterWalletPlatformHost::write(RustStream &stream, const std::shared_ptr<WalletPlatformHost> &obj) {
2298+ stream << FfiConverterWalletPlatformHost::lower(obj);
2301+uint64_t FfiConverterWalletPlatformHost::allocation_size(const std::shared_ptr<WalletPlatformHost> &) {
2307+std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::lift(uint64_t ptr) {
2308+ return std::shared_ptr<WalletStatuslessHost>(new WalletStatuslessHostImpl(ptr));
2311+uint64_t FfiConverterWalletStatuslessHost::lower(const std::shared_ptr<WalletStatuslessHost> &obj) {
2312+ return handle_map.insert(obj);
2315+std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::read(RustStream &stream) {
2319+ return FfiConverterWalletStatuslessHost::lift(ptr);
2322+void FfiConverterWalletStatuslessHost::write(RustStream &stream, const std::shared_ptr<WalletStatuslessHost> &obj) {
2323+ stream << FfiConverterWalletStatuslessHost::lower(obj);
2326+uint64_t FfiConverterWalletStatuslessHost::allocation_size(const std::shared_ptr<WalletStatuslessHost> &) {
2331+AccountSnapshot FfiConverterTypeAccountSnapshot::lift(RustBuffer buf) {
2332+ auto stream = RustStream(&buf);
2333+ auto ret = FfiConverterTypeAccountSnapshot::read(stream);
2335+ rustbuffer_free(buf);
2337+ return std::move(ret);
2340+RustBuffer FfiConverterTypeAccountSnapshot::lower(const AccountSnapshot &val) {
2341+ auto buf = rustbuffer_alloc(allocation_size(val));
2342+ auto stream = RustStream(&buf);
2344+ FfiConverterTypeAccountSnapshot::write(stream, val);
2346+ return std::move(buf);
2349+AccountSnapshot FfiConverterTypeAccountSnapshot::read(RustStream &stream) {
2351+ FfiConverterTypeUnsignedDecimalString::read(stream),
2352+ FfiConverterAccountStatus::read(stream),
2353+ FfiConverterUInt64::read(stream)
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);
2363+uint64_t FfiConverterTypeAccountSnapshot::allocation_size(const AccountSnapshot &val) {
2366+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.balance_nanograms) +
2367+ FfiConverterAccountStatus::allocation_size(val.status) +
2368+ FfiConverterUInt64::allocation_size(val.sync_utime);
2373+ActivityCursor FfiConverterTypeActivityCursor::lift(RustBuffer buf) {
2374+ auto stream = RustStream(&buf);
2375+ auto ret = FfiConverterTypeActivityCursor::read(stream);
2377+ rustbuffer_free(buf);
2379+ return std::move(ret);
2382+RustBuffer FfiConverterTypeActivityCursor::lower(const ActivityCursor &val) {
2383+ auto buf = rustbuffer_alloc(allocation_size(val));
2384+ auto stream = RustStream(&buf);
2386+ FfiConverterTypeActivityCursor::write(stream, val);
2388+ return std::move(buf);
2391+ActivityCursor FfiConverterTypeActivityCursor::read(RustStream &stream) {
2393+ FfiConverterTypeUnsignedDecimalString::read(stream),
2394+ FfiConverterTypeBase64Hash::read(stream)
2398+void FfiConverterTypeActivityCursor::write(RustStream &stream, const ActivityCursor &val) {
2399+ FfiConverterTypeUnsignedDecimalString::write(stream, val.logical_time);
2400+ FfiConverterTypeBase64Hash::write(stream, val.hash);
2403+uint64_t FfiConverterTypeActivityCursor::allocation_size(const ActivityCursor &val) {
2406+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.logical_time) +
2407+ FfiConverterTypeBase64Hash::allocation_size(val.hash);
2412+ActivityItem FfiConverterTypeActivityItem::lift(RustBuffer buf) {
2413+ auto stream = RustStream(&buf);
2414+ auto ret = FfiConverterTypeActivityItem::read(stream);
2416+ rustbuffer_free(buf);
2418+ return std::move(ret);
2421+RustBuffer FfiConverterTypeActivityItem::lower(const ActivityItem &val) {
2422+ auto buf = rustbuffer_alloc(allocation_size(val));
2423+ auto stream = RustStream(&buf);
2425+ FfiConverterTypeActivityItem::write(stream, val);
2427+ return std::move(buf);
2430+ActivityItem FfiConverterTypeActivityItem::read(RustStream &stream) {
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)
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);
2460+uint64_t FfiConverterTypeActivityItem::allocation_size(const ActivityItem &val) {
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);
2478+ActivityList FfiConverterTypeActivityList::lift(RustBuffer buf) {
2479+ auto stream = RustStream(&buf);
2480+ auto ret = FfiConverterTypeActivityList::read(stream);
2482+ rustbuffer_free(buf);
2484+ return std::move(ret);
2487+RustBuffer FfiConverterTypeActivityList::lower(const ActivityList &val) {
2488+ auto buf = rustbuffer_alloc(allocation_size(val));
2489+ auto stream = RustStream(&buf);
2491+ FfiConverterTypeActivityList::write(stream, val);
2493+ return std::move(buf);
2496+ActivityList FfiConverterTypeActivityList::read(RustStream &stream) {
2498+ FfiConverterSequenceTypeActivityItem::read(stream),
2499+ FfiConverterTypeResourceState::read(stream),
2500+ FfiConverterTypeResourceState::read(stream),
2501+ FfiConverterBool::read(stream)
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);
2512+uint64_t FfiConverterTypeActivityList::allocation_size(const ActivityList &val) {
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);
2523+CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::lift(RustBuffer buf) {
2524+ auto stream = RustStream(&buf);
2525+ auto ret = FfiConverterTypeCreateEncryptedCommentRequest::read(stream);
2527+ rustbuffer_free(buf);
2529+ return std::move(ret);
2532+RustBuffer FfiConverterTypeCreateEncryptedCommentRequest::lower(const CreateEncryptedCommentRequest &val) {
2533+ auto buf = rustbuffer_alloc(allocation_size(val));
2534+ auto stream = RustStream(&buf);
2536+ FfiConverterTypeCreateEncryptedCommentRequest::write(stream, val);
2538+ return std::move(buf);
2541+CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::read(RustStream &stream) {
2543+ FfiConverterTypeTonAddressString::read(stream),
2544+ FfiConverterString::read(stream),
2545+ FfiConverterOptionalBytes::read(stream)
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);
2555+uint64_t FfiConverterTypeCreateEncryptedCommentRequest::allocation_size(const CreateEncryptedCommentRequest &val) {
2558+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
2559+ FfiConverterString::allocation_size(val.comment) +
2560+ FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
2565+CreateWalletRequest FfiConverterTypeCreateWalletRequest::lift(RustBuffer buf) {
2566+ auto stream = RustStream(&buf);
2567+ auto ret = FfiConverterTypeCreateWalletRequest::read(stream);
2569+ rustbuffer_free(buf);
2571+ return std::move(ret);
2574+RustBuffer FfiConverterTypeCreateWalletRequest::lower(const CreateWalletRequest &val) {
2575+ auto buf = rustbuffer_alloc(allocation_size(val));
2576+ auto stream = RustStream(&buf);
2578+ FfiConverterTypeCreateWalletRequest::write(stream, val);
2580+ return std::move(buf);
2583+CreateWalletRequest FfiConverterTypeCreateWalletRequest::read(RustStream &stream) {
2585+ FfiConverterString::read(stream),
2586+ FfiConverterNetwork::read(stream)
2590+void FfiConverterTypeCreateWalletRequest::write(RustStream &stream, const CreateWalletRequest &val) {
2591+ FfiConverterString::write(stream, val.record_id);
2592+ FfiConverterNetwork::write(stream, val.network);
2595+uint64_t FfiConverterTypeCreateWalletRequest::allocation_size(const CreateWalletRequest &val) {
2598+ FfiConverterString::allocation_size(val.record_id) +
2599+ FfiConverterNetwork::allocation_size(val.network);
2604+CreatedWallet FfiConverterTypeCreatedWallet::lift(RustBuffer buf) {
2605+ auto stream = RustStream(&buf);
2606+ auto ret = FfiConverterTypeCreatedWallet::read(stream);
2608+ rustbuffer_free(buf);
2610+ return std::move(ret);
2613+RustBuffer FfiConverterTypeCreatedWallet::lower(const CreatedWallet &val) {
2614+ auto buf = rustbuffer_alloc(allocation_size(val));
2615+ auto stream = RustStream(&buf);
2617+ FfiConverterTypeCreatedWallet::write(stream, val);
2619+ return std::move(buf);
2622+CreatedWallet FfiConverterTypeCreatedWallet::read(RustStream &stream) {
2624+ FfiConverterTypeWalletDescriptor::read(stream),
2625+ FfiConverterTypeRecoveryPhrase::read(stream)
2629+void FfiConverterTypeCreatedWallet::write(RustStream &stream, const CreatedWallet &val) {
2630+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
2631+ FfiConverterTypeRecoveryPhrase::write(stream, val.recovery_phrase);
2634+uint64_t FfiConverterTypeCreatedWallet::allocation_size(const CreatedWallet &val) {
2637+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
2638+ FfiConverterTypeRecoveryPhrase::allocation_size(val.recovery_phrase);
2643+DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::lift(RustBuffer buf) {
2644+ auto stream = RustStream(&buf);
2645+ auto ret = FfiConverterTypeDecryptCommentRequest::read(stream);
2647+ rustbuffer_free(buf);
2649+ return std::move(ret);
2652+RustBuffer FfiConverterTypeDecryptCommentRequest::lower(const DecryptCommentRequest &val) {
2653+ auto buf = rustbuffer_alloc(allocation_size(val));
2654+ auto stream = RustStream(&buf);
2656+ FfiConverterTypeDecryptCommentRequest::write(stream, val);
2658+ return std::move(buf);
2661+DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::read(RustStream &stream) {
2663+ FfiConverterTypeTonAddressString::read(stream),
2664+ FfiConverterTypeBoc::read(stream)
2668+void FfiConverterTypeDecryptCommentRequest::write(RustStream &stream, const DecryptCommentRequest &val) {
2669+ FfiConverterTypeTonAddressString::write(stream, val.sender);
2670+ FfiConverterTypeBoc::write(stream, val.body);
2673+uint64_t FfiConverterTypeDecryptCommentRequest::allocation_size(const DecryptCommentRequest &val) {
2676+ FfiConverterTypeTonAddressString::allocation_size(val.sender) +
2677+ FfiConverterTypeBoc::allocation_size(val.body);
2682+DomainError FfiConverterTypeDomainError::lift(RustBuffer buf) {
2683+ auto stream = RustStream(&buf);
2684+ auto ret = FfiConverterTypeDomainError::read(stream);
2686+ rustbuffer_free(buf);
2688+ return std::move(ret);
2691+RustBuffer FfiConverterTypeDomainError::lower(const DomainError &val) {
2692+ auto buf = rustbuffer_alloc(allocation_size(val));
2693+ auto stream = RustStream(&buf);
2695+ FfiConverterTypeDomainError::write(stream, val);
2697+ return std::move(buf);
2700+DomainError FfiConverterTypeDomainError::read(RustStream &stream) {
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)
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);
2722+uint64_t FfiConverterTypeDomainError::allocation_size(const DomainError &val) {
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);
2736+EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::lift(RustBuffer buf) {
2737+ auto stream = RustStream(&buf);
2738+ auto ret = FfiConverterTypeEncryptedCommentRecipientRequest::read(stream);
2740+ rustbuffer_free(buf);
2742+ return std::move(ret);
2745+RustBuffer FfiConverterTypeEncryptedCommentRecipientRequest::lower(const EncryptedCommentRecipientRequest &val) {
2746+ auto buf = rustbuffer_alloc(allocation_size(val));
2747+ auto stream = RustStream(&buf);
2749+ FfiConverterTypeEncryptedCommentRecipientRequest::write(stream, val);
2751+ return std::move(buf);
2754+EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::read(RustStream &stream) {
2756+ FfiConverterTypeTonAddressString::read(stream),
2757+ FfiConverterOptionalBytes::read(stream)
2761+void FfiConverterTypeEncryptedCommentRecipientRequest::write(RustStream &stream, const EncryptedCommentRecipientRequest &val) {
2762+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
2763+ FfiConverterOptionalBytes::write(stream, val.recipient_public_key);
2766+uint64_t FfiConverterTypeEncryptedCommentRecipientRequest::allocation_size(const EncryptedCommentRecipientRequest &val) {
2769+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
2770+ FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
2775+HttpHeader FfiConverterTypeHttpHeader::lift(RustBuffer buf) {
2776+ auto stream = RustStream(&buf);
2777+ auto ret = FfiConverterTypeHttpHeader::read(stream);
2779+ rustbuffer_free(buf);
2781+ return std::move(ret);
2784+RustBuffer FfiConverterTypeHttpHeader::lower(const HttpHeader &val) {
2785+ auto buf = rustbuffer_alloc(allocation_size(val));
2786+ auto stream = RustStream(&buf);
2788+ FfiConverterTypeHttpHeader::write(stream, val);
2790+ return std::move(buf);
2793+HttpHeader FfiConverterTypeHttpHeader::read(RustStream &stream) {
2795+ FfiConverterString::read(stream),
2796+ FfiConverterString::read(stream)
2800+void FfiConverterTypeHttpHeader::write(RustStream &stream, const HttpHeader &val) {
2801+ FfiConverterString::write(stream, val.name);
2802+ FfiConverterString::write(stream, val.value);
2805+uint64_t FfiConverterTypeHttpHeader::allocation_size(const HttpHeader &val) {
2808+ FfiConverterString::allocation_size(val.name) +
2809+ FfiConverterString::allocation_size(val.value);
2814+HttpRequest FfiConverterTypeHttpRequest::lift(RustBuffer buf) {
2815+ auto stream = RustStream(&buf);
2816+ auto ret = FfiConverterTypeHttpRequest::read(stream);
2818+ rustbuffer_free(buf);
2820+ return std::move(ret);
2823+RustBuffer FfiConverterTypeHttpRequest::lower(const HttpRequest &val) {
2824+ auto buf = rustbuffer_alloc(allocation_size(val));
2825+ auto stream = RustStream(&buf);
2827+ FfiConverterTypeHttpRequest::write(stream, val);
2829+ return std::move(buf);
2832+HttpRequest FfiConverterTypeHttpRequest::read(RustStream &stream) {
2834+ FfiConverterTypeHttpRequestId::read(stream),
2835+ FfiConverterHttpMethod::read(stream),
2836+ FfiConverterString::read(stream),
2837+ FfiConverterSequenceTypeHttpHeader::read(stream),
2838+ FfiConverterBytes::read(stream),
2839+ FfiConverterUInt64::read(stream)
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);
2852+uint64_t FfiConverterTypeHttpRequest::allocation_size(const HttpRequest &val) {
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);
2865+HttpRequestId FfiConverterTypeHttpRequestId::lift(RustBuffer buf) {
2866+ auto stream = RustStream(&buf);
2867+ auto ret = FfiConverterTypeHttpRequestId::read(stream);
2869+ rustbuffer_free(buf);
2871+ return std::move(ret);
2874+RustBuffer FfiConverterTypeHttpRequestId::lower(const HttpRequestId &val) {
2875+ auto buf = rustbuffer_alloc(allocation_size(val));
2876+ auto stream = RustStream(&buf);
2878+ FfiConverterTypeHttpRequestId::write(stream, val);
2880+ return std::move(buf);
2883+HttpRequestId FfiConverterTypeHttpRequestId::read(RustStream &stream) {
2885+ FfiConverterUInt64::read(stream)
2889+void FfiConverterTypeHttpRequestId::write(RustStream &stream, const HttpRequestId &val) {
2890+ FfiConverterUInt64::write(stream, val.value);
2893+uint64_t FfiConverterTypeHttpRequestId::allocation_size(const HttpRequestId &val) {
2896+ FfiConverterUInt64::allocation_size(val.value);
2901+HttpResponse FfiConverterTypeHttpResponse::lift(RustBuffer buf) {
2902+ auto stream = RustStream(&buf);
2903+ auto ret = FfiConverterTypeHttpResponse::read(stream);
2905+ rustbuffer_free(buf);
2907+ return std::move(ret);
2910+RustBuffer FfiConverterTypeHttpResponse::lower(const HttpResponse &val) {
2911+ auto buf = rustbuffer_alloc(allocation_size(val));
2912+ auto stream = RustStream(&buf);
2914+ FfiConverterTypeHttpResponse::write(stream, val);
2916+ return std::move(buf);
2919+HttpResponse FfiConverterTypeHttpResponse::read(RustStream &stream) {
2921+ FfiConverterUInt16::read(stream),
2922+ FfiConverterSequenceTypeHttpHeader::read(stream),
2923+ FfiConverterBytes::read(stream),
2924+ FfiConverterString::read(stream)
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);
2935+uint64_t FfiConverterTypeHttpResponse::allocation_size(const HttpResponse &val) {
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);
2946+ImportWalletRequest FfiConverterTypeImportWalletRequest::lift(RustBuffer buf) {
2947+ auto stream = RustStream(&buf);
2948+ auto ret = FfiConverterTypeImportWalletRequest::read(stream);
2950+ rustbuffer_free(buf);
2952+ return std::move(ret);
2955+RustBuffer FfiConverterTypeImportWalletRequest::lower(const ImportWalletRequest &val) {
2956+ auto buf = rustbuffer_alloc(allocation_size(val));
2957+ auto stream = RustStream(&buf);
2959+ FfiConverterTypeImportWalletRequest::write(stream, val);
2961+ return std::move(buf);
2964+ImportWalletRequest FfiConverterTypeImportWalletRequest::read(RustStream &stream) {
2966+ FfiConverterString::read(stream),
2967+ FfiConverterNetwork::read(stream),
2968+ FfiConverterSequenceString::read(stream)
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);
2978+uint64_t FfiConverterTypeImportWalletRequest::allocation_size(const ImportWalletRequest &val) {
2981+ FfiConverterString::allocation_size(val.record_id) +
2982+ FfiConverterNetwork::allocation_size(val.network) +
2983+ FfiConverterSequenceString::allocation_size(val.recovery_words);
2988+JournalCompareExchange FfiConverterTypeJournalCompareExchange::lift(RustBuffer buf) {
2989+ auto stream = RustStream(&buf);
2990+ auto ret = FfiConverterTypeJournalCompareExchange::read(stream);
2992+ rustbuffer_free(buf);
2994+ return std::move(ret);
2997+RustBuffer FfiConverterTypeJournalCompareExchange::lower(const JournalCompareExchange &val) {
2998+ auto buf = rustbuffer_alloc(allocation_size(val));
2999+ auto stream = RustStream(&buf);
3001+ FfiConverterTypeJournalCompareExchange::write(stream, val);
3003+ return std::move(buf);
3006+JournalCompareExchange FfiConverterTypeJournalCompareExchange::read(RustStream &stream) {
3008+ FfiConverterTypeJournalKey::read(stream),
3009+ FfiConverterOptionalUInt64::read(stream),
3010+ FfiConverterTypeJournalRecord::read(stream)
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);
3020+uint64_t FfiConverterTypeJournalCompareExchange::allocation_size(const JournalCompareExchange &val) {
3023+ FfiConverterTypeJournalKey::allocation_size(val.key) +
3024+ FfiConverterOptionalUInt64::allocation_size(val.expected_version) +
3025+ FfiConverterTypeJournalRecord::allocation_size(val.replacement);
3030+JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::lift(RustBuffer buf) {
3031+ auto stream = RustStream(&buf);
3032+ auto ret = FfiConverterTypeJournalCompareExchangeResult::read(stream);
3034+ rustbuffer_free(buf);
3036+ return std::move(ret);
3039+RustBuffer FfiConverterTypeJournalCompareExchangeResult::lower(const JournalCompareExchangeResult &val) {
3040+ auto buf = rustbuffer_alloc(allocation_size(val));
3041+ auto stream = RustStream(&buf);
3043+ FfiConverterTypeJournalCompareExchangeResult::write(stream, val);
3045+ return std::move(buf);
3048+JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::read(RustStream &stream) {
3050+ FfiConverterBool::read(stream),
3051+ FfiConverterOptionalTypeJournalRecord::read(stream)
3055+void FfiConverterTypeJournalCompareExchangeResult::write(RustStream &stream, const JournalCompareExchangeResult &val) {
3056+ FfiConverterBool::write(stream, val.applied);
3057+ FfiConverterOptionalTypeJournalRecord::write(stream, val.current);
3060+uint64_t FfiConverterTypeJournalCompareExchangeResult::allocation_size(const JournalCompareExchangeResult &val) {
3063+ FfiConverterBool::allocation_size(val.applied) +
3064+ FfiConverterOptionalTypeJournalRecord::allocation_size(val.current);
3069+JournalKey FfiConverterTypeJournalKey::lift(RustBuffer buf) {
3070+ auto stream = RustStream(&buf);
3071+ auto ret = FfiConverterTypeJournalKey::read(stream);
3073+ rustbuffer_free(buf);
3075+ return std::move(ret);
3078+RustBuffer FfiConverterTypeJournalKey::lower(const JournalKey &val) {
3079+ auto buf = rustbuffer_alloc(allocation_size(val));
3080+ auto stream = RustStream(&buf);
3082+ FfiConverterTypeJournalKey::write(stream, val);
3084+ return std::move(buf);
3087+JournalKey FfiConverterTypeJournalKey::read(RustStream &stream) {
3089+ FfiConverterString::read(stream),
3090+ FfiConverterString::read(stream)
3094+void FfiConverterTypeJournalKey::write(RustStream &stream, const JournalKey &val) {
3095+ FfiConverterString::write(stream, val.record_id);
3096+ FfiConverterString::write(stream, val.slot);
3099+uint64_t FfiConverterTypeJournalKey::allocation_size(const JournalKey &val) {
3102+ FfiConverterString::allocation_size(val.record_id) +
3103+ FfiConverterString::allocation_size(val.slot);
3108+JournalRecord FfiConverterTypeJournalRecord::lift(RustBuffer buf) {
3109+ auto stream = RustStream(&buf);
3110+ auto ret = FfiConverterTypeJournalRecord::read(stream);
3112+ rustbuffer_free(buf);
3114+ return std::move(ret);
3117+RustBuffer FfiConverterTypeJournalRecord::lower(const JournalRecord &val) {
3118+ auto buf = rustbuffer_alloc(allocation_size(val));
3119+ auto stream = RustStream(&buf);
3121+ FfiConverterTypeJournalRecord::write(stream, val);
3123+ return std::move(buf);
3126+JournalRecord FfiConverterTypeJournalRecord::read(RustStream &stream) {
3128+ FfiConverterUInt64::read(stream),
3129+ FfiConverterBytes::read(stream)
3133+void FfiConverterTypeJournalRecord::write(RustStream &stream, const JournalRecord &val) {
3134+ FfiConverterUInt64::write(stream, val.version);
3135+ FfiConverterBytes::write(stream, val.payload);
3138+uint64_t FfiConverterTypeJournalRecord::allocation_size(const JournalRecord &val) {
3141+ FfiConverterUInt64::allocation_size(val.version) +
3142+ FfiConverterBytes::allocation_size(val.payload);
3147+NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::lift(RustBuffer buf) {
3148+ auto stream = RustStream(&buf);
3149+ auto ret = FfiConverterTypeNftCollectionDescriptor::read(stream);
3151+ rustbuffer_free(buf);
3153+ return std::move(ret);
3156+RustBuffer FfiConverterTypeNftCollectionDescriptor::lower(const NftCollectionDescriptor &val) {
3157+ auto buf = rustbuffer_alloc(allocation_size(val));
3158+ auto stream = RustStream(&buf);
3160+ FfiConverterTypeNftCollectionDescriptor::write(stream, val);
3162+ return std::move(buf);
3165+NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::read(RustStream &stream) {
3167+ FfiConverterTypeTonAddressString::read(stream),
3168+ FfiConverterOptionalString::read(stream),
3169+ FfiConverterOptionalString::read(stream),
3170+ FfiConverterOptionalString::read(stream),
3171+ FfiConverterMapStringString::read(stream)
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);
3183+uint64_t FfiConverterTypeNftCollectionDescriptor::allocation_size(const NftCollectionDescriptor &val) {
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);
3195+NftItem FfiConverterTypeNftItem::lift(RustBuffer buf) {
3196+ auto stream = RustStream(&buf);
3197+ auto ret = FfiConverterTypeNftItem::read(stream);
3199+ rustbuffer_free(buf);
3201+ return std::move(ret);
3204+RustBuffer FfiConverterTypeNftItem::lower(const NftItem &val) {
3205+ auto buf = rustbuffer_alloc(allocation_size(val));
3206+ auto stream = RustStream(&buf);
3208+ FfiConverterTypeNftItem::write(stream, val);
3210+ return std::move(buf);
3213+NftItem FfiConverterTypeNftItem::read(RustStream &stream) {
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)
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);
3253+uint64_t FfiConverterTypeNftItem::allocation_size(const NftItem &val) {
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);
3276+NftList FfiConverterTypeNftList::lift(RustBuffer buf) {
3277+ auto stream = RustStream(&buf);
3278+ auto ret = FfiConverterTypeNftList::read(stream);
3280+ rustbuffer_free(buf);
3282+ return std::move(ret);
3285+RustBuffer FfiConverterTypeNftList::lower(const NftList &val) {
3286+ auto buf = rustbuffer_alloc(allocation_size(val));
3287+ auto stream = RustStream(&buf);
3289+ FfiConverterTypeNftList::write(stream, val);
3291+ return std::move(buf);
3294+NftList FfiConverterTypeNftList::read(RustStream &stream) {
3296+ FfiConverterSequenceTypeNftItem::read(stream),
3297+ FfiConverterTypeResourceState::read(stream),
3298+ FfiConverterTypeResourceState::read(stream),
3299+ FfiConverterBool::read(stream)
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);
3310+uint64_t FfiConverterTypeNftList::allocation_size(const NftList &val) {
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);
3321+NftTransferIntent FfiConverterTypeNftTransferIntent::lift(RustBuffer buf) {
3322+ auto stream = RustStream(&buf);
3323+ auto ret = FfiConverterTypeNftTransferIntent::read(stream);
3325+ rustbuffer_free(buf);
3327+ return std::move(ret);
3330+RustBuffer FfiConverterTypeNftTransferIntent::lower(const NftTransferIntent &val) {
3331+ auto buf = rustbuffer_alloc(allocation_size(val));
3332+ auto stream = RustStream(&buf);
3334+ FfiConverterTypeNftTransferIntent::write(stream, val);
3336+ return std::move(buf);
3339+NftTransferIntent FfiConverterTypeNftTransferIntent::read(RustStream &stream) {
3341+ FfiConverterTypeTonAddressString::read(stream),
3342+ FfiConverterTypeTonAddressString::read(stream),
3343+ FfiConverterNftTransferFunding::read(stream),
3344+ FfiConverterNftTransferPayload::read(stream),
3345+ FfiConverterSendExpiration::read(stream)
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);
3357+uint64_t FfiConverterTypeNftTransferIntent::allocation_size(const NftTransferIntent &val) {
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);
3369+NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::lift(RustBuffer buf) {
3370+ auto stream = RustStream(&buf);
3371+ auto ret = FfiConverterTypeNftTransferPreviewRequest::read(stream);
3373+ rustbuffer_free(buf);
3375+ return std::move(ret);
3378+RustBuffer FfiConverterTypeNftTransferPreviewRequest::lower(const NftTransferPreviewRequest &val) {
3379+ auto buf = rustbuffer_alloc(allocation_size(val));
3380+ auto stream = RustStream(&buf);
3382+ FfiConverterTypeNftTransferPreviewRequest::write(stream, val);
3384+ return std::move(buf);
3387+NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::read(RustStream &stream) {
3389+ FfiConverterTypeNonEmptyString::read(stream),
3390+ FfiConverterTypeNftTransferIntent::read(stream)
3394+void FfiConverterTypeNftTransferPreviewRequest::write(RustStream &stream, const NftTransferPreviewRequest &val) {
3395+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3396+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3399+uint64_t FfiConverterTypeNftTransferPreviewRequest::allocation_size(const NftTransferPreviewRequest &val) {
3402+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3403+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3408+NftTransferRequest FfiConverterTypeNftTransferRequest::lift(RustBuffer buf) {
3409+ auto stream = RustStream(&buf);
3410+ auto ret = FfiConverterTypeNftTransferRequest::read(stream);
3412+ rustbuffer_free(buf);
3414+ return std::move(ret);
3417+RustBuffer FfiConverterTypeNftTransferRequest::lower(const NftTransferRequest &val) {
3418+ auto buf = rustbuffer_alloc(allocation_size(val));
3419+ auto stream = RustStream(&buf);
3421+ FfiConverterTypeNftTransferRequest::write(stream, val);
3423+ return std::move(buf);
3426+NftTransferRequest FfiConverterTypeNftTransferRequest::read(RustStream &stream) {
3428+ FfiConverterTypeNonEmptyString::read(stream),
3429+ FfiConverterBool::read(stream),
3430+ FfiConverterTypeNftTransferIntent::read(stream)
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);
3440+uint64_t FfiConverterTypeNftTransferRequest::allocation_size(const NftTransferRequest &val) {
3443+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3444+ FfiConverterBool::allocation_size(val.force) +
3445+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3450+ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::lift(RustBuffer buf) {
3451+ auto stream = RustStream(&buf);
3452+ auto ret = FfiConverterTypeParsedTonTransferLink::read(stream);
3454+ rustbuffer_free(buf);
3456+ return std::move(ret);
3459+RustBuffer FfiConverterTypeParsedTonTransferLink::lower(const ParsedTonTransferLink &val) {
3460+ auto buf = rustbuffer_alloc(allocation_size(val));
3461+ auto stream = RustStream(&buf);
3463+ FfiConverterTypeParsedTonTransferLink::write(stream, val);
3465+ return std::move(buf);
3468+ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::read(RustStream &stream) {
3470+ FfiConverterTypeTonAddressString::read(stream),
3471+ FfiConverterTonTransferAsset::read(stream),
3472+ FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
3473+ FfiConverterTonTransferPayload::read(stream),
3474+ FfiConverterSendExpiration::read(stream)
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);
3486+uint64_t FfiConverterTypeParsedTonTransferLink::allocation_size(const ParsedTonTransferLink &val) {
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);
3498+PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::lift(RustBuffer buf) {
3499+ auto stream = RustStream(&buf);
3500+ auto ret = FfiConverterTypePrepareKeyRotationRequest::read(stream);
3502+ rustbuffer_free(buf);
3504+ return std::move(ret);
3507+RustBuffer FfiConverterTypePrepareKeyRotationRequest::lower(const PrepareKeyRotationRequest &val) {
3508+ auto buf = rustbuffer_alloc(allocation_size(val));
3509+ auto stream = RustStream(&buf);
3511+ FfiConverterTypePrepareKeyRotationRequest::write(stream, val);
3513+ return std::move(buf);
3516+PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::read(RustStream &stream) {
3518+ FfiConverterUInt64::read(stream),
3519+ FfiConverterKeyRotationMessageKind::read(stream)
3523+void FfiConverterTypePrepareKeyRotationRequest::write(RustStream &stream, const PrepareKeyRotationRequest &val) {
3524+ FfiConverterUInt64::write(stream, val.valid_until);
3525+ FfiConverterKeyRotationMessageKind::write(stream, val.message_kind);
3528+uint64_t FfiConverterTypePrepareKeyRotationRequest::allocation_size(const PrepareKeyRotationRequest &val) {
3531+ FfiConverterUInt64::allocation_size(val.valid_until) +
3532+ FfiConverterKeyRotationMessageKind::allocation_size(val.message_kind);
3537+PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::lift(RustBuffer buf) {
3538+ auto stream = RustStream(&buf);
3539+ auto ret = FfiConverterTypePrepareNftTransferRequest::read(stream);
3541+ rustbuffer_free(buf);
3543+ return std::move(ret);
3546+RustBuffer FfiConverterTypePrepareNftTransferRequest::lower(const PrepareNftTransferRequest &val) {
3547+ auto buf = rustbuffer_alloc(allocation_size(val));
3548+ auto stream = RustStream(&buf);
3550+ FfiConverterTypePrepareNftTransferRequest::write(stream, val);
3552+ return std::move(buf);
3555+PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::read(RustStream &stream) {
3557+ FfiConverterTypeNonEmptyString::read(stream),
3558+ FfiConverterTypeNftTransferIntent::read(stream)
3562+void FfiConverterTypePrepareNftTransferRequest::write(RustStream &stream, const PrepareNftTransferRequest &val) {
3563+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3564+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3567+uint64_t FfiConverterTypePrepareNftTransferRequest::allocation_size(const PrepareNftTransferRequest &val) {
3570+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3571+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3576+PrepareTransferRequest FfiConverterTypePrepareTransferRequest::lift(RustBuffer buf) {
3577+ auto stream = RustStream(&buf);
3578+ auto ret = FfiConverterTypePrepareTransferRequest::read(stream);
3580+ rustbuffer_free(buf);
3582+ return std::move(ret);
3585+RustBuffer FfiConverterTypePrepareTransferRequest::lower(const PrepareTransferRequest &val) {
3586+ auto buf = rustbuffer_alloc(allocation_size(val));
3587+ auto stream = RustStream(&buf);
3589+ FfiConverterTypePrepareTransferRequest::write(stream, val);
3591+ return std::move(buf);
3594+PrepareTransferRequest FfiConverterTypePrepareTransferRequest::read(RustStream &stream) {
3596+ FfiConverterTypeNonEmptyString::read(stream),
3597+ FfiConverterTypeSendIntent::read(stream)
3601+void FfiConverterTypePrepareTransferRequest::write(RustStream &stream, const PrepareTransferRequest &val) {
3602+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3603+ FfiConverterTypeSendIntent::write(stream, val.intent);
3606+uint64_t FfiConverterTypePrepareTransferRequest::allocation_size(const PrepareTransferRequest &val) {
3609+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3610+ FfiConverterTypeSendIntent::allocation_size(val.intent);
3615+PreparedKeyRotation FfiConverterTypePreparedKeyRotation::lift(RustBuffer buf) {
3616+ auto stream = RustStream(&buf);
3617+ auto ret = FfiConverterTypePreparedKeyRotation::read(stream);
3619+ rustbuffer_free(buf);
3621+ return std::move(ret);
3624+RustBuffer FfiConverterTypePreparedKeyRotation::lower(const PreparedKeyRotation &val) {
3625+ auto buf = rustbuffer_alloc(allocation_size(val));
3626+ auto stream = RustStream(&buf);
3628+ FfiConverterTypePreparedKeyRotation::write(stream, val);
3630+ return std::move(buf);
3633+PreparedKeyRotation FfiConverterTypePreparedKeyRotation::read(RustStream &stream) {
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)
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);
3657+uint64_t FfiConverterTypePreparedKeyRotation::allocation_size(const PreparedKeyRotation &val) {
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);
3672+PreparedTransfer FfiConverterTypePreparedTransfer::lift(RustBuffer buf) {
3673+ auto stream = RustStream(&buf);
3674+ auto ret = FfiConverterTypePreparedTransfer::read(stream);
3676+ rustbuffer_free(buf);
3678+ return std::move(ret);
3681+RustBuffer FfiConverterTypePreparedTransfer::lower(const PreparedTransfer &val) {
3682+ auto buf = rustbuffer_alloc(allocation_size(val));
3683+ auto stream = RustStream(&buf);
3685+ FfiConverterTypePreparedTransfer::write(stream, val);
3687+ return std::move(buf);
3690+PreparedTransfer FfiConverterTypePreparedTransfer::read(RustStream &stream) {
3692+ FfiConverterTypeNonEmptyString::read(stream),
3693+ FfiConverterTypeBoc::read(stream),
3694+ FfiConverterTypeBoc::read(stream),
3695+ FfiConverterUInt32::read(stream),
3696+ FfiConverterUInt64::read(stream)
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);
3708+uint64_t FfiConverterTypePreparedTransfer::allocation_size(const PreparedTransfer &val) {
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);
3720+ProtectedSecretRead FfiConverterTypeProtectedSecretRead::lift(RustBuffer buf) {
3721+ auto stream = RustStream(&buf);
3722+ auto ret = FfiConverterTypeProtectedSecretRead::read(stream);
3724+ rustbuffer_free(buf);
3726+ return std::move(ret);
3729+RustBuffer FfiConverterTypeProtectedSecretRead::lower(const ProtectedSecretRead &val) {
3730+ auto buf = rustbuffer_alloc(allocation_size(val));
3731+ auto stream = RustStream(&buf);
3733+ FfiConverterTypeProtectedSecretRead::write(stream, val);
3735+ return std::move(buf);
3738+ProtectedSecretRead FfiConverterTypeProtectedSecretRead::read(RustStream &stream) {
3740+ FfiConverterTypeProtectedSecretRef::read(stream),
3741+ FfiConverterSecretAccessReason::read(stream),
3742+ FfiConverterString::read(stream)
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);
3752+uint64_t FfiConverterTypeProtectedSecretRead::allocation_size(const ProtectedSecretRead &val) {
3755+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
3756+ FfiConverterSecretAccessReason::allocation_size(val.reason) +
3757+ FfiConverterString::allocation_size(val.prompt);
3762+ProtectedSecretRef FfiConverterTypeProtectedSecretRef::lift(RustBuffer buf) {
3763+ auto stream = RustStream(&buf);
3764+ auto ret = FfiConverterTypeProtectedSecretRef::read(stream);
3766+ rustbuffer_free(buf);
3768+ return std::move(ret);
3771+RustBuffer FfiConverterTypeProtectedSecretRef::lower(const ProtectedSecretRef &val) {
3772+ auto buf = rustbuffer_alloc(allocation_size(val));
3773+ auto stream = RustStream(&buf);
3775+ FfiConverterTypeProtectedSecretRef::write(stream, val);
3777+ return std::move(buf);
3780+ProtectedSecretRef FfiConverterTypeProtectedSecretRef::read(RustStream &stream) {
3782+ FfiConverterString::read(stream)
3786+void FfiConverterTypeProtectedSecretRef::write(RustStream &stream, const ProtectedSecretRef &val) {
3787+ FfiConverterString::write(stream, val.value);
3790+uint64_t FfiConverterTypeProtectedSecretRef::allocation_size(const ProtectedSecretRef &val) {
3793+ FfiConverterString::allocation_size(val.value);
3798+ProtectedSecretStore FfiConverterTypeProtectedSecretStore::lift(RustBuffer buf) {
3799+ auto stream = RustStream(&buf);
3800+ auto ret = FfiConverterTypeProtectedSecretStore::read(stream);
3802+ rustbuffer_free(buf);
3804+ return std::move(ret);
3807+RustBuffer FfiConverterTypeProtectedSecretStore::lower(const ProtectedSecretStore &val) {
3808+ auto buf = rustbuffer_alloc(allocation_size(val));
3809+ auto stream = RustStream(&buf);
3811+ FfiConverterTypeProtectedSecretStore::write(stream, val);
3813+ return std::move(buf);
3816+ProtectedSecretStore FfiConverterTypeProtectedSecretStore::read(RustStream &stream) {
3818+ FfiConverterTypeProtectedSecretRef::read(stream),
3819+ FfiConverterBytes::read(stream),
3820+ FfiConverterBool::read(stream)
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);
3830+uint64_t FfiConverterTypeProtectedSecretStore::allocation_size(const ProtectedSecretStore &val) {
3833+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
3834+ FfiConverterBytes::allocation_size(val.bytes) +
3835+ FfiConverterBool::allocation_size(val.require_user_presence);
3840+ProviderConfig FfiConverterTypeProviderConfig::lift(RustBuffer buf) {
3841+ auto stream = RustStream(&buf);
3842+ auto ret = FfiConverterTypeProviderConfig::read(stream);
3844+ rustbuffer_free(buf);
3846+ return std::move(ret);
3849+RustBuffer FfiConverterTypeProviderConfig::lower(const ProviderConfig &val) {
3850+ auto buf = rustbuffer_alloc(allocation_size(val));
3851+ auto stream = RustStream(&buf);
3853+ FfiConverterTypeProviderConfig::write(stream, val);
3855+ return std::move(buf);
3858+ProviderConfig FfiConverterTypeProviderConfig::read(RustStream &stream) {
3860+ FfiConverterString::read(stream),
3861+ FfiConverterOptionalTypeTonAddressString::read(stream),
3862+ FfiConverterUInt64::read(stream)
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);
3872+uint64_t FfiConverterTypeProviderConfig::allocation_size(const ProviderConfig &val) {
3875+ FfiConverterString::allocation_size(val.toncenter_base_url) +
3876+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.dns_root_address) +
3877+ FfiConverterUInt64::allocation_size(val.request_timeout_ms);
3882+RecoveryPhrase FfiConverterTypeRecoveryPhrase::lift(RustBuffer buf) {
3883+ auto stream = RustStream(&buf);
3884+ auto ret = FfiConverterTypeRecoveryPhrase::read(stream);
3886+ rustbuffer_free(buf);
3888+ return std::move(ret);
3891+RustBuffer FfiConverterTypeRecoveryPhrase::lower(const RecoveryPhrase &val) {
3892+ auto buf = rustbuffer_alloc(allocation_size(val));
3893+ auto stream = RustStream(&buf);
3895+ FfiConverterTypeRecoveryPhrase::write(stream, val);
3897+ return std::move(buf);
3900+RecoveryPhrase FfiConverterTypeRecoveryPhrase::read(RustStream &stream) {
3902+ FfiConverterString::read(stream)
3906+void FfiConverterTypeRecoveryPhrase::write(RustStream &stream, const RecoveryPhrase &val) {
3907+ FfiConverterString::write(stream, val.phrase);
3910+uint64_t FfiConverterTypeRecoveryPhrase::allocation_size(const RecoveryPhrase &val) {
3913+ FfiConverterString::allocation_size(val.phrase);
3918+ResolutionInfo FfiConverterTypeResolutionInfo::lift(RustBuffer buf) {
3919+ auto stream = RustStream(&buf);
3920+ auto ret = FfiConverterTypeResolutionInfo::read(stream);
3922+ rustbuffer_free(buf);
3924+ return std::move(ret);
3927+RustBuffer FfiConverterTypeResolutionInfo::lower(const ResolutionInfo &val) {
3928+ auto buf = rustbuffer_alloc(allocation_size(val));
3929+ auto stream = RustStream(&buf);
3931+ FfiConverterTypeResolutionInfo::write(stream, val);
3933+ return std::move(buf);
3936+ResolutionInfo FfiConverterTypeResolutionInfo::read(RustStream &stream) {
3938+ FfiConverterOptionalTypeBase64Hash::read(stream),
3939+ FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
3940+ FfiConverterOptionalPendingReason::read(stream),
3941+ FfiConverterBool::read(stream),
3942+ FfiConverterOptionalUInt64::read(stream)
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);
3954+uint64_t FfiConverterTypeResolutionInfo::allocation_size(const ResolutionInfo &val) {
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);
3966+ResourceState FfiConverterTypeResourceState::lift(RustBuffer buf) {
3967+ auto stream = RustStream(&buf);
3968+ auto ret = FfiConverterTypeResourceState::read(stream);
3970+ rustbuffer_free(buf);
3972+ return std::move(ret);
3975+RustBuffer FfiConverterTypeResourceState::lower(const ResourceState &val) {
3976+ auto buf = rustbuffer_alloc(allocation_size(val));
3977+ auto stream = RustStream(&buf);
3979+ FfiConverterTypeResourceState::write(stream, val);
3981+ return std::move(buf);
3984+ResourceState FfiConverterTypeResourceState::read(RustStream &stream) {
3986+ FfiConverterResourcePhase::read(stream),
3987+ FfiConverterOptionalTypeDomainError::read(stream)
3991+void FfiConverterTypeResourceState::write(RustStream &stream, const ResourceState &val) {
3992+ FfiConverterResourcePhase::write(stream, val.phase);
3993+ FfiConverterOptionalTypeDomainError::write(stream, val.error);
3996+uint64_t FfiConverterTypeResourceState::allocation_size(const ResourceState &val) {
3999+ FfiConverterResourcePhase::allocation_size(val.phase) +
4000+ FfiConverterOptionalTypeDomainError::allocation_size(val.error);
4005+SendBocRequest FfiConverterTypeSendBocRequest::lift(RustBuffer buf) {
4006+ auto stream = RustStream(&buf);
4007+ auto ret = FfiConverterTypeSendBocRequest::read(stream);
4009+ rustbuffer_free(buf);
4011+ return std::move(ret);
4014+RustBuffer FfiConverterTypeSendBocRequest::lower(const SendBocRequest &val) {
4015+ auto buf = rustbuffer_alloc(allocation_size(val));
4016+ auto stream = RustStream(&buf);
4018+ FfiConverterTypeSendBocRequest::write(stream, val);
4020+ return std::move(buf);
4023+SendBocRequest FfiConverterTypeSendBocRequest::read(RustStream &stream) {
4025+ FfiConverterTypeNonEmptyString::read(stream),
4026+ FfiConverterBool::read(stream),
4027+ FfiConverterTypeBoc::read(stream),
4028+ FfiConverterUInt32::read(stream),
4029+ FfiConverterUInt64::read(stream)
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);
4041+uint64_t FfiConverterTypeSendBocRequest::allocation_size(const SendBocRequest &val) {
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);
4053+SendEmulation FfiConverterTypeSendEmulation::lift(RustBuffer buf) {
4054+ auto stream = RustStream(&buf);
4055+ auto ret = FfiConverterTypeSendEmulation::read(stream);
4057+ rustbuffer_free(buf);
4059+ return std::move(ret);
4062+RustBuffer FfiConverterTypeSendEmulation::lower(const SendEmulation &val) {
4063+ auto buf = rustbuffer_alloc(allocation_size(val));
4064+ auto stream = RustStream(&buf);
4066+ FfiConverterTypeSendEmulation::write(stream, val);
4068+ return std::move(buf);
4071+SendEmulation FfiConverterTypeSendEmulation::read(RustStream &stream) {
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)
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);
4095+uint64_t FfiConverterTypeSendEmulation::allocation_size(const SendEmulation &val) {
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);
4110+SendEmulationAction FfiConverterTypeSendEmulationAction::lift(RustBuffer buf) {
4111+ auto stream = RustStream(&buf);
4112+ auto ret = FfiConverterTypeSendEmulationAction::read(stream);
4114+ rustbuffer_free(buf);
4116+ return std::move(ret);
4119+RustBuffer FfiConverterTypeSendEmulationAction::lower(const SendEmulationAction &val) {
4120+ auto buf = rustbuffer_alloc(allocation_size(val));
4121+ auto stream = RustStream(&buf);
4123+ FfiConverterTypeSendEmulationAction::write(stream, val);
4125+ return std::move(buf);
4128+SendEmulationAction FfiConverterTypeSendEmulationAction::read(RustStream &stream) {
4130+ FfiConverterTypeBase64Hash::read(stream),
4131+ FfiConverterTypeNonEmptyString::read(stream),
4132+ FfiConverterBool::read(stream),
4133+ FfiConverterSequenceTypeTonAddressString::read(stream),
4134+ FfiConverterSequenceTypeBase64Hash::read(stream),
4135+ FfiConverterString::read(stream)
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);
4148+uint64_t FfiConverterTypeSendEmulationAction::allocation_size(const SendEmulationAction &val) {
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);
4161+SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::lift(RustBuffer buf) {
4162+ auto stream = RustStream(&buf);
4163+ auto ret = FfiConverterTypeSendEmulationTransaction::read(stream);
4165+ rustbuffer_free(buf);
4167+ return std::move(ret);
4170+RustBuffer FfiConverterTypeSendEmulationTransaction::lower(const SendEmulationTransaction &val) {
4171+ auto buf = rustbuffer_alloc(allocation_size(val));
4172+ auto stream = RustStream(&buf);
4174+ FfiConverterTypeSendEmulationTransaction::write(stream, val);
4176+ return std::move(buf);
4179+SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::read(RustStream &stream) {
4181+ FfiConverterTypeTonAddressString::read(stream),
4182+ FfiConverterBool::read(stream),
4183+ FfiConverterBool::read(stream)
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);
4193+uint64_t FfiConverterTypeSendEmulationTransaction::allocation_size(const SendEmulationTransaction &val) {
4196+ FfiConverterTypeTonAddressString::allocation_size(val.account) +
4197+ FfiConverterBool::allocation_size(val.succeeded) +
4198+ FfiConverterBool::allocation_size(val.is_root);
4203+SendIntent FfiConverterTypeSendIntent::lift(RustBuffer buf) {
4204+ auto stream = RustStream(&buf);
4205+ auto ret = FfiConverterTypeSendIntent::read(stream);
4207+ rustbuffer_free(buf);
4209+ return std::move(ret);
4212+RustBuffer FfiConverterTypeSendIntent::lower(const SendIntent &val) {
4213+ auto buf = rustbuffer_alloc(allocation_size(val));
4214+ auto stream = RustStream(&buf);
4216+ FfiConverterTypeSendIntent::write(stream, val);
4218+ return std::move(buf);
4221+SendIntent FfiConverterTypeSendIntent::read(RustStream &stream) {
4223+ FfiConverterSendExpiration::read(stream),
4224+ FfiConverterSequenceTypeSendMessage::read(stream)
4228+void FfiConverterTypeSendIntent::write(RustStream &stream, const SendIntent &val) {
4229+ FfiConverterSendExpiration::write(stream, val.expiration);
4230+ FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
4233+uint64_t FfiConverterTypeSendIntent::allocation_size(const SendIntent &val) {
4236+ FfiConverterSendExpiration::allocation_size(val.expiration) +
4237+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages);
4242+SendMessage FfiConverterTypeSendMessage::lift(RustBuffer buf) {
4243+ auto stream = RustStream(&buf);
4244+ auto ret = FfiConverterTypeSendMessage::read(stream);
4246+ rustbuffer_free(buf);
4248+ return std::move(ret);
4251+RustBuffer FfiConverterTypeSendMessage::lower(const SendMessage &val) {
4252+ auto buf = rustbuffer_alloc(allocation_size(val));
4253+ auto stream = RustStream(&buf);
4255+ FfiConverterTypeSendMessage::write(stream, val);
4257+ return std::move(buf);
4260+SendMessage FfiConverterTypeSendMessage::read(RustStream &stream) {
4262+ FfiConverterTypeTonAddressString::read(stream),
4263+ FfiConverterSendAmount::read(stream),
4264+ FfiConverterSendMessageBody::read(stream),
4265+ FfiConverterBool::read(stream),
4266+ FfiConverterOptionalTypeBoc::read(stream)
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);
4278+uint64_t FfiConverterTypeSendMessage::allocation_size(const SendMessage &val) {
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);
4290+SendPreview FfiConverterTypeSendPreview::lift(RustBuffer buf) {
4291+ auto stream = RustStream(&buf);
4292+ auto ret = FfiConverterTypeSendPreview::read(stream);
4294+ rustbuffer_free(buf);
4296+ return std::move(ret);
4299+RustBuffer FfiConverterTypeSendPreview::lower(const SendPreview &val) {
4300+ auto buf = rustbuffer_alloc(allocation_size(val));
4301+ auto stream = RustStream(&buf);
4303+ FfiConverterTypeSendPreview::write(stream, val);
4305+ return std::move(buf);
4308+SendPreview FfiConverterTypeSendPreview::read(RustStream &stream) {
4310+ FfiConverterSequenceTypeSendMessage::read(stream),
4311+ FfiConverterUInt64::read(stream),
4312+ FfiConverterTypeBoc::read(stream),
4313+ FfiConverterTypeSendEmulation::read(stream)
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);
4324+uint64_t FfiConverterTypeSendPreview::allocation_size(const SendPreview &val) {
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);
4335+SendPreviewRequest FfiConverterTypeSendPreviewRequest::lift(RustBuffer buf) {
4336+ auto stream = RustStream(&buf);
4337+ auto ret = FfiConverterTypeSendPreviewRequest::read(stream);
4339+ rustbuffer_free(buf);
4341+ return std::move(ret);
4344+RustBuffer FfiConverterTypeSendPreviewRequest::lower(const SendPreviewRequest &val) {
4345+ auto buf = rustbuffer_alloc(allocation_size(val));
4346+ auto stream = RustStream(&buf);
4348+ FfiConverterTypeSendPreviewRequest::write(stream, val);
4350+ return std::move(buf);
4353+SendPreviewRequest FfiConverterTypeSendPreviewRequest::read(RustStream &stream) {
4355+ FfiConverterTypeSendIntent::read(stream)
4359+void FfiConverterTypeSendPreviewRequest::write(RustStream &stream, const SendPreviewRequest &val) {
4360+ FfiConverterTypeSendIntent::write(stream, val.intent);
4363+uint64_t FfiConverterTypeSendPreviewRequest::allocation_size(const SendPreviewRequest &val) {
4366+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4371+SendRequest FfiConverterTypeSendRequest::lift(RustBuffer buf) {
4372+ auto stream = RustStream(&buf);
4373+ auto ret = FfiConverterTypeSendRequest::read(stream);
4375+ rustbuffer_free(buf);
4377+ return std::move(ret);
4380+RustBuffer FfiConverterTypeSendRequest::lower(const SendRequest &val) {
4381+ auto buf = rustbuffer_alloc(allocation_size(val));
4382+ auto stream = RustStream(&buf);
4384+ FfiConverterTypeSendRequest::write(stream, val);
4386+ return std::move(buf);
4389+SendRequest FfiConverterTypeSendRequest::read(RustStream &stream) {
4391+ FfiConverterTypeNonEmptyString::read(stream),
4392+ FfiConverterBool::read(stream),
4393+ FfiConverterTypeSendIntent::read(stream)
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);
4403+uint64_t FfiConverterTypeSendRequest::allocation_size(const SendRequest &val) {
4406+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4407+ FfiConverterBool::allocation_size(val.force) +
4408+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4413+SendResult FfiConverterTypeSendResult::lift(RustBuffer buf) {
4414+ auto stream = RustStream(&buf);
4415+ auto ret = FfiConverterTypeSendResult::read(stream);
4417+ rustbuffer_free(buf);
4419+ return std::move(ret);
4422+RustBuffer FfiConverterTypeSendResult::lower(const SendResult &val) {
4423+ auto buf = rustbuffer_alloc(allocation_size(val));
4424+ auto stream = RustStream(&buf);
4426+ FfiConverterTypeSendResult::write(stream, val);
4428+ return std::move(buf);
4431+SendResult FfiConverterTypeSendResult::read(RustStream &stream) {
4433+ FfiConverterTypeNonEmptyString::read(stream),
4434+ FfiConverterTypeBase64Hash::read(stream),
4435+ FfiConverterTypeBoc::read(stream),
4436+ FfiConverterSendPhase::read(stream)
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);
4447+uint64_t FfiConverterTypeSendResult::allocation_size(const SendResult &val) {
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);
4458+SendSnapshot FfiConverterTypeSendSnapshot::lift(RustBuffer buf) {
4459+ auto stream = RustStream(&buf);
4460+ auto ret = FfiConverterTypeSendSnapshot::read(stream);
4462+ rustbuffer_free(buf);
4464+ return std::move(ret);
4467+RustBuffer FfiConverterTypeSendSnapshot::lower(const SendSnapshot &val) {
4468+ auto buf = rustbuffer_alloc(allocation_size(val));
4469+ auto stream = RustStream(&buf);
4471+ FfiConverterTypeSendSnapshot::write(stream, val);
4473+ return std::move(buf);
4476+SendSnapshot FfiConverterTypeSendSnapshot::read(RustStream &stream) {
4478+ FfiConverterOptionalTypeNonEmptyString::read(stream),
4479+ FfiConverterSendPhase::read(stream),
4480+ FfiConverterOptionalString::read(stream),
4481+ FfiConverterOptionalTypeResolutionInfo::read(stream)
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);
4492+uint64_t FfiConverterTypeSendSnapshot::allocation_size(const SendSnapshot &val) {
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);
4503+SignMessagePreview FfiConverterTypeSignMessagePreview::lift(RustBuffer buf) {
4504+ auto stream = RustStream(&buf);
4505+ auto ret = FfiConverterTypeSignMessagePreview::read(stream);
4507+ rustbuffer_free(buf);
4509+ return std::move(ret);
4512+RustBuffer FfiConverterTypeSignMessagePreview::lower(const SignMessagePreview &val) {
4513+ auto buf = rustbuffer_alloc(allocation_size(val));
4514+ auto stream = RustStream(&buf);
4516+ FfiConverterTypeSignMessagePreview::write(stream, val);
4518+ return std::move(buf);
4521+SignMessagePreview FfiConverterTypeSignMessagePreview::read(RustStream &stream) {
4523+ FfiConverterSequenceTypeSendMessage::read(stream),
4524+ FfiConverterUInt64::read(stream),
4525+ FfiConverterBool::read(stream)
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);
4535+uint64_t FfiConverterTypeSignMessagePreview::allocation_size(const SignMessagePreview &val) {
4538+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages) +
4539+ FfiConverterUInt64::allocation_size(val.valid_until) +
4540+ FfiConverterBool::allocation_size(val.needs_state_init);
4545+SignMessageRequest FfiConverterTypeSignMessageRequest::lift(RustBuffer buf) {
4546+ auto stream = RustStream(&buf);
4547+ auto ret = FfiConverterTypeSignMessageRequest::read(stream);
4549+ rustbuffer_free(buf);
4551+ return std::move(ret);
4554+RustBuffer FfiConverterTypeSignMessageRequest::lower(const SignMessageRequest &val) {
4555+ auto buf = rustbuffer_alloc(allocation_size(val));
4556+ auto stream = RustStream(&buf);
4558+ FfiConverterTypeSignMessageRequest::write(stream, val);
4560+ return std::move(buf);
4563+SignMessageRequest FfiConverterTypeSignMessageRequest::read(RustStream &stream) {
4565+ FfiConverterTypeNonEmptyString::read(stream),
4566+ FfiConverterBool::read(stream),
4567+ FfiConverterTypeSendIntent::read(stream)
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);
4577+uint64_t FfiConverterTypeSignMessageRequest::allocation_size(const SignMessageRequest &val) {
4580+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4581+ FfiConverterBool::allocation_size(val.force) +
4582+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4587+SignMessageResult FfiConverterTypeSignMessageResult::lift(RustBuffer buf) {
4588+ auto stream = RustStream(&buf);
4589+ auto ret = FfiConverterTypeSignMessageResult::read(stream);
4591+ rustbuffer_free(buf);
4593+ return std::move(ret);
4596+RustBuffer FfiConverterTypeSignMessageResult::lower(const SignMessageResult &val) {
4597+ auto buf = rustbuffer_alloc(allocation_size(val));
4598+ auto stream = RustStream(&buf);
4600+ FfiConverterTypeSignMessageResult::write(stream, val);
4602+ return std::move(buf);
4605+SignMessageResult FfiConverterTypeSignMessageResult::read(RustStream &stream) {
4607+ FfiConverterTypeNonEmptyString::read(stream),
4608+ FfiConverterTypeBoc::read(stream),
4609+ FfiConverterUInt64::read(stream),
4610+ FfiConverterSendPhase::read(stream)
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);
4621+uint64_t FfiConverterTypeSignMessageResult::allocation_size(const SignMessageResult &val) {
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);
4632+TonAddressInfo FfiConverterTypeTonAddressInfo::lift(RustBuffer buf) {
4633+ auto stream = RustStream(&buf);
4634+ auto ret = FfiConverterTypeTonAddressInfo::read(stream);
4636+ rustbuffer_free(buf);
4638+ return std::move(ret);
4641+RustBuffer FfiConverterTypeTonAddressInfo::lower(const TonAddressInfo &val) {
4642+ auto buf = rustbuffer_alloc(allocation_size(val));
4643+ auto stream = RustStream(&buf);
4645+ FfiConverterTypeTonAddressInfo::write(stream, val);
4647+ return std::move(buf);
4650+TonAddressInfo FfiConverterTypeTonAddressInfo::read(RustStream &stream) {
4652+ FfiConverterString::read(stream),
4653+ FfiConverterInt32::read(stream),
4654+ FfiConverterTonAddressFormat::read(stream)
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);
4664+uint64_t FfiConverterTypeTonAddressInfo::allocation_size(const TonAddressInfo &val) {
4667+ FfiConverterString::allocation_size(val.raw) +
4668+ FfiConverterInt32::allocation_size(val.workchain) +
4669+ FfiConverterTonAddressFormat::allocation_size(val.format);
4674+TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::lift(RustBuffer buf) {
4675+ auto stream = RustStream(&buf);
4676+ auto ret = FfiConverterTypeTonConnectAccountInfo::read(stream);
4678+ rustbuffer_free(buf);
4680+ return std::move(ret);
4683+RustBuffer FfiConverterTypeTonConnectAccountInfo::lower(const TonConnectAccountInfo &val) {
4684+ auto buf = rustbuffer_alloc(allocation_size(val));
4685+ auto stream = RustStream(&buf);
4687+ FfiConverterTypeTonConnectAccountInfo::write(stream, val);
4689+ return std::move(buf);
4692+TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::read(RustStream &stream) {
4694+ FfiConverterString::read(stream),
4695+ FfiConverterString::read(stream),
4696+ FfiConverterString::read(stream),
4697+ FfiConverterBytes::read(stream)
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);
4708+uint64_t FfiConverterTypeTonConnectAccountInfo::allocation_size(const TonConnectAccountInfo &val) {
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);
4719+TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
4720+ auto stream = RustStream(&buf);
4721+ auto ret = FfiConverterTypeTonConnectConnectPrompt::read(stream);
4723+ rustbuffer_free(buf);
4725+ return std::move(ret);
4728+RustBuffer FfiConverterTypeTonConnectConnectPrompt::lower(const TonConnectConnectPrompt &val) {
4729+ auto buf = rustbuffer_alloc(allocation_size(val));
4730+ auto stream = RustStream(&buf);
4732+ FfiConverterTypeTonConnectConnectPrompt::write(stream, val);
4734+ return std::move(buf);
4737+TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::read(RustStream &stream) {
4739+ FfiConverterString::read(stream),
4740+ FfiConverterOptionalString::read(stream),
4741+ FfiConverterOptionalString::read(stream)
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);
4751+uint64_t FfiConverterTypeTonConnectConnectPrompt::allocation_size(const TonConnectConnectPrompt &val) {
4754+ FfiConverterString::allocation_size(val.manifest_url) +
4755+ FfiConverterOptionalString::allocation_size(val.requested_network) +
4756+ FfiConverterOptionalString::allocation_size(val.proof_payload);
4761+TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::lift(RustBuffer buf) {
4762+ auto stream = RustStream(&buf);
4763+ auto ret = FfiConverterTypeTonConnectDerivedRequest::read(stream);
4765+ rustbuffer_free(buf);
4767+ return std::move(ret);
4770+RustBuffer FfiConverterTypeTonConnectDerivedRequest::lower(const TonConnectDerivedRequest &val) {
4771+ auto buf = rustbuffer_alloc(allocation_size(val));
4772+ auto stream = RustStream(&buf);
4774+ FfiConverterTypeTonConnectDerivedRequest::write(stream, val);
4776+ return std::move(buf);
4779+TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::read(RustStream &stream) {
4781+ FfiConverterTonConnectIncomingRequest::read(stream),
4782+ FfiConverterOptionalInt64::read(stream)
4786+void FfiConverterTypeTonConnectDerivedRequest::write(RustStream &stream, const TonConnectDerivedRequest &val) {
4787+ FfiConverterTonConnectIncomingRequest::write(stream, val.request);
4788+ FfiConverterOptionalInt64::write(stream, val.request_id);
4791+uint64_t FfiConverterTypeTonConnectDerivedRequest::allocation_size(const TonConnectDerivedRequest &val) {
4794+ FfiConverterTonConnectIncomingRequest::allocation_size(val.request) +
4795+ FfiConverterOptionalInt64::allocation_size(val.request_id);
4800+TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::lift(RustBuffer buf) {
4801+ auto stream = RustStream(&buf);
4802+ auto ret = FfiConverterTypeTonConnectDerivedSessionRequest::read(stream);
4804+ rustbuffer_free(buf);
4806+ return std::move(ret);
4809+RustBuffer FfiConverterTypeTonConnectDerivedSessionRequest::lower(const TonConnectDerivedSessionRequest &val) {
4810+ auto buf = rustbuffer_alloc(allocation_size(val));
4811+ auto stream = RustStream(&buf);
4813+ FfiConverterTypeTonConnectDerivedSessionRequest::write(stream, val);
4815+ return std::move(buf);
4818+TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::read(RustStream &stream) {
4820+ FfiConverterTypeWalletDescriptor::read(stream),
4821+ FfiConverterString::read(stream),
4822+ FfiConverterBytes::read(stream)
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);
4832+uint64_t FfiConverterTypeTonConnectDerivedSessionRequest::allocation_size(const TonConnectDerivedSessionRequest &val) {
4835+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
4836+ FfiConverterString::allocation_size(val.dapp_client_id) +
4837+ FfiConverterBytes::allocation_size(val.nonce);
4842+TonConnectDevice FfiConverterTypeTonConnectDevice::lift(RustBuffer buf) {
4843+ auto stream = RustStream(&buf);
4844+ auto ret = FfiConverterTypeTonConnectDevice::read(stream);
4846+ rustbuffer_free(buf);
4848+ return std::move(ret);
4851+RustBuffer FfiConverterTypeTonConnectDevice::lower(const TonConnectDevice &val) {
4852+ auto buf = rustbuffer_alloc(allocation_size(val));
4853+ auto stream = RustStream(&buf);
4855+ FfiConverterTypeTonConnectDevice::write(stream, val);
4857+ return std::move(buf);
4860+TonConnectDevice FfiConverterTypeTonConnectDevice::read(RustStream &stream) {
4862+ FfiConverterTonConnectDevicePlatform::read(stream),
4863+ FfiConverterString::read(stream),
4864+ FfiConverterString::read(stream)
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);
4874+uint64_t FfiConverterTypeTonConnectDevice::allocation_size(const TonConnectDevice &val) {
4877+ FfiConverterTonConnectDevicePlatform::allocation_size(val.platform) +
4878+ FfiConverterString::allocation_size(val.app_name) +
4879+ FfiConverterString::allocation_size(val.app_version);
4884+TonConnectManifest FfiConverterTypeTonConnectManifest::lift(RustBuffer buf) {
4885+ auto stream = RustStream(&buf);
4886+ auto ret = FfiConverterTypeTonConnectManifest::read(stream);
4888+ rustbuffer_free(buf);
4890+ return std::move(ret);
4893+RustBuffer FfiConverterTypeTonConnectManifest::lower(const TonConnectManifest &val) {
4894+ auto buf = rustbuffer_alloc(allocation_size(val));
4895+ auto stream = RustStream(&buf);
4897+ FfiConverterTypeTonConnectManifest::write(stream, val);
4899+ return std::move(buf);
4902+TonConnectManifest FfiConverterTypeTonConnectManifest::read(RustStream &stream) {
4904+ FfiConverterString::read(stream),
4905+ FfiConverterString::read(stream),
4906+ FfiConverterString::read(stream),
4907+ FfiConverterString::read(stream)
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);
4918+uint64_t FfiConverterTypeTonConnectManifest::allocation_size(const TonConnectManifest &val) {
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);
4929+TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::lift(RustBuffer buf) {
4930+ auto stream = RustStream(&buf);
4931+ auto ret = FfiConverterTypeTonConnectPreparedPost::read(stream);
4933+ rustbuffer_free(buf);
4935+ return std::move(ret);
4938+RustBuffer FfiConverterTypeTonConnectPreparedPost::lower(const TonConnectPreparedPost &val) {
4939+ auto buf = rustbuffer_alloc(allocation_size(val));
4940+ auto stream = RustStream(&buf);
4942+ FfiConverterTypeTonConnectPreparedPost::write(stream, val);
4944+ return std::move(buf);
4947+TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::read(RustStream &stream) {
4949+ FfiConverterString::read(stream),
4950+ FfiConverterString::read(stream)
4954+void FfiConverterTypeTonConnectPreparedPost::write(RustStream &stream, const TonConnectPreparedPost &val) {
4955+ FfiConverterString::write(stream, val.url);
4956+ FfiConverterString::write(stream, val.body);
4959+uint64_t FfiConverterTypeTonConnectPreparedPost::allocation_size(const TonConnectPreparedPost &val) {
4962+ FfiConverterString::allocation_size(val.url) +
4963+ FfiConverterString::allocation_size(val.body);
4968+TonConnectProofReply FfiConverterTypeTonConnectProofReply::lift(RustBuffer buf) {
4969+ auto stream = RustStream(&buf);
4970+ auto ret = FfiConverterTypeTonConnectProofReply::read(stream);
4972+ rustbuffer_free(buf);
4974+ return std::move(ret);
4977+RustBuffer FfiConverterTypeTonConnectProofReply::lower(const TonConnectProofReply &val) {
4978+ auto buf = rustbuffer_alloc(allocation_size(val));
4979+ auto stream = RustStream(&buf);
4981+ FfiConverterTypeTonConnectProofReply::write(stream, val);
4983+ return std::move(buf);
4986+TonConnectProofReply FfiConverterTypeTonConnectProofReply::read(RustStream &stream) {
4988+ FfiConverterUInt64::read(stream),
4989+ FfiConverterString::read(stream),
4990+ FfiConverterString::read(stream),
4991+ FfiConverterBytes::read(stream)
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);
5002+uint64_t FfiConverterTypeTonConnectProofReply::allocation_size(const TonConnectProofReply &val) {
5005+ FfiConverterUInt64::allocation_size(val.timestamp) +
5006+ FfiConverterString::allocation_size(val.domain) +
5007+ FfiConverterString::allocation_size(val.payload) +
5008+ FfiConverterBytes::allocation_size(val.signature);
5013+TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::lift(RustBuffer buf) {
5014+ auto stream = RustStream(&buf);
5015+ auto ret = FfiConverterTypeTonConnectProofSignRequest::read(stream);
5017+ rustbuffer_free(buf);
5019+ return std::move(ret);
5022+RustBuffer FfiConverterTypeTonConnectProofSignRequest::lower(const TonConnectProofSignRequest &val) {
5023+ auto buf = rustbuffer_alloc(allocation_size(val));
5024+ auto stream = RustStream(&buf);
5026+ FfiConverterTypeTonConnectProofSignRequest::write(stream, val);
5028+ return std::move(buf);
5031+TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::read(RustStream &stream) {
5033+ FfiConverterTypeWalletDescriptor::read(stream),
5034+ FfiConverterString::read(stream),
5035+ FfiConverterUInt64::read(stream),
5036+ FfiConverterString::read(stream)
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);
5047+uint64_t FfiConverterTypeTonConnectProofSignRequest::allocation_size(const TonConnectProofSignRequest &val) {
5050+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
5051+ FfiConverterString::allocation_size(val.domain) +
5052+ FfiConverterUInt64::allocation_size(val.timestamp) +
5053+ FfiConverterString::allocation_size(val.payload);
5058+TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::lift(RustBuffer buf) {
5059+ auto stream = RustStream(&buf);
5060+ auto ret = FfiConverterTypeTonConnectProofSignature::read(stream);
5062+ rustbuffer_free(buf);
5064+ return std::move(ret);
5067+RustBuffer FfiConverterTypeTonConnectProofSignature::lower(const TonConnectProofSignature &val) {
5068+ auto buf = rustbuffer_alloc(allocation_size(val));
5069+ auto stream = RustStream(&buf);
5071+ FfiConverterTypeTonConnectProofSignature::write(stream, val);
5073+ return std::move(buf);
5076+TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::read(RustStream &stream) {
5078+ FfiConverterBytes::read(stream),
5079+ FfiConverterBytes::read(stream)
5083+void FfiConverterTypeTonConnectProofSignature::write(RustStream &stream, const TonConnectProofSignature &val) {
5084+ FfiConverterBytes::write(stream, val.signature);
5085+ FfiConverterBytes::write(stream, val.public_key);
5088+uint64_t FfiConverterTypeTonConnectProofSignature::allocation_size(const TonConnectProofSignature &val) {
5091+ FfiConverterBytes::allocation_size(val.signature) +
5092+ FfiConverterBytes::allocation_size(val.public_key);
5097+TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::lift(RustBuffer buf) {
5098+ auto stream = RustStream(&buf);
5099+ auto ret = FfiConverterTypeTonConnectSessionConfig::read(stream);
5101+ rustbuffer_free(buf);
5103+ return std::move(ret);
5106+RustBuffer FfiConverterTypeTonConnectSessionConfig::lower(const TonConnectSessionConfig &val) {
5107+ auto buf = rustbuffer_alloc(allocation_size(val));
5108+ auto stream = RustStream(&buf);
5110+ FfiConverterTypeTonConnectSessionConfig::write(stream, val);
5112+ return std::move(buf);
5115+TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::read(RustStream &stream) {
5117+ FfiConverterString::read(stream),
5118+ FfiConverterUInt64::read(stream),
5119+ FfiConverterUInt32::read(stream)
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);
5129+uint64_t FfiConverterTypeTonConnectSessionConfig::allocation_size(const TonConnectSessionConfig &val) {
5132+ FfiConverterString::allocation_size(val.bridge_url) +
5133+ FfiConverterUInt64::allocation_size(val.max_event_bytes) +
5134+ FfiConverterUInt32::allocation_size(val.message_ttl_seconds);
5139+TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::lift(RustBuffer buf) {
5140+ auto stream = RustStream(&buf);
5141+ auto ret = FfiConverterTypeTonConnectSignDataRequest::read(stream);
5143+ rustbuffer_free(buf);
5145+ return std::move(ret);
5148+RustBuffer FfiConverterTypeTonConnectSignDataRequest::lower(const TonConnectSignDataRequest &val) {
5149+ auto buf = rustbuffer_alloc(allocation_size(val));
5150+ auto stream = RustStream(&buf);
5152+ FfiConverterTypeTonConnectSignDataRequest::write(stream, val);
5154+ return std::move(buf);
5157+TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::read(RustStream &stream) {
5159+ FfiConverterTonConnectSignDataPayload::read(stream),
5160+ FfiConverterOptionalString::read(stream),
5161+ FfiConverterOptionalString::read(stream)
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);
5171+uint64_t FfiConverterTypeTonConnectSignDataRequest::allocation_size(const TonConnectSignDataRequest &val) {
5174+ FfiConverterTonConnectSignDataPayload::allocation_size(val.payload) +
5175+ FfiConverterOptionalString::allocation_size(val.network) +
5176+ FfiConverterOptionalString::allocation_size(val.from);
5181+TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::lift(RustBuffer buf) {
5182+ auto stream = RustStream(&buf);
5183+ auto ret = FfiConverterTypeTonConnectSignDataSignRequest::read(stream);
5185+ rustbuffer_free(buf);
5187+ return std::move(ret);
5190+RustBuffer FfiConverterTypeTonConnectSignDataSignRequest::lower(const TonConnectSignDataSignRequest &val) {
5191+ auto buf = rustbuffer_alloc(allocation_size(val));
5192+ auto stream = RustStream(&buf);
5194+ FfiConverterTypeTonConnectSignDataSignRequest::write(stream, val);
5196+ return std::move(buf);
5199+TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::read(RustStream &stream) {
5201+ FfiConverterTypeWalletDescriptor::read(stream),
5202+ FfiConverterTypeTonConnectSignDataRequest::read(stream),
5203+ FfiConverterString::read(stream),
5204+ FfiConverterUInt64::read(stream)
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);
5215+uint64_t FfiConverterTypeTonConnectSignDataSignRequest::allocation_size(const TonConnectSignDataSignRequest &val) {
5218+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
5219+ FfiConverterTypeTonConnectSignDataRequest::allocation_size(val.request) +
5220+ FfiConverterString::allocation_size(val.domain) +
5221+ FfiConverterUInt64::allocation_size(val.timestamp);
5226+TonConnectSignedData FfiConverterTypeTonConnectSignedData::lift(RustBuffer buf) {
5227+ auto stream = RustStream(&buf);
5228+ auto ret = FfiConverterTypeTonConnectSignedData::read(stream);
5230+ rustbuffer_free(buf);
5232+ return std::move(ret);
5235+RustBuffer FfiConverterTypeTonConnectSignedData::lower(const TonConnectSignedData &val) {
5236+ auto buf = rustbuffer_alloc(allocation_size(val));
5237+ auto stream = RustStream(&buf);
5239+ FfiConverterTypeTonConnectSignedData::write(stream, val);
5241+ return std::move(buf);
5244+TonConnectSignedData FfiConverterTypeTonConnectSignedData::read(RustStream &stream) {
5246+ FfiConverterTypeTonConnectSignDataRequest::read(stream),
5247+ FfiConverterString::read(stream),
5248+ FfiConverterUInt64::read(stream),
5249+ FfiConverterBytes::read(stream),
5250+ FfiConverterBytes::read(stream)
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);
5262+uint64_t FfiConverterTypeTonConnectSignedData::allocation_size(const TonConnectSignedData &val) {
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);
5274+WalletClientConfig FfiConverterTypeWalletClientConfig::lift(RustBuffer buf) {
5275+ auto stream = RustStream(&buf);
5276+ auto ret = FfiConverterTypeWalletClientConfig::read(stream);
5278+ rustbuffer_free(buf);
5280+ return std::move(ret);
5283+RustBuffer FfiConverterTypeWalletClientConfig::lower(const WalletClientConfig &val) {
5284+ auto buf = rustbuffer_alloc(allocation_size(val));
5285+ auto stream = RustStream(&buf);
5287+ FfiConverterTypeWalletClientConfig::write(stream, val);
5289+ return std::move(buf);
5292+WalletClientConfig FfiConverterTypeWalletClientConfig::read(RustStream &stream) {
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)
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);
5316+uint64_t FfiConverterTypeWalletClientConfig::allocation_size(const WalletClientConfig &val) {
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);
5331+WalletDescriptor FfiConverterTypeWalletDescriptor::lift(RustBuffer buf) {
5332+ auto stream = RustStream(&buf);
5333+ auto ret = FfiConverterTypeWalletDescriptor::read(stream);
5335+ rustbuffer_free(buf);
5337+ return std::move(ret);
5340+RustBuffer FfiConverterTypeWalletDescriptor::lower(const WalletDescriptor &val) {
5341+ auto buf = rustbuffer_alloc(allocation_size(val));
5342+ auto stream = RustStream(&buf);
5344+ FfiConverterTypeWalletDescriptor::write(stream, val);
5346+ return std::move(buf);
5349+WalletDescriptor FfiConverterTypeWalletDescriptor::read(RustStream &stream) {
5351+ FfiConverterString::read(stream),
5352+ FfiConverterTypeTonAddressString::read(stream),
5353+ FfiConverterBytes::read(stream),
5354+ FfiConverterNetwork::read(stream),
5355+ FfiConverterTypeProtectedSecretRef::read(stream)
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);
5367+uint64_t FfiConverterTypeWalletDescriptor::allocation_size(const WalletDescriptor &val) {
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);
5379+WalletSnapshot FfiConverterTypeWalletSnapshot::lift(RustBuffer buf) {
5380+ auto stream = RustStream(&buf);
5381+ auto ret = FfiConverterTypeWalletSnapshot::read(stream);
5383+ rustbuffer_free(buf);
5385+ return std::move(ret);
5388+RustBuffer FfiConverterTypeWalletSnapshot::lower(const WalletSnapshot &val) {
5389+ auto buf = rustbuffer_alloc(allocation_size(val));
5390+ auto stream = RustStream(&buf);
5392+ FfiConverterTypeWalletSnapshot::write(stream, val);
5394+ return std::move(buf);
5397+WalletSnapshot FfiConverterTypeWalletSnapshot::read(RustStream &stream) {
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)
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);
5425+uint64_t FfiConverterTypeWalletSnapshot::allocation_size(const WalletSnapshot &val) {
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);
5442+WalletUpdate FfiConverterTypeWalletUpdate::lift(RustBuffer buf) {
5443+ auto stream = RustStream(&buf);
5444+ auto ret = FfiConverterTypeWalletUpdate::read(stream);
5446+ rustbuffer_free(buf);
5448+ return std::move(ret);
5451+RustBuffer FfiConverterTypeWalletUpdate::lower(const WalletUpdate &val) {
5452+ auto buf = rustbuffer_alloc(allocation_size(val));
5453+ auto stream = RustStream(&buf);
5455+ FfiConverterTypeWalletUpdate::write(stream, val);
5457+ return std::move(buf);
5460+WalletUpdate FfiConverterTypeWalletUpdate::read(RustStream &stream) {
5462+ FfiConverterWalletOperationOutcome::read(stream),
5463+ FfiConverterUInt64::read(stream),
5464+ FfiConverterUInt64::read(stream),
5465+ FfiConverterTypeWalletSnapshot::read(stream)
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);
5476+uint64_t FfiConverterTypeWalletUpdate::allocation_size(const WalletUpdate &val) {
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);
5487+AccountStatus FfiConverterAccountStatus::lift(RustBuffer buf) {
5488+ auto stream = RustStream(&buf);
5489+ auto ret = FfiConverterAccountStatus::read(stream);
5491+ rustbuffer_free(buf);
5493+ return std::move(ret);
5496+RustBuffer FfiConverterAccountStatus::lower(const AccountStatus &val) {
5497+ auto buf = rustbuffer_alloc(FfiConverterAccountStatus::allocation_size(val));
5498+ auto stream = RustStream(&buf);
5500+ FfiConverterAccountStatus::write(stream, val);
5502+ return std::move(buf);
5505+AccountStatus FfiConverterAccountStatus::read(RustStream &stream) {
5512+ return AccountStatus::kNonexistent;
5515+ return AccountStatus::kUninitialized;
5518+ return AccountStatus::kActive;
5521+ return AccountStatus::kFrozen;
5524+ return AccountStatus::kUnknown;
5527+ throw std::runtime_error("No matching AccountStatus variant");
5531+void FfiConverterAccountStatus::write(RustStream &stream, const AccountStatus &val) {
5534+ case AccountStatus::kNonexistent:
5535+ stream << static_cast<int32_t>(1);
5538+ case AccountStatus::kUninitialized:
5539+ stream << static_cast<int32_t>(2);
5542+ case AccountStatus::kActive:
5543+ stream << static_cast<int32_t>(3);
5546+ case AccountStatus::kFrozen:
5547+ stream << static_cast<int32_t>(4);
5550+ case AccountStatus::kUnknown:
5551+ stream << static_cast<int32_t>(5);
5555+ throw std::runtime_error("No matching AccountStatus variant");
5559+uint64_t FfiConverterAccountStatus::allocation_size(const AccountStatus &) {
5560+ return static_cast<uint64_t>(sizeof(int32_t));
5564+ActivityDirection FfiConverterActivityDirection::lift(RustBuffer buf) {
5565+ auto stream = RustStream(&buf);
5566+ auto ret = FfiConverterActivityDirection::read(stream);
5568+ rustbuffer_free(buf);
5570+ return std::move(ret);
5573+RustBuffer FfiConverterActivityDirection::lower(const ActivityDirection &val) {
5574+ auto buf = rustbuffer_alloc(FfiConverterActivityDirection::allocation_size(val));
5575+ auto stream = RustStream(&buf);
5577+ FfiConverterActivityDirection::write(stream, val);
5579+ return std::move(buf);
5582+ActivityDirection FfiConverterActivityDirection::read(RustStream &stream) {
5589+ return ActivityDirection::kSent;
5592+ return ActivityDirection::kReceived;
5595+ throw std::runtime_error("No matching ActivityDirection variant");
5599+void FfiConverterActivityDirection::write(RustStream &stream, const ActivityDirection &val) {
5602+ case ActivityDirection::kSent:
5603+ stream << static_cast<int32_t>(1);
5606+ case ActivityDirection::kReceived:
5607+ stream << static_cast<int32_t>(2);
5611+ throw std::runtime_error("No matching ActivityDirection variant");
5615+uint64_t FfiConverterActivityDirection::allocation_size(const ActivityDirection &) {
5616+ return static_cast<uint64_t>(sizeof(int32_t));
5620+ActivityStatus FfiConverterActivityStatus::lift(RustBuffer buf) {
5621+ auto stream = RustStream(&buf);
5622+ auto ret = FfiConverterActivityStatus::read(stream);
5624+ rustbuffer_free(buf);
5626+ return std::move(ret);
5629+RustBuffer FfiConverterActivityStatus::lower(const ActivityStatus &val) {
5630+ auto buf = rustbuffer_alloc(FfiConverterActivityStatus::allocation_size(val));
5631+ auto stream = RustStream(&buf);
5633+ FfiConverterActivityStatus::write(stream, val);
5635+ return std::move(buf);
5638+ActivityStatus FfiConverterActivityStatus::read(RustStream &stream) {
5645+ return ActivityStatus::kSuccess;
5648+ return ActivityStatus::kFailed;
5651+ return ActivityStatus::kBounced;
5654+ throw std::runtime_error("No matching ActivityStatus variant");
5658+void FfiConverterActivityStatus::write(RustStream &stream, const ActivityStatus &val) {
5661+ case ActivityStatus::kSuccess:
5662+ stream << static_cast<int32_t>(1);
5665+ case ActivityStatus::kFailed:
5666+ stream << static_cast<int32_t>(2);
5669+ case ActivityStatus::kBounced:
5670+ stream << static_cast<int32_t>(3);
5674+ throw std::runtime_error("No matching ActivityStatus variant");
5678+uint64_t FfiConverterActivityStatus::allocation_size(const ActivityStatus &) {
5679+ return static_cast<uint64_t>(sizeof(int32_t));
5683+ErrorCategory FfiConverterErrorCategory::lift(RustBuffer buf) {
5684+ auto stream = RustStream(&buf);
5685+ auto ret = FfiConverterErrorCategory::read(stream);
5687+ rustbuffer_free(buf);
5689+ return std::move(ret);
5692+RustBuffer FfiConverterErrorCategory::lower(const ErrorCategory &val) {
5693+ auto buf = rustbuffer_alloc(FfiConverterErrorCategory::allocation_size(val));
5694+ auto stream = RustStream(&buf);
5696+ FfiConverterErrorCategory::write(stream, val);
5698+ return std::move(buf);
5701+ErrorCategory FfiConverterErrorCategory::read(RustStream &stream) {
5708+ return ErrorCategory::kTransport;
5711+ return ErrorCategory::kProviderProtocol;
5714+ return ErrorCategory::kRateLimit;
5717+ return ErrorCategory::kCancellation;
5720+ return ErrorCategory::kHostPolicy;
5723+ throw std::runtime_error("No matching ErrorCategory variant");
5727+void FfiConverterErrorCategory::write(RustStream &stream, const ErrorCategory &val) {
5730+ case ErrorCategory::kTransport:
5731+ stream << static_cast<int32_t>(1);
5734+ case ErrorCategory::kProviderProtocol:
5735+ stream << static_cast<int32_t>(2);
5738+ case ErrorCategory::kRateLimit:
5739+ stream << static_cast<int32_t>(3);
5742+ case ErrorCategory::kCancellation:
5743+ stream << static_cast<int32_t>(4);
5746+ case ErrorCategory::kHostPolicy:
5747+ stream << static_cast<int32_t>(5);
5751+ throw std::runtime_error("No matching ErrorCategory variant");
5755+uint64_t FfiConverterErrorCategory::allocation_size(const ErrorCategory &) {
5756+ return static_cast<uint64_t>(sizeof(int32_t));
5760+ErrorCode FfiConverterErrorCode::lift(RustBuffer buf) {
5761+ auto stream = RustStream(&buf);
5762+ auto ret = FfiConverterErrorCode::read(stream);
5764+ rustbuffer_free(buf);
5766+ return std::move(ret);
5769+RustBuffer FfiConverterErrorCode::lower(const ErrorCode &val) {
5770+ auto buf = rustbuffer_alloc(FfiConverterErrorCode::allocation_size(val));
5771+ auto stream = RustStream(&buf);
5773+ FfiConverterErrorCode::write(stream, val);
5775+ return std::move(buf);
5778+ErrorCode FfiConverterErrorCode::read(RustStream &stream) {
5785+ return ErrorCode::kInvalidProviderResponse;
5788+ return ErrorCode::kHttpRejected;
5791+ return ErrorCode::kRateLimited;
5794+ return ErrorCode::kTransportFailed;
5797+ return ErrorCode::kHostCancelled;
5800+ return ErrorCode::kResponseTooLarge;
5803+ return ErrorCode::kHostPolicyViolation;
5806+ throw std::runtime_error("No matching ErrorCode variant");
5810+void FfiConverterErrorCode::write(RustStream &stream, const ErrorCode &val) {
5813+ case ErrorCode::kInvalidProviderResponse:
5814+ stream << static_cast<int32_t>(1);
5817+ case ErrorCode::kHttpRejected:
5818+ stream << static_cast<int32_t>(2);
5821+ case ErrorCode::kRateLimited:
5822+ stream << static_cast<int32_t>(3);
5825+ case ErrorCode::kTransportFailed:
5826+ stream << static_cast<int32_t>(4);
5829+ case ErrorCode::kHostCancelled:
5830+ stream << static_cast<int32_t>(5);
5833+ case ErrorCode::kResponseTooLarge:
5834+ stream << static_cast<int32_t>(6);
5837+ case ErrorCode::kHostPolicyViolation:
5838+ stream << static_cast<int32_t>(7);
5842+ throw std::runtime_error("No matching ErrorCode variant");
5846+uint64_t FfiConverterErrorCode::allocation_size(const ErrorCode &) {
5847+ return static_cast<uint64_t>(sizeof(int32_t));
5851+std::shared_ptr<HttpHostError> FfiConverterHttpHostError::lift(RustBuffer buf) {
5852+ auto stream = RustStream(&buf);
5853+ auto ret = FfiConverterHttpHostError::read(stream);
5855+ rustbuffer_free(buf);
5860+RustBuffer FfiConverterHttpHostError::lower(const HttpHostError &val) {
5861+ auto buf = rustbuffer_alloc(allocation_size(val));
5862+ auto stream = RustStream(&buf);
5864+ FfiConverterHttpHostError::write(stream, val);
5866+ return std::move(buf);
5869+std::shared_ptr<HttpHostError> FfiConverterHttpHostError::read(RustStream &stream) {
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(
5881+ uniffi_wallet_engine_fn_method_httphosterror_uniffi_trait_display,
5883+ FfiConverterHttpHostError::lower(var)
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);
5892+ throw std::runtime_error("Unexpected error variant");
5896+void FfiConverterHttpHostError::write(RustStream &stream, const HttpHostError &val) {
5897+ stream << val.get_variant_idx();
5898+ switch (val.get_variant_idx()) {
5901+ auto var = static_cast<const http_host_error::Failed&>(val);
5902+ FfiConverterHttpHostErrorKind::write(stream, var.kind);
5903+ FfiConverterString::write(stream, var.diagnostic);
5909+uint64_t FfiConverterHttpHostError::allocation_size(const HttpHostError &val) {
5910+ switch (val.get_variant_idx()) {
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));
5919+ throw std::runtime_error("Unexpected error variant");
5924+HttpHostErrorKind FfiConverterHttpHostErrorKind::lift(RustBuffer buf) {
5925+ auto stream = RustStream(&buf);
5926+ auto ret = FfiConverterHttpHostErrorKind::read(stream);
5928+ rustbuffer_free(buf);
5930+ return std::move(ret);
5933+RustBuffer FfiConverterHttpHostErrorKind::lower(const HttpHostErrorKind &val) {
5934+ auto buf = rustbuffer_alloc(FfiConverterHttpHostErrorKind::allocation_size(val));
5935+ auto stream = RustStream(&buf);
5937+ FfiConverterHttpHostErrorKind::write(stream, val);
5939+ return std::move(buf);
5942+HttpHostErrorKind FfiConverterHttpHostErrorKind::read(RustStream &stream) {
5949+ return HttpHostErrorKind::kOffline;
5952+ return HttpHostErrorKind::kTimeout;
5955+ return HttpHostErrorKind::kConnectionLost;
5958+ return HttpHostErrorKind::kDns;
5961+ return HttpHostErrorKind::kTls;
5964+ return HttpHostErrorKind::kPolicyViolation;
5967+ return HttpHostErrorKind::kResponseTooLarge;
5970+ return HttpHostErrorKind::kCancelled;
5973+ return HttpHostErrorKind::kOther;
5976+ throw std::runtime_error("No matching HttpHostErrorKind variant");
5980+void FfiConverterHttpHostErrorKind::write(RustStream &stream, const HttpHostErrorKind &val) {
5983+ case HttpHostErrorKind::kOffline:
5984+ stream << static_cast<int32_t>(1);
5987+ case HttpHostErrorKind::kTimeout:
5988+ stream << static_cast<int32_t>(2);
5991+ case HttpHostErrorKind::kConnectionLost:
5992+ stream << static_cast<int32_t>(3);
5995+ case HttpHostErrorKind::kDns:
5996+ stream << static_cast<int32_t>(4);
5999+ case HttpHostErrorKind::kTls:
6000+ stream << static_cast<int32_t>(5);
6003+ case HttpHostErrorKind::kPolicyViolation:
6004+ stream << static_cast<int32_t>(6);
6007+ case HttpHostErrorKind::kResponseTooLarge:
6008+ stream << static_cast<int32_t>(7);
6011+ case HttpHostErrorKind::kCancelled:
6012+ stream << static_cast<int32_t>(8);
6015+ case HttpHostErrorKind::kOther:
6016+ stream << static_cast<int32_t>(9);
6020+ throw std::runtime_error("No matching HttpHostErrorKind variant");
6024+uint64_t FfiConverterHttpHostErrorKind::allocation_size(const HttpHostErrorKind &) {
6025+ return static_cast<uint64_t>(sizeof(int32_t));
6029+HttpMethod FfiConverterHttpMethod::lift(RustBuffer buf) {
6030+ auto stream = RustStream(&buf);
6031+ auto ret = FfiConverterHttpMethod::read(stream);
6033+ rustbuffer_free(buf);
6035+ return std::move(ret);
6038+RustBuffer FfiConverterHttpMethod::lower(const HttpMethod &val) {
6039+ auto buf = rustbuffer_alloc(FfiConverterHttpMethod::allocation_size(val));
6040+ auto stream = RustStream(&buf);
6042+ FfiConverterHttpMethod::write(stream, val);
6044+ return std::move(buf);
6047+HttpMethod FfiConverterHttpMethod::read(RustStream &stream) {
6054+ return HttpMethod::kGet;
6057+ return HttpMethod::kPost;
6060+ throw std::runtime_error("No matching HttpMethod variant");
6064+void FfiConverterHttpMethod::write(RustStream &stream, const HttpMethod &val) {
6067+ case HttpMethod::kGet:
6068+ stream << static_cast<int32_t>(1);
6071+ case HttpMethod::kPost:
6072+ stream << static_cast<int32_t>(2);
6076+ throw std::runtime_error("No matching HttpMethod variant");
6080+uint64_t FfiConverterHttpMethod::allocation_size(const HttpMethod &) {
6081+ return static_cast<uint64_t>(sizeof(int32_t));
6085+std::shared_ptr<JournalHostError> FfiConverterJournalHostError::lift(RustBuffer buf) {
6086+ auto stream = RustStream(&buf);
6087+ auto ret = FfiConverterJournalHostError::read(stream);
6089+ rustbuffer_free(buf);
6094+RustBuffer FfiConverterJournalHostError::lower(const JournalHostError &val) {
6095+ auto buf = rustbuffer_alloc(allocation_size(val));
6096+ auto stream = RustStream(&buf);
6098+ FfiConverterJournalHostError::write(stream, val);
6100+ return std::move(buf);
6103+std::shared_ptr<JournalHostError> FfiConverterJournalHostError::read(RustStream &stream) {
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(
6115+ uniffi_wallet_engine_fn_method_journalhosterror_uniffi_trait_display,
6117+ FfiConverterJournalHostError::lower(var)
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);
6126+ throw std::runtime_error("Unexpected error variant");
6130+void FfiConverterJournalHostError::write(RustStream &stream, const JournalHostError &val) {
6131+ stream << val.get_variant_idx();
6132+ switch (val.get_variant_idx()) {
6135+ auto var = static_cast<const journal_host_error::Failed&>(val);
6136+ FfiConverterJournalHostErrorKind::write(stream, var.kind);
6137+ FfiConverterString::write(stream, var.diagnostic);
6143+uint64_t FfiConverterJournalHostError::allocation_size(const JournalHostError &val) {
6144+ switch (val.get_variant_idx()) {
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));
6153+ throw std::runtime_error("Unexpected error variant");
6158+JournalHostErrorKind FfiConverterJournalHostErrorKind::lift(RustBuffer buf) {
6159+ auto stream = RustStream(&buf);
6160+ auto ret = FfiConverterJournalHostErrorKind::read(stream);
6162+ rustbuffer_free(buf);
6164+ return std::move(ret);
6167+RustBuffer FfiConverterJournalHostErrorKind::lower(const JournalHostErrorKind &val) {
6168+ auto buf = rustbuffer_alloc(FfiConverterJournalHostErrorKind::allocation_size(val));
6169+ auto stream = RustStream(&buf);
6171+ FfiConverterJournalHostErrorKind::write(stream, val);
6173+ return std::move(buf);
6176+JournalHostErrorKind FfiConverterJournalHostErrorKind::read(RustStream &stream) {
6183+ return JournalHostErrorKind::kUnavailable;
6186+ return JournalHostErrorKind::kCorruptData;
6189+ return JournalHostErrorKind::kCancelled;
6192+ return JournalHostErrorKind::kOther;
6195+ throw std::runtime_error("No matching JournalHostErrorKind variant");
6199+void FfiConverterJournalHostErrorKind::write(RustStream &stream, const JournalHostErrorKind &val) {
6202+ case JournalHostErrorKind::kUnavailable:
6203+ stream << static_cast<int32_t>(1);
6206+ case JournalHostErrorKind::kCorruptData:
6207+ stream << static_cast<int32_t>(2);
6210+ case JournalHostErrorKind::kCancelled:
6211+ stream << static_cast<int32_t>(3);
6214+ case JournalHostErrorKind::kOther:
6215+ stream << static_cast<int32_t>(4);
6219+ throw std::runtime_error("No matching JournalHostErrorKind variant");
6223+uint64_t FfiConverterJournalHostErrorKind::allocation_size(const JournalHostErrorKind &) {
6224+ return static_cast<uint64_t>(sizeof(int32_t));
6228+KeyRotationMessageKind FfiConverterKeyRotationMessageKind::lift(RustBuffer buf) {
6229+ auto stream = RustStream(&buf);
6230+ auto ret = FfiConverterKeyRotationMessageKind::read(stream);
6232+ rustbuffer_free(buf);
6234+ return std::move(ret);
6237+RustBuffer FfiConverterKeyRotationMessageKind::lower(const KeyRotationMessageKind &val) {
6238+ auto buf = rustbuffer_alloc(FfiConverterKeyRotationMessageKind::allocation_size(val));
6239+ auto stream = RustStream(&buf);
6241+ FfiConverterKeyRotationMessageKind::write(stream, val);
6243+ return std::move(buf);
6246+KeyRotationMessageKind FfiConverterKeyRotationMessageKind::read(RustStream &stream) {
6253+ return KeyRotationMessageKind::kExternal;
6256+ return KeyRotationMessageKind::kInternal;
6259+ throw std::runtime_error("No matching KeyRotationMessageKind variant");
6263+void FfiConverterKeyRotationMessageKind::write(RustStream &stream, const KeyRotationMessageKind &val) {
6266+ case KeyRotationMessageKind::kExternal:
6267+ stream << static_cast<int32_t>(1);
6270+ case KeyRotationMessageKind::kInternal:
6271+ stream << static_cast<int32_t>(2);
6275+ throw std::runtime_error("No matching KeyRotationMessageKind variant");
6279+uint64_t FfiConverterKeyRotationMessageKind::allocation_size(const KeyRotationMessageKind &) {
6280+ return static_cast<uint64_t>(sizeof(int32_t));
6284+MnemonicScheme FfiConverterMnemonicScheme::lift(RustBuffer buf) {
6285+ auto stream = RustStream(&buf);
6286+ auto ret = FfiConverterMnemonicScheme::read(stream);
6288+ rustbuffer_free(buf);
6290+ return std::move(ret);
6293+RustBuffer FfiConverterMnemonicScheme::lower(const MnemonicScheme &val) {
6294+ auto buf = rustbuffer_alloc(FfiConverterMnemonicScheme::allocation_size(val));
6295+ auto stream = RustStream(&buf);
6297+ FfiConverterMnemonicScheme::write(stream, val);
6299+ return std::move(buf);
6302+MnemonicScheme FfiConverterMnemonicScheme::read(RustStream &stream) {
6309+ return MnemonicScheme::kRotation;
6312+ return MnemonicScheme::kTon;
6315+ return MnemonicScheme::kBip39;
6318+ throw std::runtime_error("No matching MnemonicScheme variant");
6322+void FfiConverterMnemonicScheme::write(RustStream &stream, const MnemonicScheme &val) {
6325+ case MnemonicScheme::kRotation:
6326+ stream << static_cast<int32_t>(1);
6329+ case MnemonicScheme::kTon:
6330+ stream << static_cast<int32_t>(2);
6333+ case MnemonicScheme::kBip39:
6334+ stream << static_cast<int32_t>(3);
6338+ throw std::runtime_error("No matching MnemonicScheme variant");
6342+uint64_t FfiConverterMnemonicScheme::allocation_size(const MnemonicScheme &) {
6343+ return static_cast<uint64_t>(sizeof(int32_t));
6347+Network FfiConverterNetwork::lift(RustBuffer buf) {
6348+ auto stream = RustStream(&buf);
6349+ auto ret = FfiConverterNetwork::read(stream);
6351+ rustbuffer_free(buf);
6353+ return std::move(ret);
6356+RustBuffer FfiConverterNetwork::lower(const Network &val) {
6357+ auto buf = rustbuffer_alloc(FfiConverterNetwork::allocation_size(val));
6358+ auto stream = RustStream(&buf);
6360+ FfiConverterNetwork::write(stream, val);
6362+ return std::move(buf);
6365+Network FfiConverterNetwork::read(RustStream &stream) {
6372+ return Network::kMainnet;
6375+ return Network::kTestnet;
6378+ throw std::runtime_error("No matching Network variant");
6382+void FfiConverterNetwork::write(RustStream &stream, const Network &val) {
6385+ case Network::kMainnet:
6386+ stream << static_cast<int32_t>(1);
6389+ case Network::kTestnet:
6390+ stream << static_cast<int32_t>(2);
6394+ throw std::runtime_error("No matching Network variant");
6398+uint64_t FfiConverterNetwork::allocation_size(const Network &) {
6399+ return static_cast<uint64_t>(sizeof(int32_t));
6403+NftTransferFunding FfiConverterNftTransferFunding::lift(RustBuffer buf) {
6404+ auto stream = RustStream(&buf);
6405+ auto ret = FfiConverterNftTransferFunding::read(stream);
6407+ rustbuffer_free(buf);
6409+ return std::move(ret);
6412+RustBuffer FfiConverterNftTransferFunding::lower(const NftTransferFunding &val) {
6413+ auto buf = rustbuffer_alloc(FfiConverterNftTransferFunding::allocation_size(val));
6414+ auto stream = RustStream(&buf);
6416+ FfiConverterNftTransferFunding::write(stream, val);
6418+ return std::move(buf);
6421+NftTransferFunding FfiConverterNftTransferFunding::read(RustStream &stream) {
6422+ int32_t variant_id;
6423+ stream >> variant_id;
6425+ switch (variant_id) {
6428+ return NftTransferFunding::kExact {
6429+ .attached_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
6430+ .forward_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
6434+ throw std::runtime_error("No matching NftTransferFunding variant");
6438+void FfiConverterNftTransferFunding::write(RustStream &stream, const NftTransferFunding &val) {
6439+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
6441+ stream << variant_id;
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);
6450+ static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
6455+uint64_t FfiConverterNftTransferFunding::allocation_size(const NftTransferFunding &val) {
6456+ uint64_t size = sizeof(int32_t);
6458+ size += std::visit([&](auto &&arg) {
6459+ using T = std::decay_t<decltype(arg)>;
6460+ if constexpr (std::is_same_v<T, NftTransferFunding::kExact>) {
6462+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.attached_nanograms);
6463+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.forward_nanograms);
6467+ static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
6475+NftTransferPayload FfiConverterNftTransferPayload::lift(RustBuffer buf) {
6476+ auto stream = RustStream(&buf);
6477+ auto ret = FfiConverterNftTransferPayload::read(stream);
6479+ rustbuffer_free(buf);
6481+ return std::move(ret);
6484+RustBuffer FfiConverterNftTransferPayload::lower(const NftTransferPayload &val) {
6485+ auto buf = rustbuffer_alloc(FfiConverterNftTransferPayload::allocation_size(val));
6486+ auto stream = RustStream(&buf);
6488+ FfiConverterNftTransferPayload::write(stream, val);
6490+ return std::move(buf);
6493+NftTransferPayload FfiConverterNftTransferPayload::read(RustStream &stream) {
6494+ int32_t variant_id;
6495+ stream >> variant_id;
6497+ switch (variant_id) {
6500+ return NftTransferPayload::kEmpty {
6504+ return NftTransferPayload::kComment {
6505+ .text = FfiConverterString::read(stream),
6509+ return NftTransferPayload::kRawPayload {
6510+ .boc = FfiConverterTypeBoc::read(stream),
6514+ throw std::runtime_error("No matching NftTransferPayload variant");
6518+void FfiConverterNftTransferPayload::write(RustStream &stream, const NftTransferPayload &val) {
6519+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
6521+ stream << variant_id;
6523+ std::visit([&](auto &&arg) {
6524+ using T = std::decay_t<decltype(arg)>;
6525+ if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
6527+ else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
6528+ FfiConverterString::write(stream, arg.text);
6530+ else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
6531+ FfiConverterTypeBoc::write(stream, arg.boc);
6534+ static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
6539+uint64_t FfiConverterNftTransferPayload::allocation_size(const NftTransferPayload &val) {
6540+ uint64_t size = sizeof(int32_t);
6542+ size += std::visit([&](auto &&arg) {
6543+ using T = std::decay_t<decltype(arg)>;
6544+ if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
6548+ else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
6550+ size += FfiConverterString::allocation_size(arg.text);
6553+ else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
6555+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
6559+ static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
6567+PendingReason FfiConverterPendingReason::lift(RustBuffer buf) {
6568+ auto stream = RustStream(&buf);
6569+ auto ret = FfiConverterPendingReason::read(stream);
6571+ rustbuffer_free(buf);
6573+ return std::move(ret);
6576+RustBuffer FfiConverterPendingReason::lower(const PendingReason &val) {
6577+ auto buf = rustbuffer_alloc(FfiConverterPendingReason::allocation_size(val));
6578+ auto stream = RustStream(&buf);
6580+ FfiConverterPendingReason::write(stream, val);
6582+ return std::move(buf);
6585+PendingReason FfiConverterPendingReason::read(RustStream &stream) {
6592+ return PendingReason::kInMempool;
6595+ return PendingReason::kAwaitingWindow;
6598+ throw std::runtime_error("No matching PendingReason variant");
6602+void FfiConverterPendingReason::write(RustStream &stream, const PendingReason &val) {
6605+ case PendingReason::kInMempool:
6606+ stream << static_cast<int32_t>(1);
6609+ case PendingReason::kAwaitingWindow:
6610+ stream << static_cast<int32_t>(2);
6614+ throw std::runtime_error("No matching PendingReason variant");
6618+uint64_t FfiConverterPendingReason::allocation_size(const PendingReason &) {
6619+ return static_cast<uint64_t>(sizeof(int32_t));
6623+std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::lift(RustBuffer buf) {
6624+ auto stream = RustStream(&buf);
6625+ auto ret = FfiConverterProtectedSecretHostError::read(stream);
6627+ rustbuffer_free(buf);
6632+RustBuffer FfiConverterProtectedSecretHostError::lower(const ProtectedSecretHostError &val) {
6633+ auto buf = rustbuffer_alloc(allocation_size(val));
6634+ auto stream = RustStream(&buf);
6636+ FfiConverterProtectedSecretHostError::write(stream, val);
6638+ return std::move(buf);
6641+std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::read(RustStream &stream) {
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(
6653+ uniffi_wallet_engine_fn_method_protectedsecrethosterror_uniffi_trait_display,
6655+ FfiConverterProtectedSecretHostError::lower(var)
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);
6664+ throw std::runtime_error("Unexpected error variant");
6668+void FfiConverterProtectedSecretHostError::write(RustStream &stream, const ProtectedSecretHostError &val) {
6669+ stream << val.get_variant_idx();
6670+ switch (val.get_variant_idx()) {
6673+ auto var = static_cast<const protected_secret_host_error::Failed&>(val);
6674+ FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
6675+ FfiConverterString::write(stream, var.diagnostic);
6681+uint64_t FfiConverterProtectedSecretHostError::allocation_size(const ProtectedSecretHostError &val) {
6682+ switch (val.get_variant_idx()) {
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));
6691+ throw std::runtime_error("Unexpected error variant");
6696+ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::lift(RustBuffer buf) {
6697+ auto stream = RustStream(&buf);
6698+ auto ret = FfiConverterProtectedSecretHostErrorKind::read(stream);
6700+ rustbuffer_free(buf);
6702+ return std::move(ret);
6705+RustBuffer FfiConverterProtectedSecretHostErrorKind::lower(const ProtectedSecretHostErrorKind &val) {
6706+ auto buf = rustbuffer_alloc(FfiConverterProtectedSecretHostErrorKind::allocation_size(val));
6707+ auto stream = RustStream(&buf);
6709+ FfiConverterProtectedSecretHostErrorKind::write(stream, val);
6711+ return std::move(buf);
6714+ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::read(RustStream &stream) {
6721+ return ProtectedSecretHostErrorKind::kNotFound;
6724+ return ProtectedSecretHostErrorKind::kAuthenticationFailed;
6727+ return ProtectedSecretHostErrorKind::kCancelled;
6730+ return ProtectedSecretHostErrorKind::kUnavailable;
6733+ return ProtectedSecretHostErrorKind::kPolicyViolation;
6736+ return ProtectedSecretHostErrorKind::kOther;
6739+ throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
6743+void FfiConverterProtectedSecretHostErrorKind::write(RustStream &stream, const ProtectedSecretHostErrorKind &val) {
6746+ case ProtectedSecretHostErrorKind::kNotFound:
6747+ stream << static_cast<int32_t>(1);
6750+ case ProtectedSecretHostErrorKind::kAuthenticationFailed:
6751+ stream << static_cast<int32_t>(2);
6754+ case ProtectedSecretHostErrorKind::kCancelled:
6755+ stream << static_cast<int32_t>(3);
6758+ case ProtectedSecretHostErrorKind::kUnavailable:
6759+ stream << static_cast<int32_t>(4);
6762+ case ProtectedSecretHostErrorKind::kPolicyViolation:
6763+ stream << static_cast<int32_t>(5);
6766+ case ProtectedSecretHostErrorKind::kOther:
6767+ stream << static_cast<int32_t>(6);
6771+ throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
6775+uint64_t FfiConverterProtectedSecretHostErrorKind::allocation_size(const ProtectedSecretHostErrorKind &) {
6776+ return static_cast<uint64_t>(sizeof(int32_t));
6780+ResourcePhase FfiConverterResourcePhase::lift(RustBuffer buf) {
6781+ auto stream = RustStream(&buf);
6782+ auto ret = FfiConverterResourcePhase::read(stream);
6784+ rustbuffer_free(buf);
6786+ return std::move(ret);
6789+RustBuffer FfiConverterResourcePhase::lower(const ResourcePhase &val) {
6790+ auto buf = rustbuffer_alloc(FfiConverterResourcePhase::allocation_size(val));
6791+ auto stream = RustStream(&buf);
6793+ FfiConverterResourcePhase::write(stream, val);
6795+ return std::move(buf);
6798+ResourcePhase FfiConverterResourcePhase::read(RustStream &stream) {
6805+ return ResourcePhase::kIdle;
6808+ return ResourcePhase::kLoading;
6811+ return ResourcePhase::kReady;
6814+ return ResourcePhase::kFailed;
6817+ throw std::runtime_error("No matching ResourcePhase variant");
6821+void FfiConverterResourcePhase::write(RustStream &stream, const ResourcePhase &val) {
6824+ case ResourcePhase::kIdle:
6825+ stream << static_cast<int32_t>(1);
6828+ case ResourcePhase::kLoading:
6829+ stream << static_cast<int32_t>(2);
6832+ case ResourcePhase::kReady:
6833+ stream << static_cast<int32_t>(3);
6836+ case ResourcePhase::kFailed:
6837+ stream << static_cast<int32_t>(4);
6841+ throw std::runtime_error("No matching ResourcePhase variant");
6845+uint64_t FfiConverterResourcePhase::allocation_size(const ResourcePhase &) {
6846+ return static_cast<uint64_t>(sizeof(int32_t));
6850+RetryAdvice FfiConverterRetryAdvice::lift(RustBuffer buf) {
6851+ auto stream = RustStream(&buf);
6852+ auto ret = FfiConverterRetryAdvice::read(stream);
6854+ rustbuffer_free(buf);
6856+ return std::move(ret);
6859+RustBuffer FfiConverterRetryAdvice::lower(const RetryAdvice &val) {
6860+ auto buf = rustbuffer_alloc(FfiConverterRetryAdvice::allocation_size(val));
6861+ auto stream = RustStream(&buf);
6863+ FfiConverterRetryAdvice::write(stream, val);
6865+ return std::move(buf);
6868+RetryAdvice FfiConverterRetryAdvice::read(RustStream &stream) {
6875+ return RetryAdvice::kNone;
6878+ return RetryAdvice::kSafe;
6881+ return RetryAdvice::kAfterDelay;
6884+ throw std::runtime_error("No matching RetryAdvice variant");
6888+void FfiConverterRetryAdvice::write(RustStream &stream, const RetryAdvice &val) {
6891+ case RetryAdvice::kNone:
6892+ stream << static_cast<int32_t>(1);
6895+ case RetryAdvice::kSafe:
6896+ stream << static_cast<int32_t>(2);
6899+ case RetryAdvice::kAfterDelay:
6900+ stream << static_cast<int32_t>(3);
6904+ throw std::runtime_error("No matching RetryAdvice variant");
6908+uint64_t FfiConverterRetryAdvice::allocation_size(const RetryAdvice &) {
6909+ return static_cast<uint64_t>(sizeof(int32_t));
6913+SecretAccessReason FfiConverterSecretAccessReason::lift(RustBuffer buf) {
6914+ auto stream = RustStream(&buf);
6915+ auto ret = FfiConverterSecretAccessReason::read(stream);
6917+ rustbuffer_free(buf);
6919+ return std::move(ret);
6922+RustBuffer FfiConverterSecretAccessReason::lower(const SecretAccessReason &val) {
6923+ auto buf = rustbuffer_alloc(FfiConverterSecretAccessReason::allocation_size(val));
6924+ auto stream = RustStream(&buf);
6926+ FfiConverterSecretAccessReason::write(stream, val);
6928+ return std::move(buf);
6931+SecretAccessReason FfiConverterSecretAccessReason::read(RustStream &stream) {
6938+ return SecretAccessReason::kCreateWallet;
6941+ return SecretAccessReason::kSignTransfer;
6944+ return SecretAccessReason::kSignTonConnectProof;
6947+ return SecretAccessReason::kPrepareKeyRotation;
6950+ return SecretAccessReason::kEncryptComment;
6953+ return SecretAccessReason::kDecryptComment;
6956+ return SecretAccessReason::kRevealRecoveryPhrase;
6959+ return SecretAccessReason::kDeriveTonConnectSessionKey;
6962+ return SecretAccessReason::kSignTonConnectData;
6965+ throw std::runtime_error("No matching SecretAccessReason variant");
6969+void FfiConverterSecretAccessReason::write(RustStream &stream, const SecretAccessReason &val) {
6972+ case SecretAccessReason::kCreateWallet:
6973+ stream << static_cast<int32_t>(1);
6976+ case SecretAccessReason::kSignTransfer:
6977+ stream << static_cast<int32_t>(2);
6980+ case SecretAccessReason::kSignTonConnectProof:
6981+ stream << static_cast<int32_t>(3);
6984+ case SecretAccessReason::kPrepareKeyRotation:
6985+ stream << static_cast<int32_t>(4);
6988+ case SecretAccessReason::kEncryptComment:
6989+ stream << static_cast<int32_t>(5);
6992+ case SecretAccessReason::kDecryptComment:
6993+ stream << static_cast<int32_t>(6);
6996+ case SecretAccessReason::kRevealRecoveryPhrase:
6997+ stream << static_cast<int32_t>(7);
7000+ case SecretAccessReason::kDeriveTonConnectSessionKey:
7001+ stream << static_cast<int32_t>(8);
7004+ case SecretAccessReason::kSignTonConnectData:
7005+ stream << static_cast<int32_t>(9);
7009+ throw std::runtime_error("No matching SecretAccessReason variant");
7013+uint64_t FfiConverterSecretAccessReason::allocation_size(const SecretAccessReason &) {
7014+ return static_cast<uint64_t>(sizeof(int32_t));
7018+SendAmount FfiConverterSendAmount::lift(RustBuffer buf) {
7019+ auto stream = RustStream(&buf);
7020+ auto ret = FfiConverterSendAmount::read(stream);
7022+ rustbuffer_free(buf);
7024+ return std::move(ret);
7027+RustBuffer FfiConverterSendAmount::lower(const SendAmount &val) {
7028+ auto buf = rustbuffer_alloc(FfiConverterSendAmount::allocation_size(val));
7029+ auto stream = RustStream(&buf);
7031+ FfiConverterSendAmount::write(stream, val);
7033+ return std::move(buf);
7036+SendAmount FfiConverterSendAmount::read(RustStream &stream) {
7037+ int32_t variant_id;
7038+ stream >> variant_id;
7040+ switch (variant_id) {
7043+ return SendAmount::kExact {
7044+ .nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
7048+ return SendAmount::kAll {
7052+ throw std::runtime_error("No matching SendAmount variant");
7056+void FfiConverterSendAmount::write(RustStream &stream, const SendAmount &val) {
7057+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7059+ stream << variant_id;
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);
7066+ else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
7069+ static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
7074+uint64_t FfiConverterSendAmount::allocation_size(const SendAmount &val) {
7075+ uint64_t size = sizeof(int32_t);
7077+ size += std::visit([&](auto &&arg) {
7078+ using T = std::decay_t<decltype(arg)>;
7079+ if constexpr (std::is_same_v<T, SendAmount::kExact>) {
7081+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.nanograms);
7084+ else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
7089+ static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
7097+SendExpiration FfiConverterSendExpiration::lift(RustBuffer buf) {
7098+ auto stream = RustStream(&buf);
7099+ auto ret = FfiConverterSendExpiration::read(stream);
7101+ rustbuffer_free(buf);
7103+ return std::move(ret);
7106+RustBuffer FfiConverterSendExpiration::lower(const SendExpiration &val) {
7107+ auto buf = rustbuffer_alloc(FfiConverterSendExpiration::allocation_size(val));
7108+ auto stream = RustStream(&buf);
7110+ FfiConverterSendExpiration::write(stream, val);
7112+ return std::move(buf);
7115+SendExpiration FfiConverterSendExpiration::read(RustStream &stream) {
7116+ int32_t variant_id;
7117+ stream >> variant_id;
7119+ switch (variant_id) {
7122+ return SendExpiration::kEngineDefault {
7126+ return SendExpiration::kExact {
7127+ .unix_timestamp = FfiConverterUInt64::read(stream),
7131+ throw std::runtime_error("No matching SendExpiration variant");
7135+void FfiConverterSendExpiration::write(RustStream &stream, const SendExpiration &val) {
7136+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7138+ stream << variant_id;
7140+ std::visit([&](auto &&arg) {
7141+ using T = std::decay_t<decltype(arg)>;
7142+ if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
7144+ else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
7145+ FfiConverterUInt64::write(stream, arg.unix_timestamp);
7148+ static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
7153+uint64_t FfiConverterSendExpiration::allocation_size(const SendExpiration &val) {
7154+ uint64_t size = sizeof(int32_t);
7156+ size += std::visit([&](auto &&arg) {
7157+ using T = std::decay_t<decltype(arg)>;
7158+ if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
7162+ else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
7164+ size += FfiConverterUInt64::allocation_size(arg.unix_timestamp);
7168+ static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
7176+SendMessageBody FfiConverterSendMessageBody::lift(RustBuffer buf) {
7177+ auto stream = RustStream(&buf);
7178+ auto ret = FfiConverterSendMessageBody::read(stream);
7180+ rustbuffer_free(buf);
7182+ return std::move(ret);
7185+RustBuffer FfiConverterSendMessageBody::lower(const SendMessageBody &val) {
7186+ auto buf = rustbuffer_alloc(FfiConverterSendMessageBody::allocation_size(val));
7187+ auto stream = RustStream(&buf);
7189+ FfiConverterSendMessageBody::write(stream, val);
7191+ return std::move(buf);
7194+SendMessageBody FfiConverterSendMessageBody::read(RustStream &stream) {
7195+ int32_t variant_id;
7196+ stream >> variant_id;
7198+ switch (variant_id) {
7201+ return SendMessageBody::kEmpty {
7205+ return SendMessageBody::kComment {
7206+ .text = FfiConverterString::read(stream),
7210+ return SendMessageBody::kRawPayload {
7211+ .boc = FfiConverterTypeBoc::read(stream),
7215+ throw std::runtime_error("No matching SendMessageBody variant");
7219+void FfiConverterSendMessageBody::write(RustStream &stream, const SendMessageBody &val) {
7220+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7222+ stream << variant_id;
7224+ std::visit([&](auto &&arg) {
7225+ using T = std::decay_t<decltype(arg)>;
7226+ if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
7228+ else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
7229+ FfiConverterString::write(stream, arg.text);
7231+ else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
7232+ FfiConverterTypeBoc::write(stream, arg.boc);
7235+ static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
7240+uint64_t FfiConverterSendMessageBody::allocation_size(const SendMessageBody &val) {
7241+ uint64_t size = sizeof(int32_t);
7243+ size += std::visit([&](auto &&arg) {
7244+ using T = std::decay_t<decltype(arg)>;
7245+ if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
7249+ else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
7251+ size += FfiConverterString::allocation_size(arg.text);
7254+ else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
7256+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
7260+ static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
7268+SendPhase FfiConverterSendPhase::lift(RustBuffer buf) {
7269+ auto stream = RustStream(&buf);
7270+ auto ret = FfiConverterSendPhase::read(stream);
7272+ rustbuffer_free(buf);
7274+ return std::move(ret);
7277+RustBuffer FfiConverterSendPhase::lower(const SendPhase &val) {
7278+ auto buf = rustbuffer_alloc(FfiConverterSendPhase::allocation_size(val));
7279+ auto stream = RustStream(&buf);
7281+ FfiConverterSendPhase::write(stream, val);
7283+ return std::move(buf);
7286+SendPhase FfiConverterSendPhase::read(RustStream &stream) {
7293+ return SendPhase::kIdle;
7296+ return SendPhase::kValidating;
7299+ return SendPhase::kAuthorizing;
7302+ return SendPhase::kPreparing;
7305+ return SendPhase::kPersisting;
7308+ return SendPhase::kReadyToSubmit;
7311+ return SendPhase::kSubmitting;
7314+ return SendPhase::kSubmissionUnknown;
7317+ return SendPhase::kSubmitted;
7320+ return SendPhase::kHandedOff;
7323+ return SendPhase::kConfirmed;
7326+ return SendPhase::kReplaced;
7329+ return SendPhase::kSequenceNumberConsumed;
7332+ return SendPhase::kExpired;
7335+ return SendPhase::kSuperseded;
7338+ return SendPhase::kFailed;
7341+ return SendPhase::kCancelled;
7344+ throw std::runtime_error("No matching SendPhase variant");
7348+void FfiConverterSendPhase::write(RustStream &stream, const SendPhase &val) {
7351+ case SendPhase::kIdle:
7352+ stream << static_cast<int32_t>(1);
7355+ case SendPhase::kValidating:
7356+ stream << static_cast<int32_t>(2);
7359+ case SendPhase::kAuthorizing:
7360+ stream << static_cast<int32_t>(3);
7363+ case SendPhase::kPreparing:
7364+ stream << static_cast<int32_t>(4);
7367+ case SendPhase::kPersisting:
7368+ stream << static_cast<int32_t>(5);
7371+ case SendPhase::kReadyToSubmit:
7372+ stream << static_cast<int32_t>(6);
7375+ case SendPhase::kSubmitting:
7376+ stream << static_cast<int32_t>(7);
7379+ case SendPhase::kSubmissionUnknown:
7380+ stream << static_cast<int32_t>(8);
7383+ case SendPhase::kSubmitted:
7384+ stream << static_cast<int32_t>(9);
7387+ case SendPhase::kHandedOff:
7388+ stream << static_cast<int32_t>(10);
7391+ case SendPhase::kConfirmed:
7392+ stream << static_cast<int32_t>(11);
7395+ case SendPhase::kReplaced:
7396+ stream << static_cast<int32_t>(12);
7399+ case SendPhase::kSequenceNumberConsumed:
7400+ stream << static_cast<int32_t>(13);
7403+ case SendPhase::kExpired:
7404+ stream << static_cast<int32_t>(14);
7407+ case SendPhase::kSuperseded:
7408+ stream << static_cast<int32_t>(15);
7411+ case SendPhase::kFailed:
7412+ stream << static_cast<int32_t>(16);
7415+ case SendPhase::kCancelled:
7416+ stream << static_cast<int32_t>(17);
7420+ throw std::runtime_error("No matching SendPhase variant");
7424+uint64_t FfiConverterSendPhase::allocation_size(const SendPhase &) {
7425+ return static_cast<uint64_t>(sizeof(int32_t));
7429+std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::lift(RustBuffer buf) {
7430+ auto stream = RustStream(&buf);
7431+ auto ret = FfiConverterStatuslessHostError::read(stream);
7433+ rustbuffer_free(buf);
7438+RustBuffer FfiConverterStatuslessHostError::lower(const StatuslessHostError &val) {
7439+ auto buf = rustbuffer_alloc(allocation_size(val));
7440+ auto stream = RustStream(&buf);
7442+ FfiConverterStatuslessHostError::write(stream, val);
7444+ return std::move(buf);
7447+std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::read(RustStream &stream) {
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(
7459+ uniffi_wallet_engine_fn_method_statuslesshosterror_uniffi_trait_display,
7461+ FfiConverterStatuslessHostError::lower(var)
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);
7470+ throw std::runtime_error("Unexpected error variant");
7474+void FfiConverterStatuslessHostError::write(RustStream &stream, const StatuslessHostError &val) {
7475+ stream << val.get_variant_idx();
7476+ switch (val.get_variant_idx()) {
7479+ auto var = static_cast<const statusless_host_error::Failed&>(val);
7480+ FfiConverterStatuslessHostErrorKind::write(stream, var.kind);
7481+ FfiConverterString::write(stream, var.diagnostic);
7487+uint64_t FfiConverterStatuslessHostError::allocation_size(const StatuslessHostError &val) {
7488+ switch (val.get_variant_idx()) {
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));
7497+ throw std::runtime_error("Unexpected error variant");
7502+StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::lift(RustBuffer buf) {
7503+ auto stream = RustStream(&buf);
7504+ auto ret = FfiConverterStatuslessHostErrorKind::read(stream);
7506+ rustbuffer_free(buf);
7508+ return std::move(ret);
7511+RustBuffer FfiConverterStatuslessHostErrorKind::lower(const StatuslessHostErrorKind &val) {
7512+ auto buf = rustbuffer_alloc(FfiConverterStatuslessHostErrorKind::allocation_size(val));
7513+ auto stream = RustStream(&buf);
7515+ FfiConverterStatuslessHostErrorKind::write(stream, val);
7517+ return std::move(buf);
7520+StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::read(RustStream &stream) {
7527+ return StatuslessHostErrorKind::kOffline;
7530+ return StatuslessHostErrorKind::kTimeout;
7533+ return StatuslessHostErrorKind::kConnectionLost;
7536+ return StatuslessHostErrorKind::kPolicyViolation;
7539+ return StatuslessHostErrorKind::kResponseTooLarge;
7542+ return StatuslessHostErrorKind::kCancelled;
7545+ return StatuslessHostErrorKind::kOther;
7548+ throw std::runtime_error("No matching StatuslessHostErrorKind variant");
7552+void FfiConverterStatuslessHostErrorKind::write(RustStream &stream, const StatuslessHostErrorKind &val) {
7555+ case StatuslessHostErrorKind::kOffline:
7556+ stream << static_cast<int32_t>(1);
7559+ case StatuslessHostErrorKind::kTimeout:
7560+ stream << static_cast<int32_t>(2);
7563+ case StatuslessHostErrorKind::kConnectionLost:
7564+ stream << static_cast<int32_t>(3);
7567+ case StatuslessHostErrorKind::kPolicyViolation:
7568+ stream << static_cast<int32_t>(4);
7571+ case StatuslessHostErrorKind::kResponseTooLarge:
7572+ stream << static_cast<int32_t>(5);
7575+ case StatuslessHostErrorKind::kCancelled:
7576+ stream << static_cast<int32_t>(6);
7579+ case StatuslessHostErrorKind::kOther:
7580+ stream << static_cast<int32_t>(7);
7584+ throw std::runtime_error("No matching StatuslessHostErrorKind variant");
7588+uint64_t FfiConverterStatuslessHostErrorKind::allocation_size(const StatuslessHostErrorKind &) {
7589+ return static_cast<uint64_t>(sizeof(int32_t));
7593+std::shared_ptr<TonAddressError> FfiConverterTonAddressError::lift(RustBuffer buf) {
7594+ auto stream = RustStream(&buf);
7595+ auto ret = FfiConverterTonAddressError::read(stream);
7597+ rustbuffer_free(buf);
7602+RustBuffer FfiConverterTonAddressError::lower(const TonAddressError &val) {
7603+ auto buf = rustbuffer_alloc(allocation_size(val));
7604+ auto stream = RustStream(&buf);
7606+ FfiConverterTonAddressError::write(stream, val);
7608+ return std::move(buf);
7611+std::shared_ptr<TonAddressError> FfiConverterTonAddressError::read(RustStream &stream) {
7618+ ton_address_error::InvalidAddress var("TonAddressError::InvalidAddress");
7619+ auto what_arg = FfiConverterString::lift(
7621+ uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
7623+ FfiConverterTonAddressError::lower(var)
7626+ auto ret = std::make_shared<ton_address_error::InvalidAddress>(what_arg);
7631+ ton_address_error::UnsupportedWorkchain var("TonAddressError::UnsupportedWorkchain");
7632+ auto what_arg = FfiConverterString::lift(
7634+ uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
7636+ FfiConverterTonAddressError::lower(var)
7639+ auto ret = std::make_shared<ton_address_error::UnsupportedWorkchain>(what_arg);
7643+ throw std::runtime_error("Unexpected error variant");
7647+void FfiConverterTonAddressError::write(RustStream &stream, const TonAddressError &val) {
7648+ stream << val.get_variant_idx();
7649+ switch (val.get_variant_idx()) {
7652+ auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
7657+ auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
7663+uint64_t FfiConverterTonAddressError::allocation_size(const TonAddressError &val) {
7664+ switch (val.get_variant_idx()) {
7667+ auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
7668+ return static_cast<uint64_t>(sizeof(int32_t));
7672+ auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
7673+ return static_cast<uint64_t>(sizeof(int32_t));
7676+ throw std::runtime_error("Unexpected error variant");
7681+TonAddressFormat FfiConverterTonAddressFormat::lift(RustBuffer buf) {
7682+ auto stream = RustStream(&buf);
7683+ auto ret = FfiConverterTonAddressFormat::read(stream);
7685+ rustbuffer_free(buf);
7687+ return std::move(ret);
7690+RustBuffer FfiConverterTonAddressFormat::lower(const TonAddressFormat &val) {
7691+ auto buf = rustbuffer_alloc(FfiConverterTonAddressFormat::allocation_size(val));
7692+ auto stream = RustStream(&buf);
7694+ FfiConverterTonAddressFormat::write(stream, val);
7696+ return std::move(buf);
7699+TonAddressFormat FfiConverterTonAddressFormat::read(RustStream &stream) {
7700+ int32_t variant_id;
7701+ stream >> variant_id;
7703+ switch (variant_id) {
7706+ return TonAddressFormat::kRaw {
7710+ return TonAddressFormat::kUserFriendly {
7711+ .bounceable = FfiConverterBool::read(stream),
7712+ .testnet = FfiConverterBool::read(stream),
7716+ throw std::runtime_error("No matching TonAddressFormat variant");
7720+void FfiConverterTonAddressFormat::write(RustStream &stream, const TonAddressFormat &val) {
7721+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7723+ stream << variant_id;
7725+ std::visit([&](auto &&arg) {
7726+ using T = std::decay_t<decltype(arg)>;
7727+ if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
7729+ else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
7730+ FfiConverterBool::write(stream, arg.bounceable);
7731+ FfiConverterBool::write(stream, arg.testnet);
7734+ static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
7739+uint64_t FfiConverterTonAddressFormat::allocation_size(const TonAddressFormat &val) {
7740+ uint64_t size = sizeof(int32_t);
7742+ size += std::visit([&](auto &&arg) {
7743+ using T = std::decay_t<decltype(arg)>;
7744+ if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
7748+ else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
7750+ size += FfiConverterBool::allocation_size(arg.bounceable);
7751+ size += FfiConverterBool::allocation_size(arg.testnet);
7755+ static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
7763+TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::lift(RustBuffer buf) {
7764+ auto stream = RustStream(&buf);
7765+ auto ret = FfiConverterTonConnectConnectErrorCode::read(stream);
7767+ rustbuffer_free(buf);
7769+ return std::move(ret);
7772+RustBuffer FfiConverterTonConnectConnectErrorCode::lower(const TonConnectConnectErrorCode &val) {
7773+ auto buf = rustbuffer_alloc(FfiConverterTonConnectConnectErrorCode::allocation_size(val));
7774+ auto stream = RustStream(&buf);
7776+ FfiConverterTonConnectConnectErrorCode::write(stream, val);
7778+ return std::move(buf);
7781+TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::read(RustStream &stream) {
7788+ return TonConnectConnectErrorCode::kManifestNotFound;
7791+ return TonConnectConnectErrorCode::kManifestContent;
7794+ return TonConnectConnectErrorCode::kUserDeclined;
7797+ throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
7801+void FfiConverterTonConnectConnectErrorCode::write(RustStream &stream, const TonConnectConnectErrorCode &val) {
7804+ case TonConnectConnectErrorCode::kManifestNotFound:
7805+ stream << static_cast<int32_t>(1);
7808+ case TonConnectConnectErrorCode::kManifestContent:
7809+ stream << static_cast<int32_t>(2);
7812+ case TonConnectConnectErrorCode::kUserDeclined:
7813+ stream << static_cast<int32_t>(3);
7817+ throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
7821+uint64_t FfiConverterTonConnectConnectErrorCode::allocation_size(const TonConnectConnectErrorCode &) {
7822+ return static_cast<uint64_t>(sizeof(int32_t));
7826+TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::lift(RustBuffer buf) {
7827+ auto stream = RustStream(&buf);
7828+ auto ret = FfiConverterTonConnectDevicePlatform::read(stream);
7830+ rustbuffer_free(buf);
7832+ return std::move(ret);
7835+RustBuffer FfiConverterTonConnectDevicePlatform::lower(const TonConnectDevicePlatform &val) {
7836+ auto buf = rustbuffer_alloc(FfiConverterTonConnectDevicePlatform::allocation_size(val));
7837+ auto stream = RustStream(&buf);
7839+ FfiConverterTonConnectDevicePlatform::write(stream, val);
7841+ return std::move(buf);
7844+TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::read(RustStream &stream) {
7851+ return TonConnectDevicePlatform::kIphone;
7854+ return TonConnectDevicePlatform::kIpad;
7857+ return TonConnectDevicePlatform::kAndroid;
7860+ return TonConnectDevicePlatform::kWindows;
7863+ return TonConnectDevicePlatform::kMac;
7866+ return TonConnectDevicePlatform::kLinux;
7869+ return TonConnectDevicePlatform::kBrowser;
7872+ throw std::runtime_error("No matching TonConnectDevicePlatform variant");
7876+void FfiConverterTonConnectDevicePlatform::write(RustStream &stream, const TonConnectDevicePlatform &val) {
7879+ case TonConnectDevicePlatform::kIphone:
7880+ stream << static_cast<int32_t>(1);
7883+ case TonConnectDevicePlatform::kIpad:
7884+ stream << static_cast<int32_t>(2);
7887+ case TonConnectDevicePlatform::kAndroid:
7888+ stream << static_cast<int32_t>(3);
7891+ case TonConnectDevicePlatform::kWindows:
7892+ stream << static_cast<int32_t>(4);
7895+ case TonConnectDevicePlatform::kMac:
7896+ stream << static_cast<int32_t>(5);
7899+ case TonConnectDevicePlatform::kLinux:
7900+ stream << static_cast<int32_t>(6);
7903+ case TonConnectDevicePlatform::kBrowser:
7904+ stream << static_cast<int32_t>(7);
7908+ throw std::runtime_error("No matching TonConnectDevicePlatform variant");
7912+uint64_t FfiConverterTonConnectDevicePlatform::allocation_size(const TonConnectDevicePlatform &) {
7913+ return static_cast<uint64_t>(sizeof(int32_t));
7917+TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::lift(RustBuffer buf) {
7918+ auto stream = RustStream(&buf);
7919+ auto ret = FfiConverterTonConnectIncomingRequest::read(stream);
7921+ rustbuffer_free(buf);
7923+ return std::move(ret);
7926+RustBuffer FfiConverterTonConnectIncomingRequest::lower(const TonConnectIncomingRequest &val) {
7927+ auto buf = rustbuffer_alloc(FfiConverterTonConnectIncomingRequest::allocation_size(val));
7928+ auto stream = RustStream(&buf);
7930+ FfiConverterTonConnectIncomingRequest::write(stream, val);
7932+ return std::move(buf);
7935+TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::read(RustStream &stream) {
7936+ int32_t variant_id;
7937+ stream >> variant_id;
7939+ switch (variant_id) {
7942+ return TonConnectIncomingRequest::kSendTransaction {
7943+ .id = FfiConverterString::read(stream),
7944+ .method = FfiConverterString::read(stream),
7945+ .request = FfiConverterTypeSendRequest::read(stream),
7949+ return TonConnectIncomingRequest::kSignMessage {
7950+ .id = FfiConverterString::read(stream),
7951+ .method = FfiConverterString::read(stream),
7952+ .request = FfiConverterTypeSignMessageRequest::read(stream),
7956+ return TonConnectIncomingRequest::kDisconnect {
7957+ .id = FfiConverterString::read(stream),
7958+ .method = FfiConverterString::read(stream),
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),
7970+ return TonConnectIncomingRequest::kSignData {
7971+ .id = FfiConverterString::read(stream),
7972+ .method = FfiConverterString::read(stream),
7973+ .request = FfiConverterTypeTonConnectSignDataRequest::read(stream),
7977+ throw std::runtime_error("No matching TonConnectIncomingRequest variant");
7981+void FfiConverterTonConnectIncomingRequest::write(RustStream &stream, const TonConnectIncomingRequest &val) {
7982+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7984+ stream << variant_id;
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);
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);
7998+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
7999+ FfiConverterString::write(stream, arg.id);
8000+ FfiConverterString::write(stream, arg.method);
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);
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);
8014+ static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
8019+uint64_t FfiConverterTonConnectIncomingRequest::allocation_size(const TonConnectIncomingRequest &val) {
8020+ uint64_t size = sizeof(int32_t);
8022+ size += std::visit([&](auto &&arg) {
8023+ using T = std::decay_t<decltype(arg)>;
8024+ if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSendTransaction>) {
8026+ size += FfiConverterString::allocation_size(arg.id);
8027+ size += FfiConverterString::allocation_size(arg.method);
8028+ size += FfiConverterTypeSendRequest::allocation_size(arg.request);
8031+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignMessage>) {
8033+ size += FfiConverterString::allocation_size(arg.id);
8034+ size += FfiConverterString::allocation_size(arg.method);
8035+ size += FfiConverterTypeSignMessageRequest::allocation_size(arg.request);
8038+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
8040+ size += FfiConverterString::allocation_size(arg.id);
8041+ size += FfiConverterString::allocation_size(arg.method);
8044+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kUnsupported>) {
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);
8052+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignData>) {
8054+ size += FfiConverterString::allocation_size(arg.id);
8055+ size += FfiConverterString::allocation_size(arg.method);
8056+ size += FfiConverterTypeTonConnectSignDataRequest::allocation_size(arg.request);
8060+ static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
8068+TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::lift(RustBuffer buf) {
8069+ auto stream = RustStream(&buf);
8070+ auto ret = FfiConverterTonConnectRpcErrorCode::read(stream);
8072+ rustbuffer_free(buf);
8074+ return std::move(ret);
8077+RustBuffer FfiConverterTonConnectRpcErrorCode::lower(const TonConnectRpcErrorCode &val) {
8078+ auto buf = rustbuffer_alloc(FfiConverterTonConnectRpcErrorCode::allocation_size(val));
8079+ auto stream = RustStream(&buf);
8081+ FfiConverterTonConnectRpcErrorCode::write(stream, val);
8083+ return std::move(buf);
8086+TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::read(RustStream &stream) {
8093+ return TonConnectRpcErrorCode::kUnknown;
8096+ return TonConnectRpcErrorCode::kBadRequest;
8099+ return TonConnectRpcErrorCode::kUnknownApp;
8102+ return TonConnectRpcErrorCode::kUserDeclined;
8105+ return TonConnectRpcErrorCode::kMethodNotSupported;
8108+ throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
8112+void FfiConverterTonConnectRpcErrorCode::write(RustStream &stream, const TonConnectRpcErrorCode &val) {
8115+ case TonConnectRpcErrorCode::kUnknown:
8116+ stream << static_cast<int32_t>(1);
8119+ case TonConnectRpcErrorCode::kBadRequest:
8120+ stream << static_cast<int32_t>(2);
8123+ case TonConnectRpcErrorCode::kUnknownApp:
8124+ stream << static_cast<int32_t>(3);
8127+ case TonConnectRpcErrorCode::kUserDeclined:
8128+ stream << static_cast<int32_t>(4);
8131+ case TonConnectRpcErrorCode::kMethodNotSupported:
8132+ stream << static_cast<int32_t>(5);
8136+ throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
8140+uint64_t FfiConverterTonConnectRpcErrorCode::allocation_size(const TonConnectRpcErrorCode &) {
8141+ return static_cast<uint64_t>(sizeof(int32_t));
8145+std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::lift(RustBuffer buf) {
8146+ auto stream = RustStream(&buf);
8147+ auto ret = FfiConverterTonConnectSessionError::read(stream);
8149+ rustbuffer_free(buf);
8154+RustBuffer FfiConverterTonConnectSessionError::lower(const TonConnectSessionError &val) {
8155+ auto buf = rustbuffer_alloc(allocation_size(val));
8156+ auto stream = RustStream(&buf);
8158+ FfiConverterTonConnectSessionError::write(stream, val);
8160+ return std::move(buf);
8163+std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::read(RustStream &stream) {
8170+ ton_connect_session_error::Failed var("TonConnectSessionError::Failed");
8171+ var.diagnostic = FfiConverterString::read(stream);
8172+ auto what_arg = FfiConverterString::lift(
8174+ uniffi_wallet_engine_fn_method_tonconnectsessionerror_uniffi_trait_display,
8176+ FfiConverterTonConnectSessionError::lower(var)
8179+ auto ret = std::make_shared<ton_connect_session_error::Failed>(what_arg);
8180+ ret->diagnostic = std::move(var.diagnostic);
8184+ throw std::runtime_error("Unexpected error variant");
8188+void FfiConverterTonConnectSessionError::write(RustStream &stream, const TonConnectSessionError &val) {
8189+ stream << val.get_variant_idx();
8190+ switch (val.get_variant_idx()) {
8193+ auto var = static_cast<const ton_connect_session_error::Failed&>(val);
8194+ FfiConverterString::write(stream, var.diagnostic);
8200+uint64_t FfiConverterTonConnectSessionError::allocation_size(const TonConnectSessionError &val) {
8201+ switch (val.get_variant_idx()) {
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));
8209+ throw std::runtime_error("Unexpected error variant");
8214+TonConnectSessionPhase FfiConverterTonConnectSessionPhase::lift(RustBuffer buf) {
8215+ auto stream = RustStream(&buf);
8216+ auto ret = FfiConverterTonConnectSessionPhase::read(stream);
8218+ rustbuffer_free(buf);
8220+ return std::move(ret);
8223+RustBuffer FfiConverterTonConnectSessionPhase::lower(const TonConnectSessionPhase &val) {
8224+ auto buf = rustbuffer_alloc(FfiConverterTonConnectSessionPhase::allocation_size(val));
8225+ auto stream = RustStream(&buf);
8227+ FfiConverterTonConnectSessionPhase::write(stream, val);
8229+ return std::move(buf);
8232+TonConnectSessionPhase FfiConverterTonConnectSessionPhase::read(RustStream &stream) {
8239+ return TonConnectSessionPhase::kPendingConnect;
8242+ return TonConnectSessionPhase::kConnected;
8245+ return TonConnectSessionPhase::kDisconnected;
8248+ throw std::runtime_error("No matching TonConnectSessionPhase variant");
8252+void FfiConverterTonConnectSessionPhase::write(RustStream &stream, const TonConnectSessionPhase &val) {
8255+ case TonConnectSessionPhase::kPendingConnect:
8256+ stream << static_cast<int32_t>(1);
8259+ case TonConnectSessionPhase::kConnected:
8260+ stream << static_cast<int32_t>(2);
8263+ case TonConnectSessionPhase::kDisconnected:
8264+ stream << static_cast<int32_t>(3);
8268+ throw std::runtime_error("No matching TonConnectSessionPhase variant");
8272+uint64_t FfiConverterTonConnectSessionPhase::allocation_size(const TonConnectSessionPhase &) {
8273+ return static_cast<uint64_t>(sizeof(int32_t));
8277+TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::lift(RustBuffer buf) {
8278+ auto stream = RustStream(&buf);
8279+ auto ret = FfiConverterTonConnectSignDataPayload::read(stream);
8281+ rustbuffer_free(buf);
8283+ return std::move(ret);
8286+RustBuffer FfiConverterTonConnectSignDataPayload::lower(const TonConnectSignDataPayload &val) {
8287+ auto buf = rustbuffer_alloc(FfiConverterTonConnectSignDataPayload::allocation_size(val));
8288+ auto stream = RustStream(&buf);
8290+ FfiConverterTonConnectSignDataPayload::write(stream, val);
8292+ return std::move(buf);
8295+TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::read(RustStream &stream) {
8296+ int32_t variant_id;
8297+ stream >> variant_id;
8299+ switch (variant_id) {
8302+ return TonConnectSignDataPayload::kText {
8303+ .text = FfiConverterString::read(stream),
8307+ return TonConnectSignDataPayload::kBinary {
8308+ .bytes = FfiConverterString::read(stream),
8312+ return TonConnectSignDataPayload::kCell {
8313+ .schema = FfiConverterString::read(stream),
8314+ .cell = FfiConverterString::read(stream),
8318+ throw std::runtime_error("No matching TonConnectSignDataPayload variant");
8322+void FfiConverterTonConnectSignDataPayload::write(RustStream &stream, const TonConnectSignDataPayload &val) {
8323+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8325+ stream << variant_id;
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);
8332+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
8333+ FfiConverterString::write(stream, arg.bytes);
8335+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
8336+ FfiConverterString::write(stream, arg.schema);
8337+ FfiConverterString::write(stream, arg.cell);
8340+ static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
8345+uint64_t FfiConverterTonConnectSignDataPayload::allocation_size(const TonConnectSignDataPayload &val) {
8346+ uint64_t size = sizeof(int32_t);
8348+ size += std::visit([&](auto &&arg) {
8349+ using T = std::decay_t<decltype(arg)>;
8350+ if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kText>) {
8352+ size += FfiConverterString::allocation_size(arg.text);
8355+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
8357+ size += FfiConverterString::allocation_size(arg.bytes);
8360+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
8362+ size += FfiConverterString::allocation_size(arg.schema);
8363+ size += FfiConverterString::allocation_size(arg.cell);
8367+ static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
8375+TonTransferAsset FfiConverterTonTransferAsset::lift(RustBuffer buf) {
8376+ auto stream = RustStream(&buf);
8377+ auto ret = FfiConverterTonTransferAsset::read(stream);
8379+ rustbuffer_free(buf);
8381+ return std::move(ret);
8384+RustBuffer FfiConverterTonTransferAsset::lower(const TonTransferAsset &val) {
8385+ auto buf = rustbuffer_alloc(FfiConverterTonTransferAsset::allocation_size(val));
8386+ auto stream = RustStream(&buf);
8388+ FfiConverterTonTransferAsset::write(stream, val);
8390+ return std::move(buf);
8393+TonTransferAsset FfiConverterTonTransferAsset::read(RustStream &stream) {
8394+ int32_t variant_id;
8395+ stream >> variant_id;
8397+ switch (variant_id) {
8400+ return TonTransferAsset::kGram {
8404+ return TonTransferAsset::kJetton {
8405+ .master = FfiConverterTypeTonAddressString::read(stream),
8409+ throw std::runtime_error("No matching TonTransferAsset variant");
8413+void FfiConverterTonTransferAsset::write(RustStream &stream, const TonTransferAsset &val) {
8414+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8416+ stream << variant_id;
8418+ std::visit([&](auto &&arg) {
8419+ using T = std::decay_t<decltype(arg)>;
8420+ if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
8422+ else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
8423+ FfiConverterTypeTonAddressString::write(stream, arg.master);
8426+ static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
8431+uint64_t FfiConverterTonTransferAsset::allocation_size(const TonTransferAsset &val) {
8432+ uint64_t size = sizeof(int32_t);
8434+ size += std::visit([&](auto &&arg) {
8435+ using T = std::decay_t<decltype(arg)>;
8436+ if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
8440+ else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
8442+ size += FfiConverterTypeTonAddressString::allocation_size(arg.master);
8446+ static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
8454+std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::lift(RustBuffer buf) {
8455+ auto stream = RustStream(&buf);
8456+ auto ret = FfiConverterTonTransferLinkError::read(stream);
8458+ rustbuffer_free(buf);
8463+RustBuffer FfiConverterTonTransferLinkError::lower(const TonTransferLinkError &val) {
8464+ auto buf = rustbuffer_alloc(allocation_size(val));
8465+ auto stream = RustStream(&buf);
8467+ FfiConverterTonTransferLinkError::write(stream, val);
8469+ return std::move(buf);
8472+std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::read(RustStream &stream) {
8479+ ton_transfer_link_error::NotTonTransfer var("TonTransferLinkError::NotTonTransfer");
8480+ return std::make_shared<ton_transfer_link_error::NotTonTransfer>(var);
8484+ ton_transfer_link_error::InvalidUrl var("TonTransferLinkError::InvalidUrl");
8485+ return std::make_shared<ton_transfer_link_error::InvalidUrl>(var);
8489+ ton_transfer_link_error::MissingRecipient var("TonTransferLinkError::MissingRecipient");
8490+ return std::make_shared<ton_transfer_link_error::MissingRecipient>(var);
8494+ ton_transfer_link_error::InvalidRecipient var("TonTransferLinkError::InvalidRecipient");
8495+ return std::make_shared<ton_transfer_link_error::InvalidRecipient>(var);
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);
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);
8511+ ton_transfer_link_error::InvalidAmount var("TonTransferLinkError::InvalidAmount");
8512+ return std::make_shared<ton_transfer_link_error::InvalidAmount>(var);
8516+ ton_transfer_link_error::InvalidExpiration var("TonTransferLinkError::InvalidExpiration");
8517+ return std::make_shared<ton_transfer_link_error::InvalidExpiration>(var);
8521+ ton_transfer_link_error::InvalidJettonMaster var("TonTransferLinkError::InvalidJettonMaster");
8522+ return std::make_shared<ton_transfer_link_error::InvalidJettonMaster>(var);
8526+ ton_transfer_link_error::InvalidBinaryPayload var("TonTransferLinkError::InvalidBinaryPayload");
8527+ return std::make_shared<ton_transfer_link_error::InvalidBinaryPayload>(var);
8531+ ton_transfer_link_error::ConflictingPayloads var("TonTransferLinkError::ConflictingPayloads");
8532+ return std::make_shared<ton_transfer_link_error::ConflictingPayloads>(var);
8536+ ton_transfer_link_error::BinaryJettonConflict var("TonTransferLinkError::BinaryJettonConflict");
8537+ return std::make_shared<ton_transfer_link_error::BinaryJettonConflict>(var);
8540+ throw std::runtime_error("Unexpected error variant");
8544+void FfiConverterTonTransferLinkError::write(RustStream &stream, const TonTransferLinkError &val) {
8545+ stream << val.get_variant_idx();
8546+ switch (val.get_variant_idx()) {
8549+ auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
8554+ auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
8559+ auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
8564+ auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
8569+ auto var = static_cast<const ton_transfer_link_error::DuplicateParameter&>(val);
8570+ FfiConverterString::write(stream, var.name);
8575+ auto var = static_cast<const ton_transfer_link_error::UnsupportedParameter&>(val);
8576+ FfiConverterString::write(stream, var.name);
8581+ auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
8586+ auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
8591+ auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
8596+ auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
8601+ auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
8606+ auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
8612+uint64_t FfiConverterTonTransferLinkError::allocation_size(const TonTransferLinkError &val) {
8613+ switch (val.get_variant_idx()) {
8616+ auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
8617+ return static_cast<uint64_t>(sizeof(int32_t));
8621+ auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
8622+ return static_cast<uint64_t>(sizeof(int32_t));
8626+ auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
8627+ return static_cast<uint64_t>(sizeof(int32_t));
8631+ auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
8632+ return static_cast<uint64_t>(sizeof(int32_t));
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));
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));
8648+ auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
8649+ return static_cast<uint64_t>(sizeof(int32_t));
8653+ auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
8654+ return static_cast<uint64_t>(sizeof(int32_t));
8658+ auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
8659+ return static_cast<uint64_t>(sizeof(int32_t));
8663+ auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
8664+ return static_cast<uint64_t>(sizeof(int32_t));
8668+ auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
8669+ return static_cast<uint64_t>(sizeof(int32_t));
8673+ auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
8674+ return static_cast<uint64_t>(sizeof(int32_t));
8677+ throw std::runtime_error("Unexpected error variant");
8682+TonTransferPayload FfiConverterTonTransferPayload::lift(RustBuffer buf) {
8683+ auto stream = RustStream(&buf);
8684+ auto ret = FfiConverterTonTransferPayload::read(stream);
8686+ rustbuffer_free(buf);
8688+ return std::move(ret);
8691+RustBuffer FfiConverterTonTransferPayload::lower(const TonTransferPayload &val) {
8692+ auto buf = rustbuffer_alloc(FfiConverterTonTransferPayload::allocation_size(val));
8693+ auto stream = RustStream(&buf);
8695+ FfiConverterTonTransferPayload::write(stream, val);
8697+ return std::move(buf);
8700+TonTransferPayload FfiConverterTonTransferPayload::read(RustStream &stream) {
8701+ int32_t variant_id;
8702+ stream >> variant_id;
8704+ switch (variant_id) {
8707+ return TonTransferPayload::kNone {
8711+ return TonTransferPayload::kText {
8712+ .text = FfiConverterString::read(stream),
8716+ return TonTransferPayload::kBoc {
8717+ .boc = FfiConverterTypeBoc::read(stream),
8721+ throw std::runtime_error("No matching TonTransferPayload variant");
8725+void FfiConverterTonTransferPayload::write(RustStream &stream, const TonTransferPayload &val) {
8726+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8728+ stream << variant_id;
8730+ std::visit([&](auto &&arg) {
8731+ using T = std::decay_t<decltype(arg)>;
8732+ if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
8734+ else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
8735+ FfiConverterString::write(stream, arg.text);
8737+ else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
8738+ FfiConverterTypeBoc::write(stream, arg.boc);
8741+ static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
8746+uint64_t FfiConverterTonTransferPayload::allocation_size(const TonTransferPayload &val) {
8747+ uint64_t size = sizeof(int32_t);
8749+ size += std::visit([&](auto &&arg) {
8750+ using T = std::decay_t<decltype(arg)>;
8751+ if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
8755+ else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
8757+ size += FfiConverterString::allocation_size(arg.text);
8760+ else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
8762+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
8766+ static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
8774+std::shared_ptr<WalletClientError> FfiConverterWalletClientError::lift(RustBuffer buf) {
8775+ auto stream = RustStream(&buf);
8776+ auto ret = FfiConverterWalletClientError::read(stream);
8778+ rustbuffer_free(buf);
8783+RustBuffer FfiConverterWalletClientError::lower(const WalletClientError &val) {
8784+ auto buf = rustbuffer_alloc(allocation_size(val));
8785+ auto stream = RustStream(&buf);
8787+ FfiConverterWalletClientError::write(stream, val);
8789+ return std::move(buf);
8792+std::shared_ptr<WalletClientError> FfiConverterWalletClientError::read(RustStream &stream) {
8799+ wallet_client_error::InvalidLocalSecretReference var("WalletClientError::InvalidLocalSecretReference");
8800+ auto what_arg = FfiConverterString::lift(
8802+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8804+ FfiConverterWalletClientError::lower(var)
8807+ auto ret = std::make_shared<wallet_client_error::InvalidLocalSecretReference>(what_arg);
8812+ wallet_client_error::InvalidWalletPublicKey var("WalletClientError::InvalidWalletPublicKey");
8813+ auto what_arg = FfiConverterString::lift(
8815+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8817+ FfiConverterWalletClientError::lower(var)
8820+ auto ret = std::make_shared<wallet_client_error::InvalidWalletPublicKey>(what_arg);
8825+ wallet_client_error::WalletIdentityMismatch var("WalletClientError::WalletIdentityMismatch");
8826+ auto what_arg = FfiConverterString::lift(
8828+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8830+ FfiConverterWalletClientError::lower(var)
8833+ auto ret = std::make_shared<wallet_client_error::WalletIdentityMismatch>(what_arg);
8838+ wallet_client_error::InvalidProviderBaseUrl var("WalletClientError::InvalidProviderBaseUrl");
8839+ auto what_arg = FfiConverterString::lift(
8841+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8843+ FfiConverterWalletClientError::lower(var)
8846+ auto ret = std::make_shared<wallet_client_error::InvalidProviderBaseUrl>(what_arg);
8851+ wallet_client_error::InvalidSendRequest var("WalletClientError::InvalidSendRequest");
8852+ auto what_arg = FfiConverterString::lift(
8854+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8856+ FfiConverterWalletClientError::lower(var)
8859+ auto ret = std::make_shared<wallet_client_error::InvalidSendRequest>(what_arg);
8864+ wallet_client_error::NftTransferUnavailable var("WalletClientError::NftTransferUnavailable");
8865+ var.diagnostic = FfiConverterString::read(stream);
8866+ auto what_arg = FfiConverterString::lift(
8868+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8870+ FfiConverterWalletClientError::lower(var)
8873+ auto ret = std::make_shared<wallet_client_error::NftTransferUnavailable>(what_arg);
8874+ ret->diagnostic = std::move(var.diagnostic);
8879+ wallet_client_error::NftTransferEmulationRejected var("WalletClientError::NftTransferEmulationRejected");
8880+ var.diagnostic = FfiConverterString::read(stream);
8881+ auto what_arg = FfiConverterString::lift(
8883+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8885+ FfiConverterWalletClientError::lower(var)
8888+ auto ret = std::make_shared<wallet_client_error::NftTransferEmulationRejected>(what_arg);
8889+ ret->diagnostic = std::move(var.diagnostic);
8894+ wallet_client_error::EncryptedCommentUnavailable var("WalletClientError::EncryptedCommentUnavailable");
8895+ var.diagnostic = FfiConverterString::read(stream);
8896+ auto what_arg = FfiConverterString::lift(
8898+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8900+ FfiConverterWalletClientError::lower(var)
8903+ auto ret = std::make_shared<wallet_client_error::EncryptedCommentUnavailable>(what_arg);
8904+ ret->diagnostic = std::move(var.diagnostic);
8909+ wallet_client_error::DnsResolutionUnavailable var("WalletClientError::DnsResolutionUnavailable");
8910+ var.diagnostic = FfiConverterString::read(stream);
8911+ auto what_arg = FfiConverterString::lift(
8913+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8915+ FfiConverterWalletClientError::lower(var)
8918+ auto ret = std::make_shared<wallet_client_error::DnsResolutionUnavailable>(what_arg);
8919+ ret->diagnostic = std::move(var.diagnostic);
8924+ wallet_client_error::KeyRotationUnavailable var("WalletClientError::KeyRotationUnavailable");
8925+ var.diagnostic = FfiConverterString::read(stream);
8926+ auto what_arg = FfiConverterString::lift(
8928+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8930+ FfiConverterWalletClientError::lower(var)
8933+ auto ret = std::make_shared<wallet_client_error::KeyRotationUnavailable>(what_arg);
8934+ ret->diagnostic = std::move(var.diagnostic);
8939+ wallet_client_error::LocalSigningUnavailable var("WalletClientError::LocalSigningUnavailable");
8940+ auto what_arg = FfiConverterString::lift(
8942+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8944+ FfiConverterWalletClientError::lower(var)
8947+ auto ret = std::make_shared<wallet_client_error::LocalSigningUnavailable>(what_arg);
8952+ wallet_client_error::IdentifierExhausted var("WalletClientError::IdentifierExhausted");
8953+ auto what_arg = FfiConverterString::lift(
8955+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8957+ FfiConverterWalletClientError::lower(var)
8960+ auto ret = std::make_shared<wallet_client_error::IdentifierExhausted>(what_arg);
8965+ wallet_client_error::StateUnavailable var("WalletClientError::StateUnavailable");
8966+ auto what_arg = FfiConverterString::lift(
8968+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8970+ FfiConverterWalletClientError::lower(var)
8973+ auto ret = std::make_shared<wallet_client_error::StateUnavailable>(what_arg);
8978+ wallet_client_error::SendAlreadyInProgress var("WalletClientError::SendAlreadyInProgress");
8979+ auto what_arg = FfiConverterString::lift(
8981+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8983+ FfiConverterWalletClientError::lower(var)
8986+ auto ret = std::make_shared<wallet_client_error::SendAlreadyInProgress>(what_arg);
8991+ wallet_client_error::SendPreviewAlreadyInProgress var("WalletClientError::SendPreviewAlreadyInProgress");
8992+ auto what_arg = FfiConverterString::lift(
8994+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8996+ FfiConverterWalletClientError::lower(var)
8999+ auto ret = std::make_shared<wallet_client_error::SendPreviewAlreadyInProgress>(what_arg);
9004+ wallet_client_error::PreviousSubmissionUnresolved var("WalletClientError::PreviousSubmissionUnresolved");
9005+ auto what_arg = FfiConverterString::lift(
9007+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9009+ FfiConverterWalletClientError::lower(var)
9012+ auto ret = std::make_shared<wallet_client_error::PreviousSubmissionUnresolved>(what_arg);
9017+ wallet_client_error::WalletSeqnoNotAdvanced var("WalletClientError::WalletSeqnoNotAdvanced");
9018+ auto what_arg = FfiConverterString::lift(
9020+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9022+ FfiConverterWalletClientError::lower(var)
9025+ auto ret = std::make_shared<wallet_client_error::WalletSeqnoNotAdvanced>(what_arg);
9030+ wallet_client_error::SendAccountUnavailable var("WalletClientError::SendAccountUnavailable");
9031+ var.status = FfiConverterAccountStatus::read(stream);
9032+ auto what_arg = FfiConverterString::lift(
9034+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9036+ FfiConverterWalletClientError::lower(var)
9039+ auto ret = std::make_shared<wallet_client_error::SendAccountUnavailable>(what_arg);
9040+ ret->status = std::move(var.status);
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(
9050+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9052+ FfiConverterWalletClientError::lower(var)
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);
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(
9068+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9070+ FfiConverterWalletClientError::lower(var)
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);
9081+ wallet_client_error::InvalidProtectedSecret var("WalletClientError::InvalidProtectedSecret");
9082+ auto what_arg = FfiConverterString::lift(
9084+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9086+ FfiConverterWalletClientError::lower(var)
9089+ auto ret = std::make_shared<wallet_client_error::InvalidProtectedSecret>(what_arg);
9094+ wallet_client_error::SendPreviewFailed var("WalletClientError::SendPreviewFailed");
9095+ var.diagnostic = FfiConverterString::read(stream);
9096+ auto what_arg = FfiConverterString::lift(
9098+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9100+ FfiConverterWalletClientError::lower(var)
9103+ auto ret = std::make_shared<wallet_client_error::SendPreviewFailed>(what_arg);
9104+ ret->diagnostic = std::move(var.diagnostic);
9109+ wallet_client_error::EmulationFailed var("WalletClientError::EmulationFailed");
9110+ var.diagnostic = FfiConverterString::read(stream);
9111+ auto what_arg = FfiConverterString::lift(
9113+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9115+ FfiConverterWalletClientError::lower(var)
9118+ auto ret = std::make_shared<wallet_client_error::EmulationFailed>(what_arg);
9119+ ret->diagnostic = std::move(var.diagnostic);
9124+ wallet_client_error::EmulationMessageNotAccepted var("WalletClientError::EmulationMessageNotAccepted");
9125+ var.diagnostic = FfiConverterString::read(stream);
9126+ auto what_arg = FfiConverterString::lift(
9128+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9130+ FfiConverterWalletClientError::lower(var)
9133+ auto ret = std::make_shared<wallet_client_error::EmulationMessageNotAccepted>(what_arg);
9134+ ret->diagnostic = std::move(var.diagnostic);
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(
9145+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9147+ FfiConverterWalletClientError::lower(var)
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);
9158+ wallet_client_error::SendFailed var("WalletClientError::SendFailed");
9159+ var.diagnostic = FfiConverterString::read(stream);
9160+ auto what_arg = FfiConverterString::lift(
9162+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9164+ FfiConverterWalletClientError::lower(var)
9167+ auto ret = std::make_shared<wallet_client_error::SendFailed>(what_arg);
9168+ ret->diagnostic = std::move(var.diagnostic);
9173+ wallet_client_error::SubmissionUnknown var("WalletClientError::SubmissionUnknown");
9174+ var.diagnostic = FfiConverterString::read(stream);
9175+ auto what_arg = FfiConverterString::lift(
9177+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9179+ FfiConverterWalletClientError::lower(var)
9182+ auto ret = std::make_shared<wallet_client_error::SubmissionUnknown>(what_arg);
9183+ ret->diagnostic = std::move(var.diagnostic);
9188+ wallet_client_error::SendCancellationTooLate var("WalletClientError::SendCancellationTooLate");
9189+ auto what_arg = FfiConverterString::lift(
9191+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9193+ FfiConverterWalletClientError::lower(var)
9196+ auto ret = std::make_shared<wallet_client_error::SendCancellationTooLate>(what_arg);
9201+ wallet_client_error::Shutdown var("WalletClientError::Shutdown");
9202+ auto what_arg = FfiConverterString::lift(
9204+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9206+ FfiConverterWalletClientError::lower(var)
9209+ auto ret = std::make_shared<wallet_client_error::Shutdown>(what_arg);
9214+ wallet_client_error::EncryptedCommentLookupFailed var("WalletClientError::EncryptedCommentLookupFailed");
9215+ var.diagnostic = FfiConverterString::read(stream);
9216+ auto what_arg = FfiConverterString::lift(
9218+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9220+ FfiConverterWalletClientError::lower(var)
9223+ auto ret = std::make_shared<wallet_client_error::EncryptedCommentLookupFailed>(what_arg);
9224+ ret->diagnostic = std::move(var.diagnostic);
9228+ throw std::runtime_error("Unexpected error variant");
9232+void FfiConverterWalletClientError::write(RustStream &stream, const WalletClientError &val) {
9233+ stream << val.get_variant_idx();
9234+ switch (val.get_variant_idx()) {
9237+ auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
9242+ auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
9247+ auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
9252+ auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
9257+ auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
9262+ auto var = static_cast<const wallet_client_error::NftTransferUnavailable&>(val);
9263+ FfiConverterString::write(stream, var.diagnostic);
9268+ auto var = static_cast<const wallet_client_error::NftTransferEmulationRejected&>(val);
9269+ FfiConverterString::write(stream, var.diagnostic);
9274+ auto var = static_cast<const wallet_client_error::EncryptedCommentUnavailable&>(val);
9275+ FfiConverterString::write(stream, var.diagnostic);
9280+ auto var = static_cast<const wallet_client_error::DnsResolutionUnavailable&>(val);
9281+ FfiConverterString::write(stream, var.diagnostic);
9286+ auto var = static_cast<const wallet_client_error::KeyRotationUnavailable&>(val);
9287+ FfiConverterString::write(stream, var.diagnostic);
9292+ auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
9297+ auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
9302+ auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
9307+ auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
9312+ auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
9317+ auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
9322+ auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
9327+ auto var = static_cast<const wallet_client_error::SendAccountUnavailable&>(val);
9328+ FfiConverterAccountStatus::write(stream, var.status);
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);
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);
9348+ auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
9353+ auto var = static_cast<const wallet_client_error::SendPreviewFailed&>(val);
9354+ FfiConverterString::write(stream, var.diagnostic);
9359+ auto var = static_cast<const wallet_client_error::EmulationFailed&>(val);
9360+ FfiConverterString::write(stream, var.diagnostic);
9365+ auto var = static_cast<const wallet_client_error::EmulationMessageNotAccepted&>(val);
9366+ FfiConverterString::write(stream, var.diagnostic);
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);
9379+ auto var = static_cast<const wallet_client_error::SendFailed&>(val);
9380+ FfiConverterString::write(stream, var.diagnostic);
9385+ auto var = static_cast<const wallet_client_error::SubmissionUnknown&>(val);
9386+ FfiConverterString::write(stream, var.diagnostic);
9391+ auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
9396+ auto var = static_cast<const wallet_client_error::Shutdown&>(val);
9401+ auto var = static_cast<const wallet_client_error::EncryptedCommentLookupFailed&>(val);
9402+ FfiConverterString::write(stream, var.diagnostic);
9408+uint64_t FfiConverterWalletClientError::allocation_size(const WalletClientError &val) {
9409+ switch (val.get_variant_idx()) {
9412+ auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
9413+ return static_cast<uint64_t>(sizeof(int32_t));
9417+ auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
9418+ return static_cast<uint64_t>(sizeof(int32_t));
9422+ auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
9423+ return static_cast<uint64_t>(sizeof(int32_t));
9427+ auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
9428+ return static_cast<uint64_t>(sizeof(int32_t));
9432+ auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
9433+ return static_cast<uint64_t>(sizeof(int32_t));
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));
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));
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));
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));
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));
9467+ auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
9468+ return static_cast<uint64_t>(sizeof(int32_t));
9472+ auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
9473+ return static_cast<uint64_t>(sizeof(int32_t));
9477+ auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
9478+ return static_cast<uint64_t>(sizeof(int32_t));
9482+ auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
9483+ return static_cast<uint64_t>(sizeof(int32_t));
9487+ auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
9488+ return static_cast<uint64_t>(sizeof(int32_t));
9492+ auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
9493+ return static_cast<uint64_t>(sizeof(int32_t));
9497+ auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
9498+ return static_cast<uint64_t>(sizeof(int32_t));
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));
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));
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));
9523+ auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
9524+ return static_cast<uint64_t>(sizeof(int32_t));
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));
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));
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));
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));
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));
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));
9566+ auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
9567+ return static_cast<uint64_t>(sizeof(int32_t));
9571+ auto var = static_cast<const wallet_client_error::Shutdown&>(val);
9572+ return static_cast<uint64_t>(sizeof(int32_t));
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));
9581+ throw std::runtime_error("Unexpected error variant");
9586+std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::lift(RustBuffer buf) {
9587+ auto stream = RustStream(&buf);
9588+ auto ret = FfiConverterWalletLifecycleError::read(stream);
9590+ rustbuffer_free(buf);
9595+RustBuffer FfiConverterWalletLifecycleError::lower(const WalletLifecycleError &val) {
9596+ auto buf = rustbuffer_alloc(allocation_size(val));
9597+ auto stream = RustStream(&buf);
9599+ FfiConverterWalletLifecycleError::write(stream, val);
9601+ return std::move(buf);
9604+std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::read(RustStream &stream) {
9611+ wallet_lifecycle_error::InvalidRecordId var("WalletLifecycleError::InvalidRecordId");
9612+ auto what_arg = FfiConverterString::lift(
9614+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9616+ FfiConverterWalletLifecycleError::lower(var)
9619+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecordId>(what_arg);
9624+ wallet_lifecycle_error::InvalidRecoveryPhrase var("WalletLifecycleError::InvalidRecoveryPhrase");
9625+ auto what_arg = FfiConverterString::lift(
9627+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9629+ FfiConverterWalletLifecycleError::lower(var)
9632+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecoveryPhrase>(what_arg);
9637+ wallet_lifecycle_error::AddressDerivationFailed var("WalletLifecycleError::AddressDerivationFailed");
9638+ auto what_arg = FfiConverterString::lift(
9640+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9642+ FfiConverterWalletLifecycleError::lower(var)
9645+ auto ret = std::make_shared<wallet_lifecycle_error::AddressDerivationFailed>(what_arg);
9650+ wallet_lifecycle_error::TonConnectSigningFailed var("WalletLifecycleError::TonConnectSigningFailed");
9651+ auto what_arg = FfiConverterString::lift(
9653+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9655+ FfiConverterWalletLifecycleError::lower(var)
9658+ auto ret = std::make_shared<wallet_lifecycle_error::TonConnectSigningFailed>(what_arg);
9663+ wallet_lifecycle_error::SecretWalletMismatch var("WalletLifecycleError::SecretWalletMismatch");
9664+ auto what_arg = FfiConverterString::lift(
9666+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9668+ FfiConverterWalletLifecycleError::lower(var)
9671+ auto ret = std::make_shared<wallet_lifecycle_error::SecretWalletMismatch>(what_arg);
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(
9681+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9683+ FfiConverterWalletLifecycleError::lower(var)
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);
9693+ wallet_lifecycle_error::InvalidTonConnectSessionInput var("WalletLifecycleError::InvalidTonConnectSessionInput");
9694+ auto what_arg = FfiConverterString::lift(
9696+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9698+ FfiConverterWalletLifecycleError::lower(var)
9701+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidTonConnectSessionInput>(what_arg);
9705+ throw std::runtime_error("Unexpected error variant");
9709+void FfiConverterWalletLifecycleError::write(RustStream &stream, const WalletLifecycleError &val) {
9710+ stream << val.get_variant_idx();
9711+ switch (val.get_variant_idx()) {
9714+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
9719+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
9724+ auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
9729+ auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
9734+ auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
9739+ auto var = static_cast<const wallet_lifecycle_error::ProtectedSecretHost&>(val);
9740+ FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
9741+ FfiConverterString::write(stream, var.diagnostic);
9746+ auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
9752+uint64_t FfiConverterWalletLifecycleError::allocation_size(const WalletLifecycleError &val) {
9753+ switch (val.get_variant_idx()) {
9756+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
9757+ return static_cast<uint64_t>(sizeof(int32_t));
9761+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
9762+ return static_cast<uint64_t>(sizeof(int32_t));
9766+ auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
9767+ return static_cast<uint64_t>(sizeof(int32_t));
9771+ auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
9772+ return static_cast<uint64_t>(sizeof(int32_t));
9776+ auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
9777+ return static_cast<uint64_t>(sizeof(int32_t));
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));
9788+ auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
9789+ return static_cast<uint64_t>(sizeof(int32_t));
9792+ throw std::runtime_error("Unexpected error variant");
9797+WalletOperationOutcome FfiConverterWalletOperationOutcome::lift(RustBuffer buf) {
9798+ auto stream = RustStream(&buf);
9799+ auto ret = FfiConverterWalletOperationOutcome::read(stream);
9801+ rustbuffer_free(buf);
9803+ return std::move(ret);
9806+RustBuffer FfiConverterWalletOperationOutcome::lower(const WalletOperationOutcome &val) {
9807+ auto buf = rustbuffer_alloc(FfiConverterWalletOperationOutcome::allocation_size(val));
9808+ auto stream = RustStream(&buf);
9810+ FfiConverterWalletOperationOutcome::write(stream, val);
9812+ return std::move(buf);
9815+WalletOperationOutcome FfiConverterWalletOperationOutcome::read(RustStream &stream) {
9822+ return WalletOperationOutcome::kCompleted;
9825+ return WalletOperationOutcome::kPartiallyCompleted;
9828+ return WalletOperationOutcome::kFailed;
9831+ return WalletOperationOutcome::kCancelled;
9834+ return WalletOperationOutcome::kSuperseded;
9837+ return WalletOperationOutcome::kSkipped;
9840+ throw std::runtime_error("No matching WalletOperationOutcome variant");
9844+void FfiConverterWalletOperationOutcome::write(RustStream &stream, const WalletOperationOutcome &val) {
9847+ case WalletOperationOutcome::kCompleted:
9848+ stream << static_cast<int32_t>(1);
9851+ case WalletOperationOutcome::kPartiallyCompleted:
9852+ stream << static_cast<int32_t>(2);
9855+ case WalletOperationOutcome::kFailed:
9856+ stream << static_cast<int32_t>(3);
9859+ case WalletOperationOutcome::kCancelled:
9860+ stream << static_cast<int32_t>(4);
9863+ case WalletOperationOutcome::kSuperseded:
9864+ stream << static_cast<int32_t>(5);
9867+ case WalletOperationOutcome::kSkipped:
9868+ stream << static_cast<int32_t>(6);
9872+ throw std::runtime_error("No matching WalletOperationOutcome variant");
9876+uint64_t FfiConverterWalletOperationOutcome::allocation_size(const WalletOperationOutcome &) {
9877+ return static_cast<uint64_t>(sizeof(int32_t));
9880+std::optional<uint16_t> FfiConverterOptionalUInt16::lift(RustBuffer buf) {
9881+ auto stream = RustStream(&buf);
9882+ auto ret = FfiConverterOptionalUInt16::read(stream);
9884+ rustbuffer_free(buf);
9889+RustBuffer FfiConverterOptionalUInt16::lower(const std::optional<uint16_t>& val) {
9890+ auto buf = rustbuffer_alloc(FfiConverterOptionalUInt16::allocation_size(val));
9891+ auto stream = RustStream(&buf);
9893+ FfiConverterOptionalUInt16::write(stream, val);
9898+std::optional<uint16_t> FfiConverterOptionalUInt16::read(RustStream &stream) {
9901+ stream.get(has_value);
9903+ return std::make_optional(FfiConverterUInt16::read(stream));
9905+ return std::nullopt;
9909+void FfiConverterOptionalUInt16::write(RustStream &stream, const std::optional<uint16_t>& value) {
9910+ stream.put(static_cast<uint8_t>(!!value));
9913+ FfiConverterUInt16::write(stream, value.value());
9917+uint64_t FfiConverterOptionalUInt16::allocation_size(const std::optional<uint16_t> &val) {
9921+ ret += FfiConverterUInt16::allocation_size(val.value());
9927+std::optional<int32_t> FfiConverterOptionalInt32::lift(RustBuffer buf) {
9928+ auto stream = RustStream(&buf);
9929+ auto ret = FfiConverterOptionalInt32::read(stream);
9931+ rustbuffer_free(buf);
9936+RustBuffer FfiConverterOptionalInt32::lower(const std::optional<int32_t>& val) {
9937+ auto buf = rustbuffer_alloc(FfiConverterOptionalInt32::allocation_size(val));
9938+ auto stream = RustStream(&buf);
9940+ FfiConverterOptionalInt32::write(stream, val);
9945+std::optional<int32_t> FfiConverterOptionalInt32::read(RustStream &stream) {
9948+ stream.get(has_value);
9950+ return std::make_optional(FfiConverterInt32::read(stream));
9952+ return std::nullopt;
9956+void FfiConverterOptionalInt32::write(RustStream &stream, const std::optional<int32_t>& value) {
9957+ stream.put(static_cast<uint8_t>(!!value));
9960+ FfiConverterInt32::write(stream, value.value());
9964+uint64_t FfiConverterOptionalInt32::allocation_size(const std::optional<int32_t> &val) {
9968+ ret += FfiConverterInt32::allocation_size(val.value());
9974+std::optional<uint64_t> FfiConverterOptionalUInt64::lift(RustBuffer buf) {
9975+ auto stream = RustStream(&buf);
9976+ auto ret = FfiConverterOptionalUInt64::read(stream);
9978+ rustbuffer_free(buf);
9983+RustBuffer FfiConverterOptionalUInt64::lower(const std::optional<uint64_t>& val) {
9984+ auto buf = rustbuffer_alloc(FfiConverterOptionalUInt64::allocation_size(val));
9985+ auto stream = RustStream(&buf);
9987+ FfiConverterOptionalUInt64::write(stream, val);
9992+std::optional<uint64_t> FfiConverterOptionalUInt64::read(RustStream &stream) {
9995+ stream.get(has_value);
9997+ return std::make_optional(FfiConverterUInt64::read(stream));
9999+ return std::nullopt;
10003+void FfiConverterOptionalUInt64::write(RustStream &stream, const std::optional<uint64_t>& value) {
10004+ stream.put(static_cast<uint8_t>(!!value));
10007+ FfiConverterUInt64::write(stream, value.value());
10011+uint64_t FfiConverterOptionalUInt64::allocation_size(const std::optional<uint64_t> &val) {
10015+ ret += FfiConverterUInt64::allocation_size(val.value());
10021+std::optional<int64_t> FfiConverterOptionalInt64::lift(RustBuffer buf) {
10022+ auto stream = RustStream(&buf);
10023+ auto ret = FfiConverterOptionalInt64::read(stream);
10025+ rustbuffer_free(buf);
10030+RustBuffer FfiConverterOptionalInt64::lower(const std::optional<int64_t>& val) {
10031+ auto buf = rustbuffer_alloc(FfiConverterOptionalInt64::allocation_size(val));
10032+ auto stream = RustStream(&buf);
10034+ FfiConverterOptionalInt64::write(stream, val);
10039+std::optional<int64_t> FfiConverterOptionalInt64::read(RustStream &stream) {
10042+ stream.get(has_value);
10044+ return std::make_optional(FfiConverterInt64::read(stream));
10046+ return std::nullopt;
10050+void FfiConverterOptionalInt64::write(RustStream &stream, const std::optional<int64_t>& value) {
10051+ stream.put(static_cast<uint8_t>(!!value));
10054+ FfiConverterInt64::write(stream, value.value());
10058+uint64_t FfiConverterOptionalInt64::allocation_size(const std::optional<int64_t> &val) {
10062+ ret += FfiConverterInt64::allocation_size(val.value());
10068+std::optional<bool> FfiConverterOptionalBool::lift(RustBuffer buf) {
10069+ auto stream = RustStream(&buf);
10070+ auto ret = FfiConverterOptionalBool::read(stream);
10072+ rustbuffer_free(buf);
10077+RustBuffer FfiConverterOptionalBool::lower(const std::optional<bool>& val) {
10078+ auto buf = rustbuffer_alloc(FfiConverterOptionalBool::allocation_size(val));
10079+ auto stream = RustStream(&buf);
10081+ FfiConverterOptionalBool::write(stream, val);
10086+std::optional<bool> FfiConverterOptionalBool::read(RustStream &stream) {
10089+ stream.get(has_value);
10091+ return std::make_optional(FfiConverterBool::read(stream));
10093+ return std::nullopt;
10097+void FfiConverterOptionalBool::write(RustStream &stream, const std::optional<bool>& value) {
10098+ stream.put(static_cast<uint8_t>(!!value));
10101+ FfiConverterBool::write(stream, value.value());
10105+uint64_t FfiConverterOptionalBool::allocation_size(const std::optional<bool> &val) {
10109+ ret += FfiConverterBool::allocation_size(val.value());
10115+std::optional<std::string> FfiConverterOptionalString::lift(RustBuffer buf) {
10116+ auto stream = RustStream(&buf);
10117+ auto ret = FfiConverterOptionalString::read(stream);
10119+ rustbuffer_free(buf);
10124+RustBuffer FfiConverterOptionalString::lower(const std::optional<std::string>& val) {
10125+ auto buf = rustbuffer_alloc(FfiConverterOptionalString::allocation_size(val));
10126+ auto stream = RustStream(&buf);
10128+ FfiConverterOptionalString::write(stream, val);
10133+std::optional<std::string> FfiConverterOptionalString::read(RustStream &stream) {
10136+ stream.get(has_value);
10138+ return std::make_optional(FfiConverterString::read(stream));
10140+ return std::nullopt;
10144+void FfiConverterOptionalString::write(RustStream &stream, const std::optional<std::string>& value) {
10145+ stream.put(static_cast<uint8_t>(!!value));
10148+ FfiConverterString::write(stream, value.value());
10152+uint64_t FfiConverterOptionalString::allocation_size(const std::optional<std::string> &val) {
10156+ ret += FfiConverterString::allocation_size(val.value());
10162+std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::lift(RustBuffer buf) {
10163+ auto stream = RustStream(&buf);
10164+ auto ret = FfiConverterOptionalBytes::read(stream);
10166+ rustbuffer_free(buf);
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);
10175+ FfiConverterOptionalBytes::write(stream, val);
10180+std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::read(RustStream &stream) {
10183+ stream.get(has_value);
10185+ return std::make_optional(FfiConverterBytes::read(stream));
10187+ return std::nullopt;
10191+void FfiConverterOptionalBytes::write(RustStream &stream, const std::optional<std::vector<uint8_t>>& value) {
10192+ stream.put(static_cast<uint8_t>(!!value));
10195+ FfiConverterBytes::write(stream, value.value());
10199+uint64_t FfiConverterOptionalBytes::allocation_size(const std::optional<std::vector<uint8_t>> &val) {
10203+ ret += FfiConverterBytes::allocation_size(val.value());
10209+std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::lift(RustBuffer buf) {
10210+ auto stream = RustStream(&buf);
10211+ auto ret = FfiConverterOptionalTypeAccountSnapshot::read(stream);
10213+ rustbuffer_free(buf);
10218+RustBuffer FfiConverterOptionalTypeAccountSnapshot::lower(const std::optional<AccountSnapshot>& val) {
10219+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeAccountSnapshot::allocation_size(val));
10220+ auto stream = RustStream(&buf);
10222+ FfiConverterOptionalTypeAccountSnapshot::write(stream, val);
10227+std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::read(RustStream &stream) {
10230+ stream.get(has_value);
10232+ return std::make_optional(FfiConverterTypeAccountSnapshot::read(stream));
10234+ return std::nullopt;
10238+void FfiConverterOptionalTypeAccountSnapshot::write(RustStream &stream, const std::optional<AccountSnapshot>& value) {
10239+ stream.put(static_cast<uint8_t>(!!value));
10242+ FfiConverterTypeAccountSnapshot::write(stream, value.value());
10246+uint64_t FfiConverterOptionalTypeAccountSnapshot::allocation_size(const std::optional<AccountSnapshot> &val) {
10250+ ret += FfiConverterTypeAccountSnapshot::allocation_size(val.value());
10256+std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::lift(RustBuffer buf) {
10257+ auto stream = RustStream(&buf);
10258+ auto ret = FfiConverterOptionalTypeActivityCursor::read(stream);
10260+ rustbuffer_free(buf);
10265+RustBuffer FfiConverterOptionalTypeActivityCursor::lower(const std::optional<ActivityCursor>& val) {
10266+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeActivityCursor::allocation_size(val));
10267+ auto stream = RustStream(&buf);
10269+ FfiConverterOptionalTypeActivityCursor::write(stream, val);
10274+std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::read(RustStream &stream) {
10277+ stream.get(has_value);
10279+ return std::make_optional(FfiConverterTypeActivityCursor::read(stream));
10281+ return std::nullopt;
10285+void FfiConverterOptionalTypeActivityCursor::write(RustStream &stream, const std::optional<ActivityCursor>& value) {
10286+ stream.put(static_cast<uint8_t>(!!value));
10289+ FfiConverterTypeActivityCursor::write(stream, value.value());
10293+uint64_t FfiConverterOptionalTypeActivityCursor::allocation_size(const std::optional<ActivityCursor> &val) {
10297+ ret += FfiConverterTypeActivityCursor::allocation_size(val.value());
10303+std::optional<DomainError> FfiConverterOptionalTypeDomainError::lift(RustBuffer buf) {
10304+ auto stream = RustStream(&buf);
10305+ auto ret = FfiConverterOptionalTypeDomainError::read(stream);
10307+ rustbuffer_free(buf);
10312+RustBuffer FfiConverterOptionalTypeDomainError::lower(const std::optional<DomainError>& val) {
10313+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeDomainError::allocation_size(val));
10314+ auto stream = RustStream(&buf);
10316+ FfiConverterOptionalTypeDomainError::write(stream, val);
10321+std::optional<DomainError> FfiConverterOptionalTypeDomainError::read(RustStream &stream) {
10324+ stream.get(has_value);
10326+ return std::make_optional(FfiConverterTypeDomainError::read(stream));
10328+ return std::nullopt;
10332+void FfiConverterOptionalTypeDomainError::write(RustStream &stream, const std::optional<DomainError>& value) {
10333+ stream.put(static_cast<uint8_t>(!!value));
10336+ FfiConverterTypeDomainError::write(stream, value.value());
10340+uint64_t FfiConverterOptionalTypeDomainError::allocation_size(const std::optional<DomainError> &val) {
10344+ ret += FfiConverterTypeDomainError::allocation_size(val.value());
10350+std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::lift(RustBuffer buf) {
10351+ auto stream = RustStream(&buf);
10352+ auto ret = FfiConverterOptionalTypeJournalRecord::read(stream);
10354+ rustbuffer_free(buf);
10359+RustBuffer FfiConverterOptionalTypeJournalRecord::lower(const std::optional<JournalRecord>& val) {
10360+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeJournalRecord::allocation_size(val));
10361+ auto stream = RustStream(&buf);
10363+ FfiConverterOptionalTypeJournalRecord::write(stream, val);
10368+std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::read(RustStream &stream) {
10371+ stream.get(has_value);
10373+ return std::make_optional(FfiConverterTypeJournalRecord::read(stream));
10375+ return std::nullopt;
10379+void FfiConverterOptionalTypeJournalRecord::write(RustStream &stream, const std::optional<JournalRecord>& value) {
10380+ stream.put(static_cast<uint8_t>(!!value));
10383+ FfiConverterTypeJournalRecord::write(stream, value.value());
10387+uint64_t FfiConverterOptionalTypeJournalRecord::allocation_size(const std::optional<JournalRecord> &val) {
10391+ ret += FfiConverterTypeJournalRecord::allocation_size(val.value());
10397+std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::lift(RustBuffer buf) {
10398+ auto stream = RustStream(&buf);
10399+ auto ret = FfiConverterOptionalTypeNftCollectionDescriptor::read(stream);
10401+ rustbuffer_free(buf);
10406+RustBuffer FfiConverterOptionalTypeNftCollectionDescriptor::lower(const std::optional<NftCollectionDescriptor>& val) {
10407+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(val));
10408+ auto stream = RustStream(&buf);
10410+ FfiConverterOptionalTypeNftCollectionDescriptor::write(stream, val);
10415+std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::read(RustStream &stream) {
10418+ stream.get(has_value);
10420+ return std::make_optional(FfiConverterTypeNftCollectionDescriptor::read(stream));
10422+ return std::nullopt;
10426+void FfiConverterOptionalTypeNftCollectionDescriptor::write(RustStream &stream, const std::optional<NftCollectionDescriptor>& value) {
10427+ stream.put(static_cast<uint8_t>(!!value));
10430+ FfiConverterTypeNftCollectionDescriptor::write(stream, value.value());
10434+uint64_t FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(const std::optional<NftCollectionDescriptor> &val) {
10438+ ret += FfiConverterTypeNftCollectionDescriptor::allocation_size(val.value());
10444+std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::lift(RustBuffer buf) {
10445+ auto stream = RustStream(&buf);
10446+ auto ret = FfiConverterOptionalTypeProtectedSecretRef::read(stream);
10448+ rustbuffer_free(buf);
10453+RustBuffer FfiConverterOptionalTypeProtectedSecretRef::lower(const std::optional<ProtectedSecretRef>& val) {
10454+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeProtectedSecretRef::allocation_size(val));
10455+ auto stream = RustStream(&buf);
10457+ FfiConverterOptionalTypeProtectedSecretRef::write(stream, val);
10462+std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::read(RustStream &stream) {
10465+ stream.get(has_value);
10467+ return std::make_optional(FfiConverterTypeProtectedSecretRef::read(stream));
10469+ return std::nullopt;
10473+void FfiConverterOptionalTypeProtectedSecretRef::write(RustStream &stream, const std::optional<ProtectedSecretRef>& value) {
10474+ stream.put(static_cast<uint8_t>(!!value));
10477+ FfiConverterTypeProtectedSecretRef::write(stream, value.value());
10481+uint64_t FfiConverterOptionalTypeProtectedSecretRef::allocation_size(const std::optional<ProtectedSecretRef> &val) {
10485+ ret += FfiConverterTypeProtectedSecretRef::allocation_size(val.value());
10491+std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::lift(RustBuffer buf) {
10492+ auto stream = RustStream(&buf);
10493+ auto ret = FfiConverterOptionalTypeResolutionInfo::read(stream);
10495+ rustbuffer_free(buf);
10500+RustBuffer FfiConverterOptionalTypeResolutionInfo::lower(const std::optional<ResolutionInfo>& val) {
10501+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeResolutionInfo::allocation_size(val));
10502+ auto stream = RustStream(&buf);
10504+ FfiConverterOptionalTypeResolutionInfo::write(stream, val);
10509+std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::read(RustStream &stream) {
10512+ stream.get(has_value);
10514+ return std::make_optional(FfiConverterTypeResolutionInfo::read(stream));
10516+ return std::nullopt;
10520+void FfiConverterOptionalTypeResolutionInfo::write(RustStream &stream, const std::optional<ResolutionInfo>& value) {
10521+ stream.put(static_cast<uint8_t>(!!value));
10524+ FfiConverterTypeResolutionInfo::write(stream, value.value());
10528+uint64_t FfiConverterOptionalTypeResolutionInfo::allocation_size(const std::optional<ResolutionInfo> &val) {
10532+ ret += FfiConverterTypeResolutionInfo::allocation_size(val.value());
10538+std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
10539+ auto stream = RustStream(&buf);
10540+ auto ret = FfiConverterOptionalTypeTonConnectConnectPrompt::read(stream);
10542+ rustbuffer_free(buf);
10547+RustBuffer FfiConverterOptionalTypeTonConnectConnectPrompt::lower(const std::optional<TonConnectConnectPrompt>& val) {
10548+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(val));
10549+ auto stream = RustStream(&buf);
10551+ FfiConverterOptionalTypeTonConnectConnectPrompt::write(stream, val);
10556+std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::read(RustStream &stream) {
10559+ stream.get(has_value);
10561+ return std::make_optional(FfiConverterTypeTonConnectConnectPrompt::read(stream));
10563+ return std::nullopt;
10567+void FfiConverterOptionalTypeTonConnectConnectPrompt::write(RustStream &stream, const std::optional<TonConnectConnectPrompt>& value) {
10568+ stream.put(static_cast<uint8_t>(!!value));
10571+ FfiConverterTypeTonConnectConnectPrompt::write(stream, value.value());
10575+uint64_t FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(const std::optional<TonConnectConnectPrompt> &val) {
10579+ ret += FfiConverterTypeTonConnectConnectPrompt::allocation_size(val.value());
10585+std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::lift(RustBuffer buf) {
10586+ auto stream = RustStream(&buf);
10587+ auto ret = FfiConverterOptionalTypeTonConnectPreparedPost::read(stream);
10589+ rustbuffer_free(buf);
10594+RustBuffer FfiConverterOptionalTypeTonConnectPreparedPost::lower(const std::optional<TonConnectPreparedPost>& val) {
10595+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(val));
10596+ auto stream = RustStream(&buf);
10598+ FfiConverterOptionalTypeTonConnectPreparedPost::write(stream, val);
10603+std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::read(RustStream &stream) {
10606+ stream.get(has_value);
10608+ return std::make_optional(FfiConverterTypeTonConnectPreparedPost::read(stream));
10610+ return std::nullopt;
10614+void FfiConverterOptionalTypeTonConnectPreparedPost::write(RustStream &stream, const std::optional<TonConnectPreparedPost>& value) {
10615+ stream.put(static_cast<uint8_t>(!!value));
10618+ FfiConverterTypeTonConnectPreparedPost::write(stream, value.value());
10622+uint64_t FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(const std::optional<TonConnectPreparedPost> &val) {
10626+ ret += FfiConverterTypeTonConnectPreparedPost::allocation_size(val.value());
10632+std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::lift(RustBuffer buf) {
10633+ auto stream = RustStream(&buf);
10634+ auto ret = FfiConverterOptionalTypeTonConnectProofReply::read(stream);
10636+ rustbuffer_free(buf);
10641+RustBuffer FfiConverterOptionalTypeTonConnectProofReply::lower(const std::optional<TonConnectProofReply>& val) {
10642+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectProofReply::allocation_size(val));
10643+ auto stream = RustStream(&buf);
10645+ FfiConverterOptionalTypeTonConnectProofReply::write(stream, val);
10650+std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::read(RustStream &stream) {
10653+ stream.get(has_value);
10655+ return std::make_optional(FfiConverterTypeTonConnectProofReply::read(stream));
10657+ return std::nullopt;
10661+void FfiConverterOptionalTypeTonConnectProofReply::write(RustStream &stream, const std::optional<TonConnectProofReply>& value) {
10662+ stream.put(static_cast<uint8_t>(!!value));
10665+ FfiConverterTypeTonConnectProofReply::write(stream, value.value());
10669+uint64_t FfiConverterOptionalTypeTonConnectProofReply::allocation_size(const std::optional<TonConnectProofReply> &val) {
10673+ ret += FfiConverterTypeTonConnectProofReply::allocation_size(val.value());
10679+std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::lift(RustBuffer buf) {
10680+ auto stream = RustStream(&buf);
10681+ auto ret = FfiConverterOptionalHttpHostErrorKind::read(stream);
10683+ rustbuffer_free(buf);
10688+RustBuffer FfiConverterOptionalHttpHostErrorKind::lower(const std::optional<HttpHostErrorKind>& val) {
10689+ auto buf = rustbuffer_alloc(FfiConverterOptionalHttpHostErrorKind::allocation_size(val));
10690+ auto stream = RustStream(&buf);
10692+ FfiConverterOptionalHttpHostErrorKind::write(stream, val);
10697+std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::read(RustStream &stream) {
10700+ stream.get(has_value);
10702+ return std::make_optional(FfiConverterHttpHostErrorKind::read(stream));
10704+ return std::nullopt;
10708+void FfiConverterOptionalHttpHostErrorKind::write(RustStream &stream, const std::optional<HttpHostErrorKind>& value) {
10709+ stream.put(static_cast<uint8_t>(!!value));
10712+ FfiConverterHttpHostErrorKind::write(stream, value.value());
10716+uint64_t FfiConverterOptionalHttpHostErrorKind::allocation_size(const std::optional<HttpHostErrorKind> &val) {
10720+ ret += FfiConverterHttpHostErrorKind::allocation_size(val.value());
10726+std::optional<PendingReason> FfiConverterOptionalPendingReason::lift(RustBuffer buf) {
10727+ auto stream = RustStream(&buf);
10728+ auto ret = FfiConverterOptionalPendingReason::read(stream);
10730+ rustbuffer_free(buf);
10735+RustBuffer FfiConverterOptionalPendingReason::lower(const std::optional<PendingReason>& val) {
10736+ auto buf = rustbuffer_alloc(FfiConverterOptionalPendingReason::allocation_size(val));
10737+ auto stream = RustStream(&buf);
10739+ FfiConverterOptionalPendingReason::write(stream, val);
10744+std::optional<PendingReason> FfiConverterOptionalPendingReason::read(RustStream &stream) {
10747+ stream.get(has_value);
10749+ return std::make_optional(FfiConverterPendingReason::read(stream));
10751+ return std::nullopt;
10755+void FfiConverterOptionalPendingReason::write(RustStream &stream, const std::optional<PendingReason>& value) {
10756+ stream.put(static_cast<uint8_t>(!!value));
10759+ FfiConverterPendingReason::write(stream, value.value());
10763+uint64_t FfiConverterOptionalPendingReason::allocation_size(const std::optional<PendingReason> &val) {
10767+ ret += FfiConverterPendingReason::allocation_size(val.value());
10773+std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::lift(RustBuffer buf) {
10774+ auto stream = RustStream(&buf);
10775+ auto ret = FfiConverterOptionalTypeBase64Hash::read(stream);
10777+ rustbuffer_free(buf);
10782+RustBuffer FfiConverterOptionalTypeBase64Hash::lower(const std::optional<Base64Hash>& val) {
10783+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBase64Hash::allocation_size(val));
10784+ auto stream = RustStream(&buf);
10786+ FfiConverterOptionalTypeBase64Hash::write(stream, val);
10791+std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::read(RustStream &stream) {
10794+ stream.get(has_value);
10796+ return std::make_optional(FfiConverterTypeBase64Hash::read(stream));
10798+ return std::nullopt;
10802+void FfiConverterOptionalTypeBase64Hash::write(RustStream &stream, const std::optional<Base64Hash>& value) {
10803+ stream.put(static_cast<uint8_t>(!!value));
10806+ FfiConverterTypeBase64Hash::write(stream, value.value());
10810+uint64_t FfiConverterOptionalTypeBase64Hash::allocation_size(const std::optional<Base64Hash> &val) {
10814+ ret += FfiConverterTypeBase64Hash::allocation_size(val.value());
10820+std::optional<Boc> FfiConverterOptionalTypeBoc::lift(RustBuffer buf) {
10821+ auto stream = RustStream(&buf);
10822+ auto ret = FfiConverterOptionalTypeBoc::read(stream);
10824+ rustbuffer_free(buf);
10829+RustBuffer FfiConverterOptionalTypeBoc::lower(const std::optional<Boc>& val) {
10830+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBoc::allocation_size(val));
10831+ auto stream = RustStream(&buf);
10833+ FfiConverterOptionalTypeBoc::write(stream, val);
10838+std::optional<Boc> FfiConverterOptionalTypeBoc::read(RustStream &stream) {
10841+ stream.get(has_value);
10843+ return std::make_optional(FfiConverterTypeBoc::read(stream));
10845+ return std::nullopt;
10849+void FfiConverterOptionalTypeBoc::write(RustStream &stream, const std::optional<Boc>& value) {
10850+ stream.put(static_cast<uint8_t>(!!value));
10853+ FfiConverterTypeBoc::write(stream, value.value());
10857+uint64_t FfiConverterOptionalTypeBoc::allocation_size(const std::optional<Boc> &val) {
10861+ ret += FfiConverterTypeBoc::allocation_size(val.value());
10867+std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::lift(RustBuffer buf) {
10868+ auto stream = RustStream(&buf);
10869+ auto ret = FfiConverterOptionalTypeNonEmptyString::read(stream);
10871+ rustbuffer_free(buf);
10876+RustBuffer FfiConverterOptionalTypeNonEmptyString::lower(const std::optional<NonEmptyString>& val) {
10877+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNonEmptyString::allocation_size(val));
10878+ auto stream = RustStream(&buf);
10880+ FfiConverterOptionalTypeNonEmptyString::write(stream, val);
10885+std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::read(RustStream &stream) {
10888+ stream.get(has_value);
10890+ return std::make_optional(FfiConverterTypeNonEmptyString::read(stream));
10892+ return std::nullopt;
10896+void FfiConverterOptionalTypeNonEmptyString::write(RustStream &stream, const std::optional<NonEmptyString>& value) {
10897+ stream.put(static_cast<uint8_t>(!!value));
10900+ FfiConverterTypeNonEmptyString::write(stream, value.value());
10904+uint64_t FfiConverterOptionalTypeNonEmptyString::allocation_size(const std::optional<NonEmptyString> &val) {
10908+ ret += FfiConverterTypeNonEmptyString::allocation_size(val.value());
10914+std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::lift(RustBuffer buf) {
10915+ auto stream = RustStream(&buf);
10916+ auto ret = FfiConverterOptionalTypeTonAddressString::read(stream);
10918+ rustbuffer_free(buf);
10923+RustBuffer FfiConverterOptionalTypeTonAddressString::lower(const std::optional<TonAddressString>& val) {
10924+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonAddressString::allocation_size(val));
10925+ auto stream = RustStream(&buf);
10927+ FfiConverterOptionalTypeTonAddressString::write(stream, val);
10932+std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::read(RustStream &stream) {
10935+ stream.get(has_value);
10937+ return std::make_optional(FfiConverterTypeTonAddressString::read(stream));
10939+ return std::nullopt;
10943+void FfiConverterOptionalTypeTonAddressString::write(RustStream &stream, const std::optional<TonAddressString>& value) {
10944+ stream.put(static_cast<uint8_t>(!!value));
10947+ FfiConverterTypeTonAddressString::write(stream, value.value());
10951+uint64_t FfiConverterOptionalTypeTonAddressString::allocation_size(const std::optional<TonAddressString> &val) {
10955+ ret += FfiConverterTypeTonAddressString::allocation_size(val.value());
10961+std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::lift(RustBuffer buf) {
10962+ auto stream = RustStream(&buf);
10963+ auto ret = FfiConverterOptionalTypeUnsignedDecimalString::read(stream);
10965+ rustbuffer_free(buf);
10970+RustBuffer FfiConverterOptionalTypeUnsignedDecimalString::lower(const std::optional<UnsignedDecimalString>& val) {
10971+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val));
10972+ auto stream = RustStream(&buf);
10974+ FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val);
10979+std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::read(RustStream &stream) {
10982+ stream.get(has_value);
10984+ return std::make_optional(FfiConverterTypeUnsignedDecimalString::read(stream));
10986+ return std::nullopt;
10990+void FfiConverterOptionalTypeUnsignedDecimalString::write(RustStream &stream, const std::optional<UnsignedDecimalString>& value) {
10991+ stream.put(static_cast<uint8_t>(!!value));
10994+ FfiConverterTypeUnsignedDecimalString::write(stream, value.value());
10998+uint64_t FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(const std::optional<UnsignedDecimalString> &val) {
11002+ ret += FfiConverterTypeUnsignedDecimalString::allocation_size(val.value());
11009+std::vector<std::string> FfiConverterSequenceString::lift(RustBuffer buf) {
11010+ auto stream = RustStream(&buf);
11011+ auto ret = read(stream);
11013+ rustbuffer_free(buf);
11018+RustBuffer FfiConverterSequenceString::lower(const std::vector<std::string> &val) {
11019+ auto buf = rustbuffer_alloc(allocation_size(val));
11020+ auto stream = RustStream(&buf);
11022+ write(stream, val);
11027+std::vector<std::string> FfiConverterSequenceString::read(RustStream &stream) {
11028+ std::vector<std::string> ret;
11032+ ret.reserve(count);
11034+ for (decltype(count) i = 0; i < count; i++) {
11035+ ret.push_back(FfiConverterString::read(stream));
11041+void FfiConverterSequenceString::write(RustStream &stream, const std::vector<std::string> &val) {
11042+ stream << static_cast<int32_t>(val.size());
11044+ for (auto &elem : val) {
11045+ FfiConverterString::write(stream, elem);
11049+uint64_t FfiConverterSequenceString::allocation_size(const std::vector<std::string> &val) {
11050+ uint64_t size = sizeof(int32_t);
11052+ for (auto &elem : val) {
11053+ size += FfiConverterString::allocation_size(elem);
11060+std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::lift(RustBuffer buf) {
11061+ auto stream = RustStream(&buf);
11062+ auto ret = read(stream);
11064+ rustbuffer_free(buf);
11069+RustBuffer FfiConverterSequenceTypeActivityItem::lower(const std::vector<ActivityItem> &val) {
11070+ auto buf = rustbuffer_alloc(allocation_size(val));
11071+ auto stream = RustStream(&buf);
11073+ write(stream, val);
11078+std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::read(RustStream &stream) {
11079+ std::vector<ActivityItem> ret;
11083+ ret.reserve(count);
11085+ for (decltype(count) i = 0; i < count; i++) {
11086+ ret.push_back(FfiConverterTypeActivityItem::read(stream));
11092+void FfiConverterSequenceTypeActivityItem::write(RustStream &stream, const std::vector<ActivityItem> &val) {
11093+ stream << static_cast<int32_t>(val.size());
11095+ for (auto &elem : val) {
11096+ FfiConverterTypeActivityItem::write(stream, elem);
11100+uint64_t FfiConverterSequenceTypeActivityItem::allocation_size(const std::vector<ActivityItem> &val) {
11101+ uint64_t size = sizeof(int32_t);
11103+ for (auto &elem : val) {
11104+ size += FfiConverterTypeActivityItem::allocation_size(elem);
11111+std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::lift(RustBuffer buf) {
11112+ auto stream = RustStream(&buf);
11113+ auto ret = read(stream);
11115+ rustbuffer_free(buf);
11120+RustBuffer FfiConverterSequenceTypeHttpHeader::lower(const std::vector<HttpHeader> &val) {
11121+ auto buf = rustbuffer_alloc(allocation_size(val));
11122+ auto stream = RustStream(&buf);
11124+ write(stream, val);
11129+std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::read(RustStream &stream) {
11130+ std::vector<HttpHeader> ret;
11134+ ret.reserve(count);
11136+ for (decltype(count) i = 0; i < count; i++) {
11137+ ret.push_back(FfiConverterTypeHttpHeader::read(stream));
11143+void FfiConverterSequenceTypeHttpHeader::write(RustStream &stream, const std::vector<HttpHeader> &val) {
11144+ stream << static_cast<int32_t>(val.size());
11146+ for (auto &elem : val) {
11147+ FfiConverterTypeHttpHeader::write(stream, elem);
11151+uint64_t FfiConverterSequenceTypeHttpHeader::allocation_size(const std::vector<HttpHeader> &val) {
11152+ uint64_t size = sizeof(int32_t);
11154+ for (auto &elem : val) {
11155+ size += FfiConverterTypeHttpHeader::allocation_size(elem);
11162+std::vector<NftItem> FfiConverterSequenceTypeNftItem::lift(RustBuffer buf) {
11163+ auto stream = RustStream(&buf);
11164+ auto ret = read(stream);
11166+ rustbuffer_free(buf);
11171+RustBuffer FfiConverterSequenceTypeNftItem::lower(const std::vector<NftItem> &val) {
11172+ auto buf = rustbuffer_alloc(allocation_size(val));
11173+ auto stream = RustStream(&buf);
11175+ write(stream, val);
11180+std::vector<NftItem> FfiConverterSequenceTypeNftItem::read(RustStream &stream) {
11181+ std::vector<NftItem> ret;
11185+ ret.reserve(count);
11187+ for (decltype(count) i = 0; i < count; i++) {
11188+ ret.push_back(FfiConverterTypeNftItem::read(stream));
11194+void FfiConverterSequenceTypeNftItem::write(RustStream &stream, const std::vector<NftItem> &val) {
11195+ stream << static_cast<int32_t>(val.size());
11197+ for (auto &elem : val) {
11198+ FfiConverterTypeNftItem::write(stream, elem);
11202+uint64_t FfiConverterSequenceTypeNftItem::allocation_size(const std::vector<NftItem> &val) {
11203+ uint64_t size = sizeof(int32_t);
11205+ for (auto &elem : val) {
11206+ size += FfiConverterTypeNftItem::allocation_size(elem);
11213+std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::lift(RustBuffer buf) {
11214+ auto stream = RustStream(&buf);
11215+ auto ret = read(stream);
11217+ rustbuffer_free(buf);
11222+RustBuffer FfiConverterSequenceTypeSendEmulationAction::lower(const std::vector<SendEmulationAction> &val) {
11223+ auto buf = rustbuffer_alloc(allocation_size(val));
11224+ auto stream = RustStream(&buf);
11226+ write(stream, val);
11231+std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::read(RustStream &stream) {
11232+ std::vector<SendEmulationAction> ret;
11236+ ret.reserve(count);
11238+ for (decltype(count) i = 0; i < count; i++) {
11239+ ret.push_back(FfiConverterTypeSendEmulationAction::read(stream));
11245+void FfiConverterSequenceTypeSendEmulationAction::write(RustStream &stream, const std::vector<SendEmulationAction> &val) {
11246+ stream << static_cast<int32_t>(val.size());
11248+ for (auto &elem : val) {
11249+ FfiConverterTypeSendEmulationAction::write(stream, elem);
11253+uint64_t FfiConverterSequenceTypeSendEmulationAction::allocation_size(const std::vector<SendEmulationAction> &val) {
11254+ uint64_t size = sizeof(int32_t);
11256+ for (auto &elem : val) {
11257+ size += FfiConverterTypeSendEmulationAction::allocation_size(elem);
11264+std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::lift(RustBuffer buf) {
11265+ auto stream = RustStream(&buf);
11266+ auto ret = read(stream);
11268+ rustbuffer_free(buf);
11273+RustBuffer FfiConverterSequenceTypeSendEmulationTransaction::lower(const std::vector<SendEmulationTransaction> &val) {
11274+ auto buf = rustbuffer_alloc(allocation_size(val));
11275+ auto stream = RustStream(&buf);
11277+ write(stream, val);
11282+std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::read(RustStream &stream) {
11283+ std::vector<SendEmulationTransaction> ret;
11287+ ret.reserve(count);
11289+ for (decltype(count) i = 0; i < count; i++) {
11290+ ret.push_back(FfiConverterTypeSendEmulationTransaction::read(stream));
11296+void FfiConverterSequenceTypeSendEmulationTransaction::write(RustStream &stream, const std::vector<SendEmulationTransaction> &val) {
11297+ stream << static_cast<int32_t>(val.size());
11299+ for (auto &elem : val) {
11300+ FfiConverterTypeSendEmulationTransaction::write(stream, elem);
11304+uint64_t FfiConverterSequenceTypeSendEmulationTransaction::allocation_size(const std::vector<SendEmulationTransaction> &val) {
11305+ uint64_t size = sizeof(int32_t);
11307+ for (auto &elem : val) {
11308+ size += FfiConverterTypeSendEmulationTransaction::allocation_size(elem);
11315+std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::lift(RustBuffer buf) {
11316+ auto stream = RustStream(&buf);
11317+ auto ret = read(stream);
11319+ rustbuffer_free(buf);
11324+RustBuffer FfiConverterSequenceTypeSendMessage::lower(const std::vector<SendMessage> &val) {
11325+ auto buf = rustbuffer_alloc(allocation_size(val));
11326+ auto stream = RustStream(&buf);
11328+ write(stream, val);
11333+std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::read(RustStream &stream) {
11334+ std::vector<SendMessage> ret;
11338+ ret.reserve(count);
11340+ for (decltype(count) i = 0; i < count; i++) {
11341+ ret.push_back(FfiConverterTypeSendMessage::read(stream));
11347+void FfiConverterSequenceTypeSendMessage::write(RustStream &stream, const std::vector<SendMessage> &val) {
11348+ stream << static_cast<int32_t>(val.size());
11350+ for (auto &elem : val) {
11351+ FfiConverterTypeSendMessage::write(stream, elem);
11355+uint64_t FfiConverterSequenceTypeSendMessage::allocation_size(const std::vector<SendMessage> &val) {
11356+ uint64_t size = sizeof(int32_t);
11358+ for (auto &elem : val) {
11359+ size += FfiConverterTypeSendMessage::allocation_size(elem);
11366+std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::lift(RustBuffer buf) {
11367+ auto stream = RustStream(&buf);
11368+ auto ret = read(stream);
11370+ rustbuffer_free(buf);
11375+RustBuffer FfiConverterSequenceMnemonicScheme::lower(const std::vector<MnemonicScheme> &val) {
11376+ auto buf = rustbuffer_alloc(allocation_size(val));
11377+ auto stream = RustStream(&buf);
11379+ write(stream, val);
11384+std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::read(RustStream &stream) {
11385+ std::vector<MnemonicScheme> ret;
11389+ ret.reserve(count);
11391+ for (decltype(count) i = 0; i < count; i++) {
11392+ ret.push_back(FfiConverterMnemonicScheme::read(stream));
11398+void FfiConverterSequenceMnemonicScheme::write(RustStream &stream, const std::vector<MnemonicScheme> &val) {
11399+ stream << static_cast<int32_t>(val.size());
11401+ for (auto &elem : val) {
11402+ FfiConverterMnemonicScheme::write(stream, elem);
11406+uint64_t FfiConverterSequenceMnemonicScheme::allocation_size(const std::vector<MnemonicScheme> &val) {
11407+ uint64_t size = sizeof(int32_t);
11409+ for (auto &elem : val) {
11410+ size += FfiConverterMnemonicScheme::allocation_size(elem);
11417+std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::lift(RustBuffer buf) {
11418+ auto stream = RustStream(&buf);
11419+ auto ret = read(stream);
11421+ rustbuffer_free(buf);
11426+RustBuffer FfiConverterSequenceTonConnectIncomingRequest::lower(const std::vector<TonConnectIncomingRequest> &val) {
11427+ auto buf = rustbuffer_alloc(allocation_size(val));
11428+ auto stream = RustStream(&buf);
11430+ write(stream, val);
11435+std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::read(RustStream &stream) {
11436+ std::vector<TonConnectIncomingRequest> ret;
11440+ ret.reserve(count);
11442+ for (decltype(count) i = 0; i < count; i++) {
11443+ ret.push_back(FfiConverterTonConnectIncomingRequest::read(stream));
11449+void FfiConverterSequenceTonConnectIncomingRequest::write(RustStream &stream, const std::vector<TonConnectIncomingRequest> &val) {
11450+ stream << static_cast<int32_t>(val.size());
11452+ for (auto &elem : val) {
11453+ FfiConverterTonConnectIncomingRequest::write(stream, elem);
11457+uint64_t FfiConverterSequenceTonConnectIncomingRequest::allocation_size(const std::vector<TonConnectIncomingRequest> &val) {
11458+ uint64_t size = sizeof(int32_t);
11460+ for (auto &elem : val) {
11461+ size += FfiConverterTonConnectIncomingRequest::allocation_size(elem);
11468+std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::lift(RustBuffer buf) {
11469+ auto stream = RustStream(&buf);
11470+ auto ret = read(stream);
11472+ rustbuffer_free(buf);
11477+RustBuffer FfiConverterSequenceTypeBase64Hash::lower(const std::vector<Base64Hash> &val) {
11478+ auto buf = rustbuffer_alloc(allocation_size(val));
11479+ auto stream = RustStream(&buf);
11481+ write(stream, val);
11486+std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::read(RustStream &stream) {
11487+ std::vector<Base64Hash> ret;
11491+ ret.reserve(count);
11493+ for (decltype(count) i = 0; i < count; i++) {
11494+ ret.push_back(FfiConverterTypeBase64Hash::read(stream));
11500+void FfiConverterSequenceTypeBase64Hash::write(RustStream &stream, const std::vector<Base64Hash> &val) {
11501+ stream << static_cast<int32_t>(val.size());
11503+ for (auto &elem : val) {
11504+ FfiConverterTypeBase64Hash::write(stream, elem);
11508+uint64_t FfiConverterSequenceTypeBase64Hash::allocation_size(const std::vector<Base64Hash> &val) {
11509+ uint64_t size = sizeof(int32_t);
11511+ for (auto &elem : val) {
11512+ size += FfiConverterTypeBase64Hash::allocation_size(elem);
11519+std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::lift(RustBuffer buf) {
11520+ auto stream = RustStream(&buf);
11521+ auto ret = read(stream);
11523+ rustbuffer_free(buf);
11528+RustBuffer FfiConverterSequenceTypeTonAddressString::lower(const std::vector<TonAddressString> &val) {
11529+ auto buf = rustbuffer_alloc(allocation_size(val));
11530+ auto stream = RustStream(&buf);
11532+ write(stream, val);
11537+std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::read(RustStream &stream) {
11538+ std::vector<TonAddressString> ret;
11542+ ret.reserve(count);
11544+ for (decltype(count) i = 0; i < count; i++) {
11545+ ret.push_back(FfiConverterTypeTonAddressString::read(stream));
11551+void FfiConverterSequenceTypeTonAddressString::write(RustStream &stream, const std::vector<TonAddressString> &val) {
11552+ stream << static_cast<int32_t>(val.size());
11554+ for (auto &elem : val) {
11555+ FfiConverterTypeTonAddressString::write(stream, elem);
11559+uint64_t FfiConverterSequenceTypeTonAddressString::allocation_size(const std::vector<TonAddressString> &val) {
11560+ uint64_t size = sizeof(int32_t);
11562+ for (auto &elem : val) {
11563+ size += FfiConverterTypeTonAddressString::allocation_size(elem);
11570+std::unordered_map<std::string, std::string> FfiConverterMapStringString::lift(RustBuffer buf) {
11571+ auto stream = RustStream(&buf);
11572+ auto ret = read(stream);
11574+ rustbuffer_free(buf);
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);
11583+ write(stream, val);
11588+std::unordered_map<std::string, std::string> FfiConverterMapStringString::read(RustStream &stream) {
11589+ std::unordered_map<std::string, std::string> ret;
11593+ ret.reserve(count);
11595+ for (decltype(count) i = 0; i < count; i++) {
11596+ ret.insert({ FfiConverterString::read(stream), FfiConverterString::read(stream) });
11602+void FfiConverterMapStringString::write(RustStream &stream, const std::unordered_map<std::string, std::string> &val) {
11603+ stream << static_cast<int32_t>(val.size());
11605+ for (auto &entry : val) {
11606+ FfiConverterString::write(stream, entry.first);
11607+ FfiConverterString::write(stream, entry.second);
11611+uint64_t FfiConverterMapStringString::allocation_size(const std::unordered_map<std::string, std::string> &val) {
11612+ uint64_t size = sizeof(int32_t);
11614+ for (auto &entry : val) {
11615+ size += FfiConverterString::allocation_size(entry.first);
11616+ size += FfiConverterString::allocation_size(entry.second);
11629+ParsedTonTransferLink parse_ton_transfer_link(const std::string &value) {
11631+ uniffi::rust_call(
11632+ uniffi_wallet_engine_fn_func_parse_ton_transfer_link,
11633+ uniffi::FfiConverterTonTransferLinkError::lift, uniffi::FfiConverterString::lower(value));
11635+ return uniffi::FfiConverterTypeParsedTonTransferLink::lift(ret);
11639+TonConnectManifest parse_ton_connect_manifest(const std::string &json) {
11641+ uniffi::rust_call(
11642+ uniffi_wallet_engine_fn_func_parse_ton_connect_manifest,
11643+ uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(json));
11645+ return uniffi::FfiConverterTypeTonConnectManifest::lift(ret);
11649+std::shared_ptr<TonConnectSession> ton_connect_session_from_link(const std::string &link, const TonConnectSessionConfig &config) {
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));
11655+ return uniffi::FfiConverterTonConnectSession::lift(ret);
11659+std::shared_ptr<TonConnectSession> ton_connect_session_restore(const std::string &persisted, const TonConnectSessionConfig &config) {
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));
11665+ return uniffi::FfiConverterTonConnectSession::lift(ret);
11669+std::string convert_ton_address(const std::string &value, TonAddressFormat format) {
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));
11675+ return uniffi::FfiConverterString::lift(ret);
11679+bool is_valid_ton_address(const std::string &value) {
11681+ uniffi::rust_call(
11682+ uniffi_wallet_engine_fn_func_is_valid_ton_address,
11683+ nullptr, uniffi::FfiConverterString::lower(value));
11685+ return uniffi::FfiConverterBool::lift(ret);
11689+TonAddressInfo parse_ton_address(const std::string &value) {
11691+ uniffi::rust_call(
11692+ uniffi_wallet_engine_fn_func_parse_ton_address,
11693+ uniffi::FfiConverterTonAddressError::lift, uniffi::FfiConverterString::lower(value));
11695+ return uniffi::FfiConverterTypeTonAddressInfo::lift(ret);
11699+std::vector<std::string> mnemonic_wordlist() {
11701+ uniffi::rust_call(
11702+ uniffi_wallet_engine_fn_func_mnemonic_wordlist,
11705+ return uniffi::FfiConverterSequenceString::lift(ret);
11709+std::vector<MnemonicScheme> detect_mnemonic_schemes(const std::vector<std::string> &words) {
11711+ uniffi::rust_call(
11712+ uniffi_wallet_engine_fn_func_detect_mnemonic_schemes,
11713+ nullptr, uniffi::FfiConverterSequenceString::lower(words));
11715+ return uniffi::FfiConverterSequenceMnemonicScheme::lift(ret);
11719+std::vector<uint8_t> rotation_mnemonic_public_key(const std::string &phrase) {
11721+ uniffi::rust_call(
11722+ uniffi_wallet_engine_fn_func_rotation_mnemonic_public_key,
11723+ uniffi::FfiConverterWalletLifecycleError::lift, uniffi::FfiConverterString::lower(phrase));
11725+ return uniffi::FfiConverterBytes::lift(ret);
11727+} // namespace wallet_engine