diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 47810a88..9d5814a6 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -42,34 +42,6 @@ jobs: cd ~/play-unreal-plugin make RunUAT - Unreal_Build_5_0: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - - name: Setup - run: | - sudo chmod 777 $GITHUB_WORKSPACE - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo rm -rf /usr/local/lib/android - mv ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs.legacy ./Source/ThirdParty/PlayCppSdkLibrary/PlayCppSdkLibrary.Build.cs - TARGET=5.0 make - python change_version.py 5.0.0 - - - uses: addnab/docker-run-action@v3 - with: - registry: ghcr.io - username: ${{ secrets.USER }} - password: ${{ secrets.PAT }} - image: ghcr.io/epicgames/unreal-engine:dev-slim-5.0 - options: -v ${{ github.workspace }}:/home/ue4/play-unreal-plugin -e HOME=/home/ue4 - run: | - cd ~/play-unreal-plugin - make RunUAT - Unreal_Build_5_1: runs-on: ubuntu-22.04 steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c5a7786..35943ea3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ ## [Unreleased] -## [v0.0.13-alpha] - 2023-6-12 +## [v0.0.13-alpha] - 2023-6-15 - Support apple arm64 - Support Unreal Engine 5.2.0 +- Update play-cpp-sdk headerfiles + ## [v0.0.12-alpha] - 2023-5-04 - Support sending transactions using Metamask and Crypto.com Defi Wallet - Use play-cpp-sdk v0.0.19-alpha diff --git a/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp b/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp index 42bb0d12..fd7a339f 100644 --- a/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp +++ b/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp @@ -27,6 +27,7 @@ ::com::crypto::game_sdk::WalletconnectClient *APlayCppSdkActor::_coreClient = class UserWalletConnectCallback : public WalletConnectCallback { private: APlayCppSdkActor *PlayCppSdkPtr; + public: UserWalletConnectCallback(APlayCppSdkActor *PlayCppSdkPtr); void onConnected(const WalletConnectSessionInfo &sessioninfo) const; @@ -57,7 +58,8 @@ void UserWalletConnectCallback::onConnected( // NOLINT : flase positive, virtual sessioninfo, EWalletconnectSessionState::StateConnected)); }); } else { - UE_LOG(LogTemp, Error, TEXT("Can not find PlayCppSdkActor onConnected")); + UE_LOG(LogTemp, Error, + TEXT("Can not find PlayCppSdkActor onConnected")); } } void UserWalletConnectCallback::onDisconnected( // NOLINT : flase positive, @@ -129,7 +131,6 @@ void UserWalletConnectCallback::onUpdated( // NOLINT : flase positive, virtual } } - // Sets default values APlayCppSdkActor::APlayCppSdkActor() { // Set this actor to call Tick() every frame. You can turn this off to @@ -774,7 +775,6 @@ void APlayCppSdkActor::SendEip155Transaction( }); } - void APlayCppSdkActor::destroyCoreClient() { if (_coreClient != NULL) { UE_LOG(LogTemp, Log, TEXT("PlayCppSdkActor destroyCoreClient")); @@ -803,34 +803,35 @@ void APlayCppSdkActor::Erc721TransferFrom( if (fromAddress.IsEmpty()) return; - AsyncTask( - ENamedThreads::AnyHiPriThreadNormalTask, - [this, Out, contractAddress, fromAddress, toAddress, tokenId, gasLimit, - gasPrice, fromAddressArray]() { - FWalletSendTXEip155Result txresult; - try { - if (NULL == _coreClient) { - txresult.result = TEXT("Invalid Walletconnect"); - } else { - WalletConnectTxCommon common; - setCommon(common, gasLimit, gasPrice); - copyVecToTArray(_coreClient->send_contract_transaction( - Erc721TransferFromAction( - contractAddress, fromAddress, - toAddress, tokenId), - common, fromAddressArray), - txresult.tx_hash); - } + AsyncTask(ENamedThreads::AnyHiPriThreadNormalTask, + [this, Out, contractAddress, fromAddress, toAddress, tokenId, + gasLimit, gasPrice, fromAddressArray]() { + FWalletSendTXEip155Result txresult; + try { + if (NULL == _coreClient) { + txresult.result = TEXT("Invalid Walletconnect"); + } else { + WalletConnectTxCommon common; + setCommon(common, gasLimit, gasPrice); + copyVecToTArray( + _coreClient->send_contract_transaction( + Erc721TransferFromAction(contractAddress, + fromAddress, + toAddress, tokenId), + common, fromAddressArray), + txresult.tx_hash); + } - } catch (const std::exception &e) { - txresult.result = FString::Printf( - TEXT("CronosPlayUnreal Erc721TransferFrom Error: %s"), - UTF8_TO_TCHAR(e.what())); - } + } catch (const std::exception &e) { + txresult.result = FString::Printf( + TEXT("CronosPlayUnreal Erc721TransferFrom Error: %s"), + UTF8_TO_TCHAR(e.what())); + } - AsyncTask(ENamedThreads::GameThread, - [Out, txresult]() { Out.ExecuteIfBound(txresult); }); - }); + AsyncTask(ENamedThreads::GameThread, [Out, txresult]() { + Out.ExecuteIfBound(txresult); + }); + }); } void APlayCppSdkActor::Erc721SafeTransferFrom( @@ -1141,42 +1142,44 @@ void APlayCppSdkActor::Erc20TransferFrom( // if no fromAddress, return if (fromAddress.IsEmpty()) return; - AsyncTask( - ENamedThreads::AnyHiPriThreadNormalTask, - [this, Out, contractAddress, fromAddress, toAddress, amount, gasLimit, - gasPrice, fromAddressArray]() { - FWalletSendTXEip155Result txresult; - try { - if (NULL == _coreClient) { - txresult.result = TEXT("Invalid Walletconnect"); - } else { + AsyncTask(ENamedThreads::AnyHiPriThreadNormalTask, + [this, Out, contractAddress, fromAddress, toAddress, amount, + gasLimit, gasPrice, fromAddressArray]() { + FWalletSendTXEip155Result txresult; + try { + if (NULL == _coreClient) { + txresult.result = TEXT("Invalid Walletconnect"); + } else { - WalletConnectTxCommon common; - setCommon(common, gasLimit, gasPrice); - copyVecToTArray(_coreClient->send_contract_transaction( - Erc20TransferFromAction( - contractAddress, fromAddress, - toAddress, amount), - common, fromAddressArray), - txresult.tx_hash); - } + WalletConnectTxCommon common; + setCommon(common, gasLimit, gasPrice); + copyVecToTArray( + _coreClient->send_contract_transaction( + Erc20TransferFromAction(contractAddress, + fromAddress, + toAddress, amount), + common, fromAddressArray), + txresult.tx_hash); + } - } catch (const std::exception &e) { - txresult.result = FString::Printf( - TEXT("CronosPlayUnreal Erc20TransferFrom Error: %s"), - UTF8_TO_TCHAR(e.what())); - } + } catch (const std::exception &e) { + txresult.result = FString::Printf( + TEXT("CronosPlayUnreal Erc20TransferFrom Error: %s"), + UTF8_TO_TCHAR(e.what())); + } - AsyncTask(ENamedThreads::GameThread, - [Out, txresult]() { Out.ExecuteIfBound(txresult); }); - }); + AsyncTask(ENamedThreads::GameThread, [Out, txresult]() { + Out.ExecuteIfBound(txresult); + }); + }); } void APlayCppSdkActor::setCommon(WalletConnectTxCommon &common, FString gaslimit, FString gasprice) { // std::string mycronosrpc = TCHAR_TO_UTF8(*myCronosRpc); // common.web3api_url = mycronosrpc.c_str(); // uncessary - common.web3api_url = "https://evm-dev-t3.cronos.org"; // uncessary, placeholder + common.web3api_url = + "https://evm-dev-t3.cronos.org"; // uncessary, placeholder common.chainid = (uint64)GetChainId(); common.gas_limit = TCHAR_TO_UTF8(*gaslimit); common.gas_price = TCHAR_TO_UTF8(*gasprice); diff --git a/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h b/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h index bdaede15..ac5c992e 100644 --- a/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h +++ b/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h @@ -260,7 +260,8 @@ class CRONOSPLAYUNREAL_API APlayCppSdkActor : public AActor { EConnectionType _connection_type = EConnectionType::URI_STRING; /** - * SetupCallback delegate, called after calling `SetupCallback` internally, it does not expose to blueprint + * SetupCallback delegate, called after calling `SetupCallback` internally, + * it does not expose to blueprint */ FWalletconnectSessionInfoDelegate OnSetupCallbackDelegate; @@ -698,39 +699,39 @@ class CRONOSPLAYUNREAL_API APlayCppSdkActor : public AActor { FCronosSendContractTransactionDelegate Out); rust::string Erc721TransferFromAction(FString contract_address, - FString from_address, - FString to_address, FString token_id); + FString from_address, + FString to_address, FString token_id); rust::string Erc721SafeTransferFromAction(FString contract_address, - FString from_address, - FString to_address, - FString token_id); + FString from_address, + FString to_address, + FString token_id); rust::string Erc721SafeTransferFromWithAdditionalDataAction( FString contract_address, FString from_address, FString to_address, FString token_id, TArray additional_data); rust::string Erc1155SafeTransferFromAction(FString contract_address, - FString from_address, - FString to_address, - FString token_id, FString amount, - TArray additional_data); + FString from_address, + FString to_address, + FString token_id, FString amount, + TArray additional_data); rust::string Erc20ApprovalAction(FString contract_address, - FString approved_address, FString amount); + FString approved_address, FString amount); rust::string Erc721ApprovalAction(FString contract_address, - FString approved_address, - FString token_id); + FString approved_address, + FString token_id); rust::string Erc721SetApprovalForAllAction(FString contract_address, - FString approved_address, - bool approved); + FString approved_address, + bool approved); rust::string Erc1155ApprovalAction(FString contract_address, - FString approved_address, bool approved); + FString approved_address, bool approved); rust::string Erc20TransferAction(FString contract_address, - FString to_address, FString amount); + FString to_address, FString amount); rust::string Erc20TransferFromAction(FString contract_address, - FString from_address, - FString to_address, FString amount); + FString from_address, + FString to_address, FString amount); }; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/android.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/android.cc index 98f8e3e1..673adae7 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/android.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/android.cc @@ -87,4 +87,4 @@ rust::String secureStorageRead(rust::String userkey) { } // namespace defi_wallet_core } // namespace org -#endif \ No newline at end of file +#endif diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/android.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/android.h index 4185b75c..e06c1512 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/android.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/android.h @@ -11,4 +11,4 @@ int secureStorageWrite(rust::String userkey, rust::String uservalue); rust::String secureStorageRead(rust::String userkey); } // namespace defi_wallet_core } // namespace org -#endif \ No newline at end of file +#endif diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc index 92c2434f..f96b90f7 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc @@ -679,9 +679,7 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { - using type = void; -}; +template struct make_void { using type = void; }; template using void_t = typename make_void::type; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc index f87dd975..9d68f99a 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc @@ -868,9 +868,7 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { - using type = void; -}; +template struct make_void { using type = void; }; template using void_t = typename make_void::type; @@ -1421,6 +1419,29 @@ ::rust::repr::PtrLen org$defi_wallet_core$cxxbridge1$get_eth_balance( ::rust::repr::PtrLen org$defi_wallet_core$cxxbridge1$get_eth_nonce( ::rust::Str address, ::rust::Str api_url, ::rust::String *return$) noexcept; +::rust::repr::PtrLen org$defi_wallet_core$cxxbridge1$get_block_number_blocking( + ::rust::String *api_url, ::rust::String *return$) noexcept; + +::rust::repr::PtrLen +org$defi_wallet_core$cxxbridge1$get_eth_transaction_receipt_by_vec_blocking( + ::rust::Vec<::std::uint8_t> *tx_hash, ::rust::String *api_url, + ::rust::String *return$) noexcept; + +::rust::repr::PtrLen +org$defi_wallet_core$cxxbridge1$get_eth_transaction_receipt_by_string_blocking( + ::rust::String *tx_hash, ::rust::String *api_url, + ::rust::String *return$) noexcept; + +::rust::repr::PtrLen +org$defi_wallet_core$cxxbridge1$wait_for_transaction_receipt_by_vec_blocking( + ::rust::Vec<::std::uint8_t> *tx_hash, ::rust::String *api_url, + ::rust::String *return$) noexcept; + +::rust::repr::PtrLen +org$defi_wallet_core$cxxbridge1$wait_for_transaction_receipt_by_string_blocking( + ::rust::String *tx_hash, ::rust::String *api_url, + ::rust::String *return$) noexcept; + ::rust::repr::PtrLen org$defi_wallet_core$cxxbridge1$broadcast_eth_signed_raw_tx( ::rust::Vec<::std::uint8_t> *raw_tx, ::rust::Str web3api_url, @@ -1984,6 +2005,71 @@ ::rust::String get_eth_nonce(::rust::Str address, ::rust::Str api_url) { return ::std::move(return$.value); } +::rust::String get_block_number_blocking(::rust::String api_url) { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + org$defi_wallet_core$cxxbridge1$get_block_number_blocking( + &api_url, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + +::rust::String +get_eth_transaction_receipt_blocking(::rust::Vec<::std::uint8_t> tx_hash, + ::rust::String api_url) { + ::rust::ManuallyDrop<::rust::Vec<::std::uint8_t>> tx_hash$( + ::std::move(tx_hash)); + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + org$defi_wallet_core$cxxbridge1$get_eth_transaction_receipt_by_vec_blocking( + &tx_hash$.value, &api_url, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + +::rust::String get_eth_transaction_receipt_blocking(::rust::String tx_hash, + ::rust::String api_url) { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + org$defi_wallet_core$cxxbridge1$get_eth_transaction_receipt_by_string_blocking( + &tx_hash, &api_url, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + +::rust::String +wait_for_transaction_receipt_blocking(::rust::Vec<::std::uint8_t> tx_hash, + ::rust::String api_url) { + ::rust::ManuallyDrop<::rust::Vec<::std::uint8_t>> tx_hash$( + ::std::move(tx_hash)); + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + org$defi_wallet_core$cxxbridge1$wait_for_transaction_receipt_by_vec_blocking( + &tx_hash$.value, &api_url, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + +::rust::String wait_for_transaction_receipt_blocking(::rust::String tx_hash, + ::rust::String api_url) { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + org$defi_wallet_core$cxxbridge1$wait_for_transaction_receipt_by_string_blocking( + &tx_hash, &api_url, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + /// broadcast signed cronos tx /// ::org::defi_wallet_core::CronosTransactionReceiptRaw diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc index 7d84c912..f6156d30 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc @@ -868,9 +868,7 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { - using type = void; -}; +template struct make_void { using type = void; }; template using void_t = typename make_void::type; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h index b1e527e5..907e64b8 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h @@ -1289,6 +1289,22 @@ ::org::defi_wallet_core::U256 get_eth_balance(::rust::Str address, /// sent from it. ::rust::String get_eth_nonce(::rust::Str address, ::rust::Str api_url); +::rust::String get_block_number_blocking(::rust::String api_url); + +::rust::String +get_eth_transaction_receipt_blocking(::rust::Vec<::std::uint8_t> tx_hash, + ::rust::String api_url); + +::rust::String get_eth_transaction_receipt_blocking(::rust::String tx_hash, + ::rust::String api_url); + +::rust::String +wait_for_transaction_receipt_blocking(::rust::Vec<::std::uint8_t> tx_hash, + ::rust::String api_url); + +::rust::String wait_for_transaction_receipt_blocking(::rust::String tx_hash, + ::rust::String api_url); + /// broadcast signed cronos tx /// ::org::defi_wallet_core::CronosTransactionReceiptRaw diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc index 7d7c4c63..00267d3f 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc @@ -822,9 +822,7 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { - using type = void; -}; +template struct make_void { using type = void; }; template using void_t = typename make_void::type; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc index 86f6bfc4..2a3ca59a 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc @@ -950,12 +950,16 @@ struct WalletConnectTxCommon; struct WalletConnectTxEip155; struct WalletConnectAddress; struct WalletConnectEnsureSessionResult; +struct WalletConnect2Eip155Accounts; +struct WalletConnect2Eip155; +struct WalletConnect2EnsureSessionResult; struct CryptoComPaymentResponse; struct RawTxDetail; struct RawTokenResult; struct TokenHolderDetail; enum class QueryOption : ::std::uint8_t; struct WalletconnectClient; +struct Walletconnect2Client; using OptionalArguments = ::com::crypto::game_sdk::OptionalArguments; } // namespace game_sdk } // namespace crypto @@ -1108,6 +1112,36 @@ struct WalletConnectEnsureSessionResult final { }; #endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnectEnsureSessionResult +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155Accounts +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155Accounts +struct WalletConnect2Eip155Accounts final { + ::com::crypto::game_sdk::WalletConnectAddress address; + ::std::uint64_t chain_id; + + using IsRelocatable = ::std::true_type; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155Accounts + +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155 +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155 +struct WalletConnect2Eip155 final { + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> accounts; + ::rust::Vec<::rust::String> methods; + ::rust::Vec<::rust::String> events; + + using IsRelocatable = ::std::true_type; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155 + +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2EnsureSessionResult +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2EnsureSessionResult +struct WalletConnect2EnsureSessionResult final { + ::com::crypto::game_sdk::WalletConnect2Eip155 eip155; + + using IsRelocatable = ::std::true_type; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2EnsureSessionResult + #ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$CryptoComPaymentResponse #define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$CryptoComPaymentResponse /// the subset of payment object from https://pay-docs.crypto.com @@ -1339,6 +1373,50 @@ struct WalletconnectClient final : public ::rust::Opaque { }; #endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletconnectClient +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$Walletconnect2Client +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$Walletconnect2Client +struct Walletconnect2Client final : public ::rust::Opaque { + ::com::crypto::game_sdk::WalletConnect2EnsureSessionResult + ensure_session_blocking(::std::uint64_t waitmillis); + ::rust::String poll_events_blocking(::std::uint64_t waitmillis); + ::rust::String get_connection_string(); + ::rust::String save_client(); + ::rust::String print_uri(); + ::rust::Vec<::std::uint8_t> + sign_personal_blocking(::rust::String message, + ::std::array<::std::uint8_t, 20> address); + ::rust::String ping_blocking(::std::uint64_t waitmillis); + ::rust::Vec<::std::uint8_t> sign_eip155_transaction_blocking( + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> send_eip155_transaction_blocking( + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> + sign_transaction(::rust::String eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> + send_transaction(::rust::String eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> sign_contract_transaction( + ::rust::String contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> send_contract_transaction( + ::rust::String contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> address); + ~Walletconnect2Client() = delete; + + private: + friend ::rust::layout; + struct layout { + static ::std::size_t size() noexcept; + static ::std::size_t align() noexcept; + }; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$Walletconnect2Client + extern "C" { void com$crypto$game_sdk$cxxbridge1$WalletConnectCallback$onConnected( ::com::crypto::game_sdk::WalletConnectCallback const &self, @@ -1511,6 +1589,10 @@ ::std::size_t com$crypto$game_sdk$cxxbridge1$WalletconnectClient$operator$sizeof() noexcept; ::std::size_t com$crypto$game_sdk$cxxbridge1$WalletconnectClient$operator$alignof() noexcept; +::std::size_t +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$operator$sizeof() noexcept; +::std::size_t +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$operator$alignof() noexcept; ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$walletconnect_restore_client( @@ -1518,6 +1600,12 @@ com$crypto$game_sdk$cxxbridge1$walletconnect_restore_client( ::rust::Box<::com::crypto::game_sdk::WalletconnectClient> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$walletconnect2_restore_client( + ::rust::String *session_info, + ::rust::Box<::com::crypto::game_sdk::Walletconnect2Client> + *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$walletconnect_new_client( ::rust::String *description, ::rust::String *url, ::rust::Vec<::rust::String> *icon_urls, ::rust::String *name, @@ -1525,6 +1613,12 @@ ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$walletconnect_new_client( ::rust::Box<::com::crypto::game_sdk::WalletconnectClient> *return$) noexcept; +::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$walletconnect2_client_new( + ::rust::String *relayserver, ::rust::String *project_id, + ::rust::String *required_namespaces, ::rust::String *client_meta, + ::rust::Box<::com::crypto::game_sdk::Walletconnect2Client> + *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$setup_callback_blocking( ::com::crypto::game_sdk::WalletconnectClient &self, @@ -1536,27 +1630,65 @@ com$crypto$game_sdk$cxxbridge1$WalletconnectClient$ensure_session_blocking( ::com::crypto::game_sdk::WalletConnectEnsureSessionResult *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$ensure_session_blocking( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::std::uint64_t waitmillis, + ::com::crypto::game_sdk::WalletConnect2EnsureSessionResult + *return$) noexcept; + +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$poll_events_blocking( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::std::uint64_t waitmillis, ::rust::String *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$get_connection_string( ::com::crypto::game_sdk::WalletconnectClient &self, ::rust::String *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$get_connection_string( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$save_client( ::com::crypto::game_sdk::WalletconnectClient &self, ::rust::String *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$save_client( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$print_uri( ::com::crypto::game_sdk::WalletconnectClient &self, ::rust::String *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$print_uri( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$sign_personal_blocking( ::com::crypto::game_sdk::WalletconnectClient &self, ::rust::String *message, ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_personal_blocking( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *message, ::std::array<::std::uint8_t, 20> *address, + ::rust::Vec<::std::uint8_t> *return$) noexcept; + +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$ping_blocking( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::std::uint64_t waitmillis, ::rust::String *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$sign_eip155_transaction_blocking( ::com::crypto::game_sdk::WalletconnectClient &self, @@ -1564,6 +1696,13 @@ com$crypto$game_sdk$cxxbridge1$WalletconnectClient$sign_eip155_transaction_block ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_eip155_transaction_blocking( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> *address, + ::rust::Vec<::std::uint8_t> *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$send_eip155_transaction_blocking( ::com::crypto::game_sdk::WalletconnectClient &self, @@ -1571,6 +1710,13 @@ com$crypto$game_sdk$cxxbridge1$WalletconnectClient$send_eip155_transaction_block ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$send_eip155_transaction_blocking( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> *address, + ::rust::Vec<::std::uint8_t> *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$sign_transaction( ::com::crypto::game_sdk::WalletconnectClient &self, @@ -1578,6 +1724,13 @@ com$crypto$game_sdk$cxxbridge1$WalletconnectClient$sign_transaction( ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_transaction( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> *address, + ::rust::Vec<::std::uint8_t> *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$send_transaction( ::com::crypto::game_sdk::WalletconnectClient &self, @@ -1585,6 +1738,13 @@ com$crypto$game_sdk$cxxbridge1$WalletconnectClient$send_transaction( ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$send_transaction( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> *address, + ::rust::Vec<::std::uint8_t> *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$sign_contract_transaction( ::com::crypto::game_sdk::WalletconnectClient &self, @@ -1593,6 +1753,14 @@ com$crypto$game_sdk$cxxbridge1$WalletconnectClient$sign_contract_transaction( ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_contract_transaction( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> *address, + ::rust::Vec<::std::uint8_t> *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$WalletconnectClient$send_contract_transaction( ::com::crypto::game_sdk::WalletconnectClient &self, @@ -1601,6 +1769,14 @@ com$crypto$game_sdk$cxxbridge1$WalletconnectClient$send_contract_transaction( ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$send_contract_transaction( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> *address, + ::rust::Vec<::std::uint8_t> *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$get_transaction_history_blocking( ::rust::String *address, ::rust::String *api_key, @@ -1821,6 +1997,14 @@ ::std::size_t WalletconnectClient::layout::align() noexcept { return com$crypto$game_sdk$cxxbridge1$WalletconnectClient$operator$alignof(); } +::std::size_t Walletconnect2Client::layout::size() noexcept { + return com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$operator$sizeof(); +} + +::std::size_t Walletconnect2Client::layout::align() noexcept { + return com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$operator$alignof(); +} + /// restore walletconnect-session from string /// ::rust::Box<::com::crypto::game_sdk::WalletconnectClient> @@ -1837,6 +2021,20 @@ walletconnect_restore_client(::rust::String session_info) { return ::std::move(return$.value); } +::rust::Box<::com::crypto::game_sdk::Walletconnect2Client> +walletconnect2_restore_client(::rust::String session_info) { + ::rust::MaybeUninit< + ::rust::Box<::com::crypto::game_sdk::Walletconnect2Client>> + return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$walletconnect2_restore_client( + &session_info, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + /// create walletconnect-session /// the chain id (if 0, retrived and decided by wallet, if > 0, decided by the /// client) @@ -1859,6 +2057,23 @@ walletconnect_new_client(::rust::String description, ::rust::String url, return ::std::move(return$.value); } +::rust::Box<::com::crypto::game_sdk::Walletconnect2Client> +walletconnect2_client_new(::rust::String relayserver, ::rust::String project_id, + ::rust::String required_namespaces, + ::rust::String client_meta) { + ::rust::MaybeUninit< + ::rust::Box<::com::crypto::game_sdk::Walletconnect2Client>> + return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$walletconnect2_client_new( + &relayserver, &project_id, &required_namespaces, &client_meta, + &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + void WalletconnectClient::setup_callback_blocking( ::std::unique_ptr<::com::crypto::game_sdk::WalletConnectCallback> usercallback) { @@ -1884,6 +2099,32 @@ WalletconnectClient::ensure_session_blocking() { return ::std::move(return$.value); } +::com::crypto::game_sdk::WalletConnect2EnsureSessionResult +Walletconnect2Client::ensure_session_blocking(::std::uint64_t waitmillis) { + ::rust::MaybeUninit< + ::com::crypto::game_sdk::WalletConnect2EnsureSessionResult> + return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$ensure_session_blocking( + *this, waitmillis, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + +::rust::String +Walletconnect2Client::poll_events_blocking(::std::uint64_t waitmillis) { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$poll_events_blocking( + *this, waitmillis, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::String WalletconnectClient::get_connection_string() { ::rust::MaybeUninit<::rust::String> return$; ::rust::repr::PtrLen error$ = @@ -1895,6 +2136,17 @@ ::rust::String WalletconnectClient::get_connection_string() { return ::std::move(return$.value); } +::rust::String Walletconnect2Client::get_connection_string() { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$get_connection_string( + *this, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::String WalletconnectClient::save_client() { ::rust::MaybeUninit<::rust::String> return$; ::rust::repr::PtrLen error$ = @@ -1906,6 +2158,17 @@ ::rust::String WalletconnectClient::save_client() { return ::std::move(return$.value); } +::rust::String Walletconnect2Client::save_client() { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$save_client( + *this, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::String WalletconnectClient::print_uri() { ::rust::MaybeUninit<::rust::String> return$; ::rust::repr::PtrLen error$ = @@ -1917,6 +2180,17 @@ ::rust::String WalletconnectClient::print_uri() { return ::std::move(return$.value); } +::rust::String Walletconnect2Client::print_uri() { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$print_uri( + *this, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::Vec<::std::uint8_t> WalletconnectClient::sign_personal_blocking( ::rust::String message, ::std::array<::std::uint8_t, 20> address) { ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( @@ -1931,6 +2205,31 @@ ::rust::Vec<::std::uint8_t> WalletconnectClient::sign_personal_blocking( return ::std::move(return$.value); } +::rust::Vec<::std::uint8_t> Walletconnect2Client::sign_personal_blocking( + ::rust::String message, ::std::array<::std::uint8_t, 20> address) { + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( + ::std::move(address)); + ::rust::MaybeUninit<::rust::Vec<::std::uint8_t>> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_personal_blocking( + *this, &message, &address$.value, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + +::rust::String Walletconnect2Client::ping_blocking(::std::uint64_t waitmillis) { + ::rust::MaybeUninit<::rust::String> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$ping_blocking( + *this, waitmillis, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::Vec<::std::uint8_t> WalletconnectClient::sign_eip155_transaction_blocking( ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, @@ -1947,6 +2246,22 @@ WalletconnectClient::sign_eip155_transaction_blocking( return ::std::move(return$.value); } +::rust::Vec<::std::uint8_t> +Walletconnect2Client::sign_eip155_transaction_blocking( + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> address) { + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( + ::std::move(address)); + ::rust::MaybeUninit<::rust::Vec<::std::uint8_t>> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_eip155_transaction_blocking( + *this, info, &address$.value, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::Vec<::std::uint8_t> WalletconnectClient::send_eip155_transaction_blocking( ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, @@ -1963,6 +2278,22 @@ WalletconnectClient::send_eip155_transaction_blocking( return ::std::move(return$.value); } +::rust::Vec<::std::uint8_t> +Walletconnect2Client::send_eip155_transaction_blocking( + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> address) { + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( + ::std::move(address)); + ::rust::MaybeUninit<::rust::Vec<::std::uint8_t>> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$send_eip155_transaction_blocking( + *this, info, &address$.value, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::Vec<::std::uint8_t> WalletconnectClient::sign_transaction( ::rust::String eip1559_transaction_request, ::std::array<::std::uint8_t, 20> address) { @@ -1979,6 +2310,22 @@ ::rust::Vec<::std::uint8_t> WalletconnectClient::sign_transaction( return ::std::move(return$.value); } +::rust::Vec<::std::uint8_t> Walletconnect2Client::sign_transaction( + ::rust::String eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> address) { + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( + ::std::move(address)); + ::rust::MaybeUninit<::rust::Vec<::std::uint8_t>> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_transaction( + *this, &eip1559_transaction_request, &address$.value, + &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::Vec<::std::uint8_t> WalletconnectClient::send_transaction( ::rust::String eip1559_transaction_request, ::std::array<::std::uint8_t, 20> address) { @@ -1995,6 +2342,22 @@ ::rust::Vec<::std::uint8_t> WalletconnectClient::send_transaction( return ::std::move(return$.value); } +::rust::Vec<::std::uint8_t> Walletconnect2Client::send_transaction( + ::rust::String eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> address) { + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( + ::std::move(address)); + ::rust::MaybeUninit<::rust::Vec<::std::uint8_t>> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$send_transaction( + *this, &eip1559_transaction_request, &address$.value, + &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::Vec<::std::uint8_t> WalletconnectClient::sign_contract_transaction( ::rust::String contract_action, ::com::crypto::game_sdk::WalletConnectTxCommon const &common, @@ -2011,6 +2374,22 @@ ::rust::Vec<::std::uint8_t> WalletconnectClient::sign_contract_transaction( return ::std::move(return$.value); } +::rust::Vec<::std::uint8_t> Walletconnect2Client::sign_contract_transaction( + ::rust::String contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> address) { + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( + ::std::move(address)); + ::rust::MaybeUninit<::rust::Vec<::std::uint8_t>> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_contract_transaction( + *this, &contract_action, common, &address$.value, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::Vec<::std::uint8_t> WalletconnectClient::send_contract_transaction( ::rust::String contract_action, ::com::crypto::game_sdk::WalletConnectTxCommon const &common, @@ -2027,6 +2406,22 @@ ::rust::Vec<::std::uint8_t> WalletconnectClient::send_contract_transaction( return ::std::move(return$.value); } +::rust::Vec<::std::uint8_t> Walletconnect2Client::send_contract_transaction( + ::rust::String contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> address) { + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> address$( + ::std::move(address)); + ::rust::MaybeUninit<::rust::Vec<::std::uint8_t>> return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$send_contract_transaction( + *this, &contract_action, common, &address$.value, &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + /// returns the transactions of a given address. /// The API key can be obtained from https://cronoscan.com ::rust::Vec<::com::crypto::game_sdk::RawTxDetail> @@ -2264,6 +2659,34 @@ void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnectAddress$truncate( ::rust::Vec<::com::crypto::game_sdk::WalletConnectAddress> *ptr, ::std::size_t len) noexcept; +void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$new( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> const + *ptr) noexcept; +void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$drop( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> + *ptr) noexcept; +::std::size_t +cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$len( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> const + *ptr) noexcept; +::std::size_t +cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$capacity( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> const + *ptr) noexcept; +::com::crypto::game_sdk::WalletConnect2Eip155Accounts const * +cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$data( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> const + *ptr) noexcept; +void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$reserve_total( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> *ptr, + ::std::size_t new_cap) noexcept; +void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$set_len( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> *ptr, + ::std::size_t len) noexcept; +void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$truncate( + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> *ptr, + ::std::size_t len) noexcept; + void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletEntry$new( ::rust::Vec<::com::crypto::game_sdk::WalletEntry> const *ptr) noexcept; void cxxbridge1$rust_vec$com$crypto$game_sdk$WalletEntry$drop( @@ -2292,6 +2715,13 @@ void cxxbridge1$box$com$crypto$game_sdk$WalletconnectClient$dealloc( void cxxbridge1$box$com$crypto$game_sdk$WalletconnectClient$drop( ::rust::Box<::com::crypto::game_sdk::WalletconnectClient> *ptr) noexcept; +::com::crypto::game_sdk::Walletconnect2Client * +cxxbridge1$box$com$crypto$game_sdk$Walletconnect2Client$alloc() noexcept; +void cxxbridge1$box$com$crypto$game_sdk$Walletconnect2Client$dealloc( + ::com::crypto::game_sdk::Walletconnect2Client *) noexcept; +void cxxbridge1$box$com$crypto$game_sdk$Walletconnect2Client$drop( + ::rust::Box<::com::crypto::game_sdk::Walletconnect2Client> *ptr) noexcept; + static_assert(::rust::detail::is_complete< ::com::crypto::game_sdk::WalletConnectCallback>::value, "definition of WalletConnectCallback is required"); @@ -2450,6 +2880,55 @@ void Vec<::com::crypto::game_sdk::WalletConnectAddress>::truncate( return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnectAddress$truncate( this, len); } +template <> +Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::Vec() noexcept { + cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$new( + this); +} +template <> +void Vec< + ::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::drop() noexcept { + return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$drop( + this); +} +template <> +::std::size_t Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::size() + const noexcept { + return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$len( + this); +} +template <> +::std::size_t +Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::capacity() + const noexcept { + return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$capacity( + this); +} +template <> +::com::crypto::game_sdk::WalletConnect2Eip155Accounts const * +Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::data() + const noexcept { + return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$data( + this); +} +template <> +void Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::reserve_total( + ::std::size_t new_cap) noexcept { + return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$reserve_total( + this, new_cap); +} +template <> +void Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::set_len( + ::std::size_t len) noexcept { + return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$set_len( + this, len); +} +template <> +void Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts>::truncate( + ::std::size_t len) { + return cxxbridge1$rust_vec$com$crypto$game_sdk$WalletConnect2Eip155Accounts$truncate( + this, len); +} template <> Vec<::com::crypto::game_sdk::WalletEntry>::Vec() noexcept { cxxbridge1$rust_vec$com$crypto$game_sdk$WalletEntry$new(this); } @@ -2502,6 +2981,21 @@ template <> void Box<::com::crypto::game_sdk::WalletconnectClient>::drop() noexcept { cxxbridge1$box$com$crypto$game_sdk$WalletconnectClient$drop(this); } +template <> +::com::crypto::game_sdk::Walletconnect2Client * +Box<::com::crypto::game_sdk::Walletconnect2Client>::allocation:: + alloc() noexcept { + return cxxbridge1$box$com$crypto$game_sdk$Walletconnect2Client$alloc(); +} +template <> +void Box<::com::crypto::game_sdk::Walletconnect2Client>::allocation::dealloc( + ::com::crypto::game_sdk::Walletconnect2Client *ptr) noexcept { + cxxbridge1$box$com$crypto$game_sdk$Walletconnect2Client$dealloc(ptr); +} +template <> +void Box<::com::crypto::game_sdk::Walletconnect2Client>::drop() noexcept { + cxxbridge1$box$com$crypto$game_sdk$Walletconnect2Client$drop(this); +} template <> Vec<::com::crypto::game_sdk::RawTxDetail>::Vec() noexcept { cxxbridge1$rust_vec$com$crypto$game_sdk$RawTxDetail$new(this); } diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h index 56607215..4e5ff0c7 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h @@ -864,12 +864,16 @@ struct WalletConnectTxCommon; struct WalletConnectTxEip155; struct WalletConnectAddress; struct WalletConnectEnsureSessionResult; +struct WalletConnect2Eip155Accounts; +struct WalletConnect2Eip155; +struct WalletConnect2EnsureSessionResult; struct CryptoComPaymentResponse; struct RawTxDetail; struct RawTokenResult; struct TokenHolderDetail; enum class QueryOption : ::std::uint8_t; struct WalletconnectClient; +struct Walletconnect2Client; using OptionalArguments = ::com::crypto::game_sdk::OptionalArguments; } // namespace game_sdk } // namespace crypto @@ -1022,6 +1026,36 @@ struct WalletConnectEnsureSessionResult final { }; #endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnectEnsureSessionResult +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155Accounts +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155Accounts +struct WalletConnect2Eip155Accounts final { + ::com::crypto::game_sdk::WalletConnectAddress address; + ::std::uint64_t chain_id; + + using IsRelocatable = ::std::true_type; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155Accounts + +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155 +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155 +struct WalletConnect2Eip155 final { + ::rust::Vec<::com::crypto::game_sdk::WalletConnect2Eip155Accounts> accounts; + ::rust::Vec<::rust::String> methods; + ::rust::Vec<::rust::String> events; + + using IsRelocatable = ::std::true_type; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2Eip155 + +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2EnsureSessionResult +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2EnsureSessionResult +struct WalletConnect2EnsureSessionResult final { + ::com::crypto::game_sdk::WalletConnect2Eip155 eip155; + + using IsRelocatable = ::std::true_type; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletConnect2EnsureSessionResult + #ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$CryptoComPaymentResponse #define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$CryptoComPaymentResponse /// the subset of payment object from https://pay-docs.crypto.com @@ -1253,6 +1287,50 @@ struct WalletconnectClient final : public ::rust::Opaque { }; #endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$WalletconnectClient +#ifndef CXXBRIDGE1_STRUCT_com$crypto$game_sdk$Walletconnect2Client +#define CXXBRIDGE1_STRUCT_com$crypto$game_sdk$Walletconnect2Client +struct Walletconnect2Client final : public ::rust::Opaque { + ::com::crypto::game_sdk::WalletConnect2EnsureSessionResult + ensure_session_blocking(::std::uint64_t waitmillis); + ::rust::String poll_events_blocking(::std::uint64_t waitmillis); + ::rust::String get_connection_string(); + ::rust::String save_client(); + ::rust::String print_uri(); + ::rust::Vec<::std::uint8_t> + sign_personal_blocking(::rust::String message, + ::std::array<::std::uint8_t, 20> address); + ::rust::String ping_blocking(::std::uint64_t waitmillis); + ::rust::Vec<::std::uint8_t> sign_eip155_transaction_blocking( + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> send_eip155_transaction_blocking( + ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> + sign_transaction(::rust::String eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> + send_transaction(::rust::String eip1559_transaction_request, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> sign_contract_transaction( + ::rust::String contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> address); + ::rust::Vec<::std::uint8_t> send_contract_transaction( + ::rust::String contract_action, + ::com::crypto::game_sdk::WalletConnectTxCommon const &common, + ::std::array<::std::uint8_t, 20> address); + ~Walletconnect2Client() = delete; + + private: + friend ::rust::layout; + struct layout { + static ::std::size_t size() noexcept; + static ::std::size_t align() noexcept; + }; +}; +#endif // CXXBRIDGE1_STRUCT_com$crypto$game_sdk$Walletconnect2Client + /// filter wallets by platform /// (`registry_local_path` can be empty string if it is not needed to store the /// `cached` registry result) @@ -1289,6 +1367,9 @@ generate_qrcode(::rust::String qrcodestring); ::rust::Box<::com::crypto::game_sdk::WalletconnectClient> walletconnect_restore_client(::rust::String session_info); +::rust::Box<::com::crypto::game_sdk::Walletconnect2Client> +walletconnect2_restore_client(::rust::String session_info); + /// create walletconnect-session /// the chain id (if 0, retrived and decided by wallet, if > 0, decided by the /// client) @@ -1297,6 +1378,11 @@ walletconnect_new_client(::rust::String description, ::rust::String url, ::rust::Vec<::rust::String> icon_urls, ::rust::String name, ::std::uint64_t chain_id); +::rust::Box<::com::crypto::game_sdk::Walletconnect2Client> +walletconnect2_client_new(::rust::String relayserver, ::rust::String project_id, + ::rust::String required_namespaces, + ::rust::String client_meta); + /// returns the transactions of a given address. /// The API key can be obtained from https://cronoscan.com ::rust::Vec<::com::crypto::game_sdk::RawTxDetail> diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h index 4d4622de..9da2c332 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h @@ -989,9 +989,7 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { - using type = void; -}; +template struct make_void { using type = void; }; template using void_t = typename make_void::type;