Skip to content

Commit

Permalink
fix: exposed data types so they can be accessed via cpp calls externa…
Browse files Browse the repository at this point in the history
…lly (#82)
  • Loading branch information
YermekG authored Apr 24, 2024
1 parent 11e8635 commit f03e62d
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Source/Immutable/Immutable.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
new string[]
{
"Core",
"JsonUtilities",
// ... add other public dependencies that you statically link with here ...
}
);
Expand All @@ -47,7 +48,6 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
"Slate",
"SlateCore",
"Json",
"JsonUtilities",
"UMG",
"Projects",
// ... add private dependencies that you statically link with here ...
Expand Down
2 changes: 1 addition & 1 deletion Source/Immutable/Private/Immutable/ImmutablePassport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "Immutable/Misc/ImtblLogging.h"
#include "Immutable/ImmutableResponses.h"
#include "ImtblJSConnector.h"
#include "Immutable/ImtblJSConnector.h"
#include "JsonObjectConverter.h"
#include "Immutable/ImmutableSaveGame.h"
#include "Kismet/GameplayStatics.h"
Expand Down
18 changes: 18 additions & 0 deletions Source/Immutable/Private/Immutable/ImmutableRequests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
#include "Policies/CondensedJsonPrintPolicy.h"


FString FImxTransferRequest::ToJsonString() const
{
FString OutString;
FJsonObjectWrapper Wrapper;
Wrapper.JsonObject = MakeShared<FJsonObject>();
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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Immutable/Private/Immutable/ImmutableSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "Immutable/Misc/ImtblLogging.h"
#include "ImtblBlui.h"
#include "ImtblBrowserUserWidget.h"
#include "ImtblJSConnector.h"
#include "Immutable/ImtblJSConnector.h"

UImmutableSubsystem::UImmutableSubsystem() { IMTBL_LOG_FUNCSIG }

Expand Down
2 changes: 1 addition & 1 deletion Source/Immutable/Private/Immutable/ImtblBlui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ImtblBlui.h"
#include "Immutable/Assets/ImtblSDKResource.h"
#include "Immutable/Misc/ImtblLogging.h"
#include "ImtblJSConnector.h"
#include "Immutable/ImtblJSConnector.h"
#include <utility>

#if USING_BLUI_CEF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "Components/ScaleBoxSlot.h"
#include "Immutable/Misc/ImtblLogging.h"
#include "ImtblBrowserWidget.h"
#include "ImtblJSConnector.h"
#include "Immutable/ImtblJSConnector.h"

TSharedRef<SWidget> UImtblBrowserUserWidget::RebuildWidget()
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Immutable/Private/Immutable/ImtblBrowserWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ImtblBrowserWidget.h"

#include "Immutable/Misc/ImtblLogging.h"
#include "ImtblJSConnector.h"
#include "Immutable/ImtblJSConnector.h"
#if USING_BUNDLED_CEF
#include "SWebBrowser.h"
#endif
Expand Down
4 changes: 2 additions & 2 deletions Source/Immutable/Private/Immutable/ImtblJSConnector.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Fill out your copyright notice in the Description page of Project Settings.

#include "ImtblJSConnector.h"
#include "Immutable/ImtblJSConnector.h"

#include "Immutable/Misc/ImtblLogging.h"
#include "ImtblBrowserWidget.h"
#include "ImtblJSMessages.h"
#include "Immutable/ImtblJSMessages.h"

UImtblJSConnector::UImtblJSConnector() { IMTBL_LOG_FUNCSIG }

Expand Down
6 changes: 3 additions & 3 deletions Source/Immutable/Public/Immutable/ImmutableDataTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct FImmutableEngineVersionData
};

USTRUCT()
struct FImmutablePassportInitData
struct IMMUTABLE_API FImmutablePassportInitData
{
GENERATED_BODY()

Expand Down Expand Up @@ -104,7 +104,7 @@ struct FImmutablePassportZkEvmRequestAccountsData
};

USTRUCT()
struct FImmutablePassportZkEvmGetBalanceData
struct IMMUTABLE_API FImmutablePassportZkEvmGetBalanceData
{
GENERATED_BODY()

Expand Down Expand Up @@ -145,7 +145,7 @@ struct FImmutablePassportConnectPKCEData
};

USTRUCT()
struct FImmutablePassportResult
struct IMMUTABLE_API FImmutablePassportResult
{
GENERATED_BODY()

Expand Down
6 changes: 3 additions & 3 deletions Source/Immutable/Public/Immutable/ImmutableRequests.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


USTRUCT(BlueprintType)
struct FImtblTransactionRequest
struct IMMUTABLE_API FImtblTransactionRequest
{
GENERATED_BODY()

Expand All @@ -20,7 +20,7 @@ struct FImtblTransactionRequest
};

USTRUCT()
struct FImxTransferRequest
struct IMMUTABLE_API FImxTransferRequest
{
GENERATED_BODY()

Expand All @@ -43,7 +43,7 @@ struct FImxTransferRequest
};

USTRUCT()
struct FImxBatchNftTransferRequest
struct IMMUTABLE_API FImxBatchNftTransferRequest
{
GENERATED_BODY()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum class EImtblPassportError : int8
};

USTRUCT()
struct FImtblResponseError
struct IMMUTABLE_API FImtblResponseError
{
GENERATED_BODY()

Expand All @@ -43,7 +43,7 @@ struct FImtblResponseError
};

USTRUCT()
struct FImtblJSRequest
struct IMMUTABLE_API FImtblJSRequest
{
GENERATED_BODY()

Expand Down

0 comments on commit f03e62d

Please sign in to comment.