-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
492 changed files
with
47,143 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Source/Experimental/ImmutableOrderbook/ImmutableOrderbook.Build.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* TS SDK API | ||
* running ts sdk as an api | ||
* | ||
* OpenAPI spec version: 1.0.0 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator | ||
* https://github.com/OpenAPITools/openapi-generator | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
using System; | ||
using System.IO; | ||
using UnrealBuildTool; | ||
|
||
public class ImmutableOrderbook : ModuleRules | ||
{ | ||
public ImmutableOrderbook(ReadOnlyTargetRules Target) : base(Target) | ||
{ | ||
PublicDependencyModuleNames.AddRange( | ||
new string[] | ||
{ | ||
"Core", | ||
"HTTP", | ||
"Json", | ||
} | ||
); | ||
PCHUsage = PCHUsageMode.NoPCHs; | ||
} | ||
} |
111 changes: 111 additions & 0 deletions
111
Source/Experimental/ImmutableOrderbook/Private/APIAction.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/** | ||
* TS SDK API | ||
* running ts sdk as an api | ||
* | ||
* OpenAPI spec version: 1.0.0 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator | ||
* https://github.com/OpenAPITools/openapi-generator | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
#include "APIAction.h" | ||
|
||
#include "ImmutableOrderbookModule.h" | ||
#include "APIHelpers.h" | ||
|
||
#include "Templates/SharedPointer.h" | ||
|
||
namespace ImmutableOrderbook | ||
{ | ||
|
||
inline FString ToString(const APIAction::TypeEnum& Value) | ||
{ | ||
switch (Value) | ||
{ | ||
case APIAction::TypeEnum::Transaction: | ||
return TEXT("TRANSACTION"); | ||
case APIAction::TypeEnum::Signable: | ||
return TEXT("SIGNABLE"); | ||
} | ||
|
||
UE_LOG(LogImmutableOrderbook, Error, TEXT("Invalid APIAction::TypeEnum Value (%d)"), (int)Value); | ||
return TEXT(""); | ||
} | ||
|
||
FString APIAction::EnumToString(const APIAction::TypeEnum& EnumValue) | ||
{ | ||
return ToString(EnumValue); | ||
} | ||
|
||
inline bool FromString(const FString& EnumAsString, APIAction::TypeEnum& Value) | ||
{ | ||
static TMap<FString, APIAction::TypeEnum> StringToEnum = { | ||
{ TEXT("TRANSACTION"), APIAction::TypeEnum::Transaction }, | ||
{ TEXT("SIGNABLE"), APIAction::TypeEnum::Signable }, }; | ||
|
||
const auto Found = StringToEnum.Find(EnumAsString); | ||
if(Found) | ||
Value = *Found; | ||
|
||
return Found != nullptr; | ||
} | ||
|
||
bool APIAction::EnumFromString(const FString& EnumAsString, APIAction::TypeEnum& EnumValue) | ||
{ | ||
return FromString(EnumAsString, EnumValue); | ||
} | ||
|
||
inline void WriteJsonValue(JsonWriter& Writer, const APIAction::TypeEnum& Value) | ||
{ | ||
WriteJsonValue(Writer, ToString(Value)); | ||
} | ||
|
||
inline bool TryGetJsonValue(const TSharedPtr<FJsonValue>& JsonValue, APIAction::TypeEnum& Value) | ||
{ | ||
FString TmpValue; | ||
if (JsonValue->TryGetString(TmpValue)) | ||
{ | ||
if(FromString(TmpValue, Value)) | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
void APIAction::WriteJson(JsonWriter& Writer) const | ||
{ | ||
Writer->WriteObjectStart(); | ||
if (PopulatedTransactions.IsSet()) | ||
{ | ||
Writer->WriteIdentifierPrefix(TEXT("populatedTransactions")); WriteJsonValue(Writer, PopulatedTransactions.GetValue()); | ||
} | ||
if (Purpose.IsSet()) | ||
{ | ||
Writer->WriteIdentifierPrefix(TEXT("purpose")); WriteJsonValue(Writer, Purpose.GetValue()); | ||
} | ||
Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type); | ||
if (Message.IsSet()) | ||
{ | ||
Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message.GetValue()); | ||
} | ||
Writer->WriteObjectEnd(); | ||
} | ||
|
||
bool APIAction::FromJson(const TSharedPtr<FJsonValue>& JsonValue) | ||
{ | ||
const TSharedPtr<FJsonObject>* Object; | ||
if (!JsonValue->TryGetObject(Object)) | ||
return false; | ||
|
||
bool ParseSuccess = true; | ||
|
||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("populatedTransactions"), PopulatedTransactions); | ||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("purpose"), Purpose); | ||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("type"), Type); | ||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("message"), Message); | ||
|
||
return ParseSuccess; | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
Source/Experimental/ImmutableOrderbook/Private/APIBaseModel.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* TS SDK API | ||
* running ts sdk as an api | ||
* | ||
* OpenAPI spec version: 1.0.0 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator | ||
* https://github.com/OpenAPITools/openapi-generator | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
#include "APIBaseModel.h" | ||
|
||
namespace ImmutableOrderbook | ||
{ | ||
|
||
bool HttpRetryManager::Tick(float DeltaTime) | ||
{ | ||
FManager::Update(); | ||
return true; | ||
} | ||
|
||
HttpRetryParams::HttpRetryParams(const FRetryLimitCountSetting& InRetryLimitCountOverride /*= FRetryLimitCountSetting()*/, | ||
const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride /*= FRetryTimeoutRelativeSecondsSetting()*/, | ||
const FRetryResponseCodes& InRetryResponseCodes /*= FRetryResponseCodes()*/, | ||
const FRetryVerbs& InRetryVerbs /*= FRetryVerbs()*/, | ||
const FRetryDomainsPtr& InRetryDomains /*= FRetryDomainsPtr() */) | ||
: RetryLimitCountOverride(InRetryLimitCountOverride) | ||
, RetryTimeoutRelativeSecondsOverride(InRetryTimeoutRelativeSecondsOverride) | ||
, RetryResponseCodes(InRetryResponseCodes) | ||
, RetryVerbs(InRetryVerbs) | ||
, RetryDomains(InRetryDomains) | ||
{ | ||
} | ||
|
||
void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) | ||
{ | ||
ResponseCode = InHttpResponseCode; | ||
SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode)); | ||
if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout) | ||
{ | ||
SetResponseString(TEXT("Request Timeout")); | ||
} | ||
} | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
Source/Experimental/ImmutableOrderbook/Private/APIBigNumberish.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* TS SDK API | ||
* running ts sdk as an api | ||
* | ||
* OpenAPI spec version: 1.0.0 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator | ||
* https://github.com/OpenAPITools/openapi-generator | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
#include "APIBigNumberish.h" | ||
|
||
#include "ImmutableOrderbookModule.h" | ||
#include "APIHelpers.h" | ||
|
||
#include "Templates/SharedPointer.h" | ||
|
||
namespace ImmutableOrderbook | ||
{ | ||
|
||
void APIBigNumberish::WriteJson(JsonWriter& Writer) const | ||
{ | ||
Writer->WriteObjectStart(); | ||
Writer->WriteObjectEnd(); | ||
} | ||
|
||
bool APIBigNumberish::FromJson(const TSharedPtr<FJsonValue>& JsonValue) | ||
{ | ||
const TSharedPtr<FJsonObject>* Object; | ||
if (!JsonValue->TryGetObject(Object)) | ||
return false; | ||
|
||
bool ParseSuccess = true; | ||
|
||
|
||
return ParseSuccess; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200Response.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* TS SDK API | ||
* running ts sdk as an api | ||
* | ||
* OpenAPI spec version: 1.0.0 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator | ||
* https://github.com/OpenAPITools/openapi-generator | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
#include "APICancelOrders200Response.h" | ||
|
||
#include "ImmutableOrderbookModule.h" | ||
#include "APIHelpers.h" | ||
|
||
#include "Templates/SharedPointer.h" | ||
|
||
namespace ImmutableOrderbook | ||
{ | ||
|
||
void APICancelOrders200Response::WriteJson(JsonWriter& Writer) const | ||
{ | ||
Writer->WriteObjectStart(); | ||
if (Result.IsSet()) | ||
{ | ||
Writer->WriteIdentifierPrefix(TEXT("result")); WriteJsonValue(Writer, Result.GetValue()); | ||
} | ||
Writer->WriteObjectEnd(); | ||
} | ||
|
||
bool APICancelOrders200Response::FromJson(const TSharedPtr<FJsonValue>& JsonValue) | ||
{ | ||
const TSharedPtr<FJsonObject>* Object; | ||
if (!JsonValue->TryGetObject(Object)) | ||
return false; | ||
|
||
bool ParseSuccess = true; | ||
|
||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("result"), Result); | ||
|
||
return ParseSuccess; | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
Source/Experimental/ImmutableOrderbook/Private/APICancelOrders200ResponseResult.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* TS SDK API | ||
* running ts sdk as an api | ||
* | ||
* OpenAPI spec version: 1.0.0 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator | ||
* https://github.com/OpenAPITools/openapi-generator | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
#include "APICancelOrders200ResponseResult.h" | ||
|
||
#include "ImmutableOrderbookModule.h" | ||
#include "APIHelpers.h" | ||
|
||
#include "Templates/SharedPointer.h" | ||
|
||
namespace ImmutableOrderbook | ||
{ | ||
|
||
void APICancelOrders200ResponseResult::WriteJson(JsonWriter& Writer) const | ||
{ | ||
Writer->WriteObjectStart(); | ||
if (FailedCancellations.IsSet()) | ||
{ | ||
Writer->WriteIdentifierPrefix(TEXT("failed_cancellations")); WriteJsonValue(Writer, FailedCancellations.GetValue()); | ||
} | ||
if (PendingCancellations.IsSet()) | ||
{ | ||
Writer->WriteIdentifierPrefix(TEXT("pending_cancellations")); WriteJsonValue(Writer, PendingCancellations.GetValue()); | ||
} | ||
if (SuccessfulCancellations.IsSet()) | ||
{ | ||
Writer->WriteIdentifierPrefix(TEXT("successful_cancellations")); WriteJsonValue(Writer, SuccessfulCancellations.GetValue()); | ||
} | ||
Writer->WriteObjectEnd(); | ||
} | ||
|
||
bool APICancelOrders200ResponseResult::FromJson(const TSharedPtr<FJsonValue>& JsonValue) | ||
{ | ||
const TSharedPtr<FJsonObject>* Object; | ||
if (!JsonValue->TryGetObject(Object)) | ||
return false; | ||
|
||
bool ParseSuccess = true; | ||
|
||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("failed_cancellations"), FailedCancellations); | ||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("pending_cancellations"), PendingCancellations); | ||
ParseSuccess &= TryGetJsonValue(*Object, TEXT("successful_cancellations"), SuccessfulCancellations); | ||
|
||
return ParseSuccess; | ||
} | ||
|
||
} |
Oops, something went wrong.