Skip to content

Commit e8971cc

Browse files
YermekGImmutableJeffrey
authored andcommitted
[DX-3352] feat: experimental orderbook and zkevm api modules (#147)
* feat: added experimental module immutable orderbook * feat: added experimental module immutable zkevm api * feat: updated uplugin with new modules * fix: modified defectively generated code * fix: ignore openapi scheme files during workflow checks
1 parent 0fd0f04 commit e8971cc

File tree

492 files changed

+47143
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

492 files changed

+47143
-1
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@
6969
VALIDATE_CPP: false
7070
VALIDATE_CSHARP: false
7171
VALIDATE_CLANG_FORMAT: false
72-
FILTER_REGEX_EXCLUDE: .*/Web/index.js
72+
FILTER_REGEX_EXCLUDE: '.*\/openapi\.json|.*\/Web\/index\.js'

Immutable.uplugin

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
2525
"Name": "ImmutableEditor",
2626
"Type": "Editor",
2727
"LoadingPhase": "Default"
28+
},
29+
{
30+
"Name": "ImmutableOrderbook",
31+
"Type": "Runtime",
32+
"LoadingPhase": "Default"
33+
},
34+
{
35+
"Name": "ImmutablezkEVMAPI",
36+
"Type": "Runtime",
37+
"LoadingPhase": "Default"
2838
}
2939
],
3040
"Plugins": [
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* TS SDK API
3+
* running ts sdk as an api
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator
9+
* https://github.com/OpenAPITools/openapi-generator
10+
* Do not edit the class manually.
11+
*/
12+
13+
using System;
14+
using System.IO;
15+
using UnrealBuildTool;
16+
17+
public class ImmutableOrderbook : ModuleRules
18+
{
19+
public ImmutableOrderbook(ReadOnlyTargetRules Target) : base(Target)
20+
{
21+
PublicDependencyModuleNames.AddRange(
22+
new string[]
23+
{
24+
"Core",
25+
"HTTP",
26+
"Json",
27+
}
28+
);
29+
PCHUsage = PCHUsageMode.NoPCHs;
30+
}
31+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/**
2+
* TS SDK API
3+
* running ts sdk as an api
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator
9+
* https://github.com/OpenAPITools/openapi-generator
10+
* Do not edit the class manually.
11+
*/
12+
13+
#include "APIAction.h"
14+
15+
#include "ImmutableOrderbookModule.h"
16+
#include "APIHelpers.h"
17+
18+
#include "Templates/SharedPointer.h"
19+
20+
namespace ImmutableOrderbook
21+
{
22+
23+
inline FString ToString(const APIAction::TypeEnum& Value)
24+
{
25+
switch (Value)
26+
{
27+
case APIAction::TypeEnum::Transaction:
28+
return TEXT("TRANSACTION");
29+
case APIAction::TypeEnum::Signable:
30+
return TEXT("SIGNABLE");
31+
}
32+
33+
UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIAction::TypeEnum Value (%d)"), (int)Value);
34+
return TEXT("");
35+
}
36+
37+
FString APIAction::EnumToString(const APIAction::TypeEnum& EnumValue)
38+
{
39+
return ToString(EnumValue);
40+
}
41+
42+
inline bool FromString(const FString& EnumAsString, APIAction::TypeEnum& Value)
43+
{
44+
static TMap<FString, APIAction::TypeEnum> StringToEnum = {
45+
{ TEXT("TRANSACTION"), APIAction::TypeEnum::Transaction },
46+
{ TEXT("SIGNABLE"), APIAction::TypeEnum::Signable }, };
47+
48+
const auto Found = StringToEnum.Find(EnumAsString);
49+
if(Found)
50+
Value = *Found;
51+
52+
return Found != nullptr;
53+
}
54+
55+
bool APIAction::EnumFromString(const FString& EnumAsString, APIAction::TypeEnum& EnumValue)
56+
{
57+
return FromString(EnumAsString, EnumValue);
58+
}
59+
60+
inline void WriteJsonValue(JsonWriter& Writer, const APIAction::TypeEnum& Value)
61+
{
62+
WriteJsonValue(Writer, ToString(Value));
63+
}
64+
65+
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, APIAction::TypeEnum& Value)
66+
{
67+
FString TmpValue;
68+
if (JsonValue->TryGetString(TmpValue))
69+
{
70+
if(FromString(TmpValue, Value))
71+
return true;
72+
}
73+
return false;
74+
}
75+
76+
void APIAction::WriteJson(JsonWriter& Writer) const
77+
{
78+
Writer->WriteObjectStart();
79+
if (PopulatedTransactions.IsSet())
80+
{
81+
Writer->WriteIdentifierPrefix(TEXT("populatedTransactions")); WriteJsonValue(Writer, PopulatedTransactions.GetValue());
82+
}
83+
if (Purpose.IsSet())
84+
{
85+
Writer->WriteIdentifierPrefix(TEXT("purpose")); WriteJsonValue(Writer, Purpose.GetValue());
86+
}
87+
Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type);
88+
if (Message.IsSet())
89+
{
90+
Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message.GetValue());
91+
}
92+
Writer->WriteObjectEnd();
93+
}
94+
95+
bool APIAction::FromJson(const TSharedPtr<FJsonValue>& JsonValue)
96+
{
97+
const TSharedPtr<FJsonObject>* Object;
98+
if (!JsonValue->TryGetObject(Object))
99+
return false;
100+
101+
bool ParseSuccess = true;
102+
103+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("populatedTransactions"), PopulatedTransactions);
104+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("purpose"), Purpose);
105+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type);
106+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message);
107+
108+
return ParseSuccess;
109+
}
110+
111+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* TS SDK API
3+
* running ts sdk as an api
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator
9+
* https://github.com/OpenAPITools/openapi-generator
10+
* Do not edit the class manually.
11+
*/
12+
13+
#include "APIBaseModel.h"
14+
15+
namespace ImmutableOrderbook
16+
{
17+
18+
bool HttpRetryManager::Tick(float DeltaTime)
19+
{
20+
FManager::Update();
21+
return true;
22+
}
23+
24+
HttpRetryParams::HttpRetryParams(const FRetryLimitCountSetting& InRetryLimitCountOverride /*= FRetryLimitCountSetting()*/,
25+
const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride /*= FRetryTimeoutRelativeSecondsSetting()*/,
26+
const FRetryResponseCodes& InRetryResponseCodes /*= FRetryResponseCodes()*/,
27+
const FRetryVerbs& InRetryVerbs /*= FRetryVerbs()*/,
28+
const FRetryDomainsPtr& InRetryDomains /*= FRetryDomainsPtr() */)
29+
: RetryLimitCountOverride(InRetryLimitCountOverride)
30+
, RetryTimeoutRelativeSecondsOverride(InRetryTimeoutRelativeSecondsOverride)
31+
, RetryResponseCodes(InRetryResponseCodes)
32+
, RetryVerbs(InRetryVerbs)
33+
, RetryDomains(InRetryDomains)
34+
{
35+
}
36+
37+
void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode)
38+
{
39+
ResponseCode = InHttpResponseCode;
40+
SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode));
41+
if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout)
42+
{
43+
SetResponseString(TEXT("Request Timeout"));
44+
}
45+
}
46+
47+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* TS SDK API
3+
* running ts sdk as an api
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator
9+
* https://github.com/OpenAPITools/openapi-generator
10+
* Do not edit the class manually.
11+
*/
12+
13+
#include "APIBigNumberish.h"
14+
15+
#include "ImmutableOrderbookModule.h"
16+
#include "APIHelpers.h"
17+
18+
#include "Templates/SharedPointer.h"
19+
20+
namespace ImmutableOrderbook
21+
{
22+
23+
void APIBigNumberish::WriteJson(JsonWriter& Writer) const
24+
{
25+
Writer->WriteObjectStart();
26+
Writer->WriteObjectEnd();
27+
}
28+
29+
bool APIBigNumberish::FromJson(const TSharedPtr<FJsonValue>& JsonValue)
30+
{
31+
const TSharedPtr<FJsonObject>* Object;
32+
if (!JsonValue->TryGetObject(Object))
33+
return false;
34+
35+
bool ParseSuccess = true;
36+
37+
38+
return ParseSuccess;
39+
}
40+
41+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* TS SDK API
3+
* running ts sdk as an api
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator
9+
* https://github.com/OpenAPITools/openapi-generator
10+
* Do not edit the class manually.
11+
*/
12+
13+
#include "APICancelOrders200Response.h"
14+
15+
#include "ImmutableOrderbookModule.h"
16+
#include "APIHelpers.h"
17+
18+
#include "Templates/SharedPointer.h"
19+
20+
namespace ImmutableOrderbook
21+
{
22+
23+
void APICancelOrders200Response::WriteJson(JsonWriter& Writer) const
24+
{
25+
Writer->WriteObjectStart();
26+
if (Result.IsSet())
27+
{
28+
Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result.GetValue());
29+
}
30+
Writer->WriteObjectEnd();
31+
}
32+
33+
bool APICancelOrders200Response::FromJson(const TSharedPtr<FJsonValue>& JsonValue)
34+
{
35+
const TSharedPtr<FJsonObject>* Object;
36+
if (!JsonValue->TryGetObject(Object))
37+
return false;
38+
39+
bool ParseSuccess = true;
40+
41+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result);
42+
43+
return ParseSuccess;
44+
}
45+
46+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* TS SDK API
3+
* running ts sdk as an api
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator
9+
* https://github.com/OpenAPITools/openapi-generator
10+
* Do not edit the class manually.
11+
*/
12+
13+
#include "APICancelOrders200ResponseResult.h"
14+
15+
#include "ImmutableOrderbookModule.h"
16+
#include "APIHelpers.h"
17+
18+
#include "Templates/SharedPointer.h"
19+
20+
namespace ImmutableOrderbook
21+
{
22+
23+
void APICancelOrders200ResponseResult::WriteJson(JsonWriter& Writer) const
24+
{
25+
Writer->WriteObjectStart();
26+
if (FailedCancellations.IsSet())
27+
{
28+
Writer->WriteIdentifierPrefix(TEXT("failed_cancellations")); WriteJsonValue(Writer, FailedCancellations.GetValue());
29+
}
30+
if (PendingCancellations.IsSet())
31+
{
32+
Writer->WriteIdentifierPrefix(TEXT("pending_cancellations")); WriteJsonValue(Writer, PendingCancellations.GetValue());
33+
}
34+
if (SuccessfulCancellations.IsSet())
35+
{
36+
Writer->WriteIdentifierPrefix(TEXT("successful_cancellations")); WriteJsonValue(Writer, SuccessfulCancellations.GetValue());
37+
}
38+
Writer->WriteObjectEnd();
39+
}
40+
41+
bool APICancelOrders200ResponseResult::FromJson(const TSharedPtr<FJsonValue>& JsonValue)
42+
{
43+
const TSharedPtr<FJsonObject>* Object;
44+
if (!JsonValue->TryGetObject(Object))
45+
return false;
46+
47+
bool ParseSuccess = true;
48+
49+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("failed_cancellations"), FailedCancellations);
50+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("pending_cancellations"), PendingCancellations);
51+
ParseSuccess &= TryGetJsonValue(*Object, TEXT("successful_cancellations"), SuccessfulCancellations);
52+
53+
return ParseSuccess;
54+
}
55+
56+
}

0 commit comments

Comments
 (0)