diff --git a/Content/BlueprintSampleContent/ImtblAuthenticatedWidget4_26.uasset b/Content/BlueprintSampleContent/ImtblAuthenticatedWidget4_26.uasset index f678694d..68625eee 100644 Binary files a/Content/BlueprintSampleContent/ImtblAuthenticatedWidget4_26.uasset and b/Content/BlueprintSampleContent/ImtblAuthenticatedWidget4_26.uasset differ diff --git a/Content/BlueprintSampleContent/ImtblImxBatchNftTransferWidget4_26.uasset b/Content/BlueprintSampleContent/ImtblImxBatchNftTransferWidget4_26.uasset deleted file mode 100644 index 18bcae35..00000000 Binary files a/Content/BlueprintSampleContent/ImtblImxBatchNftTransferWidget4_26.uasset and /dev/null differ diff --git a/Content/BlueprintSampleContent/ImtblImxTransferWidget4_26.uasset b/Content/BlueprintSampleContent/ImtblImxTransferWidget4_26.uasset deleted file mode 100644 index b8208339..00000000 Binary files a/Content/BlueprintSampleContent/ImtblImxTransferWidget4_26.uasset and /dev/null differ diff --git a/Content/BlueprintSampleContent/ImtblUnauthenticatedWidget4_26.uasset b/Content/BlueprintSampleContent/ImtblUnauthenticatedWidget4_26.uasset index 78f1faab..577dd525 100644 Binary files a/Content/BlueprintSampleContent/ImtblUnauthenticatedWidget4_26.uasset and b/Content/BlueprintSampleContent/ImtblUnauthenticatedWidget4_26.uasset differ diff --git a/Source/Immutable/Private/Immutable/Actions/ImtblConnectImxAsyncAction.cpp b/Source/Immutable/Private/Immutable/Actions/ImtblConnectionAsyncAction.cpp similarity index 56% rename from Source/Immutable/Private/Immutable/Actions/ImtblConnectImxAsyncAction.cpp rename to Source/Immutable/Private/Immutable/Actions/ImtblConnectionAsyncAction.cpp index 25230605..67d1b783 100644 --- a/Source/Immutable/Private/Immutable/Actions/ImtblConnectImxAsyncAction.cpp +++ b/Source/Immutable/Private/Immutable/Actions/ImtblConnectionAsyncAction.cpp @@ -1,34 +1,17 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "Immutable/Actions/ImtblConnectImxAsyncAction.h" +#include "Immutable/Actions/ImtblConnectionAsyncAction.h" #include "Immutable/ImmutablePassport.h" #include "Immutable/ImmutableSubsystem.h" #include "Immutable/Misc/ImtblLogging.h" - UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::Login(UObject* WorldContextObject, const FImmutableDirectLoginOptions& DirectLoginOptions) { - UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject(); - - PassportInitBlueprintNode->WorldContextObject = WorldContextObject; - PassportInitBlueprintNode->bIsConnectImx = false; - PassportInitBlueprintNode->bIsPKCE = true; - PassportInitBlueprintNode->DirectLoginOptions = DirectLoginOptions; - - return PassportInitBlueprintNode; -} - -UImtblConnectionAsyncActions* UImtblConnectionAsyncActions::ConnectImx(UObject* WorldContextObject, const FImmutableDirectLoginOptions& DirectLoginOptions) -{ - UImtblConnectionAsyncActions* PassportInitBlueprintNode = NewObject(); + UImtblConnectionAsyncActions* Node = NewObject(); - PassportInitBlueprintNode->WorldContextObject = WorldContextObject; - PassportInitBlueprintNode->bIsConnectImx = true; - PassportInitBlueprintNode->bIsPKCE = true; - PassportInitBlueprintNode->DirectLoginOptions = DirectLoginOptions; + Node->WorldContextObject = WorldContextObject; + Node->DirectLoginOptions = DirectLoginOptions; - return PassportInitBlueprintNode; + return Node; } void UImtblConnectionAsyncActions::Activate() @@ -61,12 +44,9 @@ void UImtblConnectionAsyncActions::DoConnect(TWeakObjectPtr J if (Passport.IsValid()) { - if (bIsPKCE) - { #if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC | PLATFORM_WINDOWS - Passport->Connect(bIsConnectImx, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblConnectionAsyncActions::OnConnect), DirectLoginOptions); + Passport->Connect(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblConnectionAsyncActions::OnConnect), DirectLoginOptions); #endif - } } else { diff --git a/Source/Immutable/Private/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.cpp b/Source/Immutable/Private/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.cpp index 86edda0b..a568c172 100644 --- a/Source/Immutable/Private/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.cpp +++ b/Source/Immutable/Private/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.cpp @@ -1,6 +1,5 @@ -#include "Immutable/Actions/ImtblEmbeddedLoginAsyncAction.h" +#include "Immutable/Actions/ImtblEmbeddedLoginAsyncAction.h" -#include "Immutable/Actions/ImtblConnectImxAsyncAction.h" #include "Immutable/Browser/ImmutableJSConnectorBrowserWidget.h" UImtblEmbeddedLoginAsyncAction* UImtblEmbeddedLoginAsyncAction::Login(UObject* WorldContextObject, UImmutableJSConnectorBrowserWidget* JSConnectorBrowserWidget) diff --git a/Source/Immutable/Private/Immutable/Actions/ImtblPassportGetAddressAsyncAction.cpp b/Source/Immutable/Private/Immutable/Actions/ImtblPassportGetAddressAsyncAction.cpp deleted file mode 100644 index 939766b8..00000000 --- a/Source/Immutable/Private/Immutable/Actions/ImtblPassportGetAddressAsyncAction.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "Immutable/Actions/ImtblPassportGetAddressAsyncAction.h" - -#include "Immutable/ImmutablePassport.h" -#include "Immutable/ImmutableSubsystem.h" -#include "Immutable/Misc/ImtblLogging.h" - -UImtblPassportGetAddressAsyncAction* UImtblPassportGetAddressAsyncAction::GetAddress(UObject* WorldContextObject) -{ - UImtblPassportGetAddressAsyncAction* PassportInitBlueprintNode = NewObject(); - PassportInitBlueprintNode->WorldContextObject = WorldContextObject; - return PassportInitBlueprintNode; -} - -void UImtblPassportGetAddressAsyncAction::Activate() -{ - if (!WorldContextObject || !WorldContextObject->GetWorld()) - { - FString Err = "GetAddress failed due to missing world or world context object."; - IMTBL_WARN("%s", *Err) - Failed.Broadcast(Err, TEXT("")); - return; - } - - GetSubsystem()->WhenReady(this, &UImtblPassportGetAddressAsyncAction::DoGetAddress); //, /* timoutSec - //*/ 15.0f); -} - -void UImtblPassportGetAddressAsyncAction::DoGetAddress(TWeakObjectPtr JSConnector) -{ - // Get Passport - auto Passport = GetSubsystem()->GetPassport(); - // Run GetAddress - Passport->GetAddress(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportGetAddressAsyncAction::OnGetAddressResponse)); -} - -void UImtblPassportGetAddressAsyncAction::OnGetAddressResponse(FImmutablePassportResult Result) -{ - if (Result.Success) - { - GotAddress.Broadcast(TEXT(""), UImmutablePassport::GetResponseResultAsString(Result.Response)); - } - else - { - Failed.Broadcast(Result.Error, TEXT("")); - } -} diff --git a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.cpp b/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.cpp deleted file mode 100644 index 543921ef..00000000 --- a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.h" - -#include "Immutable/ImmutablePassport.h" -#include "Immutable/ImmutableSubsystem.h" -#include "Immutable/ImmutableResponses.h" -#include "Immutable/Misc/ImtblLogging.h" - -UImmutablePassportImxBatchNftTransferAsyncAction* UImmutablePassportImxBatchNftTransferAsyncAction::ImxBatchNftTransfer(UObject* WorldContextObject, const TArray& NftTransferDetails) -{ - UImmutablePassportImxBatchNftTransferAsyncAction* BlueprintNode = NewObject(); - BlueprintNode->WorldContextObject = WorldContextObject; - BlueprintNode->NftTransferDetails = NftTransferDetails; - return BlueprintNode; -} - -void UImmutablePassportImxBatchNftTransferAsyncAction::Activate() -{ - if (!WorldContextObject || !WorldContextObject->GetWorld()) - { - const FString Err = "BatchNftTransfer failed due to missing world or world context object."; - IMTBL_WARN("Error: %s", *Err) - TArray TransferIds; - Failed.Broadcast(Err, TransferIds); - return; - } - - GetSubsystem()->WhenReady(this, &UImmutablePassportImxBatchNftTransferAsyncAction::DoTransfer); -} - -void UImmutablePassportImxBatchNftTransferAsyncAction::DoTransfer(TWeakObjectPtr JSConnector) -{ - // Get Passport - FImxBatchNftTransferRequest Request; - Request.nftTransferDetails = NftTransferDetails; - - // Run Transfer - GetSubsystem()->GetPassport()->ImxBatchNftTransfer(Request, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImmutablePassportImxBatchNftTransferAsyncAction::OnTransferResponse)); -} - -void UImmutablePassportImxBatchNftTransferAsyncAction::OnTransferResponse(FImmutablePassportResult Result) -{ - TArray TransferIds; - if (Result.Success) - { - if (auto BatchNftTransferResponse = JsonObjectToUStruct(Result.Response.JsonObject)) - { - for (auto Id : BatchNftTransferResponse->transferIds) - { - TransferIds.Add(FString::Printf(TEXT("%u,"), Id)); - } - } - Success.Broadcast(TEXT(""), TransferIds); - } - else - { - Failed.Broadcast(Result.Error, TransferIds); - } -} diff --git a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxIsRegisteredOffchainAsyncAction.cpp b/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxIsRegisteredOffchainAsyncAction.cpp deleted file mode 100644 index c1944f80..00000000 --- a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxIsRegisteredOffchainAsyncAction.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "Immutable/Actions/ImtblPassportImxIsRegisteredOffchainAsyncAction.h" - -#include "Immutable/ImmutablePassport.h" -#include "Immutable/ImmutableSubsystem.h" -#include "Immutable/Misc/ImtblLogging.h" - - -UImtblPassportImxIsRegisteredOffchainAsyncAction* UImtblPassportImxIsRegisteredOffchainAsyncAction::IsRegisteredOffchain(UObject* WorldContextObject) -{ - UImtblPassportImxIsRegisteredOffchainAsyncAction* PassportInitBlueprintNode = NewObject(); - - PassportInitBlueprintNode->WorldContextObject = WorldContextObject; - - return PassportInitBlueprintNode; -} - -void UImtblPassportImxIsRegisteredOffchainAsyncAction::Activate() -{ - if (!WorldContextObject || !WorldContextObject->GetWorld()) - { - FString Err = "IsRegisteredOffchain failed due to missing world or world context object."; - IMTBL_WARN("%s", *Err) - OnComplete.Broadcast(false); - return; - } - - GetSubsystem()->WhenReady(this, &UImtblPassportImxIsRegisteredOffchainAsyncAction::DoImxIsRegisteredOffchain); //, /* timoutSec */ 15.0f); -} - -void UImtblPassportImxIsRegisteredOffchainAsyncAction::DoImxIsRegisteredOffchain(TWeakObjectPtr JSConnector) -{ - const auto Passport = GetSubsystem()->GetPassport(); - - if (Passport.IsValid()) - { - Passport->ImxIsRegisteredOffchain(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportImxIsRegisteredOffchainAsyncAction::OnImxIsRegisteredOffchainResponse)); - } -} - -void UImtblPassportImxIsRegisteredOffchainAsyncAction::OnImxIsRegisteredOffchainResponse(FImmutablePassportResult Result) -{ - OnComplete.Broadcast(UImmutablePassport::GetResponseResultAsBool(Result.Response)); -} diff --git a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.cpp b/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.cpp deleted file mode 100644 index e5573d00..00000000 --- a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.h" - -#include "Immutable/ImmutablePassport.h" -#include "Immutable/ImmutableSubsystem.h" -#include "Immutable/ImmutableResponses.h" -#include "Immutable/Misc/ImtblLogging.h" - - -UImtblPassportImxRegisterOffchainAsyncAction* UImtblPassportImxRegisterOffchainAsyncAction::RegisterOffchain(UObject* WorldContextObject) -{ - UImtblPassportImxRegisterOffchainAsyncAction* PassportInitBlueprintNode = NewObject(); - - PassportInitBlueprintNode->WorldContextObject = WorldContextObject; - - return PassportInitBlueprintNode; -} - -void UImtblPassportImxRegisterOffchainAsyncAction::Activate() -{ - if (!WorldContextObject || !WorldContextObject->GetWorld()) - { - FString Err = "RegisterOffchain failed due to missing world or world context object."; - IMTBL_WARN("%s", *Err) - OnFailure.Broadcast(TEXT(""), Err); - return; - } - - GetSubsystem()->WhenReady(this, &UImtblPassportImxRegisterOffchainAsyncAction::DoImxRegisterOffchain); -} - -void UImtblPassportImxRegisterOffchainAsyncAction::DoImxRegisterOffchain(TWeakObjectPtr JSConnector) -{ - const auto Passport = GetSubsystem()->GetPassport(); - - if (Passport.IsValid()) - { - Passport->ImxRegisterOffchain(UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportImxRegisterOffchainAsyncAction::OnImxRegisterOffchainResponse)); - } -} - -void UImtblPassportImxRegisterOffchainAsyncAction::OnImxRegisterOffchainResponse(FImmutablePassportResult Result) -{ - if (Result.Success) - { - if (auto ResponseData = JsonObjectToUStruct(Result.Response.JsonObject)) - { - OnSuccess.Broadcast(ResponseData->tx_hash, TEXT("")); - return; - } - } - - OnFailure.Broadcast(TEXT(""), Result.Error); -} diff --git a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxTransferAsyncAction.cpp b/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxTransferAsyncAction.cpp deleted file mode 100644 index 7c8253b8..00000000 --- a/Source/Immutable/Private/Immutable/Actions/ImtblPassportImxTransferAsyncAction.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "Immutable/Actions/ImtblPassportImxTransferAsyncAction.h" - -#include "Immutable/ImmutablePassport.h" -#include "Immutable/ImmutableResponses.h" -#include "Immutable/ImmutableSubsystem.h" -#include "Immutable/Misc/ImtblLogging.h" - -UImmutablePassportImxTransferAsyncAction* UImmutablePassportImxTransferAsyncAction::ImxTransfer(UObject* WorldContextObject, const FString& Receiver, const FString& Type, const FString& Amount, const FString& TokenId, const FString& TokenAddress) -{ - UImmutablePassportImxTransferAsyncAction* BlueprintNode = NewObject(); - BlueprintNode->WorldContextObject = WorldContextObject; - BlueprintNode->Receiver = Receiver; - BlueprintNode->Type = Type; - BlueprintNode->Amount = Amount; - BlueprintNode->TokenId = TokenId; - BlueprintNode->TokenAddress = TokenAddress; - return BlueprintNode; -} - -void UImmutablePassportImxTransferAsyncAction::Activate() -{ - if (!WorldContextObject || !WorldContextObject->GetWorld()) - { - const FString Err = "Transfer failed due to missing world or world context object."; - IMTBL_WARN("Error: %s", *Err) - Failed.Broadcast(Err, TEXT("")); - return; - } - - GetSubsystem()->WhenReady(this, &UImmutablePassportImxTransferAsyncAction::DoTransfer); -} - -void UImmutablePassportImxTransferAsyncAction::DoTransfer(TWeakObjectPtr JSConnector) -{ - // Get Passport - FImxTransferRequest Request; - Request.receiver = Receiver; - Request.type = Type; - Request.amount = Amount; - Request.tokenId = TokenId; - Request.tokenAddress = TokenAddress; - // Run Transfer - GetSubsystem()->GetPassport()->ImxTransfer(Request, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImmutablePassportImxTransferAsyncAction::OnTransferResponse)); -} - -void UImmutablePassportImxTransferAsyncAction::OnTransferResponse(FImmutablePassportResult Result) -{ - if (Result.Success) - { - FString TransferId; - if (auto TransferResponse = JsonObjectToUStruct(Result.Response.JsonObject)) - { - TransferId = FString::Printf(TEXT("%u"), TransferResponse->transferId); - } - Success.Broadcast(TEXT(""), TransferId); - } - else - { - Failed.Broadcast(Result.Error, TEXT("")); - } -} diff --git a/Source/Immutable/Private/Immutable/ImmutableAnalytics.h b/Source/Immutable/Private/Immutable/ImmutableAnalytics.h index 8a458140..b4ed3524 100644 --- a/Source/Immutable/Private/Immutable/ImmutableAnalytics.h +++ b/Source/Immutable/Private/Immutable/ImmutableAnalytics.h @@ -39,11 +39,6 @@ CONVERT(COMPLETE_LOGIN, "performedLogin") \ CONVERT(START_LOGIN_PKCE, "startedLoginPkce") \ CONVERT(COMPLETE_LOGIN_PKCE, "performedLoginPkce") \ CONVERT(COMPLETE_RELOGIN, "performedRelogin") \ -CONVERT(START_CONNECT_IMX, "startedConnectImx") \ -CONVERT(COMPLETE_CONNECT_IMX, "performedConnectImx") \ -CONVERT(START_CONNECT_IMX_PKCE, "startedConnectImxPkce") \ -CONVERT(COMPLETE_CONNECT_IMX_PKCE, "performedConnectImxPkce") \ -CONVERT(COMPLETE_RECONNECT, "performedReconnect") \ CONVERT(COMPLETE_LOGOUT, "performedLogout") \ CONVERT(COMPLETE_LOGOUT_PKCE, "performedLogoutPkce") diff --git a/Source/Immutable/Private/Immutable/ImmutableDataTypes.cpp b/Source/Immutable/Private/Immutable/ImmutableDataTypes.cpp index da711324..af09e087 100644 --- a/Source/Immutable/Private/Immutable/ImmutableDataTypes.cpp +++ b/Source/Immutable/Private/Immutable/ImmutableDataTypes.cpp @@ -2,8 +2,6 @@ #include "Immutable/ImmutableDataTypes.h" -#include "Immutable/Actions/ImtblConnectImxAsyncAction.h" - #if PLATFORM_WINDOWS #include "Immutable/Windows/ImmutablePKCEWindows.h" #endif diff --git a/Source/Immutable/Private/Immutable/ImmutablePassport.cpp b/Source/Immutable/Private/Immutable/ImmutablePassport.cpp index cff86b65..5f4f6d47 100644 --- a/Source/Immutable/Private/Immutable/ImmutablePassport.cpp +++ b/Source/Immutable/Private/Immutable/ImmutablePassport.cpp @@ -87,7 +87,7 @@ void UImmutablePassport::Initialize(const FImtblPassportResponseDelegate& Respon } #if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC | PLATFORM_WINDOWS -void UImmutablePassport::Connect(bool IsConnectImx, const FImtblPassportResponseDelegate& ResponseDelegate, const FImmutableDirectLoginOptions& DirectLoginOptions) +void UImmutablePassport::Connect(const FImtblPassportResponseDelegate& ResponseDelegate, const FImmutableDirectLoginOptions& DirectLoginOptions) { SetStateFlags(IPS_CONNECTING | IPS_PKCE); @@ -101,15 +101,10 @@ void UImmutablePassport::Connect(bool IsConnectImx, const FImtblPassportResponse } #endif - if (IsConnectImx) - { - SetStateFlags(IPS_IMX); - } PKCEResponseDelegate = ResponseDelegate; - Analytics->Track(IsConnectImx ? UImmutableAnalytics::EEventName::START_CONNECT_IMX_PKCE : UImmutableAnalytics::EEventName::START_LOGIN_PKCE); + Analytics->Track(UImmutableAnalytics::EEventName::START_LOGIN_PKCE); TSharedPtr RequestObject = MakeShareable(new FJsonObject); - RequestObject->SetBoolField(TEXT("isConnectImx"), IsConnectImx); TSharedPtr DirectLoginOptionsObject = DirectLoginOptions.ToJsonObject(); if (DirectLoginOptionsObject.IsValid()) @@ -216,11 +211,6 @@ void UImmutablePassport::GetAccessToken(const FImtblPassportResponseDelegate& Re CallJS(ImmutablePassportAction::GetAccessToken, TEXT(""), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); } -void UImmutablePassport::GetAddress(const FImtblPassportResponseDelegate& ResponseDelegate) -{ - CallJS(ImmutablePassportAction::GetAddress, TEXT(""), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); -} - void UImmutablePassport::GetEmail(const FImtblPassportResponseDelegate& ResponseDelegate) { CallJS(ImmutablePassportAction::GetEmail, TEXT(""), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); @@ -231,27 +221,6 @@ void UImmutablePassport::GetLinkedAddresses(const FImtblPassportResponseDelegate CallJS(ImmutablePassportAction::GetLinkedAddresses, TEXT(""), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); } -void UImmutablePassport::ImxTransfer(const FImxTransferRequest& RequestData, const FImtblPassportResponseDelegate& ResponseDelegate) -{ - IMTBL_LOG("Tranfer Request: %s", *UStructToJsonString(RequestData)) - CallJS(ImmutablePassportAction::ImxTransfer, UStructToJsonString(RequestData), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); -} - -void UImmutablePassport::ImxBatchNftTransfer(const FImxBatchNftTransferRequest& RequestData, const FImtblPassportResponseDelegate& ResponseDelegate) -{ - CallJS(ImmutablePassportAction::ImxBatchNftTransfer, RequestData.ToJsonString(), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); -} - -void UImmutablePassport::ImxIsRegisteredOffchain(const FImtblPassportResponseDelegate& ResponseDelegate) -{ - CallJS(ImmutablePassportAction::ImxIsRegisteredOffchain, TEXT(""), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); -} - -void UImmutablePassport::ImxRegisterOffchain(const FImtblPassportResponseDelegate& ResponseDelegate) -{ - CallJS(ImmutablePassportAction::ImxRegisterOffchain, TEXT(""), ResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnBridgeCallbackResponse)); -} - void UImmutablePassport::HasStoredCredentials(const FImtblPassportResponseDelegate& ResponseDelegate) { // we do check credentials into two steps, we check accessToken and then IdToken @@ -539,7 +508,7 @@ void UImmutablePassport::OnConnectResponse(FImtblJSResponse Response) ResetStateFlags(IPS_PKCE); Response.Error.IsSet() ? Msg = Response.Error->ToString() : Msg = Response.JsonObject->GetStringField(TEXT("error")); } - Analytics->Track(IsStateFlagsSet(IPS_IMX) ? UImmutableAnalytics::EEventName::COMPLETE_CONNECT_IMX_PKCE : UImmutableAnalytics::EEventName::COMPLETE_LOGIN_PKCE, Response.success); + Analytics->Track(UImmutableAnalytics::EEventName::COMPLETE_LOGIN_PKCE, Response.success); PKCEResponseDelegate.ExecuteIfBound(FImmutablePassportResult{Response.success, Msg, Response}); PKCEResponseDelegate = nullptr; @@ -628,7 +597,7 @@ void UImmutablePassport::OnDeepLinkActivated(const FString& DeepLink) IMTBL_LOG("Complete Logout PKCE") PKCELogoutResponseDelegate.ExecuteIfBound(FImmutablePassportResult{true, "Logged out"}); PKCELogoutResponseDelegate = nullptr; - ResetStateFlags(IPS_CONNECTED | IPS_PKCE | IPS_IMX); + ResetStateFlags(IPS_CONNECTED | IPS_PKCE); SavePassportSettings(); }, TStatId(), nullptr, ENamedThreads::GameThread); } @@ -684,7 +653,7 @@ void UImmutablePassport::CompleteLoginFlow(FString Url) { FImmutablePassportConnectData Data = FImmutablePassportConnectData{Code.GetValue(), State.GetValue()}; - CallJS(IsStateFlagsSet(IPS_IMX) ? ImmutablePassportAction::CONNECT_PKCE : ImmutablePassportAction::LOGIN_PKCE, UStructToJsonString(Data), PKCEResponseDelegate, + CallJS(ImmutablePassportAction::LOGIN_PKCE, UStructToJsonString(Data), PKCEResponseDelegate, FImtblJSResponseDelegate::CreateUObject(this, &UImmutablePassport::OnConnectResponse)); } } diff --git a/Source/Immutable/Private/Immutable/ImmutableRequests.cpp b/Source/Immutable/Private/Immutable/ImmutableRequests.cpp deleted file mode 100644 index 903bae30..00000000 --- a/Source/Immutable/Private/Immutable/ImmutableRequests.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "Immutable/ImmutableRequests.h" - -#include "JsonObjectConverter.h" -#include "JsonObjectWrapper.h" -#include "Immutable/Misc/ImtblLogging.h" -#include "Policies/CondensedJsonPrintPolicy.h" - - -FString FImxTransferRequest::ToJsonString() const -{ - FString OutString; - FJsonObjectWrapper Wrapper; - Wrapper.JsonObject = MakeShared(); - FJsonObjectConverter::UStructToJsonObject(StaticStruct(), this, Wrapper.JsonObject.ToSharedRef(), 0, 0); - - if (!Wrapper.JsonObject.IsValid()) - { - IMTBL_ERR("Could not convert FImxTransferRequest to JSON") - return ""; - } - - Wrapper.JsonObjectToString(OutString); - - return OutString; -} - -FString FImxBatchNftTransferRequest::ToJsonString() const -{ - FString OutString; - FJsonObjectWrapper Wrapper; - Wrapper.JsonObject = MakeShared(); - FJsonObjectConverter::UStructToJsonObject(StaticStruct(), this, Wrapper.JsonObject.ToSharedRef(), 0, 0); - - if (!Wrapper.JsonObject.IsValid()) - { - IMTBL_ERR("Could not convert FImxBatchNftTransferRequest to JSON") - return ""; - } - - if (Wrapper.JsonObject->HasField(TEXT("nftTransferDetails"))) - { - const auto Writer = TJsonWriterFactory>::Create(&OutString); - FJsonSerializer::Serialize(Wrapper.JsonObject->GetArrayField(TEXT("nftTransferDetails")), Writer); - IMTBL_LOG("FImxBatchNftTransferRequest Serialised: %s", *OutString); - Writer->Close(); - } - - return OutString; -} diff --git a/Source/Immutable/Private/Immutable/ImmutableSubsystem.cpp b/Source/Immutable/Private/Immutable/ImmutableSubsystem.cpp index c8ee922e..3628bb6e 100644 --- a/Source/Immutable/Private/Immutable/ImmutableSubsystem.cpp +++ b/Source/Immutable/Private/Immutable/ImmutableSubsystem.cpp @@ -62,7 +62,6 @@ void UImmutableSubsystem::OnBridgeReady() // Set the bIsReady flag and broadcast the OnReady event for any waiting // delegates. bIsReady = true; - ManageBridgeDelegateQueue(); } void UImmutableSubsystem::ManageBridgeDelegateQueue() diff --git a/Source/Immutable/Private/Immutable/ImtblBrowserUserWidget.cpp b/Source/Immutable/Private/Immutable/ImtblBrowserUserWidget.cpp index 3f6908a1..bf8e3450 100644 --- a/Source/Immutable/Private/Immutable/ImtblBrowserUserWidget.cpp +++ b/Source/Immutable/Private/Immutable/ImtblBrowserUserWidget.cpp @@ -9,6 +9,7 @@ #include "Components/ScaleBoxSlot.h" #include "Immutable/Browser/ImmutableJSConnectorBrowserWidget.h" +#include "Immutable/ImtblJSConnector.h" #include "Immutable/ImmutableUtilities.h" #include "Immutable/Misc/ImtblLogging.h" diff --git a/Source/Immutable/Private/Immutable/Mac/ImmutableMac.cpp b/Source/Immutable/Private/Immutable/Mac/ImmutableMac.cpp index bd5f421f..0dcacafa 100644 --- a/Source/Immutable/Private/Immutable/Mac/ImmutableMac.cpp +++ b/Source/Immutable/Private/Immutable/Mac/ImmutableMac.cpp @@ -4,12 +4,16 @@ #include "Immutable/ImmutablePassport.h" #include "Immutable/ImmutableSubsystem.h" +#include "Immutable/Misc/ImtblLogging.h" #if WITH_EDITOR #include "Editor.h" #endif -ASWebAuthenticationSession *_authSession; +@interface ImmutableMac () { + ASWebAuthenticationSession* _authSession; +} +@end @implementation ImmutableMac @@ -28,42 +32,40 @@ ASWebAuthenticationSession *_authSession; } + (UImmutablePassport*) getPassport { - UWorld* World; + auto PassportFromWorld = [](UWorld* World) -> UImmutablePassport* { + if (!World) return nullptr; + UGameInstance* GameInstance = World->GetGameInstance(); + if (!GameInstance) return nullptr; + UImmutableSubsystem* Subsystem = GameInstance->GetSubsystem(); + if (!Subsystem) return nullptr; + return Subsystem->GetPassport().Get(); + }; #if WITH_EDITOR if (GEditor) { - for (const auto& Context : GEditor->GetWorldContexts()) + for (const FWorldContext& Context : GEditor->GetWorldContexts()) { - if ((World = Context.World())) + if (UImmutablePassport* Passport = PassportFromWorld(Context.World())) { - if (auto GameInstance = World->GetGameInstance()) - { - if (auto ImmutableSubsystem = GameInstance->GetSubsystem()) - { - auto WeakPassport = ImmutableSubsystem->GetPassport(); - if (auto Passport = WeakPassport.Get()) - { - return Passport; - } - } - } + return Passport; } } } + return nullptr; #else + UWorld* World = nullptr; if (UGameEngine* GameEngine = Cast(GEngine)) { World = GameEngine->GetGameWorld(); } + return PassportFromWorld(World); #endif - - return nil; } - (void)launchUrl:(const char *)url forRedirectUri:(const char *)redirectUri { // For automation, use the browser-based method if (GIsAutomationTesting) { - NSLog(@"Using automation mode for authentication (GIsAutomationTesting is true)"); + IMTBL_LOG("Using automation mode for authentication (GIsAutomationTesting is true)"); [self launchUrlInBrowser:url]; return; } @@ -116,7 +118,7 @@ ASWebAuthenticationSession *_authSession; // Open URL in default browser [[NSWorkspace sharedWorkspace] openURL:URL]; - NSLog(@"Opened URL in browser for automation: %@", URL); + IMTBL_LOG("Opened URL in browser for automation: %s", URL.absoluteString.UTF8String); } - (ASPresentationAnchor)presentationAnchorForWebAuthenticationSession: diff --git a/Source/Immutable/Public/Immutable/Actions/ImtblConnectImxAsyncAction.h b/Source/Immutable/Public/Immutable/Actions/ImtblConnectionAsyncAction.h similarity index 64% rename from Source/Immutable/Public/Immutable/Actions/ImtblConnectImxAsyncAction.h rename to Source/Immutable/Public/Immutable/Actions/ImtblConnectionAsyncAction.h index d6e32f27..dc3d27e2 100644 --- a/Source/Immutable/Public/Immutable/Actions/ImtblConnectImxAsyncAction.h +++ b/Source/Immutable/Public/Immutable/Actions/ImtblConnectionAsyncAction.h @@ -1,15 +1,10 @@ -// Fill out your copyright notice in the Description page of Project Settings. - #pragma once #include "CoreMinimal.h" #include "Immutable/ImmutablePassport.h" #include "ImtblBlueprintAsyncAction.h" -#include "ImtblConnectImxAsyncAction.generated.h" +#include "ImtblConnectionAsyncAction.generated.h" -/** - * - */ UCLASS() class IMMUTABLE_API UImtblConnectionAsyncActions : public UImtblBlueprintAsyncAction { @@ -29,24 +24,12 @@ class IMMUTABLE_API UImtblConnectionAsyncActions : public UImtblBlueprintAsyncAc UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable") static UImtblConnectionAsyncActions* Login(UObject* WorldContextObject, const FImmutableDirectLoginOptions& DirectLoginOptions); - /** - * Log into Passport, initialise the gamer's wallet and instantiate the IMX provider. - * - * @param WorldContextObject World context - * @param DirectLoginOptions Direct login options for authentication (email, google, apple, facebook) - * - * @return A reference to the object represented by this node - */ - UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable") - static UImtblConnectionAsyncActions* ConnectImx(UObject* WorldContextObject, const FImmutableDirectLoginOptions& DirectLoginOptions); - virtual void Activate() override; - + FPassportConnectOutputPin* DynamicMulticastDelegate_OnSuccess(); FPassportConnectOutputPin* DynamicMulticastDelegate_OnFailed(); private: - void DoConnect(TWeakObjectPtr JSConnector); void OnConnect(FImmutablePassportResult Result); @@ -55,8 +38,5 @@ class IMMUTABLE_API UImtblConnectionAsyncActions : public UImtblBlueprintAsyncAc UPROPERTY(BlueprintAssignable, Meta = (DisplayName = "OnFailed")) FPassportConnectOutputPin Internal_DynamicMulticastDelegate_OnFailed; - bool bUseCachedSession = false; - bool bIsConnectImx = false; - bool bIsPKCE = false; FImmutableDirectLoginOptions DirectLoginOptions; }; diff --git a/Source/Immutable/Public/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.h b/Source/Immutable/Public/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.h index 28437f52..2bb1ac75 100644 --- a/Source/Immutable/Public/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.h +++ b/Source/Immutable/Public/Immutable/Actions/ImtblEmbeddedLoginAsyncAction.h @@ -1,7 +1,7 @@ #pragma once #include "Immutable/Actions/ImtblBlueprintAsyncAction.h" -#include "Immutable/Actions/ImtblConnectImxAsyncAction.h" +#include "Immutable/Actions/ImtblConnectionAsyncAction.h" #include "ImtblEmbeddedLoginAsyncAction.generated.h" diff --git a/Source/Immutable/Public/Immutable/Actions/ImtblPassportGetAddressAsyncAction.h b/Source/Immutable/Public/Immutable/Actions/ImtblPassportGetAddressAsyncAction.h deleted file mode 100644 index bb3718c4..00000000 --- a/Source/Immutable/Public/Immutable/Actions/ImtblPassportGetAddressAsyncAction.h +++ /dev/null @@ -1,34 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "Immutable/ImmutablePassport.h" -#include "ImtblBlueprintAsyncAction.h" -#include "ImtblPassportGetAddressAsyncAction.generated.h" - -/** - * - */ -UCLASS() -class IMMUTABLE_API UImtblPassportGetAddressAsyncAction : public UImtblBlueprintAsyncAction -{ - GENERATED_BODY() - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FPassportGetAddressOutputPin, FString, ErrorMessage, FString, Address); - -public: - UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable") - static UImtblPassportGetAddressAsyncAction* GetAddress(UObject* WorldContextObject); - - virtual void Activate() override; - -private: - void DoGetAddress(TWeakObjectPtr JSGetConnector); - void OnGetAddressResponse(FImmutablePassportResult Result); - - UPROPERTY(BlueprintAssignable) - FPassportGetAddressOutputPin GotAddress; - UPROPERTY(BlueprintAssignable) - FPassportGetAddressOutputPin Failed; -}; diff --git a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.h b/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.h deleted file mode 100644 index 9c4b1459..00000000 --- a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxBatchNftTransferAsyncAction.h +++ /dev/null @@ -1,36 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "Immutable/ImmutablePassport.h" -#include "ImtblBlueprintAsyncAction.h" -#include "ImtblPassportImxBatchNftTransferAsyncAction.generated.h" - -/** - * - */ -UCLASS() -class IMMUTABLE_API UImmutablePassportImxBatchNftTransferAsyncAction : public UImtblBlueprintAsyncAction -{ - GENERATED_BODY() - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FPassportImxBatchNftTransferIdOutputPin, FString, ErrorMessageString, const TArray &, TransferIds); - -public: - UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable") - static UImmutablePassportImxBatchNftTransferAsyncAction* ImxBatchNftTransfer(UObject* WorldContextObject, const TArray& NftTransferDetails); - - virtual void Activate() override; - -private: - void DoTransfer(TWeakObjectPtr JSGetConnector); - void OnTransferResponse(FImmutablePassportResult Result); - - TArray NftTransferDetails; - - UPROPERTY(BlueprintAssignable) - FPassportImxBatchNftTransferIdOutputPin Success; - UPROPERTY(BlueprintAssignable) - FPassportImxBatchNftTransferIdOutputPin Failed; -}; diff --git a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxIsRegisteredOffchainAsyncAction.h b/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxIsRegisteredOffchainAsyncAction.h deleted file mode 100644 index 848b1897..00000000 --- a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxIsRegisteredOffchainAsyncAction.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "ImtblBlueprintAsyncAction.h" -#include "ImtblPassportImxIsRegisteredOffchainAsyncAction.generated.h" - -/** - * Blueprint node to check if a passport is registered off-chain - */ -UCLASS() -class IMMUTABLE_API UImtblPassportImxIsRegisteredOffchainAsyncAction : public UImtblBlueprintAsyncAction -{ - GENERATED_BODY() - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCompleteOutputPin, bool, IsRegistered); - -public: - UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable") - static UImtblPassportImxIsRegisteredOffchainAsyncAction* IsRegisteredOffchain(UObject* WorldContextObject); - - virtual void Activate() override; - -private: - void DoImxIsRegisteredOffchain(TWeakObjectPtr JSGetConnector); - void OnImxIsRegisteredOffchainResponse(struct FImmutablePassportResult Result); - - UPROPERTY(BlueprintAssignable) - FOnCompleteOutputPin OnComplete; -}; diff --git a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.h b/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.h deleted file mode 100644 index 8e03fcf4..00000000 --- a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "CoreMinimal.h" -#include "ImtblBlueprintAsyncAction.h" -#include "ImtblPassportImxRegisterOffchainAsyncAction.generated.h" - -/** - * Blueprint node to register passport off-chain - */ -UCLASS() -class IMMUTABLE_API UImtblPassportImxRegisterOffchainAsyncAction : public UImtblBlueprintAsyncAction -{ - GENERATED_BODY() - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOutputPin, FString, TxHash, FString, ErrorMessage); - -public: - UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable") - static UImtblPassportImxRegisterOffchainAsyncAction* RegisterOffchain(UObject* WorldContextObject); - - virtual void Activate() override; - -private: - void DoImxRegisterOffchain(TWeakObjectPtr JSGetConnector); - void OnImxRegisterOffchainResponse(struct FImmutablePassportResult Result); - - UPROPERTY(BlueprintAssignable) - FOutputPin OnSuccess; - UPROPERTY(BlueprintAssignable) - FOutputPin OnFailure; -}; diff --git a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxTransferAsyncAction.h b/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxTransferAsyncAction.h deleted file mode 100644 index 9848de33..00000000 --- a/Source/Immutable/Public/Immutable/Actions/ImtblPassportImxTransferAsyncAction.h +++ /dev/null @@ -1,40 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "Immutable/ImmutablePassport.h" -#include "ImtblBlueprintAsyncAction.h" -#include "ImtblPassportImxTransferAsyncAction.generated.h" - -/** - * - */ -UCLASS() -class IMMUTABLE_API UImmutablePassportImxTransferAsyncAction : public UImtblBlueprintAsyncAction -{ - GENERATED_BODY() - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FPassportImxTransferIdOutputPin, FString, ErrorMessageString, FString, TransferId); - -public: - UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable") - static UImmutablePassportImxTransferAsyncAction* ImxTransfer(UObject* WorldContextObject, const FString& Receiver, const FString& Type, const FString& Amount, const FString& TokenId, const FString& TokenAddress); - - virtual void Activate() override; - -private: - void DoTransfer(TWeakObjectPtr JSGetConnector); - void OnTransferResponse(FImmutablePassportResult Result); - - FString Receiver; - FString Type; - FString Amount; - FString TokenId; - FString TokenAddress; - - UPROPERTY(BlueprintAssignable) - FPassportImxTransferIdOutputPin Success; - UPROPERTY(BlueprintAssignable) - FPassportImxTransferIdOutputPin Failed; -}; diff --git a/Source/Immutable/Public/Immutable/ImmutableDataTypes.h b/Source/Immutable/Public/Immutable/ImmutableDataTypes.h index 2f0d4329..a5c85a3d 100644 --- a/Source/Immutable/Public/Immutable/ImmutableDataTypes.h +++ b/Source/Immutable/Public/Immutable/ImmutableDataTypes.h @@ -220,10 +220,6 @@ struct IMMUTABLE_API FImmutableGetPKCEAuthUrlRequest { GENERATED_BODY() - /** Whether this is a ConnectImx operation (true) or just Login (false) */ - UPROPERTY() - bool isConnectImx = false; - /** Direct login options for authentication */ UPROPERTY() FImmutableDirectLoginOptions directLoginOptions; @@ -261,21 +257,6 @@ struct FImtblAccessListItem TArray storageKeys; }; -USTRUCT(BlueprintType) -struct FNftTransferDetails -{ - GENERATED_BODY() - - UPROPERTY(BlueprintReadWrite) - FString receiver; - - UPROPERTY(BlueprintReadWrite) - FString tokenId; - - UPROPERTY(BlueprintReadWrite) - FString tokenAddress; -}; - USTRUCT(BlueprintType) struct IMMUTABLE_API FZkEvmTransactionReceiptLog { diff --git a/Source/Immutable/Public/Immutable/ImmutableNames.h b/Source/Immutable/Public/Immutable/ImmutableNames.h index 66471b21..74c569a2 100644 --- a/Source/Immutable/Public/Immutable/ImmutableNames.h +++ b/Source/Immutable/Public/Immutable/ImmutableNames.h @@ -19,15 +19,10 @@ namespace ImmutablePassportAction const FString CONNECT_PKCE = TEXT("connectPKCE"); #endif - const FString GetAddress = TEXT("getAddress"); const FString GetEmail = TEXT("getEmail"); const FString GetAccessToken = TEXT("getAccessToken"); const FString GetIdToken = TEXT("getIdToken"); const FString GetLinkedAddresses = TEXT("getLinkedAddresses"); - const FString ImxTransfer = TEXT("imxTransfer"); - const FString ImxBatchNftTransfer = TEXT("imxBatchNftTransfer"); - const FString ImxIsRegisteredOffchain = TEXT("isRegisteredOffchain"); - const FString ImxRegisterOffchain = TEXT("registerOffchain"); const FString TRACK = TEXT("track"); } // namespace ImmutablePassportAction diff --git a/Source/Immutable/Public/Immutable/ImmutablePassport.h b/Source/Immutable/Public/Immutable/ImmutablePassport.h index 9a4dd698..8316c575 100644 --- a/Source/Immutable/Public/Immutable/ImmutablePassport.h +++ b/Source/Immutable/Public/Immutable/ImmutablePassport.h @@ -100,12 +100,10 @@ class IMMUTABLE_API UImmutablePassport : public UObject /** * Logs into Passport using Authorisation Code Flow with Proof Key for Code Exchange (PKCE) * - * @param IsConnectImx If true, player will connect to Immutable X after logging in. - * Else, just perform the login without connecting to Immutable X. * @param ResponseDelegate Callback delegate. * @param DirectLoginOptions Direct login options for authentication (email, google, apple, facebook). */ - void Connect(bool IsConnectImx, const FImtblPassportResponseDelegate& ResponseDelegate, const FImmutableDirectLoginOptions& DirectLoginOptions); + void Connect(const FImtblPassportResponseDelegate& ResponseDelegate, const FImmutableDirectLoginOptions& DirectLoginOptions); #endif /** @@ -195,13 +193,6 @@ class IMMUTABLE_API UImmutablePassport : public UObject */ void GetAccessToken(const FImtblPassportResponseDelegate& ResponseDelegate); - /** - * Gets the wallet address of the logged in user. - * - * @param ResponseDelegate Callback delegate. - */ - void GetAddress(const FImtblPassportResponseDelegate& ResponseDelegate); - /** * Retrieves the email address of the user whose credentials are currently stored. * @@ -216,40 +207,6 @@ class IMMUTABLE_API UImmutablePassport : public UObject */ void GetLinkedAddresses(const FImtblPassportResponseDelegate& ResponseDelegate); - /** - * Create a new imx transfer request. - * @param RequestData The transfer details structure of type - * FImxTransferRequest - * @param ResponseDelegate The response delegate of type - * FImtblPassportResponseDelegate to call on response from JS. - */ - void ImxTransfer(const FImxTransferRequest& RequestData, const FImtblPassportResponseDelegate& ResponseDelegate); - - /** - * Creates a new imx batch nft transfer request with the given transfer - * details. - * @param RequestData The transfer details structure of type - * FImxBatchNftTransferRequest - * @param ResponseDelegate The response delegate of type - * FImtblPassportResponseDelegate to call on response from JS. - */ - void ImxBatchNftTransfer(const FImxBatchNftTransferRequest& RequestData, const FImtblPassportResponseDelegate& ResponseDelegate); - - /** - * - * Checks if the user is registered off-chain. - * @param ResponseDelegate The response delegate of type - * FImtblPassportResponseDelegate to call on response from JS. - */ - void ImxIsRegisteredOffchain(const FImtblPassportResponseDelegate& ResponseDelegate); - - /** - * Register the user to Immutable X if they are not already registered - * @param ResponseDelegate The response delegate of type - * FImtblPassportResponseDelegate to call on response from JS. - */ - void ImxRegisterOffchain(const FImtblPassportResponseDelegate& ResponseDelegate); - /** * Checks if the user's credentials have been stored * @param ResponseDelegate The response delegate of type @@ -497,7 +454,6 @@ class IMMUTABLE_API UImmutablePassport : public UObject IPS_NONE = 0, IPS_CONNECTING = 1 << 0, IPS_CONNECTED = 1 << 1, - IPS_IMX = 1 << 2, // if set player used "connect" instead of "login" IPS_PKCE = 1 << 3, IPS_COMPLETING_PKCE = 1 << 4, IPS_INITIALIZED = 1 << 5, diff --git a/Source/Immutable/Public/Immutable/ImmutableRequests.h b/Source/Immutable/Public/Immutable/ImmutableRequests.h index b9696039..da7befe5 100644 --- a/Source/Immutable/Public/Immutable/ImmutableRequests.h +++ b/Source/Immutable/Public/Immutable/ImmutableRequests.h @@ -20,40 +20,6 @@ struct IMMUTABLE_API FImtblTransactionRequest FString value; }; -USTRUCT(BlueprintType) -struct IMMUTABLE_API FImxTransferRequest -{ - GENERATED_BODY() - - UPROPERTY() - FString receiver; - - UPROPERTY() - FString type; - - UPROPERTY() - FString amount; - - UPROPERTY() - FString tokenId; - - UPROPERTY() - FString tokenAddress; - - FString ToJsonString() const; -}; - -USTRUCT(BlueprintType) -struct IMMUTABLE_API FImxBatchNftTransferRequest -{ - GENERATED_BODY() - - UPROPERTY() - TArray nftTransferDetails; - - FString ToJsonString() const; -}; - USTRUCT(BlueprintType) struct IMMUTABLE_API FZkEvmTransactionReceiptRequest { diff --git a/Source/Immutable/Public/Immutable/ImmutableResponses.h b/Source/Immutable/Public/Immutable/ImmutableResponses.h deleted file mode 100644 index c7bca799..00000000 --- a/Source/Immutable/Public/Immutable/ImmutableResponses.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include "ImmutableResponses.generated.h" - - -USTRUCT() -struct FImxTransferResponse -{ - GENERATED_BODY() - - UPROPERTY() - FString sentSignature; - - UPROPERTY() - FString status; - - UPROPERTY() - float time = 0.0f; - - UPROPERTY() - unsigned transferId = 0; -}; - -USTRUCT() -struct FImxBatchNftTransferResponse -{ - GENERATED_BODY() - - UPROPERTY() - TArray transferIds; -}; - -USTRUCT() -struct FImxRegisterOffchainResponse -{ - GENERATED_BODY() - - UPROPERTY() - FString tx_hash; -};