Skip to content

Commit f03e62d

Browse files
authored
fix: exposed data types so they can be accessed via cpp calls externally (#82)
1 parent 11e8635 commit f03e62d

12 files changed

+34
-16
lines changed

Source/Immutable/Immutable.Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
3434
new string[]
3535
{
3636
"Core",
37+
"JsonUtilities",
3738
// ... add other public dependencies that you statically link with here ...
3839
}
3940
);
@@ -47,7 +48,6 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
4748
"Slate",
4849
"SlateCore",
4950
"Json",
50-
"JsonUtilities",
5151
"UMG",
5252
"Projects",
5353
// ... add private dependencies that you statically link with here ...

Source/Immutable/Private/Immutable/ImmutablePassport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "Immutable/Misc/ImtblLogging.h"
66
#include "Immutable/ImmutableResponses.h"
7-
#include "ImtblJSConnector.h"
7+
#include "Immutable/ImtblJSConnector.h"
88
#include "JsonObjectConverter.h"
99
#include "Immutable/ImmutableSaveGame.h"
1010
#include "Kismet/GameplayStatics.h"

Source/Immutable/Private/Immutable/ImmutableRequests.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@
88
#include "Policies/CondensedJsonPrintPolicy.h"
99

1010

11+
FString FImxTransferRequest::ToJsonString() const
12+
{
13+
FString OutString;
14+
FJsonObjectWrapper Wrapper;
15+
Wrapper.JsonObject = MakeShared<FJsonObject>();
16+
FJsonObjectConverter::UStructToJsonObject(StaticStruct(), this, Wrapper.JsonObject.ToSharedRef(), 0, 0);
17+
18+
if (!Wrapper.JsonObject.IsValid())
19+
{
20+
IMTBL_ERR("Could not convert FImxTransferRequest to JSON")
21+
return "";
22+
}
23+
24+
Wrapper.JsonObjectToString(OutString);
25+
26+
return OutString;
27+
}
28+
1129
FString FImxBatchNftTransferRequest::ToJsonString() const
1230
{
1331
FString OutString;

Source/Immutable/Private/Immutable/ImmutableSubsystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "Immutable/Misc/ImtblLogging.h"
88
#include "ImtblBlui.h"
99
#include "ImtblBrowserUserWidget.h"
10-
#include "ImtblJSConnector.h"
10+
#include "Immutable/ImtblJSConnector.h"
1111

1212
UImmutableSubsystem::UImmutableSubsystem() { IMTBL_LOG_FUNCSIG }
1313

Source/Immutable/Private/Immutable/ImtblBlui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "ImtblBlui.h"
44
#include "Immutable/Assets/ImtblSDKResource.h"
55
#include "Immutable/Misc/ImtblLogging.h"
6-
#include "ImtblJSConnector.h"
6+
#include "Immutable/ImtblJSConnector.h"
77
#include <utility>
88

99
#if USING_BLUI_CEF

Source/Immutable/Private/Immutable/ImtblBrowserUserWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "Components/ScaleBoxSlot.h"
1111
#include "Immutable/Misc/ImtblLogging.h"
1212
#include "ImtblBrowserWidget.h"
13-
#include "ImtblJSConnector.h"
13+
#include "Immutable/ImtblJSConnector.h"
1414

1515
TSharedRef<SWidget> UImtblBrowserUserWidget::RebuildWidget()
1616
{

Source/Immutable/Private/Immutable/ImtblBrowserWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "ImtblBrowserWidget.h"
44

55
#include "Immutable/Misc/ImtblLogging.h"
6-
#include "ImtblJSConnector.h"
6+
#include "Immutable/ImtblJSConnector.h"
77
#if USING_BUNDLED_CEF
88
#include "SWebBrowser.h"
99
#endif

Source/Immutable/Private/Immutable/ImtblJSConnector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Fill out your copyright notice in the Description page of Project Settings.
22

3-
#include "ImtblJSConnector.h"
3+
#include "Immutable/ImtblJSConnector.h"
44

55
#include "Immutable/Misc/ImtblLogging.h"
66
#include "ImtblBrowserWidget.h"
7-
#include "ImtblJSMessages.h"
7+
#include "Immutable/ImtblJSMessages.h"
88

99
UImtblJSConnector::UImtblJSConnector() { IMTBL_LOG_FUNCSIG }
1010

Source/Immutable/Public/Immutable/ImmutableDataTypes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct FImmutableEngineVersionData
3333
};
3434

3535
USTRUCT()
36-
struct FImmutablePassportInitData
36+
struct IMMUTABLE_API FImmutablePassportInitData
3737
{
3838
GENERATED_BODY()
3939

@@ -104,7 +104,7 @@ struct FImmutablePassportZkEvmRequestAccountsData
104104
};
105105

106106
USTRUCT()
107-
struct FImmutablePassportZkEvmGetBalanceData
107+
struct IMMUTABLE_API FImmutablePassportZkEvmGetBalanceData
108108
{
109109
GENERATED_BODY()
110110

@@ -145,7 +145,7 @@ struct FImmutablePassportConnectPKCEData
145145
};
146146

147147
USTRUCT()
148-
struct FImmutablePassportResult
148+
struct IMMUTABLE_API FImmutablePassportResult
149149
{
150150
GENERATED_BODY()
151151

Source/Immutable/Public/Immutable/ImmutableRequests.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
USTRUCT(BlueprintType)
8-
struct FImtblTransactionRequest
8+
struct IMMUTABLE_API FImtblTransactionRequest
99
{
1010
GENERATED_BODY()
1111

@@ -20,7 +20,7 @@ struct FImtblTransactionRequest
2020
};
2121

2222
USTRUCT()
23-
struct FImxTransferRequest
23+
struct IMMUTABLE_API FImxTransferRequest
2424
{
2525
GENERATED_BODY()
2626

@@ -43,7 +43,7 @@ struct FImxTransferRequest
4343
};
4444

4545
USTRUCT()
46-
struct FImxBatchNftTransferRequest
46+
struct IMMUTABLE_API FImxBatchNftTransferRequest
4747
{
4848
GENERATED_BODY()
4949

Source/Immutable/Private/Immutable/ImtblJSMessages.h renamed to Source/Immutable/Public/Immutable/ImtblJSMessages.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ enum class EImtblPassportError : int8
2525
};
2626

2727
USTRUCT()
28-
struct FImtblResponseError
28+
struct IMMUTABLE_API FImtblResponseError
2929
{
3030
GENERATED_BODY()
3131

@@ -43,7 +43,7 @@ struct FImtblResponseError
4343
};
4444

4545
USTRUCT()
46-
struct FImtblJSRequest
46+
struct IMMUTABLE_API FImtblJSRequest
4747
{
4848
GENERATED_BODY()
4949

0 commit comments

Comments
 (0)