on main help sign in
Forkgram 13.0.2 snapshot

Source: https://github.com/forkgram/TelegramAndroid/commit/ea7d77101839af8ffa020cef11c6ebf522679e1d Forkgram-Commit: ea7d77101839af8ffa020cef11c6ebf522679e1d Forkgram-Version: 13.0.2 Telegram-Base: f32ffeec763f0bdbf4bec25b52d654f77bff733d (update to 13.0.2) Tree is Forkgram's dev branch at that commit with the .github folder removed.

commit4a3faebc6db8547ef88e23d1dec8c7750bc6aa95 authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> dateTue 13 Oct 2026, 22:53 (1 day ago) parenta263091
670 files changed+75706−67948
.gitmodules+12 Dockerfile−1 TMessagesProj/build.gradle+6−2 TMessagesProj/jni/CMakeLists.txt+44 TMessagesProj/jni/TgNetWrapper.cpp+3−2 TMessagesProj/jni/gram-wallet/.gitignore+1 TMessagesProj/jni/gram-wallet/Cargo.lock+2172 TMessagesProj/jni/gram-wallet/Cargo.toml+33 TMessagesProj/jni/gram-wallet/rust-toolchain.toml+3 TMessagesProj/jni/gram-wallet/src/lib.rs+92 TMessagesProj/jni/gram-wallet/src/ton_connect.rs+538 TMessagesProj/jni/gram-wallet/wallet-engine.patch+1018 TMessagesProj/jni/prebuild/build_all.sh+2 TMessagesProj/jni/prebuild/build_prisma.sh+67 TMessagesProj/jni/prebuild/build_wallet_engine.sh+137 TMessagesProj/jni/prebuild/include/wallet-engine/gram_wallet.cpp+386 TMessagesProj/jni/prebuild/include/wallet-engine/gram_wallet.hpp+228 TMessagesProj/jni/prebuild/include/wallet-engine/gram_wallet_scaffolding.hpp+188 TMessagesProj/jni/prebuild/include/wallet-engine/wallet_engine.cpp+11727 TMessagesProj/jni/prebuild/include/wallet-engine/wallet_engine.hpp+7015 TMessagesProj/jni/prebuild/include/wallet-engine/wallet_engine_scaffolding.hpp+433 TMessagesProj/jni/prebuild/lib/arm64-v8a/libiwasm.a TMessagesProj/jni/prebuild/lib/armeabi-v7a/libiwasm.a TMessagesProj/jni/prebuild/lib/x86/libiwasm.a TMessagesProj/jni/prebuild/lib/x86_64/libiwasm.a TMessagesProj/jni/prisma/CMakeLists.txt+44 TMessagesProj/jni/prisma/bridge/PrismaEngine.cpp+240 TMessagesProj/jni/prisma/bridge/PrismaEngine.h+36 TMessagesProj/jni/prisma/bridge/PrismaIncludes.h+10 TMessagesProj/jni/prisma/bridge/PrismaJni.cpp+182 TMessagesProj/jni/prisma/generate.js+502 TMessagesProj/jni/prisma/generate_prisma_grammars.sh+19 TMessagesProj/jni/prisma/libprisma/Highlight.cpp+33 TMessagesProj/jni/prisma/libprisma/Highlight.h+131 TMessagesProj/jni/prisma/libprisma/SyntaxHighlighter.cpp+207 TMessagesProj/jni/tde2e/bridge.cpp+50 TMessagesProj/jni/tgcalls+1 TMessagesProj/jni/tgnet/ConnectionsManager.cpp+39−5 TMessagesProj/jni/tgnet/ConnectionsManager.h+1−1 TMessagesProj/jni/tgnet/Defines.h+4−2 TMessagesProj/jni/tgnet/DownloadRequestBudget.h+33 TMessagesProj/jni/tgnet/Handshake.cpp+26−3 TMessagesProj/jni/tgnet/MTProtoScheme.h+1 TMessagesProj/jni/tgnet/TLSHello.cpp+1−1 TMessagesProj/jni/third_party/boost-regex+1 TMessagesProj/jni/third_party/libprisma+1 TMessagesProj/jni/tlottie+1−1 TMessagesProj/jni/voip/CMakeLists.txt+82−79 TMessagesProj/jni/voip/org_telegram_messenger_voip_Instance.cpp+1−1 TMessagesProj/jni/voip/tgcalls/AudioDeviceHelper.cpp−142 TMessagesProj/jni/voip/tgcalls/AudioDeviceHelper.h−17 TMessagesProj/jni/voip/tgcalls/AudioFrame.h−17 TMessagesProj/jni/voip/tgcalls/ChannelManager.cpp−161 TMessagesProj/jni/voip/tgcalls/ChannelManager.h−95 TMessagesProj/jni/voip/tgcalls/CodecSelectHelper.cpp−303 TMessagesProj/jni/voip/tgcalls/CodecSelectHelper.h−32 TMessagesProj/jni/voip/tgcalls/CryptoHelper.cpp−61 TMessagesProj/jni/voip/tgcalls/CryptoHelper.h−69 TMessagesProj/jni/voip/tgcalls/DirectConnectionChannel.h−22 TMessagesProj/jni/voip/tgcalls/EncryptedConnection.cpp−808 TMessagesProj/jni/voip/tgcalls/EncryptedConnection.h−113 TMessagesProj/jni/voip/tgcalls/FakeAudioDeviceModule.cpp−257 TMessagesProj/jni/voip/tgcalls/FakeAudioDeviceModule.h−55 TMessagesProj/jni/voip/tgcalls/FakeVideoTrackSource.cpp−173 TMessagesProj/jni/voip/tgcalls/FakeVideoTrackSource.h−36 TMessagesProj/jni/voip/tgcalls/FieldTrialsConfig.cpp−7 TMessagesProj/jni/voip/tgcalls/FieldTrialsConfig.h−12 TMessagesProj/jni/voip/tgcalls/Instance.cpp−66 TMessagesProj/jni/voip/tgcalls/Instance.h−293 TMessagesProj/jni/voip/tgcalls/InstanceImpl.cpp−202 TMessagesProj/jni/voip/tgcalls/InstanceImpl.h−57 TMessagesProj/jni/voip/tgcalls/LogSinkImpl.cpp−71 TMessagesProj/jni/voip/tgcalls/LogSinkImpl.h−31 TMessagesProj/jni/voip/tgcalls/Manager.cpp−465 TMessagesProj/jni/voip/tgcalls/Manager.h−94 TMessagesProj/jni/voip/tgcalls/MediaManager.cpp−1173 TMessagesProj/jni/voip/tgcalls/MediaManager.h−195 TMessagesProj/jni/voip/tgcalls/Message.cpp−406 TMessagesProj/jni/voip/tgcalls/Message.h−149 TMessagesProj/jni/voip/tgcalls/NetworkManager.cpp−397 TMessagesProj/jni/voip/tgcalls/NetworkManager.h−123 TMessagesProj/jni/voip/tgcalls/PlatformContext.h−15 TMessagesProj/jni/voip/tgcalls/SctpDataChannelProviderInterfaceImpl.cpp−160 TMessagesProj/jni/voip/tgcalls/SctpDataChannelProviderInterfaceImpl.h−74 TMessagesProj/jni/voip/tgcalls/StaticThreads.cpp−144 TMessagesProj/jni/voip/tgcalls/StaticThreads.h−31 TMessagesProj/jni/voip/tgcalls/Stats.h−30 TMessagesProj/jni/voip/tgcalls/ThreadLocalObject.cpp−1 TMessagesProj/jni/voip/tgcalls/ThreadLocalObject.h−58 TMessagesProj/jni/voip/tgcalls/TurnCustomizerImpl.cpp−21 TMessagesProj/jni/voip/tgcalls/TurnCustomizerImpl.h−19 TMessagesProj/jni/voip/tgcalls/VideoCaptureInterface.cpp−15 TMessagesProj/jni/voip/tgcalls/VideoCaptureInterface.h−62 TMessagesProj/jni/voip/tgcalls/VideoCaptureInterfaceImpl.cpp−227 TMessagesProj/jni/voip/tgcalls/VideoCaptureInterfaceImpl.h−76 TMessagesProj/jni/voip/tgcalls/VideoCapturerInterface.h−42 TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSource.cpp−68 TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSource.h−85 TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceHelper.cpp−461 TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceHelper.h−56 TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceManager.cpp−65 TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceManager.h−49 TMessagesProj/jni/voip/tgcalls/group/AVIOContextImpl.cpp−64 TMessagesProj/jni/voip/tgcalls/group/AVIOContextImpl.h−40 TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPart.cpp−181 TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPart.h−45 TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartInternal.cpp−404 TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartInternal.h−65 TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp−138 TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartPersistentDecoder.h−51 TMessagesProj/jni/voip/tgcalls/group/GroupAudioCapturePostProcessor.cpp−198 TMessagesProj/jni/voip/tgcalls/group/GroupAudioCapturePostProcessor.h−91 TMessagesProj/jni/voip/tgcalls/group/GroupFrameTransformer.cpp−574 TMessagesProj/jni/voip/tgcalls/group/GroupFrameTransformer.h−156 TMessagesProj/jni/voip/tgcalls/group/GroupFrameTransformerTest.cpp−255 TMessagesProj/jni/voip/tgcalls/group/GroupInstanceCustomImpl.cpp−3949 TMessagesProj/jni/voip/tgcalls/group/GroupInstanceCustomImpl.h−60 TMessagesProj/jni/voip/tgcalls/group/GroupInstanceImpl.h−239 TMessagesProj/jni/voip/tgcalls/group/GroupInstanceReferenceImpl.cpp−2538 TMessagesProj/jni/voip/tgcalls/group/GroupInstanceReferenceImpl.h−58 TMessagesProj/jni/voip/tgcalls/group/GroupJoinPayload.h−78 TMessagesProj/jni/voip/tgcalls/group/GroupJoinPayloadInternal.cpp−373 TMessagesProj/jni/voip/tgcalls/group/GroupJoinPayloadInternal.h−32 TMessagesProj/jni/voip/tgcalls/group/GroupNetworkManager.cpp−680 TMessagesProj/jni/voip/tgcalls/group/GroupNetworkManager.h−134 TMessagesProj/jni/voip/tgcalls/group/StreamingAudioRenderer.cpp−53 TMessagesProj/jni/voip/tgcalls/group/StreamingAudioRenderer.h−49 TMessagesProj/jni/voip/tgcalls/group/StreamingAudioRendererTest.cpp−125 TMessagesProj/jni/voip/tgcalls/group/StreamingMediaContext.cpp−1106 TMessagesProj/jni/voip/tgcalls/group/StreamingMediaContext.h−53 TMessagesProj/jni/voip/tgcalls/group/VideoStreamingPart.cpp−925 TMessagesProj/jni/voip/tgcalls/group/VideoStreamingPart.h−78 TMessagesProj/jni/voip/tgcalls/platform/PlatformInterface.h−364 TMessagesProj/jni/voip/tgcalls/platform/android/AndroidContext.cpp−61 TMessagesProj/jni/voip/tgcalls/platform/android/AndroidContext.h−39 TMessagesProj/jni/voip/tgcalls/platform/android/AndroidInterface.cpp−167 TMessagesProj/jni/voip/tgcalls/platform/android/AndroidInterface.h−29 TMessagesProj/jni/voip/tgcalls/platform/android/VideoCameraCapturer.cpp−62 TMessagesProj/jni/voip/tgcalls/platform/android/VideoCameraCapturer.h−45 TMessagesProj/jni/voip/tgcalls/platform/android/VideoCapturerInterfaceImpl.cpp−31 TMessagesProj/jni/voip/tgcalls/platform/android/VideoCapturerInterfaceImpl.h−27 TMessagesProj/jni/voip/tgcalls/platform/darwin/AudioDeviceModuleIOS.h−40 TMessagesProj/jni/voip/tgcalls/platform/darwin/AudioDeviceModuleMacos.h−32 TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomExternalCapturer.h−22 TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomExternalCapturer.mm−90 TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomSimulcastEncoderAdapter.cpp−1017 TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomSimulcastEncoderAdapter.h−201 TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinFFMpeg.h−13 TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinFFMpeg.mm−45 TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinInterface.h−40 TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinInterface.mm−158 TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinVideoSource.h−57 TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinVideoSource.mm−165 TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopCaptureSourceViewMac.h−55 TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopCaptureSourceViewMac.mm−207 TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopSharingCapturer.h−27 TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopSharingCapturer.mm−117 TMessagesProj/jni/voip/tgcalls/platform/darwin/ExtractCVPixelBuffer.h−12 TMessagesProj/jni/voip/tgcalls/platform/darwin/ExtractCVPixelBuffer.mm−14 TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCCodecSpecificInfoH265+Private.h−25 TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCCodecSpecificInfoH265.h−28 TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCCodecSpecificInfoH265.mm−27 TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCH265ProfileLevelId.h−16 TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCH265ProfileLevelId.mm−18 TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueue.h−19 TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueue.m−124 TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueueLocalObject.h−19 TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueueLocalObject.m−40 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIOCapturer.h−29 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIOCapturer.m−45 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIODevice.h−31 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIODevice.mm−193 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCCVPixelBuffer.h−15 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCCVPixelBuffer.mm−28 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.h−25 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm−116 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.h−32 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm−172 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH264.h−18 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH264.mm−292 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH265.h−23 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH265.mm−359 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH264.h−22 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH264.mm−852 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH265.h−40 TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH265.mm−624 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCMIOCapture.h−18 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCMIOCapture.mm−237 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturer.h−33 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturer.mm−941 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturerMac.h−35 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturerMac.mm−725 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCaptureView.h−33 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCaptureView.mm−264 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCapturerInterfaceImpl.h−41 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCapturerInterfaceImpl.mm−480 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalView.h−37 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalView.mm−459 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalViewMac.h−41 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalViewMac.mm−503 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferView.h−35 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferView.mm−786 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferViewMac.h−36 TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferViewMac.mm−427 TMessagesProj/jni/voip/tgcalls/platform/darwin/h264_encoder_impl.cpp−349 TMessagesProj/jni/voip/tgcalls/platform/darwin/h264_encoder_impl.h−81 TMessagesProj/jni/voip/tgcalls/platform/darwin/h265_nalu_rewriter.cc−406 TMessagesProj/jni/voip/tgcalls/platform/darwin/h265_nalu_rewriter.h−54 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/CallAudioTone.h−48 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession+Configuration.mm−184 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession+Private.h−95 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession.h−266 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession.mm−1000 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSessionConfiguration.h−47 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSessionConfiguration.mm−137 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCNativeAudioSessionDelegateAdapter.h−33 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCNativeAudioSessionDelegateAdapter.mm−89 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_ios.h−329 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_ios.mm−1210 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_module_ios.h−161 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_module_ios.mm−756 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_voice_processing_audio_unit.h−149 TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_voice_processing_audio_unit.mm−544 TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLI420Renderer.h−17 TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLI420Renderer.mm−111 TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLRenderer+Private.h−33 TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLRenderer.h−49 TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLRenderer.mm−647 TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMetalContextHolder.h−25 TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMetalContextHolder.m−136 TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_decoder_factory.h−41 TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_decoder_factory.mm−126 TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_encoder_factory.h−61 TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_encoder_factory.mm−240 TMessagesProj/jni/voip/tgcalls/platform/fake/FakeInterface.cpp−172 TMessagesProj/jni/voip/tgcalls/platform/fake/FakeInterface.h−30 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/DesktopInterface.cpp−56 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/DesktopInterface.h−22 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCameraCapturer.cpp−253 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCameraCapturer.h−57 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerInterfaceImpl.cpp−145 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerInterfaceImpl.h−55 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerTrackSource.cpp−19 TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerTrackSource.h−30 TMessagesProj/jni/voip/tgcalls/platform/uwp/UwpContext.h−28 TMessagesProj/jni/voip/tgcalls/platform/uwp/UwpScreenCapturer.cpp−397 TMessagesProj/jni/voip/tgcalls/platform/uwp/UwpScreenCapturer.h−84 TMessagesProj/jni/voip/tgcalls/third-party/json11.cpp−791 TMessagesProj/jni/voip/tgcalls/third-party/json11.hpp−232 TMessagesProj/jni/voip/tgcalls/utils/gzip.cpp−183 TMessagesProj/jni/voip/tgcalls/utils/gzip.h−16 TMessagesProj/jni/voip/tgcalls/v2/ContentNegotiation.cpp−649 TMessagesProj/jni/voip/tgcalls/v2/ContentNegotiation.h−100 TMessagesProj/jni/voip/tgcalls/v2/CustomDcSctpSocket.cpp−1827 TMessagesProj/jni/voip/tgcalls/v2/CustomDcSctpSocket.h−301 TMessagesProj/jni/voip/tgcalls/v2/CustomParameters.h−48 TMessagesProj/jni/voip/tgcalls/v2/DirectNetworkingImpl.cpp−600 TMessagesProj/jni/voip/tgcalls/v2/DirectNetworkingImpl.h−120 TMessagesProj/jni/voip/tgcalls/v2/ExternalSignalingConnection.cpp−30 TMessagesProj/jni/voip/tgcalls/v2/ExternalSignalingConnection.h−33 TMessagesProj/jni/voip/tgcalls/v2/InstanceNetworking.h−173 TMessagesProj/jni/voip/tgcalls/v2/InstanceV2CompatImpl.cpp−1733 TMessagesProj/jni/voip/tgcalls/v2/InstanceV2CompatImpl.h−62 TMessagesProj/jni/voip/tgcalls/v2/InstanceV2Impl.cpp−2412 TMessagesProj/jni/voip/tgcalls/v2/InstanceV2Impl.h−60 TMessagesProj/jni/voip/tgcalls/v2/InstanceV2ReferenceImpl.cpp−2054 TMessagesProj/jni/voip/tgcalls/v2/InstanceV2ReferenceImpl.h−60 TMessagesProj/jni/voip/tgcalls/v2/MtProtoIceTransport.cpp−338 TMessagesProj/jni/voip/tgcalls/v2/MtProtoIceTransport.h−110 TMessagesProj/jni/voip/tgcalls/v2/MtProtoIceTransportTest.cpp−471 TMessagesProj/jni/voip/tgcalls/v2/NativeNetworkingImpl.cpp−1062 TMessagesProj/jni/voip/tgcalls/v2/NativeNetworkingImpl.h−143 TMessagesProj/jni/voip/tgcalls/v2/RawTcpSocket.cpp−111 TMessagesProj/jni/voip/tgcalls/v2/RawTcpSocket.h−53 TMessagesProj/jni/voip/tgcalls/v2/ReflectorPort.cpp−965 TMessagesProj/jni/voip/tgcalls/v2/ReflectorPort.h−256 TMessagesProj/jni/voip/tgcalls/v2/ReflectorRelayPortFactory.cpp−82 TMessagesProj/jni/voip/tgcalls/v2/ReflectorRelayPortFactory.h−39 TMessagesProj/jni/voip/tgcalls/v2/Signaling.cpp−988 TMessagesProj/jni/voip/tgcalls/v2/Signaling.h−196 TMessagesProj/jni/voip/tgcalls/v2/SignalingConnection.cpp−8 TMessagesProj/jni/voip/tgcalls/v2/SignalingConnection.h−27 TMessagesProj/jni/voip/tgcalls/v2/SignalingEncryption.cpp−22 TMessagesProj/jni/voip/tgcalls/v2/SignalingEncryption.h−24 TMessagesProj/jni/voip/tgcalls/v2/SignalingSctpConnection.cpp−234 TMessagesProj/jni/voip/tgcalls/v2/SignalingSctpConnection.h−85 TMessagesProj/jni/voip/tgcalls/v2/SignalingTranslator.cpp−271 TMessagesProj/jni/voip/tgcalls/v2/SignalingTranslator.h−70 TMessagesProj/jni/voip/tgcalls/v2_4_0_0/Signaling_4_0_0.cpp−703 TMessagesProj/jni/voip/tgcalls/v2_4_0_0/Signaling_4_0_0.h−106 TMessagesProj/jni/voip/tgcalls/v2wasm/CLAUDE.md−157 TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreABI.h−240 TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreBackend.h−28 TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreHost.cpp−1794 TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreHost.h−176 TMessagesProj/jni/voip/tgcalls/v2wasm/CoreBase64.h−98 TMessagesProj/jni/voip/tgcalls/v2wasm/CoreFactory.h−24 TMessagesProj/jni/voip/tgcalls/v2wasm/CoreGzip.cpp−46 TMessagesProj/jni/voip/tgcalls/v2wasm/CoreGzip.h−29 TMessagesProj/jni/voip/tgcalls/v2wasm/EmbeddedCoreModule.h−21 TMessagesProj/jni/voip/tgcalls/v2wasm/HostCompressionService.cpp−44 TMessagesProj/jni/voip/tgcalls/v2wasm/InstanceV2PumpImpl.cpp−148 TMessagesProj/jni/voip/tgcalls/v2wasm/InstanceV2PumpImpl.h−59 TMessagesProj/jni/voip/tgcalls/v2wasm/NativeCoreBackend.cpp−33 TMessagesProj/jni/voip/tgcalls/v2wasm/NativeCoreBackend.h−26 TMessagesProj/jni/voip/tgcalls/v2wasm/ReferenceCallCore.cpp−663 TMessagesProj/jni/voip/tgcalls/v2wasm/ReferenceCallCore.h−111 TMessagesProj/jni/voip/tgcalls/v2wasm/SignalingFraming.cpp−61 TMessagesProj/jni/voip/tgcalls/v2wasm/SignalingFraming.h−42 TMessagesProj/jni/voip/tgcalls/v2wasm/VariantCallCore.cpp−234 TMessagesProj/jni/voip/tgcalls/v2wasm/VariantCallCore.h−51 TMessagesProj/jni/voip/tgcalls/v2wasm/WamrCoreBackend.cpp−223 TMessagesProj/jni/voip/tgcalls/v2wasm/WamrCoreBackend.h−63 TMessagesProj/jni/voip/tgcalls/v2wasm/reference_core_factory.cpp−14 TMessagesProj/jni/voip/tgcalls/v2wasm/variant_core_factory.cpp−15 TMessagesProj/jni/voip/tgcalls/v2wasm/wasm_module_entry.cpp−61 TMessagesProj/jni/voip/webrtc/common_video/h265/h265_bitstream_parser.cc+38−14 TMessagesProj/jni/voip/webrtc/common_video/h265/h265_sps_parser.cc+2 TMessagesProj/jni/wallet-engine+1 TMessagesProj/jni/wallet/GramWalletAdapter.cpp+22 TMessagesProj/jni/wallet/GramWalletAdapter.h+11 TMessagesProj/jni/wallet/WalletEngineBridge.cpp+1395 TMessagesProj/jni/wallet/WalletJournal.h+104 TMessagesProj/proguard-rules.pro+4 TMessagesProj/src/main/AndroidManifest.xml+12 TMessagesProj/src/main/assets/darkblue.attheme+1 TMessagesProj/src/main/assets/fonts/currency_symbols.txt+95 TMessagesProj/src/main/assets/fonts/gram.ttf TMessagesProj/src/main/assets/fonts/rmono_var.ttf TMessagesProj/src/main/assets/grammars.dat TMessagesProj/src/main/assets/models/card.binobj TMessagesProj/src/main/assets/models/card.obj+227 TMessagesProj/src/main/assets/models/card_back.binobj TMessagesProj/src/main/assets/models/card_edge.binobj TMessagesProj/src/main/assets/models/card_front.binobj TMessagesProj/src/main/assets/models/diamond.binobj TMessagesProj/src/main/assets/models/diamond_ios/anchors.bin TMessagesProj/src/main/assets/models/diamond_ios/camera.bin TMessagesProj/src/main/assets/models/diamond_ios/facetProjection.bin+1 TMessagesProj/src/main/assets/models/diamond_ios/frames.bin TMessagesProj/src/main/assets/models/diamond_ios/main.bin TMessagesProj/src/main/assets/models/diamond_ios/planes.bin TMessagesProj/src/main/assets/models/diamond_ios/small.bin TMessagesProj/src/main/assets/models/diamond_ios/vertices.bin TMessagesProj/src/main/assets/models/diamond_ios/widths.bin TMessagesProj/src/main/assets/models/diamond_outer.binobj TMessagesProj/src/main/assets/models/diamond_outer_2.binobj TMessagesProj/src/main/assets/night.attheme+1 TMessagesProj/src/main/assets/shaders/diamond/copyFragment.glsl+4 TMessagesProj/src/main/assets/shaders/diamond/diamondFragment.glsl+699 TMessagesProj/src/main/assets/shaders/diamond/diamondVertex.glsl+69 TMessagesProj/src/main/assets/shaders/diamond/fullscreenVertex.glsl+7 TMessagesProj/src/main/assets/shaders/diamond/sparkleFragment.glsl+92 TMessagesProj/src/main/assets/shaders/diamond/sparkleVertex.glsl+97 TMessagesProj/src/main/assets/shaders/fragment5.glsl−99 TMessagesProj/src/main/assets/shaders/wallet_card_content_fragment.glsl+17 TMessagesProj/src/main/assets/shaders/wallet_card_diamond_fragment.glsl+56 TMessagesProj/src/main/assets/shaders/wallet_card_fragment.glsl+1064 TMessagesProj/src/main/assets/shaders/wallet_card_vertex.glsl+74 TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java+11−1 TMessagesProj/src/main/java/org/telegram/messenger/AppGlobalConfig.java+69 TMessagesProj/src/main/java/org/telegram/messenger/Bitmaps.java+1−14 TMessagesProj/src/main/java/org/telegram/messenger/CodeHighlighting.java−838 TMessagesProj/src/main/java/org/telegram/messenger/DialogObject.java+1−1 TMessagesProj/src/main/java/org/telegram/messenger/DispatchQueueMainThreadSync.java−169 TMessagesProj/src/main/java/org/telegram/messenger/DownloadRequestPacer.java+17 TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java+60−9 TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java+85−67 TMessagesProj/src/main/java/org/telegram/messenger/ImageLoader.java+80−50 TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java+3−3 TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java+186−23 TMessagesProj/src/main/java/org/telegram/messenger/MessageCustomParamsHelper.java+12 TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java+48−2 TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java+92−36 TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java+2 TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java+60−2 TMessagesProj/src/main/java/org/telegram/messenger/PasskeysController.java+3−1 TMessagesProj/src/main/java/org/telegram/messenger/PushListenerController.java+122−2 TMessagesProj/src/main/java/org/telegram/messenger/RichMessageLayout.java+10−2 TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java+158 TMessagesProj/src/main/java/org/telegram/messenger/SharedConfig.java+4 TMessagesProj/src/main/java/org/telegram/messenger/TelegramQRCodeWriter.java+14−3 TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java+1−2 TMessagesProj/src/main/java/org/telegram/messenger/camera/CameraController.java+3−4 TMessagesProj/src/main/java/org/telegram/messenger/utils/BillingUtilities.java+50 TMessagesProj/src/main/java/org/telegram/messenger/utils/Choreographer60FpsContent.java+80−44 TMessagesProj/src/main/java/org/telegram/messenger/utils/CopyUtilities.java+1−2 TMessagesProj/src/main/java/org/telegram/messenger/utils/CustomHtml.java+7−1 TMessagesProj/src/main/java/org/telegram/messenger/utils/tlutils/TlUtils.java+19 TMessagesProj/src/main/java/org/telegram/messenger/video/TextureRenderer.java+3−2 TMessagesProj/src/main/java/org/telegram/messenger/voip/ConferenceCall.java+5 TMessagesProj/src/main/java/org/telegram/messenger/voip/GroupCallMessagesController.java+2−2 TMessagesProj/src/main/java/org/telegram/messenger/voip/VoIPService.java+61−36 TMessagesProj/src/main/java/org/telegram/messenger/voip/VoipAudioManager.java+84−2 TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java+20−4 TMessagesProj/src/main/java/org/telegram/tgnet/TLClassStore.java+1−9 TMessagesProj/src/main/java/org/telegram/tgnet/TLParseException.java+1−1 TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java+494−45 TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_account.java+4−4 TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_bots.java+68−8 TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_iv.java+15−1 TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_toncenter.java+540 TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_update.java+109 TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_wallet.java+1760 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java+10−2 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java+10 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/AdjustPanLayoutHelper.java+1 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/AlertDialog.java+7 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BottomSheetTabs.java+5 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/INavigationLayout.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MessageDrawable.java+15−5 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java+7−1 TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ThemeColors.java+6 TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java+18 TMessagesProj/src/main/java/org/telegram/ui/ArticleViewer.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/Business/ChatAttachAlertQuickRepliesLayout.java+6 TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java+273−38 TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java+10−4 TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java+54−1 TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java+2−2 TMessagesProj/src/main/java/org/telegram/ui/Cells/StickerSetCell.java+2−2 TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java+11−4 TMessagesProj/src/main/java/org/telegram/ui/Cells/UserInfoCell.java+2−11 TMessagesProj/src/main/java/org/telegram/ui/ChannelMonetizationLayout.java+4−2 TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java+277−57 TMessagesProj/src/main/java/org/telegram/ui/Components/AIEditorAlert.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/Components/AnimatedTextView.java+173−52 TMessagesProj/src/main/java/org/telegram/ui/Components/BottomSheetWithRecyclerListView.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/Components/BulletinFactory.java+27 TMessagesProj/src/main/java/org/telegram/ui/Components/ButtonBounce.java+28−2 TMessagesProj/src/main/java/org/telegram/ui/Components/ButtonSpan.java+13−9 TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlert.java+153−33 TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertAudioLayout.java+13−13 TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertGramLayout.java+1782 TMessagesProj/src/main/java/org/telegram/ui/Components/ColoredImageSpan.java+10−5 TMessagesProj/src/main/java/org/telegram/ui/Components/CreateBotAlert.java+218−62 TMessagesProj/src/main/java/org/telegram/ui/Components/EdgeEffectTrackerFactory.java+7 TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java+6−2 TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextCaption.java+1−3 TMessagesProj/src/main/java/org/telegram/ui/Components/EllipsizeSpanAnimator.java+3 TMessagesProj/src/main/java/org/telegram/ui/Components/FlickerLoadingView.java+44−1 TMessagesProj/src/main/java/org/telegram/ui/Components/ForegroundDetector.java+29 TMessagesProj/src/main/java/org/telegram/ui/Components/FragmentContextView.java+11−11 TMessagesProj/src/main/java/org/telegram/ui/Components/HintsController.java+1 TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView.java+63−1 TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView2.java+127−18 TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraViewBase.java+7−11 TMessagesProj/src/main/java/org/telegram/ui/Components/ItemOptions.java+11 TMessagesProj/src/main/java/org/telegram/ui/Components/LoadingDrawable.java+22−7 TMessagesProj/src/main/java/org/telegram/ui/Components/Paint/Views/MessageEntityView.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/Components/PasscodeView.java+106−209 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/CoolDiamondIcon.java+383 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/DiamondProgram.java+9 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/DiamondRenderer.java+325 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/DiamondSurfaceView.java+400 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/GLIconRenderer.java+16−3 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/GLIconTextureView.java+219−88 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/GLProgramCache.java+143 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/Icon3D.java+34−41 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/ObjLoader.java+24−47 TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/WalletDiamondTextureView.java+352 TMessagesProj/src/main/java/org/telegram/ui/Components/RLottieNative.java+2−14 TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java+10−1 TMessagesProj/src/main/java/org/telegram/ui/Components/TableLayout.java+15−1 TMessagesProj/src/main/java/org/telegram/ui/Components/TableView.java+39−9 TMessagesProj/src/main/java/org/telegram/ui/Components/UItem.java+8 TMessagesProj/src/main/java/org/telegram/ui/Components/UniversalAdapter.java+1 TMessagesProj/src/main/java/org/telegram/ui/Components/blur3/BlurredBackgroundDrawableViewFactory.java+7−1 TMessagesProj/src/main/java/org/telegram/ui/Components/blur3/drawable/color/BlurredBackgroundProviderBuilder.java+2−2 TMessagesProj/src/main/java/org/telegram/ui/Components/glass/GlassTabView.java+1 TMessagesProj/src/main/java/org/telegram/ui/Components/inset/WindowInsetsStateHolder.java+8−1 TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java+45−9 TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java+28−21 TMessagesProj/src/main/java/org/telegram/ui/FragmentUsernameBottomSheet.java+1 TMessagesProj/src/main/java/org/telegram/ui/Gifts/GiftSheet.java+61−5 TMessagesProj/src/main/java/org/telegram/ui/GradientHeaderActivity.java+4 TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java+9 TMessagesProj/src/main/java/org/telegram/ui/LinkManager.java+300 TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java+18−6 TMessagesProj/src/main/java/org/telegram/ui/LogoutActivity.java+45−22 TMessagesProj/src/main/java/org/telegram/ui/MainTabsActivity.java+1 TMessagesProj/src/main/java/org/telegram/ui/OAuthSheet.java+82−18 TMessagesProj/src/main/java/org/telegram/ui/PasscodeActivity.java+83−17 TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java+2−3 TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java+32−11 TMessagesProj/src/main/java/org/telegram/ui/PremiumPreviewFragment.java+11 TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java+9−2 TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java+27−16 TMessagesProj/src/main/java/org/telegram/ui/Stars/BotStarsActivity.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/Stars/GiftOfferSheet.java−1 TMessagesProj/src/main/java/org/telegram/ui/Stars/MessageSuggestionOfferSheet.java−1 TMessagesProj/src/main/java/org/telegram/ui/Stars/SellGiftEnterPriceSheet.java−1 TMessagesProj/src/main/java/org/telegram/ui/Stars/StarsIntroActivity.java+8−4 TMessagesProj/src/main/java/org/telegram/ui/Stories/DarkThemeResourceProvider.java+2 TMessagesProj/src/main/java/org/telegram/ui/Stories/UploadingDotsSpannable.java+35−5 TMessagesProj/src/main/java/org/telegram/ui/Stories/recorder/ButtonWithCounterView.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/StoryCellFactory.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/TON/TONIntroActivity.java+16−19 TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/Wallet/CollectibleCell.java+247 TMessagesProj/src/main/java/org/telegram/ui/Wallet/CurrenciesController.java+300 TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWallet.java+3207 TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletDns.java+52 TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletPolling.java+101 TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletStorage.java+716 TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletStorageAuth.java+201 TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletStreaming.java+354 TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletTonConnect.java+1899 TMessagesProj/src/main/java/org/telegram/ui/Wallet/NavBottomSheet.java+331 TMessagesProj/src/main/java/org/telegram/ui/Wallet/NewBottomSheet.java+122 TMessagesProj/src/main/java/org/telegram/ui/Wallet/PasswordRequest.java+298 TMessagesProj/src/main/java/org/telegram/ui/Wallet/TransactionCell.java+730 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletActionLayout.java+1056 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletActivity.java+3993 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCard2DView.java+1057 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCard3D.java+816 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardComponent.java+645 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardFlecks.java+321 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardFrameHistory.java+29 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardGLRenderer.java+401 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardGeometry.java+27 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardMotion.java+98 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardQrBounds.java+96 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardTiltBaseline.java+105 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardView.java+794 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletChatSendTransition.java+309 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletDiamondView.java+670 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletEngine2.java+1588 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletImportFragment.java+419 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletKeysBackupFragment.java+820 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletRecipientView.java+409 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSecretPhraseFragment.java+178 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendEnterAmount.java+2224 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendParticles.java+125 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendSelectSender.java+851 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendTransition.java+273 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletTestPhraseFragment.java+230 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletTonConnectSessionsFragment.java+290 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletTransactionAmountView.java+130 TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletWordCell.java+556 TMessagesProj/src/main/java/org/telegram/ui/bots/BotWebViewSheet.java+68−20 TMessagesProj/src/main/java/org/telegram/ui/iv/RichEditor.java+9 TMessagesProj/src/main/java/org/telegram/ui/iv/RichEditorListView.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/iv/RichMessageConvert.java+1−1 TMessagesProj/src/main/java/org/telegram/ui/iv/RichTextCell.java+1−1 TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoCameraController.java+1113−44 TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoGlProcessor.java+309−23 TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoMp4Writer.java+130−26 TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoOverlayRenderer.java+10 TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoSession.java+26−2 TMessagesProj/src/main/java/org/telegram/utils/code/highlight/CodeHighlighting.java+558 TMessagesProj/src/main/java/org/telegram/utils/code/highlight/PrismaHighlighter.java+222 TMessagesProj/src/main/java/org/telegram/utils/code/highlight/PrismaHighlightingService.java+311 TMessagesProj/src/main/java/org/telegram/utils/code/highlight/PrismaTokenStyles.java+186 TMessagesProj/src/main/java/org/telegram/utils/localization/Localization.java+11 TMessagesProj/src/main/java/org/telegram/utils/proxy/WebProxyTransport.java+139−7 TMessagesProj/src/main/java/org/telegram/utils/settings/BooleanSetting.java+26−12 TMessagesProj/src/main/java/org/telegram/utils/settings/SharedSettings.java+1−1 TMessagesProj/src/main/res/drawable-nodpi/wallet_action_card_gradient.webp TMessagesProj/src/main/res/drawable-nodpi/wallet_card_diamond.webp TMessagesProj/src/main/res/drawable/dialog_gram_transfer.xml+19 TMessagesProj/src/main/res/drawable/filled_gram_earnings.xml+12 TMessagesProj/src/main/res/drawable/ic_gram.xml+14 TMessagesProj/src/main/res/drawable/mini_gram_16.xml+14−5 TMessagesProj/src/main/res/drawable/mini_gram_24.xml+3 TMessagesProj/src/main/res/drawable/mini_gram_72.xml+14−5 TMessagesProj/src/main/res/drawable/scan_qr.xml+23 TMessagesProj/src/main/res/drawable/settings_wallet.xml+24−9 TMessagesProj/src/main/res/drawable/settings_wallet_dark.xml+47 TMessagesProj/src/main/res/drawable/verified2_bg.xml+13 TMessagesProj/src/main/res/drawable/verified2_fg.xml+14 TMessagesProj/src/main/res/drawable/wallet_apps.xml+11 TMessagesProj/src/main/res/drawable/wallet_buy.xml+11 TMessagesProj/src/main/res/drawable/wallet_card_info.xml+18 TMessagesProj/src/main/res/drawable/wallet_card_qr.xml+11 TMessagesProj/src/main/res/drawable/wallet_comment_locked.xml+13 TMessagesProj/src/main/res/drawable/wallet_comment_unlocked.xml+13 TMessagesProj/src/main/res/drawable/wallet_copy.xml+11 TMessagesProj/src/main/res/drawable/wallet_currency_exchange.xml+22 TMessagesProj/src/main/res/drawable/wallet_globe.xml+11 TMessagesProj/src/main/res/drawable/wallet_gram_14.xml+11 TMessagesProj/src/main/res/drawable/wallet_gram_large.xml+11 TMessagesProj/src/main/res/drawable/wallet_gram_small.xml+14 TMessagesProj/src/main/res/drawable/wallet_help.xml+11 TMessagesProj/src/main/res/drawable/wallet_intro_arrow.xml+17 TMessagesProj/src/main/res/drawable/wallet_intro_chats.xml+12 TMessagesProj/src/main/res/drawable/wallet_intro_options.xml+17 TMessagesProj/src/main/res/drawable/wallet_intro_store.xml+11 TMessagesProj/src/main/res/drawable/wallet_intro_telegram.xml+14 TMessagesProj/src/main/res/drawable/wallet_intro_trade.xml+25 TMessagesProj/src/main/res/drawable/wallet_key.xml+12 TMessagesProj/src/main/res/drawable/wallet_learn_fees.xml+19 TMessagesProj/src/main/res/drawable/wallet_learn_hidden.xml+12 TMessagesProj/src/main/res/drawable/wallet_learn_instant.xml+25 TMessagesProj/src/main/res/drawable/wallet_learn_protected.xml+14 TMessagesProj/src/main/res/drawable/wallet_learn_verified.xml+14 TMessagesProj/src/main/res/drawable/wallet_learn_warn.xml+11 TMessagesProj/src/main/res/drawable/wallet_lock.xml+11 TMessagesProj/src/main/res/drawable/wallet_nft.xml+11 TMessagesProj/src/main/res/drawable/wallet_nft_placeholder.xml+11 TMessagesProj/src/main/res/drawable/wallet_protect.xml+11 TMessagesProj/src/main/res/drawable/wallet_provider_moonpay.xml+11 TMessagesProj/src/main/res/drawable/wallet_provider_wallet.xml+14 TMessagesProj/src/main/res/drawable/wallet_sell.xml+11 TMessagesProj/src/main/res/drawable/wallet_tooltip_arrow.xml+13 TMessagesProj/src/main/res/drawable/wallet_transaction_in.xml+12 TMessagesProj/src/main/res/drawable/wallet_transaction_key.xml+12 TMessagesProj/src/main/res/drawable/wallet_transaction_out.xml+12 TMessagesProj/src/main/res/drawable/wallet_transaction_topup.xml+15 TMessagesProj/src/main/res/drawable/wallet_transaction_walt.xml+11 TMessagesProj/src/main/res/drawable/wallet_transfer.xml+16 TMessagesProj/src/main/res/raw/gram.json+1 TMessagesProj/src/main/res/raw/gram_reverse.json+1 TMessagesProj/src/main/res/raw/wallet_diamond_blue.json+1 TMessagesProj/src/main/res/raw/wallet_diamond_white.json+1 TMessagesProj/src/main/res/values/strings.xml+305−4 TMessagesProj_App/build.gradle+10−2 TMessagesProj_AppHuawei/build.gradle+7−2 TMessagesProj_AppStandalone/build.gradle+7−2 TMessagesProj_AppTests/build.gradle+11−1 TMessagesProj_AppTests/src/androidTest/kotlin/not_linked_classes.txt+2−1 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_BotVerification.kt+18−1 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_BotVerifierSettings.kt+28−1 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_CurrencyRate.kt+25 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_InputTonConnectOauthSession.kt+30 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_InputWalletReplacement.kt+43 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_MessageAction.kt+77 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_MessageEntity.kt+15 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampAvailability.kt+40 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampLimits.kt+32 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampMethodAvailability.kt+32 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampProviderInfo.kt+41 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampQuote.kt+43 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampSession.kt+29 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_RichText.kt+13 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectManifest.kt+34 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectNextEventId.kt+22 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectRequest.kt+45 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectSession.kt+55 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_Update.kt+92 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_UrlAuthResult.kt+9−1 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_Username.kt+4 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletOwnershipProof.kt+26 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletState.kt+63 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletTransaction.kt+59 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletTransactionPeer.kt+91 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletUserAddress.kt+37 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_payments_CurrencyRates.kt+22 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_toncenter_ApiResponse.kt+21 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_toncenter_StreamingUrl.kt+25 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_EncryptedSecretPhrasePart.kt+23 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_ExistingBalance.kt+32 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_HolderDc.kt+26 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_NftAttribute.kt+24 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_NftItem.kt+61 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_NftItems.kt+33 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_ProofChallenge.kt+27 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_SecretPhraseParts.kt+26 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_TonConnectChallenge.kt+26 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_TonConnectPending.kt+24 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_TonConnectSessions.kt+22 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_Transactions.kt+40 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_UserAddresses.kt+24 TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/test/generated/Test_All.kt+2354−1989 TMessagesProj_AppTests/tlscheme/229.json+1−1 TMessagesProj_AppTests/tlscheme/230.json+1−1 TMessagesProj_AppTests/tlscheme/231.json+1 buildSrc/src/main/kotlin/com/example/GenerateSchemeTask.kt+1−1 gradle.properties+2−2
.gitmodules+12
@@ -43,6 +43,18 @@
4343[submodule "TMessagesProj/jni/third_party/wamr"]
4444 path = TMessagesProj/jni/third_party/wamr
4545 url = https://github.com/wasm-micro-runtime/wasm-micro-runtime.git
46+[submodule "TMessagesProj/jni/tgcalls"]
47+ path = TMessagesProj/jni/tgcalls
48+ url = https://github.com/TelegramMessenger/tgcalls.git
49+[submodule "TMessagesProj/jni/wallet-engine"]
50+ path = TMessagesProj/jni/wallet-engine
51+ url = https://github.com/dkaraush/wallet-engine.git
52+[submodule "TMessagesProj/jni/third_party/boost-regex"]
53+ path = TMessagesProj/jni/third_party/boost-regex
54+ url = https://github.com/boostorg/regex.git
55+[submodule "TMessagesProj/jni/third_party/libprisma"]
56+ path = TMessagesProj/jni/third_party/libprisma
57+ url = https://github.com/TelegramMessenger/libprisma.git
4658[submodule "TMessagesProj/jni/libwebp"]
4759 path = TMessagesProj/jni/libwebp
4860 url = https://github.com/webmproject/libwebp
Dockerfile−1
@@ -39,7 +39,6 @@ CMD mkdir -p /home/source/TMessagesProj/build/outputs/apk && \
3939 cp -R /home/source/. /home/gradle && \
4040 cd /home/gradle && \
4141 gradle --parallel \
42− :TMessagesProj_App:bundleBundleAfat_SDK23Release \
4342 :TMessagesProj_App:bundleBundleAfatRelease \
4443 :TMessagesProj_AppStandalone:assembleAfatStandalone \
4544 :TMessagesProj_App:assembleAfatRelease \
TMessagesProj/build.gradle+6−2
@@ -18,6 +18,10 @@ idea {
1818 file('jni/third_party/libyuv'),
1919 file('jni/third_party/openh264'),
2020 file('jni/third_party/xiph'),
21+ file('jni/third_party/wamr'),
22+ file('jni/third_party/libprisma'),
23+ file('jni/third_party/boost-regex'),
24+ file('jni/tgcalls'),
2125 file('jni/tlottie'),
2226 file('jni/voip/webrtc'),
2327 file('jni/sqlite')
@@ -55,6 +59,7 @@ dependencies {
5559
5660 implementation "androidx.mediarouter:mediarouter:1.7.0"
5761 implementation 'com.google.zxing:core:3.5.4'
62+ implementation 'com.neovisionaries:nv-websocket-client:2.14'
5863
5964 implementation 'androidx.car.app:app:1.4.0'
6065 implementation 'androidx.car.app:app-projected:1.4.0'
@@ -113,7 +118,6 @@ android {
113118 buildToolsVersion '36.0.0'
114119 ndkVersion "27.2.12479018"
115120
116− sourceSets.main.jniLibs.srcDirs = ['./jni/']
117121
118122 externalNativeBuild {
119123 cmake {
@@ -145,7 +149,7 @@ android {
145149 defaultConfig.versionCode = Integer.parseInt(Utils['getVersionCode']())
146150
147151 defaultConfig {
148− minSdkVersion 21
152+ minSdkVersion 23
149153 targetSdkVersion 36
150154
151155 vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
TMessagesProj/jni/CMakeLists.txt+44
@@ -98,6 +98,9 @@ set_target_properties(tde2e PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}
9898add_library(tdutils STATIC IMPORTED)
9999set_target_properties(tdutils PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/prebuild/lib/${ANDROID_ABI}/libtdutils.a)
100100
101+add_library(prisma STATIC IMPORTED)
102+set_target_properties(prisma PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/prebuild/lib/${ANDROID_ABI}/libprisma.a)
103+
101104#tgnet
102105add_library(tgnet STATIC
103106 openssl/aes_ige.c
@@ -139,6 +142,30 @@ add_library(tlottie STATIC IMPORTED)
139142set_target_properties(tlottie PROPERTIES
140143 IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/prebuild/lib/${ANDROID_ABI}/libtlottie.a)
141144
145+# Wallet Engine: matching Rust archive and generated UniFFI C++20 wrapper.
146+set(WALLET_ENGINE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/prebuild/include/wallet-engine)
147+add_library(wallet_engine STATIC IMPORTED)
148+set_target_properties(wallet_engine PROPERTIES
149+ IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/prebuild/lib/${ANDROID_ABI}/libwallet_engine.a)
150+
151+add_library(wallet_engine_cpp STATIC
152+ ${WALLET_ENGINE_INCLUDE_DIR}/wallet_engine.cpp
153+ ${WALLET_ENGINE_INCLUDE_DIR}/gram_wallet.cpp)
154+# Keep C++20 local: existing JNI sources include Breakpad's C++17-only headers.
155+# Any new source that includes wallet_engine.hpp must also opt into C++20.
156+target_compile_features(wallet_engine_cpp PRIVATE cxx_std_20)
157+# Keep unused bindings discardable even when voip resets CMAKE_CXX_FLAGS below.
158+target_compile_options(wallet_engine_cpp PRIVATE -ffunction-sections -fdata-sections)
159+target_include_directories(wallet_engine_cpp PUBLIC ${WALLET_ENGINE_INCLUDE_DIR})
160+target_link_libraries(wallet_engine_cpp PUBLIC wallet_engine dl m)
161+
162+# Compile the JNI bridge as C++20 without changing the legacy JNI sources.
163+# An object library keeps its JNI entry points in the existing tmessages .so.
164+add_library(wallet_engine_jni OBJECT wallet/WalletEngineBridge.cpp wallet/GramWalletAdapter.cpp)
165+target_compile_features(wallet_engine_jni PRIVATE cxx_std_20)
166+set_target_properties(wallet_engine_jni PROPERTIES POSITION_INDEPENDENT_CODE ON)
167+target_link_libraries(wallet_engine_jni PRIVATE wallet_engine_cpp)
168+
142169#sqlite
143170add_library(sqlite STATIC
144171 sqlite/sqlite3.c)
@@ -205,6 +232,20 @@ add_library(${NATIVE_LIB} SHARED
205232 tests.cpp
206233)
207234
235+# Compile JNI directly into the shared library so archive extraction cannot drop its exports.
236+set(PRISMA_BRIDGE_SOURCES
237+ "${CMAKE_CURRENT_SOURCE_DIR}/prisma/bridge/PrismaEngine.cpp"
238+ "${CMAKE_CURRENT_SOURCE_DIR}/prisma/bridge/PrismaJni.cpp")
239+target_sources(${NATIVE_LIB} PRIVATE ${PRISMA_BRIDGE_SOURCES})
240+target_include_directories(${NATIVE_LIB} PRIVATE
241+ "${CMAKE_CURRENT_SOURCE_DIR}/prisma/bridge"
242+ "${CMAKE_CURRENT_SOURCE_DIR}/third_party/boost-regex/include"
243+ "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libprisma/libprisma")
244+set_property(SOURCE ${PRISMA_BRIDGE_SOURCES} APPEND PROPERTY
245+ COMPILE_OPTIONS -fexceptions -frtti)
246+set_property(SOURCE ${PRISMA_BRIDGE_SOURCES} APPEND PROPERTY
247+ COMPILE_DEFINITIONS BOOST_REGEX_STANDALONE)
248+
208249target_compile_options(${NATIVE_LIB} PUBLIC
209250 -ffast-math -Oz -funroll-loops -ffast-math -fno-strict-aliasing -fno-math-errno)
210251
@@ -256,7 +297,10 @@ target_link_libraries(${NATIVE_LIB}
256297 wasm
257298 tgcalls_tp
258299 tgnet
300+ prisma
259301 tlottie
302+ wallet_engine_jni
303+ wallet_engine_cpp
260304 sqlite
261305 swscale
262306 avformat
TMessagesProj/jni/TgNetWrapper.cpp+3−2
@@ -106,9 +106,10 @@ jint getTimeDifference(JNIEnv *env, jclass c, jint instanceNum) {
106106 return ConnectionsManager::getInstance(instanceNum).getTimeDifference();
107107}
108108
109−void sendRequest(JNIEnv *env, jclass c, jint instanceNum, jlong object, jint flags, jint datacenterId, jint connectionType, jboolean immediate, jint token) {
109+void sendRequest(JNIEnv *env, jclass c, jint instanceNum, jlong object, jint flags, jint datacenterId, jint connectionType, jboolean immediate, jint token, jint downloadSize) {
110110 TL_api_request *request = new TL_api_request();
111111 request->request = (NativeByteBuffer *) (intptr_t) object;
112+ request->downloadSize = downloadSize > 0 ? (uint32_t) downloadSize : 0;
112113 ConnectionsManager::getInstance(instanceNum).sendRequest(request, ([instanceNum, token](TLObject *response, TL_error *error, int32_t networkType, int64_t responseTime, int64_t msgId, int32_t dcId) {
113114 TL_api_response *resp = (TL_api_response *) response;
114115 jlong ptr = 0;
@@ -557,7 +558,7 @@ static JNINativeMethod ConnectionsManagerMethods[] = {
557558 {"native_getCurrentAuthKeyId", "(I)J", (void *) getCurrentAuthKeyId},
558559 {"native_isTestBackend", "(I)I", (void *) isTestBackend},
559560 {"native_getTimeDifference", "(I)I", (void *) getTimeDifference},
560− {"native_sendRequest", "(IJIIIZI)V", (void *) sendRequest},
561+ {"native_sendRequest", "(IJIIIZII)V", (void *) sendRequest},
561562 {"native_cancelRequest", "(IIZ)V", (void *) cancelRequest},
562563 {"native_cleanUp", "(IZ)V", (void *) cleanUp},
563564 {"native_cancelRequestsForGuid", "(II)V", (void *) cancelRequestsForGuid},
TMessagesProj/jni/gram-wallet/.gitignorenew file+1
@@ -0,0 +1 @@
1+/target/
TMessagesProj/jni/gram-wallet/Cargo.locknew file+2172
@@ -0,0 +1,2172 @@
1+# This file is automatically @generated by Cargo.
2+# It is not intended for manual editing.
3+version = 4
4+
5+[[package]]
6+name = "aead"
7+version = "0.5.2"
8+source = "registry+https://github.com/rust-lang/crates.io-index"
9+checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
10+dependencies = [
11+ "crypto-common",
12+ "generic-array",
13+]
14+
15+[[package]]
16+name = "aes"
17+version = "0.8.4"
18+source = "registry+https://github.com/rust-lang/crates.io-index"
19+checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
20+dependencies = [
21+ "cfg-if",
22+ "cipher",
23+ "cpufeatures",
24+]
25+
26+[[package]]
27+name = "android_system_properties"
28+version = "0.1.6"
29+source = "registry+https://github.com/rust-lang/crates.io-index"
30+checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"
31+dependencies = [
32+ "libc",
33+]
34+
35+[[package]]
36+name = "anyhow"
37+version = "1.0.102"
38+source = "registry+https://github.com/rust-lang/crates.io-index"
39+checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
40+
41+[[package]]
42+name = "arrayvec"
43+version = "0.7.8"
44+source = "registry+https://github.com/rust-lang/crates.io-index"
45+checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"
46+
47+[[package]]
48+name = "askama"
49+version = "0.16.0"
50+source = "registry+https://github.com/rust-lang/crates.io-index"
51+checksum = "f1bf825125edd887a019d0a3a837dcc5499a68b0d034cc3eb594070c3e18addc"
52+dependencies = [
53+ "askama_macros",
54+ "itoa",
55+ "percent-encoding",
56+ "serde",
57+ "serde_json",
58+]
59+
60+[[package]]
61+name = "askama_derive"
62+version = "0.16.0"
63+source = "registry+https://github.com/rust-lang/crates.io-index"
64+checksum = "e1c7065972a130eafa84215f21352ae15b4a7393da48c1f5e103904490736738"
65+dependencies = [
66+ "askama_parser",
67+ "basic-toml",
68+ "glob",
69+ "memchr",
70+ "proc-macro2",
71+ "quote",
72+ "rustc-hash",
73+ "serde",
74+ "serde_derive",
75+ "syn 2.0.119",
76+]
77+
78+[[package]]
79+name = "askama_macros"
80+version = "0.16.0"
81+source = "registry+https://github.com/rust-lang/crates.io-index"
82+checksum = "0e23b1d2c4bd39a41971f6124cef4cc6fd0540913ecb90919b69ab3bbe44ae1a"
83+dependencies = [
84+ "askama_derive",
85+]
86+
87+[[package]]
88+name = "askama_parser"
89+version = "0.16.0"
90+source = "registry+https://github.com/rust-lang/crates.io-index"
91+checksum = "7db09fde9143e7ac4513358fb32ee32847125b63b18ea715afd487956da715da"
92+dependencies = [
93+ "rustc-hash",
94+ "serde",
95+ "serde_derive",
96+ "unicode-ident",
97+ "winnow 1.0.4",
98+]
99+
100+[[package]]
101+name = "async-trait"
102+version = "0.1.89"
103+source = "registry+https://github.com/rust-lang/crates.io-index"
104+checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
105+dependencies = [
106+ "proc-macro2",
107+ "quote",
108+ "syn 2.0.119",
109+]
110+
111+[[package]]
112+name = "autocfg"
113+version = "1.5.1"
114+source = "registry+https://github.com/rust-lang/crates.io-index"
115+checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
116+
117+[[package]]
118+name = "base64"
119+version = "0.22.1"
120+source = "registry+https://github.com/rust-lang/crates.io-index"
121+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
122+
123+[[package]]
124+name = "base64ct"
125+version = "1.8.3"
126+source = "registry+https://github.com/rust-lang/crates.io-index"
127+checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
128+
129+[[package]]
130+name = "basic-toml"
131+version = "0.1.10"
132+source = "registry+https://github.com/rust-lang/crates.io-index"
133+checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"
134+dependencies = [
135+ "serde",
136+]
137+
138+[[package]]
139+name = "bitflags"
140+version = "2.13.1"
141+source = "registry+https://github.com/rust-lang/crates.io-index"
142+checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
143+
144+[[package]]
145+name = "bitstream-io"
146+version = "4.10.0"
147+source = "registry+https://github.com/rust-lang/crates.io-index"
148+checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f"
149+dependencies = [
150+ "no_std_io2",
151+]
152+
153+[[package]]
154+name = "bitvec"
155+version = "1.1.1"
156+source = "registry+https://github.com/rust-lang/crates.io-index"
157+checksum = "ddcec3d12c579d40898fe0a9a358a803c23e9c52ca3c425707f81c9436211837"
158+dependencies = [
159+ "funty",
160+ "radium",
161+ "tap",
162+ "wyz",
163+]
164+
165+[[package]]
166+name = "block-buffer"
167+version = "0.10.4"
168+source = "registry+https://github.com/rust-lang/crates.io-index"
169+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
170+dependencies = [
171+ "generic-array",
172+]
173+
174+[[package]]
175+name = "bnum"
176+version = "0.12.1"
177+source = "registry+https://github.com/rust-lang/crates.io-index"
178+checksum = "f781dba93de3a5ef6dc5b17c9958b208f6f3f021623b360fb605ea51ce443f10"
179+dependencies = [
180+ "num-integer",
181+ "num-traits",
182+]
183+
184+[[package]]
185+name = "bumpalo"
186+version = "3.20.3"
187+source = "registry+https://github.com/rust-lang/crates.io-index"
188+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
189+
190+[[package]]
191+name = "bytes"
192+version = "1.12.1"
193+source = "registry+https://github.com/rust-lang/crates.io-index"
194+checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
195+
196+[[package]]
197+name = "camino"
198+version = "1.2.5"
199+source = "registry+https://github.com/rust-lang/crates.io-index"
200+checksum = "bb1307f12aa967b5a58416e87b3653360e0fd614a016b6e970db08fecbb1b80d"
201+dependencies = [
202+ "serde_core",
203+]
204+
205+[[package]]
206+name = "cargo-platform"
207+version = "0.3.2"
208+source = "registry+https://github.com/rust-lang/crates.io-index"
209+checksum = "87a0c0e6148f11f01f32650a2ea02d532b2ad4e81d8bd41e6e565b5adc5e6082"
210+dependencies = [
211+ "serde",
212+ "serde_core",
213+]
214+
215+[[package]]
216+name = "cargo_metadata"
217+version = "0.23.1"
218+source = "registry+https://github.com/rust-lang/crates.io-index"
219+checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9"
220+dependencies = [
221+ "camino",
222+ "cargo-platform",
223+ "semver",
224+ "serde",
225+ "serde_json",
226+ "thiserror",
227+]
228+
229+[[package]]
230+name = "cc"
231+version = "1.4.2"
232+source = "registry+https://github.com/rust-lang/crates.io-index"
233+checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e"
234+dependencies = [
235+ "find-msvc-tools",
236+ "shlex",
237+]
238+
239+[[package]]
240+name = "cfg-if"
241+version = "1.0.4"
242+source = "registry+https://github.com/rust-lang/crates.io-index"
243+checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
244+
245+[[package]]
246+name = "chrono"
247+version = "0.4.45"
248+source = "registry+https://github.com/rust-lang/crates.io-index"
249+checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"
250+dependencies = [
251+ "iana-time-zone",
252+ "num-traits",
253+ "windows-link",
254+]
255+
256+[[package]]
257+name = "cipher"
258+version = "0.4.4"
259+source = "registry+https://github.com/rust-lang/crates.io-index"
260+checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
261+dependencies = [
262+ "crypto-common",
263+ "inout",
264+ "zeroize",
265+]
266+
267+[[package]]
268+name = "const-oid"
269+version = "0.9.6"
270+source = "registry+https://github.com/rust-lang/crates.io-index"
271+checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
272+
273+[[package]]
274+name = "convert_case"
275+version = "0.11.0"
276+source = "registry+https://github.com/rust-lang/crates.io-index"
277+checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49"
278+dependencies = [
279+ "unicode-segmentation",
280+]
281+
282+[[package]]
283+name = "core-foundation-sys"
284+version = "0.8.7"
285+source = "registry+https://github.com/rust-lang/crates.io-index"
286+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
287+
288+[[package]]
289+name = "cpufeatures"
290+version = "0.2.17"
291+source = "registry+https://github.com/rust-lang/crates.io-index"
292+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
293+dependencies = [
294+ "libc",
295+]
296+
297+[[package]]
298+name = "crc"
299+version = "3.4.0"
300+source = "registry+https://github.com/rust-lang/crates.io-index"
301+checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d"
302+dependencies = [
303+ "crc-catalog",
304+]
305+
306+[[package]]
307+name = "crc-catalog"
308+version = "2.5.0"
309+source = "registry+https://github.com/rust-lang/crates.io-index"
310+checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853"
311+
312+[[package]]
313+name = "crypto-common"
314+version = "0.1.7"
315+source = "registry+https://github.com/rust-lang/crates.io-index"
316+checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
317+dependencies = [
318+ "generic-array",
319+ "typenum",
320+]
321+
322+[[package]]
323+name = "crypto_box"
324+version = "0.9.1"
325+source = "registry+https://github.com/rust-lang/crates.io-index"
326+checksum = "16182b4f39a82ec8a6851155cc4c0cda3065bb1db33651726a29e1951de0f009"
327+dependencies = [
328+ "aead",
329+ "crypto_secretbox",
330+ "curve25519-dalek",
331+ "salsa20",
332+ "subtle",
333+ "zeroize",
334+]
335+
336+[[package]]
337+name = "crypto_secretbox"
338+version = "0.1.1"
339+source = "registry+https://github.com/rust-lang/crates.io-index"
340+checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1"
341+dependencies = [
342+ "aead",
343+ "cipher",
344+ "generic-array",
345+ "poly1305",
346+ "salsa20",
347+ "subtle",
348+ "zeroize",
349+]
350+
351+[[package]]
352+name = "curve25519-dalek"
353+version = "4.1.3"
354+source = "registry+https://github.com/rust-lang/crates.io-index"
355+checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
356+dependencies = [
357+ "cfg-if",
358+ "cpufeatures",
359+ "curve25519-dalek-derive",
360+ "digest",
361+ "fiat-crypto",
362+ "rustc_version",
363+ "subtle",
364+ "zeroize",
365+]
366+
367+[[package]]
368+name = "curve25519-dalek-derive"
369+version = "0.1.1"
370+source = "registry+https://github.com/rust-lang/crates.io-index"
371+checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
372+dependencies = [
373+ "proc-macro2",
374+ "quote",
375+ "syn 2.0.119",
376+]
377+
378+[[package]]
379+name = "deluxe"
380+version = "0.5.0"
381+source = "registry+https://github.com/rust-lang/crates.io-index"
382+checksum = "8ed332aaf752b459088acf3dd4eca323e3ef4b83c70a84ca48fb0ec5305f1488"
383+dependencies = [
384+ "deluxe-core",
385+ "deluxe-macros",
386+ "once_cell",
387+ "proc-macro2",
388+ "syn 2.0.119",
389+]
390+
391+[[package]]
392+name = "deluxe-core"
393+version = "0.5.0"
394+source = "registry+https://github.com/rust-lang/crates.io-index"
395+checksum = "eddada51c8576df9d6a8450c351ff63042b092c9458b8ac7d20f89cbd0ffd313"
396+dependencies = [
397+ "arrayvec",
398+ "proc-macro2",
399+ "quote",
400+ "strsim",
401+ "syn 2.0.119",
402+]
403+
404+[[package]]
405+name = "deluxe-macros"
406+version = "0.5.0"
407+source = "registry+https://github.com/rust-lang/crates.io-index"
408+checksum = "f87546d9c837f0b7557e47b8bd6eae52c3c223141b76aa233c345c9ab41d9117"
409+dependencies = [
410+ "deluxe-core",
411+ "heck 0.4.1",
412+ "if_chain",
413+ "proc-macro-crate 1.3.1",
414+ "proc-macro2",
415+ "quote",
416+ "syn 2.0.119",
417+]
418+
419+[[package]]
420+name = "der"
421+version = "0.7.10"
422+source = "registry+https://github.com/rust-lang/crates.io-index"
423+checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
424+dependencies = [
425+ "const-oid",
426+ "zeroize",
427+]
428+
429+[[package]]
430+name = "digest"
431+version = "0.10.7"
432+source = "registry+https://github.com/rust-lang/crates.io-index"
433+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
434+dependencies = [
435+ "block-buffer",
436+ "crypto-common",
437+ "subtle",
438+]
439+
440+[[package]]
441+name = "displaydoc"
442+version = "0.2.7"
443+source = "registry+https://github.com/rust-lang/crates.io-index"
444+checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
445+dependencies = [
446+ "proc-macro2",
447+ "quote",
448+ "syn 3.0.3",
449+]
450+
451+[[package]]
452+name = "ed25519"
453+version = "2.2.3"
454+source = "registry+https://github.com/rust-lang/crates.io-index"
455+checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
456+dependencies = [
457+ "pkcs8",
458+ "signature",
459+]
460+
461+[[package]]
462+name = "ed25519-dalek"
463+version = "2.2.0"
464+source = "registry+https://github.com/rust-lang/crates.io-index"
465+checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9"
466+dependencies = [
467+ "curve25519-dalek",
468+ "ed25519",
469+ "serde",
470+ "sha2",
471+ "subtle",
472+ "zeroize",
473+]
474+
475+[[package]]
476+name = "equivalent"
477+version = "1.0.2"
478+source = "registry+https://github.com/rust-lang/crates.io-index"
479+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
480+
481+[[package]]
482+name = "errno"
483+version = "0.3.14"
484+source = "registry+https://github.com/rust-lang/crates.io-index"
485+checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
486+dependencies = [
487+ "libc",
488+ "windows-sys",
489+]
490+
491+[[package]]
492+name = "fastnum"
493+version = "0.7.4"
494+source = "registry+https://github.com/rust-lang/crates.io-index"
495+checksum = "4089ab2dfd45d8ddc92febb5ca80644389d5ebb954f40231274a3f18341762e2"
496+dependencies = [
497+ "bnum",
498+ "num-integer",
499+ "num-traits",
500+]
501+
502+[[package]]
503+name = "fastrand"
504+version = "2.5.0"
505+source = "registry+https://github.com/rust-lang/crates.io-index"
506+checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
507+
508+[[package]]
509+name = "fiat-crypto"
510+version = "0.2.9"
511+source = "registry+https://github.com/rust-lang/crates.io-index"
512+checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
513+
514+[[package]]
515+name = "find-msvc-tools"
516+version = "0.1.10"
517+source = "registry+https://github.com/rust-lang/crates.io-index"
518+checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de"
519+
520+[[package]]
521+name = "form_urlencoded"
522+version = "1.2.2"
523+source = "registry+https://github.com/rust-lang/crates.io-index"
524+checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
525+dependencies = [
526+ "percent-encoding",
527+]
528+
529+[[package]]
530+name = "fs-err"
531+version = "3.3.1"
532+source = "registry+https://github.com/rust-lang/crates.io-index"
533+checksum = "b91aa448ca50d7e79433bdf3ee8d99215430d2ec02ade5aefab2a073a1822e8a"
534+dependencies = [
535+ "autocfg",
536+]
537+
538+[[package]]
539+name = "funty"
540+version = "2.0.0"
541+source = "registry+https://github.com/rust-lang/crates.io-index"
542+checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
543+
544+[[package]]
545+name = "futures"
546+version = "0.3.31"
547+source = "registry+https://github.com/rust-lang/crates.io-index"
548+checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
549+dependencies = [
550+ "futures-channel",
551+ "futures-core",
552+ "futures-executor",
553+ "futures-io",
554+ "futures-sink",
555+ "futures-task",
556+ "futures-util",
557+]
558+
559+[[package]]
560+name = "futures-channel"
561+version = "0.3.34"
562+source = "registry+https://github.com/rust-lang/crates.io-index"
563+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
564+dependencies = [
565+ "futures-core",
566+ "futures-sink",
567+]
568+
569+[[package]]
570+name = "futures-core"
571+version = "0.3.34"
572+source = "registry+https://github.com/rust-lang/crates.io-index"
573+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
574+
575+[[package]]
576+name = "futures-executor"
577+version = "0.3.34"
578+source = "registry+https://github.com/rust-lang/crates.io-index"
579+checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
580+dependencies = [
581+ "futures-core",
582+ "futures-task",
583+ "futures-util",
584+]
585+
586+[[package]]
587+name = "futures-io"
588+version = "0.3.34"
589+source = "registry+https://github.com/rust-lang/crates.io-index"
590+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
591+
592+[[package]]
593+name = "futures-macro"
594+version = "0.3.34"
595+source = "registry+https://github.com/rust-lang/crates.io-index"
596+checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
597+dependencies = [
598+ "proc-macro2",
599+ "quote",
600+ "syn 3.0.3",
601+]
602+
603+[[package]]
604+name = "futures-sink"
605+version = "0.3.34"
606+source = "registry+https://github.com/rust-lang/crates.io-index"
607+checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
608+
609+[[package]]
610+name = "futures-task"
611+version = "0.3.34"
612+source = "registry+https://github.com/rust-lang/crates.io-index"
613+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
614+
615+[[package]]
616+name = "futures-util"
617+version = "0.3.34"
618+source = "registry+https://github.com/rust-lang/crates.io-index"
619+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
620+dependencies = [
621+ "futures-channel",
622+ "futures-core",
623+ "futures-io",
624+ "futures-macro",
625+ "futures-sink",
626+ "futures-task",
627+ "memchr",
628+ "pin-project-lite",
629+ "slab",
630+]
631+
632+[[package]]
633+name = "generic-array"
634+version = "0.14.7"
635+source = "registry+https://github.com/rust-lang/crates.io-index"
636+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
637+dependencies = [
638+ "typenum",
639+ "version_check",
640+ "zeroize",
641+]
642+
643+[[package]]
644+name = "getrandom"
645+version = "0.2.17"
646+source = "registry+https://github.com/rust-lang/crates.io-index"
647+checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
648+dependencies = [
649+ "cfg-if",
650+ "libc",
651+ "wasi",
652+]
653+
654+[[package]]
655+name = "getrandom"
656+version = "0.3.4"
657+source = "registry+https://github.com/rust-lang/crates.io-index"
658+checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
659+dependencies = [
660+ "cfg-if",
661+ "js-sys",
662+ "libc",
663+ "r-efi 5.3.0",
664+ "wasip2",
665+ "wasm-bindgen",
666+]
667+
668+[[package]]
669+name = "getrandom"
670+version = "0.4.3"
671+source = "registry+https://github.com/rust-lang/crates.io-index"
672+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
673+dependencies = [
674+ "cfg-if",
675+ "libc",
676+ "r-efi 6.0.0",
677+]
678+
679+[[package]]
680+name = "glob"
681+version = "0.3.4"
682+source = "registry+https://github.com/rust-lang/crates.io-index"
683+checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
684+
685+[[package]]
686+name = "goblin"
687+version = "0.8.2"
688+source = "registry+https://github.com/rust-lang/crates.io-index"
689+checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
690+dependencies = [
691+ "log",
692+ "plain",
693+ "scroll",
694+]
695+
696+[[package]]
697+name = "gram-wallet"
698+version = "0.1.0"
699+dependencies = [
700+ "async-trait",
701+ "base64",
702+ "futures",
703+ "hex",
704+ "serde",
705+ "serde_json",
706+ "thiserror",
707+ "ton",
708+ "ton-connect-core",
709+ "uniffi",
710+ "url",
711+ "wallet-engine",
712+ "zeroize",
713+]
714+
715+[[package]]
716+name = "hashbrown"
717+version = "0.17.1"
718+source = "registry+https://github.com/rust-lang/crates.io-index"
719+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
720+
721+[[package]]
722+name = "heck"
723+version = "0.4.1"
724+source = "registry+https://github.com/rust-lang/crates.io-index"
725+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
726+
727+[[package]]
728+name = "heck"
729+version = "0.5.0"
730+source = "registry+https://github.com/rust-lang/crates.io-index"
731+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
732+
733+[[package]]
734+name = "hex"
735+version = "0.4.3"
736+source = "registry+https://github.com/rust-lang/crates.io-index"
737+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
738+
739+[[package]]
740+name = "hmac"
741+version = "0.12.1"
742+source = "registry+https://github.com/rust-lang/crates.io-index"
743+checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
744+dependencies = [
745+ "digest",
746+]
747+
748+[[package]]
749+name = "iana-time-zone"
750+version = "0.1.65"
751+source = "registry+https://github.com/rust-lang/crates.io-index"
752+checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
753+dependencies = [
754+ "android_system_properties",
755+ "core-foundation-sys",
756+ "iana-time-zone-haiku",
757+ "js-sys",
758+ "log",
759+ "wasm-bindgen",
760+ "windows-core",
761+]
762+
763+[[package]]
764+name = "iana-time-zone-haiku"
765+version = "0.1.2"
766+source = "registry+https://github.com/rust-lang/crates.io-index"
767+checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
768+dependencies = [
769+ "cc",
770+]
771+
772+[[package]]
773+name = "icu_collections"
774+version = "2.2.0"
775+source = "registry+https://github.com/rust-lang/crates.io-index"
776+checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c"
777+dependencies = [
778+ "displaydoc",
779+ "potential_utf",
780+ "utf8_iter",
781+ "yoke",
782+ "zerofrom",
783+ "zerovec",
784+]
785+
786+[[package]]
787+name = "icu_locale_core"
788+version = "2.2.0"
789+source = "registry+https://github.com/rust-lang/crates.io-index"
790+checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"
791+dependencies = [
792+ "displaydoc",
793+ "litemap",
794+ "tinystr",
795+ "writeable",
796+ "zerovec",
797+]
798+
799+[[package]]
800+name = "icu_normalizer"
801+version = "2.2.0"
802+source = "registry+https://github.com/rust-lang/crates.io-index"
803+checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4"
804+dependencies = [
805+ "icu_collections",
806+ "icu_normalizer_data",
807+ "icu_properties",
808+ "icu_provider",
809+ "smallvec",
810+ "zerovec",
811+]
812+
813+[[package]]
814+name = "icu_normalizer_data"
815+version = "2.2.0"
816+source = "registry+https://github.com/rust-lang/crates.io-index"
817+checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38"
818+
819+[[package]]
820+name = "icu_properties"
821+version = "2.2.0"
822+source = "registry+https://github.com/rust-lang/crates.io-index"
823+checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de"
824+dependencies = [
825+ "icu_collections",
826+ "icu_locale_core",
827+ "icu_properties_data",
828+ "icu_provider",
829+ "zerotrie",
830+ "zerovec",
831+]
832+
833+[[package]]
834+name = "icu_properties_data"
835+version = "2.2.0"
836+source = "registry+https://github.com/rust-lang/crates.io-index"
837+checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"
838+
839+[[package]]
840+name = "icu_provider"
841+version = "2.2.0"
842+source = "registry+https://github.com/rust-lang/crates.io-index"
843+checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"
844+dependencies = [
845+ "displaydoc",
846+ "icu_locale_core",
847+ "writeable",
848+ "yoke",
849+ "zerofrom",
850+ "zerotrie",
851+ "zerovec",
852+]
853+
854+[[package]]
855+name = "idna"
856+version = "1.1.0"
857+source = "registry+https://github.com/rust-lang/crates.io-index"
858+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
859+dependencies = [
860+ "idna_adapter",
861+ "smallvec",
862+ "utf8_iter",
863+]
864+
865+[[package]]
866+name = "idna_adapter"
867+version = "1.2.2"
868+source = "registry+https://github.com/rust-lang/crates.io-index"
869+checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
870+dependencies = [
871+ "icu_normalizer",
872+ "icu_properties",
873+]
874+
875+[[package]]
876+name = "if_chain"
877+version = "1.0.3"
878+source = "registry+https://github.com/rust-lang/crates.io-index"
879+checksum = "cd62e6b5e86ea8eeeb8db1de02880a6abc01a397b2ebb64b5d74ac255318f5cb"
880+
881+[[package]]
882+name = "indexmap"
883+version = "2.14.0"
884+source = "registry+https://github.com/rust-lang/crates.io-index"
885+checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
886+dependencies = [
887+ "equivalent",
888+ "hashbrown",
889+ "serde",
890+ "serde_core",
891+]
892+
893+[[package]]
894+name = "inout"
895+version = "0.1.4"
896+source = "registry+https://github.com/rust-lang/crates.io-index"
897+checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
898+dependencies = [
899+ "generic-array",
900+]
901+
902+[[package]]
903+name = "itoa"
904+version = "1.0.18"
905+source = "registry+https://github.com/rust-lang/crates.io-index"
906+checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
907+
908+[[package]]
909+name = "js-sys"
910+version = "0.3.104"
911+source = "registry+https://github.com/rust-lang/crates.io-index"
912+checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a"
913+dependencies = [
914+ "cfg-if",
915+ "futures-util",
916+ "wasm-bindgen",
917+]
918+
919+[[package]]
920+name = "libc"
921+version = "0.2.189"
922+source = "registry+https://github.com/rust-lang/crates.io-index"
923+checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
924+
925+[[package]]
926+name = "libm"
927+version = "0.2.16"
928+source = "registry+https://github.com/rust-lang/crates.io-index"
929+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
930+
931+[[package]]
932+name = "linux-raw-sys"
933+version = "0.12.1"
934+source = "registry+https://github.com/rust-lang/crates.io-index"
935+checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
936+
937+[[package]]
938+name = "litemap"
939+version = "0.8.2"
940+source = "registry+https://github.com/rust-lang/crates.io-index"
941+checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
942+
943+[[package]]
944+name = "lock_api"
945+version = "0.4.14"
946+source = "registry+https://github.com/rust-lang/crates.io-index"
947+checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
948+dependencies = [
949+ "scopeguard",
950+]
951+
952+[[package]]
953+name = "log"
954+version = "0.4.33"
955+source = "registry+https://github.com/rust-lang/crates.io-index"
956+checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
957+
958+[[package]]
959+name = "memchr"
960+version = "2.8.3"
961+source = "registry+https://github.com/rust-lang/crates.io-index"
962+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
963+
964+[[package]]
965+name = "minimal-lexical"
966+version = "0.2.1"
967+source = "registry+https://github.com/rust-lang/crates.io-index"
968+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
969+
970+[[package]]
971+name = "no_std_io2"
972+version = "0.9.4"
973+source = "registry+https://github.com/rust-lang/crates.io-index"
974+checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003"
975+dependencies = [
976+ "memchr",
977+]
978+
979+[[package]]
980+name = "nom"
981+version = "7.1.3"
982+source = "registry+https://github.com/rust-lang/crates.io-index"
983+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
984+dependencies = [
985+ "memchr",
986+ "minimal-lexical",
987+]
988+
989+[[package]]
990+name = "num-bigint"
991+version = "0.4.8"
992+source = "registry+https://github.com/rust-lang/crates.io-index"
993+checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"
994+dependencies = [
995+ "num-integer",
996+ "num-traits",
997+]
998+
999+[[package]]
1000+name = "num-integer"
1001+version = "0.1.47"
1002+source = "registry+https://github.com/rust-lang/crates.io-index"
1003+checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
1004+dependencies = [
1005+ "num-traits",
1006+]
1007+
1008+[[package]]
1009+name = "num-traits"
1010+version = "0.2.19"
1011+source = "registry+https://github.com/rust-lang/crates.io-index"
1012+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
1013+dependencies = [
1014+ "autocfg",
1015+ "libm",
1016+]
1017+
1018+[[package]]
1019+name = "once_cell"
1020+version = "1.21.4"
1021+source = "registry+https://github.com/rust-lang/crates.io-index"
1022+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
1023+dependencies = [
1024+ "parking_lot_core",
1025+]
1026+
1027+[[package]]
1028+name = "opaque-debug"
1029+version = "0.3.1"
1030+source = "registry+https://github.com/rust-lang/crates.io-index"
1031+checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
1032+
1033+[[package]]
1034+name = "ordered-float"
1035+version = "2.10.1"
1036+source = "registry+https://github.com/rust-lang/crates.io-index"
1037+checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c"
1038+dependencies = [
1039+ "num-traits",
1040+]
1041+
1042+[[package]]
1043+name = "parking_lot"
1044+version = "0.12.5"
1045+source = "registry+https://github.com/rust-lang/crates.io-index"
1046+checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
1047+dependencies = [
1048+ "lock_api",
1049+ "parking_lot_core",
1050+]
1051+
1052+[[package]]
1053+name = "parking_lot_core"
1054+version = "0.9.12"
1055+source = "registry+https://github.com/rust-lang/crates.io-index"
1056+checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
1057+dependencies = [
1058+ "cfg-if",
1059+ "libc",
1060+ "redox_syscall",
1061+ "smallvec",
1062+ "windows-link",
1063+]
1064+
1065+[[package]]
1066+name = "password-hash"
1067+version = "0.5.0"
1068+source = "registry+https://github.com/rust-lang/crates.io-index"
1069+checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
1070+dependencies = [
1071+ "base64ct",
1072+ "rand_core",
1073+ "subtle",
1074+]
1075+
1076+[[package]]
1077+name = "pbkdf2"
1078+version = "0.12.2"
1079+source = "registry+https://github.com/rust-lang/crates.io-index"
1080+checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
1081+dependencies = [
1082+ "digest",
1083+ "hmac",
1084+ "password-hash",
1085+ "sha2",
1086+]
1087+
1088+[[package]]
1089+name = "percent-encoding"
1090+version = "2.3.2"
1091+source = "registry+https://github.com/rust-lang/crates.io-index"
1092+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
1093+
1094+[[package]]
1095+name = "pin-project-lite"
1096+version = "0.2.17"
1097+source = "registry+https://github.com/rust-lang/crates.io-index"
1098+checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
1099+
1100+[[package]]
1101+name = "pkcs8"
1102+version = "0.10.2"
1103+source = "registry+https://github.com/rust-lang/crates.io-index"
1104+checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
1105+dependencies = [
1106+ "der",
1107+ "spki",
1108+]
1109+
1110+[[package]]
1111+name = "plain"
1112+version = "0.2.3"
1113+source = "registry+https://github.com/rust-lang/crates.io-index"
1114+checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
1115+
1116+[[package]]
1117+name = "poly1305"
1118+version = "0.8.0"
1119+source = "registry+https://github.com/rust-lang/crates.io-index"
1120+checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
1121+dependencies = [
1122+ "cpufeatures",
1123+ "opaque-debug",
1124+ "universal-hash",
1125+]
1126+
1127+[[package]]
1128+name = "potential_utf"
1129+version = "0.1.5"
1130+source = "registry+https://github.com/rust-lang/crates.io-index"
1131+checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
1132+dependencies = [
1133+ "zerovec",
1134+]
1135+
1136+[[package]]
1137+name = "proc-macro-crate"
1138+version = "1.3.1"
1139+source = "registry+https://github.com/rust-lang/crates.io-index"
1140+checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919"
1141+dependencies = [
1142+ "once_cell",
1143+ "toml_edit 0.19.15",
1144+]
1145+
1146+[[package]]
1147+name = "proc-macro-crate"
1148+version = "3.5.0"
1149+source = "registry+https://github.com/rust-lang/crates.io-index"
1150+checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
1151+dependencies = [
1152+ "toml_edit 0.25.13+spec-1.1.0",
1153+]
1154+
1155+[[package]]
1156+name = "proc-macro2"
1157+version = "1.0.107"
1158+source = "registry+https://github.com/rust-lang/crates.io-index"
1159+checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
1160+dependencies = [
1161+ "unicode-ident",
1162+]
1163+
1164+[[package]]
1165+name = "quote"
1166+version = "1.0.47"
1167+source = "registry+https://github.com/rust-lang/crates.io-index"
1168+checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
1169+dependencies = [
1170+ "proc-macro2",
1171+]
1172+
1173+[[package]]
1174+name = "r-efi"
1175+version = "5.3.0"
1176+source = "registry+https://github.com/rust-lang/crates.io-index"
1177+checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
1178+
1179+[[package]]
1180+name = "r-efi"
1181+version = "6.0.0"
1182+source = "registry+https://github.com/rust-lang/crates.io-index"
1183+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
1184+
1185+[[package]]
1186+name = "radium"
1187+version = "0.7.0"
1188+source = "registry+https://github.com/rust-lang/crates.io-index"
1189+checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
1190+
1191+[[package]]
1192+name = "rand_core"
1193+version = "0.6.4"
1194+source = "registry+https://github.com/rust-lang/crates.io-index"
1195+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
1196+dependencies = [
1197+ "getrandom 0.2.17",
1198+]
1199+
1200+[[package]]
1201+name = "redox_syscall"
1202+version = "0.5.18"
1203+source = "registry+https://github.com/rust-lang/crates.io-index"
1204+checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
1205+dependencies = [
1206+ "bitflags",
1207+]
1208+
1209+[[package]]
1210+name = "rustc-hash"
1211+version = "2.1.3"
1212+source = "registry+https://github.com/rust-lang/crates.io-index"
1213+checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
1214+
1215+[[package]]
1216+name = "rustc_version"
1217+version = "0.4.1"
1218+source = "registry+https://github.com/rust-lang/crates.io-index"
1219+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
1220+dependencies = [
1221+ "semver",
1222+]
1223+
1224+[[package]]
1225+name = "rustix"
1226+version = "1.1.4"
1227+source = "registry+https://github.com/rust-lang/crates.io-index"
1228+checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
1229+dependencies = [
1230+ "bitflags",
1231+ "errno",
1232+ "libc",
1233+ "linux-raw-sys",
1234+ "windows-sys",
1235+]
1236+
1237+[[package]]
1238+name = "rustversion"
1239+version = "1.0.23"
1240+source = "registry+https://github.com/rust-lang/crates.io-index"
1241+checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
1242+
1243+[[package]]
1244+name = "salsa20"
1245+version = "0.10.2"
1246+source = "registry+https://github.com/rust-lang/crates.io-index"
1247+checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
1248+dependencies = [
1249+ "cipher",
1250+]
1251+
1252+[[package]]
1253+name = "scopeguard"
1254+version = "1.2.0"
1255+source = "registry+https://github.com/rust-lang/crates.io-index"
1256+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
1257+
1258+[[package]]
1259+name = "scroll"
1260+version = "0.12.0"
1261+source = "registry+https://github.com/rust-lang/crates.io-index"
1262+checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
1263+dependencies = [
1264+ "scroll_derive",
1265+]
1266+
1267+[[package]]
1268+name = "scroll_derive"
1269+version = "0.12.1"
1270+source = "registry+https://github.com/rust-lang/crates.io-index"
1271+checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d"
1272+dependencies = [
1273+ "proc-macro2",
1274+ "quote",
1275+ "syn 2.0.119",
1276+]
1277+
1278+[[package]]
1279+name = "semver"
1280+version = "1.0.28"
1281+source = "registry+https://github.com/rust-lang/crates.io-index"
1282+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
1283+dependencies = [
1284+ "serde",
1285+ "serde_core",
1286+]
1287+
1288+[[package]]
1289+name = "serde"
1290+version = "1.0.229"
1291+source = "registry+https://github.com/rust-lang/crates.io-index"
1292+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
1293+dependencies = [
1294+ "serde_core",
1295+ "serde_derive",
1296+]
1297+
1298+[[package]]
1299+name = "serde-aux"
1300+version = "4.7.0"
1301+source = "registry+https://github.com/rust-lang/crates.io-index"
1302+checksum = "207f67b28fe90fb596503a9bf0bf1ea5e831e21307658e177c5dfcdfc3ab8a0a"
1303+dependencies = [
1304+ "chrono",
1305+ "serde",
1306+ "serde-value",
1307+ "serde_json",
1308+]
1309+
1310+[[package]]
1311+name = "serde-value"
1312+version = "0.7.0"
1313+source = "registry+https://github.com/rust-lang/crates.io-index"
1314+checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c"
1315+dependencies = [
1316+ "ordered-float",
1317+ "serde",
1318+]
1319+
1320+[[package]]
1321+name = "serde_core"
1322+version = "1.0.229"
1323+source = "registry+https://github.com/rust-lang/crates.io-index"
1324+checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
1325+dependencies = [
1326+ "serde_derive",
1327+]
1328+
1329+[[package]]
1330+name = "serde_derive"
1331+version = "1.0.229"
1332+source = "registry+https://github.com/rust-lang/crates.io-index"
1333+checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
1334+dependencies = [
1335+ "proc-macro2",
1336+ "quote",
1337+ "syn 3.0.3",
1338+]
1339+
1340+[[package]]
1341+name = "serde_json"
1342+version = "1.0.151"
1343+source = "registry+https://github.com/rust-lang/crates.io-index"
1344+checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
1345+dependencies = [
1346+ "itoa",
1347+ "memchr",
1348+ "serde",
1349+ "serde_core",
1350+ "zmij",
1351+]
1352+
1353+[[package]]
1354+name = "serde_spanned"
1355+version = "1.1.1"
1356+source = "registry+https://github.com/rust-lang/crates.io-index"
1357+checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
1358+dependencies = [
1359+ "serde_core",
1360+]
1361+
1362+[[package]]
1363+name = "sha2"
1364+version = "0.10.9"
1365+source = "registry+https://github.com/rust-lang/crates.io-index"
1366+checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
1367+dependencies = [
1368+ "cfg-if",
1369+ "cpufeatures",
1370+ "digest",
1371+]
1372+
1373+[[package]]
1374+name = "shlex"
1375+version = "2.0.1"
1376+source = "registry+https://github.com/rust-lang/crates.io-index"
1377+checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
1378+
1379+[[package]]
1380+name = "signature"
1381+version = "2.2.0"
1382+source = "registry+https://github.com/rust-lang/crates.io-index"
1383+checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
1384+dependencies = [
1385+ "rand_core",
1386+]
1387+
1388+[[package]]
1389+name = "siphasher"
1390+version = "1.0.3"
1391+source = "registry+https://github.com/rust-lang/crates.io-index"
1392+checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"
1393+
1394+[[package]]
1395+name = "slab"
1396+version = "0.4.12"
1397+source = "registry+https://github.com/rust-lang/crates.io-index"
1398+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
1399+
1400+[[package]]
1401+name = "smallvec"
1402+version = "1.15.2"
1403+source = "registry+https://github.com/rust-lang/crates.io-index"
1404+checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
1405+
1406+[[package]]
1407+name = "smawk"
1408+version = "0.3.3"
1409+source = "registry+https://github.com/rust-lang/crates.io-index"
1410+checksum = "e8e2fb0f499abb4d162f2bedad68f5ef91a1682b5a03596ddb67efd37768d100"
1411+
1412+[[package]]
1413+name = "spki"
1414+version = "0.7.3"
1415+source = "registry+https://github.com/rust-lang/crates.io-index"
1416+checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
1417+dependencies = [
1418+ "base64ct",
1419+ "der",
1420+]
1421+
1422+[[package]]
1423+name = "stable_deref_trait"
1424+version = "1.2.1"
1425+source = "registry+https://github.com/rust-lang/crates.io-index"
1426+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
1427+
1428+[[package]]
1429+name = "static_assertions"
1430+version = "1.1.0"
1431+source = "registry+https://github.com/rust-lang/crates.io-index"
1432+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
1433+
1434+[[package]]
1435+name = "strsim"
1436+version = "0.10.0"
1437+source = "registry+https://github.com/rust-lang/crates.io-index"
1438+checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
1439+
1440+[[package]]
1441+name = "subtle"
1442+version = "2.6.1"
1443+source = "registry+https://github.com/rust-lang/crates.io-index"
1444+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
1445+
1446+[[package]]
1447+name = "syn"
1448+version = "2.0.119"
1449+source = "registry+https://github.com/rust-lang/crates.io-index"
1450+checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
1451+dependencies = [
1452+ "proc-macro2",
1453+ "quote",
1454+ "unicode-ident",
1455+]
1456+
1457+[[package]]
1458+name = "syn"
1459+version = "3.0.3"
1460+source = "registry+https://github.com/rust-lang/crates.io-index"
1461+checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
1462+dependencies = [
1463+ "proc-macro2",
1464+ "quote",
1465+ "unicode-ident",
1466+]
1467+
1468+[[package]]
1469+name = "synstructure"
1470+version = "0.13.2"
1471+source = "registry+https://github.com/rust-lang/crates.io-index"
1472+checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
1473+dependencies = [
1474+ "proc-macro2",
1475+ "quote",
1476+ "syn 2.0.119",
1477+]
1478+
1479+[[package]]
1480+name = "tap"
1481+version = "1.0.1"
1482+source = "registry+https://github.com/rust-lang/crates.io-index"
1483+checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
1484+
1485+[[package]]
1486+name = "tempfile"
1487+version = "3.27.0"
1488+source = "registry+https://github.com/rust-lang/crates.io-index"
1489+checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
1490+dependencies = [
1491+ "fastrand",
1492+ "getrandom 0.4.3",
1493+ "once_cell",
1494+ "rustix",
1495+ "windows-sys",
1496+]
1497+
1498+[[package]]
1499+name = "textwrap"
1500+version = "0.16.2"
1501+source = "registry+https://github.com/rust-lang/crates.io-index"
1502+checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
1503+dependencies = [
1504+ "smawk",
1505+]
1506+
1507+[[package]]
1508+name = "thiserror"
1509+version = "2.0.17"
1510+source = "registry+https://github.com/rust-lang/crates.io-index"
1511+checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
1512+dependencies = [
1513+ "thiserror-impl",
1514+]
1515+
1516+[[package]]
1517+name = "thiserror-impl"
1518+version = "2.0.17"
1519+source = "registry+https://github.com/rust-lang/crates.io-index"
1520+checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
1521+dependencies = [
1522+ "proc-macro2",
1523+ "quote",
1524+ "syn 2.0.119",
1525+]
1526+
1527+[[package]]
1528+name = "tinystr"
1529+version = "0.8.3"
1530+source = "registry+https://github.com/rust-lang/crates.io-index"
1531+checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
1532+dependencies = [
1533+ "displaydoc",
1534+ "zerovec",
1535+]
1536+
1537+[[package]]
1538+name = "toml"
1539+version = "1.1.4+spec-1.1.0"
1540+source = "registry+https://github.com/rust-lang/crates.io-index"
1541+checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5"
1542+dependencies = [
1543+ "indexmap",
1544+ "serde_core",
1545+ "serde_spanned",
1546+ "toml_datetime 1.1.1+spec-1.1.0",
1547+ "toml_parser",
1548+ "toml_writer",
1549+ "winnow 1.0.4",
1550+]
1551+
1552+[[package]]
1553+name = "toml_datetime"
1554+version = "0.6.11"
1555+source = "registry+https://github.com/rust-lang/crates.io-index"
1556+checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
1557+
1558+[[package]]
1559+name = "toml_datetime"
1560+version = "1.1.1+spec-1.1.0"
1561+source = "registry+https://github.com/rust-lang/crates.io-index"
1562+checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
1563+dependencies = [
1564+ "serde_core",
1565+]
1566+
1567+[[package]]
1568+name = "toml_edit"
1569+version = "0.19.15"
1570+source = "registry+https://github.com/rust-lang/crates.io-index"
1571+checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
1572+dependencies = [
1573+ "indexmap",
1574+ "toml_datetime 0.6.11",
1575+ "winnow 0.5.40",
1576+]
1577+
1578+[[package]]
1579+name = "toml_edit"
1580+version = "0.25.13+spec-1.1.0"
1581+source = "registry+https://github.com/rust-lang/crates.io-index"
1582+checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b"
1583+dependencies = [
1584+ "indexmap",
1585+ "toml_datetime 1.1.1+spec-1.1.0",
1586+ "toml_parser",
1587+ "winnow 1.0.4",
1588+]
1589+
1590+[[package]]
1591+name = "toml_parser"
1592+version = "1.1.3+spec-1.1.0"
1593+source = "registry+https://github.com/rust-lang/crates.io-index"
1594+checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"
1595+dependencies = [
1596+ "winnow 1.0.4",
1597+]
1598+
1599+[[package]]
1600+name = "toml_writer"
1601+version = "1.1.2+spec-1.1.0"
1602+source = "registry+https://github.com/rust-lang/crates.io-index"
1603+checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
1604+
1605+[[package]]
1606+name = "ton"
1607+version = "0.1.3"
1608+dependencies = [
1609+ "base64",
1610+ "ed25519-dalek",
1611+ "fastnum",
1612+ "hex",
1613+ "hmac",
1614+ "num-bigint",
1615+ "num-traits",
1616+ "parking_lot",
1617+ "pbkdf2",
1618+ "serde",
1619+ "serde-aux",
1620+ "serde_json",
1621+ "sha2",
1622+ "thiserror",
1623+ "ton_core",
1624+ "ton_macros",
1625+ "zeroize",
1626+]
1627+
1628+[[package]]
1629+name = "ton-connect-client"
1630+version = "0.0.7"
1631+dependencies = [
1632+ "serde",
1633+ "serde_json",
1634+ "thiserror",
1635+ "ton-connect-core",
1636+ "url",
1637+]
1638+
1639+[[package]]
1640+name = "ton-connect-core"
1641+version = "0.0.7"
1642+dependencies = [
1643+ "base64",
1644+ "crc",
1645+ "crypto_box",
1646+ "ed25519-dalek",
1647+ "getrandom 0.3.4",
1648+ "hex",
1649+ "serde",
1650+ "serde_json",
1651+ "sha2",
1652+ "thiserror",
1653+ "ton_core",
1654+ "url",
1655+ "zeroize",
1656+]
1657+
1658+[[package]]
1659+name = "ton_core"
1660+version = "0.1.4"
1661+source = "registry+https://github.com/rust-lang/crates.io-index"
1662+checksum = "fbe8fc69bbec68c2e4df0e78fe2d908eabbec46ce3757cf596f7facafb1f4c8c"
1663+dependencies = [
1664+ "async-trait",
1665+ "base64",
1666+ "bitstream-io",
1667+ "bitvec",
1668+ "crc",
1669+ "fastnum",
1670+ "hex",
1671+ "log",
1672+ "num-bigint",
1673+ "num-traits",
1674+ "once_cell",
1675+ "serde",
1676+ "serde_json",
1677+ "sha2",
1678+ "smallvec",
1679+ "thiserror",
1680+ "ton_macros",
1681+]
1682+
1683+[[package]]
1684+name = "ton_macros"
1685+version = "0.1.2"
1686+source = "registry+https://github.com/rust-lang/crates.io-index"
1687+checksum = "d353a7cce11cc573bf6a23794b9da44a7e32cc72455724e4c367d2fc650a7060"
1688+dependencies = [
1689+ "convert_case",
1690+ "deluxe",
1691+ "proc-macro-crate 3.5.0",
1692+ "proc-macro2",
1693+ "quote",
1694+ "syn 2.0.119",
1695+]
1696+
1697+[[package]]
1698+name = "typenum"
1699+version = "1.20.1"
1700+source = "registry+https://github.com/rust-lang/crates.io-index"
1701+checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
1702+
1703+[[package]]
1704+name = "unicode-ident"
1705+version = "1.0.24"
1706+source = "registry+https://github.com/rust-lang/crates.io-index"
1707+checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
1708+
1709+[[package]]
1710+name = "unicode-segmentation"
1711+version = "1.13.3"
1712+source = "registry+https://github.com/rust-lang/crates.io-index"
1713+checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
1714+
1715+[[package]]
1716+name = "uniffi"
1717+version = "0.32.0"
1718+source = "registry+https://github.com/rust-lang/crates.io-index"
1719+checksum = "a782a48d72cfd7a2d65cfc7c691dbf5375c43104b3c195f7eccc716dcc3540c8"
1720+dependencies = [
1721+ "anyhow",
1722+ "cargo_metadata",
1723+ "uniffi_bindgen",
1724+ "uniffi_core",
1725+ "uniffi_macros",
1726+ "uniffi_pipeline",
1727+]
1728+
1729+[[package]]
1730+name = "uniffi_bindgen"
1731+version = "0.32.0"
1732+source = "registry+https://github.com/rust-lang/crates.io-index"
1733+checksum = "533b0312c73e3b54eb78a4b257ceae390962dd4767995778309a74644643f9ac"
1734+dependencies = [
1735+ "anyhow",
1736+ "askama",
1737+ "camino",
1738+ "cargo_metadata",
1739+ "fs-err",
1740+ "glob",
1741+ "goblin",
1742+ "heck 0.5.0",
1743+ "indexmap",
1744+ "once_cell",
1745+ "serde",
1746+ "tempfile",
1747+ "textwrap",
1748+ "toml",
1749+ "uniffi_internal_macros",
1750+ "uniffi_meta",
1751+ "uniffi_pipeline",
1752+ "uniffi_udl",
1753+]
1754+
1755+[[package]]
1756+name = "uniffi_core"
1757+version = "0.32.0"
1758+source = "registry+https://github.com/rust-lang/crates.io-index"
1759+checksum = "8e32e261c5b0dfaba6488f536e71957dddd6b1a498ac7eb791bee56b60a086be"
1760+dependencies = [
1761+ "anyhow",
1762+ "bytes",
1763+ "once_cell",
1764+ "static_assertions",
1765+]
1766+
1767+[[package]]
1768+name = "uniffi_internal_macros"
1769+version = "0.32.0"
1770+source = "registry+https://github.com/rust-lang/crates.io-index"
1771+checksum = "84ae78069a5e6772ef694fd5bdb628532c88d2c2f0e7142bf6a384636eadb1af"
1772+dependencies = [
1773+ "anyhow",
1774+ "indexmap",
1775+ "proc-macro2",
1776+ "quote",
1777+ "syn 2.0.119",
1778+]
1779+
1780+[[package]]
1781+name = "uniffi_macros"
1782+version = "0.32.0"
1783+source = "registry+https://github.com/rust-lang/crates.io-index"
1784+checksum = "330be6770532e86320df31f54c70bb0be67588594e8e77fa56e9083a3fed5d0d"
1785+dependencies = [
1786+ "camino",
1787+ "fs-err",
1788+ "once_cell",
1789+ "proc-macro2",
1790+ "quote",
1791+ "serde",
1792+ "syn 2.0.119",
1793+ "toml",
1794+ "uniffi_meta",
1795+]
1796+
1797+[[package]]
1798+name = "uniffi_meta"
1799+version = "0.32.0"
1800+source = "registry+https://github.com/rust-lang/crates.io-index"
1801+checksum = "78de021f5547e56ab16c665a49d67d4fd3d31e77422f7739a2e9359d328cd9e7"
1802+dependencies = [
1803+ "anyhow",
1804+ "siphasher",
1805+ "uniffi_internal_macros",
1806+ "uniffi_pipeline",
1807+]
1808+
1809+[[package]]
1810+name = "uniffi_pipeline"
1811+version = "0.32.0"
1812+source = "registry+https://github.com/rust-lang/crates.io-index"
1813+checksum = "3f8201bb1907ed8a42d80e11cbc25c8a033e7a31c3cff1d911f56eedb81d4948"
1814+dependencies = [
1815+ "anyhow",
1816+ "heck 0.5.0",
1817+ "indexmap",
1818+ "tempfile",
1819+ "uniffi_internal_macros",
1820+]
1821+
1822+[[package]]
1823+name = "uniffi_udl"
1824+version = "0.32.0"
1825+source = "registry+https://github.com/rust-lang/crates.io-index"
1826+checksum = "a6e57996bc58009cc29bf04845d627ae313c2547b87171c1c349d6c51a1656c0"
1827+dependencies = [
1828+ "anyhow",
1829+ "textwrap",
1830+ "uniffi_meta",
1831+ "weedle2",
1832+]
1833+
1834+[[package]]
1835+name = "universal-hash"
1836+version = "0.5.1"
1837+source = "registry+https://github.com/rust-lang/crates.io-index"
1838+checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
1839+dependencies = [
1840+ "crypto-common",
1841+ "subtle",
1842+]
1843+
1844+[[package]]
1845+name = "url"
1846+version = "2.5.7"
1847+source = "registry+https://github.com/rust-lang/crates.io-index"
1848+checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b"
1849+dependencies = [
1850+ "form_urlencoded",
1851+ "idna",
1852+ "percent-encoding",
1853+ "serde",
1854+]
1855+
1856+[[package]]
1857+name = "utf8_iter"
1858+version = "1.0.4"
1859+source = "registry+https://github.com/rust-lang/crates.io-index"
1860+checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
1861+
1862+[[package]]
1863+name = "version_check"
1864+version = "0.9.5"
1865+source = "registry+https://github.com/rust-lang/crates.io-index"
1866+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
1867+
1868+[[package]]
1869+name = "wallet-engine"
1870+version = "0.0.7"
1871+dependencies = [
1872+ "aes",
1873+ "async-trait",
1874+ "base64",
1875+ "curve25519-dalek",
1876+ "ed25519-dalek",
1877+ "futures",
1878+ "getrandom 0.3.4",
1879+ "hmac",
1880+ "num-bigint",
1881+ "pbkdf2",
1882+ "serde",
1883+ "serde_json",
1884+ "sha2",
1885+ "subtle",
1886+ "thiserror",
1887+ "ton",
1888+ "ton-connect-client",
1889+ "ton-connect-core",
1890+ "uniffi",
1891+ "url",
1892+ "zeroize",
1893+]
1894+
1895+[[package]]
1896+name = "wasi"
1897+version = "0.11.1+wasi-snapshot-preview1"
1898+source = "registry+https://github.com/rust-lang/crates.io-index"
1899+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
1900+
1901+[[package]]
1902+name = "wasip2"
1903+version = "1.0.4+wasi-0.2.12"
1904+source = "registry+https://github.com/rust-lang/crates.io-index"
1905+checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"
1906+dependencies = [
1907+ "wit-bindgen",
1908+]
1909+
1910+[[package]]
1911+name = "wasm-bindgen"
1912+version = "0.2.127"
1913+source = "registry+https://github.com/rust-lang/crates.io-index"
1914+checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70"
1915+dependencies = [
1916+ "cfg-if",
1917+ "once_cell",
1918+ "rustversion",
1919+ "wasm-bindgen-macro",
1920+ "wasm-bindgen-shared",
1921+]
1922+
1923+[[package]]
1924+name = "wasm-bindgen-macro"
1925+version = "0.2.127"
1926+source = "registry+https://github.com/rust-lang/crates.io-index"
1927+checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1"
1928+dependencies = [
1929+ "quote",
1930+ "wasm-bindgen-macro-support",
1931+]
1932+
1933+[[package]]
1934+name = "wasm-bindgen-macro-support"
1935+version = "0.2.127"
1936+source = "registry+https://github.com/rust-lang/crates.io-index"
1937+checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284"
1938+dependencies = [
1939+ "bumpalo",
1940+ "proc-macro2",
1941+ "quote",
1942+ "syn 2.0.119",
1943+ "wasm-bindgen-shared",
1944+]
1945+
1946+[[package]]
1947+name = "wasm-bindgen-shared"
1948+version = "0.2.127"
1949+source = "registry+https://github.com/rust-lang/crates.io-index"
1950+checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf"
1951+dependencies = [
1952+ "unicode-ident",
1953+]
1954+
1955+[[package]]
1956+name = "weedle2"
1957+version = "5.0.0"
1958+source = "registry+https://github.com/rust-lang/crates.io-index"
1959+checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
1960+dependencies = [
1961+ "nom",
1962+]
1963+
1964+[[package]]
1965+name = "windows-core"
1966+version = "0.62.2"
1967+source = "registry+https://github.com/rust-lang/crates.io-index"
1968+checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
1969+dependencies = [
1970+ "windows-implement",
1971+ "windows-interface",
1972+ "windows-link",
1973+ "windows-result",
1974+ "windows-strings",
1975+]
1976+
1977+[[package]]
1978+name = "windows-implement"
1979+version = "0.60.2"
1980+source = "registry+https://github.com/rust-lang/crates.io-index"
1981+checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
1982+dependencies = [
1983+ "proc-macro2",
1984+ "quote",
1985+ "syn 2.0.119",
1986+]
1987+
1988+[[package]]
1989+name = "windows-interface"
1990+version = "0.59.3"
1991+source = "registry+https://github.com/rust-lang/crates.io-index"
1992+checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
1993+dependencies = [
1994+ "proc-macro2",
1995+ "quote",
1996+ "syn 2.0.119",
1997+]
1998+
1999+[[package]]
2000+name = "windows-link"
2001+version = "0.2.1"
2002+source = "registry+https://github.com/rust-lang/crates.io-index"
2003+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
2004+
2005+[[package]]
2006+name = "windows-result"
2007+version = "0.4.1"
2008+source = "registry+https://github.com/rust-lang/crates.io-index"
2009+checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
2010+dependencies = [
2011+ "windows-link",
2012+]
2013+
2014+[[package]]
2015+name = "windows-strings"
2016+version = "0.5.1"
2017+source = "registry+https://github.com/rust-lang/crates.io-index"
2018+checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
2019+dependencies = [
2020+ "windows-link",
2021+]
2022+
2023+[[package]]
2024+name = "windows-sys"
2025+version = "0.61.2"
2026+source = "registry+https://github.com/rust-lang/crates.io-index"
2027+checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
2028+dependencies = [
2029+ "windows-link",
2030+]
2031+
2032+[[package]]
2033+name = "winnow"
2034+version = "0.5.40"
2035+source = "registry+https://github.com/rust-lang/crates.io-index"
2036+checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
2037+dependencies = [
2038+ "memchr",
2039+]
2040+
2041+[[package]]
2042+name = "winnow"
2043+version = "1.0.4"
2044+source = "registry+https://github.com/rust-lang/crates.io-index"
2045+checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
2046+dependencies = [
2047+ "memchr",
2048+]
2049+
2050+[[package]]
2051+name = "wit-bindgen"
2052+version = "0.57.1"
2053+source = "registry+https://github.com/rust-lang/crates.io-index"
2054+checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
2055+
2056+[[package]]
2057+name = "writeable"
2058+version = "0.6.3"
2059+source = "registry+https://github.com/rust-lang/crates.io-index"
2060+checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
2061+
2062+[[package]]
2063+name = "wyz"
2064+version = "0.5.1"
2065+source = "registry+https://github.com/rust-lang/crates.io-index"
2066+checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
2067+dependencies = [
2068+ "tap",
2069+]
2070+
2071+[[package]]
2072+name = "yoke"
2073+version = "0.8.3"
2074+source = "registry+https://github.com/rust-lang/crates.io-index"
2075+checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5"
2076+dependencies = [
2077+ "stable_deref_trait",
2078+ "yoke-derive",
2079+ "zerofrom",
2080+]
2081+
2082+[[package]]
2083+name = "yoke-derive"
2084+version = "0.8.2"
2085+source = "registry+https://github.com/rust-lang/crates.io-index"
2086+checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
2087+dependencies = [
2088+ "proc-macro2",
2089+ "quote",
2090+ "syn 2.0.119",
2091+ "synstructure",
2092+]
2093+
2094+[[package]]
2095+name = "zerofrom"
2096+version = "0.1.8"
2097+source = "registry+https://github.com/rust-lang/crates.io-index"
2098+checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
2099+dependencies = [
2100+ "zerofrom-derive",
2101+]
2102+
2103+[[package]]
2104+name = "zerofrom-derive"
2105+version = "0.1.7"
2106+source = "registry+https://github.com/rust-lang/crates.io-index"
2107+checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
2108+dependencies = [
2109+ "proc-macro2",
2110+ "quote",
2111+ "syn 2.0.119",
2112+ "synstructure",
2113+]
2114+
2115+[[package]]
2116+name = "zeroize"
2117+version = "1.9.0"
2118+source = "registry+https://github.com/rust-lang/crates.io-index"
2119+checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
2120+dependencies = [
2121+ "zeroize_derive",
2122+]
2123+
2124+[[package]]
2125+name = "zeroize_derive"
2126+version = "1.5.0"
2127+source = "registry+https://github.com/rust-lang/crates.io-index"
2128+checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328"
2129+dependencies = [
2130+ "proc-macro2",
2131+ "quote",
2132+ "syn 2.0.119",
2133+]
2134+
2135+[[package]]
2136+name = "zerotrie"
2137+version = "0.2.4"
2138+source = "registry+https://github.com/rust-lang/crates.io-index"
2139+checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
2140+dependencies = [
2141+ "displaydoc",
2142+ "yoke",
2143+ "zerofrom",
2144+]
2145+
2146+[[package]]
2147+name = "zerovec"
2148+version = "0.11.6"
2149+source = "registry+https://github.com/rust-lang/crates.io-index"
2150+checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
2151+dependencies = [
2152+ "yoke",
2153+ "zerofrom",
2154+ "zerovec-derive",
2155+]
2156+
2157+[[package]]
2158+name = "zerovec-derive"
2159+version = "0.11.3"
2160+source = "registry+https://github.com/rust-lang/crates.io-index"
2161+checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
2162+dependencies = [
2163+ "proc-macro2",
2164+ "quote",
2165+ "syn 2.0.119",
2166+]
2167+
2168+[[package]]
2169+name = "zmij"
2170+version = "1.0.23"
2171+source = "registry+https://github.com/rust-lang/crates.io-index"
2172+checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
TMessagesProj/jni/gram-wallet/Cargo.tomlnew file+33
@@ -0,0 +1,33 @@
1+[package]
2+name = "gram-wallet"
3+version = "0.1.0"
4+edition = "2024"
5+publish = false
6+
7+[workspace]
8+
9+[lib]
10+crate-type = ["rlib", "staticlib", "cdylib"]
11+
12+[dependencies]
13+wallet-engine = { path = "../wallet-engine" }
14+ton-connect-core = { path = "../wallet-engine/crates/ton-connect-core" }
15+ton = { path = "../wallet-engine/vendor/ton", default-features = false }
16+async-trait = "=0.1.89"
17+base64 = "=0.22.1"
18+futures = "=0.3.31"
19+hex = "=0.4.3"
20+serde = { version = "=1.0.229", features = ["derive"] }
21+serde_json = "=1.0.151"
22+thiserror = "=2.0.17"
23+uniffi = "=0.32.0"
24+url = "=2.5.7"
25+zeroize = "=1.9.0"
26+
27+[profile.release]
28+codegen-units = 1
29+debug = false
30+incremental = false
31+lto = false
32+opt-level = "z"
33+panic = "abort"
TMessagesProj/jni/gram-wallet/rust-toolchain.tomlnew file+3
@@ -0,0 +1,3 @@
1+[toolchain]
2+channel = "1.96.1"
3+components = ["rustfmt", "clippy"]
TMessagesProj/jni/gram-wallet/src/lib.rsnew file+92
@@ -0,0 +1,92 @@
1+//! App-owned MTProto adaptation. Wallet account construction and proof signing
2+//! use wallet-engine's public API; no engine internals are imported here.
3+
4+mod ton_connect;
5+
6+pub use ton_connect::gram_ton_connect_crypto;
7+
8+use base64::{Engine as _, engine::general_purpose::STANDARD};
9+use ton::{
10+ block_tlb::Msg,
11+ ton_core::{cell::TonCell, traits::tlb::TLB},
12+};
13+
14+uniffi::setup_scaffolding!();
15+wallet_engine::uniffi_reexport_scaffolding!();
16+
17+#[derive(Debug, thiserror::Error, uniffi::Error)]
18+pub enum GramWalletError {
19+ #[error("Invalid Gram Wallet protocol data")]
20+ InvalidData,
21+ #[error("{message}")]
22+ Protocol { message: String },
23+}
24+
25+type Result<T> = std::result::Result<T, GramWalletError>;
26+
27+fn checked<T, E>(value: std::result::Result<T, E>) -> Result<T> {
28+ value.map_err(|_| GramWalletError::InvalidData)
29+}
30+
31+/// Validates the single-root BoC envelope before passing untrusted cells to the wallet.
32+#[uniffi::export]
33+pub fn is_valid_cell_boc(boc: String) -> bool {
34+ ton_connect_core::CellBoc::try_from(boc).is_ok()
35+}
36+
37+/// Hash of the message body, as used by the MTProto transaction matcher.
38+/// This deliberately differs from the hash of the complete external message.
39+#[uniffi::export]
40+pub fn message_body_hash(boc: String) -> Result<String> {
41+ let message = checked(Msg::<TonCell>::from_boc(checked(STANDARD.decode(boc))?))?;
42+ Ok(STANDARD.encode(checked(message.body.value.cell_hash())?.as_slice()))
43+}
44+
45+#[cfg(test)]
46+mod tests {
47+ use super::*;
48+ use ton::{
49+ block_tlb::{CommonMsgInfo, CommonMsgInfoExtIn, CommonMsgInfoInt},
50+ ton_core::types::{
51+ TonAddress,
52+ tlb_core::{EitherRefLayout, MsgAddressExt, TLBCoins, TLBEitherRef},
53+ },
54+ };
55+
56+ #[test]
57+ fn hashes_body_for_both_delivery_forms_and_cell_layouts() {
58+ let address: TonAddress =
59+ "0:1111111111111111111111111111111111111111111111111111111111111111"
60+ .parse()
61+ .unwrap();
62+ let mut body = TonCell::builder();
63+ body.write_bits([0x12, 0x34], 16).unwrap();
64+ let body = body.build().unwrap();
65+ let expected = STANDARD.encode(body.cell_hash().unwrap().as_slice());
66+ let external = CommonMsgInfo::ExtIn(CommonMsgInfoExtIn {
67+ src: MsgAddressExt::NONE,
68+ dst: address.to_msg_address_int(),
69+ import_fee: TLBCoins::ZERO,
70+ });
71+ let internal = CommonMsgInfo::Int(CommonMsgInfoInt::new(
72+ address.to_msg_address(),
73+ TLBCoins::ZERO,
74+ ));
75+ for info in [external, internal] {
76+ for layout in [EitherRefLayout::ToRef, EitherRefLayout::ToCell] {
77+ let mut message = Msg::new(info.clone(), body.clone());
78+ message.body = TLBEitherRef::new_with_layout(body.clone(), layout);
79+ assert_eq!(
80+ message_body_hash(STANDARD.encode(message.to_boc().unwrap())).unwrap(),
81+ expected
82+ );
83+ assert_ne!(
84+ STANDARD.encode(message.to_cell().unwrap().cell_hash().unwrap().as_slice()),
85+ expected
86+ );
87+ }
88+ }
89+ assert!(message_body_hash("invalid".to_owned()).is_err());
90+ assert!(message_body_hash(STANDARD.encode(body.to_boc().unwrap())).is_err());
91+ }
92+}
TMessagesProj/jni/gram-wallet/src/ton_connect.rsnew file+538
@@ -0,0 +1,538 @@
1+use std::sync::Arc;
2+
3+use base64::{Engine as _, engine::general_purpose::STANDARD};
4+use serde::Deserialize;
5+use serde_json::{Value, json};
6+use wallet_engine::*;
7+use zeroize::Zeroizing;
8+
9+use crate::{GramWalletError, Result};
10+
11+fn invalid(message: impl Into<String>) -> GramWalletError {
12+ GramWalletError::Protocol {
13+ message: message.into(),
14+ }
15+}
16+
17+fn protocol<T, E: std::fmt::Display>(
18+ operation: &str,
19+ result: std::result::Result<T, E>,
20+) -> Result<T> {
21+ result.map_err(|error| invalid(format!("{operation}: {error}")))
22+}
23+
24+#[derive(Deserialize)]
25+#[serde(rename_all = "camelCase", deny_unknown_fields)]
26+struct Parameters {
27+ dapp_client_id: String,
28+ session_nonce: String,
29+ wallet_public_key: String,
30+ wallet_address: String,
31+ #[serde(default)]
32+ client_id: Option<String>,
33+ #[serde(default)]
34+ challenge: Option<String>,
35+ #[serde(default)]
36+ decrypt: Option<String>,
37+ #[serde(default)]
38+ encrypt: Option<Value>,
39+ #[serde(default)]
40+ account: bool,
41+ #[serde(default)]
42+ proof_domain: Option<String>,
43+ #[serde(default)]
44+ proof_payload: Option<String>,
45+ #[serde(default)]
46+ sign_data: Option<ton_connect_core::SignDataPayload>,
47+ #[serde(default)]
48+ sign_domain: Option<String>,
49+ #[serde(default)]
50+ timestamp: Option<u64>,
51+}
52+
53+// An invocation can only read the already-authorized phrase. It cannot persist
54+// secrets, submit transactions, or modify a journal.
55+struct PhraseHost(Zeroizing<String>);
56+
57+fn unavailable() -> ProtectedSecretHostError {
58+ ProtectedSecretHostError::Failed {
59+ kind: ProtectedSecretHostErrorKind::PolicyViolation,
60+ diagnostic: "Unsupported adapter operation".to_owned(),
61+ }
62+}
63+
64+#[async_trait::async_trait]
65+impl WalletPlatformHost for PhraseHost {
66+ async fn read_protected_secret(
67+ &self,
68+ request: ProtectedSecretRead,
69+ ) -> std::result::Result<Vec<u8>, ProtectedSecretHostError> {
70+ if !matches!(
71+ request.reason,
72+ SecretAccessReason::SignTonConnectProof
73+ | SecretAccessReason::DeriveTonConnectSessionKey
74+ | SecretAccessReason::SignTonConnectData
75+ ) {
76+ return Err(unavailable());
77+ }
78+ Ok(self.0.as_bytes().to_vec())
79+ }
80+ async fn store_protected_secret(
81+ &self,
82+ _: ProtectedSecretStore,
83+ ) -> std::result::Result<(), ProtectedSecretHostError> {
84+ Err(unavailable())
85+ }
86+ async fn delete_protected_secret(
87+ &self,
88+ _: ProtectedSecretRef,
89+ ) -> std::result::Result<(), ProtectedSecretHostError> {
90+ Err(unavailable())
91+ }
92+ async fn load_journal(
93+ &self,
94+ _: JournalKey,
95+ ) -> std::result::Result<Option<JournalRecord>, JournalHostError> {
96+ Ok(None)
97+ }
98+ async fn compare_exchange_journal(
99+ &self,
100+ _: JournalCompareExchange,
101+ ) -> std::result::Result<JournalCompareExchangeResult, JournalHostError> {
102+ Err(JournalHostError::Failed {
103+ kind: JournalHostErrorKind::Unavailable,
104+ diagnostic: "No adapter journal".to_owned(),
105+ })
106+ }
107+}
108+
109+struct Session {
110+ derived: Arc<TonConnectDerivedSession>,
111+ lifecycle: Arc<WalletLifecycle>,
112+ descriptor: WalletDescriptor,
113+}
114+
115+impl Session {
116+ fn new(phrase: String, p: &Parameters) -> Result<Self> {
117+ let phrase = Zeroizing::new(phrase);
118+ let normalized = Zeroizing::new(
119+ phrase
120+ .split_whitespace()
121+ .map(str::to_lowercase)
122+ .collect::<Vec<_>>()
123+ .join(" "),
124+ );
125+ // The descriptor uses the immutable anchor; the derived session below
126+ // exposes the current signing key separately for the MTProto key check.
127+ let anchor = rotation_mnemonic_public_key(normalized.to_string())
128+ .map_err(|_| invalid("Invalid wallet recovery phrase"))?;
129+ let lifecycle = WalletLifecycle::new(Arc::new(PhraseHost(normalized)));
130+ // Gram Wallet currently uses mainnet, as does the Android WalletClient.
131+ let descriptor = WalletDescriptor {
132+ record_id: "ton-connect".to_owned(),
133+ address: protocol(
134+ "Parse wallet address",
135+ TonAddressString::try_from(p.wallet_address.clone()),
136+ )?,
137+ public_key: anchor,
138+ network: Network::Mainnet,
139+ secret_ref: ProtectedSecretRef {
140+ value: "wallet:ton-connect:mnemonic".to_owned(),
141+ },
142+ };
143+ // Upstream verifies that the descriptor's anchor key derives its address.
144+ protocol(
145+ "Validate wallet account",
146+ lifecycle.ton_connect_account(descriptor.clone()),
147+ )?;
148+ let derived = protocol(
149+ "Derive TON Connect session",
150+ futures::executor::block_on(lifecycle.derive_ton_connect_session(
151+ TonConnectDerivedSessionRequest {
152+ descriptor: descriptor.clone(),
153+ dapp_client_id: p.dapp_client_id.to_lowercase(),
154+ nonce: protocol("Decode session nonce", STANDARD.decode(&p.session_nonce))?,
155+ },
156+ )),
157+ )?;
158+ if protocol(
159+ "Decode wallet public key",
160+ STANDARD.decode(&p.wallet_public_key),
161+ )? != derived.signing_public_key()
162+ {
163+ return Err(invalid(
164+ "Recovery phrase does not match the current wallet signing key",
165+ ));
166+ }
167+ if let Some(expected) = &p.client_id {
168+ if !derived.public_key_hex().eq_ignore_ascii_case(expected) {
169+ return Err(invalid(
170+ "Derived session key does not match the registered client ID",
171+ ));
172+ }
173+ }
174+ Ok(Self {
175+ derived,
176+ lifecycle,
177+ descriptor,
178+ })
179+ }
180+
181+ fn client_id(&self) -> String {
182+ self.derived.public_key_hex()
183+ }
184+
185+ fn encrypt(&self, event: &Value) -> Result<String> {
186+ let body = protocol("Serialize TON Connect response", serde_json::to_vec(event))?;
187+ Ok(STANDARD.encode(protocol(
188+ "Encrypt TON Connect response",
189+ self.derived.encrypt_envelope(body),
190+ )?))
191+ }
192+}
193+
194+/// Stateless cryptographic adapter. Java owns TON Connect envelopes, methods,
195+/// capabilities and MTProto workflow; secret keys never leave this call.
196+#[uniffi::export]
197+pub fn gram_ton_connect_crypto(phrase: String, parameters: String) -> Result<String> {
198+ let p: Parameters = protocol("Parse crypto parameters", serde_json::from_str(&parameters))?;
199+ let session = Session::new(phrase, &p)?;
200+ let mut output = json!({"clientId": session.client_id()});
201+ if let Some(challenge) = &p.challenge {
202+ let bytes = protocol("Decode challenge", STANDARD.decode(challenge))?;
203+ let answer = Zeroizing::new(protocol(
204+ "Open session challenge",
205+ session.derived.open_challenge(bytes),
206+ )?);
207+ output["challengeAnswer"] = json!(STANDARD.encode(answer.as_slice()));
208+ }
209+ if let Some(body) = &p.decrypt {
210+ let body = protocol("Decode encrypted body", STANDARD.decode(body))?;
211+ if body.len() < 40 || body.len() > 1024 * 1024 {
212+ return Err(invalid("Encrypted body must be between 40 bytes and 1 MiB"));
213+ }
214+ let plaintext = Zeroizing::new(protocol(
215+ "Decrypt request",
216+ session.derived.decrypt_envelope(body),
217+ )?);
218+ output["plaintext"] = json!(protocol(
219+ "Decode UTF-8 request",
220+ std::str::from_utf8(&plaintext)
221+ )?);
222+ }
223+ if let Some(message) = &p.encrypt {
224+ output["body"] = json!(session.encrypt(message)?);
225+ }
226+ if p.account {
227+ let account = protocol(
228+ "Get wallet account",
229+ session
230+ .lifecycle
231+ .ton_connect_account(session.descriptor.clone()),
232+ )?;
233+ output["account"] = json!({"name":"ton_addr", "address":account.address,
234+ "network":account.network, "walletStateInit":account.wallet_state_init,
235+ "publicKey":hex::encode(protocol("Decode signing key", STANDARD.decode(&p.wallet_public_key))?)});
236+ }
237+ if let Some(domain) = &p.proof_domain {
238+ // The import proof uses this same signing format. Keep its domain
239+ // unavailable to dApps even if a caller skips the Java validation.
240+ if domain
241+ .trim_end_matches('.')
242+ .eq_ignore_ascii_case("telegram.org")
243+ {
244+ return Err(invalid(
245+ "The telegram.org proof domain is reserved for wallet import",
246+ ));
247+ }
248+ let timestamp = p
249+ .timestamp
250+ .filter(|t| *t > 0)
251+ .ok_or_else(|| invalid("Missing proof timestamp"))?;
252+ let payload = p
253+ .proof_payload
254+ .as_ref()
255+ .ok_or_else(|| invalid("Missing proof payload"))?;
256+ let signed = protocol(
257+ "Sign proof",
258+ futures::executor::block_on(session.lifecycle.sign_ton_connect_proof(
259+ TonConnectProofSignRequest {
260+ descriptor: session.descriptor.clone(),
261+ domain: domain.clone(),
262+ timestamp,
263+ payload: payload.clone(),
264+ },
265+ )),
266+ )?;
267+ output["signature"] = json!(STANDARD.encode(signed.signature));
268+ }
269+ if let Some(payload) = &p.sign_data {
270+ use ton_connect_core::SignDataPayload;
271+ let value = protocol("Serialize signing payload", serde_json::to_value(payload))?;
272+ let request = TonConnectSignDataRequest {
273+ payload: match payload {
274+ SignDataPayload::Text { text, .. } => {
275+ TonConnectSignDataPayload::Text { text: text.clone() }
276+ }
277+ SignDataPayload::Binary { bytes, .. } => TonConnectSignDataPayload::Binary {
278+ bytes: bytes.as_str().to_owned(),
279+ },
280+ SignDataPayload::Cell { schema, cell, .. } => TonConnectSignDataPayload::Cell {
281+ schema: schema.clone(),
282+ cell: cell.as_str().to_owned(),
283+ },
284+ },
285+ network: value
286+ .get("network")
287+ .and_then(Value::as_str)
288+ .map(str::to_owned),
289+ from: value.get("from").and_then(Value::as_str).map(str::to_owned),
290+ };
291+ let domain = p
292+ .sign_domain
293+ .as_deref()
294+ .filter(|d| !d.is_empty())
295+ .ok_or_else(|| invalid("Missing signing domain"))?;
296+ let timestamp = p
297+ .timestamp
298+ .filter(|t| *t > 0)
299+ .ok_or_else(|| invalid("Missing signing timestamp"))?;
300+ let signed = protocol(
301+ "Sign data",
302+ futures::executor::block_on(session.lifecycle.sign_ton_connect_data(
303+ TonConnectSignDataSignRequest {
304+ descriptor: session.descriptor.clone(),
305+ request,
306+ domain: domain.to_owned(),
307+ timestamp,
308+ },
309+ )),
310+ )?;
311+ let account = protocol(
312+ "Get signing account",
313+ session
314+ .lifecycle
315+ .ton_connect_account(session.descriptor.clone()),
316+ )?;
317+ output["signature"] = json!(STANDARD.encode(signed.signature));
318+ output["address"] = json!(account.address);
319+ }
320+ Ok(output.to_string())
321+}
322+
323+#[cfg(test)]
324+mod tests {
325+ use super::*;
326+ use ton::{
327+ block_tlb::StateInit,
328+ ton_core::{cell::TonHash, traits::tlb::TLB},
329+ ton_wallet::{WALLET_SUBWALLET_ID_DEFAULT, WalletData, WalletVersion},
330+ };
331+ use ton_connect_core::{
332+ ClientId, Ed25519PublicKey, Ed25519Signature, RawAccountAddress, SessionCrypto,
333+ SignatureDomain, ton_proof_signing_hash, verify_signature,
334+ };
335+ const PHRASE: &str =
336+ "notice tortoise soup strong gun divide offer process salon siren general carry";
337+ const ROTATED: &str = "notice tortoise soup strong gun divide offer process salon siren general carry clump left year void clutch tool case burden fix income champion lounge";
338+ fn parameters(peer: &SessionCrypto, phrase: &str) -> Value {
339+ let anchor = rotation_mnemonic_public_key(
340+ phrase
341+ .split_whitespace()
342+ .take(12)
343+ .collect::<Vec<_>>()
344+ .join(" "),
345+ )
346+ .unwrap();
347+ let code = WalletVersion::get_code(WalletVersion::Wallet)
348+ .unwrap()
349+ .clone();
350+ let data = WalletData::new(
351+ WALLET_SUBWALLET_ID_DEFAULT,
352+ TonHash::from_slice(&anchor).unwrap(),
353+ )
354+ .to_cell()
355+ .unwrap();
356+ let address = StateInit::new(code, data)
357+ .derive_address(0)
358+ .unwrap()
359+ .to_hex();
360+ let current_key = rotation_mnemonic_public_key(
361+ phrase.split_whitespace().collect::<Vec<_>>()[phrase.split_whitespace().count() - 12..]
362+ .join(" "),
363+ )
364+ .unwrap();
365+ json!({"dappClientId":peer.client_id().to_string(),"sessionNonce":STANDARD.encode([7u8;32]),
366+ "walletPublicKey":STANDARD.encode(current_key),"walletAddress":address})
367+ }
368+
369+ fn call(phrase: &str, p: &Value) -> Value {
370+ serde_json::from_str(&gram_ton_connect_crypto(phrase.to_owned(), p.to_string()).unwrap())
371+ .unwrap()
372+ }
373+
374+ #[test]
375+ fn derivation_matches_independent_vector() {
376+ let peer = SessionCrypto::generate().unwrap();
377+ let mut p = parameters(&peer, PHRASE);
378+ p["dappClientId"] = json!("11".repeat(32));
379+ // Reference vector from Python hashlib/hmac and OpenSSL X25519.
380+ p["sessionNonce"] = json!(STANDARD.encode([7u8; 32]));
381+ assert_eq!(
382+ call(PHRASE, &p)["clientId"],
383+ "908ba37dfad5b2d9898491ec4c8955f9342407261291d4065059d339d2c1f679"
384+ );
385+ }
386+
387+ #[test]
388+ fn boxes_and_challenges_interoperate_and_authenticate() {
389+ let peer = SessionCrypto::generate().unwrap();
390+ let mut p = parameters(&peer, PHRASE);
391+ let identity = call(PHRASE, &p);
392+ let client: ClientId = identity["clientId"].as_str().unwrap().parse().unwrap();
393+ p["clientId"] = identity["clientId"].clone();
394+ let request = br#"{"id":"request-ABC","method":"disconnect","params":[]}"#;
395+ p["decrypt"] = json!(STANDARD.encode(peer.encrypt(client, request).unwrap()));
396+ let ephemeral = SessionCrypto::generate().unwrap();
397+ let mut challenge = ephemeral.client_id().to_bytes().to_vec();
398+ challenge.extend(ephemeral.encrypt(client, &[42; 32]).unwrap());
399+ p["challenge"] = json!(STANDARD.encode(challenge));
400+ p["encrypt"] = json!({"id":"request-ABC","result":{}});
401+ let result = call(PHRASE, &p);
402+ assert_eq!(result["plaintext"], std::str::from_utf8(request).unwrap());
403+ assert_eq!(result["challengeAnswer"], STANDARD.encode([42; 32]));
404+ let response: Value = serde_json::from_slice(
405+ &peer
406+ .decrypt(
407+ client,
408+ &STANDARD.decode(result["body"].as_str().unwrap()).unwrap(),
409+ )
410+ .unwrap(),
411+ )
412+ .unwrap();
413+ assert_eq!(response, p["encrypt"]);
414+ assert_ne!(result["body"], call(PHRASE, &p)["body"]);
415+ let mut bad = p.clone();
416+ bad["clientId"] = json!(peer.client_id().to_string());
417+ assert!(gram_ton_connect_crypto(PHRASE.to_owned(), bad.to_string()).is_err());
418+ let mut body = STANDARD.decode(p["decrypt"].as_str().unwrap()).unwrap();
419+ *body.last_mut().unwrap() ^= 1;
420+ p["decrypt"] = json!(STANDARD.encode(body));
421+ assert!(gram_ton_connect_crypto(PHRASE.to_owned(), p.to_string()).is_err());
422+ }
423+
424+ #[test]
425+ fn rotated_session_preserves_sign_message_envelopes_and_rejects_stale_keys() {
426+ let peer = SessionCrypto::generate().unwrap();
427+ let mut p = parameters(&peer, ROTATED);
428+ let identity = call(ROTATED, &p);
429+ let client: ClientId = identity["clientId"].as_str().unwrap().parse().unwrap();
430+ let request = br#"{"id":"message-ABC","method":"signMessage","params":["{}"]}"#;
431+ p["decrypt"] = json!(STANDARD.encode(peer.encrypt(client, request).unwrap()));
432+ p["encrypt"] = json!({"id":"message-ABC", "result":{"internalBoc":"opaque"}});
433+ let result = call(ROTATED, &p);
434+ assert_eq!(result["plaintext"], std::str::from_utf8(request).unwrap());
435+ let response: Value = serde_json::from_slice(
436+ &peer
437+ .decrypt(
438+ client,
439+ &STANDARD.decode(result["body"].as_str().unwrap()).unwrap(),
440+ )
441+ .unwrap(),
442+ )
443+ .unwrap();
444+ assert_eq!(response, p["encrypt"]);
445+ p["walletPublicKey"] =
446+ json!(STANDARD.encode(rotation_mnemonic_public_key(ROTATED.to_owned()).unwrap()));
447+ assert!(gram_ton_connect_crypto(ROTATED.to_owned(), p.to_string()).is_err());
448+ }
449+
450+ #[test]
451+ fn signs_all_data_types_with_the_current_key_and_bound_context() {
452+ for phrase in [PHRASE, ROTATED] {
453+ let peer = SessionCrypto::generate().unwrap();
454+ let mut p = parameters(&peer, phrase);
455+ p["signDomain"] = json!("example.com");
456+ p["timestamp"] = json!(1700000000u64);
457+ for payload in [
458+ json!({"type":"text", "text":"Hello 🌍\nKeep this line", "network":"-239"}),
459+ json!({"type":"binary", "bytes":"AAEC/f7/"}),
460+ json!({"type":"cell", "schema":"empty$_ = Empty;", "cell":"te6ccgEBAQEAAgAAAA=="}),
461+ ] {
462+ p["signData"] = payload.clone();
463+ let signed = call(phrase, &p);
464+ let mut result: ton_connect_core::SignDataResult = serde_json::from_value(json!({
465+ "signature":signed["signature"], "address":signed["address"], "domain":"example.com",
466+ "timestamp":1700000000u64, "payload":payload
467+ })).unwrap();
468+ let key = Ed25519PublicKey::from_bytes(
469+ rotation_mnemonic_public_key(
470+ phrase.split_whitespace().collect::<Vec<_>>()
471+ [phrase.split_whitespace().count() - 12..]
472+ .join(" "),
473+ )
474+ .unwrap()
475+ .try_into()
476+ .unwrap(),
477+ );
478+ assert!(result.verify(&key).unwrap());
479+ result.domain = "other.example".to_owned();
480+ assert!(!result.verify(&key).unwrap());
481+ result.domain = "example.com".to_owned();
482+ result.timestamp += 1;
483+ assert!(!result.verify(&key).unwrap());
484+ }
485+ for payload in [
486+ json!({"type":"text", "text":"test", "network":"-3"}),
487+ json!({"type":"text", "text":"test", "from":"0:1111111111111111111111111111111111111111111111111111111111111111"}),
488+ json!({"type":"binary", "bytes":"bad!"}),
489+ json!({"type":"cell", "schema":"empty$_ = Empty;", "cell":"bad"}),
490+ ] {
491+ p["signData"] = payload;
492+ assert!(gram_ton_connect_crypto(phrase.to_owned(), p.to_string()).is_err());
493+ }
494+ }
495+ }
496+
497+ #[test]
498+ fn proof_uses_current_key_and_refuses_import_domain() {
499+ for phrase in [PHRASE, ROTATED] {
500+ let peer = SessionCrypto::generate().unwrap();
501+ let mut p = parameters(&peer, phrase);
502+ p["account"] = json!(true);
503+ p["proofDomain"] = json!("example.com");
504+ p["proofPayload"] = json!("challenge");
505+ p["timestamp"] = json!(1700000000u64);
506+ let result = call(phrase, &p);
507+ let address: RawAccountAddress = result["account"]["address"]
508+ .as_str()
509+ .unwrap()
510+ .parse()
511+ .unwrap();
512+ let hash =
513+ ton_proof_signing_hash(&address, "example.com", 1700000000, "challenge").unwrap();
514+ let signature = Ed25519Signature::from_bytes(
515+ STANDARD
516+ .decode(result["signature"].as_str().unwrap())
517+ .unwrap()
518+ .try_into()
519+ .unwrap(),
520+ );
521+ let key = Ed25519PublicKey::from_bytes(
522+ rotation_mnemonic_public_key(
523+ phrase.split_whitespace().collect::<Vec<_>>()
524+ [phrase.split_whitespace().count() - 12..]
525+ .join(" "),
526+ )
527+ .unwrap()
528+ .try_into()
529+ .unwrap(),
530+ );
531+ assert!(verify_signature(&hash, &signature, &key, SignatureDomain::Empty).unwrap());
532+ for domain in ["telegram.org", "TELEGRAM.ORG", "telegram.org."] {
533+ p["proofDomain"] = json!(domain);
534+ assert!(gram_ton_connect_crypto(phrase.to_owned(), p.to_string()).is_err());
535+ }
536+ }
537+ }
538+}
TMessagesProj/jni/gram-wallet/wallet-engine.patchnew file+1018
@@ -0,0 +1,1018 @@
1+diff --git a/WASM.md b/WASM.md
2+index 3d7c9f9..d4efc91 100644
3+--- a/WASM.md
4++++ b/WASM.md
5+@@ -292,10 +292,10 @@ const body = {kind: "rawPayload" as const, boc}
6+
7+ Supplying `recipientPublicKey` skips the recipient's `get_public_key` lookup,
8+ including for an uninitialized wallet. Omit it or pass `null` to use the lookup.
9+-The engine verifies locally that the supplied key derives the recipient address
10+-using [supported default wallet parameters](README.md#sending-gram).
11+-Unmatched keys or unsupported parameters are rejected before any HTTP request
12+-or protected-secret access. The engine asks the platform host for the protected
13++The supplied key is used directly, without checking whether it derives the
14++recipient address. The caller must provide the recipient's comment-decryption
15++key. Invalid key lengths are rejected before HTTP or protected-secret access.
16++The engine asks the platform host for the protected
17+ mnemonic with reason `"encryptComment"`. Put `body` into the same immutable
18+ intent passed to `previewSend` and `send`.
19+
20+diff --git a/src/domain/encrypted_comment.rs b/src/domain/encrypted_comment.rs
21+index 2b6de66..e84aa0f 100644
22+--- a/src/domain/encrypted_comment.rs
23++++ b/src/domain/encrypted_comment.rs
24+@@ -16,9 +16,8 @@ pub struct CreateEncryptedCommentRequest {
25+ pub comment: String,
26+ /// Optional 32-byte Ed25519 public key used instead of an on-chain lookup.
27+ ///
28+- /// The engine verifies this key against `recipient` by deriving supported
29+- /// wallet addresses with default parameters. A mismatch or unsupported
30+- /// wallet configuration is rejected before authorizing the sender's secret.
31++ /// Used directly without deriving or checking the recipient address. The
32++ /// caller must supply the key used by the recipient for comment decryption.
33+ #[serde(default)]
34+ #[uniffi(default = None)]
35+ pub recipient_public_key: Option<Vec<u8>>,
36+@@ -36,8 +35,8 @@ pub struct EncryptedCommentRecipientRequest {
37+ pub recipient: TonAddressString,
38+ /// Optional 32-byte Ed25519 public key used instead of an on-chain lookup.
39+ ///
40+- /// It is verified against `recipient` exactly as
41+- /// [`CreateEncryptedCommentRequest::recipient_public_key`] is.
42++ /// The host authenticates it as described by
43++ /// [`CreateEncryptedCommentRequest::recipient_public_key`].
44+ #[serde(default)]
45+ #[uniffi(default = None)]
46+ pub recipient_public_key: Option<Vec<u8>>,
47+diff --git a/src/domain/nft_send.rs b/src/domain/nft_send.rs
48+index d1cf4c1..2d474f6 100644
49+--- a/src/domain/nft_send.rs
50++++ b/src/domain/nft_send.rs
51+@@ -68,6 +68,16 @@ pub struct NftTransferPreviewRequest {
52+ pub intent: NftTransferIntent,
53+ }
54+
55++/// Requests signed NFT transfer delivery forms without submitting either one.
56++#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, uniffi::Record)]
57++#[serde(rename_all = "camelCase")]
58++pub struct PrepareNftTransferRequest {
59++ /// Correlation identifier, shared with the preview for a stable TEP-62 query ID.
60++ pub operation_id: NonEmptyString,
61++ /// Immutable NFT transfer choices.
62++ pub intent: NftTransferIntent,
63++}
64++
65+ /// Requests one owner-signed TEP-62 NFT transfer.
66+ #[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, uniffi::Record)]
67+ #[serde(rename_all = "camelCase")]
68+diff --git a/src/engine/encrypted_comment.rs b/src/engine/encrypted_comment.rs
69+index d0cfafb..321472d 100644
70+--- a/src/engine/encrypted_comment.rs
71++++ b/src/engine/encrypted_comment.rs
72+@@ -10,10 +10,9 @@ use crate::wallet::encrypted_comment::{
73+ encrypt_comment as encrypt_body, validate_encrypted_comment_body,
74+ };
75+ use crate::wallet::key_history::{KeyChange, recover_signing_keys};
76+-use crate::wallet::recipient_public_key::verify_recipient_public_key;
77+ use crate::{
78+ AccountStatus, Boc, CreateEncryptedCommentRequest, DecryptCommentRequest,
79+- EncryptedCommentRecipientRequest, HttpRequest, Network, ProtectedSecretRead, TonAddressString,
80++ EncryptedCommentRecipientRequest, HttpRequest, ProtectedSecretRead, TonAddressString,
81+ WalletClientConfig, WalletClientError,
82+ };
83+
84+@@ -42,8 +41,7 @@ impl WalletClient {
85+ /// wallet's `get_public_key` get-method, then asks the platform host to
86+ /// authorize this wallet's protected mnemonic. The sender key is this
87+ /// wallet's current signing key.
88+- /// A supplied key must locally derive the recipient's address using supported
89+- /// default wallet parameters. Verification happens before secret authorization.
90++ /// The host authenticates supplied recipient keys, including rotated keys.
91+ /// No secret is requested when the comment is already too large.
92+ /// The recipient key is resolved exactly as
93+ /// [`Self::resolve_encrypted_comment_recipient`] resolves it, including its
94+@@ -70,9 +68,6 @@ impl WalletClient {
95+ if state.active_send.is_some() || state.active_resolution.is_some() {
96+ return Err(WalletClientError::SendAlreadyInProgress);
97+ }
98+- if let Some(key) = &provided_public_key {
99+- verify_provided_recipient_key(&request.recipient, key, state.config.network)?;
100+- }
101+ let generation = next_resolution_generation(&mut state)?;
102+ let config = state.config.clone();
103+ let public_key_source = recipient_public_key_source(
104+@@ -148,7 +143,6 @@ impl WalletClient {
105+ let mut state = self.lock()?;
106+ ensure_running(&state)?;
107+ if let Some(key) = provided_public_key {
108+- verify_provided_recipient_key(&request.recipient, &key, state.config.network)?;
109+ return Ok(key.to_vec());
110+ }
111+ if state.active_send.is_some() || state.active_resolution.is_some() {
112+@@ -495,15 +489,6 @@ fn provided_recipient_key(key: Option<&[u8]>) -> Result<Option<[u8; 32]>, Wallet
113+ })
114+ }
115+
116+-fn verify_provided_recipient_key(
117+- recipient: &TonAddressString,
118+- key: &[u8; 32],
119+- network: Network,
120+-) -> Result<(), WalletClientError> {
121+- verify_recipient_public_key(recipient, key, network)
122+- .map_err(|error| encrypted_comment_error(error.to_string()))
123+-}
124+-
125+ fn next_resolution_generation(state: &mut State) -> Result<u64, WalletClientError> {
126+ state.resolution_generation = state
127+ .resolution_generation
128+@@ -862,13 +847,18 @@ mod tests {
129+ }
130+
131+ #[test]
132+- fn supplied_key_for_another_wallet_is_rejected_before_io() {
133++ fn supplied_key_need_not_derive_the_recipient_address() {
134++ const RECIPIENT_MNEMONIC: &str = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
135++ let recipient_wallet =
136++ derive_wallet(RECIPIENT_MNEMONIC, Network::Testnet).expect("recipient wallet derives");
137++ let key_address =
138++ TonAddressString::from_address(&recipient_wallet.address, Network::Testnet);
139+ let config = client_config();
140+- let recipient = config.address.clone();
141+- let correct_key = config.public_key.clone();
142+- let wrong_key = SigningKey::from_bytes(&[7; 32]).verifying_key().to_bytes();
143++ let source = config.address.clone();
144++ let recipient = TonAddressString::try_from(RECIPIENT).expect("recipient");
145++ assert_ne!(recipient, key_address);
146+ let http = Arc::new(PublicKeyHost {
147+- public_key: wrong_key,
148++ public_key: [0; 32],
149+ requests: Mutex::new(Vec::new()),
150+ });
151+ let platform = Arc::new(SecretHost {
152+@@ -877,20 +867,24 @@ mod tests {
153+ let client =
154+ WalletClient::new(config, http.clone(), platform.clone()).expect("client builds");
155+
156+- let error = block_on(
157++ let body = block_on(
158+ client.create_encrypted_comment(CreateEncryptedCommentRequest {
159+- recipient: recipient.clone(),
160+- comment: "must remain private".to_owned(),
161+- recipient_public_key: Some(wrong_key.to_vec()),
162++ recipient,
163++ comment: "use the supplied encryption key".to_owned(),
164++ recipient_public_key: Some(recipient_wallet.key_pair.public_key.to_vec()),
165+ }),
166+ )
167+- .expect_err("a key for another wallet must fail");
168++ .expect("supplied encryption key need not derive the destination address");
169++ let keys =
170++ comment_keys(RECIPIENT_MNEMONIC.as_bytes(), Network::Testnet, &key_address).unwrap();
171++ let plaintext = decrypt_comment_with_keys([&keys.signing], &source, &body)
172++ .expect("holder of the supplied key decrypts the comment");
173++ assert_eq!(plaintext, "use the supplied encryption key");
174++ assert!(http.requests.lock().expect("request lock").is_empty());
175+ assert_eq!(
176+- error,
177+- encrypted_comment_error(EncryptedCommentError::RecipientPublicKeyMismatch.to_string()),
178++ *platform.reasons.lock().expect("reason lock"),
179++ [SecretAccessReason::EncryptComment],
180+ );
181+- assert!(http.requests.lock().expect("request lock").is_empty());
182+- assert!(platform.reasons.lock().expect("reason lock").is_empty());
183+ assert!(
184+ client
185+ .lock()
186+@@ -898,20 +892,6 @@ mod tests {
187+ .active_resolution
188+ .is_none()
189+ );
190+-
191+- block_on(
192+- client.create_encrypted_comment(CreateEncryptedCommentRequest {
193+- recipient,
194+- comment: "the correct key still works".to_owned(),
195+- recipient_public_key: Some(correct_key),
196+- }),
197+- )
198+- .expect("rejected key does not leave a pending operation");
199+- assert!(http.requests.lock().expect("request lock").is_empty());
200+- assert_eq!(
201+- *platform.reasons.lock().expect("reason lock"),
202+- [SecretAccessReason::EncryptComment],
203+- );
204+ }
205+
206+ fn resolve(
207+@@ -984,7 +964,7 @@ mod tests {
208+ }
209+
210+ #[test]
211+- fn resolution_verifies_a_supplied_key_locally_even_while_the_slot_is_busy() {
212++ fn resolution_accepts_host_authenticated_keys_even_while_the_slot_is_busy() {
213+ let config = secretless_config();
214+ let recipient = config.address.clone();
215+ let correct_key = config.public_key.clone();
216+@@ -1000,10 +980,10 @@ mod tests {
217+ .expect("the supplied key derives the recipient"),
218+ correct_key
219+ );
220+- assert!(matches!(
221+- resolve(&client, recipient.clone(), Some(wrong_key.to_vec())),
222+- Err(WalletClientError::EncryptedCommentUnavailable { .. })
223+- ));
224++ assert_eq!(
225++ resolve(&client, recipient.clone(), Some(wrong_key.to_vec())).unwrap(),
226++ wrong_key.to_vec()
227++ );
228+ assert!(matches!(
229+ resolve(&client, recipient.clone(), Some(vec![7; 31])),
230+ Err(WalletClientError::EncryptedCommentUnavailable { .. })
231+diff --git a/src/engine/key_rotation.rs b/src/engine/key_rotation.rs
232+index cfded89..b41e18d 100644
233+--- a/src/engine/key_rotation.rs
234++++ b/src/engine/key_rotation.rs
235+@@ -16,7 +16,8 @@ use super::state::{OperationFamily, ensure_running};
236+
237+ #[uniffi::export]
238+ impl WalletClient {
239+- /// Generates a new signing half and a signed Wallet rev00 key-change message.
240++ /// Generates one new signing half and both signed Wallet rev00 delivery forms.
241++ /// `signed_boc` aliases the form selected by `request.message_kind`.
242+ ///
243+ /// The client first fetches fresh account state through its configured
244+ /// provider. Active wallets use the on-chain `seqno` getter, while an
245+@@ -182,6 +183,8 @@ impl WalletClient {
246+ },
247+ new_public_key: prepared.new_public_key.to_vec(),
248+ signed_boc: prepared.signed_boc,
249++ external_boc: prepared.external_boc,
250++ internal_boc: prepared.internal_boc,
251+ seqno,
252+ valid_until: request.valid_until,
253+ message_kind: request.message_kind,
254+diff --git a/src/engine/nft_transfer.rs b/src/engine/nft_transfer.rs
255+index c727fc4..052ced4 100644
256+--- a/src/engine/nft_transfer.rs
257++++ b/src/engine/nft_transfer.rs
258+@@ -3,8 +3,9 @@
259+ use crate::domain::bounded_diagnostic;
260+ use crate::wallet::nft_transfer::canonicalize_nft_transfer;
261+ use crate::{
262+- NftItem, NftTransferPreviewRequest, NftTransferRequest, SendPreview, SendPreviewRequest,
263+- SendRequest, SendResult, TonAddressString, WalletClientError,
264++ NftItem, NftTransferPreviewRequest, NftTransferRequest, PrepareNftTransferRequest,
265++ PrepareTransferRequest, PreparedTransfer, SendPreview, SendPreviewRequest, SendRequest,
266++ SendResult, TonAddressString, WalletClientError,
267+ };
268+
269+ use super::WalletClient;
270+@@ -13,6 +14,30 @@ use super::state::ensure_running;
271+
272+ #[uniffi::export]
273+ impl WalletClient {
274++ /// Validates ownership and emulation, then signs external and internal delivery
275++ /// alternatives without broadcasting or writing the send journal.
276++ pub async fn prepare_nft_transfer(
277++ &self,
278++ request: PrepareNftTransferRequest,
279++ ) -> Result<PreparedTransfer, WalletClientError> {
280++ let _preview = self
281++ .preview_nft_transfer(NftTransferPreviewRequest {
282++ operation_id: request.operation_id.clone(),
283++ intent: request.intent.clone(),
284++ })
285++ .await?;
286++ let source = self.nft_transfer_source()?;
287++ let canonical = canonicalize_nft_transfer(&request.operation_id, &source, &request.intent)
288++ .map_err(|error| {
289++ nft_unavailable(format!("failed to build TEP-62 transfer: {error}"))
290++ })?;
291++ self.prepare_transfer(PrepareTransferRequest {
292++ operation_id: request.operation_id,
293++ intent: canonical.intent,
294++ })
295++ .await
296++ }
297++
298+ /// Validates current ownership and emulates one typed TEP-62 NFT transfer.
299+ ///
300+ /// Reuse this request's operation ID for [`Self::send_nft_transfer`] after
301+diff --git a/src/engine/preview.rs b/src/engine/preview.rs
302+index 4a91f8a..2f60cfa 100644
303+--- a/src/engine/preview.rs
304++++ b/src/engine/preview.rs
305+@@ -29,6 +29,28 @@ impl WalletClient {
306+ &self,
307+ request: SendPreviewRequest,
308+ ) -> Result<SendPreview, WalletClientError> {
309++ self.preview_send_or_key_rotation(Some(request)).await
310++ }
311++
312++ /// Emulates external key rotation using public state and zero signatures.
313++ /// Never unlocks a secret, generates a replacement phrase, or submits a BOC.
314++ pub async fn preview_key_rotation(&self) -> Result<SendPreview, WalletClientError> {
315++ self.preview_send_or_key_rotation(None).await
316++ }
317++}
318++
319++impl WalletClient {
320++ async fn preview_send_or_key_rotation(
321++ &self,
322++ request: Option<SendPreviewRequest>,
323++ ) -> Result<SendPreview, WalletClientError> {
324++ let key_rotation = request.is_none();
325++ let request = request.unwrap_or_else(|| SendPreviewRequest {
326++ intent: crate::SendIntent {
327++ expiration: crate::SendExpiration::EngineDefault,
328++ messages: Vec::new(),
329++ },
330++ });
331+ let (
332+ generation,
333+ config,
334+@@ -89,10 +111,13 @@ impl WalletClient {
335+ })?;
336+
337+ let available = account.balance_nanograms.clone();
338+- let requested = request
339+- .intent
340+- .exact_value_total()
341+- .map_err(|_| self.preview_error(generation, WalletClientError::InvalidSendRequest))?;
342++ let requested = if key_rotation {
343++ Some(crate::UnsignedDecimalString::from(0_u64))
344++ } else {
345++ request.intent.exact_value_total().map_err(|_| {
346++ self.preview_error(generation, WalletClientError::InvalidSendRequest)
347++ })?
348++ };
349+
350+ if let Some(nanograms) = &requested
351+ && nanograms > &available
352+@@ -148,14 +173,27 @@ impl WalletClient {
353+ seqno,
354+ };
355+
356+- let boc = prepare_transfer_emulation(
357+- &expected_source,
358+- &config.public_key,
359+- config.network,
360+- &request,
361+- &fresh,
362+- valid_until,
363+- )
364++ let boc = if key_rotation {
365++ crate::wallet::key_rotation::prepare_key_rotation_emulation(
366++ &expected_source,
367++ &config.public_key,
368++ config.network,
369++ fresh.seqno,
370++ fresh.needs_state_init(),
371++ valid_until,
372++ )
373++ .map_err(|error| error.to_string())
374++ } else {
375++ prepare_transfer_emulation(
376++ &expected_source,
377++ &config.public_key,
378++ config.network,
379++ &request,
380++ &fresh,
381++ valid_until,
382++ )
383++ .map_err(|error| error.to_string())
384++ }
385+ .map_err(|error| {
386+ self.preview_error(
387+ generation,
388+@@ -205,7 +243,10 @@ impl WalletClient {
389+ self.finish_preview(generation)?;
390+ Ok(preview)
391+ }
392++}
393+
394++#[uniffi::export]
395++impl WalletClient {
396+ /// Emulates an already signed external-message BOC without submitting it.
397+ ///
398+ /// The request is validated against the configured source and fresh wallet
399+diff --git a/src/ton_connect/derived.rs b/src/ton_connect/derived.rs
400+index c08665e..e0809f3 100644
401+--- a/src/ton_connect/derived.rs
402++++ b/src/ton_connect/derived.rs
403+@@ -245,6 +245,18 @@ impl TonConnectDerivedSession {
404+ reason = "UniFFI exports owned records, byte buffers, and strings at the foreign-language boundary"
405+ )]
406+ impl TonConnectDerivedSession {
407++ /// Opens an opaque MTProto envelope for hosts that own RPC decoding.
408++ /// In particular, Gram Wallet also supports relayed `signMessage`.
409++ pub fn decrypt_envelope(&self, body: Vec<u8>) -> Result<Vec<u8>, TonConnectSessionError> {
410++ self.crypto.decrypt(self.peer, &body).map_err(session_error)
411++ }
412++
413++ /// Seals a host-validated protocol envelope without exporting session keys.
414++ pub fn encrypt_envelope(&self, body: Vec<u8>) -> Result<Vec<u8>, TonConnectSessionError> {
415++ let body = Zeroizing::new(body);
416++ self.crypto.encrypt(self.peer, &body).map_err(session_error)
417++ }
418++
419+ /// Returns the session public key `W` as 64 lowercase hex characters.
420+ #[must_use]
421+ pub fn public_key_hex(&self) -> String {
422+diff --git a/src/wallet/encrypted_comment.rs b/src/wallet/encrypted_comment.rs
423+index 1477d4e..238e4dd 100644
424+--- a/src/wallet/encrypted_comment.rs
425++++ b/src/wallet/encrypted_comment.rs
426+@@ -40,10 +40,6 @@ pub(crate) enum EncryptedCommentError {
427+ WalletIdentityMismatch,
428+ #[error("the peer Ed25519 public key is invalid")]
429+ InvalidPeerPublicKey,
430+- #[error(
431+- "the recipient public key does not match a supported wallet address with default parameters"
432+- )]
433+- RecipientPublicKeyMismatch,
434+ #[error("secure random generation failed")]
435+ RandomGeneration,
436+ #[error("the encrypted comment body is malformed")]
437+diff --git a/src/wallet/key_rotation.rs b/src/wallet/key_rotation.rs
438+index cbc3e6a..351bc24 100644
439+--- a/src/wallet/key_rotation.rs
440++++ b/src/wallet/key_rotation.rs
441+@@ -48,6 +48,8 @@ pub(crate) struct PreparedKeyRotationMaterial {
442+ pub(crate) replacement_mnemonic: SensitiveMnemonic,
443+ pub(crate) new_public_key: [u8; 32],
444+ pub(crate) signed_boc: Boc,
445++ pub(crate) external_boc: Boc,
446++ pub(crate) internal_boc: Boc,
447+ }
448+
449+ pub(crate) fn prepare_key_rotation(
450+@@ -143,24 +145,34 @@ fn prepare_with_new_half(
451+ .map_err(|_| KeyRotationError::Preparation)?
452+ .as_slice(),
453+ );
454+- let request = build_change_public_key_request(
455+- message_kind,
456+- wallet_id,
457+- valid_until,
458+- seqno,
459+- new_public_key,
460+- proof_signature.to_bytes(),
461+- encrypt_old_private_key(current_key, new_key),
462+- )
463+- .map_err(|_| KeyRotationError::Preparation)?;
464+- let signed_request = sign_cell(current_key, &request)?;
465+- let message = wrap_signed_request(wallet_address, message_kind, signed_request, state_init)?;
466+- let signed_boc = Boc::try_from(
467+- message
468+- .to_boc()
469+- .map_err(|_| KeyRotationError::Preparation)?,
470+- )
471+- .map_err(|_| KeyRotationError::Preparation)?;
472++ // Generate the replacement only once. The opcodes differ, so each delivery
473++ // form needs its own current-key signature over the same replacement key.
474++ let build = |kind, init| {
475++ let request = build_change_public_key_request(
476++ kind,
477++ wallet_id,
478++ valid_until,
479++ seqno,
480++ new_public_key,
481++ proof_signature.to_bytes(),
482++ encrypt_old_private_key(current_key, new_key),
483++ )
484++ .map_err(|_| KeyRotationError::Preparation)?;
485++ let signed_request = sign_cell(current_key, &request)?;
486++ let message = wrap_signed_request(wallet_address, kind, signed_request, init)?;
487++ Boc::try_from(
488++ message
489++ .to_boc()
490++ .map_err(|_| KeyRotationError::Preparation)?,
491++ )
492++ .map_err(|_| KeyRotationError::Preparation)
493++ };
494++ let external_boc = build(KeyRotationMessageKind::External, state_init.clone())?;
495++ let internal_boc = build(KeyRotationMessageKind::Internal, state_init)?;
496++ let signed_boc = match message_kind {
497++ KeyRotationMessageKind::External => external_boc.clone(),
498++ KeyRotationMessageKind::Internal => internal_boc.clone(),
499++ };
500+
501+ let mut replacement_phrase = Zeroizing::new(String::new());
502+ replacement_phrase.push_str(&current.anchor().to_phrase());
503+@@ -174,9 +186,71 @@ fn prepare_with_new_half(
504+ replacement_mnemonic,
505+ new_public_key,
506+ signed_boc,
507++ external_boc,
508++ internal_boc,
509+ })
510+ }
511+
512++/// Constructs an external rotation preview using public state only. Both the
513++/// owner signature and the new-key proof are zero placeholders; this BOC must
514++/// never authorize a real rotation, even if the emulation provider broadcasts it.
515++pub(crate) fn prepare_key_rotation_emulation(
516++ source: &TonAddressString,
517++ anchor_public_key: &[u8],
518++ network: Network,
519++ seqno: u32,
520++ needs_state_init: bool,
521++ valid_until: u64,
522++) -> Result<Boc, KeyRotationError> {
523++ let valid_until =
524++ u32::try_from(valid_until).map_err(|_| KeyRotationError::ExpirationOutOfRange)?;
525++ let wallet_id = match network {
526++ Network::Mainnet => ton::ton_wallet::WALLET_SUBWALLET_ID_DEFAULT,
527++ Network::Testnet => ton::ton_wallet::WALLET_SUBWALLET_ID_DEFAULT_TESTNET,
528++ };
529++ // Encoded Ed25519 base point: a valid public key unrelated to the wallet.
530++ let mut placeholder_key = [0x66; 32];
531++ placeholder_key[0] = 0x58;
532++ let request = build_change_public_key_request(
533++ KeyRotationMessageKind::External,
534++ wallet_id,
535++ valid_until,
536++ seqno,
537++ placeholder_key,
538++ [0; 64],
539++ [0; 32],
540++ )
541++ .map_err(|_| KeyRotationError::Preparation)?;
542++ let mut body = TonCell::builder();
543++ body.write_bits([0; 64], SIGNATURE_BITS)
544++ .map_err(|_| KeyRotationError::Preparation)?;
545++ body.write_cell(&request)
546++ .map_err(|_| KeyRotationError::Preparation)?;
547++ let body = body.build().map_err(|_| KeyRotationError::Preparation)?;
548++ let init = if needs_state_init {
549++ let (address, init) = derive_wallet_public_state(anchor_public_key, network)
550++ .map_err(|_| KeyRotationError::Preparation)?;
551++ if &address != source.as_address() {
552++ return Err(KeyRotationError::WalletIdentityMismatch);
553++ }
554++ Some(init)
555++ } else {
556++ None
557++ };
558++ let message = wrap_signed_request(
559++ source.as_address(),
560++ KeyRotationMessageKind::External,
561++ body,
562++ init,
563++ )?;
564++ Boc::try_from(
565++ message
566++ .to_boc()
567++ .map_err(|_| KeyRotationError::Preparation)?,
568++ )
569++ .map_err(|_| KeyRotationError::Preparation)
570++}
571++
572+ fn build_rotation_proof(wallet_address: &TonAddress) -> Result<TonCell, TonCoreError> {
573+ let workchain = i8::try_from(wallet_address.workchain).map_err(|_| {
574+ TonCoreError::Custom("Wallet key-rotation proof requires an int8 workchain".to_owned())
575+@@ -594,6 +668,149 @@ mod tests {
576+ ));
577+ }
578+
579++ #[test]
580++ fn paired_rotation_uses_one_replacement_and_verifiable_channel_signatures() {
581++ for phrase in [CURRENT_PHRASE, ROTATED_PHRASE] {
582++ let current = SensitiveMnemonic::from_bytes(phrase.as_bytes().to_vec()).unwrap();
583++ let wallet = derive_wallet(phrase, Network::Testnet).unwrap();
584++ let source = TonAddressString::from_address(&wallet.address, Network::Testnet);
585++ let material = prepare_key_rotation(
586++ &current,
587++ Network::Testnet,
588++ &source,
589++ SEQNO,
590++ false,
591++ u64::from(VALID_UNTIL),
592++ KeyRotationMessageKind::External,
593++ )
594++ .unwrap();
595++ let replacement =
596++ RotationMnemonic::parse(material.replacement_mnemonic.as_str().unwrap()).unwrap();
597++ let keys = derive_rotation_keys(&replacement);
598++ assert_eq!(
599++ keys.signing.verifying_key().to_bytes(),
600++ material.new_public_key
601++ );
602++ let current_keys = derive_rotation_keys(&RotationMnemonic::parse(phrase).unwrap());
603++ assert_eq!(
604++ keys.anchor.verifying_key(),
605++ current_keys.anchor.verifying_key()
606++ );
607++ assert_ne!(
608++ keys.signing.verifying_key(),
609++ current_keys.signing.verifying_key()
610++ );
611++ assert_eq!(material.signed_boc, material.external_boc);
612++ let proof = build_rotation_proof(&wallet.address).unwrap();
613++ let proof_signature = keys
614++ .signing
615++ .sign(proof.cell_hash().unwrap().as_slice())
616++ .to_bytes();
617++ for (kind, boc, opcode) in [
618++ (
619++ KeyRotationMessageKind::External,
620++ &material.external_boc,
621++ CHANGE_PUBLIC_KEY_EXTERNAL_OPCODE,
622++ ),
623++ (
624++ KeyRotationMessageKind::Internal,
625++ &material.internal_boc,
626++ CHANGE_PUBLIC_KEY_INTERNAL_OPCODE,
627++ ),
628++ ] {
629++ let message = Msg::<TonCell>::from_boc(boc.as_bytes().to_vec()).unwrap();
630++ assert!(matches!(
631++ (&message.info, kind),
632++ (CommonMsgInfo::ExtIn(_), KeyRotationMessageKind::External)
633++ | (CommonMsgInfo::Int(_), KeyRotationMessageKind::Internal)
634++ ));
635++ let request = build_change_public_key_request(
636++ kind,
637++ wallet.wallet_id,
638++ VALID_UNTIL,
639++ SEQNO,
640++ material.new_public_key,
641++ proof_signature,
642++ encrypt_old_private_key(&current_keys.signing, &keys.signing),
643++ )
644++ .unwrap();
645++ assert_signed_request(
646++ &message.body.value,
647++ &request,
648++ current_keys.signing.verifying_key().to_bytes(),
649++ opcode,
650++ material.new_public_key,
651++ );
652++ }
653++ }
654++ }
655++
656++ #[test]
657++ fn rotation_preview_has_no_valid_owner_or_replacement_signature() {
658++ let wallet = derive_wallet(CURRENT_PHRASE, Network::Testnet).unwrap();
659++ let keys = derive_rotation_keys(&RotationMnemonic::parse(CURRENT_PHRASE).unwrap());
660++ let source = TonAddressString::from_address(&wallet.address, Network::Testnet);
661++ for deploy in [false, true] {
662++ let boc = prepare_key_rotation_emulation(
663++ &source,
664++ &keys.anchor.verifying_key().to_bytes(),
665++ Network::Testnet,
666++ SEQNO,
667++ deploy,
668++ u64::from(VALID_UNTIL),
669++ )
670++ .unwrap();
671++ let message = Msg::<TonCell>::from_boc(boc.as_bytes().to_vec()).unwrap();
672++ assert!(matches!(message.info, CommonMsgInfo::ExtIn(_)));
673++ assert_eq!(message.init.is_some(), deploy);
674++ let mut parser = message.body.value.parser();
675++ let owner_signature = parser.read_bits(SIGNATURE_BITS).unwrap();
676++ assert_eq!(owner_signature, [0; 64]);
677++ assert_eq!(
678++ parser.read_num::<u32>(32).unwrap(),
679++ CHANGE_PUBLIC_KEY_EXTERNAL_OPCODE
680++ );
681++ let _ = parser.read_num::<u32>(32).unwrap();
682++ assert_eq!(parser.read_num::<u32>(32).unwrap(), VALID_UNTIL);
683++ assert_eq!(parser.read_num::<u32>(32).unwrap(), SEQNO);
684++ let key: [u8; 32] = parser.read_bits(256).unwrap().try_into().unwrap();
685++ let proof_cell = parser.read_next_ref().unwrap();
686++ let proof_signature = proof_cell.parser().read_bits(SIGNATURE_BITS).unwrap();
687++ assert_eq!(proof_signature, [0; 64]);
688++ assert_eq!(read_encrypted_old_private_key(&mut parser), [0; 32]);
689++ parser.ensure_empty().unwrap();
690++ let proof = build_rotation_proof(&wallet.address).unwrap();
691++ assert!(
692++ VerifyingKey::from_bytes(&key)
693++ .unwrap()
694++ .verify_strict(
695++ proof.cell_hash().unwrap().as_slice(),
696++ &Signature::from_slice(&proof_signature).unwrap()
697++ )
698++ .is_err()
699++ );
700++ let request = build_change_public_key_request(
701++ KeyRotationMessageKind::External,
702++ wallet.wallet_id,
703++ VALID_UNTIL,
704++ SEQNO,
705++ key,
706++ [0; 64],
707++ [0; 32],
708++ )
709++ .unwrap();
710++ assert!(
711++ keys.signing
712++ .verifying_key()
713++ .verify_strict(
714++ request.cell_hash().unwrap().as_slice(),
715++ &Signature::from_slice(&owner_signature).unwrap()
716++ )
717++ .is_err()
718++ );
719++ }
720++ }
721++
722+ fn deterministic_material(
723+ message_kind: KeyRotationMessageKind,
724+ ) -> (
725+diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs
726+index 8843ccb..4a58213 100644
727+--- a/src/wallet/mod.rs
728++++ b/src/wallet/mod.rs
729+@@ -10,7 +10,6 @@ pub(crate) mod key_rotation;
730+ pub(crate) mod mnemonic;
731+ mod mnemonic_scheme;
732+ pub(crate) mod nft_transfer;
733+-pub(crate) mod recipient_public_key;
734+ pub(crate) mod send;
735+ pub(crate) mod slip_0010;
736+ pub(crate) mod transfer;
737+@@ -217,6 +216,10 @@ pub struct PreparedKeyRotation {
738+ /// Its `ChangePublicKey` request holds two references: the new key's
739+ /// wallet-address proof signature and the encrypted old private key.
740+ pub signed_boc: Boc,
741++ /// External delivery form for the same replacement key, sequence and expiration.
742++ pub external_boc: Boc,
743++ /// Internal alternative; submit only one of the two delivery forms.
744++ pub internal_boc: Boc,
745+ /// Sequence number covered by the signed request.
746+ pub seqno: u32,
747+ /// Unix expiration timestamp covered by the signed request.
748+diff --git a/src/wallet/recipient_public_key.rs b/src/wallet/recipient_public_key.rs
749+deleted file mode 100644
750+index 5fb18f4..0000000
751+--- a/src/wallet/recipient_public_key.rs
752++++ /dev/null
753+@@ -1,265 +0,0 @@
754+-//! Local address binding for caller-supplied encrypted-comment public keys.
755+-
756+-use ton::block_tlb::StateInit;
757+-use ton::ton_core::cell::{TonCell, TonHash};
758+-use ton::ton_core::traits::tlb::TLB as _;
759+-use ton::ton_wallet::{
760+- WALLET_ID_DEFAULT, WALLET_SUBWALLET_ID_DEFAULT, WALLET_SUBWALLET_ID_DEFAULT_TESTNET,
761+- WALLET_V5R1_ID_DEFAULT, WALLET_V5R1_ID_DEFAULT_TESTNET, WalletData, WalletV1V2Data,
762+- WalletV3Data, WalletV4Data, WalletV5Data, WalletVersion,
763+-};
764+-
765+-use super::encrypted_comment::EncryptedCommentError;
766+-use crate::{Network, TonAddressString};
767+-
768+-/// Authenticates a supplied key by reconstructing standard initial wallet states.
769+-///
770+-/// This works before deployment and never trusts a provider response. V1-V5
771+-/// use their standard wallet IDs, including the workchain-aware SDK defaults;
772+-/// Wallet rev00 uses the engine's network-specific ID in workchain zero. Custom
773+-/// wallet IDs and unknown wallet contracts cannot be proven with only a key and
774+-/// are rejected. This binds only the initial key; a Wallet rev00 recipient
775+-/// running this engine still decrypts comments encrypted to it after a
776+-/// signing-key rotation, because decryption also tries the anchor key.
777+-pub(crate) fn verify_recipient_public_key(
778+- recipient: &TonAddressString,
779+- public_key: &[u8; 32],
780+- network: Network,
781+-) -> Result<(), EncryptedCommentError> {
782+- let public_key =
783+- TonHash::from_slice(public_key).map_err(|_| EncryptedCommentError::CellEncoding)?;
784+- let workchain = recipient.as_address().workchain;
785+-
786+- let data = WalletV1V2Data::new(public_key.clone())
787+- .to_cell()
788+- .map_err(|_| EncryptedCommentError::CellEncoding)?;
789+- if matches_versions(
790+- recipient,
791+- &[
792+- WalletVersion::V1R1,
793+- WalletVersion::V1R2,
794+- WalletVersion::V1R3,
795+- WalletVersion::V2R1,
796+- WalletVersion::V2R2,
797+- ],
798+- &data,
799+- )? {
800+- return Ok(());
801+- }
802+-
803+- // ton-org/ton's V3/V4 constructors add the workchain to the legacy ID.
804+- // Also recognize the fixed default used by the vendored constructors.
805+- let legacy_ids = [
806+- Some(WALLET_ID_DEFAULT),
807+- WALLET_ID_DEFAULT
808+- .checked_add(workchain)
809+- .filter(|id| *id != WALLET_ID_DEFAULT),
810+- ];
811+- for wallet_id in legacy_ids.into_iter().flatten() {
812+- let data = WalletV3Data::new(wallet_id, public_key.clone())
813+- .to_cell()
814+- .map_err(|_| EncryptedCommentError::CellEncoding)?;
815+- if matches_versions(
816+- recipient,
817+- &[WalletVersion::V3R1, WalletVersion::V3R2],
818+- &data,
819+- )? {
820+- return Ok(());
821+- }
822+- let data = WalletV4Data::new(wallet_id, public_key.clone())
823+- .to_cell()
824+- .map_err(|_| EncryptedCommentError::CellEncoding)?;
825+- if matches_versions(
826+- recipient,
827+- &[WalletVersion::V4R1, WalletVersion::V4R2],
828+- &data,
829+- )? {
830+- return Ok(());
831+- }
832+- }
833+-
834+- let (v5_id, wallet_id) = match network {
835+- Network::Mainnet => (WALLET_V5R1_ID_DEFAULT, WALLET_SUBWALLET_ID_DEFAULT),
836+- Network::Testnet => (
837+- WALLET_V5R1_ID_DEFAULT_TESTNET,
838+- WALLET_SUBWALLET_ID_DEFAULT_TESTNET,
839+- ),
840+- };
841+- let v5_ids = [
842+- Some(v5_id),
843+- v5_workchain_id(v5_id, workchain).filter(|id| *id != v5_id),
844+- ];
845+- for wallet_id in v5_ids.into_iter().flatten() {
846+- let data = WalletV5Data::new(wallet_id, public_key.clone())
847+- .to_cell()
848+- .map_err(|_| EncryptedCommentError::CellEncoding)?;
849+- if matches_versions(recipient, &[WalletVersion::V5R1], &data)? {
850+- return Ok(());
851+- }
852+- }
853+-
854+- if workchain == 0 {
855+- let data = WalletData::new(wallet_id, public_key)
856+- .to_cell()
857+- .map_err(|_| EncryptedCommentError::CellEncoding)?;
858+- if matches_versions(recipient, &[WalletVersion::Wallet], &data)? {
859+- return Ok(());
860+- }
861+- }
862+-
863+- Err(EncryptedCommentError::RecipientPublicKeyMismatch)
864+-}
865+-
866+-fn matches_versions(
867+- recipient: &TonAddressString,
868+- versions: &[WalletVersion],
869+- data: &TonCell,
870+-) -> Result<bool, EncryptedCommentError> {
871+- for &version in versions {
872+- let code =
873+- WalletVersion::get_code(version).map_err(|_| EncryptedCommentError::CellEncoding)?;
874+- let address = StateInit::new(code.clone(), data.clone())
875+- .derive_address(recipient.as_address().workchain)
876+- .map_err(|_| EncryptedCommentError::CellEncoding)?;
877+- if address == *recipient.as_address() {
878+- return Ok(true);
879+- }
880+- }
881+- Ok(false)
882+-}
883+-
884+-/// V5's client context encodes workchain as int8 immediately after its tag bit.
885+-/// See ton-org/ton's `WalletV5R1WalletId.ts`; the remaining default context bits
886+-/// and network ID are already encoded in the workchain-zero constant.
887+-fn v5_workchain_id(default_id: i32, workchain: i32) -> Option<i32> {
888+- let workchain = i8::try_from(workchain).ok()?;
889+- let workchain_bits = u32::from(u8::from_ne_bytes(workchain.to_ne_bytes())) << 23;
890+- Some(default_id ^ i32::from_ne_bytes(workchain_bits.to_ne_bytes()))
891+-}
892+-
893+-#[cfg(test)]
894+-mod tests {
895+- use ton::ton_core::types::TonAddress;
896+- use ton::ton_wallet::{KeyPair, TonWallet};
897+-
898+- use super::*;
899+-
900+- type TestResult = Result<(), Box<dyn std::error::Error>>;
901+-
902+- const PUBLIC_KEY: [u8; 32] = [0x5a; 32];
903+-
904+- fn wallet_address(
905+- version: WalletVersion,
906+- workchain: i32,
907+- wallet_id: i32,
908+- network: Network,
909+- ) -> Result<TonAddressString, Box<dyn std::error::Error>> {
910+- let wallet = TonWallet::new_with_params(
911+- version,
912+- KeyPair {
913+- public_key: PUBLIC_KEY,
914+- secret_key: [0; 64],
915+- },
916+- workchain,
917+- wallet_id,
918+- )?;
919+- Ok(TonAddressString::from_address(&wallet.address, network))
920+- }
921+-
922+- #[test]
923+- fn binds_all_supported_initial_wallet_versions_on_both_networks() -> TestResult {
924+- for network in [Network::Mainnet, Network::Testnet] {
925+- for version in [
926+- WalletVersion::V1R1,
927+- WalletVersion::V1R2,
928+- WalletVersion::V1R3,
929+- WalletVersion::V2R1,
930+- WalletVersion::V2R2,
931+- WalletVersion::V3R1,
932+- WalletVersion::V3R2,
933+- WalletVersion::V4R1,
934+- WalletVersion::V4R2,
935+- ] {
936+- let recipient = wallet_address(version, 0, WALLET_ID_DEFAULT, network)?;
937+- verify_recipient_public_key(&recipient, &PUBLIC_KEY, network)?;
938+- assert!(matches!(
939+- verify_recipient_public_key(&recipient, &[0x33; 32], network),
940+- Err(EncryptedCommentError::RecipientPublicKeyMismatch)
941+- ));
942+- }
943+- let (v5_id, wallet_id) = match network {
944+- Network::Mainnet => (WALLET_V5R1_ID_DEFAULT, WALLET_SUBWALLET_ID_DEFAULT),
945+- Network::Testnet => (
946+- WALLET_V5R1_ID_DEFAULT_TESTNET,
947+- WALLET_SUBWALLET_ID_DEFAULT_TESTNET,
948+- ),
949+- };
950+- for (version, wallet_id) in [
951+- (WalletVersion::V5R1, v5_id),
952+- (WalletVersion::Wallet, wallet_id),
953+- ] {
954+- let recipient = wallet_address(version, 0, wallet_id, network)?;
955+- verify_recipient_public_key(&recipient, &PUBLIC_KEY, network)?;
956+- assert!(matches!(
957+- verify_recipient_public_key(&recipient, &[0x33; 32], network),
958+- Err(EncryptedCommentError::RecipientPublicKeyMismatch)
959+- ));
960+- let other_network = match network {
961+- Network::Mainnet => Network::Testnet,
962+- Network::Testnet => Network::Mainnet,
963+- };
964+- assert!(matches!(
965+- verify_recipient_public_key(&recipient, &PUBLIC_KEY, other_network),
966+- Err(EncryptedCommentError::RecipientPublicKeyMismatch)
967+- ));
968+- }
969+- }
970+- Ok(())
971+- }
972+-
973+- #[test]
974+- fn binds_workchain_aware_standard_ids_and_address_spellings() -> TestResult {
975+- for (version, wallet_id) in [
976+- (WalletVersion::V3R2, 698_983_190),
977+- (WalletVersion::V4R2, 698_983_190),
978+- // Values independently pinned by the official V5 wallet-ID module.
979+- (WalletVersion::V5R1, 8_388_369),
980+- ] {
981+- let recipient = wallet_address(version, -1, wallet_id, Network::Mainnet)?;
982+- verify_recipient_public_key(&recipient, &PUBLIC_KEY, Network::Mainnet)?;
983+- let raw = TonAddressString::try_from(recipient.as_address().to_hex())?;
984+- verify_recipient_public_key(&raw, &PUBLIC_KEY, Network::Mainnet)?;
985+- }
986+- let recipient = wallet_address(WalletVersion::V5R1, -1, 8_388_605, Network::Testnet)?;
987+- verify_recipient_public_key(&recipient, &PUBLIC_KEY, Network::Testnet)?;
988+- Ok(())
989+- }
990+-
991+- #[test]
992+- fn rejects_nondefault_ids_unknown_contracts_and_unrelated_addresses() -> TestResult {
993+- let custom = wallet_address(WalletVersion::V4R2, 0, 42, Network::Mainnet)?;
994+- assert!(matches!(
995+- verify_recipient_public_key(&custom, &PUBLIC_KEY, Network::Mainnet),
996+- Err(EncryptedCommentError::RecipientPublicKeyMismatch)
997+- ));
998+- let unsupported = wallet_address(
999+- WalletVersion::HLV2R2,
1000+- 0,
1001+- WALLET_ID_DEFAULT,
1002+- Network::Mainnet,
1003+- )?;
1004+- assert!(matches!(
1005+- verify_recipient_public_key(&unsupported, &PUBLIC_KEY, Network::Mainnet),
1006+- Err(EncryptedCommentError::RecipientPublicKeyMismatch)
1007+- ));
1008+- let unrelated = TonAddressString::from_address(
1009+- &TonAddress::new(0, TonHash::from_slice(&[0x11; 32])?),
1010+- Network::Mainnet,
1011+- );
1012+- assert!(matches!(
1013+- verify_recipient_public_key(&unrelated, &PUBLIC_KEY, Network::Mainnet),
1014+- Err(EncryptedCommentError::RecipientPublicKeyMismatch)
1015+- ));
1016+- Ok(())
1017+- }
1018+-}
TMessagesProj/jni/prebuild/build_all.sh+2
@@ -27,8 +27,10 @@ build_scripts=(
2727 build_dav1d.sh
2828 build_ffmpeg.sh
2929 build_tlottie.sh
30+ build_wallet_engine.sh
3031 build_tdlib.sh
3132 build_wamr.sh
33+ build_prisma.sh
3234)
3335
3436for script in "${build_scripts[@]}"; do
TMessagesProj/jni/prebuild/build_prisma.shnew file+67
@@ -0,0 +1,67 @@
1+#!/usr/bin/env bash
2+# Compile libprisma into prebuild/lib/<ABI>/, using Telegram's shared build configuration.
3+set -Eeuo pipefail
4+
5+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+source "$SCRIPT_DIR/common.sh"
7+
8+PRISMA_SRC="${PRISMA_SOURCE_DIR:-$JNI_DIR/third_party/libprisma}"
9+PRISMA_BUILD_ROOT="${PRISMA_BUILD_ROOT:-$SCRIPT_DIR/build/prisma}"
10+BOOST_REGEX_SRC="${BOOST_REGEX_SOURCE_DIR:-$JNI_DIR/third_party/boost-regex}"
11+EXPECTED_BOOST_COMMIT=4cbcd3078e6ae10d05124379623a1bf03fcb9350
12+EXPECTED_COMMIT=31a5d6fbbef8136e4a2b3adaf7b95e2ccaa7436d
13+
14+require_ndk
15+require_cmake_ninja
16+require_command git
17+
18+[[ -f "$PRISMA_SRC/libprisma/SyntaxHighlighter.cpp" ]] || {
19+ echo "ERROR: Initialize the libprisma submodule: $PRISMA_SRC" >&2
20+ exit 1
21+}
22+actual_commit="$(git -C "$PRISMA_SRC" rev-parse HEAD)"
23+[[ "$actual_commit" == "$EXPECTED_COMMIT" ]] || {
24+ echo "ERROR: Expected libprisma $EXPECTED_COMMIT, found $actual_commit" >&2
25+ exit 1
26+}
27+
28+[[ -f "$BOOST_REGEX_SRC/include/boost/regex.hpp" ]] || {
29+ echo "ERROR: Initialize the Boost.Regex submodule: $BOOST_REGEX_SRC" >&2
30+ exit 1
31+}
32+actual_boost_commit="$(git -C "$BOOST_REGEX_SRC" rev-parse HEAD)"
33+[[ "$actual_boost_commit" == "$EXPECTED_BOOST_COMMIT" ]] || {
34+ echo "ERROR: Expected Boost.Regex $EXPECTED_BOOST_COMMIT, found $actual_boost_commit" >&2
35+ exit 1
36+}
37+
38+for abi in $ABIS; do
39+ build_dir="$PRISMA_BUILD_ROOT/$abi"
40+ out_dir="$(abi_output_dir "$abi")"
41+ echo "==> Building libprisma for $abi (API=$API)"
42+
43+ "$CMAKE_BIN" \
44+ -S "$JNI_DIR/prisma" \
45+ -B "$build_dir" \
46+ -G Ninja \
47+ -DCMAKE_MAKE_PROGRAM="$NINJA_BIN" \
48+ -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" \
49+ -DANDROID_ABI="$abi" \
50+ -DANDROID_PLATFORM="android-$API" \
51+ -DANDROID_STL=c++_static \
52+ -DCMAKE_BUILD_TYPE=Release \
53+ -DCMAKE_C_FLAGS="$CMAKE_REPRO_C_FLAGS" \
54+ -DCMAKE_CXX_FLAGS="$CMAKE_REPRO_CXX_FLAGS" \
55+ -DPRISMA_SOURCE_DIR="$PRISMA_SRC" \
56+ -DBOOST_REGEX_SOURCE_DIR="$BOOST_REGEX_SRC"
57+
58+ "$CMAKE_BIN" --build "$build_dir" --target prisma --parallel "$JOBS"
59+ archive="$build_dir/libprisma.a"
60+ [[ -f "$archive" ]] || {
61+ echo "ERROR: libprisma.a was not produced for $abi" >&2
62+ exit 1
63+ }
64+ copy_archive "$archive" "$out_dir/libprisma.a"
65+ # common.sh already supplies -g0/-fno-ident; do not strip/objcopy clang objects.
66+ echo " -> $out_dir/libprisma.a"
67+done
TMessagesProj/jni/prebuild/build_wallet_engine.shnew file+137
@@ -0,0 +1,137 @@
1+#!/usr/bin/env bash
2+# Regenerate the C++20 bindings and build Wallet Engine for all Android ABIs.
3+# Uses common.sh overrides: ABIS, API, JOBS, ANDROID_NDK_HOME, LIB_DIR, INCLUDE_DIR.
4+# Install Rust via rustup; the source's rust-toolchain.toml selects the version.
5+
6+set -Eeuo pipefail
7+
8+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9+source "$SCRIPT_DIR/common.sh"
10+
11+require_ndk
12+require_command cargo
13+require_command rustup
14+
15+# gram-wallet's Cargo manifest pins its path dependency to this submodule.
16+ENGINE_DIR="$JNI_DIR/wallet-engine"
17+if [[ ! -f "$ENGINE_DIR/Cargo.toml" ]]; then
18+ echo "ERROR: Wallet Engine sources not found: $ENGINE_DIR" >&2
19+ echo " Initialize the TMessagesProj/jni/wallet-engine submodule." >&2
20+ exit 1
21+fi
22+ENGINE_DIR="$(cd "$ENGINE_DIR" && pwd)"
23+ADAPTER_DIR="$JNI_DIR/gram-wallet"
24+BUILD_DIR="${WALLET_ENGINE_BUILD_DIR:-$SCRIPT_DIR/build/wallet-engine}"
25+mkdir -p "$BUILD_DIR" "$INCLUDE_DIR/wallet-engine"
26+BUILD_DIR="$(cd "$BUILD_DIR" && pwd)"
27+INCLUDE_DIR="$(cd "$INCLUDE_DIR" && pwd)"
28+mkdir -p "$LIB_DIR"
29+LIB_DIR="$(cd "$LIB_DIR" && pwd)"
30+
31+# The app adapter links the engine and reexports its UniFFI scaffolding. Build
32+# one archive to avoid linking two copies of Rust and wallet-engine into JNI.
33+cd "$ADAPTER_DIR"
34+export RUSTC="$(rustup which rustc)"
35+export CARGO_BUILD_JOBS="$JOBS"
36+export CARGO_INCREMENTAL=0
37+
38+rust_target_for_abi() {
39+ case "$1" in
40+ arm64-v8a) echo aarch64-linux-android ;;
41+ armeabi-v7a) echo armv7-linux-androideabi ;;
42+ x86_64) echo x86_64-linux-android ;;
43+ x86) echo i686-linux-android ;;
44+ *) echo "ERROR: unsupported ABI: $1" >&2; return 1 ;;
45+ esac
46+}
47+
48+installed_targets="$(rustup target list --installed)"
49+missing_targets=()
50+for abi in $ABIS; do
51+ target="$(rust_target_for_abi "$abi")"
52+ if [[ $'\n'"$installed_targets"$'\n' != *$'\n'"$target"$'\n'* ]]; then
53+ missing_targets+=("$target")
54+ fi
55+done
56+if (( ${#missing_targets[@]} )); then
57+ echo "ERROR: missing Rust Android targets. From $ENGINE_DIR run:" >&2
58+ echo " rustup target add ${missing_targets[*]}" >&2
59+ exit 1
60+fi
61+
62+# Use stable virtual paths in Rust objects, as common.sh does for C/C++.
63+rust_sysroot="$(rustc --print sysroot)"
64+rust_cargo_home="${CARGO_HOME:-$HOME/.cargo}"
65+rustflags=(
66+ "--remap-path-prefix=$ENGINE_DIR=/wallet-engine"
67+ "--remap-path-prefix=$ADAPTER_DIR=/gram-wallet"
68+ "--remap-path-prefix=$BUILD_DIR=/wallet-engine-target"
69+ "--remap-path-prefix=$rust_sysroot=/rust-sysroot"
70+ "--remap-path-prefix=$rust_cargo_home=/cargo-home"
71+ "-Cdebuginfo=0"
72+ "-Crelocation-model=pic"
73+)
74+unset RUSTFLAGS
75+CARGO_ENCODED_RUSTFLAGS="$(IFS=$'\037'; echo "${rustflags[*]}")"
76+export CARGO_ENCODED_RUSTFLAGS
77+
78+# Equivalent to `cargo xtask bindings cpp`, with build outputs kept in prebuild.
79+# The pinned generator reads UniFFI metadata from the matching host library.
80+case "$host_os" in
81+ Darwin) host_library=libgram_wallet.dylib ;;
82+ Linux) host_library=libgram_wallet.so ;;
83+esac
84+echo "Generating Wallet Engine C++ bindings with $(rustc --version)"
85+cargo rustc --manifest-path "$ADAPTER_DIR/Cargo.toml" \
86+ --target-dir "$BUILD_DIR/host" --locked --release --lib --crate-type cdylib
87+cargo run --manifest-path "$ENGINE_DIR/bindgen/cpp/bindgen/Cargo.toml" \
88+ --target-dir "$BUILD_DIR/bindgen" --locked -- \
89+ --library --out-dir "$BUILD_DIR/bindings" \
90+ "$BUILD_DIR/host/release/$host_library"
91+
92+for generated in wallet_engine.hpp wallet_engine.cpp wallet_engine_scaffolding.hpp \
93+ gram_wallet.hpp gram_wallet.cpp gram_wallet_scaffolding.hpp; do
94+ cp "$BUILD_DIR/bindings/$generated" "$INCLUDE_DIR/wallet-engine/$generated"
95+ chmod 0644 "$INCLUDE_DIR/wallet-engine/$generated"
96+done
97+
98+for abi in $ABIS; do
99+ target="$(rust_target_for_abi "$abi")"
100+ # NDK names its ARMv7 compiler armv7a, while Rust uses armv7.
101+ case "$abi" in
102+ armeabi-v7a) clang_prefix=armv7a-linux-androideabi ;;
103+ *) clang_prefix="$target" ;;
104+ esac
105+ linker="$NDK_TOOLCHAIN/bin/${clang_prefix}${API}-clang"
106+ if [[ ! -x "$linker" ]]; then
107+ echo "ERROR: Android compiler not found: $linker" >&2
108+ exit 1
109+ fi
110+ target_key="$(echo "$target" | tr '[:lower:]-' '[:upper:]_')"
111+ cc_key="${target//-/_}"
112+
113+ echo "Building Wallet Engine: $abi (API $API)"
114+ env "CARGO_TARGET_${target_key}_LINKER=$linker" \
115+ "CC_${cc_key}=$linker" \
116+ "CXX_${cc_key}=${linker}++" \
117+ "AR_${cc_key}=$NDK_TOOLCHAIN/bin/llvm-ar" \
118+ cargo rustc --manifest-path "$ADAPTER_DIR/Cargo.toml" \
119+ --target-dir "$BUILD_DIR/android" --locked --release --lib \
120+ --target "$target" --crate-type staticlib
121+
122+ destination="$(abi_output_dir "$abi")/libwallet_engine.a"
123+ copy_archive "$BUILD_DIR/android/$target/release/libgram_wallet.a" "$destination"
124+ # tlottie's no_std runtime defines its own rust_eh_personality. Namespace
125+ # this archive's definition AND references (including the DWARF anchor)
126+ # so both Rust libraries can be linked into the same JNI shared library.
127+ require_llvm_objcopy
128+ "$LLVM_OBJCOPY_BIN" \
129+ --redefine-sym rust_eh_personality=wallet_engine_rust_eh_personality \
130+ --redefine-sym DW.ref.rust_eh_personality=DW.ref.wallet_engine_rust_eh_personality \
131+ "$destination"
132+ finalize_archive "$destination"
133+ echo "Wrote $destination"
134+done
135+
136+echo "Wallet Engine archives: $LIB_DIR/<abi>/libwallet_engine.a"
137+echo "Wallet Engine C++ bindings: $INCLUDE_DIR/wallet-engine"
TMessagesProj/jni/prebuild/include/wallet-engine/gram_wallet.cppnew file+386
@@ -0,0 +1,386 @@
1+/* This file was generated by uniffi-bindgen-cpp. */
2+#include <string>
3+
4+#include "gram_wallet.hpp"
5+
6+namespace gram_wallet {
7+namespace uniffi {
8+template <class> inline constexpr bool always_false_v = false;
9+
10+namespace {
11+void ensure_initialized() {
12+ auto bindings_contract_version = 30;
13+ auto scaffolding_contract_version = ffi_gram_wallet_uniffi_contract_version();
14+
15+ if (bindings_contract_version != scaffolding_contract_version) {
16+ throw std::runtime_error("UniFFI contract version mismatch: try cleaning and rebuilding your project");
17+ }
18+ if (uniffi_gram_wallet_checksum_func_is_valid_cell_boc() != 22263) {
19+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
20+ }
21+ if (uniffi_gram_wallet_checksum_func_message_body_hash() != 36445) {
22+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
23+ }
24+ if (uniffi_gram_wallet_checksum_func_gram_ton_connect_crypto() != 45039) {
25+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
26+ }
27+
28+ }
29+
30+// Note: we need this indirection here and can't inline this code in the rust_call function
31+// as it's a templated function
32+void initialize() {
33+ static std::once_flag init_flag;
34+ std::call_once(init_flag, ensure_initialized);
35+}
36+}
37+
38+template <typename F>
39+void check_rust_call(const RustCallStatus &status, F error_cb) {
40+ switch (status.code) {
41+ case 0:
42+ return;
43+
44+ case 1:
45+ if constexpr (!std::is_null_pointer_v<F>) {
46+ error_cb(status.error_buf)->throw_underlying();
47+ }
48+ break;
49+
50+ case 2:
51+ if (status.error_buf.len > 0) {
52+ throw std::runtime_error(FfiConverterString::lift(status.error_buf));
53+ }
54+
55+ throw std::runtime_error("A Rust panic has occurred");
56+ }
57+
58+ throw std::runtime_error("Unexpected Rust call status");
59+}
60+
61+template <typename F, typename EF, typename... Args, typename R = std::invoke_result_t<F, Args..., RustCallStatus *>>
62+R rust_call(F f, EF error_cb, Args... args) {
63+ initialize();
64+
65+ RustCallStatus status = { 0 };
66+
67+ if constexpr (std::is_void_v<R>) {
68+ f(args..., &status);
69+ check_rust_call(status, error_cb);
70+ } else {
71+ auto ret = f(args..., &status);
72+ check_rust_call(status, error_cb);
73+
74+ return ret;
75+ }
76+}
77+
78+namespace {
79+struct RustFutureContinuationState {
80+ std::mutex mutex;
81+ std::condition_variable condition;
82+ bool called = false;
83+ int8_t poll_result = 0;
84+};
85+
86+void rust_future_continuation(uint64_t data, int8_t poll_result) {
87+ auto *state = reinterpret_cast<RustFutureContinuationState *>(data);
88+ {
89+ std::lock_guard<std::mutex> lock(state->mutex);
90+ state->poll_result = poll_result;
91+ state->called = true;
92+ }
93+ state->condition.notify_one();
94+}
95+
96+void foreign_future_drop_noop(uint64_t) {}
97+
98+template <typename F>
99+struct RustFutureHandleGuard {
100+ uint64_t handle;
101+ F free;
102+
103+ ~RustFutureHandleGuard() {
104+ free(handle);
105+ }
106+};
107+}
108+
109+template <typename Start, typename Poll, typename Complete, typename Free, typename EF,
110+ typename R = std::invoke_result_t<Complete, uint64_t, RustCallStatus *>>
111+R rust_call_async(Start start, Poll poll, Complete complete, Free free, EF error_cb) {
112+ initialize();
113+
114+ auto handle = start();
115+ RustFutureHandleGuard guard { handle, free };
116+
117+ while (true) {
118+ RustFutureContinuationState state;
119+ poll(
120+ handle,
121+ reinterpret_cast<void *>(&rust_future_continuation),
122+ reinterpret_cast<uint64_t>(&state)
123+ );
124+
125+ std::unique_lock<std::mutex> lock(state.mutex);
126+ state.condition.wait(lock, [&state] { return state.called; });
127+ if (state.poll_result == 0) {
128+ break;
129+ }
130+ if (state.poll_result != 1) {
131+ throw std::runtime_error("Unexpected Rust future poll result");
132+ }
133+ }
134+
135+ RustCallStatus status = {};
136+ if constexpr (std::is_void_v<R>) {
137+ complete(handle, &status);
138+ check_rust_call(status, error_cb);
139+ } else {
140+ auto ret = complete(handle, &status);
141+ check_rust_call(status, error_cb);
142+ return ret;
143+ }
144+}
145+
146+template <typename F, typename W>
147+void rust_call_trait_interface(RustCallStatus* status, F make_call, W write_value) {
148+ initialize();
149+
150+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
151+
152+ try {
153+ if constexpr(has_return_type) {
154+ write_value(make_call());
155+ } else {
156+ make_call();
157+ }
158+ } catch (std::exception &e) {
159+ status->code = 2;
160+ status->error_buf = FfiConverterString::lower(e.what());
161+ }
162+}
163+
164+template <typename E, typename W, typename F, typename EF>
165+void rust_call_trait_interface_with_error(RustCallStatus* status, F make_call, W write_value, EF error_cb) {
166+ initialize();
167+
168+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
169+
170+ try {
171+ try {
172+ if constexpr(has_return_type) {
173+ write_value(make_call());
174+ } else {
175+ make_call();
176+ }
177+ } catch (E &e) {
178+ status->code = 1;
179+ status->error_buf = error_cb(e);
180+ }
181+ } catch (std::exception &e) {
182+ status->code = 2;
183+ status->error_buf = FfiConverterString::lower(e.what());
184+ }
185+}
186+
187+
188+RustBuffer rustbuffer_alloc(uint64_t len) {
189+ RustCallStatus status = { 0 };
190+ auto buffer = ffi_gram_wallet_rustbuffer_alloc(len, &status);
191+
192+ check_rust_call(status, nullptr);
193+
194+ return buffer;
195+}
196+
197+RustBuffer rustbuffer_from_bytes(const ForeignBytes &bytes) {
198+ RustCallStatus status = { 0 };
199+ auto buffer = ffi_gram_wallet_rustbuffer_from_bytes(bytes, &status);
200+
201+ check_rust_call(status, nullptr);
202+
203+ return buffer;
204+}
205+
206+void rustbuffer_free(RustBuffer buf) {
207+ RustCallStatus status = { 0 };
208+
209+ ffi_gram_wallet_rustbuffer_free(std::move(buf), &status);
210+ check_rust_call(status, nullptr);
211+}
212+
213+
214+
215+bool FfiConverterBool::lift(uint8_t val) {
216+ return !!val;
217+}
218+
219+uint8_t FfiConverterBool::lower(bool val) {
220+ return val;
221+}
222+
223+bool FfiConverterBool::read(RustStream &stream) {
224+ uint8_t val;
225+ stream >> val;
226+
227+ return val;
228+}
229+
230+void FfiConverterBool::write(RustStream &stream, bool val) {
231+ stream << val;
232+}
233+
234+uint64_t FfiConverterBool::allocation_size(bool) {
235+ return 1;
236+}
237+std::string FfiConverterString::lift(RustBuffer buf) {
238+ auto string = std::string(reinterpret_cast<char *>(buf.data), buf.len);
239+
240+ rustbuffer_free(buf);
241+
242+ return string;
243+}
244+
245+RustBuffer FfiConverterString::lower(const std::string &val) {
246+ auto len = static_cast<int32_t>(val.length());
247+ auto bytes = ForeignBytes { len, reinterpret_cast<uint8_t *>(const_cast<char *>(val.data())) };
248+
249+ return rustbuffer_from_bytes(bytes);
250+}
251+
252+std::string FfiConverterString::read(RustStream &stream) {
253+ int32_t len;
254+ std::string string;
255+
256+ stream >> len;
257+
258+ string.resize(len);
259+ stream.read(string.data(), len);
260+
261+ return string;
262+}
263+
264+void FfiConverterString::write(RustStream &stream, const std::string &val) {
265+ stream << static_cast<int32_t>(val.length());
266+ stream.write(val.data(), val.length());
267+}
268+
269+uint64_t FfiConverterString::allocation_size(const std::string &val) {
270+ return static_cast<uint64_t>(sizeof(int32_t) + val.length());
271+}
272+} // namespace uniffi
273+
274+
275+
276+
277+
278+namespace uniffi {
279+
280+
281+
282+std::shared_ptr<GramWalletError> FfiConverterGramWalletError::lift(RustBuffer buf) {
283+ auto stream = RustStream(&buf);
284+ auto ret = FfiConverterGramWalletError::read(stream);
285+
286+ rustbuffer_free(buf);
287+
288+ return ret;
289+}
290+
291+RustBuffer FfiConverterGramWalletError::lower(const GramWalletError &val) {
292+ auto buf = rustbuffer_alloc(allocation_size(val));
293+ auto stream = RustStream(&buf);
294+
295+ FfiConverterGramWalletError::write(stream, val);
296+
297+ return std::move(buf);
298+}
299+
300+std::shared_ptr<GramWalletError> FfiConverterGramWalletError::read(RustStream &stream) {
301+ int32_t v;
302+ stream >> v;
303+
304+ switch (v) {
305+ case 1:
306+ {
307+ gram_wallet_error::InvalidData var("GramWalletError::InvalidData");
308+ return std::make_shared<gram_wallet_error::InvalidData>(var);
309+ }
310+ case 2:
311+ {
312+ gram_wallet_error::Protocol var("GramWalletError::Protocol");
313+ var.message = FfiConverterString::read(stream);
314+ return std::make_shared<gram_wallet_error::Protocol>(var);
315+ }
316+ default:
317+ throw std::runtime_error("Unexpected error variant");
318+ }
319+}
320+
321+void FfiConverterGramWalletError::write(RustStream &stream, const GramWalletError &val) {
322+ stream << val.get_variant_idx();
323+ switch (val.get_variant_idx()) {
324+ case 1:
325+ {
326+ auto var = static_cast<const gram_wallet_error::InvalidData&>(val);
327+ break;
328+ }
329+ case 2:
330+ {
331+ auto var = static_cast<const gram_wallet_error::Protocol&>(val);
332+ FfiConverterString::write(stream, var.message);
333+ break;
334+ }
335+ }
336+}
337+
338+uint64_t FfiConverterGramWalletError::allocation_size(const GramWalletError &val) {
339+ switch (val.get_variant_idx()) {
340+ case 1:
341+ {
342+ auto var = static_cast<const gram_wallet_error::InvalidData&>(val);
343+ return static_cast<uint64_t>(sizeof(int32_t));
344+ }
345+ case 2:
346+ {
347+ auto var = static_cast<const gram_wallet_error::Protocol&>(val);
348+ return static_cast<uint64_t>(sizeof(int32_t)
349+ + FfiConverterString::allocation_size(var.message));
350+ }
351+ default:
352+ throw std::runtime_error("Unexpected error variant");
353+ }
354+}
355+
356+}
357+
358+bool is_valid_cell_boc(const std::string &boc) {
359+ auto ret =
360+ uniffi::rust_call(
361+ uniffi_gram_wallet_fn_func_is_valid_cell_boc,
362+ nullptr, uniffi::FfiConverterString::lower(boc));
363+
364+ return uniffi::FfiConverterBool::lift(ret);
365+}
366+
367+
368+std::string message_body_hash(const std::string &boc) {
369+ auto ret =
370+ uniffi::rust_call(
371+ uniffi_gram_wallet_fn_func_message_body_hash,
372+ uniffi::FfiConverterGramWalletError::lift, uniffi::FfiConverterString::lower(boc));
373+
374+ return uniffi::FfiConverterString::lift(ret);
375+}
376+
377+
378+std::string gram_ton_connect_crypto(const std::string &phrase, const std::string &parameters) {
379+ auto ret =
380+ uniffi::rust_call(
381+ uniffi_gram_wallet_fn_func_gram_ton_connect_crypto,
382+ uniffi::FfiConverterGramWalletError::lift, uniffi::FfiConverterString::lower(phrase), uniffi::FfiConverterString::lower(parameters));
383+
384+ return uniffi::FfiConverterString::lift(ret);
385+}
386+} // namespace gram_wallet
TMessagesProj/jni/prebuild/include/wallet-engine/gram_wallet.hppnew file+228
@@ -0,0 +1,228 @@
1+#pragma once
2+
3+#include <algorithm>
4+#include <bit>
5+#include <chrono>
6+#include <condition_variable>
7+#include <cstdint>
8+#include <exception>
9+#include <functional>
10+#include <iostream>
11+#include <map>
12+#include <memory>
13+#include <mutex>
14+#include <optional>
15+#include <stdexcept>
16+#include <streambuf>
17+#include <type_traits>
18+#include <variant>
19+#include <vector>
20+
21+#include "gram_wallet_scaffolding.hpp"
22+
23+#ifndef UNIFFI_CPP_RUST_STREAM
24+#define UNIFFI_CPP_RUST_STREAM
25+namespace uniffi {
26+struct RustStreamBuffer: std::basic_streambuf<char> {
27+ RustStreamBuffer(RustBuffer *buf) {
28+ char* data = reinterpret_cast<char*>(buf->data);
29+ this->setg(data, data, data + buf->len);
30+ this->setp(data, data + buf->capacity);
31+ }
32+ ~RustStreamBuffer() = default;
33+
34+private:
35+ RustStreamBuffer() = delete;
36+ RustStreamBuffer(const RustStreamBuffer &) = delete;
37+ RustStreamBuffer(RustStreamBuffer &&) = delete;
38+
39+ RustStreamBuffer &operator=(const RustStreamBuffer &) = delete;
40+ RustStreamBuffer &operator=(RustStreamBuffer &&) = delete;
41+};
42+
43+struct RustStream: std::basic_iostream<char> {
44+ RustStream(RustBuffer *buf):
45+ std::basic_iostream<char>(&streambuf), streambuf(RustStreamBuffer(buf)) { }
46+
47+ template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
48+ RustStream &operator>>(T &val) {
49+ read(reinterpret_cast<char *>(&val), sizeof(T));
50+
51+ if (std::endian::native != std::endian::big) {
52+ auto bytes = reinterpret_cast<char *>(&val);
53+
54+ std::reverse(bytes, bytes + sizeof(T));
55+ }
56+
57+ return *this;
58+ }
59+
60+ template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
61+ RustStream &operator<<(T val) {
62+ if (std::endian::native != std::endian::big) {
63+ auto bytes = reinterpret_cast<char *>(&val);
64+
65+ std::reverse(bytes, bytes + sizeof(T));
66+ }
67+
68+ write(reinterpret_cast<char *>(&val), sizeof(T));
69+
70+ return *this;
71+ }
72+private:
73+ RustStreamBuffer streambuf;
74+};
75+
76+}
77+#endif
78+
79+namespace gram_wallet {
80+struct GramWalletError;
81+
82+namespace uniffi {
83+struct FfiConverterGramWalletError;
84+} // namespace uniffi
85+
86+struct GramWalletError: std::runtime_error {
87+ friend uniffi::FfiConverterGramWalletError;
88+
89+ GramWalletError() : std::runtime_error("") {}
90+ GramWalletError(const std::string &what_arg) : std::runtime_error(what_arg) {}
91+
92+ virtual ~GramWalletError() = default;
93+
94+ virtual void throw_underlying() {
95+ throw *this;
96+ }
97+
98+protected:
99+ virtual int32_t get_variant_idx() const {
100+ return 0;
101+ };
102+};
103+/**
104+ * Contains variants of GramWalletError
105+ */
106+namespace gram_wallet_error {
107+
108+struct InvalidData: GramWalletError {
109+
110+ InvalidData() : GramWalletError("") {}
111+ InvalidData(const std::string &what_arg) : GramWalletError(what_arg) {}
112+
113+ void throw_underlying() override {
114+ throw *this;
115+ }
116+
117+protected:
118+ int32_t get_variant_idx() const override {
119+ return 1;
120+ }
121+};
122+
123+struct Protocol: GramWalletError {
124+ std::string message;
125+
126+ Protocol() : GramWalletError("") {}
127+ Protocol(const std::string &what_arg) : GramWalletError(what_arg) {}
128+
129+ void throw_underlying() override {
130+ throw *this;
131+ }
132+
133+protected:
134+ int32_t get_variant_idx() const override {
135+ return 2;
136+ }
137+};
138+} // namespace gram_wallet_error
139+
140+namespace uniffi {
141+using ::uniffi::RustStream;
142+using ::uniffi::RustStreamBuffer;
143+
144+RustBuffer rustbuffer_alloc(uint64_t);
145+RustBuffer rustbuffer_from_bytes(const ForeignBytes &);
146+void rustbuffer_free(RustBuffer);
147+template <typename T> struct HandleMap {
148+ HandleMap() = default;
149+
150+ std::shared_ptr<T> at(uint64_t handle) {
151+ std::lock_guard<std::mutex> guard(this->mutex);
152+
153+ return this->map.at(handle);
154+ }
155+
156+ uint64_t insert(std::shared_ptr<T> impl) {
157+ std::lock_guard<std::mutex> guard(this->mutex);
158+
159+ auto handle = this->cur_handle;
160+
161+ this->map.insert({ handle, impl });
162+ this->cur_handle += 1;
163+
164+ return handle;
165+ }
166+
167+ void erase(uint64_t handle) {
168+ // We store the object here to avoid re-entrant locking
169+ std::shared_ptr<T> cleanup;
170+ {
171+ std::lock_guard<std::mutex> guard(this->mutex);
172+ auto it = this->map.find(handle);
173+ if (it != this->map.end()) {
174+ cleanup = it->second;
175+ this->map.erase(it);
176+ }
177+ }
178+ }
179+ private:
180+ HandleMap(const HandleMap<T> &) = delete;
181+ HandleMap(HandleMap<T> &&) = delete;
182+
183+ HandleMap<T> &operator=(const HandleMap<T> &) = delete;
184+ HandleMap<T> &operator=(HandleMap<T> &&) = delete;
185+
186+ std::mutex mutex;
187+ uint64_t cur_handle = 0;
188+ std::map<uint64_t, std::shared_ptr<T>> map;
189+};
190+struct FfiConverterBool {
191+ static bool lift(uint8_t);
192+ static uint8_t lower(bool);
193+ static bool read(RustStream &);
194+ static void write(RustStream &, bool);
195+ static uint64_t allocation_size(bool);
196+};
197+struct FfiConverterString {
198+ static std::string lift(RustBuffer buf);
199+ static RustBuffer lower(const std::string &);
200+ static std::string read(RustStream &);
201+ static void write(RustStream &, const std::string &);
202+ static uint64_t allocation_size(const std::string &);
203+};
204+
205+struct FfiConverterGramWalletError {
206+ static std::shared_ptr<GramWalletError> lift(RustBuffer buf);
207+ static RustBuffer lower(const GramWalletError &);
208+ static std::shared_ptr<GramWalletError> read(RustStream &stream);
209+ static void write(RustStream &stream, const GramWalletError &);
210+ static uint64_t allocation_size(const GramWalletError &);
211+};
212+} // namespace uniffi
213+
214+/**
215+ * Validates the single-root BoC envelope before passing untrusted cells to the wallet.
216+ */
217+bool is_valid_cell_boc(const std::string &boc);
218+/**
219+ * Hash of the message body, as used by the MTProto transaction matcher.
220+ * This deliberately differs from the hash of the complete external message.
221+ */
222+std::string message_body_hash(const std::string &boc);
223+/**
224+ * Stateless cryptographic adapter. Java owns TON Connect envelopes, methods,
225+ * capabilities and MTProto workflow; secret keys never leave this call.
226+ */
227+std::string gram_ton_connect_crypto(const std::string &phrase, const std::string &parameters);
228+} // namespace gram_wallet
TMessagesProj/jni/prebuild/include/wallet-engine/gram_wallet_scaffolding.hppnew file+188
@@ -0,0 +1,188 @@
1+#pragma once
2+
3+#include <stdint.h>
4+
5+#ifdef __cplusplus
6+extern "C" {
7+#endif
8+
9+#ifndef UNIFFI_CPP_INTERNALSTRUCTS
10+#define UNIFFI_CPP_INTERNALSTRUCTS
11+struct ForeignBytes {
12+ int32_t len;
13+ uint8_t *data;
14+};
15+
16+struct RustBuffer {
17+ uint64_t capacity;
18+ uint64_t len;
19+ uint8_t *data;
20+};
21+
22+struct RustCallStatus {
23+ int8_t code;
24+ RustBuffer error_buf;
25+};
26+
27+#endif
28+void RustFutureContinuationCallback(
29+ uint64_t data,int8_t poll_result
30+);
31+void ForeignFutureDroppedCallback(
32+ uint64_t handle
33+);
34+void CallbackInterfaceFree(
35+ uint64_t handle
36+);
37+uint64_t CallbackInterfaceClone(
38+ uint64_t handle
39+);
40+struct UniffiForeignFutureDroppedCallbackStruct {
41+ uint64_t handle;
42+ void * free;
43+};
44+struct UniffiForeignFutureResultU8 {
45+ uint8_t return_value;
46+ RustCallStatus call_status;
47+};
48+void ForeignFutureCompleteU8(
49+ uint64_t callback_data,UniffiForeignFutureResultU8 result
50+);
51+struct UniffiForeignFutureResultI8 {
52+ int8_t return_value;
53+ RustCallStatus call_status;
54+};
55+void ForeignFutureCompleteI8(
56+ uint64_t callback_data,UniffiForeignFutureResultI8 result
57+);
58+struct UniffiForeignFutureResultU16 {
59+ uint16_t return_value;
60+ RustCallStatus call_status;
61+};
62+void ForeignFutureCompleteU16(
63+ uint64_t callback_data,UniffiForeignFutureResultU16 result
64+);
65+struct UniffiForeignFutureResultI16 {
66+ int16_t return_value;
67+ RustCallStatus call_status;
68+};
69+void ForeignFutureCompleteI16(
70+ uint64_t callback_data,UniffiForeignFutureResultI16 result
71+);
72+struct UniffiForeignFutureResultU32 {
73+ uint32_t return_value;
74+ RustCallStatus call_status;
75+};
76+void ForeignFutureCompleteU32(
77+ uint64_t callback_data,UniffiForeignFutureResultU32 result
78+);
79+struct UniffiForeignFutureResultI32 {
80+ int32_t return_value;
81+ RustCallStatus call_status;
82+};
83+void ForeignFutureCompleteI32(
84+ uint64_t callback_data,UniffiForeignFutureResultI32 result
85+);
86+struct UniffiForeignFutureResultU64 {
87+ uint64_t return_value;
88+ RustCallStatus call_status;
89+};
90+void ForeignFutureCompleteU64(
91+ uint64_t callback_data,UniffiForeignFutureResultU64 result
92+);
93+struct UniffiForeignFutureResultI64 {
94+ int64_t return_value;
95+ RustCallStatus call_status;
96+};
97+void ForeignFutureCompleteI64(
98+ uint64_t callback_data,UniffiForeignFutureResultI64 result
99+);
100+struct UniffiForeignFutureResultF32 {
101+ float return_value;
102+ RustCallStatus call_status;
103+};
104+void ForeignFutureCompleteF32(
105+ uint64_t callback_data,UniffiForeignFutureResultF32 result
106+);
107+struct UniffiForeignFutureResultF64 {
108+ double return_value;
109+ RustCallStatus call_status;
110+};
111+void ForeignFutureCompleteF64(
112+ uint64_t callback_data,UniffiForeignFutureResultF64 result
113+);
114+struct UniffiForeignFutureResultRustBuffer {
115+ RustBuffer return_value;
116+ RustCallStatus call_status;
117+};
118+void ForeignFutureCompleteRustBuffer(
119+ uint64_t callback_data,UniffiForeignFutureResultRustBuffer result
120+);
121+struct UniffiForeignFutureResultVoid {
122+ RustCallStatus call_status;
123+};
124+void ForeignFutureCompleteVoid(
125+ uint64_t callback_data,UniffiForeignFutureResultVoid result
126+);
127+int8_t uniffi_gram_wallet_fn_func_is_valid_cell_boc(RustBuffer boc, RustCallStatus *out_status);
128+RustBuffer uniffi_gram_wallet_fn_func_message_body_hash(RustBuffer boc, RustCallStatus *out_status);
129+RustBuffer uniffi_gram_wallet_fn_func_gram_ton_connect_crypto(RustBuffer phrase, RustBuffer parameters, RustCallStatus *out_status);
130+RustBuffer ffi_gram_wallet_rustbuffer_alloc(uint64_t size, RustCallStatus *out_status);
131+RustBuffer ffi_gram_wallet_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *out_status);
132+void ffi_gram_wallet_rustbuffer_free(RustBuffer buf, RustCallStatus *out_status);
133+RustBuffer ffi_gram_wallet_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *out_status);
134+void ffi_gram_wallet_rust_future_poll_u8(uint64_t handle, void * callback, uint64_t callback_data);
135+void ffi_gram_wallet_rust_future_cancel_u8(uint64_t handle);
136+void ffi_gram_wallet_rust_future_free_u8(uint64_t handle);
137+uint8_t ffi_gram_wallet_rust_future_complete_u8(uint64_t handle, RustCallStatus *out_status);
138+void ffi_gram_wallet_rust_future_poll_i8(uint64_t handle, void * callback, uint64_t callback_data);
139+void ffi_gram_wallet_rust_future_cancel_i8(uint64_t handle);
140+void ffi_gram_wallet_rust_future_free_i8(uint64_t handle);
141+int8_t ffi_gram_wallet_rust_future_complete_i8(uint64_t handle, RustCallStatus *out_status);
142+void ffi_gram_wallet_rust_future_poll_u16(uint64_t handle, void * callback, uint64_t callback_data);
143+void ffi_gram_wallet_rust_future_cancel_u16(uint64_t handle);
144+void ffi_gram_wallet_rust_future_free_u16(uint64_t handle);
145+uint16_t ffi_gram_wallet_rust_future_complete_u16(uint64_t handle, RustCallStatus *out_status);
146+void ffi_gram_wallet_rust_future_poll_i16(uint64_t handle, void * callback, uint64_t callback_data);
147+void ffi_gram_wallet_rust_future_cancel_i16(uint64_t handle);
148+void ffi_gram_wallet_rust_future_free_i16(uint64_t handle);
149+int16_t ffi_gram_wallet_rust_future_complete_i16(uint64_t handle, RustCallStatus *out_status);
150+void ffi_gram_wallet_rust_future_poll_u32(uint64_t handle, void * callback, uint64_t callback_data);
151+void ffi_gram_wallet_rust_future_cancel_u32(uint64_t handle);
152+void ffi_gram_wallet_rust_future_free_u32(uint64_t handle);
153+uint32_t ffi_gram_wallet_rust_future_complete_u32(uint64_t handle, RustCallStatus *out_status);
154+void ffi_gram_wallet_rust_future_poll_i32(uint64_t handle, void * callback, uint64_t callback_data);
155+void ffi_gram_wallet_rust_future_cancel_i32(uint64_t handle);
156+void ffi_gram_wallet_rust_future_free_i32(uint64_t handle);
157+int32_t ffi_gram_wallet_rust_future_complete_i32(uint64_t handle, RustCallStatus *out_status);
158+void ffi_gram_wallet_rust_future_poll_u64(uint64_t handle, void * callback, uint64_t callback_data);
159+void ffi_gram_wallet_rust_future_cancel_u64(uint64_t handle);
160+void ffi_gram_wallet_rust_future_free_u64(uint64_t handle);
161+uint64_t ffi_gram_wallet_rust_future_complete_u64(uint64_t handle, RustCallStatus *out_status);
162+void ffi_gram_wallet_rust_future_poll_i64(uint64_t handle, void * callback, uint64_t callback_data);
163+void ffi_gram_wallet_rust_future_cancel_i64(uint64_t handle);
164+void ffi_gram_wallet_rust_future_free_i64(uint64_t handle);
165+int64_t ffi_gram_wallet_rust_future_complete_i64(uint64_t handle, RustCallStatus *out_status);
166+void ffi_gram_wallet_rust_future_poll_f32(uint64_t handle, void * callback, uint64_t callback_data);
167+void ffi_gram_wallet_rust_future_cancel_f32(uint64_t handle);
168+void ffi_gram_wallet_rust_future_free_f32(uint64_t handle);
169+float ffi_gram_wallet_rust_future_complete_f32(uint64_t handle, RustCallStatus *out_status);
170+void ffi_gram_wallet_rust_future_poll_f64(uint64_t handle, void * callback, uint64_t callback_data);
171+void ffi_gram_wallet_rust_future_cancel_f64(uint64_t handle);
172+void ffi_gram_wallet_rust_future_free_f64(uint64_t handle);
173+double ffi_gram_wallet_rust_future_complete_f64(uint64_t handle, RustCallStatus *out_status);
174+void ffi_gram_wallet_rust_future_poll_rust_buffer(uint64_t handle, void * callback, uint64_t callback_data);
175+void ffi_gram_wallet_rust_future_cancel_rust_buffer(uint64_t handle);
176+void ffi_gram_wallet_rust_future_free_rust_buffer(uint64_t handle);
177+RustBuffer ffi_gram_wallet_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *out_status);
178+void ffi_gram_wallet_rust_future_poll_void(uint64_t handle, void * callback, uint64_t callback_data);
179+void ffi_gram_wallet_rust_future_cancel_void(uint64_t handle);
180+void ffi_gram_wallet_rust_future_free_void(uint64_t handle);
181+void ffi_gram_wallet_rust_future_complete_void(uint64_t handle, RustCallStatus *out_status);
182+uint16_t uniffi_gram_wallet_checksum_func_is_valid_cell_boc();
183+uint16_t uniffi_gram_wallet_checksum_func_message_body_hash();
184+uint16_t uniffi_gram_wallet_checksum_func_gram_ton_connect_crypto();
185+uint32_t ffi_gram_wallet_uniffi_contract_version();
186+#ifdef __cplusplus
187+}
188+#endif
TMessagesProj/jni/prebuild/include/wallet-engine/wallet_engine.cppnew file+11727
@@ -0,0 +1,11727 @@
1+/* This file was generated by uniffi-bindgen-cpp. */
2+#include <string>
3+
4+#include "wallet_engine.hpp"
5+
6+namespace wallet_engine {
7+namespace uniffi {
8+template <class> inline constexpr bool always_false_v = false;
9+
10+namespace {
11+void ensure_initialized() {
12+ auto bindings_contract_version = 30;
13+ auto scaffolding_contract_version = ffi_wallet_engine_uniffi_contract_version();
14+
15+ if (bindings_contract_version != scaffolding_contract_version) {
16+ throw std::runtime_error("UniFFI contract version mismatch: try cleaning and rebuilding your project");
17+ }
18+ if (uniffi_wallet_engine_checksum_func_parse_ton_transfer_link() != 38144) {
19+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
20+ }
21+ if (uniffi_wallet_engine_checksum_func_parse_ton_connect_manifest() != 55166) {
22+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
23+ }
24+ if (uniffi_wallet_engine_checksum_func_ton_connect_session_from_link() != 16316) {
25+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
26+ }
27+ if (uniffi_wallet_engine_checksum_func_ton_connect_session_restore() != 63276) {
28+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
29+ }
30+ if (uniffi_wallet_engine_checksum_func_convert_ton_address() != 28540) {
31+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
32+ }
33+ if (uniffi_wallet_engine_checksum_func_is_valid_ton_address() != 32896) {
34+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
35+ }
36+ if (uniffi_wallet_engine_checksum_func_parse_ton_address() != 26131) {
37+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
38+ }
39+ if (uniffi_wallet_engine_checksum_func_mnemonic_wordlist() != 1718) {
40+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
41+ }
42+ if (uniffi_wallet_engine_checksum_func_detect_mnemonic_schemes() != 22911) {
43+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
44+ }
45+ if (uniffi_wallet_engine_checksum_func_rotation_mnemonic_public_key() != 40177) {
46+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
47+ }
48+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_load_more_activity() != 30855) {
49+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
50+ }
51+ if (uniffi_wallet_engine_checksum_method_walletclient_load_more_activity() != 1728) {
52+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
53+ }
54+ if (uniffi_wallet_engine_checksum_method_walletclient_shutdown() != 12846) {
55+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
56+ }
57+ if (uniffi_wallet_engine_checksum_method_walletclient_snapshot() != 9252) {
58+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
59+ }
60+ if (uniffi_wallet_engine_checksum_method_walletclient_wait_for_change() != 21890) {
61+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
62+ }
63+ if (uniffi_wallet_engine_checksum_method_walletclient_resolve_dns() != 63449) {
64+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
65+ }
66+ if (uniffi_wallet_engine_checksum_method_walletclient_create_encrypted_comment() != 57304) {
67+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
68+ }
69+ if (uniffi_wallet_engine_checksum_method_walletclient_decrypt_comment() != 56301) {
70+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
71+ }
72+ if (uniffi_wallet_engine_checksum_method_walletclient_resolve_encrypted_comment_recipient() != 61038) {
73+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
74+ }
75+ if (uniffi_wallet_engine_checksum_method_walletclient_prepare_key_rotation() != 44629) {
76+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
77+ }
78+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_load_more_nfts() != 55435) {
79+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
80+ }
81+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_refresh_nfts() != 10319) {
82+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
83+ }
84+ if (uniffi_wallet_engine_checksum_method_walletclient_load_more_nfts() != 53428) {
85+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
86+ }
87+ if (uniffi_wallet_engine_checksum_method_walletclient_refresh_nfts() != 19017) {
88+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
89+ }
90+ if (uniffi_wallet_engine_checksum_method_walletclient_prepare_nft_transfer() != 62136) {
91+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
92+ }
93+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_nft_transfer() != 55191) {
94+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
95+ }
96+ if (uniffi_wallet_engine_checksum_method_walletclient_send_nft_transfer() != 6467) {
97+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
98+ }
99+ if (uniffi_wallet_engine_checksum_method_walletclient_prepare_transfer() != 35005) {
100+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
101+ }
102+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_send_preview() != 28394) {
103+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
104+ }
105+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_key_rotation() != 9076) {
106+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
107+ }
108+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_send() != 55971) {
109+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
110+ }
111+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_send_boc() != 21004) {
112+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
113+ }
114+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_sign_message() != 5984) {
115+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
116+ }
117+ if (uniffi_wallet_engine_checksum_method_walletclient_preview_ton_connect() != 9616) {
118+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
119+ }
120+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_refresh() != 16959) {
121+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
122+ }
123+ if (uniffi_wallet_engine_checksum_method_walletclient_refresh() != 44556) {
124+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
125+ }
126+ if (uniffi_wallet_engine_checksum_method_walletclient_resolve_pending() != 41815) {
127+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
128+ }
129+ if (uniffi_wallet_engine_checksum_method_walletclient_cancel_send() != 37753) {
130+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
131+ }
132+ if (uniffi_wallet_engine_checksum_method_walletclient_send() != 23821) {
133+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
134+ }
135+ if (uniffi_wallet_engine_checksum_method_walletclient_send_boc() != 4063) {
136+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
137+ }
138+ if (uniffi_wallet_engine_checksum_method_walletclient_sign_message() != 31537) {
139+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
140+ }
141+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_read_protected_secret() != 7657) {
142+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
143+ }
144+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_store_protected_secret() != 21396) {
145+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
146+ }
147+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_delete_protected_secret() != 43335) {
148+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
149+ }
150+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_load_journal() != 51398) {
151+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
152+ }
153+ if (uniffi_wallet_engine_checksum_method_walletplatformhost_compare_exchange_journal() != 63993) {
154+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
155+ }
156+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_approve_connect() != 6077) {
157+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
158+ }
159+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_begin_events_subscription() != 62684) {
160+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
161+ }
162+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_complete_pending_post() != 52225) {
163+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
164+ }
165+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_connect_prompt() != 24215) {
166+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
167+ }
168+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_disconnect() != 14920) {
169+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
170+ }
171+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_ingest_sse_chunk() != 62248) {
172+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
173+ }
174+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_pending_post() != 12209) {
175+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
176+ }
177+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_pending_requests() != 22341) {
178+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
179+ }
180+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_persisted() != 36457) {
181+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
182+ }
183+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_phase() != 52857) {
184+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
185+ }
186+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_disconnect_success() != 65002) {
187+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
188+ }
189+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_error() != 22566) {
190+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
191+ }
192+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_send_success() != 31724) {
193+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
194+ }
195+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_sign_message_success() != 63431) {
196+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
197+ }
198+ if (uniffi_wallet_engine_checksum_method_tonconnectsession_reject_connect() != 45812) {
199+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
200+ }
201+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_decrypt_envelope() != 42978) {
202+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
203+ }
204+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_decrypt_request() != 40213) {
205+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
206+ }
207+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_connect_error() != 3125) {
208+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
209+ }
210+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_connect_event() != 12874) {
211+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
212+ }
213+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_disconnect_event() != 15862) {
214+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
215+ }
216+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_disconnect_success() != 11931) {
217+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
218+ }
219+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_envelope() != 50506) {
220+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
221+ }
222+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_error() != 24657) {
223+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
224+ }
225+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_send_success() != 2099) {
226+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
227+ }
228+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_sign_data_success() != 48287) {
229+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
230+ }
231+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_open_challenge() != 24298) {
232+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
233+ }
234+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_public_key_hex() != 32021) {
235+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
236+ }
237+ if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_signing_public_key() != 11397) {
238+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
239+ }
240+ if (uniffi_wallet_engine_checksum_method_wallethttphost_execute_http() != 43126) {
241+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
242+ }
243+ if (uniffi_wallet_engine_checksum_method_wallethttphost_cancel_http() != 55221) {
244+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
245+ }
246+ if (uniffi_wallet_engine_checksum_method_walletstatuslesshost_execute_statusless() != 29141) {
247+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
248+ }
249+ if (uniffi_wallet_engine_checksum_method_walletstatuslesshost_cancel_statusless() != 58537) {
250+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
251+ }
252+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_create_wallet() != 58283) {
253+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
254+ }
255+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_delete_wallet() != 60089) {
256+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
257+ }
258+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_derive_ton_connect_session() != 2602) {
259+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
260+ }
261+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_import_wallet() != 60352) {
262+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
263+ }
264+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_reveal_recovery_phrase() != 7144) {
265+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
266+ }
267+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_sign_ton_connect_data() != 38868) {
268+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
269+ }
270+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_sign_ton_connect_proof() != 59978) {
271+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
272+ }
273+ if (uniffi_wallet_engine_checksum_method_walletlifecycle_ton_connect_account() != 32302) {
274+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
275+ }
276+ if (uniffi_wallet_engine_checksum_constructor_walletclient_new() != 8434) {
277+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
278+ }
279+ if (uniffi_wallet_engine_checksum_constructor_walletclient_new_statusless() != 59466) {
280+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
281+ }
282+ if (uniffi_wallet_engine_checksum_constructor_walletlifecycle_new() != 42116) {
283+ throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
284+ }
285+
286+ uniffi::UniffiCallbackInterfaceWalletHttpHost::init();
287+ uniffi::UniffiCallbackInterfaceWalletPlatformHost::init();
288+ uniffi::UniffiCallbackInterfaceWalletStatuslessHost::init();
289+ }
290+
291+// Note: we need this indirection here and can't inline this code in the rust_call function
292+// as it's a templated function
293+void initialize() {
294+ static std::once_flag init_flag;
295+ std::call_once(init_flag, ensure_initialized);
296+}
297+}
298+
299+template <typename F>
300+void check_rust_call(const RustCallStatus &status, F error_cb) {
301+ switch (status.code) {
302+ case 0:
303+ return;
304+
305+ case 1:
306+ if constexpr (!std::is_null_pointer_v<F>) {
307+ error_cb(status.error_buf)->throw_underlying();
308+ }
309+ break;
310+
311+ case 2:
312+ if (status.error_buf.len > 0) {
313+ throw std::runtime_error(FfiConverterString::lift(status.error_buf));
314+ }
315+
316+ throw std::runtime_error("A Rust panic has occurred");
317+ }
318+
319+ throw std::runtime_error("Unexpected Rust call status");
320+}
321+
322+template <typename F, typename EF, typename... Args, typename R = std::invoke_result_t<F, Args..., RustCallStatus *>>
323+R rust_call(F f, EF error_cb, Args... args) {
324+ initialize();
325+
326+ RustCallStatus status = { 0 };
327+
328+ if constexpr (std::is_void_v<R>) {
329+ f(args..., &status);
330+ check_rust_call(status, error_cb);
331+ } else {
332+ auto ret = f(args..., &status);
333+ check_rust_call(status, error_cb);
334+
335+ return ret;
336+ }
337+}
338+
339+namespace {
340+struct RustFutureContinuationState {
341+ std::mutex mutex;
342+ std::condition_variable condition;
343+ bool called = false;
344+ int8_t poll_result = 0;
345+};
346+
347+void rust_future_continuation(uint64_t data, int8_t poll_result) {
348+ auto *state = reinterpret_cast<RustFutureContinuationState *>(data);
349+ {
350+ std::lock_guard<std::mutex> lock(state->mutex);
351+ state->poll_result = poll_result;
352+ state->called = true;
353+ }
354+ state->condition.notify_one();
355+}
356+
357+void foreign_future_drop_noop(uint64_t) {}
358+
359+template <typename F>
360+struct RustFutureHandleGuard {
361+ uint64_t handle;
362+ F free;
363+
364+ ~RustFutureHandleGuard() {
365+ free(handle);
366+ }
367+};
368+}
369+
370+template <typename Start, typename Poll, typename Complete, typename Free, typename EF,
371+ typename R = std::invoke_result_t<Complete, uint64_t, RustCallStatus *>>
372+R rust_call_async(Start start, Poll poll, Complete complete, Free free, EF error_cb) {
373+ initialize();
374+
375+ auto handle = start();
376+ RustFutureHandleGuard guard { handle, free };
377+
378+ while (true) {
379+ RustFutureContinuationState state;
380+ poll(
381+ handle,
382+ reinterpret_cast<void *>(&rust_future_continuation),
383+ reinterpret_cast<uint64_t>(&state)
384+ );
385+
386+ std::unique_lock<std::mutex> lock(state.mutex);
387+ state.condition.wait(lock, [&state] { return state.called; });
388+ if (state.poll_result == 0) {
389+ break;
390+ }
391+ if (state.poll_result != 1) {
392+ throw std::runtime_error("Unexpected Rust future poll result");
393+ }
394+ }
395+
396+ RustCallStatus status = {};
397+ if constexpr (std::is_void_v<R>) {
398+ complete(handle, &status);
399+ check_rust_call(status, error_cb);
400+ } else {
401+ auto ret = complete(handle, &status);
402+ check_rust_call(status, error_cb);
403+ return ret;
404+ }
405+}
406+
407+template <typename F, typename W>
408+void rust_call_trait_interface(RustCallStatus* status, F make_call, W write_value) {
409+ initialize();
410+
411+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
412+
413+ try {
414+ if constexpr(has_return_type) {
415+ write_value(make_call());
416+ } else {
417+ make_call();
418+ }
419+ } catch (std::exception &e) {
420+ status->code = 2;
421+ status->error_buf = FfiConverterString::lower(e.what());
422+ }
423+}
424+
425+template <typename E, typename W, typename F, typename EF>
426+void rust_call_trait_interface_with_error(RustCallStatus* status, F make_call, W write_value, EF error_cb) {
427+ initialize();
428+
429+ constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
430+
431+ try {
432+ try {
433+ if constexpr(has_return_type) {
434+ write_value(make_call());
435+ } else {
436+ make_call();
437+ }
438+ } catch (E &e) {
439+ status->code = 1;
440+ status->error_buf = error_cb(e);
441+ }
442+ } catch (std::exception &e) {
443+ status->code = 2;
444+ status->error_buf = FfiConverterString::lower(e.what());
445+ }
446+}
447+
448+
449+RustBuffer rustbuffer_alloc(uint64_t len) {
450+ RustCallStatus status = { 0 };
451+ auto buffer = ffi_wallet_engine_rustbuffer_alloc(len, &status);
452+
453+ check_rust_call(status, nullptr);
454+
455+ return buffer;
456+}
457+
458+RustBuffer rustbuffer_from_bytes(const ForeignBytes &bytes) {
459+ RustCallStatus status = { 0 };
460+ auto buffer = ffi_wallet_engine_rustbuffer_from_bytes(bytes, &status);
461+
462+ check_rust_call(status, nullptr);
463+
464+ return buffer;
465+}
466+
467+void rustbuffer_free(RustBuffer buf) {
468+ RustCallStatus status = { 0 };
469+
470+ ffi_wallet_engine_rustbuffer_free(std::move(buf), &status);
471+ check_rust_call(status, nullptr);
472+}
473+
474+
475+uint16_t FfiConverterUInt16::lift(uint16_t val) {
476+ return val;
477+}
478+
479+uint16_t FfiConverterUInt16::lower(uint16_t val) {
480+ return val;
481+}
482+
483+uint16_t FfiConverterUInt16::read(RustStream &stream) {
484+ uint16_t ret;
485+ stream >> ret;
486+
487+ return ret;
488+}
489+
490+void FfiConverterUInt16::write(RustStream &stream, uint16_t val) {
491+ stream << val;
492+}
493+
494+uint64_t FfiConverterUInt16::allocation_size(uint16_t) {
495+ return static_cast<uint64_t>(sizeof(uint16_t));
496+}
497+uint32_t FfiConverterUInt32::lift(uint32_t val) {
498+ return val;
499+}
500+
501+uint32_t FfiConverterUInt32::lower(uint32_t val) {
502+ return val;
503+}
504+
505+uint32_t FfiConverterUInt32::read(RustStream &stream) {
506+ uint32_t ret;
507+ stream >> ret;
508+
509+ return ret;
510+}
511+
512+void FfiConverterUInt32::write(RustStream &stream, uint32_t val) {
513+ stream << val;
514+}
515+
516+uint64_t FfiConverterUInt32::allocation_size(uint32_t) {
517+ return static_cast<uint64_t>(sizeof(uint32_t));
518+}
519+int32_t FfiConverterInt32::lift(int32_t val) {
520+ return val;
521+}
522+
523+int32_t FfiConverterInt32::lower(int32_t val) {
524+ return val;
525+}
526+
527+int32_t FfiConverterInt32::read(RustStream &stream) {
528+ int32_t ret;
529+ stream >> ret;
530+
531+ return ret;
532+}
533+
534+void FfiConverterInt32::write(RustStream &stream, int32_t val) {
535+ stream << val;
536+}
537+
538+uint64_t FfiConverterInt32::allocation_size(int32_t) {
539+ return static_cast<uint64_t>(sizeof(int32_t));
540+}
541+uint64_t FfiConverterUInt64::lift(uint64_t val) {
542+ return val;
543+}
544+
545+uint64_t FfiConverterUInt64::lower(uint64_t val) {
546+ return val;
547+}
548+
549+uint64_t FfiConverterUInt64::read(RustStream &stream) {
550+ uint64_t ret;
551+ stream >> ret;
552+
553+ return ret;
554+}
555+
556+void FfiConverterUInt64::write(RustStream &stream, uint64_t val) {
557+ stream << val;
558+}
559+
560+uint64_t FfiConverterUInt64::allocation_size(uint64_t) {
561+ return static_cast<uint64_t>(sizeof(uint64_t));
562+}
563+int64_t FfiConverterInt64::lift(int64_t val) {
564+ return val;
565+}
566+
567+int64_t FfiConverterInt64::lower(int64_t val) {
568+ return val;
569+}
570+
571+int64_t FfiConverterInt64::read(RustStream &stream) {
572+ int64_t ret;
573+ stream >> ret;
574+
575+ return ret;
576+}
577+
578+void FfiConverterInt64::write(RustStream &stream, int64_t val) {
579+ stream << val;
580+}
581+
582+uint64_t FfiConverterInt64::allocation_size(int64_t) {
583+ return static_cast<uint64_t>(sizeof(int64_t));
584+}
585+
586+bool FfiConverterBool::lift(uint8_t val) {
587+ return !!val;
588+}
589+
590+uint8_t FfiConverterBool::lower(bool val) {
591+ return val;
592+}
593+
594+bool FfiConverterBool::read(RustStream &stream) {
595+ uint8_t val;
596+ stream >> val;
597+
598+ return val;
599+}
600+
601+void FfiConverterBool::write(RustStream &stream, bool val) {
602+ stream << val;
603+}
604+
605+uint64_t FfiConverterBool::allocation_size(bool) {
606+ return 1;
607+}
608+std::string FfiConverterString::lift(RustBuffer buf) {
609+ auto string = std::string(reinterpret_cast<char *>(buf.data), buf.len);
610+
611+ rustbuffer_free(buf);
612+
613+ return string;
614+}
615+
616+RustBuffer FfiConverterString::lower(const std::string &val) {
617+ auto len = static_cast<int32_t>(val.length());
618+ auto bytes = ForeignBytes { len, reinterpret_cast<uint8_t *>(const_cast<char *>(val.data())) };
619+
620+ return rustbuffer_from_bytes(bytes);
621+}
622+
623+std::string FfiConverterString::read(RustStream &stream) {
624+ int32_t len;
625+ std::string string;
626+
627+ stream >> len;
628+
629+ string.resize(len);
630+ stream.read(string.data(), len);
631+
632+ return string;
633+}
634+
635+void FfiConverterString::write(RustStream &stream, const std::string &val) {
636+ stream << static_cast<int32_t>(val.length());
637+ stream.write(val.data(), val.length());
638+}
639+
640+uint64_t FfiConverterString::allocation_size(const std::string &val) {
641+ return static_cast<uint64_t>(sizeof(int32_t) + val.length());
642+}
643+std::vector<uint8_t> FfiConverterBytes::lift(RustBuffer buf) {
644+ auto stream = RustStream(&buf);
645+ auto ret = read(stream);
646+
647+ rustbuffer_free(buf);
648+
649+ return ret;
650+}
651+
652+RustBuffer FfiConverterBytes::lower(const std::vector<uint8_t> &val) {
653+ auto buf = rustbuffer_alloc(allocation_size(val));
654+ auto stream = RustStream(&buf);
655+
656+ write(stream, val);
657+
658+ return buf;
659+}
660+
661+std::vector<uint8_t> FfiConverterBytes::read(RustStream &stream) {
662+ std::vector<uint8_t> ret;
663+ int32_t count;
664+ stream >> count;
665+
666+ ret.reserve(count);
667+
668+ for (decltype(count) i = 0; i < count; i++) {
669+ uint8_t elem;
670+ stream >> elem;
671+ ret.push_back(elem);
672+ }
673+
674+ return ret;
675+}
676+
677+void FfiConverterBytes::write(RustStream &stream, const std::vector<uint8_t> &val) {
678+ stream << static_cast<int32_t>(val.size());
679+
680+ for (auto &elem : val) {
681+ stream << elem;
682+ }
683+}
684+
685+uint64_t FfiConverterBytes::allocation_size(const std::vector<uint8_t> &val) {
686+ return static_cast<uint64_t>(sizeof(int32_t) + sizeof(uint8_t) * val.size());
687+}
688+} // namespace uniffi
689+
690+
691+
692+
693+
694+
695+
696+
697+
698+
699+
700+
701+
702+TonConnectDerivedSession::TonConnectDerivedSession(uint64_t ptr): instance(ptr) {}
703+
704+TonConnectDerivedSession::TonConnectDerivedSession(const TonConnectDerivedSession &other) : instance(0) {
705+ if (other.instance) {
706+ instance = other._uniffi_internal_clone_pointer();
707+ }
708+}
709+
710+
711+
712+
713+std::vector<uint8_t> TonConnectDerivedSession::decrypt_envelope(const std::vector<uint8_t> &body) {
714+ auto ptr = this->_uniffi_internal_clone_pointer();
715+ return uniffi::FfiConverterBytes::lift(
716+ uniffi::rust_call(
717+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_envelope,
718+ uniffi::FfiConverterTonConnectSessionError::lift,
719+ ptr, uniffi::FfiConverterBytes::lower(body)));
720+}
721+TonConnectDerivedRequest TonConnectDerivedSession::decrypt_request(const std::vector<uint8_t> &body, uint64_t now) {
722+ auto ptr = this->_uniffi_internal_clone_pointer();
723+ return uniffi::FfiConverterTypeTonConnectDerivedRequest::lift(
724+ uniffi::rust_call(
725+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_request,
726+ uniffi::FfiConverterTonConnectSessionError::lift,
727+ ptr, uniffi::FfiConverterBytes::lower(body), uniffi::FfiConverterUInt64::lower(now)));
728+}
729+std::vector<uint8_t> TonConnectDerivedSession::encrypt_connect_error(uint64_t event_id, const TonConnectConnectErrorCode &code, const std::string &message) {
730+ auto ptr = this->_uniffi_internal_clone_pointer();
731+ return uniffi::FfiConverterBytes::lift(
732+ uniffi::rust_call(
733+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_connect_error,
734+ uniffi::FfiConverterTonConnectSessionError::lift,
735+ ptr, uniffi::FfiConverterUInt64::lower(event_id), uniffi::FfiConverterTonConnectConnectErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
736+}
737+std::vector<uint8_t> TonConnectDerivedSession::encrypt_connect_event(uint64_t event_id, const TonConnectAccountInfo &account, std::optional<TonConnectProofReply> proof, const TonConnectDevice &device) {
738+ auto ptr = this->_uniffi_internal_clone_pointer();
739+ return uniffi::FfiConverterBytes::lift(
740+ uniffi::rust_call(
741+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_connect_event,
742+ uniffi::FfiConverterTonConnectSessionError::lift,
743+ ptr, uniffi::FfiConverterUInt64::lower(event_id), uniffi::FfiConverterTypeTonConnectAccountInfo::lower(account), uniffi::FfiConverterOptionalTypeTonConnectProofReply::lower(proof), uniffi::FfiConverterTypeTonConnectDevice::lower(device)));
744+}
745+std::vector<uint8_t> TonConnectDerivedSession::encrypt_disconnect_event(uint64_t event_id) {
746+ auto ptr = this->_uniffi_internal_clone_pointer();
747+ return uniffi::FfiConverterBytes::lift(
748+ uniffi::rust_call(
749+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_event,
750+ uniffi::FfiConverterTonConnectSessionError::lift,
751+ ptr, uniffi::FfiConverterUInt64::lower(event_id)));
752+}
753+std::vector<uint8_t> TonConnectDerivedSession::encrypt_disconnect_success(const std::string &request_id) {
754+ auto ptr = this->_uniffi_internal_clone_pointer();
755+ return uniffi::FfiConverterBytes::lift(
756+ uniffi::rust_call(
757+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_success,
758+ uniffi::FfiConverterTonConnectSessionError::lift,
759+ ptr, uniffi::FfiConverterString::lower(request_id)));
760+}
761+std::vector<uint8_t> TonConnectDerivedSession::encrypt_envelope(const std::vector<uint8_t> &body) {
762+ auto ptr = this->_uniffi_internal_clone_pointer();
763+ return uniffi::FfiConverterBytes::lift(
764+ uniffi::rust_call(
765+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_envelope,
766+ uniffi::FfiConverterTonConnectSessionError::lift,
767+ ptr, uniffi::FfiConverterBytes::lower(body)));
768+}
769+std::vector<uint8_t> TonConnectDerivedSession::encrypt_error(const std::string &request_id, const TonConnectRpcErrorCode &code, const std::string &message) {
770+ auto ptr = this->_uniffi_internal_clone_pointer();
771+ return uniffi::FfiConverterBytes::lift(
772+ uniffi::rust_call(
773+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_error,
774+ uniffi::FfiConverterTonConnectSessionError::lift,
775+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTonConnectRpcErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
776+}
777+std::vector<uint8_t> TonConnectDerivedSession::encrypt_send_success(const std::string &request_id, const std::string &signed_boc) {
778+ auto ptr = this->_uniffi_internal_clone_pointer();
779+ return uniffi::FfiConverterBytes::lift(
780+ uniffi::rust_call(
781+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_send_success,
782+ uniffi::FfiConverterTonConnectSessionError::lift,
783+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(signed_boc)));
784+}
785+std::vector<uint8_t> TonConnectDerivedSession::encrypt_sign_data_success(const std::string &request_id, const TonConnectSignedData &signed_data) {
786+ auto ptr = this->_uniffi_internal_clone_pointer();
787+ return uniffi::FfiConverterBytes::lift(
788+ uniffi::rust_call(
789+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_sign_data_success,
790+ uniffi::FfiConverterTonConnectSessionError::lift,
791+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTypeTonConnectSignedData::lower(signed_data)));
792+}
793+std::vector<uint8_t> TonConnectDerivedSession::open_challenge(const std::vector<uint8_t> &challenge) {
794+ auto ptr = this->_uniffi_internal_clone_pointer();
795+ return uniffi::FfiConverterBytes::lift(
796+ uniffi::rust_call(
797+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_open_challenge,
798+ uniffi::FfiConverterTonConnectSessionError::lift,
799+ ptr, uniffi::FfiConverterBytes::lower(challenge)));
800+}
801+std::string TonConnectDerivedSession::public_key_hex() {
802+ auto ptr = this->_uniffi_internal_clone_pointer();
803+ return uniffi::FfiConverterString::lift(
804+ uniffi::rust_call(
805+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_public_key_hex,
806+ nullptr,
807+ ptr));
808+}
809+std::vector<uint8_t> TonConnectDerivedSession::signing_public_key() {
810+ auto ptr = this->_uniffi_internal_clone_pointer();
811+ return uniffi::FfiConverterBytes::lift(
812+ uniffi::rust_call(
813+ uniffi_wallet_engine_fn_method_tonconnectderivedsession_signing_public_key,
814+ nullptr,
815+ ptr));
816+}
817+
818+TonConnectDerivedSession::~TonConnectDerivedSession() {
819+ uniffi::rust_call(
820+ uniffi_wallet_engine_fn_free_tonconnectderivedsession,
821+ nullptr,
822+ this->instance
823+ );
824+}
825+
826+uint64_t TonConnectDerivedSession::_uniffi_internal_clone_pointer() const {
827+ return uniffi::rust_call(
828+ uniffi_wallet_engine_fn_clone_tonconnectderivedsession,
829+ nullptr,
830+ this->instance
831+ );
832+}
833+
834+
835+
836+
837+TonConnectSession::TonConnectSession(uint64_t ptr): instance(ptr) {}
838+
839+TonConnectSession::TonConnectSession(const TonConnectSession &other) : instance(0) {
840+ if (other.instance) {
841+ instance = other._uniffi_internal_clone_pointer();
842+ }
843+}
844+
845+
846+
847+
848+TonConnectPreparedPost TonConnectSession::approve_connect(const TonConnectAccountInfo &account, std::optional<TonConnectProofReply> proof, const TonConnectDevice &device) {
849+ auto ptr = this->_uniffi_internal_clone_pointer();
850+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
851+ uniffi::rust_call(
852+ uniffi_wallet_engine_fn_method_tonconnectsession_approve_connect,
853+ uniffi::FfiConverterTonConnectSessionError::lift,
854+ ptr, uniffi::FfiConverterTypeTonConnectAccountInfo::lower(account), uniffi::FfiConverterOptionalTypeTonConnectProofReply::lower(proof), uniffi::FfiConverterTypeTonConnectDevice::lower(device)));
855+}
856+std::string TonConnectSession::begin_events_subscription() {
857+ auto ptr = this->_uniffi_internal_clone_pointer();
858+ return uniffi::FfiConverterString::lift(
859+ uniffi::rust_call(
860+ uniffi_wallet_engine_fn_method_tonconnectsession_begin_events_subscription,
861+ uniffi::FfiConverterTonConnectSessionError::lift,
862+ ptr));
863+}
864+void TonConnectSession::complete_pending_post() {
865+ auto ptr = this->_uniffi_internal_clone_pointer();
866+
867+ uniffi::rust_call(
868+ uniffi_wallet_engine_fn_method_tonconnectsession_complete_pending_post,
869+ uniffi::FfiConverterTonConnectSessionError::lift,
870+ ptr);
871+}
872+std::optional<TonConnectConnectPrompt> TonConnectSession::connect_prompt() {
873+ auto ptr = this->_uniffi_internal_clone_pointer();
874+ return uniffi::FfiConverterOptionalTypeTonConnectConnectPrompt::lift(
875+ uniffi::rust_call(
876+ uniffi_wallet_engine_fn_method_tonconnectsession_connect_prompt,
877+ uniffi::FfiConverterTonConnectSessionError::lift,
878+ ptr));
879+}
880+TonConnectPreparedPost TonConnectSession::disconnect() {
881+ auto ptr = this->_uniffi_internal_clone_pointer();
882+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
883+ uniffi::rust_call(
884+ uniffi_wallet_engine_fn_method_tonconnectsession_disconnect,
885+ uniffi::FfiConverterTonConnectSessionError::lift,
886+ ptr));
887+}
888+std::vector<TonConnectIncomingRequest> TonConnectSession::ingest_sse_chunk(const std::vector<uint8_t> &chunk, uint64_t now) {
889+ auto ptr = this->_uniffi_internal_clone_pointer();
890+ return uniffi::FfiConverterSequenceTonConnectIncomingRequest::lift(
891+ uniffi::rust_call(
892+ uniffi_wallet_engine_fn_method_tonconnectsession_ingest_sse_chunk,
893+ uniffi::FfiConverterTonConnectSessionError::lift,
894+ ptr, uniffi::FfiConverterBytes::lower(chunk), uniffi::FfiConverterUInt64::lower(now)));
895+}
896+std::optional<TonConnectPreparedPost> TonConnectSession::pending_post() {
897+ auto ptr = this->_uniffi_internal_clone_pointer();
898+ return uniffi::FfiConverterOptionalTypeTonConnectPreparedPost::lift(
899+ uniffi::rust_call(
900+ uniffi_wallet_engine_fn_method_tonconnectsession_pending_post,
901+ uniffi::FfiConverterTonConnectSessionError::lift,
902+ ptr));
903+}
904+std::vector<TonConnectIncomingRequest> TonConnectSession::pending_requests(uint64_t now) {
905+ auto ptr = this->_uniffi_internal_clone_pointer();
906+ return uniffi::FfiConverterSequenceTonConnectIncomingRequest::lift(
907+ uniffi::rust_call(
908+ uniffi_wallet_engine_fn_method_tonconnectsession_pending_requests,
909+ uniffi::FfiConverterTonConnectSessionError::lift,
910+ ptr, uniffi::FfiConverterUInt64::lower(now)));
911+}
912+std::string TonConnectSession::persisted() {
913+ auto ptr = this->_uniffi_internal_clone_pointer();
914+ return uniffi::FfiConverterString::lift(
915+ uniffi::rust_call(
916+ uniffi_wallet_engine_fn_method_tonconnectsession_persisted,
917+ uniffi::FfiConverterTonConnectSessionError::lift,
918+ ptr));
919+}
920+TonConnectSessionPhase TonConnectSession::phase() {
921+ auto ptr = this->_uniffi_internal_clone_pointer();
922+ return uniffi::FfiConverterTonConnectSessionPhase::lift(
923+ uniffi::rust_call(
924+ uniffi_wallet_engine_fn_method_tonconnectsession_phase,
925+ uniffi::FfiConverterTonConnectSessionError::lift,
926+ ptr));
927+}
928+TonConnectPreparedPost TonConnectSession::prepare_disconnect_success(const std::string &request_id) {
929+ auto ptr = this->_uniffi_internal_clone_pointer();
930+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
931+ uniffi::rust_call(
932+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_disconnect_success,
933+ uniffi::FfiConverterTonConnectSessionError::lift,
934+ ptr, uniffi::FfiConverterString::lower(request_id)));
935+}
936+TonConnectPreparedPost TonConnectSession::prepare_error(const std::string &request_id, const TonConnectRpcErrorCode &code, const std::string &message) {
937+ auto ptr = this->_uniffi_internal_clone_pointer();
938+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
939+ uniffi::rust_call(
940+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_error,
941+ uniffi::FfiConverterTonConnectSessionError::lift,
942+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTonConnectRpcErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
943+}
944+TonConnectPreparedPost TonConnectSession::prepare_send_success(const std::string &request_id, const std::string &signed_boc) {
945+ auto ptr = this->_uniffi_internal_clone_pointer();
946+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
947+ uniffi::rust_call(
948+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_send_success,
949+ uniffi::FfiConverterTonConnectSessionError::lift,
950+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(signed_boc)));
951+}
952+TonConnectPreparedPost TonConnectSession::prepare_sign_message_success(const std::string &request_id, const std::string &internal_boc) {
953+ auto ptr = this->_uniffi_internal_clone_pointer();
954+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
955+ uniffi::rust_call(
956+ uniffi_wallet_engine_fn_method_tonconnectsession_prepare_sign_message_success,
957+ uniffi::FfiConverterTonConnectSessionError::lift,
958+ ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(internal_boc)));
959+}
960+TonConnectPreparedPost TonConnectSession::reject_connect(const std::string &message) {
961+ auto ptr = this->_uniffi_internal_clone_pointer();
962+ return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
963+ uniffi::rust_call(
964+ uniffi_wallet_engine_fn_method_tonconnectsession_reject_connect,
965+ uniffi::FfiConverterTonConnectSessionError::lift,
966+ ptr, uniffi::FfiConverterString::lower(message)));
967+}
968+
969+TonConnectSession::~TonConnectSession() {
970+ uniffi::rust_call(
971+ uniffi_wallet_engine_fn_free_tonconnectsession,
972+ nullptr,
973+ this->instance
974+ );
975+}
976+
977+uint64_t TonConnectSession::_uniffi_internal_clone_pointer() const {
978+ return uniffi::rust_call(
979+ uniffi_wallet_engine_fn_clone_tonconnectsession,
980+ nullptr,
981+ this->instance
982+ );
983+}
984+
985+
986+
987+
988+WalletClient::WalletClient(uint64_t ptr): instance(ptr) {}
989+
990+WalletClient::WalletClient(const WalletClient &other) : instance(0) {
991+ if (other.instance) {
992+ instance = other._uniffi_internal_clone_pointer();
993+ }
994+}
995+
996+
997+
998+
999+std::shared_ptr<WalletClient> WalletClient::init(const WalletClientConfig &config, const std::shared_ptr<WalletHttpHost> &http_host, const std::shared_ptr<WalletPlatformHost> &platform_host) {
1000+ return std::shared_ptr<WalletClient>(
1001+ new WalletClient(
1002+ uniffi::rust_call(
1003+ uniffi_wallet_engine_fn_constructor_walletclient_new,
1004+ uniffi::FfiConverterWalletClientError::lift, uniffi::FfiConverterTypeWalletClientConfig::lower(config), uniffi::FfiConverterWalletHttpHost::lower(http_host), uniffi::FfiConverterWalletPlatformHost::lower(platform_host)))
1005+ );
1006+}
1007+
1008+std::shared_ptr<WalletClient> WalletClient::new_statusless(const WalletClientConfig &config, const std::shared_ptr<WalletStatuslessHost> &statusless_host, const std::shared_ptr<WalletPlatformHost> &platform_host) {
1009+ return std::shared_ptr<WalletClient>(new WalletClient(
1010+ uniffi::rust_call(
1011+ uniffi_wallet_engine_fn_constructor_walletclient_new_statusless,
1012+ uniffi::FfiConverterWalletClientError::lift, uniffi::FfiConverterTypeWalletClientConfig::lower(config), uniffi::FfiConverterWalletStatuslessHost::lower(statusless_host), uniffi::FfiConverterWalletPlatformHost::lower(platform_host))));
1013+}
1014+
1015+void WalletClient::cancel_load_more_activity() {
1016+ auto ptr = this->_uniffi_internal_clone_pointer();
1017+
1018+ uniffi::rust_call_async(
1019+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_activity(
1020+ ptr); },
1021+ ffi_wallet_engine_rust_future_poll_void,
1022+ ffi_wallet_engine_rust_future_complete_void,
1023+ ffi_wallet_engine_rust_future_free_void,
1024+ uniffi::FfiConverterWalletClientError::lift
1025+ );
1026+}
1027+WalletUpdate WalletClient::load_more_activity() {
1028+ auto ptr = this->_uniffi_internal_clone_pointer();
1029+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1030+ uniffi::rust_call_async(
1031+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_load_more_activity(
1032+ ptr); },
1033+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1034+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1035+ ffi_wallet_engine_rust_future_free_rust_buffer,
1036+ uniffi::FfiConverterWalletClientError::lift
1037+ ));
1038+}
1039+void WalletClient::shutdown() {
1040+ auto ptr = this->_uniffi_internal_clone_pointer();
1041+
1042+ uniffi::rust_call_async(
1043+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_shutdown(
1044+ ptr); },
1045+ ffi_wallet_engine_rust_future_poll_void,
1046+ ffi_wallet_engine_rust_future_complete_void,
1047+ ffi_wallet_engine_rust_future_free_void,
1048+ uniffi::FfiConverterWalletClientError::lift
1049+ );
1050+}
1051+WalletSnapshot WalletClient::snapshot() {
1052+ auto ptr = this->_uniffi_internal_clone_pointer();
1053+ return uniffi::FfiConverterTypeWalletSnapshot::lift(
1054+ uniffi::rust_call(
1055+ uniffi_wallet_engine_fn_method_walletclient_snapshot,
1056+ uniffi::FfiConverterWalletClientError::lift,
1057+ ptr));
1058+}
1059+WalletSnapshot WalletClient::wait_for_change(uint64_t after_revision) {
1060+ auto ptr = this->_uniffi_internal_clone_pointer();
1061+ return uniffi::FfiConverterTypeWalletSnapshot::lift(
1062+ uniffi::rust_call_async(
1063+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_wait_for_change(
1064+ ptr, uniffi::FfiConverterUInt64::lower(after_revision)); },
1065+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1066+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1067+ ffi_wallet_engine_rust_future_free_rust_buffer,
1068+ uniffi::FfiConverterWalletClientError::lift
1069+ ));
1070+}
1071+std::optional<TonAddressString> WalletClient::resolve_dns(const std::string &name) {
1072+ auto ptr = this->_uniffi_internal_clone_pointer();
1073+ return uniffi::FfiConverterOptionalTypeTonAddressString::lift(
1074+ uniffi::rust_call_async(
1075+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_dns(
1076+ ptr, uniffi::FfiConverterString::lower(name)); },
1077+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1078+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1079+ ffi_wallet_engine_rust_future_free_rust_buffer,
1080+ uniffi::FfiConverterWalletClientError::lift
1081+ ));
1082+}
1083+Boc WalletClient::create_encrypted_comment(const CreateEncryptedCommentRequest &request) {
1084+ auto ptr = this->_uniffi_internal_clone_pointer();
1085+ return uniffi::FfiConverterTypeBoc::lift(
1086+ uniffi::rust_call_async(
1087+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_create_encrypted_comment(
1088+ ptr, uniffi::FfiConverterTypeCreateEncryptedCommentRequest::lower(request)); },
1089+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1090+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1091+ ffi_wallet_engine_rust_future_free_rust_buffer,
1092+ uniffi::FfiConverterWalletClientError::lift
1093+ ));
1094+}
1095+std::string WalletClient::decrypt_comment(const DecryptCommentRequest &request) {
1096+ auto ptr = this->_uniffi_internal_clone_pointer();
1097+ return uniffi::FfiConverterString::lift(
1098+ uniffi::rust_call_async(
1099+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_decrypt_comment(
1100+ ptr, uniffi::FfiConverterTypeDecryptCommentRequest::lower(request)); },
1101+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1102+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1103+ ffi_wallet_engine_rust_future_free_rust_buffer,
1104+ uniffi::FfiConverterWalletClientError::lift
1105+ ));
1106+}
1107+std::vector<uint8_t> WalletClient::resolve_encrypted_comment_recipient(const EncryptedCommentRecipientRequest &request) {
1108+ auto ptr = this->_uniffi_internal_clone_pointer();
1109+ return uniffi::FfiConverterBytes::lift(
1110+ uniffi::rust_call_async(
1111+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_encrypted_comment_recipient(
1112+ ptr, uniffi::FfiConverterTypeEncryptedCommentRecipientRequest::lower(request)); },
1113+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1114+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1115+ ffi_wallet_engine_rust_future_free_rust_buffer,
1116+ uniffi::FfiConverterWalletClientError::lift
1117+ ));
1118+}
1119+PreparedKeyRotation WalletClient::prepare_key_rotation(const PrepareKeyRotationRequest &request) {
1120+ auto ptr = this->_uniffi_internal_clone_pointer();
1121+ return uniffi::FfiConverterTypePreparedKeyRotation::lift(
1122+ uniffi::rust_call_async(
1123+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_key_rotation(
1124+ ptr, uniffi::FfiConverterTypePrepareKeyRotationRequest::lower(request)); },
1125+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1126+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1127+ ffi_wallet_engine_rust_future_free_rust_buffer,
1128+ uniffi::FfiConverterWalletClientError::lift
1129+ ));
1130+}
1131+void WalletClient::cancel_load_more_nfts() {
1132+ auto ptr = this->_uniffi_internal_clone_pointer();
1133+
1134+ uniffi::rust_call_async(
1135+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_nfts(
1136+ ptr); },
1137+ ffi_wallet_engine_rust_future_poll_void,
1138+ ffi_wallet_engine_rust_future_complete_void,
1139+ ffi_wallet_engine_rust_future_free_void,
1140+ uniffi::FfiConverterWalletClientError::lift
1141+ );
1142+}
1143+void WalletClient::cancel_refresh_nfts() {
1144+ auto ptr = this->_uniffi_internal_clone_pointer();
1145+
1146+ uniffi::rust_call_async(
1147+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh_nfts(
1148+ ptr); },
1149+ ffi_wallet_engine_rust_future_poll_void,
1150+ ffi_wallet_engine_rust_future_complete_void,
1151+ ffi_wallet_engine_rust_future_free_void,
1152+ uniffi::FfiConverterWalletClientError::lift
1153+ );
1154+}
1155+WalletUpdate WalletClient::load_more_nfts() {
1156+ auto ptr = this->_uniffi_internal_clone_pointer();
1157+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1158+ uniffi::rust_call_async(
1159+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_load_more_nfts(
1160+ ptr); },
1161+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1162+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1163+ ffi_wallet_engine_rust_future_free_rust_buffer,
1164+ uniffi::FfiConverterWalletClientError::lift
1165+ ));
1166+}
1167+WalletUpdate WalletClient::refresh_nfts() {
1168+ auto ptr = this->_uniffi_internal_clone_pointer();
1169+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1170+ uniffi::rust_call_async(
1171+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_refresh_nfts(
1172+ ptr); },
1173+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1174+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1175+ ffi_wallet_engine_rust_future_free_rust_buffer,
1176+ uniffi::FfiConverterWalletClientError::lift
1177+ ));
1178+}
1179+PreparedTransfer WalletClient::prepare_nft_transfer(const PrepareNftTransferRequest &request) {
1180+ auto ptr = this->_uniffi_internal_clone_pointer();
1181+ return uniffi::FfiConverterTypePreparedTransfer::lift(
1182+ uniffi::rust_call_async(
1183+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_nft_transfer(
1184+ ptr, uniffi::FfiConverterTypePrepareNftTransferRequest::lower(request)); },
1185+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1186+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1187+ ffi_wallet_engine_rust_future_free_rust_buffer,
1188+ uniffi::FfiConverterWalletClientError::lift
1189+ ));
1190+}
1191+SendPreview WalletClient::preview_nft_transfer(const NftTransferPreviewRequest &request) {
1192+ auto ptr = this->_uniffi_internal_clone_pointer();
1193+ return uniffi::FfiConverterTypeSendPreview::lift(
1194+ uniffi::rust_call_async(
1195+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_nft_transfer(
1196+ ptr, uniffi::FfiConverterTypeNftTransferPreviewRequest::lower(request)); },
1197+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1198+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1199+ ffi_wallet_engine_rust_future_free_rust_buffer,
1200+ uniffi::FfiConverterWalletClientError::lift
1201+ ));
1202+}
1203+SendResult WalletClient::send_nft_transfer(const NftTransferRequest &request) {
1204+ auto ptr = this->_uniffi_internal_clone_pointer();
1205+ return uniffi::FfiConverterTypeSendResult::lift(
1206+ uniffi::rust_call_async(
1207+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_send_nft_transfer(
1208+ ptr, uniffi::FfiConverterTypeNftTransferRequest::lower(request)); },
1209+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1210+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1211+ ffi_wallet_engine_rust_future_free_rust_buffer,
1212+ uniffi::FfiConverterWalletClientError::lift
1213+ ));
1214+}
1215+PreparedTransfer WalletClient::prepare_transfer(const PrepareTransferRequest &request) {
1216+ auto ptr = this->_uniffi_internal_clone_pointer();
1217+ return uniffi::FfiConverterTypePreparedTransfer::lift(
1218+ uniffi::rust_call_async(
1219+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_transfer(
1220+ ptr, uniffi::FfiConverterTypePrepareTransferRequest::lower(request)); },
1221+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1222+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1223+ ffi_wallet_engine_rust_future_free_rust_buffer,
1224+ uniffi::FfiConverterWalletClientError::lift
1225+ ));
1226+}
1227+void WalletClient::cancel_send_preview() {
1228+ auto ptr = this->_uniffi_internal_clone_pointer();
1229+
1230+ uniffi::rust_call_async(
1231+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send_preview(
1232+ ptr); },
1233+ ffi_wallet_engine_rust_future_poll_void,
1234+ ffi_wallet_engine_rust_future_complete_void,
1235+ ffi_wallet_engine_rust_future_free_void,
1236+ uniffi::FfiConverterWalletClientError::lift
1237+ );
1238+}
1239+SendPreview WalletClient::preview_key_rotation() {
1240+ auto ptr = this->_uniffi_internal_clone_pointer();
1241+ return uniffi::FfiConverterTypeSendPreview::lift(
1242+ uniffi::rust_call_async(
1243+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_key_rotation(
1244+ ptr); },
1245+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1246+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1247+ ffi_wallet_engine_rust_future_free_rust_buffer,
1248+ uniffi::FfiConverterWalletClientError::lift
1249+ ));
1250+}
1251+SendPreview WalletClient::preview_send(const SendPreviewRequest &request) {
1252+ auto ptr = this->_uniffi_internal_clone_pointer();
1253+ return uniffi::FfiConverterTypeSendPreview::lift(
1254+ uniffi::rust_call_async(
1255+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_send(
1256+ ptr, uniffi::FfiConverterTypeSendPreviewRequest::lower(request)); },
1257+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1258+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1259+ ffi_wallet_engine_rust_future_free_rust_buffer,
1260+ uniffi::FfiConverterWalletClientError::lift
1261+ ));
1262+}
1263+SendPreview WalletClient::preview_send_boc(const SendBocRequest &request) {
1264+ auto ptr = this->_uniffi_internal_clone_pointer();
1265+ return uniffi::FfiConverterTypeSendPreview::lift(
1266+ uniffi::rust_call_async(
1267+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_send_boc(
1268+ ptr, uniffi::FfiConverterTypeSendBocRequest::lower(request)); },
1269+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1270+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1271+ ffi_wallet_engine_rust_future_free_rust_buffer,
1272+ uniffi::FfiConverterWalletClientError::lift
1273+ ));
1274+}
1275+SignMessagePreview WalletClient::preview_sign_message(const SendPreviewRequest &request) {
1276+ auto ptr = this->_uniffi_internal_clone_pointer();
1277+ return uniffi::FfiConverterTypeSignMessagePreview::lift(
1278+ uniffi::rust_call_async(
1279+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_sign_message(
1280+ ptr, uniffi::FfiConverterTypeSendPreviewRequest::lower(request)); },
1281+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1282+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1283+ ffi_wallet_engine_rust_future_free_rust_buffer,
1284+ uniffi::FfiConverterWalletClientError::lift
1285+ ));
1286+}
1287+SendPreview WalletClient::preview_ton_connect(const SendRequest &request) {
1288+ auto ptr = this->_uniffi_internal_clone_pointer();
1289+ return uniffi::FfiConverterTypeSendPreview::lift(
1290+ uniffi::rust_call_async(
1291+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_ton_connect(
1292+ ptr, uniffi::FfiConverterTypeSendRequest::lower(request)); },
1293+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1294+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1295+ ffi_wallet_engine_rust_future_free_rust_buffer,
1296+ uniffi::FfiConverterWalletClientError::lift
1297+ ));
1298+}
1299+void WalletClient::cancel_refresh() {
1300+ auto ptr = this->_uniffi_internal_clone_pointer();
1301+
1302+ uniffi::rust_call_async(
1303+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh(
1304+ ptr); },
1305+ ffi_wallet_engine_rust_future_poll_void,
1306+ ffi_wallet_engine_rust_future_complete_void,
1307+ ffi_wallet_engine_rust_future_free_void,
1308+ uniffi::FfiConverterWalletClientError::lift
1309+ );
1310+}
1311+WalletUpdate WalletClient::refresh() {
1312+ auto ptr = this->_uniffi_internal_clone_pointer();
1313+ return uniffi::FfiConverterTypeWalletUpdate::lift(
1314+ uniffi::rust_call_async(
1315+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_refresh(
1316+ ptr); },
1317+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1318+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1319+ ffi_wallet_engine_rust_future_free_rust_buffer,
1320+ uniffi::FfiConverterWalletClientError::lift
1321+ ));
1322+}
1323+SendSnapshot WalletClient::resolve_pending() {
1324+ auto ptr = this->_uniffi_internal_clone_pointer();
1325+ return uniffi::FfiConverterTypeSendSnapshot::lift(
1326+ uniffi::rust_call_async(
1327+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_pending(
1328+ ptr); },
1329+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1330+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1331+ ffi_wallet_engine_rust_future_free_rust_buffer,
1332+ uniffi::FfiConverterWalletClientError::lift
1333+ ));
1334+}
1335+void WalletClient::cancel_send() {
1336+ auto ptr = this->_uniffi_internal_clone_pointer();
1337+
1338+ uniffi::rust_call_async(
1339+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send(
1340+ ptr); },
1341+ ffi_wallet_engine_rust_future_poll_void,
1342+ ffi_wallet_engine_rust_future_complete_void,
1343+ ffi_wallet_engine_rust_future_free_void,
1344+ uniffi::FfiConverterWalletClientError::lift
1345+ );
1346+}
1347+SendResult WalletClient::send(const SendRequest &request) {
1348+ auto ptr = this->_uniffi_internal_clone_pointer();
1349+ return uniffi::FfiConverterTypeSendResult::lift(
1350+ uniffi::rust_call_async(
1351+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_send(
1352+ ptr, uniffi::FfiConverterTypeSendRequest::lower(request)); },
1353+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1354+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1355+ ffi_wallet_engine_rust_future_free_rust_buffer,
1356+ uniffi::FfiConverterWalletClientError::lift
1357+ ));
1358+}
1359+SendResult WalletClient::send_boc(const SendBocRequest &request) {
1360+ auto ptr = this->_uniffi_internal_clone_pointer();
1361+ return uniffi::FfiConverterTypeSendResult::lift(
1362+ uniffi::rust_call_async(
1363+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_send_boc(
1364+ ptr, uniffi::FfiConverterTypeSendBocRequest::lower(request)); },
1365+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1366+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1367+ ffi_wallet_engine_rust_future_free_rust_buffer,
1368+ uniffi::FfiConverterWalletClientError::lift
1369+ ));
1370+}
1371+SignMessageResult WalletClient::sign_message(const SignMessageRequest &request) {
1372+ auto ptr = this->_uniffi_internal_clone_pointer();
1373+ return uniffi::FfiConverterTypeSignMessageResult::lift(
1374+ uniffi::rust_call_async(
1375+ [&]() { return uniffi_wallet_engine_fn_method_walletclient_sign_message(
1376+ ptr, uniffi::FfiConverterTypeSignMessageRequest::lower(request)); },
1377+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1378+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1379+ ffi_wallet_engine_rust_future_free_rust_buffer,
1380+ uniffi::FfiConverterWalletClientError::lift
1381+ ));
1382+}
1383+
1384+WalletClient::~WalletClient() {
1385+ uniffi::rust_call(
1386+ uniffi_wallet_engine_fn_free_walletclient,
1387+ nullptr,
1388+ this->instance
1389+ );
1390+}
1391+
1392+uint64_t WalletClient::_uniffi_internal_clone_pointer() const {
1393+ return uniffi::rust_call(
1394+ uniffi_wallet_engine_fn_clone_walletclient,
1395+ nullptr,
1396+ this->instance
1397+ );
1398+}
1399+
1400+
1401+namespace uniffi {
1402+
1403+ void UniffiCallbackInterfaceWalletHttpHost::execute_http(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1404+ auto obj = FfiConverterWalletHttpHost::handle_map.at(uniffi_handle);
1405+
1406+ auto make_call = [&]() -> HttpResponse {
1407+ auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_http(
1408+ arg0);
1409+ };
1410+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1411+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1412+ UniffiForeignFutureResultRustBuffer result = {};
1413+ uniffi_out_dropped_callback.handle = 0;
1414+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1415+
1416+
1417+ auto write_value = [&](const HttpResponse &v) {
1418+ result.return_value = FfiConverterTypeHttpResponse::lower(v);
1419+ };
1420+
1421+
1422+
1423+ rust_call_trait_interface_with_error<HttpHostError>(&result.call_status, make_call, write_value, FfiConverterHttpHostError::lower);
1424+
1425+ complete(uniffi_callback_data, result);
1426+}
1427+ void UniffiCallbackInterfaceWalletHttpHost::cancel_http(uint64_t uniffi_handle,RustBuffer request_id,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1428+ auto obj = FfiConverterWalletHttpHost::handle_map.at(uniffi_handle);
1429+
1430+ auto make_call = [&]() {
1431+ auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_http(
1432+ arg0);
1433+ };
1434+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1435+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1436+ UniffiForeignFutureResultVoid result = {};
1437+ uniffi_out_dropped_callback.handle = 0;
1438+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1439+
1440+
1441+ auto write_value = [](){};
1442+
1443+
1444+
1445+ rust_call_trait_interface(&result.call_status, make_call, write_value);
1446+
1447+ complete(uniffi_callback_data, result);
1448+}
1449+
1450+void UniffiCallbackInterfaceWalletHttpHost::uniffi_free(uint64_t uniffi_handle) {
1451+ FfiConverterWalletHttpHost::handle_map.erase(uniffi_handle);
1452+}
1453+
1454+uint64_t UniffiCallbackInterfaceWalletHttpHost::uniffi_clone(uint64_t uniffi_handle) {
1455+ return FfiConverterWalletHttpHost::handle_map.insert(
1456+ FfiConverterWalletHttpHost::handle_map.at(uniffi_handle)
1457+ );
1458+}
1459+
1460+void UniffiCallbackInterfaceWalletHttpHost::init() {
1461+ uniffi_wallet_engine_fn_init_callback_vtable_wallethttphost(vtable);
1462+}
1463+} // namespace uniffi
1464+
1465+
1466+WalletHttpHostImpl::WalletHttpHostImpl(uint64_t ptr): instance(ptr) {}
1467+
1468+WalletHttpHostImpl::WalletHttpHostImpl(const WalletHttpHostImpl &other) : instance(0) {
1469+ if (other.instance) {
1470+ instance = other._uniffi_internal_clone_pointer();
1471+ }
1472+}
1473+
1474+
1475+
1476+
1477+HttpResponse WalletHttpHostImpl::execute_http(const HttpRequest &request) {
1478+ auto ptr = this->_uniffi_internal_clone_pointer();
1479+ return uniffi::FfiConverterTypeHttpResponse::lift(
1480+ uniffi::rust_call_async(
1481+ [&]() { return uniffi_wallet_engine_fn_method_wallethttphost_execute_http(
1482+ ptr, uniffi::FfiConverterTypeHttpRequest::lower(request)); },
1483+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1484+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1485+ ffi_wallet_engine_rust_future_free_rust_buffer,
1486+ uniffi::FfiConverterHttpHostError::lift
1487+ ));
1488+}
1489+void WalletHttpHostImpl::cancel_http(const HttpRequestId &request_id) {
1490+ auto ptr = this->_uniffi_internal_clone_pointer();
1491+
1492+ uniffi::rust_call_async(
1493+ [&]() { return uniffi_wallet_engine_fn_method_wallethttphost_cancel_http(
1494+ ptr, uniffi::FfiConverterTypeHttpRequestId::lower(request_id)); },
1495+ ffi_wallet_engine_rust_future_poll_void,
1496+ ffi_wallet_engine_rust_future_complete_void,
1497+ ffi_wallet_engine_rust_future_free_void,
1498+ nullptr
1499+ );
1500+}
1501+
1502+WalletHttpHostImpl::~WalletHttpHostImpl() {
1503+ uniffi::rust_call(
1504+ uniffi_wallet_engine_fn_free_wallethttphost,
1505+ nullptr,
1506+ this->instance
1507+ );
1508+}
1509+
1510+uint64_t WalletHttpHostImpl::_uniffi_internal_clone_pointer() const {
1511+ return uniffi::rust_call(
1512+ uniffi_wallet_engine_fn_clone_wallethttphost,
1513+ nullptr,
1514+ this->instance
1515+ );
1516+}
1517+
1518+
1519+
1520+
1521+WalletLifecycle::WalletLifecycle(uint64_t ptr): instance(ptr) {}
1522+
1523+WalletLifecycle::WalletLifecycle(const WalletLifecycle &other) : instance(0) {
1524+ if (other.instance) {
1525+ instance = other._uniffi_internal_clone_pointer();
1526+ }
1527+}
1528+
1529+
1530+
1531+
1532+std::shared_ptr<WalletLifecycle> WalletLifecycle::init(const std::shared_ptr<WalletPlatformHost> &platform_host) {
1533+ return std::shared_ptr<WalletLifecycle>(
1534+ new WalletLifecycle(
1535+ uniffi::rust_call(
1536+ uniffi_wallet_engine_fn_constructor_walletlifecycle_new,
1537+ nullptr, uniffi::FfiConverterWalletPlatformHost::lower(platform_host)))
1538+ );
1539+}
1540+
1541+CreatedWallet WalletLifecycle::create_wallet(const CreateWalletRequest &request) {
1542+ auto ptr = this->_uniffi_internal_clone_pointer();
1543+ return uniffi::FfiConverterTypeCreatedWallet::lift(
1544+ uniffi::rust_call_async(
1545+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_create_wallet(
1546+ ptr, uniffi::FfiConverterTypeCreateWalletRequest::lower(request)); },
1547+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1548+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1549+ ffi_wallet_engine_rust_future_free_rust_buffer,
1550+ uniffi::FfiConverterWalletLifecycleError::lift
1551+ ));
1552+}
1553+void WalletLifecycle::delete_wallet(const WalletDescriptor &descriptor) {
1554+ auto ptr = this->_uniffi_internal_clone_pointer();
1555+
1556+ uniffi::rust_call_async(
1557+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_delete_wallet(
1558+ ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)); },
1559+ ffi_wallet_engine_rust_future_poll_void,
1560+ ffi_wallet_engine_rust_future_complete_void,
1561+ ffi_wallet_engine_rust_future_free_void,
1562+ uniffi::FfiConverterWalletLifecycleError::lift
1563+ );
1564+}
1565+std::shared_ptr<TonConnectDerivedSession> WalletLifecycle::derive_ton_connect_session(const TonConnectDerivedSessionRequest &request) {
1566+ auto ptr = this->_uniffi_internal_clone_pointer();
1567+ return uniffi::FfiConverterTonConnectDerivedSession::lift(
1568+ uniffi::rust_call_async(
1569+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_derive_ton_connect_session(
1570+ ptr, uniffi::FfiConverterTypeTonConnectDerivedSessionRequest::lower(request)); },
1571+ ffi_wallet_engine_rust_future_poll_u64,
1572+ ffi_wallet_engine_rust_future_complete_u64,
1573+ ffi_wallet_engine_rust_future_free_u64,
1574+ uniffi::FfiConverterWalletLifecycleError::lift
1575+ ));
1576+}
1577+WalletDescriptor WalletLifecycle::import_wallet(const ImportWalletRequest &request) {
1578+ auto ptr = this->_uniffi_internal_clone_pointer();
1579+ return uniffi::FfiConverterTypeWalletDescriptor::lift(
1580+ uniffi::rust_call_async(
1581+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_import_wallet(
1582+ ptr, uniffi::FfiConverterTypeImportWalletRequest::lower(request)); },
1583+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1584+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1585+ ffi_wallet_engine_rust_future_free_rust_buffer,
1586+ uniffi::FfiConverterWalletLifecycleError::lift
1587+ ));
1588+}
1589+RecoveryPhrase WalletLifecycle::reveal_recovery_phrase(const WalletDescriptor &descriptor) {
1590+ auto ptr = this->_uniffi_internal_clone_pointer();
1591+ return uniffi::FfiConverterTypeRecoveryPhrase::lift(
1592+ uniffi::rust_call_async(
1593+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_reveal_recovery_phrase(
1594+ ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)); },
1595+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1596+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1597+ ffi_wallet_engine_rust_future_free_rust_buffer,
1598+ uniffi::FfiConverterWalletLifecycleError::lift
1599+ ));
1600+}
1601+TonConnectSignedData WalletLifecycle::sign_ton_connect_data(const TonConnectSignDataSignRequest &request) {
1602+ auto ptr = this->_uniffi_internal_clone_pointer();
1603+ return uniffi::FfiConverterTypeTonConnectSignedData::lift(
1604+ uniffi::rust_call_async(
1605+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_sign_ton_connect_data(
1606+ ptr, uniffi::FfiConverterTypeTonConnectSignDataSignRequest::lower(request)); },
1607+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1608+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1609+ ffi_wallet_engine_rust_future_free_rust_buffer,
1610+ uniffi::FfiConverterWalletLifecycleError::lift
1611+ ));
1612+}
1613+TonConnectProofSignature WalletLifecycle::sign_ton_connect_proof(const TonConnectProofSignRequest &request) {
1614+ auto ptr = this->_uniffi_internal_clone_pointer();
1615+ return uniffi::FfiConverterTypeTonConnectProofSignature::lift(
1616+ uniffi::rust_call_async(
1617+ [&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_sign_ton_connect_proof(
1618+ ptr, uniffi::FfiConverterTypeTonConnectProofSignRequest::lower(request)); },
1619+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1620+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1621+ ffi_wallet_engine_rust_future_free_rust_buffer,
1622+ uniffi::FfiConverterWalletLifecycleError::lift
1623+ ));
1624+}
1625+TonConnectAccountInfo WalletLifecycle::ton_connect_account(const WalletDescriptor &descriptor) {
1626+ auto ptr = this->_uniffi_internal_clone_pointer();
1627+ return uniffi::FfiConverterTypeTonConnectAccountInfo::lift(
1628+ uniffi::rust_call(
1629+ uniffi_wallet_engine_fn_method_walletlifecycle_ton_connect_account,
1630+ uniffi::FfiConverterWalletLifecycleError::lift,
1631+ ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)));
1632+}
1633+
1634+WalletLifecycle::~WalletLifecycle() {
1635+ uniffi::rust_call(
1636+ uniffi_wallet_engine_fn_free_walletlifecycle,
1637+ nullptr,
1638+ this->instance
1639+ );
1640+}
1641+
1642+uint64_t WalletLifecycle::_uniffi_internal_clone_pointer() const {
1643+ return uniffi::rust_call(
1644+ uniffi_wallet_engine_fn_clone_walletlifecycle,
1645+ nullptr,
1646+ this->instance
1647+ );
1648+}
1649+
1650+
1651+namespace uniffi {
1652+
1653+ void UniffiCallbackInterfaceWalletPlatformHost::read_protected_secret(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1654+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1655+
1656+ auto make_call = [&]() -> std::vector<uint8_t> {
1657+ auto arg0 =FfiConverterTypeProtectedSecretRead::lift(request);return obj->read_protected_secret(
1658+ arg0);
1659+ };
1660+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1661+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1662+ UniffiForeignFutureResultRustBuffer result = {};
1663+ uniffi_out_dropped_callback.handle = 0;
1664+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1665+
1666+
1667+ auto write_value = [&](const std::vector<uint8_t> &v) {
1668+ result.return_value = FfiConverterBytes::lower(v);
1669+ };
1670+
1671+
1672+
1673+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1674+
1675+ complete(uniffi_callback_data, result);
1676+}
1677+ void UniffiCallbackInterfaceWalletPlatformHost::store_protected_secret(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1678+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1679+
1680+ auto make_call = [&]() {
1681+ auto arg0 =FfiConverterTypeProtectedSecretStore::lift(request);obj->store_protected_secret(
1682+ arg0);
1683+ };
1684+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1685+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1686+ UniffiForeignFutureResultVoid result = {};
1687+ uniffi_out_dropped_callback.handle = 0;
1688+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1689+
1690+
1691+ auto write_value = [](){};
1692+
1693+
1694+
1695+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1696+
1697+ complete(uniffi_callback_data, result);
1698+}
1699+ void UniffiCallbackInterfaceWalletPlatformHost::delete_protected_secret(uint64_t uniffi_handle,RustBuffer secret_ref,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1700+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1701+
1702+ auto make_call = [&]() {
1703+ auto arg0 =FfiConverterTypeProtectedSecretRef::lift(secret_ref);obj->delete_protected_secret(
1704+ arg0);
1705+ };
1706+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1707+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1708+ UniffiForeignFutureResultVoid result = {};
1709+ uniffi_out_dropped_callback.handle = 0;
1710+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1711+
1712+
1713+ auto write_value = [](){};
1714+
1715+
1716+
1717+ rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
1718+
1719+ complete(uniffi_callback_data, result);
1720+}
1721+ void UniffiCallbackInterfaceWalletPlatformHost::load_journal(uint64_t uniffi_handle,RustBuffer key,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1722+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1723+
1724+ auto make_call = [&]() -> std::optional<JournalRecord> {
1725+ auto arg0 =FfiConverterTypeJournalKey::lift(key);return obj->load_journal(
1726+ arg0);
1727+ };
1728+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1729+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1730+ UniffiForeignFutureResultRustBuffer result = {};
1731+ uniffi_out_dropped_callback.handle = 0;
1732+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1733+
1734+
1735+ auto write_value = [&](const std::optional<JournalRecord> &v) {
1736+ result.return_value = FfiConverterOptionalTypeJournalRecord::lower(v);
1737+ };
1738+
1739+
1740+
1741+ rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
1742+
1743+ complete(uniffi_callback_data, result);
1744+}
1745+ void UniffiCallbackInterfaceWalletPlatformHost::compare_exchange_journal(uint64_t uniffi_handle,RustBuffer mutation,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1746+ auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
1747+
1748+ auto make_call = [&]() -> JournalCompareExchangeResult {
1749+ auto arg0 =FfiConverterTypeJournalCompareExchange::lift(mutation);return obj->compare_exchange_journal(
1750+ arg0);
1751+ };
1752+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1753+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1754+ UniffiForeignFutureResultRustBuffer result = {};
1755+ uniffi_out_dropped_callback.handle = 0;
1756+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1757+
1758+
1759+ auto write_value = [&](const JournalCompareExchangeResult &v) {
1760+ result.return_value = FfiConverterTypeJournalCompareExchangeResult::lower(v);
1761+ };
1762+
1763+
1764+
1765+ rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
1766+
1767+ complete(uniffi_callback_data, result);
1768+}
1769+
1770+void UniffiCallbackInterfaceWalletPlatformHost::uniffi_free(uint64_t uniffi_handle) {
1771+ FfiConverterWalletPlatformHost::handle_map.erase(uniffi_handle);
1772+}
1773+
1774+uint64_t UniffiCallbackInterfaceWalletPlatformHost::uniffi_clone(uint64_t uniffi_handle) {
1775+ return FfiConverterWalletPlatformHost::handle_map.insert(
1776+ FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle)
1777+ );
1778+}
1779+
1780+void UniffiCallbackInterfaceWalletPlatformHost::init() {
1781+ uniffi_wallet_engine_fn_init_callback_vtable_walletplatformhost(vtable);
1782+}
1783+} // namespace uniffi
1784+
1785+
1786+WalletPlatformHostImpl::WalletPlatformHostImpl(uint64_t ptr): instance(ptr) {}
1787+
1788+WalletPlatformHostImpl::WalletPlatformHostImpl(const WalletPlatformHostImpl &other) : instance(0) {
1789+ if (other.instance) {
1790+ instance = other._uniffi_internal_clone_pointer();
1791+ }
1792+}
1793+
1794+
1795+
1796+
1797+std::vector<uint8_t> WalletPlatformHostImpl::read_protected_secret(const ProtectedSecretRead &request) {
1798+ auto ptr = this->_uniffi_internal_clone_pointer();
1799+ return uniffi::FfiConverterBytes::lift(
1800+ uniffi::rust_call_async(
1801+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_read_protected_secret(
1802+ ptr, uniffi::FfiConverterTypeProtectedSecretRead::lower(request)); },
1803+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1804+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1805+ ffi_wallet_engine_rust_future_free_rust_buffer,
1806+ uniffi::FfiConverterProtectedSecretHostError::lift
1807+ ));
1808+}
1809+void WalletPlatformHostImpl::store_protected_secret(const ProtectedSecretStore &request) {
1810+ auto ptr = this->_uniffi_internal_clone_pointer();
1811+
1812+ uniffi::rust_call_async(
1813+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_store_protected_secret(
1814+ ptr, uniffi::FfiConverterTypeProtectedSecretStore::lower(request)); },
1815+ ffi_wallet_engine_rust_future_poll_void,
1816+ ffi_wallet_engine_rust_future_complete_void,
1817+ ffi_wallet_engine_rust_future_free_void,
1818+ uniffi::FfiConverterProtectedSecretHostError::lift
1819+ );
1820+}
1821+void WalletPlatformHostImpl::delete_protected_secret(const ProtectedSecretRef &secret_ref) {
1822+ auto ptr = this->_uniffi_internal_clone_pointer();
1823+
1824+ uniffi::rust_call_async(
1825+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_delete_protected_secret(
1826+ ptr, uniffi::FfiConverterTypeProtectedSecretRef::lower(secret_ref)); },
1827+ ffi_wallet_engine_rust_future_poll_void,
1828+ ffi_wallet_engine_rust_future_complete_void,
1829+ ffi_wallet_engine_rust_future_free_void,
1830+ uniffi::FfiConverterProtectedSecretHostError::lift
1831+ );
1832+}
1833+std::optional<JournalRecord> WalletPlatformHostImpl::load_journal(const JournalKey &key) {
1834+ auto ptr = this->_uniffi_internal_clone_pointer();
1835+ return uniffi::FfiConverterOptionalTypeJournalRecord::lift(
1836+ uniffi::rust_call_async(
1837+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_load_journal(
1838+ ptr, uniffi::FfiConverterTypeJournalKey::lower(key)); },
1839+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1840+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1841+ ffi_wallet_engine_rust_future_free_rust_buffer,
1842+ uniffi::FfiConverterJournalHostError::lift
1843+ ));
1844+}
1845+JournalCompareExchangeResult WalletPlatformHostImpl::compare_exchange_journal(const JournalCompareExchange &mutation) {
1846+ auto ptr = this->_uniffi_internal_clone_pointer();
1847+ return uniffi::FfiConverterTypeJournalCompareExchangeResult::lift(
1848+ uniffi::rust_call_async(
1849+ [&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_compare_exchange_journal(
1850+ ptr, uniffi::FfiConverterTypeJournalCompareExchange::lower(mutation)); },
1851+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1852+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1853+ ffi_wallet_engine_rust_future_free_rust_buffer,
1854+ uniffi::FfiConverterJournalHostError::lift
1855+ ));
1856+}
1857+
1858+WalletPlatformHostImpl::~WalletPlatformHostImpl() {
1859+ uniffi::rust_call(
1860+ uniffi_wallet_engine_fn_free_walletplatformhost,
1861+ nullptr,
1862+ this->instance
1863+ );
1864+}
1865+
1866+uint64_t WalletPlatformHostImpl::_uniffi_internal_clone_pointer() const {
1867+ return uniffi::rust_call(
1868+ uniffi_wallet_engine_fn_clone_walletplatformhost,
1869+ nullptr,
1870+ this->instance
1871+ );
1872+}
1873+
1874+
1875+namespace uniffi {
1876+
1877+ void UniffiCallbackInterfaceWalletStatuslessHost::execute_statusless(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1878+ auto obj = FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle);
1879+
1880+ auto make_call = [&]() -> std::vector<uint8_t> {
1881+ auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_statusless(
1882+ arg0);
1883+ };
1884+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
1885+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1886+ UniffiForeignFutureResultRustBuffer result = {};
1887+ uniffi_out_dropped_callback.handle = 0;
1888+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1889+
1890+
1891+ auto write_value = [&](const std::vector<uint8_t> &v) {
1892+ result.return_value = FfiConverterBytes::lower(v);
1893+ };
1894+
1895+
1896+
1897+ rust_call_trait_interface_with_error<StatuslessHostError>(&result.call_status, make_call, write_value, FfiConverterStatuslessHostError::lower);
1898+
1899+ complete(uniffi_callback_data, result);
1900+}
1901+ void UniffiCallbackInterfaceWalletStatuslessHost::cancel_statusless(uint64_t uniffi_handle,RustBuffer request_id,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
1902+ auto obj = FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle);
1903+
1904+ auto make_call = [&]() {
1905+ auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_statusless(
1906+ arg0);
1907+ };
1908+ using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
1909+ auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
1910+ UniffiForeignFutureResultVoid result = {};
1911+ uniffi_out_dropped_callback.handle = 0;
1912+ uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
1913+
1914+
1915+ auto write_value = [](){};
1916+
1917+
1918+
1919+ rust_call_trait_interface(&result.call_status, make_call, write_value);
1920+
1921+ complete(uniffi_callback_data, result);
1922+}
1923+
1924+void UniffiCallbackInterfaceWalletStatuslessHost::uniffi_free(uint64_t uniffi_handle) {
1925+ FfiConverterWalletStatuslessHost::handle_map.erase(uniffi_handle);
1926+}
1927+
1928+uint64_t UniffiCallbackInterfaceWalletStatuslessHost::uniffi_clone(uint64_t uniffi_handle) {
1929+ return FfiConverterWalletStatuslessHost::handle_map.insert(
1930+ FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle)
1931+ );
1932+}
1933+
1934+void UniffiCallbackInterfaceWalletStatuslessHost::init() {
1935+ uniffi_wallet_engine_fn_init_callback_vtable_walletstatuslesshost(vtable);
1936+}
1937+} // namespace uniffi
1938+
1939+
1940+WalletStatuslessHostImpl::WalletStatuslessHostImpl(uint64_t ptr): instance(ptr) {}
1941+
1942+WalletStatuslessHostImpl::WalletStatuslessHostImpl(const WalletStatuslessHostImpl &other) : instance(0) {
1943+ if (other.instance) {
1944+ instance = other._uniffi_internal_clone_pointer();
1945+ }
1946+}
1947+
1948+
1949+
1950+
1951+std::vector<uint8_t> WalletStatuslessHostImpl::execute_statusless(const HttpRequest &request) {
1952+ auto ptr = this->_uniffi_internal_clone_pointer();
1953+ return uniffi::FfiConverterBytes::lift(
1954+ uniffi::rust_call_async(
1955+ [&]() { return uniffi_wallet_engine_fn_method_walletstatuslesshost_execute_statusless(
1956+ ptr, uniffi::FfiConverterTypeHttpRequest::lower(request)); },
1957+ ffi_wallet_engine_rust_future_poll_rust_buffer,
1958+ ffi_wallet_engine_rust_future_complete_rust_buffer,
1959+ ffi_wallet_engine_rust_future_free_rust_buffer,
1960+ uniffi::FfiConverterStatuslessHostError::lift
1961+ ));
1962+}
1963+void WalletStatuslessHostImpl::cancel_statusless(const HttpRequestId &request_id) {
1964+ auto ptr = this->_uniffi_internal_clone_pointer();
1965+
1966+ uniffi::rust_call_async(
1967+ [&]() { return uniffi_wallet_engine_fn_method_walletstatuslesshost_cancel_statusless(
1968+ ptr, uniffi::FfiConverterTypeHttpRequestId::lower(request_id)); },
1969+ ffi_wallet_engine_rust_future_poll_void,
1970+ ffi_wallet_engine_rust_future_complete_void,
1971+ ffi_wallet_engine_rust_future_free_void,
1972+ nullptr
1973+ );
1974+}
1975+
1976+WalletStatuslessHostImpl::~WalletStatuslessHostImpl() {
1977+ uniffi::rust_call(
1978+ uniffi_wallet_engine_fn_free_walletstatuslesshost,
1979+ nullptr,
1980+ this->instance
1981+ );
1982+}
1983+
1984+uint64_t WalletStatuslessHostImpl::_uniffi_internal_clone_pointer() const {
1985+ return uniffi::rust_call(
1986+ uniffi_wallet_engine_fn_clone_walletstatuslesshost,
1987+ nullptr,
1988+ this->instance
1989+ );
1990+}
1991+
1992+
1993+
1994+
1995+
1996+
1997+
1998+
1999+
2000+
2001+
2002+
2003+
2004+
2005+
2006+
2007+
2008+
2009+
2010+
2011+
2012+
2013+
2014+
2015+
2016+
2017+
2018+
2019+
2020+
2021+
2022+
2023+
2024+
2025+
2026+
2027+
2028+
2029+
2030+
2031+
2032+
2033+
2034+
2035+
2036+
2037+
2038+
2039+
2040+
2041+
2042+
2043+
2044+
2045+
2046+
2047+
2048+
2049+
2050+
2051+
2052+
2053+
2054+
2055+
2056+
2057+
2058+
2059+
2060+
2061+
2062+
2063+
2064+
2065+
2066+
2067+
2068+
2069+
2070+
2071+
2072+
2073+
2074+
2075+
2076+
2077+
2078+
2079+
2080+
2081+
2082+
2083+
2084+
2085+
2086+
2087+
2088+
2089+
2090+
2091+
2092+
2093+
2094+
2095+
2096+
2097+
2098+
2099+
2100+
2101+
2102+
2103+
2104+
2105+
2106+
2107+
2108+
2109+
2110+
2111+
2112+
2113+
2114+
2115+
2116+
2117+
2118+
2119+
2120+
2121+
2122+
2123+
2124+
2125+
2126+
2127+
2128+
2129+
2130+
2131+
2132+
2133+
2134+
2135+
2136+
2137+
2138+
2139+
2140+
2141+
2142+
2143+
2144+
2145+
2146+namespace uniffi {
2147+
2148+
2149+
2150+
2151+
2152+
2153+
2154+
2155+
2156+
2157+std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::lift(uint64_t ptr) {
2158+ return std::shared_ptr<TonConnectDerivedSession>(new TonConnectDerivedSession(ptr));
2159+}
2160+
2161+uint64_t FfiConverterTonConnectDerivedSession::lower(const std::shared_ptr<TonConnectDerivedSession> &obj) {
2162+ return reinterpret_cast<TonConnectDerivedSession*>(obj.get())->_uniffi_internal_clone_pointer();
2163+}
2164+
2165+std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::read(RustStream &stream) {
2166+ uint64_t ptr;
2167+ stream >> ptr;
2168+
2169+ return FfiConverterTonConnectDerivedSession::lift(ptr);
2170+}
2171+
2172+void FfiConverterTonConnectDerivedSession::write(RustStream &stream, const std::shared_ptr<TonConnectDerivedSession> &obj) {
2173+ stream << FfiConverterTonConnectDerivedSession::lower(obj);
2174+}
2175+
2176+uint64_t FfiConverterTonConnectDerivedSession::allocation_size(const std::shared_ptr<TonConnectDerivedSession> &) {
2177+ return 8;
2178+}
2179+
2180+
2181+
2182+std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::lift(uint64_t ptr) {
2183+ return std::shared_ptr<TonConnectSession>(new TonConnectSession(ptr));
2184+}
2185+
2186+uint64_t FfiConverterTonConnectSession::lower(const std::shared_ptr<TonConnectSession> &obj) {
2187+ return reinterpret_cast<TonConnectSession*>(obj.get())->_uniffi_internal_clone_pointer();
2188+}
2189+
2190+std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::read(RustStream &stream) {
2191+ uint64_t ptr;
2192+ stream >> ptr;
2193+
2194+ return FfiConverterTonConnectSession::lift(ptr);
2195+}
2196+
2197+void FfiConverterTonConnectSession::write(RustStream &stream, const std::shared_ptr<TonConnectSession> &obj) {
2198+ stream << FfiConverterTonConnectSession::lower(obj);
2199+}
2200+
2201+uint64_t FfiConverterTonConnectSession::allocation_size(const std::shared_ptr<TonConnectSession> &) {
2202+ return 8;
2203+}
2204+
2205+
2206+
2207+std::shared_ptr<WalletClient> FfiConverterWalletClient::lift(uint64_t ptr) {
2208+ return std::shared_ptr<WalletClient>(new WalletClient(ptr));
2209+}
2210+
2211+uint64_t FfiConverterWalletClient::lower(const std::shared_ptr<WalletClient> &obj) {
2212+ return reinterpret_cast<WalletClient*>(obj.get())->_uniffi_internal_clone_pointer();
2213+}
2214+
2215+std::shared_ptr<WalletClient> FfiConverterWalletClient::read(RustStream &stream) {
2216+ uint64_t ptr;
2217+ stream >> ptr;
2218+
2219+ return FfiConverterWalletClient::lift(ptr);
2220+}
2221+
2222+void FfiConverterWalletClient::write(RustStream &stream, const std::shared_ptr<WalletClient> &obj) {
2223+ stream << FfiConverterWalletClient::lower(obj);
2224+}
2225+
2226+uint64_t FfiConverterWalletClient::allocation_size(const std::shared_ptr<WalletClient> &) {
2227+ return 8;
2228+}
2229+
2230+
2231+
2232+std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::lift(uint64_t ptr) {
2233+ return std::shared_ptr<WalletHttpHost>(new WalletHttpHostImpl(ptr));
2234+}
2235+
2236+uint64_t FfiConverterWalletHttpHost::lower(const std::shared_ptr<WalletHttpHost> &obj) {
2237+ return handle_map.insert(obj);
2238+}
2239+
2240+std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::read(RustStream &stream) {
2241+ uint64_t ptr;
2242+ stream >> ptr;
2243+
2244+ return FfiConverterWalletHttpHost::lift(ptr);
2245+}
2246+
2247+void FfiConverterWalletHttpHost::write(RustStream &stream, const std::shared_ptr<WalletHttpHost> &obj) {
2248+ stream << FfiConverterWalletHttpHost::lower(obj);
2249+}
2250+
2251+uint64_t FfiConverterWalletHttpHost::allocation_size(const std::shared_ptr<WalletHttpHost> &) {
2252+ return 8;
2253+}
2254+
2255+
2256+
2257+std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::lift(uint64_t ptr) {
2258+ return std::shared_ptr<WalletLifecycle>(new WalletLifecycle(ptr));
2259+}
2260+
2261+uint64_t FfiConverterWalletLifecycle::lower(const std::shared_ptr<WalletLifecycle> &obj) {
2262+ return reinterpret_cast<WalletLifecycle*>(obj.get())->_uniffi_internal_clone_pointer();
2263+}
2264+
2265+std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::read(RustStream &stream) {
2266+ uint64_t ptr;
2267+ stream >> ptr;
2268+
2269+ return FfiConverterWalletLifecycle::lift(ptr);
2270+}
2271+
2272+void FfiConverterWalletLifecycle::write(RustStream &stream, const std::shared_ptr<WalletLifecycle> &obj) {
2273+ stream << FfiConverterWalletLifecycle::lower(obj);
2274+}
2275+
2276+uint64_t FfiConverterWalletLifecycle::allocation_size(const std::shared_ptr<WalletLifecycle> &) {
2277+ return 8;
2278+}
2279+
2280+
2281+
2282+std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::lift(uint64_t ptr) {
2283+ return std::shared_ptr<WalletPlatformHost>(new WalletPlatformHostImpl(ptr));
2284+}
2285+
2286+uint64_t FfiConverterWalletPlatformHost::lower(const std::shared_ptr<WalletPlatformHost> &obj) {
2287+ return handle_map.insert(obj);
2288+}
2289+
2290+std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::read(RustStream &stream) {
2291+ uint64_t ptr;
2292+ stream >> ptr;
2293+
2294+ return FfiConverterWalletPlatformHost::lift(ptr);
2295+}
2296+
2297+void FfiConverterWalletPlatformHost::write(RustStream &stream, const std::shared_ptr<WalletPlatformHost> &obj) {
2298+ stream << FfiConverterWalletPlatformHost::lower(obj);
2299+}
2300+
2301+uint64_t FfiConverterWalletPlatformHost::allocation_size(const std::shared_ptr<WalletPlatformHost> &) {
2302+ return 8;
2303+}
2304+
2305+
2306+
2307+std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::lift(uint64_t ptr) {
2308+ return std::shared_ptr<WalletStatuslessHost>(new WalletStatuslessHostImpl(ptr));
2309+}
2310+
2311+uint64_t FfiConverterWalletStatuslessHost::lower(const std::shared_ptr<WalletStatuslessHost> &obj) {
2312+ return handle_map.insert(obj);
2313+}
2314+
2315+std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::read(RustStream &stream) {
2316+ uint64_t ptr;
2317+ stream >> ptr;
2318+
2319+ return FfiConverterWalletStatuslessHost::lift(ptr);
2320+}
2321+
2322+void FfiConverterWalletStatuslessHost::write(RustStream &stream, const std::shared_ptr<WalletStatuslessHost> &obj) {
2323+ stream << FfiConverterWalletStatuslessHost::lower(obj);
2324+}
2325+
2326+uint64_t FfiConverterWalletStatuslessHost::allocation_size(const std::shared_ptr<WalletStatuslessHost> &) {
2327+ return 8;
2328+}
2329+
2330+
2331+AccountSnapshot FfiConverterTypeAccountSnapshot::lift(RustBuffer buf) {
2332+ auto stream = RustStream(&buf);
2333+ auto ret = FfiConverterTypeAccountSnapshot::read(stream);
2334+
2335+ rustbuffer_free(buf);
2336+
2337+ return std::move(ret);
2338+}
2339+
2340+RustBuffer FfiConverterTypeAccountSnapshot::lower(const AccountSnapshot &val) {
2341+ auto buf = rustbuffer_alloc(allocation_size(val));
2342+ auto stream = RustStream(&buf);
2343+
2344+ FfiConverterTypeAccountSnapshot::write(stream, val);
2345+
2346+ return std::move(buf);
2347+}
2348+
2349+AccountSnapshot FfiConverterTypeAccountSnapshot::read(RustStream &stream) {
2350+ return {
2351+ FfiConverterTypeUnsignedDecimalString::read(stream),
2352+ FfiConverterAccountStatus::read(stream),
2353+ FfiConverterUInt64::read(stream)
2354+ };
2355+}
2356+
2357+void FfiConverterTypeAccountSnapshot::write(RustStream &stream, const AccountSnapshot &val) {
2358+ FfiConverterTypeUnsignedDecimalString::write(stream, val.balance_nanograms);
2359+ FfiConverterAccountStatus::write(stream, val.status);
2360+ FfiConverterUInt64::write(stream, val.sync_utime);
2361+}
2362+
2363+uint64_t FfiConverterTypeAccountSnapshot::allocation_size(const AccountSnapshot &val) {
2364+
2365+ return
2366+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.balance_nanograms) +
2367+ FfiConverterAccountStatus::allocation_size(val.status) +
2368+ FfiConverterUInt64::allocation_size(val.sync_utime);
2369+
2370+}
2371+
2372+
2373+ActivityCursor FfiConverterTypeActivityCursor::lift(RustBuffer buf) {
2374+ auto stream = RustStream(&buf);
2375+ auto ret = FfiConverterTypeActivityCursor::read(stream);
2376+
2377+ rustbuffer_free(buf);
2378+
2379+ return std::move(ret);
2380+}
2381+
2382+RustBuffer FfiConverterTypeActivityCursor::lower(const ActivityCursor &val) {
2383+ auto buf = rustbuffer_alloc(allocation_size(val));
2384+ auto stream = RustStream(&buf);
2385+
2386+ FfiConverterTypeActivityCursor::write(stream, val);
2387+
2388+ return std::move(buf);
2389+}
2390+
2391+ActivityCursor FfiConverterTypeActivityCursor::read(RustStream &stream) {
2392+ return {
2393+ FfiConverterTypeUnsignedDecimalString::read(stream),
2394+ FfiConverterTypeBase64Hash::read(stream)
2395+ };
2396+}
2397+
2398+void FfiConverterTypeActivityCursor::write(RustStream &stream, const ActivityCursor &val) {
2399+ FfiConverterTypeUnsignedDecimalString::write(stream, val.logical_time);
2400+ FfiConverterTypeBase64Hash::write(stream, val.hash);
2401+}
2402+
2403+uint64_t FfiConverterTypeActivityCursor::allocation_size(const ActivityCursor &val) {
2404+
2405+ return
2406+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.logical_time) +
2407+ FfiConverterTypeBase64Hash::allocation_size(val.hash);
2408+
2409+}
2410+
2411+
2412+ActivityItem FfiConverterTypeActivityItem::lift(RustBuffer buf) {
2413+ auto stream = RustStream(&buf);
2414+ auto ret = FfiConverterTypeActivityItem::read(stream);
2415+
2416+ rustbuffer_free(buf);
2417+
2418+ return std::move(ret);
2419+}
2420+
2421+RustBuffer FfiConverterTypeActivityItem::lower(const ActivityItem &val) {
2422+ auto buf = rustbuffer_alloc(allocation_size(val));
2423+ auto stream = RustStream(&buf);
2424+
2425+ FfiConverterTypeActivityItem::write(stream, val);
2426+
2427+ return std::move(buf);
2428+}
2429+
2430+ActivityItem FfiConverterTypeActivityItem::read(RustStream &stream) {
2431+ return {
2432+ FfiConverterString::read(stream),
2433+ FfiConverterTypeBase64Hash::read(stream),
2434+ FfiConverterTypeUnsignedDecimalString::read(stream),
2435+ FfiConverterUInt64::read(stream),
2436+ FfiConverterActivityDirection::read(stream),
2437+ FfiConverterTypeUnsignedDecimalString::read(stream),
2438+ FfiConverterTypeUnsignedDecimalString::read(stream),
2439+ FfiConverterActivityStatus::read(stream),
2440+ FfiConverterOptionalString::read(stream),
2441+ FfiConverterOptionalTypeBoc::read(stream),
2442+ FfiConverterOptionalTypeTonAddressString::read(stream)
2443+ };
2444+}
2445+
2446+void FfiConverterTypeActivityItem::write(RustStream &stream, const ActivityItem &val) {
2447+ FfiConverterString::write(stream, val.id);
2448+ FfiConverterTypeBase64Hash::write(stream, val.transaction_hash);
2449+ FfiConverterTypeUnsignedDecimalString::write(stream, val.logical_time);
2450+ FfiConverterUInt64::write(stream, val.timestamp);
2451+ FfiConverterActivityDirection::write(stream, val.direction);
2452+ FfiConverterTypeUnsignedDecimalString::write(stream, val.amount_nanograms);
2453+ FfiConverterTypeUnsignedDecimalString::write(stream, val.transaction_fee_nanograms);
2454+ FfiConverterActivityStatus::write(stream, val.status);
2455+ FfiConverterOptionalString::write(stream, val.comment);
2456+ FfiConverterOptionalTypeBoc::write(stream, val.encrypted_comment);
2457+ FfiConverterOptionalTypeTonAddressString::write(stream, val.counterparty);
2458+}
2459+
2460+uint64_t FfiConverterTypeActivityItem::allocation_size(const ActivityItem &val) {
2461+
2462+ return
2463+ FfiConverterString::allocation_size(val.id) +
2464+ FfiConverterTypeBase64Hash::allocation_size(val.transaction_hash) +
2465+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.logical_time) +
2466+ FfiConverterUInt64::allocation_size(val.timestamp) +
2467+ FfiConverterActivityDirection::allocation_size(val.direction) +
2468+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.amount_nanograms) +
2469+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.transaction_fee_nanograms) +
2470+ FfiConverterActivityStatus::allocation_size(val.status) +
2471+ FfiConverterOptionalString::allocation_size(val.comment) +
2472+ FfiConverterOptionalTypeBoc::allocation_size(val.encrypted_comment) +
2473+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.counterparty);
2474+
2475+}
2476+
2477+
2478+ActivityList FfiConverterTypeActivityList::lift(RustBuffer buf) {
2479+ auto stream = RustStream(&buf);
2480+ auto ret = FfiConverterTypeActivityList::read(stream);
2481+
2482+ rustbuffer_free(buf);
2483+
2484+ return std::move(ret);
2485+}
2486+
2487+RustBuffer FfiConverterTypeActivityList::lower(const ActivityList &val) {
2488+ auto buf = rustbuffer_alloc(allocation_size(val));
2489+ auto stream = RustStream(&buf);
2490+
2491+ FfiConverterTypeActivityList::write(stream, val);
2492+
2493+ return std::move(buf);
2494+}
2495+
2496+ActivityList FfiConverterTypeActivityList::read(RustStream &stream) {
2497+ return {
2498+ FfiConverterSequenceTypeActivityItem::read(stream),
2499+ FfiConverterTypeResourceState::read(stream),
2500+ FfiConverterTypeResourceState::read(stream),
2501+ FfiConverterBool::read(stream)
2502+ };
2503+}
2504+
2505+void FfiConverterTypeActivityList::write(RustStream &stream, const ActivityList &val) {
2506+ FfiConverterSequenceTypeActivityItem::write(stream, val.items);
2507+ FfiConverterTypeResourceState::write(stream, val.resource);
2508+ FfiConverterTypeResourceState::write(stream, val.pagination_resource);
2509+ FfiConverterBool::write(stream, val.has_more);
2510+}
2511+
2512+uint64_t FfiConverterTypeActivityList::allocation_size(const ActivityList &val) {
2513+
2514+ return
2515+ FfiConverterSequenceTypeActivityItem::allocation_size(val.items) +
2516+ FfiConverterTypeResourceState::allocation_size(val.resource) +
2517+ FfiConverterTypeResourceState::allocation_size(val.pagination_resource) +
2518+ FfiConverterBool::allocation_size(val.has_more);
2519+
2520+}
2521+
2522+
2523+CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::lift(RustBuffer buf) {
2524+ auto stream = RustStream(&buf);
2525+ auto ret = FfiConverterTypeCreateEncryptedCommentRequest::read(stream);
2526+
2527+ rustbuffer_free(buf);
2528+
2529+ return std::move(ret);
2530+}
2531+
2532+RustBuffer FfiConverterTypeCreateEncryptedCommentRequest::lower(const CreateEncryptedCommentRequest &val) {
2533+ auto buf = rustbuffer_alloc(allocation_size(val));
2534+ auto stream = RustStream(&buf);
2535+
2536+ FfiConverterTypeCreateEncryptedCommentRequest::write(stream, val);
2537+
2538+ return std::move(buf);
2539+}
2540+
2541+CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::read(RustStream &stream) {
2542+ return {
2543+ FfiConverterTypeTonAddressString::read(stream),
2544+ FfiConverterString::read(stream),
2545+ FfiConverterOptionalBytes::read(stream)
2546+ };
2547+}
2548+
2549+void FfiConverterTypeCreateEncryptedCommentRequest::write(RustStream &stream, const CreateEncryptedCommentRequest &val) {
2550+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
2551+ FfiConverterString::write(stream, val.comment);
2552+ FfiConverterOptionalBytes::write(stream, val.recipient_public_key);
2553+}
2554+
2555+uint64_t FfiConverterTypeCreateEncryptedCommentRequest::allocation_size(const CreateEncryptedCommentRequest &val) {
2556+
2557+ return
2558+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
2559+ FfiConverterString::allocation_size(val.comment) +
2560+ FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
2561+
2562+}
2563+
2564+
2565+CreateWalletRequest FfiConverterTypeCreateWalletRequest::lift(RustBuffer buf) {
2566+ auto stream = RustStream(&buf);
2567+ auto ret = FfiConverterTypeCreateWalletRequest::read(stream);
2568+
2569+ rustbuffer_free(buf);
2570+
2571+ return std::move(ret);
2572+}
2573+
2574+RustBuffer FfiConverterTypeCreateWalletRequest::lower(const CreateWalletRequest &val) {
2575+ auto buf = rustbuffer_alloc(allocation_size(val));
2576+ auto stream = RustStream(&buf);
2577+
2578+ FfiConverterTypeCreateWalletRequest::write(stream, val);
2579+
2580+ return std::move(buf);
2581+}
2582+
2583+CreateWalletRequest FfiConverterTypeCreateWalletRequest::read(RustStream &stream) {
2584+ return {
2585+ FfiConverterString::read(stream),
2586+ FfiConverterNetwork::read(stream)
2587+ };
2588+}
2589+
2590+void FfiConverterTypeCreateWalletRequest::write(RustStream &stream, const CreateWalletRequest &val) {
2591+ FfiConverterString::write(stream, val.record_id);
2592+ FfiConverterNetwork::write(stream, val.network);
2593+}
2594+
2595+uint64_t FfiConverterTypeCreateWalletRequest::allocation_size(const CreateWalletRequest &val) {
2596+
2597+ return
2598+ FfiConverterString::allocation_size(val.record_id) +
2599+ FfiConverterNetwork::allocation_size(val.network);
2600+
2601+}
2602+
2603+
2604+CreatedWallet FfiConverterTypeCreatedWallet::lift(RustBuffer buf) {
2605+ auto stream = RustStream(&buf);
2606+ auto ret = FfiConverterTypeCreatedWallet::read(stream);
2607+
2608+ rustbuffer_free(buf);
2609+
2610+ return std::move(ret);
2611+}
2612+
2613+RustBuffer FfiConverterTypeCreatedWallet::lower(const CreatedWallet &val) {
2614+ auto buf = rustbuffer_alloc(allocation_size(val));
2615+ auto stream = RustStream(&buf);
2616+
2617+ FfiConverterTypeCreatedWallet::write(stream, val);
2618+
2619+ return std::move(buf);
2620+}
2621+
2622+CreatedWallet FfiConverterTypeCreatedWallet::read(RustStream &stream) {
2623+ return {
2624+ FfiConverterTypeWalletDescriptor::read(stream),
2625+ FfiConverterTypeRecoveryPhrase::read(stream)
2626+ };
2627+}
2628+
2629+void FfiConverterTypeCreatedWallet::write(RustStream &stream, const CreatedWallet &val) {
2630+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
2631+ FfiConverterTypeRecoveryPhrase::write(stream, val.recovery_phrase);
2632+}
2633+
2634+uint64_t FfiConverterTypeCreatedWallet::allocation_size(const CreatedWallet &val) {
2635+
2636+ return
2637+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
2638+ FfiConverterTypeRecoveryPhrase::allocation_size(val.recovery_phrase);
2639+
2640+}
2641+
2642+
2643+DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::lift(RustBuffer buf) {
2644+ auto stream = RustStream(&buf);
2645+ auto ret = FfiConverterTypeDecryptCommentRequest::read(stream);
2646+
2647+ rustbuffer_free(buf);
2648+
2649+ return std::move(ret);
2650+}
2651+
2652+RustBuffer FfiConverterTypeDecryptCommentRequest::lower(const DecryptCommentRequest &val) {
2653+ auto buf = rustbuffer_alloc(allocation_size(val));
2654+ auto stream = RustStream(&buf);
2655+
2656+ FfiConverterTypeDecryptCommentRequest::write(stream, val);
2657+
2658+ return std::move(buf);
2659+}
2660+
2661+DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::read(RustStream &stream) {
2662+ return {
2663+ FfiConverterTypeTonAddressString::read(stream),
2664+ FfiConverterTypeBoc::read(stream)
2665+ };
2666+}
2667+
2668+void FfiConverterTypeDecryptCommentRequest::write(RustStream &stream, const DecryptCommentRequest &val) {
2669+ FfiConverterTypeTonAddressString::write(stream, val.sender);
2670+ FfiConverterTypeBoc::write(stream, val.body);
2671+}
2672+
2673+uint64_t FfiConverterTypeDecryptCommentRequest::allocation_size(const DecryptCommentRequest &val) {
2674+
2675+ return
2676+ FfiConverterTypeTonAddressString::allocation_size(val.sender) +
2677+ FfiConverterTypeBoc::allocation_size(val.body);
2678+
2679+}
2680+
2681+
2682+DomainError FfiConverterTypeDomainError::lift(RustBuffer buf) {
2683+ auto stream = RustStream(&buf);
2684+ auto ret = FfiConverterTypeDomainError::read(stream);
2685+
2686+ rustbuffer_free(buf);
2687+
2688+ return std::move(ret);
2689+}
2690+
2691+RustBuffer FfiConverterTypeDomainError::lower(const DomainError &val) {
2692+ auto buf = rustbuffer_alloc(allocation_size(val));
2693+ auto stream = RustStream(&buf);
2694+
2695+ FfiConverterTypeDomainError::write(stream, val);
2696+
2697+ return std::move(buf);
2698+}
2699+
2700+DomainError FfiConverterTypeDomainError::read(RustStream &stream) {
2701+ return {
2702+ FfiConverterErrorCode::read(stream),
2703+ FfiConverterErrorCategory::read(stream),
2704+ FfiConverterRetryAdvice::read(stream),
2705+ FfiConverterString::read(stream),
2706+ FfiConverterOptionalUInt16::read(stream),
2707+ FfiConverterOptionalUInt64::read(stream),
2708+ FfiConverterOptionalHttpHostErrorKind::read(stream)
2709+ };
2710+}
2711+
2712+void FfiConverterTypeDomainError::write(RustStream &stream, const DomainError &val) {
2713+ FfiConverterErrorCode::write(stream, val.code);
2714+ FfiConverterErrorCategory::write(stream, val.category);
2715+ FfiConverterRetryAdvice::write(stream, val.retry);
2716+ FfiConverterString::write(stream, val.developer_message);
2717+ FfiConverterOptionalUInt16::write(stream, val.provider_status);
2718+ FfiConverterOptionalUInt64::write(stream, val.retry_after_ms);
2719+ FfiConverterOptionalHttpHostErrorKind::write(stream, val.host_kind);
2720+}
2721+
2722+uint64_t FfiConverterTypeDomainError::allocation_size(const DomainError &val) {
2723+
2724+ return
2725+ FfiConverterErrorCode::allocation_size(val.code) +
2726+ FfiConverterErrorCategory::allocation_size(val.category) +
2727+ FfiConverterRetryAdvice::allocation_size(val.retry) +
2728+ FfiConverterString::allocation_size(val.developer_message) +
2729+ FfiConverterOptionalUInt16::allocation_size(val.provider_status) +
2730+ FfiConverterOptionalUInt64::allocation_size(val.retry_after_ms) +
2731+ FfiConverterOptionalHttpHostErrorKind::allocation_size(val.host_kind);
2732+
2733+}
2734+
2735+
2736+EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::lift(RustBuffer buf) {
2737+ auto stream = RustStream(&buf);
2738+ auto ret = FfiConverterTypeEncryptedCommentRecipientRequest::read(stream);
2739+
2740+ rustbuffer_free(buf);
2741+
2742+ return std::move(ret);
2743+}
2744+
2745+RustBuffer FfiConverterTypeEncryptedCommentRecipientRequest::lower(const EncryptedCommentRecipientRequest &val) {
2746+ auto buf = rustbuffer_alloc(allocation_size(val));
2747+ auto stream = RustStream(&buf);
2748+
2749+ FfiConverterTypeEncryptedCommentRecipientRequest::write(stream, val);
2750+
2751+ return std::move(buf);
2752+}
2753+
2754+EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::read(RustStream &stream) {
2755+ return {
2756+ FfiConverterTypeTonAddressString::read(stream),
2757+ FfiConverterOptionalBytes::read(stream)
2758+ };
2759+}
2760+
2761+void FfiConverterTypeEncryptedCommentRecipientRequest::write(RustStream &stream, const EncryptedCommentRecipientRequest &val) {
2762+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
2763+ FfiConverterOptionalBytes::write(stream, val.recipient_public_key);
2764+}
2765+
2766+uint64_t FfiConverterTypeEncryptedCommentRecipientRequest::allocation_size(const EncryptedCommentRecipientRequest &val) {
2767+
2768+ return
2769+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
2770+ FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
2771+
2772+}
2773+
2774+
2775+HttpHeader FfiConverterTypeHttpHeader::lift(RustBuffer buf) {
2776+ auto stream = RustStream(&buf);
2777+ auto ret = FfiConverterTypeHttpHeader::read(stream);
2778+
2779+ rustbuffer_free(buf);
2780+
2781+ return std::move(ret);
2782+}
2783+
2784+RustBuffer FfiConverterTypeHttpHeader::lower(const HttpHeader &val) {
2785+ auto buf = rustbuffer_alloc(allocation_size(val));
2786+ auto stream = RustStream(&buf);
2787+
2788+ FfiConverterTypeHttpHeader::write(stream, val);
2789+
2790+ return std::move(buf);
2791+}
2792+
2793+HttpHeader FfiConverterTypeHttpHeader::read(RustStream &stream) {
2794+ return {
2795+ FfiConverterString::read(stream),
2796+ FfiConverterString::read(stream)
2797+ };
2798+}
2799+
2800+void FfiConverterTypeHttpHeader::write(RustStream &stream, const HttpHeader &val) {
2801+ FfiConverterString::write(stream, val.name);
2802+ FfiConverterString::write(stream, val.value);
2803+}
2804+
2805+uint64_t FfiConverterTypeHttpHeader::allocation_size(const HttpHeader &val) {
2806+
2807+ return
2808+ FfiConverterString::allocation_size(val.name) +
2809+ FfiConverterString::allocation_size(val.value);
2810+
2811+}
2812+
2813+
2814+HttpRequest FfiConverterTypeHttpRequest::lift(RustBuffer buf) {
2815+ auto stream = RustStream(&buf);
2816+ auto ret = FfiConverterTypeHttpRequest::read(stream);
2817+
2818+ rustbuffer_free(buf);
2819+
2820+ return std::move(ret);
2821+}
2822+
2823+RustBuffer FfiConverterTypeHttpRequest::lower(const HttpRequest &val) {
2824+ auto buf = rustbuffer_alloc(allocation_size(val));
2825+ auto stream = RustStream(&buf);
2826+
2827+ FfiConverterTypeHttpRequest::write(stream, val);
2828+
2829+ return std::move(buf);
2830+}
2831+
2832+HttpRequest FfiConverterTypeHttpRequest::read(RustStream &stream) {
2833+ return {
2834+ FfiConverterTypeHttpRequestId::read(stream),
2835+ FfiConverterHttpMethod::read(stream),
2836+ FfiConverterString::read(stream),
2837+ FfiConverterSequenceTypeHttpHeader::read(stream),
2838+ FfiConverterBytes::read(stream),
2839+ FfiConverterUInt64::read(stream)
2840+ };
2841+}
2842+
2843+void FfiConverterTypeHttpRequest::write(RustStream &stream, const HttpRequest &val) {
2844+ FfiConverterTypeHttpRequestId::write(stream, val.id);
2845+ FfiConverterHttpMethod::write(stream, val.method);
2846+ FfiConverterString::write(stream, val.url);
2847+ FfiConverterSequenceTypeHttpHeader::write(stream, val.headers);
2848+ FfiConverterBytes::write(stream, val.body);
2849+ FfiConverterUInt64::write(stream, val.timeout_ms);
2850+}
2851+
2852+uint64_t FfiConverterTypeHttpRequest::allocation_size(const HttpRequest &val) {
2853+
2854+ return
2855+ FfiConverterTypeHttpRequestId::allocation_size(val.id) +
2856+ FfiConverterHttpMethod::allocation_size(val.method) +
2857+ FfiConverterString::allocation_size(val.url) +
2858+ FfiConverterSequenceTypeHttpHeader::allocation_size(val.headers) +
2859+ FfiConverterBytes::allocation_size(val.body) +
2860+ FfiConverterUInt64::allocation_size(val.timeout_ms);
2861+
2862+}
2863+
2864+
2865+HttpRequestId FfiConverterTypeHttpRequestId::lift(RustBuffer buf) {
2866+ auto stream = RustStream(&buf);
2867+ auto ret = FfiConverterTypeHttpRequestId::read(stream);
2868+
2869+ rustbuffer_free(buf);
2870+
2871+ return std::move(ret);
2872+}
2873+
2874+RustBuffer FfiConverterTypeHttpRequestId::lower(const HttpRequestId &val) {
2875+ auto buf = rustbuffer_alloc(allocation_size(val));
2876+ auto stream = RustStream(&buf);
2877+
2878+ FfiConverterTypeHttpRequestId::write(stream, val);
2879+
2880+ return std::move(buf);
2881+}
2882+
2883+HttpRequestId FfiConverterTypeHttpRequestId::read(RustStream &stream) {
2884+ return {
2885+ FfiConverterUInt64::read(stream)
2886+ };
2887+}
2888+
2889+void FfiConverterTypeHttpRequestId::write(RustStream &stream, const HttpRequestId &val) {
2890+ FfiConverterUInt64::write(stream, val.value);
2891+}
2892+
2893+uint64_t FfiConverterTypeHttpRequestId::allocation_size(const HttpRequestId &val) {
2894+
2895+ return
2896+ FfiConverterUInt64::allocation_size(val.value);
2897+
2898+}
2899+
2900+
2901+HttpResponse FfiConverterTypeHttpResponse::lift(RustBuffer buf) {
2902+ auto stream = RustStream(&buf);
2903+ auto ret = FfiConverterTypeHttpResponse::read(stream);
2904+
2905+ rustbuffer_free(buf);
2906+
2907+ return std::move(ret);
2908+}
2909+
2910+RustBuffer FfiConverterTypeHttpResponse::lower(const HttpResponse &val) {
2911+ auto buf = rustbuffer_alloc(allocation_size(val));
2912+ auto stream = RustStream(&buf);
2913+
2914+ FfiConverterTypeHttpResponse::write(stream, val);
2915+
2916+ return std::move(buf);
2917+}
2918+
2919+HttpResponse FfiConverterTypeHttpResponse::read(RustStream &stream) {
2920+ return {
2921+ FfiConverterUInt16::read(stream),
2922+ FfiConverterSequenceTypeHttpHeader::read(stream),
2923+ FfiConverterBytes::read(stream),
2924+ FfiConverterString::read(stream)
2925+ };
2926+}
2927+
2928+void FfiConverterTypeHttpResponse::write(RustStream &stream, const HttpResponse &val) {
2929+ FfiConverterUInt16::write(stream, val.status);
2930+ FfiConverterSequenceTypeHttpHeader::write(stream, val.headers);
2931+ FfiConverterBytes::write(stream, val.body);
2932+ FfiConverterString::write(stream, val.final_url);
2933+}
2934+
2935+uint64_t FfiConverterTypeHttpResponse::allocation_size(const HttpResponse &val) {
2936+
2937+ return
2938+ FfiConverterUInt16::allocation_size(val.status) +
2939+ FfiConverterSequenceTypeHttpHeader::allocation_size(val.headers) +
2940+ FfiConverterBytes::allocation_size(val.body) +
2941+ FfiConverterString::allocation_size(val.final_url);
2942+
2943+}
2944+
2945+
2946+ImportWalletRequest FfiConverterTypeImportWalletRequest::lift(RustBuffer buf) {
2947+ auto stream = RustStream(&buf);
2948+ auto ret = FfiConverterTypeImportWalletRequest::read(stream);
2949+
2950+ rustbuffer_free(buf);
2951+
2952+ return std::move(ret);
2953+}
2954+
2955+RustBuffer FfiConverterTypeImportWalletRequest::lower(const ImportWalletRequest &val) {
2956+ auto buf = rustbuffer_alloc(allocation_size(val));
2957+ auto stream = RustStream(&buf);
2958+
2959+ FfiConverterTypeImportWalletRequest::write(stream, val);
2960+
2961+ return std::move(buf);
2962+}
2963+
2964+ImportWalletRequest FfiConverterTypeImportWalletRequest::read(RustStream &stream) {
2965+ return {
2966+ FfiConverterString::read(stream),
2967+ FfiConverterNetwork::read(stream),
2968+ FfiConverterSequenceString::read(stream)
2969+ };
2970+}
2971+
2972+void FfiConverterTypeImportWalletRequest::write(RustStream &stream, const ImportWalletRequest &val) {
2973+ FfiConverterString::write(stream, val.record_id);
2974+ FfiConverterNetwork::write(stream, val.network);
2975+ FfiConverterSequenceString::write(stream, val.recovery_words);
2976+}
2977+
2978+uint64_t FfiConverterTypeImportWalletRequest::allocation_size(const ImportWalletRequest &val) {
2979+
2980+ return
2981+ FfiConverterString::allocation_size(val.record_id) +
2982+ FfiConverterNetwork::allocation_size(val.network) +
2983+ FfiConverterSequenceString::allocation_size(val.recovery_words);
2984+
2985+}
2986+
2987+
2988+JournalCompareExchange FfiConverterTypeJournalCompareExchange::lift(RustBuffer buf) {
2989+ auto stream = RustStream(&buf);
2990+ auto ret = FfiConverterTypeJournalCompareExchange::read(stream);
2991+
2992+ rustbuffer_free(buf);
2993+
2994+ return std::move(ret);
2995+}
2996+
2997+RustBuffer FfiConverterTypeJournalCompareExchange::lower(const JournalCompareExchange &val) {
2998+ auto buf = rustbuffer_alloc(allocation_size(val));
2999+ auto stream = RustStream(&buf);
3000+
3001+ FfiConverterTypeJournalCompareExchange::write(stream, val);
3002+
3003+ return std::move(buf);
3004+}
3005+
3006+JournalCompareExchange FfiConverterTypeJournalCompareExchange::read(RustStream &stream) {
3007+ return {
3008+ FfiConverterTypeJournalKey::read(stream),
3009+ FfiConverterOptionalUInt64::read(stream),
3010+ FfiConverterTypeJournalRecord::read(stream)
3011+ };
3012+}
3013+
3014+void FfiConverterTypeJournalCompareExchange::write(RustStream &stream, const JournalCompareExchange &val) {
3015+ FfiConverterTypeJournalKey::write(stream, val.key);
3016+ FfiConverterOptionalUInt64::write(stream, val.expected_version);
3017+ FfiConverterTypeJournalRecord::write(stream, val.replacement);
3018+}
3019+
3020+uint64_t FfiConverterTypeJournalCompareExchange::allocation_size(const JournalCompareExchange &val) {
3021+
3022+ return
3023+ FfiConverterTypeJournalKey::allocation_size(val.key) +
3024+ FfiConverterOptionalUInt64::allocation_size(val.expected_version) +
3025+ FfiConverterTypeJournalRecord::allocation_size(val.replacement);
3026+
3027+}
3028+
3029+
3030+JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::lift(RustBuffer buf) {
3031+ auto stream = RustStream(&buf);
3032+ auto ret = FfiConverterTypeJournalCompareExchangeResult::read(stream);
3033+
3034+ rustbuffer_free(buf);
3035+
3036+ return std::move(ret);
3037+}
3038+
3039+RustBuffer FfiConverterTypeJournalCompareExchangeResult::lower(const JournalCompareExchangeResult &val) {
3040+ auto buf = rustbuffer_alloc(allocation_size(val));
3041+ auto stream = RustStream(&buf);
3042+
3043+ FfiConverterTypeJournalCompareExchangeResult::write(stream, val);
3044+
3045+ return std::move(buf);
3046+}
3047+
3048+JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::read(RustStream &stream) {
3049+ return {
3050+ FfiConverterBool::read(stream),
3051+ FfiConverterOptionalTypeJournalRecord::read(stream)
3052+ };
3053+}
3054+
3055+void FfiConverterTypeJournalCompareExchangeResult::write(RustStream &stream, const JournalCompareExchangeResult &val) {
3056+ FfiConverterBool::write(stream, val.applied);
3057+ FfiConverterOptionalTypeJournalRecord::write(stream, val.current);
3058+}
3059+
3060+uint64_t FfiConverterTypeJournalCompareExchangeResult::allocation_size(const JournalCompareExchangeResult &val) {
3061+
3062+ return
3063+ FfiConverterBool::allocation_size(val.applied) +
3064+ FfiConverterOptionalTypeJournalRecord::allocation_size(val.current);
3065+
3066+}
3067+
3068+
3069+JournalKey FfiConverterTypeJournalKey::lift(RustBuffer buf) {
3070+ auto stream = RustStream(&buf);
3071+ auto ret = FfiConverterTypeJournalKey::read(stream);
3072+
3073+ rustbuffer_free(buf);
3074+
3075+ return std::move(ret);
3076+}
3077+
3078+RustBuffer FfiConverterTypeJournalKey::lower(const JournalKey &val) {
3079+ auto buf = rustbuffer_alloc(allocation_size(val));
3080+ auto stream = RustStream(&buf);
3081+
3082+ FfiConverterTypeJournalKey::write(stream, val);
3083+
3084+ return std::move(buf);
3085+}
3086+
3087+JournalKey FfiConverterTypeJournalKey::read(RustStream &stream) {
3088+ return {
3089+ FfiConverterString::read(stream),
3090+ FfiConverterString::read(stream)
3091+ };
3092+}
3093+
3094+void FfiConverterTypeJournalKey::write(RustStream &stream, const JournalKey &val) {
3095+ FfiConverterString::write(stream, val.record_id);
3096+ FfiConverterString::write(stream, val.slot);
3097+}
3098+
3099+uint64_t FfiConverterTypeJournalKey::allocation_size(const JournalKey &val) {
3100+
3101+ return
3102+ FfiConverterString::allocation_size(val.record_id) +
3103+ FfiConverterString::allocation_size(val.slot);
3104+
3105+}
3106+
3107+
3108+JournalRecord FfiConverterTypeJournalRecord::lift(RustBuffer buf) {
3109+ auto stream = RustStream(&buf);
3110+ auto ret = FfiConverterTypeJournalRecord::read(stream);
3111+
3112+ rustbuffer_free(buf);
3113+
3114+ return std::move(ret);
3115+}
3116+
3117+RustBuffer FfiConverterTypeJournalRecord::lower(const JournalRecord &val) {
3118+ auto buf = rustbuffer_alloc(allocation_size(val));
3119+ auto stream = RustStream(&buf);
3120+
3121+ FfiConverterTypeJournalRecord::write(stream, val);
3122+
3123+ return std::move(buf);
3124+}
3125+
3126+JournalRecord FfiConverterTypeJournalRecord::read(RustStream &stream) {
3127+ return {
3128+ FfiConverterUInt64::read(stream),
3129+ FfiConverterBytes::read(stream)
3130+ };
3131+}
3132+
3133+void FfiConverterTypeJournalRecord::write(RustStream &stream, const JournalRecord &val) {
3134+ FfiConverterUInt64::write(stream, val.version);
3135+ FfiConverterBytes::write(stream, val.payload);
3136+}
3137+
3138+uint64_t FfiConverterTypeJournalRecord::allocation_size(const JournalRecord &val) {
3139+
3140+ return
3141+ FfiConverterUInt64::allocation_size(val.version) +
3142+ FfiConverterBytes::allocation_size(val.payload);
3143+
3144+}
3145+
3146+
3147+NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::lift(RustBuffer buf) {
3148+ auto stream = RustStream(&buf);
3149+ auto ret = FfiConverterTypeNftCollectionDescriptor::read(stream);
3150+
3151+ rustbuffer_free(buf);
3152+
3153+ return std::move(ret);
3154+}
3155+
3156+RustBuffer FfiConverterTypeNftCollectionDescriptor::lower(const NftCollectionDescriptor &val) {
3157+ auto buf = rustbuffer_alloc(allocation_size(val));
3158+ auto stream = RustStream(&buf);
3159+
3160+ FfiConverterTypeNftCollectionDescriptor::write(stream, val);
3161+
3162+ return std::move(buf);
3163+}
3164+
3165+NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::read(RustStream &stream) {
3166+ return {
3167+ FfiConverterTypeTonAddressString::read(stream),
3168+ FfiConverterOptionalString::read(stream),
3169+ FfiConverterOptionalString::read(stream),
3170+ FfiConverterOptionalString::read(stream),
3171+ FfiConverterMapStringString::read(stream)
3172+ };
3173+}
3174+
3175+void FfiConverterTypeNftCollectionDescriptor::write(RustStream &stream, const NftCollectionDescriptor &val) {
3176+ FfiConverterTypeTonAddressString::write(stream, val.address);
3177+ FfiConverterOptionalString::write(stream, val.name);
3178+ FfiConverterOptionalString::write(stream, val.description);
3179+ FfiConverterOptionalString::write(stream, val.image);
3180+ FfiConverterMapStringString::write(stream, val.content);
3181+}
3182+
3183+uint64_t FfiConverterTypeNftCollectionDescriptor::allocation_size(const NftCollectionDescriptor &val) {
3184+
3185+ return
3186+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
3187+ FfiConverterOptionalString::allocation_size(val.name) +
3188+ FfiConverterOptionalString::allocation_size(val.description) +
3189+ FfiConverterOptionalString::allocation_size(val.image) +
3190+ FfiConverterMapStringString::allocation_size(val.content);
3191+
3192+}
3193+
3194+
3195+NftItem FfiConverterTypeNftItem::lift(RustBuffer buf) {
3196+ auto stream = RustStream(&buf);
3197+ auto ret = FfiConverterTypeNftItem::read(stream);
3198+
3199+ rustbuffer_free(buf);
3200+
3201+ return std::move(ret);
3202+}
3203+
3204+RustBuffer FfiConverterTypeNftItem::lower(const NftItem &val) {
3205+ auto buf = rustbuffer_alloc(allocation_size(val));
3206+ auto stream = RustStream(&buf);
3207+
3208+ FfiConverterTypeNftItem::write(stream, val);
3209+
3210+ return std::move(buf);
3211+}
3212+
3213+NftItem FfiConverterTypeNftItem::read(RustStream &stream) {
3214+ return {
3215+ FfiConverterTypeTonAddressString::read(stream),
3216+ FfiConverterOptionalTypeTonAddressString::read(stream),
3217+ FfiConverterOptionalTypeNftCollectionDescriptor::read(stream),
3218+ FfiConverterOptionalTypeTonAddressString::read(stream),
3219+ FfiConverterOptionalTypeTonAddressString::read(stream),
3220+ FfiConverterOptionalTypeTonAddressString::read(stream),
3221+ FfiConverterOptionalTypeTonAddressString::read(stream),
3222+ FfiConverterTypeUnsignedDecimalString::read(stream),
3223+ FfiConverterTypeUnsignedDecimalString::read(stream),
3224+ FfiConverterBool::read(stream),
3225+ FfiConverterBool::read(stream),
3226+ FfiConverterString::read(stream),
3227+ FfiConverterString::read(stream),
3228+ FfiConverterMapStringString::read(stream),
3229+ FfiConverterOptionalBool::read(stream),
3230+ FfiConverterOptionalBool::read(stream)
3231+ };
3232+}
3233+
3234+void FfiConverterTypeNftItem::write(RustStream &stream, const NftItem &val) {
3235+ FfiConverterTypeTonAddressString::write(stream, val.address);
3236+ FfiConverterOptionalTypeTonAddressString::write(stream, val.collection_address);
3237+ FfiConverterOptionalTypeNftCollectionDescriptor::write(stream, val.collection);
3238+ FfiConverterOptionalTypeTonAddressString::write(stream, val.owner_address);
3239+ FfiConverterOptionalTypeTonAddressString::write(stream, val.real_owner);
3240+ FfiConverterOptionalTypeTonAddressString::write(stream, val.sale_contract_address);
3241+ FfiConverterOptionalTypeTonAddressString::write(stream, val.auction_contract_address);
3242+ FfiConverterTypeUnsignedDecimalString::write(stream, val.index);
3243+ FfiConverterTypeUnsignedDecimalString::write(stream, val.last_transaction_lt);
3244+ FfiConverterBool::write(stream, val.initialized);
3245+ FfiConverterBool::write(stream, val.on_sale);
3246+ FfiConverterString::write(stream, val.code_hash);
3247+ FfiConverterString::write(stream, val.data_hash);
3248+ FfiConverterMapStringString::write(stream, val.content);
3249+ FfiConverterOptionalBool::write(stream, val.is_nsfw);
3250+ FfiConverterOptionalBool::write(stream, val.is_scam);
3251+}
3252+
3253+uint64_t FfiConverterTypeNftItem::allocation_size(const NftItem &val) {
3254+
3255+ return
3256+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
3257+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.collection_address) +
3258+ FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(val.collection) +
3259+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.owner_address) +
3260+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.real_owner) +
3261+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.sale_contract_address) +
3262+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.auction_contract_address) +
3263+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.index) +
3264+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.last_transaction_lt) +
3265+ FfiConverterBool::allocation_size(val.initialized) +
3266+ FfiConverterBool::allocation_size(val.on_sale) +
3267+ FfiConverterString::allocation_size(val.code_hash) +
3268+ FfiConverterString::allocation_size(val.data_hash) +
3269+ FfiConverterMapStringString::allocation_size(val.content) +
3270+ FfiConverterOptionalBool::allocation_size(val.is_nsfw) +
3271+ FfiConverterOptionalBool::allocation_size(val.is_scam);
3272+
3273+}
3274+
3275+
3276+NftList FfiConverterTypeNftList::lift(RustBuffer buf) {
3277+ auto stream = RustStream(&buf);
3278+ auto ret = FfiConverterTypeNftList::read(stream);
3279+
3280+ rustbuffer_free(buf);
3281+
3282+ return std::move(ret);
3283+}
3284+
3285+RustBuffer FfiConverterTypeNftList::lower(const NftList &val) {
3286+ auto buf = rustbuffer_alloc(allocation_size(val));
3287+ auto stream = RustStream(&buf);
3288+
3289+ FfiConverterTypeNftList::write(stream, val);
3290+
3291+ return std::move(buf);
3292+}
3293+
3294+NftList FfiConverterTypeNftList::read(RustStream &stream) {
3295+ return {
3296+ FfiConverterSequenceTypeNftItem::read(stream),
3297+ FfiConverterTypeResourceState::read(stream),
3298+ FfiConverterTypeResourceState::read(stream),
3299+ FfiConverterBool::read(stream)
3300+ };
3301+}
3302+
3303+void FfiConverterTypeNftList::write(RustStream &stream, const NftList &val) {
3304+ FfiConverterSequenceTypeNftItem::write(stream, val.items);
3305+ FfiConverterTypeResourceState::write(stream, val.resource);
3306+ FfiConverterTypeResourceState::write(stream, val.pagination_resource);
3307+ FfiConverterBool::write(stream, val.has_more);
3308+}
3309+
3310+uint64_t FfiConverterTypeNftList::allocation_size(const NftList &val) {
3311+
3312+ return
3313+ FfiConverterSequenceTypeNftItem::allocation_size(val.items) +
3314+ FfiConverterTypeResourceState::allocation_size(val.resource) +
3315+ FfiConverterTypeResourceState::allocation_size(val.pagination_resource) +
3316+ FfiConverterBool::allocation_size(val.has_more);
3317+
3318+}
3319+
3320+
3321+NftTransferIntent FfiConverterTypeNftTransferIntent::lift(RustBuffer buf) {
3322+ auto stream = RustStream(&buf);
3323+ auto ret = FfiConverterTypeNftTransferIntent::read(stream);
3324+
3325+ rustbuffer_free(buf);
3326+
3327+ return std::move(ret);
3328+}
3329+
3330+RustBuffer FfiConverterTypeNftTransferIntent::lower(const NftTransferIntent &val) {
3331+ auto buf = rustbuffer_alloc(allocation_size(val));
3332+ auto stream = RustStream(&buf);
3333+
3334+ FfiConverterTypeNftTransferIntent::write(stream, val);
3335+
3336+ return std::move(buf);
3337+}
3338+
3339+NftTransferIntent FfiConverterTypeNftTransferIntent::read(RustStream &stream) {
3340+ return {
3341+ FfiConverterTypeTonAddressString::read(stream),
3342+ FfiConverterTypeTonAddressString::read(stream),
3343+ FfiConverterNftTransferFunding::read(stream),
3344+ FfiConverterNftTransferPayload::read(stream),
3345+ FfiConverterSendExpiration::read(stream)
3346+ };
3347+}
3348+
3349+void FfiConverterTypeNftTransferIntent::write(RustStream &stream, const NftTransferIntent &val) {
3350+ FfiConverterTypeTonAddressString::write(stream, val.nft_address);
3351+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
3352+ FfiConverterNftTransferFunding::write(stream, val.funding);
3353+ FfiConverterNftTransferPayload::write(stream, val.payload);
3354+ FfiConverterSendExpiration::write(stream, val.expiration);
3355+}
3356+
3357+uint64_t FfiConverterTypeNftTransferIntent::allocation_size(const NftTransferIntent &val) {
3358+
3359+ return
3360+ FfiConverterTypeTonAddressString::allocation_size(val.nft_address) +
3361+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
3362+ FfiConverterNftTransferFunding::allocation_size(val.funding) +
3363+ FfiConverterNftTransferPayload::allocation_size(val.payload) +
3364+ FfiConverterSendExpiration::allocation_size(val.expiration);
3365+
3366+}
3367+
3368+
3369+NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::lift(RustBuffer buf) {
3370+ auto stream = RustStream(&buf);
3371+ auto ret = FfiConverterTypeNftTransferPreviewRequest::read(stream);
3372+
3373+ rustbuffer_free(buf);
3374+
3375+ return std::move(ret);
3376+}
3377+
3378+RustBuffer FfiConverterTypeNftTransferPreviewRequest::lower(const NftTransferPreviewRequest &val) {
3379+ auto buf = rustbuffer_alloc(allocation_size(val));
3380+ auto stream = RustStream(&buf);
3381+
3382+ FfiConverterTypeNftTransferPreviewRequest::write(stream, val);
3383+
3384+ return std::move(buf);
3385+}
3386+
3387+NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::read(RustStream &stream) {
3388+ return {
3389+ FfiConverterTypeNonEmptyString::read(stream),
3390+ FfiConverterTypeNftTransferIntent::read(stream)
3391+ };
3392+}
3393+
3394+void FfiConverterTypeNftTransferPreviewRequest::write(RustStream &stream, const NftTransferPreviewRequest &val) {
3395+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3396+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3397+}
3398+
3399+uint64_t FfiConverterTypeNftTransferPreviewRequest::allocation_size(const NftTransferPreviewRequest &val) {
3400+
3401+ return
3402+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3403+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3404+
3405+}
3406+
3407+
3408+NftTransferRequest FfiConverterTypeNftTransferRequest::lift(RustBuffer buf) {
3409+ auto stream = RustStream(&buf);
3410+ auto ret = FfiConverterTypeNftTransferRequest::read(stream);
3411+
3412+ rustbuffer_free(buf);
3413+
3414+ return std::move(ret);
3415+}
3416+
3417+RustBuffer FfiConverterTypeNftTransferRequest::lower(const NftTransferRequest &val) {
3418+ auto buf = rustbuffer_alloc(allocation_size(val));
3419+ auto stream = RustStream(&buf);
3420+
3421+ FfiConverterTypeNftTransferRequest::write(stream, val);
3422+
3423+ return std::move(buf);
3424+}
3425+
3426+NftTransferRequest FfiConverterTypeNftTransferRequest::read(RustStream &stream) {
3427+ return {
3428+ FfiConverterTypeNonEmptyString::read(stream),
3429+ FfiConverterBool::read(stream),
3430+ FfiConverterTypeNftTransferIntent::read(stream)
3431+ };
3432+}
3433+
3434+void FfiConverterTypeNftTransferRequest::write(RustStream &stream, const NftTransferRequest &val) {
3435+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3436+ FfiConverterBool::write(stream, val.force);
3437+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3438+}
3439+
3440+uint64_t FfiConverterTypeNftTransferRequest::allocation_size(const NftTransferRequest &val) {
3441+
3442+ return
3443+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3444+ FfiConverterBool::allocation_size(val.force) +
3445+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3446+
3447+}
3448+
3449+
3450+ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::lift(RustBuffer buf) {
3451+ auto stream = RustStream(&buf);
3452+ auto ret = FfiConverterTypeParsedTonTransferLink::read(stream);
3453+
3454+ rustbuffer_free(buf);
3455+
3456+ return std::move(ret);
3457+}
3458+
3459+RustBuffer FfiConverterTypeParsedTonTransferLink::lower(const ParsedTonTransferLink &val) {
3460+ auto buf = rustbuffer_alloc(allocation_size(val));
3461+ auto stream = RustStream(&buf);
3462+
3463+ FfiConverterTypeParsedTonTransferLink::write(stream, val);
3464+
3465+ return std::move(buf);
3466+}
3467+
3468+ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::read(RustStream &stream) {
3469+ return {
3470+ FfiConverterTypeTonAddressString::read(stream),
3471+ FfiConverterTonTransferAsset::read(stream),
3472+ FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
3473+ FfiConverterTonTransferPayload::read(stream),
3474+ FfiConverterSendExpiration::read(stream)
3475+ };
3476+}
3477+
3478+void FfiConverterTypeParsedTonTransferLink::write(RustStream &stream, const ParsedTonTransferLink &val) {
3479+ FfiConverterTypeTonAddressString::write(stream, val.recipient);
3480+ FfiConverterTonTransferAsset::write(stream, val.asset);
3481+ FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val.amount);
3482+ FfiConverterTonTransferPayload::write(stream, val.payload);
3483+ FfiConverterSendExpiration::write(stream, val.expiration);
3484+}
3485+
3486+uint64_t FfiConverterTypeParsedTonTransferLink::allocation_size(const ParsedTonTransferLink &val) {
3487+
3488+ return
3489+ FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
3490+ FfiConverterTonTransferAsset::allocation_size(val.asset) +
3491+ FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val.amount) +
3492+ FfiConverterTonTransferPayload::allocation_size(val.payload) +
3493+ FfiConverterSendExpiration::allocation_size(val.expiration);
3494+
3495+}
3496+
3497+
3498+PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::lift(RustBuffer buf) {
3499+ auto stream = RustStream(&buf);
3500+ auto ret = FfiConverterTypePrepareKeyRotationRequest::read(stream);
3501+
3502+ rustbuffer_free(buf);
3503+
3504+ return std::move(ret);
3505+}
3506+
3507+RustBuffer FfiConverterTypePrepareKeyRotationRequest::lower(const PrepareKeyRotationRequest &val) {
3508+ auto buf = rustbuffer_alloc(allocation_size(val));
3509+ auto stream = RustStream(&buf);
3510+
3511+ FfiConverterTypePrepareKeyRotationRequest::write(stream, val);
3512+
3513+ return std::move(buf);
3514+}
3515+
3516+PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::read(RustStream &stream) {
3517+ return {
3518+ FfiConverterUInt64::read(stream),
3519+ FfiConverterKeyRotationMessageKind::read(stream)
3520+ };
3521+}
3522+
3523+void FfiConverterTypePrepareKeyRotationRequest::write(RustStream &stream, const PrepareKeyRotationRequest &val) {
3524+ FfiConverterUInt64::write(stream, val.valid_until);
3525+ FfiConverterKeyRotationMessageKind::write(stream, val.message_kind);
3526+}
3527+
3528+uint64_t FfiConverterTypePrepareKeyRotationRequest::allocation_size(const PrepareKeyRotationRequest &val) {
3529+
3530+ return
3531+ FfiConverterUInt64::allocation_size(val.valid_until) +
3532+ FfiConverterKeyRotationMessageKind::allocation_size(val.message_kind);
3533+
3534+}
3535+
3536+
3537+PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::lift(RustBuffer buf) {
3538+ auto stream = RustStream(&buf);
3539+ auto ret = FfiConverterTypePrepareNftTransferRequest::read(stream);
3540+
3541+ rustbuffer_free(buf);
3542+
3543+ return std::move(ret);
3544+}
3545+
3546+RustBuffer FfiConverterTypePrepareNftTransferRequest::lower(const PrepareNftTransferRequest &val) {
3547+ auto buf = rustbuffer_alloc(allocation_size(val));
3548+ auto stream = RustStream(&buf);
3549+
3550+ FfiConverterTypePrepareNftTransferRequest::write(stream, val);
3551+
3552+ return std::move(buf);
3553+}
3554+
3555+PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::read(RustStream &stream) {
3556+ return {
3557+ FfiConverterTypeNonEmptyString::read(stream),
3558+ FfiConverterTypeNftTransferIntent::read(stream)
3559+ };
3560+}
3561+
3562+void FfiConverterTypePrepareNftTransferRequest::write(RustStream &stream, const PrepareNftTransferRequest &val) {
3563+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3564+ FfiConverterTypeNftTransferIntent::write(stream, val.intent);
3565+}
3566+
3567+uint64_t FfiConverterTypePrepareNftTransferRequest::allocation_size(const PrepareNftTransferRequest &val) {
3568+
3569+ return
3570+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3571+ FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
3572+
3573+}
3574+
3575+
3576+PrepareTransferRequest FfiConverterTypePrepareTransferRequest::lift(RustBuffer buf) {
3577+ auto stream = RustStream(&buf);
3578+ auto ret = FfiConverterTypePrepareTransferRequest::read(stream);
3579+
3580+ rustbuffer_free(buf);
3581+
3582+ return std::move(ret);
3583+}
3584+
3585+RustBuffer FfiConverterTypePrepareTransferRequest::lower(const PrepareTransferRequest &val) {
3586+ auto buf = rustbuffer_alloc(allocation_size(val));
3587+ auto stream = RustStream(&buf);
3588+
3589+ FfiConverterTypePrepareTransferRequest::write(stream, val);
3590+
3591+ return std::move(buf);
3592+}
3593+
3594+PrepareTransferRequest FfiConverterTypePrepareTransferRequest::read(RustStream &stream) {
3595+ return {
3596+ FfiConverterTypeNonEmptyString::read(stream),
3597+ FfiConverterTypeSendIntent::read(stream)
3598+ };
3599+}
3600+
3601+void FfiConverterTypePrepareTransferRequest::write(RustStream &stream, const PrepareTransferRequest &val) {
3602+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3603+ FfiConverterTypeSendIntent::write(stream, val.intent);
3604+}
3605+
3606+uint64_t FfiConverterTypePrepareTransferRequest::allocation_size(const PrepareTransferRequest &val) {
3607+
3608+ return
3609+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3610+ FfiConverterTypeSendIntent::allocation_size(val.intent);
3611+
3612+}
3613+
3614+
3615+PreparedKeyRotation FfiConverterTypePreparedKeyRotation::lift(RustBuffer buf) {
3616+ auto stream = RustStream(&buf);
3617+ auto ret = FfiConverterTypePreparedKeyRotation::read(stream);
3618+
3619+ rustbuffer_free(buf);
3620+
3621+ return std::move(ret);
3622+}
3623+
3624+RustBuffer FfiConverterTypePreparedKeyRotation::lower(const PreparedKeyRotation &val) {
3625+ auto buf = rustbuffer_alloc(allocation_size(val));
3626+ auto stream = RustStream(&buf);
3627+
3628+ FfiConverterTypePreparedKeyRotation::write(stream, val);
3629+
3630+ return std::move(buf);
3631+}
3632+
3633+PreparedKeyRotation FfiConverterTypePreparedKeyRotation::read(RustStream &stream) {
3634+ return {
3635+ FfiConverterTypeRecoveryPhrase::read(stream),
3636+ FfiConverterBytes::read(stream),
3637+ FfiConverterTypeBoc::read(stream),
3638+ FfiConverterTypeBoc::read(stream),
3639+ FfiConverterTypeBoc::read(stream),
3640+ FfiConverterUInt32::read(stream),
3641+ FfiConverterUInt64::read(stream),
3642+ FfiConverterKeyRotationMessageKind::read(stream)
3643+ };
3644+}
3645+
3646+void FfiConverterTypePreparedKeyRotation::write(RustStream &stream, const PreparedKeyRotation &val) {
3647+ FfiConverterTypeRecoveryPhrase::write(stream, val.replacement_recovery_phrase);
3648+ FfiConverterBytes::write(stream, val.new_public_key);
3649+ FfiConverterTypeBoc::write(stream, val.signed_boc);
3650+ FfiConverterTypeBoc::write(stream, val.external_boc);
3651+ FfiConverterTypeBoc::write(stream, val.internal_boc);
3652+ FfiConverterUInt32::write(stream, val.seqno);
3653+ FfiConverterUInt64::write(stream, val.valid_until);
3654+ FfiConverterKeyRotationMessageKind::write(stream, val.message_kind);
3655+}
3656+
3657+uint64_t FfiConverterTypePreparedKeyRotation::allocation_size(const PreparedKeyRotation &val) {
3658+
3659+ return
3660+ FfiConverterTypeRecoveryPhrase::allocation_size(val.replacement_recovery_phrase) +
3661+ FfiConverterBytes::allocation_size(val.new_public_key) +
3662+ FfiConverterTypeBoc::allocation_size(val.signed_boc) +
3663+ FfiConverterTypeBoc::allocation_size(val.external_boc) +
3664+ FfiConverterTypeBoc::allocation_size(val.internal_boc) +
3665+ FfiConverterUInt32::allocation_size(val.seqno) +
3666+ FfiConverterUInt64::allocation_size(val.valid_until) +
3667+ FfiConverterKeyRotationMessageKind::allocation_size(val.message_kind);
3668+
3669+}
3670+
3671+
3672+PreparedTransfer FfiConverterTypePreparedTransfer::lift(RustBuffer buf) {
3673+ auto stream = RustStream(&buf);
3674+ auto ret = FfiConverterTypePreparedTransfer::read(stream);
3675+
3676+ rustbuffer_free(buf);
3677+
3678+ return std::move(ret);
3679+}
3680+
3681+RustBuffer FfiConverterTypePreparedTransfer::lower(const PreparedTransfer &val) {
3682+ auto buf = rustbuffer_alloc(allocation_size(val));
3683+ auto stream = RustStream(&buf);
3684+
3685+ FfiConverterTypePreparedTransfer::write(stream, val);
3686+
3687+ return std::move(buf);
3688+}
3689+
3690+PreparedTransfer FfiConverterTypePreparedTransfer::read(RustStream &stream) {
3691+ return {
3692+ FfiConverterTypeNonEmptyString::read(stream),
3693+ FfiConverterTypeBoc::read(stream),
3694+ FfiConverterTypeBoc::read(stream),
3695+ FfiConverterUInt32::read(stream),
3696+ FfiConverterUInt64::read(stream)
3697+ };
3698+}
3699+
3700+void FfiConverterTypePreparedTransfer::write(RustStream &stream, const PreparedTransfer &val) {
3701+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
3702+ FfiConverterTypeBoc::write(stream, val.external_boc);
3703+ FfiConverterTypeBoc::write(stream, val.internal_boc);
3704+ FfiConverterUInt32::write(stream, val.seqno);
3705+ FfiConverterUInt64::write(stream, val.valid_until);
3706+}
3707+
3708+uint64_t FfiConverterTypePreparedTransfer::allocation_size(const PreparedTransfer &val) {
3709+
3710+ return
3711+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
3712+ FfiConverterTypeBoc::allocation_size(val.external_boc) +
3713+ FfiConverterTypeBoc::allocation_size(val.internal_boc) +
3714+ FfiConverterUInt32::allocation_size(val.seqno) +
3715+ FfiConverterUInt64::allocation_size(val.valid_until);
3716+
3717+}
3718+
3719+
3720+ProtectedSecretRead FfiConverterTypeProtectedSecretRead::lift(RustBuffer buf) {
3721+ auto stream = RustStream(&buf);
3722+ auto ret = FfiConverterTypeProtectedSecretRead::read(stream);
3723+
3724+ rustbuffer_free(buf);
3725+
3726+ return std::move(ret);
3727+}
3728+
3729+RustBuffer FfiConverterTypeProtectedSecretRead::lower(const ProtectedSecretRead &val) {
3730+ auto buf = rustbuffer_alloc(allocation_size(val));
3731+ auto stream = RustStream(&buf);
3732+
3733+ FfiConverterTypeProtectedSecretRead::write(stream, val);
3734+
3735+ return std::move(buf);
3736+}
3737+
3738+ProtectedSecretRead FfiConverterTypeProtectedSecretRead::read(RustStream &stream) {
3739+ return {
3740+ FfiConverterTypeProtectedSecretRef::read(stream),
3741+ FfiConverterSecretAccessReason::read(stream),
3742+ FfiConverterString::read(stream)
3743+ };
3744+}
3745+
3746+void FfiConverterTypeProtectedSecretRead::write(RustStream &stream, const ProtectedSecretRead &val) {
3747+ FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
3748+ FfiConverterSecretAccessReason::write(stream, val.reason);
3749+ FfiConverterString::write(stream, val.prompt);
3750+}
3751+
3752+uint64_t FfiConverterTypeProtectedSecretRead::allocation_size(const ProtectedSecretRead &val) {
3753+
3754+ return
3755+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
3756+ FfiConverterSecretAccessReason::allocation_size(val.reason) +
3757+ FfiConverterString::allocation_size(val.prompt);
3758+
3759+}
3760+
3761+
3762+ProtectedSecretRef FfiConverterTypeProtectedSecretRef::lift(RustBuffer buf) {
3763+ auto stream = RustStream(&buf);
3764+ auto ret = FfiConverterTypeProtectedSecretRef::read(stream);
3765+
3766+ rustbuffer_free(buf);
3767+
3768+ return std::move(ret);
3769+}
3770+
3771+RustBuffer FfiConverterTypeProtectedSecretRef::lower(const ProtectedSecretRef &val) {
3772+ auto buf = rustbuffer_alloc(allocation_size(val));
3773+ auto stream = RustStream(&buf);
3774+
3775+ FfiConverterTypeProtectedSecretRef::write(stream, val);
3776+
3777+ return std::move(buf);
3778+}
3779+
3780+ProtectedSecretRef FfiConverterTypeProtectedSecretRef::read(RustStream &stream) {
3781+ return {
3782+ FfiConverterString::read(stream)
3783+ };
3784+}
3785+
3786+void FfiConverterTypeProtectedSecretRef::write(RustStream &stream, const ProtectedSecretRef &val) {
3787+ FfiConverterString::write(stream, val.value);
3788+}
3789+
3790+uint64_t FfiConverterTypeProtectedSecretRef::allocation_size(const ProtectedSecretRef &val) {
3791+
3792+ return
3793+ FfiConverterString::allocation_size(val.value);
3794+
3795+}
3796+
3797+
3798+ProtectedSecretStore FfiConverterTypeProtectedSecretStore::lift(RustBuffer buf) {
3799+ auto stream = RustStream(&buf);
3800+ auto ret = FfiConverterTypeProtectedSecretStore::read(stream);
3801+
3802+ rustbuffer_free(buf);
3803+
3804+ return std::move(ret);
3805+}
3806+
3807+RustBuffer FfiConverterTypeProtectedSecretStore::lower(const ProtectedSecretStore &val) {
3808+ auto buf = rustbuffer_alloc(allocation_size(val));
3809+ auto stream = RustStream(&buf);
3810+
3811+ FfiConverterTypeProtectedSecretStore::write(stream, val);
3812+
3813+ return std::move(buf);
3814+}
3815+
3816+ProtectedSecretStore FfiConverterTypeProtectedSecretStore::read(RustStream &stream) {
3817+ return {
3818+ FfiConverterTypeProtectedSecretRef::read(stream),
3819+ FfiConverterBytes::read(stream),
3820+ FfiConverterBool::read(stream)
3821+ };
3822+}
3823+
3824+void FfiConverterTypeProtectedSecretStore::write(RustStream &stream, const ProtectedSecretStore &val) {
3825+ FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
3826+ FfiConverterBytes::write(stream, val.bytes);
3827+ FfiConverterBool::write(stream, val.require_user_presence);
3828+}
3829+
3830+uint64_t FfiConverterTypeProtectedSecretStore::allocation_size(const ProtectedSecretStore &val) {
3831+
3832+ return
3833+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
3834+ FfiConverterBytes::allocation_size(val.bytes) +
3835+ FfiConverterBool::allocation_size(val.require_user_presence);
3836+
3837+}
3838+
3839+
3840+ProviderConfig FfiConverterTypeProviderConfig::lift(RustBuffer buf) {
3841+ auto stream = RustStream(&buf);
3842+ auto ret = FfiConverterTypeProviderConfig::read(stream);
3843+
3844+ rustbuffer_free(buf);
3845+
3846+ return std::move(ret);
3847+}
3848+
3849+RustBuffer FfiConverterTypeProviderConfig::lower(const ProviderConfig &val) {
3850+ auto buf = rustbuffer_alloc(allocation_size(val));
3851+ auto stream = RustStream(&buf);
3852+
3853+ FfiConverterTypeProviderConfig::write(stream, val);
3854+
3855+ return std::move(buf);
3856+}
3857+
3858+ProviderConfig FfiConverterTypeProviderConfig::read(RustStream &stream) {
3859+ return {
3860+ FfiConverterString::read(stream),
3861+ FfiConverterOptionalTypeTonAddressString::read(stream),
3862+ FfiConverterUInt64::read(stream)
3863+ };
3864+}
3865+
3866+void FfiConverterTypeProviderConfig::write(RustStream &stream, const ProviderConfig &val) {
3867+ FfiConverterString::write(stream, val.toncenter_base_url);
3868+ FfiConverterOptionalTypeTonAddressString::write(stream, val.dns_root_address);
3869+ FfiConverterUInt64::write(stream, val.request_timeout_ms);
3870+}
3871+
3872+uint64_t FfiConverterTypeProviderConfig::allocation_size(const ProviderConfig &val) {
3873+
3874+ return
3875+ FfiConverterString::allocation_size(val.toncenter_base_url) +
3876+ FfiConverterOptionalTypeTonAddressString::allocation_size(val.dns_root_address) +
3877+ FfiConverterUInt64::allocation_size(val.request_timeout_ms);
3878+
3879+}
3880+
3881+
3882+RecoveryPhrase FfiConverterTypeRecoveryPhrase::lift(RustBuffer buf) {
3883+ auto stream = RustStream(&buf);
3884+ auto ret = FfiConverterTypeRecoveryPhrase::read(stream);
3885+
3886+ rustbuffer_free(buf);
3887+
3888+ return std::move(ret);
3889+}
3890+
3891+RustBuffer FfiConverterTypeRecoveryPhrase::lower(const RecoveryPhrase &val) {
3892+ auto buf = rustbuffer_alloc(allocation_size(val));
3893+ auto stream = RustStream(&buf);
3894+
3895+ FfiConverterTypeRecoveryPhrase::write(stream, val);
3896+
3897+ return std::move(buf);
3898+}
3899+
3900+RecoveryPhrase FfiConverterTypeRecoveryPhrase::read(RustStream &stream) {
3901+ return {
3902+ FfiConverterString::read(stream)
3903+ };
3904+}
3905+
3906+void FfiConverterTypeRecoveryPhrase::write(RustStream &stream, const RecoveryPhrase &val) {
3907+ FfiConverterString::write(stream, val.phrase);
3908+}
3909+
3910+uint64_t FfiConverterTypeRecoveryPhrase::allocation_size(const RecoveryPhrase &val) {
3911+
3912+ return
3913+ FfiConverterString::allocation_size(val.phrase);
3914+
3915+}
3916+
3917+
3918+ResolutionInfo FfiConverterTypeResolutionInfo::lift(RustBuffer buf) {
3919+ auto stream = RustStream(&buf);
3920+ auto ret = FfiConverterTypeResolutionInfo::read(stream);
3921+
3922+ rustbuffer_free(buf);
3923+
3924+ return std::move(ret);
3925+}
3926+
3927+RustBuffer FfiConverterTypeResolutionInfo::lower(const ResolutionInfo &val) {
3928+ auto buf = rustbuffer_alloc(allocation_size(val));
3929+ auto stream = RustStream(&buf);
3930+
3931+ FfiConverterTypeResolutionInfo::write(stream, val);
3932+
3933+ return std::move(buf);
3934+}
3935+
3936+ResolutionInfo FfiConverterTypeResolutionInfo::read(RustStream &stream) {
3937+ return {
3938+ FfiConverterOptionalTypeBase64Hash::read(stream),
3939+ FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
3940+ FfiConverterOptionalPendingReason::read(stream),
3941+ FfiConverterBool::read(stream),
3942+ FfiConverterOptionalUInt64::read(stream)
3943+ };
3944+}
3945+
3946+void FfiConverterTypeResolutionInfo::write(RustStream &stream, const ResolutionInfo &val) {
3947+ FfiConverterOptionalTypeBase64Hash::write(stream, val.transaction_hash);
3948+ FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val.transaction_lt);
3949+ FfiConverterOptionalPendingReason::write(stream, val.pending_reason);
3950+ FfiConverterBool::write(stream, val.can_force_retry);
3951+ FfiConverterOptionalUInt64::write(stream, val.retry_after_hint_ms);
3952+}
3953+
3954+uint64_t FfiConverterTypeResolutionInfo::allocation_size(const ResolutionInfo &val) {
3955+
3956+ return
3957+ FfiConverterOptionalTypeBase64Hash::allocation_size(val.transaction_hash) +
3958+ FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val.transaction_lt) +
3959+ FfiConverterOptionalPendingReason::allocation_size(val.pending_reason) +
3960+ FfiConverterBool::allocation_size(val.can_force_retry) +
3961+ FfiConverterOptionalUInt64::allocation_size(val.retry_after_hint_ms);
3962+
3963+}
3964+
3965+
3966+ResourceState FfiConverterTypeResourceState::lift(RustBuffer buf) {
3967+ auto stream = RustStream(&buf);
3968+ auto ret = FfiConverterTypeResourceState::read(stream);
3969+
3970+ rustbuffer_free(buf);
3971+
3972+ return std::move(ret);
3973+}
3974+
3975+RustBuffer FfiConverterTypeResourceState::lower(const ResourceState &val) {
3976+ auto buf = rustbuffer_alloc(allocation_size(val));
3977+ auto stream = RustStream(&buf);
3978+
3979+ FfiConverterTypeResourceState::write(stream, val);
3980+
3981+ return std::move(buf);
3982+}
3983+
3984+ResourceState FfiConverterTypeResourceState::read(RustStream &stream) {
3985+ return {
3986+ FfiConverterResourcePhase::read(stream),
3987+ FfiConverterOptionalTypeDomainError::read(stream)
3988+ };
3989+}
3990+
3991+void FfiConverterTypeResourceState::write(RustStream &stream, const ResourceState &val) {
3992+ FfiConverterResourcePhase::write(stream, val.phase);
3993+ FfiConverterOptionalTypeDomainError::write(stream, val.error);
3994+}
3995+
3996+uint64_t FfiConverterTypeResourceState::allocation_size(const ResourceState &val) {
3997+
3998+ return
3999+ FfiConverterResourcePhase::allocation_size(val.phase) +
4000+ FfiConverterOptionalTypeDomainError::allocation_size(val.error);
4001+
4002+}
4003+
4004+
4005+SendBocRequest FfiConverterTypeSendBocRequest::lift(RustBuffer buf) {
4006+ auto stream = RustStream(&buf);
4007+ auto ret = FfiConverterTypeSendBocRequest::read(stream);
4008+
4009+ rustbuffer_free(buf);
4010+
4011+ return std::move(ret);
4012+}
4013+
4014+RustBuffer FfiConverterTypeSendBocRequest::lower(const SendBocRequest &val) {
4015+ auto buf = rustbuffer_alloc(allocation_size(val));
4016+ auto stream = RustStream(&buf);
4017+
4018+ FfiConverterTypeSendBocRequest::write(stream, val);
4019+
4020+ return std::move(buf);
4021+}
4022+
4023+SendBocRequest FfiConverterTypeSendBocRequest::read(RustStream &stream) {
4024+ return {
4025+ FfiConverterTypeNonEmptyString::read(stream),
4026+ FfiConverterBool::read(stream),
4027+ FfiConverterTypeBoc::read(stream),
4028+ FfiConverterUInt32::read(stream),
4029+ FfiConverterUInt64::read(stream)
4030+ };
4031+}
4032+
4033+void FfiConverterTypeSendBocRequest::write(RustStream &stream, const SendBocRequest &val) {
4034+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4035+ FfiConverterBool::write(stream, val.force);
4036+ FfiConverterTypeBoc::write(stream, val.signed_boc);
4037+ FfiConverterUInt32::write(stream, val.seqno);
4038+ FfiConverterUInt64::write(stream, val.valid_until);
4039+}
4040+
4041+uint64_t FfiConverterTypeSendBocRequest::allocation_size(const SendBocRequest &val) {
4042+
4043+ return
4044+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4045+ FfiConverterBool::allocation_size(val.force) +
4046+ FfiConverterTypeBoc::allocation_size(val.signed_boc) +
4047+ FfiConverterUInt32::allocation_size(val.seqno) +
4048+ FfiConverterUInt64::allocation_size(val.valid_until);
4049+
4050+}
4051+
4052+
4053+SendEmulation FfiConverterTypeSendEmulation::lift(RustBuffer buf) {
4054+ auto stream = RustStream(&buf);
4055+ auto ret = FfiConverterTypeSendEmulation::read(stream);
4056+
4057+ rustbuffer_free(buf);
4058+
4059+ return std::move(ret);
4060+}
4061+
4062+RustBuffer FfiConverterTypeSendEmulation::lower(const SendEmulation &val) {
4063+ auto buf = rustbuffer_alloc(allocation_size(val));
4064+ auto stream = RustStream(&buf);
4065+
4066+ FfiConverterTypeSendEmulation::write(stream, val);
4067+
4068+ return std::move(buf);
4069+}
4070+
4071+SendEmulation FfiConverterTypeSendEmulation::read(RustStream &stream) {
4072+ return {
4073+ FfiConverterUInt32::read(stream),
4074+ FfiConverterTypeUnsignedDecimalString::read(stream),
4075+ FfiConverterTypeUnsignedDecimalString::read(stream),
4076+ FfiConverterUInt64::read(stream),
4077+ FfiConverterSequenceTypeSendEmulationAction::read(stream),
4078+ FfiConverterSequenceTypeSendEmulationTransaction::read(stream),
4079+ FfiConverterBool::read(stream),
4080+ FfiConverterBool::read(stream)
4081+ };
4082+}
4083+
4084+void FfiConverterTypeSendEmulation::write(RustStream &stream, const SendEmulation &val) {
4085+ FfiConverterUInt32::write(stream, val.mc_block_seqno);
4086+ FfiConverterTypeUnsignedDecimalString::write(stream, val.wallet_fees_nanograms);
4087+ FfiConverterTypeUnsignedDecimalString::write(stream, val.trace_fees_nanograms);
4088+ FfiConverterUInt64::write(stream, val.transaction_count);
4089+ FfiConverterSequenceTypeSendEmulationAction::write(stream, val.actions);
4090+ FfiConverterSequenceTypeSendEmulationTransaction::write(stream, val.transactions);
4091+ FfiConverterBool::write(stream, val.trace_succeeded);
4092+ FfiConverterBool::write(stream, val.is_incomplete);
4093+}
4094+
4095+uint64_t FfiConverterTypeSendEmulation::allocation_size(const SendEmulation &val) {
4096+
4097+ return
4098+ FfiConverterUInt32::allocation_size(val.mc_block_seqno) +
4099+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.wallet_fees_nanograms) +
4100+ FfiConverterTypeUnsignedDecimalString::allocation_size(val.trace_fees_nanograms) +
4101+ FfiConverterUInt64::allocation_size(val.transaction_count) +
4102+ FfiConverterSequenceTypeSendEmulationAction::allocation_size(val.actions) +
4103+ FfiConverterSequenceTypeSendEmulationTransaction::allocation_size(val.transactions) +
4104+ FfiConverterBool::allocation_size(val.trace_succeeded) +
4105+ FfiConverterBool::allocation_size(val.is_incomplete);
4106+
4107+}
4108+
4109+
4110+SendEmulationAction FfiConverterTypeSendEmulationAction::lift(RustBuffer buf) {
4111+ auto stream = RustStream(&buf);
4112+ auto ret = FfiConverterTypeSendEmulationAction::read(stream);
4113+
4114+ rustbuffer_free(buf);
4115+
4116+ return std::move(ret);
4117+}
4118+
4119+RustBuffer FfiConverterTypeSendEmulationAction::lower(const SendEmulationAction &val) {
4120+ auto buf = rustbuffer_alloc(allocation_size(val));
4121+ auto stream = RustStream(&buf);
4122+
4123+ FfiConverterTypeSendEmulationAction::write(stream, val);
4124+
4125+ return std::move(buf);
4126+}
4127+
4128+SendEmulationAction FfiConverterTypeSendEmulationAction::read(RustStream &stream) {
4129+ return {
4130+ FfiConverterTypeBase64Hash::read(stream),
4131+ FfiConverterTypeNonEmptyString::read(stream),
4132+ FfiConverterBool::read(stream),
4133+ FfiConverterSequenceTypeTonAddressString::read(stream),
4134+ FfiConverterSequenceTypeBase64Hash::read(stream),
4135+ FfiConverterString::read(stream)
4136+ };
4137+}
4138+
4139+void FfiConverterTypeSendEmulationAction::write(RustStream &stream, const SendEmulationAction &val) {
4140+ FfiConverterTypeBase64Hash::write(stream, val.action_id);
4141+ FfiConverterTypeNonEmptyString::write(stream, val.kind);
4142+ FfiConverterBool::write(stream, val.succeeded);
4143+ FfiConverterSequenceTypeTonAddressString::write(stream, val.accounts);
4144+ FfiConverterSequenceTypeBase64Hash::write(stream, val.transaction_hashes);
4145+ FfiConverterString::write(stream, val.details_json);
4146+}
4147+
4148+uint64_t FfiConverterTypeSendEmulationAction::allocation_size(const SendEmulationAction &val) {
4149+
4150+ return
4151+ FfiConverterTypeBase64Hash::allocation_size(val.action_id) +
4152+ FfiConverterTypeNonEmptyString::allocation_size(val.kind) +
4153+ FfiConverterBool::allocation_size(val.succeeded) +
4154+ FfiConverterSequenceTypeTonAddressString::allocation_size(val.accounts) +
4155+ FfiConverterSequenceTypeBase64Hash::allocation_size(val.transaction_hashes) +
4156+ FfiConverterString::allocation_size(val.details_json);
4157+
4158+}
4159+
4160+
4161+SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::lift(RustBuffer buf) {
4162+ auto stream = RustStream(&buf);
4163+ auto ret = FfiConverterTypeSendEmulationTransaction::read(stream);
4164+
4165+ rustbuffer_free(buf);
4166+
4167+ return std::move(ret);
4168+}
4169+
4170+RustBuffer FfiConverterTypeSendEmulationTransaction::lower(const SendEmulationTransaction &val) {
4171+ auto buf = rustbuffer_alloc(allocation_size(val));
4172+ auto stream = RustStream(&buf);
4173+
4174+ FfiConverterTypeSendEmulationTransaction::write(stream, val);
4175+
4176+ return std::move(buf);
4177+}
4178+
4179+SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::read(RustStream &stream) {
4180+ return {
4181+ FfiConverterTypeTonAddressString::read(stream),
4182+ FfiConverterBool::read(stream),
4183+ FfiConverterBool::read(stream)
4184+ };
4185+}
4186+
4187+void FfiConverterTypeSendEmulationTransaction::write(RustStream &stream, const SendEmulationTransaction &val) {
4188+ FfiConverterTypeTonAddressString::write(stream, val.account);
4189+ FfiConverterBool::write(stream, val.succeeded);
4190+ FfiConverterBool::write(stream, val.is_root);
4191+}
4192+
4193+uint64_t FfiConverterTypeSendEmulationTransaction::allocation_size(const SendEmulationTransaction &val) {
4194+
4195+ return
4196+ FfiConverterTypeTonAddressString::allocation_size(val.account) +
4197+ FfiConverterBool::allocation_size(val.succeeded) +
4198+ FfiConverterBool::allocation_size(val.is_root);
4199+
4200+}
4201+
4202+
4203+SendIntent FfiConverterTypeSendIntent::lift(RustBuffer buf) {
4204+ auto stream = RustStream(&buf);
4205+ auto ret = FfiConverterTypeSendIntent::read(stream);
4206+
4207+ rustbuffer_free(buf);
4208+
4209+ return std::move(ret);
4210+}
4211+
4212+RustBuffer FfiConverterTypeSendIntent::lower(const SendIntent &val) {
4213+ auto buf = rustbuffer_alloc(allocation_size(val));
4214+ auto stream = RustStream(&buf);
4215+
4216+ FfiConverterTypeSendIntent::write(stream, val);
4217+
4218+ return std::move(buf);
4219+}
4220+
4221+SendIntent FfiConverterTypeSendIntent::read(RustStream &stream) {
4222+ return {
4223+ FfiConverterSendExpiration::read(stream),
4224+ FfiConverterSequenceTypeSendMessage::read(stream)
4225+ };
4226+}
4227+
4228+void FfiConverterTypeSendIntent::write(RustStream &stream, const SendIntent &val) {
4229+ FfiConverterSendExpiration::write(stream, val.expiration);
4230+ FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
4231+}
4232+
4233+uint64_t FfiConverterTypeSendIntent::allocation_size(const SendIntent &val) {
4234+
4235+ return
4236+ FfiConverterSendExpiration::allocation_size(val.expiration) +
4237+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages);
4238+
4239+}
4240+
4241+
4242+SendMessage FfiConverterTypeSendMessage::lift(RustBuffer buf) {
4243+ auto stream = RustStream(&buf);
4244+ auto ret = FfiConverterTypeSendMessage::read(stream);
4245+
4246+ rustbuffer_free(buf);
4247+
4248+ return std::move(ret);
4249+}
4250+
4251+RustBuffer FfiConverterTypeSendMessage::lower(const SendMessage &val) {
4252+ auto buf = rustbuffer_alloc(allocation_size(val));
4253+ auto stream = RustStream(&buf);
4254+
4255+ FfiConverterTypeSendMessage::write(stream, val);
4256+
4257+ return std::move(buf);
4258+}
4259+
4260+SendMessage FfiConverterTypeSendMessage::read(RustStream &stream) {
4261+ return {
4262+ FfiConverterTypeTonAddressString::read(stream),
4263+ FfiConverterSendAmount::read(stream),
4264+ FfiConverterSendMessageBody::read(stream),
4265+ FfiConverterBool::read(stream),
4266+ FfiConverterOptionalTypeBoc::read(stream)
4267+ };
4268+}
4269+
4270+void FfiConverterTypeSendMessage::write(RustStream &stream, const SendMessage &val) {
4271+ FfiConverterTypeTonAddressString::write(stream, val.destination);
4272+ FfiConverterSendAmount::write(stream, val.amount);
4273+ FfiConverterSendMessageBody::write(stream, val.body);
4274+ FfiConverterBool::write(stream, val.bounce);
4275+ FfiConverterOptionalTypeBoc::write(stream, val.state_init);
4276+}
4277+
4278+uint64_t FfiConverterTypeSendMessage::allocation_size(const SendMessage &val) {
4279+
4280+ return
4281+ FfiConverterTypeTonAddressString::allocation_size(val.destination) +
4282+ FfiConverterSendAmount::allocation_size(val.amount) +
4283+ FfiConverterSendMessageBody::allocation_size(val.body) +
4284+ FfiConverterBool::allocation_size(val.bounce) +
4285+ FfiConverterOptionalTypeBoc::allocation_size(val.state_init);
4286+
4287+}
4288+
4289+
4290+SendPreview FfiConverterTypeSendPreview::lift(RustBuffer buf) {
4291+ auto stream = RustStream(&buf);
4292+ auto ret = FfiConverterTypeSendPreview::read(stream);
4293+
4294+ rustbuffer_free(buf);
4295+
4296+ return std::move(ret);
4297+}
4298+
4299+RustBuffer FfiConverterTypeSendPreview::lower(const SendPreview &val) {
4300+ auto buf = rustbuffer_alloc(allocation_size(val));
4301+ auto stream = RustStream(&buf);
4302+
4303+ FfiConverterTypeSendPreview::write(stream, val);
4304+
4305+ return std::move(buf);
4306+}
4307+
4308+SendPreview FfiConverterTypeSendPreview::read(RustStream &stream) {
4309+ return {
4310+ FfiConverterSequenceTypeSendMessage::read(stream),
4311+ FfiConverterUInt64::read(stream),
4312+ FfiConverterTypeBoc::read(stream),
4313+ FfiConverterTypeSendEmulation::read(stream)
4314+ };
4315+}
4316+
4317+void FfiConverterTypeSendPreview::write(RustStream &stream, const SendPreview &val) {
4318+ FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
4319+ FfiConverterUInt64::write(stream, val.valid_until);
4320+ FfiConverterTypeBoc::write(stream, val.message_boc_base64);
4321+ FfiConverterTypeSendEmulation::write(stream, val.emulation);
4322+}
4323+
4324+uint64_t FfiConverterTypeSendPreview::allocation_size(const SendPreview &val) {
4325+
4326+ return
4327+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages) +
4328+ FfiConverterUInt64::allocation_size(val.valid_until) +
4329+ FfiConverterTypeBoc::allocation_size(val.message_boc_base64) +
4330+ FfiConverterTypeSendEmulation::allocation_size(val.emulation);
4331+
4332+}
4333+
4334+
4335+SendPreviewRequest FfiConverterTypeSendPreviewRequest::lift(RustBuffer buf) {
4336+ auto stream = RustStream(&buf);
4337+ auto ret = FfiConverterTypeSendPreviewRequest::read(stream);
4338+
4339+ rustbuffer_free(buf);
4340+
4341+ return std::move(ret);
4342+}
4343+
4344+RustBuffer FfiConverterTypeSendPreviewRequest::lower(const SendPreviewRequest &val) {
4345+ auto buf = rustbuffer_alloc(allocation_size(val));
4346+ auto stream = RustStream(&buf);
4347+
4348+ FfiConverterTypeSendPreviewRequest::write(stream, val);
4349+
4350+ return std::move(buf);
4351+}
4352+
4353+SendPreviewRequest FfiConverterTypeSendPreviewRequest::read(RustStream &stream) {
4354+ return {
4355+ FfiConverterTypeSendIntent::read(stream)
4356+ };
4357+}
4358+
4359+void FfiConverterTypeSendPreviewRequest::write(RustStream &stream, const SendPreviewRequest &val) {
4360+ FfiConverterTypeSendIntent::write(stream, val.intent);
4361+}
4362+
4363+uint64_t FfiConverterTypeSendPreviewRequest::allocation_size(const SendPreviewRequest &val) {
4364+
4365+ return
4366+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4367+
4368+}
4369+
4370+
4371+SendRequest FfiConverterTypeSendRequest::lift(RustBuffer buf) {
4372+ auto stream = RustStream(&buf);
4373+ auto ret = FfiConverterTypeSendRequest::read(stream);
4374+
4375+ rustbuffer_free(buf);
4376+
4377+ return std::move(ret);
4378+}
4379+
4380+RustBuffer FfiConverterTypeSendRequest::lower(const SendRequest &val) {
4381+ auto buf = rustbuffer_alloc(allocation_size(val));
4382+ auto stream = RustStream(&buf);
4383+
4384+ FfiConverterTypeSendRequest::write(stream, val);
4385+
4386+ return std::move(buf);
4387+}
4388+
4389+SendRequest FfiConverterTypeSendRequest::read(RustStream &stream) {
4390+ return {
4391+ FfiConverterTypeNonEmptyString::read(stream),
4392+ FfiConverterBool::read(stream),
4393+ FfiConverterTypeSendIntent::read(stream)
4394+ };
4395+}
4396+
4397+void FfiConverterTypeSendRequest::write(RustStream &stream, const SendRequest &val) {
4398+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4399+ FfiConverterBool::write(stream, val.force);
4400+ FfiConverterTypeSendIntent::write(stream, val.intent);
4401+}
4402+
4403+uint64_t FfiConverterTypeSendRequest::allocation_size(const SendRequest &val) {
4404+
4405+ return
4406+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4407+ FfiConverterBool::allocation_size(val.force) +
4408+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4409+
4410+}
4411+
4412+
4413+SendResult FfiConverterTypeSendResult::lift(RustBuffer buf) {
4414+ auto stream = RustStream(&buf);
4415+ auto ret = FfiConverterTypeSendResult::read(stream);
4416+
4417+ rustbuffer_free(buf);
4418+
4419+ return std::move(ret);
4420+}
4421+
4422+RustBuffer FfiConverterTypeSendResult::lower(const SendResult &val) {
4423+ auto buf = rustbuffer_alloc(allocation_size(val));
4424+ auto stream = RustStream(&buf);
4425+
4426+ FfiConverterTypeSendResult::write(stream, val);
4427+
4428+ return std::move(buf);
4429+}
4430+
4431+SendResult FfiConverterTypeSendResult::read(RustStream &stream) {
4432+ return {
4433+ FfiConverterTypeNonEmptyString::read(stream),
4434+ FfiConverterTypeBase64Hash::read(stream),
4435+ FfiConverterTypeBoc::read(stream),
4436+ FfiConverterSendPhase::read(stream)
4437+ };
4438+}
4439+
4440+void FfiConverterTypeSendResult::write(RustStream &stream, const SendResult &val) {
4441+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4442+ FfiConverterTypeBase64Hash::write(stream, val.message_hash);
4443+ FfiConverterTypeBoc::write(stream, val.signed_boc);
4444+ FfiConverterSendPhase::write(stream, val.phase);
4445+}
4446+
4447+uint64_t FfiConverterTypeSendResult::allocation_size(const SendResult &val) {
4448+
4449+ return
4450+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4451+ FfiConverterTypeBase64Hash::allocation_size(val.message_hash) +
4452+ FfiConverterTypeBoc::allocation_size(val.signed_boc) +
4453+ FfiConverterSendPhase::allocation_size(val.phase);
4454+
4455+}
4456+
4457+
4458+SendSnapshot FfiConverterTypeSendSnapshot::lift(RustBuffer buf) {
4459+ auto stream = RustStream(&buf);
4460+ auto ret = FfiConverterTypeSendSnapshot::read(stream);
4461+
4462+ rustbuffer_free(buf);
4463+
4464+ return std::move(ret);
4465+}
4466+
4467+RustBuffer FfiConverterTypeSendSnapshot::lower(const SendSnapshot &val) {
4468+ auto buf = rustbuffer_alloc(allocation_size(val));
4469+ auto stream = RustStream(&buf);
4470+
4471+ FfiConverterTypeSendSnapshot::write(stream, val);
4472+
4473+ return std::move(buf);
4474+}
4475+
4476+SendSnapshot FfiConverterTypeSendSnapshot::read(RustStream &stream) {
4477+ return {
4478+ FfiConverterOptionalTypeNonEmptyString::read(stream),
4479+ FfiConverterSendPhase::read(stream),
4480+ FfiConverterOptionalString::read(stream),
4481+ FfiConverterOptionalTypeResolutionInfo::read(stream)
4482+ };
4483+}
4484+
4485+void FfiConverterTypeSendSnapshot::write(RustStream &stream, const SendSnapshot &val) {
4486+ FfiConverterOptionalTypeNonEmptyString::write(stream, val.operation_id);
4487+ FfiConverterSendPhase::write(stream, val.phase);
4488+ FfiConverterOptionalString::write(stream, val.error_message);
4489+ FfiConverterOptionalTypeResolutionInfo::write(stream, val.resolution);
4490+}
4491+
4492+uint64_t FfiConverterTypeSendSnapshot::allocation_size(const SendSnapshot &val) {
4493+
4494+ return
4495+ FfiConverterOptionalTypeNonEmptyString::allocation_size(val.operation_id) +
4496+ FfiConverterSendPhase::allocation_size(val.phase) +
4497+ FfiConverterOptionalString::allocation_size(val.error_message) +
4498+ FfiConverterOptionalTypeResolutionInfo::allocation_size(val.resolution);
4499+
4500+}
4501+
4502+
4503+SignMessagePreview FfiConverterTypeSignMessagePreview::lift(RustBuffer buf) {
4504+ auto stream = RustStream(&buf);
4505+ auto ret = FfiConverterTypeSignMessagePreview::read(stream);
4506+
4507+ rustbuffer_free(buf);
4508+
4509+ return std::move(ret);
4510+}
4511+
4512+RustBuffer FfiConverterTypeSignMessagePreview::lower(const SignMessagePreview &val) {
4513+ auto buf = rustbuffer_alloc(allocation_size(val));
4514+ auto stream = RustStream(&buf);
4515+
4516+ FfiConverterTypeSignMessagePreview::write(stream, val);
4517+
4518+ return std::move(buf);
4519+}
4520+
4521+SignMessagePreview FfiConverterTypeSignMessagePreview::read(RustStream &stream) {
4522+ return {
4523+ FfiConverterSequenceTypeSendMessage::read(stream),
4524+ FfiConverterUInt64::read(stream),
4525+ FfiConverterBool::read(stream)
4526+ };
4527+}
4528+
4529+void FfiConverterTypeSignMessagePreview::write(RustStream &stream, const SignMessagePreview &val) {
4530+ FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
4531+ FfiConverterUInt64::write(stream, val.valid_until);
4532+ FfiConverterBool::write(stream, val.needs_state_init);
4533+}
4534+
4535+uint64_t FfiConverterTypeSignMessagePreview::allocation_size(const SignMessagePreview &val) {
4536+
4537+ return
4538+ FfiConverterSequenceTypeSendMessage::allocation_size(val.messages) +
4539+ FfiConverterUInt64::allocation_size(val.valid_until) +
4540+ FfiConverterBool::allocation_size(val.needs_state_init);
4541+
4542+}
4543+
4544+
4545+SignMessageRequest FfiConverterTypeSignMessageRequest::lift(RustBuffer buf) {
4546+ auto stream = RustStream(&buf);
4547+ auto ret = FfiConverterTypeSignMessageRequest::read(stream);
4548+
4549+ rustbuffer_free(buf);
4550+
4551+ return std::move(ret);
4552+}
4553+
4554+RustBuffer FfiConverterTypeSignMessageRequest::lower(const SignMessageRequest &val) {
4555+ auto buf = rustbuffer_alloc(allocation_size(val));
4556+ auto stream = RustStream(&buf);
4557+
4558+ FfiConverterTypeSignMessageRequest::write(stream, val);
4559+
4560+ return std::move(buf);
4561+}
4562+
4563+SignMessageRequest FfiConverterTypeSignMessageRequest::read(RustStream &stream) {
4564+ return {
4565+ FfiConverterTypeNonEmptyString::read(stream),
4566+ FfiConverterBool::read(stream),
4567+ FfiConverterTypeSendIntent::read(stream)
4568+ };
4569+}
4570+
4571+void FfiConverterTypeSignMessageRequest::write(RustStream &stream, const SignMessageRequest &val) {
4572+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4573+ FfiConverterBool::write(stream, val.force);
4574+ FfiConverterTypeSendIntent::write(stream, val.intent);
4575+}
4576+
4577+uint64_t FfiConverterTypeSignMessageRequest::allocation_size(const SignMessageRequest &val) {
4578+
4579+ return
4580+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4581+ FfiConverterBool::allocation_size(val.force) +
4582+ FfiConverterTypeSendIntent::allocation_size(val.intent);
4583+
4584+}
4585+
4586+
4587+SignMessageResult FfiConverterTypeSignMessageResult::lift(RustBuffer buf) {
4588+ auto stream = RustStream(&buf);
4589+ auto ret = FfiConverterTypeSignMessageResult::read(stream);
4590+
4591+ rustbuffer_free(buf);
4592+
4593+ return std::move(ret);
4594+}
4595+
4596+RustBuffer FfiConverterTypeSignMessageResult::lower(const SignMessageResult &val) {
4597+ auto buf = rustbuffer_alloc(allocation_size(val));
4598+ auto stream = RustStream(&buf);
4599+
4600+ FfiConverterTypeSignMessageResult::write(stream, val);
4601+
4602+ return std::move(buf);
4603+}
4604+
4605+SignMessageResult FfiConverterTypeSignMessageResult::read(RustStream &stream) {
4606+ return {
4607+ FfiConverterTypeNonEmptyString::read(stream),
4608+ FfiConverterTypeBoc::read(stream),
4609+ FfiConverterUInt64::read(stream),
4610+ FfiConverterSendPhase::read(stream)
4611+ };
4612+}
4613+
4614+void FfiConverterTypeSignMessageResult::write(RustStream &stream, const SignMessageResult &val) {
4615+ FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
4616+ FfiConverterTypeBoc::write(stream, val.internal_boc);
4617+ FfiConverterUInt64::write(stream, val.valid_until);
4618+ FfiConverterSendPhase::write(stream, val.phase);
4619+}
4620+
4621+uint64_t FfiConverterTypeSignMessageResult::allocation_size(const SignMessageResult &val) {
4622+
4623+ return
4624+ FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
4625+ FfiConverterTypeBoc::allocation_size(val.internal_boc) +
4626+ FfiConverterUInt64::allocation_size(val.valid_until) +
4627+ FfiConverterSendPhase::allocation_size(val.phase);
4628+
4629+}
4630+
4631+
4632+TonAddressInfo FfiConverterTypeTonAddressInfo::lift(RustBuffer buf) {
4633+ auto stream = RustStream(&buf);
4634+ auto ret = FfiConverterTypeTonAddressInfo::read(stream);
4635+
4636+ rustbuffer_free(buf);
4637+
4638+ return std::move(ret);
4639+}
4640+
4641+RustBuffer FfiConverterTypeTonAddressInfo::lower(const TonAddressInfo &val) {
4642+ auto buf = rustbuffer_alloc(allocation_size(val));
4643+ auto stream = RustStream(&buf);
4644+
4645+ FfiConverterTypeTonAddressInfo::write(stream, val);
4646+
4647+ return std::move(buf);
4648+}
4649+
4650+TonAddressInfo FfiConverterTypeTonAddressInfo::read(RustStream &stream) {
4651+ return {
4652+ FfiConverterString::read(stream),
4653+ FfiConverterInt32::read(stream),
4654+ FfiConverterTonAddressFormat::read(stream)
4655+ };
4656+}
4657+
4658+void FfiConverterTypeTonAddressInfo::write(RustStream &stream, const TonAddressInfo &val) {
4659+ FfiConverterString::write(stream, val.raw);
4660+ FfiConverterInt32::write(stream, val.workchain);
4661+ FfiConverterTonAddressFormat::write(stream, val.format);
4662+}
4663+
4664+uint64_t FfiConverterTypeTonAddressInfo::allocation_size(const TonAddressInfo &val) {
4665+
4666+ return
4667+ FfiConverterString::allocation_size(val.raw) +
4668+ FfiConverterInt32::allocation_size(val.workchain) +
4669+ FfiConverterTonAddressFormat::allocation_size(val.format);
4670+
4671+}
4672+
4673+
4674+TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::lift(RustBuffer buf) {
4675+ auto stream = RustStream(&buf);
4676+ auto ret = FfiConverterTypeTonConnectAccountInfo::read(stream);
4677+
4678+ rustbuffer_free(buf);
4679+
4680+ return std::move(ret);
4681+}
4682+
4683+RustBuffer FfiConverterTypeTonConnectAccountInfo::lower(const TonConnectAccountInfo &val) {
4684+ auto buf = rustbuffer_alloc(allocation_size(val));
4685+ auto stream = RustStream(&buf);
4686+
4687+ FfiConverterTypeTonConnectAccountInfo::write(stream, val);
4688+
4689+ return std::move(buf);
4690+}
4691+
4692+TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::read(RustStream &stream) {
4693+ return {
4694+ FfiConverterString::read(stream),
4695+ FfiConverterString::read(stream),
4696+ FfiConverterString::read(stream),
4697+ FfiConverterBytes::read(stream)
4698+ };
4699+}
4700+
4701+void FfiConverterTypeTonConnectAccountInfo::write(RustStream &stream, const TonConnectAccountInfo &val) {
4702+ FfiConverterString::write(stream, val.address);
4703+ FfiConverterString::write(stream, val.network);
4704+ FfiConverterString::write(stream, val.wallet_state_init);
4705+ FfiConverterBytes::write(stream, val.public_key);
4706+}
4707+
4708+uint64_t FfiConverterTypeTonConnectAccountInfo::allocation_size(const TonConnectAccountInfo &val) {
4709+
4710+ return
4711+ FfiConverterString::allocation_size(val.address) +
4712+ FfiConverterString::allocation_size(val.network) +
4713+ FfiConverterString::allocation_size(val.wallet_state_init) +
4714+ FfiConverterBytes::allocation_size(val.public_key);
4715+
4716+}
4717+
4718+
4719+TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
4720+ auto stream = RustStream(&buf);
4721+ auto ret = FfiConverterTypeTonConnectConnectPrompt::read(stream);
4722+
4723+ rustbuffer_free(buf);
4724+
4725+ return std::move(ret);
4726+}
4727+
4728+RustBuffer FfiConverterTypeTonConnectConnectPrompt::lower(const TonConnectConnectPrompt &val) {
4729+ auto buf = rustbuffer_alloc(allocation_size(val));
4730+ auto stream = RustStream(&buf);
4731+
4732+ FfiConverterTypeTonConnectConnectPrompt::write(stream, val);
4733+
4734+ return std::move(buf);
4735+}
4736+
4737+TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::read(RustStream &stream) {
4738+ return {
4739+ FfiConverterString::read(stream),
4740+ FfiConverterOptionalString::read(stream),
4741+ FfiConverterOptionalString::read(stream)
4742+ };
4743+}
4744+
4745+void FfiConverterTypeTonConnectConnectPrompt::write(RustStream &stream, const TonConnectConnectPrompt &val) {
4746+ FfiConverterString::write(stream, val.manifest_url);
4747+ FfiConverterOptionalString::write(stream, val.requested_network);
4748+ FfiConverterOptionalString::write(stream, val.proof_payload);
4749+}
4750+
4751+uint64_t FfiConverterTypeTonConnectConnectPrompt::allocation_size(const TonConnectConnectPrompt &val) {
4752+
4753+ return
4754+ FfiConverterString::allocation_size(val.manifest_url) +
4755+ FfiConverterOptionalString::allocation_size(val.requested_network) +
4756+ FfiConverterOptionalString::allocation_size(val.proof_payload);
4757+
4758+}
4759+
4760+
4761+TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::lift(RustBuffer buf) {
4762+ auto stream = RustStream(&buf);
4763+ auto ret = FfiConverterTypeTonConnectDerivedRequest::read(stream);
4764+
4765+ rustbuffer_free(buf);
4766+
4767+ return std::move(ret);
4768+}
4769+
4770+RustBuffer FfiConverterTypeTonConnectDerivedRequest::lower(const TonConnectDerivedRequest &val) {
4771+ auto buf = rustbuffer_alloc(allocation_size(val));
4772+ auto stream = RustStream(&buf);
4773+
4774+ FfiConverterTypeTonConnectDerivedRequest::write(stream, val);
4775+
4776+ return std::move(buf);
4777+}
4778+
4779+TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::read(RustStream &stream) {
4780+ return {
4781+ FfiConverterTonConnectIncomingRequest::read(stream),
4782+ FfiConverterOptionalInt64::read(stream)
4783+ };
4784+}
4785+
4786+void FfiConverterTypeTonConnectDerivedRequest::write(RustStream &stream, const TonConnectDerivedRequest &val) {
4787+ FfiConverterTonConnectIncomingRequest::write(stream, val.request);
4788+ FfiConverterOptionalInt64::write(stream, val.request_id);
4789+}
4790+
4791+uint64_t FfiConverterTypeTonConnectDerivedRequest::allocation_size(const TonConnectDerivedRequest &val) {
4792+
4793+ return
4794+ FfiConverterTonConnectIncomingRequest::allocation_size(val.request) +
4795+ FfiConverterOptionalInt64::allocation_size(val.request_id);
4796+
4797+}
4798+
4799+
4800+TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::lift(RustBuffer buf) {
4801+ auto stream = RustStream(&buf);
4802+ auto ret = FfiConverterTypeTonConnectDerivedSessionRequest::read(stream);
4803+
4804+ rustbuffer_free(buf);
4805+
4806+ return std::move(ret);
4807+}
4808+
4809+RustBuffer FfiConverterTypeTonConnectDerivedSessionRequest::lower(const TonConnectDerivedSessionRequest &val) {
4810+ auto buf = rustbuffer_alloc(allocation_size(val));
4811+ auto stream = RustStream(&buf);
4812+
4813+ FfiConverterTypeTonConnectDerivedSessionRequest::write(stream, val);
4814+
4815+ return std::move(buf);
4816+}
4817+
4818+TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::read(RustStream &stream) {
4819+ return {
4820+ FfiConverterTypeWalletDescriptor::read(stream),
4821+ FfiConverterString::read(stream),
4822+ FfiConverterBytes::read(stream)
4823+ };
4824+}
4825+
4826+void FfiConverterTypeTonConnectDerivedSessionRequest::write(RustStream &stream, const TonConnectDerivedSessionRequest &val) {
4827+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
4828+ FfiConverterString::write(stream, val.dapp_client_id);
4829+ FfiConverterBytes::write(stream, val.nonce);
4830+}
4831+
4832+uint64_t FfiConverterTypeTonConnectDerivedSessionRequest::allocation_size(const TonConnectDerivedSessionRequest &val) {
4833+
4834+ return
4835+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
4836+ FfiConverterString::allocation_size(val.dapp_client_id) +
4837+ FfiConverterBytes::allocation_size(val.nonce);
4838+
4839+}
4840+
4841+
4842+TonConnectDevice FfiConverterTypeTonConnectDevice::lift(RustBuffer buf) {
4843+ auto stream = RustStream(&buf);
4844+ auto ret = FfiConverterTypeTonConnectDevice::read(stream);
4845+
4846+ rustbuffer_free(buf);
4847+
4848+ return std::move(ret);
4849+}
4850+
4851+RustBuffer FfiConverterTypeTonConnectDevice::lower(const TonConnectDevice &val) {
4852+ auto buf = rustbuffer_alloc(allocation_size(val));
4853+ auto stream = RustStream(&buf);
4854+
4855+ FfiConverterTypeTonConnectDevice::write(stream, val);
4856+
4857+ return std::move(buf);
4858+}
4859+
4860+TonConnectDevice FfiConverterTypeTonConnectDevice::read(RustStream &stream) {
4861+ return {
4862+ FfiConverterTonConnectDevicePlatform::read(stream),
4863+ FfiConverterString::read(stream),
4864+ FfiConverterString::read(stream)
4865+ };
4866+}
4867+
4868+void FfiConverterTypeTonConnectDevice::write(RustStream &stream, const TonConnectDevice &val) {
4869+ FfiConverterTonConnectDevicePlatform::write(stream, val.platform);
4870+ FfiConverterString::write(stream, val.app_name);
4871+ FfiConverterString::write(stream, val.app_version);
4872+}
4873+
4874+uint64_t FfiConverterTypeTonConnectDevice::allocation_size(const TonConnectDevice &val) {
4875+
4876+ return
4877+ FfiConverterTonConnectDevicePlatform::allocation_size(val.platform) +
4878+ FfiConverterString::allocation_size(val.app_name) +
4879+ FfiConverterString::allocation_size(val.app_version);
4880+
4881+}
4882+
4883+
4884+TonConnectManifest FfiConverterTypeTonConnectManifest::lift(RustBuffer buf) {
4885+ auto stream = RustStream(&buf);
4886+ auto ret = FfiConverterTypeTonConnectManifest::read(stream);
4887+
4888+ rustbuffer_free(buf);
4889+
4890+ return std::move(ret);
4891+}
4892+
4893+RustBuffer FfiConverterTypeTonConnectManifest::lower(const TonConnectManifest &val) {
4894+ auto buf = rustbuffer_alloc(allocation_size(val));
4895+ auto stream = RustStream(&buf);
4896+
4897+ FfiConverterTypeTonConnectManifest::write(stream, val);
4898+
4899+ return std::move(buf);
4900+}
4901+
4902+TonConnectManifest FfiConverterTypeTonConnectManifest::read(RustStream &stream) {
4903+ return {
4904+ FfiConverterString::read(stream),
4905+ FfiConverterString::read(stream),
4906+ FfiConverterString::read(stream),
4907+ FfiConverterString::read(stream)
4908+ };
4909+}
4910+
4911+void FfiConverterTypeTonConnectManifest::write(RustStream &stream, const TonConnectManifest &val) {
4912+ FfiConverterString::write(stream, val.url);
4913+ FfiConverterString::write(stream, val.name);
4914+ FfiConverterString::write(stream, val.icon_url);
4915+ FfiConverterString::write(stream, val.domain);
4916+}
4917+
4918+uint64_t FfiConverterTypeTonConnectManifest::allocation_size(const TonConnectManifest &val) {
4919+
4920+ return
4921+ FfiConverterString::allocation_size(val.url) +
4922+ FfiConverterString::allocation_size(val.name) +
4923+ FfiConverterString::allocation_size(val.icon_url) +
4924+ FfiConverterString::allocation_size(val.domain);
4925+
4926+}
4927+
4928+
4929+TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::lift(RustBuffer buf) {
4930+ auto stream = RustStream(&buf);
4931+ auto ret = FfiConverterTypeTonConnectPreparedPost::read(stream);
4932+
4933+ rustbuffer_free(buf);
4934+
4935+ return std::move(ret);
4936+}
4937+
4938+RustBuffer FfiConverterTypeTonConnectPreparedPost::lower(const TonConnectPreparedPost &val) {
4939+ auto buf = rustbuffer_alloc(allocation_size(val));
4940+ auto stream = RustStream(&buf);
4941+
4942+ FfiConverterTypeTonConnectPreparedPost::write(stream, val);
4943+
4944+ return std::move(buf);
4945+}
4946+
4947+TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::read(RustStream &stream) {
4948+ return {
4949+ FfiConverterString::read(stream),
4950+ FfiConverterString::read(stream)
4951+ };
4952+}
4953+
4954+void FfiConverterTypeTonConnectPreparedPost::write(RustStream &stream, const TonConnectPreparedPost &val) {
4955+ FfiConverterString::write(stream, val.url);
4956+ FfiConverterString::write(stream, val.body);
4957+}
4958+
4959+uint64_t FfiConverterTypeTonConnectPreparedPost::allocation_size(const TonConnectPreparedPost &val) {
4960+
4961+ return
4962+ FfiConverterString::allocation_size(val.url) +
4963+ FfiConverterString::allocation_size(val.body);
4964+
4965+}
4966+
4967+
4968+TonConnectProofReply FfiConverterTypeTonConnectProofReply::lift(RustBuffer buf) {
4969+ auto stream = RustStream(&buf);
4970+ auto ret = FfiConverterTypeTonConnectProofReply::read(stream);
4971+
4972+ rustbuffer_free(buf);
4973+
4974+ return std::move(ret);
4975+}
4976+
4977+RustBuffer FfiConverterTypeTonConnectProofReply::lower(const TonConnectProofReply &val) {
4978+ auto buf = rustbuffer_alloc(allocation_size(val));
4979+ auto stream = RustStream(&buf);
4980+
4981+ FfiConverterTypeTonConnectProofReply::write(stream, val);
4982+
4983+ return std::move(buf);
4984+}
4985+
4986+TonConnectProofReply FfiConverterTypeTonConnectProofReply::read(RustStream &stream) {
4987+ return {
4988+ FfiConverterUInt64::read(stream),
4989+ FfiConverterString::read(stream),
4990+ FfiConverterString::read(stream),
4991+ FfiConverterBytes::read(stream)
4992+ };
4993+}
4994+
4995+void FfiConverterTypeTonConnectProofReply::write(RustStream &stream, const TonConnectProofReply &val) {
4996+ FfiConverterUInt64::write(stream, val.timestamp);
4997+ FfiConverterString::write(stream, val.domain);
4998+ FfiConverterString::write(stream, val.payload);
4999+ FfiConverterBytes::write(stream, val.signature);
5000+}
5001+
5002+uint64_t FfiConverterTypeTonConnectProofReply::allocation_size(const TonConnectProofReply &val) {
5003+
5004+ return
5005+ FfiConverterUInt64::allocation_size(val.timestamp) +
5006+ FfiConverterString::allocation_size(val.domain) +
5007+ FfiConverterString::allocation_size(val.payload) +
5008+ FfiConverterBytes::allocation_size(val.signature);
5009+
5010+}
5011+
5012+
5013+TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::lift(RustBuffer buf) {
5014+ auto stream = RustStream(&buf);
5015+ auto ret = FfiConverterTypeTonConnectProofSignRequest::read(stream);
5016+
5017+ rustbuffer_free(buf);
5018+
5019+ return std::move(ret);
5020+}
5021+
5022+RustBuffer FfiConverterTypeTonConnectProofSignRequest::lower(const TonConnectProofSignRequest &val) {
5023+ auto buf = rustbuffer_alloc(allocation_size(val));
5024+ auto stream = RustStream(&buf);
5025+
5026+ FfiConverterTypeTonConnectProofSignRequest::write(stream, val);
5027+
5028+ return std::move(buf);
5029+}
5030+
5031+TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::read(RustStream &stream) {
5032+ return {
5033+ FfiConverterTypeWalletDescriptor::read(stream),
5034+ FfiConverterString::read(stream),
5035+ FfiConverterUInt64::read(stream),
5036+ FfiConverterString::read(stream)
5037+ };
5038+}
5039+
5040+void FfiConverterTypeTonConnectProofSignRequest::write(RustStream &stream, const TonConnectProofSignRequest &val) {
5041+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
5042+ FfiConverterString::write(stream, val.domain);
5043+ FfiConverterUInt64::write(stream, val.timestamp);
5044+ FfiConverterString::write(stream, val.payload);
5045+}
5046+
5047+uint64_t FfiConverterTypeTonConnectProofSignRequest::allocation_size(const TonConnectProofSignRequest &val) {
5048+
5049+ return
5050+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
5051+ FfiConverterString::allocation_size(val.domain) +
5052+ FfiConverterUInt64::allocation_size(val.timestamp) +
5053+ FfiConverterString::allocation_size(val.payload);
5054+
5055+}
5056+
5057+
5058+TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::lift(RustBuffer buf) {
5059+ auto stream = RustStream(&buf);
5060+ auto ret = FfiConverterTypeTonConnectProofSignature::read(stream);
5061+
5062+ rustbuffer_free(buf);
5063+
5064+ return std::move(ret);
5065+}
5066+
5067+RustBuffer FfiConverterTypeTonConnectProofSignature::lower(const TonConnectProofSignature &val) {
5068+ auto buf = rustbuffer_alloc(allocation_size(val));
5069+ auto stream = RustStream(&buf);
5070+
5071+ FfiConverterTypeTonConnectProofSignature::write(stream, val);
5072+
5073+ return std::move(buf);
5074+}
5075+
5076+TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::read(RustStream &stream) {
5077+ return {
5078+ FfiConverterBytes::read(stream),
5079+ FfiConverterBytes::read(stream)
5080+ };
5081+}
5082+
5083+void FfiConverterTypeTonConnectProofSignature::write(RustStream &stream, const TonConnectProofSignature &val) {
5084+ FfiConverterBytes::write(stream, val.signature);
5085+ FfiConverterBytes::write(stream, val.public_key);
5086+}
5087+
5088+uint64_t FfiConverterTypeTonConnectProofSignature::allocation_size(const TonConnectProofSignature &val) {
5089+
5090+ return
5091+ FfiConverterBytes::allocation_size(val.signature) +
5092+ FfiConverterBytes::allocation_size(val.public_key);
5093+
5094+}
5095+
5096+
5097+TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::lift(RustBuffer buf) {
5098+ auto stream = RustStream(&buf);
5099+ auto ret = FfiConverterTypeTonConnectSessionConfig::read(stream);
5100+
5101+ rustbuffer_free(buf);
5102+
5103+ return std::move(ret);
5104+}
5105+
5106+RustBuffer FfiConverterTypeTonConnectSessionConfig::lower(const TonConnectSessionConfig &val) {
5107+ auto buf = rustbuffer_alloc(allocation_size(val));
5108+ auto stream = RustStream(&buf);
5109+
5110+ FfiConverterTypeTonConnectSessionConfig::write(stream, val);
5111+
5112+ return std::move(buf);
5113+}
5114+
5115+TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::read(RustStream &stream) {
5116+ return {
5117+ FfiConverterString::read(stream),
5118+ FfiConverterUInt64::read(stream),
5119+ FfiConverterUInt32::read(stream)
5120+ };
5121+}
5122+
5123+void FfiConverterTypeTonConnectSessionConfig::write(RustStream &stream, const TonConnectSessionConfig &val) {
5124+ FfiConverterString::write(stream, val.bridge_url);
5125+ FfiConverterUInt64::write(stream, val.max_event_bytes);
5126+ FfiConverterUInt32::write(stream, val.message_ttl_seconds);
5127+}
5128+
5129+uint64_t FfiConverterTypeTonConnectSessionConfig::allocation_size(const TonConnectSessionConfig &val) {
5130+
5131+ return
5132+ FfiConverterString::allocation_size(val.bridge_url) +
5133+ FfiConverterUInt64::allocation_size(val.max_event_bytes) +
5134+ FfiConverterUInt32::allocation_size(val.message_ttl_seconds);
5135+
5136+}
5137+
5138+
5139+TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::lift(RustBuffer buf) {
5140+ auto stream = RustStream(&buf);
5141+ auto ret = FfiConverterTypeTonConnectSignDataRequest::read(stream);
5142+
5143+ rustbuffer_free(buf);
5144+
5145+ return std::move(ret);
5146+}
5147+
5148+RustBuffer FfiConverterTypeTonConnectSignDataRequest::lower(const TonConnectSignDataRequest &val) {
5149+ auto buf = rustbuffer_alloc(allocation_size(val));
5150+ auto stream = RustStream(&buf);
5151+
5152+ FfiConverterTypeTonConnectSignDataRequest::write(stream, val);
5153+
5154+ return std::move(buf);
5155+}
5156+
5157+TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::read(RustStream &stream) {
5158+ return {
5159+ FfiConverterTonConnectSignDataPayload::read(stream),
5160+ FfiConverterOptionalString::read(stream),
5161+ FfiConverterOptionalString::read(stream)
5162+ };
5163+}
5164+
5165+void FfiConverterTypeTonConnectSignDataRequest::write(RustStream &stream, const TonConnectSignDataRequest &val) {
5166+ FfiConverterTonConnectSignDataPayload::write(stream, val.payload);
5167+ FfiConverterOptionalString::write(stream, val.network);
5168+ FfiConverterOptionalString::write(stream, val.from);
5169+}
5170+
5171+uint64_t FfiConverterTypeTonConnectSignDataRequest::allocation_size(const TonConnectSignDataRequest &val) {
5172+
5173+ return
5174+ FfiConverterTonConnectSignDataPayload::allocation_size(val.payload) +
5175+ FfiConverterOptionalString::allocation_size(val.network) +
5176+ FfiConverterOptionalString::allocation_size(val.from);
5177+
5178+}
5179+
5180+
5181+TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::lift(RustBuffer buf) {
5182+ auto stream = RustStream(&buf);
5183+ auto ret = FfiConverterTypeTonConnectSignDataSignRequest::read(stream);
5184+
5185+ rustbuffer_free(buf);
5186+
5187+ return std::move(ret);
5188+}
5189+
5190+RustBuffer FfiConverterTypeTonConnectSignDataSignRequest::lower(const TonConnectSignDataSignRequest &val) {
5191+ auto buf = rustbuffer_alloc(allocation_size(val));
5192+ auto stream = RustStream(&buf);
5193+
5194+ FfiConverterTypeTonConnectSignDataSignRequest::write(stream, val);
5195+
5196+ return std::move(buf);
5197+}
5198+
5199+TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::read(RustStream &stream) {
5200+ return {
5201+ FfiConverterTypeWalletDescriptor::read(stream),
5202+ FfiConverterTypeTonConnectSignDataRequest::read(stream),
5203+ FfiConverterString::read(stream),
5204+ FfiConverterUInt64::read(stream)
5205+ };
5206+}
5207+
5208+void FfiConverterTypeTonConnectSignDataSignRequest::write(RustStream &stream, const TonConnectSignDataSignRequest &val) {
5209+ FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
5210+ FfiConverterTypeTonConnectSignDataRequest::write(stream, val.request);
5211+ FfiConverterString::write(stream, val.domain);
5212+ FfiConverterUInt64::write(stream, val.timestamp);
5213+}
5214+
5215+uint64_t FfiConverterTypeTonConnectSignDataSignRequest::allocation_size(const TonConnectSignDataSignRequest &val) {
5216+
5217+ return
5218+ FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
5219+ FfiConverterTypeTonConnectSignDataRequest::allocation_size(val.request) +
5220+ FfiConverterString::allocation_size(val.domain) +
5221+ FfiConverterUInt64::allocation_size(val.timestamp);
5222+
5223+}
5224+
5225+
5226+TonConnectSignedData FfiConverterTypeTonConnectSignedData::lift(RustBuffer buf) {
5227+ auto stream = RustStream(&buf);
5228+ auto ret = FfiConverterTypeTonConnectSignedData::read(stream);
5229+
5230+ rustbuffer_free(buf);
5231+
5232+ return std::move(ret);
5233+}
5234+
5235+RustBuffer FfiConverterTypeTonConnectSignedData::lower(const TonConnectSignedData &val) {
5236+ auto buf = rustbuffer_alloc(allocation_size(val));
5237+ auto stream = RustStream(&buf);
5238+
5239+ FfiConverterTypeTonConnectSignedData::write(stream, val);
5240+
5241+ return std::move(buf);
5242+}
5243+
5244+TonConnectSignedData FfiConverterTypeTonConnectSignedData::read(RustStream &stream) {
5245+ return {
5246+ FfiConverterTypeTonConnectSignDataRequest::read(stream),
5247+ FfiConverterString::read(stream),
5248+ FfiConverterUInt64::read(stream),
5249+ FfiConverterBytes::read(stream),
5250+ FfiConverterBytes::read(stream)
5251+ };
5252+}
5253+
5254+void FfiConverterTypeTonConnectSignedData::write(RustStream &stream, const TonConnectSignedData &val) {
5255+ FfiConverterTypeTonConnectSignDataRequest::write(stream, val.request);
5256+ FfiConverterString::write(stream, val.domain);
5257+ FfiConverterUInt64::write(stream, val.timestamp);
5258+ FfiConverterBytes::write(stream, val.signature);
5259+ FfiConverterBytes::write(stream, val.public_key);
5260+}
5261+
5262+uint64_t FfiConverterTypeTonConnectSignedData::allocation_size(const TonConnectSignedData &val) {
5263+
5264+ return
5265+ FfiConverterTypeTonConnectSignDataRequest::allocation_size(val.request) +
5266+ FfiConverterString::allocation_size(val.domain) +
5267+ FfiConverterUInt64::allocation_size(val.timestamp) +
5268+ FfiConverterBytes::allocation_size(val.signature) +
5269+ FfiConverterBytes::allocation_size(val.public_key);
5270+
5271+}
5272+
5273+
5274+WalletClientConfig FfiConverterTypeWalletClientConfig::lift(RustBuffer buf) {
5275+ auto stream = RustStream(&buf);
5276+ auto ret = FfiConverterTypeWalletClientConfig::read(stream);
5277+
5278+ rustbuffer_free(buf);
5279+
5280+ return std::move(ret);
5281+}
5282+
5283+RustBuffer FfiConverterTypeWalletClientConfig::lower(const WalletClientConfig &val) {
5284+ auto buf = rustbuffer_alloc(allocation_size(val));
5285+ auto stream = RustStream(&buf);
5286+
5287+ FfiConverterTypeWalletClientConfig::write(stream, val);
5288+
5289+ return std::move(buf);
5290+}
5291+
5292+WalletClientConfig FfiConverterTypeWalletClientConfig::read(RustStream &stream) {
5293+ return {
5294+ FfiConverterTypeNonEmptyString::read(stream),
5295+ FfiConverterTypeTonAddressString::read(stream),
5296+ FfiConverterBytes::read(stream),
5297+ FfiConverterOptionalTypeProtectedSecretRef::read(stream),
5298+ FfiConverterNetwork::read(stream),
5299+ FfiConverterUInt64::read(stream),
5300+ FfiConverterUInt64::read(stream),
5301+ FfiConverterTypeProviderConfig::read(stream)
5302+ };
5303+}
5304+
5305+void FfiConverterTypeWalletClientConfig::write(RustStream &stream, const WalletClientConfig &val) {
5306+ FfiConverterTypeNonEmptyString::write(stream, val.record_id);
5307+ FfiConverterTypeTonAddressString::write(stream, val.address);
5308+ FfiConverterBytes::write(stream, val.public_key);
5309+ FfiConverterOptionalTypeProtectedSecretRef::write(stream, val.local_secret_ref);
5310+ FfiConverterNetwork::write(stream, val.network);
5311+ FfiConverterUInt64::write(stream, val.send_validity_seconds);
5312+ FfiConverterUInt64::write(stream, val.resolution_margin_seconds);
5313+ FfiConverterTypeProviderConfig::write(stream, val.providers);
5314+}
5315+
5316+uint64_t FfiConverterTypeWalletClientConfig::allocation_size(const WalletClientConfig &val) {
5317+
5318+ return
5319+ FfiConverterTypeNonEmptyString::allocation_size(val.record_id) +
5320+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
5321+ FfiConverterBytes::allocation_size(val.public_key) +
5322+ FfiConverterOptionalTypeProtectedSecretRef::allocation_size(val.local_secret_ref) +
5323+ FfiConverterNetwork::allocation_size(val.network) +
5324+ FfiConverterUInt64::allocation_size(val.send_validity_seconds) +
5325+ FfiConverterUInt64::allocation_size(val.resolution_margin_seconds) +
5326+ FfiConverterTypeProviderConfig::allocation_size(val.providers);
5327+
5328+}
5329+
5330+
5331+WalletDescriptor FfiConverterTypeWalletDescriptor::lift(RustBuffer buf) {
5332+ auto stream = RustStream(&buf);
5333+ auto ret = FfiConverterTypeWalletDescriptor::read(stream);
5334+
5335+ rustbuffer_free(buf);
5336+
5337+ return std::move(ret);
5338+}
5339+
5340+RustBuffer FfiConverterTypeWalletDescriptor::lower(const WalletDescriptor &val) {
5341+ auto buf = rustbuffer_alloc(allocation_size(val));
5342+ auto stream = RustStream(&buf);
5343+
5344+ FfiConverterTypeWalletDescriptor::write(stream, val);
5345+
5346+ return std::move(buf);
5347+}
5348+
5349+WalletDescriptor FfiConverterTypeWalletDescriptor::read(RustStream &stream) {
5350+ return {
5351+ FfiConverterString::read(stream),
5352+ FfiConverterTypeTonAddressString::read(stream),
5353+ FfiConverterBytes::read(stream),
5354+ FfiConverterNetwork::read(stream),
5355+ FfiConverterTypeProtectedSecretRef::read(stream)
5356+ };
5357+}
5358+
5359+void FfiConverterTypeWalletDescriptor::write(RustStream &stream, const WalletDescriptor &val) {
5360+ FfiConverterString::write(stream, val.record_id);
5361+ FfiConverterTypeTonAddressString::write(stream, val.address);
5362+ FfiConverterBytes::write(stream, val.public_key);
5363+ FfiConverterNetwork::write(stream, val.network);
5364+ FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
5365+}
5366+
5367+uint64_t FfiConverterTypeWalletDescriptor::allocation_size(const WalletDescriptor &val) {
5368+
5369+ return
5370+ FfiConverterString::allocation_size(val.record_id) +
5371+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
5372+ FfiConverterBytes::allocation_size(val.public_key) +
5373+ FfiConverterNetwork::allocation_size(val.network) +
5374+ FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref);
5375+
5376+}
5377+
5378+
5379+WalletSnapshot FfiConverterTypeWalletSnapshot::lift(RustBuffer buf) {
5380+ auto stream = RustStream(&buf);
5381+ auto ret = FfiConverterTypeWalletSnapshot::read(stream);
5382+
5383+ rustbuffer_free(buf);
5384+
5385+ return std::move(ret);
5386+}
5387+
5388+RustBuffer FfiConverterTypeWalletSnapshot::lower(const WalletSnapshot &val) {
5389+ auto buf = rustbuffer_alloc(allocation_size(val));
5390+ auto stream = RustStream(&buf);
5391+
5392+ FfiConverterTypeWalletSnapshot::write(stream, val);
5393+
5394+ return std::move(buf);
5395+}
5396+
5397+WalletSnapshot FfiConverterTypeWalletSnapshot::read(RustStream &stream) {
5398+ return {
5399+ FfiConverterUInt64::read(stream),
5400+ FfiConverterTypeNonEmptyString::read(stream),
5401+ FfiConverterTypeTonAddressString::read(stream),
5402+ FfiConverterNetwork::read(stream),
5403+ FfiConverterOptionalTypeAccountSnapshot::read(stream),
5404+ FfiConverterTypeResourceState::read(stream),
5405+ FfiConverterTypeActivityList::read(stream),
5406+ FfiConverterOptionalTypeActivityCursor::read(stream),
5407+ FfiConverterTypeNftList::read(stream),
5408+ FfiConverterTypeSendSnapshot::read(stream)
5409+ };
5410+}
5411+
5412+void FfiConverterTypeWalletSnapshot::write(RustStream &stream, const WalletSnapshot &val) {
5413+ FfiConverterUInt64::write(stream, val.revision);
5414+ FfiConverterTypeNonEmptyString::write(stream, val.record_id);
5415+ FfiConverterTypeTonAddressString::write(stream, val.address);
5416+ FfiConverterNetwork::write(stream, val.network);
5417+ FfiConverterOptionalTypeAccountSnapshot::write(stream, val.account);
5418+ FfiConverterTypeResourceState::write(stream, val.account_resource);
5419+ FfiConverterTypeActivityList::write(stream, val.activity);
5420+ FfiConverterOptionalTypeActivityCursor::write(stream, val.activity_cursor);
5421+ FfiConverterTypeNftList::write(stream, val.nfts);
5422+ FfiConverterTypeSendSnapshot::write(stream, val.send);
5423+}
5424+
5425+uint64_t FfiConverterTypeWalletSnapshot::allocation_size(const WalletSnapshot &val) {
5426+
5427+ return
5428+ FfiConverterUInt64::allocation_size(val.revision) +
5429+ FfiConverterTypeNonEmptyString::allocation_size(val.record_id) +
5430+ FfiConverterTypeTonAddressString::allocation_size(val.address) +
5431+ FfiConverterNetwork::allocation_size(val.network) +
5432+ FfiConverterOptionalTypeAccountSnapshot::allocation_size(val.account) +
5433+ FfiConverterTypeResourceState::allocation_size(val.account_resource) +
5434+ FfiConverterTypeActivityList::allocation_size(val.activity) +
5435+ FfiConverterOptionalTypeActivityCursor::allocation_size(val.activity_cursor) +
5436+ FfiConverterTypeNftList::allocation_size(val.nfts) +
5437+ FfiConverterTypeSendSnapshot::allocation_size(val.send);
5438+
5439+}
5440+
5441+
5442+WalletUpdate FfiConverterTypeWalletUpdate::lift(RustBuffer buf) {
5443+ auto stream = RustStream(&buf);
5444+ auto ret = FfiConverterTypeWalletUpdate::read(stream);
5445+
5446+ rustbuffer_free(buf);
5447+
5448+ return std::move(ret);
5449+}
5450+
5451+RustBuffer FfiConverterTypeWalletUpdate::lower(const WalletUpdate &val) {
5452+ auto buf = rustbuffer_alloc(allocation_size(val));
5453+ auto stream = RustStream(&buf);
5454+
5455+ FfiConverterTypeWalletUpdate::write(stream, val);
5456+
5457+ return std::move(buf);
5458+}
5459+
5460+WalletUpdate FfiConverterTypeWalletUpdate::read(RustStream &stream) {
5461+ return {
5462+ FfiConverterWalletOperationOutcome::read(stream),
5463+ FfiConverterUInt64::read(stream),
5464+ FfiConverterUInt64::read(stream),
5465+ FfiConverterTypeWalletSnapshot::read(stream)
5466+ };
5467+}
5468+
5469+void FfiConverterTypeWalletUpdate::write(RustStream &stream, const WalletUpdate &val) {
5470+ FfiConverterWalletOperationOutcome::write(stream, val.outcome);
5471+ FfiConverterUInt64::write(stream, val.activity_items_added);
5472+ FfiConverterUInt64::write(stream, val.nft_items_added);
5473+ FfiConverterTypeWalletSnapshot::write(stream, val.snapshot);
5474+}
5475+
5476+uint64_t FfiConverterTypeWalletUpdate::allocation_size(const WalletUpdate &val) {
5477+
5478+ return
5479+ FfiConverterWalletOperationOutcome::allocation_size(val.outcome) +
5480+ FfiConverterUInt64::allocation_size(val.activity_items_added) +
5481+ FfiConverterUInt64::allocation_size(val.nft_items_added) +
5482+ FfiConverterTypeWalletSnapshot::allocation_size(val.snapshot);
5483+
5484+}
5485+
5486+
5487+AccountStatus FfiConverterAccountStatus::lift(RustBuffer buf) {
5488+ auto stream = RustStream(&buf);
5489+ auto ret = FfiConverterAccountStatus::read(stream);
5490+
5491+ rustbuffer_free(buf);
5492+
5493+ return std::move(ret);
5494+}
5495+
5496+RustBuffer FfiConverterAccountStatus::lower(const AccountStatus &val) {
5497+ auto buf = rustbuffer_alloc(FfiConverterAccountStatus::allocation_size(val));
5498+ auto stream = RustStream(&buf);
5499+
5500+ FfiConverterAccountStatus::write(stream, val);
5501+
5502+ return std::move(buf);
5503+}
5504+
5505+AccountStatus FfiConverterAccountStatus::read(RustStream &stream) {
5506+ int32_t variant;
5507+ stream >> variant;
5508+
5509+ switch (variant) {
5510+
5511+ case 1:
5512+ return AccountStatus::kNonexistent;
5513+
5514+ case 2:
5515+ return AccountStatus::kUninitialized;
5516+
5517+ case 3:
5518+ return AccountStatus::kActive;
5519+
5520+ case 4:
5521+ return AccountStatus::kFrozen;
5522+
5523+ case 5:
5524+ return AccountStatus::kUnknown;
5525+
5526+ default:
5527+ throw std::runtime_error("No matching AccountStatus variant");
5528+ }
5529+}
5530+
5531+void FfiConverterAccountStatus::write(RustStream &stream, const AccountStatus &val) {
5532+ switch (val) {
5533+
5534+ case AccountStatus::kNonexistent:
5535+ stream << static_cast<int32_t>(1);
5536+ break;
5537+
5538+ case AccountStatus::kUninitialized:
5539+ stream << static_cast<int32_t>(2);
5540+ break;
5541+
5542+ case AccountStatus::kActive:
5543+ stream << static_cast<int32_t>(3);
5544+ break;
5545+
5546+ case AccountStatus::kFrozen:
5547+ stream << static_cast<int32_t>(4);
5548+ break;
5549+
5550+ case AccountStatus::kUnknown:
5551+ stream << static_cast<int32_t>(5);
5552+ break;
5553+
5554+ default:
5555+ throw std::runtime_error("No matching AccountStatus variant");
5556+ }
5557+}
5558+
5559+uint64_t FfiConverterAccountStatus::allocation_size(const AccountStatus &) {
5560+ return static_cast<uint64_t>(sizeof(int32_t));
5561+}
5562+
5563+
5564+ActivityDirection FfiConverterActivityDirection::lift(RustBuffer buf) {
5565+ auto stream = RustStream(&buf);
5566+ auto ret = FfiConverterActivityDirection::read(stream);
5567+
5568+ rustbuffer_free(buf);
5569+
5570+ return std::move(ret);
5571+}
5572+
5573+RustBuffer FfiConverterActivityDirection::lower(const ActivityDirection &val) {
5574+ auto buf = rustbuffer_alloc(FfiConverterActivityDirection::allocation_size(val));
5575+ auto stream = RustStream(&buf);
5576+
5577+ FfiConverterActivityDirection::write(stream, val);
5578+
5579+ return std::move(buf);
5580+}
5581+
5582+ActivityDirection FfiConverterActivityDirection::read(RustStream &stream) {
5583+ int32_t variant;
5584+ stream >> variant;
5585+
5586+ switch (variant) {
5587+
5588+ case 1:
5589+ return ActivityDirection::kSent;
5590+
5591+ case 2:
5592+ return ActivityDirection::kReceived;
5593+
5594+ default:
5595+ throw std::runtime_error("No matching ActivityDirection variant");
5596+ }
5597+}
5598+
5599+void FfiConverterActivityDirection::write(RustStream &stream, const ActivityDirection &val) {
5600+ switch (val) {
5601+
5602+ case ActivityDirection::kSent:
5603+ stream << static_cast<int32_t>(1);
5604+ break;
5605+
5606+ case ActivityDirection::kReceived:
5607+ stream << static_cast<int32_t>(2);
5608+ break;
5609+
5610+ default:
5611+ throw std::runtime_error("No matching ActivityDirection variant");
5612+ }
5613+}
5614+
5615+uint64_t FfiConverterActivityDirection::allocation_size(const ActivityDirection &) {
5616+ return static_cast<uint64_t>(sizeof(int32_t));
5617+}
5618+
5619+
5620+ActivityStatus FfiConverterActivityStatus::lift(RustBuffer buf) {
5621+ auto stream = RustStream(&buf);
5622+ auto ret = FfiConverterActivityStatus::read(stream);
5623+
5624+ rustbuffer_free(buf);
5625+
5626+ return std::move(ret);
5627+}
5628+
5629+RustBuffer FfiConverterActivityStatus::lower(const ActivityStatus &val) {
5630+ auto buf = rustbuffer_alloc(FfiConverterActivityStatus::allocation_size(val));
5631+ auto stream = RustStream(&buf);
5632+
5633+ FfiConverterActivityStatus::write(stream, val);
5634+
5635+ return std::move(buf);
5636+}
5637+
5638+ActivityStatus FfiConverterActivityStatus::read(RustStream &stream) {
5639+ int32_t variant;
5640+ stream >> variant;
5641+
5642+ switch (variant) {
5643+
5644+ case 1:
5645+ return ActivityStatus::kSuccess;
5646+
5647+ case 2:
5648+ return ActivityStatus::kFailed;
5649+
5650+ case 3:
5651+ return ActivityStatus::kBounced;
5652+
5653+ default:
5654+ throw std::runtime_error("No matching ActivityStatus variant");
5655+ }
5656+}
5657+
5658+void FfiConverterActivityStatus::write(RustStream &stream, const ActivityStatus &val) {
5659+ switch (val) {
5660+
5661+ case ActivityStatus::kSuccess:
5662+ stream << static_cast<int32_t>(1);
5663+ break;
5664+
5665+ case ActivityStatus::kFailed:
5666+ stream << static_cast<int32_t>(2);
5667+ break;
5668+
5669+ case ActivityStatus::kBounced:
5670+ stream << static_cast<int32_t>(3);
5671+ break;
5672+
5673+ default:
5674+ throw std::runtime_error("No matching ActivityStatus variant");
5675+ }
5676+}
5677+
5678+uint64_t FfiConverterActivityStatus::allocation_size(const ActivityStatus &) {
5679+ return static_cast<uint64_t>(sizeof(int32_t));
5680+}
5681+
5682+
5683+ErrorCategory FfiConverterErrorCategory::lift(RustBuffer buf) {
5684+ auto stream = RustStream(&buf);
5685+ auto ret = FfiConverterErrorCategory::read(stream);
5686+
5687+ rustbuffer_free(buf);
5688+
5689+ return std::move(ret);
5690+}
5691+
5692+RustBuffer FfiConverterErrorCategory::lower(const ErrorCategory &val) {
5693+ auto buf = rustbuffer_alloc(FfiConverterErrorCategory::allocation_size(val));
5694+ auto stream = RustStream(&buf);
5695+
5696+ FfiConverterErrorCategory::write(stream, val);
5697+
5698+ return std::move(buf);
5699+}
5700+
5701+ErrorCategory FfiConverterErrorCategory::read(RustStream &stream) {
5702+ int32_t variant;
5703+ stream >> variant;
5704+
5705+ switch (variant) {
5706+
5707+ case 1:
5708+ return ErrorCategory::kTransport;
5709+
5710+ case 2:
5711+ return ErrorCategory::kProviderProtocol;
5712+
5713+ case 3:
5714+ return ErrorCategory::kRateLimit;
5715+
5716+ case 4:
5717+ return ErrorCategory::kCancellation;
5718+
5719+ case 5:
5720+ return ErrorCategory::kHostPolicy;
5721+
5722+ default:
5723+ throw std::runtime_error("No matching ErrorCategory variant");
5724+ }
5725+}
5726+
5727+void FfiConverterErrorCategory::write(RustStream &stream, const ErrorCategory &val) {
5728+ switch (val) {
5729+
5730+ case ErrorCategory::kTransport:
5731+ stream << static_cast<int32_t>(1);
5732+ break;
5733+
5734+ case ErrorCategory::kProviderProtocol:
5735+ stream << static_cast<int32_t>(2);
5736+ break;
5737+
5738+ case ErrorCategory::kRateLimit:
5739+ stream << static_cast<int32_t>(3);
5740+ break;
5741+
5742+ case ErrorCategory::kCancellation:
5743+ stream << static_cast<int32_t>(4);
5744+ break;
5745+
5746+ case ErrorCategory::kHostPolicy:
5747+ stream << static_cast<int32_t>(5);
5748+ break;
5749+
5750+ default:
5751+ throw std::runtime_error("No matching ErrorCategory variant");
5752+ }
5753+}
5754+
5755+uint64_t FfiConverterErrorCategory::allocation_size(const ErrorCategory &) {
5756+ return static_cast<uint64_t>(sizeof(int32_t));
5757+}
5758+
5759+
5760+ErrorCode FfiConverterErrorCode::lift(RustBuffer buf) {
5761+ auto stream = RustStream(&buf);
5762+ auto ret = FfiConverterErrorCode::read(stream);
5763+
5764+ rustbuffer_free(buf);
5765+
5766+ return std::move(ret);
5767+}
5768+
5769+RustBuffer FfiConverterErrorCode::lower(const ErrorCode &val) {
5770+ auto buf = rustbuffer_alloc(FfiConverterErrorCode::allocation_size(val));
5771+ auto stream = RustStream(&buf);
5772+
5773+ FfiConverterErrorCode::write(stream, val);
5774+
5775+ return std::move(buf);
5776+}
5777+
5778+ErrorCode FfiConverterErrorCode::read(RustStream &stream) {
5779+ int32_t variant;
5780+ stream >> variant;
5781+
5782+ switch (variant) {
5783+
5784+ case 1:
5785+ return ErrorCode::kInvalidProviderResponse;
5786+
5787+ case 2:
5788+ return ErrorCode::kHttpRejected;
5789+
5790+ case 3:
5791+ return ErrorCode::kRateLimited;
5792+
5793+ case 4:
5794+ return ErrorCode::kTransportFailed;
5795+
5796+ case 5:
5797+ return ErrorCode::kHostCancelled;
5798+
5799+ case 6:
5800+ return ErrorCode::kResponseTooLarge;
5801+
5802+ case 7:
5803+ return ErrorCode::kHostPolicyViolation;
5804+
5805+ default:
5806+ throw std::runtime_error("No matching ErrorCode variant");
5807+ }
5808+}
5809+
5810+void FfiConverterErrorCode::write(RustStream &stream, const ErrorCode &val) {
5811+ switch (val) {
5812+
5813+ case ErrorCode::kInvalidProviderResponse:
5814+ stream << static_cast<int32_t>(1);
5815+ break;
5816+
5817+ case ErrorCode::kHttpRejected:
5818+ stream << static_cast<int32_t>(2);
5819+ break;
5820+
5821+ case ErrorCode::kRateLimited:
5822+ stream << static_cast<int32_t>(3);
5823+ break;
5824+
5825+ case ErrorCode::kTransportFailed:
5826+ stream << static_cast<int32_t>(4);
5827+ break;
5828+
5829+ case ErrorCode::kHostCancelled:
5830+ stream << static_cast<int32_t>(5);
5831+ break;
5832+
5833+ case ErrorCode::kResponseTooLarge:
5834+ stream << static_cast<int32_t>(6);
5835+ break;
5836+
5837+ case ErrorCode::kHostPolicyViolation:
5838+ stream << static_cast<int32_t>(7);
5839+ break;
5840+
5841+ default:
5842+ throw std::runtime_error("No matching ErrorCode variant");
5843+ }
5844+}
5845+
5846+uint64_t FfiConverterErrorCode::allocation_size(const ErrorCode &) {
5847+ return static_cast<uint64_t>(sizeof(int32_t));
5848+}
5849+
5850+
5851+std::shared_ptr<HttpHostError> FfiConverterHttpHostError::lift(RustBuffer buf) {
5852+ auto stream = RustStream(&buf);
5853+ auto ret = FfiConverterHttpHostError::read(stream);
5854+
5855+ rustbuffer_free(buf);
5856+
5857+ return ret;
5858+}
5859+
5860+RustBuffer FfiConverterHttpHostError::lower(const HttpHostError &val) {
5861+ auto buf = rustbuffer_alloc(allocation_size(val));
5862+ auto stream = RustStream(&buf);
5863+
5864+ FfiConverterHttpHostError::write(stream, val);
5865+
5866+ return std::move(buf);
5867+}
5868+
5869+std::shared_ptr<HttpHostError> FfiConverterHttpHostError::read(RustStream &stream) {
5870+ int32_t v;
5871+ stream >> v;
5872+
5873+ switch (v) {
5874+ case 1:
5875+ {
5876+ http_host_error::Failed var("HttpHostError::Failed");
5877+ var.kind = FfiConverterHttpHostErrorKind::read(stream);
5878+ var.diagnostic = FfiConverterString::read(stream);
5879+ auto what_arg = FfiConverterString::lift(
5880+ rust_call(
5881+ uniffi_wallet_engine_fn_method_httphosterror_uniffi_trait_display,
5882+ nullptr,
5883+ FfiConverterHttpHostError::lower(var)
5884+ )
5885+ );
5886+ auto ret = std::make_shared<http_host_error::Failed>(what_arg);
5887+ ret->kind = std::move(var.kind);
5888+ ret->diagnostic = std::move(var.diagnostic);
5889+ return ret;
5890+ }
5891+ default:
5892+ throw std::runtime_error("Unexpected error variant");
5893+ }
5894+}
5895+
5896+void FfiConverterHttpHostError::write(RustStream &stream, const HttpHostError &val) {
5897+ stream << val.get_variant_idx();
5898+ switch (val.get_variant_idx()) {
5899+ case 1:
5900+ {
5901+ auto var = static_cast<const http_host_error::Failed&>(val);
5902+ FfiConverterHttpHostErrorKind::write(stream, var.kind);
5903+ FfiConverterString::write(stream, var.diagnostic);
5904+ break;
5905+ }
5906+ }
5907+}
5908+
5909+uint64_t FfiConverterHttpHostError::allocation_size(const HttpHostError &val) {
5910+ switch (val.get_variant_idx()) {
5911+ case 1:
5912+ {
5913+ auto var = static_cast<const http_host_error::Failed&>(val);
5914+ return static_cast<uint64_t>(sizeof(int32_t)
5915+ + FfiConverterHttpHostErrorKind::allocation_size(var.kind)
5916+ + FfiConverterString::allocation_size(var.diagnostic));
5917+ }
5918+ default:
5919+ throw std::runtime_error("Unexpected error variant");
5920+ }
5921+}
5922+
5923+
5924+HttpHostErrorKind FfiConverterHttpHostErrorKind::lift(RustBuffer buf) {
5925+ auto stream = RustStream(&buf);
5926+ auto ret = FfiConverterHttpHostErrorKind::read(stream);
5927+
5928+ rustbuffer_free(buf);
5929+
5930+ return std::move(ret);
5931+}
5932+
5933+RustBuffer FfiConverterHttpHostErrorKind::lower(const HttpHostErrorKind &val) {
5934+ auto buf = rustbuffer_alloc(FfiConverterHttpHostErrorKind::allocation_size(val));
5935+ auto stream = RustStream(&buf);
5936+
5937+ FfiConverterHttpHostErrorKind::write(stream, val);
5938+
5939+ return std::move(buf);
5940+}
5941+
5942+HttpHostErrorKind FfiConverterHttpHostErrorKind::read(RustStream &stream) {
5943+ int32_t variant;
5944+ stream >> variant;
5945+
5946+ switch (variant) {
5947+
5948+ case 1:
5949+ return HttpHostErrorKind::kOffline;
5950+
5951+ case 2:
5952+ return HttpHostErrorKind::kTimeout;
5953+
5954+ case 3:
5955+ return HttpHostErrorKind::kConnectionLost;
5956+
5957+ case 4:
5958+ return HttpHostErrorKind::kDns;
5959+
5960+ case 5:
5961+ return HttpHostErrorKind::kTls;
5962+
5963+ case 6:
5964+ return HttpHostErrorKind::kPolicyViolation;
5965+
5966+ case 7:
5967+ return HttpHostErrorKind::kResponseTooLarge;
5968+
5969+ case 8:
5970+ return HttpHostErrorKind::kCancelled;
5971+
5972+ case 9:
5973+ return HttpHostErrorKind::kOther;
5974+
5975+ default:
5976+ throw std::runtime_error("No matching HttpHostErrorKind variant");
5977+ }
5978+}
5979+
5980+void FfiConverterHttpHostErrorKind::write(RustStream &stream, const HttpHostErrorKind &val) {
5981+ switch (val) {
5982+
5983+ case HttpHostErrorKind::kOffline:
5984+ stream << static_cast<int32_t>(1);
5985+ break;
5986+
5987+ case HttpHostErrorKind::kTimeout:
5988+ stream << static_cast<int32_t>(2);
5989+ break;
5990+
5991+ case HttpHostErrorKind::kConnectionLost:
5992+ stream << static_cast<int32_t>(3);
5993+ break;
5994+
5995+ case HttpHostErrorKind::kDns:
5996+ stream << static_cast<int32_t>(4);
5997+ break;
5998+
5999+ case HttpHostErrorKind::kTls:
6000+ stream << static_cast<int32_t>(5);
6001+ break;
6002+
6003+ case HttpHostErrorKind::kPolicyViolation:
6004+ stream << static_cast<int32_t>(6);
6005+ break;
6006+
6007+ case HttpHostErrorKind::kResponseTooLarge:
6008+ stream << static_cast<int32_t>(7);
6009+ break;
6010+
6011+ case HttpHostErrorKind::kCancelled:
6012+ stream << static_cast<int32_t>(8);
6013+ break;
6014+
6015+ case HttpHostErrorKind::kOther:
6016+ stream << static_cast<int32_t>(9);
6017+ break;
6018+
6019+ default:
6020+ throw std::runtime_error("No matching HttpHostErrorKind variant");
6021+ }
6022+}
6023+
6024+uint64_t FfiConverterHttpHostErrorKind::allocation_size(const HttpHostErrorKind &) {
6025+ return static_cast<uint64_t>(sizeof(int32_t));
6026+}
6027+
6028+
6029+HttpMethod FfiConverterHttpMethod::lift(RustBuffer buf) {
6030+ auto stream = RustStream(&buf);
6031+ auto ret = FfiConverterHttpMethod::read(stream);
6032+
6033+ rustbuffer_free(buf);
6034+
6035+ return std::move(ret);
6036+}
6037+
6038+RustBuffer FfiConverterHttpMethod::lower(const HttpMethod &val) {
6039+ auto buf = rustbuffer_alloc(FfiConverterHttpMethod::allocation_size(val));
6040+ auto stream = RustStream(&buf);
6041+
6042+ FfiConverterHttpMethod::write(stream, val);
6043+
6044+ return std::move(buf);
6045+}
6046+
6047+HttpMethod FfiConverterHttpMethod::read(RustStream &stream) {
6048+ int32_t variant;
6049+ stream >> variant;
6050+
6051+ switch (variant) {
6052+
6053+ case 1:
6054+ return HttpMethod::kGet;
6055+
6056+ case 2:
6057+ return HttpMethod::kPost;
6058+
6059+ default:
6060+ throw std::runtime_error("No matching HttpMethod variant");
6061+ }
6062+}
6063+
6064+void FfiConverterHttpMethod::write(RustStream &stream, const HttpMethod &val) {
6065+ switch (val) {
6066+
6067+ case HttpMethod::kGet:
6068+ stream << static_cast<int32_t>(1);
6069+ break;
6070+
6071+ case HttpMethod::kPost:
6072+ stream << static_cast<int32_t>(2);
6073+ break;
6074+
6075+ default:
6076+ throw std::runtime_error("No matching HttpMethod variant");
6077+ }
6078+}
6079+
6080+uint64_t FfiConverterHttpMethod::allocation_size(const HttpMethod &) {
6081+ return static_cast<uint64_t>(sizeof(int32_t));
6082+}
6083+
6084+
6085+std::shared_ptr<JournalHostError> FfiConverterJournalHostError::lift(RustBuffer buf) {
6086+ auto stream = RustStream(&buf);
6087+ auto ret = FfiConverterJournalHostError::read(stream);
6088+
6089+ rustbuffer_free(buf);
6090+
6091+ return ret;
6092+}
6093+
6094+RustBuffer FfiConverterJournalHostError::lower(const JournalHostError &val) {
6095+ auto buf = rustbuffer_alloc(allocation_size(val));
6096+ auto stream = RustStream(&buf);
6097+
6098+ FfiConverterJournalHostError::write(stream, val);
6099+
6100+ return std::move(buf);
6101+}
6102+
6103+std::shared_ptr<JournalHostError> FfiConverterJournalHostError::read(RustStream &stream) {
6104+ int32_t v;
6105+ stream >> v;
6106+
6107+ switch (v) {
6108+ case 1:
6109+ {
6110+ journal_host_error::Failed var("JournalHostError::Failed");
6111+ var.kind = FfiConverterJournalHostErrorKind::read(stream);
6112+ var.diagnostic = FfiConverterString::read(stream);
6113+ auto what_arg = FfiConverterString::lift(
6114+ rust_call(
6115+ uniffi_wallet_engine_fn_method_journalhosterror_uniffi_trait_display,
6116+ nullptr,
6117+ FfiConverterJournalHostError::lower(var)
6118+ )
6119+ );
6120+ auto ret = std::make_shared<journal_host_error::Failed>(what_arg);
6121+ ret->kind = std::move(var.kind);
6122+ ret->diagnostic = std::move(var.diagnostic);
6123+ return ret;
6124+ }
6125+ default:
6126+ throw std::runtime_error("Unexpected error variant");
6127+ }
6128+}
6129+
6130+void FfiConverterJournalHostError::write(RustStream &stream, const JournalHostError &val) {
6131+ stream << val.get_variant_idx();
6132+ switch (val.get_variant_idx()) {
6133+ case 1:
6134+ {
6135+ auto var = static_cast<const journal_host_error::Failed&>(val);
6136+ FfiConverterJournalHostErrorKind::write(stream, var.kind);
6137+ FfiConverterString::write(stream, var.diagnostic);
6138+ break;
6139+ }
6140+ }
6141+}
6142+
6143+uint64_t FfiConverterJournalHostError::allocation_size(const JournalHostError &val) {
6144+ switch (val.get_variant_idx()) {
6145+ case 1:
6146+ {
6147+ auto var = static_cast<const journal_host_error::Failed&>(val);
6148+ return static_cast<uint64_t>(sizeof(int32_t)
6149+ + FfiConverterJournalHostErrorKind::allocation_size(var.kind)
6150+ + FfiConverterString::allocation_size(var.diagnostic));
6151+ }
6152+ default:
6153+ throw std::runtime_error("Unexpected error variant");
6154+ }
6155+}
6156+
6157+
6158+JournalHostErrorKind FfiConverterJournalHostErrorKind::lift(RustBuffer buf) {
6159+ auto stream = RustStream(&buf);
6160+ auto ret = FfiConverterJournalHostErrorKind::read(stream);
6161+
6162+ rustbuffer_free(buf);
6163+
6164+ return std::move(ret);
6165+}
6166+
6167+RustBuffer FfiConverterJournalHostErrorKind::lower(const JournalHostErrorKind &val) {
6168+ auto buf = rustbuffer_alloc(FfiConverterJournalHostErrorKind::allocation_size(val));
6169+ auto stream = RustStream(&buf);
6170+
6171+ FfiConverterJournalHostErrorKind::write(stream, val);
6172+
6173+ return std::move(buf);
6174+}
6175+
6176+JournalHostErrorKind FfiConverterJournalHostErrorKind::read(RustStream &stream) {
6177+ int32_t variant;
6178+ stream >> variant;
6179+
6180+ switch (variant) {
6181+
6182+ case 1:
6183+ return JournalHostErrorKind::kUnavailable;
6184+
6185+ case 2:
6186+ return JournalHostErrorKind::kCorruptData;
6187+
6188+ case 3:
6189+ return JournalHostErrorKind::kCancelled;
6190+
6191+ case 4:
6192+ return JournalHostErrorKind::kOther;
6193+
6194+ default:
6195+ throw std::runtime_error("No matching JournalHostErrorKind variant");
6196+ }
6197+}
6198+
6199+void FfiConverterJournalHostErrorKind::write(RustStream &stream, const JournalHostErrorKind &val) {
6200+ switch (val) {
6201+
6202+ case JournalHostErrorKind::kUnavailable:
6203+ stream << static_cast<int32_t>(1);
6204+ break;
6205+
6206+ case JournalHostErrorKind::kCorruptData:
6207+ stream << static_cast<int32_t>(2);
6208+ break;
6209+
6210+ case JournalHostErrorKind::kCancelled:
6211+ stream << static_cast<int32_t>(3);
6212+ break;
6213+
6214+ case JournalHostErrorKind::kOther:
6215+ stream << static_cast<int32_t>(4);
6216+ break;
6217+
6218+ default:
6219+ throw std::runtime_error("No matching JournalHostErrorKind variant");
6220+ }
6221+}
6222+
6223+uint64_t FfiConverterJournalHostErrorKind::allocation_size(const JournalHostErrorKind &) {
6224+ return static_cast<uint64_t>(sizeof(int32_t));
6225+}
6226+
6227+
6228+KeyRotationMessageKind FfiConverterKeyRotationMessageKind::lift(RustBuffer buf) {
6229+ auto stream = RustStream(&buf);
6230+ auto ret = FfiConverterKeyRotationMessageKind::read(stream);
6231+
6232+ rustbuffer_free(buf);
6233+
6234+ return std::move(ret);
6235+}
6236+
6237+RustBuffer FfiConverterKeyRotationMessageKind::lower(const KeyRotationMessageKind &val) {
6238+ auto buf = rustbuffer_alloc(FfiConverterKeyRotationMessageKind::allocation_size(val));
6239+ auto stream = RustStream(&buf);
6240+
6241+ FfiConverterKeyRotationMessageKind::write(stream, val);
6242+
6243+ return std::move(buf);
6244+}
6245+
6246+KeyRotationMessageKind FfiConverterKeyRotationMessageKind::read(RustStream &stream) {
6247+ int32_t variant;
6248+ stream >> variant;
6249+
6250+ switch (variant) {
6251+
6252+ case 1:
6253+ return KeyRotationMessageKind::kExternal;
6254+
6255+ case 2:
6256+ return KeyRotationMessageKind::kInternal;
6257+
6258+ default:
6259+ throw std::runtime_error("No matching KeyRotationMessageKind variant");
6260+ }
6261+}
6262+
6263+void FfiConverterKeyRotationMessageKind::write(RustStream &stream, const KeyRotationMessageKind &val) {
6264+ switch (val) {
6265+
6266+ case KeyRotationMessageKind::kExternal:
6267+ stream << static_cast<int32_t>(1);
6268+ break;
6269+
6270+ case KeyRotationMessageKind::kInternal:
6271+ stream << static_cast<int32_t>(2);
6272+ break;
6273+
6274+ default:
6275+ throw std::runtime_error("No matching KeyRotationMessageKind variant");
6276+ }
6277+}
6278+
6279+uint64_t FfiConverterKeyRotationMessageKind::allocation_size(const KeyRotationMessageKind &) {
6280+ return static_cast<uint64_t>(sizeof(int32_t));
6281+}
6282+
6283+
6284+MnemonicScheme FfiConverterMnemonicScheme::lift(RustBuffer buf) {
6285+ auto stream = RustStream(&buf);
6286+ auto ret = FfiConverterMnemonicScheme::read(stream);
6287+
6288+ rustbuffer_free(buf);
6289+
6290+ return std::move(ret);
6291+}
6292+
6293+RustBuffer FfiConverterMnemonicScheme::lower(const MnemonicScheme &val) {
6294+ auto buf = rustbuffer_alloc(FfiConverterMnemonicScheme::allocation_size(val));
6295+ auto stream = RustStream(&buf);
6296+
6297+ FfiConverterMnemonicScheme::write(stream, val);
6298+
6299+ return std::move(buf);
6300+}
6301+
6302+MnemonicScheme FfiConverterMnemonicScheme::read(RustStream &stream) {
6303+ int32_t variant;
6304+ stream >> variant;
6305+
6306+ switch (variant) {
6307+
6308+ case 1:
6309+ return MnemonicScheme::kRotation;
6310+
6311+ case 2:
6312+ return MnemonicScheme::kTon;
6313+
6314+ case 3:
6315+ return MnemonicScheme::kBip39;
6316+
6317+ default:
6318+ throw std::runtime_error("No matching MnemonicScheme variant");
6319+ }
6320+}
6321+
6322+void FfiConverterMnemonicScheme::write(RustStream &stream, const MnemonicScheme &val) {
6323+ switch (val) {
6324+
6325+ case MnemonicScheme::kRotation:
6326+ stream << static_cast<int32_t>(1);
6327+ break;
6328+
6329+ case MnemonicScheme::kTon:
6330+ stream << static_cast<int32_t>(2);
6331+ break;
6332+
6333+ case MnemonicScheme::kBip39:
6334+ stream << static_cast<int32_t>(3);
6335+ break;
6336+
6337+ default:
6338+ throw std::runtime_error("No matching MnemonicScheme variant");
6339+ }
6340+}
6341+
6342+uint64_t FfiConverterMnemonicScheme::allocation_size(const MnemonicScheme &) {
6343+ return static_cast<uint64_t>(sizeof(int32_t));
6344+}
6345+
6346+
6347+Network FfiConverterNetwork::lift(RustBuffer buf) {
6348+ auto stream = RustStream(&buf);
6349+ auto ret = FfiConverterNetwork::read(stream);
6350+
6351+ rustbuffer_free(buf);
6352+
6353+ return std::move(ret);
6354+}
6355+
6356+RustBuffer FfiConverterNetwork::lower(const Network &val) {
6357+ auto buf = rustbuffer_alloc(FfiConverterNetwork::allocation_size(val));
6358+ auto stream = RustStream(&buf);
6359+
6360+ FfiConverterNetwork::write(stream, val);
6361+
6362+ return std::move(buf);
6363+}
6364+
6365+Network FfiConverterNetwork::read(RustStream &stream) {
6366+ int32_t variant;
6367+ stream >> variant;
6368+
6369+ switch (variant) {
6370+
6371+ case 1:
6372+ return Network::kMainnet;
6373+
6374+ case 2:
6375+ return Network::kTestnet;
6376+
6377+ default:
6378+ throw std::runtime_error("No matching Network variant");
6379+ }
6380+}
6381+
6382+void FfiConverterNetwork::write(RustStream &stream, const Network &val) {
6383+ switch (val) {
6384+
6385+ case Network::kMainnet:
6386+ stream << static_cast<int32_t>(1);
6387+ break;
6388+
6389+ case Network::kTestnet:
6390+ stream << static_cast<int32_t>(2);
6391+ break;
6392+
6393+ default:
6394+ throw std::runtime_error("No matching Network variant");
6395+ }
6396+}
6397+
6398+uint64_t FfiConverterNetwork::allocation_size(const Network &) {
6399+ return static_cast<uint64_t>(sizeof(int32_t));
6400+}
6401+
6402+
6403+NftTransferFunding FfiConverterNftTransferFunding::lift(RustBuffer buf) {
6404+ auto stream = RustStream(&buf);
6405+ auto ret = FfiConverterNftTransferFunding::read(stream);
6406+
6407+ rustbuffer_free(buf);
6408+
6409+ return std::move(ret);
6410+}
6411+
6412+RustBuffer FfiConverterNftTransferFunding::lower(const NftTransferFunding &val) {
6413+ auto buf = rustbuffer_alloc(FfiConverterNftTransferFunding::allocation_size(val));
6414+ auto stream = RustStream(&buf);
6415+
6416+ FfiConverterNftTransferFunding::write(stream, val);
6417+
6418+ return std::move(buf);
6419+}
6420+
6421+NftTransferFunding FfiConverterNftTransferFunding::read(RustStream &stream) {
6422+ int32_t variant_id;
6423+ stream >> variant_id;
6424+
6425+ switch (variant_id) {
6426+
6427+ case 1:
6428+ return NftTransferFunding::kExact {
6429+ .attached_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
6430+ .forward_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
6431+ };
6432+
6433+ default:
6434+ throw std::runtime_error("No matching NftTransferFunding variant");
6435+ }
6436+}
6437+
6438+void FfiConverterNftTransferFunding::write(RustStream &stream, const NftTransferFunding &val) {
6439+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
6440+
6441+ stream << variant_id;
6442+
6443+ std::visit([&](auto &&arg) {
6444+ using T = std::decay_t<decltype(arg)>;
6445+ if constexpr (std::is_same_v<T, NftTransferFunding::kExact>) {
6446+ FfiConverterTypeUnsignedDecimalString::write(stream, arg.attached_nanograms);
6447+ FfiConverterTypeUnsignedDecimalString::write(stream, arg.forward_nanograms);
6448+ }
6449+ else {
6450+ static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
6451+ }
6452+ }, val.variant);
6453+}
6454+
6455+uint64_t FfiConverterNftTransferFunding::allocation_size(const NftTransferFunding &val) {
6456+ uint64_t size = sizeof(int32_t);
6457+
6458+ size += std::visit([&](auto &&arg) {
6459+ using T = std::decay_t<decltype(arg)>;
6460+ if constexpr (std::is_same_v<T, NftTransferFunding::kExact>) {
6461+ uint64_t size = 0;
6462+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.attached_nanograms);
6463+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.forward_nanograms);
6464+ return size;
6465+ }
6466+ else {
6467+ static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
6468+ }
6469+ }, val.variant);
6470+
6471+ return size;
6472+}
6473+
6474+
6475+NftTransferPayload FfiConverterNftTransferPayload::lift(RustBuffer buf) {
6476+ auto stream = RustStream(&buf);
6477+ auto ret = FfiConverterNftTransferPayload::read(stream);
6478+
6479+ rustbuffer_free(buf);
6480+
6481+ return std::move(ret);
6482+}
6483+
6484+RustBuffer FfiConverterNftTransferPayload::lower(const NftTransferPayload &val) {
6485+ auto buf = rustbuffer_alloc(FfiConverterNftTransferPayload::allocation_size(val));
6486+ auto stream = RustStream(&buf);
6487+
6488+ FfiConverterNftTransferPayload::write(stream, val);
6489+
6490+ return std::move(buf);
6491+}
6492+
6493+NftTransferPayload FfiConverterNftTransferPayload::read(RustStream &stream) {
6494+ int32_t variant_id;
6495+ stream >> variant_id;
6496+
6497+ switch (variant_id) {
6498+
6499+ case 1:
6500+ return NftTransferPayload::kEmpty {
6501+ };
6502+
6503+ case 2:
6504+ return NftTransferPayload::kComment {
6505+ .text = FfiConverterString::read(stream),
6506+ };
6507+
6508+ case 3:
6509+ return NftTransferPayload::kRawPayload {
6510+ .boc = FfiConverterTypeBoc::read(stream),
6511+ };
6512+
6513+ default:
6514+ throw std::runtime_error("No matching NftTransferPayload variant");
6515+ }
6516+}
6517+
6518+void FfiConverterNftTransferPayload::write(RustStream &stream, const NftTransferPayload &val) {
6519+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
6520+
6521+ stream << variant_id;
6522+
6523+ std::visit([&](auto &&arg) {
6524+ using T = std::decay_t<decltype(arg)>;
6525+ if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
6526+ }
6527+ else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
6528+ FfiConverterString::write(stream, arg.text);
6529+ }
6530+ else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
6531+ FfiConverterTypeBoc::write(stream, arg.boc);
6532+ }
6533+ else {
6534+ static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
6535+ }
6536+ }, val.variant);
6537+}
6538+
6539+uint64_t FfiConverterNftTransferPayload::allocation_size(const NftTransferPayload &val) {
6540+ uint64_t size = sizeof(int32_t);
6541+
6542+ size += std::visit([&](auto &&arg) {
6543+ using T = std::decay_t<decltype(arg)>;
6544+ if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
6545+ uint64_t size = 0;
6546+ return size;
6547+ }
6548+ else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
6549+ uint64_t size = 0;
6550+ size += FfiConverterString::allocation_size(arg.text);
6551+ return size;
6552+ }
6553+ else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
6554+ uint64_t size = 0;
6555+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
6556+ return size;
6557+ }
6558+ else {
6559+ static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
6560+ }
6561+ }, val.variant);
6562+
6563+ return size;
6564+}
6565+
6566+
6567+PendingReason FfiConverterPendingReason::lift(RustBuffer buf) {
6568+ auto stream = RustStream(&buf);
6569+ auto ret = FfiConverterPendingReason::read(stream);
6570+
6571+ rustbuffer_free(buf);
6572+
6573+ return std::move(ret);
6574+}
6575+
6576+RustBuffer FfiConverterPendingReason::lower(const PendingReason &val) {
6577+ auto buf = rustbuffer_alloc(FfiConverterPendingReason::allocation_size(val));
6578+ auto stream = RustStream(&buf);
6579+
6580+ FfiConverterPendingReason::write(stream, val);
6581+
6582+ return std::move(buf);
6583+}
6584+
6585+PendingReason FfiConverterPendingReason::read(RustStream &stream) {
6586+ int32_t variant;
6587+ stream >> variant;
6588+
6589+ switch (variant) {
6590+
6591+ case 1:
6592+ return PendingReason::kInMempool;
6593+
6594+ case 2:
6595+ return PendingReason::kAwaitingWindow;
6596+
6597+ default:
6598+ throw std::runtime_error("No matching PendingReason variant");
6599+ }
6600+}
6601+
6602+void FfiConverterPendingReason::write(RustStream &stream, const PendingReason &val) {
6603+ switch (val) {
6604+
6605+ case PendingReason::kInMempool:
6606+ stream << static_cast<int32_t>(1);
6607+ break;
6608+
6609+ case PendingReason::kAwaitingWindow:
6610+ stream << static_cast<int32_t>(2);
6611+ break;
6612+
6613+ default:
6614+ throw std::runtime_error("No matching PendingReason variant");
6615+ }
6616+}
6617+
6618+uint64_t FfiConverterPendingReason::allocation_size(const PendingReason &) {
6619+ return static_cast<uint64_t>(sizeof(int32_t));
6620+}
6621+
6622+
6623+std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::lift(RustBuffer buf) {
6624+ auto stream = RustStream(&buf);
6625+ auto ret = FfiConverterProtectedSecretHostError::read(stream);
6626+
6627+ rustbuffer_free(buf);
6628+
6629+ return ret;
6630+}
6631+
6632+RustBuffer FfiConverterProtectedSecretHostError::lower(const ProtectedSecretHostError &val) {
6633+ auto buf = rustbuffer_alloc(allocation_size(val));
6634+ auto stream = RustStream(&buf);
6635+
6636+ FfiConverterProtectedSecretHostError::write(stream, val);
6637+
6638+ return std::move(buf);
6639+}
6640+
6641+std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::read(RustStream &stream) {
6642+ int32_t v;
6643+ stream >> v;
6644+
6645+ switch (v) {
6646+ case 1:
6647+ {
6648+ protected_secret_host_error::Failed var("ProtectedSecretHostError::Failed");
6649+ var.kind = FfiConverterProtectedSecretHostErrorKind::read(stream);
6650+ var.diagnostic = FfiConverterString::read(stream);
6651+ auto what_arg = FfiConverterString::lift(
6652+ rust_call(
6653+ uniffi_wallet_engine_fn_method_protectedsecrethosterror_uniffi_trait_display,
6654+ nullptr,
6655+ FfiConverterProtectedSecretHostError::lower(var)
6656+ )
6657+ );
6658+ auto ret = std::make_shared<protected_secret_host_error::Failed>(what_arg);
6659+ ret->kind = std::move(var.kind);
6660+ ret->diagnostic = std::move(var.diagnostic);
6661+ return ret;
6662+ }
6663+ default:
6664+ throw std::runtime_error("Unexpected error variant");
6665+ }
6666+}
6667+
6668+void FfiConverterProtectedSecretHostError::write(RustStream &stream, const ProtectedSecretHostError &val) {
6669+ stream << val.get_variant_idx();
6670+ switch (val.get_variant_idx()) {
6671+ case 1:
6672+ {
6673+ auto var = static_cast<const protected_secret_host_error::Failed&>(val);
6674+ FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
6675+ FfiConverterString::write(stream, var.diagnostic);
6676+ break;
6677+ }
6678+ }
6679+}
6680+
6681+uint64_t FfiConverterProtectedSecretHostError::allocation_size(const ProtectedSecretHostError &val) {
6682+ switch (val.get_variant_idx()) {
6683+ case 1:
6684+ {
6685+ auto var = static_cast<const protected_secret_host_error::Failed&>(val);
6686+ return static_cast<uint64_t>(sizeof(int32_t)
6687+ + FfiConverterProtectedSecretHostErrorKind::allocation_size(var.kind)
6688+ + FfiConverterString::allocation_size(var.diagnostic));
6689+ }
6690+ default:
6691+ throw std::runtime_error("Unexpected error variant");
6692+ }
6693+}
6694+
6695+
6696+ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::lift(RustBuffer buf) {
6697+ auto stream = RustStream(&buf);
6698+ auto ret = FfiConverterProtectedSecretHostErrorKind::read(stream);
6699+
6700+ rustbuffer_free(buf);
6701+
6702+ return std::move(ret);
6703+}
6704+
6705+RustBuffer FfiConverterProtectedSecretHostErrorKind::lower(const ProtectedSecretHostErrorKind &val) {
6706+ auto buf = rustbuffer_alloc(FfiConverterProtectedSecretHostErrorKind::allocation_size(val));
6707+ auto stream = RustStream(&buf);
6708+
6709+ FfiConverterProtectedSecretHostErrorKind::write(stream, val);
6710+
6711+ return std::move(buf);
6712+}
6713+
6714+ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::read(RustStream &stream) {
6715+ int32_t variant;
6716+ stream >> variant;
6717+
6718+ switch (variant) {
6719+
6720+ case 1:
6721+ return ProtectedSecretHostErrorKind::kNotFound;
6722+
6723+ case 2:
6724+ return ProtectedSecretHostErrorKind::kAuthenticationFailed;
6725+
6726+ case 3:
6727+ return ProtectedSecretHostErrorKind::kCancelled;
6728+
6729+ case 4:
6730+ return ProtectedSecretHostErrorKind::kUnavailable;
6731+
6732+ case 5:
6733+ return ProtectedSecretHostErrorKind::kPolicyViolation;
6734+
6735+ case 6:
6736+ return ProtectedSecretHostErrorKind::kOther;
6737+
6738+ default:
6739+ throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
6740+ }
6741+}
6742+
6743+void FfiConverterProtectedSecretHostErrorKind::write(RustStream &stream, const ProtectedSecretHostErrorKind &val) {
6744+ switch (val) {
6745+
6746+ case ProtectedSecretHostErrorKind::kNotFound:
6747+ stream << static_cast<int32_t>(1);
6748+ break;
6749+
6750+ case ProtectedSecretHostErrorKind::kAuthenticationFailed:
6751+ stream << static_cast<int32_t>(2);
6752+ break;
6753+
6754+ case ProtectedSecretHostErrorKind::kCancelled:
6755+ stream << static_cast<int32_t>(3);
6756+ break;
6757+
6758+ case ProtectedSecretHostErrorKind::kUnavailable:
6759+ stream << static_cast<int32_t>(4);
6760+ break;
6761+
6762+ case ProtectedSecretHostErrorKind::kPolicyViolation:
6763+ stream << static_cast<int32_t>(5);
6764+ break;
6765+
6766+ case ProtectedSecretHostErrorKind::kOther:
6767+ stream << static_cast<int32_t>(6);
6768+ break;
6769+
6770+ default:
6771+ throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
6772+ }
6773+}
6774+
6775+uint64_t FfiConverterProtectedSecretHostErrorKind::allocation_size(const ProtectedSecretHostErrorKind &) {
6776+ return static_cast<uint64_t>(sizeof(int32_t));
6777+}
6778+
6779+
6780+ResourcePhase FfiConverterResourcePhase::lift(RustBuffer buf) {
6781+ auto stream = RustStream(&buf);
6782+ auto ret = FfiConverterResourcePhase::read(stream);
6783+
6784+ rustbuffer_free(buf);
6785+
6786+ return std::move(ret);
6787+}
6788+
6789+RustBuffer FfiConverterResourcePhase::lower(const ResourcePhase &val) {
6790+ auto buf = rustbuffer_alloc(FfiConverterResourcePhase::allocation_size(val));
6791+ auto stream = RustStream(&buf);
6792+
6793+ FfiConverterResourcePhase::write(stream, val);
6794+
6795+ return std::move(buf);
6796+}
6797+
6798+ResourcePhase FfiConverterResourcePhase::read(RustStream &stream) {
6799+ int32_t variant;
6800+ stream >> variant;
6801+
6802+ switch (variant) {
6803+
6804+ case 1:
6805+ return ResourcePhase::kIdle;
6806+
6807+ case 2:
6808+ return ResourcePhase::kLoading;
6809+
6810+ case 3:
6811+ return ResourcePhase::kReady;
6812+
6813+ case 4:
6814+ return ResourcePhase::kFailed;
6815+
6816+ default:
6817+ throw std::runtime_error("No matching ResourcePhase variant");
6818+ }
6819+}
6820+
6821+void FfiConverterResourcePhase::write(RustStream &stream, const ResourcePhase &val) {
6822+ switch (val) {
6823+
6824+ case ResourcePhase::kIdle:
6825+ stream << static_cast<int32_t>(1);
6826+ break;
6827+
6828+ case ResourcePhase::kLoading:
6829+ stream << static_cast<int32_t>(2);
6830+ break;
6831+
6832+ case ResourcePhase::kReady:
6833+ stream << static_cast<int32_t>(3);
6834+ break;
6835+
6836+ case ResourcePhase::kFailed:
6837+ stream << static_cast<int32_t>(4);
6838+ break;
6839+
6840+ default:
6841+ throw std::runtime_error("No matching ResourcePhase variant");
6842+ }
6843+}
6844+
6845+uint64_t FfiConverterResourcePhase::allocation_size(const ResourcePhase &) {
6846+ return static_cast<uint64_t>(sizeof(int32_t));
6847+}
6848+
6849+
6850+RetryAdvice FfiConverterRetryAdvice::lift(RustBuffer buf) {
6851+ auto stream = RustStream(&buf);
6852+ auto ret = FfiConverterRetryAdvice::read(stream);
6853+
6854+ rustbuffer_free(buf);
6855+
6856+ return std::move(ret);
6857+}
6858+
6859+RustBuffer FfiConverterRetryAdvice::lower(const RetryAdvice &val) {
6860+ auto buf = rustbuffer_alloc(FfiConverterRetryAdvice::allocation_size(val));
6861+ auto stream = RustStream(&buf);
6862+
6863+ FfiConverterRetryAdvice::write(stream, val);
6864+
6865+ return std::move(buf);
6866+}
6867+
6868+RetryAdvice FfiConverterRetryAdvice::read(RustStream &stream) {
6869+ int32_t variant;
6870+ stream >> variant;
6871+
6872+ switch (variant) {
6873+
6874+ case 1:
6875+ return RetryAdvice::kNone;
6876+
6877+ case 2:
6878+ return RetryAdvice::kSafe;
6879+
6880+ case 3:
6881+ return RetryAdvice::kAfterDelay;
6882+
6883+ default:
6884+ throw std::runtime_error("No matching RetryAdvice variant");
6885+ }
6886+}
6887+
6888+void FfiConverterRetryAdvice::write(RustStream &stream, const RetryAdvice &val) {
6889+ switch (val) {
6890+
6891+ case RetryAdvice::kNone:
6892+ stream << static_cast<int32_t>(1);
6893+ break;
6894+
6895+ case RetryAdvice::kSafe:
6896+ stream << static_cast<int32_t>(2);
6897+ break;
6898+
6899+ case RetryAdvice::kAfterDelay:
6900+ stream << static_cast<int32_t>(3);
6901+ break;
6902+
6903+ default:
6904+ throw std::runtime_error("No matching RetryAdvice variant");
6905+ }
6906+}
6907+
6908+uint64_t FfiConverterRetryAdvice::allocation_size(const RetryAdvice &) {
6909+ return static_cast<uint64_t>(sizeof(int32_t));
6910+}
6911+
6912+
6913+SecretAccessReason FfiConverterSecretAccessReason::lift(RustBuffer buf) {
6914+ auto stream = RustStream(&buf);
6915+ auto ret = FfiConverterSecretAccessReason::read(stream);
6916+
6917+ rustbuffer_free(buf);
6918+
6919+ return std::move(ret);
6920+}
6921+
6922+RustBuffer FfiConverterSecretAccessReason::lower(const SecretAccessReason &val) {
6923+ auto buf = rustbuffer_alloc(FfiConverterSecretAccessReason::allocation_size(val));
6924+ auto stream = RustStream(&buf);
6925+
6926+ FfiConverterSecretAccessReason::write(stream, val);
6927+
6928+ return std::move(buf);
6929+}
6930+
6931+SecretAccessReason FfiConverterSecretAccessReason::read(RustStream &stream) {
6932+ int32_t variant;
6933+ stream >> variant;
6934+
6935+ switch (variant) {
6936+
6937+ case 1:
6938+ return SecretAccessReason::kCreateWallet;
6939+
6940+ case 2:
6941+ return SecretAccessReason::kSignTransfer;
6942+
6943+ case 3:
6944+ return SecretAccessReason::kSignTonConnectProof;
6945+
6946+ case 4:
6947+ return SecretAccessReason::kPrepareKeyRotation;
6948+
6949+ case 5:
6950+ return SecretAccessReason::kEncryptComment;
6951+
6952+ case 6:
6953+ return SecretAccessReason::kDecryptComment;
6954+
6955+ case 7:
6956+ return SecretAccessReason::kRevealRecoveryPhrase;
6957+
6958+ case 8:
6959+ return SecretAccessReason::kDeriveTonConnectSessionKey;
6960+
6961+ case 9:
6962+ return SecretAccessReason::kSignTonConnectData;
6963+
6964+ default:
6965+ throw std::runtime_error("No matching SecretAccessReason variant");
6966+ }
6967+}
6968+
6969+void FfiConverterSecretAccessReason::write(RustStream &stream, const SecretAccessReason &val) {
6970+ switch (val) {
6971+
6972+ case SecretAccessReason::kCreateWallet:
6973+ stream << static_cast<int32_t>(1);
6974+ break;
6975+
6976+ case SecretAccessReason::kSignTransfer:
6977+ stream << static_cast<int32_t>(2);
6978+ break;
6979+
6980+ case SecretAccessReason::kSignTonConnectProof:
6981+ stream << static_cast<int32_t>(3);
6982+ break;
6983+
6984+ case SecretAccessReason::kPrepareKeyRotation:
6985+ stream << static_cast<int32_t>(4);
6986+ break;
6987+
6988+ case SecretAccessReason::kEncryptComment:
6989+ stream << static_cast<int32_t>(5);
6990+ break;
6991+
6992+ case SecretAccessReason::kDecryptComment:
6993+ stream << static_cast<int32_t>(6);
6994+ break;
6995+
6996+ case SecretAccessReason::kRevealRecoveryPhrase:
6997+ stream << static_cast<int32_t>(7);
6998+ break;
6999+
7000+ case SecretAccessReason::kDeriveTonConnectSessionKey:
7001+ stream << static_cast<int32_t>(8);
7002+ break;
7003+
7004+ case SecretAccessReason::kSignTonConnectData:
7005+ stream << static_cast<int32_t>(9);
7006+ break;
7007+
7008+ default:
7009+ throw std::runtime_error("No matching SecretAccessReason variant");
7010+ }
7011+}
7012+
7013+uint64_t FfiConverterSecretAccessReason::allocation_size(const SecretAccessReason &) {
7014+ return static_cast<uint64_t>(sizeof(int32_t));
7015+}
7016+
7017+
7018+SendAmount FfiConverterSendAmount::lift(RustBuffer buf) {
7019+ auto stream = RustStream(&buf);
7020+ auto ret = FfiConverterSendAmount::read(stream);
7021+
7022+ rustbuffer_free(buf);
7023+
7024+ return std::move(ret);
7025+}
7026+
7027+RustBuffer FfiConverterSendAmount::lower(const SendAmount &val) {
7028+ auto buf = rustbuffer_alloc(FfiConverterSendAmount::allocation_size(val));
7029+ auto stream = RustStream(&buf);
7030+
7031+ FfiConverterSendAmount::write(stream, val);
7032+
7033+ return std::move(buf);
7034+}
7035+
7036+SendAmount FfiConverterSendAmount::read(RustStream &stream) {
7037+ int32_t variant_id;
7038+ stream >> variant_id;
7039+
7040+ switch (variant_id) {
7041+
7042+ case 1:
7043+ return SendAmount::kExact {
7044+ .nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
7045+ };
7046+
7047+ case 2:
7048+ return SendAmount::kAll {
7049+ };
7050+
7051+ default:
7052+ throw std::runtime_error("No matching SendAmount variant");
7053+ }
7054+}
7055+
7056+void FfiConverterSendAmount::write(RustStream &stream, const SendAmount &val) {
7057+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7058+
7059+ stream << variant_id;
7060+
7061+ std::visit([&](auto &&arg) {
7062+ using T = std::decay_t<decltype(arg)>;
7063+ if constexpr (std::is_same_v<T, SendAmount::kExact>) {
7064+ FfiConverterTypeUnsignedDecimalString::write(stream, arg.nanograms);
7065+ }
7066+ else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
7067+ }
7068+ else {
7069+ static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
7070+ }
7071+ }, val.variant);
7072+}
7073+
7074+uint64_t FfiConverterSendAmount::allocation_size(const SendAmount &val) {
7075+ uint64_t size = sizeof(int32_t);
7076+
7077+ size += std::visit([&](auto &&arg) {
7078+ using T = std::decay_t<decltype(arg)>;
7079+ if constexpr (std::is_same_v<T, SendAmount::kExact>) {
7080+ uint64_t size = 0;
7081+ size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.nanograms);
7082+ return size;
7083+ }
7084+ else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
7085+ uint64_t size = 0;
7086+ return size;
7087+ }
7088+ else {
7089+ static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
7090+ }
7091+ }, val.variant);
7092+
7093+ return size;
7094+}
7095+
7096+
7097+SendExpiration FfiConverterSendExpiration::lift(RustBuffer buf) {
7098+ auto stream = RustStream(&buf);
7099+ auto ret = FfiConverterSendExpiration::read(stream);
7100+
7101+ rustbuffer_free(buf);
7102+
7103+ return std::move(ret);
7104+}
7105+
7106+RustBuffer FfiConverterSendExpiration::lower(const SendExpiration &val) {
7107+ auto buf = rustbuffer_alloc(FfiConverterSendExpiration::allocation_size(val));
7108+ auto stream = RustStream(&buf);
7109+
7110+ FfiConverterSendExpiration::write(stream, val);
7111+
7112+ return std::move(buf);
7113+}
7114+
7115+SendExpiration FfiConverterSendExpiration::read(RustStream &stream) {
7116+ int32_t variant_id;
7117+ stream >> variant_id;
7118+
7119+ switch (variant_id) {
7120+
7121+ case 1:
7122+ return SendExpiration::kEngineDefault {
7123+ };
7124+
7125+ case 2:
7126+ return SendExpiration::kExact {
7127+ .unix_timestamp = FfiConverterUInt64::read(stream),
7128+ };
7129+
7130+ default:
7131+ throw std::runtime_error("No matching SendExpiration variant");
7132+ }
7133+}
7134+
7135+void FfiConverterSendExpiration::write(RustStream &stream, const SendExpiration &val) {
7136+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7137+
7138+ stream << variant_id;
7139+
7140+ std::visit([&](auto &&arg) {
7141+ using T = std::decay_t<decltype(arg)>;
7142+ if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
7143+ }
7144+ else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
7145+ FfiConverterUInt64::write(stream, arg.unix_timestamp);
7146+ }
7147+ else {
7148+ static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
7149+ }
7150+ }, val.variant);
7151+}
7152+
7153+uint64_t FfiConverterSendExpiration::allocation_size(const SendExpiration &val) {
7154+ uint64_t size = sizeof(int32_t);
7155+
7156+ size += std::visit([&](auto &&arg) {
7157+ using T = std::decay_t<decltype(arg)>;
7158+ if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
7159+ uint64_t size = 0;
7160+ return size;
7161+ }
7162+ else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
7163+ uint64_t size = 0;
7164+ size += FfiConverterUInt64::allocation_size(arg.unix_timestamp);
7165+ return size;
7166+ }
7167+ else {
7168+ static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
7169+ }
7170+ }, val.variant);
7171+
7172+ return size;
7173+}
7174+
7175+
7176+SendMessageBody FfiConverterSendMessageBody::lift(RustBuffer buf) {
7177+ auto stream = RustStream(&buf);
7178+ auto ret = FfiConverterSendMessageBody::read(stream);
7179+
7180+ rustbuffer_free(buf);
7181+
7182+ return std::move(ret);
7183+}
7184+
7185+RustBuffer FfiConverterSendMessageBody::lower(const SendMessageBody &val) {
7186+ auto buf = rustbuffer_alloc(FfiConverterSendMessageBody::allocation_size(val));
7187+ auto stream = RustStream(&buf);
7188+
7189+ FfiConverterSendMessageBody::write(stream, val);
7190+
7191+ return std::move(buf);
7192+}
7193+
7194+SendMessageBody FfiConverterSendMessageBody::read(RustStream &stream) {
7195+ int32_t variant_id;
7196+ stream >> variant_id;
7197+
7198+ switch (variant_id) {
7199+
7200+ case 1:
7201+ return SendMessageBody::kEmpty {
7202+ };
7203+
7204+ case 2:
7205+ return SendMessageBody::kComment {
7206+ .text = FfiConverterString::read(stream),
7207+ };
7208+
7209+ case 3:
7210+ return SendMessageBody::kRawPayload {
7211+ .boc = FfiConverterTypeBoc::read(stream),
7212+ };
7213+
7214+ default:
7215+ throw std::runtime_error("No matching SendMessageBody variant");
7216+ }
7217+}
7218+
7219+void FfiConverterSendMessageBody::write(RustStream &stream, const SendMessageBody &val) {
7220+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7221+
7222+ stream << variant_id;
7223+
7224+ std::visit([&](auto &&arg) {
7225+ using T = std::decay_t<decltype(arg)>;
7226+ if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
7227+ }
7228+ else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
7229+ FfiConverterString::write(stream, arg.text);
7230+ }
7231+ else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
7232+ FfiConverterTypeBoc::write(stream, arg.boc);
7233+ }
7234+ else {
7235+ static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
7236+ }
7237+ }, val.variant);
7238+}
7239+
7240+uint64_t FfiConverterSendMessageBody::allocation_size(const SendMessageBody &val) {
7241+ uint64_t size = sizeof(int32_t);
7242+
7243+ size += std::visit([&](auto &&arg) {
7244+ using T = std::decay_t<decltype(arg)>;
7245+ if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
7246+ uint64_t size = 0;
7247+ return size;
7248+ }
7249+ else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
7250+ uint64_t size = 0;
7251+ size += FfiConverterString::allocation_size(arg.text);
7252+ return size;
7253+ }
7254+ else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
7255+ uint64_t size = 0;
7256+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
7257+ return size;
7258+ }
7259+ else {
7260+ static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
7261+ }
7262+ }, val.variant);
7263+
7264+ return size;
7265+}
7266+
7267+
7268+SendPhase FfiConverterSendPhase::lift(RustBuffer buf) {
7269+ auto stream = RustStream(&buf);
7270+ auto ret = FfiConverterSendPhase::read(stream);
7271+
7272+ rustbuffer_free(buf);
7273+
7274+ return std::move(ret);
7275+}
7276+
7277+RustBuffer FfiConverterSendPhase::lower(const SendPhase &val) {
7278+ auto buf = rustbuffer_alloc(FfiConverterSendPhase::allocation_size(val));
7279+ auto stream = RustStream(&buf);
7280+
7281+ FfiConverterSendPhase::write(stream, val);
7282+
7283+ return std::move(buf);
7284+}
7285+
7286+SendPhase FfiConverterSendPhase::read(RustStream &stream) {
7287+ int32_t variant;
7288+ stream >> variant;
7289+
7290+ switch (variant) {
7291+
7292+ case 1:
7293+ return SendPhase::kIdle;
7294+
7295+ case 2:
7296+ return SendPhase::kValidating;
7297+
7298+ case 3:
7299+ return SendPhase::kAuthorizing;
7300+
7301+ case 4:
7302+ return SendPhase::kPreparing;
7303+
7304+ case 5:
7305+ return SendPhase::kPersisting;
7306+
7307+ case 6:
7308+ return SendPhase::kReadyToSubmit;
7309+
7310+ case 7:
7311+ return SendPhase::kSubmitting;
7312+
7313+ case 8:
7314+ return SendPhase::kSubmissionUnknown;
7315+
7316+ case 9:
7317+ return SendPhase::kSubmitted;
7318+
7319+ case 10:
7320+ return SendPhase::kHandedOff;
7321+
7322+ case 11:
7323+ return SendPhase::kConfirmed;
7324+
7325+ case 12:
7326+ return SendPhase::kReplaced;
7327+
7328+ case 13:
7329+ return SendPhase::kSequenceNumberConsumed;
7330+
7331+ case 14:
7332+ return SendPhase::kExpired;
7333+
7334+ case 15:
7335+ return SendPhase::kSuperseded;
7336+
7337+ case 16:
7338+ return SendPhase::kFailed;
7339+
7340+ case 17:
7341+ return SendPhase::kCancelled;
7342+
7343+ default:
7344+ throw std::runtime_error("No matching SendPhase variant");
7345+ }
7346+}
7347+
7348+void FfiConverterSendPhase::write(RustStream &stream, const SendPhase &val) {
7349+ switch (val) {
7350+
7351+ case SendPhase::kIdle:
7352+ stream << static_cast<int32_t>(1);
7353+ break;
7354+
7355+ case SendPhase::kValidating:
7356+ stream << static_cast<int32_t>(2);
7357+ break;
7358+
7359+ case SendPhase::kAuthorizing:
7360+ stream << static_cast<int32_t>(3);
7361+ break;
7362+
7363+ case SendPhase::kPreparing:
7364+ stream << static_cast<int32_t>(4);
7365+ break;
7366+
7367+ case SendPhase::kPersisting:
7368+ stream << static_cast<int32_t>(5);
7369+ break;
7370+
7371+ case SendPhase::kReadyToSubmit:
7372+ stream << static_cast<int32_t>(6);
7373+ break;
7374+
7375+ case SendPhase::kSubmitting:
7376+ stream << static_cast<int32_t>(7);
7377+ break;
7378+
7379+ case SendPhase::kSubmissionUnknown:
7380+ stream << static_cast<int32_t>(8);
7381+ break;
7382+
7383+ case SendPhase::kSubmitted:
7384+ stream << static_cast<int32_t>(9);
7385+ break;
7386+
7387+ case SendPhase::kHandedOff:
7388+ stream << static_cast<int32_t>(10);
7389+ break;
7390+
7391+ case SendPhase::kConfirmed:
7392+ stream << static_cast<int32_t>(11);
7393+ break;
7394+
7395+ case SendPhase::kReplaced:
7396+ stream << static_cast<int32_t>(12);
7397+ break;
7398+
7399+ case SendPhase::kSequenceNumberConsumed:
7400+ stream << static_cast<int32_t>(13);
7401+ break;
7402+
7403+ case SendPhase::kExpired:
7404+ stream << static_cast<int32_t>(14);
7405+ break;
7406+
7407+ case SendPhase::kSuperseded:
7408+ stream << static_cast<int32_t>(15);
7409+ break;
7410+
7411+ case SendPhase::kFailed:
7412+ stream << static_cast<int32_t>(16);
7413+ break;
7414+
7415+ case SendPhase::kCancelled:
7416+ stream << static_cast<int32_t>(17);
7417+ break;
7418+
7419+ default:
7420+ throw std::runtime_error("No matching SendPhase variant");
7421+ }
7422+}
7423+
7424+uint64_t FfiConverterSendPhase::allocation_size(const SendPhase &) {
7425+ return static_cast<uint64_t>(sizeof(int32_t));
7426+}
7427+
7428+
7429+std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::lift(RustBuffer buf) {
7430+ auto stream = RustStream(&buf);
7431+ auto ret = FfiConverterStatuslessHostError::read(stream);
7432+
7433+ rustbuffer_free(buf);
7434+
7435+ return ret;
7436+}
7437+
7438+RustBuffer FfiConverterStatuslessHostError::lower(const StatuslessHostError &val) {
7439+ auto buf = rustbuffer_alloc(allocation_size(val));
7440+ auto stream = RustStream(&buf);
7441+
7442+ FfiConverterStatuslessHostError::write(stream, val);
7443+
7444+ return std::move(buf);
7445+}
7446+
7447+std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::read(RustStream &stream) {
7448+ int32_t v;
7449+ stream >> v;
7450+
7451+ switch (v) {
7452+ case 1:
7453+ {
7454+ statusless_host_error::Failed var("StatuslessHostError::Failed");
7455+ var.kind = FfiConverterStatuslessHostErrorKind::read(stream);
7456+ var.diagnostic = FfiConverterString::read(stream);
7457+ auto what_arg = FfiConverterString::lift(
7458+ rust_call(
7459+ uniffi_wallet_engine_fn_method_statuslesshosterror_uniffi_trait_display,
7460+ nullptr,
7461+ FfiConverterStatuslessHostError::lower(var)
7462+ )
7463+ );
7464+ auto ret = std::make_shared<statusless_host_error::Failed>(what_arg);
7465+ ret->kind = std::move(var.kind);
7466+ ret->diagnostic = std::move(var.diagnostic);
7467+ return ret;
7468+ }
7469+ default:
7470+ throw std::runtime_error("Unexpected error variant");
7471+ }
7472+}
7473+
7474+void FfiConverterStatuslessHostError::write(RustStream &stream, const StatuslessHostError &val) {
7475+ stream << val.get_variant_idx();
7476+ switch (val.get_variant_idx()) {
7477+ case 1:
7478+ {
7479+ auto var = static_cast<const statusless_host_error::Failed&>(val);
7480+ FfiConverterStatuslessHostErrorKind::write(stream, var.kind);
7481+ FfiConverterString::write(stream, var.diagnostic);
7482+ break;
7483+ }
7484+ }
7485+}
7486+
7487+uint64_t FfiConverterStatuslessHostError::allocation_size(const StatuslessHostError &val) {
7488+ switch (val.get_variant_idx()) {
7489+ case 1:
7490+ {
7491+ auto var = static_cast<const statusless_host_error::Failed&>(val);
7492+ return static_cast<uint64_t>(sizeof(int32_t)
7493+ + FfiConverterStatuslessHostErrorKind::allocation_size(var.kind)
7494+ + FfiConverterString::allocation_size(var.diagnostic));
7495+ }
7496+ default:
7497+ throw std::runtime_error("Unexpected error variant");
7498+ }
7499+}
7500+
7501+
7502+StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::lift(RustBuffer buf) {
7503+ auto stream = RustStream(&buf);
7504+ auto ret = FfiConverterStatuslessHostErrorKind::read(stream);
7505+
7506+ rustbuffer_free(buf);
7507+
7508+ return std::move(ret);
7509+}
7510+
7511+RustBuffer FfiConverterStatuslessHostErrorKind::lower(const StatuslessHostErrorKind &val) {
7512+ auto buf = rustbuffer_alloc(FfiConverterStatuslessHostErrorKind::allocation_size(val));
7513+ auto stream = RustStream(&buf);
7514+
7515+ FfiConverterStatuslessHostErrorKind::write(stream, val);
7516+
7517+ return std::move(buf);
7518+}
7519+
7520+StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::read(RustStream &stream) {
7521+ int32_t variant;
7522+ stream >> variant;
7523+
7524+ switch (variant) {
7525+
7526+ case 1:
7527+ return StatuslessHostErrorKind::kOffline;
7528+
7529+ case 2:
7530+ return StatuslessHostErrorKind::kTimeout;
7531+
7532+ case 3:
7533+ return StatuslessHostErrorKind::kConnectionLost;
7534+
7535+ case 4:
7536+ return StatuslessHostErrorKind::kPolicyViolation;
7537+
7538+ case 5:
7539+ return StatuslessHostErrorKind::kResponseTooLarge;
7540+
7541+ case 6:
7542+ return StatuslessHostErrorKind::kCancelled;
7543+
7544+ case 7:
7545+ return StatuslessHostErrorKind::kOther;
7546+
7547+ default:
7548+ throw std::runtime_error("No matching StatuslessHostErrorKind variant");
7549+ }
7550+}
7551+
7552+void FfiConverterStatuslessHostErrorKind::write(RustStream &stream, const StatuslessHostErrorKind &val) {
7553+ switch (val) {
7554+
7555+ case StatuslessHostErrorKind::kOffline:
7556+ stream << static_cast<int32_t>(1);
7557+ break;
7558+
7559+ case StatuslessHostErrorKind::kTimeout:
7560+ stream << static_cast<int32_t>(2);
7561+ break;
7562+
7563+ case StatuslessHostErrorKind::kConnectionLost:
7564+ stream << static_cast<int32_t>(3);
7565+ break;
7566+
7567+ case StatuslessHostErrorKind::kPolicyViolation:
7568+ stream << static_cast<int32_t>(4);
7569+ break;
7570+
7571+ case StatuslessHostErrorKind::kResponseTooLarge:
7572+ stream << static_cast<int32_t>(5);
7573+ break;
7574+
7575+ case StatuslessHostErrorKind::kCancelled:
7576+ stream << static_cast<int32_t>(6);
7577+ break;
7578+
7579+ case StatuslessHostErrorKind::kOther:
7580+ stream << static_cast<int32_t>(7);
7581+ break;
7582+
7583+ default:
7584+ throw std::runtime_error("No matching StatuslessHostErrorKind variant");
7585+ }
7586+}
7587+
7588+uint64_t FfiConverterStatuslessHostErrorKind::allocation_size(const StatuslessHostErrorKind &) {
7589+ return static_cast<uint64_t>(sizeof(int32_t));
7590+}
7591+
7592+
7593+std::shared_ptr<TonAddressError> FfiConverterTonAddressError::lift(RustBuffer buf) {
7594+ auto stream = RustStream(&buf);
7595+ auto ret = FfiConverterTonAddressError::read(stream);
7596+
7597+ rustbuffer_free(buf);
7598+
7599+ return ret;
7600+}
7601+
7602+RustBuffer FfiConverterTonAddressError::lower(const TonAddressError &val) {
7603+ auto buf = rustbuffer_alloc(allocation_size(val));
7604+ auto stream = RustStream(&buf);
7605+
7606+ FfiConverterTonAddressError::write(stream, val);
7607+
7608+ return std::move(buf);
7609+}
7610+
7611+std::shared_ptr<TonAddressError> FfiConverterTonAddressError::read(RustStream &stream) {
7612+ int32_t v;
7613+ stream >> v;
7614+
7615+ switch (v) {
7616+ case 1:
7617+ {
7618+ ton_address_error::InvalidAddress var("TonAddressError::InvalidAddress");
7619+ auto what_arg = FfiConverterString::lift(
7620+ rust_call(
7621+ uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
7622+ nullptr,
7623+ FfiConverterTonAddressError::lower(var)
7624+ )
7625+ );
7626+ auto ret = std::make_shared<ton_address_error::InvalidAddress>(what_arg);
7627+ return ret;
7628+ }
7629+ case 2:
7630+ {
7631+ ton_address_error::UnsupportedWorkchain var("TonAddressError::UnsupportedWorkchain");
7632+ auto what_arg = FfiConverterString::lift(
7633+ rust_call(
7634+ uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
7635+ nullptr,
7636+ FfiConverterTonAddressError::lower(var)
7637+ )
7638+ );
7639+ auto ret = std::make_shared<ton_address_error::UnsupportedWorkchain>(what_arg);
7640+ return ret;
7641+ }
7642+ default:
7643+ throw std::runtime_error("Unexpected error variant");
7644+ }
7645+}
7646+
7647+void FfiConverterTonAddressError::write(RustStream &stream, const TonAddressError &val) {
7648+ stream << val.get_variant_idx();
7649+ switch (val.get_variant_idx()) {
7650+ case 1:
7651+ {
7652+ auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
7653+ break;
7654+ }
7655+ case 2:
7656+ {
7657+ auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
7658+ break;
7659+ }
7660+ }
7661+}
7662+
7663+uint64_t FfiConverterTonAddressError::allocation_size(const TonAddressError &val) {
7664+ switch (val.get_variant_idx()) {
7665+ case 1:
7666+ {
7667+ auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
7668+ return static_cast<uint64_t>(sizeof(int32_t));
7669+ }
7670+ case 2:
7671+ {
7672+ auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
7673+ return static_cast<uint64_t>(sizeof(int32_t));
7674+ }
7675+ default:
7676+ throw std::runtime_error("Unexpected error variant");
7677+ }
7678+}
7679+
7680+
7681+TonAddressFormat FfiConverterTonAddressFormat::lift(RustBuffer buf) {
7682+ auto stream = RustStream(&buf);
7683+ auto ret = FfiConverterTonAddressFormat::read(stream);
7684+
7685+ rustbuffer_free(buf);
7686+
7687+ return std::move(ret);
7688+}
7689+
7690+RustBuffer FfiConverterTonAddressFormat::lower(const TonAddressFormat &val) {
7691+ auto buf = rustbuffer_alloc(FfiConverterTonAddressFormat::allocation_size(val));
7692+ auto stream = RustStream(&buf);
7693+
7694+ FfiConverterTonAddressFormat::write(stream, val);
7695+
7696+ return std::move(buf);
7697+}
7698+
7699+TonAddressFormat FfiConverterTonAddressFormat::read(RustStream &stream) {
7700+ int32_t variant_id;
7701+ stream >> variant_id;
7702+
7703+ switch (variant_id) {
7704+
7705+ case 1:
7706+ return TonAddressFormat::kRaw {
7707+ };
7708+
7709+ case 2:
7710+ return TonAddressFormat::kUserFriendly {
7711+ .bounceable = FfiConverterBool::read(stream),
7712+ .testnet = FfiConverterBool::read(stream),
7713+ };
7714+
7715+ default:
7716+ throw std::runtime_error("No matching TonAddressFormat variant");
7717+ }
7718+}
7719+
7720+void FfiConverterTonAddressFormat::write(RustStream &stream, const TonAddressFormat &val) {
7721+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7722+
7723+ stream << variant_id;
7724+
7725+ std::visit([&](auto &&arg) {
7726+ using T = std::decay_t<decltype(arg)>;
7727+ if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
7728+ }
7729+ else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
7730+ FfiConverterBool::write(stream, arg.bounceable);
7731+ FfiConverterBool::write(stream, arg.testnet);
7732+ }
7733+ else {
7734+ static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
7735+ }
7736+ }, val.variant);
7737+}
7738+
7739+uint64_t FfiConverterTonAddressFormat::allocation_size(const TonAddressFormat &val) {
7740+ uint64_t size = sizeof(int32_t);
7741+
7742+ size += std::visit([&](auto &&arg) {
7743+ using T = std::decay_t<decltype(arg)>;
7744+ if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
7745+ uint64_t size = 0;
7746+ return size;
7747+ }
7748+ else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
7749+ uint64_t size = 0;
7750+ size += FfiConverterBool::allocation_size(arg.bounceable);
7751+ size += FfiConverterBool::allocation_size(arg.testnet);
7752+ return size;
7753+ }
7754+ else {
7755+ static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
7756+ }
7757+ }, val.variant);
7758+
7759+ return size;
7760+}
7761+
7762+
7763+TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::lift(RustBuffer buf) {
7764+ auto stream = RustStream(&buf);
7765+ auto ret = FfiConverterTonConnectConnectErrorCode::read(stream);
7766+
7767+ rustbuffer_free(buf);
7768+
7769+ return std::move(ret);
7770+}
7771+
7772+RustBuffer FfiConverterTonConnectConnectErrorCode::lower(const TonConnectConnectErrorCode &val) {
7773+ auto buf = rustbuffer_alloc(FfiConverterTonConnectConnectErrorCode::allocation_size(val));
7774+ auto stream = RustStream(&buf);
7775+
7776+ FfiConverterTonConnectConnectErrorCode::write(stream, val);
7777+
7778+ return std::move(buf);
7779+}
7780+
7781+TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::read(RustStream &stream) {
7782+ int32_t variant;
7783+ stream >> variant;
7784+
7785+ switch (variant) {
7786+
7787+ case 1:
7788+ return TonConnectConnectErrorCode::kManifestNotFound;
7789+
7790+ case 2:
7791+ return TonConnectConnectErrorCode::kManifestContent;
7792+
7793+ case 3:
7794+ return TonConnectConnectErrorCode::kUserDeclined;
7795+
7796+ default:
7797+ throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
7798+ }
7799+}
7800+
7801+void FfiConverterTonConnectConnectErrorCode::write(RustStream &stream, const TonConnectConnectErrorCode &val) {
7802+ switch (val) {
7803+
7804+ case TonConnectConnectErrorCode::kManifestNotFound:
7805+ stream << static_cast<int32_t>(1);
7806+ break;
7807+
7808+ case TonConnectConnectErrorCode::kManifestContent:
7809+ stream << static_cast<int32_t>(2);
7810+ break;
7811+
7812+ case TonConnectConnectErrorCode::kUserDeclined:
7813+ stream << static_cast<int32_t>(3);
7814+ break;
7815+
7816+ default:
7817+ throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
7818+ }
7819+}
7820+
7821+uint64_t FfiConverterTonConnectConnectErrorCode::allocation_size(const TonConnectConnectErrorCode &) {
7822+ return static_cast<uint64_t>(sizeof(int32_t));
7823+}
7824+
7825+
7826+TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::lift(RustBuffer buf) {
7827+ auto stream = RustStream(&buf);
7828+ auto ret = FfiConverterTonConnectDevicePlatform::read(stream);
7829+
7830+ rustbuffer_free(buf);
7831+
7832+ return std::move(ret);
7833+}
7834+
7835+RustBuffer FfiConverterTonConnectDevicePlatform::lower(const TonConnectDevicePlatform &val) {
7836+ auto buf = rustbuffer_alloc(FfiConverterTonConnectDevicePlatform::allocation_size(val));
7837+ auto stream = RustStream(&buf);
7838+
7839+ FfiConverterTonConnectDevicePlatform::write(stream, val);
7840+
7841+ return std::move(buf);
7842+}
7843+
7844+TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::read(RustStream &stream) {
7845+ int32_t variant;
7846+ stream >> variant;
7847+
7848+ switch (variant) {
7849+
7850+ case 1:
7851+ return TonConnectDevicePlatform::kIphone;
7852+
7853+ case 2:
7854+ return TonConnectDevicePlatform::kIpad;
7855+
7856+ case 3:
7857+ return TonConnectDevicePlatform::kAndroid;
7858+
7859+ case 4:
7860+ return TonConnectDevicePlatform::kWindows;
7861+
7862+ case 5:
7863+ return TonConnectDevicePlatform::kMac;
7864+
7865+ case 6:
7866+ return TonConnectDevicePlatform::kLinux;
7867+
7868+ case 7:
7869+ return TonConnectDevicePlatform::kBrowser;
7870+
7871+ default:
7872+ throw std::runtime_error("No matching TonConnectDevicePlatform variant");
7873+ }
7874+}
7875+
7876+void FfiConverterTonConnectDevicePlatform::write(RustStream &stream, const TonConnectDevicePlatform &val) {
7877+ switch (val) {
7878+
7879+ case TonConnectDevicePlatform::kIphone:
7880+ stream << static_cast<int32_t>(1);
7881+ break;
7882+
7883+ case TonConnectDevicePlatform::kIpad:
7884+ stream << static_cast<int32_t>(2);
7885+ break;
7886+
7887+ case TonConnectDevicePlatform::kAndroid:
7888+ stream << static_cast<int32_t>(3);
7889+ break;
7890+
7891+ case TonConnectDevicePlatform::kWindows:
7892+ stream << static_cast<int32_t>(4);
7893+ break;
7894+
7895+ case TonConnectDevicePlatform::kMac:
7896+ stream << static_cast<int32_t>(5);
7897+ break;
7898+
7899+ case TonConnectDevicePlatform::kLinux:
7900+ stream << static_cast<int32_t>(6);
7901+ break;
7902+
7903+ case TonConnectDevicePlatform::kBrowser:
7904+ stream << static_cast<int32_t>(7);
7905+ break;
7906+
7907+ default:
7908+ throw std::runtime_error("No matching TonConnectDevicePlatform variant");
7909+ }
7910+}
7911+
7912+uint64_t FfiConverterTonConnectDevicePlatform::allocation_size(const TonConnectDevicePlatform &) {
7913+ return static_cast<uint64_t>(sizeof(int32_t));
7914+}
7915+
7916+
7917+TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::lift(RustBuffer buf) {
7918+ auto stream = RustStream(&buf);
7919+ auto ret = FfiConverterTonConnectIncomingRequest::read(stream);
7920+
7921+ rustbuffer_free(buf);
7922+
7923+ return std::move(ret);
7924+}
7925+
7926+RustBuffer FfiConverterTonConnectIncomingRequest::lower(const TonConnectIncomingRequest &val) {
7927+ auto buf = rustbuffer_alloc(FfiConverterTonConnectIncomingRequest::allocation_size(val));
7928+ auto stream = RustStream(&buf);
7929+
7930+ FfiConverterTonConnectIncomingRequest::write(stream, val);
7931+
7932+ return std::move(buf);
7933+}
7934+
7935+TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::read(RustStream &stream) {
7936+ int32_t variant_id;
7937+ stream >> variant_id;
7938+
7939+ switch (variant_id) {
7940+
7941+ case 1:
7942+ return TonConnectIncomingRequest::kSendTransaction {
7943+ .id = FfiConverterString::read(stream),
7944+ .method = FfiConverterString::read(stream),
7945+ .request = FfiConverterTypeSendRequest::read(stream),
7946+ };
7947+
7948+ case 2:
7949+ return TonConnectIncomingRequest::kSignMessage {
7950+ .id = FfiConverterString::read(stream),
7951+ .method = FfiConverterString::read(stream),
7952+ .request = FfiConverterTypeSignMessageRequest::read(stream),
7953+ };
7954+
7955+ case 3:
7956+ return TonConnectIncomingRequest::kDisconnect {
7957+ .id = FfiConverterString::read(stream),
7958+ .method = FfiConverterString::read(stream),
7959+ };
7960+
7961+ case 4:
7962+ return TonConnectIncomingRequest::kUnsupported {
7963+ .id = FfiConverterString::read(stream),
7964+ .method = FfiConverterString::read(stream),
7965+ .error_code = FfiConverterTonConnectRpcErrorCode::read(stream),
7966+ .error_message = FfiConverterString::read(stream),
7967+ };
7968+
7969+ case 5:
7970+ return TonConnectIncomingRequest::kSignData {
7971+ .id = FfiConverterString::read(stream),
7972+ .method = FfiConverterString::read(stream),
7973+ .request = FfiConverterTypeTonConnectSignDataRequest::read(stream),
7974+ };
7975+
7976+ default:
7977+ throw std::runtime_error("No matching TonConnectIncomingRequest variant");
7978+ }
7979+}
7980+
7981+void FfiConverterTonConnectIncomingRequest::write(RustStream &stream, const TonConnectIncomingRequest &val) {
7982+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
7983+
7984+ stream << variant_id;
7985+
7986+ std::visit([&](auto &&arg) {
7987+ using T = std::decay_t<decltype(arg)>;
7988+ if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSendTransaction>) {
7989+ FfiConverterString::write(stream, arg.id);
7990+ FfiConverterString::write(stream, arg.method);
7991+ FfiConverterTypeSendRequest::write(stream, arg.request);
7992+ }
7993+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignMessage>) {
7994+ FfiConverterString::write(stream, arg.id);
7995+ FfiConverterString::write(stream, arg.method);
7996+ FfiConverterTypeSignMessageRequest::write(stream, arg.request);
7997+ }
7998+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
7999+ FfiConverterString::write(stream, arg.id);
8000+ FfiConverterString::write(stream, arg.method);
8001+ }
8002+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kUnsupported>) {
8003+ FfiConverterString::write(stream, arg.id);
8004+ FfiConverterString::write(stream, arg.method);
8005+ FfiConverterTonConnectRpcErrorCode::write(stream, arg.error_code);
8006+ FfiConverterString::write(stream, arg.error_message);
8007+ }
8008+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignData>) {
8009+ FfiConverterString::write(stream, arg.id);
8010+ FfiConverterString::write(stream, arg.method);
8011+ FfiConverterTypeTonConnectSignDataRequest::write(stream, arg.request);
8012+ }
8013+ else {
8014+ static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
8015+ }
8016+ }, val.variant);
8017+}
8018+
8019+uint64_t FfiConverterTonConnectIncomingRequest::allocation_size(const TonConnectIncomingRequest &val) {
8020+ uint64_t size = sizeof(int32_t);
8021+
8022+ size += std::visit([&](auto &&arg) {
8023+ using T = std::decay_t<decltype(arg)>;
8024+ if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSendTransaction>) {
8025+ uint64_t size = 0;
8026+ size += FfiConverterString::allocation_size(arg.id);
8027+ size += FfiConverterString::allocation_size(arg.method);
8028+ size += FfiConverterTypeSendRequest::allocation_size(arg.request);
8029+ return size;
8030+ }
8031+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignMessage>) {
8032+ uint64_t size = 0;
8033+ size += FfiConverterString::allocation_size(arg.id);
8034+ size += FfiConverterString::allocation_size(arg.method);
8035+ size += FfiConverterTypeSignMessageRequest::allocation_size(arg.request);
8036+ return size;
8037+ }
8038+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
8039+ uint64_t size = 0;
8040+ size += FfiConverterString::allocation_size(arg.id);
8041+ size += FfiConverterString::allocation_size(arg.method);
8042+ return size;
8043+ }
8044+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kUnsupported>) {
8045+ uint64_t size = 0;
8046+ size += FfiConverterString::allocation_size(arg.id);
8047+ size += FfiConverterString::allocation_size(arg.method);
8048+ size += FfiConverterTonConnectRpcErrorCode::allocation_size(arg.error_code);
8049+ size += FfiConverterString::allocation_size(arg.error_message);
8050+ return size;
8051+ }
8052+ else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignData>) {
8053+ uint64_t size = 0;
8054+ size += FfiConverterString::allocation_size(arg.id);
8055+ size += FfiConverterString::allocation_size(arg.method);
8056+ size += FfiConverterTypeTonConnectSignDataRequest::allocation_size(arg.request);
8057+ return size;
8058+ }
8059+ else {
8060+ static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
8061+ }
8062+ }, val.variant);
8063+
8064+ return size;
8065+}
8066+
8067+
8068+TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::lift(RustBuffer buf) {
8069+ auto stream = RustStream(&buf);
8070+ auto ret = FfiConverterTonConnectRpcErrorCode::read(stream);
8071+
8072+ rustbuffer_free(buf);
8073+
8074+ return std::move(ret);
8075+}
8076+
8077+RustBuffer FfiConverterTonConnectRpcErrorCode::lower(const TonConnectRpcErrorCode &val) {
8078+ auto buf = rustbuffer_alloc(FfiConverterTonConnectRpcErrorCode::allocation_size(val));
8079+ auto stream = RustStream(&buf);
8080+
8081+ FfiConverterTonConnectRpcErrorCode::write(stream, val);
8082+
8083+ return std::move(buf);
8084+}
8085+
8086+TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::read(RustStream &stream) {
8087+ int32_t variant;
8088+ stream >> variant;
8089+
8090+ switch (variant) {
8091+
8092+ case 1:
8093+ return TonConnectRpcErrorCode::kUnknown;
8094+
8095+ case 2:
8096+ return TonConnectRpcErrorCode::kBadRequest;
8097+
8098+ case 3:
8099+ return TonConnectRpcErrorCode::kUnknownApp;
8100+
8101+ case 4:
8102+ return TonConnectRpcErrorCode::kUserDeclined;
8103+
8104+ case 5:
8105+ return TonConnectRpcErrorCode::kMethodNotSupported;
8106+
8107+ default:
8108+ throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
8109+ }
8110+}
8111+
8112+void FfiConverterTonConnectRpcErrorCode::write(RustStream &stream, const TonConnectRpcErrorCode &val) {
8113+ switch (val) {
8114+
8115+ case TonConnectRpcErrorCode::kUnknown:
8116+ stream << static_cast<int32_t>(1);
8117+ break;
8118+
8119+ case TonConnectRpcErrorCode::kBadRequest:
8120+ stream << static_cast<int32_t>(2);
8121+ break;
8122+
8123+ case TonConnectRpcErrorCode::kUnknownApp:
8124+ stream << static_cast<int32_t>(3);
8125+ break;
8126+
8127+ case TonConnectRpcErrorCode::kUserDeclined:
8128+ stream << static_cast<int32_t>(4);
8129+ break;
8130+
8131+ case TonConnectRpcErrorCode::kMethodNotSupported:
8132+ stream << static_cast<int32_t>(5);
8133+ break;
8134+
8135+ default:
8136+ throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
8137+ }
8138+}
8139+
8140+uint64_t FfiConverterTonConnectRpcErrorCode::allocation_size(const TonConnectRpcErrorCode &) {
8141+ return static_cast<uint64_t>(sizeof(int32_t));
8142+}
8143+
8144+
8145+std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::lift(RustBuffer buf) {
8146+ auto stream = RustStream(&buf);
8147+ auto ret = FfiConverterTonConnectSessionError::read(stream);
8148+
8149+ rustbuffer_free(buf);
8150+
8151+ return ret;
8152+}
8153+
8154+RustBuffer FfiConverterTonConnectSessionError::lower(const TonConnectSessionError &val) {
8155+ auto buf = rustbuffer_alloc(allocation_size(val));
8156+ auto stream = RustStream(&buf);
8157+
8158+ FfiConverterTonConnectSessionError::write(stream, val);
8159+
8160+ return std::move(buf);
8161+}
8162+
8163+std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::read(RustStream &stream) {
8164+ int32_t v;
8165+ stream >> v;
8166+
8167+ switch (v) {
8168+ case 1:
8169+ {
8170+ ton_connect_session_error::Failed var("TonConnectSessionError::Failed");
8171+ var.diagnostic = FfiConverterString::read(stream);
8172+ auto what_arg = FfiConverterString::lift(
8173+ rust_call(
8174+ uniffi_wallet_engine_fn_method_tonconnectsessionerror_uniffi_trait_display,
8175+ nullptr,
8176+ FfiConverterTonConnectSessionError::lower(var)
8177+ )
8178+ );
8179+ auto ret = std::make_shared<ton_connect_session_error::Failed>(what_arg);
8180+ ret->diagnostic = std::move(var.diagnostic);
8181+ return ret;
8182+ }
8183+ default:
8184+ throw std::runtime_error("Unexpected error variant");
8185+ }
8186+}
8187+
8188+void FfiConverterTonConnectSessionError::write(RustStream &stream, const TonConnectSessionError &val) {
8189+ stream << val.get_variant_idx();
8190+ switch (val.get_variant_idx()) {
8191+ case 1:
8192+ {
8193+ auto var = static_cast<const ton_connect_session_error::Failed&>(val);
8194+ FfiConverterString::write(stream, var.diagnostic);
8195+ break;
8196+ }
8197+ }
8198+}
8199+
8200+uint64_t FfiConverterTonConnectSessionError::allocation_size(const TonConnectSessionError &val) {
8201+ switch (val.get_variant_idx()) {
8202+ case 1:
8203+ {
8204+ auto var = static_cast<const ton_connect_session_error::Failed&>(val);
8205+ return static_cast<uint64_t>(sizeof(int32_t)
8206+ + FfiConverterString::allocation_size(var.diagnostic));
8207+ }
8208+ default:
8209+ throw std::runtime_error("Unexpected error variant");
8210+ }
8211+}
8212+
8213+
8214+TonConnectSessionPhase FfiConverterTonConnectSessionPhase::lift(RustBuffer buf) {
8215+ auto stream = RustStream(&buf);
8216+ auto ret = FfiConverterTonConnectSessionPhase::read(stream);
8217+
8218+ rustbuffer_free(buf);
8219+
8220+ return std::move(ret);
8221+}
8222+
8223+RustBuffer FfiConverterTonConnectSessionPhase::lower(const TonConnectSessionPhase &val) {
8224+ auto buf = rustbuffer_alloc(FfiConverterTonConnectSessionPhase::allocation_size(val));
8225+ auto stream = RustStream(&buf);
8226+
8227+ FfiConverterTonConnectSessionPhase::write(stream, val);
8228+
8229+ return std::move(buf);
8230+}
8231+
8232+TonConnectSessionPhase FfiConverterTonConnectSessionPhase::read(RustStream &stream) {
8233+ int32_t variant;
8234+ stream >> variant;
8235+
8236+ switch (variant) {
8237+
8238+ case 1:
8239+ return TonConnectSessionPhase::kPendingConnect;
8240+
8241+ case 2:
8242+ return TonConnectSessionPhase::kConnected;
8243+
8244+ case 3:
8245+ return TonConnectSessionPhase::kDisconnected;
8246+
8247+ default:
8248+ throw std::runtime_error("No matching TonConnectSessionPhase variant");
8249+ }
8250+}
8251+
8252+void FfiConverterTonConnectSessionPhase::write(RustStream &stream, const TonConnectSessionPhase &val) {
8253+ switch (val) {
8254+
8255+ case TonConnectSessionPhase::kPendingConnect:
8256+ stream << static_cast<int32_t>(1);
8257+ break;
8258+
8259+ case TonConnectSessionPhase::kConnected:
8260+ stream << static_cast<int32_t>(2);
8261+ break;
8262+
8263+ case TonConnectSessionPhase::kDisconnected:
8264+ stream << static_cast<int32_t>(3);
8265+ break;
8266+
8267+ default:
8268+ throw std::runtime_error("No matching TonConnectSessionPhase variant");
8269+ }
8270+}
8271+
8272+uint64_t FfiConverterTonConnectSessionPhase::allocation_size(const TonConnectSessionPhase &) {
8273+ return static_cast<uint64_t>(sizeof(int32_t));
8274+}
8275+
8276+
8277+TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::lift(RustBuffer buf) {
8278+ auto stream = RustStream(&buf);
8279+ auto ret = FfiConverterTonConnectSignDataPayload::read(stream);
8280+
8281+ rustbuffer_free(buf);
8282+
8283+ return std::move(ret);
8284+}
8285+
8286+RustBuffer FfiConverterTonConnectSignDataPayload::lower(const TonConnectSignDataPayload &val) {
8287+ auto buf = rustbuffer_alloc(FfiConverterTonConnectSignDataPayload::allocation_size(val));
8288+ auto stream = RustStream(&buf);
8289+
8290+ FfiConverterTonConnectSignDataPayload::write(stream, val);
8291+
8292+ return std::move(buf);
8293+}
8294+
8295+TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::read(RustStream &stream) {
8296+ int32_t variant_id;
8297+ stream >> variant_id;
8298+
8299+ switch (variant_id) {
8300+
8301+ case 1:
8302+ return TonConnectSignDataPayload::kText {
8303+ .text = FfiConverterString::read(stream),
8304+ };
8305+
8306+ case 2:
8307+ return TonConnectSignDataPayload::kBinary {
8308+ .bytes = FfiConverterString::read(stream),
8309+ };
8310+
8311+ case 3:
8312+ return TonConnectSignDataPayload::kCell {
8313+ .schema = FfiConverterString::read(stream),
8314+ .cell = FfiConverterString::read(stream),
8315+ };
8316+
8317+ default:
8318+ throw std::runtime_error("No matching TonConnectSignDataPayload variant");
8319+ }
8320+}
8321+
8322+void FfiConverterTonConnectSignDataPayload::write(RustStream &stream, const TonConnectSignDataPayload &val) {
8323+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8324+
8325+ stream << variant_id;
8326+
8327+ std::visit([&](auto &&arg) {
8328+ using T = std::decay_t<decltype(arg)>;
8329+ if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kText>) {
8330+ FfiConverterString::write(stream, arg.text);
8331+ }
8332+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
8333+ FfiConverterString::write(stream, arg.bytes);
8334+ }
8335+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
8336+ FfiConverterString::write(stream, arg.schema);
8337+ FfiConverterString::write(stream, arg.cell);
8338+ }
8339+ else {
8340+ static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
8341+ }
8342+ }, val.variant);
8343+}
8344+
8345+uint64_t FfiConverterTonConnectSignDataPayload::allocation_size(const TonConnectSignDataPayload &val) {
8346+ uint64_t size = sizeof(int32_t);
8347+
8348+ size += std::visit([&](auto &&arg) {
8349+ using T = std::decay_t<decltype(arg)>;
8350+ if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kText>) {
8351+ uint64_t size = 0;
8352+ size += FfiConverterString::allocation_size(arg.text);
8353+ return size;
8354+ }
8355+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
8356+ uint64_t size = 0;
8357+ size += FfiConverterString::allocation_size(arg.bytes);
8358+ return size;
8359+ }
8360+ else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
8361+ uint64_t size = 0;
8362+ size += FfiConverterString::allocation_size(arg.schema);
8363+ size += FfiConverterString::allocation_size(arg.cell);
8364+ return size;
8365+ }
8366+ else {
8367+ static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
8368+ }
8369+ }, val.variant);
8370+
8371+ return size;
8372+}
8373+
8374+
8375+TonTransferAsset FfiConverterTonTransferAsset::lift(RustBuffer buf) {
8376+ auto stream = RustStream(&buf);
8377+ auto ret = FfiConverterTonTransferAsset::read(stream);
8378+
8379+ rustbuffer_free(buf);
8380+
8381+ return std::move(ret);
8382+}
8383+
8384+RustBuffer FfiConverterTonTransferAsset::lower(const TonTransferAsset &val) {
8385+ auto buf = rustbuffer_alloc(FfiConverterTonTransferAsset::allocation_size(val));
8386+ auto stream = RustStream(&buf);
8387+
8388+ FfiConverterTonTransferAsset::write(stream, val);
8389+
8390+ return std::move(buf);
8391+}
8392+
8393+TonTransferAsset FfiConverterTonTransferAsset::read(RustStream &stream) {
8394+ int32_t variant_id;
8395+ stream >> variant_id;
8396+
8397+ switch (variant_id) {
8398+
8399+ case 1:
8400+ return TonTransferAsset::kGram {
8401+ };
8402+
8403+ case 2:
8404+ return TonTransferAsset::kJetton {
8405+ .master = FfiConverterTypeTonAddressString::read(stream),
8406+ };
8407+
8408+ default:
8409+ throw std::runtime_error("No matching TonTransferAsset variant");
8410+ }
8411+}
8412+
8413+void FfiConverterTonTransferAsset::write(RustStream &stream, const TonTransferAsset &val) {
8414+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8415+
8416+ stream << variant_id;
8417+
8418+ std::visit([&](auto &&arg) {
8419+ using T = std::decay_t<decltype(arg)>;
8420+ if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
8421+ }
8422+ else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
8423+ FfiConverterTypeTonAddressString::write(stream, arg.master);
8424+ }
8425+ else {
8426+ static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
8427+ }
8428+ }, val.variant);
8429+}
8430+
8431+uint64_t FfiConverterTonTransferAsset::allocation_size(const TonTransferAsset &val) {
8432+ uint64_t size = sizeof(int32_t);
8433+
8434+ size += std::visit([&](auto &&arg) {
8435+ using T = std::decay_t<decltype(arg)>;
8436+ if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
8437+ uint64_t size = 0;
8438+ return size;
8439+ }
8440+ else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
8441+ uint64_t size = 0;
8442+ size += FfiConverterTypeTonAddressString::allocation_size(arg.master);
8443+ return size;
8444+ }
8445+ else {
8446+ static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
8447+ }
8448+ }, val.variant);
8449+
8450+ return size;
8451+}
8452+
8453+
8454+std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::lift(RustBuffer buf) {
8455+ auto stream = RustStream(&buf);
8456+ auto ret = FfiConverterTonTransferLinkError::read(stream);
8457+
8458+ rustbuffer_free(buf);
8459+
8460+ return ret;
8461+}
8462+
8463+RustBuffer FfiConverterTonTransferLinkError::lower(const TonTransferLinkError &val) {
8464+ auto buf = rustbuffer_alloc(allocation_size(val));
8465+ auto stream = RustStream(&buf);
8466+
8467+ FfiConverterTonTransferLinkError::write(stream, val);
8468+
8469+ return std::move(buf);
8470+}
8471+
8472+std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::read(RustStream &stream) {
8473+ int32_t v;
8474+ stream >> v;
8475+
8476+ switch (v) {
8477+ case 1:
8478+ {
8479+ ton_transfer_link_error::NotTonTransfer var("TonTransferLinkError::NotTonTransfer");
8480+ return std::make_shared<ton_transfer_link_error::NotTonTransfer>(var);
8481+ }
8482+ case 2:
8483+ {
8484+ ton_transfer_link_error::InvalidUrl var("TonTransferLinkError::InvalidUrl");
8485+ return std::make_shared<ton_transfer_link_error::InvalidUrl>(var);
8486+ }
8487+ case 3:
8488+ {
8489+ ton_transfer_link_error::MissingRecipient var("TonTransferLinkError::MissingRecipient");
8490+ return std::make_shared<ton_transfer_link_error::MissingRecipient>(var);
8491+ }
8492+ case 4:
8493+ {
8494+ ton_transfer_link_error::InvalidRecipient var("TonTransferLinkError::InvalidRecipient");
8495+ return std::make_shared<ton_transfer_link_error::InvalidRecipient>(var);
8496+ }
8497+ case 5:
8498+ {
8499+ ton_transfer_link_error::DuplicateParameter var("TonTransferLinkError::DuplicateParameter");
8500+ var.name = FfiConverterString::read(stream);
8501+ return std::make_shared<ton_transfer_link_error::DuplicateParameter>(var);
8502+ }
8503+ case 6:
8504+ {
8505+ ton_transfer_link_error::UnsupportedParameter var("TonTransferLinkError::UnsupportedParameter");
8506+ var.name = FfiConverterString::read(stream);
8507+ return std::make_shared<ton_transfer_link_error::UnsupportedParameter>(var);
8508+ }
8509+ case 7:
8510+ {
8511+ ton_transfer_link_error::InvalidAmount var("TonTransferLinkError::InvalidAmount");
8512+ return std::make_shared<ton_transfer_link_error::InvalidAmount>(var);
8513+ }
8514+ case 8:
8515+ {
8516+ ton_transfer_link_error::InvalidExpiration var("TonTransferLinkError::InvalidExpiration");
8517+ return std::make_shared<ton_transfer_link_error::InvalidExpiration>(var);
8518+ }
8519+ case 9:
8520+ {
8521+ ton_transfer_link_error::InvalidJettonMaster var("TonTransferLinkError::InvalidJettonMaster");
8522+ return std::make_shared<ton_transfer_link_error::InvalidJettonMaster>(var);
8523+ }
8524+ case 10:
8525+ {
8526+ ton_transfer_link_error::InvalidBinaryPayload var("TonTransferLinkError::InvalidBinaryPayload");
8527+ return std::make_shared<ton_transfer_link_error::InvalidBinaryPayload>(var);
8528+ }
8529+ case 11:
8530+ {
8531+ ton_transfer_link_error::ConflictingPayloads var("TonTransferLinkError::ConflictingPayloads");
8532+ return std::make_shared<ton_transfer_link_error::ConflictingPayloads>(var);
8533+ }
8534+ case 12:
8535+ {
8536+ ton_transfer_link_error::BinaryJettonConflict var("TonTransferLinkError::BinaryJettonConflict");
8537+ return std::make_shared<ton_transfer_link_error::BinaryJettonConflict>(var);
8538+ }
8539+ default:
8540+ throw std::runtime_error("Unexpected error variant");
8541+ }
8542+}
8543+
8544+void FfiConverterTonTransferLinkError::write(RustStream &stream, const TonTransferLinkError &val) {
8545+ stream << val.get_variant_idx();
8546+ switch (val.get_variant_idx()) {
8547+ case 1:
8548+ {
8549+ auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
8550+ break;
8551+ }
8552+ case 2:
8553+ {
8554+ auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
8555+ break;
8556+ }
8557+ case 3:
8558+ {
8559+ auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
8560+ break;
8561+ }
8562+ case 4:
8563+ {
8564+ auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
8565+ break;
8566+ }
8567+ case 5:
8568+ {
8569+ auto var = static_cast<const ton_transfer_link_error::DuplicateParameter&>(val);
8570+ FfiConverterString::write(stream, var.name);
8571+ break;
8572+ }
8573+ case 6:
8574+ {
8575+ auto var = static_cast<const ton_transfer_link_error::UnsupportedParameter&>(val);
8576+ FfiConverterString::write(stream, var.name);
8577+ break;
8578+ }
8579+ case 7:
8580+ {
8581+ auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
8582+ break;
8583+ }
8584+ case 8:
8585+ {
8586+ auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
8587+ break;
8588+ }
8589+ case 9:
8590+ {
8591+ auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
8592+ break;
8593+ }
8594+ case 10:
8595+ {
8596+ auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
8597+ break;
8598+ }
8599+ case 11:
8600+ {
8601+ auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
8602+ break;
8603+ }
8604+ case 12:
8605+ {
8606+ auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
8607+ break;
8608+ }
8609+ }
8610+}
8611+
8612+uint64_t FfiConverterTonTransferLinkError::allocation_size(const TonTransferLinkError &val) {
8613+ switch (val.get_variant_idx()) {
8614+ case 1:
8615+ {
8616+ auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
8617+ return static_cast<uint64_t>(sizeof(int32_t));
8618+ }
8619+ case 2:
8620+ {
8621+ auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
8622+ return static_cast<uint64_t>(sizeof(int32_t));
8623+ }
8624+ case 3:
8625+ {
8626+ auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
8627+ return static_cast<uint64_t>(sizeof(int32_t));
8628+ }
8629+ case 4:
8630+ {
8631+ auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
8632+ return static_cast<uint64_t>(sizeof(int32_t));
8633+ }
8634+ case 5:
8635+ {
8636+ auto var = static_cast<const ton_transfer_link_error::DuplicateParameter&>(val);
8637+ return static_cast<uint64_t>(sizeof(int32_t)
8638+ + FfiConverterString::allocation_size(var.name));
8639+ }
8640+ case 6:
8641+ {
8642+ auto var = static_cast<const ton_transfer_link_error::UnsupportedParameter&>(val);
8643+ return static_cast<uint64_t>(sizeof(int32_t)
8644+ + FfiConverterString::allocation_size(var.name));
8645+ }
8646+ case 7:
8647+ {
8648+ auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
8649+ return static_cast<uint64_t>(sizeof(int32_t));
8650+ }
8651+ case 8:
8652+ {
8653+ auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
8654+ return static_cast<uint64_t>(sizeof(int32_t));
8655+ }
8656+ case 9:
8657+ {
8658+ auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
8659+ return static_cast<uint64_t>(sizeof(int32_t));
8660+ }
8661+ case 10:
8662+ {
8663+ auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
8664+ return static_cast<uint64_t>(sizeof(int32_t));
8665+ }
8666+ case 11:
8667+ {
8668+ auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
8669+ return static_cast<uint64_t>(sizeof(int32_t));
8670+ }
8671+ case 12:
8672+ {
8673+ auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
8674+ return static_cast<uint64_t>(sizeof(int32_t));
8675+ }
8676+ default:
8677+ throw std::runtime_error("Unexpected error variant");
8678+ }
8679+}
8680+
8681+
8682+TonTransferPayload FfiConverterTonTransferPayload::lift(RustBuffer buf) {
8683+ auto stream = RustStream(&buf);
8684+ auto ret = FfiConverterTonTransferPayload::read(stream);
8685+
8686+ rustbuffer_free(buf);
8687+
8688+ return std::move(ret);
8689+}
8690+
8691+RustBuffer FfiConverterTonTransferPayload::lower(const TonTransferPayload &val) {
8692+ auto buf = rustbuffer_alloc(FfiConverterTonTransferPayload::allocation_size(val));
8693+ auto stream = RustStream(&buf);
8694+
8695+ FfiConverterTonTransferPayload::write(stream, val);
8696+
8697+ return std::move(buf);
8698+}
8699+
8700+TonTransferPayload FfiConverterTonTransferPayload::read(RustStream &stream) {
8701+ int32_t variant_id;
8702+ stream >> variant_id;
8703+
8704+ switch (variant_id) {
8705+
8706+ case 1:
8707+ return TonTransferPayload::kNone {
8708+ };
8709+
8710+ case 2:
8711+ return TonTransferPayload::kText {
8712+ .text = FfiConverterString::read(stream),
8713+ };
8714+
8715+ case 3:
8716+ return TonTransferPayload::kBoc {
8717+ .boc = FfiConverterTypeBoc::read(stream),
8718+ };
8719+
8720+ default:
8721+ throw std::runtime_error("No matching TonTransferPayload variant");
8722+ }
8723+}
8724+
8725+void FfiConverterTonTransferPayload::write(RustStream &stream, const TonTransferPayload &val) {
8726+ int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
8727+
8728+ stream << variant_id;
8729+
8730+ std::visit([&](auto &&arg) {
8731+ using T = std::decay_t<decltype(arg)>;
8732+ if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
8733+ }
8734+ else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
8735+ FfiConverterString::write(stream, arg.text);
8736+ }
8737+ else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
8738+ FfiConverterTypeBoc::write(stream, arg.boc);
8739+ }
8740+ else {
8741+ static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
8742+ }
8743+ }, val.variant);
8744+}
8745+
8746+uint64_t FfiConverterTonTransferPayload::allocation_size(const TonTransferPayload &val) {
8747+ uint64_t size = sizeof(int32_t);
8748+
8749+ size += std::visit([&](auto &&arg) {
8750+ using T = std::decay_t<decltype(arg)>;
8751+ if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
8752+ uint64_t size = 0;
8753+ return size;
8754+ }
8755+ else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
8756+ uint64_t size = 0;
8757+ size += FfiConverterString::allocation_size(arg.text);
8758+ return size;
8759+ }
8760+ else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
8761+ uint64_t size = 0;
8762+ size += FfiConverterTypeBoc::allocation_size(arg.boc);
8763+ return size;
8764+ }
8765+ else {
8766+ static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
8767+ }
8768+ }, val.variant);
8769+
8770+ return size;
8771+}
8772+
8773+
8774+std::shared_ptr<WalletClientError> FfiConverterWalletClientError::lift(RustBuffer buf) {
8775+ auto stream = RustStream(&buf);
8776+ auto ret = FfiConverterWalletClientError::read(stream);
8777+
8778+ rustbuffer_free(buf);
8779+
8780+ return ret;
8781+}
8782+
8783+RustBuffer FfiConverterWalletClientError::lower(const WalletClientError &val) {
8784+ auto buf = rustbuffer_alloc(allocation_size(val));
8785+ auto stream = RustStream(&buf);
8786+
8787+ FfiConverterWalletClientError::write(stream, val);
8788+
8789+ return std::move(buf);
8790+}
8791+
8792+std::shared_ptr<WalletClientError> FfiConverterWalletClientError::read(RustStream &stream) {
8793+ int32_t v;
8794+ stream >> v;
8795+
8796+ switch (v) {
8797+ case 1:
8798+ {
8799+ wallet_client_error::InvalidLocalSecretReference var("WalletClientError::InvalidLocalSecretReference");
8800+ auto what_arg = FfiConverterString::lift(
8801+ rust_call(
8802+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8803+ nullptr,
8804+ FfiConverterWalletClientError::lower(var)
8805+ )
8806+ );
8807+ auto ret = std::make_shared<wallet_client_error::InvalidLocalSecretReference>(what_arg);
8808+ return ret;
8809+ }
8810+ case 2:
8811+ {
8812+ wallet_client_error::InvalidWalletPublicKey var("WalletClientError::InvalidWalletPublicKey");
8813+ auto what_arg = FfiConverterString::lift(
8814+ rust_call(
8815+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8816+ nullptr,
8817+ FfiConverterWalletClientError::lower(var)
8818+ )
8819+ );
8820+ auto ret = std::make_shared<wallet_client_error::InvalidWalletPublicKey>(what_arg);
8821+ return ret;
8822+ }
8823+ case 3:
8824+ {
8825+ wallet_client_error::WalletIdentityMismatch var("WalletClientError::WalletIdentityMismatch");
8826+ auto what_arg = FfiConverterString::lift(
8827+ rust_call(
8828+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8829+ nullptr,
8830+ FfiConverterWalletClientError::lower(var)
8831+ )
8832+ );
8833+ auto ret = std::make_shared<wallet_client_error::WalletIdentityMismatch>(what_arg);
8834+ return ret;
8835+ }
8836+ case 4:
8837+ {
8838+ wallet_client_error::InvalidProviderBaseUrl var("WalletClientError::InvalidProviderBaseUrl");
8839+ auto what_arg = FfiConverterString::lift(
8840+ rust_call(
8841+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8842+ nullptr,
8843+ FfiConverterWalletClientError::lower(var)
8844+ )
8845+ );
8846+ auto ret = std::make_shared<wallet_client_error::InvalidProviderBaseUrl>(what_arg);
8847+ return ret;
8848+ }
8849+ case 5:
8850+ {
8851+ wallet_client_error::InvalidSendRequest var("WalletClientError::InvalidSendRequest");
8852+ auto what_arg = FfiConverterString::lift(
8853+ rust_call(
8854+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8855+ nullptr,
8856+ FfiConverterWalletClientError::lower(var)
8857+ )
8858+ );
8859+ auto ret = std::make_shared<wallet_client_error::InvalidSendRequest>(what_arg);
8860+ return ret;
8861+ }
8862+ case 6:
8863+ {
8864+ wallet_client_error::NftTransferUnavailable var("WalletClientError::NftTransferUnavailable");
8865+ var.diagnostic = FfiConverterString::read(stream);
8866+ auto what_arg = FfiConverterString::lift(
8867+ rust_call(
8868+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8869+ nullptr,
8870+ FfiConverterWalletClientError::lower(var)
8871+ )
8872+ );
8873+ auto ret = std::make_shared<wallet_client_error::NftTransferUnavailable>(what_arg);
8874+ ret->diagnostic = std::move(var.diagnostic);
8875+ return ret;
8876+ }
8877+ case 7:
8878+ {
8879+ wallet_client_error::NftTransferEmulationRejected var("WalletClientError::NftTransferEmulationRejected");
8880+ var.diagnostic = FfiConverterString::read(stream);
8881+ auto what_arg = FfiConverterString::lift(
8882+ rust_call(
8883+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8884+ nullptr,
8885+ FfiConverterWalletClientError::lower(var)
8886+ )
8887+ );
8888+ auto ret = std::make_shared<wallet_client_error::NftTransferEmulationRejected>(what_arg);
8889+ ret->diagnostic = std::move(var.diagnostic);
8890+ return ret;
8891+ }
8892+ case 8:
8893+ {
8894+ wallet_client_error::EncryptedCommentUnavailable var("WalletClientError::EncryptedCommentUnavailable");
8895+ var.diagnostic = FfiConverterString::read(stream);
8896+ auto what_arg = FfiConverterString::lift(
8897+ rust_call(
8898+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8899+ nullptr,
8900+ FfiConverterWalletClientError::lower(var)
8901+ )
8902+ );
8903+ auto ret = std::make_shared<wallet_client_error::EncryptedCommentUnavailable>(what_arg);
8904+ ret->diagnostic = std::move(var.diagnostic);
8905+ return ret;
8906+ }
8907+ case 9:
8908+ {
8909+ wallet_client_error::DnsResolutionUnavailable var("WalletClientError::DnsResolutionUnavailable");
8910+ var.diagnostic = FfiConverterString::read(stream);
8911+ auto what_arg = FfiConverterString::lift(
8912+ rust_call(
8913+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8914+ nullptr,
8915+ FfiConverterWalletClientError::lower(var)
8916+ )
8917+ );
8918+ auto ret = std::make_shared<wallet_client_error::DnsResolutionUnavailable>(what_arg);
8919+ ret->diagnostic = std::move(var.diagnostic);
8920+ return ret;
8921+ }
8922+ case 10:
8923+ {
8924+ wallet_client_error::KeyRotationUnavailable var("WalletClientError::KeyRotationUnavailable");
8925+ var.diagnostic = FfiConverterString::read(stream);
8926+ auto what_arg = FfiConverterString::lift(
8927+ rust_call(
8928+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8929+ nullptr,
8930+ FfiConverterWalletClientError::lower(var)
8931+ )
8932+ );
8933+ auto ret = std::make_shared<wallet_client_error::KeyRotationUnavailable>(what_arg);
8934+ ret->diagnostic = std::move(var.diagnostic);
8935+ return ret;
8936+ }
8937+ case 11:
8938+ {
8939+ wallet_client_error::LocalSigningUnavailable var("WalletClientError::LocalSigningUnavailable");
8940+ auto what_arg = FfiConverterString::lift(
8941+ rust_call(
8942+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8943+ nullptr,
8944+ FfiConverterWalletClientError::lower(var)
8945+ )
8946+ );
8947+ auto ret = std::make_shared<wallet_client_error::LocalSigningUnavailable>(what_arg);
8948+ return ret;
8949+ }
8950+ case 12:
8951+ {
8952+ wallet_client_error::IdentifierExhausted var("WalletClientError::IdentifierExhausted");
8953+ auto what_arg = FfiConverterString::lift(
8954+ rust_call(
8955+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8956+ nullptr,
8957+ FfiConverterWalletClientError::lower(var)
8958+ )
8959+ );
8960+ auto ret = std::make_shared<wallet_client_error::IdentifierExhausted>(what_arg);
8961+ return ret;
8962+ }
8963+ case 13:
8964+ {
8965+ wallet_client_error::StateUnavailable var("WalletClientError::StateUnavailable");
8966+ auto what_arg = FfiConverterString::lift(
8967+ rust_call(
8968+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8969+ nullptr,
8970+ FfiConverterWalletClientError::lower(var)
8971+ )
8972+ );
8973+ auto ret = std::make_shared<wallet_client_error::StateUnavailable>(what_arg);
8974+ return ret;
8975+ }
8976+ case 14:
8977+ {
8978+ wallet_client_error::SendAlreadyInProgress var("WalletClientError::SendAlreadyInProgress");
8979+ auto what_arg = FfiConverterString::lift(
8980+ rust_call(
8981+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8982+ nullptr,
8983+ FfiConverterWalletClientError::lower(var)
8984+ )
8985+ );
8986+ auto ret = std::make_shared<wallet_client_error::SendAlreadyInProgress>(what_arg);
8987+ return ret;
8988+ }
8989+ case 15:
8990+ {
8991+ wallet_client_error::SendPreviewAlreadyInProgress var("WalletClientError::SendPreviewAlreadyInProgress");
8992+ auto what_arg = FfiConverterString::lift(
8993+ rust_call(
8994+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
8995+ nullptr,
8996+ FfiConverterWalletClientError::lower(var)
8997+ )
8998+ );
8999+ auto ret = std::make_shared<wallet_client_error::SendPreviewAlreadyInProgress>(what_arg);
9000+ return ret;
9001+ }
9002+ case 16:
9003+ {
9004+ wallet_client_error::PreviousSubmissionUnresolved var("WalletClientError::PreviousSubmissionUnresolved");
9005+ auto what_arg = FfiConverterString::lift(
9006+ rust_call(
9007+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9008+ nullptr,
9009+ FfiConverterWalletClientError::lower(var)
9010+ )
9011+ );
9012+ auto ret = std::make_shared<wallet_client_error::PreviousSubmissionUnresolved>(what_arg);
9013+ return ret;
9014+ }
9015+ case 17:
9016+ {
9017+ wallet_client_error::WalletSeqnoNotAdvanced var("WalletClientError::WalletSeqnoNotAdvanced");
9018+ auto what_arg = FfiConverterString::lift(
9019+ rust_call(
9020+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9021+ nullptr,
9022+ FfiConverterWalletClientError::lower(var)
9023+ )
9024+ );
9025+ auto ret = std::make_shared<wallet_client_error::WalletSeqnoNotAdvanced>(what_arg);
9026+ return ret;
9027+ }
9028+ case 18:
9029+ {
9030+ wallet_client_error::SendAccountUnavailable var("WalletClientError::SendAccountUnavailable");
9031+ var.status = FfiConverterAccountStatus::read(stream);
9032+ auto what_arg = FfiConverterString::lift(
9033+ rust_call(
9034+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9035+ nullptr,
9036+ FfiConverterWalletClientError::lower(var)
9037+ )
9038+ );
9039+ auto ret = std::make_shared<wallet_client_error::SendAccountUnavailable>(what_arg);
9040+ ret->status = std::move(var.status);
9041+ return ret;
9042+ }
9043+ case 19:
9044+ {
9045+ wallet_client_error::InsufficientBalance var("WalletClientError::InsufficientBalance");
9046+ var.available_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9047+ var.requested_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9048+ auto what_arg = FfiConverterString::lift(
9049+ rust_call(
9050+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9051+ nullptr,
9052+ FfiConverterWalletClientError::lower(var)
9053+ )
9054+ );
9055+ auto ret = std::make_shared<wallet_client_error::InsufficientBalance>(what_arg);
9056+ ret->available_nanograms = std::move(var.available_nanograms);
9057+ ret->requested_nanograms = std::move(var.requested_nanograms);
9058+ return ret;
9059+ }
9060+ case 20:
9061+ {
9062+ wallet_client_error::InsufficientBalanceForFees var("WalletClientError::InsufficientBalanceForFees");
9063+ var.available_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9064+ var.requested_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9065+ var.estimated_fee_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
9066+ auto what_arg = FfiConverterString::lift(
9067+ rust_call(
9068+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9069+ nullptr,
9070+ FfiConverterWalletClientError::lower(var)
9071+ )
9072+ );
9073+ auto ret = std::make_shared<wallet_client_error::InsufficientBalanceForFees>(what_arg);
9074+ ret->available_nanograms = std::move(var.available_nanograms);
9075+ ret->requested_nanograms = std::move(var.requested_nanograms);
9076+ ret->estimated_fee_nanograms = std::move(var.estimated_fee_nanograms);
9077+ return ret;
9078+ }
9079+ case 21:
9080+ {
9081+ wallet_client_error::InvalidProtectedSecret var("WalletClientError::InvalidProtectedSecret");
9082+ auto what_arg = FfiConverterString::lift(
9083+ rust_call(
9084+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9085+ nullptr,
9086+ FfiConverterWalletClientError::lower(var)
9087+ )
9088+ );
9089+ auto ret = std::make_shared<wallet_client_error::InvalidProtectedSecret>(what_arg);
9090+ return ret;
9091+ }
9092+ case 22:
9093+ {
9094+ wallet_client_error::SendPreviewFailed var("WalletClientError::SendPreviewFailed");
9095+ var.diagnostic = FfiConverterString::read(stream);
9096+ auto what_arg = FfiConverterString::lift(
9097+ rust_call(
9098+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9099+ nullptr,
9100+ FfiConverterWalletClientError::lower(var)
9101+ )
9102+ );
9103+ auto ret = std::make_shared<wallet_client_error::SendPreviewFailed>(what_arg);
9104+ ret->diagnostic = std::move(var.diagnostic);
9105+ return ret;
9106+ }
9107+ case 23:
9108+ {
9109+ wallet_client_error::EmulationFailed var("WalletClientError::EmulationFailed");
9110+ var.diagnostic = FfiConverterString::read(stream);
9111+ auto what_arg = FfiConverterString::lift(
9112+ rust_call(
9113+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9114+ nullptr,
9115+ FfiConverterWalletClientError::lower(var)
9116+ )
9117+ );
9118+ auto ret = std::make_shared<wallet_client_error::EmulationFailed>(what_arg);
9119+ ret->diagnostic = std::move(var.diagnostic);
9120+ return ret;
9121+ }
9122+ case 24:
9123+ {
9124+ wallet_client_error::EmulationMessageNotAccepted var("WalletClientError::EmulationMessageNotAccepted");
9125+ var.diagnostic = FfiConverterString::read(stream);
9126+ auto what_arg = FfiConverterString::lift(
9127+ rust_call(
9128+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9129+ nullptr,
9130+ FfiConverterWalletClientError::lower(var)
9131+ )
9132+ );
9133+ auto ret = std::make_shared<wallet_client_error::EmulationMessageNotAccepted>(what_arg);
9134+ ret->diagnostic = std::move(var.diagnostic);
9135+ return ret;
9136+ }
9137+ case 25:
9138+ {
9139+ wallet_client_error::EmulationRejected var("WalletClientError::EmulationRejected");
9140+ var.diagnostic = FfiConverterString::read(stream);
9141+ var.compute_exit_code = FfiConverterOptionalInt32::read(stream);
9142+ var.action_result_code = FfiConverterOptionalInt32::read(stream);
9143+ auto what_arg = FfiConverterString::lift(
9144+ rust_call(
9145+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9146+ nullptr,
9147+ FfiConverterWalletClientError::lower(var)
9148+ )
9149+ );
9150+ auto ret = std::make_shared<wallet_client_error::EmulationRejected>(what_arg);
9151+ ret->diagnostic = std::move(var.diagnostic);
9152+ ret->compute_exit_code = std::move(var.compute_exit_code);
9153+ ret->action_result_code = std::move(var.action_result_code);
9154+ return ret;
9155+ }
9156+ case 26:
9157+ {
9158+ wallet_client_error::SendFailed var("WalletClientError::SendFailed");
9159+ var.diagnostic = FfiConverterString::read(stream);
9160+ auto what_arg = FfiConverterString::lift(
9161+ rust_call(
9162+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9163+ nullptr,
9164+ FfiConverterWalletClientError::lower(var)
9165+ )
9166+ );
9167+ auto ret = std::make_shared<wallet_client_error::SendFailed>(what_arg);
9168+ ret->diagnostic = std::move(var.diagnostic);
9169+ return ret;
9170+ }
9171+ case 27:
9172+ {
9173+ wallet_client_error::SubmissionUnknown var("WalletClientError::SubmissionUnknown");
9174+ var.diagnostic = FfiConverterString::read(stream);
9175+ auto what_arg = FfiConverterString::lift(
9176+ rust_call(
9177+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9178+ nullptr,
9179+ FfiConverterWalletClientError::lower(var)
9180+ )
9181+ );
9182+ auto ret = std::make_shared<wallet_client_error::SubmissionUnknown>(what_arg);
9183+ ret->diagnostic = std::move(var.diagnostic);
9184+ return ret;
9185+ }
9186+ case 28:
9187+ {
9188+ wallet_client_error::SendCancellationTooLate var("WalletClientError::SendCancellationTooLate");
9189+ auto what_arg = FfiConverterString::lift(
9190+ rust_call(
9191+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9192+ nullptr,
9193+ FfiConverterWalletClientError::lower(var)
9194+ )
9195+ );
9196+ auto ret = std::make_shared<wallet_client_error::SendCancellationTooLate>(what_arg);
9197+ return ret;
9198+ }
9199+ case 29:
9200+ {
9201+ wallet_client_error::Shutdown var("WalletClientError::Shutdown");
9202+ auto what_arg = FfiConverterString::lift(
9203+ rust_call(
9204+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9205+ nullptr,
9206+ FfiConverterWalletClientError::lower(var)
9207+ )
9208+ );
9209+ auto ret = std::make_shared<wallet_client_error::Shutdown>(what_arg);
9210+ return ret;
9211+ }
9212+ case 30:
9213+ {
9214+ wallet_client_error::EncryptedCommentLookupFailed var("WalletClientError::EncryptedCommentLookupFailed");
9215+ var.diagnostic = FfiConverterString::read(stream);
9216+ auto what_arg = FfiConverterString::lift(
9217+ rust_call(
9218+ uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
9219+ nullptr,
9220+ FfiConverterWalletClientError::lower(var)
9221+ )
9222+ );
9223+ auto ret = std::make_shared<wallet_client_error::EncryptedCommentLookupFailed>(what_arg);
9224+ ret->diagnostic = std::move(var.diagnostic);
9225+ return ret;
9226+ }
9227+ default:
9228+ throw std::runtime_error("Unexpected error variant");
9229+ }
9230+}
9231+
9232+void FfiConverterWalletClientError::write(RustStream &stream, const WalletClientError &val) {
9233+ stream << val.get_variant_idx();
9234+ switch (val.get_variant_idx()) {
9235+ case 1:
9236+ {
9237+ auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
9238+ break;
9239+ }
9240+ case 2:
9241+ {
9242+ auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
9243+ break;
9244+ }
9245+ case 3:
9246+ {
9247+ auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
9248+ break;
9249+ }
9250+ case 4:
9251+ {
9252+ auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
9253+ break;
9254+ }
9255+ case 5:
9256+ {
9257+ auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
9258+ break;
9259+ }
9260+ case 6:
9261+ {
9262+ auto var = static_cast<const wallet_client_error::NftTransferUnavailable&>(val);
9263+ FfiConverterString::write(stream, var.diagnostic);
9264+ break;
9265+ }
9266+ case 7:
9267+ {
9268+ auto var = static_cast<const wallet_client_error::NftTransferEmulationRejected&>(val);
9269+ FfiConverterString::write(stream, var.diagnostic);
9270+ break;
9271+ }
9272+ case 8:
9273+ {
9274+ auto var = static_cast<const wallet_client_error::EncryptedCommentUnavailable&>(val);
9275+ FfiConverterString::write(stream, var.diagnostic);
9276+ break;
9277+ }
9278+ case 9:
9279+ {
9280+ auto var = static_cast<const wallet_client_error::DnsResolutionUnavailable&>(val);
9281+ FfiConverterString::write(stream, var.diagnostic);
9282+ break;
9283+ }
9284+ case 10:
9285+ {
9286+ auto var = static_cast<const wallet_client_error::KeyRotationUnavailable&>(val);
9287+ FfiConverterString::write(stream, var.diagnostic);
9288+ break;
9289+ }
9290+ case 11:
9291+ {
9292+ auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
9293+ break;
9294+ }
9295+ case 12:
9296+ {
9297+ auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
9298+ break;
9299+ }
9300+ case 13:
9301+ {
9302+ auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
9303+ break;
9304+ }
9305+ case 14:
9306+ {
9307+ auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
9308+ break;
9309+ }
9310+ case 15:
9311+ {
9312+ auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
9313+ break;
9314+ }
9315+ case 16:
9316+ {
9317+ auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
9318+ break;
9319+ }
9320+ case 17:
9321+ {
9322+ auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
9323+ break;
9324+ }
9325+ case 18:
9326+ {
9327+ auto var = static_cast<const wallet_client_error::SendAccountUnavailable&>(val);
9328+ FfiConverterAccountStatus::write(stream, var.status);
9329+ break;
9330+ }
9331+ case 19:
9332+ {
9333+ auto var = static_cast<const wallet_client_error::InsufficientBalance&>(val);
9334+ FfiConverterTypeUnsignedDecimalString::write(stream, var.available_nanograms);
9335+ FfiConverterTypeUnsignedDecimalString::write(stream, var.requested_nanograms);
9336+ break;
9337+ }
9338+ case 20:
9339+ {
9340+ auto var = static_cast<const wallet_client_error::InsufficientBalanceForFees&>(val);
9341+ FfiConverterTypeUnsignedDecimalString::write(stream, var.available_nanograms);
9342+ FfiConverterTypeUnsignedDecimalString::write(stream, var.requested_nanograms);
9343+ FfiConverterTypeUnsignedDecimalString::write(stream, var.estimated_fee_nanograms);
9344+ break;
9345+ }
9346+ case 21:
9347+ {
9348+ auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
9349+ break;
9350+ }
9351+ case 22:
9352+ {
9353+ auto var = static_cast<const wallet_client_error::SendPreviewFailed&>(val);
9354+ FfiConverterString::write(stream, var.diagnostic);
9355+ break;
9356+ }
9357+ case 23:
9358+ {
9359+ auto var = static_cast<const wallet_client_error::EmulationFailed&>(val);
9360+ FfiConverterString::write(stream, var.diagnostic);
9361+ break;
9362+ }
9363+ case 24:
9364+ {
9365+ auto var = static_cast<const wallet_client_error::EmulationMessageNotAccepted&>(val);
9366+ FfiConverterString::write(stream, var.diagnostic);
9367+ break;
9368+ }
9369+ case 25:
9370+ {
9371+ auto var = static_cast<const wallet_client_error::EmulationRejected&>(val);
9372+ FfiConverterString::write(stream, var.diagnostic);
9373+ FfiConverterOptionalInt32::write(stream, var.compute_exit_code);
9374+ FfiConverterOptionalInt32::write(stream, var.action_result_code);
9375+ break;
9376+ }
9377+ case 26:
9378+ {
9379+ auto var = static_cast<const wallet_client_error::SendFailed&>(val);
9380+ FfiConverterString::write(stream, var.diagnostic);
9381+ break;
9382+ }
9383+ case 27:
9384+ {
9385+ auto var = static_cast<const wallet_client_error::SubmissionUnknown&>(val);
9386+ FfiConverterString::write(stream, var.diagnostic);
9387+ break;
9388+ }
9389+ case 28:
9390+ {
9391+ auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
9392+ break;
9393+ }
9394+ case 29:
9395+ {
9396+ auto var = static_cast<const wallet_client_error::Shutdown&>(val);
9397+ break;
9398+ }
9399+ case 30:
9400+ {
9401+ auto var = static_cast<const wallet_client_error::EncryptedCommentLookupFailed&>(val);
9402+ FfiConverterString::write(stream, var.diagnostic);
9403+ break;
9404+ }
9405+ }
9406+}
9407+
9408+uint64_t FfiConverterWalletClientError::allocation_size(const WalletClientError &val) {
9409+ switch (val.get_variant_idx()) {
9410+ case 1:
9411+ {
9412+ auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
9413+ return static_cast<uint64_t>(sizeof(int32_t));
9414+ }
9415+ case 2:
9416+ {
9417+ auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
9418+ return static_cast<uint64_t>(sizeof(int32_t));
9419+ }
9420+ case 3:
9421+ {
9422+ auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
9423+ return static_cast<uint64_t>(sizeof(int32_t));
9424+ }
9425+ case 4:
9426+ {
9427+ auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
9428+ return static_cast<uint64_t>(sizeof(int32_t));
9429+ }
9430+ case 5:
9431+ {
9432+ auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
9433+ return static_cast<uint64_t>(sizeof(int32_t));
9434+ }
9435+ case 6:
9436+ {
9437+ auto var = static_cast<const wallet_client_error::NftTransferUnavailable&>(val);
9438+ return static_cast<uint64_t>(sizeof(int32_t)
9439+ + FfiConverterString::allocation_size(var.diagnostic));
9440+ }
9441+ case 7:
9442+ {
9443+ auto var = static_cast<const wallet_client_error::NftTransferEmulationRejected&>(val);
9444+ return static_cast<uint64_t>(sizeof(int32_t)
9445+ + FfiConverterString::allocation_size(var.diagnostic));
9446+ }
9447+ case 8:
9448+ {
9449+ auto var = static_cast<const wallet_client_error::EncryptedCommentUnavailable&>(val);
9450+ return static_cast<uint64_t>(sizeof(int32_t)
9451+ + FfiConverterString::allocation_size(var.diagnostic));
9452+ }
9453+ case 9:
9454+ {
9455+ auto var = static_cast<const wallet_client_error::DnsResolutionUnavailable&>(val);
9456+ return static_cast<uint64_t>(sizeof(int32_t)
9457+ + FfiConverterString::allocation_size(var.diagnostic));
9458+ }
9459+ case 10:
9460+ {
9461+ auto var = static_cast<const wallet_client_error::KeyRotationUnavailable&>(val);
9462+ return static_cast<uint64_t>(sizeof(int32_t)
9463+ + FfiConverterString::allocation_size(var.diagnostic));
9464+ }
9465+ case 11:
9466+ {
9467+ auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
9468+ return static_cast<uint64_t>(sizeof(int32_t));
9469+ }
9470+ case 12:
9471+ {
9472+ auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
9473+ return static_cast<uint64_t>(sizeof(int32_t));
9474+ }
9475+ case 13:
9476+ {
9477+ auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
9478+ return static_cast<uint64_t>(sizeof(int32_t));
9479+ }
9480+ case 14:
9481+ {
9482+ auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
9483+ return static_cast<uint64_t>(sizeof(int32_t));
9484+ }
9485+ case 15:
9486+ {
9487+ auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
9488+ return static_cast<uint64_t>(sizeof(int32_t));
9489+ }
9490+ case 16:
9491+ {
9492+ auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
9493+ return static_cast<uint64_t>(sizeof(int32_t));
9494+ }
9495+ case 17:
9496+ {
9497+ auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
9498+ return static_cast<uint64_t>(sizeof(int32_t));
9499+ }
9500+ case 18:
9501+ {
9502+ auto var = static_cast<const wallet_client_error::SendAccountUnavailable&>(val);
9503+ return static_cast<uint64_t>(sizeof(int32_t)
9504+ + FfiConverterAccountStatus::allocation_size(var.status));
9505+ }
9506+ case 19:
9507+ {
9508+ auto var = static_cast<const wallet_client_error::InsufficientBalance&>(val);
9509+ return static_cast<uint64_t>(sizeof(int32_t)
9510+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.available_nanograms)
9511+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.requested_nanograms));
9512+ }
9513+ case 20:
9514+ {
9515+ auto var = static_cast<const wallet_client_error::InsufficientBalanceForFees&>(val);
9516+ return static_cast<uint64_t>(sizeof(int32_t)
9517+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.available_nanograms)
9518+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.requested_nanograms)
9519+ + FfiConverterTypeUnsignedDecimalString::allocation_size(var.estimated_fee_nanograms));
9520+ }
9521+ case 21:
9522+ {
9523+ auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
9524+ return static_cast<uint64_t>(sizeof(int32_t));
9525+ }
9526+ case 22:
9527+ {
9528+ auto var = static_cast<const wallet_client_error::SendPreviewFailed&>(val);
9529+ return static_cast<uint64_t>(sizeof(int32_t)
9530+ + FfiConverterString::allocation_size(var.diagnostic));
9531+ }
9532+ case 23:
9533+ {
9534+ auto var = static_cast<const wallet_client_error::EmulationFailed&>(val);
9535+ return static_cast<uint64_t>(sizeof(int32_t)
9536+ + FfiConverterString::allocation_size(var.diagnostic));
9537+ }
9538+ case 24:
9539+ {
9540+ auto var = static_cast<const wallet_client_error::EmulationMessageNotAccepted&>(val);
9541+ return static_cast<uint64_t>(sizeof(int32_t)
9542+ + FfiConverterString::allocation_size(var.diagnostic));
9543+ }
9544+ case 25:
9545+ {
9546+ auto var = static_cast<const wallet_client_error::EmulationRejected&>(val);
9547+ return static_cast<uint64_t>(sizeof(int32_t)
9548+ + FfiConverterString::allocation_size(var.diagnostic)
9549+ + FfiConverterOptionalInt32::allocation_size(var.compute_exit_code)
9550+ + FfiConverterOptionalInt32::allocation_size(var.action_result_code));
9551+ }
9552+ case 26:
9553+ {
9554+ auto var = static_cast<const wallet_client_error::SendFailed&>(val);
9555+ return static_cast<uint64_t>(sizeof(int32_t)
9556+ + FfiConverterString::allocation_size(var.diagnostic));
9557+ }
9558+ case 27:
9559+ {
9560+ auto var = static_cast<const wallet_client_error::SubmissionUnknown&>(val);
9561+ return static_cast<uint64_t>(sizeof(int32_t)
9562+ + FfiConverterString::allocation_size(var.diagnostic));
9563+ }
9564+ case 28:
9565+ {
9566+ auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
9567+ return static_cast<uint64_t>(sizeof(int32_t));
9568+ }
9569+ case 29:
9570+ {
9571+ auto var = static_cast<const wallet_client_error::Shutdown&>(val);
9572+ return static_cast<uint64_t>(sizeof(int32_t));
9573+ }
9574+ case 30:
9575+ {
9576+ auto var = static_cast<const wallet_client_error::EncryptedCommentLookupFailed&>(val);
9577+ return static_cast<uint64_t>(sizeof(int32_t)
9578+ + FfiConverterString::allocation_size(var.diagnostic));
9579+ }
9580+ default:
9581+ throw std::runtime_error("Unexpected error variant");
9582+ }
9583+}
9584+
9585+
9586+std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::lift(RustBuffer buf) {
9587+ auto stream = RustStream(&buf);
9588+ auto ret = FfiConverterWalletLifecycleError::read(stream);
9589+
9590+ rustbuffer_free(buf);
9591+
9592+ return ret;
9593+}
9594+
9595+RustBuffer FfiConverterWalletLifecycleError::lower(const WalletLifecycleError &val) {
9596+ auto buf = rustbuffer_alloc(allocation_size(val));
9597+ auto stream = RustStream(&buf);
9598+
9599+ FfiConverterWalletLifecycleError::write(stream, val);
9600+
9601+ return std::move(buf);
9602+}
9603+
9604+std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::read(RustStream &stream) {
9605+ int32_t v;
9606+ stream >> v;
9607+
9608+ switch (v) {
9609+ case 1:
9610+ {
9611+ wallet_lifecycle_error::InvalidRecordId var("WalletLifecycleError::InvalidRecordId");
9612+ auto what_arg = FfiConverterString::lift(
9613+ rust_call(
9614+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9615+ nullptr,
9616+ FfiConverterWalletLifecycleError::lower(var)
9617+ )
9618+ );
9619+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecordId>(what_arg);
9620+ return ret;
9621+ }
9622+ case 2:
9623+ {
9624+ wallet_lifecycle_error::InvalidRecoveryPhrase var("WalletLifecycleError::InvalidRecoveryPhrase");
9625+ auto what_arg = FfiConverterString::lift(
9626+ rust_call(
9627+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9628+ nullptr,
9629+ FfiConverterWalletLifecycleError::lower(var)
9630+ )
9631+ );
9632+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecoveryPhrase>(what_arg);
9633+ return ret;
9634+ }
9635+ case 3:
9636+ {
9637+ wallet_lifecycle_error::AddressDerivationFailed var("WalletLifecycleError::AddressDerivationFailed");
9638+ auto what_arg = FfiConverterString::lift(
9639+ rust_call(
9640+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9641+ nullptr,
9642+ FfiConverterWalletLifecycleError::lower(var)
9643+ )
9644+ );
9645+ auto ret = std::make_shared<wallet_lifecycle_error::AddressDerivationFailed>(what_arg);
9646+ return ret;
9647+ }
9648+ case 4:
9649+ {
9650+ wallet_lifecycle_error::TonConnectSigningFailed var("WalletLifecycleError::TonConnectSigningFailed");
9651+ auto what_arg = FfiConverterString::lift(
9652+ rust_call(
9653+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9654+ nullptr,
9655+ FfiConverterWalletLifecycleError::lower(var)
9656+ )
9657+ );
9658+ auto ret = std::make_shared<wallet_lifecycle_error::TonConnectSigningFailed>(what_arg);
9659+ return ret;
9660+ }
9661+ case 5:
9662+ {
9663+ wallet_lifecycle_error::SecretWalletMismatch var("WalletLifecycleError::SecretWalletMismatch");
9664+ auto what_arg = FfiConverterString::lift(
9665+ rust_call(
9666+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9667+ nullptr,
9668+ FfiConverterWalletLifecycleError::lower(var)
9669+ )
9670+ );
9671+ auto ret = std::make_shared<wallet_lifecycle_error::SecretWalletMismatch>(what_arg);
9672+ return ret;
9673+ }
9674+ case 6:
9675+ {
9676+ wallet_lifecycle_error::ProtectedSecretHost var("WalletLifecycleError::ProtectedSecretHost");
9677+ var.kind = FfiConverterProtectedSecretHostErrorKind::read(stream);
9678+ var.diagnostic = FfiConverterString::read(stream);
9679+ auto what_arg = FfiConverterString::lift(
9680+ rust_call(
9681+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9682+ nullptr,
9683+ FfiConverterWalletLifecycleError::lower(var)
9684+ )
9685+ );
9686+ auto ret = std::make_shared<wallet_lifecycle_error::ProtectedSecretHost>(what_arg);
9687+ ret->kind = std::move(var.kind);
9688+ ret->diagnostic = std::move(var.diagnostic);
9689+ return ret;
9690+ }
9691+ case 7:
9692+ {
9693+ wallet_lifecycle_error::InvalidTonConnectSessionInput var("WalletLifecycleError::InvalidTonConnectSessionInput");
9694+ auto what_arg = FfiConverterString::lift(
9695+ rust_call(
9696+ uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
9697+ nullptr,
9698+ FfiConverterWalletLifecycleError::lower(var)
9699+ )
9700+ );
9701+ auto ret = std::make_shared<wallet_lifecycle_error::InvalidTonConnectSessionInput>(what_arg);
9702+ return ret;
9703+ }
9704+ default:
9705+ throw std::runtime_error("Unexpected error variant");
9706+ }
9707+}
9708+
9709+void FfiConverterWalletLifecycleError::write(RustStream &stream, const WalletLifecycleError &val) {
9710+ stream << val.get_variant_idx();
9711+ switch (val.get_variant_idx()) {
9712+ case 1:
9713+ {
9714+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
9715+ break;
9716+ }
9717+ case 2:
9718+ {
9719+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
9720+ break;
9721+ }
9722+ case 3:
9723+ {
9724+ auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
9725+ break;
9726+ }
9727+ case 4:
9728+ {
9729+ auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
9730+ break;
9731+ }
9732+ case 5:
9733+ {
9734+ auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
9735+ break;
9736+ }
9737+ case 6:
9738+ {
9739+ auto var = static_cast<const wallet_lifecycle_error::ProtectedSecretHost&>(val);
9740+ FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
9741+ FfiConverterString::write(stream, var.diagnostic);
9742+ break;
9743+ }
9744+ case 7:
9745+ {
9746+ auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
9747+ break;
9748+ }
9749+ }
9750+}
9751+
9752+uint64_t FfiConverterWalletLifecycleError::allocation_size(const WalletLifecycleError &val) {
9753+ switch (val.get_variant_idx()) {
9754+ case 1:
9755+ {
9756+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
9757+ return static_cast<uint64_t>(sizeof(int32_t));
9758+ }
9759+ case 2:
9760+ {
9761+ auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
9762+ return static_cast<uint64_t>(sizeof(int32_t));
9763+ }
9764+ case 3:
9765+ {
9766+ auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
9767+ return static_cast<uint64_t>(sizeof(int32_t));
9768+ }
9769+ case 4:
9770+ {
9771+ auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
9772+ return static_cast<uint64_t>(sizeof(int32_t));
9773+ }
9774+ case 5:
9775+ {
9776+ auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
9777+ return static_cast<uint64_t>(sizeof(int32_t));
9778+ }
9779+ case 6:
9780+ {
9781+ auto var = static_cast<const wallet_lifecycle_error::ProtectedSecretHost&>(val);
9782+ return static_cast<uint64_t>(sizeof(int32_t)
9783+ + FfiConverterProtectedSecretHostErrorKind::allocation_size(var.kind)
9784+ + FfiConverterString::allocation_size(var.diagnostic));
9785+ }
9786+ case 7:
9787+ {
9788+ auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
9789+ return static_cast<uint64_t>(sizeof(int32_t));
9790+ }
9791+ default:
9792+ throw std::runtime_error("Unexpected error variant");
9793+ }
9794+}
9795+
9796+
9797+WalletOperationOutcome FfiConverterWalletOperationOutcome::lift(RustBuffer buf) {
9798+ auto stream = RustStream(&buf);
9799+ auto ret = FfiConverterWalletOperationOutcome::read(stream);
9800+
9801+ rustbuffer_free(buf);
9802+
9803+ return std::move(ret);
9804+}
9805+
9806+RustBuffer FfiConverterWalletOperationOutcome::lower(const WalletOperationOutcome &val) {
9807+ auto buf = rustbuffer_alloc(FfiConverterWalletOperationOutcome::allocation_size(val));
9808+ auto stream = RustStream(&buf);
9809+
9810+ FfiConverterWalletOperationOutcome::write(stream, val);
9811+
9812+ return std::move(buf);
9813+}
9814+
9815+WalletOperationOutcome FfiConverterWalletOperationOutcome::read(RustStream &stream) {
9816+ int32_t variant;
9817+ stream >> variant;
9818+
9819+ switch (variant) {
9820+
9821+ case 1:
9822+ return WalletOperationOutcome::kCompleted;
9823+
9824+ case 2:
9825+ return WalletOperationOutcome::kPartiallyCompleted;
9826+
9827+ case 3:
9828+ return WalletOperationOutcome::kFailed;
9829+
9830+ case 4:
9831+ return WalletOperationOutcome::kCancelled;
9832+
9833+ case 5:
9834+ return WalletOperationOutcome::kSuperseded;
9835+
9836+ case 6:
9837+ return WalletOperationOutcome::kSkipped;
9838+
9839+ default:
9840+ throw std::runtime_error("No matching WalletOperationOutcome variant");
9841+ }
9842+}
9843+
9844+void FfiConverterWalletOperationOutcome::write(RustStream &stream, const WalletOperationOutcome &val) {
9845+ switch (val) {
9846+
9847+ case WalletOperationOutcome::kCompleted:
9848+ stream << static_cast<int32_t>(1);
9849+ break;
9850+
9851+ case WalletOperationOutcome::kPartiallyCompleted:
9852+ stream << static_cast<int32_t>(2);
9853+ break;
9854+
9855+ case WalletOperationOutcome::kFailed:
9856+ stream << static_cast<int32_t>(3);
9857+ break;
9858+
9859+ case WalletOperationOutcome::kCancelled:
9860+ stream << static_cast<int32_t>(4);
9861+ break;
9862+
9863+ case WalletOperationOutcome::kSuperseded:
9864+ stream << static_cast<int32_t>(5);
9865+ break;
9866+
9867+ case WalletOperationOutcome::kSkipped:
9868+ stream << static_cast<int32_t>(6);
9869+ break;
9870+
9871+ default:
9872+ throw std::runtime_error("No matching WalletOperationOutcome variant");
9873+ }
9874+}
9875+
9876+uint64_t FfiConverterWalletOperationOutcome::allocation_size(const WalletOperationOutcome &) {
9877+ return static_cast<uint64_t>(sizeof(int32_t));
9878+}
9879+
9880+std::optional<uint16_t> FfiConverterOptionalUInt16::lift(RustBuffer buf) {
9881+ auto stream = RustStream(&buf);
9882+ auto ret = FfiConverterOptionalUInt16::read(stream);
9883+
9884+ rustbuffer_free(buf);
9885+
9886+ return ret;
9887+}
9888+
9889+RustBuffer FfiConverterOptionalUInt16::lower(const std::optional<uint16_t>& val) {
9890+ auto buf = rustbuffer_alloc(FfiConverterOptionalUInt16::allocation_size(val));
9891+ auto stream = RustStream(&buf);
9892+
9893+ FfiConverterOptionalUInt16::write(stream, val);
9894+
9895+ return buf;
9896+}
9897+
9898+std::optional<uint16_t> FfiConverterOptionalUInt16::read(RustStream &stream) {
9899+ char has_value;
9900+
9901+ stream.get(has_value);
9902+ if (has_value) {
9903+ return std::make_optional(FfiConverterUInt16::read(stream));
9904+ } else {
9905+ return std::nullopt;
9906+ }
9907+}
9908+
9909+void FfiConverterOptionalUInt16::write(RustStream &stream, const std::optional<uint16_t>& value) {
9910+ stream.put(static_cast<uint8_t>(!!value));
9911+
9912+ if (value) {
9913+ FfiConverterUInt16::write(stream, value.value());
9914+ }
9915+}
9916+
9917+uint64_t FfiConverterOptionalUInt16::allocation_size(const std::optional<uint16_t> &val) {
9918+ uint64_t ret = 1;
9919+
9920+ if (val) {
9921+ ret += FfiConverterUInt16::allocation_size(val.value());
9922+ }
9923+
9924+ return ret;
9925+}
9926+
9927+std::optional<int32_t> FfiConverterOptionalInt32::lift(RustBuffer buf) {
9928+ auto stream = RustStream(&buf);
9929+ auto ret = FfiConverterOptionalInt32::read(stream);
9930+
9931+ rustbuffer_free(buf);
9932+
9933+ return ret;
9934+}
9935+
9936+RustBuffer FfiConverterOptionalInt32::lower(const std::optional<int32_t>& val) {
9937+ auto buf = rustbuffer_alloc(FfiConverterOptionalInt32::allocation_size(val));
9938+ auto stream = RustStream(&buf);
9939+
9940+ FfiConverterOptionalInt32::write(stream, val);
9941+
9942+ return buf;
9943+}
9944+
9945+std::optional<int32_t> FfiConverterOptionalInt32::read(RustStream &stream) {
9946+ char has_value;
9947+
9948+ stream.get(has_value);
9949+ if (has_value) {
9950+ return std::make_optional(FfiConverterInt32::read(stream));
9951+ } else {
9952+ return std::nullopt;
9953+ }
9954+}
9955+
9956+void FfiConverterOptionalInt32::write(RustStream &stream, const std::optional<int32_t>& value) {
9957+ stream.put(static_cast<uint8_t>(!!value));
9958+
9959+ if (value) {
9960+ FfiConverterInt32::write(stream, value.value());
9961+ }
9962+}
9963+
9964+uint64_t FfiConverterOptionalInt32::allocation_size(const std::optional<int32_t> &val) {
9965+ uint64_t ret = 1;
9966+
9967+ if (val) {
9968+ ret += FfiConverterInt32::allocation_size(val.value());
9969+ }
9970+
9971+ return ret;
9972+}
9973+
9974+std::optional<uint64_t> FfiConverterOptionalUInt64::lift(RustBuffer buf) {
9975+ auto stream = RustStream(&buf);
9976+ auto ret = FfiConverterOptionalUInt64::read(stream);
9977+
9978+ rustbuffer_free(buf);
9979+
9980+ return ret;
9981+}
9982+
9983+RustBuffer FfiConverterOptionalUInt64::lower(const std::optional<uint64_t>& val) {
9984+ auto buf = rustbuffer_alloc(FfiConverterOptionalUInt64::allocation_size(val));
9985+ auto stream = RustStream(&buf);
9986+
9987+ FfiConverterOptionalUInt64::write(stream, val);
9988+
9989+ return buf;
9990+}
9991+
9992+std::optional<uint64_t> FfiConverterOptionalUInt64::read(RustStream &stream) {
9993+ char has_value;
9994+
9995+ stream.get(has_value);
9996+ if (has_value) {
9997+ return std::make_optional(FfiConverterUInt64::read(stream));
9998+ } else {
9999+ return std::nullopt;
10000+ }
10001+}
10002+
10003+void FfiConverterOptionalUInt64::write(RustStream &stream, const std::optional<uint64_t>& value) {
10004+ stream.put(static_cast<uint8_t>(!!value));
10005+
10006+ if (value) {
10007+ FfiConverterUInt64::write(stream, value.value());
10008+ }
10009+}
10010+
10011+uint64_t FfiConverterOptionalUInt64::allocation_size(const std::optional<uint64_t> &val) {
10012+ uint64_t ret = 1;
10013+
10014+ if (val) {
10015+ ret += FfiConverterUInt64::allocation_size(val.value());
10016+ }
10017+
10018+ return ret;
10019+}
10020+
10021+std::optional<int64_t> FfiConverterOptionalInt64::lift(RustBuffer buf) {
10022+ auto stream = RustStream(&buf);
10023+ auto ret = FfiConverterOptionalInt64::read(stream);
10024+
10025+ rustbuffer_free(buf);
10026+
10027+ return ret;
10028+}
10029+
10030+RustBuffer FfiConverterOptionalInt64::lower(const std::optional<int64_t>& val) {
10031+ auto buf = rustbuffer_alloc(FfiConverterOptionalInt64::allocation_size(val));
10032+ auto stream = RustStream(&buf);
10033+
10034+ FfiConverterOptionalInt64::write(stream, val);
10035+
10036+ return buf;
10037+}
10038+
10039+std::optional<int64_t> FfiConverterOptionalInt64::read(RustStream &stream) {
10040+ char has_value;
10041+
10042+ stream.get(has_value);
10043+ if (has_value) {
10044+ return std::make_optional(FfiConverterInt64::read(stream));
10045+ } else {
10046+ return std::nullopt;
10047+ }
10048+}
10049+
10050+void FfiConverterOptionalInt64::write(RustStream &stream, const std::optional<int64_t>& value) {
10051+ stream.put(static_cast<uint8_t>(!!value));
10052+
10053+ if (value) {
10054+ FfiConverterInt64::write(stream, value.value());
10055+ }
10056+}
10057+
10058+uint64_t FfiConverterOptionalInt64::allocation_size(const std::optional<int64_t> &val) {
10059+ uint64_t ret = 1;
10060+
10061+ if (val) {
10062+ ret += FfiConverterInt64::allocation_size(val.value());
10063+ }
10064+
10065+ return ret;
10066+}
10067+
10068+std::optional<bool> FfiConverterOptionalBool::lift(RustBuffer buf) {
10069+ auto stream = RustStream(&buf);
10070+ auto ret = FfiConverterOptionalBool::read(stream);
10071+
10072+ rustbuffer_free(buf);
10073+
10074+ return ret;
10075+}
10076+
10077+RustBuffer FfiConverterOptionalBool::lower(const std::optional<bool>& val) {
10078+ auto buf = rustbuffer_alloc(FfiConverterOptionalBool::allocation_size(val));
10079+ auto stream = RustStream(&buf);
10080+
10081+ FfiConverterOptionalBool::write(stream, val);
10082+
10083+ return buf;
10084+}
10085+
10086+std::optional<bool> FfiConverterOptionalBool::read(RustStream &stream) {
10087+ char has_value;
10088+
10089+ stream.get(has_value);
10090+ if (has_value) {
10091+ return std::make_optional(FfiConverterBool::read(stream));
10092+ } else {
10093+ return std::nullopt;
10094+ }
10095+}
10096+
10097+void FfiConverterOptionalBool::write(RustStream &stream, const std::optional<bool>& value) {
10098+ stream.put(static_cast<uint8_t>(!!value));
10099+
10100+ if (value) {
10101+ FfiConverterBool::write(stream, value.value());
10102+ }
10103+}
10104+
10105+uint64_t FfiConverterOptionalBool::allocation_size(const std::optional<bool> &val) {
10106+ uint64_t ret = 1;
10107+
10108+ if (val) {
10109+ ret += FfiConverterBool::allocation_size(val.value());
10110+ }
10111+
10112+ return ret;
10113+}
10114+
10115+std::optional<std::string> FfiConverterOptionalString::lift(RustBuffer buf) {
10116+ auto stream = RustStream(&buf);
10117+ auto ret = FfiConverterOptionalString::read(stream);
10118+
10119+ rustbuffer_free(buf);
10120+
10121+ return ret;
10122+}
10123+
10124+RustBuffer FfiConverterOptionalString::lower(const std::optional<std::string>& val) {
10125+ auto buf = rustbuffer_alloc(FfiConverterOptionalString::allocation_size(val));
10126+ auto stream = RustStream(&buf);
10127+
10128+ FfiConverterOptionalString::write(stream, val);
10129+
10130+ return buf;
10131+}
10132+
10133+std::optional<std::string> FfiConverterOptionalString::read(RustStream &stream) {
10134+ char has_value;
10135+
10136+ stream.get(has_value);
10137+ if (has_value) {
10138+ return std::make_optional(FfiConverterString::read(stream));
10139+ } else {
10140+ return std::nullopt;
10141+ }
10142+}
10143+
10144+void FfiConverterOptionalString::write(RustStream &stream, const std::optional<std::string>& value) {
10145+ stream.put(static_cast<uint8_t>(!!value));
10146+
10147+ if (value) {
10148+ FfiConverterString::write(stream, value.value());
10149+ }
10150+}
10151+
10152+uint64_t FfiConverterOptionalString::allocation_size(const std::optional<std::string> &val) {
10153+ uint64_t ret = 1;
10154+
10155+ if (val) {
10156+ ret += FfiConverterString::allocation_size(val.value());
10157+ }
10158+
10159+ return ret;
10160+}
10161+
10162+std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::lift(RustBuffer buf) {
10163+ auto stream = RustStream(&buf);
10164+ auto ret = FfiConverterOptionalBytes::read(stream);
10165+
10166+ rustbuffer_free(buf);
10167+
10168+ return ret;
10169+}
10170+
10171+RustBuffer FfiConverterOptionalBytes::lower(const std::optional<std::vector<uint8_t>>& val) {
10172+ auto buf = rustbuffer_alloc(FfiConverterOptionalBytes::allocation_size(val));
10173+ auto stream = RustStream(&buf);
10174+
10175+ FfiConverterOptionalBytes::write(stream, val);
10176+
10177+ return buf;
10178+}
10179+
10180+std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::read(RustStream &stream) {
10181+ char has_value;
10182+
10183+ stream.get(has_value);
10184+ if (has_value) {
10185+ return std::make_optional(FfiConverterBytes::read(stream));
10186+ } else {
10187+ return std::nullopt;
10188+ }
10189+}
10190+
10191+void FfiConverterOptionalBytes::write(RustStream &stream, const std::optional<std::vector<uint8_t>>& value) {
10192+ stream.put(static_cast<uint8_t>(!!value));
10193+
10194+ if (value) {
10195+ FfiConverterBytes::write(stream, value.value());
10196+ }
10197+}
10198+
10199+uint64_t FfiConverterOptionalBytes::allocation_size(const std::optional<std::vector<uint8_t>> &val) {
10200+ uint64_t ret = 1;
10201+
10202+ if (val) {
10203+ ret += FfiConverterBytes::allocation_size(val.value());
10204+ }
10205+
10206+ return ret;
10207+}
10208+
10209+std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::lift(RustBuffer buf) {
10210+ auto stream = RustStream(&buf);
10211+ auto ret = FfiConverterOptionalTypeAccountSnapshot::read(stream);
10212+
10213+ rustbuffer_free(buf);
10214+
10215+ return ret;
10216+}
10217+
10218+RustBuffer FfiConverterOptionalTypeAccountSnapshot::lower(const std::optional<AccountSnapshot>& val) {
10219+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeAccountSnapshot::allocation_size(val));
10220+ auto stream = RustStream(&buf);
10221+
10222+ FfiConverterOptionalTypeAccountSnapshot::write(stream, val);
10223+
10224+ return buf;
10225+}
10226+
10227+std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::read(RustStream &stream) {
10228+ char has_value;
10229+
10230+ stream.get(has_value);
10231+ if (has_value) {
10232+ return std::make_optional(FfiConverterTypeAccountSnapshot::read(stream));
10233+ } else {
10234+ return std::nullopt;
10235+ }
10236+}
10237+
10238+void FfiConverterOptionalTypeAccountSnapshot::write(RustStream &stream, const std::optional<AccountSnapshot>& value) {
10239+ stream.put(static_cast<uint8_t>(!!value));
10240+
10241+ if (value) {
10242+ FfiConverterTypeAccountSnapshot::write(stream, value.value());
10243+ }
10244+}
10245+
10246+uint64_t FfiConverterOptionalTypeAccountSnapshot::allocation_size(const std::optional<AccountSnapshot> &val) {
10247+ uint64_t ret = 1;
10248+
10249+ if (val) {
10250+ ret += FfiConverterTypeAccountSnapshot::allocation_size(val.value());
10251+ }
10252+
10253+ return ret;
10254+}
10255+
10256+std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::lift(RustBuffer buf) {
10257+ auto stream = RustStream(&buf);
10258+ auto ret = FfiConverterOptionalTypeActivityCursor::read(stream);
10259+
10260+ rustbuffer_free(buf);
10261+
10262+ return ret;
10263+}
10264+
10265+RustBuffer FfiConverterOptionalTypeActivityCursor::lower(const std::optional<ActivityCursor>& val) {
10266+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeActivityCursor::allocation_size(val));
10267+ auto stream = RustStream(&buf);
10268+
10269+ FfiConverterOptionalTypeActivityCursor::write(stream, val);
10270+
10271+ return buf;
10272+}
10273+
10274+std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::read(RustStream &stream) {
10275+ char has_value;
10276+
10277+ stream.get(has_value);
10278+ if (has_value) {
10279+ return std::make_optional(FfiConverterTypeActivityCursor::read(stream));
10280+ } else {
10281+ return std::nullopt;
10282+ }
10283+}
10284+
10285+void FfiConverterOptionalTypeActivityCursor::write(RustStream &stream, const std::optional<ActivityCursor>& value) {
10286+ stream.put(static_cast<uint8_t>(!!value));
10287+
10288+ if (value) {
10289+ FfiConverterTypeActivityCursor::write(stream, value.value());
10290+ }
10291+}
10292+
10293+uint64_t FfiConverterOptionalTypeActivityCursor::allocation_size(const std::optional<ActivityCursor> &val) {
10294+ uint64_t ret = 1;
10295+
10296+ if (val) {
10297+ ret += FfiConverterTypeActivityCursor::allocation_size(val.value());
10298+ }
10299+
10300+ return ret;
10301+}
10302+
10303+std::optional<DomainError> FfiConverterOptionalTypeDomainError::lift(RustBuffer buf) {
10304+ auto stream = RustStream(&buf);
10305+ auto ret = FfiConverterOptionalTypeDomainError::read(stream);
10306+
10307+ rustbuffer_free(buf);
10308+
10309+ return ret;
10310+}
10311+
10312+RustBuffer FfiConverterOptionalTypeDomainError::lower(const std::optional<DomainError>& val) {
10313+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeDomainError::allocation_size(val));
10314+ auto stream = RustStream(&buf);
10315+
10316+ FfiConverterOptionalTypeDomainError::write(stream, val);
10317+
10318+ return buf;
10319+}
10320+
10321+std::optional<DomainError> FfiConverterOptionalTypeDomainError::read(RustStream &stream) {
10322+ char has_value;
10323+
10324+ stream.get(has_value);
10325+ if (has_value) {
10326+ return std::make_optional(FfiConverterTypeDomainError::read(stream));
10327+ } else {
10328+ return std::nullopt;
10329+ }
10330+}
10331+
10332+void FfiConverterOptionalTypeDomainError::write(RustStream &stream, const std::optional<DomainError>& value) {
10333+ stream.put(static_cast<uint8_t>(!!value));
10334+
10335+ if (value) {
10336+ FfiConverterTypeDomainError::write(stream, value.value());
10337+ }
10338+}
10339+
10340+uint64_t FfiConverterOptionalTypeDomainError::allocation_size(const std::optional<DomainError> &val) {
10341+ uint64_t ret = 1;
10342+
10343+ if (val) {
10344+ ret += FfiConverterTypeDomainError::allocation_size(val.value());
10345+ }
10346+
10347+ return ret;
10348+}
10349+
10350+std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::lift(RustBuffer buf) {
10351+ auto stream = RustStream(&buf);
10352+ auto ret = FfiConverterOptionalTypeJournalRecord::read(stream);
10353+
10354+ rustbuffer_free(buf);
10355+
10356+ return ret;
10357+}
10358+
10359+RustBuffer FfiConverterOptionalTypeJournalRecord::lower(const std::optional<JournalRecord>& val) {
10360+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeJournalRecord::allocation_size(val));
10361+ auto stream = RustStream(&buf);
10362+
10363+ FfiConverterOptionalTypeJournalRecord::write(stream, val);
10364+
10365+ return buf;
10366+}
10367+
10368+std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::read(RustStream &stream) {
10369+ char has_value;
10370+
10371+ stream.get(has_value);
10372+ if (has_value) {
10373+ return std::make_optional(FfiConverterTypeJournalRecord::read(stream));
10374+ } else {
10375+ return std::nullopt;
10376+ }
10377+}
10378+
10379+void FfiConverterOptionalTypeJournalRecord::write(RustStream &stream, const std::optional<JournalRecord>& value) {
10380+ stream.put(static_cast<uint8_t>(!!value));
10381+
10382+ if (value) {
10383+ FfiConverterTypeJournalRecord::write(stream, value.value());
10384+ }
10385+}
10386+
10387+uint64_t FfiConverterOptionalTypeJournalRecord::allocation_size(const std::optional<JournalRecord> &val) {
10388+ uint64_t ret = 1;
10389+
10390+ if (val) {
10391+ ret += FfiConverterTypeJournalRecord::allocation_size(val.value());
10392+ }
10393+
10394+ return ret;
10395+}
10396+
10397+std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::lift(RustBuffer buf) {
10398+ auto stream = RustStream(&buf);
10399+ auto ret = FfiConverterOptionalTypeNftCollectionDescriptor::read(stream);
10400+
10401+ rustbuffer_free(buf);
10402+
10403+ return ret;
10404+}
10405+
10406+RustBuffer FfiConverterOptionalTypeNftCollectionDescriptor::lower(const std::optional<NftCollectionDescriptor>& val) {
10407+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(val));
10408+ auto stream = RustStream(&buf);
10409+
10410+ FfiConverterOptionalTypeNftCollectionDescriptor::write(stream, val);
10411+
10412+ return buf;
10413+}
10414+
10415+std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::read(RustStream &stream) {
10416+ char has_value;
10417+
10418+ stream.get(has_value);
10419+ if (has_value) {
10420+ return std::make_optional(FfiConverterTypeNftCollectionDescriptor::read(stream));
10421+ } else {
10422+ return std::nullopt;
10423+ }
10424+}
10425+
10426+void FfiConverterOptionalTypeNftCollectionDescriptor::write(RustStream &stream, const std::optional<NftCollectionDescriptor>& value) {
10427+ stream.put(static_cast<uint8_t>(!!value));
10428+
10429+ if (value) {
10430+ FfiConverterTypeNftCollectionDescriptor::write(stream, value.value());
10431+ }
10432+}
10433+
10434+uint64_t FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(const std::optional<NftCollectionDescriptor> &val) {
10435+ uint64_t ret = 1;
10436+
10437+ if (val) {
10438+ ret += FfiConverterTypeNftCollectionDescriptor::allocation_size(val.value());
10439+ }
10440+
10441+ return ret;
10442+}
10443+
10444+std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::lift(RustBuffer buf) {
10445+ auto stream = RustStream(&buf);
10446+ auto ret = FfiConverterOptionalTypeProtectedSecretRef::read(stream);
10447+
10448+ rustbuffer_free(buf);
10449+
10450+ return ret;
10451+}
10452+
10453+RustBuffer FfiConverterOptionalTypeProtectedSecretRef::lower(const std::optional<ProtectedSecretRef>& val) {
10454+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeProtectedSecretRef::allocation_size(val));
10455+ auto stream = RustStream(&buf);
10456+
10457+ FfiConverterOptionalTypeProtectedSecretRef::write(stream, val);
10458+
10459+ return buf;
10460+}
10461+
10462+std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::read(RustStream &stream) {
10463+ char has_value;
10464+
10465+ stream.get(has_value);
10466+ if (has_value) {
10467+ return std::make_optional(FfiConverterTypeProtectedSecretRef::read(stream));
10468+ } else {
10469+ return std::nullopt;
10470+ }
10471+}
10472+
10473+void FfiConverterOptionalTypeProtectedSecretRef::write(RustStream &stream, const std::optional<ProtectedSecretRef>& value) {
10474+ stream.put(static_cast<uint8_t>(!!value));
10475+
10476+ if (value) {
10477+ FfiConverterTypeProtectedSecretRef::write(stream, value.value());
10478+ }
10479+}
10480+
10481+uint64_t FfiConverterOptionalTypeProtectedSecretRef::allocation_size(const std::optional<ProtectedSecretRef> &val) {
10482+ uint64_t ret = 1;
10483+
10484+ if (val) {
10485+ ret += FfiConverterTypeProtectedSecretRef::allocation_size(val.value());
10486+ }
10487+
10488+ return ret;
10489+}
10490+
10491+std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::lift(RustBuffer buf) {
10492+ auto stream = RustStream(&buf);
10493+ auto ret = FfiConverterOptionalTypeResolutionInfo::read(stream);
10494+
10495+ rustbuffer_free(buf);
10496+
10497+ return ret;
10498+}
10499+
10500+RustBuffer FfiConverterOptionalTypeResolutionInfo::lower(const std::optional<ResolutionInfo>& val) {
10501+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeResolutionInfo::allocation_size(val));
10502+ auto stream = RustStream(&buf);
10503+
10504+ FfiConverterOptionalTypeResolutionInfo::write(stream, val);
10505+
10506+ return buf;
10507+}
10508+
10509+std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::read(RustStream &stream) {
10510+ char has_value;
10511+
10512+ stream.get(has_value);
10513+ if (has_value) {
10514+ return std::make_optional(FfiConverterTypeResolutionInfo::read(stream));
10515+ } else {
10516+ return std::nullopt;
10517+ }
10518+}
10519+
10520+void FfiConverterOptionalTypeResolutionInfo::write(RustStream &stream, const std::optional<ResolutionInfo>& value) {
10521+ stream.put(static_cast<uint8_t>(!!value));
10522+
10523+ if (value) {
10524+ FfiConverterTypeResolutionInfo::write(stream, value.value());
10525+ }
10526+}
10527+
10528+uint64_t FfiConverterOptionalTypeResolutionInfo::allocation_size(const std::optional<ResolutionInfo> &val) {
10529+ uint64_t ret = 1;
10530+
10531+ if (val) {
10532+ ret += FfiConverterTypeResolutionInfo::allocation_size(val.value());
10533+ }
10534+
10535+ return ret;
10536+}
10537+
10538+std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
10539+ auto stream = RustStream(&buf);
10540+ auto ret = FfiConverterOptionalTypeTonConnectConnectPrompt::read(stream);
10541+
10542+ rustbuffer_free(buf);
10543+
10544+ return ret;
10545+}
10546+
10547+RustBuffer FfiConverterOptionalTypeTonConnectConnectPrompt::lower(const std::optional<TonConnectConnectPrompt>& val) {
10548+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(val));
10549+ auto stream = RustStream(&buf);
10550+
10551+ FfiConverterOptionalTypeTonConnectConnectPrompt::write(stream, val);
10552+
10553+ return buf;
10554+}
10555+
10556+std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::read(RustStream &stream) {
10557+ char has_value;
10558+
10559+ stream.get(has_value);
10560+ if (has_value) {
10561+ return std::make_optional(FfiConverterTypeTonConnectConnectPrompt::read(stream));
10562+ } else {
10563+ return std::nullopt;
10564+ }
10565+}
10566+
10567+void FfiConverterOptionalTypeTonConnectConnectPrompt::write(RustStream &stream, const std::optional<TonConnectConnectPrompt>& value) {
10568+ stream.put(static_cast<uint8_t>(!!value));
10569+
10570+ if (value) {
10571+ FfiConverterTypeTonConnectConnectPrompt::write(stream, value.value());
10572+ }
10573+}
10574+
10575+uint64_t FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(const std::optional<TonConnectConnectPrompt> &val) {
10576+ uint64_t ret = 1;
10577+
10578+ if (val) {
10579+ ret += FfiConverterTypeTonConnectConnectPrompt::allocation_size(val.value());
10580+ }
10581+
10582+ return ret;
10583+}
10584+
10585+std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::lift(RustBuffer buf) {
10586+ auto stream = RustStream(&buf);
10587+ auto ret = FfiConverterOptionalTypeTonConnectPreparedPost::read(stream);
10588+
10589+ rustbuffer_free(buf);
10590+
10591+ return ret;
10592+}
10593+
10594+RustBuffer FfiConverterOptionalTypeTonConnectPreparedPost::lower(const std::optional<TonConnectPreparedPost>& val) {
10595+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(val));
10596+ auto stream = RustStream(&buf);
10597+
10598+ FfiConverterOptionalTypeTonConnectPreparedPost::write(stream, val);
10599+
10600+ return buf;
10601+}
10602+
10603+std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::read(RustStream &stream) {
10604+ char has_value;
10605+
10606+ stream.get(has_value);
10607+ if (has_value) {
10608+ return std::make_optional(FfiConverterTypeTonConnectPreparedPost::read(stream));
10609+ } else {
10610+ return std::nullopt;
10611+ }
10612+}
10613+
10614+void FfiConverterOptionalTypeTonConnectPreparedPost::write(RustStream &stream, const std::optional<TonConnectPreparedPost>& value) {
10615+ stream.put(static_cast<uint8_t>(!!value));
10616+
10617+ if (value) {
10618+ FfiConverterTypeTonConnectPreparedPost::write(stream, value.value());
10619+ }
10620+}
10621+
10622+uint64_t FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(const std::optional<TonConnectPreparedPost> &val) {
10623+ uint64_t ret = 1;
10624+
10625+ if (val) {
10626+ ret += FfiConverterTypeTonConnectPreparedPost::allocation_size(val.value());
10627+ }
10628+
10629+ return ret;
10630+}
10631+
10632+std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::lift(RustBuffer buf) {
10633+ auto stream = RustStream(&buf);
10634+ auto ret = FfiConverterOptionalTypeTonConnectProofReply::read(stream);
10635+
10636+ rustbuffer_free(buf);
10637+
10638+ return ret;
10639+}
10640+
10641+RustBuffer FfiConverterOptionalTypeTonConnectProofReply::lower(const std::optional<TonConnectProofReply>& val) {
10642+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectProofReply::allocation_size(val));
10643+ auto stream = RustStream(&buf);
10644+
10645+ FfiConverterOptionalTypeTonConnectProofReply::write(stream, val);
10646+
10647+ return buf;
10648+}
10649+
10650+std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::read(RustStream &stream) {
10651+ char has_value;
10652+
10653+ stream.get(has_value);
10654+ if (has_value) {
10655+ return std::make_optional(FfiConverterTypeTonConnectProofReply::read(stream));
10656+ } else {
10657+ return std::nullopt;
10658+ }
10659+}
10660+
10661+void FfiConverterOptionalTypeTonConnectProofReply::write(RustStream &stream, const std::optional<TonConnectProofReply>& value) {
10662+ stream.put(static_cast<uint8_t>(!!value));
10663+
10664+ if (value) {
10665+ FfiConverterTypeTonConnectProofReply::write(stream, value.value());
10666+ }
10667+}
10668+
10669+uint64_t FfiConverterOptionalTypeTonConnectProofReply::allocation_size(const std::optional<TonConnectProofReply> &val) {
10670+ uint64_t ret = 1;
10671+
10672+ if (val) {
10673+ ret += FfiConverterTypeTonConnectProofReply::allocation_size(val.value());
10674+ }
10675+
10676+ return ret;
10677+}
10678+
10679+std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::lift(RustBuffer buf) {
10680+ auto stream = RustStream(&buf);
10681+ auto ret = FfiConverterOptionalHttpHostErrorKind::read(stream);
10682+
10683+ rustbuffer_free(buf);
10684+
10685+ return ret;
10686+}
10687+
10688+RustBuffer FfiConverterOptionalHttpHostErrorKind::lower(const std::optional<HttpHostErrorKind>& val) {
10689+ auto buf = rustbuffer_alloc(FfiConverterOptionalHttpHostErrorKind::allocation_size(val));
10690+ auto stream = RustStream(&buf);
10691+
10692+ FfiConverterOptionalHttpHostErrorKind::write(stream, val);
10693+
10694+ return buf;
10695+}
10696+
10697+std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::read(RustStream &stream) {
10698+ char has_value;
10699+
10700+ stream.get(has_value);
10701+ if (has_value) {
10702+ return std::make_optional(FfiConverterHttpHostErrorKind::read(stream));
10703+ } else {
10704+ return std::nullopt;
10705+ }
10706+}
10707+
10708+void FfiConverterOptionalHttpHostErrorKind::write(RustStream &stream, const std::optional<HttpHostErrorKind>& value) {
10709+ stream.put(static_cast<uint8_t>(!!value));
10710+
10711+ if (value) {
10712+ FfiConverterHttpHostErrorKind::write(stream, value.value());
10713+ }
10714+}
10715+
10716+uint64_t FfiConverterOptionalHttpHostErrorKind::allocation_size(const std::optional<HttpHostErrorKind> &val) {
10717+ uint64_t ret = 1;
10718+
10719+ if (val) {
10720+ ret += FfiConverterHttpHostErrorKind::allocation_size(val.value());
10721+ }
10722+
10723+ return ret;
10724+}
10725+
10726+std::optional<PendingReason> FfiConverterOptionalPendingReason::lift(RustBuffer buf) {
10727+ auto stream = RustStream(&buf);
10728+ auto ret = FfiConverterOptionalPendingReason::read(stream);
10729+
10730+ rustbuffer_free(buf);
10731+
10732+ return ret;
10733+}
10734+
10735+RustBuffer FfiConverterOptionalPendingReason::lower(const std::optional<PendingReason>& val) {
10736+ auto buf = rustbuffer_alloc(FfiConverterOptionalPendingReason::allocation_size(val));
10737+ auto stream = RustStream(&buf);
10738+
10739+ FfiConverterOptionalPendingReason::write(stream, val);
10740+
10741+ return buf;
10742+}
10743+
10744+std::optional<PendingReason> FfiConverterOptionalPendingReason::read(RustStream &stream) {
10745+ char has_value;
10746+
10747+ stream.get(has_value);
10748+ if (has_value) {
10749+ return std::make_optional(FfiConverterPendingReason::read(stream));
10750+ } else {
10751+ return std::nullopt;
10752+ }
10753+}
10754+
10755+void FfiConverterOptionalPendingReason::write(RustStream &stream, const std::optional<PendingReason>& value) {
10756+ stream.put(static_cast<uint8_t>(!!value));
10757+
10758+ if (value) {
10759+ FfiConverterPendingReason::write(stream, value.value());
10760+ }
10761+}
10762+
10763+uint64_t FfiConverterOptionalPendingReason::allocation_size(const std::optional<PendingReason> &val) {
10764+ uint64_t ret = 1;
10765+
10766+ if (val) {
10767+ ret += FfiConverterPendingReason::allocation_size(val.value());
10768+ }
10769+
10770+ return ret;
10771+}
10772+
10773+std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::lift(RustBuffer buf) {
10774+ auto stream = RustStream(&buf);
10775+ auto ret = FfiConverterOptionalTypeBase64Hash::read(stream);
10776+
10777+ rustbuffer_free(buf);
10778+
10779+ return ret;
10780+}
10781+
10782+RustBuffer FfiConverterOptionalTypeBase64Hash::lower(const std::optional<Base64Hash>& val) {
10783+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBase64Hash::allocation_size(val));
10784+ auto stream = RustStream(&buf);
10785+
10786+ FfiConverterOptionalTypeBase64Hash::write(stream, val);
10787+
10788+ return buf;
10789+}
10790+
10791+std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::read(RustStream &stream) {
10792+ char has_value;
10793+
10794+ stream.get(has_value);
10795+ if (has_value) {
10796+ return std::make_optional(FfiConverterTypeBase64Hash::read(stream));
10797+ } else {
10798+ return std::nullopt;
10799+ }
10800+}
10801+
10802+void FfiConverterOptionalTypeBase64Hash::write(RustStream &stream, const std::optional<Base64Hash>& value) {
10803+ stream.put(static_cast<uint8_t>(!!value));
10804+
10805+ if (value) {
10806+ FfiConverterTypeBase64Hash::write(stream, value.value());
10807+ }
10808+}
10809+
10810+uint64_t FfiConverterOptionalTypeBase64Hash::allocation_size(const std::optional<Base64Hash> &val) {
10811+ uint64_t ret = 1;
10812+
10813+ if (val) {
10814+ ret += FfiConverterTypeBase64Hash::allocation_size(val.value());
10815+ }
10816+
10817+ return ret;
10818+}
10819+
10820+std::optional<Boc> FfiConverterOptionalTypeBoc::lift(RustBuffer buf) {
10821+ auto stream = RustStream(&buf);
10822+ auto ret = FfiConverterOptionalTypeBoc::read(stream);
10823+
10824+ rustbuffer_free(buf);
10825+
10826+ return ret;
10827+}
10828+
10829+RustBuffer FfiConverterOptionalTypeBoc::lower(const std::optional<Boc>& val) {
10830+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBoc::allocation_size(val));
10831+ auto stream = RustStream(&buf);
10832+
10833+ FfiConverterOptionalTypeBoc::write(stream, val);
10834+
10835+ return buf;
10836+}
10837+
10838+std::optional<Boc> FfiConverterOptionalTypeBoc::read(RustStream &stream) {
10839+ char has_value;
10840+
10841+ stream.get(has_value);
10842+ if (has_value) {
10843+ return std::make_optional(FfiConverterTypeBoc::read(stream));
10844+ } else {
10845+ return std::nullopt;
10846+ }
10847+}
10848+
10849+void FfiConverterOptionalTypeBoc::write(RustStream &stream, const std::optional<Boc>& value) {
10850+ stream.put(static_cast<uint8_t>(!!value));
10851+
10852+ if (value) {
10853+ FfiConverterTypeBoc::write(stream, value.value());
10854+ }
10855+}
10856+
10857+uint64_t FfiConverterOptionalTypeBoc::allocation_size(const std::optional<Boc> &val) {
10858+ uint64_t ret = 1;
10859+
10860+ if (val) {
10861+ ret += FfiConverterTypeBoc::allocation_size(val.value());
10862+ }
10863+
10864+ return ret;
10865+}
10866+
10867+std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::lift(RustBuffer buf) {
10868+ auto stream = RustStream(&buf);
10869+ auto ret = FfiConverterOptionalTypeNonEmptyString::read(stream);
10870+
10871+ rustbuffer_free(buf);
10872+
10873+ return ret;
10874+}
10875+
10876+RustBuffer FfiConverterOptionalTypeNonEmptyString::lower(const std::optional<NonEmptyString>& val) {
10877+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNonEmptyString::allocation_size(val));
10878+ auto stream = RustStream(&buf);
10879+
10880+ FfiConverterOptionalTypeNonEmptyString::write(stream, val);
10881+
10882+ return buf;
10883+}
10884+
10885+std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::read(RustStream &stream) {
10886+ char has_value;
10887+
10888+ stream.get(has_value);
10889+ if (has_value) {
10890+ return std::make_optional(FfiConverterTypeNonEmptyString::read(stream));
10891+ } else {
10892+ return std::nullopt;
10893+ }
10894+}
10895+
10896+void FfiConverterOptionalTypeNonEmptyString::write(RustStream &stream, const std::optional<NonEmptyString>& value) {
10897+ stream.put(static_cast<uint8_t>(!!value));
10898+
10899+ if (value) {
10900+ FfiConverterTypeNonEmptyString::write(stream, value.value());
10901+ }
10902+}
10903+
10904+uint64_t FfiConverterOptionalTypeNonEmptyString::allocation_size(const std::optional<NonEmptyString> &val) {
10905+ uint64_t ret = 1;
10906+
10907+ if (val) {
10908+ ret += FfiConverterTypeNonEmptyString::allocation_size(val.value());
10909+ }
10910+
10911+ return ret;
10912+}
10913+
10914+std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::lift(RustBuffer buf) {
10915+ auto stream = RustStream(&buf);
10916+ auto ret = FfiConverterOptionalTypeTonAddressString::read(stream);
10917+
10918+ rustbuffer_free(buf);
10919+
10920+ return ret;
10921+}
10922+
10923+RustBuffer FfiConverterOptionalTypeTonAddressString::lower(const std::optional<TonAddressString>& val) {
10924+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonAddressString::allocation_size(val));
10925+ auto stream = RustStream(&buf);
10926+
10927+ FfiConverterOptionalTypeTonAddressString::write(stream, val);
10928+
10929+ return buf;
10930+}
10931+
10932+std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::read(RustStream &stream) {
10933+ char has_value;
10934+
10935+ stream.get(has_value);
10936+ if (has_value) {
10937+ return std::make_optional(FfiConverterTypeTonAddressString::read(stream));
10938+ } else {
10939+ return std::nullopt;
10940+ }
10941+}
10942+
10943+void FfiConverterOptionalTypeTonAddressString::write(RustStream &stream, const std::optional<TonAddressString>& value) {
10944+ stream.put(static_cast<uint8_t>(!!value));
10945+
10946+ if (value) {
10947+ FfiConverterTypeTonAddressString::write(stream, value.value());
10948+ }
10949+}
10950+
10951+uint64_t FfiConverterOptionalTypeTonAddressString::allocation_size(const std::optional<TonAddressString> &val) {
10952+ uint64_t ret = 1;
10953+
10954+ if (val) {
10955+ ret += FfiConverterTypeTonAddressString::allocation_size(val.value());
10956+ }
10957+
10958+ return ret;
10959+}
10960+
10961+std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::lift(RustBuffer buf) {
10962+ auto stream = RustStream(&buf);
10963+ auto ret = FfiConverterOptionalTypeUnsignedDecimalString::read(stream);
10964+
10965+ rustbuffer_free(buf);
10966+
10967+ return ret;
10968+}
10969+
10970+RustBuffer FfiConverterOptionalTypeUnsignedDecimalString::lower(const std::optional<UnsignedDecimalString>& val) {
10971+ auto buf = rustbuffer_alloc(FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val));
10972+ auto stream = RustStream(&buf);
10973+
10974+ FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val);
10975+
10976+ return buf;
10977+}
10978+
10979+std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::read(RustStream &stream) {
10980+ char has_value;
10981+
10982+ stream.get(has_value);
10983+ if (has_value) {
10984+ return std::make_optional(FfiConverterTypeUnsignedDecimalString::read(stream));
10985+ } else {
10986+ return std::nullopt;
10987+ }
10988+}
10989+
10990+void FfiConverterOptionalTypeUnsignedDecimalString::write(RustStream &stream, const std::optional<UnsignedDecimalString>& value) {
10991+ stream.put(static_cast<uint8_t>(!!value));
10992+
10993+ if (value) {
10994+ FfiConverterTypeUnsignedDecimalString::write(stream, value.value());
10995+ }
10996+}
10997+
10998+uint64_t FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(const std::optional<UnsignedDecimalString> &val) {
10999+ uint64_t ret = 1;
11000+
11001+ if (val) {
11002+ ret += FfiConverterTypeUnsignedDecimalString::allocation_size(val.value());
11003+ }
11004+
11005+ return ret;
11006+}
11007+
11008+
11009+std::vector<std::string> FfiConverterSequenceString::lift(RustBuffer buf) {
11010+ auto stream = RustStream(&buf);
11011+ auto ret = read(stream);
11012+
11013+ rustbuffer_free(buf);
11014+
11015+ return ret;
11016+}
11017+
11018+RustBuffer FfiConverterSequenceString::lower(const std::vector<std::string> &val) {
11019+ auto buf = rustbuffer_alloc(allocation_size(val));
11020+ auto stream = RustStream(&buf);
11021+
11022+ write(stream, val);
11023+
11024+ return buf;
11025+}
11026+
11027+std::vector<std::string> FfiConverterSequenceString::read(RustStream &stream) {
11028+ std::vector<std::string> ret;
11029+ int32_t count;
11030+ stream >> count;
11031+
11032+ ret.reserve(count);
11033+
11034+ for (decltype(count) i = 0; i < count; i++) {
11035+ ret.push_back(FfiConverterString::read(stream));
11036+ }
11037+
11038+ return ret;
11039+}
11040+
11041+void FfiConverterSequenceString::write(RustStream &stream, const std::vector<std::string> &val) {
11042+ stream << static_cast<int32_t>(val.size());
11043+
11044+ for (auto &elem : val) {
11045+ FfiConverterString::write(stream, elem);
11046+ }
11047+}
11048+
11049+uint64_t FfiConverterSequenceString::allocation_size(const std::vector<std::string> &val) {
11050+ uint64_t size = sizeof(int32_t);
11051+
11052+ for (auto &elem : val) {
11053+ size += FfiConverterString::allocation_size(elem);
11054+ }
11055+
11056+ return size;
11057+}
11058+
11059+
11060+std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::lift(RustBuffer buf) {
11061+ auto stream = RustStream(&buf);
11062+ auto ret = read(stream);
11063+
11064+ rustbuffer_free(buf);
11065+
11066+ return ret;
11067+}
11068+
11069+RustBuffer FfiConverterSequenceTypeActivityItem::lower(const std::vector<ActivityItem> &val) {
11070+ auto buf = rustbuffer_alloc(allocation_size(val));
11071+ auto stream = RustStream(&buf);
11072+
11073+ write(stream, val);
11074+
11075+ return buf;
11076+}
11077+
11078+std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::read(RustStream &stream) {
11079+ std::vector<ActivityItem> ret;
11080+ int32_t count;
11081+ stream >> count;
11082+
11083+ ret.reserve(count);
11084+
11085+ for (decltype(count) i = 0; i < count; i++) {
11086+ ret.push_back(FfiConverterTypeActivityItem::read(stream));
11087+ }
11088+
11089+ return ret;
11090+}
11091+
11092+void FfiConverterSequenceTypeActivityItem::write(RustStream &stream, const std::vector<ActivityItem> &val) {
11093+ stream << static_cast<int32_t>(val.size());
11094+
11095+ for (auto &elem : val) {
11096+ FfiConverterTypeActivityItem::write(stream, elem);
11097+ }
11098+}
11099+
11100+uint64_t FfiConverterSequenceTypeActivityItem::allocation_size(const std::vector<ActivityItem> &val) {
11101+ uint64_t size = sizeof(int32_t);
11102+
11103+ for (auto &elem : val) {
11104+ size += FfiConverterTypeActivityItem::allocation_size(elem);
11105+ }
11106+
11107+ return size;
11108+}
11109+
11110+
11111+std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::lift(RustBuffer buf) {
11112+ auto stream = RustStream(&buf);
11113+ auto ret = read(stream);
11114+
11115+ rustbuffer_free(buf);
11116+
11117+ return ret;
11118+}
11119+
11120+RustBuffer FfiConverterSequenceTypeHttpHeader::lower(const std::vector<HttpHeader> &val) {
11121+ auto buf = rustbuffer_alloc(allocation_size(val));
11122+ auto stream = RustStream(&buf);
11123+
11124+ write(stream, val);
11125+
11126+ return buf;
11127+}
11128+
11129+std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::read(RustStream &stream) {
11130+ std::vector<HttpHeader> ret;
11131+ int32_t count;
11132+ stream >> count;
11133+
11134+ ret.reserve(count);
11135+
11136+ for (decltype(count) i = 0; i < count; i++) {
11137+ ret.push_back(FfiConverterTypeHttpHeader::read(stream));
11138+ }
11139+
11140+ return ret;
11141+}
11142+
11143+void FfiConverterSequenceTypeHttpHeader::write(RustStream &stream, const std::vector<HttpHeader> &val) {
11144+ stream << static_cast<int32_t>(val.size());
11145+
11146+ for (auto &elem : val) {
11147+ FfiConverterTypeHttpHeader::write(stream, elem);
11148+ }
11149+}
11150+
11151+uint64_t FfiConverterSequenceTypeHttpHeader::allocation_size(const std::vector<HttpHeader> &val) {
11152+ uint64_t size = sizeof(int32_t);
11153+
11154+ for (auto &elem : val) {
11155+ size += FfiConverterTypeHttpHeader::allocation_size(elem);
11156+ }
11157+
11158+ return size;
11159+}
11160+
11161+
11162+std::vector<NftItem> FfiConverterSequenceTypeNftItem::lift(RustBuffer buf) {
11163+ auto stream = RustStream(&buf);
11164+ auto ret = read(stream);
11165+
11166+ rustbuffer_free(buf);
11167+
11168+ return ret;
11169+}
11170+
11171+RustBuffer FfiConverterSequenceTypeNftItem::lower(const std::vector<NftItem> &val) {
11172+ auto buf = rustbuffer_alloc(allocation_size(val));
11173+ auto stream = RustStream(&buf);
11174+
11175+ write(stream, val);
11176+
11177+ return buf;
11178+}
11179+
11180+std::vector<NftItem> FfiConverterSequenceTypeNftItem::read(RustStream &stream) {
11181+ std::vector<NftItem> ret;
11182+ int32_t count;
11183+ stream >> count;
11184+
11185+ ret.reserve(count);
11186+
11187+ for (decltype(count) i = 0; i < count; i++) {
11188+ ret.push_back(FfiConverterTypeNftItem::read(stream));
11189+ }
11190+
11191+ return ret;
11192+}
11193+
11194+void FfiConverterSequenceTypeNftItem::write(RustStream &stream, const std::vector<NftItem> &val) {
11195+ stream << static_cast<int32_t>(val.size());
11196+
11197+ for (auto &elem : val) {
11198+ FfiConverterTypeNftItem::write(stream, elem);
11199+ }
11200+}
11201+
11202+uint64_t FfiConverterSequenceTypeNftItem::allocation_size(const std::vector<NftItem> &val) {
11203+ uint64_t size = sizeof(int32_t);
11204+
11205+ for (auto &elem : val) {
11206+ size += FfiConverterTypeNftItem::allocation_size(elem);
11207+ }
11208+
11209+ return size;
11210+}
11211+
11212+
11213+std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::lift(RustBuffer buf) {
11214+ auto stream = RustStream(&buf);
11215+ auto ret = read(stream);
11216+
11217+ rustbuffer_free(buf);
11218+
11219+ return ret;
11220+}
11221+
11222+RustBuffer FfiConverterSequenceTypeSendEmulationAction::lower(const std::vector<SendEmulationAction> &val) {
11223+ auto buf = rustbuffer_alloc(allocation_size(val));
11224+ auto stream = RustStream(&buf);
11225+
11226+ write(stream, val);
11227+
11228+ return buf;
11229+}
11230+
11231+std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::read(RustStream &stream) {
11232+ std::vector<SendEmulationAction> ret;
11233+ int32_t count;
11234+ stream >> count;
11235+
11236+ ret.reserve(count);
11237+
11238+ for (decltype(count) i = 0; i < count; i++) {
11239+ ret.push_back(FfiConverterTypeSendEmulationAction::read(stream));
11240+ }
11241+
11242+ return ret;
11243+}
11244+
11245+void FfiConverterSequenceTypeSendEmulationAction::write(RustStream &stream, const std::vector<SendEmulationAction> &val) {
11246+ stream << static_cast<int32_t>(val.size());
11247+
11248+ for (auto &elem : val) {
11249+ FfiConverterTypeSendEmulationAction::write(stream, elem);
11250+ }
11251+}
11252+
11253+uint64_t FfiConverterSequenceTypeSendEmulationAction::allocation_size(const std::vector<SendEmulationAction> &val) {
11254+ uint64_t size = sizeof(int32_t);
11255+
11256+ for (auto &elem : val) {
11257+ size += FfiConverterTypeSendEmulationAction::allocation_size(elem);
11258+ }
11259+
11260+ return size;
11261+}
11262+
11263+
11264+std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::lift(RustBuffer buf) {
11265+ auto stream = RustStream(&buf);
11266+ auto ret = read(stream);
11267+
11268+ rustbuffer_free(buf);
11269+
11270+ return ret;
11271+}
11272+
11273+RustBuffer FfiConverterSequenceTypeSendEmulationTransaction::lower(const std::vector<SendEmulationTransaction> &val) {
11274+ auto buf = rustbuffer_alloc(allocation_size(val));
11275+ auto stream = RustStream(&buf);
11276+
11277+ write(stream, val);
11278+
11279+ return buf;
11280+}
11281+
11282+std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::read(RustStream &stream) {
11283+ std::vector<SendEmulationTransaction> ret;
11284+ int32_t count;
11285+ stream >> count;
11286+
11287+ ret.reserve(count);
11288+
11289+ for (decltype(count) i = 0; i < count; i++) {
11290+ ret.push_back(FfiConverterTypeSendEmulationTransaction::read(stream));
11291+ }
11292+
11293+ return ret;
11294+}
11295+
11296+void FfiConverterSequenceTypeSendEmulationTransaction::write(RustStream &stream, const std::vector<SendEmulationTransaction> &val) {
11297+ stream << static_cast<int32_t>(val.size());
11298+
11299+ for (auto &elem : val) {
11300+ FfiConverterTypeSendEmulationTransaction::write(stream, elem);
11301+ }
11302+}
11303+
11304+uint64_t FfiConverterSequenceTypeSendEmulationTransaction::allocation_size(const std::vector<SendEmulationTransaction> &val) {
11305+ uint64_t size = sizeof(int32_t);
11306+
11307+ for (auto &elem : val) {
11308+ size += FfiConverterTypeSendEmulationTransaction::allocation_size(elem);
11309+ }
11310+
11311+ return size;
11312+}
11313+
11314+
11315+std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::lift(RustBuffer buf) {
11316+ auto stream = RustStream(&buf);
11317+ auto ret = read(stream);
11318+
11319+ rustbuffer_free(buf);
11320+
11321+ return ret;
11322+}
11323+
11324+RustBuffer FfiConverterSequenceTypeSendMessage::lower(const std::vector<SendMessage> &val) {
11325+ auto buf = rustbuffer_alloc(allocation_size(val));
11326+ auto stream = RustStream(&buf);
11327+
11328+ write(stream, val);
11329+
11330+ return buf;
11331+}
11332+
11333+std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::read(RustStream &stream) {
11334+ std::vector<SendMessage> ret;
11335+ int32_t count;
11336+ stream >> count;
11337+
11338+ ret.reserve(count);
11339+
11340+ for (decltype(count) i = 0; i < count; i++) {
11341+ ret.push_back(FfiConverterTypeSendMessage::read(stream));
11342+ }
11343+
11344+ return ret;
11345+}
11346+
11347+void FfiConverterSequenceTypeSendMessage::write(RustStream &stream, const std::vector<SendMessage> &val) {
11348+ stream << static_cast<int32_t>(val.size());
11349+
11350+ for (auto &elem : val) {
11351+ FfiConverterTypeSendMessage::write(stream, elem);
11352+ }
11353+}
11354+
11355+uint64_t FfiConverterSequenceTypeSendMessage::allocation_size(const std::vector<SendMessage> &val) {
11356+ uint64_t size = sizeof(int32_t);
11357+
11358+ for (auto &elem : val) {
11359+ size += FfiConverterTypeSendMessage::allocation_size(elem);
11360+ }
11361+
11362+ return size;
11363+}
11364+
11365+
11366+std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::lift(RustBuffer buf) {
11367+ auto stream = RustStream(&buf);
11368+ auto ret = read(stream);
11369+
11370+ rustbuffer_free(buf);
11371+
11372+ return ret;
11373+}
11374+
11375+RustBuffer FfiConverterSequenceMnemonicScheme::lower(const std::vector<MnemonicScheme> &val) {
11376+ auto buf = rustbuffer_alloc(allocation_size(val));
11377+ auto stream = RustStream(&buf);
11378+
11379+ write(stream, val);
11380+
11381+ return buf;
11382+}
11383+
11384+std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::read(RustStream &stream) {
11385+ std::vector<MnemonicScheme> ret;
11386+ int32_t count;
11387+ stream >> count;
11388+
11389+ ret.reserve(count);
11390+
11391+ for (decltype(count) i = 0; i < count; i++) {
11392+ ret.push_back(FfiConverterMnemonicScheme::read(stream));
11393+ }
11394+
11395+ return ret;
11396+}
11397+
11398+void FfiConverterSequenceMnemonicScheme::write(RustStream &stream, const std::vector<MnemonicScheme> &val) {
11399+ stream << static_cast<int32_t>(val.size());
11400+
11401+ for (auto &elem : val) {
11402+ FfiConverterMnemonicScheme::write(stream, elem);
11403+ }
11404+}
11405+
11406+uint64_t FfiConverterSequenceMnemonicScheme::allocation_size(const std::vector<MnemonicScheme> &val) {
11407+ uint64_t size = sizeof(int32_t);
11408+
11409+ for (auto &elem : val) {
11410+ size += FfiConverterMnemonicScheme::allocation_size(elem);
11411+ }
11412+
11413+ return size;
11414+}
11415+
11416+
11417+std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::lift(RustBuffer buf) {
11418+ auto stream = RustStream(&buf);
11419+ auto ret = read(stream);
11420+
11421+ rustbuffer_free(buf);
11422+
11423+ return ret;
11424+}
11425+
11426+RustBuffer FfiConverterSequenceTonConnectIncomingRequest::lower(const std::vector<TonConnectIncomingRequest> &val) {
11427+ auto buf = rustbuffer_alloc(allocation_size(val));
11428+ auto stream = RustStream(&buf);
11429+
11430+ write(stream, val);
11431+
11432+ return buf;
11433+}
11434+
11435+std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::read(RustStream &stream) {
11436+ std::vector<TonConnectIncomingRequest> ret;
11437+ int32_t count;
11438+ stream >> count;
11439+
11440+ ret.reserve(count);
11441+
11442+ for (decltype(count) i = 0; i < count; i++) {
11443+ ret.push_back(FfiConverterTonConnectIncomingRequest::read(stream));
11444+ }
11445+
11446+ return ret;
11447+}
11448+
11449+void FfiConverterSequenceTonConnectIncomingRequest::write(RustStream &stream, const std::vector<TonConnectIncomingRequest> &val) {
11450+ stream << static_cast<int32_t>(val.size());
11451+
11452+ for (auto &elem : val) {
11453+ FfiConverterTonConnectIncomingRequest::write(stream, elem);
11454+ }
11455+}
11456+
11457+uint64_t FfiConverterSequenceTonConnectIncomingRequest::allocation_size(const std::vector<TonConnectIncomingRequest> &val) {
11458+ uint64_t size = sizeof(int32_t);
11459+
11460+ for (auto &elem : val) {
11461+ size += FfiConverterTonConnectIncomingRequest::allocation_size(elem);
11462+ }
11463+
11464+ return size;
11465+}
11466+
11467+
11468+std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::lift(RustBuffer buf) {
11469+ auto stream = RustStream(&buf);
11470+ auto ret = read(stream);
11471+
11472+ rustbuffer_free(buf);
11473+
11474+ return ret;
11475+}
11476+
11477+RustBuffer FfiConverterSequenceTypeBase64Hash::lower(const std::vector<Base64Hash> &val) {
11478+ auto buf = rustbuffer_alloc(allocation_size(val));
11479+ auto stream = RustStream(&buf);
11480+
11481+ write(stream, val);
11482+
11483+ return buf;
11484+}
11485+
11486+std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::read(RustStream &stream) {
11487+ std::vector<Base64Hash> ret;
11488+ int32_t count;
11489+ stream >> count;
11490+
11491+ ret.reserve(count);
11492+
11493+ for (decltype(count) i = 0; i < count; i++) {
11494+ ret.push_back(FfiConverterTypeBase64Hash::read(stream));
11495+ }
11496+
11497+ return ret;
11498+}
11499+
11500+void FfiConverterSequenceTypeBase64Hash::write(RustStream &stream, const std::vector<Base64Hash> &val) {
11501+ stream << static_cast<int32_t>(val.size());
11502+
11503+ for (auto &elem : val) {
11504+ FfiConverterTypeBase64Hash::write(stream, elem);
11505+ }
11506+}
11507+
11508+uint64_t FfiConverterSequenceTypeBase64Hash::allocation_size(const std::vector<Base64Hash> &val) {
11509+ uint64_t size = sizeof(int32_t);
11510+
11511+ for (auto &elem : val) {
11512+ size += FfiConverterTypeBase64Hash::allocation_size(elem);
11513+ }
11514+
11515+ return size;
11516+}
11517+
11518+
11519+std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::lift(RustBuffer buf) {
11520+ auto stream = RustStream(&buf);
11521+ auto ret = read(stream);
11522+
11523+ rustbuffer_free(buf);
11524+
11525+ return ret;
11526+}
11527+
11528+RustBuffer FfiConverterSequenceTypeTonAddressString::lower(const std::vector<TonAddressString> &val) {
11529+ auto buf = rustbuffer_alloc(allocation_size(val));
11530+ auto stream = RustStream(&buf);
11531+
11532+ write(stream, val);
11533+
11534+ return buf;
11535+}
11536+
11537+std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::read(RustStream &stream) {
11538+ std::vector<TonAddressString> ret;
11539+ int32_t count;
11540+ stream >> count;
11541+
11542+ ret.reserve(count);
11543+
11544+ for (decltype(count) i = 0; i < count; i++) {
11545+ ret.push_back(FfiConverterTypeTonAddressString::read(stream));
11546+ }
11547+
11548+ return ret;
11549+}
11550+
11551+void FfiConverterSequenceTypeTonAddressString::write(RustStream &stream, const std::vector<TonAddressString> &val) {
11552+ stream << static_cast<int32_t>(val.size());
11553+
11554+ for (auto &elem : val) {
11555+ FfiConverterTypeTonAddressString::write(stream, elem);
11556+ }
11557+}
11558+
11559+uint64_t FfiConverterSequenceTypeTonAddressString::allocation_size(const std::vector<TonAddressString> &val) {
11560+ uint64_t size = sizeof(int32_t);
11561+
11562+ for (auto &elem : val) {
11563+ size += FfiConverterTypeTonAddressString::allocation_size(elem);
11564+ }
11565+
11566+ return size;
11567+}
11568+
11569+
11570+std::unordered_map<std::string, std::string> FfiConverterMapStringString::lift(RustBuffer buf) {
11571+ auto stream = RustStream(&buf);
11572+ auto ret = read(stream);
11573+
11574+ rustbuffer_free(buf);
11575+
11576+ return ret;
11577+}
11578+
11579+RustBuffer FfiConverterMapStringString::lower(const std::unordered_map<std::string, std::string> &val) {
11580+ auto buf = rustbuffer_alloc(allocation_size(val));
11581+ auto stream = RustStream(&buf);
11582+
11583+ write(stream, val);
11584+
11585+ return buf;
11586+}
11587+
11588+std::unordered_map<std::string, std::string> FfiConverterMapStringString::read(RustStream &stream) {
11589+ std::unordered_map<std::string, std::string> ret;
11590+ int32_t count;
11591+ stream >> count;
11592+
11593+ ret.reserve(count);
11594+
11595+ for (decltype(count) i = 0; i < count; i++) {
11596+ ret.insert({ FfiConverterString::read(stream), FfiConverterString::read(stream) });
11597+ }
11598+
11599+ return ret;
11600+}
11601+
11602+void FfiConverterMapStringString::write(RustStream &stream, const std::unordered_map<std::string, std::string> &val) {
11603+ stream << static_cast<int32_t>(val.size());
11604+
11605+ for (auto &entry : val) {
11606+ FfiConverterString::write(stream, entry.first);
11607+ FfiConverterString::write(stream, entry.second);
11608+ }
11609+}
11610+
11611+uint64_t FfiConverterMapStringString::allocation_size(const std::unordered_map<std::string, std::string> &val) {
11612+ uint64_t size = sizeof(int32_t);
11613+
11614+ for (auto &entry : val) {
11615+ size += FfiConverterString::allocation_size(entry.first);
11616+ size += FfiConverterString::allocation_size(entry.second);
11617+ }
11618+
11619+ return size;
11620+}
11621+
11622+
11623+
11624+
11625+
11626+
11627+}
11628+
11629+ParsedTonTransferLink parse_ton_transfer_link(const std::string &value) {
11630+ auto ret =
11631+ uniffi::rust_call(
11632+ uniffi_wallet_engine_fn_func_parse_ton_transfer_link,
11633+ uniffi::FfiConverterTonTransferLinkError::lift, uniffi::FfiConverterString::lower(value));
11634+
11635+ return uniffi::FfiConverterTypeParsedTonTransferLink::lift(ret);
11636+}
11637+
11638+
11639+TonConnectManifest parse_ton_connect_manifest(const std::string &json) {
11640+ auto ret =
11641+ uniffi::rust_call(
11642+ uniffi_wallet_engine_fn_func_parse_ton_connect_manifest,
11643+ uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(json));
11644+
11645+ return uniffi::FfiConverterTypeTonConnectManifest::lift(ret);
11646+}
11647+
11648+
11649+std::shared_ptr<TonConnectSession> ton_connect_session_from_link(const std::string &link, const TonConnectSessionConfig &config) {
11650+ auto ret =
11651+ uniffi::rust_call(
11652+ uniffi_wallet_engine_fn_func_ton_connect_session_from_link,
11653+ uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(link), uniffi::FfiConverterTypeTonConnectSessionConfig::lower(config));
11654+
11655+ return uniffi::FfiConverterTonConnectSession::lift(ret);
11656+}
11657+
11658+
11659+std::shared_ptr<TonConnectSession> ton_connect_session_restore(const std::string &persisted, const TonConnectSessionConfig &config) {
11660+ auto ret =
11661+ uniffi::rust_call(
11662+ uniffi_wallet_engine_fn_func_ton_connect_session_restore,
11663+ uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(persisted), uniffi::FfiConverterTypeTonConnectSessionConfig::lower(config));
11664+
11665+ return uniffi::FfiConverterTonConnectSession::lift(ret);
11666+}
11667+
11668+
11669+std::string convert_ton_address(const std::string &value, TonAddressFormat format) {
11670+ auto ret =
11671+ uniffi::rust_call(
11672+ uniffi_wallet_engine_fn_func_convert_ton_address,
11673+ uniffi::FfiConverterTonAddressError::lift, uniffi::FfiConverterString::lower(value), uniffi::FfiConverterTonAddressFormat::lower(format));
11674+
11675+ return uniffi::FfiConverterString::lift(ret);
11676+}
11677+
11678+
11679+bool is_valid_ton_address(const std::string &value) {
11680+ auto ret =
11681+ uniffi::rust_call(
11682+ uniffi_wallet_engine_fn_func_is_valid_ton_address,
11683+ nullptr, uniffi::FfiConverterString::lower(value));
11684+
11685+ return uniffi::FfiConverterBool::lift(ret);
11686+}
11687+
11688+
11689+TonAddressInfo parse_ton_address(const std::string &value) {
11690+ auto ret =
11691+ uniffi::rust_call(
11692+ uniffi_wallet_engine_fn_func_parse_ton_address,
11693+ uniffi::FfiConverterTonAddressError::lift, uniffi::FfiConverterString::lower(value));
11694+
11695+ return uniffi::FfiConverterTypeTonAddressInfo::lift(ret);
11696+}
11697+
11698+
11699+std::vector<std::string> mnemonic_wordlist() {
11700+ auto ret =
11701+ uniffi::rust_call(
11702+ uniffi_wallet_engine_fn_func_mnemonic_wordlist,
11703+ nullptr);
11704+
11705+ return uniffi::FfiConverterSequenceString::lift(ret);
11706+}
11707+
11708+
11709+std::vector<MnemonicScheme> detect_mnemonic_schemes(const std::vector<std::string> &words) {
11710+ auto ret =
11711+ uniffi::rust_call(
11712+ uniffi_wallet_engine_fn_func_detect_mnemonic_schemes,
11713+ nullptr, uniffi::FfiConverterSequenceString::lower(words));
11714+
11715+ return uniffi::FfiConverterSequenceMnemonicScheme::lift(ret);
11716+}
11717+
11718+
11719+std::vector<uint8_t> rotation_mnemonic_public_key(const std::string &phrase) {
11720+ auto ret =
11721+ uniffi::rust_call(
11722+ uniffi_wallet_engine_fn_func_rotation_mnemonic_public_key,
11723+ uniffi::FfiConverterWalletLifecycleError::lift, uniffi::FfiConverterString::lower(phrase));
11724+
11725+ return uniffi::FfiConverterBytes::lift(ret);
11726+}
11727+} // namespace wallet_engine
TMessagesProj/jni/prebuild/include/wallet-engine/wallet_engine.hppnew file+7015

This diff is too big to show here.

TMessagesProj/jni/prebuild/include/wallet-engine/wallet_engine_scaffolding.hppnew file+433

This diff is too big to show here.

TMessagesProj/jni/prebuild/lib/arm64-v8a/libiwasm.adeleted

Binary file not shown.

TMessagesProj/jni/prebuild/lib/armeabi-v7a/libiwasm.adeleted

Binary file not shown.

TMessagesProj/jni/prebuild/lib/x86/libiwasm.adeleted

Binary file not shown.

TMessagesProj/jni/prebuild/lib/x86_64/libiwasm.adeleted

Binary file not shown.

TMessagesProj/jni/prisma/CMakeLists.txtnew file+44

This diff is too big to show here.

TMessagesProj/jni/prisma/bridge/PrismaEngine.cppnew file+240

This diff is too big to show here.

TMessagesProj/jni/prisma/bridge/PrismaEngine.hnew file+36

This diff is too big to show here.

TMessagesProj/jni/prisma/bridge/PrismaIncludes.hnew file+10

This diff is too big to show here.

TMessagesProj/jni/prisma/bridge/PrismaJni.cppnew file+182

This diff is too big to show here.

TMessagesProj/jni/prisma/generate.jsnew file+502

This diff is too big to show here.

TMessagesProj/jni/prisma/generate_prisma_grammars.shnew file+19

This diff is too big to show here.

TMessagesProj/jni/prisma/libprisma/Highlight.cppnew file+33

This diff is too big to show here.

TMessagesProj/jni/prisma/libprisma/Highlight.hnew file+131

This diff is too big to show here.

TMessagesProj/jni/prisma/libprisma/SyntaxHighlighter.cppnew file+207

This diff is too big to show here.

TMessagesProj/jni/tde2e/bridge.cpp+50

This diff is too big to show here.

TMessagesProj/jni/tgcallsnew file+1

This diff is too big to show here.

TMessagesProj/jni/tgnet/ConnectionsManager.cpp+39−5

This diff is too big to show here.

TMessagesProj/jni/tgnet/ConnectionsManager.h+1−1

This diff is too big to show here.

TMessagesProj/jni/tgnet/Defines.h+4−2

This diff is too big to show here.

TMessagesProj/jni/tgnet/DownloadRequestBudget.hnew file+33

This diff is too big to show here.

TMessagesProj/jni/tgnet/Handshake.cpp+26−3

This diff is too big to show here.

TMessagesProj/jni/tgnet/MTProtoScheme.h+1

This diff is too big to show here.

TMessagesProj/jni/tgnet/TLSHello.cpp+1−1

This diff is too big to show here.

TMessagesProj/jni/third_party/boost-regexnew file+1

This diff is too big to show here.

TMessagesProj/jni/third_party/libprismanew file+1

This diff is too big to show here.

TMessagesProj/jni/tlottie+1−1

This diff is too big to show here.

TMessagesProj/jni/voip/CMakeLists.txt+82−79

This diff is too big to show here.

TMessagesProj/jni/voip/org_telegram_messenger_voip_Instance.cpp+1−1

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/AudioDeviceHelper.cppdeleted−142

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/AudioDeviceHelper.hdeleted−17

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/AudioFrame.hdeleted−17

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/ChannelManager.cppdeleted−161

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/ChannelManager.hdeleted−95

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/CodecSelectHelper.cppdeleted−303

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/CodecSelectHelper.hdeleted−32

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/CryptoHelper.cppdeleted−61

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/CryptoHelper.hdeleted−69

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/DirectConnectionChannel.hdeleted−22

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/EncryptedConnection.cppdeleted−808

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/EncryptedConnection.hdeleted−113

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/FakeAudioDeviceModule.cppdeleted−257

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/FakeAudioDeviceModule.hdeleted−55

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/FakeVideoTrackSource.cppdeleted−173

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/FakeVideoTrackSource.hdeleted−36

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/FieldTrialsConfig.cppdeleted−7

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/FieldTrialsConfig.hdeleted−12

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/Instance.cppdeleted−66

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/Instance.hdeleted−293

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/InstanceImpl.cppdeleted−202

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/InstanceImpl.hdeleted−57

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/LogSinkImpl.cppdeleted−71

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/LogSinkImpl.hdeleted−31

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/Manager.cppdeleted−465

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/Manager.hdeleted−94

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/MediaManager.cppdeleted−1173

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/MediaManager.hdeleted−195

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/Message.cppdeleted−406

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/Message.hdeleted−149

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/NetworkManager.cppdeleted−397

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/NetworkManager.hdeleted−123

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/PlatformContext.hdeleted−15

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/SctpDataChannelProviderInterfaceImpl.cppdeleted−160

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/SctpDataChannelProviderInterfaceImpl.hdeleted−74

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/StaticThreads.cppdeleted−144

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/StaticThreads.hdeleted−31

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/Stats.hdeleted−30

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/ThreadLocalObject.cppdeleted−1

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/ThreadLocalObject.hdeleted−58

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/TurnCustomizerImpl.cppdeleted−21

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/TurnCustomizerImpl.hdeleted−19

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/VideoCaptureInterface.cppdeleted−15

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/VideoCaptureInterface.hdeleted−62

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/VideoCaptureInterfaceImpl.cppdeleted−227

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/VideoCaptureInterfaceImpl.hdeleted−76

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/VideoCapturerInterface.hdeleted−42

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSource.cppdeleted−68

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSource.hdeleted−85

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceHelper.cppdeleted−461

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceHelper.hdeleted−56

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceManager.cppdeleted−65

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/desktop_capturer/DesktopCaptureSourceManager.hdeleted−49

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AVIOContextImpl.cppdeleted−64

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AVIOContextImpl.hdeleted−40

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPart.cppdeleted−181

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPart.hdeleted−45

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartInternal.cppdeleted−404

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartInternal.hdeleted−65

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartPersistentDecoder.cppdeleted−138

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/AudioStreamingPartPersistentDecoder.hdeleted−51

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupAudioCapturePostProcessor.cppdeleted−198

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupAudioCapturePostProcessor.hdeleted−91

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupFrameTransformer.cppdeleted−574

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupFrameTransformer.hdeleted−156

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupFrameTransformerTest.cppdeleted−255

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupInstanceCustomImpl.cppdeleted−3949

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupInstanceCustomImpl.hdeleted−60

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupInstanceImpl.hdeleted−239

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupInstanceReferenceImpl.cppdeleted−2538

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupInstanceReferenceImpl.hdeleted−58

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupJoinPayload.hdeleted−78

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupJoinPayloadInternal.cppdeleted−373

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupJoinPayloadInternal.hdeleted−32

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupNetworkManager.cppdeleted−680

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/GroupNetworkManager.hdeleted−134

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/StreamingAudioRenderer.cppdeleted−53

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/StreamingAudioRenderer.hdeleted−49

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/StreamingAudioRendererTest.cppdeleted−125

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/StreamingMediaContext.cppdeleted−1106

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/StreamingMediaContext.hdeleted−53

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/VideoStreamingPart.cppdeleted−925

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/group/VideoStreamingPart.hdeleted−78

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/PlatformInterface.hdeleted−364

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/AndroidContext.cppdeleted−61

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/AndroidContext.hdeleted−39

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/AndroidInterface.cppdeleted−167

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/AndroidInterface.hdeleted−29

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/VideoCameraCapturer.cppdeleted−62

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/VideoCameraCapturer.hdeleted−45

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/VideoCapturerInterfaceImpl.cppdeleted−31

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/android/VideoCapturerInterfaceImpl.hdeleted−27

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/AudioDeviceModuleIOS.hdeleted−40

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/AudioDeviceModuleMacos.hdeleted−32

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomExternalCapturer.hdeleted−22

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomExternalCapturer.mmdeleted−90

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomSimulcastEncoderAdapter.cppdeleted−1017

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/CustomSimulcastEncoderAdapter.hdeleted−201

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinFFMpeg.hdeleted−13

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinFFMpeg.mmdeleted−45

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinInterface.hdeleted−40

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinInterface.mmdeleted−158

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinVideoSource.hdeleted−57

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DarwinVideoSource.mmdeleted−165

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopCaptureSourceViewMac.hdeleted−55

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopCaptureSourceViewMac.mmdeleted−207

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopSharingCapturer.hdeleted−27

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/DesktopSharingCapturer.mmdeleted−117

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/ExtractCVPixelBuffer.hdeleted−12

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/ExtractCVPixelBuffer.mmdeleted−14

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCCodecSpecificInfoH265+Private.hdeleted−25

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCCodecSpecificInfoH265.hdeleted−28

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCCodecSpecificInfoH265.mmdeleted−27

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCH265ProfileLevelId.hdeleted−16

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/RTCH265ProfileLevelId.mmdeleted−18

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueue.hdeleted−19

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueue.mdeleted−124

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueueLocalObject.hdeleted−19

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/SQueueLocalObject.mdeleted−40

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIOCapturer.hdeleted−29

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIOCapturer.mdeleted−45

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIODevice.hdeleted−31

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGCMIODevice.mmdeleted−193

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCCVPixelBuffer.hdeleted−15

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCCVPixelBuffer.mmdeleted−28

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.hdeleted−25

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mmdeleted−116

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.hdeleted−32

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mmdeleted−172

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH264.hdeleted−18

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH264.mmdeleted−292

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH265.hdeleted−23

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoDecoderH265.mmdeleted−359

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH264.hdeleted−22

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH264.mmdeleted−852

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH265.hdeleted−40

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/TGRTCVideoEncoderH265.mmdeleted−624

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCMIOCapture.hdeleted−18

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCMIOCapture.mmdeleted−237

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturer.hdeleted−33

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturer.mmdeleted−941

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturerMac.hdeleted−35

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCameraCapturerMac.mmdeleted−725

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCaptureView.hdeleted−33

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCaptureView.mmdeleted−264

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCapturerInterfaceImpl.hdeleted−41

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoCapturerInterfaceImpl.mmdeleted−480

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalView.hdeleted−37

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalView.mmdeleted−459

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalViewMac.hdeleted−41

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoMetalViewMac.mmdeleted−503

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferView.hdeleted−35

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferView.mmdeleted−786

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferViewMac.hdeleted−36

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/VideoSampleBufferViewMac.mmdeleted−427

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/h264_encoder_impl.cppdeleted−349

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/h264_encoder_impl.hdeleted−81

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/h265_nalu_rewriter.ccdeleted−406

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/h265_nalu_rewriter.hdeleted−54

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/CallAudioTone.hdeleted−48

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession+Configuration.mmdeleted−184

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession+Private.hdeleted−95

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession.hdeleted−266

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSession.mmdeleted−1000

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSessionConfiguration.hdeleted−47

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCAudioSessionConfiguration.mmdeleted−137

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCNativeAudioSessionDelegateAdapter.hdeleted−33

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/RTCNativeAudioSessionDelegateAdapter.mmdeleted−89

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_ios.hdeleted−329

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_ios.mmdeleted−1210

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_module_ios.hdeleted−161

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_audio_device_module_ios.mmdeleted−756

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_voice_processing_audio_unit.hdeleted−149

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/iOS/tgcalls_voice_processing_audio_unit.mmdeleted−544

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLI420Renderer.hdeleted−17

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLI420Renderer.mmdeleted−111

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLRenderer+Private.hdeleted−33

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLRenderer.hdeleted−49

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMTLRenderer.mmdeleted−647

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMetalContextHolder.hdeleted−25

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/macOS/TGRTCMetalContextHolder.mdeleted−136

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_decoder_factory.hdeleted−41

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_decoder_factory.mmdeleted−126

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_encoder_factory.hdeleted−61

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/darwin/objc_video_encoder_factory.mmdeleted−240

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/fake/FakeInterface.cppdeleted−172

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/fake/FakeInterface.hdeleted−30

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/DesktopInterface.cppdeleted−56

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/DesktopInterface.hdeleted−22

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCameraCapturer.cppdeleted−253

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCameraCapturer.hdeleted−57

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerInterfaceImpl.cppdeleted−145

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerInterfaceImpl.hdeleted−55

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerTrackSource.cppdeleted−19

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/tdesktop/VideoCapturerTrackSource.hdeleted−30

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/uwp/UwpContext.hdeleted−28

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/uwp/UwpScreenCapturer.cppdeleted−397

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/platform/uwp/UwpScreenCapturer.hdeleted−84

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/third-party/json11.cppdeleted−791

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/third-party/json11.hppdeleted−232

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/utils/gzip.cppdeleted−183

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/utils/gzip.hdeleted−16

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ContentNegotiation.cppdeleted−649

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ContentNegotiation.hdeleted−100

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/CustomDcSctpSocket.cppdeleted−1827

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/CustomDcSctpSocket.hdeleted−301

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/CustomParameters.hdeleted−48

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/DirectNetworkingImpl.cppdeleted−600

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/DirectNetworkingImpl.hdeleted−120

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ExternalSignalingConnection.cppdeleted−30

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ExternalSignalingConnection.hdeleted−33

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/InstanceNetworking.hdeleted−173

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/InstanceV2CompatImpl.cppdeleted−1733

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/InstanceV2CompatImpl.hdeleted−62

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/InstanceV2Impl.cppdeleted−2412

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/InstanceV2Impl.hdeleted−60

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/InstanceV2ReferenceImpl.cppdeleted−2054

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/InstanceV2ReferenceImpl.hdeleted−60

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/MtProtoIceTransport.cppdeleted−338

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/MtProtoIceTransport.hdeleted−110

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/MtProtoIceTransportTest.cppdeleted−471

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/NativeNetworkingImpl.cppdeleted−1062

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/NativeNetworkingImpl.hdeleted−143

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/RawTcpSocket.cppdeleted−111

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/RawTcpSocket.hdeleted−53

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ReflectorPort.cppdeleted−965

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ReflectorPort.hdeleted−256

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ReflectorRelayPortFactory.cppdeleted−82

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/ReflectorRelayPortFactory.hdeleted−39

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/Signaling.cppdeleted−988

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/Signaling.hdeleted−196

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingConnection.cppdeleted−8

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingConnection.hdeleted−27

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingEncryption.cppdeleted−22

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingEncryption.hdeleted−24

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingSctpConnection.cppdeleted−234

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingSctpConnection.hdeleted−85

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingTranslator.cppdeleted−271

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2/SignalingTranslator.hdeleted−70

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2_4_0_0/Signaling_4_0_0.cppdeleted−703

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2_4_0_0/Signaling_4_0_0.hdeleted−106

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CLAUDE.mddeleted−157

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreABI.hdeleted−240

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreBackend.hdeleted−28

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreHost.cppdeleted−1794

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CallCoreHost.hdeleted−176

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CoreBase64.hdeleted−98

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CoreFactory.hdeleted−24

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CoreGzip.cppdeleted−46

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/CoreGzip.hdeleted−29

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/EmbeddedCoreModule.hdeleted−21

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/HostCompressionService.cppdeleted−44

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/InstanceV2PumpImpl.cppdeleted−148

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/InstanceV2PumpImpl.hdeleted−59

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/NativeCoreBackend.cppdeleted−33

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/NativeCoreBackend.hdeleted−26

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/ReferenceCallCore.cppdeleted−663

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/ReferenceCallCore.hdeleted−111

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/SignalingFraming.cppdeleted−61

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/SignalingFraming.hdeleted−42

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/VariantCallCore.cppdeleted−234

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/VariantCallCore.hdeleted−51

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/WamrCoreBackend.cppdeleted−223

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/WamrCoreBackend.hdeleted−63

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/reference_core_factory.cppdeleted−14

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/variant_core_factory.cppdeleted−15

This diff is too big to show here.

TMessagesProj/jni/voip/tgcalls/v2wasm/wasm_module_entry.cppdeleted−61

This diff is too big to show here.

TMessagesProj/jni/voip/webrtc/common_video/h265/h265_bitstream_parser.cc+38−14

This diff is too big to show here.

TMessagesProj/jni/voip/webrtc/common_video/h265/h265_sps_parser.cc+2

This diff is too big to show here.

TMessagesProj/jni/wallet-enginenew file+1

This diff is too big to show here.

TMessagesProj/jni/wallet/GramWalletAdapter.cppnew file+22

This diff is too big to show here.

TMessagesProj/jni/wallet/GramWalletAdapter.hnew file+11

This diff is too big to show here.

TMessagesProj/jni/wallet/WalletEngineBridge.cppnew file+1395

This diff is too big to show here.

TMessagesProj/jni/wallet/WalletJournal.hnew file+104

This diff is too big to show here.

TMessagesProj/proguard-rules.pro+4

This diff is too big to show here.

TMessagesProj/src/main/AndroidManifest.xml+12

This diff is too big to show here.

TMessagesProj/src/main/assets/darkblue.attheme+1

This diff is too big to show here.

TMessagesProj/src/main/assets/fonts/currency_symbols.txtnew file+95

This diff is too big to show here.

TMessagesProj/src/main/assets/fonts/gram.ttfnew file

Binary file not shown.

TMessagesProj/src/main/assets/fonts/rmono_var.ttfnew file

Binary file not shown.

TMessagesProj/src/main/assets/grammars.datnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/card.binobjnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/card.objnew file+227

This diff is too big to show here.

TMessagesProj/src/main/assets/models/card_back.binobjnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/card_edge.binobjnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/card_front.binobjnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond.binobjdeleted

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/anchors.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/camera.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/facetProjection.binnew file+1

This diff is too big to show here.

TMessagesProj/src/main/assets/models/diamond_ios/frames.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/main.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/planes.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/small.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/vertices.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_ios/widths.binnew file

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_outer.binobjdeleted

Binary file not shown.

TMessagesProj/src/main/assets/models/diamond_outer_2.binobjdeleted

Binary file not shown.

TMessagesProj/src/main/assets/night.attheme+1

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/diamond/copyFragment.glslnew file+4

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/diamond/diamondFragment.glslnew file+699

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/diamond/diamondVertex.glslnew file+69

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/diamond/fullscreenVertex.glslnew file+7

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/diamond/sparkleFragment.glslnew file+92

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/diamond/sparkleVertex.glslnew file+97

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/fragment5.glsldeleted−99

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/wallet_card_content_fragment.glslnew file+17

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/wallet_card_diamond_fragment.glslnew file+56

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/wallet_card_fragment.glslnew file+1064

This diff is too big to show here.

TMessagesProj/src/main/assets/shaders/wallet_card_vertex.glslnew file+74

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java+11−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/AppGlobalConfig.java+69

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/Bitmaps.java+1−14

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/CodeHighlighting.javadeleted−838

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/DialogObject.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/DispatchQueueMainThreadSync.javadeleted−169

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/DownloadRequestPacer.javanew file+17

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java+60−9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java+85−67

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/ImageLoader.java+80−50

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java+3−3

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java+186−23

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/MessageCustomParamsHelper.java+12

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java+48−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java+92−36

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/NotificationCenter.java+2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java+60−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/PasskeysController.java+3−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/PushListenerController.java+122−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/RichMessageLayout.java+10−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java+158

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/SharedConfig.java+4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/TelegramQRCodeWriter.java+14−3

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java+1−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/camera/CameraController.java+3−4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/utils/BillingUtilities.java+50

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/utils/Choreographer60FpsContent.java+80−44

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/utils/CopyUtilities.java+1−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/utils/CustomHtml.java+7−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/utils/tlutils/TlUtils.java+19

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/video/TextureRenderer.java+3−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/voip/ConferenceCall.java+5

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/voip/GroupCallMessagesController.java+2−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/voip/VoIPService.java+61−36

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/messenger/voip/VoipAudioManager.java+84−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java+20−4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/TLClassStore.java+1−9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/TLParseException.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java+494−45

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_account.java+4−4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_bots.java+68−8

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_iv.java+15−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_toncenter.javanew file+540

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_update.java+109

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_wallet.javanew file+1760

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java+10−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java+10

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/AdjustPanLayoutHelper.java+1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/AlertDialog.java+7

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BottomSheetTabs.java+5

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/INavigationLayout.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MessageDrawable.java+15−5

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java+7−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ThemeColors.java+6

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java+18

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ArticleViewer.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Business/ChatAttachAlertQuickRepliesLayout.java+6

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java+273−38

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java+10−4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java+54−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Cells/HeaderCell.java+2−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Cells/StickerSetCell.java+2−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java+11−4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Cells/UserInfoCell.java+2−11

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ChannelMonetizationLayout.java+4−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java+277−57

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/AIEditorAlert.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/AnimatedTextView.java+173−52

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/BottomSheetWithRecyclerListView.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/BulletinFactory.java+27

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ButtonBounce.java+28−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ButtonSpan.java+13−9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlert.java+153−33

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertAudioLayout.java+13−13

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertGramLayout.javanew file+1782

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ColoredImageSpan.java+10−5

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/CreateBotAlert.java+218−62

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/EdgeEffectTrackerFactory.java+7

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java+6−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextCaption.java+1−3

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/EllipsizeSpanAnimator.java+3

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/FlickerLoadingView.java+44−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ForegroundDetector.java+29

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/FragmentContextView.java+11−11

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/HintsController.java+1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView.java+63−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView2.java+127−18

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraViewBase.java+7−11

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/ItemOptions.java+11

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/LoadingDrawable.java+22−7

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Paint/Views/MessageEntityView.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/PasscodeView.java+106−209

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/CoolDiamondIcon.javanew file+383

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/DiamondProgram.javanew file+9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/DiamondRenderer.javanew file+325

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/DiamondSurfaceView.javanew file+400

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/GLIconRenderer.java+16−3

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/GLIconTextureView.java+219−88

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/GLProgramCache.javanew file+143

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/Icon3D.java+34−41

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/ObjLoader.java+24−47

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/Premium/GLIcon/WalletDiamondTextureView.javanew file+352

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/RLottieNative.java+2−14

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/RecyclerListView.java+10−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/TableLayout.java+15−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/TableView.java+39−9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/UItem.java+8

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/UniversalAdapter.java+1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/blur3/BlurredBackgroundDrawableViewFactory.java+7−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/blur3/drawable/color/BlurredBackgroundProviderBuilder.java+2−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/glass/GlassTabView.java+1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/inset/WindowInsetsStateHolder.java+8−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Components/spoilers/SpoilersTextView.java+45−9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java+28−21

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/FragmentUsernameBottomSheet.java+1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Gifts/GiftSheet.java+61−5

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/GradientHeaderActivity.java+4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java+9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/LinkManager.java+300

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java+18−6

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/LogoutActivity.java+45−22

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/MainTabsActivity.java+1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/OAuthSheet.java+82−18

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/PasscodeActivity.java+83−17

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java+2−3

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java+32−11

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/PremiumPreviewFragment.java+11

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java+9−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java+27−16

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stars/BotStarsActivity.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stars/GiftOfferSheet.java−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stars/MessageSuggestionOfferSheet.java−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stars/SellGiftEnterPriceSheet.java−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stars/StarsIntroActivity.java+8−4

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stories/DarkThemeResourceProvider.java+2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stories/UploadingDotsSpannable.java+35−5

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Stories/recorder/ButtonWithCounterView.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/StoryCellFactory.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/TON/TONIntroActivity.java+16−19

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/CollectibleCell.javanew file+247

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/CurrenciesController.javanew file+300

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWallet.javanew file+3207

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletDns.javanew file+52

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletPolling.javanew file+101

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletStorage.javanew file+716

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletStorageAuth.javanew file+201

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletStreaming.javanew file+354

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/GramWalletTonConnect.javanew file+1899

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/NavBottomSheet.javanew file+331

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/NewBottomSheet.javanew file+122

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/PasswordRequest.javanew file+298

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/TransactionCell.javanew file+730

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletActionLayout.javanew file+1056

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletActivity.javanew file+3993

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCard2DView.javanew file+1057

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCard3D.javanew file+816

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardComponent.javanew file+645

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardFlecks.javanew file+321

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardFrameHistory.javanew file+29

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardGLRenderer.javanew file+401

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardGeometry.javanew file+27

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardMotion.javanew file+98

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardQrBounds.javanew file+96

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardTiltBaseline.javanew file+105

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletCardView.javanew file+794

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletChatSendTransition.javanew file+309

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletDiamondView.javanew file+670

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletEngine2.javanew file+1588

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletImportFragment.javanew file+419

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletKeysBackupFragment.javanew file+820

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletRecipientView.javanew file+409

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSecretPhraseFragment.javanew file+178

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendEnterAmount.javanew file+2224

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendParticles.javanew file+125

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendSelectSender.javanew file+851

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletSendTransition.javanew file+273

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletTestPhraseFragment.javanew file+230

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletTonConnectSessionsFragment.javanew file+290

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletTransactionAmountView.javanew file+130

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/Wallet/WalletWordCell.javanew file+556

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/bots/BotWebViewSheet.java+68−20

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/iv/RichEditor.java+9

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/iv/RichEditorListView.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/iv/RichMessageConvert.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/ui/iv/RichTextCell.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoCameraController.java+1113−44

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoGlProcessor.java+309−23

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoMp4Writer.java+130−26

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoOverlayRenderer.java+10

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/camera/roundvideo/RoundVideoSession.java+26−2

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/code/highlight/CodeHighlighting.javanew file+558

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/code/highlight/PrismaHighlighter.javanew file+222

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/code/highlight/PrismaHighlightingService.javanew file+311

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/code/highlight/PrismaTokenStyles.javanew file+186

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/localization/Localization.java+11

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/proxy/WebProxyTransport.java+139−7

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/settings/BooleanSetting.java+26−12

This diff is too big to show here.

TMessagesProj/src/main/java/org/telegram/utils/settings/SharedSettings.java+1−1

This diff is too big to show here.

TMessagesProj/src/main/res/drawable-nodpi/wallet_action_card_gradient.webpnew file

Binary file not shown.

TMessagesProj/src/main/res/drawable-nodpi/wallet_card_diamond.webpnew file

Binary file not shown.

TMessagesProj/src/main/res/drawable/dialog_gram_transfer.xmlnew file+19

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/filled_gram_earnings.xmlnew file+12

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/ic_gram.xmlnew file+14

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/mini_gram_16.xml+14−5

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/mini_gram_24.xmlnew file+3

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/mini_gram_72.xml+14−5

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/scan_qr.xmlnew file+23

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/settings_wallet.xml+24−9

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/settings_wallet_dark.xmlnew file+47

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/verified2_bg.xmlnew file+13

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/verified2_fg.xmlnew file+14

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_apps.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_buy.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_card_info.xmlnew file+18

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_card_qr.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_comment_locked.xmlnew file+13

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_comment_unlocked.xmlnew file+13

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_copy.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_currency_exchange.xmlnew file+22

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_globe.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_gram_14.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_gram_large.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_gram_small.xmlnew file+14

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_help.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_intro_arrow.xmlnew file+17

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_intro_chats.xmlnew file+12

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_intro_options.xmlnew file+17

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_intro_store.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_intro_telegram.xmlnew file+14

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_intro_trade.xmlnew file+25

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_key.xmlnew file+12

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_learn_fees.xmlnew file+19

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_learn_hidden.xmlnew file+12

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_learn_instant.xmlnew file+25

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_learn_protected.xmlnew file+14

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_learn_verified.xmlnew file+14

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_learn_warn.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_lock.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_nft.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_nft_placeholder.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_protect.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_provider_moonpay.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_provider_wallet.xmlnew file+14

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_sell.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_tooltip_arrow.xmlnew file+13

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_transaction_in.xmlnew file+12

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_transaction_key.xmlnew file+12

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_transaction_out.xmlnew file+12

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_transaction_topup.xmlnew file+15

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_transaction_walt.xmlnew file+11

This diff is too big to show here.

TMessagesProj/src/main/res/drawable/wallet_transfer.xmlnew file+16

This diff is too big to show here.

TMessagesProj/src/main/res/raw/gram.jsonnew file+1

This diff is too big to show here.

TMessagesProj/src/main/res/raw/gram_reverse.jsonnew file+1

This diff is too big to show here.

TMessagesProj/src/main/res/raw/wallet_diamond_blue.jsonnew file+1

This diff is too big to show here.

TMessagesProj/src/main/res/raw/wallet_diamond_white.jsonnew file+1

This diff is too big to show here.

TMessagesProj/src/main/res/values/strings.xml+305−4

This diff is too big to show here.

TMessagesProj_App/build.gradle+10−2

This diff is too big to show here.

TMessagesProj_AppHuawei/build.gradle+7−2

This diff is too big to show here.

TMessagesProj_AppStandalone/build.gradle+7−2

This diff is too big to show here.

TMessagesProj_AppTests/build.gradle+11−1

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/not_linked_classes.txt+2−1

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_BotVerification.kt+18−1

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_BotVerifierSettings.kt+28−1

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_CurrencyRate.ktnew file+25

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_InputTonConnectOauthSession.ktnew file+30

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_InputWalletReplacement.ktnew file+43

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_MessageAction.kt+77

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_MessageEntity.kt+15

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampAvailability.ktnew file+40

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampLimits.ktnew file+32

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampMethodAvailability.ktnew file+32

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampProviderInfo.ktnew file+41

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampQuote.ktnew file+43

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_OnrampSession.ktnew file+29

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_RichText.kt+13

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectManifest.ktnew file+34

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectNextEventId.ktnew file+22

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectRequest.ktnew file+45

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_TonConnectSession.ktnew file+55

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_Update.kt+92

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_UrlAuthResult.kt+9−1

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_Username.kt+4

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletOwnershipProof.ktnew file+26

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletState.ktnew file+63

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletTransaction.ktnew file+59

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletTransactionPeer.ktnew file+91

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_WalletUserAddress.ktnew file+37

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_payments_CurrencyRates.ktnew file+22

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_toncenter_ApiResponse.ktnew file+21

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_toncenter_StreamingUrl.ktnew file+25

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_EncryptedSecretPhrasePart.ktnew file+23

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_ExistingBalance.ktnew file+32

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_HolderDc.ktnew file+26

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_NftAttribute.ktnew file+24

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_NftItem.ktnew file+61

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_NftItems.ktnew file+33

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_ProofChallenge.ktnew file+27

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_SecretPhraseParts.ktnew file+26

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_TonConnectChallenge.ktnew file+26

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_TonConnectPending.ktnew file+24

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_TonConnectSessions.ktnew file+22

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_Transactions.ktnew file+40

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/model/generated/TlGen_wallet_UserAddresses.ktnew file+24

This diff is too big to show here.

TMessagesProj_AppTests/src/androidTest/kotlin/org/telegram/tgnet/test/generated/Test_All.kt+2354−1989

This diff is too big to show here.

TMessagesProj_AppTests/tlscheme/229.json+1−1

This diff is too big to show here.

TMessagesProj_AppTests/tlscheme/230.json+1−1

This diff is too big to show here.

TMessagesProj_AppTests/tlscheme/231.json+1

This diff is too big to show here.

buildSrc/src/main/kotlin/com/example/GenerateSchemeTask.kt+1−1

This diff is too big to show here.

gradle.properties+2−2

This diff is too big to show here.