11727 lines
No EOL
378 KiB
C++
11727 lines
No EOL
378 KiB
C++
/* This file was generated by uniffi-bindgen-cpp. */
|
|
#include <string>
|
|
|
|
#include "wallet_engine.hpp"
|
|
|
|
namespace wallet_engine {
|
|
namespace uniffi {
|
|
template <class> inline constexpr bool always_false_v = false;
|
|
|
|
namespace {
|
|
void ensure_initialized() {
|
|
auto bindings_contract_version = 30;
|
|
auto scaffolding_contract_version = ffi_wallet_engine_uniffi_contract_version();
|
|
|
|
if (bindings_contract_version != scaffolding_contract_version) {
|
|
throw std::runtime_error("UniFFI contract version mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_parse_ton_transfer_link() != 38144) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_parse_ton_connect_manifest() != 55166) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_ton_connect_session_from_link() != 16316) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_ton_connect_session_restore() != 63276) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_convert_ton_address() != 28540) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_is_valid_ton_address() != 32896) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_parse_ton_address() != 26131) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_mnemonic_wordlist() != 1718) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_detect_mnemonic_schemes() != 22911) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_func_rotation_mnemonic_public_key() != 40177) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_cancel_load_more_activity() != 30855) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_load_more_activity() != 1728) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_shutdown() != 12846) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_snapshot() != 9252) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_wait_for_change() != 21890) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_resolve_dns() != 63449) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_create_encrypted_comment() != 57304) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_decrypt_comment() != 56301) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_resolve_encrypted_comment_recipient() != 61038) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_prepare_key_rotation() != 44629) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_cancel_load_more_nfts() != 55435) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_cancel_refresh_nfts() != 10319) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_load_more_nfts() != 53428) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_refresh_nfts() != 19017) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_prepare_nft_transfer() != 62136) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_preview_nft_transfer() != 55191) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_send_nft_transfer() != 6467) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_prepare_transfer() != 35005) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_cancel_send_preview() != 28394) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_preview_key_rotation() != 9076) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_preview_send() != 55971) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_preview_send_boc() != 21004) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_preview_sign_message() != 5984) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_preview_ton_connect() != 9616) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_cancel_refresh() != 16959) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_refresh() != 44556) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_resolve_pending() != 41815) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_cancel_send() != 37753) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_send() != 23821) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_send_boc() != 4063) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletclient_sign_message() != 31537) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletplatformhost_read_protected_secret() != 7657) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletplatformhost_store_protected_secret() != 21396) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletplatformhost_delete_protected_secret() != 43335) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletplatformhost_load_journal() != 51398) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletplatformhost_compare_exchange_journal() != 63993) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_approve_connect() != 6077) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_begin_events_subscription() != 62684) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_complete_pending_post() != 52225) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_connect_prompt() != 24215) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_disconnect() != 14920) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_ingest_sse_chunk() != 62248) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_pending_post() != 12209) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_pending_requests() != 22341) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_persisted() != 36457) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_phase() != 52857) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_disconnect_success() != 65002) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_error() != 22566) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_send_success() != 31724) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_prepare_sign_message_success() != 63431) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectsession_reject_connect() != 45812) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_decrypt_envelope() != 42978) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_decrypt_request() != 40213) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_connect_error() != 3125) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_connect_event() != 12874) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_disconnect_event() != 15862) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_disconnect_success() != 11931) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_envelope() != 50506) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_error() != 24657) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_send_success() != 2099) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_encrypt_sign_data_success() != 48287) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_open_challenge() != 24298) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_public_key_hex() != 32021) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_tonconnectderivedsession_signing_public_key() != 11397) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_wallethttphost_execute_http() != 43126) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_wallethttphost_cancel_http() != 55221) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletstatuslesshost_execute_statusless() != 29141) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletstatuslesshost_cancel_statusless() != 58537) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_create_wallet() != 58283) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_delete_wallet() != 60089) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_derive_ton_connect_session() != 2602) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_import_wallet() != 60352) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_reveal_recovery_phrase() != 7144) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_sign_ton_connect_data() != 38868) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_sign_ton_connect_proof() != 59978) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_method_walletlifecycle_ton_connect_account() != 32302) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_constructor_walletclient_new() != 8434) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_constructor_walletclient_new_statusless() != 59466) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
if (uniffi_wallet_engine_checksum_constructor_walletlifecycle_new() != 42116) {
|
|
throw std::runtime_error("UniFFI API checksum mismatch: try cleaning and rebuilding your project");
|
|
}
|
|
|
|
uniffi::UniffiCallbackInterfaceWalletHttpHost::init();
|
|
uniffi::UniffiCallbackInterfaceWalletPlatformHost::init();
|
|
uniffi::UniffiCallbackInterfaceWalletStatuslessHost::init();
|
|
}
|
|
|
|
// Note: we need this indirection here and can't inline this code in the rust_call function
|
|
// as it's a templated function
|
|
void initialize() {
|
|
static std::once_flag init_flag;
|
|
std::call_once(init_flag, ensure_initialized);
|
|
}
|
|
}
|
|
|
|
template <typename F>
|
|
void check_rust_call(const RustCallStatus &status, F error_cb) {
|
|
switch (status.code) {
|
|
case 0:
|
|
return;
|
|
|
|
case 1:
|
|
if constexpr (!std::is_null_pointer_v<F>) {
|
|
error_cb(status.error_buf)->throw_underlying();
|
|
}
|
|
break;
|
|
|
|
case 2:
|
|
if (status.error_buf.len > 0) {
|
|
throw std::runtime_error(FfiConverterString::lift(status.error_buf));
|
|
}
|
|
|
|
throw std::runtime_error("A Rust panic has occurred");
|
|
}
|
|
|
|
throw std::runtime_error("Unexpected Rust call status");
|
|
}
|
|
|
|
template <typename F, typename EF, typename... Args, typename R = std::invoke_result_t<F, Args..., RustCallStatus *>>
|
|
R rust_call(F f, EF error_cb, Args... args) {
|
|
initialize();
|
|
|
|
RustCallStatus status = { 0 };
|
|
|
|
if constexpr (std::is_void_v<R>) {
|
|
f(args..., &status);
|
|
check_rust_call(status, error_cb);
|
|
} else {
|
|
auto ret = f(args..., &status);
|
|
check_rust_call(status, error_cb);
|
|
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
namespace {
|
|
struct RustFutureContinuationState {
|
|
std::mutex mutex;
|
|
std::condition_variable condition;
|
|
bool called = false;
|
|
int8_t poll_result = 0;
|
|
};
|
|
|
|
void rust_future_continuation(uint64_t data, int8_t poll_result) {
|
|
auto *state = reinterpret_cast<RustFutureContinuationState *>(data);
|
|
{
|
|
std::lock_guard<std::mutex> lock(state->mutex);
|
|
state->poll_result = poll_result;
|
|
state->called = true;
|
|
}
|
|
state->condition.notify_one();
|
|
}
|
|
|
|
void foreign_future_drop_noop(uint64_t) {}
|
|
|
|
template <typename F>
|
|
struct RustFutureHandleGuard {
|
|
uint64_t handle;
|
|
F free;
|
|
|
|
~RustFutureHandleGuard() {
|
|
free(handle);
|
|
}
|
|
};
|
|
}
|
|
|
|
template <typename Start, typename Poll, typename Complete, typename Free, typename EF,
|
|
typename R = std::invoke_result_t<Complete, uint64_t, RustCallStatus *>>
|
|
R rust_call_async(Start start, Poll poll, Complete complete, Free free, EF error_cb) {
|
|
initialize();
|
|
|
|
auto handle = start();
|
|
RustFutureHandleGuard guard { handle, free };
|
|
|
|
while (true) {
|
|
RustFutureContinuationState state;
|
|
poll(
|
|
handle,
|
|
reinterpret_cast<void *>(&rust_future_continuation),
|
|
reinterpret_cast<uint64_t>(&state)
|
|
);
|
|
|
|
std::unique_lock<std::mutex> lock(state.mutex);
|
|
state.condition.wait(lock, [&state] { return state.called; });
|
|
if (state.poll_result == 0) {
|
|
break;
|
|
}
|
|
if (state.poll_result != 1) {
|
|
throw std::runtime_error("Unexpected Rust future poll result");
|
|
}
|
|
}
|
|
|
|
RustCallStatus status = {};
|
|
if constexpr (std::is_void_v<R>) {
|
|
complete(handle, &status);
|
|
check_rust_call(status, error_cb);
|
|
} else {
|
|
auto ret = complete(handle, &status);
|
|
check_rust_call(status, error_cb);
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
template <typename F, typename W>
|
|
void rust_call_trait_interface(RustCallStatus* status, F make_call, W write_value) {
|
|
initialize();
|
|
|
|
constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
|
|
|
|
try {
|
|
if constexpr(has_return_type) {
|
|
write_value(make_call());
|
|
} else {
|
|
make_call();
|
|
}
|
|
} catch (std::exception &e) {
|
|
status->code = 2;
|
|
status->error_buf = FfiConverterString::lower(e.what());
|
|
}
|
|
}
|
|
|
|
template <typename E, typename W, typename F, typename EF>
|
|
void rust_call_trait_interface_with_error(RustCallStatus* status, F make_call, W write_value, EF error_cb) {
|
|
initialize();
|
|
|
|
constexpr bool has_return_type = std::negation<std::is_same<void, std::invoke_result_t<F>>>::value;
|
|
|
|
try {
|
|
try {
|
|
if constexpr(has_return_type) {
|
|
write_value(make_call());
|
|
} else {
|
|
make_call();
|
|
}
|
|
} catch (E &e) {
|
|
status->code = 1;
|
|
status->error_buf = error_cb(e);
|
|
}
|
|
} catch (std::exception &e) {
|
|
status->code = 2;
|
|
status->error_buf = FfiConverterString::lower(e.what());
|
|
}
|
|
}
|
|
|
|
|
|
RustBuffer rustbuffer_alloc(uint64_t len) {
|
|
RustCallStatus status = { 0 };
|
|
auto buffer = ffi_wallet_engine_rustbuffer_alloc(len, &status);
|
|
|
|
check_rust_call(status, nullptr);
|
|
|
|
return buffer;
|
|
}
|
|
|
|
RustBuffer rustbuffer_from_bytes(const ForeignBytes &bytes) {
|
|
RustCallStatus status = { 0 };
|
|
auto buffer = ffi_wallet_engine_rustbuffer_from_bytes(bytes, &status);
|
|
|
|
check_rust_call(status, nullptr);
|
|
|
|
return buffer;
|
|
}
|
|
|
|
void rustbuffer_free(RustBuffer buf) {
|
|
RustCallStatus status = { 0 };
|
|
|
|
ffi_wallet_engine_rustbuffer_free(std::move(buf), &status);
|
|
check_rust_call(status, nullptr);
|
|
}
|
|
|
|
|
|
uint16_t FfiConverterUInt16::lift(uint16_t val) {
|
|
return val;
|
|
}
|
|
|
|
uint16_t FfiConverterUInt16::lower(uint16_t val) {
|
|
return val;
|
|
}
|
|
|
|
uint16_t FfiConverterUInt16::read(RustStream &stream) {
|
|
uint16_t ret;
|
|
stream >> ret;
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterUInt16::write(RustStream &stream, uint16_t val) {
|
|
stream << val;
|
|
}
|
|
|
|
uint64_t FfiConverterUInt16::allocation_size(uint16_t) {
|
|
return static_cast<uint64_t>(sizeof(uint16_t));
|
|
}
|
|
uint32_t FfiConverterUInt32::lift(uint32_t val) {
|
|
return val;
|
|
}
|
|
|
|
uint32_t FfiConverterUInt32::lower(uint32_t val) {
|
|
return val;
|
|
}
|
|
|
|
uint32_t FfiConverterUInt32::read(RustStream &stream) {
|
|
uint32_t ret;
|
|
stream >> ret;
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterUInt32::write(RustStream &stream, uint32_t val) {
|
|
stream << val;
|
|
}
|
|
|
|
uint64_t FfiConverterUInt32::allocation_size(uint32_t) {
|
|
return static_cast<uint64_t>(sizeof(uint32_t));
|
|
}
|
|
int32_t FfiConverterInt32::lift(int32_t val) {
|
|
return val;
|
|
}
|
|
|
|
int32_t FfiConverterInt32::lower(int32_t val) {
|
|
return val;
|
|
}
|
|
|
|
int32_t FfiConverterInt32::read(RustStream &stream) {
|
|
int32_t ret;
|
|
stream >> ret;
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterInt32::write(RustStream &stream, int32_t val) {
|
|
stream << val;
|
|
}
|
|
|
|
uint64_t FfiConverterInt32::allocation_size(int32_t) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
uint64_t FfiConverterUInt64::lift(uint64_t val) {
|
|
return val;
|
|
}
|
|
|
|
uint64_t FfiConverterUInt64::lower(uint64_t val) {
|
|
return val;
|
|
}
|
|
|
|
uint64_t FfiConverterUInt64::read(RustStream &stream) {
|
|
uint64_t ret;
|
|
stream >> ret;
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterUInt64::write(RustStream &stream, uint64_t val) {
|
|
stream << val;
|
|
}
|
|
|
|
uint64_t FfiConverterUInt64::allocation_size(uint64_t) {
|
|
return static_cast<uint64_t>(sizeof(uint64_t));
|
|
}
|
|
int64_t FfiConverterInt64::lift(int64_t val) {
|
|
return val;
|
|
}
|
|
|
|
int64_t FfiConverterInt64::lower(int64_t val) {
|
|
return val;
|
|
}
|
|
|
|
int64_t FfiConverterInt64::read(RustStream &stream) {
|
|
int64_t ret;
|
|
stream >> ret;
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterInt64::write(RustStream &stream, int64_t val) {
|
|
stream << val;
|
|
}
|
|
|
|
uint64_t FfiConverterInt64::allocation_size(int64_t) {
|
|
return static_cast<uint64_t>(sizeof(int64_t));
|
|
}
|
|
|
|
bool FfiConverterBool::lift(uint8_t val) {
|
|
return !!val;
|
|
}
|
|
|
|
uint8_t FfiConverterBool::lower(bool val) {
|
|
return val;
|
|
}
|
|
|
|
bool FfiConverterBool::read(RustStream &stream) {
|
|
uint8_t val;
|
|
stream >> val;
|
|
|
|
return val;
|
|
}
|
|
|
|
void FfiConverterBool::write(RustStream &stream, bool val) {
|
|
stream << val;
|
|
}
|
|
|
|
uint64_t FfiConverterBool::allocation_size(bool) {
|
|
return 1;
|
|
}
|
|
std::string FfiConverterString::lift(RustBuffer buf) {
|
|
auto string = std::string(reinterpret_cast<char *>(buf.data), buf.len);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return string;
|
|
}
|
|
|
|
RustBuffer FfiConverterString::lower(const std::string &val) {
|
|
auto len = static_cast<int32_t>(val.length());
|
|
auto bytes = ForeignBytes { len, reinterpret_cast<uint8_t *>(const_cast<char *>(val.data())) };
|
|
|
|
return rustbuffer_from_bytes(bytes);
|
|
}
|
|
|
|
std::string FfiConverterString::read(RustStream &stream) {
|
|
int32_t len;
|
|
std::string string;
|
|
|
|
stream >> len;
|
|
|
|
string.resize(len);
|
|
stream.read(string.data(), len);
|
|
|
|
return string;
|
|
}
|
|
|
|
void FfiConverterString::write(RustStream &stream, const std::string &val) {
|
|
stream << static_cast<int32_t>(val.length());
|
|
stream.write(val.data(), val.length());
|
|
}
|
|
|
|
uint64_t FfiConverterString::allocation_size(const std::string &val) {
|
|
return static_cast<uint64_t>(sizeof(int32_t) + val.length());
|
|
}
|
|
std::vector<uint8_t> FfiConverterBytes::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterBytes::lower(const std::vector<uint8_t> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<uint8_t> FfiConverterBytes::read(RustStream &stream) {
|
|
std::vector<uint8_t> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
uint8_t elem;
|
|
stream >> elem;
|
|
ret.push_back(elem);
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterBytes::write(RustStream &stream, const std::vector<uint8_t> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
stream << elem;
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterBytes::allocation_size(const std::vector<uint8_t> &val) {
|
|
return static_cast<uint64_t>(sizeof(int32_t) + sizeof(uint8_t) * val.size());
|
|
}
|
|
} // namespace uniffi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TonConnectDerivedSession::TonConnectDerivedSession(uint64_t ptr): instance(ptr) {}
|
|
|
|
TonConnectDerivedSession::TonConnectDerivedSession(const TonConnectDerivedSession &other) : instance(0) {
|
|
if (other.instance) {
|
|
instance = other._uniffi_internal_clone_pointer();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<uint8_t> TonConnectDerivedSession::decrypt_envelope(const std::vector<uint8_t> &body) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_envelope,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterBytes::lower(body)));
|
|
}
|
|
TonConnectDerivedRequest TonConnectDerivedSession::decrypt_request(const std::vector<uint8_t> &body, uint64_t now) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectDerivedRequest::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_decrypt_request,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterBytes::lower(body), uniffi::FfiConverterUInt64::lower(now)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_connect_error(uint64_t event_id, const TonConnectConnectErrorCode &code, const std::string &message) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_connect_error,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterUInt64::lower(event_id), uniffi::FfiConverterTonConnectConnectErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_connect_event(uint64_t event_id, const TonConnectAccountInfo &account, std::optional<TonConnectProofReply> proof, const TonConnectDevice &device) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_connect_event,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterUInt64::lower(event_id), uniffi::FfiConverterTypeTonConnectAccountInfo::lower(account), uniffi::FfiConverterOptionalTypeTonConnectProofReply::lower(proof), uniffi::FfiConverterTypeTonConnectDevice::lower(device)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_disconnect_event(uint64_t event_id) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_event,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterUInt64::lower(event_id)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_disconnect_success(const std::string &request_id) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_disconnect_success,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_envelope(const std::vector<uint8_t> &body) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_envelope,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterBytes::lower(body)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_error(const std::string &request_id, const TonConnectRpcErrorCode &code, const std::string &message) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_error,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTonConnectRpcErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_send_success(const std::string &request_id, const std::string &signed_boc) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_send_success,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(signed_boc)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::encrypt_sign_data_success(const std::string &request_id, const TonConnectSignedData &signed_data) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_encrypt_sign_data_success,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTypeTonConnectSignedData::lower(signed_data)));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::open_challenge(const std::vector<uint8_t> &challenge) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_open_challenge,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterBytes::lower(challenge)));
|
|
}
|
|
std::string TonConnectDerivedSession::public_key_hex() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterString::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_public_key_hex,
|
|
nullptr,
|
|
ptr));
|
|
}
|
|
std::vector<uint8_t> TonConnectDerivedSession::signing_public_key() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectderivedsession_signing_public_key,
|
|
nullptr,
|
|
ptr));
|
|
}
|
|
|
|
TonConnectDerivedSession::~TonConnectDerivedSession() {
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_free_tonconnectderivedsession,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
uint64_t TonConnectDerivedSession::_uniffi_internal_clone_pointer() const {
|
|
return uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_clone_tonconnectderivedsession,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
|
|
|
|
|
|
TonConnectSession::TonConnectSession(uint64_t ptr): instance(ptr) {}
|
|
|
|
TonConnectSession::TonConnectSession(const TonConnectSession &other) : instance(0) {
|
|
if (other.instance) {
|
|
instance = other._uniffi_internal_clone_pointer();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
TonConnectPreparedPost TonConnectSession::approve_connect(const TonConnectAccountInfo &account, std::optional<TonConnectProofReply> proof, const TonConnectDevice &device) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_approve_connect,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterTypeTonConnectAccountInfo::lower(account), uniffi::FfiConverterOptionalTypeTonConnectProofReply::lower(proof), uniffi::FfiConverterTypeTonConnectDevice::lower(device)));
|
|
}
|
|
std::string TonConnectSession::begin_events_subscription() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterString::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_begin_events_subscription,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr));
|
|
}
|
|
void TonConnectSession::complete_pending_post() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_complete_pending_post,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr);
|
|
}
|
|
std::optional<TonConnectConnectPrompt> TonConnectSession::connect_prompt() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterOptionalTypeTonConnectConnectPrompt::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_connect_prompt,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr));
|
|
}
|
|
TonConnectPreparedPost TonConnectSession::disconnect() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_disconnect,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr));
|
|
}
|
|
std::vector<TonConnectIncomingRequest> TonConnectSession::ingest_sse_chunk(const std::vector<uint8_t> &chunk, uint64_t now) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterSequenceTonConnectIncomingRequest::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_ingest_sse_chunk,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterBytes::lower(chunk), uniffi::FfiConverterUInt64::lower(now)));
|
|
}
|
|
std::optional<TonConnectPreparedPost> TonConnectSession::pending_post() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterOptionalTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_pending_post,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr));
|
|
}
|
|
std::vector<TonConnectIncomingRequest> TonConnectSession::pending_requests(uint64_t now) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterSequenceTonConnectIncomingRequest::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_pending_requests,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterUInt64::lower(now)));
|
|
}
|
|
std::string TonConnectSession::persisted() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterString::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_persisted,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr));
|
|
}
|
|
TonConnectSessionPhase TonConnectSession::phase() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTonConnectSessionPhase::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_phase,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr));
|
|
}
|
|
TonConnectPreparedPost TonConnectSession::prepare_disconnect_success(const std::string &request_id) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_prepare_disconnect_success,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id)));
|
|
}
|
|
TonConnectPreparedPost TonConnectSession::prepare_error(const std::string &request_id, const TonConnectRpcErrorCode &code, const std::string &message) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_prepare_error,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterTonConnectRpcErrorCode::lower(code), uniffi::FfiConverterString::lower(message)));
|
|
}
|
|
TonConnectPreparedPost TonConnectSession::prepare_send_success(const std::string &request_id, const std::string &signed_boc) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_prepare_send_success,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(signed_boc)));
|
|
}
|
|
TonConnectPreparedPost TonConnectSession::prepare_sign_message_success(const std::string &request_id, const std::string &internal_boc) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_prepare_sign_message_success,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(request_id), uniffi::FfiConverterString::lower(internal_boc)));
|
|
}
|
|
TonConnectPreparedPost TonConnectSession::reject_connect(const std::string &message) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectPreparedPost::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsession_reject_connect,
|
|
uniffi::FfiConverterTonConnectSessionError::lift,
|
|
ptr, uniffi::FfiConverterString::lower(message)));
|
|
}
|
|
|
|
TonConnectSession::~TonConnectSession() {
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_free_tonconnectsession,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
uint64_t TonConnectSession::_uniffi_internal_clone_pointer() const {
|
|
return uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_clone_tonconnectsession,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
|
|
|
|
|
|
WalletClient::WalletClient(uint64_t ptr): instance(ptr) {}
|
|
|
|
WalletClient::WalletClient(const WalletClient &other) : instance(0) {
|
|
if (other.instance) {
|
|
instance = other._uniffi_internal_clone_pointer();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<WalletClient> WalletClient::init(const WalletClientConfig &config, const std::shared_ptr<WalletHttpHost> &http_host, const std::shared_ptr<WalletPlatformHost> &platform_host) {
|
|
return std::shared_ptr<WalletClient>(
|
|
new WalletClient(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_constructor_walletclient_new,
|
|
uniffi::FfiConverterWalletClientError::lift, uniffi::FfiConverterTypeWalletClientConfig::lower(config), uniffi::FfiConverterWalletHttpHost::lower(http_host), uniffi::FfiConverterWalletPlatformHost::lower(platform_host)))
|
|
);
|
|
}
|
|
|
|
std::shared_ptr<WalletClient> WalletClient::new_statusless(const WalletClientConfig &config, const std::shared_ptr<WalletStatuslessHost> &statusless_host, const std::shared_ptr<WalletPlatformHost> &platform_host) {
|
|
return std::shared_ptr<WalletClient>(new WalletClient(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_constructor_walletclient_new_statusless,
|
|
uniffi::FfiConverterWalletClientError::lift, uniffi::FfiConverterTypeWalletClientConfig::lower(config), uniffi::FfiConverterWalletStatuslessHost::lower(statusless_host), uniffi::FfiConverterWalletPlatformHost::lower(platform_host))));
|
|
}
|
|
|
|
void WalletClient::cancel_load_more_activity() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_activity(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
);
|
|
}
|
|
WalletUpdate WalletClient::load_more_activity() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeWalletUpdate::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_load_more_activity(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
void WalletClient::shutdown() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_shutdown(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
);
|
|
}
|
|
WalletSnapshot WalletClient::snapshot() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeWalletSnapshot::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclient_snapshot,
|
|
uniffi::FfiConverterWalletClientError::lift,
|
|
ptr));
|
|
}
|
|
WalletSnapshot WalletClient::wait_for_change(uint64_t after_revision) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeWalletSnapshot::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_wait_for_change(
|
|
ptr, uniffi::FfiConverterUInt64::lower(after_revision)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
std::optional<TonAddressString> WalletClient::resolve_dns(const std::string &name) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterOptionalTypeTonAddressString::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_dns(
|
|
ptr, uniffi::FfiConverterString::lower(name)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
Boc WalletClient::create_encrypted_comment(const CreateEncryptedCommentRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeBoc::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_create_encrypted_comment(
|
|
ptr, uniffi::FfiConverterTypeCreateEncryptedCommentRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
std::string WalletClient::decrypt_comment(const DecryptCommentRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterString::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_decrypt_comment(
|
|
ptr, uniffi::FfiConverterTypeDecryptCommentRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
std::vector<uint8_t> WalletClient::resolve_encrypted_comment_recipient(const EncryptedCommentRecipientRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_encrypted_comment_recipient(
|
|
ptr, uniffi::FfiConverterTypeEncryptedCommentRecipientRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
PreparedKeyRotation WalletClient::prepare_key_rotation(const PrepareKeyRotationRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypePreparedKeyRotation::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_key_rotation(
|
|
ptr, uniffi::FfiConverterTypePrepareKeyRotationRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
void WalletClient::cancel_load_more_nfts() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_load_more_nfts(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
);
|
|
}
|
|
void WalletClient::cancel_refresh_nfts() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh_nfts(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
);
|
|
}
|
|
WalletUpdate WalletClient::load_more_nfts() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeWalletUpdate::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_load_more_nfts(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
WalletUpdate WalletClient::refresh_nfts() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeWalletUpdate::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_refresh_nfts(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
PreparedTransfer WalletClient::prepare_nft_transfer(const PrepareNftTransferRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypePreparedTransfer::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_nft_transfer(
|
|
ptr, uniffi::FfiConverterTypePrepareNftTransferRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SendPreview WalletClient::preview_nft_transfer(const NftTransferPreviewRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendPreview::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_nft_transfer(
|
|
ptr, uniffi::FfiConverterTypeNftTransferPreviewRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SendResult WalletClient::send_nft_transfer(const NftTransferRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendResult::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_send_nft_transfer(
|
|
ptr, uniffi::FfiConverterTypeNftTransferRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
PreparedTransfer WalletClient::prepare_transfer(const PrepareTransferRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypePreparedTransfer::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_prepare_transfer(
|
|
ptr, uniffi::FfiConverterTypePrepareTransferRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
void WalletClient::cancel_send_preview() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send_preview(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
);
|
|
}
|
|
SendPreview WalletClient::preview_key_rotation() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendPreview::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_key_rotation(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SendPreview WalletClient::preview_send(const SendPreviewRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendPreview::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_send(
|
|
ptr, uniffi::FfiConverterTypeSendPreviewRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SendPreview WalletClient::preview_send_boc(const SendBocRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendPreview::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_send_boc(
|
|
ptr, uniffi::FfiConverterTypeSendBocRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SignMessagePreview WalletClient::preview_sign_message(const SendPreviewRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSignMessagePreview::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_sign_message(
|
|
ptr, uniffi::FfiConverterTypeSendPreviewRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SendPreview WalletClient::preview_ton_connect(const SendRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendPreview::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_preview_ton_connect(
|
|
ptr, uniffi::FfiConverterTypeSendRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
void WalletClient::cancel_refresh() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_refresh(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
);
|
|
}
|
|
WalletUpdate WalletClient::refresh() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeWalletUpdate::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_refresh(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SendSnapshot WalletClient::resolve_pending() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendSnapshot::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_resolve_pending(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
void WalletClient::cancel_send() {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_cancel_send(
|
|
ptr); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
);
|
|
}
|
|
SendResult WalletClient::send(const SendRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendResult::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_send(
|
|
ptr, uniffi::FfiConverterTypeSendRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SendResult WalletClient::send_boc(const SendBocRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSendResult::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_send_boc(
|
|
ptr, uniffi::FfiConverterTypeSendBocRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
SignMessageResult WalletClient::sign_message(const SignMessageRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeSignMessageResult::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletclient_sign_message(
|
|
ptr, uniffi::FfiConverterTypeSignMessageRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletClientError::lift
|
|
));
|
|
}
|
|
|
|
WalletClient::~WalletClient() {
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_free_walletclient,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
uint64_t WalletClient::_uniffi_internal_clone_pointer() const {
|
|
return uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_clone_walletclient,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
|
|
namespace uniffi {
|
|
|
|
void UniffiCallbackInterfaceWalletHttpHost::execute_http(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
|
|
auto obj = FfiConverterWalletHttpHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() -> HttpResponse {
|
|
auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_http(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultRustBuffer result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [&](const HttpResponse &v) {
|
|
result.return_value = FfiConverterTypeHttpResponse::lower(v);
|
|
};
|
|
|
|
|
|
|
|
rust_call_trait_interface_with_error<HttpHostError>(&result.call_status, make_call, write_value, FfiConverterHttpHostError::lower);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
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) {
|
|
auto obj = FfiConverterWalletHttpHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() {
|
|
auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_http(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultVoid result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [](){};
|
|
|
|
|
|
|
|
rust_call_trait_interface(&result.call_status, make_call, write_value);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
|
|
void UniffiCallbackInterfaceWalletHttpHost::uniffi_free(uint64_t uniffi_handle) {
|
|
FfiConverterWalletHttpHost::handle_map.erase(uniffi_handle);
|
|
}
|
|
|
|
uint64_t UniffiCallbackInterfaceWalletHttpHost::uniffi_clone(uint64_t uniffi_handle) {
|
|
return FfiConverterWalletHttpHost::handle_map.insert(
|
|
FfiConverterWalletHttpHost::handle_map.at(uniffi_handle)
|
|
);
|
|
}
|
|
|
|
void UniffiCallbackInterfaceWalletHttpHost::init() {
|
|
uniffi_wallet_engine_fn_init_callback_vtable_wallethttphost(vtable);
|
|
}
|
|
} // namespace uniffi
|
|
|
|
|
|
WalletHttpHostImpl::WalletHttpHostImpl(uint64_t ptr): instance(ptr) {}
|
|
|
|
WalletHttpHostImpl::WalletHttpHostImpl(const WalletHttpHostImpl &other) : instance(0) {
|
|
if (other.instance) {
|
|
instance = other._uniffi_internal_clone_pointer();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
HttpResponse WalletHttpHostImpl::execute_http(const HttpRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeHttpResponse::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_wallethttphost_execute_http(
|
|
ptr, uniffi::FfiConverterTypeHttpRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterHttpHostError::lift
|
|
));
|
|
}
|
|
void WalletHttpHostImpl::cancel_http(const HttpRequestId &request_id) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_wallethttphost_cancel_http(
|
|
ptr, uniffi::FfiConverterTypeHttpRequestId::lower(request_id)); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
nullptr
|
|
);
|
|
}
|
|
|
|
WalletHttpHostImpl::~WalletHttpHostImpl() {
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_free_wallethttphost,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
uint64_t WalletHttpHostImpl::_uniffi_internal_clone_pointer() const {
|
|
return uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_clone_wallethttphost,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
|
|
|
|
|
|
WalletLifecycle::WalletLifecycle(uint64_t ptr): instance(ptr) {}
|
|
|
|
WalletLifecycle::WalletLifecycle(const WalletLifecycle &other) : instance(0) {
|
|
if (other.instance) {
|
|
instance = other._uniffi_internal_clone_pointer();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<WalletLifecycle> WalletLifecycle::init(const std::shared_ptr<WalletPlatformHost> &platform_host) {
|
|
return std::shared_ptr<WalletLifecycle>(
|
|
new WalletLifecycle(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_constructor_walletlifecycle_new,
|
|
nullptr, uniffi::FfiConverterWalletPlatformHost::lower(platform_host)))
|
|
);
|
|
}
|
|
|
|
CreatedWallet WalletLifecycle::create_wallet(const CreateWalletRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeCreatedWallet::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_create_wallet(
|
|
ptr, uniffi::FfiConverterTypeCreateWalletRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletLifecycleError::lift
|
|
));
|
|
}
|
|
void WalletLifecycle::delete_wallet(const WalletDescriptor &descriptor) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_delete_wallet(
|
|
ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterWalletLifecycleError::lift
|
|
);
|
|
}
|
|
std::shared_ptr<TonConnectDerivedSession> WalletLifecycle::derive_ton_connect_session(const TonConnectDerivedSessionRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTonConnectDerivedSession::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_derive_ton_connect_session(
|
|
ptr, uniffi::FfiConverterTypeTonConnectDerivedSessionRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_u64,
|
|
ffi_wallet_engine_rust_future_complete_u64,
|
|
ffi_wallet_engine_rust_future_free_u64,
|
|
uniffi::FfiConverterWalletLifecycleError::lift
|
|
));
|
|
}
|
|
WalletDescriptor WalletLifecycle::import_wallet(const ImportWalletRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeWalletDescriptor::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_import_wallet(
|
|
ptr, uniffi::FfiConverterTypeImportWalletRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletLifecycleError::lift
|
|
));
|
|
}
|
|
RecoveryPhrase WalletLifecycle::reveal_recovery_phrase(const WalletDescriptor &descriptor) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeRecoveryPhrase::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_reveal_recovery_phrase(
|
|
ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletLifecycleError::lift
|
|
));
|
|
}
|
|
TonConnectSignedData WalletLifecycle::sign_ton_connect_data(const TonConnectSignDataSignRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectSignedData::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_sign_ton_connect_data(
|
|
ptr, uniffi::FfiConverterTypeTonConnectSignDataSignRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletLifecycleError::lift
|
|
));
|
|
}
|
|
TonConnectProofSignature WalletLifecycle::sign_ton_connect_proof(const TonConnectProofSignRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectProofSignature::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletlifecycle_sign_ton_connect_proof(
|
|
ptr, uniffi::FfiConverterTypeTonConnectProofSignRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterWalletLifecycleError::lift
|
|
));
|
|
}
|
|
TonConnectAccountInfo WalletLifecycle::ton_connect_account(const WalletDescriptor &descriptor) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeTonConnectAccountInfo::lift(
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycle_ton_connect_account,
|
|
uniffi::FfiConverterWalletLifecycleError::lift,
|
|
ptr, uniffi::FfiConverterTypeWalletDescriptor::lower(descriptor)));
|
|
}
|
|
|
|
WalletLifecycle::~WalletLifecycle() {
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_free_walletlifecycle,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
uint64_t WalletLifecycle::_uniffi_internal_clone_pointer() const {
|
|
return uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_clone_walletlifecycle,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
|
|
namespace uniffi {
|
|
|
|
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) {
|
|
auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() -> std::vector<uint8_t> {
|
|
auto arg0 =FfiConverterTypeProtectedSecretRead::lift(request);return obj->read_protected_secret(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultRustBuffer result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [&](const std::vector<uint8_t> &v) {
|
|
result.return_value = FfiConverterBytes::lower(v);
|
|
};
|
|
|
|
|
|
|
|
rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
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) {
|
|
auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() {
|
|
auto arg0 =FfiConverterTypeProtectedSecretStore::lift(request);obj->store_protected_secret(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultVoid result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [](){};
|
|
|
|
|
|
|
|
rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
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) {
|
|
auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() {
|
|
auto arg0 =FfiConverterTypeProtectedSecretRef::lift(secret_ref);obj->delete_protected_secret(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultVoid result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [](){};
|
|
|
|
|
|
|
|
rust_call_trait_interface_with_error<ProtectedSecretHostError>(&result.call_status, make_call, write_value, FfiConverterProtectedSecretHostError::lower);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
void UniffiCallbackInterfaceWalletPlatformHost::load_journal(uint64_t uniffi_handle,RustBuffer key,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
|
|
auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() -> std::optional<JournalRecord> {
|
|
auto arg0 =FfiConverterTypeJournalKey::lift(key);return obj->load_journal(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultRustBuffer result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [&](const std::optional<JournalRecord> &v) {
|
|
result.return_value = FfiConverterOptionalTypeJournalRecord::lower(v);
|
|
};
|
|
|
|
|
|
|
|
rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
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) {
|
|
auto obj = FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() -> JournalCompareExchangeResult {
|
|
auto arg0 =FfiConverterTypeJournalCompareExchange::lift(mutation);return obj->compare_exchange_journal(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultRustBuffer result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [&](const JournalCompareExchangeResult &v) {
|
|
result.return_value = FfiConverterTypeJournalCompareExchangeResult::lower(v);
|
|
};
|
|
|
|
|
|
|
|
rust_call_trait_interface_with_error<JournalHostError>(&result.call_status, make_call, write_value, FfiConverterJournalHostError::lower);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
|
|
void UniffiCallbackInterfaceWalletPlatformHost::uniffi_free(uint64_t uniffi_handle) {
|
|
FfiConverterWalletPlatformHost::handle_map.erase(uniffi_handle);
|
|
}
|
|
|
|
uint64_t UniffiCallbackInterfaceWalletPlatformHost::uniffi_clone(uint64_t uniffi_handle) {
|
|
return FfiConverterWalletPlatformHost::handle_map.insert(
|
|
FfiConverterWalletPlatformHost::handle_map.at(uniffi_handle)
|
|
);
|
|
}
|
|
|
|
void UniffiCallbackInterfaceWalletPlatformHost::init() {
|
|
uniffi_wallet_engine_fn_init_callback_vtable_walletplatformhost(vtable);
|
|
}
|
|
} // namespace uniffi
|
|
|
|
|
|
WalletPlatformHostImpl::WalletPlatformHostImpl(uint64_t ptr): instance(ptr) {}
|
|
|
|
WalletPlatformHostImpl::WalletPlatformHostImpl(const WalletPlatformHostImpl &other) : instance(0) {
|
|
if (other.instance) {
|
|
instance = other._uniffi_internal_clone_pointer();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<uint8_t> WalletPlatformHostImpl::read_protected_secret(const ProtectedSecretRead &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_read_protected_secret(
|
|
ptr, uniffi::FfiConverterTypeProtectedSecretRead::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterProtectedSecretHostError::lift
|
|
));
|
|
}
|
|
void WalletPlatformHostImpl::store_protected_secret(const ProtectedSecretStore &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_store_protected_secret(
|
|
ptr, uniffi::FfiConverterTypeProtectedSecretStore::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterProtectedSecretHostError::lift
|
|
);
|
|
}
|
|
void WalletPlatformHostImpl::delete_protected_secret(const ProtectedSecretRef &secret_ref) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_delete_protected_secret(
|
|
ptr, uniffi::FfiConverterTypeProtectedSecretRef::lower(secret_ref)); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
uniffi::FfiConverterProtectedSecretHostError::lift
|
|
);
|
|
}
|
|
std::optional<JournalRecord> WalletPlatformHostImpl::load_journal(const JournalKey &key) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterOptionalTypeJournalRecord::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_load_journal(
|
|
ptr, uniffi::FfiConverterTypeJournalKey::lower(key)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterJournalHostError::lift
|
|
));
|
|
}
|
|
JournalCompareExchangeResult WalletPlatformHostImpl::compare_exchange_journal(const JournalCompareExchange &mutation) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterTypeJournalCompareExchangeResult::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletplatformhost_compare_exchange_journal(
|
|
ptr, uniffi::FfiConverterTypeJournalCompareExchange::lower(mutation)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterJournalHostError::lift
|
|
));
|
|
}
|
|
|
|
WalletPlatformHostImpl::~WalletPlatformHostImpl() {
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_free_walletplatformhost,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
uint64_t WalletPlatformHostImpl::_uniffi_internal_clone_pointer() const {
|
|
return uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_clone_walletplatformhost,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
|
|
namespace uniffi {
|
|
|
|
void UniffiCallbackInterfaceWalletStatuslessHost::execute_statusless(uint64_t uniffi_handle,RustBuffer request,void * uniffi_future_callback,uint64_t uniffi_callback_data,UniffiForeignFutureDroppedCallbackStruct & uniffi_out_dropped_callback) {
|
|
auto obj = FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() -> std::vector<uint8_t> {
|
|
auto arg0 =FfiConverterTypeHttpRequest::lift(request);return obj->execute_statusless(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultRustBuffer);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultRustBuffer result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [&](const std::vector<uint8_t> &v) {
|
|
result.return_value = FfiConverterBytes::lower(v);
|
|
};
|
|
|
|
|
|
|
|
rust_call_trait_interface_with_error<StatuslessHostError>(&result.call_status, make_call, write_value, FfiConverterStatuslessHostError::lower);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
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) {
|
|
auto obj = FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle);
|
|
|
|
auto make_call = [&]() {
|
|
auto arg0 =FfiConverterTypeHttpRequestId::lift(request_id);obj->cancel_statusless(
|
|
arg0);
|
|
};
|
|
using CompleteCallback = void (*)(uint64_t, UniffiForeignFutureResultVoid);
|
|
auto complete = reinterpret_cast<CompleteCallback>(uniffi_future_callback);
|
|
UniffiForeignFutureResultVoid result = {};
|
|
uniffi_out_dropped_callback.handle = 0;
|
|
uniffi_out_dropped_callback.free = reinterpret_cast<void *>(&foreign_future_drop_noop);
|
|
|
|
|
|
auto write_value = [](){};
|
|
|
|
|
|
|
|
rust_call_trait_interface(&result.call_status, make_call, write_value);
|
|
|
|
complete(uniffi_callback_data, result);
|
|
}
|
|
|
|
void UniffiCallbackInterfaceWalletStatuslessHost::uniffi_free(uint64_t uniffi_handle) {
|
|
FfiConverterWalletStatuslessHost::handle_map.erase(uniffi_handle);
|
|
}
|
|
|
|
uint64_t UniffiCallbackInterfaceWalletStatuslessHost::uniffi_clone(uint64_t uniffi_handle) {
|
|
return FfiConverterWalletStatuslessHost::handle_map.insert(
|
|
FfiConverterWalletStatuslessHost::handle_map.at(uniffi_handle)
|
|
);
|
|
}
|
|
|
|
void UniffiCallbackInterfaceWalletStatuslessHost::init() {
|
|
uniffi_wallet_engine_fn_init_callback_vtable_walletstatuslesshost(vtable);
|
|
}
|
|
} // namespace uniffi
|
|
|
|
|
|
WalletStatuslessHostImpl::WalletStatuslessHostImpl(uint64_t ptr): instance(ptr) {}
|
|
|
|
WalletStatuslessHostImpl::WalletStatuslessHostImpl(const WalletStatuslessHostImpl &other) : instance(0) {
|
|
if (other.instance) {
|
|
instance = other._uniffi_internal_clone_pointer();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<uint8_t> WalletStatuslessHostImpl::execute_statusless(const HttpRequest &request) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
return uniffi::FfiConverterBytes::lift(
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletstatuslesshost_execute_statusless(
|
|
ptr, uniffi::FfiConverterTypeHttpRequest::lower(request)); },
|
|
ffi_wallet_engine_rust_future_poll_rust_buffer,
|
|
ffi_wallet_engine_rust_future_complete_rust_buffer,
|
|
ffi_wallet_engine_rust_future_free_rust_buffer,
|
|
uniffi::FfiConverterStatuslessHostError::lift
|
|
));
|
|
}
|
|
void WalletStatuslessHostImpl::cancel_statusless(const HttpRequestId &request_id) {
|
|
auto ptr = this->_uniffi_internal_clone_pointer();
|
|
|
|
uniffi::rust_call_async(
|
|
[&]() { return uniffi_wallet_engine_fn_method_walletstatuslesshost_cancel_statusless(
|
|
ptr, uniffi::FfiConverterTypeHttpRequestId::lower(request_id)); },
|
|
ffi_wallet_engine_rust_future_poll_void,
|
|
ffi_wallet_engine_rust_future_complete_void,
|
|
ffi_wallet_engine_rust_future_free_void,
|
|
nullptr
|
|
);
|
|
}
|
|
|
|
WalletStatuslessHostImpl::~WalletStatuslessHostImpl() {
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_free_walletstatuslesshost,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
uint64_t WalletStatuslessHostImpl::_uniffi_internal_clone_pointer() const {
|
|
return uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_clone_walletstatuslesshost,
|
|
nullptr,
|
|
this->instance
|
|
);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace uniffi {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::lift(uint64_t ptr) {
|
|
return std::shared_ptr<TonConnectDerivedSession>(new TonConnectDerivedSession(ptr));
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectDerivedSession::lower(const std::shared_ptr<TonConnectDerivedSession> &obj) {
|
|
return reinterpret_cast<TonConnectDerivedSession*>(obj.get())->_uniffi_internal_clone_pointer();
|
|
}
|
|
|
|
std::shared_ptr<TonConnectDerivedSession> FfiConverterTonConnectDerivedSession::read(RustStream &stream) {
|
|
uint64_t ptr;
|
|
stream >> ptr;
|
|
|
|
return FfiConverterTonConnectDerivedSession::lift(ptr);
|
|
}
|
|
|
|
void FfiConverterTonConnectDerivedSession::write(RustStream &stream, const std::shared_ptr<TonConnectDerivedSession> &obj) {
|
|
stream << FfiConverterTonConnectDerivedSession::lower(obj);
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectDerivedSession::allocation_size(const std::shared_ptr<TonConnectDerivedSession> &) {
|
|
return 8;
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::lift(uint64_t ptr) {
|
|
return std::shared_ptr<TonConnectSession>(new TonConnectSession(ptr));
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectSession::lower(const std::shared_ptr<TonConnectSession> &obj) {
|
|
return reinterpret_cast<TonConnectSession*>(obj.get())->_uniffi_internal_clone_pointer();
|
|
}
|
|
|
|
std::shared_ptr<TonConnectSession> FfiConverterTonConnectSession::read(RustStream &stream) {
|
|
uint64_t ptr;
|
|
stream >> ptr;
|
|
|
|
return FfiConverterTonConnectSession::lift(ptr);
|
|
}
|
|
|
|
void FfiConverterTonConnectSession::write(RustStream &stream, const std::shared_ptr<TonConnectSession> &obj) {
|
|
stream << FfiConverterTonConnectSession::lower(obj);
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectSession::allocation_size(const std::shared_ptr<TonConnectSession> &) {
|
|
return 8;
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<WalletClient> FfiConverterWalletClient::lift(uint64_t ptr) {
|
|
return std::shared_ptr<WalletClient>(new WalletClient(ptr));
|
|
}
|
|
|
|
uint64_t FfiConverterWalletClient::lower(const std::shared_ptr<WalletClient> &obj) {
|
|
return reinterpret_cast<WalletClient*>(obj.get())->_uniffi_internal_clone_pointer();
|
|
}
|
|
|
|
std::shared_ptr<WalletClient> FfiConverterWalletClient::read(RustStream &stream) {
|
|
uint64_t ptr;
|
|
stream >> ptr;
|
|
|
|
return FfiConverterWalletClient::lift(ptr);
|
|
}
|
|
|
|
void FfiConverterWalletClient::write(RustStream &stream, const std::shared_ptr<WalletClient> &obj) {
|
|
stream << FfiConverterWalletClient::lower(obj);
|
|
}
|
|
|
|
uint64_t FfiConverterWalletClient::allocation_size(const std::shared_ptr<WalletClient> &) {
|
|
return 8;
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::lift(uint64_t ptr) {
|
|
return std::shared_ptr<WalletHttpHost>(new WalletHttpHostImpl(ptr));
|
|
}
|
|
|
|
uint64_t FfiConverterWalletHttpHost::lower(const std::shared_ptr<WalletHttpHost> &obj) {
|
|
return handle_map.insert(obj);
|
|
}
|
|
|
|
std::shared_ptr<WalletHttpHost> FfiConverterWalletHttpHost::read(RustStream &stream) {
|
|
uint64_t ptr;
|
|
stream >> ptr;
|
|
|
|
return FfiConverterWalletHttpHost::lift(ptr);
|
|
}
|
|
|
|
void FfiConverterWalletHttpHost::write(RustStream &stream, const std::shared_ptr<WalletHttpHost> &obj) {
|
|
stream << FfiConverterWalletHttpHost::lower(obj);
|
|
}
|
|
|
|
uint64_t FfiConverterWalletHttpHost::allocation_size(const std::shared_ptr<WalletHttpHost> &) {
|
|
return 8;
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::lift(uint64_t ptr) {
|
|
return std::shared_ptr<WalletLifecycle>(new WalletLifecycle(ptr));
|
|
}
|
|
|
|
uint64_t FfiConverterWalletLifecycle::lower(const std::shared_ptr<WalletLifecycle> &obj) {
|
|
return reinterpret_cast<WalletLifecycle*>(obj.get())->_uniffi_internal_clone_pointer();
|
|
}
|
|
|
|
std::shared_ptr<WalletLifecycle> FfiConverterWalletLifecycle::read(RustStream &stream) {
|
|
uint64_t ptr;
|
|
stream >> ptr;
|
|
|
|
return FfiConverterWalletLifecycle::lift(ptr);
|
|
}
|
|
|
|
void FfiConverterWalletLifecycle::write(RustStream &stream, const std::shared_ptr<WalletLifecycle> &obj) {
|
|
stream << FfiConverterWalletLifecycle::lower(obj);
|
|
}
|
|
|
|
uint64_t FfiConverterWalletLifecycle::allocation_size(const std::shared_ptr<WalletLifecycle> &) {
|
|
return 8;
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::lift(uint64_t ptr) {
|
|
return std::shared_ptr<WalletPlatformHost>(new WalletPlatformHostImpl(ptr));
|
|
}
|
|
|
|
uint64_t FfiConverterWalletPlatformHost::lower(const std::shared_ptr<WalletPlatformHost> &obj) {
|
|
return handle_map.insert(obj);
|
|
}
|
|
|
|
std::shared_ptr<WalletPlatformHost> FfiConverterWalletPlatformHost::read(RustStream &stream) {
|
|
uint64_t ptr;
|
|
stream >> ptr;
|
|
|
|
return FfiConverterWalletPlatformHost::lift(ptr);
|
|
}
|
|
|
|
void FfiConverterWalletPlatformHost::write(RustStream &stream, const std::shared_ptr<WalletPlatformHost> &obj) {
|
|
stream << FfiConverterWalletPlatformHost::lower(obj);
|
|
}
|
|
|
|
uint64_t FfiConverterWalletPlatformHost::allocation_size(const std::shared_ptr<WalletPlatformHost> &) {
|
|
return 8;
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::lift(uint64_t ptr) {
|
|
return std::shared_ptr<WalletStatuslessHost>(new WalletStatuslessHostImpl(ptr));
|
|
}
|
|
|
|
uint64_t FfiConverterWalletStatuslessHost::lower(const std::shared_ptr<WalletStatuslessHost> &obj) {
|
|
return handle_map.insert(obj);
|
|
}
|
|
|
|
std::shared_ptr<WalletStatuslessHost> FfiConverterWalletStatuslessHost::read(RustStream &stream) {
|
|
uint64_t ptr;
|
|
stream >> ptr;
|
|
|
|
return FfiConverterWalletStatuslessHost::lift(ptr);
|
|
}
|
|
|
|
void FfiConverterWalletStatuslessHost::write(RustStream &stream, const std::shared_ptr<WalletStatuslessHost> &obj) {
|
|
stream << FfiConverterWalletStatuslessHost::lower(obj);
|
|
}
|
|
|
|
uint64_t FfiConverterWalletStatuslessHost::allocation_size(const std::shared_ptr<WalletStatuslessHost> &) {
|
|
return 8;
|
|
}
|
|
|
|
|
|
AccountSnapshot FfiConverterTypeAccountSnapshot::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeAccountSnapshot::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeAccountSnapshot::lower(const AccountSnapshot &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeAccountSnapshot::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
AccountSnapshot FfiConverterTypeAccountSnapshot::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterAccountStatus::read(stream),
|
|
FfiConverterUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeAccountSnapshot::write(RustStream &stream, const AccountSnapshot &val) {
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.balance_nanograms);
|
|
FfiConverterAccountStatus::write(stream, val.status);
|
|
FfiConverterUInt64::write(stream, val.sync_utime);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeAccountSnapshot::allocation_size(const AccountSnapshot &val) {
|
|
|
|
return
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.balance_nanograms) +
|
|
FfiConverterAccountStatus::allocation_size(val.status) +
|
|
FfiConverterUInt64::allocation_size(val.sync_utime);
|
|
|
|
}
|
|
|
|
|
|
ActivityCursor FfiConverterTypeActivityCursor::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeActivityCursor::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeActivityCursor::lower(const ActivityCursor &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeActivityCursor::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ActivityCursor FfiConverterTypeActivityCursor::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterTypeBase64Hash::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeActivityCursor::write(RustStream &stream, const ActivityCursor &val) {
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.logical_time);
|
|
FfiConverterTypeBase64Hash::write(stream, val.hash);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeActivityCursor::allocation_size(const ActivityCursor &val) {
|
|
|
|
return
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.logical_time) +
|
|
FfiConverterTypeBase64Hash::allocation_size(val.hash);
|
|
|
|
}
|
|
|
|
|
|
ActivityItem FfiConverterTypeActivityItem::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeActivityItem::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeActivityItem::lower(const ActivityItem &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeActivityItem::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ActivityItem FfiConverterTypeActivityItem::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterTypeBase64Hash::read(stream),
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterActivityDirection::read(stream),
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterActivityStatus::read(stream),
|
|
FfiConverterOptionalString::read(stream),
|
|
FfiConverterOptionalTypeBoc::read(stream),
|
|
FfiConverterOptionalTypeTonAddressString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeActivityItem::write(RustStream &stream, const ActivityItem &val) {
|
|
FfiConverterString::write(stream, val.id);
|
|
FfiConverterTypeBase64Hash::write(stream, val.transaction_hash);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.logical_time);
|
|
FfiConverterUInt64::write(stream, val.timestamp);
|
|
FfiConverterActivityDirection::write(stream, val.direction);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.amount_nanograms);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.transaction_fee_nanograms);
|
|
FfiConverterActivityStatus::write(stream, val.status);
|
|
FfiConverterOptionalString::write(stream, val.comment);
|
|
FfiConverterOptionalTypeBoc::write(stream, val.encrypted_comment);
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val.counterparty);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeActivityItem::allocation_size(const ActivityItem &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.id) +
|
|
FfiConverterTypeBase64Hash::allocation_size(val.transaction_hash) +
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.logical_time) +
|
|
FfiConverterUInt64::allocation_size(val.timestamp) +
|
|
FfiConverterActivityDirection::allocation_size(val.direction) +
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.amount_nanograms) +
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.transaction_fee_nanograms) +
|
|
FfiConverterActivityStatus::allocation_size(val.status) +
|
|
FfiConverterOptionalString::allocation_size(val.comment) +
|
|
FfiConverterOptionalTypeBoc::allocation_size(val.encrypted_comment) +
|
|
FfiConverterOptionalTypeTonAddressString::allocation_size(val.counterparty);
|
|
|
|
}
|
|
|
|
|
|
ActivityList FfiConverterTypeActivityList::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeActivityList::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeActivityList::lower(const ActivityList &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeActivityList::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ActivityList FfiConverterTypeActivityList::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterSequenceTypeActivityItem::read(stream),
|
|
FfiConverterTypeResourceState::read(stream),
|
|
FfiConverterTypeResourceState::read(stream),
|
|
FfiConverterBool::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeActivityList::write(RustStream &stream, const ActivityList &val) {
|
|
FfiConverterSequenceTypeActivityItem::write(stream, val.items);
|
|
FfiConverterTypeResourceState::write(stream, val.resource);
|
|
FfiConverterTypeResourceState::write(stream, val.pagination_resource);
|
|
FfiConverterBool::write(stream, val.has_more);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeActivityList::allocation_size(const ActivityList &val) {
|
|
|
|
return
|
|
FfiConverterSequenceTypeActivityItem::allocation_size(val.items) +
|
|
FfiConverterTypeResourceState::allocation_size(val.resource) +
|
|
FfiConverterTypeResourceState::allocation_size(val.pagination_resource) +
|
|
FfiConverterBool::allocation_size(val.has_more);
|
|
|
|
}
|
|
|
|
|
|
CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeCreateEncryptedCommentRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeCreateEncryptedCommentRequest::lower(const CreateEncryptedCommentRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeCreateEncryptedCommentRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
CreateEncryptedCommentRequest FfiConverterTypeCreateEncryptedCommentRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterOptionalBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeCreateEncryptedCommentRequest::write(RustStream &stream, const CreateEncryptedCommentRequest &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.recipient);
|
|
FfiConverterString::write(stream, val.comment);
|
|
FfiConverterOptionalBytes::write(stream, val.recipient_public_key);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeCreateEncryptedCommentRequest::allocation_size(const CreateEncryptedCommentRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
|
|
FfiConverterString::allocation_size(val.comment) +
|
|
FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
|
|
|
|
}
|
|
|
|
|
|
CreateWalletRequest FfiConverterTypeCreateWalletRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeCreateWalletRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeCreateWalletRequest::lower(const CreateWalletRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeCreateWalletRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
CreateWalletRequest FfiConverterTypeCreateWalletRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterNetwork::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeCreateWalletRequest::write(RustStream &stream, const CreateWalletRequest &val) {
|
|
FfiConverterString::write(stream, val.record_id);
|
|
FfiConverterNetwork::write(stream, val.network);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeCreateWalletRequest::allocation_size(const CreateWalletRequest &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.record_id) +
|
|
FfiConverterNetwork::allocation_size(val.network);
|
|
|
|
}
|
|
|
|
|
|
CreatedWallet FfiConverterTypeCreatedWallet::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeCreatedWallet::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeCreatedWallet::lower(const CreatedWallet &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeCreatedWallet::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
CreatedWallet FfiConverterTypeCreatedWallet::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeWalletDescriptor::read(stream),
|
|
FfiConverterTypeRecoveryPhrase::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeCreatedWallet::write(RustStream &stream, const CreatedWallet &val) {
|
|
FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
|
|
FfiConverterTypeRecoveryPhrase::write(stream, val.recovery_phrase);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeCreatedWallet::allocation_size(const CreatedWallet &val) {
|
|
|
|
return
|
|
FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
|
|
FfiConverterTypeRecoveryPhrase::allocation_size(val.recovery_phrase);
|
|
|
|
}
|
|
|
|
|
|
DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeDecryptCommentRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeDecryptCommentRequest::lower(const DecryptCommentRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeDecryptCommentRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
DecryptCommentRequest FfiConverterTypeDecryptCommentRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterTypeBoc::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeDecryptCommentRequest::write(RustStream &stream, const DecryptCommentRequest &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.sender);
|
|
FfiConverterTypeBoc::write(stream, val.body);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeDecryptCommentRequest::allocation_size(const DecryptCommentRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.sender) +
|
|
FfiConverterTypeBoc::allocation_size(val.body);
|
|
|
|
}
|
|
|
|
|
|
DomainError FfiConverterTypeDomainError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeDomainError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeDomainError::lower(const DomainError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeDomainError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
DomainError FfiConverterTypeDomainError::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterErrorCode::read(stream),
|
|
FfiConverterErrorCategory::read(stream),
|
|
FfiConverterRetryAdvice::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterOptionalUInt16::read(stream),
|
|
FfiConverterOptionalUInt64::read(stream),
|
|
FfiConverterOptionalHttpHostErrorKind::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeDomainError::write(RustStream &stream, const DomainError &val) {
|
|
FfiConverterErrorCode::write(stream, val.code);
|
|
FfiConverterErrorCategory::write(stream, val.category);
|
|
FfiConverterRetryAdvice::write(stream, val.retry);
|
|
FfiConverterString::write(stream, val.developer_message);
|
|
FfiConverterOptionalUInt16::write(stream, val.provider_status);
|
|
FfiConverterOptionalUInt64::write(stream, val.retry_after_ms);
|
|
FfiConverterOptionalHttpHostErrorKind::write(stream, val.host_kind);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeDomainError::allocation_size(const DomainError &val) {
|
|
|
|
return
|
|
FfiConverterErrorCode::allocation_size(val.code) +
|
|
FfiConverterErrorCategory::allocation_size(val.category) +
|
|
FfiConverterRetryAdvice::allocation_size(val.retry) +
|
|
FfiConverterString::allocation_size(val.developer_message) +
|
|
FfiConverterOptionalUInt16::allocation_size(val.provider_status) +
|
|
FfiConverterOptionalUInt64::allocation_size(val.retry_after_ms) +
|
|
FfiConverterOptionalHttpHostErrorKind::allocation_size(val.host_kind);
|
|
|
|
}
|
|
|
|
|
|
EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeEncryptedCommentRecipientRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeEncryptedCommentRecipientRequest::lower(const EncryptedCommentRecipientRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeEncryptedCommentRecipientRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
EncryptedCommentRecipientRequest FfiConverterTypeEncryptedCommentRecipientRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterOptionalBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeEncryptedCommentRecipientRequest::write(RustStream &stream, const EncryptedCommentRecipientRequest &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.recipient);
|
|
FfiConverterOptionalBytes::write(stream, val.recipient_public_key);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeEncryptedCommentRecipientRequest::allocation_size(const EncryptedCommentRecipientRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
|
|
FfiConverterOptionalBytes::allocation_size(val.recipient_public_key);
|
|
|
|
}
|
|
|
|
|
|
HttpHeader FfiConverterTypeHttpHeader::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeHttpHeader::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeHttpHeader::lower(const HttpHeader &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeHttpHeader::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
HttpHeader FfiConverterTypeHttpHeader::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeHttpHeader::write(RustStream &stream, const HttpHeader &val) {
|
|
FfiConverterString::write(stream, val.name);
|
|
FfiConverterString::write(stream, val.value);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeHttpHeader::allocation_size(const HttpHeader &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.name) +
|
|
FfiConverterString::allocation_size(val.value);
|
|
|
|
}
|
|
|
|
|
|
HttpRequest FfiConverterTypeHttpRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeHttpRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeHttpRequest::lower(const HttpRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeHttpRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
HttpRequest FfiConverterTypeHttpRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeHttpRequestId::read(stream),
|
|
FfiConverterHttpMethod::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterSequenceTypeHttpHeader::read(stream),
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeHttpRequest::write(RustStream &stream, const HttpRequest &val) {
|
|
FfiConverterTypeHttpRequestId::write(stream, val.id);
|
|
FfiConverterHttpMethod::write(stream, val.method);
|
|
FfiConverterString::write(stream, val.url);
|
|
FfiConverterSequenceTypeHttpHeader::write(stream, val.headers);
|
|
FfiConverterBytes::write(stream, val.body);
|
|
FfiConverterUInt64::write(stream, val.timeout_ms);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeHttpRequest::allocation_size(const HttpRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeHttpRequestId::allocation_size(val.id) +
|
|
FfiConverterHttpMethod::allocation_size(val.method) +
|
|
FfiConverterString::allocation_size(val.url) +
|
|
FfiConverterSequenceTypeHttpHeader::allocation_size(val.headers) +
|
|
FfiConverterBytes::allocation_size(val.body) +
|
|
FfiConverterUInt64::allocation_size(val.timeout_ms);
|
|
|
|
}
|
|
|
|
|
|
HttpRequestId FfiConverterTypeHttpRequestId::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeHttpRequestId::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeHttpRequestId::lower(const HttpRequestId &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeHttpRequestId::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
HttpRequestId FfiConverterTypeHttpRequestId::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeHttpRequestId::write(RustStream &stream, const HttpRequestId &val) {
|
|
FfiConverterUInt64::write(stream, val.value);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeHttpRequestId::allocation_size(const HttpRequestId &val) {
|
|
|
|
return
|
|
FfiConverterUInt64::allocation_size(val.value);
|
|
|
|
}
|
|
|
|
|
|
HttpResponse FfiConverterTypeHttpResponse::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeHttpResponse::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeHttpResponse::lower(const HttpResponse &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeHttpResponse::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
HttpResponse FfiConverterTypeHttpResponse::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterUInt16::read(stream),
|
|
FfiConverterSequenceTypeHttpHeader::read(stream),
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeHttpResponse::write(RustStream &stream, const HttpResponse &val) {
|
|
FfiConverterUInt16::write(stream, val.status);
|
|
FfiConverterSequenceTypeHttpHeader::write(stream, val.headers);
|
|
FfiConverterBytes::write(stream, val.body);
|
|
FfiConverterString::write(stream, val.final_url);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeHttpResponse::allocation_size(const HttpResponse &val) {
|
|
|
|
return
|
|
FfiConverterUInt16::allocation_size(val.status) +
|
|
FfiConverterSequenceTypeHttpHeader::allocation_size(val.headers) +
|
|
FfiConverterBytes::allocation_size(val.body) +
|
|
FfiConverterString::allocation_size(val.final_url);
|
|
|
|
}
|
|
|
|
|
|
ImportWalletRequest FfiConverterTypeImportWalletRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeImportWalletRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeImportWalletRequest::lower(const ImportWalletRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeImportWalletRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ImportWalletRequest FfiConverterTypeImportWalletRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterNetwork::read(stream),
|
|
FfiConverterSequenceString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeImportWalletRequest::write(RustStream &stream, const ImportWalletRequest &val) {
|
|
FfiConverterString::write(stream, val.record_id);
|
|
FfiConverterNetwork::write(stream, val.network);
|
|
FfiConverterSequenceString::write(stream, val.recovery_words);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeImportWalletRequest::allocation_size(const ImportWalletRequest &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.record_id) +
|
|
FfiConverterNetwork::allocation_size(val.network) +
|
|
FfiConverterSequenceString::allocation_size(val.recovery_words);
|
|
|
|
}
|
|
|
|
|
|
JournalCompareExchange FfiConverterTypeJournalCompareExchange::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeJournalCompareExchange::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeJournalCompareExchange::lower(const JournalCompareExchange &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeJournalCompareExchange::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
JournalCompareExchange FfiConverterTypeJournalCompareExchange::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeJournalKey::read(stream),
|
|
FfiConverterOptionalUInt64::read(stream),
|
|
FfiConverterTypeJournalRecord::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeJournalCompareExchange::write(RustStream &stream, const JournalCompareExchange &val) {
|
|
FfiConverterTypeJournalKey::write(stream, val.key);
|
|
FfiConverterOptionalUInt64::write(stream, val.expected_version);
|
|
FfiConverterTypeJournalRecord::write(stream, val.replacement);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeJournalCompareExchange::allocation_size(const JournalCompareExchange &val) {
|
|
|
|
return
|
|
FfiConverterTypeJournalKey::allocation_size(val.key) +
|
|
FfiConverterOptionalUInt64::allocation_size(val.expected_version) +
|
|
FfiConverterTypeJournalRecord::allocation_size(val.replacement);
|
|
|
|
}
|
|
|
|
|
|
JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeJournalCompareExchangeResult::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeJournalCompareExchangeResult::lower(const JournalCompareExchangeResult &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeJournalCompareExchangeResult::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
JournalCompareExchangeResult FfiConverterTypeJournalCompareExchangeResult::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterOptionalTypeJournalRecord::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeJournalCompareExchangeResult::write(RustStream &stream, const JournalCompareExchangeResult &val) {
|
|
FfiConverterBool::write(stream, val.applied);
|
|
FfiConverterOptionalTypeJournalRecord::write(stream, val.current);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeJournalCompareExchangeResult::allocation_size(const JournalCompareExchangeResult &val) {
|
|
|
|
return
|
|
FfiConverterBool::allocation_size(val.applied) +
|
|
FfiConverterOptionalTypeJournalRecord::allocation_size(val.current);
|
|
|
|
}
|
|
|
|
|
|
JournalKey FfiConverterTypeJournalKey::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeJournalKey::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeJournalKey::lower(const JournalKey &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeJournalKey::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
JournalKey FfiConverterTypeJournalKey::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeJournalKey::write(RustStream &stream, const JournalKey &val) {
|
|
FfiConverterString::write(stream, val.record_id);
|
|
FfiConverterString::write(stream, val.slot);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeJournalKey::allocation_size(const JournalKey &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.record_id) +
|
|
FfiConverterString::allocation_size(val.slot);
|
|
|
|
}
|
|
|
|
|
|
JournalRecord FfiConverterTypeJournalRecord::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeJournalRecord::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeJournalRecord::lower(const JournalRecord &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeJournalRecord::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
JournalRecord FfiConverterTypeJournalRecord::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeJournalRecord::write(RustStream &stream, const JournalRecord &val) {
|
|
FfiConverterUInt64::write(stream, val.version);
|
|
FfiConverterBytes::write(stream, val.payload);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeJournalRecord::allocation_size(const JournalRecord &val) {
|
|
|
|
return
|
|
FfiConverterUInt64::allocation_size(val.version) +
|
|
FfiConverterBytes::allocation_size(val.payload);
|
|
|
|
}
|
|
|
|
|
|
NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeNftCollectionDescriptor::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeNftCollectionDescriptor::lower(const NftCollectionDescriptor &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeNftCollectionDescriptor::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftCollectionDescriptor FfiConverterTypeNftCollectionDescriptor::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterOptionalString::read(stream),
|
|
FfiConverterOptionalString::read(stream),
|
|
FfiConverterOptionalString::read(stream),
|
|
FfiConverterMapStringString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeNftCollectionDescriptor::write(RustStream &stream, const NftCollectionDescriptor &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.address);
|
|
FfiConverterOptionalString::write(stream, val.name);
|
|
FfiConverterOptionalString::write(stream, val.description);
|
|
FfiConverterOptionalString::write(stream, val.image);
|
|
FfiConverterMapStringString::write(stream, val.content);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeNftCollectionDescriptor::allocation_size(const NftCollectionDescriptor &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.address) +
|
|
FfiConverterOptionalString::allocation_size(val.name) +
|
|
FfiConverterOptionalString::allocation_size(val.description) +
|
|
FfiConverterOptionalString::allocation_size(val.image) +
|
|
FfiConverterMapStringString::allocation_size(val.content);
|
|
|
|
}
|
|
|
|
|
|
NftItem FfiConverterTypeNftItem::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeNftItem::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeNftItem::lower(const NftItem &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeNftItem::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftItem FfiConverterTypeNftItem::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterOptionalTypeTonAddressString::read(stream),
|
|
FfiConverterOptionalTypeNftCollectionDescriptor::read(stream),
|
|
FfiConverterOptionalTypeTonAddressString::read(stream),
|
|
FfiConverterOptionalTypeTonAddressString::read(stream),
|
|
FfiConverterOptionalTypeTonAddressString::read(stream),
|
|
FfiConverterOptionalTypeTonAddressString::read(stream),
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterMapStringString::read(stream),
|
|
FfiConverterOptionalBool::read(stream),
|
|
FfiConverterOptionalBool::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeNftItem::write(RustStream &stream, const NftItem &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.address);
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val.collection_address);
|
|
FfiConverterOptionalTypeNftCollectionDescriptor::write(stream, val.collection);
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val.owner_address);
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val.real_owner);
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val.sale_contract_address);
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val.auction_contract_address);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.index);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.last_transaction_lt);
|
|
FfiConverterBool::write(stream, val.initialized);
|
|
FfiConverterBool::write(stream, val.on_sale);
|
|
FfiConverterString::write(stream, val.code_hash);
|
|
FfiConverterString::write(stream, val.data_hash);
|
|
FfiConverterMapStringString::write(stream, val.content);
|
|
FfiConverterOptionalBool::write(stream, val.is_nsfw);
|
|
FfiConverterOptionalBool::write(stream, val.is_scam);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeNftItem::allocation_size(const NftItem &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.address) +
|
|
FfiConverterOptionalTypeTonAddressString::allocation_size(val.collection_address) +
|
|
FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(val.collection) +
|
|
FfiConverterOptionalTypeTonAddressString::allocation_size(val.owner_address) +
|
|
FfiConverterOptionalTypeTonAddressString::allocation_size(val.real_owner) +
|
|
FfiConverterOptionalTypeTonAddressString::allocation_size(val.sale_contract_address) +
|
|
FfiConverterOptionalTypeTonAddressString::allocation_size(val.auction_contract_address) +
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.index) +
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.last_transaction_lt) +
|
|
FfiConverterBool::allocation_size(val.initialized) +
|
|
FfiConverterBool::allocation_size(val.on_sale) +
|
|
FfiConverterString::allocation_size(val.code_hash) +
|
|
FfiConverterString::allocation_size(val.data_hash) +
|
|
FfiConverterMapStringString::allocation_size(val.content) +
|
|
FfiConverterOptionalBool::allocation_size(val.is_nsfw) +
|
|
FfiConverterOptionalBool::allocation_size(val.is_scam);
|
|
|
|
}
|
|
|
|
|
|
NftList FfiConverterTypeNftList::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeNftList::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeNftList::lower(const NftList &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeNftList::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftList FfiConverterTypeNftList::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterSequenceTypeNftItem::read(stream),
|
|
FfiConverterTypeResourceState::read(stream),
|
|
FfiConverterTypeResourceState::read(stream),
|
|
FfiConverterBool::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeNftList::write(RustStream &stream, const NftList &val) {
|
|
FfiConverterSequenceTypeNftItem::write(stream, val.items);
|
|
FfiConverterTypeResourceState::write(stream, val.resource);
|
|
FfiConverterTypeResourceState::write(stream, val.pagination_resource);
|
|
FfiConverterBool::write(stream, val.has_more);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeNftList::allocation_size(const NftList &val) {
|
|
|
|
return
|
|
FfiConverterSequenceTypeNftItem::allocation_size(val.items) +
|
|
FfiConverterTypeResourceState::allocation_size(val.resource) +
|
|
FfiConverterTypeResourceState::allocation_size(val.pagination_resource) +
|
|
FfiConverterBool::allocation_size(val.has_more);
|
|
|
|
}
|
|
|
|
|
|
NftTransferIntent FfiConverterTypeNftTransferIntent::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeNftTransferIntent::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeNftTransferIntent::lower(const NftTransferIntent &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeNftTransferIntent::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftTransferIntent FfiConverterTypeNftTransferIntent::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterNftTransferFunding::read(stream),
|
|
FfiConverterNftTransferPayload::read(stream),
|
|
FfiConverterSendExpiration::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeNftTransferIntent::write(RustStream &stream, const NftTransferIntent &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.nft_address);
|
|
FfiConverterTypeTonAddressString::write(stream, val.recipient);
|
|
FfiConverterNftTransferFunding::write(stream, val.funding);
|
|
FfiConverterNftTransferPayload::write(stream, val.payload);
|
|
FfiConverterSendExpiration::write(stream, val.expiration);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeNftTransferIntent::allocation_size(const NftTransferIntent &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.nft_address) +
|
|
FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
|
|
FfiConverterNftTransferFunding::allocation_size(val.funding) +
|
|
FfiConverterNftTransferPayload::allocation_size(val.payload) +
|
|
FfiConverterSendExpiration::allocation_size(val.expiration);
|
|
|
|
}
|
|
|
|
|
|
NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeNftTransferPreviewRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeNftTransferPreviewRequest::lower(const NftTransferPreviewRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeNftTransferPreviewRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftTransferPreviewRequest FfiConverterTypeNftTransferPreviewRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeNftTransferIntent::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeNftTransferPreviewRequest::write(RustStream &stream, const NftTransferPreviewRequest &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterTypeNftTransferIntent::write(stream, val.intent);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeNftTransferPreviewRequest::allocation_size(const NftTransferPreviewRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
|
|
|
|
}
|
|
|
|
|
|
NftTransferRequest FfiConverterTypeNftTransferRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeNftTransferRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeNftTransferRequest::lower(const NftTransferRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeNftTransferRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftTransferRequest FfiConverterTypeNftTransferRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterTypeNftTransferIntent::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeNftTransferRequest::write(RustStream &stream, const NftTransferRequest &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterBool::write(stream, val.force);
|
|
FfiConverterTypeNftTransferIntent::write(stream, val.intent);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeNftTransferRequest::allocation_size(const NftTransferRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterBool::allocation_size(val.force) +
|
|
FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
|
|
|
|
}
|
|
|
|
|
|
ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeParsedTonTransferLink::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeParsedTonTransferLink::lower(const ParsedTonTransferLink &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeParsedTonTransferLink::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ParsedTonTransferLink FfiConverterTypeParsedTonTransferLink::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterTonTransferAsset::read(stream),
|
|
FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterTonTransferPayload::read(stream),
|
|
FfiConverterSendExpiration::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeParsedTonTransferLink::write(RustStream &stream, const ParsedTonTransferLink &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.recipient);
|
|
FfiConverterTonTransferAsset::write(stream, val.asset);
|
|
FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val.amount);
|
|
FfiConverterTonTransferPayload::write(stream, val.payload);
|
|
FfiConverterSendExpiration::write(stream, val.expiration);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeParsedTonTransferLink::allocation_size(const ParsedTonTransferLink &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.recipient) +
|
|
FfiConverterTonTransferAsset::allocation_size(val.asset) +
|
|
FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val.amount) +
|
|
FfiConverterTonTransferPayload::allocation_size(val.payload) +
|
|
FfiConverterSendExpiration::allocation_size(val.expiration);
|
|
|
|
}
|
|
|
|
|
|
PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypePrepareKeyRotationRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypePrepareKeyRotationRequest::lower(const PrepareKeyRotationRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypePrepareKeyRotationRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
PrepareKeyRotationRequest FfiConverterTypePrepareKeyRotationRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterKeyRotationMessageKind::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypePrepareKeyRotationRequest::write(RustStream &stream, const PrepareKeyRotationRequest &val) {
|
|
FfiConverterUInt64::write(stream, val.valid_until);
|
|
FfiConverterKeyRotationMessageKind::write(stream, val.message_kind);
|
|
}
|
|
|
|
uint64_t FfiConverterTypePrepareKeyRotationRequest::allocation_size(const PrepareKeyRotationRequest &val) {
|
|
|
|
return
|
|
FfiConverterUInt64::allocation_size(val.valid_until) +
|
|
FfiConverterKeyRotationMessageKind::allocation_size(val.message_kind);
|
|
|
|
}
|
|
|
|
|
|
PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypePrepareNftTransferRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypePrepareNftTransferRequest::lower(const PrepareNftTransferRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypePrepareNftTransferRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
PrepareNftTransferRequest FfiConverterTypePrepareNftTransferRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeNftTransferIntent::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypePrepareNftTransferRequest::write(RustStream &stream, const PrepareNftTransferRequest &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterTypeNftTransferIntent::write(stream, val.intent);
|
|
}
|
|
|
|
uint64_t FfiConverterTypePrepareNftTransferRequest::allocation_size(const PrepareNftTransferRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterTypeNftTransferIntent::allocation_size(val.intent);
|
|
|
|
}
|
|
|
|
|
|
PrepareTransferRequest FfiConverterTypePrepareTransferRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypePrepareTransferRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypePrepareTransferRequest::lower(const PrepareTransferRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypePrepareTransferRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
PrepareTransferRequest FfiConverterTypePrepareTransferRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeSendIntent::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypePrepareTransferRequest::write(RustStream &stream, const PrepareTransferRequest &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterTypeSendIntent::write(stream, val.intent);
|
|
}
|
|
|
|
uint64_t FfiConverterTypePrepareTransferRequest::allocation_size(const PrepareTransferRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterTypeSendIntent::allocation_size(val.intent);
|
|
|
|
}
|
|
|
|
|
|
PreparedKeyRotation FfiConverterTypePreparedKeyRotation::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypePreparedKeyRotation::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypePreparedKeyRotation::lower(const PreparedKeyRotation &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypePreparedKeyRotation::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
PreparedKeyRotation FfiConverterTypePreparedKeyRotation::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeRecoveryPhrase::read(stream),
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterUInt32::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterKeyRotationMessageKind::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypePreparedKeyRotation::write(RustStream &stream, const PreparedKeyRotation &val) {
|
|
FfiConverterTypeRecoveryPhrase::write(stream, val.replacement_recovery_phrase);
|
|
FfiConverterBytes::write(stream, val.new_public_key);
|
|
FfiConverterTypeBoc::write(stream, val.signed_boc);
|
|
FfiConverterTypeBoc::write(stream, val.external_boc);
|
|
FfiConverterTypeBoc::write(stream, val.internal_boc);
|
|
FfiConverterUInt32::write(stream, val.seqno);
|
|
FfiConverterUInt64::write(stream, val.valid_until);
|
|
FfiConverterKeyRotationMessageKind::write(stream, val.message_kind);
|
|
}
|
|
|
|
uint64_t FfiConverterTypePreparedKeyRotation::allocation_size(const PreparedKeyRotation &val) {
|
|
|
|
return
|
|
FfiConverterTypeRecoveryPhrase::allocation_size(val.replacement_recovery_phrase) +
|
|
FfiConverterBytes::allocation_size(val.new_public_key) +
|
|
FfiConverterTypeBoc::allocation_size(val.signed_boc) +
|
|
FfiConverterTypeBoc::allocation_size(val.external_boc) +
|
|
FfiConverterTypeBoc::allocation_size(val.internal_boc) +
|
|
FfiConverterUInt32::allocation_size(val.seqno) +
|
|
FfiConverterUInt64::allocation_size(val.valid_until) +
|
|
FfiConverterKeyRotationMessageKind::allocation_size(val.message_kind);
|
|
|
|
}
|
|
|
|
|
|
PreparedTransfer FfiConverterTypePreparedTransfer::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypePreparedTransfer::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypePreparedTransfer::lower(const PreparedTransfer &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypePreparedTransfer::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
PreparedTransfer FfiConverterTypePreparedTransfer::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterUInt32::read(stream),
|
|
FfiConverterUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypePreparedTransfer::write(RustStream &stream, const PreparedTransfer &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterTypeBoc::write(stream, val.external_boc);
|
|
FfiConverterTypeBoc::write(stream, val.internal_boc);
|
|
FfiConverterUInt32::write(stream, val.seqno);
|
|
FfiConverterUInt64::write(stream, val.valid_until);
|
|
}
|
|
|
|
uint64_t FfiConverterTypePreparedTransfer::allocation_size(const PreparedTransfer &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterTypeBoc::allocation_size(val.external_boc) +
|
|
FfiConverterTypeBoc::allocation_size(val.internal_boc) +
|
|
FfiConverterUInt32::allocation_size(val.seqno) +
|
|
FfiConverterUInt64::allocation_size(val.valid_until);
|
|
|
|
}
|
|
|
|
|
|
ProtectedSecretRead FfiConverterTypeProtectedSecretRead::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeProtectedSecretRead::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeProtectedSecretRead::lower(const ProtectedSecretRead &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeProtectedSecretRead::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ProtectedSecretRead FfiConverterTypeProtectedSecretRead::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeProtectedSecretRef::read(stream),
|
|
FfiConverterSecretAccessReason::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeProtectedSecretRead::write(RustStream &stream, const ProtectedSecretRead &val) {
|
|
FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
|
|
FfiConverterSecretAccessReason::write(stream, val.reason);
|
|
FfiConverterString::write(stream, val.prompt);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeProtectedSecretRead::allocation_size(const ProtectedSecretRead &val) {
|
|
|
|
return
|
|
FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
|
|
FfiConverterSecretAccessReason::allocation_size(val.reason) +
|
|
FfiConverterString::allocation_size(val.prompt);
|
|
|
|
}
|
|
|
|
|
|
ProtectedSecretRef FfiConverterTypeProtectedSecretRef::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeProtectedSecretRef::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeProtectedSecretRef::lower(const ProtectedSecretRef &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeProtectedSecretRef::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ProtectedSecretRef FfiConverterTypeProtectedSecretRef::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeProtectedSecretRef::write(RustStream &stream, const ProtectedSecretRef &val) {
|
|
FfiConverterString::write(stream, val.value);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeProtectedSecretRef::allocation_size(const ProtectedSecretRef &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.value);
|
|
|
|
}
|
|
|
|
|
|
ProtectedSecretStore FfiConverterTypeProtectedSecretStore::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeProtectedSecretStore::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeProtectedSecretStore::lower(const ProtectedSecretStore &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeProtectedSecretStore::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ProtectedSecretStore FfiConverterTypeProtectedSecretStore::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeProtectedSecretRef::read(stream),
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterBool::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeProtectedSecretStore::write(RustStream &stream, const ProtectedSecretStore &val) {
|
|
FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
|
|
FfiConverterBytes::write(stream, val.bytes);
|
|
FfiConverterBool::write(stream, val.require_user_presence);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeProtectedSecretStore::allocation_size(const ProtectedSecretStore &val) {
|
|
|
|
return
|
|
FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref) +
|
|
FfiConverterBytes::allocation_size(val.bytes) +
|
|
FfiConverterBool::allocation_size(val.require_user_presence);
|
|
|
|
}
|
|
|
|
|
|
ProviderConfig FfiConverterTypeProviderConfig::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeProviderConfig::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeProviderConfig::lower(const ProviderConfig &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeProviderConfig::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ProviderConfig FfiConverterTypeProviderConfig::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterOptionalTypeTonAddressString::read(stream),
|
|
FfiConverterUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeProviderConfig::write(RustStream &stream, const ProviderConfig &val) {
|
|
FfiConverterString::write(stream, val.toncenter_base_url);
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val.dns_root_address);
|
|
FfiConverterUInt64::write(stream, val.request_timeout_ms);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeProviderConfig::allocation_size(const ProviderConfig &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.toncenter_base_url) +
|
|
FfiConverterOptionalTypeTonAddressString::allocation_size(val.dns_root_address) +
|
|
FfiConverterUInt64::allocation_size(val.request_timeout_ms);
|
|
|
|
}
|
|
|
|
|
|
RecoveryPhrase FfiConverterTypeRecoveryPhrase::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeRecoveryPhrase::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeRecoveryPhrase::lower(const RecoveryPhrase &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeRecoveryPhrase::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
RecoveryPhrase FfiConverterTypeRecoveryPhrase::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeRecoveryPhrase::write(RustStream &stream, const RecoveryPhrase &val) {
|
|
FfiConverterString::write(stream, val.phrase);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeRecoveryPhrase::allocation_size(const RecoveryPhrase &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.phrase);
|
|
|
|
}
|
|
|
|
|
|
ResolutionInfo FfiConverterTypeResolutionInfo::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeResolutionInfo::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeResolutionInfo::lower(const ResolutionInfo &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeResolutionInfo::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ResolutionInfo FfiConverterTypeResolutionInfo::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterOptionalTypeBase64Hash::read(stream),
|
|
FfiConverterOptionalTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterOptionalPendingReason::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterOptionalUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeResolutionInfo::write(RustStream &stream, const ResolutionInfo &val) {
|
|
FfiConverterOptionalTypeBase64Hash::write(stream, val.transaction_hash);
|
|
FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val.transaction_lt);
|
|
FfiConverterOptionalPendingReason::write(stream, val.pending_reason);
|
|
FfiConverterBool::write(stream, val.can_force_retry);
|
|
FfiConverterOptionalUInt64::write(stream, val.retry_after_hint_ms);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeResolutionInfo::allocation_size(const ResolutionInfo &val) {
|
|
|
|
return
|
|
FfiConverterOptionalTypeBase64Hash::allocation_size(val.transaction_hash) +
|
|
FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val.transaction_lt) +
|
|
FfiConverterOptionalPendingReason::allocation_size(val.pending_reason) +
|
|
FfiConverterBool::allocation_size(val.can_force_retry) +
|
|
FfiConverterOptionalUInt64::allocation_size(val.retry_after_hint_ms);
|
|
|
|
}
|
|
|
|
|
|
ResourceState FfiConverterTypeResourceState::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeResourceState::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeResourceState::lower(const ResourceState &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeResourceState::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ResourceState FfiConverterTypeResourceState::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterResourcePhase::read(stream),
|
|
FfiConverterOptionalTypeDomainError::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeResourceState::write(RustStream &stream, const ResourceState &val) {
|
|
FfiConverterResourcePhase::write(stream, val.phase);
|
|
FfiConverterOptionalTypeDomainError::write(stream, val.error);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeResourceState::allocation_size(const ResourceState &val) {
|
|
|
|
return
|
|
FfiConverterResourcePhase::allocation_size(val.phase) +
|
|
FfiConverterOptionalTypeDomainError::allocation_size(val.error);
|
|
|
|
}
|
|
|
|
|
|
SendBocRequest FfiConverterTypeSendBocRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendBocRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendBocRequest::lower(const SendBocRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendBocRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendBocRequest FfiConverterTypeSendBocRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterUInt32::read(stream),
|
|
FfiConverterUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendBocRequest::write(RustStream &stream, const SendBocRequest &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterBool::write(stream, val.force);
|
|
FfiConverterTypeBoc::write(stream, val.signed_boc);
|
|
FfiConverterUInt32::write(stream, val.seqno);
|
|
FfiConverterUInt64::write(stream, val.valid_until);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendBocRequest::allocation_size(const SendBocRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterBool::allocation_size(val.force) +
|
|
FfiConverterTypeBoc::allocation_size(val.signed_boc) +
|
|
FfiConverterUInt32::allocation_size(val.seqno) +
|
|
FfiConverterUInt64::allocation_size(val.valid_until);
|
|
|
|
}
|
|
|
|
|
|
SendEmulation FfiConverterTypeSendEmulation::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendEmulation::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendEmulation::lower(const SendEmulation &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendEmulation::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendEmulation FfiConverterTypeSendEmulation::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterUInt32::read(stream),
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterSequenceTypeSendEmulationAction::read(stream),
|
|
FfiConverterSequenceTypeSendEmulationTransaction::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterBool::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendEmulation::write(RustStream &stream, const SendEmulation &val) {
|
|
FfiConverterUInt32::write(stream, val.mc_block_seqno);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.wallet_fees_nanograms);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, val.trace_fees_nanograms);
|
|
FfiConverterUInt64::write(stream, val.transaction_count);
|
|
FfiConverterSequenceTypeSendEmulationAction::write(stream, val.actions);
|
|
FfiConverterSequenceTypeSendEmulationTransaction::write(stream, val.transactions);
|
|
FfiConverterBool::write(stream, val.trace_succeeded);
|
|
FfiConverterBool::write(stream, val.is_incomplete);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendEmulation::allocation_size(const SendEmulation &val) {
|
|
|
|
return
|
|
FfiConverterUInt32::allocation_size(val.mc_block_seqno) +
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.wallet_fees_nanograms) +
|
|
FfiConverterTypeUnsignedDecimalString::allocation_size(val.trace_fees_nanograms) +
|
|
FfiConverterUInt64::allocation_size(val.transaction_count) +
|
|
FfiConverterSequenceTypeSendEmulationAction::allocation_size(val.actions) +
|
|
FfiConverterSequenceTypeSendEmulationTransaction::allocation_size(val.transactions) +
|
|
FfiConverterBool::allocation_size(val.trace_succeeded) +
|
|
FfiConverterBool::allocation_size(val.is_incomplete);
|
|
|
|
}
|
|
|
|
|
|
SendEmulationAction FfiConverterTypeSendEmulationAction::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendEmulationAction::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendEmulationAction::lower(const SendEmulationAction &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendEmulationAction::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendEmulationAction FfiConverterTypeSendEmulationAction::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeBase64Hash::read(stream),
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterSequenceTypeTonAddressString::read(stream),
|
|
FfiConverterSequenceTypeBase64Hash::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendEmulationAction::write(RustStream &stream, const SendEmulationAction &val) {
|
|
FfiConverterTypeBase64Hash::write(stream, val.action_id);
|
|
FfiConverterTypeNonEmptyString::write(stream, val.kind);
|
|
FfiConverterBool::write(stream, val.succeeded);
|
|
FfiConverterSequenceTypeTonAddressString::write(stream, val.accounts);
|
|
FfiConverterSequenceTypeBase64Hash::write(stream, val.transaction_hashes);
|
|
FfiConverterString::write(stream, val.details_json);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendEmulationAction::allocation_size(const SendEmulationAction &val) {
|
|
|
|
return
|
|
FfiConverterTypeBase64Hash::allocation_size(val.action_id) +
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.kind) +
|
|
FfiConverterBool::allocation_size(val.succeeded) +
|
|
FfiConverterSequenceTypeTonAddressString::allocation_size(val.accounts) +
|
|
FfiConverterSequenceTypeBase64Hash::allocation_size(val.transaction_hashes) +
|
|
FfiConverterString::allocation_size(val.details_json);
|
|
|
|
}
|
|
|
|
|
|
SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendEmulationTransaction::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendEmulationTransaction::lower(const SendEmulationTransaction &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendEmulationTransaction::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendEmulationTransaction FfiConverterTypeSendEmulationTransaction::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterBool::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendEmulationTransaction::write(RustStream &stream, const SendEmulationTransaction &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.account);
|
|
FfiConverterBool::write(stream, val.succeeded);
|
|
FfiConverterBool::write(stream, val.is_root);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendEmulationTransaction::allocation_size(const SendEmulationTransaction &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.account) +
|
|
FfiConverterBool::allocation_size(val.succeeded) +
|
|
FfiConverterBool::allocation_size(val.is_root);
|
|
|
|
}
|
|
|
|
|
|
SendIntent FfiConverterTypeSendIntent::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendIntent::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendIntent::lower(const SendIntent &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendIntent::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendIntent FfiConverterTypeSendIntent::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterSendExpiration::read(stream),
|
|
FfiConverterSequenceTypeSendMessage::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendIntent::write(RustStream &stream, const SendIntent &val) {
|
|
FfiConverterSendExpiration::write(stream, val.expiration);
|
|
FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendIntent::allocation_size(const SendIntent &val) {
|
|
|
|
return
|
|
FfiConverterSendExpiration::allocation_size(val.expiration) +
|
|
FfiConverterSequenceTypeSendMessage::allocation_size(val.messages);
|
|
|
|
}
|
|
|
|
|
|
SendMessage FfiConverterTypeSendMessage::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendMessage::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendMessage::lower(const SendMessage &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendMessage::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendMessage FfiConverterTypeSendMessage::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterSendAmount::read(stream),
|
|
FfiConverterSendMessageBody::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterOptionalTypeBoc::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendMessage::write(RustStream &stream, const SendMessage &val) {
|
|
FfiConverterTypeTonAddressString::write(stream, val.destination);
|
|
FfiConverterSendAmount::write(stream, val.amount);
|
|
FfiConverterSendMessageBody::write(stream, val.body);
|
|
FfiConverterBool::write(stream, val.bounce);
|
|
FfiConverterOptionalTypeBoc::write(stream, val.state_init);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendMessage::allocation_size(const SendMessage &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonAddressString::allocation_size(val.destination) +
|
|
FfiConverterSendAmount::allocation_size(val.amount) +
|
|
FfiConverterSendMessageBody::allocation_size(val.body) +
|
|
FfiConverterBool::allocation_size(val.bounce) +
|
|
FfiConverterOptionalTypeBoc::allocation_size(val.state_init);
|
|
|
|
}
|
|
|
|
|
|
SendPreview FfiConverterTypeSendPreview::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendPreview::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendPreview::lower(const SendPreview &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendPreview::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendPreview FfiConverterTypeSendPreview::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterSequenceTypeSendMessage::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterTypeSendEmulation::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendPreview::write(RustStream &stream, const SendPreview &val) {
|
|
FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
|
|
FfiConverterUInt64::write(stream, val.valid_until);
|
|
FfiConverterTypeBoc::write(stream, val.message_boc_base64);
|
|
FfiConverterTypeSendEmulation::write(stream, val.emulation);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendPreview::allocation_size(const SendPreview &val) {
|
|
|
|
return
|
|
FfiConverterSequenceTypeSendMessage::allocation_size(val.messages) +
|
|
FfiConverterUInt64::allocation_size(val.valid_until) +
|
|
FfiConverterTypeBoc::allocation_size(val.message_boc_base64) +
|
|
FfiConverterTypeSendEmulation::allocation_size(val.emulation);
|
|
|
|
}
|
|
|
|
|
|
SendPreviewRequest FfiConverterTypeSendPreviewRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendPreviewRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendPreviewRequest::lower(const SendPreviewRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendPreviewRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendPreviewRequest FfiConverterTypeSendPreviewRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeSendIntent::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendPreviewRequest::write(RustStream &stream, const SendPreviewRequest &val) {
|
|
FfiConverterTypeSendIntent::write(stream, val.intent);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendPreviewRequest::allocation_size(const SendPreviewRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeSendIntent::allocation_size(val.intent);
|
|
|
|
}
|
|
|
|
|
|
SendRequest FfiConverterTypeSendRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendRequest::lower(const SendRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendRequest FfiConverterTypeSendRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterTypeSendIntent::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendRequest::write(RustStream &stream, const SendRequest &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterBool::write(stream, val.force);
|
|
FfiConverterTypeSendIntent::write(stream, val.intent);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendRequest::allocation_size(const SendRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterBool::allocation_size(val.force) +
|
|
FfiConverterTypeSendIntent::allocation_size(val.intent);
|
|
|
|
}
|
|
|
|
|
|
SendResult FfiConverterTypeSendResult::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendResult::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendResult::lower(const SendResult &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendResult::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendResult FfiConverterTypeSendResult::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeBase64Hash::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterSendPhase::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendResult::write(RustStream &stream, const SendResult &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterTypeBase64Hash::write(stream, val.message_hash);
|
|
FfiConverterTypeBoc::write(stream, val.signed_boc);
|
|
FfiConverterSendPhase::write(stream, val.phase);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendResult::allocation_size(const SendResult &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterTypeBase64Hash::allocation_size(val.message_hash) +
|
|
FfiConverterTypeBoc::allocation_size(val.signed_boc) +
|
|
FfiConverterSendPhase::allocation_size(val.phase);
|
|
|
|
}
|
|
|
|
|
|
SendSnapshot FfiConverterTypeSendSnapshot::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSendSnapshot::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSendSnapshot::lower(const SendSnapshot &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSendSnapshot::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendSnapshot FfiConverterTypeSendSnapshot::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterOptionalTypeNonEmptyString::read(stream),
|
|
FfiConverterSendPhase::read(stream),
|
|
FfiConverterOptionalString::read(stream),
|
|
FfiConverterOptionalTypeResolutionInfo::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSendSnapshot::write(RustStream &stream, const SendSnapshot &val) {
|
|
FfiConverterOptionalTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterSendPhase::write(stream, val.phase);
|
|
FfiConverterOptionalString::write(stream, val.error_message);
|
|
FfiConverterOptionalTypeResolutionInfo::write(stream, val.resolution);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSendSnapshot::allocation_size(const SendSnapshot &val) {
|
|
|
|
return
|
|
FfiConverterOptionalTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterSendPhase::allocation_size(val.phase) +
|
|
FfiConverterOptionalString::allocation_size(val.error_message) +
|
|
FfiConverterOptionalTypeResolutionInfo::allocation_size(val.resolution);
|
|
|
|
}
|
|
|
|
|
|
SignMessagePreview FfiConverterTypeSignMessagePreview::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSignMessagePreview::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSignMessagePreview::lower(const SignMessagePreview &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSignMessagePreview::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SignMessagePreview FfiConverterTypeSignMessagePreview::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterSequenceTypeSendMessage::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterBool::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSignMessagePreview::write(RustStream &stream, const SignMessagePreview &val) {
|
|
FfiConverterSequenceTypeSendMessage::write(stream, val.messages);
|
|
FfiConverterUInt64::write(stream, val.valid_until);
|
|
FfiConverterBool::write(stream, val.needs_state_init);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSignMessagePreview::allocation_size(const SignMessagePreview &val) {
|
|
|
|
return
|
|
FfiConverterSequenceTypeSendMessage::allocation_size(val.messages) +
|
|
FfiConverterUInt64::allocation_size(val.valid_until) +
|
|
FfiConverterBool::allocation_size(val.needs_state_init);
|
|
|
|
}
|
|
|
|
|
|
SignMessageRequest FfiConverterTypeSignMessageRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSignMessageRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSignMessageRequest::lower(const SignMessageRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSignMessageRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SignMessageRequest FfiConverterTypeSignMessageRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterBool::read(stream),
|
|
FfiConverterTypeSendIntent::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSignMessageRequest::write(RustStream &stream, const SignMessageRequest &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterBool::write(stream, val.force);
|
|
FfiConverterTypeSendIntent::write(stream, val.intent);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSignMessageRequest::allocation_size(const SignMessageRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterBool::allocation_size(val.force) +
|
|
FfiConverterTypeSendIntent::allocation_size(val.intent);
|
|
|
|
}
|
|
|
|
|
|
SignMessageResult FfiConverterTypeSignMessageResult::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeSignMessageResult::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeSignMessageResult::lower(const SignMessageResult &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeSignMessageResult::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SignMessageResult FfiConverterTypeSignMessageResult::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeBoc::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterSendPhase::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeSignMessageResult::write(RustStream &stream, const SignMessageResult &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.operation_id);
|
|
FfiConverterTypeBoc::write(stream, val.internal_boc);
|
|
FfiConverterUInt64::write(stream, val.valid_until);
|
|
FfiConverterSendPhase::write(stream, val.phase);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeSignMessageResult::allocation_size(const SignMessageResult &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.operation_id) +
|
|
FfiConverterTypeBoc::allocation_size(val.internal_boc) +
|
|
FfiConverterUInt64::allocation_size(val.valid_until) +
|
|
FfiConverterSendPhase::allocation_size(val.phase);
|
|
|
|
}
|
|
|
|
|
|
TonAddressInfo FfiConverterTypeTonAddressInfo::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonAddressInfo::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonAddressInfo::lower(const TonAddressInfo &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonAddressInfo::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonAddressInfo FfiConverterTypeTonAddressInfo::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterInt32::read(stream),
|
|
FfiConverterTonAddressFormat::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonAddressInfo::write(RustStream &stream, const TonAddressInfo &val) {
|
|
FfiConverterString::write(stream, val.raw);
|
|
FfiConverterInt32::write(stream, val.workchain);
|
|
FfiConverterTonAddressFormat::write(stream, val.format);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonAddressInfo::allocation_size(const TonAddressInfo &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.raw) +
|
|
FfiConverterInt32::allocation_size(val.workchain) +
|
|
FfiConverterTonAddressFormat::allocation_size(val.format);
|
|
|
|
}
|
|
|
|
|
|
TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectAccountInfo::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectAccountInfo::lower(const TonConnectAccountInfo &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectAccountInfo::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectAccountInfo FfiConverterTypeTonConnectAccountInfo::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectAccountInfo::write(RustStream &stream, const TonConnectAccountInfo &val) {
|
|
FfiConverterString::write(stream, val.address);
|
|
FfiConverterString::write(stream, val.network);
|
|
FfiConverterString::write(stream, val.wallet_state_init);
|
|
FfiConverterBytes::write(stream, val.public_key);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectAccountInfo::allocation_size(const TonConnectAccountInfo &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.address) +
|
|
FfiConverterString::allocation_size(val.network) +
|
|
FfiConverterString::allocation_size(val.wallet_state_init) +
|
|
FfiConverterBytes::allocation_size(val.public_key);
|
|
|
|
}
|
|
|
|
|
|
TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectConnectPrompt::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectConnectPrompt::lower(const TonConnectConnectPrompt &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectConnectPrompt::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectConnectPrompt FfiConverterTypeTonConnectConnectPrompt::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterOptionalString::read(stream),
|
|
FfiConverterOptionalString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectConnectPrompt::write(RustStream &stream, const TonConnectConnectPrompt &val) {
|
|
FfiConverterString::write(stream, val.manifest_url);
|
|
FfiConverterOptionalString::write(stream, val.requested_network);
|
|
FfiConverterOptionalString::write(stream, val.proof_payload);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectConnectPrompt::allocation_size(const TonConnectConnectPrompt &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.manifest_url) +
|
|
FfiConverterOptionalString::allocation_size(val.requested_network) +
|
|
FfiConverterOptionalString::allocation_size(val.proof_payload);
|
|
|
|
}
|
|
|
|
|
|
TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectDerivedRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectDerivedRequest::lower(const TonConnectDerivedRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectDerivedRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectDerivedRequest FfiConverterTypeTonConnectDerivedRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTonConnectIncomingRequest::read(stream),
|
|
FfiConverterOptionalInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectDerivedRequest::write(RustStream &stream, const TonConnectDerivedRequest &val) {
|
|
FfiConverterTonConnectIncomingRequest::write(stream, val.request);
|
|
FfiConverterOptionalInt64::write(stream, val.request_id);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectDerivedRequest::allocation_size(const TonConnectDerivedRequest &val) {
|
|
|
|
return
|
|
FfiConverterTonConnectIncomingRequest::allocation_size(val.request) +
|
|
FfiConverterOptionalInt64::allocation_size(val.request_id);
|
|
|
|
}
|
|
|
|
|
|
TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectDerivedSessionRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectDerivedSessionRequest::lower(const TonConnectDerivedSessionRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectDerivedSessionRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectDerivedSessionRequest FfiConverterTypeTonConnectDerivedSessionRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeWalletDescriptor::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectDerivedSessionRequest::write(RustStream &stream, const TonConnectDerivedSessionRequest &val) {
|
|
FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
|
|
FfiConverterString::write(stream, val.dapp_client_id);
|
|
FfiConverterBytes::write(stream, val.nonce);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectDerivedSessionRequest::allocation_size(const TonConnectDerivedSessionRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
|
|
FfiConverterString::allocation_size(val.dapp_client_id) +
|
|
FfiConverterBytes::allocation_size(val.nonce);
|
|
|
|
}
|
|
|
|
|
|
TonConnectDevice FfiConverterTypeTonConnectDevice::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectDevice::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectDevice::lower(const TonConnectDevice &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectDevice::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectDevice FfiConverterTypeTonConnectDevice::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTonConnectDevicePlatform::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectDevice::write(RustStream &stream, const TonConnectDevice &val) {
|
|
FfiConverterTonConnectDevicePlatform::write(stream, val.platform);
|
|
FfiConverterString::write(stream, val.app_name);
|
|
FfiConverterString::write(stream, val.app_version);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectDevice::allocation_size(const TonConnectDevice &val) {
|
|
|
|
return
|
|
FfiConverterTonConnectDevicePlatform::allocation_size(val.platform) +
|
|
FfiConverterString::allocation_size(val.app_name) +
|
|
FfiConverterString::allocation_size(val.app_version);
|
|
|
|
}
|
|
|
|
|
|
TonConnectManifest FfiConverterTypeTonConnectManifest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectManifest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectManifest::lower(const TonConnectManifest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectManifest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectManifest FfiConverterTypeTonConnectManifest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectManifest::write(RustStream &stream, const TonConnectManifest &val) {
|
|
FfiConverterString::write(stream, val.url);
|
|
FfiConverterString::write(stream, val.name);
|
|
FfiConverterString::write(stream, val.icon_url);
|
|
FfiConverterString::write(stream, val.domain);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectManifest::allocation_size(const TonConnectManifest &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.url) +
|
|
FfiConverterString::allocation_size(val.name) +
|
|
FfiConverterString::allocation_size(val.icon_url) +
|
|
FfiConverterString::allocation_size(val.domain);
|
|
|
|
}
|
|
|
|
|
|
TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectPreparedPost::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectPreparedPost::lower(const TonConnectPreparedPost &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectPreparedPost::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectPreparedPost FfiConverterTypeTonConnectPreparedPost::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectPreparedPost::write(RustStream &stream, const TonConnectPreparedPost &val) {
|
|
FfiConverterString::write(stream, val.url);
|
|
FfiConverterString::write(stream, val.body);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectPreparedPost::allocation_size(const TonConnectPreparedPost &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.url) +
|
|
FfiConverterString::allocation_size(val.body);
|
|
|
|
}
|
|
|
|
|
|
TonConnectProofReply FfiConverterTypeTonConnectProofReply::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectProofReply::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectProofReply::lower(const TonConnectProofReply &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectProofReply::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectProofReply FfiConverterTypeTonConnectProofReply::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectProofReply::write(RustStream &stream, const TonConnectProofReply &val) {
|
|
FfiConverterUInt64::write(stream, val.timestamp);
|
|
FfiConverterString::write(stream, val.domain);
|
|
FfiConverterString::write(stream, val.payload);
|
|
FfiConverterBytes::write(stream, val.signature);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectProofReply::allocation_size(const TonConnectProofReply &val) {
|
|
|
|
return
|
|
FfiConverterUInt64::allocation_size(val.timestamp) +
|
|
FfiConverterString::allocation_size(val.domain) +
|
|
FfiConverterString::allocation_size(val.payload) +
|
|
FfiConverterBytes::allocation_size(val.signature);
|
|
|
|
}
|
|
|
|
|
|
TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectProofSignRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectProofSignRequest::lower(const TonConnectProofSignRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectProofSignRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectProofSignRequest FfiConverterTypeTonConnectProofSignRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeWalletDescriptor::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectProofSignRequest::write(RustStream &stream, const TonConnectProofSignRequest &val) {
|
|
FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
|
|
FfiConverterString::write(stream, val.domain);
|
|
FfiConverterUInt64::write(stream, val.timestamp);
|
|
FfiConverterString::write(stream, val.payload);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectProofSignRequest::allocation_size(const TonConnectProofSignRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
|
|
FfiConverterString::allocation_size(val.domain) +
|
|
FfiConverterUInt64::allocation_size(val.timestamp) +
|
|
FfiConverterString::allocation_size(val.payload);
|
|
|
|
}
|
|
|
|
|
|
TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectProofSignature::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectProofSignature::lower(const TonConnectProofSignature &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectProofSignature::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectProofSignature FfiConverterTypeTonConnectProofSignature::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectProofSignature::write(RustStream &stream, const TonConnectProofSignature &val) {
|
|
FfiConverterBytes::write(stream, val.signature);
|
|
FfiConverterBytes::write(stream, val.public_key);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectProofSignature::allocation_size(const TonConnectProofSignature &val) {
|
|
|
|
return
|
|
FfiConverterBytes::allocation_size(val.signature) +
|
|
FfiConverterBytes::allocation_size(val.public_key);
|
|
|
|
}
|
|
|
|
|
|
TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectSessionConfig::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectSessionConfig::lower(const TonConnectSessionConfig &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectSessionConfig::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectSessionConfig FfiConverterTypeTonConnectSessionConfig::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterUInt32::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectSessionConfig::write(RustStream &stream, const TonConnectSessionConfig &val) {
|
|
FfiConverterString::write(stream, val.bridge_url);
|
|
FfiConverterUInt64::write(stream, val.max_event_bytes);
|
|
FfiConverterUInt32::write(stream, val.message_ttl_seconds);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectSessionConfig::allocation_size(const TonConnectSessionConfig &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.bridge_url) +
|
|
FfiConverterUInt64::allocation_size(val.max_event_bytes) +
|
|
FfiConverterUInt32::allocation_size(val.message_ttl_seconds);
|
|
|
|
}
|
|
|
|
|
|
TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectSignDataRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectSignDataRequest::lower(const TonConnectSignDataRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectSignDataRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectSignDataRequest FfiConverterTypeTonConnectSignDataRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTonConnectSignDataPayload::read(stream),
|
|
FfiConverterOptionalString::read(stream),
|
|
FfiConverterOptionalString::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectSignDataRequest::write(RustStream &stream, const TonConnectSignDataRequest &val) {
|
|
FfiConverterTonConnectSignDataPayload::write(stream, val.payload);
|
|
FfiConverterOptionalString::write(stream, val.network);
|
|
FfiConverterOptionalString::write(stream, val.from);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectSignDataRequest::allocation_size(const TonConnectSignDataRequest &val) {
|
|
|
|
return
|
|
FfiConverterTonConnectSignDataPayload::allocation_size(val.payload) +
|
|
FfiConverterOptionalString::allocation_size(val.network) +
|
|
FfiConverterOptionalString::allocation_size(val.from);
|
|
|
|
}
|
|
|
|
|
|
TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectSignDataSignRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectSignDataSignRequest::lower(const TonConnectSignDataSignRequest &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectSignDataSignRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectSignDataSignRequest FfiConverterTypeTonConnectSignDataSignRequest::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeWalletDescriptor::read(stream),
|
|
FfiConverterTypeTonConnectSignDataRequest::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterUInt64::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectSignDataSignRequest::write(RustStream &stream, const TonConnectSignDataSignRequest &val) {
|
|
FfiConverterTypeWalletDescriptor::write(stream, val.descriptor);
|
|
FfiConverterTypeTonConnectSignDataRequest::write(stream, val.request);
|
|
FfiConverterString::write(stream, val.domain);
|
|
FfiConverterUInt64::write(stream, val.timestamp);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectSignDataSignRequest::allocation_size(const TonConnectSignDataSignRequest &val) {
|
|
|
|
return
|
|
FfiConverterTypeWalletDescriptor::allocation_size(val.descriptor) +
|
|
FfiConverterTypeTonConnectSignDataRequest::allocation_size(val.request) +
|
|
FfiConverterString::allocation_size(val.domain) +
|
|
FfiConverterUInt64::allocation_size(val.timestamp);
|
|
|
|
}
|
|
|
|
|
|
TonConnectSignedData FfiConverterTypeTonConnectSignedData::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeTonConnectSignedData::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeTonConnectSignedData::lower(const TonConnectSignedData &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeTonConnectSignedData::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectSignedData FfiConverterTypeTonConnectSignedData::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeTonConnectSignDataRequest::read(stream),
|
|
FfiConverterString::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterBytes::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeTonConnectSignedData::write(RustStream &stream, const TonConnectSignedData &val) {
|
|
FfiConverterTypeTonConnectSignDataRequest::write(stream, val.request);
|
|
FfiConverterString::write(stream, val.domain);
|
|
FfiConverterUInt64::write(stream, val.timestamp);
|
|
FfiConverterBytes::write(stream, val.signature);
|
|
FfiConverterBytes::write(stream, val.public_key);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeTonConnectSignedData::allocation_size(const TonConnectSignedData &val) {
|
|
|
|
return
|
|
FfiConverterTypeTonConnectSignDataRequest::allocation_size(val.request) +
|
|
FfiConverterString::allocation_size(val.domain) +
|
|
FfiConverterUInt64::allocation_size(val.timestamp) +
|
|
FfiConverterBytes::allocation_size(val.signature) +
|
|
FfiConverterBytes::allocation_size(val.public_key);
|
|
|
|
}
|
|
|
|
|
|
WalletClientConfig FfiConverterTypeWalletClientConfig::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeWalletClientConfig::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeWalletClientConfig::lower(const WalletClientConfig &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeWalletClientConfig::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
WalletClientConfig FfiConverterTypeWalletClientConfig::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterOptionalTypeProtectedSecretRef::read(stream),
|
|
FfiConverterNetwork::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterTypeProviderConfig::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeWalletClientConfig::write(RustStream &stream, const WalletClientConfig &val) {
|
|
FfiConverterTypeNonEmptyString::write(stream, val.record_id);
|
|
FfiConverterTypeTonAddressString::write(stream, val.address);
|
|
FfiConverterBytes::write(stream, val.public_key);
|
|
FfiConverterOptionalTypeProtectedSecretRef::write(stream, val.local_secret_ref);
|
|
FfiConverterNetwork::write(stream, val.network);
|
|
FfiConverterUInt64::write(stream, val.send_validity_seconds);
|
|
FfiConverterUInt64::write(stream, val.resolution_margin_seconds);
|
|
FfiConverterTypeProviderConfig::write(stream, val.providers);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeWalletClientConfig::allocation_size(const WalletClientConfig &val) {
|
|
|
|
return
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.record_id) +
|
|
FfiConverterTypeTonAddressString::allocation_size(val.address) +
|
|
FfiConverterBytes::allocation_size(val.public_key) +
|
|
FfiConverterOptionalTypeProtectedSecretRef::allocation_size(val.local_secret_ref) +
|
|
FfiConverterNetwork::allocation_size(val.network) +
|
|
FfiConverterUInt64::allocation_size(val.send_validity_seconds) +
|
|
FfiConverterUInt64::allocation_size(val.resolution_margin_seconds) +
|
|
FfiConverterTypeProviderConfig::allocation_size(val.providers);
|
|
|
|
}
|
|
|
|
|
|
WalletDescriptor FfiConverterTypeWalletDescriptor::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeWalletDescriptor::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeWalletDescriptor::lower(const WalletDescriptor &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeWalletDescriptor::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
WalletDescriptor FfiConverterTypeWalletDescriptor::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterString::read(stream),
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterBytes::read(stream),
|
|
FfiConverterNetwork::read(stream),
|
|
FfiConverterTypeProtectedSecretRef::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeWalletDescriptor::write(RustStream &stream, const WalletDescriptor &val) {
|
|
FfiConverterString::write(stream, val.record_id);
|
|
FfiConverterTypeTonAddressString::write(stream, val.address);
|
|
FfiConverterBytes::write(stream, val.public_key);
|
|
FfiConverterNetwork::write(stream, val.network);
|
|
FfiConverterTypeProtectedSecretRef::write(stream, val.secret_ref);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeWalletDescriptor::allocation_size(const WalletDescriptor &val) {
|
|
|
|
return
|
|
FfiConverterString::allocation_size(val.record_id) +
|
|
FfiConverterTypeTonAddressString::allocation_size(val.address) +
|
|
FfiConverterBytes::allocation_size(val.public_key) +
|
|
FfiConverterNetwork::allocation_size(val.network) +
|
|
FfiConverterTypeProtectedSecretRef::allocation_size(val.secret_ref);
|
|
|
|
}
|
|
|
|
|
|
WalletSnapshot FfiConverterTypeWalletSnapshot::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeWalletSnapshot::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeWalletSnapshot::lower(const WalletSnapshot &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeWalletSnapshot::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
WalletSnapshot FfiConverterTypeWalletSnapshot::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterTypeNonEmptyString::read(stream),
|
|
FfiConverterTypeTonAddressString::read(stream),
|
|
FfiConverterNetwork::read(stream),
|
|
FfiConverterOptionalTypeAccountSnapshot::read(stream),
|
|
FfiConverterTypeResourceState::read(stream),
|
|
FfiConverterTypeActivityList::read(stream),
|
|
FfiConverterOptionalTypeActivityCursor::read(stream),
|
|
FfiConverterTypeNftList::read(stream),
|
|
FfiConverterTypeSendSnapshot::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeWalletSnapshot::write(RustStream &stream, const WalletSnapshot &val) {
|
|
FfiConverterUInt64::write(stream, val.revision);
|
|
FfiConverterTypeNonEmptyString::write(stream, val.record_id);
|
|
FfiConverterTypeTonAddressString::write(stream, val.address);
|
|
FfiConverterNetwork::write(stream, val.network);
|
|
FfiConverterOptionalTypeAccountSnapshot::write(stream, val.account);
|
|
FfiConverterTypeResourceState::write(stream, val.account_resource);
|
|
FfiConverterTypeActivityList::write(stream, val.activity);
|
|
FfiConverterOptionalTypeActivityCursor::write(stream, val.activity_cursor);
|
|
FfiConverterTypeNftList::write(stream, val.nfts);
|
|
FfiConverterTypeSendSnapshot::write(stream, val.send);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeWalletSnapshot::allocation_size(const WalletSnapshot &val) {
|
|
|
|
return
|
|
FfiConverterUInt64::allocation_size(val.revision) +
|
|
FfiConverterTypeNonEmptyString::allocation_size(val.record_id) +
|
|
FfiConverterTypeTonAddressString::allocation_size(val.address) +
|
|
FfiConverterNetwork::allocation_size(val.network) +
|
|
FfiConverterOptionalTypeAccountSnapshot::allocation_size(val.account) +
|
|
FfiConverterTypeResourceState::allocation_size(val.account_resource) +
|
|
FfiConverterTypeActivityList::allocation_size(val.activity) +
|
|
FfiConverterOptionalTypeActivityCursor::allocation_size(val.activity_cursor) +
|
|
FfiConverterTypeNftList::allocation_size(val.nfts) +
|
|
FfiConverterTypeSendSnapshot::allocation_size(val.send);
|
|
|
|
}
|
|
|
|
|
|
WalletUpdate FfiConverterTypeWalletUpdate::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTypeWalletUpdate::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTypeWalletUpdate::lower(const WalletUpdate &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTypeWalletUpdate::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
WalletUpdate FfiConverterTypeWalletUpdate::read(RustStream &stream) {
|
|
return {
|
|
FfiConverterWalletOperationOutcome::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterUInt64::read(stream),
|
|
FfiConverterTypeWalletSnapshot::read(stream)
|
|
};
|
|
}
|
|
|
|
void FfiConverterTypeWalletUpdate::write(RustStream &stream, const WalletUpdate &val) {
|
|
FfiConverterWalletOperationOutcome::write(stream, val.outcome);
|
|
FfiConverterUInt64::write(stream, val.activity_items_added);
|
|
FfiConverterUInt64::write(stream, val.nft_items_added);
|
|
FfiConverterTypeWalletSnapshot::write(stream, val.snapshot);
|
|
}
|
|
|
|
uint64_t FfiConverterTypeWalletUpdate::allocation_size(const WalletUpdate &val) {
|
|
|
|
return
|
|
FfiConverterWalletOperationOutcome::allocation_size(val.outcome) +
|
|
FfiConverterUInt64::allocation_size(val.activity_items_added) +
|
|
FfiConverterUInt64::allocation_size(val.nft_items_added) +
|
|
FfiConverterTypeWalletSnapshot::allocation_size(val.snapshot);
|
|
|
|
}
|
|
|
|
|
|
AccountStatus FfiConverterAccountStatus::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterAccountStatus::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterAccountStatus::lower(const AccountStatus &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterAccountStatus::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterAccountStatus::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
AccountStatus FfiConverterAccountStatus::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return AccountStatus::kNonexistent;
|
|
|
|
case 2:
|
|
return AccountStatus::kUninitialized;
|
|
|
|
case 3:
|
|
return AccountStatus::kActive;
|
|
|
|
case 4:
|
|
return AccountStatus::kFrozen;
|
|
|
|
case 5:
|
|
return AccountStatus::kUnknown;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching AccountStatus variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterAccountStatus::write(RustStream &stream, const AccountStatus &val) {
|
|
switch (val) {
|
|
|
|
case AccountStatus::kNonexistent:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case AccountStatus::kUninitialized:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case AccountStatus::kActive:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case AccountStatus::kFrozen:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case AccountStatus::kUnknown:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching AccountStatus variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterAccountStatus::allocation_size(const AccountStatus &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
ActivityDirection FfiConverterActivityDirection::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterActivityDirection::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterActivityDirection::lower(const ActivityDirection &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterActivityDirection::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterActivityDirection::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ActivityDirection FfiConverterActivityDirection::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return ActivityDirection::kSent;
|
|
|
|
case 2:
|
|
return ActivityDirection::kReceived;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ActivityDirection variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterActivityDirection::write(RustStream &stream, const ActivityDirection &val) {
|
|
switch (val) {
|
|
|
|
case ActivityDirection::kSent:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case ActivityDirection::kReceived:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ActivityDirection variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterActivityDirection::allocation_size(const ActivityDirection &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
ActivityStatus FfiConverterActivityStatus::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterActivityStatus::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterActivityStatus::lower(const ActivityStatus &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterActivityStatus::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterActivityStatus::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ActivityStatus FfiConverterActivityStatus::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return ActivityStatus::kSuccess;
|
|
|
|
case 2:
|
|
return ActivityStatus::kFailed;
|
|
|
|
case 3:
|
|
return ActivityStatus::kBounced;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ActivityStatus variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterActivityStatus::write(RustStream &stream, const ActivityStatus &val) {
|
|
switch (val) {
|
|
|
|
case ActivityStatus::kSuccess:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case ActivityStatus::kFailed:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case ActivityStatus::kBounced:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ActivityStatus variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterActivityStatus::allocation_size(const ActivityStatus &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
ErrorCategory FfiConverterErrorCategory::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterErrorCategory::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterErrorCategory::lower(const ErrorCategory &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterErrorCategory::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterErrorCategory::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ErrorCategory FfiConverterErrorCategory::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return ErrorCategory::kTransport;
|
|
|
|
case 2:
|
|
return ErrorCategory::kProviderProtocol;
|
|
|
|
case 3:
|
|
return ErrorCategory::kRateLimit;
|
|
|
|
case 4:
|
|
return ErrorCategory::kCancellation;
|
|
|
|
case 5:
|
|
return ErrorCategory::kHostPolicy;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ErrorCategory variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterErrorCategory::write(RustStream &stream, const ErrorCategory &val) {
|
|
switch (val) {
|
|
|
|
case ErrorCategory::kTransport:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case ErrorCategory::kProviderProtocol:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case ErrorCategory::kRateLimit:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case ErrorCategory::kCancellation:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case ErrorCategory::kHostPolicy:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ErrorCategory variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterErrorCategory::allocation_size(const ErrorCategory &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
ErrorCode FfiConverterErrorCode::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterErrorCode::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterErrorCode::lower(const ErrorCode &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterErrorCode::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterErrorCode::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ErrorCode FfiConverterErrorCode::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return ErrorCode::kInvalidProviderResponse;
|
|
|
|
case 2:
|
|
return ErrorCode::kHttpRejected;
|
|
|
|
case 3:
|
|
return ErrorCode::kRateLimited;
|
|
|
|
case 4:
|
|
return ErrorCode::kTransportFailed;
|
|
|
|
case 5:
|
|
return ErrorCode::kHostCancelled;
|
|
|
|
case 6:
|
|
return ErrorCode::kResponseTooLarge;
|
|
|
|
case 7:
|
|
return ErrorCode::kHostPolicyViolation;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ErrorCode variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterErrorCode::write(RustStream &stream, const ErrorCode &val) {
|
|
switch (val) {
|
|
|
|
case ErrorCode::kInvalidProviderResponse:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case ErrorCode::kHttpRejected:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case ErrorCode::kRateLimited:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case ErrorCode::kTransportFailed:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case ErrorCode::kHostCancelled:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case ErrorCode::kResponseTooLarge:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
case ErrorCode::kHostPolicyViolation:
|
|
stream << static_cast<int32_t>(7);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ErrorCode variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterErrorCode::allocation_size(const ErrorCode &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
std::shared_ptr<HttpHostError> FfiConverterHttpHostError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterHttpHostError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterHttpHostError::lower(const HttpHostError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterHttpHostError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<HttpHostError> FfiConverterHttpHostError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
http_host_error::Failed var("HttpHostError::Failed");
|
|
var.kind = FfiConverterHttpHostErrorKind::read(stream);
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_httphosterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterHttpHostError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<http_host_error::Failed>(what_arg);
|
|
ret->kind = std::move(var.kind);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterHttpHostError::write(RustStream &stream, const HttpHostError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const http_host_error::Failed&>(val);
|
|
FfiConverterHttpHostErrorKind::write(stream, var.kind);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterHttpHostError::allocation_size(const HttpHostError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const http_host_error::Failed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterHttpHostErrorKind::allocation_size(var.kind)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
HttpHostErrorKind FfiConverterHttpHostErrorKind::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterHttpHostErrorKind::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterHttpHostErrorKind::lower(const HttpHostErrorKind &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterHttpHostErrorKind::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterHttpHostErrorKind::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
HttpHostErrorKind FfiConverterHttpHostErrorKind::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return HttpHostErrorKind::kOffline;
|
|
|
|
case 2:
|
|
return HttpHostErrorKind::kTimeout;
|
|
|
|
case 3:
|
|
return HttpHostErrorKind::kConnectionLost;
|
|
|
|
case 4:
|
|
return HttpHostErrorKind::kDns;
|
|
|
|
case 5:
|
|
return HttpHostErrorKind::kTls;
|
|
|
|
case 6:
|
|
return HttpHostErrorKind::kPolicyViolation;
|
|
|
|
case 7:
|
|
return HttpHostErrorKind::kResponseTooLarge;
|
|
|
|
case 8:
|
|
return HttpHostErrorKind::kCancelled;
|
|
|
|
case 9:
|
|
return HttpHostErrorKind::kOther;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching HttpHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterHttpHostErrorKind::write(RustStream &stream, const HttpHostErrorKind &val) {
|
|
switch (val) {
|
|
|
|
case HttpHostErrorKind::kOffline:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kTimeout:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kConnectionLost:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kDns:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kTls:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kPolicyViolation:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kResponseTooLarge:
|
|
stream << static_cast<int32_t>(7);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kCancelled:
|
|
stream << static_cast<int32_t>(8);
|
|
break;
|
|
|
|
case HttpHostErrorKind::kOther:
|
|
stream << static_cast<int32_t>(9);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching HttpHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterHttpHostErrorKind::allocation_size(const HttpHostErrorKind &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
HttpMethod FfiConverterHttpMethod::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterHttpMethod::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterHttpMethod::lower(const HttpMethod &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterHttpMethod::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterHttpMethod::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
HttpMethod FfiConverterHttpMethod::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return HttpMethod::kGet;
|
|
|
|
case 2:
|
|
return HttpMethod::kPost;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching HttpMethod variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterHttpMethod::write(RustStream &stream, const HttpMethod &val) {
|
|
switch (val) {
|
|
|
|
case HttpMethod::kGet:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case HttpMethod::kPost:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching HttpMethod variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterHttpMethod::allocation_size(const HttpMethod &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
std::shared_ptr<JournalHostError> FfiConverterJournalHostError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterJournalHostError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterJournalHostError::lower(const JournalHostError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterJournalHostError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<JournalHostError> FfiConverterJournalHostError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
journal_host_error::Failed var("JournalHostError::Failed");
|
|
var.kind = FfiConverterJournalHostErrorKind::read(stream);
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_journalhosterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterJournalHostError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<journal_host_error::Failed>(what_arg);
|
|
ret->kind = std::move(var.kind);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterJournalHostError::write(RustStream &stream, const JournalHostError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const journal_host_error::Failed&>(val);
|
|
FfiConverterJournalHostErrorKind::write(stream, var.kind);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterJournalHostError::allocation_size(const JournalHostError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const journal_host_error::Failed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterJournalHostErrorKind::allocation_size(var.kind)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
JournalHostErrorKind FfiConverterJournalHostErrorKind::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterJournalHostErrorKind::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterJournalHostErrorKind::lower(const JournalHostErrorKind &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterJournalHostErrorKind::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterJournalHostErrorKind::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
JournalHostErrorKind FfiConverterJournalHostErrorKind::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return JournalHostErrorKind::kUnavailable;
|
|
|
|
case 2:
|
|
return JournalHostErrorKind::kCorruptData;
|
|
|
|
case 3:
|
|
return JournalHostErrorKind::kCancelled;
|
|
|
|
case 4:
|
|
return JournalHostErrorKind::kOther;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching JournalHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterJournalHostErrorKind::write(RustStream &stream, const JournalHostErrorKind &val) {
|
|
switch (val) {
|
|
|
|
case JournalHostErrorKind::kUnavailable:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case JournalHostErrorKind::kCorruptData:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case JournalHostErrorKind::kCancelled:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case JournalHostErrorKind::kOther:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching JournalHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterJournalHostErrorKind::allocation_size(const JournalHostErrorKind &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
KeyRotationMessageKind FfiConverterKeyRotationMessageKind::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterKeyRotationMessageKind::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterKeyRotationMessageKind::lower(const KeyRotationMessageKind &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterKeyRotationMessageKind::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterKeyRotationMessageKind::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
KeyRotationMessageKind FfiConverterKeyRotationMessageKind::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return KeyRotationMessageKind::kExternal;
|
|
|
|
case 2:
|
|
return KeyRotationMessageKind::kInternal;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching KeyRotationMessageKind variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterKeyRotationMessageKind::write(RustStream &stream, const KeyRotationMessageKind &val) {
|
|
switch (val) {
|
|
|
|
case KeyRotationMessageKind::kExternal:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case KeyRotationMessageKind::kInternal:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching KeyRotationMessageKind variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterKeyRotationMessageKind::allocation_size(const KeyRotationMessageKind &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
MnemonicScheme FfiConverterMnemonicScheme::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterMnemonicScheme::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterMnemonicScheme::lower(const MnemonicScheme &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterMnemonicScheme::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterMnemonicScheme::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
MnemonicScheme FfiConverterMnemonicScheme::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return MnemonicScheme::kRotation;
|
|
|
|
case 2:
|
|
return MnemonicScheme::kTon;
|
|
|
|
case 3:
|
|
return MnemonicScheme::kBip39;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching MnemonicScheme variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterMnemonicScheme::write(RustStream &stream, const MnemonicScheme &val) {
|
|
switch (val) {
|
|
|
|
case MnemonicScheme::kRotation:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case MnemonicScheme::kTon:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case MnemonicScheme::kBip39:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching MnemonicScheme variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterMnemonicScheme::allocation_size(const MnemonicScheme &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
Network FfiConverterNetwork::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterNetwork::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterNetwork::lower(const Network &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterNetwork::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterNetwork::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
Network FfiConverterNetwork::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return Network::kMainnet;
|
|
|
|
case 2:
|
|
return Network::kTestnet;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching Network variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterNetwork::write(RustStream &stream, const Network &val) {
|
|
switch (val) {
|
|
|
|
case Network::kMainnet:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case Network::kTestnet:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching Network variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterNetwork::allocation_size(const Network &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
NftTransferFunding FfiConverterNftTransferFunding::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterNftTransferFunding::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterNftTransferFunding::lower(const NftTransferFunding &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterNftTransferFunding::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterNftTransferFunding::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftTransferFunding FfiConverterNftTransferFunding::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return NftTransferFunding::kExact {
|
|
.attached_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
.forward_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching NftTransferFunding variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterNftTransferFunding::write(RustStream &stream, const NftTransferFunding &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, NftTransferFunding::kExact>) {
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, arg.attached_nanograms);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, arg.forward_nanograms);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterNftTransferFunding::allocation_size(const NftTransferFunding &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, NftTransferFunding::kExact>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.attached_nanograms);
|
|
size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.forward_nanograms);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive NftTransferFunding visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
NftTransferPayload FfiConverterNftTransferPayload::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterNftTransferPayload::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterNftTransferPayload::lower(const NftTransferPayload &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterNftTransferPayload::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterNftTransferPayload::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
NftTransferPayload FfiConverterNftTransferPayload::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return NftTransferPayload::kEmpty {
|
|
};
|
|
|
|
case 2:
|
|
return NftTransferPayload::kComment {
|
|
.text = FfiConverterString::read(stream),
|
|
};
|
|
|
|
case 3:
|
|
return NftTransferPayload::kRawPayload {
|
|
.boc = FfiConverterTypeBoc::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching NftTransferPayload variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterNftTransferPayload::write(RustStream &stream, const NftTransferPayload &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
|
|
}
|
|
else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
|
|
FfiConverterString::write(stream, arg.text);
|
|
}
|
|
else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
|
|
FfiConverterTypeBoc::write(stream, arg.boc);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterNftTransferPayload::allocation_size(const NftTransferPayload &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, NftTransferPayload::kEmpty>) {
|
|
uint64_t size = 0;
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, NftTransferPayload::kComment>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.text);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, NftTransferPayload::kRawPayload>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterTypeBoc::allocation_size(arg.boc);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive NftTransferPayload visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
PendingReason FfiConverterPendingReason::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterPendingReason::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterPendingReason::lower(const PendingReason &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterPendingReason::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterPendingReason::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
PendingReason FfiConverterPendingReason::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return PendingReason::kInMempool;
|
|
|
|
case 2:
|
|
return PendingReason::kAwaitingWindow;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching PendingReason variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterPendingReason::write(RustStream &stream, const PendingReason &val) {
|
|
switch (val) {
|
|
|
|
case PendingReason::kInMempool:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case PendingReason::kAwaitingWindow:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching PendingReason variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterPendingReason::allocation_size(const PendingReason &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterProtectedSecretHostError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterProtectedSecretHostError::lower(const ProtectedSecretHostError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterProtectedSecretHostError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<ProtectedSecretHostError> FfiConverterProtectedSecretHostError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
protected_secret_host_error::Failed var("ProtectedSecretHostError::Failed");
|
|
var.kind = FfiConverterProtectedSecretHostErrorKind::read(stream);
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_protectedsecrethosterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterProtectedSecretHostError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<protected_secret_host_error::Failed>(what_arg);
|
|
ret->kind = std::move(var.kind);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterProtectedSecretHostError::write(RustStream &stream, const ProtectedSecretHostError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const protected_secret_host_error::Failed&>(val);
|
|
FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterProtectedSecretHostError::allocation_size(const ProtectedSecretHostError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const protected_secret_host_error::Failed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterProtectedSecretHostErrorKind::allocation_size(var.kind)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterProtectedSecretHostErrorKind::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterProtectedSecretHostErrorKind::lower(const ProtectedSecretHostErrorKind &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterProtectedSecretHostErrorKind::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterProtectedSecretHostErrorKind::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ProtectedSecretHostErrorKind FfiConverterProtectedSecretHostErrorKind::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return ProtectedSecretHostErrorKind::kNotFound;
|
|
|
|
case 2:
|
|
return ProtectedSecretHostErrorKind::kAuthenticationFailed;
|
|
|
|
case 3:
|
|
return ProtectedSecretHostErrorKind::kCancelled;
|
|
|
|
case 4:
|
|
return ProtectedSecretHostErrorKind::kUnavailable;
|
|
|
|
case 5:
|
|
return ProtectedSecretHostErrorKind::kPolicyViolation;
|
|
|
|
case 6:
|
|
return ProtectedSecretHostErrorKind::kOther;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterProtectedSecretHostErrorKind::write(RustStream &stream, const ProtectedSecretHostErrorKind &val) {
|
|
switch (val) {
|
|
|
|
case ProtectedSecretHostErrorKind::kNotFound:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case ProtectedSecretHostErrorKind::kAuthenticationFailed:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case ProtectedSecretHostErrorKind::kCancelled:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case ProtectedSecretHostErrorKind::kUnavailable:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case ProtectedSecretHostErrorKind::kPolicyViolation:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case ProtectedSecretHostErrorKind::kOther:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ProtectedSecretHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterProtectedSecretHostErrorKind::allocation_size(const ProtectedSecretHostErrorKind &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
ResourcePhase FfiConverterResourcePhase::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterResourcePhase::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterResourcePhase::lower(const ResourcePhase &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterResourcePhase::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterResourcePhase::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
ResourcePhase FfiConverterResourcePhase::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return ResourcePhase::kIdle;
|
|
|
|
case 2:
|
|
return ResourcePhase::kLoading;
|
|
|
|
case 3:
|
|
return ResourcePhase::kReady;
|
|
|
|
case 4:
|
|
return ResourcePhase::kFailed;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ResourcePhase variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterResourcePhase::write(RustStream &stream, const ResourcePhase &val) {
|
|
switch (val) {
|
|
|
|
case ResourcePhase::kIdle:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case ResourcePhase::kLoading:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case ResourcePhase::kReady:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case ResourcePhase::kFailed:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching ResourcePhase variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterResourcePhase::allocation_size(const ResourcePhase &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
RetryAdvice FfiConverterRetryAdvice::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterRetryAdvice::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterRetryAdvice::lower(const RetryAdvice &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterRetryAdvice::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterRetryAdvice::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
RetryAdvice FfiConverterRetryAdvice::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return RetryAdvice::kNone;
|
|
|
|
case 2:
|
|
return RetryAdvice::kSafe;
|
|
|
|
case 3:
|
|
return RetryAdvice::kAfterDelay;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching RetryAdvice variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterRetryAdvice::write(RustStream &stream, const RetryAdvice &val) {
|
|
switch (val) {
|
|
|
|
case RetryAdvice::kNone:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case RetryAdvice::kSafe:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case RetryAdvice::kAfterDelay:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching RetryAdvice variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterRetryAdvice::allocation_size(const RetryAdvice &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
SecretAccessReason FfiConverterSecretAccessReason::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterSecretAccessReason::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterSecretAccessReason::lower(const SecretAccessReason &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterSecretAccessReason::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterSecretAccessReason::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SecretAccessReason FfiConverterSecretAccessReason::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return SecretAccessReason::kCreateWallet;
|
|
|
|
case 2:
|
|
return SecretAccessReason::kSignTransfer;
|
|
|
|
case 3:
|
|
return SecretAccessReason::kSignTonConnectProof;
|
|
|
|
case 4:
|
|
return SecretAccessReason::kPrepareKeyRotation;
|
|
|
|
case 5:
|
|
return SecretAccessReason::kEncryptComment;
|
|
|
|
case 6:
|
|
return SecretAccessReason::kDecryptComment;
|
|
|
|
case 7:
|
|
return SecretAccessReason::kRevealRecoveryPhrase;
|
|
|
|
case 8:
|
|
return SecretAccessReason::kDeriveTonConnectSessionKey;
|
|
|
|
case 9:
|
|
return SecretAccessReason::kSignTonConnectData;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching SecretAccessReason variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterSecretAccessReason::write(RustStream &stream, const SecretAccessReason &val) {
|
|
switch (val) {
|
|
|
|
case SecretAccessReason::kCreateWallet:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case SecretAccessReason::kSignTransfer:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case SecretAccessReason::kSignTonConnectProof:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case SecretAccessReason::kPrepareKeyRotation:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case SecretAccessReason::kEncryptComment:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case SecretAccessReason::kDecryptComment:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
case SecretAccessReason::kRevealRecoveryPhrase:
|
|
stream << static_cast<int32_t>(7);
|
|
break;
|
|
|
|
case SecretAccessReason::kDeriveTonConnectSessionKey:
|
|
stream << static_cast<int32_t>(8);
|
|
break;
|
|
|
|
case SecretAccessReason::kSignTonConnectData:
|
|
stream << static_cast<int32_t>(9);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching SecretAccessReason variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSecretAccessReason::allocation_size(const SecretAccessReason &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
SendAmount FfiConverterSendAmount::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterSendAmount::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterSendAmount::lower(const SendAmount &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterSendAmount::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterSendAmount::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendAmount FfiConverterSendAmount::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return SendAmount::kExact {
|
|
.nanograms = FfiConverterTypeUnsignedDecimalString::read(stream),
|
|
};
|
|
|
|
case 2:
|
|
return SendAmount::kAll {
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching SendAmount variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterSendAmount::write(RustStream &stream, const SendAmount &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, SendAmount::kExact>) {
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, arg.nanograms);
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterSendAmount::allocation_size(const SendAmount &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, SendAmount::kExact>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterTypeUnsignedDecimalString::allocation_size(arg.nanograms);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendAmount::kAll>) {
|
|
uint64_t size = 0;
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive SendAmount visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
SendExpiration FfiConverterSendExpiration::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterSendExpiration::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterSendExpiration::lower(const SendExpiration &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterSendExpiration::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterSendExpiration::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendExpiration FfiConverterSendExpiration::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return SendExpiration::kEngineDefault {
|
|
};
|
|
|
|
case 2:
|
|
return SendExpiration::kExact {
|
|
.unix_timestamp = FfiConverterUInt64::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching SendExpiration variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterSendExpiration::write(RustStream &stream, const SendExpiration &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
|
|
FfiConverterUInt64::write(stream, arg.unix_timestamp);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterSendExpiration::allocation_size(const SendExpiration &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, SendExpiration::kEngineDefault>) {
|
|
uint64_t size = 0;
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendExpiration::kExact>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterUInt64::allocation_size(arg.unix_timestamp);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive SendExpiration visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
SendMessageBody FfiConverterSendMessageBody::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterSendMessageBody::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterSendMessageBody::lower(const SendMessageBody &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterSendMessageBody::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterSendMessageBody::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendMessageBody FfiConverterSendMessageBody::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return SendMessageBody::kEmpty {
|
|
};
|
|
|
|
case 2:
|
|
return SendMessageBody::kComment {
|
|
.text = FfiConverterString::read(stream),
|
|
};
|
|
|
|
case 3:
|
|
return SendMessageBody::kRawPayload {
|
|
.boc = FfiConverterTypeBoc::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching SendMessageBody variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterSendMessageBody::write(RustStream &stream, const SendMessageBody &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
|
|
FfiConverterString::write(stream, arg.text);
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
|
|
FfiConverterTypeBoc::write(stream, arg.boc);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterSendMessageBody::allocation_size(const SendMessageBody &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, SendMessageBody::kEmpty>) {
|
|
uint64_t size = 0;
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendMessageBody::kComment>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.text);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, SendMessageBody::kRawPayload>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterTypeBoc::allocation_size(arg.boc);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive SendMessageBody visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
SendPhase FfiConverterSendPhase::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterSendPhase::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterSendPhase::lower(const SendPhase &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterSendPhase::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterSendPhase::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
SendPhase FfiConverterSendPhase::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return SendPhase::kIdle;
|
|
|
|
case 2:
|
|
return SendPhase::kValidating;
|
|
|
|
case 3:
|
|
return SendPhase::kAuthorizing;
|
|
|
|
case 4:
|
|
return SendPhase::kPreparing;
|
|
|
|
case 5:
|
|
return SendPhase::kPersisting;
|
|
|
|
case 6:
|
|
return SendPhase::kReadyToSubmit;
|
|
|
|
case 7:
|
|
return SendPhase::kSubmitting;
|
|
|
|
case 8:
|
|
return SendPhase::kSubmissionUnknown;
|
|
|
|
case 9:
|
|
return SendPhase::kSubmitted;
|
|
|
|
case 10:
|
|
return SendPhase::kHandedOff;
|
|
|
|
case 11:
|
|
return SendPhase::kConfirmed;
|
|
|
|
case 12:
|
|
return SendPhase::kReplaced;
|
|
|
|
case 13:
|
|
return SendPhase::kSequenceNumberConsumed;
|
|
|
|
case 14:
|
|
return SendPhase::kExpired;
|
|
|
|
case 15:
|
|
return SendPhase::kSuperseded;
|
|
|
|
case 16:
|
|
return SendPhase::kFailed;
|
|
|
|
case 17:
|
|
return SendPhase::kCancelled;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching SendPhase variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterSendPhase::write(RustStream &stream, const SendPhase &val) {
|
|
switch (val) {
|
|
|
|
case SendPhase::kIdle:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case SendPhase::kValidating:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case SendPhase::kAuthorizing:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case SendPhase::kPreparing:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case SendPhase::kPersisting:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case SendPhase::kReadyToSubmit:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
case SendPhase::kSubmitting:
|
|
stream << static_cast<int32_t>(7);
|
|
break;
|
|
|
|
case SendPhase::kSubmissionUnknown:
|
|
stream << static_cast<int32_t>(8);
|
|
break;
|
|
|
|
case SendPhase::kSubmitted:
|
|
stream << static_cast<int32_t>(9);
|
|
break;
|
|
|
|
case SendPhase::kHandedOff:
|
|
stream << static_cast<int32_t>(10);
|
|
break;
|
|
|
|
case SendPhase::kConfirmed:
|
|
stream << static_cast<int32_t>(11);
|
|
break;
|
|
|
|
case SendPhase::kReplaced:
|
|
stream << static_cast<int32_t>(12);
|
|
break;
|
|
|
|
case SendPhase::kSequenceNumberConsumed:
|
|
stream << static_cast<int32_t>(13);
|
|
break;
|
|
|
|
case SendPhase::kExpired:
|
|
stream << static_cast<int32_t>(14);
|
|
break;
|
|
|
|
case SendPhase::kSuperseded:
|
|
stream << static_cast<int32_t>(15);
|
|
break;
|
|
|
|
case SendPhase::kFailed:
|
|
stream << static_cast<int32_t>(16);
|
|
break;
|
|
|
|
case SendPhase::kCancelled:
|
|
stream << static_cast<int32_t>(17);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching SendPhase variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSendPhase::allocation_size(const SendPhase &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterStatuslessHostError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterStatuslessHostError::lower(const StatuslessHostError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterStatuslessHostError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<StatuslessHostError> FfiConverterStatuslessHostError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
statusless_host_error::Failed var("StatuslessHostError::Failed");
|
|
var.kind = FfiConverterStatuslessHostErrorKind::read(stream);
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_statuslesshosterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterStatuslessHostError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<statusless_host_error::Failed>(what_arg);
|
|
ret->kind = std::move(var.kind);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterStatuslessHostError::write(RustStream &stream, const StatuslessHostError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const statusless_host_error::Failed&>(val);
|
|
FfiConverterStatuslessHostErrorKind::write(stream, var.kind);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterStatuslessHostError::allocation_size(const StatuslessHostError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const statusless_host_error::Failed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterStatuslessHostErrorKind::allocation_size(var.kind)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterStatuslessHostErrorKind::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterStatuslessHostErrorKind::lower(const StatuslessHostErrorKind &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterStatuslessHostErrorKind::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterStatuslessHostErrorKind::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
StatuslessHostErrorKind FfiConverterStatuslessHostErrorKind::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return StatuslessHostErrorKind::kOffline;
|
|
|
|
case 2:
|
|
return StatuslessHostErrorKind::kTimeout;
|
|
|
|
case 3:
|
|
return StatuslessHostErrorKind::kConnectionLost;
|
|
|
|
case 4:
|
|
return StatuslessHostErrorKind::kPolicyViolation;
|
|
|
|
case 5:
|
|
return StatuslessHostErrorKind::kResponseTooLarge;
|
|
|
|
case 6:
|
|
return StatuslessHostErrorKind::kCancelled;
|
|
|
|
case 7:
|
|
return StatuslessHostErrorKind::kOther;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching StatuslessHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterStatuslessHostErrorKind::write(RustStream &stream, const StatuslessHostErrorKind &val) {
|
|
switch (val) {
|
|
|
|
case StatuslessHostErrorKind::kOffline:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case StatuslessHostErrorKind::kTimeout:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case StatuslessHostErrorKind::kConnectionLost:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case StatuslessHostErrorKind::kPolicyViolation:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case StatuslessHostErrorKind::kResponseTooLarge:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case StatuslessHostErrorKind::kCancelled:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
case StatuslessHostErrorKind::kOther:
|
|
stream << static_cast<int32_t>(7);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching StatuslessHostErrorKind variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterStatuslessHostErrorKind::allocation_size(const StatuslessHostErrorKind &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
std::shared_ptr<TonAddressError> FfiConverterTonAddressError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonAddressError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterTonAddressError::lower(const TonAddressError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonAddressError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<TonAddressError> FfiConverterTonAddressError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
ton_address_error::InvalidAddress var("TonAddressError::InvalidAddress");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterTonAddressError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<ton_address_error::InvalidAddress>(what_arg);
|
|
return ret;
|
|
}
|
|
case 2:
|
|
{
|
|
ton_address_error::UnsupportedWorkchain var("TonAddressError::UnsupportedWorkchain");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_tonaddresserror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterTonAddressError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<ton_address_error::UnsupportedWorkchain>(what_arg);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonAddressError::write(RustStream &stream, const TonAddressError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
|
|
break;
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterTonAddressError::allocation_size(const TonAddressError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const ton_address_error::InvalidAddress&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const ton_address_error::UnsupportedWorkchain&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
TonAddressFormat FfiConverterTonAddressFormat::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonAddressFormat::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonAddressFormat::lower(const TonAddressFormat &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonAddressFormat::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonAddressFormat::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonAddressFormat FfiConverterTonAddressFormat::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return TonAddressFormat::kRaw {
|
|
};
|
|
|
|
case 2:
|
|
return TonAddressFormat::kUserFriendly {
|
|
.bounceable = FfiConverterBool::read(stream),
|
|
.testnet = FfiConverterBool::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonAddressFormat variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonAddressFormat::write(RustStream &stream, const TonAddressFormat &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
|
|
FfiConverterBool::write(stream, arg.bounceable);
|
|
FfiConverterBool::write(stream, arg.testnet);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterTonAddressFormat::allocation_size(const TonAddressFormat &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonAddressFormat::kRaw>) {
|
|
uint64_t size = 0;
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonAddressFormat::kUserFriendly>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterBool::allocation_size(arg.bounceable);
|
|
size += FfiConverterBool::allocation_size(arg.testnet);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonAddressFormat visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonConnectConnectErrorCode::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonConnectConnectErrorCode::lower(const TonConnectConnectErrorCode &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonConnectConnectErrorCode::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonConnectConnectErrorCode::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectConnectErrorCode FfiConverterTonConnectConnectErrorCode::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return TonConnectConnectErrorCode::kManifestNotFound;
|
|
|
|
case 2:
|
|
return TonConnectConnectErrorCode::kManifestContent;
|
|
|
|
case 3:
|
|
return TonConnectConnectErrorCode::kUserDeclined;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonConnectConnectErrorCode::write(RustStream &stream, const TonConnectConnectErrorCode &val) {
|
|
switch (val) {
|
|
|
|
case TonConnectConnectErrorCode::kManifestNotFound:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case TonConnectConnectErrorCode::kManifestContent:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case TonConnectConnectErrorCode::kUserDeclined:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectConnectErrorCode variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectConnectErrorCode::allocation_size(const TonConnectConnectErrorCode &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonConnectDevicePlatform::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonConnectDevicePlatform::lower(const TonConnectDevicePlatform &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonConnectDevicePlatform::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonConnectDevicePlatform::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectDevicePlatform FfiConverterTonConnectDevicePlatform::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return TonConnectDevicePlatform::kIphone;
|
|
|
|
case 2:
|
|
return TonConnectDevicePlatform::kIpad;
|
|
|
|
case 3:
|
|
return TonConnectDevicePlatform::kAndroid;
|
|
|
|
case 4:
|
|
return TonConnectDevicePlatform::kWindows;
|
|
|
|
case 5:
|
|
return TonConnectDevicePlatform::kMac;
|
|
|
|
case 6:
|
|
return TonConnectDevicePlatform::kLinux;
|
|
|
|
case 7:
|
|
return TonConnectDevicePlatform::kBrowser;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectDevicePlatform variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonConnectDevicePlatform::write(RustStream &stream, const TonConnectDevicePlatform &val) {
|
|
switch (val) {
|
|
|
|
case TonConnectDevicePlatform::kIphone:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case TonConnectDevicePlatform::kIpad:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case TonConnectDevicePlatform::kAndroid:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case TonConnectDevicePlatform::kWindows:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case TonConnectDevicePlatform::kMac:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case TonConnectDevicePlatform::kLinux:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
case TonConnectDevicePlatform::kBrowser:
|
|
stream << static_cast<int32_t>(7);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectDevicePlatform variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectDevicePlatform::allocation_size(const TonConnectDevicePlatform &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonConnectIncomingRequest::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonConnectIncomingRequest::lower(const TonConnectIncomingRequest &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonConnectIncomingRequest::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonConnectIncomingRequest::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectIncomingRequest FfiConverterTonConnectIncomingRequest::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return TonConnectIncomingRequest::kSendTransaction {
|
|
.id = FfiConverterString::read(stream),
|
|
.method = FfiConverterString::read(stream),
|
|
.request = FfiConverterTypeSendRequest::read(stream),
|
|
};
|
|
|
|
case 2:
|
|
return TonConnectIncomingRequest::kSignMessage {
|
|
.id = FfiConverterString::read(stream),
|
|
.method = FfiConverterString::read(stream),
|
|
.request = FfiConverterTypeSignMessageRequest::read(stream),
|
|
};
|
|
|
|
case 3:
|
|
return TonConnectIncomingRequest::kDisconnect {
|
|
.id = FfiConverterString::read(stream),
|
|
.method = FfiConverterString::read(stream),
|
|
};
|
|
|
|
case 4:
|
|
return TonConnectIncomingRequest::kUnsupported {
|
|
.id = FfiConverterString::read(stream),
|
|
.method = FfiConverterString::read(stream),
|
|
.error_code = FfiConverterTonConnectRpcErrorCode::read(stream),
|
|
.error_message = FfiConverterString::read(stream),
|
|
};
|
|
|
|
case 5:
|
|
return TonConnectIncomingRequest::kSignData {
|
|
.id = FfiConverterString::read(stream),
|
|
.method = FfiConverterString::read(stream),
|
|
.request = FfiConverterTypeTonConnectSignDataRequest::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectIncomingRequest variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonConnectIncomingRequest::write(RustStream &stream, const TonConnectIncomingRequest &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSendTransaction>) {
|
|
FfiConverterString::write(stream, arg.id);
|
|
FfiConverterString::write(stream, arg.method);
|
|
FfiConverterTypeSendRequest::write(stream, arg.request);
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignMessage>) {
|
|
FfiConverterString::write(stream, arg.id);
|
|
FfiConverterString::write(stream, arg.method);
|
|
FfiConverterTypeSignMessageRequest::write(stream, arg.request);
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
|
|
FfiConverterString::write(stream, arg.id);
|
|
FfiConverterString::write(stream, arg.method);
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kUnsupported>) {
|
|
FfiConverterString::write(stream, arg.id);
|
|
FfiConverterString::write(stream, arg.method);
|
|
FfiConverterTonConnectRpcErrorCode::write(stream, arg.error_code);
|
|
FfiConverterString::write(stream, arg.error_message);
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignData>) {
|
|
FfiConverterString::write(stream, arg.id);
|
|
FfiConverterString::write(stream, arg.method);
|
|
FfiConverterTypeTonConnectSignDataRequest::write(stream, arg.request);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectIncomingRequest::allocation_size(const TonConnectIncomingRequest &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSendTransaction>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.id);
|
|
size += FfiConverterString::allocation_size(arg.method);
|
|
size += FfiConverterTypeSendRequest::allocation_size(arg.request);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignMessage>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.id);
|
|
size += FfiConverterString::allocation_size(arg.method);
|
|
size += FfiConverterTypeSignMessageRequest::allocation_size(arg.request);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kDisconnect>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.id);
|
|
size += FfiConverterString::allocation_size(arg.method);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kUnsupported>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.id);
|
|
size += FfiConverterString::allocation_size(arg.method);
|
|
size += FfiConverterTonConnectRpcErrorCode::allocation_size(arg.error_code);
|
|
size += FfiConverterString::allocation_size(arg.error_message);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectIncomingRequest::kSignData>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.id);
|
|
size += FfiConverterString::allocation_size(arg.method);
|
|
size += FfiConverterTypeTonConnectSignDataRequest::allocation_size(arg.request);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonConnectIncomingRequest visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonConnectRpcErrorCode::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonConnectRpcErrorCode::lower(const TonConnectRpcErrorCode &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonConnectRpcErrorCode::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonConnectRpcErrorCode::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectRpcErrorCode FfiConverterTonConnectRpcErrorCode::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return TonConnectRpcErrorCode::kUnknown;
|
|
|
|
case 2:
|
|
return TonConnectRpcErrorCode::kBadRequest;
|
|
|
|
case 3:
|
|
return TonConnectRpcErrorCode::kUnknownApp;
|
|
|
|
case 4:
|
|
return TonConnectRpcErrorCode::kUserDeclined;
|
|
|
|
case 5:
|
|
return TonConnectRpcErrorCode::kMethodNotSupported;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonConnectRpcErrorCode::write(RustStream &stream, const TonConnectRpcErrorCode &val) {
|
|
switch (val) {
|
|
|
|
case TonConnectRpcErrorCode::kUnknown:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case TonConnectRpcErrorCode::kBadRequest:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case TonConnectRpcErrorCode::kUnknownApp:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case TonConnectRpcErrorCode::kUserDeclined:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case TonConnectRpcErrorCode::kMethodNotSupported:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectRpcErrorCode variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectRpcErrorCode::allocation_size(const TonConnectRpcErrorCode &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonConnectSessionError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterTonConnectSessionError::lower(const TonConnectSessionError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonConnectSessionError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<TonConnectSessionError> FfiConverterTonConnectSessionError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
ton_connect_session_error::Failed var("TonConnectSessionError::Failed");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_tonconnectsessionerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterTonConnectSessionError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<ton_connect_session_error::Failed>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonConnectSessionError::write(RustStream &stream, const TonConnectSessionError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const ton_connect_session_error::Failed&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectSessionError::allocation_size(const TonConnectSessionError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const ton_connect_session_error::Failed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
TonConnectSessionPhase FfiConverterTonConnectSessionPhase::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonConnectSessionPhase::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonConnectSessionPhase::lower(const TonConnectSessionPhase &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonConnectSessionPhase::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonConnectSessionPhase::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectSessionPhase FfiConverterTonConnectSessionPhase::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return TonConnectSessionPhase::kPendingConnect;
|
|
|
|
case 2:
|
|
return TonConnectSessionPhase::kConnected;
|
|
|
|
case 3:
|
|
return TonConnectSessionPhase::kDisconnected;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectSessionPhase variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonConnectSessionPhase::write(RustStream &stream, const TonConnectSessionPhase &val) {
|
|
switch (val) {
|
|
|
|
case TonConnectSessionPhase::kPendingConnect:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case TonConnectSessionPhase::kConnected:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case TonConnectSessionPhase::kDisconnected:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectSessionPhase variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectSessionPhase::allocation_size(const TonConnectSessionPhase &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
|
|
TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonConnectSignDataPayload::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonConnectSignDataPayload::lower(const TonConnectSignDataPayload &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonConnectSignDataPayload::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonConnectSignDataPayload::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonConnectSignDataPayload FfiConverterTonConnectSignDataPayload::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return TonConnectSignDataPayload::kText {
|
|
.text = FfiConverterString::read(stream),
|
|
};
|
|
|
|
case 2:
|
|
return TonConnectSignDataPayload::kBinary {
|
|
.bytes = FfiConverterString::read(stream),
|
|
};
|
|
|
|
case 3:
|
|
return TonConnectSignDataPayload::kCell {
|
|
.schema = FfiConverterString::read(stream),
|
|
.cell = FfiConverterString::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonConnectSignDataPayload variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonConnectSignDataPayload::write(RustStream &stream, const TonConnectSignDataPayload &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kText>) {
|
|
FfiConverterString::write(stream, arg.text);
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
|
|
FfiConverterString::write(stream, arg.bytes);
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
|
|
FfiConverterString::write(stream, arg.schema);
|
|
FfiConverterString::write(stream, arg.cell);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterTonConnectSignDataPayload::allocation_size(const TonConnectSignDataPayload &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kText>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.text);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kBinary>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.bytes);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonConnectSignDataPayload::kCell>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.schema);
|
|
size += FfiConverterString::allocation_size(arg.cell);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonConnectSignDataPayload visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
TonTransferAsset FfiConverterTonTransferAsset::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonTransferAsset::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonTransferAsset::lower(const TonTransferAsset &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonTransferAsset::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonTransferAsset::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonTransferAsset FfiConverterTonTransferAsset::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return TonTransferAsset::kGram {
|
|
};
|
|
|
|
case 2:
|
|
return TonTransferAsset::kJetton {
|
|
.master = FfiConverterTypeTonAddressString::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonTransferAsset variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonTransferAsset::write(RustStream &stream, const TonTransferAsset &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
|
|
FfiConverterTypeTonAddressString::write(stream, arg.master);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterTonTransferAsset::allocation_size(const TonTransferAsset &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonTransferAsset::kGram>) {
|
|
uint64_t size = 0;
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonTransferAsset::kJetton>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterTypeTonAddressString::allocation_size(arg.master);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonTransferAsset visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonTransferLinkError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterTonTransferLinkError::lower(const TonTransferLinkError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonTransferLinkError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<TonTransferLinkError> FfiConverterTonTransferLinkError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
ton_transfer_link_error::NotTonTransfer var("TonTransferLinkError::NotTonTransfer");
|
|
return std::make_shared<ton_transfer_link_error::NotTonTransfer>(var);
|
|
}
|
|
case 2:
|
|
{
|
|
ton_transfer_link_error::InvalidUrl var("TonTransferLinkError::InvalidUrl");
|
|
return std::make_shared<ton_transfer_link_error::InvalidUrl>(var);
|
|
}
|
|
case 3:
|
|
{
|
|
ton_transfer_link_error::MissingRecipient var("TonTransferLinkError::MissingRecipient");
|
|
return std::make_shared<ton_transfer_link_error::MissingRecipient>(var);
|
|
}
|
|
case 4:
|
|
{
|
|
ton_transfer_link_error::InvalidRecipient var("TonTransferLinkError::InvalidRecipient");
|
|
return std::make_shared<ton_transfer_link_error::InvalidRecipient>(var);
|
|
}
|
|
case 5:
|
|
{
|
|
ton_transfer_link_error::DuplicateParameter var("TonTransferLinkError::DuplicateParameter");
|
|
var.name = FfiConverterString::read(stream);
|
|
return std::make_shared<ton_transfer_link_error::DuplicateParameter>(var);
|
|
}
|
|
case 6:
|
|
{
|
|
ton_transfer_link_error::UnsupportedParameter var("TonTransferLinkError::UnsupportedParameter");
|
|
var.name = FfiConverterString::read(stream);
|
|
return std::make_shared<ton_transfer_link_error::UnsupportedParameter>(var);
|
|
}
|
|
case 7:
|
|
{
|
|
ton_transfer_link_error::InvalidAmount var("TonTransferLinkError::InvalidAmount");
|
|
return std::make_shared<ton_transfer_link_error::InvalidAmount>(var);
|
|
}
|
|
case 8:
|
|
{
|
|
ton_transfer_link_error::InvalidExpiration var("TonTransferLinkError::InvalidExpiration");
|
|
return std::make_shared<ton_transfer_link_error::InvalidExpiration>(var);
|
|
}
|
|
case 9:
|
|
{
|
|
ton_transfer_link_error::InvalidJettonMaster var("TonTransferLinkError::InvalidJettonMaster");
|
|
return std::make_shared<ton_transfer_link_error::InvalidJettonMaster>(var);
|
|
}
|
|
case 10:
|
|
{
|
|
ton_transfer_link_error::InvalidBinaryPayload var("TonTransferLinkError::InvalidBinaryPayload");
|
|
return std::make_shared<ton_transfer_link_error::InvalidBinaryPayload>(var);
|
|
}
|
|
case 11:
|
|
{
|
|
ton_transfer_link_error::ConflictingPayloads var("TonTransferLinkError::ConflictingPayloads");
|
|
return std::make_shared<ton_transfer_link_error::ConflictingPayloads>(var);
|
|
}
|
|
case 12:
|
|
{
|
|
ton_transfer_link_error::BinaryJettonConflict var("TonTransferLinkError::BinaryJettonConflict");
|
|
return std::make_shared<ton_transfer_link_error::BinaryJettonConflict>(var);
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonTransferLinkError::write(RustStream &stream, const TonTransferLinkError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
|
|
break;
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
|
|
break;
|
|
}
|
|
case 3:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
|
|
break;
|
|
}
|
|
case 4:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
|
|
break;
|
|
}
|
|
case 5:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::DuplicateParameter&>(val);
|
|
FfiConverterString::write(stream, var.name);
|
|
break;
|
|
}
|
|
case 6:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::UnsupportedParameter&>(val);
|
|
FfiConverterString::write(stream, var.name);
|
|
break;
|
|
}
|
|
case 7:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
|
|
break;
|
|
}
|
|
case 8:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
|
|
break;
|
|
}
|
|
case 9:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
|
|
break;
|
|
}
|
|
case 10:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
|
|
break;
|
|
}
|
|
case 11:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
|
|
break;
|
|
}
|
|
case 12:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterTonTransferLinkError::allocation_size(const TonTransferLinkError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::NotTonTransfer&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidUrl&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 3:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::MissingRecipient&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 4:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidRecipient&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 5:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::DuplicateParameter&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.name));
|
|
}
|
|
case 6:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::UnsupportedParameter&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.name));
|
|
}
|
|
case 7:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidAmount&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 8:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidExpiration&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 9:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidJettonMaster&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 10:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::InvalidBinaryPayload&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 11:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::ConflictingPayloads&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 12:
|
|
{
|
|
auto var = static_cast<const ton_transfer_link_error::BinaryJettonConflict&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
TonTransferPayload FfiConverterTonTransferPayload::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterTonTransferPayload::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterTonTransferPayload::lower(const TonTransferPayload &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterTonTransferPayload::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterTonTransferPayload::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
TonTransferPayload FfiConverterTonTransferPayload::read(RustStream &stream) {
|
|
int32_t variant_id;
|
|
stream >> variant_id;
|
|
|
|
switch (variant_id) {
|
|
|
|
case 1:
|
|
return TonTransferPayload::kNone {
|
|
};
|
|
|
|
case 2:
|
|
return TonTransferPayload::kText {
|
|
.text = FfiConverterString::read(stream),
|
|
};
|
|
|
|
case 3:
|
|
return TonTransferPayload::kBoc {
|
|
.boc = FfiConverterTypeBoc::read(stream),
|
|
};
|
|
|
|
default:
|
|
throw std::runtime_error("No matching TonTransferPayload variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterTonTransferPayload::write(RustStream &stream, const TonTransferPayload &val) {
|
|
int32_t variant_id = static_cast<int32_t>(val.variant.index() + 1);
|
|
|
|
stream << variant_id;
|
|
|
|
std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
|
|
FfiConverterString::write(stream, arg.text);
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
|
|
FfiConverterTypeBoc::write(stream, arg.boc);
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
|
|
}
|
|
}, val.variant);
|
|
}
|
|
|
|
uint64_t FfiConverterTonTransferPayload::allocation_size(const TonTransferPayload &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
size += std::visit([&](auto &&arg) {
|
|
using T = std::decay_t<decltype(arg)>;
|
|
if constexpr (std::is_same_v<T, TonTransferPayload::kNone>) {
|
|
uint64_t size = 0;
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonTransferPayload::kText>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterString::allocation_size(arg.text);
|
|
return size;
|
|
}
|
|
else if constexpr (std::is_same_v<T, TonTransferPayload::kBoc>) {
|
|
uint64_t size = 0;
|
|
size += FfiConverterTypeBoc::allocation_size(arg.boc);
|
|
return size;
|
|
}
|
|
else {
|
|
static_assert(always_false_v<T>, "non-exhaustive TonTransferPayload visitor");
|
|
}
|
|
}, val.variant);
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::shared_ptr<WalletClientError> FfiConverterWalletClientError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterWalletClientError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterWalletClientError::lower(const WalletClientError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterWalletClientError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<WalletClientError> FfiConverterWalletClientError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
wallet_client_error::InvalidLocalSecretReference var("WalletClientError::InvalidLocalSecretReference");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::InvalidLocalSecretReference>(what_arg);
|
|
return ret;
|
|
}
|
|
case 2:
|
|
{
|
|
wallet_client_error::InvalidWalletPublicKey var("WalletClientError::InvalidWalletPublicKey");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::InvalidWalletPublicKey>(what_arg);
|
|
return ret;
|
|
}
|
|
case 3:
|
|
{
|
|
wallet_client_error::WalletIdentityMismatch var("WalletClientError::WalletIdentityMismatch");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::WalletIdentityMismatch>(what_arg);
|
|
return ret;
|
|
}
|
|
case 4:
|
|
{
|
|
wallet_client_error::InvalidProviderBaseUrl var("WalletClientError::InvalidProviderBaseUrl");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::InvalidProviderBaseUrl>(what_arg);
|
|
return ret;
|
|
}
|
|
case 5:
|
|
{
|
|
wallet_client_error::InvalidSendRequest var("WalletClientError::InvalidSendRequest");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::InvalidSendRequest>(what_arg);
|
|
return ret;
|
|
}
|
|
case 6:
|
|
{
|
|
wallet_client_error::NftTransferUnavailable var("WalletClientError::NftTransferUnavailable");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::NftTransferUnavailable>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 7:
|
|
{
|
|
wallet_client_error::NftTransferEmulationRejected var("WalletClientError::NftTransferEmulationRejected");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::NftTransferEmulationRejected>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 8:
|
|
{
|
|
wallet_client_error::EncryptedCommentUnavailable var("WalletClientError::EncryptedCommentUnavailable");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::EncryptedCommentUnavailable>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 9:
|
|
{
|
|
wallet_client_error::DnsResolutionUnavailable var("WalletClientError::DnsResolutionUnavailable");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::DnsResolutionUnavailable>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 10:
|
|
{
|
|
wallet_client_error::KeyRotationUnavailable var("WalletClientError::KeyRotationUnavailable");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::KeyRotationUnavailable>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 11:
|
|
{
|
|
wallet_client_error::LocalSigningUnavailable var("WalletClientError::LocalSigningUnavailable");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::LocalSigningUnavailable>(what_arg);
|
|
return ret;
|
|
}
|
|
case 12:
|
|
{
|
|
wallet_client_error::IdentifierExhausted var("WalletClientError::IdentifierExhausted");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::IdentifierExhausted>(what_arg);
|
|
return ret;
|
|
}
|
|
case 13:
|
|
{
|
|
wallet_client_error::StateUnavailable var("WalletClientError::StateUnavailable");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::StateUnavailable>(what_arg);
|
|
return ret;
|
|
}
|
|
case 14:
|
|
{
|
|
wallet_client_error::SendAlreadyInProgress var("WalletClientError::SendAlreadyInProgress");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::SendAlreadyInProgress>(what_arg);
|
|
return ret;
|
|
}
|
|
case 15:
|
|
{
|
|
wallet_client_error::SendPreviewAlreadyInProgress var("WalletClientError::SendPreviewAlreadyInProgress");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::SendPreviewAlreadyInProgress>(what_arg);
|
|
return ret;
|
|
}
|
|
case 16:
|
|
{
|
|
wallet_client_error::PreviousSubmissionUnresolved var("WalletClientError::PreviousSubmissionUnresolved");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::PreviousSubmissionUnresolved>(what_arg);
|
|
return ret;
|
|
}
|
|
case 17:
|
|
{
|
|
wallet_client_error::WalletSeqnoNotAdvanced var("WalletClientError::WalletSeqnoNotAdvanced");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::WalletSeqnoNotAdvanced>(what_arg);
|
|
return ret;
|
|
}
|
|
case 18:
|
|
{
|
|
wallet_client_error::SendAccountUnavailable var("WalletClientError::SendAccountUnavailable");
|
|
var.status = FfiConverterAccountStatus::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::SendAccountUnavailable>(what_arg);
|
|
ret->status = std::move(var.status);
|
|
return ret;
|
|
}
|
|
case 19:
|
|
{
|
|
wallet_client_error::InsufficientBalance var("WalletClientError::InsufficientBalance");
|
|
var.available_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
|
|
var.requested_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::InsufficientBalance>(what_arg);
|
|
ret->available_nanograms = std::move(var.available_nanograms);
|
|
ret->requested_nanograms = std::move(var.requested_nanograms);
|
|
return ret;
|
|
}
|
|
case 20:
|
|
{
|
|
wallet_client_error::InsufficientBalanceForFees var("WalletClientError::InsufficientBalanceForFees");
|
|
var.available_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
|
|
var.requested_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
|
|
var.estimated_fee_nanograms = FfiConverterTypeUnsignedDecimalString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::InsufficientBalanceForFees>(what_arg);
|
|
ret->available_nanograms = std::move(var.available_nanograms);
|
|
ret->requested_nanograms = std::move(var.requested_nanograms);
|
|
ret->estimated_fee_nanograms = std::move(var.estimated_fee_nanograms);
|
|
return ret;
|
|
}
|
|
case 21:
|
|
{
|
|
wallet_client_error::InvalidProtectedSecret var("WalletClientError::InvalidProtectedSecret");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::InvalidProtectedSecret>(what_arg);
|
|
return ret;
|
|
}
|
|
case 22:
|
|
{
|
|
wallet_client_error::SendPreviewFailed var("WalletClientError::SendPreviewFailed");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::SendPreviewFailed>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 23:
|
|
{
|
|
wallet_client_error::EmulationFailed var("WalletClientError::EmulationFailed");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::EmulationFailed>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 24:
|
|
{
|
|
wallet_client_error::EmulationMessageNotAccepted var("WalletClientError::EmulationMessageNotAccepted");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::EmulationMessageNotAccepted>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 25:
|
|
{
|
|
wallet_client_error::EmulationRejected var("WalletClientError::EmulationRejected");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
var.compute_exit_code = FfiConverterOptionalInt32::read(stream);
|
|
var.action_result_code = FfiConverterOptionalInt32::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::EmulationRejected>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
ret->compute_exit_code = std::move(var.compute_exit_code);
|
|
ret->action_result_code = std::move(var.action_result_code);
|
|
return ret;
|
|
}
|
|
case 26:
|
|
{
|
|
wallet_client_error::SendFailed var("WalletClientError::SendFailed");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::SendFailed>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 27:
|
|
{
|
|
wallet_client_error::SubmissionUnknown var("WalletClientError::SubmissionUnknown");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::SubmissionUnknown>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 28:
|
|
{
|
|
wallet_client_error::SendCancellationTooLate var("WalletClientError::SendCancellationTooLate");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::SendCancellationTooLate>(what_arg);
|
|
return ret;
|
|
}
|
|
case 29:
|
|
{
|
|
wallet_client_error::Shutdown var("WalletClientError::Shutdown");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::Shutdown>(what_arg);
|
|
return ret;
|
|
}
|
|
case 30:
|
|
{
|
|
wallet_client_error::EncryptedCommentLookupFailed var("WalletClientError::EncryptedCommentLookupFailed");
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletclienterror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletClientError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_client_error::EncryptedCommentLookupFailed>(what_arg);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterWalletClientError::write(RustStream &stream, const WalletClientError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
|
|
break;
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
|
|
break;
|
|
}
|
|
case 3:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
|
|
break;
|
|
}
|
|
case 4:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
|
|
break;
|
|
}
|
|
case 5:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
|
|
break;
|
|
}
|
|
case 6:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::NftTransferUnavailable&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 7:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::NftTransferEmulationRejected&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 8:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EncryptedCommentUnavailable&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 9:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::DnsResolutionUnavailable&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 10:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::KeyRotationUnavailable&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 11:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
|
|
break;
|
|
}
|
|
case 12:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
|
|
break;
|
|
}
|
|
case 13:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
|
|
break;
|
|
}
|
|
case 14:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
|
|
break;
|
|
}
|
|
case 15:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
|
|
break;
|
|
}
|
|
case 16:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
|
|
break;
|
|
}
|
|
case 17:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
|
|
break;
|
|
}
|
|
case 18:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendAccountUnavailable&>(val);
|
|
FfiConverterAccountStatus::write(stream, var.status);
|
|
break;
|
|
}
|
|
case 19:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InsufficientBalance&>(val);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, var.available_nanograms);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, var.requested_nanograms);
|
|
break;
|
|
}
|
|
case 20:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InsufficientBalanceForFees&>(val);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, var.available_nanograms);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, var.requested_nanograms);
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, var.estimated_fee_nanograms);
|
|
break;
|
|
}
|
|
case 21:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
|
|
break;
|
|
}
|
|
case 22:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendPreviewFailed&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 23:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EmulationFailed&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 24:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EmulationMessageNotAccepted&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 25:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EmulationRejected&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
FfiConverterOptionalInt32::write(stream, var.compute_exit_code);
|
|
FfiConverterOptionalInt32::write(stream, var.action_result_code);
|
|
break;
|
|
}
|
|
case 26:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendFailed&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 27:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SubmissionUnknown&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 28:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
|
|
break;
|
|
}
|
|
case 29:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::Shutdown&>(val);
|
|
break;
|
|
}
|
|
case 30:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EncryptedCommentLookupFailed&>(val);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterWalletClientError::allocation_size(const WalletClientError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidLocalSecretReference&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidWalletPublicKey&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 3:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::WalletIdentityMismatch&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 4:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidProviderBaseUrl&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 5:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidSendRequest&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 6:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::NftTransferUnavailable&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 7:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::NftTransferEmulationRejected&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 8:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EncryptedCommentUnavailable&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 9:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::DnsResolutionUnavailable&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 10:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::KeyRotationUnavailable&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 11:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::LocalSigningUnavailable&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 12:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::IdentifierExhausted&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 13:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::StateUnavailable&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 14:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendAlreadyInProgress&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 15:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendPreviewAlreadyInProgress&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 16:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::PreviousSubmissionUnresolved&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 17:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::WalletSeqnoNotAdvanced&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 18:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendAccountUnavailable&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterAccountStatus::allocation_size(var.status));
|
|
}
|
|
case 19:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InsufficientBalance&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterTypeUnsignedDecimalString::allocation_size(var.available_nanograms)
|
|
+ FfiConverterTypeUnsignedDecimalString::allocation_size(var.requested_nanograms));
|
|
}
|
|
case 20:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InsufficientBalanceForFees&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterTypeUnsignedDecimalString::allocation_size(var.available_nanograms)
|
|
+ FfiConverterTypeUnsignedDecimalString::allocation_size(var.requested_nanograms)
|
|
+ FfiConverterTypeUnsignedDecimalString::allocation_size(var.estimated_fee_nanograms));
|
|
}
|
|
case 21:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::InvalidProtectedSecret&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 22:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendPreviewFailed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 23:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EmulationFailed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 24:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EmulationMessageNotAccepted&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 25:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EmulationRejected&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic)
|
|
+ FfiConverterOptionalInt32::allocation_size(var.compute_exit_code)
|
|
+ FfiConverterOptionalInt32::allocation_size(var.action_result_code));
|
|
}
|
|
case 26:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendFailed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 27:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SubmissionUnknown&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 28:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::SendCancellationTooLate&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 29:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::Shutdown&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 30:
|
|
{
|
|
auto var = static_cast<const wallet_client_error::EncryptedCommentLookupFailed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterWalletLifecycleError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterWalletLifecycleError::lower(const WalletLifecycleError &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterWalletLifecycleError::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
std::shared_ptr<WalletLifecycleError> FfiConverterWalletLifecycleError::read(RustStream &stream) {
|
|
int32_t v;
|
|
stream >> v;
|
|
|
|
switch (v) {
|
|
case 1:
|
|
{
|
|
wallet_lifecycle_error::InvalidRecordId var("WalletLifecycleError::InvalidRecordId");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletLifecycleError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecordId>(what_arg);
|
|
return ret;
|
|
}
|
|
case 2:
|
|
{
|
|
wallet_lifecycle_error::InvalidRecoveryPhrase var("WalletLifecycleError::InvalidRecoveryPhrase");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletLifecycleError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_lifecycle_error::InvalidRecoveryPhrase>(what_arg);
|
|
return ret;
|
|
}
|
|
case 3:
|
|
{
|
|
wallet_lifecycle_error::AddressDerivationFailed var("WalletLifecycleError::AddressDerivationFailed");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletLifecycleError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_lifecycle_error::AddressDerivationFailed>(what_arg);
|
|
return ret;
|
|
}
|
|
case 4:
|
|
{
|
|
wallet_lifecycle_error::TonConnectSigningFailed var("WalletLifecycleError::TonConnectSigningFailed");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletLifecycleError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_lifecycle_error::TonConnectSigningFailed>(what_arg);
|
|
return ret;
|
|
}
|
|
case 5:
|
|
{
|
|
wallet_lifecycle_error::SecretWalletMismatch var("WalletLifecycleError::SecretWalletMismatch");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletLifecycleError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_lifecycle_error::SecretWalletMismatch>(what_arg);
|
|
return ret;
|
|
}
|
|
case 6:
|
|
{
|
|
wallet_lifecycle_error::ProtectedSecretHost var("WalletLifecycleError::ProtectedSecretHost");
|
|
var.kind = FfiConverterProtectedSecretHostErrorKind::read(stream);
|
|
var.diagnostic = FfiConverterString::read(stream);
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletLifecycleError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_lifecycle_error::ProtectedSecretHost>(what_arg);
|
|
ret->kind = std::move(var.kind);
|
|
ret->diagnostic = std::move(var.diagnostic);
|
|
return ret;
|
|
}
|
|
case 7:
|
|
{
|
|
wallet_lifecycle_error::InvalidTonConnectSessionInput var("WalletLifecycleError::InvalidTonConnectSessionInput");
|
|
auto what_arg = FfiConverterString::lift(
|
|
rust_call(
|
|
uniffi_wallet_engine_fn_method_walletlifecycleerror_uniffi_trait_display,
|
|
nullptr,
|
|
FfiConverterWalletLifecycleError::lower(var)
|
|
)
|
|
);
|
|
auto ret = std::make_shared<wallet_lifecycle_error::InvalidTonConnectSessionInput>(what_arg);
|
|
return ret;
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterWalletLifecycleError::write(RustStream &stream, const WalletLifecycleError &val) {
|
|
stream << val.get_variant_idx();
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
|
|
break;
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
|
|
break;
|
|
}
|
|
case 3:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
|
|
break;
|
|
}
|
|
case 4:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
|
|
break;
|
|
}
|
|
case 5:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
|
|
break;
|
|
}
|
|
case 6:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::ProtectedSecretHost&>(val);
|
|
FfiConverterProtectedSecretHostErrorKind::write(stream, var.kind);
|
|
FfiConverterString::write(stream, var.diagnostic);
|
|
break;
|
|
}
|
|
case 7:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterWalletLifecycleError::allocation_size(const WalletLifecycleError &val) {
|
|
switch (val.get_variant_idx()) {
|
|
case 1:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::InvalidRecordId&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 2:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::InvalidRecoveryPhrase&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 3:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::AddressDerivationFailed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 4:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::TonConnectSigningFailed&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 5:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::SecretWalletMismatch&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
case 6:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::ProtectedSecretHost&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t)
|
|
+ FfiConverterProtectedSecretHostErrorKind::allocation_size(var.kind)
|
|
+ FfiConverterString::allocation_size(var.diagnostic));
|
|
}
|
|
case 7:
|
|
{
|
|
auto var = static_cast<const wallet_lifecycle_error::InvalidTonConnectSessionInput&>(val);
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
default:
|
|
throw std::runtime_error("Unexpected error variant");
|
|
}
|
|
}
|
|
|
|
|
|
WalletOperationOutcome FfiConverterWalletOperationOutcome::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterWalletOperationOutcome::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return std::move(ret);
|
|
}
|
|
|
|
RustBuffer FfiConverterWalletOperationOutcome::lower(const WalletOperationOutcome &val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterWalletOperationOutcome::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterWalletOperationOutcome::write(stream, val);
|
|
|
|
return std::move(buf);
|
|
}
|
|
|
|
WalletOperationOutcome FfiConverterWalletOperationOutcome::read(RustStream &stream) {
|
|
int32_t variant;
|
|
stream >> variant;
|
|
|
|
switch (variant) {
|
|
|
|
case 1:
|
|
return WalletOperationOutcome::kCompleted;
|
|
|
|
case 2:
|
|
return WalletOperationOutcome::kPartiallyCompleted;
|
|
|
|
case 3:
|
|
return WalletOperationOutcome::kFailed;
|
|
|
|
case 4:
|
|
return WalletOperationOutcome::kCancelled;
|
|
|
|
case 5:
|
|
return WalletOperationOutcome::kSuperseded;
|
|
|
|
case 6:
|
|
return WalletOperationOutcome::kSkipped;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching WalletOperationOutcome variant");
|
|
}
|
|
}
|
|
|
|
void FfiConverterWalletOperationOutcome::write(RustStream &stream, const WalletOperationOutcome &val) {
|
|
switch (val) {
|
|
|
|
case WalletOperationOutcome::kCompleted:
|
|
stream << static_cast<int32_t>(1);
|
|
break;
|
|
|
|
case WalletOperationOutcome::kPartiallyCompleted:
|
|
stream << static_cast<int32_t>(2);
|
|
break;
|
|
|
|
case WalletOperationOutcome::kFailed:
|
|
stream << static_cast<int32_t>(3);
|
|
break;
|
|
|
|
case WalletOperationOutcome::kCancelled:
|
|
stream << static_cast<int32_t>(4);
|
|
break;
|
|
|
|
case WalletOperationOutcome::kSuperseded:
|
|
stream << static_cast<int32_t>(5);
|
|
break;
|
|
|
|
case WalletOperationOutcome::kSkipped:
|
|
stream << static_cast<int32_t>(6);
|
|
break;
|
|
|
|
default:
|
|
throw std::runtime_error("No matching WalletOperationOutcome variant");
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterWalletOperationOutcome::allocation_size(const WalletOperationOutcome &) {
|
|
return static_cast<uint64_t>(sizeof(int32_t));
|
|
}
|
|
|
|
std::optional<uint16_t> FfiConverterOptionalUInt16::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalUInt16::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalUInt16::lower(const std::optional<uint16_t>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalUInt16::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalUInt16::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<uint16_t> FfiConverterOptionalUInt16::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterUInt16::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalUInt16::write(RustStream &stream, const std::optional<uint16_t>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterUInt16::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalUInt16::allocation_size(const std::optional<uint16_t> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterUInt16::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<int32_t> FfiConverterOptionalInt32::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalInt32::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalInt32::lower(const std::optional<int32_t>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalInt32::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalInt32::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<int32_t> FfiConverterOptionalInt32::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterInt32::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalInt32::write(RustStream &stream, const std::optional<int32_t>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterInt32::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalInt32::allocation_size(const std::optional<int32_t> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterInt32::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<uint64_t> FfiConverterOptionalUInt64::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalUInt64::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalUInt64::lower(const std::optional<uint64_t>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalUInt64::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalUInt64::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<uint64_t> FfiConverterOptionalUInt64::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterUInt64::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalUInt64::write(RustStream &stream, const std::optional<uint64_t>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterUInt64::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalUInt64::allocation_size(const std::optional<uint64_t> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterUInt64::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<int64_t> FfiConverterOptionalInt64::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalInt64::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalInt64::lower(const std::optional<int64_t>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalInt64::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalInt64::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<int64_t> FfiConverterOptionalInt64::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterInt64::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalInt64::write(RustStream &stream, const std::optional<int64_t>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterInt64::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalInt64::allocation_size(const std::optional<int64_t> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterInt64::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<bool> FfiConverterOptionalBool::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalBool::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalBool::lower(const std::optional<bool>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalBool::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalBool::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<bool> FfiConverterOptionalBool::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterBool::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalBool::write(RustStream &stream, const std::optional<bool>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterBool::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalBool::allocation_size(const std::optional<bool> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterBool::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<std::string> FfiConverterOptionalString::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalString::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalString::lower(const std::optional<std::string>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalString::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalString::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<std::string> FfiConverterOptionalString::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterString::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalString::write(RustStream &stream, const std::optional<std::string>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterString::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalString::allocation_size(const std::optional<std::string> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterString::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalBytes::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalBytes::lower(const std::optional<std::vector<uint8_t>>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalBytes::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalBytes::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<std::vector<uint8_t>> FfiConverterOptionalBytes::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterBytes::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalBytes::write(RustStream &stream, const std::optional<std::vector<uint8_t>>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterBytes::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalBytes::allocation_size(const std::optional<std::vector<uint8_t>> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterBytes::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeAccountSnapshot::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeAccountSnapshot::lower(const std::optional<AccountSnapshot>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeAccountSnapshot::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeAccountSnapshot::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<AccountSnapshot> FfiConverterOptionalTypeAccountSnapshot::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeAccountSnapshot::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeAccountSnapshot::write(RustStream &stream, const std::optional<AccountSnapshot>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeAccountSnapshot::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeAccountSnapshot::allocation_size(const std::optional<AccountSnapshot> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeAccountSnapshot::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeActivityCursor::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeActivityCursor::lower(const std::optional<ActivityCursor>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeActivityCursor::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeActivityCursor::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<ActivityCursor> FfiConverterOptionalTypeActivityCursor::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeActivityCursor::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeActivityCursor::write(RustStream &stream, const std::optional<ActivityCursor>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeActivityCursor::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeActivityCursor::allocation_size(const std::optional<ActivityCursor> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeActivityCursor::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<DomainError> FfiConverterOptionalTypeDomainError::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeDomainError::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeDomainError::lower(const std::optional<DomainError>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeDomainError::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeDomainError::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<DomainError> FfiConverterOptionalTypeDomainError::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeDomainError::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeDomainError::write(RustStream &stream, const std::optional<DomainError>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeDomainError::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeDomainError::allocation_size(const std::optional<DomainError> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeDomainError::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeJournalRecord::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeJournalRecord::lower(const std::optional<JournalRecord>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeJournalRecord::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeJournalRecord::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<JournalRecord> FfiConverterOptionalTypeJournalRecord::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeJournalRecord::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeJournalRecord::write(RustStream &stream, const std::optional<JournalRecord>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeJournalRecord::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeJournalRecord::allocation_size(const std::optional<JournalRecord> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeJournalRecord::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeNftCollectionDescriptor::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeNftCollectionDescriptor::lower(const std::optional<NftCollectionDescriptor>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeNftCollectionDescriptor::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<NftCollectionDescriptor> FfiConverterOptionalTypeNftCollectionDescriptor::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeNftCollectionDescriptor::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeNftCollectionDescriptor::write(RustStream &stream, const std::optional<NftCollectionDescriptor>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeNftCollectionDescriptor::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeNftCollectionDescriptor::allocation_size(const std::optional<NftCollectionDescriptor> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeNftCollectionDescriptor::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeProtectedSecretRef::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeProtectedSecretRef::lower(const std::optional<ProtectedSecretRef>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeProtectedSecretRef::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeProtectedSecretRef::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<ProtectedSecretRef> FfiConverterOptionalTypeProtectedSecretRef::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeProtectedSecretRef::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeProtectedSecretRef::write(RustStream &stream, const std::optional<ProtectedSecretRef>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeProtectedSecretRef::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeProtectedSecretRef::allocation_size(const std::optional<ProtectedSecretRef> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeProtectedSecretRef::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeResolutionInfo::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeResolutionInfo::lower(const std::optional<ResolutionInfo>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeResolutionInfo::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeResolutionInfo::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<ResolutionInfo> FfiConverterOptionalTypeResolutionInfo::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeResolutionInfo::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeResolutionInfo::write(RustStream &stream, const std::optional<ResolutionInfo>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeResolutionInfo::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeResolutionInfo::allocation_size(const std::optional<ResolutionInfo> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeResolutionInfo::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeTonConnectConnectPrompt::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeTonConnectConnectPrompt::lower(const std::optional<TonConnectConnectPrompt>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeTonConnectConnectPrompt::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<TonConnectConnectPrompt> FfiConverterOptionalTypeTonConnectConnectPrompt::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeTonConnectConnectPrompt::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeTonConnectConnectPrompt::write(RustStream &stream, const std::optional<TonConnectConnectPrompt>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeTonConnectConnectPrompt::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeTonConnectConnectPrompt::allocation_size(const std::optional<TonConnectConnectPrompt> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeTonConnectConnectPrompt::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeTonConnectPreparedPost::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeTonConnectPreparedPost::lower(const std::optional<TonConnectPreparedPost>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeTonConnectPreparedPost::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<TonConnectPreparedPost> FfiConverterOptionalTypeTonConnectPreparedPost::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeTonConnectPreparedPost::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeTonConnectPreparedPost::write(RustStream &stream, const std::optional<TonConnectPreparedPost>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeTonConnectPreparedPost::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeTonConnectPreparedPost::allocation_size(const std::optional<TonConnectPreparedPost> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeTonConnectPreparedPost::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeTonConnectProofReply::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeTonConnectProofReply::lower(const std::optional<TonConnectProofReply>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonConnectProofReply::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeTonConnectProofReply::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<TonConnectProofReply> FfiConverterOptionalTypeTonConnectProofReply::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeTonConnectProofReply::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeTonConnectProofReply::write(RustStream &stream, const std::optional<TonConnectProofReply>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeTonConnectProofReply::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeTonConnectProofReply::allocation_size(const std::optional<TonConnectProofReply> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeTonConnectProofReply::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalHttpHostErrorKind::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalHttpHostErrorKind::lower(const std::optional<HttpHostErrorKind>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalHttpHostErrorKind::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalHttpHostErrorKind::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<HttpHostErrorKind> FfiConverterOptionalHttpHostErrorKind::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterHttpHostErrorKind::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalHttpHostErrorKind::write(RustStream &stream, const std::optional<HttpHostErrorKind>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterHttpHostErrorKind::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalHttpHostErrorKind::allocation_size(const std::optional<HttpHostErrorKind> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterHttpHostErrorKind::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<PendingReason> FfiConverterOptionalPendingReason::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalPendingReason::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalPendingReason::lower(const std::optional<PendingReason>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalPendingReason::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalPendingReason::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<PendingReason> FfiConverterOptionalPendingReason::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterPendingReason::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalPendingReason::write(RustStream &stream, const std::optional<PendingReason>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterPendingReason::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalPendingReason::allocation_size(const std::optional<PendingReason> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterPendingReason::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeBase64Hash::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeBase64Hash::lower(const std::optional<Base64Hash>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBase64Hash::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeBase64Hash::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<Base64Hash> FfiConverterOptionalTypeBase64Hash::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeBase64Hash::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeBase64Hash::write(RustStream &stream, const std::optional<Base64Hash>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeBase64Hash::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeBase64Hash::allocation_size(const std::optional<Base64Hash> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeBase64Hash::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<Boc> FfiConverterOptionalTypeBoc::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeBoc::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeBoc::lower(const std::optional<Boc>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeBoc::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeBoc::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<Boc> FfiConverterOptionalTypeBoc::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeBoc::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeBoc::write(RustStream &stream, const std::optional<Boc>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeBoc::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeBoc::allocation_size(const std::optional<Boc> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeBoc::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeNonEmptyString::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeNonEmptyString::lower(const std::optional<NonEmptyString>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeNonEmptyString::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeNonEmptyString::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<NonEmptyString> FfiConverterOptionalTypeNonEmptyString::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeNonEmptyString::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeNonEmptyString::write(RustStream &stream, const std::optional<NonEmptyString>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeNonEmptyString::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeNonEmptyString::allocation_size(const std::optional<NonEmptyString> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeNonEmptyString::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeTonAddressString::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeTonAddressString::lower(const std::optional<TonAddressString>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeTonAddressString::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeTonAddressString::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<TonAddressString> FfiConverterOptionalTypeTonAddressString::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeTonAddressString::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeTonAddressString::write(RustStream &stream, const std::optional<TonAddressString>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeTonAddressString::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeTonAddressString::allocation_size(const std::optional<TonAddressString> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeTonAddressString::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = FfiConverterOptionalTypeUnsignedDecimalString::read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterOptionalTypeUnsignedDecimalString::lower(const std::optional<UnsignedDecimalString>& val) {
|
|
auto buf = rustbuffer_alloc(FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
FfiConverterOptionalTypeUnsignedDecimalString::write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::optional<UnsignedDecimalString> FfiConverterOptionalTypeUnsignedDecimalString::read(RustStream &stream) {
|
|
char has_value;
|
|
|
|
stream.get(has_value);
|
|
if (has_value) {
|
|
return std::make_optional(FfiConverterTypeUnsignedDecimalString::read(stream));
|
|
} else {
|
|
return std::nullopt;
|
|
}
|
|
}
|
|
|
|
void FfiConverterOptionalTypeUnsignedDecimalString::write(RustStream &stream, const std::optional<UnsignedDecimalString>& value) {
|
|
stream.put(static_cast<uint8_t>(!!value));
|
|
|
|
if (value) {
|
|
FfiConverterTypeUnsignedDecimalString::write(stream, value.value());
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterOptionalTypeUnsignedDecimalString::allocation_size(const std::optional<UnsignedDecimalString> &val) {
|
|
uint64_t ret = 1;
|
|
|
|
if (val) {
|
|
ret += FfiConverterTypeUnsignedDecimalString::allocation_size(val.value());
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
|
|
std::vector<std::string> FfiConverterSequenceString::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceString::lower(const std::vector<std::string> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<std::string> FfiConverterSequenceString::read(RustStream &stream) {
|
|
std::vector<std::string> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterString::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceString::write(RustStream &stream, const std::vector<std::string> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterString::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceString::allocation_size(const std::vector<std::string> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterString::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeActivityItem::lower(const std::vector<ActivityItem> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<ActivityItem> FfiConverterSequenceTypeActivityItem::read(RustStream &stream) {
|
|
std::vector<ActivityItem> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeActivityItem::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeActivityItem::write(RustStream &stream, const std::vector<ActivityItem> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeActivityItem::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeActivityItem::allocation_size(const std::vector<ActivityItem> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeActivityItem::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeHttpHeader::lower(const std::vector<HttpHeader> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<HttpHeader> FfiConverterSequenceTypeHttpHeader::read(RustStream &stream) {
|
|
std::vector<HttpHeader> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeHttpHeader::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeHttpHeader::write(RustStream &stream, const std::vector<HttpHeader> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeHttpHeader::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeHttpHeader::allocation_size(const std::vector<HttpHeader> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeHttpHeader::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<NftItem> FfiConverterSequenceTypeNftItem::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeNftItem::lower(const std::vector<NftItem> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<NftItem> FfiConverterSequenceTypeNftItem::read(RustStream &stream) {
|
|
std::vector<NftItem> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeNftItem::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeNftItem::write(RustStream &stream, const std::vector<NftItem> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeNftItem::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeNftItem::allocation_size(const std::vector<NftItem> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeNftItem::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeSendEmulationAction::lower(const std::vector<SendEmulationAction> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<SendEmulationAction> FfiConverterSequenceTypeSendEmulationAction::read(RustStream &stream) {
|
|
std::vector<SendEmulationAction> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeSendEmulationAction::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeSendEmulationAction::write(RustStream &stream, const std::vector<SendEmulationAction> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeSendEmulationAction::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeSendEmulationAction::allocation_size(const std::vector<SendEmulationAction> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeSendEmulationAction::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeSendEmulationTransaction::lower(const std::vector<SendEmulationTransaction> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<SendEmulationTransaction> FfiConverterSequenceTypeSendEmulationTransaction::read(RustStream &stream) {
|
|
std::vector<SendEmulationTransaction> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeSendEmulationTransaction::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeSendEmulationTransaction::write(RustStream &stream, const std::vector<SendEmulationTransaction> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeSendEmulationTransaction::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeSendEmulationTransaction::allocation_size(const std::vector<SendEmulationTransaction> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeSendEmulationTransaction::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeSendMessage::lower(const std::vector<SendMessage> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<SendMessage> FfiConverterSequenceTypeSendMessage::read(RustStream &stream) {
|
|
std::vector<SendMessage> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeSendMessage::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeSendMessage::write(RustStream &stream, const std::vector<SendMessage> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeSendMessage::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeSendMessage::allocation_size(const std::vector<SendMessage> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeSendMessage::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceMnemonicScheme::lower(const std::vector<MnemonicScheme> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<MnemonicScheme> FfiConverterSequenceMnemonicScheme::read(RustStream &stream) {
|
|
std::vector<MnemonicScheme> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterMnemonicScheme::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceMnemonicScheme::write(RustStream &stream, const std::vector<MnemonicScheme> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterMnemonicScheme::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceMnemonicScheme::allocation_size(const std::vector<MnemonicScheme> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterMnemonicScheme::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTonConnectIncomingRequest::lower(const std::vector<TonConnectIncomingRequest> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<TonConnectIncomingRequest> FfiConverterSequenceTonConnectIncomingRequest::read(RustStream &stream) {
|
|
std::vector<TonConnectIncomingRequest> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTonConnectIncomingRequest::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTonConnectIncomingRequest::write(RustStream &stream, const std::vector<TonConnectIncomingRequest> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTonConnectIncomingRequest::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTonConnectIncomingRequest::allocation_size(const std::vector<TonConnectIncomingRequest> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTonConnectIncomingRequest::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeBase64Hash::lower(const std::vector<Base64Hash> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<Base64Hash> FfiConverterSequenceTypeBase64Hash::read(RustStream &stream) {
|
|
std::vector<Base64Hash> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeBase64Hash::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeBase64Hash::write(RustStream &stream, const std::vector<Base64Hash> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeBase64Hash::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeBase64Hash::allocation_size(const std::vector<Base64Hash> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeBase64Hash::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterSequenceTypeTonAddressString::lower(const std::vector<TonAddressString> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::vector<TonAddressString> FfiConverterSequenceTypeTonAddressString::read(RustStream &stream) {
|
|
std::vector<TonAddressString> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.push_back(FfiConverterTypeTonAddressString::read(stream));
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterSequenceTypeTonAddressString::write(RustStream &stream, const std::vector<TonAddressString> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &elem : val) {
|
|
FfiConverterTypeTonAddressString::write(stream, elem);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterSequenceTypeTonAddressString::allocation_size(const std::vector<TonAddressString> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &elem : val) {
|
|
size += FfiConverterTypeTonAddressString::allocation_size(elem);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
std::unordered_map<std::string, std::string> FfiConverterMapStringString::lift(RustBuffer buf) {
|
|
auto stream = RustStream(&buf);
|
|
auto ret = read(stream);
|
|
|
|
rustbuffer_free(buf);
|
|
|
|
return ret;
|
|
}
|
|
|
|
RustBuffer FfiConverterMapStringString::lower(const std::unordered_map<std::string, std::string> &val) {
|
|
auto buf = rustbuffer_alloc(allocation_size(val));
|
|
auto stream = RustStream(&buf);
|
|
|
|
write(stream, val);
|
|
|
|
return buf;
|
|
}
|
|
|
|
std::unordered_map<std::string, std::string> FfiConverterMapStringString::read(RustStream &stream) {
|
|
std::unordered_map<std::string, std::string> ret;
|
|
int32_t count;
|
|
stream >> count;
|
|
|
|
ret.reserve(count);
|
|
|
|
for (decltype(count) i = 0; i < count; i++) {
|
|
ret.insert({ FfiConverterString::read(stream), FfiConverterString::read(stream) });
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
void FfiConverterMapStringString::write(RustStream &stream, const std::unordered_map<std::string, std::string> &val) {
|
|
stream << static_cast<int32_t>(val.size());
|
|
|
|
for (auto &entry : val) {
|
|
FfiConverterString::write(stream, entry.first);
|
|
FfiConverterString::write(stream, entry.second);
|
|
}
|
|
}
|
|
|
|
uint64_t FfiConverterMapStringString::allocation_size(const std::unordered_map<std::string, std::string> &val) {
|
|
uint64_t size = sizeof(int32_t);
|
|
|
|
for (auto &entry : val) {
|
|
size += FfiConverterString::allocation_size(entry.first);
|
|
size += FfiConverterString::allocation_size(entry.second);
|
|
}
|
|
|
|
return size;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
ParsedTonTransferLink parse_ton_transfer_link(const std::string &value) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_parse_ton_transfer_link,
|
|
uniffi::FfiConverterTonTransferLinkError::lift, uniffi::FfiConverterString::lower(value));
|
|
|
|
return uniffi::FfiConverterTypeParsedTonTransferLink::lift(ret);
|
|
}
|
|
|
|
|
|
TonConnectManifest parse_ton_connect_manifest(const std::string &json) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_parse_ton_connect_manifest,
|
|
uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(json));
|
|
|
|
return uniffi::FfiConverterTypeTonConnectManifest::lift(ret);
|
|
}
|
|
|
|
|
|
std::shared_ptr<TonConnectSession> ton_connect_session_from_link(const std::string &link, const TonConnectSessionConfig &config) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_ton_connect_session_from_link,
|
|
uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(link), uniffi::FfiConverterTypeTonConnectSessionConfig::lower(config));
|
|
|
|
return uniffi::FfiConverterTonConnectSession::lift(ret);
|
|
}
|
|
|
|
|
|
std::shared_ptr<TonConnectSession> ton_connect_session_restore(const std::string &persisted, const TonConnectSessionConfig &config) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_ton_connect_session_restore,
|
|
uniffi::FfiConverterTonConnectSessionError::lift, uniffi::FfiConverterString::lower(persisted), uniffi::FfiConverterTypeTonConnectSessionConfig::lower(config));
|
|
|
|
return uniffi::FfiConverterTonConnectSession::lift(ret);
|
|
}
|
|
|
|
|
|
std::string convert_ton_address(const std::string &value, TonAddressFormat format) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_convert_ton_address,
|
|
uniffi::FfiConverterTonAddressError::lift, uniffi::FfiConverterString::lower(value), uniffi::FfiConverterTonAddressFormat::lower(format));
|
|
|
|
return uniffi::FfiConverterString::lift(ret);
|
|
}
|
|
|
|
|
|
bool is_valid_ton_address(const std::string &value) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_is_valid_ton_address,
|
|
nullptr, uniffi::FfiConverterString::lower(value));
|
|
|
|
return uniffi::FfiConverterBool::lift(ret);
|
|
}
|
|
|
|
|
|
TonAddressInfo parse_ton_address(const std::string &value) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_parse_ton_address,
|
|
uniffi::FfiConverterTonAddressError::lift, uniffi::FfiConverterString::lower(value));
|
|
|
|
return uniffi::FfiConverterTypeTonAddressInfo::lift(ret);
|
|
}
|
|
|
|
|
|
std::vector<std::string> mnemonic_wordlist() {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_mnemonic_wordlist,
|
|
nullptr);
|
|
|
|
return uniffi::FfiConverterSequenceString::lift(ret);
|
|
}
|
|
|
|
|
|
std::vector<MnemonicScheme> detect_mnemonic_schemes(const std::vector<std::string> &words) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_detect_mnemonic_schemes,
|
|
nullptr, uniffi::FfiConverterSequenceString::lower(words));
|
|
|
|
return uniffi::FfiConverterSequenceMnemonicScheme::lift(ret);
|
|
}
|
|
|
|
|
|
std::vector<uint8_t> rotation_mnemonic_public_key(const std::string &phrase) {
|
|
auto ret =
|
|
uniffi::rust_call(
|
|
uniffi_wallet_engine_fn_func_rotation_mnemonic_public_key,
|
|
uniffi::FfiConverterWalletLifecycleError::lift, uniffi::FfiConverterString::lower(phrase));
|
|
|
|
return uniffi::FfiConverterBytes::lift(ret);
|
|
}
|
|
} // namespace wallet_engine
|